semiotic 3.12.0 → 3.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) hide show
  1. package/README.md +50 -46
  2. package/ai/artifact-surface-inventory.json +1 -1
  3. package/ai/behaviorContracts.cjs +1 -1
  4. package/ai/dist/diagnose-operation.js +3 -3
  5. package/ai/dist/mcp-server.js +1 -1
  6. package/ai/reference.md +15 -3
  7. package/ai/schema.json +908 -96
  8. package/ai/surface-manifest.json +1 -1
  9. package/ai/task-packets/compare-category-totals.json +5 -5
  10. package/ai/task-packets/compare-category-totals.md +2 -2
  11. package/ai/task-packets/correct-published-chart.json +5 -5
  12. package/ai/task-packets/correct-published-chart.md +2 -2
  13. package/ai/task-packets/index.json +6 -6
  14. package/ai/task-packets/update-live-chart.json +5 -5
  15. package/ai/task-packets/update-live-chart.md +2 -2
  16. package/dist/c-27DCB5T6.min.js +7 -7
  17. package/dist/c-2CKIGFD2.min.js +1 -1
  18. package/dist/c-3FATLOH4.min.js +1 -0
  19. package/dist/{c-STVM6CBI.min.js → c-4SCJKAWZ.min.js} +200 -200
  20. package/dist/c-5FUOKMH6.min.js +7 -0
  21. package/dist/c-AAIPWVQ5.min.js +6 -6
  22. package/dist/{c-2RG4WOVX.min.js → c-ALLF3Y77.min.js} +1 -1
  23. package/dist/{c-QMKQVCCZ.min.js → c-C5GXUHUO.min.js} +6 -6
  24. package/dist/c-C67QDKTU.min.js +34 -0
  25. package/dist/c-F76M77YC.min.js +1 -0
  26. package/dist/c-FEVXPKQH.min.js +1 -1
  27. package/dist/c-G42WVQO2.min.js +1 -0
  28. package/dist/c-G5A3YWTN.min.js +66 -0
  29. package/dist/c-H4HVKBU3.min.js +1 -0
  30. package/dist/c-HU3ASFKT.min.js +1 -0
  31. package/dist/c-I4FYCVJB.min.js +391 -0
  32. package/dist/{c-5L7JGWQW.min.js → c-IATPZOL7.min.js} +28 -28
  33. package/dist/c-IE5EBBP6.min.js +110 -0
  34. package/dist/c-IGONIKZL.min.js +1 -0
  35. package/dist/c-IKPM53JH.min.js +1 -0
  36. package/dist/c-IU4QZ7Y5.min.js +1 -1
  37. package/dist/{c-2ACLVPKF.min.js → c-K5VE57OI.min.js} +1 -1
  38. package/dist/c-KWJIBJ4R.min.js +1 -0
  39. package/dist/c-LIMFU6RD.min.js +1 -0
  40. package/dist/c-M4T43G76.min.js +1 -0
  41. package/dist/c-M7QUZZCE.min.js +1 -1
  42. package/dist/c-NVSINXE5.min.js +1 -0
  43. package/dist/{c-FAF6EV4E.min.js → c-NWRYV6ZF.min.js} +1 -1
  44. package/dist/c-O5GU2R5W.min.js +1 -0
  45. package/dist/c-OC7GNXGZ.min.js +1 -0
  46. package/dist/c-OV5F3DQP.min.js +1 -0
  47. package/dist/{c-5TAXHW7I.min.js → c-PJ5CAYAW.min.js} +1 -1
  48. package/dist/c-Q5LZRQGD.min.js +1 -0
  49. package/dist/c-QP3PXK3N.min.js +1 -0
  50. package/dist/c-SGZ7ZD2I.min.js +51 -0
  51. package/dist/c-SSKV5JPW.min.js +1 -1
  52. package/dist/c-THWTHWXU.min.js +37 -0
  53. package/dist/c-TRMNDRC4.min.js +41 -0
  54. package/dist/c-UP656CST.min.js +1 -1
  55. package/dist/c-USYOK5OX.min.js +1 -0
  56. package/dist/c-VI753KBO.min.js +1 -0
  57. package/dist/{c-TT4CTEBR.min.js → c-VLAAAFST.min.js} +1 -1
  58. package/dist/c-VSOQPII4.min.js +5 -5
  59. package/dist/c-WGDM4ZRP.min.js +26 -0
  60. package/dist/c-XCV7VUU3.min.js +87 -0
  61. package/dist/c-XGDZPYBI.min.js +1 -0
  62. package/dist/c-XI6CLZII.min.js +1 -0
  63. package/dist/{c-L4Q2YMXO.min.js → c-XLC7PKM7.min.js} +1 -1
  64. package/dist/{c-3YAGKCPU.min.js → c-YEB6Z35F.min.js} +1 -1
  65. package/dist/c-YWZBFG63.min.js +1 -0
  66. package/dist/c-ZMYO3NZU.min.js +2 -0
  67. package/dist/c-ZO36H5VH.min.js +48 -0
  68. package/dist/components/LinkedCharts.d.ts +6 -1
  69. package/dist/components/Tooltip/Tooltip.d.ts +11 -1
  70. package/dist/components/Tooltip/tooltipChrome.d.ts +8 -2
  71. package/dist/components/bundling/semioticVite.d.ts +24 -0
  72. package/dist/components/charts/physics/cruciblePhysics.d.ts +2 -2
  73. package/dist/components/charts/physics/gauntletPhysics.d.ts +2 -6
  74. package/dist/components/charts/physics/physicsHocUtils.d.ts +8 -1
  75. package/dist/components/charts/realtime/RealtimeHistogram.d.ts +2 -0
  76. package/dist/components/charts/shared/chartSize.d.ts +58 -0
  77. package/dist/components/charts/shared/chartSizeDefaults.d.ts +189 -0
  78. package/dist/components/charts/shared/chartSizeDefaultsAtlas.d.ts +9 -0
  79. package/dist/components/charts/shared/chartSizeDefaultsNetwork.d.ts +29 -0
  80. package/dist/components/charts/shared/chartSizeDefaultsOrdinal.d.ts +13 -0
  81. package/dist/components/charts/shared/chartSizeDefaultsPhysics.d.ts +41 -0
  82. package/dist/components/charts/shared/chartSizeDefaultsValue.d.ts +19 -0
  83. package/dist/components/charts/shared/chartSizeDefaultsXY.d.ts +10 -0
  84. package/dist/components/charts/shared/networkPerspectiveWireSchema.d.ts +3 -0
  85. package/dist/components/charts/shared/useChartSetup.d.ts +3 -0
  86. package/dist/components/charts/shared/useCustomChartSetup.d.ts +4 -0
  87. package/dist/components/charts/shared/useNetworkChartSetup.d.ts +2 -0
  88. package/dist/components/charts/shared/withChartWrapper.d.ts +6 -2
  89. package/dist/components/charts/value/BigNumber.d.ts +0 -8
  90. package/dist/components/charts/xy/minimapLayout.d.ts +10 -0
  91. package/dist/components/realtime/BinAccumulator.d.ts +5 -2
  92. package/dist/components/recipes/atlas/dependencyForestChartProps.d.ts +4 -4
  93. package/dist/components/recipes/atlas/flowCircuitChartProps.d.ts +177 -1
  94. package/dist/components/recipes/atlas/flowCircuitLayout.d.ts +3 -0
  95. package/dist/components/recipes/atlas/motifBraidChartProps.d.ts +2 -0
  96. package/dist/components/recipes/atlas/resolution/BoundaryLoomChart.d.ts +3 -0
  97. package/dist/components/recipes/atlas/resolution/ComponentCutaway.d.ts +16 -0
  98. package/dist/components/recipes/atlas/resolution/ResolutionAtlasChart.d.ts +3 -0
  99. package/dist/components/recipes/atlas/resolution/ResolutionGlyphs.d.ts +15 -0
  100. package/dist/components/recipes/atlas/resolution/ResolutionReader.d.ts +5 -0
  101. package/dist/components/recipes/atlas/resolution/appearance.d.ts +58 -0
  102. package/dist/components/recipes/atlas/resolution/boundaryLoomLayout.d.ts +4 -0
  103. package/dist/components/recipes/atlas/resolution/chartProps.d.ts +75 -0
  104. package/dist/components/recipes/atlas/resolution/componentCutawayLayout.d.ts +12 -0
  105. package/dist/components/recipes/atlas/resolution/cutawayContext.d.ts +23 -0
  106. package/dist/components/recipes/atlas/resolution/cutawayGraph.d.ts +4 -0
  107. package/dist/components/recipes/atlas/resolution/cycles.d.ts +7 -0
  108. package/dist/components/recipes/atlas/resolution/evidence.d.ts +43 -0
  109. package/dist/components/recipes/atlas/resolution/glyphs.d.ts +40 -0
  110. package/dist/components/recipes/atlas/resolution/identity.d.ts +4 -0
  111. package/dist/components/recipes/atlas/resolution/indexGraph.d.ts +32 -0
  112. package/dist/components/recipes/atlas/resolution/ownership.d.ts +25 -0
  113. package/dist/components/recipes/atlas/resolution/plan.d.ts +12 -0
  114. package/dist/components/recipes/atlas/resolution/ports.d.ts +44 -0
  115. package/dist/components/recipes/atlas/resolution/prepare.d.ts +4 -0
  116. package/dist/components/recipes/atlas/resolution/project.d.ts +70 -0
  117. package/dist/components/recipes/atlas/resolution/queries.d.ts +23 -0
  118. package/dist/components/recipes/atlas/resolution/resolutionAtlasLayout.d.ts +9 -0
  119. package/dist/components/recipes/atlas/resolution/rules.d.ts +14 -0
  120. package/dist/components/recipes/atlas/resolution/scene.d.ts +52 -0
  121. package/dist/components/recipes/atlas/resolution/selection.d.ts +3 -0
  122. package/dist/components/recipes/atlas/resolution/sets.d.ts +10 -0
  123. package/dist/components/recipes/atlas/resolution/types.d.ts +401 -0
  124. package/dist/components/recipes/atlas/resolution/validate.d.ts +4 -0
  125. package/dist/components/recipes/atlas/resolution/witnesses.d.ts +18 -0
  126. package/dist/components/recipes/atlas/resolution/worker.d.ts +34 -0
  127. package/dist/components/recipes/lineageDag.d.ts +4 -0
  128. package/dist/components/recipes/recipeUtils.d.ts +2 -0
  129. package/dist/components/recipes/transitDiagram.d.ts +2 -61
  130. package/dist/components/recipes/transitDiagramTypes.d.ts +65 -0
  131. package/dist/components/semiotic-ai.d.ts +2 -0
  132. package/dist/components/semiotic-experimental-network-resolution-react.d.ts +12 -0
  133. package/dist/components/semiotic-experimental-network-resolution.d.ts +13 -0
  134. package/dist/components/semiotic-geo.d.ts +1 -1
  135. package/dist/components/semiotic-network-perspective-core.d.ts +6 -0
  136. package/dist/components/semiotic-network.d.ts +1 -1
  137. package/dist/components/semiotic-ordinal.d.ts +1 -1
  138. package/dist/components/semiotic-physics.d.ts +1 -1
  139. package/dist/components/semiotic-realtime-core.d.ts +1 -1
  140. package/dist/components/semiotic-realtime-react.d.ts +2 -0
  141. package/dist/components/semiotic-utils-core.d.ts +3 -1
  142. package/dist/components/semiotic-vite.d.ts +2 -0
  143. package/dist/components/semiotic-xy.d.ts +3 -1
  144. package/dist/components/semiotic.d.ts +3 -1
  145. package/dist/components/server/renderToStaticSVG.d.ts +2 -1
  146. package/dist/components/server/serverChartConfigShared.d.ts +2 -0
  147. package/dist/components/store/LinkedCrosshairStore.d.ts +43 -11
  148. package/dist/components/store/themeCore.d.ts +2 -0
  149. package/dist/components/stream/frameKeyboardNavigation.d.ts +3 -1
  150. package/dist/components/stream/hoverUtils.d.ts +5 -0
  151. package/dist/components/stream/networkCustomLayout.d.ts +3 -0
  152. package/dist/components/stream/networkPerspective.d.ts +2 -0
  153. package/dist/components/stream/networkPerspectiveFit.d.ts +12 -1
  154. package/dist/components/stream/networkPerspectiveSolid.d.ts +1 -1
  155. package/dist/components/stream/networkSceneTypes.d.ts +4 -0
  156. package/dist/components/stream/networkTypes.d.ts +2 -0
  157. package/dist/components/stream/pipelineConfig.d.ts +2 -0
  158. package/dist/components/stream/pipelineDomainResolution.d.ts +4 -1
  159. package/dist/components/stream/types.d.ts +2 -0
  160. package/dist/components/stream/useFrame.d.ts +2 -0
  161. package/dist/components/stream/xySceneBuilders/types.d.ts +2 -0
  162. package/dist/controls.module.min.js +31 -31
  163. package/dist/geo.min.js +150 -150
  164. package/dist/geo.module.min.js +31 -31
  165. package/dist/network.module.min.js +1 -1
  166. package/dist/ordinal.module.min.js +1 -1
  167. package/dist/physics.module.min.js +1 -1
  168. package/dist/rough.module.min.js +1 -1
  169. package/dist/semiotic-ai-core.min.js +1 -1
  170. package/dist/semiotic-ai-core.module.min.js +1 -1
  171. package/dist/semiotic-ai.d.ts +2 -0
  172. package/dist/semiotic-ai.module.min.js +13 -13
  173. package/dist/semiotic-artifact-react.module.min.js +4 -4
  174. package/dist/semiotic-artifact.min.js +1 -1
  175. package/dist/semiotic-artifact.module.min.js +1 -1
  176. package/dist/semiotic-atlas-selection.module.min.js +1 -1
  177. package/dist/semiotic-atlas.module.min.js +10 -12
  178. package/dist/semiotic-client-cjs-shared.min.js +1078 -925
  179. package/dist/semiotic-client-glyph.module.min.js +2 -2
  180. package/dist/semiotic-client-shared.module.min.js +1 -1
  181. package/dist/semiotic-experimental-auxiliary.module.min.js +8 -9
  182. package/dist/semiotic-experimental-network-resolution-react.d.ts +12 -0
  183. package/dist/semiotic-experimental-network-resolution-react.min.js +2 -0
  184. package/dist/semiotic-experimental-network-resolution-react.module.min.js +89 -0
  185. package/dist/semiotic-experimental-network-resolution.d.ts +13 -0
  186. package/dist/semiotic-experimental-network-resolution.min.js +2 -0
  187. package/dist/semiotic-experimental-network-resolution.module.min.js +2 -0
  188. package/dist/semiotic-experimental-node-auxiliary.module.min.js +9 -10
  189. package/dist/semiotic-geo.d.ts +1 -1
  190. package/dist/semiotic-line.module.min.js +1 -1
  191. package/dist/semiotic-network-perspective-core.d.ts +6 -0
  192. package/dist/semiotic-network-perspective-core.min.js +1 -0
  193. package/dist/semiotic-network-perspective-core.module.min.js +1 -0
  194. package/dist/semiotic-network-perspective.module.min.js +1 -1
  195. package/dist/semiotic-network-placement.min.js +4 -0
  196. package/dist/semiotic-network-placement.module.min.js +4 -0
  197. package/dist/semiotic-network-zoom.module.min.js +1 -1
  198. package/dist/semiotic-network.d.ts +1 -1
  199. package/dist/semiotic-ordinal.d.ts +1 -1
  200. package/dist/semiotic-physics.d.ts +1 -1
  201. package/dist/semiotic-realtime-core.d.ts +1 -1
  202. package/dist/semiotic-realtime-core.module.min.js +1 -1
  203. package/dist/semiotic-realtime-react.d.ts +2 -0
  204. package/dist/semiotic-realtime-react.module.min.js +1 -1
  205. package/dist/semiotic-recipes-core-cjs-base.min.js +101 -106
  206. package/dist/semiotic-recipes-core.module.min.js +75 -76
  207. package/dist/semiotic-server-edge-node.module.min.js +391 -392
  208. package/dist/semiotic-server-edge.min.js +387 -388
  209. package/dist/semiotic-server-edge.module.min.js +371 -371
  210. package/dist/semiotic-server-node.min.js +387 -388
  211. package/dist/semiotic-server-node.module.min.js +1 -1
  212. package/dist/semiotic-utils-core.d.ts +3 -1
  213. package/dist/semiotic-utils-core.min.js +12 -11
  214. package/dist/semiotic-utils-core.module.min.js +12 -11
  215. package/dist/semiotic-value.module.min.js +4 -4
  216. package/dist/semiotic-vite.d.ts +2 -0
  217. package/dist/semiotic-vite.min.js +1 -0
  218. package/dist/semiotic-vite.module.min.js +1 -0
  219. package/dist/semiotic-xy.d.ts +3 -1
  220. package/dist/semiotic.d.ts +3 -1
  221. package/dist/semiotic.module.min.js +12 -12
  222. package/dist/server.min.js +387 -388
  223. package/dist/server.module.min.js +1 -1
  224. package/dist/xy.module.min.js +1 -1
  225. package/package.json +42 -13
  226. package/dist/c-2AB65V3L.min.js +0 -1
  227. package/dist/c-2U5JMOPN.min.js +0 -88
  228. package/dist/c-3DCTIRW4.min.js +0 -1
  229. package/dist/c-3OKFRTYM.min.js +0 -1
  230. package/dist/c-3VZHOPFW.min.js +0 -1
  231. package/dist/c-4ZSQIBC7.min.js +0 -1
  232. package/dist/c-5M4RUS7V.min.js +0 -34
  233. package/dist/c-6O5WWP7F.min.js +0 -1
  234. package/dist/c-73TOIYIW.min.js +0 -48
  235. package/dist/c-AE4M7BWH.min.js +0 -1
  236. package/dist/c-AEIK2NFW.min.js +0 -30
  237. package/dist/c-AFQSEIZ4.min.js +0 -4
  238. package/dist/c-BBX7DVVB.min.js +0 -51
  239. package/dist/c-CNYFCSG4.min.js +0 -5
  240. package/dist/c-E6QH2WYE.min.js +0 -1
  241. package/dist/c-GOMQWQJR.min.js +0 -1
  242. package/dist/c-GTYG4PDT.min.js +0 -1
  243. package/dist/c-H23GIKTK.min.js +0 -1
  244. package/dist/c-HQLUUSRJ.min.js +0 -1
  245. package/dist/c-HXUOFDSD.min.js +0 -64
  246. package/dist/c-L3LKYOLK.min.js +0 -1
  247. package/dist/c-MIKDFGKH.min.js +0 -1
  248. package/dist/c-OYSPTIAG.min.js +0 -1
  249. package/dist/c-PWPJNYQP.min.js +0 -1
  250. package/dist/c-QZ5SWKHC.min.js +0 -392
  251. package/dist/c-RXJH4IRX.min.js +0 -41
  252. package/dist/c-SN2D6QMH.min.js +0 -1
  253. package/dist/c-U5YGK6HL.min.js +0 -1
  254. package/dist/c-VIN5ASK2.min.js +0 -37
  255. package/dist/c-XZ3GASUJ.min.js +0 -1
  256. package/dist/c-ZLZZTH4I.min.js +0 -118
