semiotic 3.8.4 → 3.8.6

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 (222) hide show
  1. package/CLAUDE.md +9 -5
  2. package/README.md +52 -46
  3. package/ai/behaviorContracts.cjs +2 -2
  4. package/ai/componentMetadata.cjs +2 -2
  5. package/ai/dist/mcp-server.js +6 -2
  6. package/ai/examples.md +211 -2
  7. package/ai/schema.json +1388 -14
  8. package/ai/surface-manifest.json +8 -4
  9. package/ai/system-prompt.md +1 -1
  10. package/dist/chunk-chartContainerDataAudit-FEOD5GTQ.module.min.js +2 -0
  11. package/dist/chunk-chunk-2CHN2TA3.module.min.js +1 -0
  12. package/dist/chunk-chunk-2JGJ5GUG.module.min.js +1 -0
  13. package/dist/chunk-chunk-3NGIKFD6.module.min.js +1 -0
  14. package/dist/chunk-chunk-3SHB24AG.module.min.js +1 -0
  15. package/dist/chunk-chunk-4MMOOYTX.module.min.js +2 -0
  16. package/dist/chunk-chunk-75OTQSXS.module.min.js +1 -0
  17. package/dist/chunk-chunk-A5GRQUOF.module.min.js +1 -0
  18. package/dist/chunk-chunk-AAF5LZAU.module.min.js +2 -0
  19. package/dist/{chunk-chunk-LQBSXO7K.module.min.js → chunk-chunk-ARZGA4LJ.module.min.js} +1 -1
  20. package/dist/chunk-chunk-CAFLML4L.module.min.js +2 -0
  21. package/dist/chunk-chunk-CO5KQMGH.module.min.js +1 -0
  22. package/dist/chunk-chunk-FHBN7OEB.module.min.js +2 -0
  23. package/dist/{chunk-chunk-KQ546MKE.module.min.js → chunk-chunk-GFTVACTO.module.min.js} +1 -1
  24. package/dist/chunk-chunk-IP2UE74X.module.min.js +1 -0
  25. package/dist/chunk-chunk-ITDWLZXV.module.min.js +2 -0
  26. package/dist/chunk-chunk-LPSPATPC.module.min.js +1 -0
  27. package/dist/chunk-chunk-OM6NWS4H.module.min.js +2 -0
  28. package/dist/chunk-chunk-PX5YQGDP.module.min.js +2 -0
  29. package/dist/chunk-chunk-Q2BS46W2.module.min.js +2 -0
  30. package/dist/{chunk-chunk-FBGHXL72.module.min.js → chunk-chunk-RA7JCG7D.module.min.js} +1 -1
  31. package/dist/chunk-chunk-RNUHEXZA.module.min.js +2 -0
  32. package/dist/chunk-chunk-ROZWKEUG.module.min.js +1 -0
  33. package/dist/chunk-chunk-SMVD3EQJ.module.min.js +2 -0
  34. package/dist/chunk-chunk-T2FKJD4O.module.min.js +2 -0
  35. package/dist/chunk-chunk-UDREYOLV.module.min.js +1 -0
  36. package/dist/chunk-chunk-VOWE3SAP.module.min.js +2 -0
  37. package/dist/chunk-chunk-VQPNBUSW.module.min.js +2 -0
  38. package/dist/{chunk-chunk-7RYBCTK5.module.min.js → chunk-chunk-WAWCIHFJ.module.min.js} +1 -1
  39. package/dist/{chunk-chunk-F7WFPD4O.module.min.js → chunk-chunk-WYARAXHR.module.min.js} +1 -1
  40. package/dist/{chunk-chunk-JDXT6ORT.module.min.js → chunk-chunk-XP3OHHFX.module.min.js} +1 -1
  41. package/dist/chunk-chunk-XV3KGYTR.module.min.js +2 -0
  42. package/dist/chunk-chunk-YC2IVEPX.module.min.js +1 -0
  43. package/dist/chunk-chunk-ZXIXAPRE.module.min.js +2 -0
  44. package/dist/components/ChartContainer.d.ts +10 -0
  45. package/dist/components/ai/chartCapabilities.d.ts +3 -1
  46. package/dist/components/ai/chartCapabilityTypes.d.ts +14 -0
  47. package/dist/components/chartContainerDataAudit.d.ts +10 -0
  48. package/dist/components/charts/custom/XYCustomChart.d.ts +3 -0
  49. package/dist/components/charts/geo/DistanceCartogram.d.ts +30 -4
  50. package/dist/components/charts/index.d.ts +4 -0
  51. package/dist/components/charts/network/ForceDirectedGraph.d.ts +36 -1
  52. package/dist/components/charts/ordinal/BarChart.d.ts +7 -14
  53. package/dist/components/charts/ordinal/GaugeChart.d.ts +3 -0
  54. package/dist/components/charts/ordinal/GroupedBarChart.d.ts +3 -0
  55. package/dist/components/charts/ordinal/StackedBarChart.d.ts +3 -0
  56. package/dist/components/charts/ordinal/SwimlaneChart.d.ts +4 -14
  57. package/dist/components/charts/physics/CrucibleChart.capability.d.ts +8 -0
  58. package/dist/components/charts/physics/CrucibleChart.d.ts +63 -0
  59. package/dist/components/charts/physics/crucibleBodyRenderers.d.ts +27 -0
  60. package/dist/components/charts/physics/crucibleChartProps.d.ts +90 -0
  61. package/dist/components/charts/physics/crucibleChrome.d.ts +47 -0
  62. package/dist/components/charts/physics/crucibleController.d.ts +59 -0
  63. package/dist/components/charts/physics/crucibleEffects.d.ts +30 -0
  64. package/dist/components/charts/physics/cruciblePhysics.d.ts +54 -0
  65. package/dist/components/charts/physics/crucibleProgram.d.ts +38 -0
  66. package/dist/components/charts/physics/crucibleTypes.d.ts +415 -0
  67. package/dist/components/charts/shared/chartSpecCore.d.ts +10 -4
  68. package/dist/components/charts/shared/crucibleWireSchema.d.ts +5 -0
  69. package/dist/components/charts/shared/diagnoseTypes.d.ts +10 -0
  70. package/dist/components/charts/shared/gaugeGradient.d.ts +4 -8
  71. package/dist/components/charts/shared/gradient.d.ts +35 -0
  72. package/dist/components/charts/shared/hatchFill.d.ts +3 -10
  73. package/dist/components/charts/shared/hooks.d.ts +2 -50
  74. package/dist/components/charts/shared/knownChartComponents.d.ts +1 -1
  75. package/dist/components/charts/shared/streamPropsHelpers.d.ts +1 -2
  76. package/dist/components/charts/shared/useChartLegend.d.ts +58 -0
  77. package/dist/components/charts/shared/useChartSetup.d.ts +5 -0
  78. package/dist/components/charts/shared/useCustomChartSetup.d.ts +6 -1
  79. package/dist/components/charts/shared/useNetworkChartSetup.d.ts +1 -0
  80. package/dist/components/charts/shared/useStreamingLegend.d.ts +1 -1
  81. package/dist/components/charts/xy/AreaChart.d.ts +25 -42
  82. package/dist/components/charts/xy/BumpChart.capability.d.ts +11 -0
  83. package/dist/components/charts/xy/BumpChart.d.ts +161 -0
  84. package/dist/components/charts/xy/DifferenceChart.d.ts +3 -10
  85. package/dist/components/charts/xy/Heatmap.d.ts +3 -0
  86. package/dist/components/charts/xy/LineChart.d.ts +6 -8
  87. package/dist/components/data/auditData.d.ts +51 -0
  88. package/dist/components/data/dataAuditPresentation.d.ts +18 -0
  89. package/dist/components/data/dataAuditSources.d.ts +9 -0
  90. package/dist/components/data/numericContracts.d.ts +59 -0
  91. package/dist/components/data/numericFieldProfiler.d.ts +23 -0
  92. package/dist/components/geometry/bumpRibbonGeometry.d.ts +36 -0
  93. package/dist/components/legendLayout.d.ts +19 -1
  94. package/dist/components/recipes/netEnsembleLayout.d.ts +167 -0
  95. package/dist/components/recipes/netEnsembleOverlays.d.ts +20 -0
  96. package/dist/components/recipes/wordTrails.d.ts +156 -0
  97. package/dist/components/recipes/wordTrailsProgressiveReveal.d.ts +42 -0
  98. package/dist/components/semiotic-ai-core.d.ts +3 -0
  99. package/dist/components/semiotic-ai-data-audit.d.ts +4 -0
  100. package/dist/components/semiotic-ai.d.ts +9 -6
  101. package/dist/components/semiotic-geo.d.ts +1 -0
  102. package/dist/components/semiotic-network.d.ts +1 -0
  103. package/dist/components/semiotic-ordinal.d.ts +2 -0
  104. package/dist/components/semiotic-physics.d.ts +2 -0
  105. package/dist/components/semiotic-realtime-core.d.ts +1 -0
  106. package/dist/components/semiotic-recipes-core.d.ts +4 -0
  107. package/dist/components/semiotic-server-edge.d.ts +1 -1
  108. package/dist/components/semiotic-server.d.ts +1 -1
  109. package/dist/components/semiotic-utils-core.d.ts +3 -0
  110. package/dist/components/semiotic-xy.d.ts +4 -0
  111. package/dist/components/semiotic.d.ts +5 -5
  112. package/dist/components/server/renderEvidence.d.ts +27 -0
  113. package/dist/components/server/serverChartConfigs.d.ts +2 -0
  114. package/dist/components/server/serverChartConfigsPhysics.d.ts +9 -0
  115. package/dist/components/server/serverChartConfigsXY.d.ts +1 -0
  116. package/dist/components/server/staticAnnotations.d.ts +12 -0
  117. package/dist/components/server/staticLegend.d.ts +4 -2
  118. package/dist/components/server/staticSVGChrome.d.ts +4 -4
  119. package/dist/components/stream/GeoPipelineStore.d.ts +1 -0
  120. package/dist/components/stream/GeoSVGOverlay.d.ts +11 -10
  121. package/dist/components/stream/NetworkSVGOverlay.d.ts +2 -6
  122. package/dist/components/stream/OrdinalSVGOverlay.d.ts +2 -6
  123. package/dist/components/stream/SVGOverlay.d.ts +2 -6
  124. package/dist/components/stream/StalenessBadge.d.ts +2 -6
  125. package/dist/components/stream/geoCartogram.d.ts +7 -0
  126. package/dist/components/stream/geoTypes.d.ts +20 -8
  127. package/dist/components/stream/legendRenderer.d.ts +2 -6
  128. package/dist/components/stream/networkFrameHandleTypes.d.ts +4 -0
  129. package/dist/components/stream/ordinalTypes.d.ts +7 -31
  130. package/dist/components/stream/physics/PhysicsKernel.d.ts +1 -0
  131. package/dist/components/stream/physics/PhysicsSVGOverlay.d.ts +2 -6
  132. package/dist/components/stream/physics/PhysicsSettledSVG.d.ts +8 -0
  133. package/dist/components/stream/physics/StreamPhysicsTypes.d.ts +2 -6
  134. package/dist/components/stream/pipelineConfig.d.ts +7 -15
  135. package/dist/components/stream/renderers/canvasRenderHelpers.d.ts +9 -69
  136. package/dist/components/stream/renderers/cornerRadii.d.ts +2 -9
  137. package/dist/components/stream/renderers/thresholdLineSegments.d.ts +12 -0
  138. package/dist/components/stream/sceneToSVGShared.d.ts +3 -5
  139. package/dist/components/stream/types.d.ts +32 -56
  140. package/dist/components/stream/xySceneBuilders/areaGradient.d.ts +4 -20
  141. package/dist/components/stream/xySceneBuilders/types.d.ts +6 -6
  142. package/dist/components/types/legendTypes.d.ts +15 -6
  143. package/dist/components/useChartContainerDataAudit.d.ts +7 -0
  144. package/dist/geo.min.js +1 -1
  145. package/dist/geo.module.min.js +1 -1
  146. package/dist/network.min.js +1 -1
  147. package/dist/network.module.min.js +1 -1
  148. package/dist/ordinal.min.js +1 -1
  149. package/dist/ordinal.module.min.js +1 -1
  150. package/dist/physics.min.js +1 -1
  151. package/dist/physics.module.min.js +1 -1
  152. package/dist/physicsWorker.js +1 -1
  153. package/dist/realtime.min.js +1 -1
  154. package/dist/realtime.module.min.js +1 -1
  155. package/dist/semiotic-ai-core.d.ts +3 -0
  156. package/dist/semiotic-ai-core.min.js +1 -1
  157. package/dist/semiotic-ai-core.module.min.js +1 -1
  158. package/dist/semiotic-ai.d.ts +9 -6
  159. package/dist/semiotic-ai.min.js +1 -1
  160. package/dist/semiotic-ai.module.min.js +1 -1
  161. package/dist/semiotic-experimental.min.js +1 -1
  162. package/dist/semiotic-experimental.module.min.js +1 -1
  163. package/dist/semiotic-geo.d.ts +1 -0
  164. package/dist/semiotic-network.d.ts +1 -0
  165. package/dist/semiotic-ordinal.d.ts +2 -0
  166. package/dist/semiotic-physics.d.ts +2 -0
  167. package/dist/semiotic-realtime-core.d.ts +1 -0
  168. package/dist/semiotic-realtime-core.min.js +1 -1
  169. package/dist/semiotic-realtime-core.module.min.js +1 -1
  170. package/dist/semiotic-recipes-core.d.ts +4 -0
  171. package/dist/semiotic-recipes-core.min.js +1 -1
  172. package/dist/semiotic-recipes-core.module.min.js +1 -1
  173. package/dist/semiotic-recipes.min.js +1 -1
  174. package/dist/semiotic-recipes.module.min.js +1 -1
  175. package/dist/semiotic-server-edge.d.ts +1 -1
  176. package/dist/semiotic-server-edge.min.js +1 -1
  177. package/dist/semiotic-server-edge.module.min.js +1 -1
  178. package/dist/semiotic-server-node.min.js +1 -1
  179. package/dist/semiotic-server-node.module.min.js +1 -1
  180. package/dist/semiotic-server.d.ts +1 -1
  181. package/dist/semiotic-utils-core.d.ts +3 -0
  182. package/dist/semiotic-utils-core.min.js +1 -1
  183. package/dist/semiotic-utils-core.module.min.js +1 -1
  184. package/dist/semiotic-utils.min.js +1 -1
  185. package/dist/semiotic-utils.module.min.js +1 -1
  186. package/dist/semiotic-xy.d.ts +4 -0
  187. package/dist/semiotic.d.ts +5 -5
  188. package/dist/semiotic.min.js +1 -1
  189. package/dist/semiotic.module.min.js +1 -1
  190. package/dist/server.min.js +1 -1
  191. package/dist/server.module.min.js +1 -1
  192. package/dist/xy.min.js +1 -1
  193. package/dist/xy.module.min.js +1 -1
  194. package/package.json +2 -2
  195. package/dist/chunk-chunk-3ILKBVVQ.module.min.js +0 -1
  196. package/dist/chunk-chunk-6TPGFL7M.module.min.js +0 -2
  197. package/dist/chunk-chunk-7KZJUTKP.module.min.js +0 -2
  198. package/dist/chunk-chunk-ANYDWOZF.module.min.js +0 -1
  199. package/dist/chunk-chunk-AQPQN2HH.module.min.js +0 -2
  200. package/dist/chunk-chunk-ASKSE5F5.module.min.js +0 -1
  201. package/dist/chunk-chunk-AVBI6GDT.module.min.js +0 -1
  202. package/dist/chunk-chunk-B3DRZPBK.module.min.js +0 -2
  203. package/dist/chunk-chunk-BFHUYEOS.module.min.js +0 -2
  204. package/dist/chunk-chunk-C57LR3YG.module.min.js +0 -1
  205. package/dist/chunk-chunk-F5V4UIE6.module.min.js +0 -2
  206. package/dist/chunk-chunk-FP44FHFO.module.min.js +0 -2
  207. package/dist/chunk-chunk-HKXUAEPJ.module.min.js +0 -2
  208. package/dist/chunk-chunk-ICEXPNDC.module.min.js +0 -2
  209. package/dist/chunk-chunk-JMVEIZXP.module.min.js +0 -1
  210. package/dist/chunk-chunk-KHCOJMGK.module.min.js +0 -1
  211. package/dist/chunk-chunk-LRIFN2HK.module.min.js +0 -1
  212. package/dist/chunk-chunk-MFHF4J2Z.module.min.js +0 -1
  213. package/dist/chunk-chunk-N6VKKF3A.module.min.js +0 -2
  214. package/dist/chunk-chunk-NEVE562N.module.min.js +0 -1
  215. package/dist/chunk-chunk-NKZ75IM5.module.min.js +0 -2
  216. package/dist/chunk-chunk-PLIDPQNG.module.min.js +0 -2
  217. package/dist/chunk-chunk-QGZGZI4X.module.min.js +0 -1
  218. package/dist/chunk-chunk-RP7WTID5.module.min.js +0 -1
  219. package/dist/chunk-chunk-S7KLNUO6.module.min.js +0 -1
  220. package/dist/chunk-chunk-SR4ZXOWR.module.min.js +0 -2
  221. package/dist/chunk-statisticalOverlays-QGDLRUHX.module.min.js +0 -1
  222. package/dist/chunk-statisticalOverlays-T77OKLDY.module.min.js +0 -1