@@ -0,0 +1,110 @@
1
+ function e(t){if(Array.isArray(t))return t.length>0&&t.every(e);if(!Ei.isValidElement(t))return!1;if(t.type===Ei.Fragment){let o=Ei.Children.toArray(t.props.children);return o.length>0&&o.every(e)}return"string"==typeof t.type&&ji.has(t.type)}function t(t,o,i){if(!e(t))return null;if(!Ei.isValidElement(t)||t.type===Ei.Fragment)/* */
2
+ return Wi("g",{className:"semiotic-radial-center-content",transform:`translate(${o},${i})`,pointerEvents:"none",children:t});let r=t,a="text"===r.type?Ei.cloneElement(r,{x:r.props.x??0,y:r.props.y??0,textAnchor:r.props.textAnchor??"middle",dominantBaseline:r.props.dominantBaseline??"middle"}):r;/* */
3
+ return Wi("g",{className:"semiotic-radial-center-content",transform:`translate(${o},${i})`,pointerEvents:"none",children:a})}function o({content:e,centerX:o,centerY:i,width:r,height:a}){let n=t(e,o,i);return n?/* @__PURE__ */Wi("svg",{width:r,height:a,style:{position:"absolute",left:0,top:0,pointerEvents:"none",overflow:"visible"},children:n}):/* @__PURE__ */Wi("div",{style:{position:"absolute",left:o,top:i,transform:"translate(-50%, -50%)",pointerEvents:"none",textAlign:"center"},children:e})}function i(e,t,o,i,r,a){let n=e.color??"rgba(255,255,255,0.6)",s=e.glowRadius??4,l=!1;for(let c of t){if("connector"===c.type||"violin"===c.type||"boxplot"===c.type)continue;if("wedge"===c.type){let t=c.category;if(!t)continue;let i=0;for(let n of r(t)??[]){let t=o.get(n);null!=t&&(i=Math.max(i,Ue(e,t,a)))}l=Je(c,i,n)||l;continue}if(null==c.datum)continue;let t=i.get(c.datum);if(null==t)continue;let h=o.get(t),u=null==h?0:Ue(e,h,a);l=Je(c,u,n,s)||l}return l}function r(e,t,o){let{scales:i,config:r,getConnector:a,getO:n}=e;if(!a||!i)return[];let s=[],{projection:l}=i,c=/* @__PURE__ */new Map;for(let e of t){if("point"!==e.type&&"rect"!==e.type)continue;let t=e.datum;if(!t)continue;let o,i,r=a(t);r&&("point"===e.type?(o=e.x,i=e.y):(o=e.x+e.w/2,i=e.y+("vertical"===l?0:e.h/2)),c.has(r)||c.set(r,[]),c.get(r).push({x:o,y:i,datum:t,category:n(t)}))}let h=new Map(i.o.domain().map((e,t)=>[e,t])),u=r.connectorStyle,d={stroke:e.config.themeSemantic?.border||e.config.themeSemantic?.secondary||"#999",strokeWidth:1,opacity:.5},m=e=>"function"==typeof u?u(e):u||d,g=(e,t,o)=>{s.push({type:"connector",x1:e.x,y1:e.y,x2:t.x,y2:t.y,style:m(e.datum),datum:e.datum,group:o})};for(let[e,t]of c)if(!(t.length<2)){t.sort((e,t)=>(h.get(e.category)??-1)-(h.get(t.category)??-1));for(let o=0;o<t.length-1;o++)g(t[o],t[o+1],e);"radial"===l&&t.length>=3&&g(t[t.length-1],t[0],e)}return s}function a(e,t,o,i=!1){let r=/* @__PURE__ */new Map;for(let i of e){let e=t(i);if(!Number.isFinite(e))continue;let a=o?o(i):"_default",n=r.get(a);n||(n={total:0,value:0,pieces:[]},r.set(a,n)),n.total+=e,n.pieces.push(i)}let a=0;for(let e of r.values())a+=Math.abs(e.total);for(let e of r.values())e.value=i&&a>0?e.total/a:e.total;return r}function n(e,t,o,i=!1){let r=/* @__PURE__ */new Set;return{steps:e.map(e=>{let n=a(e.pieceData,t,o,i),s=0;for(let[e,t]of n)r.add(e),s+=t.total;return{col:e,groups:n,stepTotal:s}}),keys:[...r]}}function s(e,t,o){let i="function"==typeof e?e(o?t.w:t.h):e;return"number"==typeof i&&Number.isFinite(i)?Math.max(0,i):0}function l(e){let t=e.getSymbol;return t?Pi(t,e.config.symbolMap):null}function c(e,t,o,i,r,a,n){t?e.push({type:"symbol",x:i,y:r,size:Math.PI*a*a,symbolType:t(o),style:n,datum:o}):e.push({type:"point",x:i,y:r,r:a,style:n,datum:o})}function h(e,t){let{scales:o,columns:i,config:r,resolvePieceStyle:a,getR:n}=e,s=[],l=Math.min(t.width,t.height)/2-4,c="donut"===r.chartType?r.innerRadius||60:0,h=-Math.PI/2+(r.startAngle||0)*Math.PI/180,u=null!=r.sweepAngle?r.sweepAngle*Math.PI/180:2*Math.PI,d=null!=r.sweepAngle&&r.sweepAngle<360,m=Object.values(i),g=m.some(e=>{let t=e.pieceData[0];return t&&("number"==typeof t._pct||"number"==typeof t._pctStart||null!=t._roundedEnds)}),p=m.length,f=d&&!g&&p>1&&(r.cornerRadius??0)>0;for(let e=0;e<m.length;e++){let t=m[e],o=t.pieceData[0],i="number"==typeof o?._pctStart?o._pctStart:t.pctStart,d="number"==typeof o?._pct?o._pct:t.pct,g=h+i*u,p=h+(i+d)*u,y=a(t.pieceData[0],t.name),v=0===e,b=e===m.length-1,x={type:"wedge",cx:0,cy:0,innerRadius:c,outerRadius:l,startAngle:g,endAngle:p,...r.cornerRadius&&{cornerRadius:r.cornerRadius},style:y,datum:o?._nonInteractive?null:t.pieceData,accessibleDatum:{...1===t.pieceData.length?t.pieceData[0]:{},category:t.name,value:t.pieceData.reduce((e,t)=>e+n(t),0),percent:100*d,count:t.pieceData.length,...t.pieceData[0]?.__gaugeAccessibleDatum},category:t.name};o?._roundedEnds?x.roundedEnds=o._roundedEnds:f&&(x.roundedEnds={start:v,end:b}),o?._gradientBand&&(x._gradientBand=o._gradientBand),s.push(x)}return s}function u(e,t,o){return{...e[0],...o,category:t,data:e}}function d(e){let t=e.length,o=e[0],i=e[t-1];return{n:t,min:o,q1:Ui(e,.25)??o,median:Ui(e,.5)??(o+i)/2,q3:Ui(e,.75)??i,max:i,mean:e.reduce((e,t)=>e+t,0)/t}}function m(e,t,o,i,r){let a=new Array(r).fill(0);for(let n of e)n<t||n>o||a[Math.min(Math.floor((n-t)/i),r-1)]++;return a}function g(e){let{data:t,chartType:o,projection:i,normalize:r,rExtent:n,extentPadding:s=.05,baselinePadding:l,axisExtent:c,getO:h,getR:u,getStack:d,rawRExtent:m}=e,g=s;if("radial"===i&&("pie"===o||"donut"===o))return[0,1];let p=0,f=0;if("bar"===o||"bar-funnel"===o){let e=/* @__PURE__ */new Map;for(let o of t){let t=h(o);e.has(t)||e.set(t,[]),e.get(t).push(o)}for(let t of e.values()){let e=a(t,u,d,"bar"===o&&r),i=0,n=0;for(let{value:t}of e.values())"bar-funnel"===o?(i=Math.max(i,t),n=Math.min(n,t)):t>=0?i+=t:n+=t;f=Math.max(f,i),p=Math.min(p,n)}}else if("swimlane"===o){let e=/* @__PURE__ */new Map;for(let o of t){let t=h(o),i=Math.abs(u(o));e.set(t,(e.get(t)||0)+i)}for(let t of e.values())t>f&&(f=t)}else if("clusterbar"===o)for(let e of t){let t=u(e);Number.isFinite(t)&&(t>f&&(f=t),t<p&&(p=t))}else{let e=m[0],t=m[1];e!==1/0&&(p=e),t!==-1/0&&(f=t)}n&&(null!=n[0]&&(p=n[0]),null!=n[1]&&(f=n[1]));let y="bar"===o||"clusterbar"===o||"bar-funnel"===o||"swimlane"===o;if(y&&(null!=n?.[0]||null!=n?.[1]||(p>0&&(p=0),f<0&&(f=0))),"bar-funnel"!==o&&"exact"!==c){let e=f-p,t=e>0?e*g:1,i=y&&!l&&0===p,r=y&&!l&&0===f||"swimlane"===o;null==n?.[0]&&!i&&(p-=t),null==n?.[1]&&!r&&(f+=t)}return[p,f]}function p(e){let{data:t,oExtent:o,oScale:i,projection:r,layout:a,dynamicColumnWidth:n,getO:s,getR:l}=e,c=/* @__PURE__ */Object.create(null),h=/* @__PURE__ */new Map;for(let e of t){let t=s(e);h.has(t)||h.set(t,[]),h.get(t).push(e)}let u=0;if("radial"===r)for(let e of t)u+=Math.abs(l(e));let d=null;if(n&&"radial"!==r){d=/* @__PURE__ */new Map;let e=0;for(let t of o){let o,i=h.get(t)||[];o="string"==typeof n?i.reduce((e,t)=>{let o=Number(t[n]);return e+(Number.isFinite(o)?o:0)},0):n(i);let r=Number.isFinite(o)?Math.max(0,o):0;d.set(t,r),e=Math.max(e,r)}let t="horizontal"===r?a.height:a.width,s=i.padding()*i.step()*Math.max(0,o.length-1),l=Math.max(0,t-s);if(e>0){let t=0;for(let o of d.values())t+=o/e;for(let[o,i]of d)d.set(o,i/e/t*l)}}let m=0,g=0;for(let e of o){let t,o,r=h.get(e)||[],a=r.reduce((e,t)=>e+Math.abs(l(t)),0),n=u>0?a/u:0;d?(t=g,o=d.get(e)??i.bandwidth(),g+=o+i.padding()*i.step()):(t=i(e)??0,o=i.bandwidth()),c[e]={name:e,x:t,y:0,width:o,middle:t+o/2,padding:i.padding()*i.step(),pieceData:r,pct:n,pctStart:m},m+=n}return c}function f(e,t){let o="function"==typeof t,i=o?null:t||"category",r=/* @__PURE__ */new Map;for(let a=0;a<e.length;a++){let n=e[a],s=o?t(n):n[i],l=r.get(s);l?l.push(a):r.set(s,[a])}return r}function y(e){let t="preserve",o=/* @__PURE__ */new Set;for(let i of e){let e=hr[i]??ur;"rebuild"===e.retainedData&&(t="rebuild");for(let t of e.invalidations)o.add(t)}return{retainedData:t,invalidations:o}}function v(e){let t=0,o=0;for(let i of e)"point"===i.type&&!1!==i.interactive&&(t++,i.r>o&&(o=i.r));if(t<=500)return{quadtree:null,maxRadius:o};let i=new Array(t),r=0;for(let t of e)"point"===t.type&&!1!==t.interactive&&(i[r++]=t);return{maxRadius:o,quadtree:mr().x(e=>e.x).y(e=>e.y).addAll(i)}}function b(e,{storeRef:t,adapterRef:o,dirtyRef:i,scheduleRender:r,hoverRef:a,setHoverPoint:n}){let s=pr(e=>{o.current?.push(e)},[o]),l=pr(e=>{o.current?.pushMany(e)},[o]),c=pr(()=>{o.current?.clear(),t.current?.clear(),i.current=!0,r()},[o,t,i,r]),h=pr(e=>{o.current?.clearLastData(),o.current?.setReplacementData(e)},[o]);fr(e,()=>({push:s,pushMany:l,replace:h,remove:e=>{o.current?.flush();let s=t.current?.remove(e)??[];if(s.length>0){let e=a.current?.data;a.current&&(Array.isArray(e)?s.some(t=>e.includes(t)):s.some(t=>t===e))&&(a.current=null,n(null)),i.current=!0,r()}return s},update:(e,a)=>{o.current?.flush();let n=t.current?.update(e,a)??[];return n.length>0&&(i.current=!0,r()),n},clear:c,getData:()=>(o.current?.flush(),t.current?.getData()??[]),getScales:()=>t.current?.scales??null,getCustomLayout:()=>t.current?.lastCustomLayoutResult??null,getLayoutFailure:()=>t.current?.lastCustomLayoutFailure??null}),[s,l,h,c,r,o,t,i,a,n])}function x(e,t,o,i=30,r,a=0){let n=null,s=null;if(r){let e=$t(r,t,o,i,a);e&&!1!==e.node.interactive&&(n={node:e.node,datum:e.node.datum,x:e.node.x,y:e.node.y,distance:e.distance})}for(let a of e){let e=null;switch(a.type){case"rect":if(null==a.datum)break;e=w(a,t,o);break;case"point":if(!1===a.interactive||r)break;e=k(a,t,o,i);break;case"symbol":e=A(a,t,o,i);break;case"glyph":e=S(a,t,o,i);break;case"wedge":if(null===a.datum)break;e=R(a,t,o);break;case"boxplot":e=P(a,t,o);break;case"violin":e=C(a,t,o);break;case"connector":e=_(a,t,o,i);break;case"trapezoid":e=M(a,t,o)}e&&(e.node=a,"connector"===a.type?(!s||e.distance<s.distance)&&(s=e):(!n||e.distance<n.distance)&&(n=e))}return n??s??L(e,t,o)}function w(e,t,o){let i=Tt(t,o,e);return i.hit?{datum:e.datum,x:i.cx,y:e.y,distance:0,category:e.group}:null}function k(e,t,o,i=30){let r=t-e.x,a=o-e.y,n=Math.sqrt(r*r+a*a);return n<=Ht(e.r,i)?{datum:e.datum,x:e.x,y:e.y,distance:n}:null}function A(e,t,o,i=30){let r=t-e.x,a=o-e.y,n=Math.sqrt(r*r+a*a);return n<=Ht(Ri(e.size),i)?{datum:e.datum,x:e.x,y:e.y,distance:n}:null}function S(e,t,o,i=30){if(null==e.datum)return null;let r=Ci(e.glyph,e.size),a=e.x+r.centerDx,n=e.y+r.centerDy,s=t-a,l=o-n,c=Math.sqrt(s*s+l*l);return c<=Ht(r.radius,i)?{datum:e.datum,x:a,y:n,distance:c}:null}function R(e,t,o){let i=t-e.cx,r=o-e.cy,a=Math.sqrt(i*i+r*r);if(a<e.innerRadius||a>e.outerRadius)return null;let n=Bt(Math.atan2(r,i)),s=Bt(e.startAngle),l=Bt(e.endAngle);if(!(s<=l?n>=s&&n<=l:n>=s||n<=l))return null;let c=(e.startAngle+e.endAngle)/2,h=(e.innerRadius+e.outerRadius)/2;return{datum:e.datum,x:e.cx+Math.cos(c)*h,y:e.cy+Math.sin(c)*h,distance:0,category:e.category}}function P(e,t,o){let i=e.columnWidth/2;if("vertical"===e.projection){let r=e.x-i,a=e.x+i,n=Math.min(e.minPos,e.maxPos),s=Math.max(e.minPos,e.maxPos);if(t>=r&&t<=a&&o>=n&&o<=s)return{datum:e.datum,x:e.x,y:e.medianPos,distance:0,category:e.category,stats:e.stats}}else{let r=e.y-i,a=e.y+i,n=Math.min(e.minPos,e.maxPos),s=Math.max(e.minPos,e.maxPos);if(t>=n&&t<=s&&o>=r&&o<=a)return{datum:e.datum,x:e.medianPos,y:e.y,distance:0,category:e.category,stats:e.stats}}return null}function C(e,t,o){if(!e.bounds)return null;let{x:i,y:r,width:a,height:n}=e.bounds;return t>=i&&t<=i+a&&o>=r&&o<=r+n?{datum:e.datum,x:i+a/2,y:r+n/2,distance:0,category:e.category,stats:e.stats}:null}function _(e,t,o,i){let r=e.style.strokeWidth??1;if(r<=0||"none"===e.style.stroke)return null;let a=T(t,o,e.x1,e.y1,e.x2,e.y2);return!a||a.distance>Math.max(i,r/2)?null:{datum:e.datum,x:a.x,y:a.y,distance:a.distance,category:e.group}}function L(e,t,o){let i=/* @__PURE__ */new Map;for(let t of e){if("connector"!==t.type)continue;let e=t.group||"_default",o=i.get(e);o?o.push(t):i.set(e,[t])}for(let e of i.values()){let i=e[0];if(e.length<2||!i.style.fill||"none"===i.style.fill)continue;let r=[[i.x1,i.y1],...e.map(e=>[e.x2,e.y2])];if(!B(r,t,o))continue;let a=I(r);return{node:i,datum:i.datum,x:a.x,y:a.y,distance:0,category:i.group}}return null}function M(e,t,o){if(e.points.length<3)return null;let i=H(e.points,t,o),r=B(e.points,t,o),a=e.style.strokeWidth??1,n=!!(e.style.stroke&&"none"!==e.style.stroke&&a>0);if(!r&&(!n||i>a/2))return null;let s=I(e.points);return{datum:e.datum,x:s.x,y:s.y,distance:r?0:i,category:e.category}}function I(e){let t=e.reduce((e,t)=>({x:e.x+t[0],y:e.y+t[1]}),{x:0,y:0});return{x:t.x/e.length,y:t.y/e.length}}function T(e,t,o,i,r,a){let n=r-o,s=a-i,l=n*n+s*s;if(0===l)return null;let c=((e-o)*n+(t-i)*s)/l,h=Math.max(0,Math.min(1,c)),u=o+h*n,d=i+h*s;return{x:u,y:d,distance:Math.hypot(e-u,t-d)}}function H(e,t,o){let i=1/0;for(let r=0;r<e.length;r++){let a=e[r],n=e[(r+1)%e.length],s=T(t,o,a[0],a[1],n[0],n[1]);s&&s.distance<i&&(i=s.distance)}return i}function B(e,t,o){if(H(e,t,o)<=16*Number.EPSILON)return!0;let i=!1;for(let r=0,a=e.length-1;r<e.length;a=r++){let[n,s]=e[r],[l,c]=e[a];s>o!=c>o&&t<(l-n)*(o-s)/(c-s)+n&&(i=!i)}return i}function $(e){let t=e.pointer.clientX-e.canvasRect.left-e.margin.left,o=e.pointer.clientY-e.canvasRect.top-e.margin.top;if(t<0||t>e.width||o<0||o>e.height)return{kind:"outside"};if(0===e.scene.length)return{kind:"miss"};let i="radial"===e.projection,r=x(e.scene,i?t-e.width/2:t,i?o-e.height/2:o,e.hoverRadius,e.pointQuadtree,e.maxPointRadius);return r?{kind:"hit",hit:r}:{kind:"miss"}}function F(e,t){return ii(e.datum||{},e.x,e.y,{...e.stats&&{stats:e.stats},...e.category&&{category:e.category},__oAccessor:"string"==typeof t.oAccessor?t.oAccessor:void 0,__rAccessor:"string"==typeof t.rAccessor?t.rAccessor:void 0,__chartType:t.chartType})}function O(e){let{width:t,height:o,totalWidth:i,totalHeight:r,margin:a,scales:n,showAxes:s,showGrid:l}=e,{rTickValues:c,axisExtent:h}=e,u="radial"===n?.projection,d="horizontal"===n?.projection,m=yr(()=>n&&!u&&l?(c||Ve(n.r,5,h)).map(e=>({value:e,pixel:n.r(e)})):[],[n,u,c,h,l]),g=l&&n&&!u,p=s&&n&&!u;return g||p?/* @__PURE__ */wr("svg",{width:i,height:r,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:/* @__PURE__ */kr("g",{transform:`translate(${a.left},${a.top})`,children:[g&&/* @__PURE__ */wr("g",{className:"ordinal-grid",children:m.map((e,i)=>/* @__PURE__ */wr("line",{x1:d?e.pixel:0,y1:d?0:e.pixel,x2:d?e.pixel:t,y2:d?o:e.pixel,stroke:"var(--semiotic-grid, #e0e0e0)",strokeWidth:1},`grid-${i}`))}),p&&/* @__PURE__ */wr(xr,{children:/* @__PURE__ */kr(xr,d?{children:[
4
+ /* @__PURE__ */wr("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),
5
+ /* @__PURE__ */wr("line",{x1:0,y1:o,x2:t,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1})]}:{children:[
6
+ /* @__PURE__ */wr("line",{x1:0,y1:o,x2:t,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),
7
+ /* @__PURE__ */wr("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1})]})})]})}):null}function D(e){let{width:t,height:o,totalWidth:i,totalHeight:r,margin:a,scales:n,columns:s,showAxes:l,showCategoryTicks:c,oLabel:h,rLabel:u,oFormat:d,rFormat:m,showGrid:g,title:p,description:f,idPrefix:y,legend:v,legendHoverBehavior:b,legendClickBehavior:x,legendHighlightedCategory:w,legendIsolatedCategories:k,legendPosition:A="right",legendLayout:S,foregroundGraphics:R,annotations:P,onAnnotationActivate:C,onObservation:_,chartId:L,chartType:M,autoPlaceAnnotations:I,svgAnnotationRules:T,annotationFrame:H,xAccessor:B,yAccessor:$,annotationData:F,underlayRendered:O,canvasObscuresUnderlay:D=!0,children:E}=e,W=oo({onAnnotationActivate:C,onObservation:_,chartId:L,chartType:M}),j="radial"===n?.projection,N="horizontal"===n?.projection,z=!1!==c,V=!O||D,G=Uo({showAxes:l,projection:j?"radial":N?"horizontal":"vertical",hasCategoryLabel:!!h,hasValueLabel:!!u}),q=Qo(S,G.leftAxis),X=v&&"left"===A&&q>0?q:a.left,Y=yr(()=>{if(!l||!z||!n||j)return[];let e=n.o.bandwidth(),t=n.o.domain().map((t,o)=>({value:t,pixel:s?.[t]?.middle??(n.o(t)??0)+e/2,label:d?d(t,o):t}));if(t.length<=2)return t;let o=e=>N?"string"==typeof e||"number"==typeof e?16:24:"string"==typeof e||"number"==typeof e?6.5*String(e).length:60,i=N?0:6,r=-1/0,a=0;return t.filter(e=>{let t=o(e.label);return!(e.pixel-r<(a+t)/2+i||(r=e.pixel,a=t,0))})},[l,z,n,s,d,j,N]),Q=e.rTickValues,K=e.tickLabelEdgeAlign,Z=e.axisExtent,U=yr(()=>{if(!l&&!g||!n||j)return[];let e=Q||Ve(n.r,5,Z),t=m||Yo(e);return e.map(e=>({value:e,pixel:n.r(e),label:t(e)}))},[l,g,n,m,j,Q,Z]),J=vr(/* @__PURE__ */new Map),ee=vr(P?.length??0),te=P?.length??0;ee.current!==te&&(ee.current=te,J.current=/* @__PURE__ */new Map);let oe=yr(()=>{if(!P||0===P.length)return null;let e=Dt(P),i=mo("ordinal",W),r="horizontal"===n?.projection,a=n?.o?e=>(n.o(e)??0)+n.o.bandwidth()/2:null,s={scales:n?{x:r?n.r:a||n.r,y:r&&a||n.r,time:n.r,value:n.r,o:n.o}:null,timeAxis:"x",xAccessor:B,yAccessor:$,width:t,height:o,data:F,frameType:"ordinal",projection:r?"horizontal":"vertical",stickyPositionCache:J.current},l=I?yo({annotations:e,context:s,..."object"==typeof I?I:{}}):e;return uo(l,i,T,s)},[P,I,T,t,o,n,B,$,F,W]),ie=l||p||f||v||R||oe&&oe.length>0||g||E,re=br(),{titleId:ae,descId:ne,labelledBy:se}=jt(y||L||re);return ie?/* @__PURE__ */kr("svg",{role:"img","aria-labelledby":se,width:i,height:r,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:[
8
+ /* @__PURE__ */wr("title",{id:ae,children:Et(p,"Ordinal Chart")}),
9
+ /* @__PURE__ */wr("desc",{id:ne,children:Wt(p,f,{familyPhrase:"ordinal data visualization",fallback:"Ordinal data visualization"})}),
10
+ /* @__PURE__ */kr("g",{transform:`translate(${a.left},${a.top})`,children:[g&&n&&!j&&V&&/* @__PURE__ */wr("g",{className:"ordinal-grid",children:U.map((e,i)=>/* @__PURE__ */wr("line",{x1:N?e.pixel:0,y1:N?0:e.pixel,x2:N?e.pixel:t,y2:N?o:e.pixel,stroke:"var(--semiotic-grid, #e0e0e0)",strokeWidth:1},`grid-${i}`))}),l&&n&&!j&&(()=>{let e={fontSize:"var(--semiotic-tick-font-size, 12px)"},i={fontSize:"var(--semiotic-axis-label-font-size, 12px)"};/* */
11
+ return wr("g",{className:"ordinal-axes",children:/* @__PURE__ */kr(xr,N?{children:[
12
+ /* @__PURE__ */kr("g",{className:"semiotic-axis semiotic-axis-left","data-orient":"left",children:[V&&/* @__PURE__ */wr("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),Y.map((t,o)=>/* @__PURE__ */kr("g",{transform:`translate(0,${t.pixel})`,children:[
13
+ /* @__PURE__ */wr("line",{x2:-5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),"string"==typeof t.label||"number"==typeof t.label?/* @__PURE__ */wr("text",{x:-8,textAnchor:"end",dominantBaseline:"middle",fill:"var(--semiotic-text-secondary, #666)",fontSize:12,className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label}):/* @__PURE__ */wr("foreignObject",{x:-68,y:-12,width:60,height:24,style:{overflow:"visible"},children:/* @__PURE__ */wr("div",{style:{textAlign:"right",userSelect:"none",...e},children:t.label})})]},`cat-${o}`)),h&&/* @__PURE__ */wr("text",{x:15-X,y:o/2,textAnchor:"middle",fill:"var(--semiotic-text, #333)",transform:`rotate(-90, ${15-X}, ${o/2})`,fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...i},children:h})]}),
14
+ /* @__PURE__ */kr("g",{className:"semiotic-axis semiotic-axis-bottom","data-orient":"bottom",children:[V&&/* @__PURE__ */wr("line",{x1:0,y1:o,x2:t,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),V&&n?.r&&(()=>{let e=n.r(0);return e>1&&e<t-1?/* @__PURE__ */wr("line",{x1:e,y1:0,x2:e,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1,strokeDasharray:"4,4"}):null})(),U.map((t,i)=>{let r=K?0===i?"start":i===U.length-1?"end":"middle":"middle";/* */
15
+ return kr("g",{transform:`translate(${t.pixel},${o})`,children:[
16
+ /* @__PURE__ */wr("line",{y2:5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),
17
+ /* @__PURE__ */wr("text",{y:18,textAnchor:r,fill:"var(--semiotic-text-secondary, #666)",fontSize:12,className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label})]},`val-${i}`)}),u&&/* @__PURE__ */wr("text",{x:t/2,y:o+40,textAnchor:"middle",fill:"var(--semiotic-text, #333)",fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...i},children:u})]})]}:{children:[
18
+ /* @__PURE__ */kr("g",{className:"semiotic-axis semiotic-axis-bottom","data-orient":"bottom",children:[V&&(()=>{let e=n?.r?n.r(0):o,i=e>=0&&e<=o?e:o;/* */
19
+ return wr("line",{x1:0,y1:i,x2:t,y2:i,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1})})(),Y.map((t,i)=>/* @__PURE__ */kr("g",{transform:`translate(${t.pixel},${o})`,children:[
20
+ /* @__PURE__ */wr("line",{y2:5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),"string"==typeof t.label||"number"==typeof t.label?/* @__PURE__ */wr("text",{y:18,textAnchor:"middle",fill:"var(--semiotic-text-secondary, #666)",fontSize:12,className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label}):/* @__PURE__ */wr("foreignObject",{x:-30,y:6,width:60,height:24,style:{overflow:"visible"},children:/* @__PURE__ */wr("div",{style:{textAlign:"center",userSelect:"none",...e},children:t.label})})]},`cat-${i}`)),h&&/* @__PURE__ */wr("text",{x:t/2,y:o+40,textAnchor:"middle",fill:"var(--semiotic-text, #333)",fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...i},children:h})]}),
21
+ /* @__PURE__ */kr("g",{className:"semiotic-axis semiotic-axis-left","data-orient":"left",children:[V&&/* @__PURE__ */wr("line",{x1:0,y1:0,x2:0,y2:o,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),U.map((t,o)=>/* @__PURE__ */kr("g",{transform:`translate(0,${t.pixel})`,children:[
22
+ /* @__PURE__ */wr("line",{x2:-5,stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),
23
+ /* @__PURE__ */wr("text",{x:-8,textAnchor:"end",dominantBaseline:"middle",fill:"var(--semiotic-text-secondary, #666)",fontSize:12,className:"semiotic-axis-tick",style:{userSelect:"none",...e},children:t.label})]},`val-${o}`)),u&&/* @__PURE__ */wr("text",{x:15-X,y:o/2,textAnchor:"middle",fill:"var(--semiotic-text, #333)",transform:`rotate(-90, ${15-X}, ${o/2})`,fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...i},children:u})]})]})})})(),oe,R,E]}),
24
+ /* @__PURE__ */wr(xo,{title:p,totalWidth:i,marginTop:a.top}),Qt({legend:v,totalWidth:i,totalHeight:r,margin:a,legendPosition:A,title:p,legendLayout:S,axisChrome:G,legendHoverBehavior:b,legendClickBehavior:x,legendHighlightedCategory:w,legendIsolatedCategories:k})]}):null}function E(e){let[t,o]=Ar.useState(()=>Rr);return Ar.useEffect(()=>{if(t)return;let e=!1;return(Rr?Promise.resolve(Rr):(Pr||(Pr=import("./c-D7G47WV4.min.js").then(e=>Rr=e.OrdinalBrushOverlay).catch(e=>{throw Pr=null,e})),Pr)).then(t=>{e||o(()=>t)}),()=>{e=!0}},[t]),t?/* @__PURE__ */Sr(t,{...e}):null}function W(e){let{innerRadius:t,outerRadius:o,startAngle:i,endAngle:r}=e,a=t<=0;if(!((e.cornerRadius??0)>0&&(e.roundStart||e.roundEnd))){if(a){let e=_r(o,i),t=_r(o,r),a=r-i>Math.PI?1:0;return`M0,0 L${e.x},${e.y} A${o},${o} 0 ${a} 1 ${t.x},${t.y} Z`}let e=_r(o,i),n=_r(o,r),s=_r(t,r),l=_r(t,i),c=r-i>Math.PI?1:0;return`M${e.x},${e.y} A${o},${o} 0 ${c} 1 ${n.x},${n.y} L${s.x},${s.y} A${t},${t} 0 ${c} 0 ${l.x},${l.y} Z`}let n=o-t,s=Math.max(0,Math.min(e.cornerRadius??0,n/2));if(0===s)return W({...e,cornerRadius:0,roundStart:!1,roundEnd:!1});let l=Math.asin(Math.min(1,s/Math.max(1e-9,o-s))),c=a?0:Math.asin(Math.min(1,s/Math.max(1e-9,t+s))),h=r-i,u=e.roundStart&&e.roundEnd?h/2:h,d=!!e.roundStart&&l<u,m=!!e.roundEnd&&l<u;if(!d&&!m)return W({...e,cornerRadius:0,roundStart:!1,roundEnd:!1});let g=i+(d?l:0),p=r-(m?l:0),f=i+(d?c:0),y=r-(m?c:0),v=_r(o,g),b=_r(o,p),x=(o-s)*Math.cos(l),w=_r(x,i),k=_r(x,r),A=a?null:_r(t,y),S=a?null:_r(t,f),R=a?0:(t+s)*Math.cos(c),P=a?null:_r(R,i),C=a?null:_r(R,r),_=p-g>Math.PI?1:0,L=a?0:y-f>Math.PI?1:0,M="";if(d)M+=`M${w.x},${w.y}`,M+=` A${s},${s} 0 0 1 ${v.x},${v.y}`;else{let e=_r(o,i);M+=`M${e.x},${e.y}`}if(m)M+=` A${o},${o} 0 ${_} 1 ${b.x},${b.y}`,M+=` A${s},${s} 0 0 1 ${k.x},${k.y}`;else{let e=_r(o,r);M+=` A${o},${o} 0 ${_} 1 ${e.x},${e.y}`}if(a)M+=" L0,0";else{if(m)M+=` L${C.x},${C.y}`,M+=` A${s},${s} 0 0 1 ${A.x},${A.y}`;else{let e=_r(t,r);M+=` L${e.x},${e.y}`}if(d)M+=` A${t},${t} 0 ${L} 0 ${S.x},${S.y}`,M+=` A${s},${s} 0 0 1 ${P.x},${P.y}`;else{let e=_r(t,i);M+=` A${t},${t} 0 ${L} 0 ${e.x},${e.y}`}}return M+=" Z",M}function j(e){let t=W({innerRadius:e.innerRadius,outerRadius:e.outerRadius,startAngle:e.startAngle,endAngle:e.endAngle,cornerRadius:e.cornerRadius,roundStart:e.roundStart,roundEnd:e.roundEnd}),o=[],i=e.colors;if(i.length>0){let t=(e.endAngle-e.startAngle)/i.length;for(let r=0;r<i.length;r++){let a=e.startAngle+r*t;o.push({d:W({innerRadius:e.innerRadius,outerRadius:e.outerRadius,startAngle:a,endAngle:e.endAngle}),color:i[r]})}}return{clipPath:t,slices:o}}function N(e,t){let o=t._gradientBand.colors;if(0===o.length)return;let{clipPath:i,slices:r}=j({innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle,endAngle:t.endAngle,cornerRadius:t.cornerRadius,roundStart:t.roundedEnds?.start??!0,roundEnd:t.roundedEnds?.end??!0,colors:o}),a=new Path2D(i);e.save(),e.translate(t.cx,t.cy),e.clip(a);for(let t of r)e.fillStyle=yi(e,t.color)||t.color||"#007bff",e.fill(new Path2D(t.d));e.restore();let n=t.style.strokeWidth??1;t.style.stroke&&"none"!==t.style.stroke&&n>0&&(e.save(),e.translate(t.cx,t.cy),e.strokeStyle=yi(e,t.style.stroke)||t.style.stroke,e.lineWidth=n,e.stroke(a),e.restore())}function z(e,t){e.beginPath(),t.innerRadius>0?(e.arc(t.cx,t.cy,t.outerRadius,t.startAngle,t.endAngle),e.arc(t.cx,t.cy,t.innerRadius,t.endAngle,t.startAngle,!0)):(e.moveTo(t.cx,t.cy),e.arc(t.cx,t.cy,t.outerRadius,t.startAngle,t.endAngle)),e.closePath()}function V(e,t){let o={innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle+Math.PI/2,endAngle:t.endAngle+Math.PI/2},i=Cr().cornerRadius(t.cornerRadius)(o);if(!i)return;e.save(),e.translate(t.cx,t.cy);let r=new Path2D(i);e.fill(r);let a=t.style.strokeWidth??1;t.style.stroke&&"none"!==t.style.stroke&&a>0&&(e.lineWidth=a,e.stroke(r)),e.restore()}function G(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e4?`${(e/1e3).toFixed(0)}K`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function q(e){return Math.abs(e-Math.round(e))<.05?`${Math.round(e)}%`:`${e.toFixed(1)}%`}function X(e,t){let o=`${e}@${typeof window<"u"&&window.devicePixelRatio||1}`,i=Fr.get(o);if(void 0!==i)return i;let r=bi({...$r,background:e},t),a=xi(r)?null:r;return Fr.set(o,a),a}function Y(e,t,o,i,r,a){e.moveTo(t+a,o),e.lineTo(t+i-a,o),e.quadraticCurveTo(t+i,o,t+i,o+a),e.lineTo(t+i,o+r-a),e.quadraticCurveTo(t+i,o+r,t+i-a,o+r),e.lineTo(t+a,o+r),e.quadraticCurveTo(t,o+r,t,o+r-a),e.lineTo(t,o+a),e.quadraticCurveTo(t,o,t+a,o),e.closePath()}function Q(e,t){let[o,i,r]=vi(e,t);return(.2126*o+.7152*i+.0722*r)/255>.6}function K(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e4?`${(e/1e3).toFixed(0)}K`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(Math.round(e))}function Z(e){return Math.abs(e-Math.round(e))<.05?`${Math.round(e)}%`:`${e.toFixed(1)}%`}function U(e){return"rect"===e.type||"point"===e.type||"symbol"===e.type||"glyph"===e.type}function J(e){return(t,o,i,r)=>{e(t,o.filter(U),{x:i.r,y:i.r},r)}}function ee(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e4?`${(e/1e3).toFixed(0)}K`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function te(e,t){let o=e.datum;if(!o)return null;let i=[],r=o.__funnelStepLabel,a=Number(o.__funnelStepLabelX),n=Number(o.__funnelStepLabelY),s=Number(o.__funnelRowWidth);"string"==typeof r&&Number.isFinite(a)&&Number.isFinite(n)&&(!Number.isFinite(s)||8.4*r.length+16<=s)&&i.push(
25
+ /* @__PURE__ */qr("text",{x:a,y:n+3,textAnchor:"middle",dominantBaseline:"hanging",fontSize:14,fontWeight:"bold",fill:"#fff",fontFamily:"var(--semiotic-font-family, sans-serif)",stroke:"rgba(0,0,0,0.6)",strokeWidth:3,paintOrder:"stroke",children:r},`${t}-funnel-step`));let l=Number(o.__funnelValue),c=Number(o.__funnelValueLabelX),h=Number(o.__funnelValueLabelY),u=Number(o.__funnelBarW);if(Number.isFinite(l)&&0!==l&&Number.isFinite(c)&&Number.isFinite(h)&&u>=60){let e=Number(o.__funnelPercent),r=!0!==o.__funnelIsFirstStep&&Number.isFinite(e)?`${ee(l)} (${Math.abs(e-Math.round(e))<.05?Math.round(e):e.toFixed(1)}%)`:ee(l);7.8*r.length+16>u&&(r=ee(l)),7.8*r.length+16<=u&&i.push(
26
+ /* @__PURE__ */qr("text",{x:c,y:h+22,textAnchor:"middle",dominantBaseline:"hanging",fontSize:13,fontWeight:"bold",fill:"#fff",fontFamily:"var(--semiotic-font-family, sans-serif)",stroke:"rgba(0,0,0,0.5)",strokeWidth:3,paintOrder:"stroke",children:r},`${t}-funnel-value`))}return i.length?/* @__PURE__ */qr("g",{children:i},`${t}-funnel-labels`):null}function oe(e,t,o){return Do(ie(e,t,o),e,`ordinal-cursor-${t}`)}function ie(e,t,o){let i=("category"in e?e.category:void 0)||("group"in e?e.group:void 0)||"",r=o=>`ord-${e.type}-${i}-${t}-${o}`,a=`ord-${e.type}-${i}-${t}`;switch(e.type){case"rect":{let t,o,i=e,r=`${Ao(a)}-grad`,n=Co(i,r);if(n)o=`url(#${r})`;else if(xi(i.style.fill)){let e=`${Ao(a)}-hatch`;t=wi(i.style.fill,e),o=`url(#${e})`}else o=ko(i.style.fill);let s=n||t?/* @__PURE__ */Xr("defs",{children:[n,t]}):null;if(i.cornerRadii&&Si(i.cornerRadii)){let e=Xt(i);/* */
27
+ return Xr(Vr.Fragment,{children:[s,
28
+ /* @__PURE__ */qr("path",{d:e,fill:o,opacity:i.style.opacity,stroke:i.style.stroke,strokeWidth:i.style.strokeWidth})]},a)}if(i.roundedTop&&i.roundedTop>0){let e,t=Math.min(i.roundedTop,i.w/2,i.h/2),{x:r,y:n,w:l,h:c}=i;switch(i.roundedEdge){case"right":e=`M${r},${n} L${r+l-t},${n} A${t},${t} 0 0 1 ${r+l},${n+t} L${r+l},${n+c-t} A${t},${t} 0 0 1 ${r+l-t},${n+c} L${r},${n+c} Z`;break;case"left":e=`M${r+l},${n} L${r+t},${n} A${t},${t} 0 0 0 ${r},${n+t} L${r},${n+c-t} A${t},${t} 0 0 0 ${r+t},${n+c} L${r+l},${n+c} Z`;break;case"bottom":e=`M${r},${n} L${r+l},${n} L${r+l},${n+c-t} A${t},${t} 0 0 1 ${r+l-t},${n+c} L${r+t},${n+c} A${t},${t} 0 0 1 ${r},${n+c-t} Z`;break;default:e=`M${r},${n+c} L${r},${n+t} A${t},${t} 0 0 1 ${r+t},${n} L${r+l-t},${n} A${t},${t} 0 0 1 ${r+l},${n+t} L${r+l},${n+c} Z`}/* */
29
+ return Xr(Vr.Fragment,{children:[s,
30
+ /* @__PURE__ */qr("path",{d:e,fill:o,opacity:i.style.opacity,stroke:i.style.stroke,strokeWidth:i.style.strokeWidth})]},a)}/* */
31
+ return Xr(Vr.Fragment,{children:[s,
32
+ /* @__PURE__ */qr("rect",{x:i.x,y:i.y,width:i.w,height:i.h,fill:o,opacity:i.style.opacity,stroke:i.style.stroke,strokeWidth:i.style.strokeWidth}),te(i,a)]},a)}case"point":{let t=e;/* */
33
+ return qr("circle",{cx:t.x,cy:t.y,r:t.r,fill:ko(t.style.fill),opacity:t.style.opacity??t.style.fillOpacity??.8,stroke:t.style.stroke,strokeWidth:t.style.strokeWidth},a)}case"symbol":return Lo(e,t,o);case"glyph":{let i=e;return Ro(i,i.x,i.y,`${o??""}ord-glyph-${i.pointId??t}`)}case"wedge":{let i,r=e;if(r._gradientBand&&r._gradientBand.colors.length>0){let e=Ao(`${o?`${o}-`:""}gauge-grad-${r.category||a}-${t}`),{clipPath:i,slices:n}=j({innerRadius:r.innerRadius,outerRadius:r.outerRadius,startAngle:r.startAngle,endAngle:r.endAngle,cornerRadius:r.cornerRadius,roundStart:r.roundedEnds?.start??!0,roundEnd:r.roundedEnds?.end??!0,colors:r._gradientBand.colors});/* */
34
+ return Xr("g",{transform:`translate(${r.cx},${r.cy})`,opacity:r.style.opacity,fillOpacity:r.style.fillOpacity,children:[
35
+ /* @__PURE__ */qr("defs",{children:/* @__PURE__ */qr("clipPath",{id:e,children:/* @__PURE__ */qr("path",{d:i})})}),
36
+ /* @__PURE__ */qr("g",{clipPath:`url(#${e})`,children:n.map((e,t)=>/* @__PURE__ */qr("path",{d:e.d,fill:ko(e.color)},t))}),r.style.stroke&&"none"!==r.style.stroke&&
37
+ /* @__PURE__ */qr("path",{d:i,fill:"none",stroke:r.style.stroke,strokeWidth:r.style.strokeWidth})]},a)}if(r.roundedEnds)i=W({innerRadius:r.innerRadius,outerRadius:r.outerRadius,startAngle:r.startAngle,endAngle:r.endAngle,cornerRadius:r.cornerRadius,roundStart:r.roundedEnds.start,roundEnd:r.roundedEnds.end});else{let e=Gr().innerRadius(r.innerRadius).outerRadius(r.outerRadius).startAngle(r.startAngle+Math.PI/2).endAngle(r.endAngle+Math.PI/2);r.cornerRadius&&e.cornerRadius(r.cornerRadius),i=e(wo)||""}/* */
38
+ return qr("path",{d:i,transform:`translate(${r.cx},${r.cy})`,fill:ko(r.style.fill),stroke:r.style.stroke,strokeWidth:r.style.strokeWidth,opacity:r.style.opacity},a)}case"boxplot":{let t=e,o=t.columnWidth/2,i=t.style.strokeWidth??1;return"vertical"===t.projection?/* @__PURE__ */Xr("g",{children:[
39
+ /* @__PURE__ */qr("line",{x1:t.x,y1:t.minPos,x2:t.x,y2:t.maxPos,stroke:t.style.stroke||"#333",strokeWidth:i}),
40
+ /* @__PURE__ */qr("rect",{x:t.x-o,y:Math.min(t.q1Pos,t.q3Pos),width:t.columnWidth,height:Math.abs(t.q3Pos-t.q1Pos),fill:ko(t.style.fill),fillOpacity:t.style.fillOpacity??.6,stroke:t.style.stroke||"#333",strokeWidth:i}),
41
+ /* @__PURE__ */qr("line",{x1:t.x-o,y1:t.medianPos,x2:t.x+o,y2:t.medianPos,stroke:t.style.stroke||"#333",strokeWidth:2*i}),
42
+ /* @__PURE__ */qr("line",{x1:t.x-.5*o,y1:t.minPos,x2:t.x+.5*o,y2:t.minPos,stroke:t.style.stroke||"#333",strokeWidth:i}),
43
+ /* @__PURE__ */qr("line",{x1:t.x-.5*o,y1:t.maxPos,x2:t.x+.5*o,y2:t.maxPos,stroke:t.style.stroke||"#333",strokeWidth:i})]},a):/* @__PURE__ */Xr("g",{children:[
44
+ /* @__PURE__ */qr("line",{x1:t.minPos,y1:t.y,x2:t.maxPos,y2:t.y,stroke:t.style.stroke||"#333",strokeWidth:i}),
45
+ /* @__PURE__ */qr("rect",{x:Math.min(t.q1Pos,t.q3Pos),y:t.y-o,width:Math.abs(t.q3Pos-t.q1Pos),height:t.columnWidth,fill:ko(t.style.fill),fillOpacity:t.style.fillOpacity??.6,stroke:t.style.stroke||"#333",strokeWidth:i}),
46
+ /* @__PURE__ */qr("line",{x1:t.medianPos,y1:t.y-o,x2:t.medianPos,y2:t.y+o,stroke:t.style.stroke||"#333",strokeWidth:2*i}),
47
+ /* @__PURE__ */qr("line",{x1:t.minPos,y1:t.y-.5*o,x2:t.minPos,y2:t.y+.5*o,stroke:t.style.stroke||"#333",strokeWidth:i}),
48
+ /* @__PURE__ */qr("line",{x1:t.maxPos,y1:t.y-.5*o,x2:t.maxPos,y2:t.y+.5*o,stroke:t.style.stroke||"#333",strokeWidth:i})]},a)}case"violin":{let t=e,o=[
49
+ /* @__PURE__ */qr("path",{d:t.pathString,transform:t.translateX||t.translateY?`translate(${t.translateX},${t.translateY})`:void 0,fill:ko(t.style.fill),fillOpacity:t.style.fillOpacity??t.style.opacity??.6,stroke:t.style.stroke||"#333",strokeWidth:t.style.strokeWidth??1},r("path"))];if(t.iqrLine&&t.bounds){let e=t.bounds,i=e.x+e.width/2,a=e.y+e.height/2;t.iqrLine.isVertical?o.push(
50
+ /* @__PURE__ */qr("line",{x1:i,y1:t.iqrLine.q1Pos,x2:i,y2:t.iqrLine.q3Pos,stroke:t.style.stroke||"#333",strokeWidth:2},r("iqr")),
51
+ /* @__PURE__ */qr("circle",{cx:i,cy:t.iqrLine.medianPos,r:3,fill:"white",stroke:t.style.stroke||"#333",strokeWidth:1},r("med"))):o.push(
52
+ /* @__PURE__ */qr("line",{x1:t.iqrLine.q1Pos,y1:a,x2:t.iqrLine.q3Pos,y2:a,stroke:t.style.stroke||"#333",strokeWidth:2},r("iqr")),
53
+ /* @__PURE__ */qr("circle",{cx:t.iqrLine.medianPos,cy:a,r:3,fill:"white",stroke:t.style.stroke||"#333",strokeWidth:1},r("med")))}/* */
54
+ return qr("g",{children:o},a)}case"connector":{let t=e,o=t.style.fill&&"none"!==t.style.fill?ko(t.style.fill,"var(--semiotic-border, #999)"):"var(--semiotic-border, #999)";/* */
55
+ return qr("line",{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:t.style.stroke||o,strokeWidth:t.style.strokeWidth??1,opacity:t.style.opacity??.5},a)}case"trapezoid":{let t=e,o=t.points.map(e=>`${e[0]},${e[1]}`).join(" ");/* */
56
+ return qr("polygon",{points:o,fill:ko(t.style.fill,"#999"),opacity:t.style.opacity,stroke:t.style.stroke,strokeWidth:t.style.strokeWidth},a)}default:return null}}function re(e){return"connector"===e.node.type}function ae(e,t,o,i){if(e.length<2)return null;let r=e[0].node,a=r.style.fill;if(!a||"none"===a)return null;let n=Ao(`${t?`${t}-`:""}connector-${o}-${i}-hatch`),s=xi(a)?wi(a,n):null,l=[`${r.x1},${r.y1}`,...e.map(({node:e})=>`${e.x2},${e.y2}`)].join(" "),c=/* @__PURE__ */Qr(zr.Fragment,{children:[s&&/* @__PURE__ */Yr("defs",{children:s}),
57
+ /* @__PURE__ */Yr("polygon",{points:l,fill:s?`url(#${n})`:ko(a,"#999"),opacity:r.style.fillOpacity??r.style.opacity??.3,"data-semiotic-connector-fill":r.group||"_default"})]});return Do(c,r,`ordinal-connector-fill-${o}-${i}`)}function ne(e,t,o){let i=/* @__PURE__ */new Map;for(let t of e){if(!re(t))continue;let e=t.node.group||"_default",o=i.get(e);o?o.push(t):i.set(e,[t])}if(0===i.size)return;let r=Array.from(i.values()).map((e,i)=>/* @__PURE__ */Qr("g",{children:[ae(e,t,o,i),e.map(e=>e.element)]},`ordinal-connectors-${o}-${i}`)),a=e[0],n=re(a)?null:a.element;for(let e of i.values())for(let t of e)t.element=null;a.element=/* @__PURE__ */Qr(zr.Fragment,{children:[r,n]},`ordinal-connector-run-${o}`)}function se(e){let t=yt({nodes:e.nodes,renderMode:e.renderMode,fallback:(t,o)=>oe(t,o,e.idPrefix)}),o=0;for(let i=0;i<t.length;){if(t[i].renderedByBackend){i++;continue}let r=i+1;for(;r<t.length&&!t[r].renderedByBackend;)r++;ne(t.slice(i,r),e.idPrefix,o++),i=r}return t}function le(e){return t=>{let o=t.category||t.data&&t.data[0]?.category||"",i=t.stats||(t.data||t).stats;if(i&&null!=i.median)/* */
58
+ return Zr("div",{className:"semiotic-tooltip",style:Mi,children:[o&&/* @__PURE__ */Kr("div",{style:{fontWeight:"bold"},children:String(o)}),null!=i.n&&/* @__PURE__ */Zr("div",{children:["n = ",i.n]}),null!=i.min&&/* @__PURE__ */Zr("div",{children:["Min: ",i.min.toLocaleString()]}),null!=i.q1&&/* @__PURE__ */Zr("div",{children:["Q1: ",i.q1.toLocaleString()]}),
59
+ /* @__PURE__ */Zr("div",{children:["Median: ",i.median.toLocaleString()]}),null!=i.q3&&/* @__PURE__ */Zr("div",{children:["Q3: ",i.q3.toLocaleString()]}),null!=i.max&&/* @__PURE__ */Zr("div",{children:["Max: ",i.max.toLocaleString()]}),null!=i.mean&&/* @__PURE__ */Zr("div",{style:{opacity:.8},children:["Mean: ",i.mean.toLocaleString(void 0,{maximumFractionDigits:2})]})]});if(e?.valueAccessor){let i=Array.isArray(t.data)?t.data:[],r=e.valueAccessor,a=i.map(e=>Number("function"==typeof r?r(e):e[r])).filter(e=>Number.isFinite(e)).sort((e,t)=>e-t),n=a.length,s=n>0?n%2!=0?a[Math.floor(n/2)]:(a[n/2-1]+a[n/2])/2:null;/* */
60
+ return Zr("div",{className:"semiotic-tooltip",style:Mi,children:[o&&/* @__PURE__ */Kr("div",{style:{fontWeight:"bold"},children:String(o)}),n>0&&/* @__PURE__ */Zr("div",{children:["n = ",n]}),null!=s&&/* @__PURE__ */Zr("div",{children:["Median: ",s.toLocaleString()]})]})}/* */
61
+ return Kr("div",{className:"semiotic-tooltip",style:Mi,children:/* @__PURE__ */Kr("div",{style:{fontWeight:"bold"},children:String(o)})})}}function ce(e){let t=go(e,{skipPositional:!1});return null==t.title&&0===t.entries.length?null:/* @__PURE__ */Jr("div",{className:"semiotic-tooltip",style:Mi,children:[null!=t.title&&/* @__PURE__ */Ur("div",{style:{fontWeight:"bold"},children:String(t.title)}),t.entries.map(e=>/* @__PURE__ */Jr("div",{children:[
62
+ /* @__PURE__ */Jr("span",{style:{opacity:.7},children:[e.key,":"]})," ","number"==typeof e.value?e.value.toLocaleString():String(e.value)]},e.key))]})}function he({ref:e,frameRef:t,setup:o}){return ca(e,()=>({push:e=>t.current?.push(e),pushMany:e=>t.current?.pushMany(e),remove:e=>t.current?.remove(e)??[],update:(e,o)=>t.current?.update(e,o)??[],replace:e=>t.current?.replace(e),clear:()=>t.current?.clear(),getData:()=>t.current?.getData()??[],getScales:()=>t.current?.getScales()??null}),[t]),{effectiveLegendProps:o.legendBehaviorProps,effectiveMargin:o.margin}}function ue(e){let{colorBy:t,colorScale:o,color:i,themeCategorical:r,colorScheme:a,categoryIndexMap:n,userPieceStyle:s,stroke:l,strokeWidth:c,opacity:h,effectiveSelectionHook:u,resolvedSelection:d,cycleByCategory:m=!1,baseStyleExtras:g,linkStrokeToFill:p=!1,styleRules:f,resolveRuleValue:y}=e,v=ha(()=>(e,s)=>{let l="function"==typeof g?g(e,s):g,c=l?{...l}:{};if(void 0===c.fill)if(t){if(!o)return c;c.fill=di(e,t,o)}else c.fill=pi(i,r,a,m?s:void 0,n);if(f&&f.length>0){let t=po(e,f,{value:y?y(e,s):void 0,category:s});Object.assign(c,t)}return p&&void 0===c.stroke&&void 0!==c.fill&&(c.stroke=c.fill),c},[t,o,i,r,a,n,m,g,p,f,y]),b=ha(()=>At(s?"function"==typeof s?(e,t)=>({...v(e,t),...s(e,t)||{}}):(e,t)=>({...v(e,t),...s}):v,{stroke:l,strokeWidth:c,opacity:h}),[v,s,l,c,h]);return ha(()=>oi(b,u??null,d),[b,u,d])}function de({brushProp:e,onBrushProp:t,linkedBrush:o,valueAccessor:i}){let r=da(()=>{let e="string"==typeof o?o:o?{name:o.name,xField:o.rField}:void 0;return ti(e)},[o]),a="string"==typeof i?i:"value",n=Eo({name:r?.name||"__unused_ordinal_brush__",xField:r?.xField||a}),s=ma(n.brushInteraction);s.current=n.brushInteraction;let l=ua(e=>{if(r){let t=s.current;e?t.end(e.r):t.end(null)}t?.(e)},[t,r]),c=!!(e||o||t);return{hasBrush:c,handleBrush:l,brushStreamProps:c?{brush:{dimension:"r"},onBrush:l}:{}}}function me(e,t){if("function"==typeof e)return e;let o=e||t;return e=>e[o]}function ge(e,t){if(e<=0)return[];if(t&&Object.prototype.hasOwnProperty.call(Ma,t)){let o=Ma[t];if(1===e)return[o(.5)];let i=[];for(let t=0;t<e;t++)i.push(o(t/(e-1)));return i}let o=["#da1e28","#ff8389","#ffb3b8"],i=["#a6c8ff","#4589ff","#0043ce"],r="#a8a8a8";if(1===e)return[r];let a=e%2!=0,n=Math.floor(e/2),s=[];for(let e=0;e<n;e++)s.push(o[Math.min(Math.floor(e*o.length/n),o.length-1)]);a&&s.push(r);for(let e=0;e<n;e++)s.push(i[Math.min(Math.floor(e*i.length/n),i.length-1)]);return s}function pe(e,t,o,i,r,a,n={}){let s=/* @__PURE__ */new Map,l=new Set(t);for(let n of e){let e=o(n);s.has(e)||s.set(e,/* @__PURE__ */new Map);let c=s.get(e);if(i){let e=i(n);if(null==e||!Number.isFinite(e))continue;if(!Number.isInteger(e)){"production"!==process.env.NODE_ENV&&console.warn("[LikertChart] Ignoring non-integer Likert score:",e);continue}let o=e-1;if(o<0||o>=t.length)continue;let r=t[o];c.set(r,(c.get(r)||0)+1)}else if(r&&a){let e=r(n),t=a(n);if(!l.has(e))continue;c.set(e,(c.get(e)||0)+(Number.isFinite(t)?t:0))}}let c=[];for(let[e,o]of s){let i=0;for(let e of t)i+=o.get(e)||0;if(0!==i)for(let r=0;r<t.length;r++){let a=t[r],s=o.get(a)||0,l={};n.category&&(l[n.category]=e),n.level&&(l[n.level]=a),n.count&&(l[n.count]=s),n.score&&(l[n.score]=r+1),c.push({...l,__likertCategory:e,__likertLevel:a,__likertLevelLabel:a,__likertCount:s,__likertPct:s/i*100,__likertLevelIndex:r})}}return c}function fe(e,t){let o=t.length,i=o%2!=0,r=Math.floor(o/2),a=[];for(let t of e){let e=t.__likertLevelIndex;if(i&&e===r){let e=t.__likertPct/2;a.push({...t,__likertLevel:Ia,__likertPct:-e}),a.push({...t,__likertLevel:Ta,__likertPct:e})}else e<r?a.push({...t,__likertPct:-t.__likertPct}):a.push(t)}return a}function ye(e,t){let o=t.length,i=o%2!=0,r=Math.floor(o/2),a=/* @__PURE__ */new Map;for(let t of e){let e=a.get(t.__likertCategory)||[];e.push(t),a.set(t.__likertCategory,e)}let n=[];for(let[,e]of a){let t,a,s=/* @__PURE__ */new Map;for(let o of e)o.__likertLevel===Ia?t=o:o.__likertLevel===Ta?a=o:s.set(o.__likertLevelIndex,o);i&&t&&n.push(t);for(let e=r-1;e>=0;e--){let t=s.get(e);t&&n.push(t)}i&&a&&n.push(a);for(let e=i?r+1:r;e<o;e++){let t=s.get(e);t&&n.push(t)}}return n}function ve({data:e,levels:t,categoryAccessor:o,valueAccessor:i,levelAccessor:r,countAccessor:a,isDiverging:n,frameRef:s}){let l=!r,c=Ca(()=>me(o,"question"),[o]),h=Ca(()=>l?me(i,"score"):null,[l,i]),u=Ca(()=>l?null:me(r,"level"),[l,r]),d=Ca(()=>l?null:me(a,"count"),[l,a]),m=La([]),g=Ca(()=>({category:"string"==typeof o?o:void 0,level:"string"==typeof r?r:void 0,count:"string"==typeof a?a:void 0,score:r||"string"!=typeof i?void 0:i}),[o,a,r,i]);return{processedData:Ca(()=>{let o=e||[];if(0===o.length)return[];let i=pe(o,t,c,h,u,d,g);return n&&(i=fe(i,t),i=ye(i,t)),i},[e,t,c,h,u,d,g,n]),reAggregate:_a(e=>{let o=pe(e,t,c,h,u,d,g);n&&(o=fe(o,t),o=ye(o,t)),s.current?.replace(o)},[t,c,h,u,d,g,n,s]),accumulatorRef:m}}function be(e){let t=e.__likertPct??e.data?.__likertPct;return"number"==typeof t&&Number.isFinite(t)?t:void 0}function xe(e,t,o){let i=Math.max(16,.3*t);if(null==o||o<=0)return i;let r=Ut(e,i),a=2*o*.8;return r<=a?i:i*a/r}function we({value:e,min:t,max:o,radius:i,innerRadius:r,showScaleLabels:a,label:n}){let s=xe(e,i,r),l=.7*s+11;/* */
63
+ return Mn("g",{textAnchor:"middle",children:[
64
+ /* @__PURE__ */Ln("text",{y:0,dominantBaseline:"central",fontSize:s,fontWeight:700,fill:"var(--semiotic-text, #333)",children:e}),a&&/* @__PURE__ */Mn("text",{y:l,fontSize:11,fill:"var(--semiotic-text-secondary, #666)",children:[t," – ",o]}),null!=n&&""!==n&&/* @__PURE__ */Ln("text",{y:l+(a?14:0),fontSize:11,fill:"var(--semiotic-text-secondary, #666)",children:n})]})}function ke({centerContent:e,centerLabel:t,value:o,min:i,max:r,radius:a,innerRadius:n,showScaleLabels:s,valueFormat:l,compact:c}){if(null!=e){let s="function"==typeof e?e(o,i,r):e;return"string"==typeof s||"number"==typeof s?we({value:String(s),min:i,max:r,radius:a,innerRadius:n,showScaleLabels:!1,label:t}):s}return c?null:we({value:l?l(o):String(Math.round(o)),min:i,max:r,radius:a,innerRadius:n,showScaleLabels:s,label:t})}function Ae(e=240){let t=e*Math.PI/180,o=360-e,i=180+o/2,r=i*Math.PI/180;return{sweepRad:t,gapDeg:o,startAngleDeg:i,startAngleRad:r,offsetRad:-Math.PI/2+r}}function Se(e=240){let{sweepRad:t,offsetRad:o}=Ae(e),i=[[Math.cos(o),Math.sin(o)],[Math.cos(o+t),Math.sin(o+t)],[0,0]];for(let e=0;e<2*Math.PI;e+=Math.PI/2)((e-o)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)<=t+.001&&i.push([Math.cos(e),Math.sin(e)]);let r=i.map(e=>e[0]),a=i.map(e=>e[1]),[n,s]=Oi(r),[l,c]=Oi(a);return{minX:n,maxX:s,minY:l,maxY:c,width:s-n,height:c-l,cx:(n+s)/2,cy:(l+c)/2}}function Re(e){return Math.max(0,Math.min(1,e))}function Pe(e){let t=e.trim();if(t.startsWith("#")){let e=t.slice(1);if(3===e.length&&(e=e.split("").map(e=>e+e).join("")),6===e.length&&/^[0-9a-f]{6}$/i.test(e))return[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]}let o=e.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);if(o){let e=[Number(o[1]),Number(o[2]),Number(o[3])];if(e.every(Number.isFinite))return e}return null}function Ce(e,t,o){let i=e=>Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,"0");return`#${i(e)}${i(t)}${i(o)}`}function _e(e,t,o){let i=e.filter(e=>Number.isFinite(e.offset)).map(e=>({offset:Re(e.offset),color:e.color??o,opacity:null==e.opacity?1:Re(e.opacity)})).sort((e,t)=>e.offset-t.offset);if(0===i.length)return"#999999";let r=e=>{if(1===e.opacity)return e.color;let t=Pe(e.color);return t?`rgba(${t[0]},${t[1]},${t[2]},${e.opacity})`:e.color};if(1===i.length)return r(i[0]);let a=Re(t);if(a<=i[0].offset)return r(i[0]);if(a>=i[i.length-1].offset)return r(i[i.length-1]);for(let e=0;e<i.length-1;e++){let t=i[e],o=i[e+1];if(a<t.offset||a>o.offset)continue;let n=o.offset-t.offset,s=n<=0?0:(a-t.offset)/n,l=Pe(t.color),c=Pe(o.color);if(!l||!c)return r(s<.5?t:o);let[h,u,d]=l,[m,g,p]=c,f=h+(m-h)*s,y=u+(g-u)*s,v=d+(p-d)*s,b=t.opacity+(o.opacity-t.opacity)*s;return 1===b?Ce(f,y,v):`rgba(${Math.round(f)},${Math.round(y)},${Math.round(v)},${b})`}return r(i[i.length-1])}function Le(e,t,o){return null==o?`${e}-${t}`:`${e}-${t}-${o}`}function Me(e){let{min:t,max:o,value:i,thresholds:r,fillColor:a,backgroundColor:n,fillZones:s,showScaleLabels:l,gradientFill:c,gradientSteps:h=240}=e,u=Math.max(t,Math.min(o,i)),d=o-t||1,m=(u-t)/d,g=r&&r.length>0?[...r].sort((e,t)=>e.value-t.value):[{value:o,color:a||"#007bff"}];g=g.map(e=>({...e,value:Math.max(t,Math.min(o,e.value))})),g[g.length-1].value<o&&g.push({value:o,color:g[g.length-1].color});let p=!!c&&c.stops.length>=2,f=[],y=/* @__PURE__ */new Map,v=[];if(p){let e=s?m:1,t=Le("bg",0);if(f.push({category:t,value:1,_zone:"Track",_isFill:!1,_pctStart:0,_pct:1,_roundedEnds:{start:!0,end:!0},_nonInteractive:!0}),y.set(t,{fill:n,opacity:.4}),e>0){let t=Math.max(1,Math.floor(h)),o=Math.max(1,Math.min(t,Math.round(e*t))),i=[];for(let t=0;t<o;t++){let r=e*(t+.5)/o;i.push(_e(c.stops,r,a||g[0]?.color||"#007bff"))}let r=Le("fill",0);f.push({category:r,value:e,_zone:"Gradient",_isFill:!0,_pctStart:0,_pct:e,_roundedEnds:{start:!0,end:!0},_nonInteractive:!0,_gradientBand:{colors:i}}),y.set(r,{fill:i[0]||n})}}else{let e=t;for(let r=0;r<g.length;r++){let a=g[r],l=(a.value-e)/d,c=(e-t)/d,h=(a.value-t)/d,p=s?Math.min(m,h):h,v=Math.max(0,p-c),b=s?Math.max(0,l-v):0;if(v>0){let n=Le("fill",r);f.push({category:n,value:v,_zone:a.label||`Zone ${r+1}`,_isFill:!0,__gaugeAccessibleDatum:{category:a.label||`Zone ${r+1}`,value:i,min:t,max:o,segmentStart:e,segmentEnd:t+p*d,filled:!0}}),y.set(n,{fill:a.color})}if(b>0){let s=Le("bg",r);f.push({category:s,value:b,_zone:a.label||`Zone ${r+1}`,_isFill:!1,__gaugeAccessibleDatum:{category:a.label||`Zone ${r+1}`,value:i,min:t,max:o,segmentStart:Math.max(e,u),segmentEnd:a.value,filled:!1}}),y.set(s,{fill:n,opacity:.4})}e=a.value}}if(l&&r&&r.length>0)for(let e of r)e.value>t&&e.value<o&&v.push({type:"gauge-label",value:e.value,label:e.label||String(e.value)});return{gaugeData:f,pieceStyle:(e,t)=>{let o=t||e.category;return y.get(o)||{fill:n}},gaugeAnnotations:v}}import{a as Ie}from"./c-PDQHLOKU.min.js";import{c as Te}from"./c-QP3PXK3N.min.js";import{c as He}from"./c-CZI7G7G2.min.js";import{a as Be,b as $e,c as Fe}from"./c-XI6CLZII.min.js";import{a as Oe}from"./c-OV5F3DQP.min.js";import{a as De}from"./c-4IH2UPBL.min.js";import{b as Ee,c as We,d as je,e as Ne,g as ze,h as Ve,i as Ge,j as qe,l as Xe}from"./c-NWRYV6ZF.min.js";import{h as Ye,j as Qe,k as Ke}from"./c-BSLJZUTD.min.js";import{a as Ze,b as Ue,d as Je,e as et,f as tt,g as ot,h as it,i as rt,j as at,k as nt,m as st}from"./c-VI753KBO.min.js";import{a as lt}from"./c-BKL6GCDN.min.js";import{a as ct}from"./c-UF4BWPDR.min.js";import{a as ht}from"./c-3DHY6CIP.min.js";import{a as ut}from"./c-QXLDCATV.min.js";import{a as dt,b as mt,d as gt}from"./c-U5XVLSHN.min.js";import{B as pt,C as ft,E as yt,J as vt,U as bt,V as xt,W as wt,X as kt,Y as At,a as St,b as Rt,d as Pt,e as Ct,f as _t,g as Lt,h as Mt,i as It,k as Tt,l as Ht,n as Bt,o as $t,q as Ft,r as Ot,s as Dt,t as Et,u as Wt,v as jt,y as Nt}from"./c-C5GXUHUO.min.js";import{d as zt}from"./c-3KOWSG3J.min.js";import{c as Vt}from"./c-IU4QZ7Y5.min.js";import{a as Gt,b as qt}from"./c-RDM36RTX.min.js";import{$ as Xt,$a as Yt,A as Qt,Aa as Kt,Ab as Zt,B as Ut,Ca as Jt,Cb as eo,Da as to,E as oo,Eb as io,Fa as ro,Fb as ao,G as no,Ga as so,Ha as lo,Hb as co,Ib as ho,J as uo,K as mo,Ka as go,Nb as po,Ob as fo,Q as yo,Sa as vo,Ta as bo,U as xo,V as wo,W as ko,X as Ao,Xa as So,Y as Ro,Ya as Po,_ as Co,_a as _o,aa as Lo,ab as Mo,b as Io,bb as To,ca as Ho,ea as Bo,fa as $o,ga as Fo,ha as Oo,ia as Do,ib as Eo,ja as Wo,k as jo,ka as No,l as zo,m as Vo,ma as Go,na as qo,o as Xo,q as Yo,t as Qo,ta as Ko,va as Zo,w as Uo,xa as Jo,za as ei}from"./c-XCV7VUU3.min.js";import{d as ti,f as oi}from"./c-2OZMC2MZ.min.js";import{c as ii}from"./c-NVSINXE5.min.js";import{e as ri,f as ai,g as ni,h as si,i as li,j as ci,k as hi,p as ui,r as di,s as mi,u as gi,v as pi}from"./c-ZOE7TAR3.min.js";import{a as fi,c as yi,f as vi,h as bi,i as xi,k as wi,p as ki,r as Ai,v as Si}from"./c-SSKV5JPW.min.js";import{b as Ri,c as Pi,i as Ci}from"./c-RBWJFQDC.min.js";import{e as _i,k as Li,l as Mi,p as Ii,q as Ti}from"./c-5FUOKMH6.min.js";import{a as Hi,b as Bi,c as $i,d as Fi}from"./c-ESCEKIUO.min.js";import{a as Oi,c as Di}from"./c-3PFVJFBK.min.js";import*as Ei from"react";import{jsx as Wi}from"react/jsx-runtime";var ji=/* @__PURE__ */new Set(["svg","g","text","tspan","path","circle","ellipse","rect","line","polyline","polygon","use","image","defs","symbol"]);import{forwardRef as Ni,memo as zi,useCallback as Vi,useEffect as Gi,useMemo as qi,useRef as Xi,useState as Yi}from"react";import{scaleBand as Qi,scaleLinear as Ki}from"d3-scale";var Zi=class{constructor(){this.colorSchemeMap=/* @__PURE__ */new Map,this.colorSchemeIndex=0}resetColors(){this.colorSchemeMap.clear(),this.colorSchemeIndex=0}resolvePieceStyle(e,t,o){if(t&&"function"==typeof e.pieceStyle){let i=e.pieceStyle(t,o);return i&&!i.fill&&o?{...i,fill:this.getColorFromScheme(e,o)}:i}return e.pieceStyle&&"object"==typeof e.pieceStyle?e.pieceStyle:e.barColors&&o?{fill:mi(e.barColors,o)??"#007bff"}:{fill:o?this.getColorFromScheme(e,o):"#007bff"}}resolveSummaryStyle(e,t,o){return t&&"function"==typeof e.summaryStyle?e.summaryStyle(t,o):e.summaryStyle&&"object"==typeof e.summaryStyle?e.summaryStyle:{fill:"#007bff",fillOpacity:.6,stroke:"#007bff",strokeWidth:1}}getColorFromScheme(e,t){let o=this.colorSchemeMap.get(t);if(o)return o;let i=Array.isArray(e.colorScheme)?e.colorScheme:e.themeCategorical||ui,r=i[this.colorSchemeIndex%i.length];return this.colorSchemeIndex++,this.colorSchemeMap.set(t,r),r}};import{quantileSorted as Ui}from"d3-array";import{scaleLinear as Ji}from"d3-scale";var er={bar:function(e,t){let{scales:o,columns:i,config:r,getR:a,getStack:l,resolvePieceStyle:c}=e,{r:h,projection:u}=o,d=[],m="vertical"===u,g="horizontal"===u,p=r.normalize,{steps:f,keys:y}=n(Object.values(i),a,l,p);for(let{col:e,groups:t}of f){let o=0,i=0;for(let r of y){let a=t.get(r);if(!a)continue;let n=a.value,s=c(a.pieces[0],l?r:e.name),u={...a.pieces[0],__aggregateValue:a.total,__pieceCount:a.pieces.length,category:e.name};if(m){let t=h(n>=0?o+n:i),a=n>=0?h(o)-h(o+n):h(i+n)-h(i);d.push(Ye(e.x,t,e.width,Math.abs(a),s,u,r)),n>=0?o+=n:i+=n}else if(g){let t=h(n>=0?o:i+n),a=n>=0?h(o+n)-h(o):h(i)-h(i+n);d.push(Ye(t,e.x,Math.abs(a),e.width,s,u,r)),n>=0?o+=n:i+=n}}}let v="vertical"===u;for(let e of d){if("rect"!==e.type)continue;let t=e.datum?.__aggregateValue??0;e.roundedEdge=v?t>=0?"top":"bottom":t>=0?"right":"left",r.gradientFill&&(e.fillGradient=r.gradientFill)}if(void 0!==r.roundedTop){let e=/* @__PURE__ */new Map;for(let t of d){if("rect"!==t.type)continue;let o=t.datum?.category||"";e.has(o)||e.set(o,[]),e.get(o).push(t)}for(let t of e.values()){if(0===t.length)continue;let e=t.filter(e=>(e.datum?.__aggregateValue??0)>=0),o=t.filter(e=>(e.datum?.__aggregateValue??0)<0);if(e.length>0){let t=v?e.reduce((e,t)=>e.y<t.y?e:t):e.reduce((e,t)=>e.x+e.w>t.x+t.w?e:t),o=s(r.roundedTop,t,v);o>0&&(t.roundedTop=o)}if(o.length>0){let e=v?o.reduce((e,t)=>e.y+e.h>t.y+t.h?e:t):o.reduce((e,t)=>e.x<t.x?e:t),t=s(r.roundedTop,e,v);t>0&&(e.roundedTop=t)}}}return d},clusterbar:function(e,t){let{scales:o,columns:i,config:r,getR:a,getGroup:l,resolvePieceStyle:c}=e,{r:h,projection:u}=o,d=[],m="vertical"===u,{steps:g,keys:p}=n(Object.values(i),a,l),f=p.length||1;for(let{col:e,groups:t}of g){let o=e.width/f,i=.2*o,r=o-i;for(let n=0;n<p.length;n++){let s=t.get(p[n])?.pieces||[];for(let t of s){let s=a(t),l=c(t,p[n]);if(m){let a=e.x+n*o+i/2,c=h(0),u=h(s);d.push(Ye(a,Math.min(c,u),r,Math.abs(c-u),l,t,p[n]))}else{let a=e.x+n*o+i/2,c=h(0),u=h(s);d.push(Ye(Math.min(c,u),a,Math.abs(u-c),r,l,t,p[n]))}}}}for(let e of d){if("rect"!==e.type||null==e.datum)continue;let t=a(e.datum),o=s(r.roundedTop,e,m);o>0&&(e.roundedTop=o),e.roundedEdge=m?t>=0?"top":"bottom":t>=0?"right":"left",r.gradientFill&&(e.fillGradient=r.gradientFill)}return d},point:function(e,t){let{scales:o,columns:i,getR:r,multiScales:a,resolvePieceStyle:n}=e,{r:s,projection:h}=o,u=[],d="vertical"===h,m="radial"===h,g=a.length>0,p=l(e),f=2*Math.PI,y=-Math.PI/2;for(let e of Object.values(i))for(let t of e.pieceData){let o,i,l=t.__rIndex??0,h=t.__rValue??r(t),v=g&&a[l]||s,b=n(t,e.name),x=b.r||5;if(m){let t=y+(e.pctStart+e.pct/2)*f,r=v(h);o=Math.cos(t)*r,i=Math.sin(t)*r}else d?(o=e.middle,i=v(h)):(o=v(h),i=e.middle);c(u,p,t,o,i,x,b)}return u},swarm:function(e,t){let{scales:o,columns:i,getR:r,resolvePieceStyle:a}=e,{r:n,projection:s}=o,h=[],u="vertical"===s,d=l(e);for(let e of Object.values(i)){let t=e.width/2;for(let o=0;o<e.pieceData.length;o++){let i=e.pieceData[o],s=r(i),l=a(i,e.name),m=l.r||4,g=(7919*o%100/100-.5)*t*.8;c(h,d,i,u?e.middle+g:n(s),u?n(s):e.middle+g,m,l)}}return h},pie:h,donut:h,boxplot:function(e,t){let{scales:o,columns:i,config:r,getR:a,resolveSummaryStyle:n}=e,{r:s,projection:l}=o,c=[],h="vertical"===l,m=!1!==r.showOutliers;for(let t of Object.values(i)){let o=t.pieceData.map(e=>a(e)).filter(e=>null!=e&&!isNaN(e)).sort((e,t)=>e-t);if(0===o.length)continue;let i=d(o),{min:r,max:l,q1:g,median:p,q3:f}=i,y=f-g,v=g-1.5*y,b=f+1.5*y,x=o.find(e=>e>=v)??r,w=l;for(let e=o.length-1;e>=0;e--)if(o[e]<=b){w=o[e];break}i.min=x,i.max=w;let k=n(u(t.pieceData,t.name,i),t.name),A=[];if(m)for(let e of t.pieceData){let o=a(e);if(o<v||o>b){let i=h?t.middle:s(o),r=h?s(o):t.middle;A.push({px:i,py:r,value:o,datum:e})}}if(c.push({type:"boxplot",x:h?t.middle:0,y:h?0:t.middle,projection:h?"vertical":"horizontal",columnWidth:.6*t.width,minPos:s(x),q1Pos:s(g),medianPos:s(p),q3Pos:s(f),maxPos:s(w),stats:i,style:k,datum:t.pieceData,category:t.name,outliers:A}),m)for(let t of A)c.push({type:"point",x:t.px,y:t.py,r:3,style:{fill:k.fill||e.config.themeSemantic?.secondary||"#999",opacity:.6,cursor:k.cursor},datum:t.datum})}return c},violin:function(e,t){let{scales:o,columns:i,config:r,getR:a,resolveSummaryStyle:n}=e,{r:s,projection:l}=o,c=[],h="vertical"===l,g=r.bins||20,p=!1!==r.showIQR;for(let e of Object.values(i)){let t=e.pieceData.map(e=>a(e)).filter(e=>null!=e&&!isNaN(e)).sort((e,t)=>e-t);if(t.length<2)continue;let o,i=t[0],r=t[t.length-1],l=(r-i)/g||1,f=m(t,i,r,l,g),y=Di(f,1),v=e.width/2*.9;if(h){o=`M ${e.middle} ${s(i)}`;for(let t=0;t<g;t++){let r=s(i+(t+.5)*l),a=f[t]/y*v;o+=` L ${e.middle+a} ${r}`}o+=` L ${e.middle} ${s(r)}`;for(let t=g-1;t>=0;t--){let r=s(i+(t+.5)*l),a=f[t]/y*v;o+=` L ${e.middle-a} ${r}`}o+=" Z"}else{o=`M ${s(i)} ${e.middle}`;for(let t=0;t<g;t++){let r=s(i+(t+.5)*l),a=f[t]/y*v;o+=` L ${r} ${e.middle-a}`}o+=` L ${s(r)} ${e.middle}`;for(let t=g-1;t>=0;t--){let r=s(i+(t+.5)*l),a=f[t]/y*v;o+=` L ${r} ${e.middle+a}`}o+=" Z"}let b,x=d(t),w=n(u(e.pieceData,e.name,x),e.name);p&&t.length>=4&&(b={q1Pos:s(x.q1),medianPos:s(x.median),q3Pos:s(x.q3),centerPos:e.middle,isVertical:h});let k=h?{x:e.x,y:Math.min(s(r),s(i)),width:e.width,height:Math.abs(s(r)-s(i))}:{x:Math.min(s(i),s(r)),y:e.x,width:Math.abs(s(r)-s(i)),height:e.width};c.push({type:"violin",pathString:o,translateX:0,translateY:0,bounds:k,iqrLine:b,stats:x,style:w,datum:e.pieceData,category:e.name})}return c},histogram:function(e,t){let{scales:o,columns:i,config:r,getR:a,resolveSummaryStyle:n}=e,{r:s}=o,l=[],c=r.bins||25,h=r.normalize,u=s.domain?.(),d=u?+u[0]:void 0,g=u?+u[1]:void 0;for(let e of Object.values(i)){let t=e.pieceData.map(e=>a(e)).filter(e=>null!=e&&!isNaN(e));if(0===t.length)continue;let[o,i]=Oi(t),r=null!=d&&isFinite(d)?d:o,u=null!=g&&isFinite(g)?g:i,p=(u-r)/c||1,f=m(t,r,u,p,c),y=t.length,v=Di(f,1);for(let t=0;t<c;t++){if(0===f[t])continue;let o=(h?f[t]/y:f[t]/v)*e.width*.9,i=s(r+t*p),a=s(r+(t+1)*p),c=Math.min(i,a),u=Math.abs(a-i),d=e.x+e.width-o,m={...e.pieceData[0],bin:t,count:f[t],range:[r+t*p,r+(t+1)*p],category:e.name,data:e.pieceData},g=n(m,e.name);l.push(Ye(c,d,u,o,g,m,e.name))}}return l},ridgeline:function(e,t){let{scales:o,columns:i,config:r,getR:a,resolveSummaryStyle:n}=e,{r:s,projection:l}=o,c=[],h=r.bins||20,g="horizontal"===l,p=r.amplitude||1.5;for(let e of Object.values(i)){let t=e.pieceData.map(e=>a(e)).filter(e=>null!=e&&!isNaN(e)).sort((e,t)=>e-t);if(t.length<2)continue;let o,i=t[0],r=t[t.length-1],l=(r-i)/h||1,f=m(t,i,r,l,h),y=Di(f,1),v=d(t),b=n(u(e.pieceData,e.name,v),e.name),x=e.width*p;if(g){let t=e.x+e.width;o=`M ${s(i)} ${t}`;for(let e=0;e<h;e++)o+=` L ${s(i+(e+.5)*l)} ${t-f[e]/y*x}`;o+=` L ${s(r)} ${t} Z`}else{let t=e.x;o=`M ${t} ${s(i)}`;for(let e=0;e<h;e++){let r=s(i+(e+.5)*l);o+=` L ${t+f[e]/y*x} ${r}`}o+=` L ${t} ${s(r)} Z`}let w=g?{x:Math.min(s(i),s(r)),y:e.x,width:Math.abs(s(r)-s(i)),height:e.width}:{x:e.x,y:Math.min(s(r),s(i)),width:e.width,height:Math.abs(s(r)-s(i))};c.push({type:"violin",pathString:o,translateX:0,translateY:0,bounds:w,stats:v,style:{...b,fillOpacity:b.fillOpacity??.5},datum:e.pieceData,category:e.name})}return c},timeline:function(e,t){let{scales:o,columns:i,getRawRange:r,resolvePieceStyle:a}=e,{r:n,projection:s}=o,l=[],c="horizontal"===s;for(let e of Object.values(i))for(let t of e.pieceData){let o=r(t);if(!o)continue;let[i,s]=o,h=a(t,e.name);if(c){let o=n(Math.min(i,s)),r=n(Math.max(i,s));l.push(Ye(o,e.x,r-o,e.width,h,t,e.name))}else{let o=n(Math.max(i,s)),r=n(Math.min(i,s));l.push(Ye(e.x,o,e.width,r-o,h,t,e.name))}}return l},funnel:function(e,t){let{columns:o,getR:i,getStack:r,resolvePieceStyle:a}=e,s=[],l=t.width/2,c=!1!==e.config.showLabels,h=e.scales.o.domain().map(e=>o[e]).filter(Boolean);if(0===h.length)return s;let{steps:u,keys:d}=n(h,i,r),m=d.length>1&&"_default"!==d[0],g=0;if(!m)for(let{stepTotal:e}of u)e>g&&(g=e);if(m)for(let e of u){let t=0,o=0;for(let i=0;i<d.length;i++){let r=e.groups.get(d[i]);r&&(i%2==0?t+=r.total:o+=r.total)}let i=Math.max(t,o);i>g&&(g=i)}if(0===g)return s;let p=u[0].stepTotal,f=m?.95*l:.9*t.width,y=Ji().domain([0,g]).range([0,f]),v=e.config.connectorOpacity??.3,b=/* @__PURE__ */new Map;for(let t=0;t<u.length;t++){let o=u[t],i=o.col,r=0===t,n=i.x,h=i.width,g=.55*h,f=n+(h-g)/2,x=/* @__PURE__ */new Map;if(m){let e=0;for(let t of d){let i=o.groups.get(t);i&&(e+=y(i.total))}let t=l,n=l;for(let h=0;h<d.length;h++){let m=d[h],p=o.groups.get(m);if(!p)continue;let v=y(p.total),b=h%2==0,w=b?t:n-v;b?t+=v:n-=v;let k=a(p.pieces[0],m),A=u[0].groups.get(m)?.total??0,S=A>0?p.total/A*100:0,R={...p.pieces[0],__funnelValue:p.total,__funnelPercent:S,__funnelStep:i.name,__funnelIsFirstStep:r,__aggregateValue:p.total,__pieceCount:p.pieces.length,category:m};c&&(0===h&&(R.__funnelStepLabel=i.name,R.__funnelStepLabelX=l,R.__funnelStepLabelY=f,R.__funnelRowWidth=e),R.__funnelValueLabelX=w+v/2,R.__funnelValueLabelY=f,R.__funnelBarW=v),s.push(Ye(w,f,v,g,k,R,m)),x.set(m,{x:w,y:f,w:v,h:g})}}else{let e=o.stepTotal,t=y(e),n=l-t/2,h=d[0],u="_default"!==h,m=o.groups.get(h)?.pieces[0]??i.pieceData[0],v=u?h:i.name,b=a(m,v),w=p>0?e/p*100:0,k={...m,__funnelValue:e,__funnelPercent:w,__funnelStep:i.name,__funnelIsFirstStep:r,category:u?h:i.name};c&&(k.__funnelStepLabel=i.name,k.__funnelStepLabelX=l,k.__funnelStepLabelY=f,k.__funnelRowWidth=t,k.__funnelValueLabelX=l,k.__funnelValueLabelY=f,k.__funnelBarW=t),s.push(Ye(n,f,t,g,b,k,v)),x.set(h,{x:n,y:f,w:t,h:g})}if(t>0&&b.size>0){let t=m?d:[d[0]];for(let r of t){let t=b.get(r),n=x.get(r);if(!t||!n)continue;let l=(()=>{let e=o.groups.get(r),t="_default"===r?i.name:r;return a(e?e.pieces[0]:i.pieceData[0],t)})(),c={type:"trapezoid",points:[[t.x,t.y+t.h],[t.x+t.w,t.y+t.h],[n.x+n.w,n.y],[n.x,n.y]],style:{fill:l.fill||e.config.themeSemantic?.secondary||"#999",opacity:v,cursor:l.cursor},datum:o.groups.get(r)?.pieces[0]??i.pieceData[0],category:"_default"===r?i.name:r};s.push(c)}}b=x}return s},"bar-funnel":function(e,t){let{columns:o,getR:i,getStack:r,resolvePieceStyle:a,scales:s}=e,l=[],c=s.o.domain().map(e=>o[e]).filter(Boolean);if(0===c.length)return l;let{steps:h,keys:u}=n(c,i,r),d=u.length>1&&"_default"!==u[0],m=s.r,g=d?u.length:1,p=d?.15:0;for(let e=0;e<h.length;e++){let t=h[e],o=t.col,i=0===e,r=e>0?h[e-1]:null,n=o.width/g,s=n*p,c=n-s;for(let e=0;e<u.length;e++){let g=u[e],p=t.groups.get(g);if(!p)continue;let f=p.total,y=h[0].groups.get(g)?.total??0,v=y>0?f/y*100:0,b=r?.groups.get(g)?.total??f,x=i?0:Math.max(0,b-f),w=o.x+e*n+s/2,k=m(f),A=m(0),S=A-k,R=a(p.pieces[0],d?g:o.name),P={...p.pieces[0],__barFunnelValue:f,__barFunnelPercent:v,__barFunnelIsFirstStep:i,__barFunnelIsDropoff:!1,__barFunnelStep:o.name,__barFunnelDropoffValue:x,__barFunnelCategory:"_default"===g?void 0:g,category:d?g:o.name,__barFunnelLabelX:w+c/2,__barFunnelLabelY:m(f+x)};if(l.push(Ye(w,Math.min(k,A),c,Math.abs(S),R,P,d?g:o.name)),x>0){let e=m(f+x),t=k-e,i={...R},r={...p.pieces[0],__barFunnelValue:x,__barFunnelPercent:y>0?x/y*100:0,__barFunnelIsFirstStep:!1,__barFunnelIsDropoff:!0,__barFunnelStep:o.name,__barFunnelCategory:"_default"===g?void 0:g,category:d?g:o.name};l.push(Ye(w,e,c,t,i,r,d?g:o.name))}}}return l},swimlane:function(e,t){let{scales:o,columns:i,getR:r,getStack:a,resolvePieceStyle:n}=e,{r:s,projection:l}=o,c=[],h="horizontal"===l,u=e.config.gradientFill,d=h?"left":"bottom",m=/* @__PURE__ */new Map,g=t=>{let o=m.get(t);if(void 0!==o)return o;let i="function"==typeof e.config.roundedTop?e.config.roundedTop(t.width):e.config.roundedTop,r="number"==typeof i&&Number.isFinite(i)?Math.max(0,i):0;return m.set(t,r),r},p=e.config.trackFill;if(p){let e="string"==typeof p?p:p.color,t="string"==typeof p?1:p.opacity??1,[o,r]=s.range(),a=Math.min(o,r),n=Math.abs(r-o);for(let o of Object.values(i)){let i={fill:e,opacity:t},r=h?Ye(a,o.x,n,o.width,i,null,"__track__"):Ye(o.x,a,o.width,n,i,null,"__track__"),s=g(o);s>0&&(r.cornerRadii={tl:s,tr:s,br:s,bl:s}),c.push(r)}}for(let e of Object.values(i)){let t=0,o=c.length,i=g(e);for(let o of e.pieceData){let i=Math.abs(r(o));if(0===i)continue;let l,m=a?a(o):e.name,g=n(o,m);if(h){let r=s(t),a=s(t+i);l=Ye(r,e.x,a-r,e.width,g,o,m)}else{let r=s(t+i),a=s(t);l=Ye(e.x,r,e.width,a-r,g,o,m)}u&&(l.fillGradient=u,l.roundedEdge=d),c.push(l),t+=i}if(i>0&&c.length>o){let e=c.slice(o),t=e[0],r=e[e.length-1];1===e.length?t.cornerRadii={tl:i,tr:i,br:i,bl:i}:h?(t.cornerRadii={tl:i,bl:i},r.cornerRadii={tr:i,br:i}):(t.cornerRadii={bl:i,br:i},r.cornerRadii={tl:i,tr:i})}}return c}},tr=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],or=["scene-style","data-paint","accessibility","evidence"],ir=(e,t)=>({retainedData:e,invalidations:t}),rr=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],ar=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],nr=["layout","scene-geometry","data-paint","overlay","accessibility","evidence"],sr=["scene-geometry","data-paint","accessibility","evidence"],lr=["scene-style","data-paint","accessibility","evidence"],cr=[],hr={chartType:/* @__PURE__ */ir("rebuild",rr),runtimeMode:/* @__PURE__ */ir("rebuild",rr),categoryAccessor:/* @__PURE__ */ir("rebuild",rr),valueAccessor:/* @__PURE__ */ir("rebuild",rr),oAccessor:/* @__PURE__ */ir("rebuild",rr),rAccessor:/* @__PURE__ */ir("rebuild",rr),stackBy:/* @__PURE__ */ir("rebuild",rr),groupBy:/* @__PURE__ */ir("rebuild",rr),timeAccessor:/* @__PURE__ */ir("rebuild",rr),accessorRevision:/* @__PURE__ */ir("rebuild",rr),colorAccessor:/* @__PURE__ */ir("rebuild",lr),symbolAccessor:/* @__PURE__ */ir("rebuild",sr),connectorAccessor:/* @__PURE__ */ir("rebuild",sr),dataIdAccessor:/* @__PURE__ */ir("rebuild",sr),projection:/* @__PURE__ */ir("preserve",ar),extentPadding:/* @__PURE__ */ir("preserve",ar),axisExtent:/* @__PURE__ */ir("preserve",ar),rExtent:/* @__PURE__ */ir("preserve",ar),oExtent:/* @__PURE__ */ir("preserve",ar),multiAxis:/* @__PURE__ */ir("preserve",ar),normalize:/* @__PURE__ */ir("preserve",ar),bins:/* @__PURE__ */ir("preserve",ar),oSort:/* @__PURE__ */ir("preserve",nr),barPadding:/* @__PURE__ */ir("preserve",nr),roundedTop:/* @__PURE__ */ir("preserve",nr),baselinePadding:/* @__PURE__ */ir("preserve",nr),innerRadius:/* @__PURE__ */ir("preserve",nr),cornerRadius:/* @__PURE__ */ir("preserve",nr),startAngle:/* @__PURE__ */ir("preserve",nr),sweepAngle:/* @__PURE__ */ir("preserve",nr),trackFill:/* @__PURE__ */ir("preserve",nr),showOutliers:/* @__PURE__ */ir("preserve",nr),showIQR:/* @__PURE__ */ir("preserve",nr),amplitude:/* @__PURE__ */ir("preserve",nr),connectorOpacity:/* @__PURE__ */ir("preserve",nr),showLabels:/* @__PURE__ */ir("preserve",nr),dynamicColumnWidth:/* @__PURE__ */ir("rebuild",nr),customLayout:/* @__PURE__ */ir("preserve",nr),layoutConfig:/* @__PURE__ */ir("preserve",nr),layoutMargin:/* @__PURE__ */ir("preserve",nr),symbolMap:/* @__PURE__ */ir("preserve",sr),pieceStyle:/* @__PURE__ */ir("preserve",lr),summaryStyle:/* @__PURE__ */ir("preserve",lr),connectorStyle:/* @__PURE__ */ir("preserve",lr),gradientFill:/* @__PURE__ */ir("preserve",lr),colorScheme:/* @__PURE__ */ir("preserve",lr),themeCategorical:/* @__PURE__ */ir("preserve",lr),themeSemantic:/* @__PURE__ */ir("preserve",lr),themeSequential:/* @__PURE__ */ir("preserve",lr),themeDiverging:/* @__PURE__ */ir("preserve",lr),barColors:/* @__PURE__ */ir("preserve",lr),decay:/* @__PURE__ */ir("preserve",lr),pulse:/* @__PURE__ */ir("preserve",lr),staleness:/* @__PURE__ */ir("preserve",lr),layoutSelection:/* @__PURE__ */ir("preserve",lr),windowSize:/* @__PURE__ */ir("preserve",cr),windowMode:/* @__PURE__ */ir("preserve",cr),clock:/* @__PURE__ */ir("preserve",cr),transition:/* @__PURE__ */ir("preserve",cr),introAnimation:/* @__PURE__ */ir("preserve",cr),onLayoutError:/* @__PURE__ */ir("preserve",cr)},ur=/* @__PURE__ */ir("preserve",nr),dr=class{constructor(){this.tracker=new zo}get last(){return this.tracker.last}subscribe(e){return this.tracker.subscribe(e)}recordData(e,t){return this.tracker.record({kind:e,...void 0===t?{}:{count:t}},tr)}recordNoop(e){return this.tracker.record({kind:e,..."restyle"===e?{}:{count:0}},[])}recordRestyle(e){return e?this.tracker.record({kind:"restyle"},or):this.recordNoop("restyle")}recordConfig(e){let t=y(e);return this.tracker.record({kind:"config",keys:e},t.invalidations)}};import{quadtree as mr}from"d3-quadtree";var gr=class extends _t{constructor(e){super(),this.rExtent=new je,this.rExtents=[],this.windowSizeWarned=!1,this.updateResults=new dr,this.rAccessors=[],this.categories=/* @__PURE__ */new Set,this._hasStreamingData=!1,this.styleResolver=new Zi,this.timestampBuffer=null,this.activeTransition=null,this.prevPositionMap=/* @__PURE__ */new Map,this.exitNodes=[],this.lastIngestTime=0,this.scales=null,this.multiScales=[],this.scene=[],this.columns={},this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customLayoutFailedThisBuild=!1,this._customLayoutDiagnosticsWarned=/* @__PURE__ */new Set,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=/* @__PURE__ */new WeakMap,this.version=0,this._dataVersion=0,this._bufferArrayCache=null,this._pointQuadtree=null,this._maxPointRadius=0,this._datumIndexCache=null,this._categoryIndexCache=null,this._hasRenderedOnce=!1,this.config=e,this.buffer=new Ze(e.windowSize),this.getO=gt(e.categoryAccessor||e.oAccessor,"category");let t="streaming"===e.runtimeMode,o=e.valueAccessor||e.rAccessor;Array.isArray(o)?(this.rAccessors=o.map(e=>mt(e,"value")),this.getR=this.rAccessors[0],this.rExtents=o.map(()=>new je)):(t&&e.timeAccessor,this.getR=mt(o,"value"),this.rAccessors=[this.getR],this.rExtents=[this.rExtent]),this.getStack=gt(e.stackBy),this.getGroup=gt(e.groupBy),this.getColor=gt(e.colorAccessor),this.getSymbol=gt(e.symbolAccessor),this.getConnector=gt(e.connectorAccessor),this.getDataId=gt(e.dataIdAccessor),e.pulse&&(this.timestampBuffer=new Ze(e.windowSize))}syncPulseTimestampBuffer(){var e,t,o,i;this.timestampBuffer=(e=!!this.config.pulse,t=this.buffer,o=this.timestampBuffer,i=this.currentTime(),e?null!=o&&o.capacity===t.capacity&&o.size===t.size?o:ot(t,i):null)}currentTime(){return this.config.clock?.()??Fi()}ingest(e){let t=this.currentTime();if(this.lastIngestTime=t,this._dataVersion++,e.bounded){this.buffer.clear(),this.rExtent.clear();for(let e of this.rExtents)e.clear();e.preserveCategoryOrder?this._hasStreamingData=!0:this.categories.clear(),this.timestampBuffer&&this.timestampBuffer.clear();let o=e.totalSize||e.inserts.length;tt(this.buffer,o,this.timestampBuffer);for(let o of e.inserts)it(this.buffer,o,this.timestampBuffer,t),this.categories.add(this.getO(o)),this.pushValueExtent(o)}else{this._hasStreamingData=!0;for(let o of e.inserts){let e=it(this.buffer,o,this.timestampBuffer,t);this.categories.add(this.getO(o)),this.pushValueExtent(o),null!=e&&this.evictValueExtent(e)}}return this.updateResults.recordData(e.bounded?"replace":"ingest",e.inserts.length),!0}ingestWithResult(e){return this.ingest(e),this.updateResults.last}pushValueExtent(e){if("timeline"===this.config.chartType){let t=this.getRawRange(e);t&&(this.rExtent.push(t[0]),this.rExtent.push(t[1]))}else if(this.rAccessors.length>1){for(let t=0;t<this.rAccessors.length;t++)this.rExtents[t].push(this.rAccessors[t](e));this.rExtent.push(this.getR(e))}else this.rExtent.push(this.getR(e))}evictValueExtent(e){if("timeline"===this.config.chartType){let t=this.getRawRange(e);t&&(this.rExtent.evict(t[0]),this.rExtent.evict(t[1]))}else if(this.rAccessors.length>1){for(let t=0;t<this.rAccessors.length;t++)this.rExtents[t].evict(this.rAccessors[t](e));this.rExtent.evict(this.getR(e))}else this.rExtent.evict(this.getR(e))}getRawRange(e){let t=this.config.valueAccessor||this.config.rAccessor;if(!t)return null;let o="function"==typeof t?t(e):e[t];return Array.isArray(o)&&o.length>=2?[+o[0],+o[1]]:null}computeScene(e){let{config:t,buffer:o}=this,i=this.scales,r=this.multiScales,a=this.columns;if(0===o.size)return this.scales=null,this.multiScales=[],this.scene=[],this.columns={},this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=/* @__PURE__ */new WeakMap,void this.version++;this.rExtent.dirty&&("timeline"===t.chartType?(this.rExtent.clear(),o.forEach(e=>this.pushValueExtent(e))):this.rExtent.recalculate(o,this.getR));let n,s,l=this.getBufferArray(),c=t.projection||"vertical",h=t.oExtent||this.resolveCategories(l),u=this.computeValueDomain(l,h),d="vertical"===c,m="horizontal"===c,g="radial"===c,p=null!=t.barPadding?t.barPadding/(d?e.width:e.height):.1,f=Math.min(.9,Math.max(0,p));if(g){n=Qi().domain(h).range([0,1]).padding(0);let o=Math.min(e.width,e.height)/2,i=t.innerRadius||0;s=Ki().domain(u).range([i,o])}else m?(n=Qi().domain(h).range([0,e.height]).padding(f),s=Ki().domain(u).range([0,e.width])):(n=Qi().domain(h).range([0,e.width]).padding(f),s=Ki().domain(u).range([e.height,0]));this.scales={o:n,r:s,projection:c},this.rAccessors.length>1&&t.multiAxis?this.multiScales=this.rAccessors.map((i,r)=>{let a=this.rExtents[r];a.dirty&&a.recalculate(o,i);let[n,s]=a.extent;n===1/0&&(n=0,s=1);let l=t.extentPadding??.05,c=s-n,h=c>0?c*l:1;return n-=h,s+=h,n>0&&(n=0),m?Ki().domain([n,s]).range([0,e.width]):Ki().domain([n,s]).range([e.height,0])}):this.multiScales=[];let y=l;this.rAccessors.length>1&&(y=l.flatMap(e=>this.rAccessors.map((t,o)=>({...e,__rIndex:o,__rValue:t(e),__rName:this.resolveRAccessorName(o)})))),this.columns=this.buildColumns(y,h,n,c,e),this._customLayoutFailedThisBuild=!1;let v=this.buildSceneNodes(y,e);this._customLayoutFailedThisBuild?!0===this.lastCustomLayoutFailure?.preservedLastGoodScene?(this.scales=i,this.multiScales=r,this.columns=a):(this.scene=[],this.rebuildPointQuadtree()):(this.config.transition&&this.scene.length>0&&this.snapshotPositions(),this.scene=v,this.rebuildPointQuadtree(),this.config.decay&&this.applyDecay(this.scene,l),this.config.pulse&&this.applyPulse(this.scene,l),this.config.transition&&!this._hasRenderedOnce&&this.scene.length>0&&(this.config.introAnimation&&this.synthesizeIntroPositions(),this._hasRenderedOnce=!0),this.config.transition&&this.prevPositionMap.size>0&&this.startTransition(),this.version++)}resolveRAccessorName(e){let t=this.config.valueAccessor||this.config.rAccessor,o=Array.isArray(t)?t[e]:t;return"string"==typeof o?o:`value${e}`}resolveCategories(e){let t=this.config.oSort,o="streaming"===this.config.runtimeMode||this._hasStreamingData,i="auto"===t?void 0:t,r=null;if(o){r=/* @__PURE__ */new Set;for(let t of e)r.add(this.getO(t))}let a=r?Array.from(this.categories).filter(e=>r.has(e)):Array.from(this.categories);if(o&&void 0===i){let e=Math.max(50,3*r.size);if(this.categories.size>e){let t=this.categories.size-e;for(let e of this.categories){if(t<=0)break;r.has(e)||(this.categories.delete(e),t--)}}return a}if(!1===i)return a;if("function"==typeof i)return a.sort(i);let n=/* @__PURE__ */new Map;for(let t of e){let e=this.getO(t);n.set(e,(n.get(e)||0)+Math.abs(this.getR(t)))}return"asc"===i?a.sort((e,t)=>(n.get(e)||0)-(n.get(t)||0)):a.sort((e,t)=>(n.get(t)||0)-(n.get(e)||0))}computeValueDomain(e,t){return g({data:e,chartType:this.config.chartType,projection:this.config.projection,normalize:this.config.normalize,rExtent:this.config.rExtent,extentPadding:this.config.extentPadding,baselinePadding:this.config.baselinePadding,axisExtent:this.config.axisExtent,getO:this.getO,getR:this.getR,getStack:this.getStack,rawRExtent:this.rExtent.extent})}buildColumns(e,t,o,i,r){return p({data:e,oExtent:t,oScale:o,projection:i,layout:r,dynamicColumnWidth:this.config.dynamicColumnWidth,getO:this.getO,getR:this.getR})}getSceneContext(){return{scales:this.scales,columns:this.columns,config:this.config,getR:this.getR,getStack:this.getStack,getGroup:this.getGroup,getColor:this.getColor,getSymbol:this.getSymbol,getConnector:this.getConnector,getO:this.getO,multiScales:this.multiScales,rAccessors:this.rAccessors,resolvePieceStyle:(e,t)=>this.styleResolver.resolvePieceStyle(this.config,e,t),resolveSummaryStyle:(e,t)=>this.styleResolver.resolveSummaryStyle(this.config,e,t),getRawRange:e=>this.getRawRange(e)}}buildSceneNodes(e,t){if(!this.scales)return[];if(this.config.customLayout){let o=this.buildLayoutContext(e,t),i=Ct({family:"ordinal",logLabel:"ordinal customLayout",revision:this.version,hasPreviousResult:null!==this.lastCustomLayoutResult,onLayoutError:this.config.onLayoutError,run:()=>this.config.customLayout(o)});if("failure"===i.kind)return this.lastCustomLayoutFailure=i.diagnostic,this._customLayoutFailedThisBuild=!0,i.preservedLastGoodScene?this.scene:(this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=/* @__PURE__ */new WeakMap,[]);let r=i.result;this.customLayoutOverlays=r.overlays??null,this.lastCustomLayoutResult=r,this.lastCustomLayoutFailure=null;let a=r.nodes??[];if(this._customRestyle=r.restyle,this.hasCustomRestyle=!!r.restyle,this.hasCustomRestyle){this._baseStyles=/* @__PURE__ */new WeakMap;for(let e of a)e.style&&this._baseStyles.set(e,e.style);this.applyCustomRestyle(a,this.config.layoutSelection??null)}return Pt({label:"ordinal customLayout",nodes:a,overlays:this.customLayoutOverlays,warned:this._customLayoutDiagnosticsWarned}),a}this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1;let o=this.getSceneContext(),i=er[this.config.chartType],a=i?i(o,t):[];return this.getConnector&&this.scales&&(a=[...r(o,a),...a]),a}buildLayoutContext(e,t){let o=this.config,i=o.layoutMargin??{top:0,right:0,bottom:0,left:0},r=Gt(o.colorScheme,o.themeCategorical,ui),a=this.scales,n="radial"===a.projection?{x:-t.width/2,y:-t.height/2,width:t.width,height:t.height}:{x:0,y:0,width:t.width,height:t.height};return{data:e,scales:{o:a.o,r:a.r,projection:a.projection},dimensions:{width:t.width,height:t.height,margin:i,plot:n},theme:{semantic:o.themeSemantic??{},categorical:[...r]},resolveColor:qt(r,o.colorScheme),config:o.layoutConfig??{},selection:o.layoutSelection??null}}computeDecayOpacity(e,t){let o=this.config.decay;return!o||t<=1?1:St(o,e,t)}getDatumIndexMap(e){if(this._datumIndexCache&&this._datumIndexCache.version===this._dataVersion)return this._datumIndexCache.map;let t=Rt(e);return this._datumIndexCache={version:this._dataVersion,map:t},t}getCategoryIndexMap(e){if(this._categoryIndexCache&&this._categoryIndexCache.version===this._dataVersion)return this._categoryIndexCache.map;let t=f(e,this.config.categoryAccessor||this.config.oAccessor);return this._categoryIndexCache={version:this._dataVersion,map:t},t}rebuildPointQuadtree(){let e=v(this.scene);this._pointQuadtree=e.quadtree,this._maxPointRadius=e.maxRadius}get pointQuadtree(){return this._pointQuadtree}get maxPointRadius(){return this._maxPointRadius}applyDecay(e,t){if(!this.config.decay)return;let o=t.length;if(o<=1)return;let i=this.getDatumIndexMap(t);for(let t of e){if("connector"===t.type||"violin"===t.type||"boxplot"===t.type||"wedge"===t.type||!t.datum)continue;let e=i.get(t.datum);if(null==e)continue;let r=this.computeDecayOpacity(e,o),a=t.style?.opacity??1;t.style={...t.style,opacity:a*r}}}applyPulse(e,t,o=this.currentTime()){return!(!this.config.pulse||!this.timestampBuffer)&&i(this.config.pulse,e,this.timestampBuffer,this.getDatumIndexMap(t),e=>this.getCategoryIndexMap(t).get(e),o)}refreshPulse(e){return!0!==this.lastCustomLayoutFailure?.preservedLastGoodScene&&this.applyPulse(this.scene,this.getBufferArray(),e)}hasActivePulsesAt(e){return!!this.config.pulse&&et(this.config.pulse,this.timestampBuffer,e)}get hasActivePulses(){return this.hasActivePulsesAt(this.currentTime())}synthesizeIntroPositions(){this.prevPositionMap.clear();let e,t=/* @__PURE__ */new Map,o=this.scales?.r(0)??0,i="horizontal"!==this.scales?.projection;for(let r=0;r<this.scene.length;r++){let a=this.scene[r],n=this.getNodeKey(a,t);n&&("rect"===a.type?i?this.prevPositionMap.set(n,{x:a.x,y:o,w:a.w,h:0,opacity:a.style.opacity??1}):this.prevPositionMap.set(n,{x:o,y:a.y,w:0,h:a.h,opacity:a.style.opacity??1}):"point"===a.type?this.prevPositionMap.set(n,{x:a.x,y:a.y,r:0,opacity:0}):"wedge"===a.type&&(void 0===e&&(e=a.startAngle),this.prevPositionMap.set(n,{x:a.cx,y:a.cy,startAngle:e,endAngle:e,innerRadius:a.innerRadius,outerRadius:a.outerRadius,opacity:0})))}}getNodeKey(e,t){if("point"===e.type){let o=`p:${e.datum?this.getO(e.datum):""}:${e.datum?this.getR(e.datum):0}`,i=t.get(o)||0;return t.set(o,i+1),`${o}:${i}`}if("rect"===e.type){let o=e.datum?null!=e.datum.category&&""!==e.datum.category?String(e.datum.category):String(this.getO(e.datum)??""):"",i=`r:${e.group||""}:${o}`,r=t.get(i)||0;return t.set(i,r+1),0===r?i:`${i}:${r}`}return"wedge"===e.type?`w:${e.category??""}`:null}snapshotPositions(){this.prevPositionMap.clear();let e=/* @__PURE__ */new Map;for(let t=0;t<this.scene.length;t++){let o=this.scene[t],i=this.getNodeKey(o,e);i&&("point"===o.type?this.prevPositionMap.set(i,{x:o.x,y:o.y,r:o.r,opacity:o.style.opacity??o.style.fillOpacity}):"rect"===o.type?this.prevPositionMap.set(i,{x:o.x,y:o.y,w:o.w,h:o.h,opacity:o.style.opacity??o.style.fillOpacity}):"wedge"===o.type&&this.prevPositionMap.set(i,{x:o.cx,y:o.cy,startAngle:o.startAngle,endAngle:o.endAngle,innerRadius:o.innerRadius,outerRadius:o.outerRadius,opacity:o.style.opacity??1}))}}startTransition(){if(!this.config.transition||0===this.prevPositionMap.size)return;let e=this.config.transition.duration??300;if(this.exitNodes.length>0){let e=new Set(this.exitNodes);this.scene=this.scene.filter(t=>!e.has(t)),this.exitNodes=[]}let t=!1,o=/* @__PURE__ */new Set,i=/* @__PURE__ */new Map;for(let e=0;e<this.scene.length;e++){let r=this.scene[e],a=this.getNodeKey(r,i);if(!a)continue;r._transitionKey=a;let n=this.prevPositionMap.get(a);if("point"===r.type)n?(o.add(a),r._targetOpacity=r.style.opacity??r.style.fillOpacity??1,(n.x!==r.x||n.y!==r.y||void 0!==n.r&&n.r!==r.r)&&(r._targetX=r.x,r._targetY=r.y,r._targetR=r.r,r.x=n.x,r.y=n.y,void 0!==n.r&&(r.r=n.r),t=!0)):(r._targetOpacity=r.style.opacity??r.style.fillOpacity??1,r._targetR=r.r,r.r=0,r.style={...r.style,opacity:0},t=!0);else if("rect"===r.type)n?(o.add(a),r._targetOpacity=r.style.opacity??r.style.fillOpacity??1,(n.x!==r.x||n.y!==r.y||n.w!==r.w||n.h!==r.h)&&(r._targetX=r.x,r._targetY=r.y,r._targetW=r.w,r._targetH=r.h,r.x=n.x,r.y=n.y,r.w=n.w??r.w,r.h=n.h??r.h,t=!0)):(r._targetOpacity=r.style.opacity??r.style.fillOpacity??1,r.style={...r.style,opacity:0},t=!0);else if("wedge"===r.type)if(n)o.add(a),r._targetOpacity=r.style.opacity??r.style.fillOpacity??1,(n.startAngle!==r.startAngle||n.endAngle!==r.endAngle)&&(r._targetStartAngle=r.startAngle,r._targetEndAngle=r.endAngle,r.startAngle=n.startAngle,r.endAngle=n.endAngle,t=!0);else{r._targetOpacity=r.style.opacity??r.style.fillOpacity??1,r._targetStartAngle=r.startAngle,r._targetEndAngle=r.endAngle;let e=r.startAngle;r.startAngle=e,r.endAngle=e,r.style={...r.style,opacity:0},this.prevPositionMap.set(a,{x:r.cx,y:r.cy,startAngle:e,endAngle:e,innerRadius:r.innerRadius,outerRadius:r.outerRadius,opacity:0}),t=!0}}this.exitNodes=[];for(let[e,i]of this.prevPositionMap)if(!o.has(e)){if(e.startsWith("p:"))this.exitNodes.push({type:"point",x:i.x,y:i.y,r:i.r??3,style:{opacity:i.opacity??1},datum:null,_targetOpacity:0,_transitionKey:e});else if(e.startsWith("r:"))this.exitNodes.push({type:"rect",x:i.x,y:i.y,w:i.w??0,h:i.h??0,style:{opacity:i.opacity??1,fill:"#999"},datum:null,_targetOpacity:0,_transitionKey:e});else if(e.startsWith("w:")){let t=((i.startAngle??0)+(i.endAngle??0))/2,o={type:"wedge",cx:i.x,cy:i.y,innerRadius:i.innerRadius??0,outerRadius:i.outerRadius??100,startAngle:i.startAngle??0,endAngle:i.endAngle??0,style:{opacity:i.opacity??1},datum:null,category:e.slice(2),_targetStartAngle:t,_targetEndAngle:t,_targetOpacity:0,_transitionKey:e};this.exitNodes.push(o)}t=!0}this.exitNodes.length>0&&(this.scene=[...this.scene,...this.exitNodes]),t&&(this.activeTransition={startTime:this.currentTime(),duration:e})}advanceTransition(e){if(!this.activeTransition)return!1;let t=Bi(e,this.activeTransition),o="linear"===this.config.transition?.easing?"linear":"ease-out-cubic",i=Hi(t,o);for(let e of this.scene){let t=e._transitionKey;if(t)if("point"===e.type){if(void 0!==e._targetOpacity){let o=this.prevPositionMap.get(t),r=o?o.opacity??1:0;e.style.opacity=$i(r,e._targetOpacity,i)}let o=this.prevPositionMap.get(t);void 0!==e._targetX&&o&&(e.x=$i(o.x,e._targetX,i),e.y=$i(o.y,e._targetY,i)),void 0!==e._targetR&&void 0!==o?.r&&(e.r=$i(o.r,e._targetR,i))}else if("rect"===e.type){if(void 0!==e._targetOpacity){let o=this.prevPositionMap.get(t),r=o?o.opacity??1:0;e.style.opacity=$i(r,e._targetOpacity,i)}if(void 0===e._targetX)continue;let o=this.prevPositionMap.get(t);if(!o)continue;e.x=$i(o.x,e._targetX,i),e.y=$i(o.y,e._targetY,i),void 0!==o.w&&(e.w=$i(o.w,e._targetW,i),e.h=$i(o.h,e._targetH,i))}else if("wedge"===e.type){if(void 0!==e._targetOpacity){let o=this.prevPositionMap.get(t),r=o?o.opacity??1:0;e.style={...e.style,opacity:$i(r,e._targetOpacity,i)}}if(void 0!==e._targetStartAngle&&void 0!==e._targetEndAngle){let o=this.prevPositionMap.get(t);o&&void 0!==o.startAngle&&(e.startAngle=$i(o.startAngle,e._targetStartAngle,i),e.endAngle=$i(o.endAngle,e._targetEndAngle,i))}}}if(t>=1){for(let e of this.scene)if(void 0!==e._targetOpacity&&(e.style={...e.style||{},opacity:0===e._targetOpacity?0:e._targetOpacity},e._targetOpacity=void 0),"point"===e.type){if(void 0===e._targetX&&void 0===e._targetR)continue;void 0!==e._targetX&&(e.x=e._targetX,e.y=e._targetY),void 0!==e._targetR&&(e.r=e._targetR),e._targetX=void 0,e._targetY=void 0,e._targetR=void 0}else if("rect"===e.type){if(void 0===e._targetX)continue;e.x=e._targetX,e.y=e._targetY,e.w=e._targetW,e.h=e._targetH,e._targetX=void 0,e._targetY=void 0,e._targetW=void 0,e._targetH=void 0}else"wedge"===e.type&&void 0!==e._targetStartAngle&&(e.startAngle=e._targetStartAngle,e.endAngle=e._targetEndAngle,e._targetStartAngle=void 0,e._targetEndAngle=void 0);if(this.exitNodes.length>0){let e=new Set(this.exitNodes);this.scene=this.scene.filter(t=>!e.has(t)),this.exitNodes=[]}return this.activeTransition=null,!1}return!0}cancelIntroAnimation(){this.prevPositionMap.clear(),this.activeTransition=null,ze(this.scene),this.exitNodes=[]}getBufferArray(){return this._bufferArrayCache?.version!==this._dataVersion&&(this._bufferArrayCache={version:this._dataVersion,data:this.buffer.toArray()}),this._bufferArrayCache.data}getData(){return this.buffer.toArray()}remove(e){if(!this.getDataId)throw new Error("remove() requires dataIdAccessor to be configured");this.config.transition&&this.scene.length>0&&this.snapshotPositions();let t=Ne(e),o=this.getDataId,i=e=>t.has(o(e));rt(this.buffer,this.timestampBuffer,i);let r=this.buffer.remove(i);if(0===r.length)return this.updateResults.recordNoop("remove"),r;for(let e of r)this.evictValueExtent(e);return this.categories.clear(),this.buffer.forEach(e=>this.categories.add(this.getO(e))),this._dataVersion++,this.version++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("remove",r.length),r}update(e,t){if(!this.getDataId)throw new Error("update() requires dataIdAccessor to be configured");let o=Ne(e),i=this.getDataId,r=/* @__PURE__ */new Set;this.buffer.forEach((e,t)=>{o.has(i(e))&&r.add(t)});let a=this.buffer.update(e=>o.has(i(e)),t);if(0===a.length)return this.updateResults.recordNoop("update"),a;for(let e of a)this.evictValueExtent(e);return this.categories.clear(),this.buffer.forEach((e,t)=>{this.categories.add(this.getO(e)),r.has(t)&&this.pushValueExtent(e)}),this._dataVersion++,this.version++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("update",a.length),a}clear(){this.buffer.clear(),this.rExtent.clear(),this.categories.clear(),this._hasStreamingData=!1,this._hasRenderedOnce=!1,this.timestampBuffer&&this.timestampBuffer.clear(),this.prevPositionMap.clear(),this.exitNodes=[],this.activeTransition=null,this.lastIngestTime=0,this.scales=null,this.scene=[],this.columns={},this.multiScales=[],this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=/* @__PURE__ */new WeakMap,this._pointQuadtree=null,this._maxPointRadius=0,this.styleResolver.resetColors(),this._dataVersion++,this.version++,this.updateResults.recordData("clear")}get size(){return this.buffer.size}getOAccessor(){return this.getO}getRAccessor(){return this.getR}applyCustomRestyle(e,t){let o=this._customRestyle;if(o)for(let i of e){let e=this._baseStyles.get(i)??i.style??{},r=o(i,t);i.style=r?{...e,...r}:e}}restyleScene(e){this._customRestyle?(this.applyCustomRestyle(this.scene,e),this.markStylePaintPending(),this.updateResults.recordRestyle(!0)):this.updateResults.recordRestyle(!1)}rebuildAccessorDerivedState(){this.categories.clear(),this.rExtent.clear();for(let e of this.rExtents)e.clear();this._categoryIndexCache=null,this.buffer.forEach(e=>{this.categories.add(this.getO(e)),this.pushValueExtent(e)})}updateConfig(e){let t={...this.config},o=Object.keys(e).filter(o=>e[o]!==t[o]);"production"!==process.env.NODE_ENV&&!this.windowSizeWarned&&"windowSize"in e&&e.windowSize!==t.windowSize&&(this.windowSizeWarned=!0,console.warn(`[Semiotic] windowSize changed after mount (${t.windowSize} → ${e.windowSize}) but it is a mount-only setting — the ring buffer keeps its original capacity. Remount the chart (e.g. via a React key) to apply a new windowSize.`)),("colorScheme"in e&&e.colorScheme!==t.colorScheme||"themeCategorical"in e&&e.themeCategorical!==t.themeCategorical||"colorAccessor"in e&&!dt(e.colorAccessor,t.colorAccessor))&&this.styleResolver.resetColors(),("categoryAccessor"in e&&!dt(e.categoryAccessor,t.categoryAccessor)||"oAccessor"in e&&!dt(e.oAccessor,t.oAccessor))&&(this._categoryIndexCache=null),Object.assign(this.config,e),"pulse"in e&&this.syncPulseTimestampBuffer();let i=!1;if("categoryAccessor"in e||"oAccessor"in e){let e=this.config.categoryAccessor||this.config.oAccessor,o=t.categoryAccessor||t.oAccessor;dt(e,o)||(this.getO=gt(this.config.categoryAccessor||this.config.oAccessor,"category"),i=!0)}let r=!1;if("valueAccessor"in e||"rAccessor"in e){let e=this.config.valueAccessor||this.config.rAccessor,o=t.valueAccessor||t.rAccessor,i=Array.isArray(e)?e:[e],a=Array.isArray(o)?o:[o];if(r=i.length!==a.length||i.some((e,t)=>!dt(e,a[t])),r){let e=this.config.valueAccessor||this.config.rAccessor;Array.isArray(e)?(this.rAccessors=e.map(e=>mt(e,"value")),this.getR=this.rAccessors[0],this.rExtents=e.map(()=>new je)):(this.getR=mt(e,"value"),this.rAccessors=[this.getR],this.rExtents=[this.rExtent])}}"stackBy"in e&&!dt(e.stackBy,t.stackBy)&&(this.getStack=null!=this.config.stackBy?gt(this.config.stackBy):void 0),"groupBy"in e&&!dt(e.groupBy,t.groupBy)&&(this.getGroup=null!=this.config.groupBy?gt(this.config.groupBy):void 0),"colorAccessor"in e&&!dt(e.colorAccessor,t.colorAccessor)&&(this.getColor=null!=this.config.colorAccessor?gt(this.config.colorAccessor):void 0),"symbolAccessor"in e&&!dt(e.symbolAccessor,t.symbolAccessor)&&(this.getSymbol=null!=this.config.symbolAccessor?gt(this.config.symbolAccessor):void 0),"connectorAccessor"in e&&!dt(e.connectorAccessor,t.connectorAccessor)&&(this.getConnector=null!=this.config.connectorAccessor?gt(this.config.connectorAccessor):void 0);let a="accessorRevision"in e&&e.accessorRevision!==t.accessorRevision;(i||r||a)&&this.rebuildAccessorDerivedState(),this.updateResults.recordConfig(o)}updateConfigWithResult(e){return this.updateConfig(e),this.updateResults.last}};import{useCallback as pr,useImperativeHandle as fr}from"react";import{useMemo as yr,useRef as vr,useId as br}from"react";import{Fragment as xr,jsx as wr,jsxs as kr}from"react/jsx-runtime";import*as Ar from"react";import{jsx as Sr}from"react/jsx-runtime";var Rr=null,Pr=null;import{arc as Cr}from"d3-shape";var _r=(e,t)=>({x:e*Math.cos(t),y:e*Math.sin(t)}),Lr=(e,t,o,i)=>{let r=t.filter(e=>"wedge"===e.type);for(let t of r){let o=t.style.fillOpacity??1,i=t.style.opacity??1,r=t.style.strokeWidth??1,a=t.style.stroke,n=!!(a&&"none"!==a&&r>0);if(e.globalAlpha=o*i,t._gradientBand&&t._gradientBand.colors.length>0)N(e,t),t._pulseIntensity&&t._pulseIntensity>0&&(z(e,t),zt(e,t)),e.globalAlpha=1;else{if(e.fillStyle=ki(e,t.style.fill,"#007bff"),t.roundedEnds){n&&(e.strokeStyle=yi(e,a)||a,e.lineWidth=r);let o=W({innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle,endAngle:t.endAngle,cornerRadius:t.cornerRadius,roundStart:t.roundedEnds.start,roundEnd:t.roundedEnds.end});e.save(),e.translate(t.cx,t.cy);let i=new Path2D(o);e.fill(i),n&&e.stroke(i),e.restore()}else t.cornerRadius?(n&&(e.strokeStyle=yi(e,a)||a,e.lineWidth=r),V(e,t)):(z(e,t),e.fill(),n&&(e.strokeStyle=yi(e,a)||a,e.lineWidth=r,e.stroke()));t._pulseIntensity&&t._pulseIntensity>0&&(z(e,t),zt(e,t)),e.globalAlpha=1}}},Mr=(e,t,o,i)=>{let r=t.filter(e=>"boxplot"===e.type);for(let t of r){let o=t.columnWidth/2,i="vertical"===t.projection,r=yi(e,"var(--semiotic-primary, #007bff)"),a=yi(e,"var(--semiotic-text, #333)"),n=ki(e,t.style.fill,r),s=t.style.stroke,l="string"==typeof s?yi(e,s)||s:a,c=t.style.strokeWidth??1,h=c>0&&!("string"==typeof s&&"none"===s.trim().toLowerCase()),u=t.style.fillOpacity??t.style.opacity??.6;if(e.save(),h&&(e.strokeStyle=l,e.lineWidth=c,e.beginPath(),i?(e.moveTo(t.x,t.minPos),e.lineTo(t.x,t.maxPos)):(e.moveTo(t.minPos,t.y),e.lineTo(t.maxPos,t.y)),e.stroke(),e.beginPath(),i?(e.moveTo(t.x-.4*o,t.minPos),e.lineTo(t.x+.4*o,t.minPos),e.moveTo(t.x-.4*o,t.maxPos),e.lineTo(t.x+.4*o,t.maxPos)):(e.moveTo(t.minPos,t.y-.4*o),e.lineTo(t.minPos,t.y+.4*o),e.moveTo(t.maxPos,t.y-.4*o),e.lineTo(t.maxPos,t.y+.4*o)),e.stroke()),e.globalAlpha=u,e.fillStyle=n,i){let i=Math.min(t.q1Pos,t.q3Pos),r=Math.abs(t.q3Pos-t.q1Pos);e.fillRect(t.x-o,i,t.columnWidth,r),e.globalAlpha=1,h&&e.strokeRect(t.x-o,i,t.columnWidth,r)}else{let i=Math.min(t.q1Pos,t.q3Pos),r=Math.abs(t.q3Pos-t.q1Pos);e.fillRect(i,t.y-o,r,t.columnWidth),e.globalAlpha=1,h&&e.strokeRect(i,t.y-o,r,t.columnWidth)}h&&(e.strokeStyle=l,e.lineWidth=2*c,e.beginPath(),i?(e.moveTo(t.x-o,t.medianPos),e.lineTo(t.x+o,t.medianPos)):(e.moveTo(t.medianPos,t.y-o),e.lineTo(t.medianPos,t.y+o)),e.stroke()),e.restore()}},Ir=/* @__PURE__ */new WeakMap,Tr=(e,t,o,i)=>{for(let o of t){if("violin"!==o.type)continue;e.save(),(o.translateX||o.translateY)&&e.translate(o.translateX,o.translateY);let t=Ir.get(o);(!t||t.source!==o.pathString)&&(t={source:o.pathString,path:new Path2D(o.pathString)},Ir.set(o,t));let i=t.path;e.globalAlpha=o.style.fillOpacity??o.style.opacity??.6,e.fillStyle=ki(e,o.style.fill,"#007bff"),e.fill(i),e.globalAlpha=1;let r=o.style.strokeWidth??1;if(o.style.stroke&&"none"!==o.style.stroke&&r>0&&(e.strokeStyle=yi(e,o.style.stroke)||o.style.stroke,e.lineWidth=r,e.stroke(i)),o.iqrLine){e.strokeStyle="#333",e.lineWidth=2,e.globalAlpha=.8;let t=o.iqrLine.centerPos,i=!1!==o.iqrLine.isVertical;e.beginPath(),i?(e.moveTo(t,o.iqrLine.q1Pos),e.lineTo(t,o.iqrLine.q3Pos)):(e.moveTo(o.iqrLine.q1Pos,t),e.lineTo(o.iqrLine.q3Pos,t)),e.stroke(),e.beginPath(),i?e.arc(t,o.iqrLine.medianPos,3,0,2*Math.PI):e.arc(o.iqrLine.medianPos,t,3,0,2*Math.PI),e.fillStyle="#fff",e.fill(),e.strokeStyle="#333",e.lineWidth=1,e.stroke(),e.globalAlpha=1}e.restore()}},Hr=(e,t,o,i)=>{let r=t.filter(e=>"connector"===e.type);if(0===r.length)return;let a=/* @__PURE__ */new Map;for(let e of r){let t=e.group||"_default";a.has(t)||a.set(t,[]),a.get(t).push(e)}for(let[,t]of a){if(0===t.length)continue;let o=t[0].style;if(o.fill&&"none"!==o.fill){e.beginPath(),e.moveTo(t[0].x1,t[0].y1);for(let o of t)e.lineTo(o.x2,o.y2);e.closePath(),e.globalAlpha=o.fillOpacity??o.opacity??.3,e.fillStyle=Ai(e,o.fill)??"#999",e.fill(),e.globalAlpha=1}for(let o of t){let t=o.style.strokeWidth??1;t<=0||"none"===o.style.stroke||(e.beginPath(),e.moveTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.strokeStyle=yi(e,o.style.stroke)||ki(e,o.style.fill,"")||yi(e,"var(--semiotic-border, #999)"),e.lineWidth=t,e.globalAlpha=o.style.opacity??.5,e.stroke(),e.globalAlpha=1)}}},Br=(e,t,o,i)=>{let r=t.filter(e=>"trapezoid"===e.type);for(let t of r){let o=t.points;if(o.length<4)continue;e.globalAlpha=t.style?.opacity??1,e.beginPath(),e.moveTo(o[0][0],o[0][1]);for(let t=1;t<o.length;t++)e.lineTo(o[t][0],o[t][1]);e.closePath(),e.fillStyle=Ai(e,t.style?.fill)||"#999",e.fill();let i=t.style?.strokeWidth??1;t.style?.stroke&&"none"!==t.style.stroke&&i>0&&(e.strokeStyle=yi(e,t.style.stroke)||t.style.stroke,e.lineWidth=i,e.stroke()),e.globalAlpha=1}},$r={stroke:"rgba(255,255,255,0.5)",lineWidth:1.5,spacing:6,angle:45,lineOpacity:1},Fr=/* @__PURE__ */new Map,Or=/* @__PURE__ */J(De),Dr=/* @__PURE__ */J(lt),Er=/* @__PURE__ */J(ct),Wr=/* @__PURE__ */J(ht),jr=e=>[Hr,...e],Nr={bar:/* @__PURE__ */jr([Or]),clusterbar:/* @__PURE__ */jr([Or]),point:/* @__PURE__ */jr([Dr,Er]),swarm:/* @__PURE__ */jr([Dr,Er]),pie:[Lr],donut:[Lr],boxplot:/* @__PURE__ */jr([Mr,Dr]),violin:/* @__PURE__ */jr([Tr]),histogram:/* @__PURE__ */jr([Or]),ridgeline:/* @__PURE__ */jr([Tr]),timeline:/* @__PURE__ */jr([Or]),funnel:[Or,Br,(e,t,o,i)=>{let r=t.filter(e=>"rect"===e.type&&null!=e.datum);if(0===r.length||!r.some(e=>null!=e.datum?.__funnelStepLabel||null!=e.datum?.__funnelValueLabelX))return;let a=yi(e,"var(--semiotic-font-family, sans-serif)")||"sans-serif";e.textBaseline="top",e.lineJoin="round",e.textAlign="center",e.font=`bold 14px ${a}`;for(let t of r){let o=t.datum;if(!o||!o.__funnelStepLabel)continue;let i=o.__funnelStepLabel;if(e.measureText(i).width+16>(o.__funnelRowWidth??o.__funnelBarW??0))continue;let r=o.__funnelStepLabelX,a=o.__funnelStepLabelY+3;e.strokeStyle="rgba(0,0,0,0.6)",e.lineWidth=3,e.strokeText(i,r,a),e.fillStyle="#fff",e.fillText(i,r,a)}e.font=`bold 13px ${a}`;for(let t of r){let o=t.datum;if(!o||null==o.__funnelValueLabelX)continue;let i=o.__funnelBarW??0;if(i<60)continue;let r=o.__funnelValue;if(null==r||0===r)continue;let a,n=o.__funnelPercent,s=!0===o.__funnelIsFirstStep;if(a=s?G(r):null!=n?`${G(r)} (${q(n)})`:G(r),e.measureText(a).width+16>i){if(s||null==n)continue;if(a=G(r),e.measureText(a).width+16>i)continue}let l=o.__funnelValueLabelX,c=(o.__funnelValueLabelY??t.y)+14+5;e.textAlign="center",e.strokeStyle="rgba(0,0,0,0.5)",e.lineWidth=3,e.strokeText(a,l,c),e.fillStyle="#fff",e.fillText(a,l,c)}e.lineWidth=1,e.lineJoin="miter"}],"bar-funnel":[Or,(e,t,o,i)=>{let r=t.filter(e=>"rect"===e.type&&!0===e.datum?.__barFunnelIsDropoff);for(let t of r){let o=("string"==typeof t.style.fill?t.style.fill:null)||yi(e,"var(--semiotic-border, #999)"),i=X(o,e);e.globalAlpha=t.style.opacity??1,e.beginPath(),e.rect(t.x,t.y,t.w,t.h),i?e.fillStyle=i:(e.fillStyle=o,e.globalAlpha=.4*(t.style.opacity??1)),e.fill(),e.globalAlpha=1}},(e,t,o,i)=>{let r=t.filter(e=>"rect"===e.type&&!0!==e.datum?.__barFunnelIsDropoff&&null!=e.datum?.__barFunnelLabelX);if(0===r.length)return;let a=yi(e,"var(--semiotic-font-family, sans-serif)")||"sans-serif",n=Q(e,yi(e,"var(--semiotic-text, #333)")),s=n?"#1f2937":"#ffffff",l=n?"rgba(255,255,255,0.18)":"rgba(0,0,0,0.12)",c=n?"#f3f4f6":"#1a1a1a",h=c;for(let t of r){let o=t.datum;if(!o)continue;let i=o.__barFunnelValue;if(null==i||t.w<25)continue;let r=o.__barFunnelPercent,n=!(!0===o.__barFunnelIsFirstStep)&&null!=r,u=n?Z(r):"",d=K(i);e.font=`bold 13px ${a}`;let m=n?e.measureText(u).width:0;e.font=`11px ${a}`;let g=e.measureText(d).width,p=Math.max(m,g)+12,f=n?32:17,y=o.__barFunnelLabelX,v=y-p/2,b=o.__barFunnelLabelY-f-4;e.save(),e.shadowColor="rgba(0,0,0,0.15)",e.shadowBlur=4,e.shadowOffsetY=1,e.fillStyle=s,e.beginPath(),Y(e,v,b,p,f,4),e.fill(),e.restore(),e.strokeStyle=l,e.lineWidth=.5,e.beginPath(),Y(e,v,b,p,f,4),e.stroke(),e.textAlign="center",e.textBaseline="top",n?(e.font=`bold 13px ${a}`,e.fillStyle=c,e.fillText(u,y,b+3),e.font=`11px ${a}`,e.fillStyle=h,e.fillText(d,y,b+3+13+2)):(e.font=`bold 11px ${a}`,e.fillStyle=c,e.fillText(d,y,b+3))}e.lineWidth=1}],swimlane:/* @__PURE__ */jr([Or]),custom:/* @__PURE__ */jr([Or,Dr,Er,Wr,Lr,Mr,Tr,Br])};import*as zr from"react";import*as Vr from"react";import{arc as Gr}from"d3-shape";import{jsx as qr,jsxs as Xr}from"react/jsx-runtime";import{jsx as Yr,jsxs as Qr}from"react/jsx-runtime";import{jsx as Kr,jsxs as Zr}from"react/jsx-runtime";import{jsx as Ur,jsxs as Jr}from"react/jsx-runtime";var ea=/* @__PURE__ */le(),ta=/* @__PURE__ */Ii(function({hover:e}){let t=e.data||{},o=e.stats,i=e.category;if(Array.isArray(t)){let e=i||t[0]?.category||"";if(o)return ea({category:e,stats:o});let r=t.length;/* */
65
+ return Jr("div",{className:"semiotic-tooltip",style:Mi,children:[e&&/* @__PURE__ */Ur("div",{style:{fontWeight:"bold"},children:String(e)}),
66
+ /* @__PURE__ */Jr("div",{children:[r," items"]})]})}if(null!=t.bin&&null!=t.count){let e=t.range||[];/* */
67
+ return Jr("div",{className:"semiotic-tooltip",style:Mi,children:[t.category&&/* @__PURE__ */Ur("div",{style:{fontWeight:"bold"},children:String(t.category)}),
68
+ /* @__PURE__ */Jr("div",{children:["Count: ",t.count]}),2===e.length&&/* @__PURE__ */Jr("div",{style:{opacity:.8},children:[Number(e[0]).toFixed(1)," – ",Number(e[1]).toFixed(1)]})]})}let r=e.__oAccessor,a=e.__rAccessor,n=e.__chartType;if("swarm"===n||"point"===n)return ce(t);let s=(r&&null!=t[r]?t[r]:null)||t.category||t.name||t.group||t.__rName||"",l=t.__aggregateValue??(a&&null!=t[a]?t[a]:null)??t.value??t.__rValue??t.pct??"";return s||""!==l?/* @__PURE__ */Jr("div",{className:"semiotic-tooltip",style:Mi,children:[s&&/* @__PURE__ */Ur("div",{style:{fontWeight:"bold"},children:String(s)}),""!==l&&/* @__PURE__ */Ur("div",{children:"number"==typeof l?l.toLocaleString():String(l)})]}):ce(t)});import{jsx as oa,jsxs as ia}from"react/jsx-runtime";var ra=ut,aa=/* @__PURE__ */So(/* @__PURE__ */zi(/* @__PURE__ */Ni(function(e,t){let{chartType:i,runtimeMode:r,data:a,oAccessor:n="category",rAccessor:s="value",colorAccessor:l,symbolAccessor:c,symbolMap:h,stackBy:u,groupBy:d,multiAxis:m,timeAccessor:g,valueAccessor:p,categoryAccessor:f,accessorRevision:y,projection:v="vertical",size:x=[600,400],responsiveWidth:w,responsiveHeight:k,margin:A,maxDevicePixelRatio:S,barPadding:R,roundedTop:P,gradientFill:C,trackFill:_,baselinePadding:L,innerRadius:M,cornerRadius:I,normalize:T,startAngle:H,sweepAngle:B,dynamicColumnWidth:W,bins:j,showOutliers:N,showIQR:z,amplitude:V,connectorOpacity:G,showLabels:q,connectorAccessor:X,connectorStyle:Y,dataIdAccessor:Q,rExtent:K,oExtent:Z,extentPadding:U=.05,oSort:J,windowMode:ee="sliding",windowSize:te=200,pieceStyle:oe,summaryStyle:ie,renderMode:re,colorScheme:ae,barColors:ne,showAxes:le=!0,showCategoryTicks:ce,categoryLabel:he,valueLabel:ue,categoryFormat:de,valueFormat:me,oLabel:ge,rLabel:pe,oFormat:fe,rFormat:ye,rTickValues:ve,tickLabelEdgeAlign:be,axisExtent:xe,enableHover:we=!0,hoverRadius:ke=30,hoverAnnotation:Ae,tooltipContent:Se,customHoverBehavior:Re,customClickBehavior:Pe,onObservation:Ce,annotationObservationCallback:_e,chartId:Le,annotations:Me,onAnnotationActivate:Ie,autoPlaceAnnotations:Te,svgAnnotationRules:He,showGrid:Be=!1,legend:$e,legendHoverBehavior:Fe,legendClickBehavior:Oe,legendHighlightedCategory:De,legendIsolatedCategories:je,legendPosition:Ne,legendLayout:ze,legendCategoryAccessor:Ve,onCategoriesChange:Ye,backgroundGraphics:Ke,foregroundGraphics:Ze,interactiveGraphics:Ue,interactiveGraphicsLabel:Je,title:et,className:tt,background:ot,centerContent:it,decay:rt,pulse:lt,transition:ct,animate:ht,staleness:ut,frameScheduler:dt,clock:mt,random:gt,seed:yt,paused:vt=!1,suspendWhenHidden:xt=!0,brush:wt,onBrush:kt,accessibleTable:At=!0,description:St,summary:Rt,customLayout:Pt,onLayoutError:Ct,layoutConfig:_t,layoutSelection:Tt}=e,{customHoverBehavior:Ht,customClickBehavior:Bt,hasClickBehavior:$t}=nt({customHoverBehavior:Re,customClickBehavior:Pe,onObservation:Ce,chartId:Le,chartType:"StreamOrdinalFrame"}),Dt=f??n,Et=p??s,Wt=he??ge,jt=ue??pe,zt=de??fe,Gt=me??ye,qt=Xi(!0),Xt=Jt({sizeProp:x,responsiveWidth:w,responsiveHeight:k,userMargin:A,marginDefault:ra,title:et,legend:$e,legendPosition:Ne,...Xe(e,$e),animate:ht,transitionProp:ct,frameScheduler:dt,clock:mt,random:gt,seed:yt,paused:vt,suspendWhenHidden:xt,themeDirtyRef:qt}),{reducedMotionRef:Yt,responsiveRef:Qt,size:Zt,margin:Ut,adjustedWidth:eo,adjustedHeight:oo,currentTheme:io,transition:ao,introEnabled:co,tableId:ho,rafRef:uo,renderFnRef:mo,scheduleRender:go,frameRuntime:po}=Xt;Gi(()=>fi(()=>{qt.current=!0,go()}),[go]);let fo=Wo(),yo=No(),vo=qi(()=>Io(a),[a]),xo=Xi(null),wo=Xi(!1),[ko,Ao]=Yi(null),[So,Ro]=Yi(null),Po=Nt(Ze,Zt,Ut,So),Co=Nt(Ke,Zt,Ut,So),_o=Ke||"transparent"===ot?null:/* @__PURE__ */oa("rect",{className:"semiotic-canvas-background","data-semiotic-layer":"canvas-background",x:-Ut.left,y:-Ut.top,width:Zt[0],height:Zt[1],fill:ot||"var(--semiotic-bg, transparent)"}),Lo=Ke&&ot&&"transparent"!==ot?/* @__PURE__ */oa("rect",{className:"semiotic-canvas-background semiotic-canvas-background--combined","data-semiotic-layer":"canvas-background",x:-Ut.left,y:-Ut.top,width:Zt[0],height:Zt[1],fill:ot}):null,[Mo,To]=Yi(0),Do=Xi(0),[Eo,zo]=Yi(!1),Yo=Xi({w:-1,h:-1}),Qo=Xi(!1),Uo=Vo("StreamOrdinalFrame"),ti=we||Ae,oi="streaming"===r,ii=qi(()=>({chartType:i,runtimeMode:oi?"streaming":"bounded",windowSize:te,windowMode:ee,extentPadding:U,projection:v,oAccessor:oi?void 0:Dt,rAccessor:oi?void 0:Et,accessorRevision:y,colorAccessor:l,symbolAccessor:c,symbolMap:h,stackBy:u,groupBy:d,multiAxis:m,timeAccessor:oi?g:void 0,valueAccessor:oi?p||("string"==typeof Et||"function"==typeof Et?Et:void 0):void 0,categoryAccessor:oi?Dt:void 0,rExtent:K,oExtent:Z,axisExtent:xe,barPadding:R,roundedTop:P,gradientFill:Qe(C),trackFill:_,baselinePadding:L,innerRadius:M,cornerRadius:I,normalize:T,startAngle:H,sweepAngle:B,dynamicColumnWidth:W,bins:j,showOutliers:N,showIQR:z,amplitude:V,connectorOpacity:G,showLabels:q,connectorAccessor:X,connectorStyle:Y,dataIdAccessor:Q,oSort:J,pieceStyle:oe,summaryStyle:ie,colorScheme:ae,themeCategorical:io?.colors?.categorical,themeSemantic:_i(io),themeSequential:io?.colors?.sequential,themeDiverging:io?.colors?.diverging,barColors:ne,decay:rt,pulse:lt,transition:ao,introAnimation:co,staleness:ut,clock:po.now,customLayout:Pt,onLayoutError:Ct,layoutConfig:_t,layoutMargin:Ut}),[i,oi,te,ee,U,v,Dt,Et,y,l,c,h,u,d,m,g,p,K,Z,xe,R,P,C,_,L,M,I,T,H,B,W,j,N,z,V,G,q,X,Y,Q,J,oe,ie,ae,io,ne,rt,lt,ao,co,ut,po.now,Pt,Ct,_t,Ut]),ri=Go(ii),ai=Xi(null);ai.current||(ai.current=new gr(ri));let ni=pt(ai,Ve,Ye,e=>e.getData());Mt(ai,ri,qt,go),It(ai,Tt,qt,go);let si=Xi(null);si.current||(si.current=new We(e=>{let t=ai.current;t&&t.ingest(e)&&(qt.current=!0,go())})),b(t,{storeRef:ai,adapterRef:si,dirtyRef:qt,scheduleRender:go,hoverRef:xo,setHoverPoint:Ao}),Gi(()=>{a&&si.current?.setBoundedData(vo)},[a,vo]);let{canvasRef:li,resolutionDirtyRef:ci}=so(Xt,{storeRef:ai,dirtyRef:qt,hydrated:fo,wasHydratingFromSSR:yo,cleanup:()=>si.current?.clear(),maxDevicePixelRatio:S,canvasPaintDependencies:[i,eo,oo,le,ot,Ke,re,go]}),{hoverHandlerRef:hi,hoverLeaveRef:ui,onPointerMove:di,onPointerLeave:mi,flushPointerMove:gi,pointerStateRef:pi}=Xt;hi.current=e=>{let t=li.current;if(!t)return;let o=ai.current;if(!o)return void Bo(t);let r=$({pointer:e,canvasRect:t.getBoundingClientRect(),margin:{left:Ut.left,top:Ut.top},width:eo,height:oo,projection:v,hoverRadius:ke,scene:o.scene,pointQuadtree:o.pointQuadtree,maxPointRadius:o.maxPointRadius});if(Bo(t,"hit"===r.kind?Ho(r.hit.node):void 0),!ti)return;if("hit"!==r.kind)return void(xo.current&&(xo.current=null,Ao(null),Ht&&Ht(null),go()));let a=F(r.hit,{oAccessor:Dt,rAccessor:Et,chartType:i});xo.current=a,Ao(a),Ht?.(a),go()},ui.current=()=>{Bo(li.current),xo.current&&(xo.current=null,Ao(null),Ht?.(null),go())},Oo(li);let yi=Vi(e=>{if(no(e.target)||!Bt)return;gi();let t=li.current;if(!t)return Bt(null),void go();let o=ai.current;if(!o)return Bt(null),void go();let r=$({pointer:e,canvasRect:t.getBoundingClientRect(),margin:{left:Ut.left,top:Ut.top},width:eo,height:oo,projection:v,hoverRadius:ke,scene:o.scene,pointQuadtree:o.pointQuadtree,maxPointRadius:o.maxPointRadius});if("hit"!==r.kind)return Bt(null),void go();Bt(F(r.hit,{oAccessor:Dt,rAccessor:Et,chartType:i}),{type:"activate",inputType:bo(e.nativeEvent.pointerType)}),go()},[Bt,li,Ut.left,Ut.top,eo,oo,v,ke,Dt,Et,i,go,gi]),{kbFocusIndexRef:vi,focusedNavPointRef:bi,onKeyDown:xi,refreshKeyboardFocus:wi}=st({clearPointerHover:mi,storeRef:ai,hoverRef:xo,setHoverPoint:Ao,customHoverBehavior:Ht,customClickBehavior:Bt,scheduleRender:go,chartType:i,oAccessor:Dt,rAccessor:Et}),ki=Vi(e=>{bt(pi,e,!!ti,wo.current,li.current,"mouse")&&(vi.current=-1,bi.current=null,di(e))},[li,ti,bi,vi,di,pi]);mo.current=()=>{if(uo.current=null,!po.isActive)return;let e=li.current;if(!e)return;let t=e.getContext("2d");if(!t)return;let o=ai.current;if(!o)return;let r=po.now(),a=null!=o.activeTransition,n=o.advanceTransition(Yt.current?r+1e6:r),s=!Yt.current&&n,l=Yo.current.w!==eo||Yo.current.h!==oo,c=qt.current,h=o.consumeStylePaintPending(),u=!1,d=Uo.current.beforeCompute(o.getLastUpdateResult(),s);var m;(c||l)&&(!s||l)&&(o.computeScene({width:eo,height:oo}),wi(),Yo.current={w:eo,h:oo},u=!0,ni()),(u||h)&&(wo.current=$o(e,o.scene)),wo.current&&(a||u||h)&&(m={canvas:e,pointer:pi.current,store:o,margin:{left:Ut.left,top:Ut.top},width:eo,height:oo,projection:v,hoverRadius:ke,geometryMoved:a||u},Fo(m.canvas,m.pointer,e=>{let t=$({pointer:e,canvasRect:m.canvas.getBoundingClientRect(),margin:m.margin,width:m.width,height:m.height,projection:m.projection,hoverRadius:m.hoverRadius,scene:m.store.scene,pointQuadtree:m.geometryMoved?null:m.store.pointQuadtree,maxPointRadius:m.store.maxPointRadius});return"hit"===t.kind?Ho(t.hit.node):void 0})),Uo.current.afterCompute(d,u,l),qt.current=c&&s&&!u,ci.current=!1;let g=at(o,r,u,Qo);(u||s)&&e.setAttribute("aria-label",Ko(o.scene,i+" chart"));let p=ro(S,Zt),{effectiveDprX:f,effectiveDprY:y}=to(e,Zt,p);t.setTransform(f,0,0,y,0,0),t.clearRect(0,0,Zt[0],Zt[1]);let b=ut?.threshold??5e3,x=ut&&o.lastIngestTime>0&&r-o.lastIngestTime>b;x&&(t.globalAlpha=ut?.dimOpacity??.5);let w="radial"===v;t.save(),t.beginPath(),t.rect(Ut.left,Ut.top,eo,oo),t.clip(),w?(t.save(),t.translate(Ut.left+eo/2,Ut.top+oo/2)):t.translate(Ut.left,Ut.top);let k=Pt?Nr.custom:Nr[i]||[],A={width:eo,height:oo},R=o.scales;R&&ft({context:t,nodes:o.scene,renderMode:re,pixelRatio:p,paintBuiltIn:e=>{for(let o of k)o(t,e,R,A)}}),w&&t.restore(),t.restore(),x&&(t.globalAlpha=1),u&&o.scales?(Ro(o.scales),To(e=>e+1),Do.current=r):s&&o.scales&&r-Do.current>=33&&(To(e=>e+1),Do.current=r),ut?.showBadge&&zo(!!x),(s||null!=o.activeTransition||g.pending)&&go()},Ft(ut,ai,qt,go,po.now,Eo,zo);let Ai=ti&&ko?Se?Se(ko):/* @__PURE__ */oa(ta,{hover:ko}):null,Si="radial"===v,Ri=ko?Si?ko.x+eo/2:ko.x:0,Pi=ko?Si?ko.y+oo/2:ko.y:0,Ci=Li(Ai)?/* @__PURE__ */oa(Kt,{contentOwnsChrome:Ti(Se),x:Ri,y:Pi,containerWidth:eo,containerHeight:oo,margin:Ut,className:"stream-ordinal-tooltip",children:Ai}):null,Mi="horizontal"===v?Dt:Et,Ii=Ge("horizontal"===v?Et:Dt,void 0,"__semiotic_resolvedO",""),Hi=Ge(Mi,void 0,"__semiotic_resolvedR",""),Bi=Ii.key,$i=Hi.key,Fi=Me&&Me.length>0||!1,Oi=qe(Ii,Hi,Fi);if(jo||!fo&&yo){let e=ai.current;e&&a&&(e.ingest({inserts:vo,bounded:!0}),e.computeScene({width:eo,height:oo}),e.cancelIntroAnimation());let t=e?.scene??[],r=e?.scales??null,n=Nt(Ze,Zt,Ut,r),s=Nt(Ke,Zt,Ut,r),l="radial"===v,c=l?Ut.left+eo/2:Ut.left,h=l?Ut.top+oo/2:Ut.top;/* */
69
+ return ia("div",{ref:Qt,className:"stream-ordinal-frame"+(tt?` ${tt}`:""),role:At?"group":"img","aria-label":St||("string"==typeof et?et:"Ordinal chart"),style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:w?"100%":Zt[0],height:k?"100%":Zt[1]},children:[
70
+ /* @__PURE__ */oa(Zo,{accessibleTable:At,scene:t,chartType:i+" chart",tableId:ho,chartTitle:"string"==typeof et?et:void 0}),
71
+ /* @__PURE__ */oa(Jo,{summary:Rt}),
72
+ /* @__PURE__ */ia("svg",{xmlns:"http://www.w3.org/2000/svg",width:Zt[0],height:Zt[1],style:{position:"absolute",left:0,top:0},children:[
73
+ /* @__PURE__ */ia("g",{transform:`translate(${Ut.left},${Ut.top})`,children:[ot&&/* @__PURE__ */oa("rect",{x:0,y:0,width:eo,height:oo,fill:ot}),s]}),
74
+ /* @__PURE__ */oa("g",{transform:`translate(${c},${h})`,children:se({nodes:t,renderMode:re,idPrefix:ho}).map(e=>e.element)})]}),
75
+ /* @__PURE__ */oa(D,{width:eo,height:oo,totalWidth:Zt[0],totalHeight:Zt[1],margin:Ut,scales:r,columns:e?.columns,showAxes:le,showCategoryTicks:ce,oLabel:Wt,rLabel:jt,oFormat:zt,rFormat:Gt,rTickValues:ve,tickLabelEdgeAlign:be,axisExtent:xe,showGrid:Be,title:et,description:St,legend:$e,legendHoverBehavior:Fe,legendClickBehavior:Oe,legendHighlightedCategory:De,legendIsolatedCategories:je,legendPosition:Ne,legendLayout:ze,foregroundGraphics:Lt(n,Vt(ai.current?.customLayoutOverlays,Tt??null)),annotations:Me,onAnnotationActivate:Ie,onObservation:_e??Ce,chartId:Le,chartType:"StreamOrdinalFrame",autoPlaceAnnotations:Te,svgAnnotationRules:He,annotationFrame:0,xAccessor:Bi,yAccessor:$i,annotationData:Oi(e?.getData())}),it&&"radial"===v&&/* @__PURE__ */oa(o,{content:it,centerX:Ut.left+eo/2,centerY:Ut.top+oo/2,width:Zt[0],height:Zt[1]})]})}/* */
76
+ return ia("div",{ref:Qt,className:"stream-ordinal-frame"+(tt?` ${tt}`:""),role:"group","aria-label":St||("string"==typeof et?et:"Ordinal chart"),tabIndex:0,style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:w?"100%":Zt[0],height:k?"100%":Zt[1],overflow:"visible"},onKeyDown:xi,children:["production"!==process.env.NODE_ENV&&ai.current&&/* @__PURE__ */oa(Xo,{store:ai.current,diagnostics:Uo.current}),
77
+ /* @__PURE__ */oa(Zo,{accessibleTable:At,sceneRevision:ai.current?.getUpdateSnapshot().revisions.accessibility,scene:ai.current?.scene??[],chartType:i+" chart",tableId:ho,chartTitle:"string"==typeof et?et:void 0}),
78
+ /* @__PURE__ */oa(Jo,{summary:Rt}),
79
+ /* @__PURE__ */oa(qo,{active:vi.current>=0,hoverPoint:ko,scene:ai.current?.scene}),
80
+ /* @__PURE__ */ia("div",{role:"img","aria-label":St||("string"==typeof et?et:"Ordinal chart"),style:{position:"relative",width:"100%",height:"100%"},onMouseMove:ki,onMouseLeave:mi,onClick:$t?yi:void 0,children:[
81
+ /* @__PURE__ */ia(lo,{size:Zt,margin:Ut,children:[Lo,_o,Co]}),
82
+ /* @__PURE__ */oa(O,{width:eo,height:oo,totalWidth:Zt[0],totalHeight:Zt[1],margin:Ut,scales:So,showAxes:le,showGrid:Be,rFormat:Gt,rTickValues:ve,axisExtent:xe}),
83
+ /* @__PURE__ */oa("canvas",{ref:li,"aria-label":Ko(ai.current?.scene??[],i+" chart"),style:{position:"absolute",top:0,left:0,width:Zt[0],height:Zt[1]}}),
84
+ /* @__PURE__ */oa(D,{width:eo,height:oo,totalWidth:Zt[0],totalHeight:Zt[1],margin:Ut,scales:So,columns:ai.current?.columns,showAxes:le,showCategoryTicks:ce,oLabel:Wt,rLabel:jt,oFormat:zt,rFormat:Gt,rTickValues:ve,axisExtent:xe,showGrid:Be,title:et,description:St,legend:$e,legendHoverBehavior:Fe,legendClickBehavior:Oe,legendHighlightedCategory:De,legendIsolatedCategories:je,legendPosition:Ne,legendLayout:ze,foregroundGraphics:Lt(Po,Vt(ai.current?.customLayoutOverlays,Tt??null)),annotations:Me,onAnnotationActivate:Ie,onObservation:_e??Ce,chartId:Le,chartType:"StreamOrdinalFrame",autoPlaceAnnotations:Te,svgAnnotationRules:He,annotationFrame:Mo,xAccessor:Bi,yAccessor:$i,annotationData:Oi(ai.current?.getData()),underlayRendered:!0,canvasObscuresUnderlay:!1}),(wt||kt)&&"radial"!==v&&/* @__PURE__ */oa(E,{width:eo,height:oo,totalWidth:Zt[0],totalHeight:Zt[1],margin:Ut,scales:So,onBrush:kt||(()=>{})}),it&&"radial"===v&&/* @__PURE__ */oa(o,{content:it,centerX:Ut.left+eo/2,centerY:Ut.top+oo/2,width:Zt[0],height:Zt[1]}),ut?.showBadge&&/* @__PURE__ */oa(Ot,{isStale:Eo,position:ut.badgePosition,state:ut.state,settling:ut.settling}),
85
+ /* @__PURE__ */oa(ei,{active:vi.current>=0,hoverPoint:ko,margin:Ut,size:Zt,shape:bi.current?.shape,width:bi.current?.w,height:bi.current?.h,pathData:bi.current?.pathData}),Ci]}),
86
+ /* @__PURE__ */oa(Ee,{graphics:Ue,size:Zt,margin:Ut,scales:So,label:Je})]})})),"StreamOrdinalFrame");import{useMemo as na,forwardRef as sa,useRef as la}from"react";import{useImperativeHandle as ca}from"react";import{useMemo as ha}from"react";import{useCallback as ua,useMemo as da,useRef as ma}from"react";import{jsx as ga}from"react/jsx-runtime";var pa=/* @__PURE__ */So(/* @__PURE__ */sa(function(e,t){let o=co(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=la(null),{data:r,margin:a,className:n,categoryAccessor:s="category",valueAccessor:l="value",orientation:c="vertical",valueFormat:h,colorBy:u,colorScheme:d,sort:m=!1,barPadding:g=40,roundedTop:p,gradientFill:f=!1,styleRules:y,baselinePadding:v=!1,tooltip:b,annotations:x,regression:w,valueExtent:k,frameProps:A={},selection:S,linkedHover:R,linkedBrush:P,brush:C,onBrush:_,onObservation:L,onClick:M,hoverHighlight:I,chartId:T,loading:H,loadingContent:B,emptyContent:$,legendInteraction:F,legendPosition:O,color:D,stroke:E,strokeWidth:W,opacity:j,showCategoryTicks:N,categoryFormat:z,dataIdAccessor:V}=e,{width:G,height:q,enableHover:X,showGrid:Y,showLegend:Q,title:K,description:Z,summary:U,accessibleTable:J,categoryLabel:ee,valueLabel:te}=o,oe=na(()=>Io(r),[r]),ie=$e({responsive:e,data:oe,rawData:r,colorBy:u,colorScheme:d,legendInteraction:F,legendPosition:O,frameLegend:A,selection:S,linkedHover:R,fallbackFields:u?["string"==typeof u?u:""]:[],unwrapData:!0,onObservation:L,onClick:M,hoverHighlight:I,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"BarChart",chartId:T,showLegend:Q,userMargin:a,marginDefaults:o.marginDefaults,loading:H,loadingContent:B,emptyContent:$,width:G,height:q,hasTitle:!!K,axisChrome:Uo({showAxes:o.showAxes,projection:"horizontal"===c?"horizontal":"vertical",hasCategoryLabel:!!ee,hasValueLabel:!!te})}),{effectiveLegendProps:re,effectiveMargin:ae}=he({ref:t,frameRef:i,setup:ie});To("BarChart",oe,"categoryAccessor",s),To("BarChart",oe,"valueAccessor",l);let ne=io(oe,m,l),se=Zt(),le=na(()=>/* @__PURE__ */new Map,[]),ce=na(()=>ho(l),[l]),me=de({brushProp:C,onBrushProp:_,linkedBrush:P,valueAccessor:l}),ge=ue({colorBy:u,colorScale:ie.colorScale,color:D,themeCategorical:se,colorScheme:d,categoryIndexMap:le,userPieceStyle:A?.pieceStyle,stroke:E,strokeWidth:W,opacity:j,styleRules:y,resolveRuleValue:ce,effectiveSelectionHook:ie.effectiveSelectionHook,resolvedSelection:ie.resolvedSelection}),pe=na(()=>vt({categoryAccessor:s,valueAccessor:l,groupAccessor:u&&u!==s?u:void 0,groupLabel:"string"==typeof u?u:"group",valueFormat:h}),[s,l,u,h]),fe=na(()=>Qe(f),[f]);if(ie.earlyReturn)return ie.earlyReturn;let ye=He({componentName:"BarChart",data:r,accessors:{categoryAccessor:s,valueAccessor:l}});if(ye)/* */return ga(Po,{componentName:"BarChart",message:ye,width:G,height:q});let ve=Ie(w),be=ve?[ve,...x||[]]:x,xe={chartType:"bar",...null!=r&&{data:ne},oAccessor:s,rAccessor:l,projection:"horizontal"===c?"horizontal":"vertical",pieceStyle:ge,size:[G,q],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ae,barPadding:g,...null!=p&&{roundedTop:p},...fe&&{gradientFill:fe},...V&&{dataIdAccessor:V},baselinePadding:v,enableHover:X,showAxes:o.showAxes,oLabel:ee,rLabel:te,rFormat:h,...z&&{oFormat:z},showGrid:Y,showCategoryTicks:N,oSort:m,...re,...xt({title:K,description:Z,summary:U,accessibleTable:J,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...kt({tooltip:b,defaultTooltipContent:pe}),...wt({linkedHover:R,selection:S,onObservation:L,onClick:M,hoverHighlight:I,mobileInteraction:ie.mobileInteraction,customHoverBehavior:ie.customHoverBehavior,customClickBehavior:ie.customClickBehavior}),...be&&be.length>0&&{annotations:be},...k&&{rExtent:k},...me.brushStreamProps,...Object.fromEntries(Object.entries(A).filter(([e])=>"pieceStyle"!==e))};/* */
87
+ return ga(_o,{componentName:"BarChart",width:G,height:q,children:/* @__PURE__ */ga(aa,{ref:i,...xe})})}),"BarChart");import{useMemo as fa,forwardRef as ya,useRef as va}from"react";import{jsx as ba}from"react/jsx-runtime";var xa=/* @__PURE__ */So(/* @__PURE__ */ya(function(e,t){let o=co(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=va(null),{data:r,margin:a,className:n,categoryAccessor:s="category",stackBy:l,valueAccessor:c="value",orientation:h="vertical",valueFormat:u,colorBy:d,colorScheme:m,normalize:g=!1,sort:p=!1,barPadding:f=40,roundedTop:y,gradientFill:v,styleRules:b,baselinePadding:x=!1,tooltip:w,annotations:k,valueExtent:A,frameProps:S={},selection:R,linkedHover:P,linkedBrush:C,brush:_,onBrush:L,onObservation:M,onClick:I,hoverHighlight:T,chartId:H,loading:B,loadingContent:$,emptyContent:F,legendInteraction:O,legendPosition:D,color:E,stroke:W,strokeWidth:j,opacity:N,categoryFormat:z}=e,{width:V,height:G,enableHover:q,showGrid:X,showLegend:Y,title:Q,description:K,summary:Z,accessibleTable:U,categoryLabel:J,valueLabel:ee}=o,te=fa(()=>Io(r),[r]),oe=d||l,ie=$e({responsive:e,data:te,rawData:r,colorBy:oe,colorScheme:m,legendInteraction:O,legendPosition:D,frameLegend:S,selection:R,linkedHover:P,fallbackFields:oe?["string"==typeof oe?oe:""]:[],unwrapData:!0,onObservation:M,onClick:I,hoverHighlight:T,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"StackedBarChart",chartId:H,showLegend:Y,userMargin:a,marginDefaults:o.marginDefaults,loading:B,loadingContent:$,emptyContent:F,width:V,height:G,hasTitle:!!Q,axisChrome:Uo({showAxes:o.showAxes,projection:"horizontal"===h?"horizontal":"vertical",hasCategoryLabel:!!J,hasValueLabel:!!ee})}),re=Zt(),ae=fa(()=>/* @__PURE__ */new Map,[]),ne=fa(()=>ho(c),[c]),se=de({brushProp:_,onBrushProp:L,linkedBrush:C,valueAccessor:c}),le=ue({colorBy:oe,colorScale:ie.colorScale,color:E,themeCategorical:re,colorScheme:m,categoryIndexMap:ae,userPieceStyle:S?.pieceStyle,stroke:W,strokeWidth:j,opacity:N,styleRules:b,resolveRuleValue:ne,effectiveSelectionHook:ie.effectiveSelectionHook,resolvedSelection:ie.resolvedSelection}),ce=fa(()=>vt({categoryAccessor:l,valueAccessor:c,groupAccessor:s,valueFormat:u}),[l,s,c,u]),me=He({componentName:"StackedBarChart",data:r,accessors:{categoryAccessor:s,valueAccessor:c},requiredProps:{stackBy:l}}),{effectiveLegendProps:ge,effectiveMargin:pe}=he({ref:t,frameRef:i,setup:ie}),fe=fa(()=>Qe(v),[v]);if(ie.earlyReturn)return ie.earlyReturn;let ye={chartType:"bar",...null!=r&&{data:te},oAccessor:s,rAccessor:c,stackBy:l,normalize:g,oSort:p,projection:"horizontal"===h?"horizontal":"vertical",pieceStyle:le,size:[V,G],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:pe,barPadding:f,...null!=y&&{roundedTop:y},...fe&&{gradientFill:fe},baselinePadding:x,enableHover:q,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:J,rLabel:ee,rFormat:u,...z&&{oFormat:z},showGrid:X,...ge,...xt({title:Q,description:K,summary:Z,accessibleTable:U,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...kt({tooltip:w,defaultTooltipContent:ce}),...wt({linkedHover:P,selection:R,onObservation:M,onClick:I,hoverHighlight:T,mobileInteraction:ie.mobileInteraction,customHoverBehavior:ie.customHoverBehavior,customClickBehavior:ie.customClickBehavior}),...k&&k.length>0&&{annotations:k},...A&&{rExtent:A},...se.brushStreamProps,...Object.fromEntries(Object.entries(S).filter(([e])=>"pieceStyle"!==e))};return me?/* @__PURE__ */ba(Po,{componentName:"StackedBarChart",message:me,width:V,height:G}):/* @__PURE__ */ba(_o,{componentName:"StackedBarChart",width:V,height:G,children:/* @__PURE__ */ba(aa,{ref:i,...ye})})}),"StackedBarChart");import*as wa from"react";import{useMemo as ka,useCallback as Aa,forwardRef as Sa,useRef as Ra,useImperativeHandle as Pa}from"react";import{useMemo as Ca,useCallback as _a,useRef as La}from"react";var Ma={RdBu:ri,PiYG:ai,PRGn:ni,BrBG:si,RdYlBu:li,RdYlGn:ci,Spectral:hi},Ia="__likert_neutral_neg",Ta="__likert_neutral_pos",Ha=["Very Low","Low","Neutral","High","Very High"];import{jsx as Ba}from"react/jsx-runtime";var $a=/* @__PURE__ */new Map,Fa=/* @__PURE__ */So(/* @__PURE__ */Sa(function(e,t){let o=co(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=Ra(null),{data:r,margin:a,className:n,categoryAccessor:s="question",valueAccessor:l,levelAccessor:c,countAccessor:h="count",levels:u=Ha,orientation:d="horizontal",colorScheme:m,barPadding:g=20,styleRules:p,tooltip:f,annotations:y,valueExtent:v,frameProps:b={},selection:x,linkedHover:w,onObservation:k,onClick:A,hoverHighlight:S,chartId:R,valueFormat:P,loading:C,loadingContent:_,emptyContent:L,legendInteraction:M,legendPosition:I,categoryFormat:T,stroke:H,strokeWidth:B,opacity:$}=e,{width:F,height:O,enableHover:D,showGrid:E,showLegend:W,title:j,description:N,summary:z,accessibleTable:V,categoryLabel:G,valueLabel:q}=o,X="horizontal"===d,Y=void 0===r,Q=!c,K=eo(),Z=ka(()=>m&&Array.isArray(m)&&m.length>=u.length?m:ge(u.length,K),[m,u.length,K]),U=ka(()=>{let e=/* @__PURE__ */new Map;for(let t=0;t<u.length;t++)e.set(u[t],Z[t]||"#888");return e},[u,Z]),J=ka(()=>{if(!1!==W)return{legendGroups:[{styleFn:e=>({fill:U.get(e.label)||"#888"}),items:u.map(e=>({label:e})),label:""}]}},[W,u,U]),ee=ka(()=>Object.hasOwn(b,"legend")?b:{...b,legend:J},[b,J]),{processedData:te,reAggregate:oe,accumulatorRef:ie}=ve({data:r,levels:u,categoryAccessor:s,valueAccessor:l,levelAccessor:c,countAccessor:h,isDiverging:X,frameRef:i}),re="__likertLevelLabel",ae=Oe({isPushMode:Y,colorBy:re,colorScheme:Z,showLegend:W,legendPosition:I}),{wrapPush:ne,wrapPushMany:se}=ae,le=Aa(e=>ne(e=>{ie.current.push(e),oe(ie.current)})(e),[ne,oe,ie]),ce=Aa(e=>se(e=>{ie.current.push(...e),oe(ie.current)})(e),[se,oe,ie]);Pa(t,()=>({push:le,pushMany:ce,remove:e=>i.current?.remove(e)??[],update:(e,t)=>i.current?.update(e,t)??[],replace:e=>i.current?.replace(e),clear:()=>{ie.current=[],ae.resetCategories(),i.current?.clear()},getData:()=>i.current?.getData()??[],getScales:()=>i.current?.getScales()??null}),[le,ce,ie,ae]);let he=$e({responsive:e,data:te,rawData:r,colorBy:re,colorScheme:Z,legendInteraction:M,legendPosition:I,frameLegend:ee,selection:x,linkedHover:w,fallbackFields:["__likertLevelLabel"],unwrapData:!0,onObservation:k,onClick:A,hoverHighlight:S,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"LikertChart",chartId:R,showLegend:W,userMargin:a,marginDefaults:o.marginDefaults,loading:C,loadingContent:_,emptyContent:L,width:F,height:O,hasTitle:!!j,axisChrome:{hasAxis:!1!==o.showAxes,hasAxisLabel:X?!!q:!!G}}),de=ka(()=>{let e=u.length;return e%2!=0&&U.get(u[Math.floor(e/2)])||"#888"},[u,U]),me=ue({colorBy:void 0,colorScale:void 0,color:void 0,themeCategorical:void 0,colorScheme:void 0,categoryIndexMap:$a,userPieceStyle:b?.pieceStyle,stroke:H,strokeWidth:B,opacity:$,effectiveSelectionHook:he.effectiveSelectionHook,resolvedSelection:he.resolvedSelection,styleRules:p,resolveRuleValue:be,baseStyleExtras:e=>{let t=e.__likertLevelLabel||e.data?.__likertLevelLabel,o=e.__likertLevel||e.data?.__likertLevel;if(o===Ia||o===Ta)return{fill:de};let i=t||o;return i&&U.has(i)?{fill:U.get(i)}:{fill:"#888"}}}),pe=ka(()=>{let e=u.length;return e%2!=0?u[Math.floor(e/2)]:""},[u]),fe=ka(()=>e=>{let t=e.data||e,o=t.__likertLevel||"Unknown",i=o===Ia||o===Ta?pe:o,r=t.__likertCategory||"",a=Math.abs(t.__likertPct||0),n=o===Ia||o===Ta?2*a:a,s=t.__likertCount||0;return wa.createElement("div",{className:"semiotic-tooltip",style:Mi},wa.createElement("div",{style:{fontWeight:"bold"}},r),wa.createElement("div",{style:{marginTop:4}},`${i}: ${n.toFixed(1)}% (n=${s})`))},[pe]),ye=ka(()=>{if(!u||u.length<2)return"LikertChart requires `levels` with at least 2 entries.";if(l&&c)return"LikertChart: provide either `valueAccessor` (raw responses) or `levelAccessor` + `countAccessor` (pre-aggregated), not both.";if(c&&!h)return"LikertChart: pre-aggregated mode requires both `levelAccessor` and `countAccessor`.";if(void 0!==r&&0===r.length)return null;let e={categoryAccessor:s};return Q?l&&(e.valueAccessor=l):(c&&(e.levelAccessor=c),h&&(e.countAccessor=h)),He({componentName:"LikertChart",data:r,accessors:e,requiredProps:{levels:u}})},[r,s,l,c,h,u,Q]),xe=he.legendBehaviorProps,we=ka(()=>{let e={...he.margin};if(Y&&he.legend){let t=he.legendPosition;"bottom"===t&&e.bottom<80?e.bottom=80:"top"===t&&e.top<50?e.top=50:"right"===t&&e.right<110?e.right=110:"left"===t&&e.left<110&&(e.left=110)}else if(ae.streamingMarginAdjust)for(let[t,o]of Object.entries(ae.streamingMarginAdjust)){let i=t;e[i]<o&&(e[i]=o)}return X&&e.left<100&&(e.left=100),e},[he.margin,he.legend,he.legendPosition,ae.streamingMarginAdjust,X,Y]),ke=ka(()=>P||(X?e=>`${Math.abs(Number(e)).toFixed(0)}%`:e=>`${Number(e).toFixed(0)}%`),[X,P]);if(he.earlyReturn)return he.earlyReturn;let Ae={chartType:"bar",...null!=r&&{data:te},oAccessor:"__likertCategory",rAccessor:"__likertPct",stackBy:"__likertLevel",normalize:!1,projection:X?"horizontal":"vertical",pieceStyle:me,size:[F,O],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:we,barPadding:g,enableHover:D,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:G,rLabel:q||(X?void 0:"Percentage"),rFormat:ke,...T&&{oFormat:T},showGrid:E,...xe,...j&&{title:j},...N&&{description:N},...z&&{summary:z},...void 0!==V&&{accessibleTable:V},...n&&{className:n},...null!=e.animate&&{animate:e.animate},...void 0!==e.axisExtent&&{axisExtent:e.axisExtent},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},tooltipContent:!1===f?()=>null:!0===f?fe:vo(f)||fe,...wt({linkedHover:w,selection:x,onObservation:k,onClick:A,hoverHighlight:S,mobileInteraction:he.mobileInteraction,customHoverBehavior:he.customHoverBehavior,customClickBehavior:he.customClickBehavior}),...y&&y.length>0&&{annotations:y},...v&&{rExtent:v},...Object.fromEntries(Object.entries(b).filter(([e])=>"pieceStyle"!==e))};return ye?/* @__PURE__ */Ba(Po,{componentName:"LikertChart",message:ye,width:F,height:O}):/* @__PURE__ */Ba(_o,{componentName:"LikertChart",width:F,height:O,children:/* @__PURE__ */Ba(aa,{ref:i,...Ae})})}),"LikertChart");import{useMemo as Oa,forwardRef as Da,useRef as Ea}from"react";import{jsx as Wa}from"react/jsx-runtime";var ja=/* @__PURE__ */So(/* @__PURE__ */Da(function(e,t){let o=co(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=Ea(null);Fe(t,{variant:"xy",frameRef:i});let{data:r,margin:a,className:n,categoryAccessor:s="category",valueAccessor:l="value",orientation:c="vertical",valueFormat:h,colorBy:u,colorScheme:d,styleRules:m,sizeBy:g,sizeRange:p=[3,8],symbolBy:f,symbolMap:y,pointRadius:v=4,pointOpacity:b=.7,categoryPadding:x=20,tooltip:w,annotations:k,valueExtent:A,brush:S,onBrush:R,linkedBrush:P,frameProps:C={},selection:_,linkedHover:L,onObservation:M,onClick:I,hoverHighlight:T,chartId:H,loading:B,loadingContent:$,emptyContent:F,legendInteraction:O,legendPosition:D,color:E,stroke:W,strokeWidth:j,opacity:N,showCategoryTicks:z,categoryFormat:V}=e,{width:G,height:q,enableHover:X,showGrid:Y,showLegend:Q,title:K,description:Z,summary:U,accessibleTable:J,categoryLabel:ee,valueLabel:te}=o,oe=Oa(()=>Io(r),[r]),ie=$e({responsive:e,data:oe,rawData:r,colorBy:u,colorScheme:d,legendInteraction:O,legendPosition:D,frameLegend:C,selection:_,linkedHover:L,fallbackFields:u?["string"==typeof u?u:""]:["string"==typeof s?s:""],unwrapData:!0,onObservation:M,onClick:I,hoverHighlight:T,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"SwarmPlot",chartId:H,showLegend:Q,userMargin:a,marginDefaults:o.marginDefaults,loading:B,loadingContent:$,emptyContent:F,width:G,height:q,hasTitle:!!K,axisChrome:Uo({showAxes:o.showAxes,projection:"horizontal"===c?"horizontal":"vertical",hasCategoryLabel:!!ee,hasValueLabel:!!te})}),re=de({brushProp:S,onBrushProp:R,linkedBrush:P,valueAccessor:l}),ae=Oa(()=>{if(!g)return;let e=oe.map(e=>"function"==typeof g?g(e):e[g]);return Oi(e)},[oe,g]),ne=Zt(),se=Oa(()=>/* @__PURE__ */new Map,[]),le=Oa(()=>ho(l),[l]),ce=ue({colorBy:u,colorScale:ie.colorScale,color:E,themeCategorical:ne,colorScheme:d,categoryIndexMap:se,userPieceStyle:C?.pieceStyle,stroke:W,strokeWidth:j,opacity:N,effectiveSelectionHook:ie.effectiveSelectionHook,resolvedSelection:ie.resolvedSelection,baseStyleExtras:e=>({fillOpacity:b,r:g?gi(e,g,p,ae):v}),styleRules:m,resolveRuleValue:le}),he=Oa(()=>vt({categoryAccessor:s,valueAccessor:l,groupAccessor:u||void 0,valueFormat:h}),[s,l,u,h]);if(ie.earlyReturn)return ie.earlyReturn;let me=He({componentName:"SwarmPlot",data:r,accessors:{categoryAccessor:s,valueAccessor:l}});if(me)/* */return Wa(Po,{componentName:"SwarmPlot",message:me,width:G,height:q});let ge={chartType:"swarm",...null!=r&&{data:oe},oAccessor:s,rAccessor:l,...f&&{symbolAccessor:f},...y&&{symbolMap:y},projection:"horizontal"===c?"horizontal":"vertical",pieceStyle:ce,size:[G,q],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ie.margin,barPadding:x,enableHover:X,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:ee,rLabel:te,rFormat:h,...V&&{oFormat:V},showGrid:Y,showCategoryTicks:z,...ie.legendBehaviorProps,...xt({title:K,description:Z,summary:U,accessibleTable:J,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...kt({tooltip:w,defaultTooltipContent:he}),...wt({linkedHover:L,selection:_,onObservation:M,onClick:I,hoverHighlight:T,mobileInteraction:ie.mobileInteraction,customHoverBehavior:ie.customHoverBehavior,customClickBehavior:ie.customClickBehavior}),...k&&k.length>0&&{annotations:k},...A&&{rExtent:A},...re.brushStreamProps,...Object.fromEntries(Object.entries(C).filter(([e])=>"pieceStyle"!==e))};/* */
88
+ return Wa(_o,{componentName:"SwarmPlot",width:G,height:q,children:/* @__PURE__ */Wa(aa,{ref:i,...ge})})}),"SwarmPlot");import{useMemo as Na,forwardRef as za,useRef as Va}from"react";import{jsx as Ga}from"react/jsx-runtime";var qa=/* @__PURE__ */So(/* @__PURE__ */za(function(e,t){let o=co(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=Va(null);Fe(t,{variant:"xy",frameRef:i});let{data:r,margin:a,className:n,categoryAccessor:s="category",valueAccessor:l="value",orientation:c="vertical",valueFormat:h,colorBy:u,colorScheme:d,styleRules:m,showOutliers:g=!0,outlierRadius:p=3,categoryPadding:f=20,tooltip:y,annotations:v,valueExtent:b,frameProps:x={},selection:w,linkedHover:k,onObservation:A,onClick:S,hoverHighlight:R,chartId:P,loading:C,loadingContent:_,emptyContent:L,legendInteraction:M,legendPosition:I,color:T,stroke:H,strokeWidth:B,opacity:$,showCategoryTicks:F,categoryFormat:O}=e,{width:D,height:E,enableHover:W,showGrid:j,showLegend:N,title:z,description:V,summary:G,accessibleTable:q,categoryLabel:X,valueLabel:Y}=o,Q=Na(()=>Io(r),[r]),K=$e({responsive:e,data:Q,rawData:r,colorBy:u,colorScheme:d,legendInteraction:M,legendPosition:I,frameLegend:x,selection:w,linkedHover:k,fallbackFields:u?["string"==typeof u?u:""]:["string"==typeof s?s:""],unwrapData:!0,onObservation:A,onClick:S,hoverHighlight:R,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"BoxPlot",chartId:P,showLegend:N,userMargin:a,marginDefaults:o.marginDefaults,loading:C,loadingContent:_,emptyContent:L,width:D,height:E,hasTitle:!!z,axisChrome:Uo({showAxes:o.showAxes,projection:"horizontal"===c?"horizontal":"vertical",hasCategoryLabel:!!X,hasValueLabel:!!Y})}),Z=Zt(),U=Na(()=>/* @__PURE__ */new Map,[]),J=Na(()=>{let e=ho(l);return t=>"number"==typeof t.median?t.median:e(t)},[l]),ee=ue({colorBy:u,colorScale:K.colorScale,color:T,themeCategorical:Z,colorScheme:d,categoryIndexMap:U,userPieceStyle:void 0,stroke:H,strokeWidth:B,opacity:$,effectiveSelectionHook:K.effectiveSelectionHook,resolvedSelection:K.resolvedSelection,baseStyleExtras:{fillOpacity:.8},linkStrokeToFill:!0,styleRules:m,resolveRuleValue:J}),te=Na(()=>le(),[]);if(K.earlyReturn)return K.earlyReturn;let oe=He({componentName:"BoxPlot",data:r,accessors:{categoryAccessor:s,valueAccessor:l}});if(oe)/* */return Ga(Po,{componentName:"BoxPlot",message:oe,width:D,height:E});let ie={chartType:"boxplot",...null!=r&&{data:Q},oAccessor:s,rAccessor:l,projection:"horizontal"===c?"horizontal":"vertical",summaryStyle:ee,showOutliers:g,size:[D,E],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:K.margin,barPadding:f,enableHover:W,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:X,rLabel:Y,rFormat:h,...O&&{oFormat:O},showGrid:j,showCategoryTicks:F,...K.legendBehaviorProps,...xt({title:z,description:V,summary:G,accessibleTable:q,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...kt({tooltip:y,defaultTooltipContent:te}),...wt({linkedHover:k,selection:w,onObservation:A,onClick:S,hoverHighlight:R,mobileInteraction:K.mobileInteraction,customHoverBehavior:K.customHoverBehavior,customClickBehavior:K.customClickBehavior}),...v&&v.length>0&&{annotations:v},...b&&{rExtent:b},...Object.fromEntries(Object.entries(x).filter(([e])=>"pieceStyle"!==e))};/* */
89
+ return Ga(_o,{componentName:"BoxPlot",width:D,height:E,children:/* @__PURE__ */Ga(aa,{ref:i,...ie})})}),"BoxPlot");import{useMemo as Xa,forwardRef as Ya,useRef as Qa}from"react";import{jsx as Ka,jsxs as Za}from"react/jsx-runtime";var Ua=e=>{let t=e?.category;return null==t?"All":String(t)},Ja=/* @__PURE__ */So(/* @__PURE__ */Ya(function(e,t){let o=co(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:"horizontal",mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=Qa(null);Fe(t,{variant:"xy",frameRef:i});let{data:r,margin:a,className:n,categoryAccessor:s=Ua,valueAccessor:l="value",bins:c=25,relative:h=!1,valueFormat:u,colorBy:d,colorScheme:m,styleRules:g,categoryPadding:p=("sparkline"===o.mode?0:20),tooltip:f,annotations:y,valueExtent:v,brush:b,onBrush:x,linkedBrush:w,frameProps:k={},selection:A,linkedHover:S,onObservation:R,onClick:P,hoverHighlight:C,chartId:_,loading:L,loadingContent:M,emptyContent:I,legendInteraction:T,legendPosition:H,color:B,stroke:$,strokeWidth:F,opacity:O,showCategoryTicks:D,categoryFormat:E}=e,{width:W,height:j,enableHover:N,showGrid:z,showLegend:V,title:G,description:q,summary:X,accessibleTable:Y,categoryLabel:Q,valueLabel:K}=o,Z=Xa(()=>Io(r),[r]),U=$e({responsive:e,data:Z,rawData:r,colorBy:d,colorScheme:m,legendInteraction:T,legendPosition:H,frameLegend:k,selection:A,linkedHover:S,fallbackFields:d?["string"==typeof d?d:""]:["string"==typeof s?s:""],unwrapData:!0,onObservation:R,onClick:P,hoverHighlight:C,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"Histogram",chartId:_,showLegend:V,userMargin:a,marginDefaults:o.marginDefaults,loading:L,loadingContent:M,emptyContent:I,width:W,height:j,hasTitle:!!G,axisChrome:Uo({showAxes:o.showAxes,projection:"horizontal",hasCategoryLabel:!!Q,hasValueLabel:!!K})}),J=de({brushProp:b,onBrushProp:x,linkedBrush:w,valueAccessor:l}),ee=Xa(()=>{if(0===Z.length)return;let e="function"==typeof l?l:e=>e[l],t=1/0,o=-1/0;for(let i of Z){let r=e(i);null!=r&&isFinite(r)&&(r<t&&(t=r),r>o&&(o=r))}return t<=o?[t,o]:void 0},[Z,l]),te=Zt(),oe=Xa(()=>/* @__PURE__ */new Map,[]),ie=Xa(()=>{let e=ho(l);return t=>"number"==typeof t.count?t.count:e(t)},[l]),re=ue({colorBy:d,colorScale:U.colorScale,color:B,themeCategorical:te,colorScheme:m,categoryIndexMap:oe,userPieceStyle:void 0,stroke:$,strokeWidth:F,opacity:O,effectiveSelectionHook:U.effectiveSelectionHook,resolvedSelection:U.resolvedSelection,baseStyleExtras:{fillOpacity:.8},linkStrokeToFill:!0,styleRules:g,resolveRuleValue:ie}),ae=Xa(()=>e=>{let t=e.data||e,o=t.category||e.category||"",i=t.count,r=t.range;/* */
90
+ return Za("div",{className:"semiotic-tooltip",style:Mi,children:[o&&/* @__PURE__ */Ka("div",{style:{fontWeight:"bold"},children:String(o)}),null!=i&&/* @__PURE__ */Za("div",{children:["Count: ",i]}),r&&2===r.length&&/* @__PURE__ */Za("div",{style:{opacity:.8},children:[Number(r[0]).toFixed(1)," – ",Number(r[1]).toFixed(1)]})]})},[]);if(U.earlyReturn)return U.earlyReturn;let ne=He({componentName:"Histogram",data:r,accessors:{categoryAccessor:s,valueAccessor:l}});if(ne)/* */return Ka(Po,{componentName:"Histogram",message:ne,width:W,height:j});let se={chartType:"histogram",...null!=r&&{data:Z},oAccessor:s,rAccessor:l,projection:"horizontal",summaryStyle:re,bins:c,normalize:h,...v?{rExtent:v}:ee&&{rExtent:ee},size:[W,j],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:U.margin,barPadding:p,enableHover:N,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:Q,rLabel:K,rFormat:u,...E&&{oFormat:E},showGrid:z,showCategoryTicks:D,...U.legendBehaviorProps,...xt({title:G,description:q,summary:X,accessibleTable:Y,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...kt({tooltip:f,defaultTooltipContent:ae}),...wt({linkedHover:S,selection:A,onObservation:R,onClick:P,hoverHighlight:C,mobileInteraction:U.mobileInteraction,customHoverBehavior:U.customHoverBehavior,customClickBehavior:U.customClickBehavior}),...y&&y.length>0&&{annotations:y},...J.brushStreamProps,...Object.fromEntries(Object.entries(k).filter(([e])=>"pieceStyle"!==e))};/* */
91
+ return Ka(_o,{componentName:"Histogram",width:W,height:j,children:/* @__PURE__ */Ka(aa,{ref:i,...se})})}),"Histogram");import{useMemo as en,forwardRef as tn,useRef as on}from"react";import{jsx as rn}from"react/jsx-runtime";var an=/* @__PURE__ */So(/* @__PURE__ */tn(function(e,t){let o=co(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=on(null);Fe(t,{variant:"xy",frameRef:i});let{data:r,margin:a,className:n,categoryAccessor:s="category",valueAccessor:l="value",orientation:c="vertical",bins:h=25,curve:u="catmullRom",showIQR:d=!0,valueFormat:m,colorBy:g,colorScheme:p,styleRules:f,categoryPadding:y=20,tooltip:v,annotations:b,valueExtent:x,brush:w,onBrush:k,linkedBrush:A,frameProps:S={},selection:R,linkedHover:P,onObservation:C,onClick:_,hoverHighlight:L,chartId:M,loading:I,loadingContent:T,emptyContent:H,legendInteraction:B,legendPosition:$,color:F,stroke:O,strokeWidth:D,opacity:E,showCategoryTicks:W,categoryFormat:j}=e,{width:N,height:z,enableHover:V,showGrid:G,showLegend:q,title:X,description:Y,summary:Q,accessibleTable:K,categoryLabel:Z,valueLabel:U}=o,J=en(()=>Io(r),[r]),ee=$e({responsive:e,data:J,rawData:r,colorBy:g,colorScheme:p,legendInteraction:B,legendPosition:$,frameLegend:S,selection:R,linkedHover:P,fallbackFields:g?["string"==typeof g?g:""]:["string"==typeof s?s:""],unwrapData:!0,onObservation:C,onClick:_,hoverHighlight:L,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"ViolinPlot",chartId:M,showLegend:q,userMargin:a,marginDefaults:o.marginDefaults,loading:I,loadingContent:T,emptyContent:H,width:N,height:z,hasTitle:!!X,axisChrome:Uo({showAxes:o.showAxes,projection:"horizontal"===c?"horizontal":"vertical",hasCategoryLabel:!!Z,hasValueLabel:!!U})}),te=de({brushProp:w,onBrushProp:k,linkedBrush:A,valueAccessor:l}),oe=Zt(),ie=en(()=>/* @__PURE__ */new Map,[]),re=en(()=>{let e=ho(l);return t=>"number"==typeof t.median?t.median:e(t)},[l]),ae=ue({colorBy:g,colorScale:ee.colorScale,color:F,themeCategorical:oe,colorScheme:p,categoryIndexMap:ie,userPieceStyle:void 0,stroke:O,strokeWidth:D,opacity:E,effectiveSelectionHook:ee.effectiveSelectionHook,resolvedSelection:ee.resolvedSelection,baseStyleExtras:{fillOpacity:.6},linkStrokeToFill:!0,styleRules:f,resolveRuleValue:re}),ne=en(()=>le({valueAccessor:l}),[l]);if(ee.earlyReturn)return ee.earlyReturn;let se=He({componentName:"ViolinPlot",data:r,accessors:{categoryAccessor:s,valueAccessor:l}});if(se)/* */return rn(Po,{componentName:"ViolinPlot",message:se,width:N,height:z});let ce={chartType:"violin",...null!=r&&{data:J},oAccessor:s,rAccessor:l,projection:"horizontal"===c?"horizontal":"vertical",summaryStyle:ae,bins:h,showIQR:d,size:[N,z],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ee.margin,barPadding:y,enableHover:V,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:Z,rLabel:U,rFormat:m,...j&&{oFormat:j},showGrid:G,showCategoryTicks:W,...ee.legendBehaviorProps,...xt({title:X,description:Y,summary:Q,accessibleTable:K,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...kt({tooltip:v,defaultTooltipContent:ne}),...wt({linkedHover:P,selection:R,onObservation:C,onClick:_,hoverHighlight:L,mobileInteraction:ee.mobileInteraction,customHoverBehavior:ee.customHoverBehavior,customClickBehavior:ee.customClickBehavior}),...b&&b.length>0&&{annotations:b},...x&&{rExtent:x},...te.brushStreamProps,...Object.fromEntries(Object.entries(S).filter(([e])=>"pieceStyle"!==e))};/* */
92
+ return rn(_o,{componentName:"ViolinPlot",width:N,height:z,children:/* @__PURE__ */rn(aa,{ref:i,...ce})})}),"ViolinPlot");import{useMemo as nn,forwardRef as sn,useRef as ln}from"react";import{jsx as cn}from"react/jsx-runtime";var hn=/* @__PURE__ */So(/* @__PURE__ */sn(function(e,t){let o=co(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=ln(null);Fe(t,{variant:"xy",frameRef:i});let{data:r,margin:a,className:n,categoryAccessor:s="category",valueAccessor:l="value",orientation:c="horizontal",bins:h=20,amplitude:u=1.5,valueFormat:d,colorBy:m,colorScheme:g,styleRules:p,categoryPadding:f=5,tooltip:y,annotations:v,valueExtent:b,frameProps:x={},selection:w,linkedHover:k,onObservation:A,onClick:S,hoverHighlight:R,chartId:P,loading:C,loadingContent:_,emptyContent:L,legendInteraction:M,legendPosition:I,color:T,stroke:H,strokeWidth:B,opacity:$,showCategoryTicks:F,categoryFormat:O}=e,{width:D,height:E,enableHover:W,showGrid:j,showLegend:N,title:z,description:V,summary:G,accessibleTable:q,categoryLabel:X,valueLabel:Y}=o,Q=nn(()=>Io(r),[r]),K=$e({responsive:e,data:Q,rawData:r,colorBy:m,colorScheme:g,legendInteraction:M,legendPosition:I,frameLegend:x,selection:w,linkedHover:k,fallbackFields:m?["string"==typeof m?m:""]:["string"==typeof s?s:""],unwrapData:!0,onObservation:A,onClick:S,hoverHighlight:R,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"RidgelinePlot",chartId:P,showLegend:N,userMargin:a,marginDefaults:o.marginDefaults,loading:C,loadingContent:_,emptyContent:L,width:D,height:E,hasTitle:!!z,axisChrome:Uo({showAxes:o.showAxes,projection:"horizontal"===c?"horizontal":"vertical",hasCategoryLabel:!!X,hasValueLabel:!!Y})}),Z=Zt(),U=nn(()=>/* @__PURE__ */new Map,[]),J=nn(()=>{let e=ho(l);return t=>"number"==typeof t.median?t.median:e(t)},[l]),ee=ue({colorBy:m,colorScale:K.colorScale,color:T,themeCategorical:Z,colorScheme:g,categoryIndexMap:U,userPieceStyle:void 0,stroke:H,strokeWidth:B,opacity:$,effectiveSelectionHook:K.effectiveSelectionHook,resolvedSelection:K.resolvedSelection,baseStyleExtras:{fillOpacity:.5},linkStrokeToFill:!0,styleRules:p,resolveRuleValue:J}),te=nn(()=>le(),[]);if(K.earlyReturn)return K.earlyReturn;let oe=He({componentName:"RidgelinePlot",data:r,accessors:{categoryAccessor:s,valueAccessor:l}});if(oe)/* */return cn(Po,{componentName:"RidgelinePlot",message:oe,width:D,height:E});let ie={chartType:"ridgeline",...null!=r&&{data:Q},oAccessor:s,rAccessor:l,projection:"horizontal"===c?"horizontal":"vertical",summaryStyle:ee,bins:h,size:[D,E],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:K.margin,barPadding:f,enableHover:W,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:X,rLabel:Y,rFormat:d,...O&&{oFormat:O},showGrid:j,showCategoryTicks:F,oSort:!1,amplitude:u,...K.legendBehaviorProps,...xt({title:z,description:V,summary:G,accessibleTable:q,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...kt({tooltip:y,defaultTooltipContent:te}),...wt({linkedHover:k,selection:w,onObservation:A,onClick:S,hoverHighlight:R,mobileInteraction:K.mobileInteraction,customHoverBehavior:K.customHoverBehavior,customClickBehavior:K.customClickBehavior}),...v&&v.length>0&&{annotations:v},...b&&{rExtent:b},...Object.fromEntries(Object.entries(x).filter(([e])=>"pieceStyle"!==e))};/* */
93
+ return cn(_o,{componentName:"RidgelinePlot",width:D,height:E,children:/* @__PURE__ */cn(aa,{ref:i,...ie})})}),"RidgelinePlot");import{useMemo as un,forwardRef as dn,useRef as mn}from"react";import{jsx as gn}from"react/jsx-runtime";var pn=/* @__PURE__ */So(/* @__PURE__ */dn(function(e,t){let o=co(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid??!0,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=mn(null);Fe(t,{variant:"xy",frameRef:i});let{data:r,margin:a,className:n,categoryAccessor:s="category",valueAccessor:l="value",orientation:c="horizontal",valueFormat:h,colorBy:u,colorScheme:d,styleRules:m,sort:g="auto",dotRadius:p=5,categoryPadding:f=10,tooltip:y,annotations:v,regression:b,valueExtent:x,frameProps:w={},selection:k,linkedHover:A,onObservation:S,onClick:R,hoverHighlight:P,chartId:C,loading:_,loadingContent:L,emptyContent:M,legendInteraction:I,legendPosition:T,color:H,stroke:B,strokeWidth:$,opacity:F,categoryFormat:O}=e,{width:D,height:E,enableHover:W,showGrid:j,showLegend:N,title:z,description:V,summary:G,accessibleTable:q,categoryLabel:X,valueLabel:Y}=o,Q=un(()=>Io(r),[r]),K=$e({responsive:e,data:Q,rawData:r,colorBy:u,colorScheme:d,legendInteraction:I,legendPosition:T,frameLegend:w,selection:k,linkedHover:A,fallbackFields:u?["string"==typeof u?u:""]:["string"==typeof s?s:""],unwrapData:!0,onObservation:S,onClick:R,hoverHighlight:P,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"DotPlot",chartId:C,showLegend:N,userMargin:a,marginDefaults:o.marginDefaults,loading:_,loadingContent:L,emptyContent:M,width:D,height:E,hasTitle:!!z,axisChrome:Uo({showAxes:o.showAxes,projection:"horizontal"===c?"horizontal":"vertical",hasCategoryLabel:!!X,hasValueLabel:!!Y})}),Z=io(Q,g,l),U=Zt(),J=un(()=>/* @__PURE__ */new Map,[]),ee=un(()=>ho(l),[l]),te=ue({colorBy:u,colorScale:K.colorScale,color:H,themeCategorical:U,colorScheme:d,categoryIndexMap:J,userPieceStyle:w?.pieceStyle,stroke:B,strokeWidth:$,opacity:F,effectiveSelectionHook:K.effectiveSelectionHook,resolvedSelection:K.resolvedSelection,baseStyleExtras:{r:p,fillOpacity:.8},styleRules:m,resolveRuleValue:ee}),oe=un(()=>vt({categoryAccessor:s,valueAccessor:l,valueFormat:h}),[s,l,h]);if(K.earlyReturn)return K.earlyReturn;let ie=He({componentName:"DotPlot",data:r,accessors:{categoryAccessor:s,valueAccessor:l}});if(ie)/* */return gn(Po,{componentName:"DotPlot",message:ie,width:D,height:E});let re=Ie(b),ae=re?[re,...v||[]]:v,ne={chartType:"point",...null!=r&&{data:Z},oAccessor:s,rAccessor:l,projection:"horizontal"===c?"horizontal":"vertical",pieceStyle:te,size:[D,E],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:K.margin,barPadding:f,enableHover:W,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:X,rLabel:Y,rFormat:h,...O&&{oFormat:O},showGrid:j,oSort:g,...K.legendBehaviorProps,...xt({title:z,description:V,summary:G,accessibleTable:q,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...kt({tooltip:y,defaultTooltipContent:oe}),...wt({linkedHover:A,selection:k,onObservation:S,onClick:R,hoverHighlight:P,mobileInteraction:K.mobileInteraction,customHoverBehavior:K.customHoverBehavior,customClickBehavior:K.customClickBehavior}),...ae&&ae.length>0&&{annotations:ae},...x&&{rExtent:x},...Object.fromEntries(Object.entries(w).filter(([e])=>"pieceStyle"!==e))};/* */
94
+ return gn(_o,{componentName:"DotPlot",width:D,height:E,children:/* @__PURE__ */gn(aa,{ref:i,...ne})})}),"DotPlot"),fn={width:400,height:400},yn={width:400,height:400},vn={width:300,height:250};import{useMemo as bn,forwardRef as xn,useRef as wn}from"react";import{jsx as kn}from"react/jsx-runtime";var An=/* @__PURE__ */So(/* @__PURE__ */xn(function(e,t){let o=co(e.mode,{width:e.width,height:e.height,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,showCategoryTicks:e.showCategoryTicks,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules},fn),i=wn(null),{data:r,margin:a,className:n,categoryAccessor:s="category",valueAccessor:l="value",colorBy:c,colorScheme:h,styleRules:u,startAngle:d=0,cornerRadius:m,valueFormat:g,tooltip:p,annotations:f,frameProps:y={},selection:v,linkedHover:b,onObservation:x,onClick:w,hoverHighlight:k,chartId:A,loading:S,loadingContent:R,emptyContent:P,legendInteraction:C,legendPosition:_,color:L,stroke:M,strokeWidth:I,opacity:T}=e,{width:H,height:B,enableHover:$,showLegend:F,title:O,description:D,summary:E,accessibleTable:W}=o,j=bn(()=>Io(r),[r]),N=c||s,z=$e({responsive:e,data:j,rawData:r,colorBy:N,colorScheme:h,legendInteraction:C,legendPosition:_,frameLegend:y,selection:v,linkedHover:b,fallbackFields:N?["string"==typeof N?N:""]:[],unwrapData:!0,onObservation:x,onClick:w,hoverHighlight:k,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"PieChart",chartId:A,showLegend:F,userMargin:a,marginDefaults:o.marginDefaults,loading:S,loadingContent:R,emptyContent:P,width:H,height:B,hasTitle:!!O,axisChrome:{hasAxis:!1}}),V=Zt(),G=bn(()=>/* @__PURE__ */new Map,[]),q=bn(()=>{let e=ho(l);return t=>{let o=e(t);return null==o?void 0:Math.abs(o)}},[l]),X=ue({colorBy:N,colorScale:z.colorScale,color:L,themeCategorical:V,colorScheme:h,categoryIndexMap:G,userPieceStyle:y?.pieceStyle,stroke:M,strokeWidth:I,opacity:T,effectiveSelectionHook:z.effectiveSelectionHook,resolvedSelection:z.resolvedSelection,cycleByCategory:!0,styleRules:u,resolveRuleValue:q}),Y=bn(()=>vt({categoryAccessor:s,valueAccessor:l,groupAccessor:c&&c!==s?c:void 0,groupLabel:"string"==typeof c?c:"group",pieData:!0,valueFormat:g}),[s,l,c,g]),Q=He({componentName:"PieChart",data:r,accessors:{categoryAccessor:s,valueAccessor:l}}),{effectiveLegendProps:K,effectiveMargin:Z}=he({ref:t,frameRef:i,setup:z});if(z.earlyReturn)return z.earlyReturn;let U={chartType:"pie",...null!=r&&{data:j},oAccessor:s,rAccessor:l,projection:"radial",pieceStyle:X,startAngle:d,...null!=m&&{cornerRadius:m},size:[H,B],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:Z,enableHover:$,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:!1,...K,...xt({title:O,description:D,summary:E,accessibleTable:W,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...kt({tooltip:p,defaultTooltipContent:Y}),...wt({linkedHover:b,selection:v,onObservation:x,onClick:w,hoverHighlight:k,mobileInteraction:z.mobileInteraction,customHoverBehavior:z.customHoverBehavior,customClickBehavior:z.customClickBehavior}),...f&&f.length>0&&{annotations:f},...Object.fromEntries(Object.entries(y).filter(([e])=>"pieceStyle"!==e))};return Q?/* @__PURE__ */kn(Po,{componentName:"PieChart",message:Q,width:H,height:B}):/* @__PURE__ */kn(_o,{componentName:"PieChart",width:H,height:B,children:/* @__PURE__ */kn(aa,{ref:i,...U})})}),"PieChart");import{useMemo as Sn,forwardRef as Rn,useRef as Pn}from"react";import{jsx as Cn}from"react/jsx-runtime";var _n=/* @__PURE__ */So(/* @__PURE__ */Rn(function(e,t){let o=co(e.mode,{width:e.width,height:e.height,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,linkedHover:e.linkedHover,showCategoryTicks:e.showCategoryTicks,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules},yn),i=Pn(null),{data:r,margin:a,className:n,categoryAccessor:s="category",valueAccessor:l="value",innerRadius:c,centerContent:h,colorBy:u,colorScheme:d,styleRules:m,startAngle:g=0,cornerRadius:p,valueFormat:f,tooltip:y,annotations:v,frameProps:b={},selection:x,linkedHover:w,onObservation:k,onClick:A,hoverHighlight:S,chartId:R,loading:P,loadingContent:C,emptyContent:_,legendInteraction:L,legendPosition:M,color:I,stroke:T,strokeWidth:H,opacity:B}=e,{width:$,height:F,enableHover:O,showLegend:D,title:E,description:W,summary:j,accessibleTable:N}=o,z=Sn(()=>Io(r),[r]),V=u||s,G=$e({responsive:e,data:z,rawData:r,colorBy:V,colorScheme:d,legendInteraction:L,legendPosition:M,frameLegend:b,selection:x,linkedHover:w,fallbackFields:V?["string"==typeof V?V:""]:[],unwrapData:!0,onObservation:k,onClick:A,hoverHighlight:S,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"DonutChart",chartId:R,showLegend:D,userMargin:a,marginDefaults:o.marginDefaults,loading:P,loadingContent:C,emptyContent:_,width:$,height:F,hasTitle:!!E,axisChrome:{hasAxis:!1}}),q=c??Math.max(2,.15*Math.min($,F)),X=Zt(),Y=Sn(()=>/* @__PURE__ */new Map,[]),Q=Sn(()=>{let e=ho(l);return t=>{let o=e(t);return null==o?void 0:Math.abs(o)}},[l]),K=ue({colorBy:V,colorScale:G.colorScale,color:I,themeCategorical:X,colorScheme:d,categoryIndexMap:Y,userPieceStyle:b?.pieceStyle,stroke:T,strokeWidth:H,opacity:B,effectiveSelectionHook:G.effectiveSelectionHook,resolvedSelection:G.resolvedSelection,cycleByCategory:!0,styleRules:m,resolveRuleValue:Q}),Z=Sn(()=>vt({categoryAccessor:s,valueAccessor:l,groupAccessor:u&&u!==s?u:void 0,groupLabel:"string"==typeof u?u:"group",pieData:!0,valueFormat:f}),[s,l,u,f]),U=He({componentName:"DonutChart",data:r,accessors:{categoryAccessor:s,valueAccessor:l}}),{effectiveLegendProps:J,effectiveMargin:ee}=he({ref:t,frameRef:i,setup:G});if(G.earlyReturn)return G.earlyReturn;let te={chartType:"donut",...null!=r&&{data:z},oAccessor:s,rAccessor:l,projection:"radial",pieceStyle:K,innerRadius:q,startAngle:g,...null!=p&&{cornerRadius:p},centerContent:h,size:[$,F],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ee,enableHover:O,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:!1,...J,...xt({title:E,description:W,summary:j,accessibleTable:N,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...kt({tooltip:y,defaultTooltipContent:Z}),...wt({linkedHover:w,selection:x,onObservation:k,onClick:A,hoverHighlight:S,mobileInteraction:G.mobileInteraction,customHoverBehavior:G.customHoverBehavior,customClickBehavior:G.customClickBehavior}),...v&&v.length>0&&{annotations:v},...Object.fromEntries(Object.entries(b).filter(([e])=>"pieceStyle"!==e))};return U?/* @__PURE__ */Cn(Po,{componentName:"DonutChart",message:U,width:$,height:F}):/* @__PURE__ */Cn(_o,{componentName:"DonutChart",width:$,height:F,children:/* @__PURE__ */Cn(aa,{ref:i,...te})})}),"DonutChart");import{jsx as Ln,jsxs as Mn}from"react/jsx-runtime";import{useMemo as In,forwardRef as Tn,useRef as Hn}from"react";import{jsx as Bn,jsxs as $n}from"react/jsx-runtime";var Fn=/* @__PURE__ */So(/* @__PURE__ */Tn(function(e,t){let o=co(e.mode,{width:e.width,height:e.height,enableHover:e.enableHover,showLegend:!1,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules},vn),i=Hn(null),r="context"===o.mode,{compactMode:a}=o,{value:n,min:s=0,max:l=100,thresholds:c,gradientFill:h,color:u,backgroundColor:d="var(--semiotic-grid, #e0e0e0)",arcWidth:m=.3,cornerRadius:g,showNeedle:p=!0,needleColor:f="var(--semiotic-text, #333)",centerContent:y,centerLabel:v,valueFormat:b,showScaleLabels:x=!a,sweep:w=240,fillZones:k=!0,tooltip:A,styleRules:S,annotations:R,frameProps:P={},className:C,stroke:_,strokeWidth:L,opacity:M}=e,{width:I,height:T,title:H,description:B,summary:$,accessibleTable:F}=o,O=Ke(h),D=Math.max(s,Math.min(l,n)),E=l-s||1,W=(D-s)/E,{gaugeData:j,pieceStyle:N,gaugeAnnotations:z}=In(()=>Me({min:s,max:l,value:n,thresholds:c,fillColor:u,backgroundColor:d,fillZones:k,showScaleLabels:x,gradientFill:O}),[n,s,l,c,u,d,x,k,O]),V=In(()=>fo(N,S,(e,t)=>({value:"number"==typeof e.value?e.value:void 0,category:t??(null==e.category?void 0:String(e.category))})),[N,S]),G=In(()=>At(V,{stroke:_,strokeWidth:L,opacity:M}),[V,_,L,M]),{activeSelectionHook:q,customHoverBehavior:X,customClickBehavior:Y}=ao({selection:e.selection,linkedHover:e.linkedHover,fallbackFields:["category"],onObservation:e.onObservation,chartType:"GaugeChart",chartId:e.chartId,onClick:e.onClick,hoverHighlight:e.hoverHighlight,colorByField:"category",mobileInteraction:o.mobileInteraction}),Q=Be(e.selection),K=In(()=>oi(G,q,Q),[G,q,Q]),{sweepRad:Z,startAngleDeg:U}=Ae(w),J=Se(w),ee=Math.min(10,Math.max(1,Math.min(I,T)/12)),te=J.width,oe=J.height,ie=J.cx,re=J.cy,ae=Math.max(4,Math.min((I-2*ee)/te,(T-2*ee)/oe)-2),ne=Math.max(0,Math.min(ae-1.5,ae*(1-m))),se=I/2-ie*ae,le=T/2-re*ae,ce=2*(ae+4),he=In(()=>ke({centerContent:y,centerLabel:v,value:D,min:s,max:l,radius:ae,innerRadius:ne,showScaleLabels:x,valueFormat:b,compact:a}),[y,v,D,s,l,b,x,ae,ne,a]),ue=In(()=>r&&null==y?{type:"gauge-value",text:b?b(D):String(Math.round(D))}:null,[r,y,D,b]),de=In(()=>{if(!p)return null;let e=-Math.PI/2+U*Math.PI/180+W*Z,t=ne>20?ne-8:ae-1;return{type:"gauge-needle",tipX:Math.cos(e)*t,tipY:Math.sin(e)*t,color:f}},[p,U,W,Z,ne,ae,f]),me=In(()=>(e,t,o)=>{if("gauge-needle"===e.type){let i=(o.width||I)/2,r=(o.height||T)/2,a=Math.max(1,ae-ne),n=Math.max(1,Math.min(2.5,.4*a)),s=Math.max(1,Math.min(5,.6*a));/* */
95
+ return $n("g",{transform:`translate(${i},${r})`,children:[
96
+ /* @__PURE__ */Bn("line",{x1:0,y1:0,x2:e.tipX,y2:e.tipY,stroke:e.color,strokeWidth:n,strokeLinecap:"round"}),
97
+ /* @__PURE__ */Bn("circle",{cx:0,cy:0,r:s,fill:e.color})]},`gauge-needle-${t}`)}if("gauge-label"===e.type){let i,r,a=(e.value-s)/E,n=-Math.PI/2+U*Math.PI/180+a*Z,l=(o.width||I)/2,c=(o.height||T)/2,h=ne-1,u=ae+1,d=Math.cos(n)*h,m=Math.sin(n)*h,g=Math.cos(n)*u,p=Math.sin(n)*u,f=ae+10,y=Math.cos(n)*f,v=Math.sin(n)*f,b=((n+Math.PI/2)/(2*Math.PI)*12+12)%12;return b>=11||b<1?(i="middle",r="auto"):b>=1&&b<5?(i="start",r="middle"):b>=5&&b<7?(i="middle",r="hanging"):(i="end",r="middle"),/* @__PURE__ */$n("g",{transform:`translate(${l},${c})`,children:[
98
+ /* @__PURE__ */Bn("line",{x1:d,y1:m,x2:g,y2:p,stroke:"var(--semiotic-border, #ccc)",strokeWidth:2,strokeLinecap:"round"}),
99
+ /* @__PURE__ */Bn("text",{x:y,y:v,textAnchor:i,dominantBaseline:r,fill:"var(--semiotic-text-secondary, #666)",fontSize:10,style:{userSelect:"none",fontSize:"var(--semiotic-gauge-label-font-size, 10px)"},children:e.label})]},`gauge-label-${t}`)}if("gauge-value"===e.type){let i=(o.width||I)/2,r=(o.height||T)/2-.2*ne,a=Math.max(12,Math.min(22,.28*ae));/* */
100
+ return Bn("text",{x:i,y:r,textAnchor:"middle",dominantBaseline:"middle",fontSize:a,fontWeight:700,fill:"var(--semiotic-text, #333)",style:{userSelect:"none"},children:e.text},`gauge-value-${t}`)}return null},[I,T,s,E,U,Z,ne,ae]),ge=In(()=>{let e=[...z,...R||[]];return de&&e.push(de),ue&&e.push(ue),e},[z,R,de,ue]),pe=In(()=>e=>{let t=e?.data?.[0]||e?.data||e,o=t?._zone||"",i=t?._isFill;/* */
101
+ return $n("div",{className:"semiotic-tooltip",style:{padding:"6px 10px",background:"var(--semiotic-tooltip-bg, white)",borderRadius:"var(--semiotic-tooltip-radius, 6px)",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0,0,0,0.15))"},children:[
102
+ /* @__PURE__ */Bn("div",{style:{fontWeight:600},children:o}),
103
+ /* @__PURE__ */$n("div",{style:{fontSize:"0.85em",color:"var(--semiotic-text-secondary, #666)"},children:["Current: ",b?b(D):Math.round(D)]}),!i&&/* @__PURE__ */$n("div",{style:{fontSize:"0.85em",color:"var(--semiotic-text-secondary, #666)"},children:["Remaining: ",b?b(l-D):Math.round(l-D)]})]})},[D,l,b]),fe=Mo(e.loading,I,T,e.loadingContent,e),ye=fe?null:Yt(Number.isFinite(n)?[{value:n}]:[],I,T,e.emptyContent,e);if(fe)return fe;if(ye)return ye;if(0===j.length)/* */
104
+ return Bn(Po,{componentName:"GaugeChart",message:"No data to display",width:I,height:T});let ve={chartType:"donut",data:j,oAccessor:"category",rAccessor:"value",oSort:!1,projection:"radial",pieceStyle:K,innerRadius:ne,startAngle:U,sweepAngle:w,...null!=g&&{cornerRadius:g},centerContent:he,size:[I,T],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:{top:le-ce/2,bottom:T-le-ce/2,left:se-ce/2,right:I-se-ce/2},enableHover:o.enableHover,showAxes:!1,showCategoryTicks:!1,tooltipContent:!1===A?()=>null:vo(A)||pe,...wt({linkedHover:e.linkedHover,selection:e.selection,onObservation:e.onObservation,onClick:e.onClick,hoverRadius:e.hoverRadius,hoverHighlight:e.hoverHighlight,mobileInteraction:o.mobileInteraction,customHoverBehavior:X,customClickBehavior:Y}),svgAnnotationRules:me,...ge.length>0&&{annotations:ge},...H&&{title:H},...B&&{description:B},...$&&{summary:$},...void 0!==F&&{accessibleTable:F},...C&&{className:C},...null!=e.animate&&{animate:e.animate},...P};/* */
105
+ return Bn(_o,{componentName:"GaugeChart",width:I,height:T,children:/* @__PURE__ */Bn(aa,{ref:i,...ve})})}),"GaugeChart");import{useMemo as On,forwardRef as Dn,useRef as En}from"react";import{jsx as Wn}from"react/jsx-runtime";var jn=/* @__PURE__ */So(/* @__PURE__ */Dn(function(e,t){let o=co(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=En(null),{data:r,margin:a,className:n,categoryAccessor:s="category",groupBy:l,valueAccessor:c="value",orientation:h="vertical",valueFormat:u,colorBy:d,colorScheme:m,sort:g=!1,barPadding:p=60,roundedTop:f,gradientFill:y,styleRules:v,baselinePadding:b=!1,tooltip:x,annotations:w,valueExtent:k,frameProps:A={},selection:S,linkedHover:R,linkedBrush:P,brush:C,onBrush:_,onObservation:L,onClick:M,hoverHighlight:I,chartId:T,loading:H,loadingContent:B,emptyContent:$,legendInteraction:F,legendPosition:O,color:D,stroke:E,strokeWidth:W,opacity:j,categoryFormat:N}=e,{width:z,height:V,enableHover:G,showGrid:q,showLegend:X,title:Y,description:Q,summary:K,accessibleTable:Z,categoryLabel:U,valueLabel:J}=o,ee=On(()=>Io(r),[r]),te=d||l,oe=$e({responsive:e,data:ee,rawData:r,colorBy:te,colorScheme:m,legendInteraction:F,legendPosition:O,frameLegend:A,selection:S,linkedHover:R,fallbackFields:te?["string"==typeof te?te:""]:[],unwrapData:!0,onObservation:L,onClick:M,hoverHighlight:I,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"GroupedBarChart",chartId:T,showLegend:X,userMargin:a,marginDefaults:o.marginDefaults,loading:H,loadingContent:B,emptyContent:$,width:z,height:V,hasTitle:!!Y,axisChrome:Uo({showAxes:o.showAxes,projection:"horizontal"===h?"horizontal":"vertical",hasCategoryLabel:!!U,hasValueLabel:!!J})}),ie=Zt(),re=On(()=>/* @__PURE__ */new Map,[]),ae=On(()=>ho(c),[c]),ne=de({brushProp:C,onBrushProp:_,linkedBrush:P,valueAccessor:c}),se=ue({colorBy:te,colorScale:oe.colorScale,color:D,themeCategorical:ie,colorScheme:m,categoryIndexMap:re,userPieceStyle:A.pieceStyle,stroke:E,strokeWidth:W,opacity:j,styleRules:v,resolveRuleValue:ae,effectiveSelectionHook:oe.effectiveSelectionHook,resolvedSelection:oe.resolvedSelection}),le=On(()=>vt({categoryAccessor:l,valueAccessor:c,groupAccessor:s,valueFormat:u}),[l,s,c,u]),ce=He({componentName:"GroupedBarChart",data:r,accessors:{categoryAccessor:s,valueAccessor:c},requiredProps:{groupBy:l}}),{effectiveLegendProps:me,effectiveMargin:ge}=he({ref:t,frameRef:i,setup:oe}),pe=On(()=>Qe(y),[y]);if(oe.earlyReturn)return oe.earlyReturn;let fe={chartType:"clusterbar",...null!=r&&{data:ee},oAccessor:s,rAccessor:c,groupBy:l,oSort:g,projection:"horizontal"===h?"horizontal":"vertical",pieceStyle:se,size:[z,V],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ge,barPadding:p,...null!=f&&{roundedTop:f},...pe&&{gradientFill:pe},baselinePadding:b,enableHover:G,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:U,rLabel:J,rFormat:u,...N&&{oFormat:N},showGrid:q,...me,...xt({title:Y,description:Q,summary:K,accessibleTable:Z,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...kt({tooltip:x,defaultTooltipContent:le}),...wt({linkedHover:R,selection:S,onObservation:L,onClick:M,hoverHighlight:I,mobileInteraction:oe.mobileInteraction,customHoverBehavior:oe.customHoverBehavior,customClickBehavior:oe.customClickBehavior}),...w&&w.length>0&&{annotations:w},...k&&{rExtent:k},...ne.brushStreamProps,...Object.fromEntries(Object.entries(A).filter(([e])=>"pieceStyle"!==e))};return ce?/* @__PURE__ */Wn(Po,{componentName:"GroupedBarChart",message:ce,width:z,height:V}):/* @__PURE__ */Wn(_o,{componentName:"GroupedBarChart",width:z,height:V,children:/* @__PURE__ */Wn(aa,{ref:i,...fe})})}),"GroupedBarChart");import{useMemo as Nn,forwardRef as zn,useRef as Vn}from"react";import{jsx as Gn,jsxs as qn}from"react/jsx-runtime";var Xn=/* @__PURE__ */So(/* @__PURE__ */zn(function(e,t){let o=co(e.mode,{width:e.width,height:e.height,showAxes:e.showAxes,showGrid:!1,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,showCategoryTicks:!1,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=Vn(null);Fe(t,{variant:"xy",frameRef:i});let{data:r,margin:a,className:n,stepAccessor:s="step",valueAccessor:l="value",categoryAccessor:c,colorBy:h,colorScheme:u,styleRules:d,orientation:m="horizontal",connectorOpacity:g=.3,showLabels:p=!0,valueFormat:f,tooltip:y,annotations:v,frameProps:b={},selection:x,linkedHover:w,onObservation:k,onClick:A,hoverHighlight:S,chartId:R,loading:P,loadingContent:C,emptyContent:_,legendInteraction:L,legendPosition:M,color:I,stroke:T,strokeWidth:H,opacity:B,categoryFormat:$}=e,F="vertical"===m,{width:O,height:D,enableHover:E,showLegend:W,title:j,description:N,summary:z,accessibleTable:V}=o,G=F?{top:j?60:40,right:20,bottom:60,left:60}:{top:j?40:10,right:10,bottom:10,left:10},q=Nn(()=>Io(r),[r]),X=h||c,Y=!X,Q=$e({responsive:e,data:q,rawData:r,colorBy:X,colorScheme:u,legendInteraction:L,legendPosition:M,frameLegend:b,selection:x,linkedHover:w,fallbackFields:X?["string"==typeof X?X:""]:[],unwrapData:!0,onObservation:k,onClick:A,hoverHighlight:S,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"FunnelChart",chartId:R,showLegend:W,userMargin:a,marginDefaults:G,loading:P,loadingContent:C,emptyContent:_,width:O,height:D,hasTitle:!!j,axisChrome:Uo({showAxes:F&&o.showAxes,projection:F?"vertical":"horizontal",hasCategoryLabel:!1,hasValueLabel:!1})});To("FunnelChart",q,"stepAccessor",s),To("FunnelChart",q,"valueAccessor",l);let K=Zt(),Z=Nn(()=>/* @__PURE__ */new Map,[]),U=Nn(()=>ho(l),[l]),J=Nn(()=>{if(Y)return I||(K?.[0]?K[0]:Array.isArray(u)&&u[0]?u[0]:"#4e79a7")},[Y,I,K,u]),ee=ue({colorBy:J?void 0:X,colorScale:Q.colorScale,color:J??I,themeCategorical:K,colorScheme:u,categoryIndexMap:Z,userPieceStyle:b?.pieceStyle,stroke:T,strokeWidth:H,opacity:B,effectiveSelectionHook:Q.effectiveSelectionHook,resolvedSelection:Q.resolvedSelection,styleRules:d,resolveRuleValue:U}),te=Nn(()=>e=>{let t=e?.data||e,o=t?.__funnelStep||t?.__barFunnelStep||t?.step||"",i=t?.__funnelValue??t?.__barFunnelValue??t?.value??"",r=t?.__funnelPercent??t?.__barFunnelPercent,a=t?.__funnelIsFirstStep??t?.__barFunnelIsFirstStep,n=t?.__barFunnelIsDropoff,s=t?.__barFunnelCategory??t?.category,l=null==r||a?"":` (${Math.abs(r-Math.round(r))<.05?`${Math.round(r)}%`:`${r.toFixed(1)}%`})`;/* */
106
+ return qn("div",{className:"semiotic-tooltip",style:Mi,children:[o&&/* @__PURE__ */Gn("div",{style:{fontWeight:"bold"},children:String(o)}),s&&s!==o&&/* @__PURE__ */Gn("div",{style:{marginTop:2,opacity:.8},children:String(s)}),n&&/* @__PURE__ */Gn("div",{style:{marginTop:2,fontStyle:"italic",opacity:.7},children:"Dropoff"}),
107
+ /* @__PURE__ */qn("div",{style:{marginTop:4},children:[!f||"number"!=typeof i&&"string"!=typeof i?String(i):f(i),l]})]})},[f]);if(Q.earlyReturn)return Q.earlyReturn;let oe=He({componentName:"FunnelChart",data:r,accessors:{stepAccessor:s,valueAccessor:l}});if(oe)/* */return Gn(Po,{componentName:"FunnelChart",message:oe,width:O,height:D});let ie={chartType:F?"bar-funnel":"funnel",...null!=r&&{data:q},oAccessor:s,rAccessor:l,...c&&{stackBy:c},projection:F?"vertical":"horizontal",barPadding:F?40:0,pieceStyle:ee,size:[O,D],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:Q.margin,enableHover:E,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:F&&o.showAxes,showCategoryTicks:F&&o.showAxes,...$&&{oFormat:$},...f&&{rFormat:f},showGrid:F,...!F&&{connectorOpacity:g},showLabels:p,...Q.legendBehaviorProps,...j&&{title:j},...N&&{description:N},...z&&{summary:z},...void 0!==V&&{accessibleTable:V},...n&&{className:n},...null!=e.animate&&{animate:e.animate},tooltipContent:!1===y?()=>null:!0===y||null==y?te:vo(y)||te,...wt({linkedHover:w,selection:x,onObservation:k,onClick:A,hoverHighlight:S,mobileInteraction:Q.mobileInteraction,customHoverBehavior:Q.customHoverBehavior,customClickBehavior:Q.customClickBehavior}),...v&&v.length>0&&{annotations:v},...Object.fromEntries(Object.entries(b).filter(([e])=>"pieceStyle"!==e))};/* */
108
+ return Gn(_o,{componentName:"FunnelChart",width:O,height:D,children:/* @__PURE__ */Gn(aa,{ref:i,...ie})})}),"FunnelChart");import{useMemo as Yn,forwardRef as Qn,useRef as Kn}from"react";import{jsx as Zn}from"react/jsx-runtime";var Un=/* @__PURE__ */So(/* @__PURE__ */Qn(function(e,t){let o=Kn(null);Fe(t,{variant:"xy",frameRef:o});let i=co(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{data:r,margin:a,className:n,categoryAccessor:s="attribute",valueAccessor:l="value",seriesAccessor:c,colorBy:h,categoryFormat:u,colorScheme:d,styleRules:m,pointRadius:g=4,valueExtent:p,valueFormat:f,tooltip:y,annotations:v,frameProps:b={},selection:x,linkedHover:w,onObservation:k,onClick:A,hoverHighlight:S,chartId:R,loading:P,loadingContent:C,emptyContent:_,legendInteraction:L,legendPosition:M,color:I,stroke:T,strokeWidth:H,opacity:B}=e,{width:$,height:F,enableHover:O,showGrid:D,showLegend:E,title:W,description:j,summary:N,accessibleTable:z}=i,V=Yn(()=>Io(r),[r]),G=c||("string"==typeof h?h:void 0)||("function"==typeof h?h:void 0),q=G??"__radar",X=h||G,Y=$e({responsive:e,data:V,rawData:r,colorBy:X,colorScheme:d,legendInteraction:L,legendPosition:M,frameLegend:b,selection:x,linkedHover:w,fallbackFields:["string"==typeof X?X:"","string"==typeof s?s:""].filter(Boolean),unwrapData:!0,onObservation:k,onClick:A,hoverHighlight:S,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"RadarChart",chartId:R,showLegend:E,userMargin:a,marginDefaults:i.marginDefaults,loading:P,loadingContent:C,emptyContent:_,width:$,height:F,hasTitle:!!W,axisChrome:Uo({showAxes:!0,projection:"radial",hasCategoryLabel:!1,hasValueLabel:!1})}),Q=Zt(),K=Yn(()=>/* @__PURE__ */new Map,[]),Z=Yn(()=>ho(l),[l]),U=ue({colorBy:X,colorScale:Y.colorScale,color:I,themeCategorical:Q,colorScheme:d,categoryIndexMap:K,userPieceStyle:b?.pieceStyle,stroke:T,strokeWidth:H,opacity:B,effectiveSelectionHook:Y.effectiveSelectionHook,resolvedSelection:Y.resolvedSelection,baseStyleExtras:{r:g,fillOpacity:.85},styleRules:m,resolveRuleValue:Z}),J=Yn(()=>vt({categoryAccessor:s,valueAccessor:l,groupAccessor:G,groupLabel:"string"==typeof G?G:"series",valueFormat:f}),[s,l,G,f]);if(Y.earlyReturn)return Y.earlyReturn;let ee=He({componentName:"RadarChart",data:r,accessors:{categoryAccessor:s,valueAccessor:l}});if(ee)/* */return Zn(Po,{componentName:"RadarChart",message:ee,width:$,height:F});let te={chartType:"point",projection:"radial",...null!=r&&{data:V},oAccessor:s,rAccessor:l,connectorAccessor:q,connectorStyle:e=>{let t="function"==typeof U?U(e):{},o="string"==typeof t.fill?t.fill:void 0;return{fill:o,fillOpacity:.15,stroke:o,strokeWidth:2,opacity:.7}},pieceStyle:U,...u&&{oFormat:u},rExtent:p??[0],rFormat:f,oLabel:"",size:[$,F],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:Y.margin,enableHover:O,showAxes:!0,showGrid:D,...Y.legendBehaviorProps,...xt({title:W,description:j,summary:N,accessibleTable:z,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...kt({tooltip:y,defaultTooltipContent:J}),...wt({linkedHover:w,selection:x,onObservation:k,onClick:A,hoverHighlight:S,mobileInteraction:Y.mobileInteraction,customHoverBehavior:Y.customHoverBehavior,customClickBehavior:Y.customClickBehavior}),...v&&v.length>0&&{annotations:v},...Object.fromEntries(Object.entries(b).filter(([e])=>"pieceStyle"!==e&&"connectorStyle"!==e))};/* */
109
+ return Zn(_o,{componentName:"RadarChart",width:$,height:F,children:/* @__PURE__ */Zn(aa,{ref:o,...te})})}),"RadarChart");import{useMemo as Jn,forwardRef as es,useRef as ts}from"react";import{jsx as os}from"react/jsx-runtime";var is=/* @__PURE__ */So(/* @__PURE__ */es(function(e,t){let o=co(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,categoryLabel:e.categoryLabel,valueLabel:e.valueLabel,showCategoryTicks:e.showCategoryTicks,orientation:e.orientation,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=ts(null),{data:r,margin:a,className:n,categoryAccessor:s="category",subcategoryAccessor:l,valueAccessor:c="value",orientation:h="horizontal",valueFormat:u,colorBy:d,colorScheme:m,styleRules:g,barPadding:p,tooltip:f,annotations:y,brush:v,onBrush:b,linkedBrush:x,frameProps:w={},selection:k,linkedHover:A,onObservation:S,onClick:R,hoverHighlight:P,chartId:C,loading:_,loadingContent:L,emptyContent:M,legendInteraction:I,legendPosition:T,color:H,stroke:B,strokeWidth:$,opacity:F,categoryFormat:O,rTickValues:D,tickLabelEdgeAlign:E,showCategoryTicks:W,gradientFill:j,trackFill:N,roundedTop:z,valueExtent:V}=e,{width:G,height:q,enableHover:X,showGrid:Y,showLegend:Q,title:K,description:Z,summary:U,accessibleTable:J,categoryLabel:ee,valueLabel:te}=o,oe=Jn(()=>Io(r),[r]),ie=d||l,re=Jn(()=>{if(null!=p)return p;if("sparkline"!==o.mode)return 40;let e=new Set(oe.map(e=>"function"==typeof s?s(e):e[s])),t=Math.max(1,e.size);if(t<=1)return 1;let i=(("horizontal"===h?q:G)-2*t)/(t-1);return Math.max(0,Math.min(1,i))},[p,o.mode,oe,s,h,G,q]),ae=$e({responsive:e,data:oe,rawData:r,colorBy:ie,colorScheme:m,legendInteraction:I,legendPosition:T,frameLegend:w,selection:k,linkedHover:A,fallbackFields:ie?["string"==typeof ie?ie:""]:[],unwrapData:!0,onObservation:S,onClick:R,hoverHighlight:P,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"SwimlaneChart",chartId:C,showLegend:Q,userMargin:a,marginDefaults:o.marginDefaults,loading:_,loadingContent:L,emptyContent:M,width:G,height:q,hasTitle:!!K,axisChrome:Uo({showAxes:o.showAxes,projection:"horizontal"===h?"horizontal":"vertical",hasCategoryLabel:!1!==W&&!!ee,hasValueLabel:!!te})}),ne=de({brushProp:v,onBrushProp:b,linkedBrush:x,valueAccessor:c}),se=Zt(),le=Jn(()=>/* @__PURE__ */new Map,[]),ce=Jn(()=>ho(c),[c]),me=ue({colorBy:ie,colorScale:ae.colorScale,color:H,themeCategorical:se,colorScheme:m,categoryIndexMap:le,userPieceStyle:w?.pieceStyle,stroke:B,strokeWidth:$,opacity:F,effectiveSelectionHook:ae.effectiveSelectionHook,resolvedSelection:ae.resolvedSelection,cycleByCategory:!0,styleRules:g,resolveRuleValue:ce}),ge=Jn(()=>vt({categoryAccessor:l,valueAccessor:c,groupAccessor:s,valueFormat:u}),[l,s,c,u]),pe=He({componentName:"SwimlaneChart",data:r,accessors:{categoryAccessor:s,valueAccessor:c,subcategoryAccessor:l},requiredProps:{subcategoryAccessor:l}}),{effectiveLegendProps:fe,effectiveMargin:ye}=he({ref:t,frameRef:i,setup:ae}),ve=Jn(()=>Qe(j),[j]);if(ae.earlyReturn)return ae.earlyReturn;let be={chartType:"swimlane",...null!=r&&{data:oe},oAccessor:s,rAccessor:c,stackBy:l,projection:"horizontal"===h?"horizontal":"vertical",pieceStyle:me,size:[G,q],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:ye,barPadding:re,enableHover:X,...e.dataIdAccessor&&{dataIdAccessor:e.dataIdAccessor},showAxes:o.showAxes,oLabel:!1===W?void 0:ee,rLabel:te,rFormat:u,...D&&{rTickValues:D},...null!=E&&{tickLabelEdgeAlign:E},...O&&{oFormat:O},...void 0!==W&&{showCategoryTicks:W},showGrid:Y,...fe,...xt({title:K,description:Z,summary:U,accessibleTable:J,className:n,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...kt({tooltip:f,defaultTooltipContent:ge}),...wt({linkedHover:A,selection:k,onObservation:S,onClick:R,hoverHighlight:P,mobileInteraction:ae.mobileInteraction,customHoverBehavior:ae.customHoverBehavior,customClickBehavior:ae.customClickBehavior}),...y&&y.length>0&&{annotations:y},...ve&&{gradientFill:ve},...null!=N&&{trackFill:N},...null!=z&&{roundedTop:z},...V&&{rExtent:V},...ne.brushStreamProps,...Object.fromEntries(Object.entries(w).filter(([e])=>"pieceStyle"!==e))};return pe?/* @__PURE__ */os(Po,{componentName:"SwimlaneChart",message:pe,width:G,height:q}):/* @__PURE__ */os(_o,{componentName:"SwimlaneChart",width:G,height:q,children:/* @__PURE__ */os(aa,{ref:i,...be})})}),"SwimlaneChart");import{forwardRef as rs,useMemo as as}from"react";import{jsx as ns}from"react/jsx-runtime";var ss=/* @__PURE__ */So(/* @__PURE__ */rs(function(e,t){let{data:o,layout:i,layoutConfig:r,onLayoutError:a,categoryAccessor:n="category",valueAccessor:s="value",oExtent:l,rExtent:c,projection:h="vertical",margin:u,className:d,colorBy:m,colorScheme:g,tooltip:p,showAxes:f=!1,annotations:y,onObservation:v,onClick:b,selection:x,linkedHover:w,chartId:k,loading:A,loadingContent:S,emptyContent:R,frameProps:P={}}=e,{frameRef:C,resolved:_,safeData:L,setup:M,earlyReturn:I}=Te({responsive:e,imperativeRef:t,imperativeVariant:"xy",chartTypeLabel:"OrdinalCustomChart",unwrapData:!0,data:o,colorBy:m,colorScheme:g,frameLegend:P,selection:x,linkedHover:w,onObservation:v,onClick:b,chartId:k,loading:A,loadingContent:S,emptyContent:R,margin:u,width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mode:e.mode,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),T=M.effectiveSelectionHook,H=as(()=>T?.isActive?{isActive:!0,predicate:T.predicate}:null,[T?.isActive,T?.predicate]),B=as(()=>vo(p),[p]);if(I)return I;let{width:$,height:F,enableHover:O,showGrid:D,title:E,description:W,summary:j,accessibleTable:N}=_,z={chartType:"custom",...null!=o&&{data:L},customLayout:i,layoutConfig:r,onLayoutError:a,...H&&{layoutSelection:H},oAccessor:n,rAccessor:s,oExtent:l,rExtent:c,projection:h,colorAccessor:m,colorScheme:g,size:[$,F],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:M.margin,enableHover:O,showAxes:f,showGrid:D,annotations:y,...xt({title:E,description:W,summary:j,accessibleTable:N,className:d,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,axisExtent:e.axisExtent,autoPlaceAnnotations:e.autoPlaceAnnotations}),...!1===p?{tooltipContent:()=>null}:B?{tooltipContent:B}:{},...M.legendBehaviorProps,...wt({linkedHover:w,selection:x,onObservation:v,onClick:b,hoverHighlight:!1,mobileInteraction:M.mobileInteraction,customHoverBehavior:M.customHoverBehavior,customClickBehavior:M.customClickBehavior}),...P};/* */
110
+ return ns(_o,{componentName:"OrdinalCustomChart",width:$,height:F,children:/* @__PURE__ */ns(aa,{ref:C,...z})})}),"OrdinalCustomChart");export{aa as a,pa as b,xa as c,Fa as d,ja as e,qa as f,Ja as g,an as h,hn as i,pn as j,An as k,_n as l,Fn as m,jn as n,Xn as o,Un as p,is as q,ss as r};
@@ -0,0 +1 @@
1
+ import{a,b as s,c as m,d as i,e as o,f as r,g as c,h as n}from"./c-F76M77YC.min.js";import{e as t}from"./c-UZJAWWAI.min.js";import{a as A,i as f,k as p,l as j}from"./c-VLAAAFST.min.js";function e(){A(f),A(p),A(a),A(j),A(s),A(m),A(i),A(o),A(r),A(c),A(n),A(t)}export{e as a};