@@ -1,2 +0,0 @@
1
- "use client";
2
- import{MobileStandardControls as e,auditVisualizationControls as t}from"./chunk-chunk-RCF52Z42.module.min.js";import{resolveAccessor as i,resolveRawAccessor as n}from"./chunk-chunk-AQPQN2HH.module.min.js";import{filterAnnotationsByStatus as r}from"./chunk-chunk-F7WFPD4O.module.min.js";import{DataSummaryProvider as o,LinkedCharts as a,annotationStableId as s,resolveResponsiveRules as l,useChartObserver as c,useDataSummaryToggle as d,useLinkedChartsActive as u,useObservationSelector as m,useSelection as p}from"./chunk-chunk-BFHUYEOS.module.min.js";import{getMinMax as h}from"./chunk-chunk-JJ2OOIET.module.min.js";import{ChartErrorBoundary as f}from"./chunk-chunk-ACLDBMRH.module.min.js";async function g(e,t){const{format:i="png",filename:n="chart",scale:r=2,background:o="white"}=t||{},a=e.querySelector("svg");if(!a)throw Error("No SVG element found in the container");const s=a.cloneNode(!0),l=a.getBoundingClientRect();if(s.getAttribute("width")||s.setAttribute("width",l.width+""),s.getAttribute("height")||s.setAttribute("height",l.height+""),s.getAttribute("xmlns")||s.setAttribute("xmlns","http://www.w3.org/2000/svg"),b(a,s),"svg"===i){const e=(new XMLSerializer).serializeToString(s);y(new Blob([e],{type:"image/svg+xml;charset=utf-8"}),n+".svg")}else{const t=l.width*r,i=l.height*r,a=document.createElement("canvas");a.width=t,a.height=i;const c=a.getContext("2d");c.fillStyle=o,c.fillRect(0,0,t,i),c.scale(r,r);const d=e.querySelector("canvas");d&&c.drawImage(d,0,0,l.width,l.height);const u=(new XMLSerializer).serializeToString(s),m=new Blob([u],{type:"image/svg+xml;charset=utf-8"}),p=URL.createObjectURL(m),h=new Image;h.width=l.width,h.height=l.height,await new Promise((e,t)=>{h.onload=()=>{c.drawImage(h,0,0),a.toBlob(i=>{i?(y(i,n+".png"),e()):t(Error("Failed to create PNG blob"))},"image/png"),URL.revokeObjectURL(p)},h.onerror=()=>{URL.revokeObjectURL(p),t(Error("Failed to load SVG image"))},h.src=p})}}function b(e,t){const i=e.children,n=t.children,r=window.getComputedStyle(e),o=["fill","stroke","stroke-width","stroke-dasharray","opacity","fill-opacity","stroke-opacity","font-family","font-size","font-weight","text-anchor","dominant-baseline"];for(const e of o){const i=r.getPropertyValue(e);i&&"none"!==i&&""!==i&&t.style?.setProperty(e,i)}for(let e=0;Math.min(i.length,n.length)>e;e++)b(i[e],n[e])}function y(e,t){const i=URL.createObjectURL(e),n=document.createElement("a");n.href=i,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(i)}function v(e){return x(e),e}function x(e){if(!e||"object"!=typeof e)throw Error("Chart recipe must be an object.");if("string"!=typeof e.id||""===e.id.trim())throw Error("Chart recipe requires a non-empty id.");if("string"!=typeof e.name||""===e.name.trim())throw Error(`Chart recipe "${e.id}" requires a non-empty name.`);if(!Array.isArray(e.dataRoles)||0===e.dataRoles.length)throw Error(`Chart recipe "${e.id}" requires at least one data role.`);if(!Array.isArray(e.intents)||0===e.intents.length)throw Error(`Chart recipe "${e.id}" requires at least one intent.`);for(const t of e.intents)if("string"!=typeof t&&(!t||"string"!=typeof t.id&&"string"!=typeof t.name))throw Error(`Chart recipe "${e.id}" has an intent without an id or name.`);if(!e.designContract?.whyCustom)throw Error(`Chart recipe "${e.id}" requires designContract.whyCustom.`);if(!e.accessibility||"object"!=typeof e.accessibility)throw Error(`Chart recipe "${e.id}" requires accessibility expectations.`);if(void 0!==e.controls){const i=t({controls:e.controls}).findings.filter(e=>"fail"===e.status);if(i.length>0)throw Error(`Chart recipe "${e.id}" has invalid controls: ${i.map(e=>e.message).join(" ")}`)}if("portable"===e.portability){if(!w(e.layout))throw Error(`Portable chart recipe "${e.id}" must reference a registered layout by id.`);const t=e.layoutConfigSchema??e.portabilityConfig?.schema;if(!t)throw Error(`Portable chart recipe "${e.id}" requires a serializable layout config schema.`);if(!k(t))throw Error(`Portable chart recipe "${e.id}" has a layout config schema that is not JSON-safe.`)}}function w(e){return!!e&&"object"==typeof e&&"string"==typeof e.id}function k(e,t=new Set){if(null===e)return!0;const i=typeof e;if("string"===i||"boolean"===i)return!0;if("number"===i)return Number.isFinite(e);if("object"!==i)return!1;if(t.has(e))return!1;t.add(e);const n=Array.isArray(e)?e.every(e=>k(e,t)):Object.entries(e).every(([,e])=>k(e,t));return t.delete(e),n}function $(e){return"string"==typeof e?e:e.id??e.name}function C(e){return"string"==typeof e?3:"number"==typeof e.score&&Number.isFinite(e.score)?Math.max(0,Math.min(5,e.score>1?e.score:5*e.score)):"primary"===e.strength?5:"secondary"===e.strength?3:"supporting"===e.strength?2:3}function S(e){const t=new Set(e.intents.map($));return t.has("geo")?"geo":t.has("hierarchy")?"hierarchy":t.has("flow")?"flow":t.has("relationship")?"network":t.has("distribution")?"distribution":t.has("correlation")?"relationship":t.has("trend")||t.has("composition-over-time")?"time-series":t.has("compare-categories")||t.has("rank")||t.has("part-to-whole")?"categorical":"custom"}function A(e){const t=Object.values(e.audience?.familiarity??{}),i=t.find(e=>"number"==typeof e);if(void 0!==i)return Math.max(1,Math.min(5,Math.round(i)));const n=t.filter(e=>"string"==typeof e);return n.includes("high")?4:n.includes("medium")?3:n.includes("low")?2:e.reception?.memorableForm?3:2}function j(e,t){return"nodes"===t?e.network?.nodes??[]:"edges"===t?e.network?.edges??[]:"areas"===t?e.geo?.features??[]:"points"===t?e.geo?.points??[]:"lines"===t?e.geo?.flows??[]:e.data}function N(e,t,i){return j(e,t.source).some(e=>null!=e&&Object.prototype.hasOwnProperty.call(e,i))}function I(e,t,i){if(t.field&&N(i,t,t.field))return t.field;if("nodes"===t.source||"edges"===t.source){const e="node-id"===t.role?"id":"edge-source"===t.role?"source":"edge-target"===t.role?"target":void 0;if(e&&N(i,t,e))return e}switch(t.semanticType){case"quantitative":return i.primary.y??i.primary.size??i.primary.x;case"temporal":return i.primary.time??i.primary.x;case"nominal":case"ordinal":return i.primary.category??i.primary.series;case"identifier":{const e=j(i,t.source);return["id","key","name"].find(t=>e.some(e=>null!=e&&Object.prototype.hasOwnProperty.call(e,t)))}case"geographic":return i.hasGeo?t.field:void 0;default:return t.field}}function L(e){const t={},i=[];for(const n of e.intents){const e=$(n);e&&(t[e]=C(n),"string"!=typeof n&&n.rationale&&i.push(n.rationale))}i.push(...(e.reception?.strengths??[]).map(e=>"Reception strength: "+e));const n=e.reception?.risks??[],r=e.designContract.misuse??[],o=[...e.designContract.caveats??[],...e.caveats??[]];return{component:e.id,displayName:e.name,candidateKind:"recipe",family:S(e),renderingFamily:e.frameFamily,importPath:"semiotic/ai",rubric:{familiarity:A(e),accuracy:4,precision:n.some(e=>/precis|comparison/i.test(e))?2:3},fits:t=>function(e,t){for(const i of e.dataRoles)if(!1!==i.required&&!I(0,i,t))return`needs data role "${i.role}" (${i.semanticType})`;const i=e.audit?.maxCategories;return"number"==typeof i&&"number"==typeof t.categoryCount&&t.categoryCount>i?`${t.categoryCount} categories exceeds this recipe's declared maximum of ${i}`:null}(e,t),intentScores:t,caveats:()=>[...n,...r,...o],buildProps:t=>function(e,t){const i={};for(const n of e.dataRoles){const e=I(0,n,t);e&&n.accessor&&(i[n.accessor]=e)}const n={recipeId:e.id,layoutConfig:i};e.frameFamily.startsWith("Network")?(n.nodes=t.network?.nodes??t.data,n.edges=t.network?.edges??[]):e.frameFamily.startsWith("Geo")?(n.areas=t.geo?.features??[],n.points=t.geo?.points??t.data,n.lines=t.geo?.flows??[]):n.data=t.data;const r=e.mobile??("number"==typeof e.accessibility.minimumHitTarget?{minimumHitTarget:e.accessibility.minimumHitTarget}:void 0);return r&&(n.mobileSemantics=r),n}(e,t),mobile:e.mobile??("number"==typeof e.accessibility.minimumHitTarget?{minimumHitTarget:e.accessibility.minimumHitTarget}:void 0),recipe:e,positiveRationale:i,whyCustom:{defaultAlternative:e.designContract.defaultAlternative,reason:e.designContract.whyNotDefault??e.designContract.whyCustom,tradeoff:e.designContract.tradeoff??(n.length>0?n[0]:void 0)}}}var P=Symbol.for("semiotic.chartRecipeRegistry");function R(){const e=globalThis;return e[P]||(e[P]={recipes:new Map,capabilities:new Map,layouts:new Map}),e[P]}function M(e){x(e),R().recipes.set(e.id,e),R().capabilities.set(e.id,L(e))}function B(e){R().recipes.delete(e),R().capabilities.delete(e)}function F(e){return R().recipes.get(e)}function z(){return Array.from(R().recipes.values())}function T(){return Array.from(R().capabilities.values())}function D(){return R().capabilities.size>0}function E(e,t){if(!e)throw Error("Recipe layout requires a non-empty id.");if("function"!=typeof t)throw Error(`Recipe layout "${e}" must be a function.`);R().layouts.set(e,t)}function O(e){R().layouts.delete(e)}function H(e){return R().layouts.get(e)}function W(e){return"string"==typeof e?F(e):e&&"object"==typeof e&&"string"==typeof e.id?e:void 0}var V=["BarChart","StackedBarChart","GroupedBarChart","SwarmPlot","BoxPlot","Histogram","ViolinPlot","RidgelinePlot","DotPlot","PieChart","DonutChart","GaugeChart","FunnelChart","SwimlaneChart","LikertChart","LineChart","AreaChart","DifferenceChart","StackedAreaChart","Scatterplot","BubbleChart","Heatmap","QuadrantChart","MultiAxisLineChart","CandlestickChart","ConnectedScatterplot","ScatterplotMatrix","MinimapChart","ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram","TreeDiagram","Treemap","CirclePack","OrbitDiagram","ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram","RealtimeLineChart","RealtimeHistogram","TemporalHistogram","RealtimeSwarmChart","RealtimeWaterfallChart","RealtimeHeatmap","GaltonBoardChart","EventDropChart","PhysicsPileChart","CollisionSwarmChart","GauntletChart","ProcessFlowChart","PhysicalFlowChart","BigNumber"],U=new Set(V);function G(e){return U.has(e)}function q(e){return"string"==typeof e?e:e.id??e.name}function J(e){return e.layoutConfig&&"object"==typeof e.layoutConfig?e.layoutConfig:{}}function _(e){return Array.isArray(e.data)?e.data:Array.isArray(e.nodes)?e.nodes:Array.isArray(e.points)?e.points:Array.isArray(e.areas)?e.areas:[]}function Q(e,t,i){return i??W(t.recipe)??W(t.recipeId)??F(e)}function X(e,t,i=[]){const n=e.accessor?t[e.accessor]:void 0;if("string"==typeof n&&n)return n;if(e.field)return e.field;const r=i.find(e=>e&&"object"==typeof e);if(!r)return;const o=Object.entries(r).filter(([e,t])=>!e.startsWith("_")&&null!=t);return"quantitative"===e.semanticType?o.find(([,e])=>"number"==typeof e)?.[0]:"identifier"===e.semanticType?["id","key","name"].find(e=>e in r):o.find(([,e])=>"string"==typeof e)?.[0]}function Z(e,t){return e.dataRoles.find(e=>e.role===t)}function K(e,t){return e.dataRoles.find(e=>t.includes(e.semanticType))}function Y(e,t,i,n,r,o={}){const a={...o};if(t)for(const[e,i]of Object.entries(t))a[e]=i;for(const e of i.dataRoles){const i=X(e,n,r),o=t&&i?t[i]:i;void 0!==o&&(a[e.role]=o)}return e.replace(/\{([^}]+)\}/g,(e,t)=>{const i=a[t];return null==i?`{${t}}`:i+""})}var ee=new Set(["tooltip","onObservation","xFormat","yFormat","valueFormat","svgAnnotationRules","tooltipContent","onHover","tickFormatTime","tickFormatValue","edgeSort","sortGroups","centerContent","frameProps","controls","oFormat","rFormat","oSort","pieceStyle","summaryStyle","nodeStyle","edgeStyle","customHoverBehavior","customClickBehavior","customDoubleClickBehavior","onBrush","onTopologyChange","backgroundGraphics","foregroundGraphics","legend","recipe","layout"]),te=new Set(["data","nodes","edges","points","areas","lines","flows"]);function ie(e){if(null==e)return e;if("function"==typeof e)return;if("object"!=typeof e)return e;if(e.$$typeof)return;if(Array.isArray(e))return e.map(ie).filter(e=>void 0!==e);if(e instanceof Date)return e;const t={};for(const[i,n]of Object.entries(e)){if("function"==typeof n)continue;if(n&&"object"==typeof n&&n.$$typeof)continue;const e=ie(n);void 0!==e&&(t[i]=e)}return t}function ne(e,t){return!!te.has(e)&&("areas"!==e||"string"!=typeof t)}var re="function"==typeof structuredClone?structuredClone:e=>JSON.parse(JSON.stringify(e));function oe(e,t,i){const n=F(e)??W(t.recipe)??W(t.recipeId);if(n)return function(e,t,i){const n=function(e,t,i){const n={};for(const[r,o]of Object.entries(e))if(null!=o&&!ee.has(r)&&"recipeId"!==r&&(t||!ne(r,o)))if("function"==typeof o||o?.$$typeof){if(i)throw Error(`Portable recipe prop "${r}" is not JSON-safe.`)}else if(k(o))n[r]=re(o);else if(i)throw Error(`Portable recipe prop "${r}" is not JSON-safe.`);return n}(t,!1!==i?.includeData,"portable"===e.portability),r=e.intents.map(q).filter(e=>!!e),o={name:e.name,intents:r,...e.audience?.primary?{audience:[e.audience.primary]}:{},frameFamily:e.frameFamily};if("portable"===e.portability){if(!k(n))throw Error(`Portable recipe "${e.id}" contains non-JSON-safe props or layoutConfig.`);return{component:"ChartRecipe",recipeId:e.id,portable:!0,props:n,manifest:o,version:"1",createdAt:(new Date).toISOString(),...i?.selections?{selections:i.selections}:{}}}return{component:"ChartRecipe",recipeId:e.id,portable:!1,reason:"Recipe contains or may depend on non-serializable local layout callbacks.",warnings:["This config is inspectable but cannot be rendered remotely by CLI or MCP."],props:n,manifest:o,version:"1",createdAt:(new Date).toISOString(),...i?.selections?{selections:i.selections}:{}}}(n,t,i);if(!G(e))throw Error(`Unknown component "${e}". Known components: ${V.join(", ")}`);const r=!1!==i?.includeData,o={};for(const[e,i]of Object.entries(t))if(null!=i&&!ee.has(e)&&(r||!ne(e,i))&&"function"!=typeof i&&!i?.$$typeof)try{o[e]=re(ie(i))}catch{}return{component:e,props:o,version:"1",createdAt:(new Date).toISOString(),...i?.selections?{selections:i.selections}:{}}}function ae(e){if(!e.component||!e.props)throw Error("Invalid chart config: missing component or props");if("ChartRecipe"===e.component||"LocalChartRecipe"===e.component){if(!e.recipeId)throw Error("Invalid chart recipe config: missing recipeId");const t=F(e.recipeId);if(!t)throw Error(`Unknown chart recipe "${e.recipeId}". Register it before deserializing this config.`);if("LocalChartRecipe"!==e.component&&!1!==e.portable&&"portable"!==t.portability)throw Error(`Chart recipe "${e.recipeId}" is registered as local, not portable.`);return{componentName:"ChartRecipe",props:{...re(e.props),recipeId:e.recipeId}}}if(!G(e.component))throw Error(`Unknown component "${e.component}". This config may require a newer version of semiotic.`);return{componentName:e.component,props:re(e.props)}}function se(e){const t=JSON.stringify(e);return"sc="+btoa(unescape(encodeURIComponent(t))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function le(e){const t=new URLSearchParams(e.includes("?")?e.split("?")[1]:e).get("sc");if(!t)throw Error("No chart config found in URL (missing 'sc' parameter)");const i=t.replace(/-/g,"+").replace(/_/g,"/"),n=decodeURIComponent(escape(atob(i)));return JSON.parse(n)}async function ce(e,t="json"){const i="jsx"===t?de(e):JSON.stringify(e,null,2);if("undefined"==typeof navigator||!navigator.clipboard)throw Error("Clipboard API not available. copyConfig requires a browser environment.");await navigator.clipboard.writeText(i)}function de(e){const{props:t}=e,i=["<"+("LocalChartRecipe"===e.component?"ChartRecipe":e.component)];e.recipeId&&i.push(` recipeId="${e.recipeId}"`);for(const[e,n]of Object.entries(t))if("string"==typeof n)i.push(` ${e}="${n}"`);else if("boolean"==typeof n&&!0===n)i.push(" "+e);else if("boolean"==typeof n&&!1===n)i.push(` ${e}={false}`);else if("number"==typeof n)i.push(` ${e}={${n}}`);else{const t=JSON.stringify(n);i.push(80>t.length?` ${e}={${t}}`:` ${e}={${JSON.stringify(n,null,2)}}`)}return i.push("/>"),i.join("\n")}function ue(e){const t={};for(const[i,n]of e){const e=[];for(const[,t]of n.clauses){const i={};for(const[e,n]of Object.entries(t.fields))i[e]="point"===n.type?{type:"point",values:Array.from(n.values)}:{type:"interval",range:n.range};e.push({clientId:t.clientId,type:t.type,fields:i})}t[i]={name:n.name,resolution:n.resolution,clauses:e}}return t}function me(e){const t=new Map;for(const[i,n]of Object.entries(e)){const e=new Map;for(const t of n.clauses){const i={};for(const[e,n]of Object.entries(t.fields))i[e]="point"===n.type?{type:"point",values:new Set(n.values)}:{type:"interval",range:n.range};e.set(t.clientId,{clientId:t.clientId,type:t.type,fields:i})}t.set(i,{name:n.name,resolution:n.resolution,clauses:e})}return t}function pe(e){return"nominal"===e||"ordinal"===e}function he(e){return"quantitative"===e||"temporal"===e}var fe={category10:"category10",category20:"category20",category20b:"category20",category20c:"category20",accent:"accent",dark2:"dark2",paired:"paired",pastel1:"pastel1",pastel2:"pastel2",set1:"set1",set2:"set2",set3:"set3",tableau10:"category10",tableau20:"category20"},ge={linear:"linear","monotone-x":"monotoneX","monotone-y":"monotoneY",monotone:"monotoneX",step:"step","step-after":"stepAfter","step-before":"stepBefore",basis:"basis",cardinal:"cardinal","catmull-rom":"catmullRom"},be={sum:"sum",mean:"mean",average:"mean",count:"count",min:"min",max:"max",median:"mean"};function ye(e){e=function(e){if(!function(e){return e.usermeta?.idid}(e)||!Array.isArray(e.layer))return e;const t=e.layer.filter(e=>!function(e){return"annotation-layer"===e.usermeta?.idid?.role}(e));if(1!==t.length)return e;const{layer:i,...n}=e,{usermeta:r,...o}=t[0];return{...n,...o}}(e);const t=[],{type:i,markProps:n}=function(e){if(!e)return{type:"",markProps:{}};if("string"==typeof e)return{type:e,markProps:{}};const{type:t,...i}=e;return{type:t,markProps:i}}(e.mark),r=e.encoding||{},o=r.x,a=r.y,s=r.color,l=r.size,c=r.theta,d=r.opacity;let u;e.data?.values?u=e.data.values:e.data?.url&&t.push("data.url is not supported — only inline data.values can be translated. Provide data manually."),e.transform&&e.transform.length>0&&t.push("Vega-Lite transforms are not supported. Pre-transform your data before passing to fromVegaLite()."),e.layer&&t.push('Layered specs ("layer") are not supported. Only single-mark specs can be translated.'),(e.hconcat||e.vconcat||e.concat)&&t.push('Concatenated views ("hconcat"/"vconcat"/"concat") are not supported. Translate each sub-spec individually.'),(e.facet||r.facet||r.row||r.column)&&t.push("Faceted views are not supported. Use Semiotic's LinkedCharts or render multiple charts manually."),e.repeat&&t.push('Repeated views ("repeat") are not supported. Translate each field combination individually.'),(e.params||e.selection)&&t.push("Selections/params are not supported. Use Semiotic's LinkedCharts and selection props for interactivity.");const m={};e.width&&(m.width=e.width),e.height&&(m.height=e.height);const p=function(e){if(e)return"string"==typeof e?e:e.text}(e.title);if(p&&(m.title=p),s?.field&&(m.colorBy=s.field,s.scale?.scheme)){const e=fe[s.scale.scheme];e&&(m.colorScheme=e)}void 0!==d?.value&&(m.pointOpacity=d.value);const f=o?.aggregate,g=a?.aggregate;if(u&&(f||g)){const e=g?a:o,t=g?o:a,i=be[e.aggregate];if(i&&t?.field&&e.field)u=function(e,t){const{groupBy:i,value:n,agg:r="sum"}=t,o=new Map;for(const t of e){const e=t[i]+"";o.has(e)||o.set(e,[]),o.get(e).push(Number(t[n]))}const a=[];for(const[e,t]of o){let n;switch(r){case"count":n=t.length;break;case"mean":n=t.reduce((e,t)=>e+t,0)/t.length;break;case"min":n=h(t)[0];break;case"max":n=h(t)[1];break;default:n=t.reduce((e,t)=>e+t,0)}a.push({[i]:e,value:n})}return a}(u,{groupBy:t.field,value:e.field,agg:i});else if(("count"===i||"count"===e.aggregate)&&t?.field&&u){const e=new Map;for(const i of u){const n=i[t.field]+"";e.set(n,(e.get(n)||0)+1)}u=Array.from(e,([e,i])=>({[t.field]:e,value:i}))}}if(o?.bin||a?.bin){const e="Histogram";u&&(m.data=u),o?.bin?(m.valueAccessor=o.field,a?.field&&(m.categoryAccessor=a.field),o.axis?.title&&(m.valueLabel=o.axis.title)):a?.bin&&(m.valueAccessor=a.field,o?.field&&(m.categoryAccessor=o.field),a.axis?.title&&(m.valueLabel=a.axis.title));const i=o?.bin||a?.bin,n="object"==typeof i?i.maxbins:void 0;return n&&(m.bins=n),xe(e,m,t)}let b;switch(i){case"bar":b=function(e,t,i,n,r,o,a){let s;return i?.field&&!1!==e?.stack&&!1!==t?.stack&&null!==e?.stack&&null!==t?.stack?(s="StackedBarChart",n.stackBy=i.field):s="BarChart",pe(e?.type)&&he(t?.type)?(n.categoryAccessor=e.field,n.valueAccessor=a?"value":t.field,e?.axis?.title&&(n.categoryLabel=e.axis.title),t?.axis?.title&&(n.valueLabel=t.axis.title)):he(e?.type)&&pe(t?.type)?(n.categoryAccessor=t.field,n.valueAccessor=o?"value":e.field,n.orientation="horizontal",t?.axis?.title&&(n.categoryLabel=t.axis.title),e?.axis?.title&&(n.valueLabel=e.axis.title)):(e?.field&&(n.categoryAccessor=e.field),t?.field&&(n.valueAccessor=a?"value":t.field),e?.axis?.title&&(n.categoryLabel=e.axis.title),t?.axis?.title&&(n.valueLabel=t.axis.title)),r&&(n.data=r),s}(o,a,s,m,u,f,g);break;case"line":if(b="LineChart",ve(o,a,m,f,g),s?.field&&(m.lineBy=s.field),n.interpolate){const e=ge[n.interpolate];e&&(m.curve=e)}!0===n.point&&(m.showPoints=!0),u&&(m.data=u);break;case"area":if(s?.field?(b="StackedAreaChart",m.areaBy=s.field):b="AreaChart",ve(o,a,m,f,g),n.interpolate){const e=ge[n.interpolate];e&&(m.curve=e)}void 0!==n.opacity&&(m.areaOpacity=n.opacity),u&&(m.data=u);break;case"point":case"circle":case"square":l?.field?(b="BubbleChart",m.sizeBy=l.field,l.scale?.range&&(m.sizeRange=l.scale.range)):b="Scatterplot",ve(o,a,m,f,g),u&&(m.data=u);break;case"rect":b="Heatmap",o?.field&&(m.xAccessor=o.field),a?.field&&(m.yAccessor=a.field),s?.field&&(m.valueAccessor=s.field,delete m.colorBy),o?.axis?.title&&(m.xLabel=o.axis.title),a?.axis?.title&&(m.yLabel=a.axis.title),u&&(m.data=u);break;case"arc":n.innerRadius&&n.innerRadius>0?(b="DonutChart",m.innerRadius=n.innerRadius):b="PieChart",c?.field?m.valueAccessor=c.field:a?.field&&(m.valueAccessor=g?"value":a.field),s?.field&&(m.categoryAccessor=s.field),o?.field&&!c?.field&&(m.categoryAccessor=o.field),u&&(m.data=u);break;case"tick":b="DotPlot",pe(o?.type)?(m.categoryAccessor=o.field,a?.field&&(m.valueAccessor=g?"value":a.field),o?.axis?.title&&(m.categoryLabel=o.axis.title),a?.axis?.title&&(m.valueLabel=a.axis.title)):pe(a?.type)?(m.categoryAccessor=a.field,o?.field&&(m.valueAccessor=f?"value":o.field),m.orientation="horizontal",a?.axis?.title&&(m.categoryLabel=a.axis.title),o?.axis?.title&&(m.valueLabel=o.axis.title)):(o?.field&&(m.categoryAccessor=o.field),a?.field&&(m.valueAccessor=g?"value":a.field)),u&&(m.data=u);break;default:t.push(`Unsupported mark type "${i}". Defaulting to Scatterplot.`),b="Scatterplot",ve(o,a,m,f,g),u&&(m.data=u)}return xe(b,m,t)}function ve(e,t,i,n,r){e?.field&&(i.xAccessor=n?"value":e.field),t?.field&&(i.yAccessor=r?"value":t.field),e?.axis?.title&&(i.xLabel=e.axis.title),t?.axis?.title&&(i.yLabel=t.axis.title)}function xe(e,t,i){const n={component:e,props:t,version:"1",createdAt:(new Date).toISOString()};if(i.length>0){n.warnings=i;for(const e of i)console.warn("[semiotic/fromVegaLite] "+e)}return n}function we(e,t,i={}){const n=_(t),r=J(t),o=i.locale??"en",a="function"==typeof e.description?e.description({data:n,config:r,locale:o}):void 0,s=a?.levels??function(e,t,i,n){const r=K(e,["nominal","ordinal"]),o=K(e,["quantitative"]),a=r?X(r,i,t):void 0,s=o?X(o,i,t):void 0,l=r?.role??a??"category",c=o?.role??s??"value",d=e.encodings??[],u=d.length?d.slice(0,3).map(e=>e.meaning.replace(/\.$/,"")).join("; "):`${l} and ${c} are mapped through the recipe's declared visual semantics`,{number:m,percent:p}=function(e){try{return{number:new Intl.NumberFormat(e,{maximumFractionDigits:2}),percent:new Intl.NumberFormat(e,{style:"percent",maximumFractionDigits:1})}}catch{return{number:new Intl.NumberFormat("en",{maximumFractionDigits:2}),percent:new Intl.NumberFormat("en",{style:"percent",maximumFractionDigits:1})}}}(n),h=new Map;if(a&&s)for(const e of t){const t=(e[a]??"Uncategorized")+"",i=Number(e[s]);Number.isFinite(i)&&h.set(t,(h.get(t)??0)+i)}const f=[...h].sort((e,t)=>t[1]-e[1]),g=f.reduce((e,[,t])=>e+t,0),b=f[0],y=f[1],v=g>0?((b?.[1]??0)+(y?.[1]??0))/g:0,x=e.intents.map(e=>({id:q(e),strength:"string"==typeof e?void 0:e.strength})).sort((e,t)=>"primary"===e.strength?-1:"primary"===t.strength?1:0)[0]?.id,w=e.audience?.primary??e.audienceFit?.find(e=>"strong"===e.fit)?.audience;return{l1:`A ${e.name.toLowerCase()} encodes ${l} and ${c}. ${k=u,k?k.charAt(0).toUpperCase()+k.slice(1):k}.`,l2:f.length>0?`${f.length} categories total ${m.format(g)}. ${b[0]} accounts for ${m.format(b[1])}${g>0?` (${p.format(b[1]/g)})`:""}${y?`, followed by ${y[0]} at ${m.format(y[1])}`:""}.`:`${t.length} data ${1===t.length?"item is":"items are"} represented.`,l3:2>f.length?b?b[0]+" is the only represented category.":"No quantitative pattern can be derived from the available data.":.5>v?`The total is distributed across ${f.length} categories without the first two forming a majority.`:`Most of the total is concentrated in ${b[0]} and ${y[0]}, which together account for ${p.format(v)}.`,l4:`The chart is intended for ${x??"explanation"}${w?` with a ${w} audience`:""}: ${e.designContract.whyCustom}`};var k}(e,n,r,o),l=i.levels??["l1","l2","l3","l4"],c={};for(const e of l)s[e]&&(c[e]=s[e]);const d=["l1","l2","l3","l4"].map(e=>c[e]).filter(e=>!!e).join(" "),u=i.includeCaveats?[...e.reception?.risks??[],...e.caveats??[],...(e.designContract.misuse??[]).map(e=>"Misuse: "+e)]:void 0;return{text:d,levels:c,...u?.length?{caveats:u}:{}}}var ke=new Set(["LineChart","AreaChart","StackedAreaChart","DifferenceChart","Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","MultiAxisLineChart","MinimapChart"]),$e=new Set(["BarChart","StackedBarChart","GroupedBarChart","DotPlot"]),Ce=new Set(["PieChart","DonutChart","FunnelChart"]),Se=new Set(["Histogram","BoxPlot","ViolinPlot","RidgelinePlot","SwarmPlot"]);function Ae(e,t){return $e.has(e)||Ce.has(e)||"SwimlaneChart"===e||"GaugeChart"===e?{measure:t.valueAccessor,measureFallback:"value",dimension:t.categoryAccessor??t.stepAccessor,dimensionFallback:"category"}:{measure:t.yAccessor??t.valueAccessor,measureFallback:"y",dimension:t.xAccessor,dimensionFallback:"x"}}function je(e){for(const t of["lineBy","areaBy","stackBy","groupBy","colorBy"]){const i=e[t];if("string"==typeof i&&i)return i}}function Ne(e,t){return null==e?"—":e instanceof Date?e.toISOString().slice(0,10):"number"==typeof e?t(e):e+""}var Ie={LineChart:"line chart",AreaChart:"area chart",StackedAreaChart:"stacked area chart",DifferenceChart:"difference chart",Scatterplot:"scatter plot",BubbleChart:"bubble chart",ConnectedScatterplot:"connected scatter plot",QuadrantChart:"quadrant chart",MultiAxisLineChart:"dual-axis line chart",CandlestickChart:"candlestick chart",Heatmap:"heatmap",MinimapChart:"line chart",BarChart:"bar chart",StackedBarChart:"stacked bar chart",GroupedBarChart:"grouped bar chart",DotPlot:"dot plot",Histogram:"histogram",BoxPlot:"box plot",ViolinPlot:"violin plot",RidgelinePlot:"ridgeline plot",SwarmPlot:"swarm plot",PieChart:"pie chart",DonutChart:"donut chart",FunnelChart:"funnel chart",GaugeChart:"gauge",LikertChart:"Likert chart",SwimlaneChart:"swimlane chart",ForceDirectedGraph:"network graph",SankeyDiagram:"Sankey diagram",ProcessSankey:"temporal Sankey diagram",ChordDiagram:"chord diagram",TreeDiagram:"tree diagram",Treemap:"treemap",CirclePack:"circle-packing chart",OrbitDiagram:"orbit diagram",ChoroplethMap:"choropleth map",ProportionalSymbolMap:"proportional-symbol map",FlowMap:"flow map",DistanceCartogram:"distance cartogram",BigNumber:"single value",StreamPhysicsFrame:"physics stream frame",EventDropChart:"event-drop physics chart",GaltonBoardChart:"Galton board chart",PhysicsPileChart:"physics pile chart",CollisionSwarmChart:"collision swarm chart",PhysicalFlowChart:"physical flow chart",ProcessFlowChart:"process flow physics chart",PhysicsCustomChart:"custom physics chart"},Le=new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]),Pe=new Set(["StreamPhysicsFrame","EventDropChart","GaltonBoardChart","PhysicsPileChart","CollisionSwarmChart","PhysicalFlowChart","ProcessFlowChart","GauntletChart","PhysicsCustomChart"]);function Re(e){return Ie[e]||e.replace(/([a-z])([A-Z])/g,"$1 $2").toLowerCase()+" chart"}function Me(e){const t="number"==typeof e?e:"string"==typeof e?Number(e):NaN;return Number.isFinite(t)?t:void 0}var Be=new Set(["Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","ScatterplotMatrix"]),Fe={"outlier-detection":"alerting","change-detection":"alerting",trend:"tracking","composition-over-time":"apportioning","compare-series":"comparing","compare-categories":"comparing",rank:"ranking","part-to-whole":"apportioning",distribution:"characterizing",correlation:"relating",flow:"tracing",hierarchy:"nesting",geo:"locating"},ze={"time-series":"tracking",categorical:"comparing",distribution:"characterizing",relationship:"relating",flow:"tracing",network:"tracing",hierarchy:"nesting",geo:"locating",realtime:"tracking",value:"presenting",custom:"presenting"},Te=["trend","compare-series","compare-categories","rank","part-to-whole","distribution","correlation","flow","hierarchy","geo","composition-over-time","change-detection","outlier-detection"],De={alerting:"alerting",tracking:"trend",comparing:"comparison",ranking:"ranking",apportioning:"composition",characterizing:"distribution",relating:"correlation",tracing:"flow",nesting:"hierarchy",locating:"locator",presenting:"single-value"};function Ee(e){return Fe[e]}function Oe(e,t){const i=function(e){if(e){if("fits"in e||"buildProps"in e){const t=e,i={};for(const[e,n]of Object.entries(t.intentScores))"number"==typeof n&&Number.isFinite(n)&&(i[e]=n);return{family:t.family,intentScores:Object.keys(i).length?i:void 0}}return e}}(t);if(i?.act)return i.act;if(i?.intentScores){const e=function(e){let t,i=0;for(const[n,r]of Object.entries(e))if("number"==typeof r&&r>0)if(r>i)t=n,i=r;else if(r===i&&void 0!==t){const e=Te.indexOf(n),i=Te.indexOf(t);-1===e||-1!==i&&e>=i||(t=n)}return t}(i.intentScores);if(e&&Fe[e]&&(i.intentScores[e]??0)>=3)return Fe[e]}return i?.family?ze[i.family]:function(e){return Ce.has(e)||"StackedAreaChart"===e?"apportioning":Be.has(e)?"relating":$e.has(e)?"comparing":Se.has(e)?"characterizing":ke.has(e)?"tracking":Le.has(e)?"tracing":"BigNumber"===e?"presenting":void 0}(e)}var He=new Set(["y-threshold","x-threshold","band","x-band","callout","label"]),We=new Set(["system","agent","watcher"]),Ve=new Set(["ai","agent","system","computed","dbt","great-expectations"]),Ue=new Set(["rule","statistical-test","llm-inference","computed"]);function Ge(e){const t=e.annotations;return!!Array.isArray(t)&&t.some(e=>{if(!e||"object"!=typeof e)return!1;const t=e;if("string"!=typeof t.type||!He.has(t.type))return!1;const i=t.provenance;return!(!i||"object"!=typeof i)&&(We.has(i.authorKind)||Ve.has(i.source)||Ue.has(i.basis))})}function qe(e="en"){let t,i;try{t=new Intl.NumberFormat(e,{notation:"compact",maximumFractionDigits:1}),i=new Intl.NumberFormat(e,{maximumFractionDigits:2})}catch{t=new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}),i=new Intl.NumberFormat("en",{maximumFractionDigits:2})}return e=>Number.isFinite(e)?1e4>Math.abs(e)?i.format(e):t.format(e):e+""}var Je={"y-threshold":"a threshold line","x-threshold":"a threshold line",band:"a highlighted band","x-band":"a highlighted band",label:"a label",callout:"a callout","callout-circle":"a callout","callout-rect":"a callout",text:"a text note",bracket:"a bracket",enclose:"an enclosure","rect-enclose":"an enclosure",highlight:"a highlight",widget:"a widget",trend:"a trend line",envelope:"an envelope","anomaly-band":"an anomaly band",forecast:"a forecast","category-highlight":"a category highlight"};function _e(e){const t=Je["string"==typeof e.type?e.type:"annotation"]||"an annotation",i=function(e){const t=e.provenance&&"object"==typeof e.provenance?e.provenance:null,i=t?.authorKind??t?.source??t?.basis;return"watcher"===i?"a watcher-flagged ":"agent"===i||"ai"===i||"llm-inference"===i?"an AI-suggested ":""}(e),n=i?i+t.replace(/^an? /,""):t,r="string"==typeof e.label?e.label:"string"==typeof e.title?e.title:void 0;return r?`${n} labeled "${r}"`:n}function Qe(e){const t=Array.isArray(e.annotations)?e.annotations:null;if(!t||0===t.length)return;const i=r(t.filter(e=>!!e&&"object"==typeof e));if(0===i.length)return;const n=i.map(_e),o=n.slice(0,5),a=n.length-o.length,s=function(e){return e.length>1?2===e.length?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(", ")}, and ${e[e.length-1]}`:e[0]??""}(o)+(a>0?`, and ${a} more`:""),l=i.length;return`The author has marked ${1===l?"one feature":l+" features"} on this chart: ${s}.`}function Xe(e,t,r={}){const o=void 0!==r.levels,a=new Set(r.levels??["l1","l2","l3"]);o||!r.capability&&!Ge(t)||a.add("l4");const s=Q(e,t,r.recipe);if(s){const e=["l1","l2","l3","l4"].filter(e=>a.has(e));o||e.includes("l4")||e.push("l4");const i=we(s,t,{levels:e,locale:r.locale,audience:r.audience,includeCaveats:r.includeCaveats}),n=Qe(t);return{...i,text:n?`${n} ${i.text}`.trim():i.text,...n?{annotations:n}:{}}}const l=qe(r.locale??"en"),c=Re(e),d=Array.isArray(t.data)?t.data:null,u=je(t),m=Pe.has(e)?function(e,t){const i=e.physics&&"object"==typeof e.physics?e.physics:null,n=e.settledProjection&&"object"==typeof e.settledProjection?e.settledProjection:null,r=[e.settledProjectionRows,e.projectionRows,n?.rows,i?.settledProjectionRows,i?.projectionRows,i?.settledProjection&&"object"==typeof i.settledProjection?i.settledProjection.rows:void 0].find(e=>Array.isArray(e));return Array.isArray(r)?r.map((e,i)=>{if(!e||"object"!=typeof e)return null;const n=e,r=Me(n.count??n.value??n.total??n.bodies??n.events);if(null==r)return null;const o=n.label??n.id??n.name??"container "+(i+1),a=Me(n.secondary??n.secondaryCount),s=Me(n.observed??n.observedCount);return{label:Ne(o,t),count:r,...null!=a?{secondary:a}:{},..."string"==typeof n.secondaryLabel&&n.secondaryLabel?{secondaryLabel:n.secondaryLabel}:{},...null!=s?{observed:s}:{}}}).filter(e=>null!=e):null}(t,l):null,{measure:p,measureFallback:h,dimension:f,dimensionFallback:g}=Ae(e,t),b="string"==typeof p&&p?p:h,y="string"==typeof f&&f?f:g,v={};if(Pe.has(e)&&function(e,t,i,n,r,o){const a=function(e){return"EventDropChart"===e?"time window":"GaltonBoardChart"===e?"bin":"CollisionSwarmChart"===e?"group lane":"PhysicalFlowChart"===e?"flow node":"container"}(e),s=function(e){return"EventDropChart"===e?"event":"GaltonBoardChart"===e?"sample":"CollisionSwarmChart"===e?"point":"PhysicalFlowChart"===e?"packet":"body"}(e);if(r.has("l1")&&(n.l1=function(e,t){return"EventDropChart"===e?"An event-drop physics chart that collapses moving events into a settled projection by event-time window.":"GaltonBoardChart"===e?"A Galton board chart that collapses falling samples into a settled histogram projection.":"PhysicsPileChart"===e?"A physics pile chart that collapses moving bodies into a settled bar-style projection by container.":"CollisionSwarmChart"===e?"A collision swarm chart that separates overlapping points while preserving their quantitative axis position.":"PhysicalFlowChart"===e?"A physical flow chart that keeps authored routes visible while packet bodies show throughput and proximity events.":`A ${t} whose accessible reading is the settled projection rather than individual trajectories.`}(e,t)),!r.has("l2")&&!r.has("l3"))return;if(!i||0===i.length)return void(r.has("l2")&&(n.l2="No settled projection is loaded yet."));const l=i.reduce((e,t)=>e+t.count,0),c=i.filter(e=>e.count>0).sort((e,t)=>t.count-e.count),d=c[0]??i.slice().sort((e,t)=>t.count-e.count)[0];if(!d)return;const u=i.reduce((e,t)=>e+(t.secondary??0),0),m=i.find(e=>e.secondaryLabel)?.secondaryLabel??"secondary";if(r.has("l2"))if(0===c.length)n.l2=`The settled projection contains ${o(l)} ${Ke(l,s)} across ${i.length} ${Ke(i.length,a)}; no ${Ke(2,a)} are non-empty yet.`;else{const e=u>0?` ${o(u)} ${Ke(u,s)} ${1===u?"is":"are"} marked ${m}.`:"";n.l2=`The settled projection contains ${o(l)} ${Ke(l,s)} across ${i.length} ${Ke(i.length,a)}; ${c.length} ${Ke(c.length,a)} ${1===c.length?"is":"are"} non-empty. The largest ${a} is ${d.label} with ${o(d.count)} ${Ke(d.count,s)}.${e}`}if(r.has("l3")&&l>0&&c.length>0){const e=c.find(e=>e!==d),t=function(e,t){if(0>=t)return"0%";const i=e/t*100;return(10>i?Math.round(10*i)/10:Math.round(i))+"%"}(d.count,l);n.l3=e?`The settled projection is most concentrated in ${d.label}, which holds ${o(d.count)} ${Ke(d.count,s)} (${t}); ${e.label} follows with ${o(e.count)} ${Ke(e.count,s)}.`:`The settled projection is concentrated in ${d.label}, which holds all ${o(d.count)} ${Ke(d.count,s)}.`}}(e,c,m,v,a,l),a.has("l1")&&!Pe.has(e))if(ke.has(e)||$e.has(e))v.l1=`A ${c} of ${b} by ${y}`+(u?`, split by ${u}.`:".");else if(Ce.has(e))v.l1=`A ${c} showing ${b} across ${y} categories.`;else if(Se.has(e))v.l1=`A ${c} of the distribution of ${b}`+(u?` by ${u}.`:".");else if(Le.has(e)){const e=Array.isArray(t.nodes)?t.nodes.length:void 0,i=Array.isArray(t.edges)?t.edges.length:void 0,n=[null!=e?`${e} ${Ke(e,"node")}`:null,null!=i?`${i} ${Ke(i,"edge")}`:null].filter(Boolean);v.l1=`A ${c}${n.length?" with "+n.join(" and "):""}.`}else if("BigNumber"===e){const e="string"==typeof t.label?t.label:b;v.l1=`A single value${e?" for "+e:""}.`}else v.l1=`A ${c}.`;const x=ke.has(e)||$e.has(e)||Ce.has(e)||Se.has(e);let w=null;if((a.has("l2")||a.has("l3")||a.has("l4"))&&x&&d&&d.length>0&&(w=function(e,t,i,n){let r=0,o=0,a=1/0,s=-1/0,l=null,c=null,d=0,u=0,m=null,p=null,h=NaN,f=NaN;for(const i of e){const e=t(i);Number.isFinite(e)&&(0===r&&(h=e,m=i),f=e,p=i,a>e&&(a=e,l=i,d=r),e>s&&(s=e,c=i,u=r),r++,o+=e)}return 0===r?null:{count:r,min:a,max:s,mean:o/r,minLabel:Ne(null!=l?i(l):null,n),maxLabel:Ne(null!=c?i(c):null,n),first:h,last:f,firstLabel:Ne(null!=m?i(m):null,n),lastLabel:Ne(null!=p?i(p):null,n),minIndex:d,maxIndex:u}}(d,i(p,h),n(f,g),l)),a.has("l2")&&x&&(d&&0!==d.length?w&&(v.l2=Ce.has(e)?`${w.count} segments totaling ${l(function(e){return e.mean*e.count}(w))}. Largest is ${w.maxLabel} at ${l(w.max)}; smallest is ${w.minLabel} at ${l(w.min)}.`:`${b} ranges from ${l(w.min)} (${w.minLabel}) to ${l(w.max)} (${w.maxLabel}), with a mean of ${l(w.mean)} across ${w.count} points.`):v.l2="No data is loaded yet."),a.has("l3")&&w&&!u&&ke.has(e)?v.l3=function(e,t,i){const{first:n,last:r,min:o,max:a,maxLabel:s,minLabel:l,firstLabel:c,lastLabel:d,minIndex:u,maxIndex:m,count:p}=e,h=a-o,f=r-n;if(0===h)return`${Ze(t)} is constant at ${i(n)} across the series.`;if(.04>h/(Math.abs(e.mean)||1))return`${Ze(t)} ends roughly where it started (${i(n)} at ${c} to ${i(r)} at ${d}), ranging between ${i(o)} and ${i(a)}.`;const g=m>0&&p-1>m,b=u>0&&p-1>u,y=(a-Math.max(n,r))/h,v=(Math.min(n,r)-o)/h;return g&&y>.15?`Overall ${t} climbs to a peak of ${i(a)} (${s}), then falls to ${i(r)} (${d}).`:b&&v>.15?`Overall ${t} drops to a low of ${i(o)} (${l}), then recovers to ${i(r)} (${d}).`:.05>Math.abs(f)/h?`${Ze(t)} ends roughly where it started (${i(n)} at ${c} to ${i(r)} at ${d}), ranging between ${i(o)} and ${i(a)}.`:f>0?m===p-1?`Overall ${t} rises from ${i(n)} (${c}) to a peak of ${i(r)} (${d}).`:`Overall ${t} rises from ${i(n)} (${c}) to ${i(r)} (${d}), after peaking at ${i(a)} (${s}).`:u===p-1?`Overall ${t} falls from ${i(n)} (${c}) to a low of ${i(r)} (${d}).`:`Overall ${t} falls from ${i(n)} (${c}) to ${i(r)} (${d}), after dipping to ${i(o)} (${l}).`}(w,b,l):a.has("l3")&&w&&!u&&$e.has(e)&&(v.l3=`The highest ${y} is ${w.maxLabel} and the lowest is ${w.minLabel}.`),a.has("l4")){const i=Ge(t)?"alerting":Oe(e,r.capability);i&&(v.l4=function(e,t,i,n,r,o,a,s){const l=De[e],c=/^[aeiou]/i.test(l)?"an":"a";let d,u;switch(e){case"locating":d="This is a map",u="read values by location";break;case"presenting":d="This is a single-value display",u=`read ${"string"==typeof i.label&&i.label?i.label:r} as the headline number`;break;case"tracing":d=`This is ${c} ${l} chart`,u="follow the movement between states";break;case"nesting":d=`This is ${c} ${l} chart`,u="read it for nested structure and how children sum into their parents";break;case"relating":d=`This is ${c} ${l} chart`,u=`read it for whether ${o} and ${r} move together`;break;default:d=`This is ${c} ${l} chart`,u=function(e,t,i,n,r,o){if(!t)switch(e){case"alerting":return"watch for points that break from the rest";case"tracking":return"read it for the overall direction of "+i;case"comparing":return`compare ${i} across ${n}`;case"ranking":return"read it top to bottom by "+i;case"apportioning":return`read each ${n}'s share of the whole`;case"characterizing":return"read it for the spread and shape of "+i;default:return"read the highlighted features"}switch(e){case"alerting":return function(e,t,i){if($e.has(i)||Ce.has(i))return`${e.maxLabel} stands out at ${t(e.max)} — check it first`;const{first:n,last:r,min:o,max:a,minLabel:s,maxLabel:l,lastLabel:c,minIndex:d,maxIndex:u,count:m}=e,p=a-o;if(p>0){const e=u>0&&m-1>u,i=d>0&&m-1>d,h=(a-Math.max(n,r))/p,f=(Math.min(n,r)-o)/p;if(e&&h>.15)return`the peak of ${t(a)} at ${l} is the point to investigate`;if(i&&f>.15)return`the dip to ${t(o)} at ${s} is the point to investigate`;if(r>=a)return`the climb to ${t(r)} at ${c} warrants a closer look`;if(o>=r)return`the drop to ${t(r)} at ${c} warrants a closer look`}return`the extremes — ${l} (${t(a)}) and ${s} (${t(o)}) — are the points to check`}(t,r,o);case"tracking":return`read it for the trajectory of ${i}, which ${function(e){const t=e.max-e.min,i=e.last-e.first;return 0===t||.05>Math.abs(i)/t?"holds roughly steady":i>0?"rises":"falls"}(t)} from ${r(t.first)} (${t.firstLabel}) to ${r(t.last)} (${t.lastLabel})`;case"comparing":return`compare ${i} across ${n}; ${t.maxLabel} leads at ${r(t.max)}`;case"ranking":return`read it top to bottom by ${i}; ${t.maxLabel} ranks highest at ${r(t.max)}`;case"apportioning":{const e=t.mean*t.count,i=e>0?Math.round(t.max/e*100):null;return`read each ${n}'s share of the ${r(e)} total; ${t.maxLabel} is the largest at ${r(t.max)}${null!=i?` (${i}%)`:""}`}case"characterizing":return`read it for the spread of ${i}, from ${r(t.min)} to ${r(t.max)}`;default:return"read the highlighted features"}}(e,n,r,o,a,t)}return`${d}; ${u}.${function(e,t){if(!t)return"";const i=t.familiarity?.[e];return"number"!=typeof i||i>2?"":` This ${Re(e)} may be unfamiliar${t.name?` to ${t.name.toLowerCase()} readers`:""} — lean on this description.`}(t,s)}`}(i,e,t,u?null:w,b,y,l,r.audience))}const k=["l1","l2","l3","l4"].filter(e=>a.has(e)&&v[e]).map(e=>v[e]).join(" "),$=Qe(t);return{text:$?`${$} ${k}`.trim():k,levels:v,...$?{annotations:$}:{}}}function Ze(e){return e.length?e[0].toUpperCase()+e.slice(1):e}function Ke(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:t+"s"}function Ye(e){return((e??"unknown")+"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"unknown"}function et(e,t,i={}){const n=_(t),r=J(t),o=Math.max(1,i.maxLeaves??200);if("function"==typeof e.navigation)return e.navigation({data:n,config:r,locale:i.locale??"en"});const a=(s=e.navigation)&&"object"==typeof s?e.navigation:void 0;var s;const l=(a?.groupByRole?Z(e,a.groupByRole):void 0)??(a?.groupBy?.[0]?Z(e,a.groupBy[0])??e.dataRoles.find(e=>e.field===a.groupBy?.[0]):void 0)??K(e,["nominal","ordinal"]),c=l?X(l,r,n):void 0,d=(a?.idRole?Z(e,a.idRole):void 0)??K(e,["identifier"]),u=d?X(d,r,n):void 0,m={id:"root",role:"chart",label:a?.summaryTemplate?Y(a.summaryTemplate,void 0,e,r,n,{count:n.length}):`${e.name}: ${n.length} ${1===n.length?"item":"items"} represented.`,level:1,children:[]};let p=0;const h=(t,i,o)=>{const s=u?t[u]:void 0,l=a?.itemLabelTemplate?Y(a.itemLabelTemplate,t,e,r,n,{count:n.length}):function(e,t,i,n){const r=K(t,["nominal","ordinal"]),o=t.dataRoles.filter(e=>"quantitative"===e.semanticType),a=r?X(r,i,n):void 0,s=[];a&&null!=e[a]&&s.push(e[a]+"");for(const t of o){const r=X(t,i,n);r&&null!=e[r]&&s.push(`${t.role}: ${e[r]+""}`)}return s.length>0?s.join(", "):"Data item"}(t,e,r,n);return{id:"datum-"+Ye(s??i),role:"datum",label:l,level:o,datum:t}};if(c){const e=new Map;for(const t of n){const i=(t[c]??"Uncategorized")+"",n=e.get(i);n?n.push(t):e.set(i,[t])}m.children=[...e].map(([e,t],i)=>{const n=t.slice(0,Math.max(0,o-p));p+=n.length;const r=n.map((e,t)=>h(e,1e5*i+t,3));return t.length>n.length&&r.push({id:"more-"+Ye(e),role:"datum",label:`…and ${t.length-n.length} more items`,level:3}),{id:"group-"+Ye(e),role:"series",label:`${e}: ${t.length} ${1===t.length?"item":"items"}.`,level:2,children:r}})}else{const e=n.slice(0,o);m.children=e.map((e,t)=>h(e,t,2)),n.length>e.length&&m.children.push({id:"more",role:"datum",label:`…and ${n.length-e.length} more items`,level:2})}return m}function tt(e,t,o={}){const a=o.locale??"en",s=Math.max(1,o.maxLeaves??200),l=qe(a),c=Q(e,t,o.recipe);if(c)return et(c,t,{maxLeaves:s,locale:a});const d={id:"root",role:"chart",label:Xe(e,t,{locale:a}).text||"Chart.",level:1,children:[]},u=function(e,t){const i=Array.isArray(e.annotations)?e.annotations:null;if(!i)return null;const n=r(i.filter(e=>!!e&&"object"==typeof e));if(0===n.length)return null;let o=0;const a=n.slice(0,t).map(e=>{const t=e.lifecycle?.status,i=t&&"accepted"!==t?` (${t})`:"";return{id:"annotation-"+o++,role:"annotation",level:3,label:`${n=_e(e),n?n.charAt(0).toUpperCase()+n.slice(1):n}${i}.`,datum:e};var n});n.length>t&&a.push({id:"annotation-"+o++,role:"annotation",level:3,label:`…and ${n.length-t} more annotations.`});const s=n.length;return{id:"annotations",role:"annotation",level:2,label:`Annotations: ${1===s?"one marked feature":s+" marked features"}.`,children:a}}(t,s),m=Array.isArray(t.data)?t.data:null,p=ke.has(e)||$e.has(e)||Ce.has(e)||Se.has(e);if(!m||0===m.length||!p)return u&&(d.children=[u]),d;const{measure:h,measureFallback:f,dimension:g,dimensionFallback:b}=Ae(e,t),y=i(h,f),v=n(g,b),x="string"==typeof h&&h?h:f,w="string"==typeof g&&g?g:b,k=je(t);let $=0;const C=e=>`${e}-${$++}`,S=(e,t)=>{const i=e.slice(0,s).map(e=>((e,t)=>{const i=y(e),n=Ne(v(e),l);return{id:C("datum"),role:"datum",level:t,label:`${n}: ${Number.isFinite(i)?l(i):"—"}`,value:Number.isFinite(i)?i:void 0,datum:e}})(e,t));return e.length>s&&i.push({id:C("more"),role:"datum",level:t,label:`…and ${e.length-s} more points`}),i},A=[];if(ke.has(e)||$e.has(e)){let t=1/0,i=-1/0,n=1/0,r=-1/0;const o=[];let a=!0;for(const e of m){const s=y(e);Number.isFinite(s)&&(t>s&&(t=s),s>i&&(i=s));const l=v(e);o.push(l),"number"==typeof l&&Number.isFinite(l)?(n>l&&(n=l),l>r&&(r=l)):a=!1}const s=new Set,c=[];for(const e of o){const t=e+"";s.has(t)||(s.add(t),c.push(e))}const d=a?`${l(n)} to ${l(r)}`:`${Ne(c[0],l)} to ${Ne(c[c.length-1],l)} (${$e.has(e)?c.length+" categories":m.length+" points"})`;A.push({id:C("axis"),role:"axis",level:2,label:`${$e.has(e)?"Category axis":"X axis"}: ${w}, ${d}.`}),t>i||A.push({id:C("axis"),role:"axis",level:2,label:`Value axis: ${x}, ${l(t)} to ${l(i)}.`})}if(k){const i=n(k,k),r=new Map;for(const e of m){const t=(i(e)??"—")+"",n=r.get(t);n?n.push(e):r.set(t,[e])}const o=[];for(const[i,n]of r){const r=Xe(e,{...t,data:n},{levels:["l2","l3"],locale:a}).text;o.push({id:C("series"),role:"series",level:2,label:`Series ${i}: ${r}`,children:S(n,3)})}d.children=[...A,...o]}else d.children=[...A,...S(m,2)];return u&&d.children.push(u),d}function it(e,t){const i=[],n=e=>{if(i.push(e),e.children&&e.children.length>0&&t.has(e.id))for(const t of e.children)n(t)};return n(e),i}function nt(e){let t=1;if(e.children)for(const i of e.children)t+=nt(i);return t}var rt=null,ot=new Set,at=new Set,st=1e3;function lt(e,t,i){const n=e??t;if(!Number.isFinite(n)||0>=n)throw new RangeError(`${i} must be a positive number, got ${n+""}`);return Math.floor(n)}function ct(e,t){void 0!==console&&console.warn(`[conversationArc] ${e} failed:`,t)}function dt(e,t){try{const i=t();i&&"function"==typeof i.then&&Promise.resolve(i).catch(t=>ct(e,t))}catch(t){ct(e,t)}}function ut(e){if(e)return e;try{return globalThis.localStorage??null}catch{return null}}function mt(e,t){if(!e)return[];try{return function(e){if(!e)return[];try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch(e){return ct("localStorage load",e),[]}}(e.getItem(t))}catch(e){return ct("localStorage read",e),[]}}var pt=Object.freeze([]),ht=pt,ft=!1;function gt(){return ft?(ht=rt?Object.freeze(rt.buffer.slice()):pt,ft=!1,ht):ht}function bt(){ft=!0}var yt=new Set;function vt(){for(const e of yt)try{e()}catch(e){void 0!==console&&console.warn("[conversationArc] change subscriber threw:",e)}}function xt(e){return yt.add(e),()=>{yt.delete(e)}}function wt(e){if(!e||"object"!=typeof e)throw new TypeError("registerConversationArcSink: sink must be an object");return at.add(e),()=>{at.delete(e)}}function kt(e={}){const t=e.key??"semiotic:conversation-arc",i=lt(e.maxEvents,st,"createLocalStorageConversationArcSink: maxEvents");return{record(n){const r=ut(e.storage),o=mt(r,t);o.push(n),function(e,t,i,n){if(e)try{e.setItem(t,JSON.stringify(i.slice(-n)))}catch(e){ct("localStorage write",e)}}(r,t,o,i)},clear(){const i=ut(e.storage);if(i)try{i.removeItem(t)}catch(e){ct("localStorage clear",e)}},load:()=>mt(ut(e.storage),t)}}function $t(e={}){const t=e.dbName??"semiotic-conversation-arc",i=e.storeName??"events",n=lt(e.maxEvents,st,"createIndexedDBConversationArcSink: maxEvents");let r=null;const o=()=>(r??(r=function(e,t,i){const n=function(e){if(e)return e;try{return globalThis.indexedDB??null}catch{return null}}(i);return n?new Promise(i=>{let r;try{r=n.open(e,1)}catch(e){return ct("IndexedDB open",e),void i(null)}r.onupgradeneeded=()=>{const e=r.result;e.objectStoreNames.contains(t)||e.createObjectStore(t,{keyPath:"id",autoIncrement:!0})},r.onsuccess=()=>i(r.result),r.onerror=()=>{ct("IndexedDB open",r.error),i(null)},r.onblocked=()=>{ct("IndexedDB open",Error("upgrade blocked")),i(null)}}):Promise.resolve(null)}(t,i,e.indexedDB)),r);return{async record(e){const t=await o();t&&(await new Promise(n=>{try{const r=t.transaction(i,"readwrite");r.objectStore(i).add({event:e}),r.oncomplete=()=>n(),r.onerror=()=>{ct("IndexedDB record",r.error),n()}}catch(e){ct("IndexedDB record",e),n()}}),await function(e,t,i){return e?new Promise(n=>{try{const r=e.transaction(t,"readwrite"),o=r.objectStore(t),a=o.getAll();a.onsuccess=()=>{const e=Array.isArray(a.result)?a.result:[],t=e.length-i;if(t>0)for(const i of e.slice(0,t))null!=i.id&&o.delete(i.id)},a.onerror=()=>ct("IndexedDB trim",a.error),r.oncomplete=()=>n(),r.onerror=()=>{ct("IndexedDB trim",r.error),n()}}catch(e){ct("IndexedDB trim",e),n()}}):Promise.resolve()}(t,i,n))},async clear(){const e=await o();e&&await new Promise(t=>{try{const n=e.transaction(i,"readwrite");n.objectStore(i).clear(),n.oncomplete=()=>t(),n.onerror=()=>{ct("IndexedDB clear",n.error),t()}}catch(e){ct("IndexedDB clear",e),t()}})},load:async()=>function(e,t){return e?new Promise(i=>{try{const n=e.transaction(t,"readonly").objectStore(t).getAll();n.onsuccess=()=>{i((Array.isArray(n.result)?n.result:[]).map(e=>e.event).filter(Boolean))},n.onerror=()=>{ct("IndexedDB load",n.error),i([])}}catch(e){ct("IndexedDB load",e),i([])}}):Promise.resolve([])}(await o(),i)}}function Ct(e){if(!e.url)throw new TypeError("createWebhookConversationArcSink: url is required");const t=e.method??"POST";return{record(i){const n=e.fetch??globalThis.fetch;if(!n)return;const r=e.mapEvent?e.mapEvent(i):i;return n(e.url,{method:t,headers:{"Content-Type":"application/json",...e.headers},body:JSON.stringify(r)}).then(()=>{})}}}function St(e,t={}){const i=Array.isArray(e)?e.slice():[],n=lt(t.capacity,Math.max(rt?.capacity??st,i.length,1),"loadConversationArc: capacity"),r=t.sessionId??i[0]?.sessionId??rt?.sessionId??It();for(rt?(rt.enabled=t.enabled??!1,rt.sessionId=r,rt.capacity=n):rt={enabled:t.enabled??!1,sessionId:r,capacity:n,buffer:[]},t.append||(rt.buffer=[]),rt.buffer.push(...i);rt.buffer.length>rt.capacity;)rt.buffer.shift();return bt(),vt(),gt()}function At(e,t={}){return St(e,t)}function jt(e,t,i){return Bt.record({type:"audience-set",audience:e,previous:t??void 0,...i})}function Nt(e,t){return Bt.record({type:"annotation-status-changed",toStatus:e,annotationId:t?.annotationId,fromStatus:t?.fromStatus,chartId:t?.chartId,arcId:t?.arcId,meta:t?.meta})}function It(){return`arc-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function Lt(){return rt}function Pt(e={}){const t=e.capacity??1e3;if(!Number.isFinite(t)||0>=t)throw new RangeError("enableConversationArc: capacity must be a positive number, got "+t);if(rt){if(rt.enabled=!0,e.sessionId&&(rt.sessionId=e.sessionId),null!=e.capacity){for(rt.capacity=t;rt.buffer.length>rt.capacity;)rt.buffer.shift();bt()}}else rt={enabled:!0,sessionId:e.sessionId??It(),capacity:t,buffer:[]},bt();return vt(),Bt}function Rt(){rt&&(rt.enabled=!1,vt())}function Mt(){return Bt}var Bt={get enabled(){return rt?.enabled??!1},get sessionId(){return rt?.sessionId??null},get capacity(){return rt?.capacity??0},record(e){const t=Lt();if(!t||!t.enabled)return null;const i={...e,timestamp:e.timestamp??Date.now(),sessionId:e.sessionId??t.sessionId};for(t.buffer.push(i);t.buffer.length>t.capacity;)t.buffer.shift();bt(),vt();for(const e of ot)try{e(i)}catch(e){void 0!==console&&console.warn("[conversationArc] subscriber threw:",e)}return function(e){for(const t of at)t.record&&dt("sink record",()=>t.record?.(e))}(i),i},flush(){const e=Lt();if(!e)return[];const t=e.buffer.slice();return e.buffer=[],bt(),vt(),function(e){for(const t of at)t.flush&&dt("sink flush",()=>t.flush?.(e))}(t),t},getEvents:()=>gt(),subscribe:e=>(ot.add(e),()=>{ot.delete(e)}),clear(){const e=Lt();e&&(e.buffer=[],bt(),vt()),function(){for(const e of at)e.clear&&dt("sink clear",()=>e.clear?.())}()},reset(){if(ot.clear(),at.clear(),ht=pt,ft=!1,!rt)return vt(),void yt.clear();rt.buffer=[],rt.enabled=!1,rt=null,vt(),yt.clear()}};import*as Ft from"react";import{jsx as zt,jsxs as Tt}from"react/jsx-runtime";var Dt={position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0,padding:0,margin:-1};function Et({tree:e,label:t,visible:i=!1,className:n,onActiveChange:r,activeId:o,chartId:a,onObservation:l,onAnnotationActivate:c}){const[d,u]=Ft.useState(()=>new Set([e.id])),[p,h]=Ft.useState(e.id),f=void 0!==o,g=f?o:p,b=Ft.useRef(null),y=Ft.useRef(new Map),v=m(e=>e.pushObservation),x=Ft.useCallback(e=>{l?.(e),v?.(e)},[l,v]),w=Ft.useMemo(()=>function(e){const t=new Map,i=e=>{for(const n of e.children??[])t.set(n.id,e),i(n)};return i(e),t}(e),[e]),k=Ft.useMemo(()=>it(e,d),[e,d]);Ft.useEffect(()=>{f||k.some(e=>e.id===p)||h(e.id)},[k,p,e.id,f]),Ft.useEffect(()=>{const e=[];let t=w.get(g);for(;t;)e.push(t.id),t=w.get(t.id);e.length>0&&u(t=>{if(e.every(e=>t.has(e)))return t;const i=new Set(t);for(const t of e)i.add(t);return i})},[g,w]),Ft.useEffect(()=>{b.current?.contains(document.activeElement)&&y.current.get(g)?.focus()},[g]);const $=Ft.useCallback((e,t,i)=>{const n=Mt();n.enabled&&n.record("focus"===t?{type:"nav-node-focused",chartId:a,nodeId:e.id,role:e.role,level:e.level,label:e.label.length>200?e.label.slice(0,200):e.label}:{type:"nav-branch-expanded",chartId:a,nodeId:e.id,role:e.role,level:e.level,expanded:!!i})},[a]),C=Ft.useCallback(e=>{e.id!==g&&(f||h(e.id),r?.(e),$(e,"focus"),e.datum&&x({type:"focus",datum:e.datum,inputType:"navigation-tree",timestamp:Date.now(),chartType:"AccessibleNavTree",chartId:a}))},[r,f,$,g,x,a]),S=Ft.useCallback(e=>{if(e.datum){if("annotation"===e.role){const t=s(e.datum);return c?.({annotation:e.datum,annotationId:t,chartId:a,inputType:"navigation-tree"}),void(t&&x({type:"annotation-activate",annotationId:t,inputType:"navigation-tree",timestamp:Date.now(),chartType:"AccessibleNavTree",chartId:a}))}x({type:"activate",datum:e.datum,inputType:"navigation-tree",timestamp:Date.now(),chartType:"AccessibleNavTree",chartId:a})}},[a,x,c]),A=e=>{u(t=>new Set(t).add(e.id)),$(e,"toggle",!0)},j=e=>{u(t=>{const i=new Set(t);return i.delete(e.id),i}),$(e,"toggle",!1)},N=(e,t,n)=>{const r=!!e.children&&e.children.length>0,o=d.has(e.id);return Tt("li",{role:"treeitem","aria-label":e.label,"aria-level":e.level,"aria-posinset":t,"aria-setsize":n,"aria-expanded":r?o:void 0,"aria-selected":e.id===g,tabIndex:e.id===g?0:-1,ref:t=>{y.current.set(e.id,t)},onClick:t=>{t.stopPropagation(),C(e),r?(o?j:A)(e):S(e)},style:i?{listStyle:"none",padding:"2px 6px",paddingLeft:6+16*(e.level-1),cursor:r?"pointer":"default",fontSize:13,color:"var(--semiotic-text, currentColor)",background:e.id===g?"var(--semiotic-surface, var(--semiotic-grid, var(--semiotic-bg, #f0f4f8)))":"transparent",outline:"none"}:void 0,children:[Tt("span",{className:"semiotic-nav-tree-label semiotic-nav-tree-"+e.role,children:[i&&r?o?"▾ ":"▸ ":"",e.label]}),r&&o&&zt("ul",{role:"group",style:i?{margin:0,padding:0}:void 0,children:e.children.map((t,i)=>N(t,i+1,e.children.length))})]},e.id)};return zt("div",{ref:b,className:"semiotic-nav-tree"+(n?" "+n:""),style:i?void 0:Dt,onKeyDown:e=>{const t=k.findIndex(e=>e.id===g);if(-1===t)return;const i=k[t],n=!!i.children&&i.children.length>0,r=d.has(i.id);let o=!0;switch(e.key){case"ArrowDown":C(k[Math.min(t+1,k.length-1)]);break;case"ArrowUp":C(k[Math.max(t-1,0)]);break;case"Home":C(k[0]);break;case"End":C(k[k.length-1]);break;case"ArrowRight":n&&!r?A(i):n&&r?C(i.children[0]):o=!1;break;case"ArrowLeft":if(n&&r)j(i);else{const e=w.get(i.id);e?C(e):o=!1}break;case"Enter":case" ":n?(r?j:A)(i):S(i);break;default:o=!1}o&&(e.preventDefault(),e.stopPropagation())},children:zt("ul",{role:"tree","aria-label":t||"Chart navigation",style:i?{margin:0,padding:0}:void 0,children:N(e,1,1)})})}var Ot=new Set(["LineChart","AreaChart","DifferenceChart","StackedAreaChart","Scatterplot","ConnectedScatterplot","BubbleChart","QuadrantChart","MultiAxisLineChart","CandlestickChart","Heatmap","MinimapChart","RealtimeLineChart","RealtimeHeatmap"]),Ht=new Set(["BarChart","StackedBarChart","GroupedBarChart","SwarmPlot","BoxPlot","Histogram","ViolinPlot","DotPlot","RidgelinePlot","FunnelChart","LikertChart","SwimlaneChart"]),Wt={Scatterplot:["pointRadius","hoverRadius"],BubbleChart:["pointRadius","hoverRadius"],ConnectedScatterplot:["pointRadius","hoverRadius"],QuadrantChart:["pointRadius","hoverRadius"],SwarmPlot:["pointRadius","hoverRadius"],DotPlot:["dotRadius","hoverRadius"]};function Vt(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function Ut(e){return"string"==typeof e&&e.trim().length>0}function Gt(e){const t=Vt(e.capability)?e.capability:null,i=Vt(e.recipe)?e.recipe:null,n=[e.mobileSemantics,e.mobileVisualization,e.mobile,t?.mobile,i?.mobile];for(const e of n)if(Vt(e))return e;return null}function qt(e){return Array.isArray(e)&&e.length>=2&&"number"==typeof e[0]&&"number"==typeof e[1]&&Number.isFinite(e[0])&&Number.isFinite(e[1])?[e[0],e[1]]:null}function Jt(e){return qt(e.size)||qt(Vt(e.frameProps)?e.frameProps.size:void 0)||("number"==typeof e.width&&"number"==typeof e.height?[e.width,e.height]:null)}function _t(e,t){e.push({...t,status:"pass"})}function Qt(e,t){e.push({...t,status:"warn"})}function Xt(e,t){e.push({...t,status:"manual"})}function Zt(e,t={},i={}){const n=i.viewportWidth??390,r=i.targetSize??44,o=Jt(t),a=l(t,{width:n,height:o?.[1]}),s=[],c=Jt(t=a.props),d=Gt(t),u=function(e,t){return e.includes("CustomChart")||e.includes("Custom")||null!=t.recipeId||null!=t.mobileSemantics}(e,t),m=function(e){const t=Gt(e);return!0===e.responsive||!0===e.mobile||!0===t?.responsive||!0===t?.supportsResponsiveLayout||Array.isArray(t?.breakpoints)||"number"==typeof t?.minViewportWidth||"responsive"===t?.strategy||"small-multiples"===t?.strategy||"summary-cards"===t?.strategy||null!=e.mobileLayout||null!=e.responsiveRules||"mobile-readable"===e.density}(t),p=!0===i.inChartContainer,h=Ut(t.title)||Ut(t.summary)||Ut(t.description)||!0===d?.summary||Ut(d?.summary);if(a.matches.length>0&&_t(s,{id:"layout.responsive-rule-applied",category:"layout",impact:"medium",message:`${a.matches.length} responsive rule(s) applied for the ${n}px mobile audit.`}),c){const[t,i]=c;t>n&&!m?Qt(s,{id:"layout.fixed-desktop-size",category:"layout",impact:"high",message:`Chart size is ${t}px wide against a ${n}px mobile viewport with no responsive/mobile transform hint.`,fix:"Use responsive sizing, responsiveRules/mobileLayout, or an explicit mobile variant that preserves the task instead of clipping the desktop chart."}):_t(s,{id:"layout.fixed-desktop-size",category:"layout",impact:"high",message:"No fixed desktop-width overflow risk is visible from the config."}),"number"==typeof d?.minViewportWidth&&d.minViewportWidth>n&&Qt(s,{id:"layout.mobile-min-width",category:"layout",impact:"high",message:`The declared mobile contract supports ${d.minViewportWidth}px minimum, wider than the audited ${n}px viewport.`,fix:"Add a narrower breakpoint, summary-card fallback, or explicit horizontal-scroll affordance with a non-visual equivalent."});const r=t/Math.max(1,i);430>=n&&r>2.4&&"BigNumber"!==e&&Qt(s,{id:"layout.wide-aspect-ratio",category:"layout",impact:"medium",message:`Chart aspect ratio is ${r.toFixed(1)}:1, which tends to compress phone charts vertically.`,fix:"Prefer stacked sections, small multiples, cards plus a sparkline, or a taller mobile-specific chart ratio."}),160>i&&"BigNumber"!==e&&Qt(s,{id:"layout.too-short-for-reading",category:"layout",impact:"medium",message:`Chart height is ${i}px; most phone charts need enough vertical room for marks plus readable labels.`,fix:"Reserve more vertical space, remove nonessential axes, or switch to a card/sparkline pattern with external labels."})}else Xt(s,{id:"layout.unknown-size",category:"layout",impact:"medium",message:"No explicit size is available to audit. This may be responsive, but static mobile overflow cannot be checked.",fix:"Audit rendered widths at 320, 360, 390, and 430px, or pass size/responsiveRules metadata into the config."});const f=function(e){const t=[e.data,e.points,e.lines,e.nodes,e.edges,e.areas,Vt(e.frameProps)?e.frameProps.data:void 0];let i=0;for(const e of t)Array.isArray(e)&&(i+=e.length);return i}(t);f>0&&(f>("number"==typeof d?.maxMarks?d.maxMarks:Ot.has(e)?1.25*n:Ht.has(e)?Math.max(8,Math.floor(n/34)):n)?Qt(s,{id:"density.mark-budget",category:"density",impact:Ot.has(e)?"medium":"high",message:`${f} data item(s) exceed the rough mobile density budget for ${e} at ${n}px.`,fix:"Aggregate, filter, facet into small multiples, switch to a summary-card plus detail view, or use progressive disclosure."}):_t(s,{id:"density.mark-budget",category:"density",impact:"medium",message:f+" data item(s) are within the rough mobile density budget for this component."}));const g=function(e){const t=[e.tickValues,e.xTickValues,e.yTickValues,e.rTickValues,e.oTickValues];let i=0;for(const e of t)Array.isArray(e)&&(i+=e.length);return i>0?i:null}(t),b=!1!==t.showAxes&&!1!==t.axis;if(b&&null!=g){const e=Math.max(3,Math.floor(n/58));g>e&&Qt(s,{id:"density.explicit-tick-count",category:"density",impact:"medium",message:`${g} explicit tick(s) exceed a phone-friendly budget of about ${e} at ${n}px.`,fix:"Use adaptive ticks, fewer tickValues, direct labels, or move exact values into a tap-accessible detail panel."})}else b&&(Ot.has(e)||Ht.has(e))&&Xt(s,{id:"density.axis-label-collision",category:"density",impact:"medium",message:"Axes are enabled, but label collision depends on rendered tick text and cannot be checked statically.",fix:"Verify tick labels at phone widths or provide explicit mobile tick density."});!function(e){const t=Vt(e.frameProps)?e.frameProps:{};return(!0===e.enableHover||null!=e.tooltipContent||null!=e.tooltip||null!=t.tooltipContent||!0===t.enableHover)&&!function(e){const t=Gt(e),i=Vt(e.mobileInteraction)?e.mobileInteraction:null;return null!=e.controls||null!=e.mobileControls||!0===e.alternativeControls||null!=e.selection||null!=e.onClick||null!=e.onSelect||!0===e.mobileInteraction||!0===i?.tapToSelect||!0===i?.tapToLockTooltip||Array.isArray(t?.interaction?.alternatives)&&t.interaction.alternatives.length>0||"tap"===t?.interaction?.primary||"button"===t?.interaction?.primary||Ut(t?.interaction?.hoverFallback)}(e)}(t)?_t(s,{id:"interaction.hover-only-detail",category:"interaction",impact:"high",message:"No hover-only detail path is visible from the config."}):Qt(s,{id:"interaction.hover-only-detail",category:"interaction",impact:"high",message:"The chart exposes tooltip/hover detail without an obvious tap, selection, or control alternative.",fix:"Enable tap-to-select, a persistent details panel, visible segment buttons, or another non-hover path for the same information."});const y=function(e,t){const i=Wt[e];if(!i)return null;let n=i.includes("hoverRadius")?30:null;for(const e of i){const i=t[e];"number"==typeof i&&Number.isFinite(i)&&i>0&&(n=null==n?i:Math.max(n,i))}return null==n?null:2*n}(e,t),v=Vt(t.mobileInteraction)?t.mobileInteraction:null,x=y??("number"==typeof v?.targetSize?v.targetSize:!0===t.mobileInteraction?44:"number"==typeof d?.minimumHitTarget?d.minimumHitTarget:"number"==typeof d?.interaction?.targetSize?d.interaction.targetSize:null);null!=x&&(24>x?Qt(s,{id:"interaction.target-size-minimum",category:"interaction",impact:"high",message:`Small interactive marks expose an estimated ${x}px pointer target, below WCAG's 24px minimum.`,fix:"Increase mark radius/hoverRadius, add tap snapping to nearest datum, or provide larger external controls."}):r>x?Qt(s,{id:"interaction.target-size-comfort",category:"interaction",impact:"medium",message:`Pointer target is about ${x}px, above 24px but below the ${r}px comfortable phone target.`,fix:"Use hoverRadius/tapRadius near 44px while keeping the visible mark small if needed."}):_t(s,{id:"interaction.target-size-comfort",category:"interaction",impact:"medium",message:`Pointer target is about ${x}px, meeting the configured ${r}px target.`}));const w=[];null==t.brush&&null==t.onBrush||w.push("brush"),!0===t.zoomable&&w.push("pan/zoom"),"isolate"!==t.legendInteraction&&"highlight"!==t.legendInteraction||w.push("legend filtering"),w.length>0&&!function(e,t){const i=Gt(e),n=Vt(e.mobileInteraction)?e.mobileInteraction:null,r=n?.standardControls;return!!(null!=e.controls||null!=e.mobileControls||!0===e.alternativeControls||Array.isArray(i?.interaction?.alternatives)&&i.interaction.alternatives.length>0)||!0===r||"all"===r||t.every(e=>"brush"===e?Array.isArray(r)?r.includes("brush"):"brush"===r:"pan/zoom"===e?Array.isArray(r)?r.includes("zoom"):"zoom"===r:"legend filtering"===e&&(Array.isArray(r)?r.includes("legend"):"legend"===r))}(t,w)&&Qt(s,{id:"interaction.complex-gesture-alternative",category:"interaction",impact:"high",message:`Mobile-hostile complex interaction detected: ${w.join(", ")} without standard control alternatives.`,fix:"Pair gestures with buttons, range inputs, chips, or a details panel that works with touch and keyboard."}),!1===t.showLegend||!1===t.legend||!0!==t.showLegend&&!0!==t.legend&&null==t.colorBy&&null==t.groupBy&&null==t.lineBy&&null==t.areaBy&&null==t.stackBy||!0===t.directLabel||!0===t.showLabels||"direct"===t.labelStrategy||"direct-end"===t.labelStrategy||"direct"===d?.labels?.strategy||"inline"===d?.labels?.strategy||"external"===d?.labels?.strategy||n>430||Qt(s,{id:"semantics.legend-over-direct-labels",category:"semantics",impact:"medium",message:"The chart appears to rely on a legend instead of direct labels at phone width.",fix:"Prefer direct end labels, inline labels, or a compact chip selector so readers do not bounce between plot and legend."});const k=Array.isArray(t.annotations)?t.annotations.filter(e=>Vt(e)):[];if(k.length>("number"==typeof d?.maxAnnotations?d.maxAnnotations:3)&&430>=n&&Qt(s,{id:"annotation.mobile-density",category:"annotation",impact:"medium",message:k.length+" annotation(s) compete for phone plot space.",fix:"Assign annotation priority, collapse secondary notes into a callout list, or provide shorter mobileText."}),k.length>0){const e=k.filter(e=>!Ut(e.mobileText)&&!Ut(e.shortText)&&!Ut(e.label));e.length>0&&Xt(s,{id:"annotation.mobile-copy",category:"annotation",impact:"low",message:e.length+" annotation(s) lack explicit short/mobile copy.",fix:"Add mobileText or shortText for notes that need to survive narrow layouts."})}m||"BigNumber"===e||Xt(s,{id:"layout.no-responsive-transform",category:"layout",impact:"low",message:"No explicit responsive transformation hint is present.",fix:"Declare responsiveRules/mobileLayout or a density/label strategy so the mobile version is a designed transformation, not an accidental resize."}),u&&(d?(_t(s,{id:"semantics.custom-mobile-contract",category:"semantics",impact:"medium",message:"Custom chart/recipe provides a mobileSemantics/mobile contract, so the audit can inspect its authored phone behavior."}),!1===d.custom?.dataBearingSceneNodes?Qt(s,{id:"semantics.custom-data-bearing-scene",category:"semantics",impact:"medium",message:"Custom mobile contract says emitted scene nodes are not data-bearing.",fix:"Preserve datum references, semantic roles, or accessible-table fields so intelligence, navigation, and tap details can recover the chart's meaning."}):!0!==d.custom?.dataBearingSceneNodes&&Xt(s,{id:"semantics.custom-data-bearing-scene",category:"semantics",impact:"low",message:"Custom chart mobile contract does not state whether scene nodes are data-bearing.",fix:"Set mobile.custom.dataBearingSceneNodes and mobile.custom.navigationGranularity for custom layouts and interoperability adapters."})):Xt(s,{id:"semantics.custom-mobile-contract",category:"semantics",impact:"medium",message:"Custom chart layout is opaque to static mobile analysis because no mobileSemantics/mobile contract is present.",fix:"Declare mobileSemantics with strategy, breakpoints, mark budgets, touch target size, interaction alternatives, and custom scene semantics."})),h||p||Qt(s,{id:"semantics.no-mobile-summary",category:"semantics",impact:"medium",message:"No title, summary, description, or ChartContainer context is visible from the config.",fix:"Add title/summary text or wrap in ChartContainer so the small-screen reader gets the task before the chart."});const $=s.filter(e=>"warn"===e.status),C={highRisk:$.filter(e=>"high"===e.impact).length,warnings:$.length,manual:s.filter(e=>"manual"===e.status).length,passes:s.filter(e=>"pass"===e.status).length};return{component:e,viewportWidth:n,ok:0===C.highRisk,summary:C,findings:s,reference:"Mobile visualization audit: informed by MobileVisFixer, mobile exploratory interaction research, small-multiple mobile studies, responsive visualization grammars, constraint-based breakpoints, and WCAG 2.2 input modalities."}}var Kt={pass:"PASS",warn:"WARN",manual:"MANUAL","not-applicable":"N/A"},Yt=["layout","density","interaction","annotation","semantics"];function ei(e){const t=[],i=e.summary,n=e.ok?`no high-risk mobile blockers at ${e.viewportWidth}px`:`${i.highRisk} high-risk mobile issue(s) at ${e.viewportWidth}px`;t.push(`${e.ok?"PASS":"WARN"} ${e.component}: mobile visualization audit`),t.push(` ${n} - ${i.warnings} warning(s) - ${i.manual} manual check(s)`);for(const i of Yt){const n=e.findings.filter(e=>e.category===i&&"not-applicable"!==e.status);if(0!==n.length){t.push(""),t.push(" "+i.toUpperCase());for(const e of n)t.push(` ${Kt[e.status]} [${e.impact}] ${e.id}: ${e.message}`),!e.fix||"warn"!==e.status&&"manual"!==e.status||t.push(" -> "+e.fix)}}return t.push(""),t.push(" Ref: "+e.reference),t.join("\n")}function ti(){return["Static audit only: rendered label collision, CSS-resolved type size, and actual touch behavior still require viewport testing.","Use multiple widths, usually 320, 360, 390, 430, and 768 CSS pixels.","A mobile pass means no high-risk static warnings, not that the chart is perceptually or ergonomically optimal."]}import*as ii from"react";function ni(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function ri(e){return e&&"object"==typeof e&&"number"==typeof e.targetSize?e.targetSize:void 0}function oi(e){return Array.isArray(e)?e.length>0:!!e}import{Fragment as ai,jsx as si,jsxs as li}from"react/jsx-runtime";var ci={position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0,padding:0,margin:-1};function di(){const e=d();return e?si("button",{className:"semiotic-chart-action",onClick:e,title:"Data summary","aria-label":"Toggle data summary",style:xi,children:li("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[si("rect",{x:"1",y:"1",width:"12",height:"3",rx:"0.5"}),si("rect",{x:"1",y:"6",width:"8",height:"3",rx:"0.5"}),si("rect",{x:"1",y:"11",width:"5",height:"2",rx:"0.5"})]})}):null}var ui={info:"var(--semiotic-info, #2563eb)",success:"var(--semiotic-success, #16a34a)",warning:"var(--semiotic-warning, #d97706)",error:"var(--semiotic-error, var(--semiotic-danger, #dc2626))",neutral:"var(--semiotic-text-secondary, #6b7280)"},mi={error:4,warning:3,info:2,success:1,neutral:0};function pi({level:e}){const t={width:15,height:15,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};switch(e){case"error":case"warning":return li("svg",{...t,children:[si("path",{d:"M8 1.8 15 14H1L8 1.8Z"}),si("path",{d:"M8 6.4v3.4"}),si("circle",{cx:"8",cy:"11.8",r:"0.5",fill:"currentColor",stroke:"none"})]});case"success":return li("svg",{...t,children:[si("circle",{cx:"8",cy:"8",r:"6.4"}),si("path",{d:"M5 8.2 7 10.2 11 5.8"})]});case"info":return li("svg",{...t,children:[si("circle",{cx:"8",cy:"8",r:"6.4"}),si("path",{d:"M8 7.4V11"}),si("circle",{cx:"8",cy:"5",r:"0.5",fill:"currentColor",stroke:"none"})]});default:return li("svg",{...t,children:[si("path",{d:"M8 2a3.5 3.5 0 0 0-3.5 3.5c0 4-1.5 5-1.5 5h10s-1.5-1-1.5-5A3.5 3.5 0 0 0 8 2Z"}),si("path",{d:"M6.5 13a1.5 1.5 0 0 0 3 0"})]})}}function hi({notification:e,level:t,onDismiss:i}){const n=ui[t]??ui.info,r=!1!==e.dismissible;return li("div",{className:"semiotic-chart-notification semiotic-chart-notification--"+t,style:{display:"flex",alignItems:"flex-start",gap:8,padding:"6px 10px",borderRadius:4,borderLeft:"3px solid "+n,background:"var(--semiotic-surface, rgba(127, 127, 127, 0.08))"},children:[li("div",{style:{flex:1,minWidth:0},children:[e.source&&si("div",{className:"semiotic-chart-notification-source",style:{fontSize:9,fontWeight:700,letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--semiotic-text-secondary, #666)"},children:e.source}),e.title&&si("div",{className:"semiotic-chart-notification-title",style:{fontSize:12,fontWeight:600,color:n},children:e.title}),si("div",{className:"semiotic-chart-notification-message",style:{fontSize:12,lineHeight:1.45,color:"var(--semiotic-text, #333)"},children:e.message})]}),r&&si("button",{className:"semiotic-chart-notification-dismiss","aria-label":e.title?"Dismiss notification: "+e.title:"Dismiss notification",title:"Dismiss",onClick:i,style:{...xi,width:18,height:18,fontSize:13,lineHeight:1,flex:"none"},children:"×"})]})}function fi({visible:e,onDismiss:t}){const[i,n]=ii.useState(!1),r=ii.useRef(null),o=ii.useRef(null);if(ii.useEffect(()=>{0===e.length&&i&&n(!1)},[e.length,i]),ii.useEffect(()=>{if(!i)return;const e=e=>{r.current&&!r.current.contains(e.target)&&n(!1)},t=e=>{"Escape"===e.key&&(n(!1),o.current?.focus())};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[i]),0===e.length)return null;const a=e.reduce((e,t)=>mi[t.level]>mi[e]?t.level:e,e[0].level),s=ui[a]??ui.info,l=e.length,c=`${l} chart notification${1===l?"":"s"}, most severe: ${a}`;return li("div",{ref:r,className:"semiotic-chart-notifications",style:{position:"relative",display:"inline-flex"},children:[si("span",{style:ci,role:"status","aria-live":"polite",children:c}),li("button",{ref:o,className:"semiotic-chart-action semiotic-chart-notifications-toggle","aria-haspopup":"dialog","aria-expanded":i,"aria-label":`${c}. ${i?"Hide":"Show"} notifications`,title:c,onClick:()=>n(e=>!e),style:{...xi,color:s,position:"relative"},children:[si(pi,{level:a}),si("span",{className:"semiotic-chart-notifications-badge","aria-hidden":"true",style:{position:"absolute",top:-3,right:-3,minWidth:15,height:15,padding:"0 3px",boxSizing:"border-box",borderRadius:8,background:s,color:"#fff",fontSize:9,fontWeight:700,lineHeight:"15px",textAlign:"center"},children:l>99?"99+":l})]}),i&&si("div",{className:"semiotic-chart-notifications-popover",role:"dialog","aria-label":"Chart notifications",style:{position:"absolute",top:"calc(100% + 6px)",right:0,zIndex:20,width:320,maxWidth:"min(360px, 90vw)",maxHeight:320,overflowY:"auto",display:"flex",flexDirection:"column",gap:6,padding:10,textAlign:"left",background:"var(--semiotic-bg, #fff)",border:"1px solid var(--semiotic-border, #e0e0e0)",borderRadius:6,boxShadow:"0 6px 24px rgba(0, 0, 0, 0.16)"},children:e.map(e=>si(hi,{notification:e.notification,level:e.level,onDismiss:()=>t(e)},e.key))})]})}var gi={live:{bg:"#22c55e",color:"#fff"},stale:{bg:"#ef4444",color:"#fff"},paused:{bg:"#eab308",color:"#000"},error:{bg:"#ef4444",color:"#fff"},static:{bg:"#6b7280",color:"#fff"}};function bi({height:e}){return si("div",{role:"status","aria-busy":"true","aria-label":"Loading chart",style:{width:"100%",height:e,background:"linear-gradient(90deg, var(--semiotic-border, #e0e0e0) 25%, var(--semiotic-bg, #f5f5f5) 50%, var(--semiotic-border, #e0e0e0) 75%)",backgroundSize:"200% 100%",animation:"semiotic-skeleton-pulse 1.5s ease-in-out infinite",borderRadius:4}})}function yi({error:e}){return si("div",{role:"alert",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",minHeight:120,padding:24,boxSizing:"border-box"},children:si("div",{style:{textAlign:"center",maxWidth:400,fontSize:14,color:"var(--semiotic-text-secondary, #666)",lineHeight:1.5},children:e})})}var vi=ii.forwardRef(function({title:t,subtitle:i,children:n,width:r="100%",height:a=400,actions:s,chartConfig:l,describe:c,navigable:d,controls:u,banner:m,notifications:p,onNotificationDismiss:h,loading:b=!1,error:y,errorBoundary:v=!1,status:x,detailsPanel:w,mobile:k,mobileAudit:$,className:C,style:S},A){const j=ii.useRef(null),N=ii.useRef(null),[I,L]=ii.useState(!1),[P,R]=ii.useState(()=>new Set);ii.useEffect(()=>{R(e=>{if(0===e.size)return e;const t=new Set((p??[]).map((e,t)=>e.id??t+""));let i=!1;const n=new Set;for(const r of e)t.has(r)?n.add(r):i=!0;return i?n:e})},[p]);const M=ii.useMemo(()=>p?p.map((e,t)=>({notification:e,index:t,key:e.id??t+"",level:e.level??"info"})).filter(({key:e})=>!P.has(e)):[],[p,P]),B=ii.useCallback(e=>{R(t=>new Set(t).add(e.key)),h?.(e.notification,e.index)},[h]),F=!1!==s?.export&&void 0!==s?.export,z=!1!==s?.fullscreen&&void 0!==s?.fullscreen,T=!1!==s?.copyConfig&&void 0!==s?.copyConfig&&l,D=!0===s?.dataSummary,E=ii.useMemo(()=>{if(!c||!l?.component||!l?.props)return"";const e="object"==typeof c?c.levels:void 0;try{return Xe(l.component,l.props,e?{levels:e}:{}).text}catch{return""}},[c,l]),O="object"==typeof c&&!0===c.visible,H=ii.useMemo(()=>{if(!d||!l?.component||!l?.props)return null;const e="object"==typeof d?d.maxLeaves:void 0;try{return tt(l.component,l.props,e?{maxLeaves:e}:{})}catch{return null}},[d,l]),W="object"==typeof d&&!0===d.visible,V=ii.useMemo(()=>"object"==typeof s?.export?s.export:{},[s?.export]),U="object"==typeof s?.copyConfig?s.copyConfig.format:"json",G=ii.useCallback(async e=>{N.current&&await g(N.current,{...V,...e})},[V]),q=ii.useCallback(()=>{j.current&&(document.fullscreenElement?document.exitFullscreen().catch(()=>{}):j.current.requestFullscreen().catch(()=>{}))},[]),J=ii.useCallback(async e=>{l&&await ce({...l,version:l.version??"1",createdAt:l.createdAt??(new Date).toISOString()},e||U||"json")},[l,U]);ii.useEffect(()=>{const e=()=>{L(!!document.fullscreenElement)};return document.addEventListener("fullscreenchange",e),()=>document.removeEventListener("fullscreenchange",e)},[]),ii.useImperativeHandle(A,()=>({export:G,toggleFullscreen:q,copyConfig:J,element:j.current}),[G,q,J]);const _=!0===k?{}:k&&"object"==typeof k?k:null,Q=!!k,X=_?.breakpoint??480,Z=void 0===_?.chartMode?"mobile":_.chartMode,K=_?.semantics,Y=_?.mobileInteraction??(!!Q||void 0),ee=_?.standardControls,te=ni(ee)?ee:null,ie=te?.controls??(ni(ee)?void 0:ee)??function(e){return e&&"object"==typeof e?e.standardControls:void 0}(Y),ne=ii.useMemo(()=>function(e,t){return oi(t)?e&&"object"==typeof e?{...e,standardControls:t}:!1===e||null==e?e:{standardControls:t}:e}(Y,ie),[Y,ie]),re=Q&&oi(ie)?si(e,{controls:ie,targetSize:te?.targetSize??ri(Y)??44,compact:te?.compact??!0,className:te?.className,style:te?.style,ariaLabel:te?.ariaLabel,brush:te?.brush,zoom:te?.zoom,legend:te?.legend}):null,oe=_?.summary,ae=!0===_?.allowHorizontalScroll,se=!0===_?.hideToolbar,le=ii.useMemo(()=>{if(!$||!l?.component||!l?.props)return null;const e="object"==typeof $?$:{},t=l.props;try{return Zt(l.component,{...t,mobileSemantics:t.mobileSemantics??K,mobileInteraction:t.mobileInteraction??ne},{viewportWidth:e.viewportWidth??390,targetSize:e.targetSize??44,inChartContainer:!0})}catch{return null}},[$,l,K,ne]);ii.useEffect(()=>{if(!le||le.ok)return;const e=le.findings.filter(e=>"pass"!==e.status).slice(0,5);console.warn(`[Semiotic mobile audit] ${l?.component}: ${le.summary.highRisk} high-risk mobile finding(s), ${le.summary.warnings} warning(s).`,e)},[le,l?.component]);const de=le&&!le.ok&&"object"==typeof $&&!0===$.visible?li("div",{className:"semiotic-chart-mobile-audit",role:"status",style:{padding:"8px 12px",fontSize:12,lineHeight:1.45,color:"var(--semiotic-warning, #6b3f00)",background:"color-mix(in srgb, var(--semiotic-warning, #d97706) 14%, var(--semiotic-bg, #fff))",borderBottom:"1px solid var(--semiotic-border, #e0e0e0)"},children:["Mobile audit: ",le.summary.highRisk," high-risk finding",1===le.summary.highRisk?"":"s"," and"," ",le.summary.warnings," warning",1===le.summary.warnings?"":"s"," at"," ",("object"==typeof $?$.viewportWidth:void 0)??390,"px."]}):null,ue=M.length>0,me=t||i||u||F||z||T||D||x||ue,pe=ii.useMemo(()=>{if(!Q||!ii.isValidElement(n))return n;if(!function(e){const t=e.type;return"function"==typeof t||"object"==typeof t&&null!==t}(n))return n;const e=n.props,t={};return Z&&null==e.mode&&(t.mode=Z),K&&null==e.mobileSemantics&&(t.mobileSemantics=K),void 0!==ne&&null==e.mobileInteraction&&(t.mobileInteraction=ne),Object.keys(t).length>0?ii.cloneElement(n,t):n},[n,Q,Z,K,ne]),he=b?si(bi,{height:a}):y?si(yi,{error:y}):v?si(f,{children:pe}):pe;return fe=li(ai,{children:[si("style",{dangerouslySetInnerHTML:{__html:`@keyframes semiotic-skeleton-pulse {\n 0% { background-position: 200% 0; }\n 100% { background-position: -200% 0; }\n}\n@media (max-width: ${X}px) {\n .semiotic-chart-container[data-semiotic-mobile="true"] .semiotic-chart-header {\n padding: 10px 12px !important;\n gap: 10px !important;\n }\n .semiotic-chart-container[data-semiotic-mobile="true"] .semiotic-chart-title-area {\n flex-basis: 100% !important;\n }\n .semiotic-chart-container[data-semiotic-mobile="true"] .semiotic-chart-toolbar {\n width: 100% !important;\n margin-left: 0 !important;\n justify-content: flex-start !important;\n overflow-x: auto !important;\n -webkit-overflow-scrolling: touch;\n }\n .semiotic-chart-container[data-semiotic-mobile="true"][data-semiotic-mobile-hide-toolbar="true"] .semiotic-chart-toolbar {\n display: none !important;\n }\n .semiotic-chart-container[data-semiotic-mobile="true"] .semiotic-chart-action {\n min-width: 32px !important;\n min-height: 32px !important;\n }\n .semiotic-chart-container[data-semiotic-mobile="true"] .semiotic-chart-mobile-summary {\n display: block !important;\n }\n .semiotic-chart-container[data-semiotic-mobile="true"] .semiotic-chart-mobile-standard-controls {\n display: block !important;\n }\n .semiotic-chart-container[data-semiotic-mobile="true"][data-semiotic-mobile-scroll="true"] .semiotic-chart-body {\n overflow-x: auto !important;\n justify-content: flex-start !important;\n -webkit-overflow-scrolling: touch;\n }\n}`}}),li("div",{ref:j,className:"semiotic-chart-container"+(C?" "+C:""),"data-semiotic-mobile":Q?"true":void 0,"data-semiotic-mobile-scroll":ae?"true":void 0,"data-semiotic-mobile-hide-toolbar":se?"true":void 0,style:{width:r,border:"1px solid var(--semiotic-border, #e0e0e0)",borderRadius:"var(--semiotic-border-radius, 8px)",overflow:"hidden",background:"var(--semiotic-bg, #fff)",fontFamily:"var(--semiotic-font-family, sans-serif)",position:"relative",...I?{display:"flex",flexDirection:"column",width:"100%",height:"100%"}:{},...S},children:[me&&li("div",{className:"semiotic-chart-header",style:{padding:"12px 16px",display:"flex",justifyContent:"space-between",alignItems:"flex-start",flexWrap:"wrap",gap:8,borderBottom:"1px solid var(--semiotic-border, #e0e0e0)"},children:[li("div",{className:"semiotic-chart-title-area",style:{minWidth:0,flex:"1 1 200px"},children:[t&&si("div",{className:"semiotic-chart-title",style:{fontSize:14,fontWeight:600,color:"var(--semiotic-text, #333)"},children:t}),i&&si("div",{className:"semiotic-chart-subtitle",style:{fontSize:12,color:"var(--semiotic-text-secondary, #666)",marginTop:t?2:0},children:i})]}),li("div",{className:"semiotic-chart-toolbar",style:{display:"flex",alignItems:"center",gap:4,marginLeft:"auto"},children:[u,ue&&si(fi,{visible:M,onDismiss:B}),F&&si("button",{className:"semiotic-chart-action",onClick:()=>G(),title:"Export chart","aria-label":"Export chart",style:xi,children:li("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[si("path",{d:"M7 2v8M3.5 7L7 10.5 10.5 7"}),si("path",{d:"M2 12h10"})]})}),D&&si(di,{}),z&&si("button",{className:"semiotic-chart-action",onClick:q,title:I?"Exit fullscreen":"Fullscreen","aria-label":I?"Exit fullscreen":"Enter fullscreen",style:xi,children:si("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:li(ai,I?{children:[si("path",{d:"M9 1v4h4"}),si("path",{d:"M5 13V9H1"}),si("path",{d:"M13 5H9V1"}),si("path",{d:"M1 9h4v4"})]}:{children:[si("path",{d:"M1 5V1h4"}),si("path",{d:"M13 9v4H9"}),si("path",{d:"M9 1h4v4"}),si("path",{d:"M5 13H1V9"})]})})}),T&&si("button",{className:"semiotic-chart-action",onClick:()=>J(),title:"Copy config","aria-label":"Copy chart configuration",style:xi,children:li("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[si("rect",{x:"5",y:"5",width:"8",height:"8",rx:"1"}),si("path",{d:"M9 5V2a1 1 0 00-1-1H2a1 1 0 00-1 1v6a1 1 0 001 1h3"})]})}),x&&si("div",{className:"semiotic-chart-status","aria-live":"polite","aria-atomic":"true",style:{padding:"2px 8px",borderRadius:4,fontSize:10,fontWeight:700,letterSpacing:"0.05em",textTransform:"uppercase",background:gi[x].bg,color:gi[x].color,lineHeight:"18px"},children:x})]})]}),m&&si("div",{className:"semiotic-chart-banner",children:m}),de,oe&&si("div",{className:"semiotic-chart-mobile-summary",style:{display:"none",padding:"8px 12px",fontSize:12,lineHeight:1.45,color:"var(--semiotic-text-secondary, #666)",borderBottom:"1px solid var(--semiotic-border, #e0e0e0)"},children:oe}),re&&si("div",{className:"semiotic-chart-mobile-standard-controls",style:{display:"none",padding:"10px 12px",borderBottom:"1px solid var(--semiotic-border, #e0e0e0)",background:"var(--semiotic-surface, var(--semiotic-bg, #f6f8fa))"},children:re}),E&&si("div",{className:"semiotic-chart-description",role:"note",style:O?{padding:"8px 16px",fontSize:12,lineHeight:1.5,color:"var(--semiotic-text-secondary, #666)",borderBottom:"1px solid var(--semiotic-border, #e0e0e0)"}:ci,children:E}),H&&si("div",{className:"semiotic-chart-nav",style:W?{padding:"8px 8px",borderBottom:"1px solid var(--semiotic-border, #e0e0e0)",maxHeight:240,overflow:"auto"}:void 0,children:si(Et,{tree:H,label:"string"==typeof t&&t?t+" — navigable structure":"Chart navigable structure",visible:W,chartId:"string"==typeof l?.props?.chartId?l.props.chartId:void 0})}),li("div",{className:"semiotic-chart-body",ref:N,style:{position:"relative",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",...I?{flex:1}:{height:a}},children:[he,w]})]})]}),D?si(o,{children:fe}):fe;var fe}),xi={width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center",border:"none",background:"transparent",cursor:"pointer",borderRadius:4,color:"var(--semiotic-text-secondary, #666)",padding:0};import*as wi from"react";import{jsx as ki,jsxs as $i}from"react/jsx-runtime";function Ci({children:e,controls:t,mobile:i,breakpoint:n=480,chartMode:r="mobile",mobileInteraction:o=!0,mobileSemantics:a,mobileSummary:s,chips:l=[],activeChip:c,onChipChange:d,detail:u,detailTitle:m="Details",detailMode:p="sheet",initialDetailOpen:h=!1,allowHorizontalScroll:f=!1,hideToolbar:g=!1,chartDefaults:b,...y}){const[v,x]=wi.useState(()=>c??l.find(e=>!e.disabled)?.id),[w,k]=wi.useState(h);wi.useEffect(()=>{void 0===c&&(l.length?l.some(e=>e.id===v&&!e.disabled)||x(l.find(e=>!e.disabled)?.id):x(void 0))},[c,l,v]);const $=c??v,C=wi.useCallback(e=>{e.disabled||(void 0===c&&x(e.id),d?.(e))},[c,d]),S=l.length?ki("div",{className:"semiotic-mobile-chip-row",role:"list","aria-label":"Mobile chart controls",children:l.map(e=>$i("button",{type:"button",className:"semiotic-mobile-chip","aria-pressed":e.id===$,disabled:e.disabled,onClick:()=>C(e),title:"string"==typeof e.description?e.description:void 0,children:[ki("span",{children:e.label}),e.description&&ki("small",{className:"semiotic-mobile-chip-description",children:e.description})]},e.id))}):null,A=s||S?$i("div",{className:"semiotic-mobile-summary-card",children:[s&&ki("div",{className:"semiotic-mobile-summary-copy",children:s}),S]}):i?.summary,j={breakpoint:n,chartMode:r,mobileInteraction:o,semantics:a,allowHorizontalScroll:f,hideToolbar:g,...i,summary:A},N=wi.useMemo(()=>{if(!b||!wi.isValidElement(e))return e;const t=e.props,i={};for(const[e,n]of Object.entries(b))null==t[e]&&(i[e]=n);return Object.keys(i).length>0?wi.cloneElement(e,i):e},[e,b]),I=!!u&&"sheet"===p,L=!!u&&"inline"===p||I&&w,P=I?ki("button",{type:"button",className:"semiotic-mobile-detail-toggle","aria-expanded":w,onClick:()=>k(e=>!e),children:w?"Hide details":"Show details"}):null,R=t||P?$i("div",{className:"semiotic-mobile-control-stack",children:[t,P]}):void 0;return $i("div",{className:"semiotic-mobile-chart-shell",children:[ki("style",{children:`\n .semiotic-mobile-chart-shell {\n display: grid;\n gap: 10px;\n width: 100%;\n }\n .semiotic-mobile-summary-card {\n display: grid;\n gap: 10px;\n }\n .semiotic-mobile-summary-copy {\n font-size: 13px;\n line-height: 1.45;\n }\n .semiotic-mobile-chip-row {\n display: flex;\n gap: 8px;\n overflow-x: auto;\n padding-bottom: 2px;\n -webkit-overflow-scrolling: touch;\n }\n .semiotic-mobile-chip {\n display: inline-flex;\n flex: 0 0 auto;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n min-height: 40px;\n min-width: 44px;\n border: 1px solid var(--semiotic-border, #d8d8d8);\n border-radius: 999px;\n padding: 7px 12px;\n background: var(--semiotic-bg, #fff);\n color: var(--semiotic-text, #222);\n font: inherit;\n font-size: 12px;\n font-weight: 700;\n cursor: pointer;\n }\n .semiotic-mobile-chip[aria-pressed="true"] {\n border-color: var(--semiotic-accent, #1f7a6d);\n background: color-mix(in srgb, var(--semiotic-accent, #1f7a6d) 14%, transparent);\n }\n .semiotic-mobile-chip:disabled {\n cursor: not-allowed;\n opacity: 0.45;\n }\n .semiotic-mobile-chip-description {\n display: block;\n max-width: 160px;\n margin-top: 2px;\n color: var(--semiotic-text-secondary, #666);\n font-size: 10px;\n font-weight: 500;\n line-height: 1.2;\n }\n .semiotic-mobile-control-stack {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n flex-wrap: wrap;\n }\n .semiotic-mobile-detail-toggle {\n min-height: 32px;\n border: 1px solid var(--semiotic-border, #d8d8d8);\n border-radius: 999px;\n padding: 5px 10px;\n background: transparent;\n color: var(--semiotic-text, #222);\n font: inherit;\n font-size: 12px;\n font-weight: 700;\n cursor: pointer;\n }\n .semiotic-mobile-detail-panel {\n border: 1px solid var(--semiotic-border, #d8d8d8);\n border-radius: 16px;\n background: var(--semiotic-bg, #fff);\n color: var(--semiotic-text, #222);\n box-shadow: 0 18px 48px rgba(0, 0, 0, 0.16);\n overflow: hidden;\n }\n .semiotic-mobile-detail-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n padding: 10px 12px;\n border-bottom: 1px solid var(--semiotic-border, #d8d8d8);\n font-size: 13px;\n font-weight: 800;\n }\n .semiotic-mobile-detail-body {\n padding: 12px;\n font-size: 13px;\n line-height: 1.5;\n }\n @media (max-width: ${n}px) {\n .semiotic-mobile-detail-panel[data-mode="sheet"] {\n position: sticky;\n bottom: 8px;\n z-index: 2;\n max-height: min(55vh, 420px);\n overflow: auto;\n }\n }\n `}),ki(vi,{...y,controls:R,mobile:j,children:N}),L&&$i("section",{className:"semiotic-mobile-detail-panel","data-mode":p,"aria-label":"string"==typeof m?m:"Chart details",children:[$i("div",{className:"semiotic-mobile-detail-header",children:[ki("span",{children:m}),I&&ki("button",{type:"button",className:"semiotic-mobile-detail-toggle",onClick:()=>k(!1),children:"Close"})]}),ki("div",{className:"semiotic-mobile-detail-body",children:u})]})]})}import*as Si from"react";import{jsx as Ai,jsxs as ji}from"react/jsx-runtime";function Ni(e,t){if(t)return"function"==typeof t?t(e):e?.[t]}function Ii(e,t){const i="function"==typeof t?t(e):e[t];return Array.isArray(i)?i:[]}function Li(e){return{strategy:"small-multiples",responsive:!0,supportsResponsiveLayout:!0,summary:`${e} vertically stacked small multiple panel${1===e?"":"s"} with shared scale guidance.`,interaction:{primary:"tap",alternatives:["panel summary","linked selection"],hoverFallback:"tap-to-lock",targetSize:44},labels:{strategy:"external",minFontSize:12}}}function Pi(e,t){if(!Si.isValidElement(e))return e;const i=e.props,n={};for(const[e,r]of Object.entries(t))void 0!==r&&null==i[e]&&(n[e]=r);return Object.keys(n).length>0?Si.cloneElement(e,n):e}function Ri({items:e,children:t,columns:i=3,tabletColumns:n=2,mobileColumns:r=1,mobileBreakpoint:o=480,tabletBreakpoint:s=860,gap:l=12,mode:c="mobile",chartHeight:d=220,sharedExtent:m=!0,valueAccessor:p,dataAccessor:h="data",extentProps:f=["yExtent","valueExtent"],linkedHover:g,selection:b,linkedBy:y,linkProvider:v="auto",selections:x,showLegend:w=!1,legendPosition:k,legendInteraction:$,legendSelectionName:C,legendField:S,mobileInteraction:A=!0,mobileSemantics:j,labelMode:N="panel",chartDefaults:I,className:L,style:P}){const R=u(),M=e||"function"==typeof t?[]:Si.Children.toArray(t),B=e??M.map((e,t)=>({id:"panel-"+(t+1)})),F=B.length,z=Si.useMemo(()=>function(e,t,i,n){if(t&&"object"==typeof t)return t;if(!1===t)return{};const r=[],o=[];for(const t of e)if(t.extent&&r.push(t.extent[0],t.extent[1]),n)for(const e of Ii(t,i))o.push(Ni(e,n));const a=function(e){let t=1/0,i=-1/0;for(const n of e){const e=Number(n);Number.isFinite(e)&&(t>e&&(t=e),e>i&&(i=e))}if(Number.isFinite(t)&&Number.isFinite(i))return t===i?[t-1,i+1]:[t,i]}(o.length?o:r);return a?{yExtent:a,valueExtent:a}:{}}(B,m,h,p),[B,m,h,p]),T=Si.useMemo(()=>{if(!y)return{name:void 0,fields:void 0,linkedHover:g,selection:b};const e=Array.isArray(y)?"small-multiples":y.name||"small-multiples",t=Array.isArray(y)?y:y.fields||[];return{name:e,fields:t,linkedHover:g??{name:e,fields:t},selection:b??{name:e}}},[y,g,b]),D=Si.useMemo(()=>({linkedHover:T.linkedHover,selection:T.selection}),[T.linkedHover,T.selection]),E=Si.useMemo(()=>{const e={mode:c,height:d,responsiveWidth:!0,mobileInteraction:A,mobileSemantics:j??Li(F),...D,...I};"legend"!==N&&(e.showLegend=!1),"direct"===N&&(e.directLabel=!0);for(const t of f)t in z&&(e[t]=z[t]);return e},[c,d,A,j,F,D,I,N,f,z]),O=ji("section",{className:["semiotic-small-multiple-chart",L].filter(Boolean).join(" "),style:P,"data-semiotic-small-multiple":"true",children:[Ai("style",{children:`\n .semiotic-small-multiple-chart {\n --semiotic-small-multiple-columns: ${i};\n --semiotic-small-multiple-gap: ${l}px;\n display: grid;\n grid-template-columns: repeat(var(--semiotic-small-multiple-columns), minmax(0, 1fr));\n gap: var(--semiotic-small-multiple-gap);\n width: 100%;\n }\n .semiotic-small-multiple-panel {\n min-width: 0;\n border: 1px solid var(--semiotic-border, #d8d8d8);\n border-radius: 16px;\n background: var(--semiotic-bg, #fff);\n overflow: hidden;\n }\n .semiotic-small-multiple-heading {\n display: grid;\n gap: 3px;\n padding: 10px 12px 0;\n }\n .semiotic-small-multiple-title {\n margin: 0;\n color: var(--semiotic-text, #222);\n font-size: 13px;\n font-weight: 800;\n line-height: 1.25;\n }\n .semiotic-small-multiple-subtitle,\n .semiotic-small-multiple-summary {\n margin: 0;\n color: var(--semiotic-text-secondary, #666);\n font-size: 11px;\n line-height: 1.35;\n }\n .semiotic-small-multiple-plot {\n min-width: 0;\n padding: 4px 6px 8px;\n overflow: hidden;\n }\n @media (max-width: ${s}px) {\n .semiotic-small-multiple-chart {\n --semiotic-small-multiple-columns: ${n};\n }\n }\n @media (max-width: ${o}px) {\n .semiotic-small-multiple-chart {\n --semiotic-small-multiple-columns: ${r};\n }\n .semiotic-small-multiple-panel {\n border-radius: 14px;\n }\n .semiotic-small-multiple-heading {\n padding: 9px 10px 0;\n }\n }\n `}),B.map((e,i)=>{const n={...E},r="function"==typeof t?t(e,{item:e,index:i,count:F,chartProps:n,sharedExtent:z}):M[i];return ji("article",{className:"semiotic-small-multiple-panel","aria-label":"string"==typeof e.title?e.title:void 0,children:[(e.title||e.subtitle||e.summary)&&ji("header",{className:"semiotic-small-multiple-heading",children:[e.title&&Ai("h3",{className:"semiotic-small-multiple-title",children:e.title}),e.subtitle&&Ai("p",{className:"semiotic-small-multiple-subtitle",children:e.subtitle}),e.summary&&Ai("p",{className:"semiotic-small-multiple-summary",children:e.summary})]}),Ai("div",{className:"semiotic-small-multiple-plot",children:Pi(r,n)})]},e.id??i)})]});return!0===v||"auto"===v&&(y||g||b||x||!0===w)&&!R?Ai(a,{selections:x,showLegend:w,legendPosition:k,legendInteraction:$,legendSelectionName:C??T.name??"small-multiples",legendField:S??T.fields?.[0]??"category",children:O}):O}import*as Mi from"react";import{Fragment as Bi,jsx as Fi,jsxs as zi}from"react/jsx-runtime";function Ti({children:e,columns:t="auto",minCellWidth:i=300,gap:n=16,tabletColumns:r,mobileColumns:o=1,mobileBreakpoint:a=480,tabletBreakpoint:s=860,chartDefaults:l,className:c,style:d}){const u="semiotic-chart-grid-"+Mi.useId().replace(/[^a-zA-Z0-9_-]/g,""),m="number"==typeof t?t:void 0,p="auto"===t?`repeat(auto-fill, minmax(${i}px, 1fr))`:`repeat(${t}, 1fr)`,h=["semiotic-chart-grid",u,c].filter(Boolean).join(" ");return zi(Bi,{children:[Fi("style",{children:`\n ${r?`\n @media (max-width: ${s}px) {\n .${u} {\n grid-template-columns: repeat(${r}, minmax(0, 1fr)) !important;\n }\n }`:""}\n @media (max-width: ${a}px) {\n .${u} {\n grid-template-columns: repeat(${o}, minmax(0, 1fr)) !important;\n }\n .${u} > [data-semiotic-chart-grid-primary="true"] {\n grid-column: span ${o} !important;\n }\n }\n `}),Fi("div",{className:h,style:{display:"grid",gridTemplateColumns:p,gap:n,width:"100%",...d},children:Mi.Children.map(e,e=>{if(!Mi.isValidElement(e))return e;const t=e.props,i={};if(l)for(const[e,n]of Object.entries(l))null==t[e]&&(i[e]=n);const n=Object.keys(i).length>0?Mi.cloneElement(e,i):e;return"primary"!==e.props.emphasis||void 0!==m&&2>m?n:Fi("div",{"data-semiotic-chart-grid-primary":"true",style:{gridColumn:"span 2",minWidth:0},children:n})})})]})}Ti.displayName="ChartGrid";import*as Di from"react";import{Fragment as Ei,jsx as Oi,jsxs as Hi}from"react/jsx-runtime";function Wi({children:e,context:t,position:i="right",contextSize:n=250,mobilePosition:r="bottom",mobileBreakpoint:o=480,gap:a=12,className:s,style:l}){const c="semiotic-context-layout-"+Di.useId().replace(/[^a-zA-Z0-9_-]/g,""),d="left"===i||"right"===i,u="left"===i||"top"===i,m={display:"flex",flexDirection:d?u?"row-reverse":"row":u?"column-reverse":"column",gap:a,width:"100%",...l},p=d?{flex:`0 0 ${n}px`,width:n,minHeight:0}:{flex:`0 0 ${n}px`,height:n,minWidth:0};return Hi(Ei,{children:[Oi("style",{children:`\n @media (max-width: ${o}px) {\n .${c}[data-mobile-position="bottom"] {\n flex-direction: column !important;\n }\n .${c}[data-mobile-position="top"] {\n flex-direction: column-reverse !important;\n }\n .${c}[data-mobile-position="bottom"] > .semiotic-context-panel,\n .${c}[data-mobile-position="top"] > .semiotic-context-panel {\n flex: 0 0 auto !important;\n width: 100% !important;\n height: auto !important;\n }\n }\n `}),Hi("div",{className:["semiotic-context-layout",c,s].filter(Boolean).join(" "),"data-mobile-position":r,style:m,children:[Oi("div",{className:"semiotic-context-primary",style:{flex:"1 1 0%",minWidth:0,minHeight:0},children:e}),Oi("div",{className:"semiotic-context-panel",style:p,children:t})]})]})}Wi.displayName="ContextLayout";import{useState as Vi,useEffect as Ui,useRef as Gi,useCallback as qi}from"react";import{jsx as Ji,jsxs as _i}from"react/jsx-runtime";function Qi({children:e,position:t="right",size:i=300,trigger:n="click",chartId:r,observation:o,dismissOnEmpty:a=!0,showClose:s=!0,onToggle:l,className:d,style:u}){const[m,p]=Vi(null),[h,f]=Vi(null),[g,b]=Vi(!1),[y,v]=Vi(!1),x=Gi(null),w=Gi(void 0),k="click"===n?["click","click-end"]:["hover","hover-end"],{latest:$}=c({types:k,chartId:r,limit:1}),C=void 0!==o?o:$,S=qi(()=>{v(!0),b(!1),clearTimeout(w.current),w.current=setTimeout(()=>{v(!1),p(null),f(null)},200)},[]);if(Ui(()=>{if(C)if("click"===C.type||"hover"===C.type){const e=C;p(e.datum),f(e),b(e=>(e||(v(!0),clearTimeout(w.current),w.current=setTimeout(()=>v(!1),200)),!0))}else!a||"click-end"!==C.type&&"hover-end"!==C.type||S()},[a,S,C]),Ui(()=>{l?.(g)},[g,l]),Ui(()=>()=>clearTimeout(w.current),[]),!m&&!y)return null;const A=m&&h?e(m,h):null;if(null===A&&!y)return null;const j=function(e,t,i,n){const r={position:"absolute",background:"var(--semiotic-bg, #fff)",borderColor:"var(--semiotic-border, #e0e0e0)",borderStyle:"solid",borderWidth:0,boxSizing:"border-box",zIndex:10,display:"flex",flexDirection:"column",transition:n?"transform 200ms ease-out, opacity 200ms ease-out":void 0};return"right"===e?{...r,top:0,right:0,width:t,height:"100%",borderLeftWidth:1,padding:"12px 16px",transform:i?"translateX(0)":`translateX(${t}px)`,opacity:i?1:0}:"bottom"===e?{...r,bottom:0,left:0,width:"100%",height:t,borderTopWidth:1,padding:"12px 16px",transform:i?"translateY(0)":`translateY(${t}px)`,opacity:i?1:0}:{...r,top:"50%",left:"50%",transform:i?"translate(-50%, -50%) scale(1)":"translate(-50%, -50%) scale(0.95)",opacity:i?1:0,width:Math.min(t,400),maxHeight:"80%",borderWidth:1,borderRadius:8,padding:"16px 20px",boxShadow:"0 8px 32px rgba(0,0,0,0.12)"}}(t,i,g,y);return _i("div",{ref:x,className:`semiotic-details-panel semiotic-details-${t}${d?" "+d:""}`,style:{...j,...u},children:[s&&Ji("button",{className:"semiotic-details-close",onClick:S,"aria-label":"Close details",style:Xi,children:Ji("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:Ji("path",{d:"M2 2l8 8M10 2l-8 8"})})}),Ji("div",{className:"semiotic-details-content",style:{overflow:"auto",flex:1},children:A})]})}var Xi={position:"absolute",top:8,right:8,width:20,height:20,display:"flex",alignItems:"center",justifyContent:"center",border:"none",background:"transparent",cursor:"pointer",borderRadius:4,color:"var(--semiotic-text-secondary, #666)",padding:0,zIndex:1};function Zi(e){const t=e.designContract?.chartFamily??e.title??"chart",i=e.audience?.primary?" for "+e.audience.primary:"",n=e.designContract?.whyThisForm;return`${t}: ${e.intent.primary}${i}${n?". "+n:""}`}function Ki(e,t){const i=e.intents.map(e=>"string"==typeof e?e:e.id??e.name).filter(e=>!!e),n=e.intents.find(e=>"string"!=typeof e&&"primary"===e.strength),r=("object"==typeof n?n.id??n.name:void 0)??i[0]??"explanation";return{ididVersion:"0.1",chartId:t.chartId,title:t.title??e.name,intent:{primary:r,secondary:i.filter(e=>e!==r)},audience:{primary:e.audience?.primary,familiarityAssumptions:Object.fromEntries(Object.entries(e.audience?.familiarity??{}).map(([e,t])=>[e,t+""])),literacyTargets:e.audience?.literacyTargets?.map(e=>({feature:e.concept,rationale:e.rationale}))},reception:e.reception?{channels:e.reception.channels,strengths:e.reception.strengths,risks:e.reception.risks,scaffolds:e.reception.scaffolds,memorableForm:e.reception.memorableForm}:void 0,designContract:{chartFamily:e.frameFamily,whyThisForm:e.designContract.whyThisForm??e.designContract.whyCustom,whyNotDefault:e.designContract.whyNotDefault,risks:e.reception?.risks,misuse:e.designContract.misuse},accessibility:{description:t.description,navigation:"required"===e.accessibility.keyboardNavigation||null!=e.navigation,dataFallback:!0===e.accessibility.fallbackTable||"required"===e.accessibility.accessibleTable||!0===e.accessibility.requiresAccessibleTable,manualChecks:["real screen-reader behavior","keyboard order quality","custom metaphor comprehension","animation distraction"]},provenance:t.dataSources||t.reviewStatus?{dataSources:t.dataSources,reviewStatus:t.reviewStatus,generatedBy:"Semiotic recipe intelligence"}:void 0}}Qi.displayName="DetailsPanel";import*as Yi from"react";import{jsx as en,jsxs as tn}from"react/jsx-runtime";function nn({manifest:e,label:t="Intent Mark",className:i,showSummary:n=!0}){const[r,o]=Yi.useState(!1),a=Yi.useMemo(()=>JSON.stringify(e,null,2),[e]),s=Yi.useCallback(async()=>{"undefined"!=typeof navigator&&navigator.clipboard&&(await navigator.clipboard.writeText(a),o(!0),window.setTimeout(()=>o(!1),1200))},[a]);return tn("details",{className:i?"semiotic-intent-mark "+i:"semiotic-intent-mark",style:{border:"1px solid var(--semiotic-border, #c8c8c8)",borderRadius:6,background:"var(--semiotic-surface, #fff)",color:"var(--semiotic-text, #222)",fontFamily:"var(--semiotic-font-family, sans-serif)"},children:[tn("summary",{style:{cursor:"pointer",padding:"7px 10px",fontSize:12,fontWeight:700,letterSpacing:"0.04em",textTransform:"uppercase"},children:[t," · ",e.intent.primary]}),tn("div",{style:{padding:"0 10px 10px"},children:[n&&en("p",{style:{margin:"4px 0 10px",fontSize:13,lineHeight:1.45},children:Zi(e)}),en("button",{type:"button",onClick:s,style:{border:"1px solid currentColor",borderRadius:4,background:"transparent",color:"inherit",padding:"4px 8px",font:"inherit",fontSize:12,cursor:"pointer"},children:r?"Copied":"Copy manifest"}),en("pre",{style:{maxHeight:280,overflow:"auto",margin:"10px 0 0",padding:10,background:"var(--semiotic-background, #f5f5f5)",fontSize:11,lineHeight:1.45,whiteSpace:"pre-wrap"},children:a})]})]})}import{useCallback as rn,useEffect as on,useMemo as an,useRef as sn,useState as ln}from"react";var cn=["hover","click","focus","activate"];function dn(e){if("datum"===e.role&&e.datum)return e.datum;for(const t of e.children??[]){const e=dn(t);if(e)return e}return null}function un(e,t){return e?t.map(t=>e[t]+"").join(""):""}function mn(e,t){if(e.id===t)return e;for(const i of e.children??[]){const e=mn(i,t);if(e)return e}return null}function pn(e){const{tree:t,chartId:i,observe:n=cn}=e,r=e.selectionName??"__semiotic-nav-sync"+(i?":"+i:""),o=an(()=>{if(e.matchFields)return e.matchFields;const i=dn(t);return i?Object.keys(i).filter(e=>{return!e.startsWith("_")&&(null==(t=i[e])||"string"==typeof t||"number"==typeof t||"boolean"==typeof t);var t}):[]},[e.matchFields,t]),a=an(()=>{const e=new Map,i=t=>{if("datum"===t.role&&t.datum){const i=un(t.datum,o);e.has(i)||e.set(i,t.id)}for(const e of t.children??[])i(e)};return i(t),e},[t,o]),{selectPoints:s,clear:l}=p({name:r,fields:o}),d=an(()=>[...n,"hover-end"],[n]),{latest:u}=c({chartId:i,types:d,limit:1}),[m,h]=ln(t.id),f=sn(m);f.current=m;const g=sn(t);on(()=>{const e=g.current;g.current=t;const i=mn(e,f.current),n=mn(t,f.current);"datum"===i?.role&&"datum"===n?.role&&i.datum&&n.datum&&o.length>0&&un(i.datum,o)===un(n.datum,o)||i&&n&&"datum"!==i.role&&"datum"!==n.role||(h(t.id),l())},[t,l,o]);const b=rn(e=>{if(h(e.id),"datum"===e.role&&e.datum&&o.length>0){const t={};for(const i of o)t[i]=[e.datum[i]];s(t)}else l()},[o,s,l]),y=e.annotations,v=an(()=>{const e=new Set;if(0===o.length||!y)return e;for(const t of y){const i=a.get(un(t,o));i&&e.add(i)}return e},[y,a,o]),x=rn(e=>{const t="number"==typeof e?y?.[e]:e;if(!t||0===o.length)return!1;const i=a.get(un(t,o));if(!i)return!1;h(i);const n={};for(const e of o)n[e]=[t[e]];return s(n),!0},[y,a,o,s]),w=sn(null),k=rn(e=>{if(i&&e.chartId!==i)return;if("hover-end"===e.type){if(e===w.current)return;return void(w.current=e)}if(!function(e){return"hover"===e.type||"click"===e.type||"focus"===e.type||"activate"===e.type}(e))return;if(!n.includes(e.type))return;if(e===w.current)return;if(w.current=e,0===o.length)return;const t=function(e){const t=e,i=t.data;if(!i||"object"!=typeof i||Array.isArray(i))return e;const n=e=>e.every(e=>"number"==typeof t[e]),r=n(["x0","x1","y0","y1","width","height","value"]),o=n(["y0","y1","sankeyWidth","value"])&&"source"in t&&"target"in t;return r||o?i:e}(e.datum),r=a.get(un(t,o));r&&h(e=>e===r?e:r)},[i,n,a,o]),$=sn(null);return on(()=>{u&&u!==$.current&&($.current=u,k(u))},[u,k]),{activeId:m,onActiveChange:b,selection:{name:r},onObservation:k,handleObservation:k,annotatedIds:v,focusAnnotation:x}}import{Fragment as hn,jsx as fn,jsxs as gn}from"react/jsx-runtime";function bn({items:e,title:t="Additional notes",empty:i=null,ordered:n=!0,renderItem:r,className:o,style:a}){if(!e.length)return i?fn(hn,{children:i}):null;const s=n?"ol":"ul";return gn("section",{className:["semiotic-mobile-annotation-callouts",o].filter(Boolean).join(" "),style:a,children:[fn("style",{children:"\n .semiotic-mobile-annotation-callouts {\n display: grid;\n gap: 8px;\n padding: 10px 12px;\n border: 1px solid var(--semiotic-border, #d8d8d8);\n border-radius: 14px;\n background: var(--semiotic-bg, #fff);\n color: var(--semiotic-text, #222);\n }\n .semiotic-mobile-annotation-callouts h3 {\n margin: 0;\n font-size: 13px;\n font-weight: 800;\n line-height: 1.25;\n }\n .semiotic-mobile-annotation-callouts ol,\n .semiotic-mobile-annotation-callouts ul {\n display: grid;\n gap: 8px;\n margin: 0;\n padding-left: 18px;\n }\n .semiotic-mobile-annotation-callouts li {\n font-size: 13px;\n line-height: 1.45;\n }\n .semiotic-mobile-annotation-callouts small {\n display: block;\n margin-top: 2px;\n color: var(--semiotic-text-secondary, #666);\n font-size: 11px;\n line-height: 1.3;\n }\n "}),t&&fn("h3",{children:t}),fn(s,{children:e.map((e,t)=>fn("li",{children:r?r(e,t):gn(hn,{children:[fn("span",{children:e.label}),(e.source||e.emphasis)&&fn("small",{children:[e.emphasis,e.source].filter(Boolean).join(" - ")})]})},e.id))})]})}export{g as exportChart,v as defineChartRecipe,x as validateChartRecipe,w as isRegisteredRecipeLayout,k as isJsonSafe,I as resolveRecipeRoleField,L as recipeToChartCapability,M as registerChartRecipe,B as unregisterChartRecipe,F as getChartRecipe,z as listChartRecipes,T as getRegisteredRecipeCapabilities,D as hasRegisteredRecipeCapabilities,E as registerRecipeLayout,O as unregisterRecipeLayout,H as getRecipeLayout,W as resolveChartRecipe,q as recipeIntentId,J as recipeConfig,X as fieldForRole,oe as toConfig,ae as fromConfig,se as toURL,le as fromURL,ce as copyConfig,de as configToJSX,ue as serializeSelections,me as deserializeSelections,ye as fromVegaLite,we as describeRecipeChart,Ee as communicativeActForIntent,Oe as resolveCommunicativeAct,Xe as describeChart,et as buildRecipeNavigationTree,tt as buildNavigationTree,it as flattenVisible,nt as countNodes,xt as subscribeToConversationArcChange,wt as registerConversationArcSink,kt as createLocalStorageConversationArcSink,$t as createIndexedDBConversationArcSink,Ct as createWebhookConversationArcSink,St as loadConversationArc,At as replayConversationArc,jt as recordAudienceChange,Nt as recordAnnotationStatusChange,Pt as enableConversationArc,Rt as disableConversationArc,Mt as getConversationArcStore,Et as AccessibleNavTree,Zt as auditMobileVisualization,ei as formatMobileVisualizationAudit,ti as mobileVisualizationCaveats,vi as ChartContainer,Ci as MobileChartContainer,Ri as SmallMultipleChart,Ti as ChartGrid,Wi as ContextLayout,Qi as DetailsPanel,Zi as summarizeIntentManifest,Ki as intentManifestFromRecipe,nn as IntentMark,pn as useNavigationSync,bn as MobileAnnotationCalloutList};
@@ -1 +0,0 @@
1
- import{createStore as e}from"./chunk-chunk-DSNGDNJY.module.min.js";var t={fresh:1,aging:1.5,stale:3};function n(e,t,n={}){return Number.isFinite(t)&&t>0?Number.isNaN(e)?"fresh":e===1/0?"expired":0>e||t*(n.fresh??1)>e?"fresh":t*(n.aging??1.5)>e?"aging":t*(n.stale??3)>e?"stale":"expired":"fresh"}function o(e){return{type:"hatch",background:e.background,stroke:e.stroke,lineWidth:e.lineWidth,spacing:e.spacing,angle:e.angle}}var r=null;function i(e={},t){const{background:n="transparent",stroke:i="#000",lineWidth:a=1.5,spacing:s=6,angle:l=45}=e,c={background:n,stroke:i,lineWidth:a,spacing:s,angle:l},u=Math.max(8,Math.ceil(2*s));let f;try{f=function(e){return"undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(e,e):(r||(r=document.createElement("canvas")),r.width=e,r.height=e,r)}(u)}catch{return o(c)}const d=f.getContext("2d");if(!d)return o(c);n&&"transparent"!==n?(d.fillStyle=n,d.fillRect(0,0,u,u)):d.clearRect(0,0,u,u),d.strokeStyle=i,d.lineWidth=a,d.lineCap="square";const p=l*Math.PI/180;if(45===l||-45===l){const e=l>0?1:-1;for(let t=-u;2*u>=t;t+=s)d.beginPath(),d.moveTo(t,0),d.lineTo(t+e*u,u),d.stroke()}else{d.save(),d.translate(u/2,u/2),d.rotate(p);const e=2*u;for(let t=-e;e>=t;t+=s)d.beginPath(),d.moveTo(-e,t),d.lineTo(e,t),d.stroke();d.restore()}return(t||d).createPattern(f,"repeat")}import{jsx as a,jsxs as s}from"react/jsx-runtime";function l(e){return"object"==typeof e&&null!==e&&"hatch"===e.type}function c(e){return["hatch",e.background??"transparent",e.stroke??"#000",e.lineWidth??1.5,e.spacing??6,e.angle??45,e.lineOpacity??1].join("|")}function u(e,t){let n=2166136261;const o=c(t);for(let e=0;o.length>e;e++)n^=o.charCodeAt(e),n=Math.imul(n,16777619);return`${e}-hatch-${(n>>>0).toString(36)}`}var f=new Map;function d(e,t){const n="undefined"!=typeof window&&window.devicePixelRatio||1,o=`${c(e)}@${n}`,r=f.get(o);if(void 0!==r)return r;const a=i({background:e.background,stroke:e.stroke,lineWidth:e.lineWidth,spacing:e.spacing,angle:e.angle},t),s=l(a)?null:a;return f.set(o,s),s}function p(e,t){const{background:n="transparent",stroke:o="#000",lineWidth:r=1.5,spacing:i=6,angle:l=45,lineOpacity:c=1}=e,u=Math.max(8,Math.ceil(2*i));return s("pattern",{id:t,width:u,height:u,patternUnits:"userSpaceOnUse",patternTransform:0!==l?`rotate(${l})`:void 0,children:[n&&"transparent"!==n&&a("rect",{width:u,height:u,fill:n}),a("line",{x1:0,y1:0,x2:0,y2:u,stroke:o,strokeWidth:r,strokeOpacity:c}),a("line",{x1:i,y1:0,x2:i,y2:u,stroke:o,strokeWidth:r,strokeOpacity:c})]},t)}function h(e,t,n="#4e79a7"){if(l(e)){const n=u(t,e);return{fill:`url(#${n})`,def:p(e,n)}}return e&&"string"==typeof e?{fill:e}:{fill:n}}function y(e,t){return"touch"===t?Math.max(e,24):e}function m(e){return Array.isArray(e)?e[0]:e}function b(e,t,n,o){return{data:m(e),x:t,y:n,__semioticHoverData:!0,...o}}var g=["name","label","title"],v=["type","kind","category","group","class","status","role","shape"],k=["value","amount","total","count","weight","score"],x=new Set(["x","y","z","x0","x1","y0","y1","r","cx","cy","radius","layer","row","rowindex","col","column","depth","index","order","sankeywidth","coincidentpoints","sourcelinks","targetlinks","parent","children","fx","fy","vx","vy"]);function w(e,t){for(const n of t){const t=e.find(e=>e.lower===n);if(t)return t}}function A(e,t={}){if(!e||"object"!=typeof e)return{entries:[]};const n=t.maxEntries??6,o=!1!==t.skipPositional,r=[];for(const[t,n]of Object.entries(e)){if(t.startsWith("_"))continue;if("data"===t)continue;if(o&&x.has(t.toLowerCase()))continue;if(null==n)continue;const e=typeof n;("string"===e||"number"===e||"boolean"===e||n instanceof Date)&&r.push({key:t,lower:t.toLowerCase(),value:n})}if(0===r.length)return{entries:[]};let i=r.findIndex(e=>g.includes(e.lower));const a=i>=0;0>i&&(i=r.findIndex(e=>"id"===e.lower)),0>i&&(i=r.findIndex(e=>"string"==typeof e.value));const s=0>i?void 0:r[i];let l=r.filter((e,t)=>t!==i);a&&(l=l.filter(e=>"id"!==e.lower));const c=w(l,v),u=w(l,k),f=new Set(v),d=new Set(k),p=[];c&&p.push({key:c.key,value:c.value}),u&&p.push({key:u.key,value:u.value});for(const e of l){if(p.length>=n)break;e!==c&&e!==u&&(f.has(e.lower)||d.has(e.lower)||p.push({key:e.key,value:e.value}))}return{titleKey:s?.key,title:s?.value,entries:p}}import{jsx as N,jsxs as W}from"react/jsx-runtime";var O={background:"var(--semiotic-tooltip-bg, rgba(0, 0, 0, 0.85))",color:"var(--semiotic-tooltip-text, white)",padding:"8px 12px",borderRadius:"var(--semiotic-tooltip-radius, 6px)",fontSize:"var(--semiotic-tooltip-font-size, 14px)",fontFamily:"var(--semiotic-font-family, inherit)",lineHeight:"1.5",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0, 0, 0, 0.15))",pointerEvents:"none",maxWidth:"300px",wordWrap:"break-word"};function S(e,t){return"function"==typeof t?t(e):e[t]}function j(e,t){if(t)return t(e);if(null==e)return"";if("number"==typeof e){if(!Number.isFinite(e))return e+"";const t=Number.isInteger(e)?e:parseFloat(e.toPrecision(6));return Math.abs(t)>9999?t.toLocaleString():t+""}return e instanceof Date?e.toLocaleDateString():"object"==typeof e&&null!==e?void 0!==e.id?e.id+"":void 0!==e.name?e.name+"":JSON.stringify(e):e+""}function C(e={}){const{fields:t,title:n,format:o,style:r={},className:i=""}=e;return e=>{if(!e||"object"!=typeof e)return null;let a;const s=[];if(n){const t=S(e,n);a=j(t,o)}if(t&&t.length>0)t.forEach(t=>{let n,r,i;"string"==typeof t?(n=t,r=t,i=o):(n=t.label,r=t.accessor||t.key||"",i=t.format||o);const a=S(e,r);s.push({label:n,value:j(a,i)})});else if(!n){const t=["value","y","name","id","label"];for(const n of t)if(void 0!==e[n]){a=j(e[n],o);break}if(!a){const t=Object.keys(e).filter(e=>!e.startsWith("_"));t.length>0&&(a=j(e[t[0]],o))}}const l={...O,...r};return W("div",{className:("semiotic-tooltip "+i).trim(),style:l,children:[a&&N("div",{style:{fontWeight:s.length>0?"bold":"normal"},children:a}),s.map((e,t)=>W("div",{style:{marginTop:0===t&&a?"4px":0},children:[e.label&&W("span",{children:[e.label,": "]}),e.value]},t))]})}}function I(){return e=>{const t=e.allSeries;if(!t||0===t.length)return N("div",{className:"semiotic-tooltip",style:O,children:N("div",{children:j(e.data?.value??e.data?.y)})});const n=e.xValue??e.data?.time??e.data?.x;return W("div",{className:"semiotic-tooltip",style:O,children:[null!=n&&N("div",{style:{fontWeight:600,marginBottom:4,fontSize:"0.9em",borderBottom:"1px solid var(--semiotic-border, #eee)",paddingBottom:4},children:j(n)}),t.map((e,t)=>W("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"1px 0"},children:[N("span",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:e.color,flexShrink:0}}),N("span",{style:{flex:1,fontSize:"0.85em"},children:e.group}),N("span",{style:{fontWeight:500,fontSize:"0.85em"},children:j(e.value)})]},t))]})}}function T(e){if(!0!==e){if("function"==typeof e){const t=e;return e=>{let n=m(!0===e?.__semioticHoverData||e&&void 0!==e.data&&"number"==typeof e.x&&"number"==typeof e.y&&e&&("node"===e.type||"edge"===e.type||void 0!==e.nodeOrEdge||void 0!==e.allSeries||void 0!==e.stats||void 0!==e.__chartType)?e.data??{}:e);if(!n)return null;if(("node"===e?.nodeOrEdge&&"number"==typeof n?.x0&&"number"==typeof n?.x1||"edge"===e?.nodeOrEdge&&"number"==typeof n?.sankeyWidth)&&n.data&&"object"==typeof n.data&&(n=n.data),!n)return null;const o=t(n);return null==o?null:N("div",{className:"semiotic-tooltip",style:O,children:o})}}return!1!==e&&void 0!==e&&("object"==typeof e&&null!==e&&("fields"in e||"title"in e)?C(e):"multi"===e?("undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&console.warn('[semiotic] tooltip="multi" reached normalizeTooltip — prefer charts that set tooltipMode (LineChart, AreaChart, StackedAreaChart, DifferenceChart). Rendering MultiLineTooltip content as a fallback.'),function(e={}){const{fields:t=[],title:n,format:o,style:r={},className:i="",showLabels:a=!0,separator:s=": "}=e;return e=>{if(!e||"object"!=typeof e)return null;const l=[];if(n){const t=S(e,n);l.push({value:j(t,o)})}if(t&&Array.isArray(t)&&t.length>0)t.forEach(t=>{let n,r,i;"string"==typeof t?(n=t,r=t,i=o):(n=t.label,r=t.accessor||t.key||"",i=t.format||o);const s=j(S(e,r),i);l.push({label:a?n:void 0,value:s})});else{const t=A(e,{skipPositional:!1});null!=t.title&&l.push({label:void 0,value:j(t.title,o),bold:!0}),t.entries.forEach(e=>{l.push({label:a?e.key:void 0,value:j(e.value,o)})})}const c={...O,...r};return Array.isArray(l)&&0!==l.length?N("div",{className:("semiotic-tooltip semiotic-tooltip-multiline "+i).trim(),style:c,children:l.map((e,t)=>W("div",{style:{marginBottom:l.length-1>t?"4px":0,fontWeight:e.bold?"bold":void 0},children:[e.label&&W("strong",{children:[e.label,s]}),e.value]},t))}):null}}()):C())}}function E(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function R(e,t){const{when:n}=e,o=t.width,r=t.height,i=function(e){if("number"==typeof e.height&&e.height>0)return e.width/e.height}(t),a=function(e){if("number"==typeof e.height&&e.height>0)return e.height>e.width?"portrait":"landscape"}(t);return!("number"==typeof n.minWidth&&n.minWidth>o||"number"==typeof n.maxWidth&&o>n.maxWidth||"number"==typeof n.minHeight&&("number"!=typeof r||n.minHeight>r)||"number"==typeof n.maxHeight&&("number"!=typeof r||r>n.maxHeight)||"number"==typeof n.minAspectRatio&&("number"!=typeof i||n.minAspectRatio>i)||"number"==typeof n.maxAspectRatio&&("number"!=typeof i||i>n.maxAspectRatio)||n.orientation&&a!==n.orientation)}function D(e,t,n=e.responsiveRules){if(!Array.isArray(n)||0===n.length)return{props:e,matches:[]};const o=n.map((e,t)=>({rule:e,index:t})).filter(e=>R(e.rule,t)).sort((e,t)=>("number"==typeof e.rule.priority?e.rule.priority:e.index)-("number"==typeof t.rule.priority?t.rule.priority:t.index));return{props:o.reduce((e,t)=>function(e,t){const n={...e,...t};for(const o of["margin","frameProps","mobileSemantics","style"])E(e[o])&&E(t[o])&&(n[o]={...e[o],...t[o]});return"string"==typeof e.className&&"string"==typeof t.className&&(n.className=`${e.className} ${t.className}`),n}(e,t.rule.transform),e),matches:o}}function M(e,t){return e===t}function _(e,t){if("function"==typeof e)return t=>+e(t);const n=e||t;return e=>+e[n]}function P(e,t){if("function"==typeof e)return e;const n=e||t;return e=>e[n]}function L(e,t){return"function"==typeof e?e:e?t=>t[e]+"":t?e=>e[t]+"":void 0}import*as $ from"react";var[z,F]=e(e=>({observations:[],maxObservations:100,version:0,pushObservation(t){e(e=>{const n=e.observations;return n.push(t),n.length>e.maxObservations&&n.shift(),{version:e.version+1}})},clearObservations(){e(()=>({observations:[],version:0}))}}));function H(e){const t=F(e=>e.pushObservation),n=$.useCallback(n=>{e.onObservation?.(n),t?.(n)},[e,t]);return $.useMemo(()=>({...e,onObservation:n}),[n,e])}function B(e){const t=e.provenance,n=e.id??e.stableId??t?.stableId;return null==n||""===n?void 0:n+""}function V(e,t={}){const n=B(e);return{"data-semiotic-annotation-widget":"",...n?{"data-semiotic-annotation-id":n}:{},onClickCapture(o){const r=function(e){const t=e.nativeEvent;return"touch"===t.pointerType?"touch":0===t.detail?"keyboard":"pointer"}(o);t.onAnnotationActivate?.({annotation:e,annotationId:n,chartId:t.chartId,inputType:r}),n&&t.onObservation&&t.onObservation({type:"annotation-activate",annotationId:n,inputType:r,timestamp:Date.now(),chartType:t.chartType??"unknown",chartId:t.chartId})}}}function J(e){return e instanceof Element&&null!=e.closest("[data-semiotic-annotation-widget]")}function U(e,t={}){const n=!0===t.showRetractedAnnotations,o=!0===t.showSupersededAnnotations,r=new Set;for(const t of e){const e=t?.lifecycle?.supersedes;e&&"retracted"!==t?.lifecycle?.status&&r.add(e)}return e.filter(e=>{if("retracted"===e?.lifecycle?.status&&!n)return!1;const t=e?.provenance?.stableId;return!(t&&r.has(t)&&!o)})}function q(e){const t={};if(null==e||"object"!=typeof e)return t;for(const[n,o]of Object.entries(e))n.startsWith("_")||null!=o&&""!==o&&("number"==typeof o?Number.isFinite(o)&&(t[n]=o):"string"==typeof o?t[n]=o:"boolean"==typeof o?t[n]=o+"":o instanceof Date&&(t[n]=o.toISOString().slice(0,10)));return t}function G(e){return e&&"object"==typeof e?e:{}}function K(e){return G(e.accessibility).tableFields??e.accessibleDatum??e.datum}function Y(e){const t=[];if(!Array.isArray(e))return t;const n=e.some(e=>e&&("line"===e.type||"area"===e.type));for(const o of e)if(o&&"object"==typeof o&&null!==o.datum)try{switch(o.type){case"point":if(n)break;t.push({label:"Point",values:q(K(o))});break;case"line":case"area":{const e=K(o),n=Array.isArray(e)?e:[],r="line"===o.type?"Line point":"Area point";for(const e of n)t.push({label:r,values:q(e)});break}case"rect":{const e=K(o),n=null!=e&&"object"==typeof e?e:{},r=n.category??o.group??"",i=n.value??n.__aggregateValue??n.total,a=q(n);null==a.category&&""!==r&&(a.category=r+""),null==a.value&&null!=i&&(a.value="number"==typeof i||"string"==typeof i?i:i+""),t.push({label:"Bar",values:a});break}case"heatcell":{const e=q(K(o));null==e.value&&"number"==typeof o.value&&Number.isFinite(o.value)&&(e.value=o.value),t.push({label:"Cell",values:e});break}case"wedge":{const e=K(o),n=q(e);if(null==n.category){const t=G(e),o=t.category??t.label;null!=o&&(n.category=o+"")}t.push({label:"Wedge",values:n});break}case"circle":t.push({label:"Node",values:q(K(o))});break;case"arc":t.push({label:"Arc",values:q(K(o))});break;case"candlestick":t.push({label:"Candlestick",values:q(K(o))});break;case"geoarea":{const e=G(K(o)),n=q(e);if(null==n.name){const t=G(e.properties).name??e.name;null!=t&&(n.name=t+"")}t.push({label:"Region",values:n});break}}}catch{}return t}export{M as accessorsEquivalent,_ as resolveAccessor,P as resolveRawAccessor,L as resolveStringAccessor,t as DEFAULT_LIFECYCLE_THRESHOLDS,n as bandFromAge,i as createHatchPattern,l as isHatchFill,c as hatchFillKey,u as hatchFillId,d as resolveHatchCanvasPattern,p as hatchPatternDef,h as resolveSvgFill,F as useObservationSelector,H as useAnnotationActivationOptions,B as annotationStableId,V as annotationActivationProps,J as isAnnotationActivationTarget,U as filterAnnotationsByStatus,Y as extractAllRows,y as getPointerHitRadius,b as buildHoverData,A as smartTooltipEntries,O as defaultTooltipStyle,I as MultiPointTooltip,T as normalizeTooltip,R as responsiveRuleMatches,D as resolveResponsiveRules};