semiotic 3.13.0 → 3.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -41
- package/ai/artifact-surface-inventory.json +1 -1
- package/ai/dist/mcp-server.js +132 -106
- package/ai/reference.md +12 -4
- package/ai/schema.json +16 -2
- package/ai/surface-manifest.json +1 -1
- package/ai/task-packets/compare-category-totals.json +5 -5
- package/ai/task-packets/compare-category-totals.md +2 -2
- package/ai/task-packets/correct-published-chart.json +5 -5
- package/ai/task-packets/correct-published-chart.md +2 -2
- package/ai/task-packets/index.json +6 -6
- package/ai/task-packets/update-live-chart.json +5 -5
- package/ai/task-packets/update-live-chart.md +2 -2
- package/dist/{c-CRKR5M42.min.js → c-2M2OPWVA.min.js} +37 -37
- package/dist/c-3GIPT46Z.min.js +1 -0
- package/dist/c-3UXQGCQT.min.js +1 -0
- package/dist/{c-MHNU6KYQ.min.js → c-4P2EM44G.min.js} +3 -3
- package/dist/c-4RVDKSMQ.min.js +1 -0
- package/dist/{c-6MEEA5VY.min.js → c-4YPPVFZH.min.js} +1 -1
- package/dist/{c-6MPP6QF5.min.js → c-62JIVHK5.min.js} +1 -1
- package/dist/{c-KYRH3XKJ.min.js → c-6QCSRJSC.min.js} +1 -1
- package/dist/c-6WJKNYIG.min.js +1 -0
- package/dist/c-7BVQDXFU.min.js +1 -0
- package/dist/c-7UN2WUMI.min.js +1 -0
- package/dist/c-AQUX6L2O.min.js +1 -0
- package/dist/c-BR5QDUCR.min.js +1 -0
- package/dist/c-C3YQVUB6.min.js +1 -0
- package/dist/{c-RQ2XZHWY.min.js → c-COP4OISO.min.js} +1 -1
- package/dist/c-ENRZPF5E.min.js +1 -0
- package/dist/c-HBLICBM6.min.js +1 -0
- package/dist/{c-EQVM754Z.min.js → c-HGWITEJI.min.js} +1 -1
- package/dist/{c-3K2FJDLE.min.js → c-I54V24WG.min.js} +1 -1
- package/dist/c-IDCFMBA4.min.js +2 -0
- package/dist/{c-TPL7X32J.min.js → c-ISHYKYII.min.js} +1 -1
- package/dist/c-KSSS3HSA.min.js +1 -0
- package/dist/c-LEICSI5V.min.js +1 -0
- package/dist/c-LJ4XY3Z3.min.js +1 -0
- package/dist/c-MBE6PPHN.min.js +1 -0
- package/dist/c-MOK4RWNO.min.js +1 -0
- package/dist/c-N2TVSOYL.min.js +2 -0
- package/dist/{c-EAAKQIUZ.min.js → c-NHZ2E3CI.min.js} +1 -1
- package/dist/{c-MDY3ULP6.min.js → c-OBA7XSLH.min.js} +1 -1
- package/dist/c-OIJL2WZH.min.js +1 -0
- package/dist/c-ONOWKUUZ.min.js +1 -0
- package/dist/{c-CPJR4LHF.min.js → c-OSLNYZ3Q.min.js} +17 -17
- package/dist/c-PBFRYNKM.min.js +1 -0
- package/dist/c-QUAEYF34.min.js +1 -0
- package/dist/c-RDFFLRKC.min.js +1 -0
- package/dist/c-SDGGMIYI.min.js +1 -0
- package/dist/c-SQQZPFVY.min.js +1 -0
- package/dist/c-SU6Z75M2.min.js +1 -0
- package/dist/{c-BWM7MU2Y.min.js → c-SX4TPG3Z.min.js} +1 -1
- package/dist/{c-DTYG34WG.min.js → c-VGHU2LTF.min.js} +2 -2
- package/dist/c-VLWWXOM5.min.js +1 -0
- package/dist/c-VZNIIKL6.min.js +1 -0
- package/dist/{c-GBO32OML.min.js → c-W5ATXREF.min.js} +1 -1
- package/dist/c-WSWMQDFZ.min.js +1 -0
- package/dist/{c-3SDC7AQQ.min.js → c-XM76UG3P.min.js} +1 -1
- package/dist/c-XORVM6C5.min.js +1 -0
- package/dist/{c-MYRI7NF2.min.js → c-XZJWL7UL.min.js} +1 -1
- package/dist/c-Y43GTKGR.min.js +1 -0
- package/dist/c-YGTMWEEF.min.js +1 -0
- package/dist/c-ZFIURPZA.min.js +1 -0
- package/dist/c-ZWJDTDEV.min.js +1 -0
- package/dist/c-ZYMXDR42.min.js +1 -0
- package/dist/components/ai/chartClinic.d.ts +4 -0
- package/dist/components/ai/evaluateChart.d.ts +3 -1
- package/dist/components/ai/generativeChart.d.ts +13 -0
- package/dist/components/ai/renderEvidenceMemoKey.d.ts +9 -0
- package/dist/components/ai/reportRenderError.d.ts +2 -0
- package/dist/components/charts/physics/eventDropSources.d.ts +1 -1
- package/dist/components/evidence/claimReferences.d.ts +9 -0
- package/dist/components/realtime/BinAccumulator.d.ts +5 -0
- package/dist/components/recipes/atlas/dependencyEvidence.d.ts +5 -0
- package/dist/components/recipes/atlas/support.d.ts +5 -0
- package/dist/components/server/staticXYAxisTicks.d.ts +1 -1
- package/dist/components/stream/MarginalGraphics.d.ts +4 -2
- package/dist/components/stream/PipelineStore.d.ts +6 -18
- package/dist/components/stream/axisTickUtils.d.ts +1 -1
- package/dist/components/stream/countNoun.d.ts +2 -0
- package/dist/components/stream/heatmapBandTicks.d.ts +68 -0
- package/dist/components/stream/pipelineDomainResolution.d.ts +52 -3
- package/dist/components/stream/renderers/canvasRenderHelpers.d.ts +8 -0
- package/dist/components/stream/uniqueRegionLabel.d.ts +6 -0
- package/dist/components/stream/xyAxisTicks.d.ts +8 -1
- package/dist/components/stream/xyFrameAxisTypes.d.ts +4 -2
- package/dist/components/stream/xySceneBuilders/types.d.ts +6 -0
- package/dist/geo.min.js +152 -152
- package/dist/geo.module.min.js +1 -1
- package/dist/network.module.min.js +1 -1
- package/dist/ordinal.module.min.js +1 -1
- package/dist/physics.module.min.js +1 -1
- package/dist/physicsWorker.js +1 -1
- package/dist/processSankeyLayoutWorker.js +1 -1
- package/dist/semiotic-access.module.min.js +2 -2
- package/dist/semiotic-ai-core.min.js +5 -5
- package/dist/semiotic-ai-core.module.min.js +4 -4
- package/dist/semiotic-ai.module.min.js +2 -2
- package/dist/semiotic-artifact.min.js +6 -6
- package/dist/semiotic-artifact.module.min.js +2 -2
- package/dist/semiotic-atlas-core.min.js +1 -1
- package/dist/semiotic-atlas-core.module.min.js +1 -1
- package/dist/semiotic-atlas-selection.module.min.js +1 -1
- package/dist/semiotic-client-cjs-shared.min.js +1023 -1023
- package/dist/semiotic-evidence.min.js +4 -4
- package/dist/semiotic-evidence.module.min.js +3 -3
- package/dist/semiotic-experimental-auxiliary.module.min.js +1 -1
- package/dist/semiotic-experimental-node-auxiliary.module.min.js +1 -1
- package/dist/semiotic-experimental-react-shared.module.min.js +1 -1
- package/dist/semiotic-experimental-vacp.min.js +1 -1
- package/dist/semiotic-experimental-vacp.module.min.js +1 -1
- package/dist/semiotic-line.module.min.js +1 -1
- package/dist/semiotic-realtime-core.module.min.js +1 -1
- package/dist/semiotic-recipes-core-cjs-base.min.js +101 -101
- package/dist/semiotic-recipes-core.module.min.js +1 -1
- package/dist/semiotic-server-edge-node.module.min.js +3 -3
- package/dist/semiotic-server-edge.min.js +397 -397
- package/dist/semiotic-server-edge.module.min.js +3 -3
- package/dist/semiotic-server-node.min.js +397 -397
- package/dist/semiotic-utils-core.min.js +11 -11
- package/dist/semiotic-utils-core.module.min.js +3 -3
- package/dist/semiotic.module.min.js +1 -1
- package/dist/server.min.js +397 -397
- package/dist/server.module.min.js +3 -3
- package/dist/xy.module.min.js +1 -1
- package/package.json +2 -2
- package/dist/c-3OBJLOXI.min.js +0 -1
- package/dist/c-4VFGNUWG.min.js +0 -1
- package/dist/c-5BN7GWJH.min.js +0 -1
- package/dist/c-65GMYND6.min.js +0 -1
- package/dist/c-AGRMJIUH.min.js +0 -1
- package/dist/c-BJKGYOPX.min.js +0 -1
- package/dist/c-C332PFY6.min.js +0 -1
- package/dist/c-DDZ5TZ7P.min.js +0 -1
- package/dist/c-F4DZ3NMI.min.js +0 -1
- package/dist/c-GZJ2XEQ5.min.js +0 -1
- package/dist/c-HFQ3Z65X.min.js +0 -1
- package/dist/c-HNW73MXJ.min.js +0 -1
- package/dist/c-HWFZB7SD.min.js +0 -1
- package/dist/c-IIV4DB7T.min.js +0 -1
- package/dist/c-J2QH3PEI.min.js +0 -1
- package/dist/c-JZNWRFVJ.min.js +0 -2
- package/dist/c-KHLBCSIO.min.js +0 -1
- package/dist/c-L7FQHKGH.min.js +0 -1
- package/dist/c-LYPOBMKC.min.js +0 -1
- package/dist/c-NGMMPKNJ.min.js +0 -1
- package/dist/c-NOME4L5M.min.js +0 -1
- package/dist/c-OKIJBK5K.min.js +0 -2
- package/dist/c-OXV4W7YX.min.js +0 -1
- package/dist/c-P73SQZEP.min.js +0 -1
- package/dist/c-PD5EZI24.min.js +0 -1
- package/dist/c-RAL7HCTV.min.js +0 -1
- package/dist/c-S4OGXAVO.min.js +0 -1
- package/dist/c-UWE3VZEO.min.js +0 -1
- package/dist/c-VP7WX6QI.min.js +0 -1
- package/dist/c-VW7ZSLDC.min.js +0 -1
- package/dist/c-WDVYLMCM.min.js +0 -1
- package/dist/c-XEACLH4B.min.js +0 -1
- package/dist/c-YJDGSPNB.min.js +0 -1
- package/dist/c-ZYBEKQCT.min.js +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use strict";async function e(e,i){const{format:o="png",filename:n="chart",scale:s=2,background:c="white"}=i||{},l=e.querySelector("svg[data-semiotic-overlay]")||e.querySelector('svg[role="img"]')||e.querySelector("svg");if(!l)throw new Error("No SVG element found in the container");const u=l.cloneNode(!0);if("presentation"===u.getAttribute("role")){u.setAttribute("role","img");const e=l.closest('[role="img"]')?.getAttribute("aria-label");e&&u.setAttribute("aria-label",e)}const d=l.getBoundingClientRect();if(u.getAttribute("width")||u.setAttribute("width",String(d.width)),u.getAttribute("height")||u.setAttribute("height",String(d.height)),u.getAttribute("xmlns")||u.setAttribute("xmlns","http://www.w3.org/2000/svg"),r(l,u),"svg"===o){const e=(new XMLSerializer).serializeToString(u);a(new Blob([e],{type:"image/svg+xml;charset=utf-8"}),`${n}.svg`)}else{const i=d.width*s,o=d.height*s,l=document.createElement("canvas");l.width=i,l.height=o;const h=l.getContext("2d");h.fillStyle=c,h.fillRect(0,0,i,o),h.scale(s,s);const p=e.querySelector("canvas");if(p){for(const e of Array.from(p.parentElement.children)){if(e===p)break;if(e instanceof SVGSVGElement){const a=e.cloneNode(!0);a.setAttribute("xmlns","http://www.w3.org/2000/svg");const i=e.getBoundingClientRect();a.setAttribute("width",String(i.width)),a.setAttribute("height",String(i.height)),r(e,a),await t(h,a,i.x-d.x,i.y-d.y)}}h.drawImage(p,0,0,d.width,d.height)}await t(h,u,0,0),await new Promise((e,t)=>{l.toBlob(r=>{r?(a(r,`${n}.png`),e()):t(new Error("Failed to create PNG blob"))},"image/png")})}}async function t(e,t,r,a){const i=new Blob([(new XMLSerializer).serializeToString(t)],{type:"image/svg+xml;charset=utf-8"}),o=URL.createObjectURL(i);try{const i=new Image;i.width=Number(t.getAttribute("width")),i.height=Number(t.getAttribute("height")),await new Promise((e,t)=>{i.onload=()=>e(),i.onerror=()=>t(new Error("Failed to load SVG image")),i.src=o}),e.drawImage(i,r,a)}finally{URL.revokeObjectURL(o)}}function r(e,t){const a=e.children,i=t.children,o=window.getComputedStyle(e),n=["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 n){const r=o.getPropertyValue(e);r&&"none"!==r&&""!==r&&t.style?.setProperty(e,r)}for(let e=0;e<Math.min(a.length,i.length);e++)r(a[e],i[e])}function a(e,t){const r=URL.createObjectURL(e),a=document.createElement("a");a.href=r,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(r)}function i(e){let t=e.replace(/^#/,"");/^[a-f\d]{3}$/i.test(t)&&(t=t.split("").map(e=>e+e).join(""));const r=t.match(/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i);if(!r)return null;const[a,i,o]=[parseInt(r[1],16)/255,parseInt(r[2],16)/255,parseInt(r[3],16)/255],n=e=>e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4);return.2126*n(a)+.7152*n(i)+.0722*n(o)}function o(e,t){const r=i(e),a=i(t);return null===r||null===a?null:(Math.max(r,a)+.05)/(Math.min(r,a)+.05)}function n(e){return Object.prototype.hasOwnProperty.call(Xc,e)?function e(t){return Array.isArray(t)?t.map(e):null!==t&&"object"==typeof t?Object.fromEntries(Object.entries(t).map(([t,r])=>[t,e(r)])):t}(Xc[e]):void 0}function s(e){for(let t=0;t<e.length;t++){const r=e.charCodeAt(t);if(r<32||127===r)return!0}return!1}function c(e,t){("string"!=typeof e||s(e)||e.includes("<"))&&t();let r="",a="";for(let i=0;i<e.length;i++){const o=e[i];r?"\\"===o?++i===e.length&&t():o===r&&(r=""):'"'===o||"'"===o?(r=o,a+=" "):a+=o}return r&&t(),a}function l(e,t){const r=c(e,()=>{throw new TypeError(`Unsafe theme CSS in ${t}`)});if(/[>{};\\]|\/\*|\*\/|(?:url|expression)\s*\(/i.test(r))throw new TypeError(`Unsafe theme CSS in ${t}`)}function u(e){const t=c(e,()=>{throw new TypeError("Unsafe theme CSS selector")});if(!e.trim()||/[{};\\]|\/\*|\*\//.test(t))throw new TypeError("Unsafe theme CSS selector")}function d(e){const t={"--semiotic-bg":e.colors.background,"--semiotic-text":e.colors.text,"--semiotic-text-secondary":e.colors.textSecondary,"--semiotic-grid":e.colors.grid,"--semiotic-border":e.colors.border,"--semiotic-cell-border":e.colors.cellBorder||e.colors.border,"--semiotic-primary":e.colors.primary,"--semiotic-font-family":e.typography.fontFamily,"--semiotic-secondary":e.colors.secondary||e.colors.primary,"--semiotic-surface":e.colors.surface||e.colors.background};e.colors.categorical.forEach((e,r)=>{t[`--semiotic-category-${r+1}`]=e}),e.colors.focus&&(t["--semiotic-focus"]=e.colors.focus),e.colors.selection&&(t["--semiotic-selection-color"]=e.colors.selection),null!=e.colors.selectionOpacity&&(t["--semiotic-selection-opacity"]=String(e.colors.selectionOpacity)),e.colors.diverging&&(t["--semiotic-diverging"]=e.colors.diverging),e.colors.annotation&&(t["--semiotic-annotation-color"]=e.colors.annotation),e.colors.success&&(t["--semiotic-success"]=e.colors.success),e.colors.danger&&(t["--semiotic-danger"]=e.colors.danger),e.colors.warning&&(t["--semiotic-warning"]=e.colors.warning),e.colors.error&&(t["--semiotic-error"]=e.colors.error),e.colors.info&&(t["--semiotic-info"]=e.colors.info),e.tooltip?.background&&(t["--semiotic-tooltip-bg"]=e.tooltip.background),e.tooltip?.text&&(t["--semiotic-tooltip-text"]=e.tooltip.text),e.tooltip?.borderRadius&&(t["--semiotic-tooltip-radius"]=e.tooltip.borderRadius),e.tooltip?.fontSize&&(t["--semiotic-tooltip-font-size"]=e.tooltip.fontSize),e.tooltip?.shadow&&(t["--semiotic-tooltip-shadow"]=e.tooltip.shadow),e.borderRadius&&(t["--semiotic-border-radius"]=e.borderRadius);const r=e.typography.legendSize??e.typography.labelSize;null!=r&&(t["--semiotic-legend-font-size"]=`${r}px`),null!=e.typography.legendFontFamily&&(t["--semiotic-legend-font-family"]=e.typography.legendFontFamily),null!=e.typography.legendFontWeight&&(t["--semiotic-legend-font-weight"]=String(e.typography.legendFontWeight));const a=e.typography.titleFontSize??e.typography.titleSize;null!=a&&(t["--semiotic-title-font-size"]=`${a}px`),null!=e.typography.titleFontFamily&&(t["--semiotic-title-font-family"]=e.typography.titleFontFamily),null!=e.typography.titleFontWeight&&(t["--semiotic-title-font-weight"]=String(e.typography.titleFontWeight)),null!=e.typography.tickFontFamily&&(t["--semiotic-tick-font-family"]=e.typography.tickFontFamily),null!=e.typography.tickSize&&(t["--semiotic-tick-font-size"]=`${e.typography.tickSize}px`),null!=e.typography.labelSize&&(t["--semiotic-axis-label-font-size"]=`${e.typography.labelSize}px`);for(const[e,r]of Object.entries(t))l(r,e);return t}function h(e,t=":root"){return u(t),`${t} {\n${Object.entries(d(e)).map(([e,t])=>` ${e}: ${t};`).join("\n")}\n}`}function p(e){return{semiotic:{mode:{$value:e.mode,$type:"string"},bg:{$value:e.colors.background,$type:"color"},text:{$value:e.colors.text,$type:"color"},"text-secondary":{$value:e.colors.textSecondary,$type:"color"},grid:{$value:e.colors.grid,$type:"color"},border:{$value:e.colors.border,$type:"color"},primary:{$value:e.colors.primary,$type:"color"},...null!=e.colors.focus?{focus:{$value:e.colors.focus,$type:"color"}}:{},...null!=e.colors.cellBorder?{"cell-border":{$value:e.colors.cellBorder,$type:"color"}}:{},"font-family":{$value:e.typography.fontFamily,$type:"fontFamily"},"title-size":{$value:`${e.typography.titleSize}px`,$type:"dimension"},...null!=e.borderRadius?{"border-radius":{$value:e.borderRadius,$type:"dimension"}}:{},...null!=e.tooltip?{tooltip:{...null!=e.tooltip.background?{bg:{$value:e.tooltip.background,$type:"color"}}:{},...null!=e.tooltip.text?{text:{$value:e.tooltip.text,$type:"color"}}:{},...null!=e.tooltip.borderRadius?{radius:{$value:e.tooltip.borderRadius,$type:"dimension"}}:{},...null!=e.tooltip.fontSize?{"font-size":{$value:e.tooltip.fontSize,$type:"dimension"}}:{},...null!=e.tooltip.shadow?{shadow:{$value:e.tooltip.shadow,$type:"shadow"}}:{},...null!=e.tooltip.chrome?{chrome:{$value:e.tooltip.chrome,$type:"string"}}:{}}}:{},...null!=e.colors.selection||null!=e.colors.selectionOpacity?{selection:{...null!=e.colors.selection?{color:{$value:e.colors.selection,$type:"color"}}:{},...null!=e.colors.selectionOpacity?{opacity:{$value:e.colors.selectionOpacity,$type:"number"}}:{}}}:{},...null!=e.accessibility?{accessibility:Object.fromEntries(Object.entries(e.accessibility).map(([e,t])=>[e,{$value:t,$type:"boolean"}]))}:{},categorical:{$value:[...e.colors.categorical],$type:"color",$description:"Categorical color palette"},sequential:{$value:e.colors.sequential,$type:"string",$description:"d3-scale-chromatic sequential scheme name"},...e.aesthetics?{aesthetics:{...e.aesthetics.name?{profile:{$value:e.aesthetics.name,$type:"string"}}:{},...null!=e.aesthetics.minimumScore?{"minimum-score":{$value:e.aesthetics.minimumScore,$type:"number"}}:{},weights:Object.fromEntries(Object.entries(e.aesthetics.weights??{}).map(([e,t])=>[e,{$value:t,$type:"number"}])),thresholds:Object.fromEntries(Object.entries(e.aesthetics.thresholds??{}).map(([e,t])=>[e,{$value:t,$type:"number"}])),rationales:Object.fromEntries(Object.entries(e.aesthetics.rationales??{}).map(([e,t])=>[e,{$value:t,$type:"string"}]))}}:{},...e.colors.diverging?{diverging:{$value:e.colors.diverging,$type:"string",$description:"d3-scale-chromatic diverging scheme name"}}:{},...e.colors.annotation?{"annotation-color":{$value:e.colors.annotation,$type:"color"}}:{},...null!=e.typography.legendSize?{"legend-font-size":{$value:`${e.typography.legendSize}px`,$type:"dimension"}}:{},...null!=e.typography.legendFontFamily?{"legend-font-family":{$value:e.typography.legendFontFamily,$type:"fontFamily"}}:{},...null!=e.typography.legendFontWeight?{"legend-font-weight":{$value:e.typography.legendFontWeight,$type:"fontWeight"}}:{},...null!=e.typography.titleFontSize?{"title-font-size":{$value:`${e.typography.titleFontSize}px`,$type:"dimension"}}:{},...null!=e.typography.titleFontFamily?{"title-font-family":{$value:e.typography.titleFontFamily,$type:"fontFamily"}}:{},...null!=e.typography.titleFontWeight?{"title-font-weight":{$value:e.typography.titleFontWeight,$type:"fontWeight"}}:{},...null!=e.typography.tickFontFamily?{"tick-font-family":{$value:e.typography.tickFontFamily,$type:"fontFamily"}}:{},...null!=e.typography.tickSize?{"tick-font-size":{$value:`${e.typography.tickSize}px`,$type:"dimension"}}:{},...null!=e.typography.labelSize?{"axis-label-font-size":{$value:`${e.typography.labelSize}px`,$type:"dimension"}}:{},...null!=e.colors.secondary?{secondary:{$value:e.colors.secondary,$type:"color"}}:{},...null!=e.colors.surface?{surface:{$value:e.colors.surface,$type:"color"}}:{},...e.colors.success?{success:{$value:e.colors.success,$type:"color"}}:{},...e.colors.danger?{danger:{$value:e.colors.danger,$type:"color"}}:{},...e.colors.warning?{warning:{$value:e.colors.warning,$type:"color"}}:{},...e.colors.error?{error:{$value:e.colors.error,$type:"color"}}:{},...e.colors.info?{info:{$value:e.colors.info,$type:"color"}}:{}}}}function f(e){return Math.min(255,Math.max(0,Math.round(e)))}function m(e){if("string"!=typeof e)return null;const t=e.trim().toLowerCase(),r=t.match(/^#([a-f\d]{3,4}|[a-f\d]{6}|[a-f\d]{8})$/i)?.[1];if(r){const e=r.length<=4?r.split("").map(e=>`${e}${e}`).join(""):r;return{r:Number.parseInt(e.slice(0,2),16),g:Number.parseInt(e.slice(2,4),16),b:Number.parseInt(e.slice(4,6),16),a:8===e.length?Number.parseInt(e.slice(6,8),16)/255:1}}const a=t.match(/^(rgba?|hsla?)\(([^()]*)\)$/);if(!a)return null;const i=a[2].includes(","),o=a[2].split("/");if(o.length>2||i&&o.length>1)return null;const n=i?a[2].split(",").map(e=>e.trim()):o[0].trim().split(/\s+/);if(!i){if(3!==n.length)return null;2===o.length&&n.push(o[1].trim())}if(3!==n.length&&4!==n.length)return null;const s=(e,t)=>/^[+-]?(?:\d+\.?\d*|\.\d+)%?$/.test(e)?parseFloat(e)*(e.endsWith("%")?t/100:1):NaN,c=void 0===n[3]?1:s(n[3],1);let l;if(a[1].startsWith("hsl")){const e=n[0].match(/^([+-]?(?:\d+\.?\d*|\.\d+))(deg|grad|rad|turn)?$/);if(!e||!n[1].endsWith("%")||!n[2].endsWith("%"))return null;const t=(Number(e[1])*("turn"===e[2]?360:"rad"===e[2]?180/Math.PI:"grad"===e[2]?.9:1)%360+360)%360/60,r=s(n[1],1),a=s(n[2],1);if(!Number.isFinite(t)||r<0||r>1||a<0||a>1)return null;const i=(1-Math.abs(2*a-1))*r,o=i*(1-Math.abs(t%2-1)),c=a-i/2;l=(t<1?[i,o,0]:t<2?[o,i,0]:t<3?[0,i,o]:t<4?[0,o,i]:t<5?[o,0,i]:[i,0,o]).map(e=>255*(e+c))}else l=n.slice(0,3).map(e=>s(e,255));return l.some(e=>!Number.isFinite(e)||e<0||e>255)||!Number.isFinite(c)||c<0||c>1?null:{r:l[0],g:l[1],b:l[2],a:c}}function g(e,t){return t.a<1?null:{r:f(e.r*e.a+t.r*(1-e.a)),g:f(e.g*e.a+t.g*(1-e.a)),b:f(e.b*e.a+t.b*(1-e.a)),a:1}}function y(e){return e.a<1?null:`#${[e.r,e.g,e.b].map(e=>f(e).toString(16).padStart(2,"0")).join("")}`}function b(e){if("string"!=typeof e||""===e.trim())return;const t=m(e);return t?y(t)??`rgba(${f(t.r)},${f(t.g)},${f(t.b)},${t.a})`:e.trim().toLowerCase()}function v(e){if(null==e)return()=>{};const t="function"==typeof e?e:t=>t[e];return e=>x(t(e))}function w(e,t){const r=v(e),a=v(t);return(e,t)=>{const i=a(e);return{value:i,x:r(e),y:i,category:t}}}function A(e,t){const r=v(t??"value"),a=null==e?void 0:"function"==typeof e?e:t=>t[e];return e=>{const t=a?a(e):void 0;return{value:r(e),category:null==t?void 0:String(t)}}}function x(e){if("number"==typeof e)return Number.isFinite(e)?e:void 0;if("string"==typeof e&&""!==e.trim()){const t=Number(e);return Number.isFinite(t)?t:void 0}}function $(e,t,r){const a=null!=e.axis?r[e.axis]:null!=e.field?t[e.field]:r.value;if(void 0!==e.eq&&a!==e.eq)return!1;if(void 0!==e.ne&&a===e.ne)return!1;if(void 0!==e.in&&!e.in.includes(a))return!1;if(void 0===e.gt&&void 0===e.gte&&void 0===e.lt&&void 0===e.lte&&void 0===e.within&&void 0===e.outside)return!0;const i=x(a);if(void 0===i)return!1;if(void 0!==e.gt&&!(i>e.gt))return!1;if(void 0!==e.gte&&!(i>=e.gte))return!1;if(void 0!==e.lt&&!(i<e.lt))return!1;if(void 0!==e.lte&&!(i<=e.lte))return!1;if(void 0!==e.within){const[t,r]=e.within;if(!(i>=t&&i<=r))return!1}if(void 0!==e.outside){const[t,r]=e.outside;if(!(i<t||i>r))return!1}return!0}function C(e,t,r){const a=e.when;return void 0===a||!0===a||!1!==a&&("function"==typeof a?a(t,r):$(a,t,r))}function S(e,t,r){if(!t||0===t.length)return{};let a={};for(const i of t){if(!C(i,e,r))continue;const t="function"==typeof i.style?i.style(e,r):i.style;t&&(a={...a,...t})}return a}function k(e,t,r,a=e=>e){const i=e??(()=>({}));return t&&0!==t.length?(e,o)=>{const n=a(e),s={...i(e,o)};return Object.assign(s,S(n,t,r(n,o))),s}:i}function R(e,t,r){return e&&0!==e.length?(a,i)=>{const o=S(a,e,t(a,i)),n=r?r(a,i):void 0;return n?{...o,...n}:o}:r}function P(e,t){let r=1/0,a=-1/0;for(const i of e){const e=t?t(i):i;e<r&&(r=e),e>a&&(a=e)}return[r,a]}function E(e,t=1/0){let r=t;for(const t of e)t<r&&(r=t);return r}function N(e,t,r){const a=m(e),i=m(t);if(!a||!i)return null;const o=g({...a,a:a.a*Math.min(1,Math.max(0,r))},i);return o?y(o):null}function T(e){const t=m(e.backgroundColor),r=t?y(t):null,a=N(e.scaffoldColor,e.backgroundColor,e.scaffoldOpacity??1),i=a&&r?o(a,r):null,n=e.dataColors.map(t=>N(t,e.backgroundColor,1)).map(e=>e&&r?o(e,r):null).filter(e=>null!==e);if(null===i||n.length!==e.dataColors.length||0===n.length)return{ok:!0,status:"manual",method:"mark-to-scaffold-contrast",finding:{code:"VISUAL_HIERARCHY_MANUAL",status:"manual",message:"Visual hierarchy could not be computed from the supplied colors.",fix:"Resolve CSS variables, gradients, or named colors to solid colors and run the audit again."}};const s=E(n),c=s/i,l={weakestDataContrast:s,scaffoldContrast:i,hierarchyRatio:c},u=Math.max(1,e.minimumScaffoldContrast??1.1),d=Math.max(u,e.maximumScaffoldContrast??2),h=Math.max(1,e.minimumHierarchyRatio??2);return s<3?{ok:!1,status:"warn",method:"mark-to-scaffold-contrast",evidence:l,finding:{code:"DATA_MARK_CONTRAST",status:"warn",message:"Primary data marks have contrast below 3:1 against the background.",fix:"Increase data-mark contrast against the background before adjusting grids or guides."}}:i<u?{ok:!1,status:"warn",method:"mark-to-scaffold-contrast",evidence:l,finding:{code:"SCAFFOLD_VISIBILITY",status:"warn",message:"Reference scaffolding may be too faint to remain useful.",fix:"Increase grid or guide contrast while keeping it below the primary data marks."}}:s>=3&&i<=d&&c>=h?{ok:!0,status:"pass",method:"mark-to-scaffold-contrast",evidence:l,finding:{code:"SCAFFOLD_DOMINANCE",status:"pass",message:"Primary data marks lead while reference scaffolding remains visible and subordinate."}}:{ok:!1,status:"warn",method:"mark-to-scaffold-contrast",evidence:l,finding:{code:"SCAFFOLD_DOMINANCE",status:"warn",message:"Reference scaffolding competes with the primary data marks.",fix:"Increase mark contrast or lighten grid and guide colors until marks have at least twice the scaffold contrast."}}}function I(e){return Math.min(1,Math.max(0,e))}function M(e,t){return Number.isFinite(e)?e:t}function O(e){const t=e.thresholds??{},r=Math.max(1,M(t.scaffoldContrastMin,Qc.scaffoldContrastMin)),a=I(M(t.emphasisRatioMin,Qc.emphasisRatioMin));return{hierarchyRatio:Math.max(1,M(t.hierarchyRatio,Qc.hierarchyRatio)),scaffoldContrastMin:r,scaffoldContrastMax:Math.max(r,M(t.scaffoldContrastMax,Qc.scaffoldContrastMax)),titleScaleRatio:Math.max(1.01,M(t.titleScaleRatio,Qc.titleScaleRatio)),categoricalColorMax:Math.max(1,Math.round(M(t.categoricalColorMax,Qc.categoricalColorMax))),emphasisRatioMin:a,emphasisRatioMax:Math.max(a,I(M(t.emphasisRatioMax,Qc.emphasisRatioMax)))}}function j(e){return b(e)}function F(e){return(Array.isArray(e)?e:e&&"object"==typeof e?Object.values(e):[e]).map(j).filter(e=>!!e)}function z(e){return Array.isArray(e)||e&&"object"==typeof e?F(e):[]}function L(e){return!(e.length<4)&&rl.some(t=>e.length===t.length&&e.every((e,r)=>e===t[r]))}function B(e){const t=e.frameProps&&"object"==typeof e.frameProps&&e.frameProps.pieceStyle&&"object"==typeof e.frameProps.pieceStyle?e.frameProps.pieceStyle:void 0,r=[...z(e.colorScheme),...F(e.color),...F(e.fill),...F(e.stroke),...F(t?.fill),...F(t?.stroke)],a=Array.isArray(e.styleRules)?e.styleRules:[];for(const e of a)e.style&&"function"!=typeof e.style&&r.push(...F(e.style.fill),...F(e.style.stroke));return Array.from(new Set(r))}function D(e){const t=e.frameProps&&"object"==typeof e.frameProps&&e.frameProps.pieceStyle&&"object"==typeof e.frameProps.pieceStyle?e.frameProps.pieceStyle:void 0,r=[...z(e.colorScheme),...F(e.color),...F(e.fill),...F(t?.fill)],a=Array.isArray(e.styleRules)?e.styleRules:[];for(const e of a)e.style&&"function"!=typeof e.style&&r.push(...F(e.style.fill));return Array.from(new Set(r))}function _(e,t){const r=Array.isArray(e.data)?e.data:[];return"string"==typeof t?Array.from(new Set(r.map(e=>String(e[t])))):"function"==typeof t?Array.from(new Set(r.map((e,r)=>String(t(e,r))))):[]}function U(e){const t=Array.isArray(e.data)?e.data:[],r=Array.isArray(e.styleRules)?e.styleRules:[],a="string"==typeof e.valueAccessor?e.valueAccessor:"string"==typeof e.yAccessor?e.yAccessor:"value",i="string"==typeof e.categoryAccessor?e.categoryAccessor:"category",o=[];for(const e of r)e.style&&"function"!=typeof e.style&&t.some((t,r)=>C(e,t,{value:Number(t[a]),category:String(t[i]??""),index:r}))&&o.push(...F(e.style.fill));return Array.from(new Set(o))}function G(e,t,r){const a=z(t.colorScheme),i=F(t.color),o=_(t,t.colorBy),n=il.has(e)?_(t,t.categoryAccessor??"category"):[],s=t.colorScheme&&"object"==typeof t.colorScheme&&!Array.isArray(t.colorScheme)?t.colorScheme:void 0,c=(e,t)=>e.map((e,a)=>j(s?.[e])??("gray"===t?"#999999":r.colors.categorical.length>0?r.colors.categorical[a%r.colors.categorical.length]:"#007bff")),l=o.length>0?s?c(o,"gray"):a.length>0?a:r.colors.categorical:i.length>0?i:n.length>0&&s?c(n,"theme"):a.length>0&&!s?a:r.colors.categorical,u=Math.max(1,o.length||n.length||1),d=o.length>0||n.length>0?l.slice(0,Math.min(l.length,u)):l.slice(0,1),h=U(t).filter(e=>!d.includes(e));return Array.from(/* @__PURE__ */new Set([...d,...h]))}function V(e){const t=e.colors.surface??e.colors.background,r=m(t),a=m(e.colors.background);if(!r)return t;if(1===r.a)return y(r)??t;if(!a)return t;const i=g(r,a);return i?y(i)??t:t}function H(e,t){if(!e.evidence)return.5;const{weakestDataContrast:r,scaffoldContrast:a,hierarchyRatio:i}=e.evidence;return Math.min(I(r/3),I(a/t.scaffoldContrastMin),I(t.scaffoldContrastMax/a),I(i/t.hierarchyRatio))}function W(e,t,r,a,i,o,n){const s=r[e];return{id:e,label:ol[e],status:0===s?"disabled":n??(t>=.8?"pass":"warn"),score:t,weight:s,contribution:t*s,message:a,...o?.[e]?{rationale:o[e]}:{},evidence:i}}function q(e){return Math.max(1,e.length)}function Y(e){const t=Array.isArray(e.data)?e.data:[],r=Array.isArray(e.styleRules)?e.styleRules:[];if(0===t.length||0===r.length)return{ratio:0,authored:!1};const a="string"==typeof e.valueAccessor?e.valueAccessor:"string"==typeof e.yAccessor?e.yAccessor:"value",i="string"==typeof e.categoryAccessor?e.categoryAccessor:"category";return{ratio:t.filter((e,t)=>r.some(r=>C(r,e,{value:Number(e[a]),category:String(e[i]??""),index:t}))).length/t.length,authored:!0}}function K(e,t,r={}){const a=r.theme??Wc,i=r.profile??a.aesthetics??el,o={...Zc,...i.weights??{}};for(const e of Object.keys(o)){const t=o[e];o[e]=Number.isFinite(t)?Math.max(0,t):0}const n=O(i),s=G(e,t,a),c=T({backgroundColor:V(a),dataColors:s,scaffoldColor:a.colors.grid,minimumHierarchyRatio:n.hierarchyRatio,minimumScaffoldContrast:n.scaffoldContrastMin,maximumScaffoldContrast:n.scaffoldContrastMax}),l=B(t),u=L(a.colors.categorical.map(j).filter(e=>!!e)),d=D(t),h="string"==typeof t.colorScheme?t.colorScheme.trim().toLowerCase():void 0,p=d.length>0||h?"chart":"theme",f="chart"===p?L(d)||!!h&&al.has(h):u,m=f?.2:"chart"===p?1:.8,g=q(s),y=g<=n.categoricalColorMax?1:I(1-(g-n.categoricalColorMax)/n.categoricalColorMax),b=a.typography.titleFontSize??a.typography.titleSize,v=Math.max(a.typography.tickSize,a.typography.labelSize),w=v>0?b/v:1,A=I((w-1)/(n.titleScaleRatio-1)),x=new Set([...a.colors.categorical,a.colors.primary,a.colors.secondary,a.colors.background,a.colors.surface,a.colors.text,a.colors.textSecondary,a.colors.grid,a.colors.border,a.colors.annotation].map(j).filter(e=>!!e)),$=l.filter(e=>!x.has(e)).length,C=0===l.length?1:I(1-$/l.length),S=Y(t),k=S.authored?S.ratio<n.emphasisRatioMin?I(S.ratio/n.emphasisRatioMin):S.ratio<=n.emphasisRatioMax?1:I(n.emphasisRatioMax/S.ratio):.35,R=[W("mark-scaffold-hierarchy",H(c,n),o,c.finding.message,{hierarchyRatio:c.evidence?.hierarchyRatio??0,markContrast:c.evidence?.weakestDataContrast??0,scaffoldContrast:c.evidence?.scaffoldContrast??0},i.rationales,c.status),W("palette-authorship",m,o,f?"theme"===p?"The chart inherits a ubiquitous categorical default without an organizational palette decision.":"The chart explicitly selects a ubiquitous categorical palette.":"The effective palette records an authored choice beyond the ubiquitous defaults.",{paletteSource:p,ubiquitousDefault:f,colorCount:s.length},i.rationales),W("palette-economy",y,o,`${g} color role(s) are used against a policy ceiling of ${n.categoricalColorMax}.`,{colorRoles:g,maximum:n.categoricalColorMax},i.rationales),W("typographic-hierarchy",A,o,`Title-to-supporting-type scale is ${w.toFixed(2)}×.`,{titleSize:b,supportingSize:v,ratio:w},i.rationales),W("theme-coherence",C,o,`${$} of ${l.length} explicit chart color(s) fall outside the theme vocabulary.`,{explicitColors:l.length,outsideTheme:$},i.rationales),W("editorial-emphasis",k,o,S.authored?`${Math.round(100*S.ratio)}% of marks receive authored emphasis.`:"No machine-visible editorial emphasis rule is declared.",{authored:S.authored,emphasizedRatio:S.ratio},i.rationales)],P=R.reduce((e,t)=>e+t.weight,0),E=R.reduce((e,t)=>e+t.contribution,0),N=0===P?null:E/P*100,F=100*I(M(i.minimumScore,el.minimumScore??70)/100);return{component:e,profile:i.name??"Unnamed aesthetic profile",ok:null===N||N>=F,score:N,minimumScore:F,weightedPoints:E,totalWeight:P,features:R,method:"weighted-machine-visible-features"}}function J(e){if(e.length<2)return"days";const t=[];for(let r=1;r<e.length;r++)t.push(e[r]-e[r-1]);t.sort((e,t)=>e-t);const r=t[Math.floor(t.length/2)];return r<2*nl?"seconds":r<2*sl?"minutes":r<2*cl?"hours":r<60*cl?"days":r<400*cl?"months":"years"}function X(e){return e<10?`0${e}`:String(e)}function Z(e={}){const t=e.timeZone;return"UTC"===t?{kind:"utc"}:"local"===t?{kind:"local"}:"string"==typeof t&&t.length>0?{kind:"iana",id:t}:!1===e.utc?{kind:"local"}:{kind:"utc"}}function Q(e,t){return t?{month:e.getUTCMonth(),day:e.getUTCDate(),year:e.getUTCFullYear(),hours:e.getUTCHours(),minutes:e.getUTCMinutes(),seconds:e.getUTCSeconds()}:{month:e.getMonth(),day:e.getDate(),year:e.getFullYear(),hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()}}function ee(e){let t;try{t=new Intl.DateTimeFormat("en-US",{timeZone:e,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hourCycle:"h23"})}catch{return e=>Q(e,!0)}return e=>{const r={};for(const a of t.formatToParts(e))"literal"!==a.type&&(r[a.type]=a.value);return{month:Math.max(0,(Number(r.month)||1)-1),day:Number(r.day)||1,year:Number(r.year)||1970,hours:Number(r.hour)||0,minutes:Number(r.minute)||0,seconds:Number(r.second)||0}}}function te(e,t,r,a=ul){const{month:i,day:o,year:n,hours:s,minutes:c,seconds:l}=r(e),u=ll[i],d=X(s),h=X(c),p=X(l),f=a.year?`${u} ${o}, ${n} `:`${u} ${o} `;switch(t){case"seconds":return`${a.date?f:""}${d}:${h}:${p}`;case"minutes":case"hours":return`${a.date?f:""}${d}:${h}`;case"days":return a.year?`${u} ${o}, ${n}`:`${u} ${o}`;case"months":return a.year?`${u} ${n}`:`${u}`;case"years":return`${n}`}}function re(e,t,r,a,i=ul,o=!1){const n=a(e),s=a(t),c=n.year!==s.year,l=c||n.month!==s.month,u=l||n.day!==s.day,d=u||n.hours!==s.hours,h=d||n.minutes!==s.minutes,p=i.date,f=c&&i.year,m=ll[n.month],{day:g,year:y}=n,b=X(n.hours),v=X(n.minutes),w=X(n.seconds);switch(r){case"seconds":return f&&p?`${m} ${g}, ${y} ${b}:${v}:${w}`:u&&p?`${m} ${g} ${b}:${v}:${w}`:d||o?`${b}:${v}:${w}`:h?`${v}:${w}`:`:${w}`;case"minutes":return f&&p?`${m} ${g}, ${y} ${b}:${v}`:u&&p?`${m} ${g} ${b}:${v}`:d||o?`${b}:${v}`:`:${v}`;case"hours":return f&&p?`${m} ${g}, ${y} ${b}:${v}`:u&&p?`${m} ${g} ${b}:${v}`:`${b}:${v}`;case"days":return f?`${m} ${g}, ${y}`:l||o?`${m} ${g}`:`${g}`;case"months":return f?`${m} ${y}`:`${m}`;case"years":return`${y}`}}function ae(e,t={}){let r,a=e;const i="utc"===(o=Z(t)).kind?e=>Q(e,!0):"local"===o.kind?e=>Q(e,!1):ee(o.id);var o;const{includeYear:n="always",includeDate:s="always"}=t,c="clock"===t.deltaStyle,l="auto"===n?i(new Date(t.referenceTime??Date.now())).year:void 0;let u,d={referenceYear:!1,oneDay:!1};const h=e=>{if(e!==u){u=e;const t=e.map(e=>i(new Date(e))),[r]=t;d={referenceYear:t.every(e=>e.year===l),oneDay:t.every(e=>e.year===r.year&&e.month===r.month&&e.day===r.day)}}return d};return(t,o,l)=>{const u=t instanceof Date?t:new Date(t);!e&&l&&l.length>=2&&l!==r&&(r=l,a=J(l));const p=a||"days";if(null==o||!l||0===l.length)return te(u,p,i);const f="seconds"===p||"minutes"===p||"hours"===p,m="always"===n&&"always"===s?ul:{year:"years"===p||"never"!==n,date:!f||"never"!==s};if(0===o){if(m===ul)return te(u,p,i);const{referenceYear:e,oneDay:t}="auto"===n||"auto"===s?h(l):d,r=m.date&&!(f&&"auto"===s&&t),a=r&&m.year&&!("years"!==p&&"auto"===n&&e);return te(u,p,i,{year:a||"years"===p,date:r})}return re(u,new Date(l[o-1]),p,i,m,c)}}function ie(e){if(null==e)return"";if("number"!=typeof e)return String(e);if(!isFinite(e))return String(e);if(0===e)return"0";const t=parseFloat(e.toPrecision(12)),r=Math.abs(t);if(r>=1e4)for(let e=dl.length-1;e>=0;e--){const[a,i]=dl[e];if(r<a)continue;const o=parseFloat((t/a).toPrecision(3));if(Math.abs(o)>=1e3&&e<dl.length-1){const[r,a]=dl[e+1];return`${parseFloat((t/r).toPrecision(3))}${a}`}return`${o}${i}`}return Number.isInteger(t)?String(t):String(parseFloat(t.toPrecision(6)))}function oe(e,t=0,r=1/0,a=0){const i=Number.isFinite(t)?t:0,o=Number.isFinite(r)?Math.max(i,r):1/0,n=Number.isFinite(e)?Math.floor(e):i,s=Math.max(i,Math.min(o,n));return a>0&&Number.isFinite(a)?Math.max(i,Math.min(o,Math.round(s/a)*a)):s}function ne(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function se(e){if(!("number"!=typeof e.height||e.height<=0))return e.width>=e.height?"landscape":"portrait"}function ce(e){if(!("number"!=typeof e.height||e.height<=0))return e.width/e.height}function le(e,t){const{when:r}=e,a=t.width,i=t.height,o=ce(t),n=se(t);return!("number"==typeof r.minWidth&&a<r.minWidth||"number"==typeof r.maxWidth&&a>r.maxWidth||"number"==typeof r.minHeight&&("number"!=typeof i||i<r.minHeight)||"number"==typeof r.maxHeight&&("number"!=typeof i||i>r.maxHeight)||"number"==typeof r.minAspectRatio&&("number"!=typeof o||o<r.minAspectRatio)||"number"==typeof r.maxAspectRatio&&("number"!=typeof o||o>r.maxAspectRatio)||r.orientation&&n!==r.orientation)}function ue(e,t){const r={...e,...t};for(const a of["margin","frameProps","mobileSemantics","style"])ne(e[a])&&ne(t[a])&&(r[a]={...e[a],...t[a]});return"string"==typeof e.className&&"string"==typeof t.className&&(r.className=`${e.className} ${t.className}`),r}function de(e,t,r=e.responsiveRules){if(!Array.isArray(r)||0===r.length)return{props:e,matches:[]};const a=r.map((e,t)=>({rule:e,index:t})).filter(e=>le(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:a.reduce((e,t)=>ue(e,t.rule.transform),e),matches:a}}function he(e,t={}){const r=t.mobileSemantics?.interaction,a="number"==typeof r?.targetSize?r.targetSize:"number"==typeof t.mobileSemantics?.minimumHitTarget?t.mobileSemantics.minimumHitTarget:void 0,i="mobile"===t.mode||"number"==typeof t.width&&t.width<=480,o=!!r||void 0!==a,n=e&&"object"==typeof e?e:void 0;if(!1===e||!1===n?.enabled||void 0===e&&!i&&!o)return pl;const s=n??{};return{enabled:!0,tapToSelect:s.tapToSelect??!0,tapToLockTooltip:s.tapToLockTooltip??!0,clearSelection:s.clearSelection??"backgroundTap",targetSize:s.targetSize??a??hl,snap:s.snap??"nearestDatum",brushHandleSize:s.brushHandleSize??hl,standardControls:s.standardControls??!1}}function pe(e,t,r){const a=fl[e||"primary"],i=e&&"primary"!==e||!r?.width?a.width:r.width,o=e&&"primary"!==e||!r?.height?a.height:r.height,n=de({...t,mode:e},{width:t.width??i,height:t.height??o}).props,s=n.mode||e||"primary",c=fl[s],l="context"===s||"sparkline"===s,u="primary"===s&&r?.width?r.width:c.width,d="primary"===s&&r?.height?r.height:c.height;return{mode:s,width:n.width??u,height:n.height??d,showAxes:n.showAxes??c.showAxes,showGrid:n.showGrid??c.showGrid,enableHover:n.enableHover??(!!n.linkedHover||c.enableHover),showLegend:n.showLegend??c.showLegend,showLabels:n.showLabels??c.showLabels,title:l?void 0:n.title,description:n.description,summary:n.summary,accessibleTable:n.accessibleTable,xLabel:l?void 0:n.xLabel,yLabel:l?void 0:n.yLabel,categoryLabel:l?void 0:n.categoryLabel,valueLabel:l?void 0:n.valueLabel,marginDefaults:fe(c.marginDefaults,n.showCategoryTicks,n.orientation),compactMode:l,mobileInteraction:he(n.mobileInteraction,{mode:s,width:n.width??u,mobileSemantics:n.mobileSemantics}),mobileSemantics:n.mobileSemantics}}function fe(e,t,r){if(!1!==t)return e;const a={...e};return"horizontal"===r?a.left=Math.min(a.left,15):a.bottom=Math.min(a.bottom,15),a}function me(e){const t=ge(e);return(e.height||vl)+(e.margin?.top??t.top)+(e.margin?.bottom??t.bottom)}function ge(e){const t=e.handles&&"object"==typeof e.handles?e.handles:e.handles?{}:null,r="number"==typeof t?.size&&Number.isFinite(t.size)?t.size:12;return{top:t?.move?Math.ceil(bl(r)/2)+2:0,bottom:e.showExtentLabels?34:20}}function ye(e,t={}){if("BigNumber"===e){const e=t,r=e.mode&&Object.hasOwn(ml,e.mode)?ml[e.mode]:ml.tile;return{width:e.width??r.width,height:e.height??r.height}}if(!Object.hasOwn(yl,e))throw new Error(`Unknown chart: ${e}`);const r=t;if("ScatterplotMatrix"===e){const e=r.fields?.length??0,t=gl.labelWidth+e*((r.cellSize??gl.cellSize)+(r.cellGap??gl.cellGap));return{width:t,height:t}}const a=(i=e,["MinimapChart","ProcessSankey","ChainReactionChart","DependencyForestChart","FlowCircuitChart"].includes(i));var i;const o=["GaltonBoardChart","UnitPileChart","CollisionSwarmChart","EventDropChart","PacketFlowChart","ProcessFlowChart","PhysicsCustomChart","GauntletChart","CrucibleChart"].includes(e),n=o||e.startsWith("Realtime")||"TemporalHistogram"===e?r.size:void 0,s=pe("Sparkline"===e?"sparkline":a?void 0:"string"==typeof(c=r.mode)&&Object.prototype.hasOwnProperty.call(fl,c)?r.mode:void 0,{width:!o&&n?n[0]:r.width,height:!o&&n?n[1]:r.height,responsiveRules:a?void 0:r.responsiveRules},yl[e]);var c;let l=n?n[0]:s.width,u=n?n[1]:s.height;return r.responsiveWidth&&void 0!==r.containerSize?.width&&(l=oe(r.containerSize.width)),r.responsiveHeight&&void 0!==r.containerSize?.height&&(u=oe(r.containerSize.height)),"MinimapChart"===e&&(u+=me(r.minimap??{})),(o||"ChainReactionChart"===e||"FlowCircuitChart"===e)&&(l=Math.max(1,l),u=Math.max(1,u)),{width:l,height:u}}function be(e,t=.5){const r=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e);if(!r)return e;const a=Math.round(parseInt(r[1],16)*(1-t)),i=Math.round(parseInt(r[2],16)*(1-t)),o=Math.round(parseInt(r[3],16)*(1-t));return`#${a.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}`}function ve(e,t=.5){const r=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e);if(!r)return e;const a=Math.round(parseInt(r[1],16)+(255-parseInt(r[1],16))*t),i=Math.round(parseInt(r[2],16)+(255-parseInt(r[2],16))*t),o=Math.round(parseInt(r[3],16)+(255-parseInt(r[3],16))*t);return`#${a.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}`}function we(e){const t=Number.isFinite(e)&&e>0?e:6;return{width:Math.max(8,t),height:t,lineY:t/2}}function Ae(e){return{type:"hatch",background:e.background,stroke:e.stroke,lineWidth:e.lineWidth,spacing:e.spacing,angle:e.angle,...1!==e.lineOpacity?{lineOpacity:e.lineOpacity}:{}}}function xe(){const e="undefined"!=typeof window&&window.devicePixelRatio||1;return Math.min(3,Math.max(1,e))}function $e(e,t,r,a){t&&"transparent"!==t&&"none"!==t?(e.fillStyle=t,e.fillRect(0,0,r,a)):e.clearRect(0,0,r,a)}function Ce(e={},t){const{background:r="transparent",stroke:a="#000",lineWidth:i=1.5,spacing:o=6,angle:n=45,lineOpacity:s=1}=e,c={background:r,stroke:a,lineWidth:i,spacing:o,angle:n,lineOpacity:s},l=we(o),u=xe(),d=Math.max(1,Math.round(l.width*u)),h=Math.max(1,Math.round(l.height*u));let p;try{f=d,m=h,p="undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(f,m):(wl||(wl=document.createElement("canvas")),wl.width=f,wl.height=m,wl)}catch{return Ae(c)}var f,m;const g=p.getContext("2d");if(!g)return Ae(c);$e(g,r,d,h);const y=h/l.height,b=Math.max(0,i)*y;g.save(),g.globalAlpha=Math.min(1,Math.max(0,s)),g.fillStyle=a,g.fillRect(0,l.lineY*y-b/2,d,b),g.restore();const v=(t||g).createPattern(p,"repeat");if(!v)return v;const w=n*Math.PI/180,A=Math.cos(w),x=Math.sin(w),$=l.width/d,C=l.height/h;return v.setTransform?.({a:A*$,b:x*$,c:-x*C,d:A*C,e:0,f:0}),v}function Se(e,t=2166136261){let r=t;for(let t=0;t<e.length;t++)r^=e.charCodeAt(t),r=Math.imul(r,16777619);return r>>>0}function ke(e){return"object"==typeof e&&null!==e&&"hatch"===e.type}function Re(e){return["hatch",e.background??"transparent",e.stroke??"#000",e.lineWidth??1.5,e.spacing??6,e.angle??45,e.lineOpacity??1].join("|")}function Pe(e,t){return`${e}-hatch-${Se(Re(t)).toString(36)}`}function Ee(e){return!(null===e||"object"!=typeof e||Array.isArray(e)||e instanceof Date||e instanceof Map||e instanceof Set)}function Ne(e){const t=(e.length<=3?Array.from(e):[e[0],e[Math.floor(e.length/2)],e[e.length-1]]).filter(Ee);return t.length?t:e.filter(Ee)}function Te(e){return[...new Set(Ne(e).flatMap(Object.keys))]}function Ie(e,t){const r=e.length,a=t.length,i=new Array(a+1);for(let e=0;e<=a;e++)i[e]=e;for(let o=1;o<=r;o++){let r=i[0];i[0]=o;for(let n=1;n<=a;n++){const a=i[n];i[n]=e[o-1]===t[n-1]?r:1+Math.min(r,i[n],i[n-1]),r=a}}return i[a]}function Me(e,t,r=3){let a,i=r+1;for(const r of t){const t=Ie(e.toLowerCase(),r.toLowerCase());t<i&&(i=t,a=r)}return i<=r?a:void 0}function Oe(e,t){if(0===t.length)return null;const r=e.toLowerCase();return t.find(e=>Math.min(e.length,r.length)>=3&&(e.toLowerCase().includes(r)||r.includes(e.toLowerCase())))||(Me(e,t,Math.min(3,Math.floor(e.length/2)))??null)}function je(e){return` Or use a function: ${e}={d => d.myValue}.`}function Fe(e,t,r,a){if(!r)return null;const i=[...new Set(t.flatMap(Object.keys))];for(const[t,o]of Object.entries(r))if(o&&"string"==typeof o&&!i.includes(o)){const r=Oe(o,i),n=r?` Try ${t}="${r}".`:"";return`${e}: ${t} "${o}" not found in ${a}. Available fields: ${i.join(", ")}.${n}`+je(t)}return null}function ze({componentName:e,data:t,accessors:r,requiredProps:a}){if(a)for(const[t,r]of Object.entries(a))if(null==r)return`${e}: ${t} is required. Provide a field name or function.`;if(null==t)return null;if(!Array.isArray(t)&&"object"==typeof t)return`${e}: data should be an array, but received an object. If this is hierarchical data, use TreeDiagram, Treemap, or CirclePack instead.`;if(!Array.isArray(t)||0===t.length)return`${e}: No data provided. Pass a non-empty array to the data prop.`;const i=Ne(t);return i.length?Fe(e,i,r,"data"):`${e}: No data records provided. Pass a non-empty array of objects to the data prop.`}function Le({componentName:e,data:t,dataLabel:r="data"}){return null==t?`${e}: No ${r} provided. Pass a hierarchical object with children: { name: "root", children: [...] }.`:Array.isArray(t)?`${e}: ${r} should be a single root object, not an array. Expected: { name: "root", children: [...] }. If you have flat data, use LineChart, BarChart, or Scatterplot instead.`:Ee(t)?null:`${e}: ${r} should be a hierarchical object with children: { name: "root", children: [...] }.`}function Be({componentName:e,nodes:t,edges:r,nodesRequired:a=!1,edgesRequired:i=!0,accessors:o}){if(null==t&&null==r)return null;if(i&&(!r||!Array.isArray(r)||0===r.length))return`${e}: No edges provided. Pass a non-empty array: edges={[{ source: "A", target: "B", value: 10 }, ...]}.`;if(a&&(!t||!Array.isArray(t)||0===t.length))return`${e}: No nodes provided. Pass a non-empty array: nodes={[{ id: "A" }, { id: "B" }, ...]}.`;for(const[a,i]of[["nodes",t],["edges",r]])if(null!=i&&(!Array.isArray(i)||i.length>0&&!Ne(i).length))return`${e}: ${a} should be an array containing data records.`;return o&&t&&t.length>0?Fe(e,Ne(t),o,"node data"):null}function De(e){return xl.has(e)}function _e(e){const[t,r]=Array.isArray(e)?e:[e,void 0],a=Cl[t],i=Array.isArray(a)?[...a]:a;return void 0===r?{type:i}:{type:i,enum:[...Sl[r]]}}function Ue(){return Object.fromEntries(Rl.map(([e,t,r,a,i],o)=>[Al[o],{required:[...e],dataShape:t,dataAccessors:[...r],props:Object.fromEntries(Object.entries(Object.assign({},...a.map(e=>kl[e]),i)).map(([e,t])=>[e,_e(t)]))}]))}function Ge(e){if(!Array.isArray(e))return[];const t=[];return e.forEach((e,r)=>{if(e&&"object"==typeof e&&!Array.isArray(e))for(const a of Object.keys(e)){if(Tl(a))continue;const i=e.orient;t.push({index:r,..."string"==typeof i&&{orient:i},key:a,suggestion:Me(a,Nl)})}}),t}function Ve(e,t){const r=Array.isArray(t)?t:[t],a=Array.isArray(e)?"array":typeof e;return r.includes(a)}function He(e,t){return"mechanical"===t.mode&&("GaltonBoardChart"===e||"UnitPileChart"===e)}function We(e){if(!Array.isArray(e.thresholds))return[];const t=[];return 0===e.thresholds.length&&t.push('"thresholds" for GaugeChart must contain at least one { value, color, label? } object.'),e.thresholds.forEach((e,r)=>{if(!e||"object"!=typeof e||Array.isArray(e))return void t.push(`"thresholds[${r}]" for GaugeChart should be an object with numeric "value" and string "color".`);const a=e;"number"==typeof a.value&&Number.isFinite(a.value)||t.push(`"thresholds[${r}].value" is required for GaugeChart and must be a finite number. BigNumber's "at" threshold key is not supported here.`),"string"==typeof a.color&&0!==a.color.length||t.push(`"thresholds[${r}].color" is required for GaugeChart and must be a non-empty string.`),void 0!==a.label&&"string"!=typeof a.label&&t.push(`"thresholds[${r}].label" for GaugeChart should be a string.`);const i=Object.keys(a).filter(e=>"value"!==e&&"color"!==e&&"label"!==e);i.length>0&&t.push(`"thresholds[${r}]" has unsupported GaugeChart key(s): ${i.join(", ")}. Use { value, color, label? }; { at, level } belongs to BigNumber.`)}),t}function qe(e){const t=e.frameProps;return null==t||"object"!=typeof t||Array.isArray(t)?[]:[...Ye(t.axes,"frameProps.axes"),...Ke(t)]}function Ye(e,t){return Ge(e).map(({index:e,key:r,suggestion:a})=>`Unknown "${t}[${e}]" key "${r}" is ignored.`+(a?` Did you mean "${a}"?`:""))}function Ke(e){const t=e.legendLayout;if(null==t||"object"!=typeof t||Array.isArray(t))return null==t?[]:['"frameProps.legendLayout" should be object, got '+(Array.isArray(t)?"array":typeof t)+"."];const r=[],a=t,i=/* @__PURE__ */new Set(["align",...Object.keys(Ml)]);for(const e of Object.keys(a))i.has(e)||r.push(`Unknown "frameProps.legendLayout" key "${e}". Valid keys: ${[...i].join(", ")}.`);void 0!==a.align&&"string"!=typeof a.align?r.push(`"frameProps.legendLayout.align" should be string, got ${Array.isArray(a.align)?"array":typeof a.align}.`):"string"!=typeof a.align||Il.has(a.align)||r.push(`"frameProps.legendLayout.align" value "${a.align}" is not valid. Expected one of: ${[...Il].join(", ")}.`);for(const[e,t]of Object.entries(Ml)){const i=a[e];void 0!==i&&("number"==typeof i&&Number.isFinite(i)?i<t.minimum&&r.push(`"frameProps.legendLayout.${e}" should be ${t.label} (minimum ${t.minimum}), got ${i}.`):r.push(`"frameProps.legendLayout.${e}" should be ${t.label}, got ${Array.isArray(i)?"array":typeof i}.`))}return r}function Je(e,t){const r=[];null!=t&&"object"==typeof t||(t={});const a=El[e];if(!a)return{valid:!1,errors:[`Unknown component "${e}". Valid components: ${Object.keys(El).join(", ")}`]};for(const i of a.required)void 0!==t[i]&&null!==t[i]||r.push(`"${i}" is required for ${e}.`);"array"!==a.dataShape||!Object.prototype.hasOwnProperty.call(a.props,"data")||a.required.includes("data")||He(e,t)||void 0!==t.data&&null!==t.data||r.push(`"data" is required for ${e}.`);for(const[e,i]of Object.entries(t)){if(null==i)continue;const t=Object.prototype.hasOwnProperty.call(a.props,e)?a.props[e]:void 0;if(t){if(!Ve(i,t.type)){const a=Array.isArray(t.type)?t.type.join(" | "):t.type;r.push(`"${e}" should be ${a}, got ${Array.isArray(i)?"array":typeof i}.`);continue}"width"!==e&&"height"!==e||"number"==typeof i&&Number.isFinite(i)&&!(i<=0)||r.push(`"${e}" must be a finite positive number.`),"size"!==e||!Array.isArray(i)||2===i.length&&Array.from(i).every(e=>"number"==typeof e&&Number.isFinite(e)&&e>0)||r.push('"size" must contain two finite positive dimensions.'),t.enum&&"string"==typeof i&&!t.enum.includes(i)&&r.push(`"${e}" value "${i}" is not valid. Expected one of: ${t.enum.join(", ")}.`)}}const i=Object.keys(a.props),o=new Set(i);for(const a of Object.keys(t))if(void 0!==t[a]&&!o.has(a)){const t=Me(a,i),o=t?`Unknown prop "${a}" for ${e}. Did you mean "${t}"?`:`Unknown prop "${a}" for ${e}. Valid props: ${i.join(", ")}.`;r.push(o)}if(o.has("axes")&&r.push(...Ye(t.axes,"axes")),"array"===a.dataShape){const i=t.data,o={};for(const e of a.dataAccessors){const r=t[e];"string"==typeof r&&(o[e]=r)}const n=ze({componentName:e,data:i,accessors:Object.keys(o).length>0?o:void 0});n&&r.push(n)}else if("object"===a.dataShape){const a=Le({componentName:e,data:t.data});a&&r.push(a)}else if("network"===a.dataShape){const i=t.nodeIdAccessor??t.nodeIDAccessor??"id",o="string"==typeof i?{nodeIdAccessor:i}:void 0,n=Be({componentName:e,nodes:t.nodes,edges:t.edges,nodesRequired:a.required.includes("nodes"),edgesRequired:a.required.includes("edges"),accessors:o});n&&r.push(n)}return"GaugeChart"===e&&r.push(...We(t)),"ScatterplotMatrix"===e&&null!=t.frameProps&&r.push('"frameProps" is not supported for ScatterplotMatrix; configure its matrix props directly.'),r.push(...qe(t)),{valid:0===r.length,errors:r}}function Xe(e){function t(){r=r+1831565813|0;let e=Math.imul(r^r>>>15,1|r);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}let r=e>>>0;return t.getState=()=>r>>>0,t}function Ze(e){if(null==e)return null;const t=e;return t.data??t.datum??e}function Qe(e){const t=Number(e);return Number.isFinite(t)?Math.max(0,t):0}function et(e,t={}){const r=[],a=e.tokenSemantics,i=e.countStrategy,o=t.maxRecommendedTokens??("fixed-denominator"===i&&Qe(e.denominator)<=jl?jl:Ol);return a||r.push({code:"TOKEN_SEMANTICS_UNCLEAR",severity:"warning",message:"Every tokenized encoding should state what one token represents."}),i||r.push({code:"MISSING_COUNT_STRATEGY",severity:"warning",message:"Every tokenized encoding should state how token counts are produced."}),"icon"!==e.tokenType&&"glyph"!==e.tokenType||"icon-only"!==e.labelPolicy&&"token-only"!==e.labelPolicy||r.push({code:"ICON_ONLY_LABELS",severity:"warning",message:"Icons should supplement text labels, not replace them."}),null!=t.visibleTokens&&t.visibleTokens>o&&r.push({code:"TOO_MANY_VISIBLE_TOKENS",severity:"warning",message:`This encoding renders ${t.visibleTokens} visible tokens. Consider unitizing, sampling, or a hybrid bar/token view.`}),"decorative"!==a||"icon"!==e.tokenType&&"glyph"!==e.tokenType||r.push({code:"DECORATIVE_PICTOGRAPHS",severity:"warning",message:"Decorative pictographs can harm recall and speed when they do not clarify the data."}),"unitized-measure"===a&&i&&"unitized"!==i&&r.push({code:"TOKEN_STRATEGY_MISMATCH",severity:"warning",message:"Unitized measures should use the unitized count strategy so each token has a stable value."}),"risk-case"===a&&i&&"fixed-denominator"!==i&&r.push({code:"TOKEN_STRATEGY_MISMATCH",severity:"warning",message:"Risk cases are usually clearest as a fixed-denominator natural frequency."}),"possible-outcome"!==a&&"posterior-sample"!==a&&"hypothetical-case"!==a||!i||"quantile"===i||"sample"===i||"posterior-sample"===i||"random-sample"===i||r.push({code:"TOKEN_STRATEGY_MISMATCH",severity:"warning",message:"Outcome/sample tokens should come from quantiles or samples, not from a unitized magnitude."}),"unitized-measure"===a&&"unitized"===i&&null==e.unitValue&&null==e.unit&&r.push({code:"MISSING_UNIT_VALUE",severity:"warning",message:"Unitized measures should set unitValue so each token has a declared value."}),"unitized-measure"!==a||"unitized"!==i||e.unitMeaning||r.push({code:"MISSING_UNIT_MEANING",severity:"info",message:"Add unitMeaning so readers know what one full token represents."}),r}function tt(e){return"string"==typeof e?.type?e.type:""}function rt(e){return!!e&&"object"==typeof e&&iu.has(tt(e))}function at(e){return Array.isArray(e?.disable)&&e.disable.includes("connector")}function it(e){return ou.has(tt(e))&&!at(e)}function ot(e,t,r={}){if("number"==typeof r.maxAnnotations&&Number.isFinite(r.maxAnnotations))return Math.max(0,Math.floor(r.maxAnnotations));if(!(e>0&&t>0))return 1/0;const a=r.areaPerAnnotation&&r.areaPerAnnotation>0?r.areaPerAnnotation:nu;return Math.max(1,Math.round(e*t/a))}function nt(e){const t=e.provenance,r=e.id??e.stableId??t?.stableId;return null==r||""===r?void 0:String(r)}function st(e){return e.length<=5?1:2}function ct(e,{dataKeys:t=[],accessorFields:r=[]}={}){if(!Array.isArray(e))return[];const a=/* @__PURE__ */new Set([...t,...r]),i=[];return e.forEach((e,t)=>{if(e&&"object"==typeof e&&!Array.isArray(e))for(const r of Object.keys(e)){if(cu.has(r)||a.has(r)||r.startsWith("_")||r.length<3)continue;let o,n=st(r)+1;for(const e of su){const t=Ie(r.toLowerCase(),e.toLowerCase());t<n&&(o=e,n=t)}if(!o)continue;const s=e.type;i.push({index:t,type:"string"==typeof s?s:"",key:r,suggestion:o})}}),i}function lt(e,t,r){const a=Array.isArray(t.annotations)?t.annotations:null;if(a)for(const e of a)e&&"object"==typeof e&&"widget"===tt(e)&&null!=e.content&&!nt(e)&&r.push({severity:"warning",code:"ANNOTATION_INTERACTIVE_ID",message:"An interactive widget annotation has no stable id, so its activation cannot be normalized or replayed reliably.",fix:"Add id, stableId, or provenance.stableId to the widget annotation. Do not identify interactive annotations by array index."})}function ut(e,t,r){const a=Array.isArray(t.annotations)?t.annotations:null;if(a)for(const e of a){if(!e||"object"!=typeof e)continue;const t=tt(e);if(!rt(e)||"widget"===t)continue;const a="number"==typeof e.dx?e.dx:0,i="number"==typeof e.dy?e.dy:0,o=Math.hypot(a,i),n="string"==typeof e.label?e.label:"string"==typeof e.title?e.title:t,s=it(e);!s&&o>lu?r.push({severity:"warning",code:"ANNOTATION_FAR_NO_CONNECTOR",message:`Annotation "${n}" sits ~${Math.round(o)}px from its anchor with no connector — a reader can't tell what it refers to.`,fix:'Add a connector (connector: { end: "arrow" }, the label/callout default) or place the note adjacent to its target (smaller dx/dy).'}):s&&o>uu&&r.push({severity:"warning",code:"ANNOTATION_LONG_CONNECTOR",message:`Annotation "${n}" uses a very long connector (~${Math.round(o)}px); prefer placing the note adjacent to its target when space allows.`,fix:"Reduce dx/dy so the note sits near its target, or keep the long connector only if proximity is genuinely infeasible."})}}function dt(e,t,r){const a=Array.isArray(t.annotations)?t.annotations:null;if(!a)return;const i=a.filter(rt).length;if(0===i)return;const o="number"==typeof t.width?t.width:600,n="number"==typeof t.height?t.height:400,s=ot(o,n);!Number.isFinite(s)||i<=s||r.push({severity:"warning",code:"ANNOTATION_DENSITY",message:`${i} note annotations on a ${o}×${n} chart exceed the ~${s} notes the plot area carries comfortably — the chart may read as cluttered.`,fix:'Mark the essential notes emphasis: "primary" and let density management shed the rest (autoPlaceAnnotations: { density: true }), enable progressive disclosure to reveal secondary notes on hover, or give the chart more room.'})}function ht(e,t,r){if(!Array.isArray(t.annotations)||0===t.annotations.length)return;const a=/* @__PURE__ */new Set;for(const e of[t.data,t.nodes,t.edges,t.points,t.areas])if(Array.isArray(e))for(const t of e)if(t&&"object"==typeof t)for(const e of Object.keys(t))a.add(e);const i=Object.entries(t).filter(([e,t])=>/Accessor$|By$/.test(e)&&"string"==typeof t).map(([,e])=>e);for(const e of ct(t.annotations,{dataKeys:a,accessorFields:i})){const t=e.type?` ${e.type}`:"";r.push({severity:"warning",code:"ANNOTATION_UNKNOWN_FIELD",message:`annotations[${e.index}]${t} has an unknown field "${e.key}", which no renderer reads.`,fix:`Did you mean "${e.suggestion}"? Rename the field; unknown annotation fields are ignored.`})}}function pt(e,t,r){for(const e of du){const a=t[e];if(!Array.isArray(a)||a.length<2)continue;const[i,o]=a;"number"==typeof i&&"number"==typeof o&&i>o&&r.push({severity:"warning",code:"INVERTED_AXIS",message:`${e}=[${i}, ${o}] is descending — the axis renders inverted, so "up" reads as less. Inverted axes are a classic misleading-design pattern unless the inversion is the point.`,fix:`Order the extent ascending (${e}={[${o}, ${i}]}). If the inversion is deliberate (e.g. rank #1 at top), say so in the title or an annotation so readers aren't misled.`})}}function ft(e,t,r){if("MultiAxisLineChart"!==e)return;const a=t.series;if(!Array.isArray(a)||2!==a.length)return;const i=a.filter(e=>!e||"object"!=typeof e||"string"!=typeof e.label||0===e.label.trim().length);i.length>0&&r.push({severity:"warning",code:"DUAL_AXIS_UNLABELED",message:`Dual-axis chart with ${i.length} unlabeled series. Two y-scales invite false equivalence between the lines; without per-series labels a reader can't tell which scale is whose.`,fix:'Give every series a label: series={[{ yAccessor: "a", label: "Revenue ($)" }, { yAccessor: "b", label: "Users" }]} — and consider whether two separate charts read more honestly.'})}function mt(e,t,r){if(!Bl.has(e))return;const a=t.xExtent;if(!Array.isArray(a)||a.length<2)return;const[i,o]=a;if("number"!=typeof i||"number"!=typeof o||i>=o)return;const n=t.data;if(!n||!Array.isArray(n)||n.length<4)return;const s=t.xAccessor??"x";if("string"!=typeof s)return;let c=1/0,l=-1/0;for(const e of n){const t=e?.[s];"number"==typeof t&&Number.isFinite(t)&&(t<c&&(c=t),t>l&&(l=t))}if(!Number.isFinite(c)||!Number.isFinite(l)||l<=c)return;const u=l-c,d=Math.max(0,Math.min(o,l)-Math.max(i,c))/u;d<.7&&r.push({severity:"warning",code:"CHERRY_PICKED_WINDOW",message:`xExtent=[${i}, ${o}] shows only ~${Math.round(100*d)}% of the data's x range [${c}, ${l}] — a trend cropped to a favorable window is a classic misleading-design pattern.`,fix:'Widen xExtent to cover the data, filter the data itself so the chart shows what it has, or annotate the visible window ("Q4 only") so the cropping is explicit.'})}function gt(e,t,r){const a=Gl[e],i=Hl[e];if(!a&&!i)return;if(i&&!t.normalize)return;const o=a??i,n=t[o],s="string"==typeof n?n:"yAccessor"===o?"y":"value",c=t.data;if(!c||!Array.isArray(c)||0===c.length)return;const l=c.filter(e=>{const t=e?.[s];return"number"==typeof t&&t<0});l.length>0&&r.push({severity:a?"error":"warning",code:"PART_TO_WHOLE_NEGATIVE",message:`${l.length} negative value(s) in "${s}" — a part-to-whole encoding cannot represent negative parts${a?"; slice angles/areas for negatives are meaningless":"; normalized shares distort when parts are negative"}.`,fix:a?"Filter or transform negative values first, or switch to a BarChart/WaterfallChart, which encode signed values honestly.":"Drop normalize for signed data, or use a diverging BarChart so negative contributions read as negative."})}function yt(e,t,r){_l.has(e)&&"basis"===t.curve&&r.push({severity:"warning",code:"NON_PASSING_CURVE",message:'curve="basis" draws a B-spline that does NOT pass through your data points — rendered values differ from actual values everywhere except the endpoints.',fix:'Use curve="monotoneX" or curve="catmullRom" (both interpolate through every point), or keep "basis" only for deliberately schematic, clearly-labeled smoothing.'})}function bt(e,t,r){if("LineChart"!==e&&"AreaChart"!==e)return;if("sparkline"===t.mode)return;if(t.responsiveWidth||t.responsiveHeight)return;const a="number"==typeof t.width?t.width:600,i="number"==typeof t.height?t.height:400;if(a<=0||i<=0)return;const o=a/i;if(o>8||o<.25){const e=o>8?"flattens":"exaggerates";r.push({severity:"warning",code:"EXTREME_ASPECT_RATIO",message:`${a}×${i} (${o.toFixed(1)}:1) is an extreme aspect ratio that ${e} the slopes a reader perceives — aspect-ratio distortion is a documented misleading-design pattern.`,fix:o>8?'Use a more balanced aspect (e.g. width/height between 1 and 3), or set mode="sparkline" if this is genuinely a sparkline strip.':"Use a more balanced aspect (e.g. width/height between 1 and 3); very tall trend charts overstate every change."})}}function vt(e,t,r){if(!Ul.has(e))return;const a=t.data;if(!a||!Array.isArray(a)||0===a.length)return;const i=t.categoryAccessor,o="string"==typeof i?i:"category",n=/* @__PURE__ */new Set;for(const e of a){const t=e?.[o];null!=t&&n.add(t)}n.size>hu&&r.push({severity:"warning",code:"PIE_TOO_MANY_SLICES",message:`${n.size} slices — angle judgments degrade rapidly past ~${hu} categories (Cleveland & McGill), and thin slices become unreadable and unlabelable.`,fix:`Use a BarChart or DotPlot for ${n.size} categories, or group the long tail into an "Other" slice before charting.`})}function wt(e,t,r){if(!zl.has(e)&&!Fl.has(e)&&!/^(Process|Network)(Sankey|CustomChart)$/.test(e))return;const a=t.perspective;"ProcessSankey"===e&&a&&"flat"!==a&&"flat"!==a.type&&r.push({severity:"warning",code:"PERSPECTIVE_MEASURED_POSITION",message:"ProcessSankey positions flows on a time axis; perspective foreshortens it, so equal durations stop looking equal.",fix:"Keep ProcessSankey flat when readers compare durations, or pair it with a flat view."}),void 0!==t.projection&&r.push({severity:"warning",code:"NETWORK_PROJECTION_PROP",message:`${e} has no projection prop (that is the geo map projection).`,fix:'Use perspective instead, e.g. perspective="isometric".'})}function At(e,t,r){return"function"==typeof r?r(e,t):e[r]}function xt(e){if(e instanceof Date){const t=e.getTime();return Number.isFinite(t)?t:null}const t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:null}function $t(e,t){const r=xt(e);return null!=r&&r>0?r:t}function Ct(e){if(!e)return;const t=xt(e[0]),r=xt(e[1]);return null!=t&&null!=r?t<=r?[t,r]:[r,t]:void 0}function St(e={}){const t=(e.categories?.length?e.categories:["Intake","Review","Build","Ship"]).map(e=>String(e).trim()).filter(Boolean),r=t.length?t:["Intake"],a=Math.max(r.length,Math.round(e.count??Math.max(48,12*r.length))),i=$t(e.unitValue,1),o=Xe(e.seed??1),n=e.idPrefix??"mechanical-pile",s=r.map(()=>.65+.9*o()),c=s.reduce((e,t)=>e+t,0)||1,l=a-r.length,u=s.map(e=>e/c*l),d=u.map(e=>1+Math.floor(e));let h=a-d.reduce((e,t)=>e+t,0);const p=u.map((e,t)=>({index:t,fraction:e-Math.floor(e)})).sort((e,t)=>t.fraction-e.fraction);for(let e=0;h>0;e=(e+1)%p.length)d[p[e].index]+=1,h-=1;return r.map((e,t)=>({id:`${n}-${t}`,category:e,value:d[t]*i,mechanical:!0,unitCount:d[t],unitValue:i,share:d[t]/a}))}function kt(e,t){const r=e/t,a=Math.round(r);return Math.ceil(a>0&&Math.abs(r-a)<=Number.EPSILON*r*4?a:r)}function Rt(e,t,r=0){const a=new Set(e.filter(e=>null!=e.id).map(e=>String(e.id))),i=/* @__PURE__ */new Map;for(const o of e){let e=null==o.id?`${t}-${r++}`:String(o.id);for(;null==o.id&&a.has(e);)e=`${t}-${r++}`;a.add(e),i.set(e,null==o.id?{...o,id:e}:o)}return{seed:e,rows:Array.from(i.values()),nextId:r}}function Pt(e){const t=e instanceof Date?e.getTime():Number(e);return Number.isFinite(t)?t:null}function Et(e,t,r){if("function"==typeof t)return t(e);const a="string"==typeof t?t:r;return e?.[a]}function Nt(e,t,r){if(Zl.has(e)){if([t.bodyStyle?.glyph,t.frameProps?.bodyStyle?.glyph,...Array.isArray(t.styleRules)?t.styleRules.map(e=>e.style?.glyph):[],...Array.isArray(t.sources)?t.sources.map(e=>e.glyph):[]].some(e=>{const t=e&&"object"==typeof e?e.viewBox:void 0;return Array.isArray(t)&&t[0]>0&&t[1]>0&&Math.max(t[0]/t[1],t[1]/t[0])>1.5})&&r.push({severity:"warning",code:"PHYSICS_GLYPH_ASPECT_RATIO",message:"A physics glyph has aspect ratio above 1.5; its visual bounds differ substantially from the circular collider.",fix:"Use a compact glyph or matching custom collision geometry. Glyphs change paint only, including in settled SVG."}),["GaltonBoardChart","UnitPileChart","EventDropChart","CollisionSwarmChart"].includes(e)&&Array.isArray(t.data)){const e=/* @__PURE__ */new Set;let a=0;for(const r of t.data){if(null==r?.id)continue;const t=String(r.id);e.has(t)&&a++,e.add(t)}a&&r.push({severity:"warning",code:"PHYSICS_DUPLICATE_IDS",message:`${a} physics source rows are replaced by later rows with the same id. Source IDs use upsert semantics, including push and update.`,fix:"Assign a unique id to each observation (rather than each entity), or omit id to retain every row."})}if("GaltonBoardChart"===e){const e=t.bins;null!=e&&(!Number.isInteger(e)||e<1)&&r.push({severity:"error",code:"PHYSICS_BAD_BINS",message:`bins=${e} is normalized to a finite positive integer by the Galton builder.`,fix:"Use a positive integer; 8-24 bins is a practical range for physics distributions."});const a=Pt(t.branchProbability);null!=t.branchProbability&&(null==a||a<0||a>1)&&r.push({severity:"error",code:"PHYSICS_BAD_BRANCH_PROBABILITY",message:`branchProbability=${String(t.branchProbability)} must be between 0 and 1.`,fix:"Use branchProbability={0.5} for a balanced Galton board, or bias it within the [0, 1] range."});const i=Pt(t.mechanicalCount);null!=t.mechanicalCount&&(null==i||i<=0)&&r.push({severity:"error",code:"PHYSICS_BAD_MECHANICAL_COUNT",message:`mechanicalCount=${String(t.mechanicalCount)} cannot generate a mechanical Galton board.`,fix:"Use a positive mechanicalCount, for example 96."})}if("EventDropChart"===e){const e=t.windows,a=e&&"object"==typeof e?Pt(e.size):null;null!=a&&a<=0&&r.push({severity:"error",code:"PHYSICS_BAD_WINDOW_SIZE",message:`windows.size=${a} cannot form event-time barriers.`,fix:"Set windows={{ size: positiveNumber }} so each event can settle into a real time window."}),"number"==typeof t.timeScale&&t.timeScale<=0&&r.push({severity:"error",code:"PHYSICS_BAD_TIME_SCALE",message:`timeScale=${t.timeScale} prevents arrival replay from advancing.`,fix:"Use a positive timeScale, or omit it for the default pace."});const i=Array.isArray(t.data)?t.data:[];if(i.length>0){const e=t.timeAccessor||"time",a=t.arrivalAccessor||"arrivalTime";i.some(t=>{const r=Pt(Et(t,e,"time")),i=Pt(Et(t,a,"arrivalTime"));return null!=r&&null!=i&&r!==i})||r.push({severity:"warning",code:"PHYSICS_EVENTDROP_NO_ARRIVAL_SPREAD",message:"EventDropChart data does not show distinct arrival times, so the physics replay collapses to event order.",fix:"Provide an arrivalAccessor field with event-arrival times when demonstrating lateness, watermarks, or out-of-order streams."})}}if("UnitPileChart"===e){const e="mechanical"===(t.simulationMode??t.mode),a=Pt(t.mechanicalCount);null!=t.mechanicalCount&&(null==a||a<=0)&&r.push({severity:"error",code:"PHYSICS_BAD_MECHANICAL_COUNT",message:`mechanicalCount=${String(t.mechanicalCount)} cannot generate a mechanical pile chart.`,fix:"Use a positive mechanicalCount, for example 80."}),e&&Array.isArray(t.mechanicalCategories)&&0===t.mechanicalCategories.length&&r.push({severity:"error",code:"PHYSICS_EMPTY_MECHANICAL_CATEGORIES",message:"mechanicalCategories=[] leaves no containers for the generated unit pile.",fix:"Provide at least one category label, or omit mechanicalCategories for the default set."});const i=xt(t.unitValue??1);if(null==i||i<=0)return void r.push({severity:"error",code:"PHYSICS_BAD_UNIT_VALUE",message:`unitValue=${t.unitValue} cannot unitize values into physical bodies.`,fix:"Set unitValue to a positive number represented by one body."});const o=e?St({count:a??void 0,categories:Array.isArray(t.mechanicalCategories)?t.mechanicalCategories:void 0,seed:xt(t.seed)??1,unitValue:i}):Array.isArray(t.data)?t.data:[],{rows:n}=Rt(o,"pile"),s=t.valueAccessor??(e?"value":void 0),c=n.reduce((e,t,r)=>{const a="function"==typeof s?s(t,r):"string"==typeof s&&s?t[s]:1;return e+kt(Math.max(0,xt(a)??0),i)},0);c>1500&&r.push({severity:"warning",code:"PHYSICS_BODY_BUDGET",message:`UnitPileChart would create about ${c} live bodies; motion may dominate the chart and stress the frame budget.`,fix:"Sample or aggregate source records, or use a bounded window with sediment. A larger unitValue reduces full circles but still leaves at least one body per positive source record."})}if("CollisionSwarmChart"===e){if((Pt(t.pointRadius??5)??5)<=0&&r.push({severity:"error",code:"PHYSICS_BAD_POINT_RADIUS",message:`pointRadius=${t.pointRadius} cannot produce collision bodies.`,fix:"Use a positive pointRadius, for example 5."}),(Pt(t.collisionIterations??6)??6)<=0&&r.push({severity:"error",code:"PHYSICS_BAD_COLLISION_ITERATIONS",message:`collisionIterations=${t.collisionIterations} disables collision relaxation.`,fix:"Use at least one collision iteration; 4-8 is a practical range for swarms."}),null!=t.xExtent){const e=Array.isArray(t.xExtent)?t.xExtent:[],a=Pt(e[0]),i=Pt(e[1]);(e.length<2||null==a||null==i)&&r.push({severity:"error",code:"PHYSICS_BAD_X_EXTENT",message:"xExtent must be a numeric [min, max] pair for CollisionSwarmChart.",fix:"Pass xExtent={[min, max]} or omit it so the chart infers the domain from data."})}const e=Array.isArray(t.data)?t.data:[];e.length>1200&&r.push({severity:"warning",code:"PHYSICS_BODY_BUDGET",message:`CollisionSwarmChart would create ${e.length} live bodies; collision relaxation may dominate the frame budget.`,fix:"Sample, aggregate, reduce point radius, or move to a static SwarmPlot when every row does not need a physical body."});const a=t.groupAccessor;if(e.length>0&&a){const t=/* @__PURE__ */new Set;for(const r of e){const e=Et(r,a,"group");null!=e&&t.add(e)}t.size>12&&r.push({severity:"warning",code:"PHYSICS_TOO_MANY_SWARM_LANES",message:`CollisionSwarmChart has ${t.size} group lanes, which leaves little vertical room for collision separation.`,fix:"Facet or filter groups, or use an ordinary SwarmPlot/BoxPlot for dense grouped comparison."})}}if("GaltonBoardChart"!==e&&"UnitPileChart"!==e&&"CollisionSwarmChart"!==e&&"ProcessFlowChart"!==e&&"EventDropChart"!==e||(null!=t.massBy||null!=t.massAccessor||t.frameProps&&"object"==typeof t.frameProps&&null!=t.frameProps.bodyMassBy)&&r.push({severity:"warning",code:"PHYSICS_DATA_IN_DYNAMICS",message:`${e} appears to map a data field to mass/dynamics. Mass is not a readable quantitative channel.`,fix:"Encode quantities in spawn position, bin, size, color, or glyph — keep mass/friction/restitution as process texture. Use showProjection for the truth layer."}),"UnitPileChart"!==e&&"GaltonBoardChart"!==e&&"CollisionSwarmChart"!==e&&"ProcessFlowChart"!==e&&"CrucibleChart"!==e||!1!==t.showProjection||r.push({severity:"warning",code:"PHYSICS_NO_PROJECTION",message:`${e} has showProjection={false}. Without a settled projection, motion is easy to over-read as data.`,fix:"Keep showProjection enabled (default) so the chart collapses to a legible static reading, or document why the process alone is the claim."}),"ProcessFlowChart"===e){const e=Array.isArray(t.stages)?t.stages:[];if(0===e.length)r.push({severity:"error",code:"PROCESS_FLOW_MISSING_STAGES",message:"ProcessFlowChart requires a non-empty stages array.",fix:'Provide stages={[{ id: "coding", force: 12 }, { id: "merged", absorb: true }]}.'});else{e.some(e=>!e||null==e.id||""===String(e.id).trim())&&r.push({severity:"error",code:"PROCESS_FLOW_BAD_STAGE",message:"Every ProcessFlowChart stage needs a stable id.",fix:'Use stages like { id: "review", label: "Review", capacity: { unitsPerSecond: 4 } }.'});const a=e.filter(e=>e?.absorb).length;t.groupBy&&0===a&&r.push({severity:"warning",code:"PROCESS_FLOW_GROUP_NO_ABSORB",message:"groupBy is set but no stage has absorb: true, so all-members completion cannot resolve.",fix:'Mark a terminal stage with absorb: true (e.g. merged), or set groupCompletion="none".'})}}if("GauntletChart"===e&&(Array.isArray(t.negativeProperties)||r.push({severity:"warning",code:"GAUNTLET_MISSING_NEGATIVE_PROPERTIES",message:"GauntletChart usually needs negativeProperties for drag/cost bodies (empty array is ok if intentional).",fix:'Provide negativeProperties={[{ id: "cost", label: "Cost", load: 1 }]} or explicitly pass [].'})),"CrucibleChart"===e){const e=Array.isArray(t.phases)?t.phases:[],a=Array.isArray(t.products)?t.products:[],i=Array.isArray(t.events)?t.events:[],o=Array.isArray(t.outlets)?t.outlets:[];0===e.length?r.push({severity:"error",code:"CRUCIBLE_MISSING_PHASES",message:"CrucibleChart requires an authored, non-empty phases array; a treatment program cannot be inferred from flat data.",fix:'Provide phases={[{ id: "charge", label: "Charge", duration: 1, motion: "charge" }]}.'}):e.some(e=>!e||null==e.id||""===String(e.id).trim()||null==Pt(e.duration)||Number(e.duration)<=0)&&r.push({severity:"error",code:"CRUCIBLE_BAD_PHASE",message:"Every CrucibleChart phase needs a stable id and a positive finite duration.",fix:'Use phases like { id: "assay", label: "Assay", duration: 2, motion: "mix" }.'}),0===a.length&&r.push({severity:"warning",code:"CRUCIBLE_NO_PRODUCTS",message:"CrucibleChart has no declared product molds. Products are never discovered from collisions or source fields.",fix:'Declare products={[{ id: "accepted", label: "Accepted", outletId: "product" }]} when the treatment forms an output.'}),0===i.length&&r.push({severity:"warning",code:"CRUCIBLE_NO_EVENTS",message:"CrucibleChart has no authored events, so its phases cannot transform, combine, split, or route the charge.",fix:"Supply an explicit events array; do not ask the chart or an AI layer to infer a treatment from the rows."}),Array.isArray(t.outlets)||r.push({severity:"warning",code:"CRUCIBLE_IMPLICIT_OUTLETS",message:"CrucibleChart is using generic default outlets rather than domain-specific destinations.",fix:"Provide reason-labelled outlets and reference their ids from products, complete-product, and eject effects."});const n=new Set(a.map(e=>e?.id).filter(e=>null!=e).map(String)),s=/* @__PURE__ */new Set(["product","retained","residue","failed","recovered",...o.map(e=>e?.id).filter(e=>null!=e).map(String)]),c=/* @__PURE__ */new Set,l=/* @__PURE__ */new Set;for(const e of i)if(e&&Array.isArray(e.effects))for(const t of e.effects){if(!t||"object"!=typeof t)continue;const e=t.type;if("combine"!==e&&"contribute"!==e&&"complete-product"!==e||null==t.productId||n.has(String(t.productId))||c.add(String(t.productId)),"split"===e&&Array.isArray(t.products))for(const e of t.products)null==e?.productId||n.has(String(e.productId))||c.add(String(e.productId));null==t.outletId||s.has(String(t.outletId))||l.add(String(t.outletId))}c.size>0&&r.push({severity:"error",code:"CRUCIBLE_UNKNOWN_PRODUCT",message:`CrucibleChart events reference undeclared product molds: ${[...c].sort().join(", ")}.`,fix:"Declare every referenced product id in products; do not create product definitions implicitly inside events."}),l.size>0&&r.push({severity:"error",code:"CRUCIBLE_UNKNOWN_OUTLET",message:`CrucibleChart events reference undeclared outlets: ${[...l].sort().join(", ")}.`,fix:"Declare every domain outlet in outlets and reuse its stable id in authored effects."});const u=Pt(t.playbackRate);null!=t.playbackRate&&(null==u||u<=0)&&r.push({severity:"error",code:"CRUCIBLE_BAD_PLAYBACK_RATE",message:`playbackRate=${String(t.playbackRate)} cannot advance the authored CrucibleChart tape.`,fix:"Use a positive playbackRate such as 0.5 for half speed or 2 for double speed."});const d=Pt(t.rerunMS);null!=t.rerunMS&&(null==d||d<0)&&r.push({severity:"error",code:"CRUCIBLE_BAD_RERUN_MS",message:`rerunMS=${String(t.rerunMS)} must be a finite non-negative delay or null.`,fix:"Use rerunMS={3000}, rerunMS={0}, or omit the prop for a single run."})}if("GaltonBoardChart"===e||"CollisionSwarmChart"===e||"ProcessFlowChart"===e||"EventDropChart"===e||"CrucibleChart"===e){const a=Array.isArray(t.data)?t.data:[],i=Pt(t.mechanicalCount)??0,o=a.length>0?a.length:i;o>2500&&r.push({severity:"warning",code:"PHYSICS_BODY_BUDGET",message:`${e} may spawn ~${Math.round(o)} live bodies, which can overwhelm the simulation loop.`,fix:"Lower mechanicalCount / unitize with a larger unitValue, enable sediment/windowSize, or sample the data before spawn."})}}}function Tt(e){const t=e.trim();if(!t||!Number.isNaN(Number(t)))return NaN;const r=pu.exec(t);if(r){const e=Number(r[1]),t=Number(r[2])-1,a=Number(r[3]??1),i=/* @__PURE__ */new Date(0);return i.setUTCFullYear(e,t,a),i.getUTCFullYear()===e&&i.getUTCMonth()===t&&i.getUTCDate()===a?i.getTime():NaN}if(t.length<10)return NaN;const a=Date.parse(t);return Number.isFinite(a)?a:NaN}function It(e){if(e instanceof Date)return e.getTime();if("number"==typeof e)return Number.isFinite(e)?e:NaN;if("string"!=typeof e||!e.trim())return NaN;const t=e.trim(),r=Number(t);if(!Number.isNaN(r))return Number.isFinite(r)?r:NaN;if(/^\d{4}-\d{1,2}(?:-\d{1,2})?$/.test(t))return Tt(t);const a=/^(\d{4}-\d{2}-\d{2})[Tt ](\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)([Zz]|[+-]\d{2}:?\d{2})?$/.exec(t);return a&&Number.isFinite(Tt(a[1]))?Date.parse(`${a[1]}T${a[2]}${a[3]||"Z"}`):NaN}function Mt(e){const t=[],r=e.domain,a=Array.isArray(r)?It(r[0]):NaN,i=Array.isArray(r)?It(r[1]):NaN;null==r?t.push({severity:"error",code:"PROCESS_SANKEY_MISSING_DOMAIN",message:"ProcessSankey requires domain: [tStart, tEnd].",fix:"Pass domain={[start, end]} using numbers, Dates, numeric strings, or ISO date strings."}):Array.isArray(r)&&2===r.length&&Number.isFinite(a)&&Number.isFinite(i)&&!(a>i)||t.push({severity:"error",code:"PROCESS_SANKEY_BAD_DOMAIN",message:"domain must be a 2-tuple of finite times with start <= end.",fix:"Use domain={[t0, t1]} with t0 <= t1."});const o=e.edges;if(Array.isArray(o)&&o.length>0){const e=o[0];null!=e.startTime&&null!=e.endTime||t.push({severity:"warning",code:"PROCESS_SANKEY_EDGE_TIMES",message:"Edges should carry startTime and endTime for temporal layout.",fix:"Add startTime/endTime fields or set startTimeAccessor/endTimeAccessor."})}const n=e.nodes,s=Array.isArray(n)?n.length:0;return!0===e.showLabels&&s>=24&&t.push({severity:"warning",code:"PROCESS_SANKEY_LABEL_DENSITY",message:`showLabels={true} with ${s} nodes may overcrowd the plot.`,fix:'Use showLabels="auto" with optional labelPriorityAccessor / maxLabels.'}),(Array.isArray(o)?o.length:0)>=80&&null==e.layoutExecution&&"off"!==e.packing&&t.push({severity:"warning",code:"PROCESS_SANKEY_WORKER_HINT",message:"Dense ProcessSankey layouts benefit from worker packing/order.",fix:'layoutExecution defaults to "auto"; set layoutExecution="worker" or raise layoutWorkerThreshold deliberately.'}),t}function Ot(e,t){const r=e.nestedDataAccessorProp?t[e.nestedDataAccessorProp]:void 0;return"string"==typeof r?r:e.defaultNestedDataAccessor}function jt(e,t,r){const a=e.dataProp??"data",i=t[a],o=r??(Array.isArray(i)?i:[]),n=Ot(e,t);if(!n)return{dataProp:a,rows:o};const s=[];let c=!1;for(const e of o){const t=e?.[n];if(Array.isArray(t)){c=!0;for(const e of t)e&&"object"==typeof e&&s.push(e)}}return{dataProp:a,rows:c?s:o}}function Ft(e,t,r){const a=/* @__PURE__ */new Set;for(const i of e.fields){const e=i.dataProp??"data",o=r??t[e];if(!Array.isArray(o))continue;if(0===o.length){a.add(e);continue}const n=Ot(i,t);if(!n)continue;const s=o.map(e=>e?.[n]).filter(Array.isArray);s.length>0&&s.every(e=>0===e.length)&&a.add(`${e}.${n}`)}return[...a]}function zt(){const e=globalThis;return e[Pu]??(e[Pu]={contracts:/* @__PURE__ */new Map}),e[Pu]}function Lt(e){return zt().contracts.get(e)??Ru[e]}function Bt(e){if("number"==typeof e)return e;if("string"!=typeof e)return;const t=e.trim();return/^[+-]?nan$/i.test(t)?NaN:/^[+-]?Infinity$/.test(t)||/^[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?$/.test(t)&&!/^[+-]?0\d+$/.test(t)?Number(t):void 0}function Dt(e){return null==e||"string"==typeof e&&""===e.trim()}function _t(e,t,r){const a={numbers:r?[]:void 0,finite:0,min:1/0,max:-1/0,missing:0,nonFinite:0,nonNumeric:0,zero:0,negative:0,fractional:0};for(const r of e){const e=r&&Object.prototype.hasOwnProperty.call(r,t)?r[t]:void 0;if(Dt(e)){a.missing++;continue}const i=Bt(e);void 0!==i?Number.isFinite(i)?(a.numbers?.push(i),a.finite++,i<a.min&&(a.min=i),i>a.max&&(a.max=i),0===i&&a.zero++,i<0&&a.negative++,Number.isInteger(i)||a.fractional++):a.nonFinite++:a.nonNumeric++}return a}function Ut(e,t){if(0===e.length)return;const r=(e.length-1)*t,a=Math.floor(r),i=Math.ceil(r);if(a===i)return e[a];const o=r-a;return e[a]*(1-o)+e[i]*o}function Gt(e,t={}){if(!Array.isArray(e)||0===e.length)return{};const r=/* @__PURE__ */new Set;for(const t of e)if(t&&"object"==typeof t)for(const e of Object.keys(t))r.add(e);const a={};for(const i of r){const r=_t(e,i,!1!==t.quantiles),o=r.numbers?.sort((e,t)=>e-t);Object.defineProperty(a,i,{enumerable:!0,writable:!0,configurable:!0,value:{field:i,observedCount:e.length-r.missing,finiteCount:r.finite,missingCount:r.missing,nonFiniteCount:r.nonFinite,nonNumericCount:r.nonNumeric,zeroCount:r.zero,negativeCount:r.negative,fractionalCount:r.fractional,...r.finite>0?{min:r.min,...o?{q1:Ut(o,.25),median:Ut(o,.5),q3:Ut(o,.75)}:{},max:r.max}:{}}})}return a}function Vt(e){const t=e.ok?"✓ numerically safe":"✗ numeric hazards found",r=[`${e.component}: ${t}`,`${e.rowCount} rows · ${e.summary.fieldsChecked} numeric fields · ${e.summary.errors} errors · ${e.summary.warnings} warnings`];for(const t of e.diagnoses)r.push(`${"error"===t.severity?"ERROR":"WARN"} ${t.code}${t.field?` [${t.field}]`:""}: ${t.message}`),t.fix&&r.push(` Fix: ${t.fix}`);return r.join("\n")}function Ht(e){return e.code.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Wt(e,t={}){const r=Number.isFinite(t.max)?Math.max(0,Math.floor(t.max)):6,a=e.diagnoses.map((e,t)=>({item:e,diagnosisIndex:t})).filter(({item:e})=>!t.errorsOnly||"error"===e.severity),i=a.slice(0,r).map(({item:e,diagnosisIndex:t})=>({id:`data-audit:${e.code}:${e.role??"chart"}:${e.field??"chart"}:${t}`,level:e.severity,title:e.field?`${Ht(e)} · ${e.field}`:Ht(e),message:e.fix?`${e.message} ${e.fix}`:e.message,source:"Semiotic data audit",dismissible:!0}));return a.length>r&&i.push({id:"data-audit:overflow:chart",level:a.slice(r).some(({item:e})=>"error"===e.severity)?"error":"warning",title:`${a.length-r} more numeric finding${a.length-r===1?"":"s"}`,message:"Run auditData() or diagnoseConfig() to inspect the complete report.",source:"Semiotic data audit",dismissible:!0}),i}function qt(e){const t=[];for(const[r,a]of Object.entries(Nu))"string"!=typeof e[r]&&"function"!=typeof e[r]||t.push({role:a,accessor:r,..."size"===a?{requirements:["finite","non-negative"]}:{},..."x"===a||"y"===a?{domain:!0}:{}});return t.length>0?{fields:t}:void 0}function Yt(e,t,r){return"function"==typeof e?e(t,r):t[e]}function Kt(e,t){if("number"==typeof e)return Number.isFinite(e)?e:null;if(e instanceof Date){const r=e.getTime();return t&&Number.isFinite(r)?r:null}if("string"==typeof e){const r=e.trim(),a=Number(r);if(r&&Number.isFinite(a))return a;if("date-like"===t){const e=Tt(r);return Number.isFinite(e)?e:null}}return null}function Jt(e){return"number"==typeof e&&!Number.isFinite(e)}function Xt(e,t,r,a,i){const o={field:r,numbers:[],finiteRows:[],missingRows:[],nonFiniteRows:[],nonNumericRows:[],accessorErrorRows:[],zeroRows:[],negativeRows:[],fractionalRows:[]};for(let r=0;r<e.length;r++){let n;try{n=Yt(t,e[r],r)}catch{o.accessorErrorRows.push(r);continue}if(null==n||""===n){if(void 0!==i){o.numbers.push(i),o.finiteRows.push(r),0===i&&o.zeroRows.push(r),i<0&&o.negativeRows.push(r),Number.isInteger(i)||o.fractionalRows.push(r);continue}o.missingRows.push(r);continue}const s=Kt(n,a);null!=s?(o.numbers.push(s),o.finiteRows.push(r),0===s&&o.zeroRows.push(r),s<0&&o.negativeRows.push(r),Number.isInteger(s)||o.fractionalRows.push(r)):Jt(n)?o.nonFiniteRows.push(r):o.nonNumericRows.push(r)}return o}function Zt(e,t){const r=new Set(e.requirements??["finite"]);return r.add("finite"),("x"===e.role&&"log"===t.xScaleType||"y"===e.role&&"log"===t.yScaleType)&&r.add("positive"),[...r]}function Qt(e){let t=1/0,r=-1/0;for(const a of e)a<t&&(t=a),a>r&&(r=a);return[t,r]}function er(e,t,r){const a=[],i=/* @__PURE__ */new Set;for(const o of e.fields){if(o.whenProps?.some(e=>null==t[e]))continue;const e=t[o.accessor],n="string"==typeof e||"function"==typeof e?e:o.defaultAccessor;if("string"!=typeof n&&"function"!=typeof n)continue;const{dataProp:s,rows:c}=jt(o,t,r);if(0===c.length)continue;const l="string"==typeof n?n:`${o.accessor}()`,u=`${s}:${o.role}:${l}`;if(i.has(u))continue;i.add(u);const d=o.temporalValues??("time"===o.role||"x"===o.role&&"time"===t.xScaleType?"date-like":void 0),h="x"===o.role&&"log"===t.xScaleType||"y"===o.role&&"log"===t.yScaleType,p=Zt(o,t);a.push({contract:o,accessor:n,accessorLabel:l,dataProp:s,rows:c,requirements:p,logScale:h,observation:Xt(c,n,l,d,o.missingValue)})}return a}function tr(e){return e.slice(0,Eu)}function rr(e){return{domain:"data",...e}}function ar(e){const t=e.observation.numbers.map((t,r)=>({value:t,row:e.observation.finiteRows[r]})).sort((e,t)=>e.value-t.value);if(t.length<8)return[];const r=t.map(e=>e.value),a=Ut(r,.25),i=Ut(r,.75),o=Ut(r,.5),n=i-a;if(n>0){const e=a-10*n,r=i+10*n;return t.filter(t=>t.value<e||t.value>r).map(e=>e.row)}const s=100*Math.max(1,Math.abs(o));return t.filter(e=>Math.abs(e.value-o)>s).map(e=>e.row)}function ir(e,t){const r=[],{observation:a,contract:i,accessorLabel:o,requirements:n}=e,s={field:o,role:i.role},c=[...a.nonFiniteRows,...a.nonNumericRows,...a.accessorErrorRows].sort((e,t)=>e-t);if(0===a.numbers.length)return r.push(rr({severity:"error",code:"DEGENERATE_EXTENT",message:`${i.accessor}="${o}" produces no finite numeric values; the chart cannot resolve its ${i.role} input.`,fix:`Ensure ${o} contains finite numbers${"x"===i.role?" (or valid dates for a time scale)":""}.`,...s,...c.length>0?{rows:tr(c),count:c.length}:{}})),r;a.nonFiniteRows.length>0&&r.push(rr({severity:"error",code:"NON_FINITE_VALUE",message:`${o} contains ${a.nonFiniteRows.length} NaN or infinite value${1===a.nonFiniteRows.length?"":"s"}; scale and layout math require finite numbers.`,fix:`Filter or replace NaN/Infinity in ${o} before rendering.`,...s,rows:tr(a.nonFiniteRows),count:a.nonFiniteRows.length})),!i.allowMissing&&a.missingRows.length>0&&r.push(rr({severity:"error",code:"MISSING_NUMERIC_VALUE",message:`${o} is missing for ${a.missingRows.length} row${1===a.missingRows.length?"":"s"}; the ${i.role} role requires an explicit numeric value.`,fix:`Fill or filter missing ${o} values before rendering.`,...s,rows:tr(a.missingRows),count:a.missingRows.length}));const l=[...a.nonNumericRows,...a.accessorErrorRows].sort((e,t)=>e-t);if(l.length>0&&r.push(rr({severity:"error",code:"NON_NUMERIC_VALUE",message:`${o} produces ${l.length} non-numeric value${1===l.length?"":"s"} for the ${i.role} role.`,fix:`Bind ${i.accessor} to a numeric field or return finite numbers from the accessor.`,...s,rows:tr(l),count:l.length})),i.domain&&a.numbers.length>=2){const[e,t]=Qt(a.numbers);e===t&&r.push(rr({severity:"warning",code:"ZERO_SPAN_DOMAIN",message:`${o} is constant at ${e}; its ${i.role} scale has a zero-span data domain.`,fix:`Provide varying ${i.role} values, set an explicit extent around ${e}, or use a single-value display.`,...s,rows:tr(a.finiteRows),count:a.finiteRows.length}))}if(n.includes("positive")){const t=a.numbers.map((e,t)=>({number:e,row:a.finiteRows[t]})).filter(({number:e})=>e<=0).map(({row:e})=>e);if(t.length>0){const a=e.logScale;r.push(rr({severity:"error",code:a?"LOG_NON_POSITIVE":"NON_POSITIVE_VALUE",message:`${o} contains ${t.length} non-positive value${1===t.length?"":"s"}, which ${a?"cannot be represented on a log scale":"violate the positive-value contract"}.`,fix:a?"Remove or transform values ≤ 0, or use a linear/symlog scale.":"Provide values greater than zero.",...s,rows:tr(t),count:t.length}))}}if(n.includes("non-negative")&&a.negativeRows.length>0&&r.push(rr({severity:"error",code:"size"===i.role?"NEGATIVE_SIZE":"NEGATIVE_VALUE",message:`${o} contains ${a.negativeRows.length} negative ${i.role} value${1===a.negativeRows.length?"":"s"}; the chart maps this role to non-negative geometry.`,fix:"Use a non-negative measure, clamp intentionally, or encode sign with position/color instead.",...s,rows:tr(a.negativeRows),count:a.negativeRows.length})),n.includes("integer")){const e=[.../* @__PURE__ */new Set([...a.negativeRows,...a.zeroRows,...a.fractionalRows])].sort((e,t)=>e-t);e.length>0&&r.push(rr({severity:"error",code:"INVALID_COUNT",message:`${o} contains ${e.length} value${1===e.length?"":"s"} that are not positive integers.`,fix:"Counts must be integers ≥ 1; aggregate, round intentionally, or use a continuous-value encoding.",...s,rows:tr(e),count:e.length}))}if(n.includes("unit-interval")){const e=a.numbers.map((e,t)=>({number:e,row:a.finiteRows[t]})).filter(({number:e})=>e<0||e>1).map(({row:e})=>e);e.length>0&&r.push(rr({severity:"error",code:"OUTSIDE_UNIT_INTERVAL",message:`${o} contains ${e.length} value${1===e.length?"":"s"} outside [0, 1].`,fix:`Normalize ${o} to [0, 1] before using it as ${i.role}.`,...s,rows:tr(e),count:e.length}))}if(t&&i.domain){const t=ar(e);t.length>0&&r.push(rr({severity:"warning",code:"OUTLIER_DOMINATED_DOMAIN",message:`${o} has ${t.length} extreme value${1===t.length?"":"s"} beyond the 10×IQR guardrail; the main distribution may collapse visually.`,fix:"Verify the extreme values, then consider a log scale, robust extent, inset, or explicit annotation rather than silently clipping them.",...s,rows:tr(t),count:t.length}))}return r}function or(e,t,r){if(!e)return"__all__";try{return String(Yt(e,t,r))}catch{return"__accessor_error__"}}function nr(e,t,r){if(e.whenProp&&!0!==r[e.whenProp])return[];const a=t.find(t=>t.contract.role===e.role);if(!a||0===a.observation.numbers.length)return[];const i=e.groupAccessor?r[e.groupAccessor]:void 0,o="string"==typeof i||"function"==typeof i?i:e.defaultGroupAccessor,n=/* @__PURE__ */new Map;for(let e=0;e<a.rows.length;e++){let t;try{t=Yt(a.accessor,a.rows[e],e)}catch{continue}const r=Kt(t,void 0);if(null==r)continue;const i=or(o,a.rows[e],e),s=n.get(i)??{sum:0,magnitude:0,positive:!1,negative:!1,rows:[],negativeRows:[]};s.sum+=r,s.magnitude+=Math.abs(r),s.positive||(s.positive=r>0),s.negative||(s.negative=r<0),s.rows.push(e),r<0&&s.negativeRows.push(e),n.set(i,s)}const s=[],c=[],l=[],u=[],d=[],h=[];for(const[t,r]of n){const a=Math.abs(r.sum)<=Number.EPSILON*Math.max(1,r.magnitude)*10;("positive-total"===e.kind&&r.sum<=0||"normalized-total"===e.kind&&a)&&(s.push(t),u.push(...r.rows)),"normalized-total"===e.kind&&r.positive&&r.negative&&(c.push(t),d.push(...r.rows)),"normalized-total"===e.kind&&r.negative&&(l.push(t),h.push(...r.negativeRows))}const p=[];return s.length>0&&p.push(rr({severity:"error",code:"normalized-total"===e.kind?"ZERO_NORMALIZED_TOTAL":"NON_POSITIVE_TOTAL",message:"normalized-total"===e.kind?`${s.length} normalization group${1===s.length?" has":"s have"} a zero total, so division would be undefined.`:"The part-to-whole total is not positive, so meaningful shares cannot be computed.",fix:"normalized-total"===e.kind?"Remove empty/zero-sum groups or disable normalization.":"Provide at least one positive value and ensure the total is greater than zero.",field:a.accessorLabel,role:e.role,rows:tr([...new Set(u)].sort((e,t)=>e-t)),count:s.length})),l.length>0&&p.push(rr({severity:"error",code:"NEGATIVE_NORMALIZED_VALUE",message:`${l.length} normalization group${1===l.length?" contains":"s contain"} negative contributions, so conventional percentage shares are not defined.`,fix:"Use non-negative contributions, a diverging stack, or disable normalization.",field:a.accessorLabel,role:e.role,rows:tr([...new Set(h)].sort((e,t)=>e-t)),count:h.length})),c.length>0&&p.push(rr({severity:"warning",code:"MIXED_SIGN_NORMALIZATION",message:`${c.length} normalization group${1===c.length?" mixes":"s mix"} positive and negative contributions; percentage shares may be unstable or misleading.`,fix:"Separate positive and negative contributions, use diverging stacks, or disable normalization.",field:a.accessorLabel,role:e.role,rows:tr([...new Set(d)].sort((e,t)=>e-t)),count:c.length})),p}function sr(e,t,r,a={}){const i=a.contracts??Lt(e)??qt(t);if(!i)return{component:e,ok:!0,rowCount:r?.length??(Array.isArray(t.data)?t.data.length:0),summary:{fieldsChecked:0,errors:0,warnings:0},contracts:[],diagnoses:[]};const o=er(i,t,r),n=[],s=!1!==a.checkOutliers;for(const e of Ft(i,t,r))n.push(rr({severity:"error",code:"EMPTY_DATA",message:`${e} is an explicitly empty array; there are no numeric inputs to render.`,fix:`Provide at least one valid row, render an intentional empty state, or omit ${e} when using the ref push API.`,count:0,rows:[]}));const c=new Set(o.filter(e=>e.contract.domain&&1===e.rows.length).map(e=>e.dataProp));for(const e of c)n.push(rr({severity:"warning",code:"SINGLE_ROW_DOMAIN",message:`${e} has one row; a quantitative scale cannot establish variation from a single observation.`,fix:"Provide at least two observations or use a single-value display such as BigNumber.",count:1,rows:[0]}));for(const e of o)n.push(...ir(e,s));for(const e of i.aggregates??[])n.push(...nr(e,o,t));const l=n.filter(e=>"error"===e.severity).length,u=n.length-l;return{component:e,ok:0===l,rowCount:o.reduce((e,t)=>Math.max(e,t.rows.length),r?.length??(Array.isArray(t.data)?t.data.length:0)),summary:{fieldsChecked:o.length,errors:l,warnings:u},contracts:o.map(e=>({role:e.contract.role,accessor:e.accessorLabel,dataProp:e.dataProp,requirements:e.requirements,allowMissing:!0===e.contract.allowMissing,...void 0!==e.contract.missingValue?{missingValue:e.contract.missingValue}:{},domain:!0===e.contract.domain})),diagnoses:n}}function cr(e,t,r){const a=El[e];if(a){if("array"===a.dataShape||"realtime"===a.dataShape){const e=t.data;e&&Array.isArray(e)&&0===e.length&&r.push({severity:"error",code:"EMPTY_DATA",message:"data is an empty array — chart will render blank.",fix:"realtime"===a.dataShape?"Provide at least one observation: data={[{ time: 0, value: 1 }]}, or omit data for React ref push mode.":"Provide at least one data point: data={[{ x: 1, y: 2 }]}."})}"network"===a.dataShape&&t.edges&&Array.isArray(t.edges)&&0===t.edges.length&&r.push({severity:"error",code:"EMPTY_EDGES",message:"edges is an empty array — network chart will render blank.",fix:'Provide at least one edge: edges={[{ source: "A", target: "B" }]}.'})}}function lr(e,t){for(const[r,a]of[["width",600],["height",400]]){const i=e[r];void 0!==i&&("number"!=typeof i||!Number.isFinite(i)||i<=0)&&t.push({severity:"error",code:"width"===r?"BAD_WIDTH":"BAD_HEIGHT",message:`${r} must be a finite positive number.`,fix:`Set ${r}={${a}}.`})}if(e.size&&Array.isArray(e.size)){const[r,a]=e.size;(2!==e.size.length||[r,a].some(e=>"number"!=typeof e||!Number.isFinite(e)||e<=0))&&t.push({severity:"error",code:"BAD_SIZE",message:"size must contain two finite positive dimensions.",fix:"Set size={[600, 400]}."})}}function ur(e,t,r){const a=El[e];if(!a||"array"!==a.dataShape)return;const i=t.data;if(!i||!Array.isArray(i)||0===i.length)return;const o=Te(i);if(o.length)for(const e of a.dataAccessors){const a=t[e];"string"==typeof a&&(o.includes(a)||r.push({severity:"error",code:"ACCESSOR_MISSING",message:`${e}="${a}" not found in data. Available fields: ${o.join(", ")}.`,fix:`Change ${e} to one of: ${o.map(e=>`"${e}"`).join(", ")}, or use a function: ${e}={d => d.myValue}.`}))}}function dr(e,t,r){Fl.has(e)&&Array.isArray(t.data)&&r.push({severity:"error",code:"HIERARCHY_FLAT_ARRAY",message:`${e} expects hierarchical data but received a flat array.`,fix:'Pass a root object: data={{ name: "root", children: [...] }}. For flat data, use BarChart or LineChart.'})}function hr(e,t,r){zl.has(e)&&(t.edges||t.data||r.push({severity:"error",code:"NETWORK_NO_EDGES",message:`${e} requires an edges prop.`,fix:'Provide edges={[{ source: "A", target: "B", value: 10 }]}.'}))}function pr(e,t,r){const a=El[e];if(!a||"array"!==a.dataShape)return;const i=t.data;if(!i||!Array.isArray(i)||0===i.length)return;const o=i[0];if(!o||"object"!=typeof o)return;const n=t.xAccessor;"string"==typeof n&&o[n]instanceof Date&&!t.xFormat&&r.push({severity:"warning",code:"DATE_NO_FORMAT",message:`xAccessor "${n}" contains Date objects but no xFormat is provided. Axis ticks may display "[object Object]".`,fix:"Add xFormat={d => d.toLocaleDateString()} or use timestamps (d.getTime()) instead of Date objects."})}function fr(e,t,r){t.linkedHover&&!t.selection&&r.push({severity:"warning",code:"LINKED_HOVER_NO_SELECTION",message:"linkedHover is set but selection is not — this chart emits hover events but won't highlight from others.",fix:`Add selection={{ name: "${"object"==typeof t.linkedHover&&t.linkedHover.name||"hl"}" }} to receive cross-highlights.`})}function mr(e,t,r){if(!Bl.has(e))return;if(t.gapStrategy)return;const a=t.data;if(!a||!Array.isArray(a)||0===a.length)return;const i=t.yAccessor||"y";"string"==typeof i&&a.some(e=>{const t=e?.[i];return null==t||Number.isNaN(t)})&&r.push({severity:"warning",code:"DATA_GAPS",message:`Data contains null/undefined/NaN values in "${i}". Default behavior breaks the line at gaps.`,fix:'Set gapStrategy="break" (default), "interpolate", or "zero" to control gap handling.'})}function gr(e,t,r){if(!Ll.has(e))return;const a=t.rExtent||t.yExtent||t.valueExtent;a&&Array.isArray(a)&&a.length>=1&&null!=a[0]&&0!==a[0]&&r.push({severity:"warning",code:"NON_ZERO_BASELINE",message:`${e} has a non-zero baseline (${a[0]}). Bar and area charts should start at zero to avoid exaggerating differences.`,fix:`Remove the custom extent minimum or set it to 0: rExtent={[0, ${a[1]??"auto"}]}. For trend-focused charts, use LineChart instead.`})}function yr(e,t,r){if(!Dl.has(e))return;const a=t.barPadding;"number"==typeof a&&a<10&&r.push({severity:"warning",code:"BAR_PADDING_INVISIBLE",message:`barPadding=${a} is very small — bars may appear to have no spacing between them.`,fix:"Increase barPadding to at least 10 for visible gaps, e.g. barPadding={12}."})}function br(e,t,r){if("Heatmap"!==e)return;const a=t.data;if(!a||!Array.isArray(a)||0===a.length)return;const i=a[0];if(i&&"object"==typeof i)for(const e of["xAccessor","yAccessor"]){const a=t[e];if("string"!=typeof a)continue;const o=i[a];"string"==typeof o&&r.push({severity:"warning",code:"HEATMAP_STRING_ACCESSOR",message:`${e}="${a}" resolves to string values (e.g. "${o}"). Heatmap will use categorical axis handling which may produce unexpected cell layout.`,fix:"If you intend categorical axes this is fine. Otherwise, convert values to numbers before passing data."})}}function vr(e,t,r){const a=t.colorScheme;if(!a||!Array.isArray(a))return;const i="string"==typeof t.background?t.background:"#ffffff";if(!i.startsWith("#"))return;const n=[];for(const e of a){if("string"!=typeof e||!e.startsWith("#"))continue;const t=o(e,i);null!==t&&t<3&&n.push(`${e} (${t.toFixed(1)}:1)`)}n.length>0&&r.push({severity:"warning",code:"LOW_COLOR_CONTRAST",message:`${n.length} color(s) in colorScheme have < 3:1 contrast against background "${i}": ${n.join(", ")}. Data marks may be hard to see.`,fix:"Choose colors with at least 3:1 contrast against the chart background."})}function wr(e,t){const r=e.width??600,a=e.height??400,i=e.margin;if(!i||"object"!=typeof i)return;const o=(i.left||0)+(i.right||0),n=(i.top||0)+(i.bottom||0);o>=r&&t.push({severity:"error",code:"MARGIN_OVERFLOW_H",message:`Horizontal margins (${o}px) >= width (${r}px) — no drawing area left.`,fix:"Reduce margin.left/right or increase width."}),n>=a&&t.push({severity:"error",code:"MARGIN_OVERFLOW_V",message:`Vertical margins (${n}px) >= height (${a}px) — no drawing area left.`,fix:"Reduce margin.top/bottom or increase height."})}function Ar(e,t,r){const a=El[e]?.props,i=e=>!!a?.[e]&&"string"==typeof t[e]&&t[e].trim().length>0,o=i("title"),n=i("description"),s=i("summary");o||n||s||r.push({severity:"warning",code:"MISSING_DESCRIPTION",message:"No title, description, or summary provided. Screen readers will fall back to a generic chart-type label.",fix:'Add a title="..." prop for a brief label, or description="..." for a detailed aria-label, or summary="..." for a screen-reader-only note describing the chart\'s purpose.'})}function xr(e,t,r){const a=t.colorScheme;if("string"!=typeof a)return;const i=El[e];i?.props?.colorScheme?.enum||Tu.has(a)||r.push({severity:"warning",code:"UNKNOWN_COLOR_SCHEME",message:`colorScheme "${a}" is not a recognized named scheme — the chart will fall back to the default palette.`,fix:`Use a known scheme name (${[...Tu].join(", ")}) or pass an explicit color array, e.g. colorScheme={["#1f77b4", "#ff7f0e"]}.`})}function $r(e,t,r){const a=t.colorScheme;if(!a||!Array.isArray(a)||a.length<2)return;const i=a.filter(e=>"string"==typeof e&&e.startsWith("#"));if(i.length<2)return;const n=[];for(let e=0;e<i.length-1;e++){const t=o(i[e],i[e+1]);null!==t&&t<1.5&&n.push(`${i[e]} / ${i[e+1]} (${t.toFixed(1)}:1)`)}n.length>0&&r.push({severity:"warning",code:"LOW_ADJACENT_CONTRAST",message:`${n.length} adjacent color pair(s) in colorScheme have very similar luminance: ${n.join("; ")}. Categories may be hard to distinguish.`,fix:'Alternate light and dark colors in the scheme, or use COLOR_BLIND_SAFE_CATEGORICAL from "semiotic" for a pre-tested palette.'})}function Cr(e,t,r){const a=[];for(const e of Iu)"function"==typeof t[e]&&a.push(e);a.length>0&&r.push({severity:"warning",code:"FUNCTION_ACCESSOR",message:`Function accessor${a.length>1?"s":""} detected: ${a.join(", ")}. If defined inline (e.g. \`xAccessor={d => d.value}\`), every parent re-render creates a new reference; closures over changing values can force unnecessary scene rebuilds on resize/rotation.`,fix:'Use string accessors when possible (e.g. xAccessor="value"), or memoize with useCallback / define outside the component.'})}function Sr(e,t,r){const a=t.hoverRadius,i=!1!==t.enableHover&&(!1!==t.hoverAnnotation||t.tooltip||t.customHoverBehavior||t.customClickBehavior||t.onClick);"number"==typeof a&&a>0&&a<24&&i&&r.push({severity:"warning",code:"TOUCH_TARGET_SMALL",message:`hoverRadius=${a}px is below the ~24px radius needed for reliable 48px touch targets on mobile screens.`,fix:"Use hoverRadius={24} or larger for touch-heavy views. Semiotic floors touch pointer hit testing to 24px, but explicit desktop-only radii should be documented."})}function kr(e,t,r){!0===t.responsiveWidth&&!0===t.responsiveHeight&&r.push({severity:"warning",code:"RESPONSIVE_BOTH_AXES",message:"responsiveWidth and responsiveHeight are both true. On mobile this can create resize feedback loops when the parent height depends on chart content.",fix:"Prefer responsiveWidth={true} with a fixed parent height or size={[width, fixedHeight]}; use a ResizeObserver outside the chart if the height must follow aspect ratio."})}function Rr(e,t,r){if(!0!==t.showParticles)return;const a=t.particleStyle&&"object"==typeof t.particleStyle?t.particleStyle:{},i="number"==typeof a.maxPerLine?a.maxPerLine:void 0,o="number"==typeof a.spawnRate?a.spawnRate:void 0;("number"==typeof i&&i>20||"number"==typeof o&&o>.08)&&r.push({severity:"warning",code:"GEO_PARTICLE_MOBILE_COST",message:"Animated geo particles run a continuous canvas loop that can drain battery and trigger thermal throttling on mobile GPUs.",fix:"Set particleStyle={{ maxPerLine: 12, spawnRate: 0.06 }} for mobile-heavy views, or disable showParticles when reduced-motion or low-power modes are active."})}function Pr(e){return"object"==typeof e&&null!==e&&("tokenType"in e||"tokenSemantics"in e||"countStrategy"in e||"unitValue"in e||"unit"in e)}function Er(e){return"number"==typeof e&&Number.isFinite(e)&&e>=0?e:void 0}function Nr(e,t){const r=Er(e.visibleTokens);if(null!=r)return r;const a=Er(t.denominator);if("fixed-denominator"===t.countStrategy&&null!=a)return a;const i=Er(t.tokenCount),o=Er(t.maxTokens);return null!=i&&null!=o?Math.min(i,o):i??a??o}function Tr(e,t,r){const a=[];Pr(t.tokenEncoding)&&a.push({source:"tokenEncoding",encoding:t.tokenEncoding}),Pr(t.encoding)&&a.push({source:"encoding",encoding:t.encoding});for(const{source:e,encoding:i}of a){const a=Nr(t,i);for(const t of et(i,{visibleTokens:a}))r.push({severity:"warning",code:`TOKEN_${t.code}`,message:t.message,fix:"MISSING_UNIT_VALUE"===t.code?`Set ${e}.unitValue to the value represented by one full token.`:"MISSING_UNIT_MEANING"===t.code?`Set ${e}.unitMeaning so readers know what one full token represents.`:"MISSING_COUNT_STRATEGY"===t.code?`Set ${e}.countStrategy to actual, unitized, fixed-denominator, quantile, sample, posterior-sample, or random-sample.`:"TOKEN_SEMANTICS_UNCLEAR"===t.code?`Set ${e}.tokenSemantics to observed-unit, unitized-measure, risk-case, possible-outcome, posterior-sample, hypothetical-case, topic-anchor, or decorative.`:`Adjust ${e} so its semantics, strategy, labels, and visible token count match the task.`})}}function Ir(e){const t={...e};return delete t.tokenEncoding,delete t.visibleTokens,Pr(t.encoding)&&delete t.encoding,t}function Mr(e,t){const r=t.match(/^Unknown prop "([^"]+)"/);if(r)return`Remove \`${r[1]}\` or replace it with a documented ${e} prop.`;const a=t.match(/^"([^"]+)" is required for .+\.$/i)??t.match(/(?:Missing|required) prop "?([^". ]+)/i);return a?`Add the required \`${a[1]}\` prop using the ${e} schema and example.`:t.startsWith("Unknown component")?"Choose a component returned by getSchema() or check the component name for a typo.":`Correct this ${e} prop configuration to match its schema: ${t}`}function Or(e,t){void 0!==e.accessibleTable&&t.push({severity:"error",code:"BIGNUMBER_ACCESSIBLE_TABLE",message:"BigNumber is a value component and does not support accessibleTable.",fix:"Remove accessibleTable. Use label, description, and summary to provide BigNumber's accessible text."})}function jr(e,t){Ee(t)||(t={});const r=[],a=()=>({ok:r.every(e=>"warning"===e.severity),diagnoses:r}),i=/^(XY|Ordinal|Network|Physics|Geo)CustomChart$/.test(e),o=i?[]:Je(e,Ir(t)).errors;if(i){"function"!=typeof t.layout&&o.push("Provide a layout function.");const r="NetworkCustomChart"===e?["nodes","edges"]:"GeoCustomChart"===e?["points","areas","lines"]:["data"];for(const e of r)null==t[e]||Array.isArray(t[e])||o.push(`Provide an array for ${e}.`)}for(const a of o)"BigNumber"===e&&void 0!==t.accessibleTable&&a.startsWith('Unknown prop "accessibleTable"')||r.push({severity:"error",code:"VALIDATION",message:a,fix:i?a:Mr(e,a)});if("BigNumber"===e&&Or(t,r),(i||El[e])&&(lr(t,r),wr(t,r),lt(0,t,r)),!El[e])return a();cr(e,t,r),ur(e,t,r),dr(e,t,r),hr(e,t,r),pr(e,t,r),fr(0,t,r),gr(e,t,r),mr(e,t,r);const n=sr(e,t,void 0,{checkOutliers:!1}).diagnoses;for(const e of n)"EMPTY_DATA"===e.code&&r.some(e=>"EMPTY_DATA"===e.code||"EMPTY_EDGES"===e.code)||r.push(e);if(yr(e,t,r),br(e,t,r),vr(0,t,r),$r(0,t,r),xr(e,t,r),Ar(e,t,r),Cr(0,t,r),Sr(0,t,r),kr(0,t,r),Rr(0,t,r),Tr(0,t,r),ut(0,t,r),dt(0,t,r),ht(0,t,r),pt(0,t,r),wt(e,t,r),ft(e,t,r),mt(e,t,r),r.some(e=>"NEGATIVE_VALUE"===e.code||"NEGATIVE_NORMALIZED_VALUE"===e.code)||gt(e,t,r),yt(e,t,r),bt(e,t,r),vt(e,t,r),Nt(e,t,r),"ProcessSankey"===e)for(const e of Mt(t))r.push(e);return a()}function Fr(e){return!!Array.isArray(e.styleRules)&&e.styleRules.some(e=>{if("object"!=typeof e||null===e)return!1;const t=e.style;if("object"!=typeof t||null===t||Array.isArray(t))return!1;const r=t.fill;return"object"==typeof r&&null!==r&&"hatch"===r.type})}function zr(e){if(!Array.isArray(e))return!1;const t=e.filter(e=>"string"==typeof e&&e.startsWith("#")).map(e=>e.toLowerCase());return t.length>0&&t.every(e=>Mu.has(e))}function Lr(e,t){return"number"==typeof t?`${e}[${t}]`:`${e}.${t}`}function Br(e,t){return`${e}[Symbol(${t.description??""})]`}function Dr(e,t){if(!/^(0|[1-9][0-9]*)$/.test(e))return!1;const r=Number(e);return Number.isSafeInteger(r)&&r>=0&&r<t}function _r(e,t){try{return Object.getOwnPropertyDescriptor(e,t)}catch{return}}function Ur(e,t,r,a){const i=_r(e,t);return i&&"value"in i&&i.enumerable?Gr(i.value,r,a):[r]}function Gr(e,t="$",r=/* @__PURE__ */new Set){if(null===e||"string"==typeof e||"boolean"==typeof e)return[];if("number"==typeof e)return Number.isFinite(e)&&!Object.is(e,-0)?[]:[t];if("object"!=typeof e)return[t];if(r.has(e))return[t];let a,i,o;try{o=Array.isArray(e),a=Object.getPrototypeOf(e),i=Reflect.ownKeys(e)}catch{return[t]}if(a!==(o?Array.prototype:Object.prototype)&&null!==a)return[t];r.add(e);const n=[];try{if(o){const a=_r(e,"length")?.value;if(!Number.isSafeInteger(a)||a<0)return[Lr(t,"length")];for(const e of i)"length"===e||"string"==typeof e&&Dr(e,a)||n.push("symbol"==typeof e?Br(t,e):Lr(t,e));for(let i=0;i<a;i+=1)n.push(...Ur(e,String(i),Lr(t,i),r))}else for(const a of i)"symbol"!=typeof a?n.push(...Ur(e,a,Lr(t,a),r)):n.push(Br(t,a));return n}catch{return[t]}finally{r.delete(e)}}function Vr(){const e=globalThis;return e[Ou]||(e[Ou]={recipes:/* @__PURE__ */new Map,capabilities:/* @__PURE__ */new Map,layouts:/* @__PURE__ */new Map}),e[Ou]}function Hr(e){return Vr().recipes.get(e)}function Wr(e){return Vr().layouts.get(e)?.layout}function qr(e){const t=Vr().layouts.get(e)?.identity;return t?{...t}:void 0}function Yr(e){return"string"==typeof e?Hr(e):e&&"object"==typeof e&&"string"==typeof e.id?e:void 0}function Kr(e){return"string"==typeof e&&e.trim().length>0}function Jr(e,t,r){const a=Fu.has(e)||void 0!==r&&zu.has(r),i=t=>{return i=t,De(r=e)&&!$l[i].includes(r)||a;var r,i},o=ju.filter(e=>Kr(t[e])&&!i(e));return{hasTitle:i("title")&&Kr(t.title),hasDescription:i("description")&&Kr(t.description),hasSummary:i("summary")&&Kr(t.summary),unsupportedFinding:o.length>0?{id:"understandable.unsupported-description-prop",principle:"understandable",heuristic:"Descriptive text is connected to the rendered chart",critical:!0,status:"warn",message:`Useful ${o.join(" and ")} text was supplied, but ${1===o.length?"that prop is":"those props are"} not supported by ${e}'s declared chart API and cannot be credited as rendered accessibility text.`,fix:"Use the component's declared title, description, and summary props when available; for richer generated description or navigation, use ChartContainer with chartConfig plus describe and/or navigable."}:void 0}}function Xr(e,{isValue:t,tableEnabled:r,hasDescription:a,hasSummary:i}){e.push({id:"perceivable.content-only-visual",principle:"perceivable",heuristic:"Content is only visual",critical:!0,...t?{status:"pass",message:"BigNumber renders its value as real text with an ARIA label — available without vision."}:r?{status:"pass",message:"A screen-reader data table + live region expose the data non-visually (accessibleTable is on)."}:a&&i?{status:"manual",message:"accessibleTable is off; a description + summary are present. Verify they convey everything the chart shows.",fix:"Re-enable accessibleTable, or confirm via screen reader that the text alternative is complete."}:{status:"fail",message:"accessibleTable is disabled and there's no full text alternative — the data is only available visually.",fix:"Remove accessibleTable={false}, or provide a complete description/summary plus a data table."}})}function Zr(e,{props:t}){if(null!=t.colorBy){const r=!0===t.directLabel||!0===t.showLabels,a=Fr(t);e.push({id:"perceivable.color-alone",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1,...r?{status:"pass",message:"Categories are encoded by color (colorBy) and also directly labeled, so color isn't the only channel."}:{status:"warn",message:a?"Categories use colorBy and this config authors a HatchFill through styleRules, but a static audit cannot prove those rules give every category a distinct non-color cue. Semiotic does not automatically assign per-category textures.":"Categories are encoded by color (colorBy) with no declared redundant channel. Semiotic supports author-supplied HatchFill patterns through styleRules, but this config has no statically visible HatchFill descriptor and there is no automatic per-category texture assignment.",fix:a?"Verify every category remains distinguishable with color removed; add direct labels where hatching is incomplete, keep categories ≤ ~7, and use a CVD-safe palette.":"Add direct labels (directLabel on LineChart/AreaChart, showLabels on network/hierarchy) or category-targeted styleRules with distinct HatchFill descriptors; keep categories ≤ ~7 and use a CVD-safe palette."}})}}function Qr(e,{isValue:t,tableEnabled:r}){e.push({id:"compromising.table",principle:"compromising",heuristic:"No table",critical:!0,...t?{status:"not-applicable",message:"Single-value display — a table isn't meaningful."}:r?{status:"pass",message:"A human-readable data table is provided (accessibleTable)."}:{status:"fail",message:"accessibleTable is disabled — no human-readable table of the underlying data.",fix:"Remove accessibleTable={false} (unless title/summary/annotations already convey all the data)."}})}function ea(e,{navigable:t,isHierarchy:r,builtIn:a,builtInNote:i,known:o}){e.push({id:"compromising.navigable-structure",principle:"compromising",heuristic:"Information cannot be navigated according to narrative or structure",critical:!1,...t?r?{status:"pass",message:"ChartContainer's navigable option mounts a structured navigation tree, including hierarchy/network branches and their data items."}:{status:"pass",message:"ChartContainer's navigable option mounts a structured tree (chart → axes/series → data points) that screen readers can traverse."}:r?{status:"warn",message:"Hierarchical chart: built-in keyboard navigation is largely flat — it doesn't descend the tree structure.",fix:"Enable ChartContainer's navigable option for a structured navigation tree, or lean on the data table and a summary that conveys the hierarchy."}:{status:a,message:`Keyboard navigation steps through points and switches series/groups${i}.`,fix:o?"For deeper structure (axis → series → datum), enable ChartContainer's navigable option.":void 0}})}function ta(e,{component:t,props:r}){{const a=Array.isArray(r.data)?r.data:null,i=Array.isArray(r.nodes)?r.nodes:null,o={id:"assistive.data-density",principle:"assistive",heuristic:"Data density is inappropriate",critical:!0};let n;n=Vl.has(t)&&a&&a.length>7?{...o,status:"warn",message:`${a.length} slices in a part-to-whole chart. Chartability suggests ≤ 5 categories; many thin slices are hard to perceive and to describe.`,fix:'Group small slices into an "Other" category, or switch to a ranked bar chart.'}:i&&i.length>200?{...o,status:"warn",message:`${i.length} nodes. A network this size is hard to navigate non-visually node by node.`,fix:"Provide a summary of structure (clusters, hubs, components) and consider filtering or aggregating the graph."}:a&&a.length>5e3?{...o,status:"warn",message:`${a.length} data points. Canvas renders this fine, but the non-visual table/navigation become unwieldy.`,fix:"Aggregate or bin for the accessible representation, or expose summary statistics rather than every row."}:a?{...o,status:"pass",message:`${a.length} data points — a reasonable density for non-visual consumption.`}:i?{...o,status:"pass",message:`${i.length} nodes — a reasonable density for non-visual consumption.`}:{...o,status:"manual",message:"Data not provided inline (push mode); verify density at runtime."},e.push(n)}}function ra(e,{props:t}){{const r=Array.isArray(t.data)?t.data:null,a=["valueFormat","yFormat","xFormat","tickFormat","format"].some(e=>"function"==typeof t[e]||"string"==typeof t[e]);let i=!1;if(r&&!a)for(const e of r.slice(0,50))if(e&&"object"==typeof e){for(const t of Object.values(e))if("number"==typeof t&&Number.isFinite(t)&&Math.abs(t)>=1e5){i=!0;break}if(i)break}i&&e.push({id:"assistive.human-readable-numbers",principle:"assistive",heuristic:"Data in text is not human-readable",critical:!1,status:"warn",message:'Data includes large numbers (≥ 100,000) and no value/tick formatter — screen readers will read every digit (e.g. "six hundred fifty thousand…").',fix:'Pass valueFormat / yFormat (e.g. a compact formatter so 6,500,000 reads as "6.5M"); the formatter flows to ticks, tooltips, and the data table.'})}}function aa(e,{isValue:t,tableEnabled:r}){e.push({id:"assistive.skippable-navigation",principle:"assistive",heuristic:"Navigation and interaction is tedious",critical:!0,...t?{status:"not-applicable",message:"Single value — nothing to skip."}:r?{status:"pass",message:'A "Skip to data table" link lets screen-reader users bypass point-by-point navigation.'}:{status:"warn",message:"accessibleTable is off, removing the skip-to-table affordance.",fix:"Keep accessibleTable enabled so users can skip past dense point navigation."}})}function ia(e){const t=e?.provenance?.confidence;return"number"==typeof t&&Number.isFinite(t)?t:null}function oa(e){return"primary"===e?.emphasis||"secondary"===e?.emphasis||null!=ia(e)}function na(e){const t=e.split(/[.!?]+/).map(e=>e.trim()).filter(Boolean),r=e.trim().split(/\s+/).filter(Boolean);if(0===r.length||0===t.length)return null;let a=0;for(const e of r)a+=sa(e);return r.length/t.length*.39+a/r.length*11.8-15.59}function sa(e){const t=e.toLowerCase().replace(/[^a-z]/g,"");if(!t)return 0;if(t.length<=3)return 1;const r=t.replace(/(?:[^laeiouy]es|ed|[^laeiouy]e)$/,"").replace(/^y/,"").match(/[aeiouy]{1,2}/g);return r?r.length:1}function ca(e){return!1!==e.tooltip||null!=e.onClick||null!=e.brush||null!=e.onBrush||null!=e.selection||null!=e.linkedHover||null!=e.linkedBrush}function la(e){return e.physics&&"object"==typeof e.physics?e.physics:{}}function ua(e){const t=la(e),r=e.controls&&"object"==typeof e.controls?e.controls:{};return!0===e.pauseControl||!0===t.pauseControl||!0===r.pause||"function"==typeof r.pause}function da(e){const t=la(e);return!0===e.settledProjection||!0===t.settledProjection}function ha(e){const t=la(e);return!0===e.reducedMotionSettle||"settle"===e.reducedMotion||!0===t.reducedMotionSettle||"settle"===t.reducedMotion}function pa(e){const t={id:"perceivable.low-contrast",principle:"perceivable",heuristic:"Low contrast",critical:!0},r=e.colorScheme,a="string"==typeof e.background?e.background:null;if(a&&!a.startsWith("#"))return{...t,status:"manual",message:`Background "${a}" isn't a hex literal (theme/CSS variable) — contrast can't be verified statically.`,fix:'Pass a hex `background` (e.g. "#ffffff"/"#000000"), or verify contrast manually once the theme resolves.'};const i=a??"#ffffff";if(!Array.isArray(r))return{...t,status:"manual",message:"Mark colors come from the theme/CSS variables — contrast can't be verified statically.",fix:"Confirm geometries/large text have ≥ 3:1 and regular text ≥ 4.5:1 contrast against the background."};const n=[];let s=0;for(const e of r){if("string"!=typeof e||!e.startsWith("#"))continue;const t=o(e,i);null!=t&&(s++,t<3&&n.push(`${e} (${t.toFixed(1)}:1)`))}return 0===s?{...t,status:"manual",message:"colorScheme has no parseable hex colors to check.",fix:"Verify contrast manually for non-hex colors."}:n.length>0?{...t,status:"fail",message:`${n.length} color(s) fall below 3:1 contrast vs ${i}: ${n.join(", ")}.`,fix:"Darken (light background) or lighten (dark background) those colors, or use COLOR_BLIND_SAFE_CATEGORICAL."}:{...t,status:"pass",message:`All ${s} checked colorScheme color(s) meet ≥ 3:1 contrast vs ${i}.`}}function fa(e,t,r={}){const a=[],i=Hr(e),o=Kl.has(e),n=De(e)||!!i||o,s=!0===r.inChartContainer,c=!0===r.describe,l=!0===r.navigable,u=Wl.has(e),d=Fl.has(e),{hasTitle:h,hasDescription:p,hasSummary:f,unsupportedFinding:m}=Jr(e,t,i?.frameFamily),g=!1!==t.accessibleTable&&!u,y=h||p||f,b=ca(t),v=ua(t),w=o,A=da(t)||Xl.has(e)&&g,x=ha(t)||w,$=Array.isArray(t.annotations)?t.annotations.filter(e=>!!e&&"object"==typeof e):[],C=n?"pass":"manual",S=n?"":` (unrecognized component "${e}" — verify manually that the built-in applies)`,k={component:e,props:t,isValue:u,tableEnabled:g,hasDescription:p,hasSummary:f,known:n,builtIn:C,builtInNote:S,navigable:l,isHierarchy:d};if(m&&a.push(m),a.push(pa(t)),Xr(a,k),a.push({id:"perceivable.small-text",principle:"perceivable",heuristic:"Small text size",critical:!0,status:"pass",message:"Semiotic's default tick and axis-label fonts are 12px, meeting Chartability's 9pt/12px floor.",fix:"If a theme or override lowers --semiotic-tick-font-size below 12px, raise it back for low-vision audiences."}),a.push({id:"perceivable.seizure-risk",principle:"perceivable",heuristic:"Visual presents seizure risk",critical:!0,...null!=t.pulse||Jl.has(e)?{status:"manual",message:"Pulse/continuous animation is in use. Confirm nothing flashes more than 3×/sec, especially saturated red.",fix:"Avoid red flashes and rapid (>3 Hz) flicker; reduced-motion is auto-honored, but verify the default presentation."}:{status:"manual",message:"No flashing detected statically. Confirm no element flashes more than 3×/sec.",fix:"Manual check — most static charts pass trivially."}}),Zr(a,k),null!=t.colorBy){const e=Fr(t),r=zr(t.colorScheme);a.push({id:"perceivable.cvd-safe",principle:"perceivable",heuristic:"Not CVD-friendly",critical:!1,...r?{status:"pass",message:"colorScheme uses Semiotic's Wong colorblind-safe palette."}:{status:"manual",message:"Color encodes meaning; statically we can't confirm the palette is colorblind-safe.",fix:'Use COLOR_BLIND_SAFE_CATEGORICAL from "semiotic", or test your scheme with Viz Palette / Chroma.'}}),a.push({id:"flexible.textures-adjustable",principle:"flexible",heuristic:"Contrast and textures cannot be adjusted",critical:!1,status:"warn",message:e?"This config uses an author-supplied HatchFill through styleRules, but Semiotic has no automatic, theme-aware per-category texture channel or user-facing texture toggle.":"Semiotic supports author-supplied HatchFill patterns through styleRules, but this config has no statically visible HatchFill descriptor; there is no automatic, theme-aware per-category texture channel or user-facing texture toggle.",fix:e?"Verify the authored hatches cover every meaningful category and remain legible in the active theme; pair them with direct labels and a CVD-safe palette.":"Use category-targeted styleRules with distinct HatchFill descriptors or direct labels so the encoding survives color removal. Contrast itself is themeable via CSS variables."})}{const e=$.filter(rt);if(e.length>0){const r=t.autoPlaceAnnotations,i="object"==typeof r&&null!==r&&!0===r.redundantCues,o=e.filter(e=>{if("string"!=typeof e.color)return!1;const t=tt(e),r=i&&"text"===t;return!(it(e)||r)});a.push({id:"perceivable.annotation-association",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1,...0===o.length?{status:"pass",message:"No annotation relies on color alone to indicate its target — wherever color is used, a connector, enclosure, or reference-line cue is present too."}:{status:"warn",message:`${o.length} of ${e.length} annotation(s) carry a color but no connector, enclosure, or reference-line cue, so a color-blind or non-visual reader can't tie them to their target (the correspondence problem).`,fix:"Add a connector (the label/callout default), place the note adjacent to its target, enclose the target, or enable autoPlaceAnnotations: { redundantCues: true } to give colored text notes a leader line — don't rely on color matching alone."}})}}a.push({id:"operable.single-input-modality",principle:"operable",heuristic:"Interaction modality only has one input type",critical:!0,...n?{status:"pass",message:"Built-in keyboard navigation (arrows/Home/End/PageUp-Down/Enter) mirrors mouse hover."}:{status:"manual",message:`Can't confirm keyboard support for "${e}".`,fix:"Verify Tab + arrow-key operation."}});{const e=[];null==t.brush&&null==t.onBrush||e.push("brushing"),!0===t.zoomable&&e.push("zoom/pan"),"isolate"!==t.legendInteraction&&"highlight"!==t.legendInteraction||e.push("legend filtering"),e.length>0&&a.push({id:"operable.complex-action-alternatives",principle:"operable",heuristic:"Complex actions have no alternatives",critical:!1,status:"warn",message:`Mouse-driven ${e.join(", ")} ${e.length>1?"have":"has"} no built-in keyboard/standard-UI equivalent.`,fix:"Pair the complex interaction with a standard control (range inputs for a brush, buttons for zoom, a checkbox list for legend filtering) operable by keyboard and screen reader."})}{const r=ru[e];if(r&&b){const e=t[r];"number"==typeof e&&e>0&&2*e<24&&a.push({id:"operable.target-size",principle:"operable",heuristic:"Target pointer interaction size is too small",critical:!1,status:"warn",message:`${r}=${e} gives a ~${2*e}px hit target, below the 24×24px minimum for pointer interaction.`,fix:"Increase the radius, or rely on the chart's hoverRadius / keyboard navigation as the alternative for precise selection."})}}a.push({id:"operable.tab-stops",principle:"operable",heuristic:"Inappropriate tab stops",critical:!1,status:C,message:`The chart takes a single tab stop and navigates data with arrow keys${S} — the recommended pattern for dense charts (no per-datum tab stops to wade through).`}),a.push({id:"operable.interaction-cues",principle:"operable",heuristic:"No interaction cues or instructions",critical:!0,...b?f||p?{status:"manual",message:"Chart is interactive and has descriptive text. Confirm that text explains how to interact (keyboard + pointer).",fix:'State the interaction model in summary, e.g. "Use arrow keys to move between points."'}:{status:"warn",message:"Chart is interactive but nothing explains how to use it.",fix:"Describe the interaction in a summary or nearby text (keyboard navigation, what hover/click reveals)."}:{status:"not-applicable",message:"No interactive behavior detected."}}),a.push({id:"operable.controls-override-at",principle:"operable",heuristic:"Controls override AT controls",critical:!0,status:C,message:`Keyboard handlers fire only while the chart has focus, so they don't hijack page/app screen-reader shortcuts${S}.`}),a.push({id:"operable.focus-indicator",principle:"operable",heuristic:"Keyboard focus indicator missing, obscured, or low contrast",critical:!1,status:C,message:`A shape-adaptive focus ring (var(--semiotic-focus)) marks the focused element${S}.`,fix:n?"Ensure --semiotic-focus keeps ≥ 3:1 contrast against your background.":void 0}),a.push({id:"understandable.title-summary-caption",principle:"understandable",heuristic:"No title, summary, or caption",critical:!0,...y?{status:"pass",message:`Provided: ${[h&&"title",p&&"description",f&&"summary"].filter(Boolean).join(", ")}.`}:s?{status:"manual",message:"No title/description/summary on the chart. If the wrapping ChartContainer supplies a title/subtitle, this is covered at that layer — verify it does.",fix:"Give the ChartContainer a title (and optionally enable describe), or set title/description/summary on the chart."}:{status:"fail",message:"No title, description, or summary — the screen reader falls back to a generic label.",fix:"Add title/description/summary on the chart, or wrap it in a ChartContainer (the opt-in layer for title/caption/description chrome)."}}),a.push({id:"understandable.explain-purpose",principle:"understandable",heuristic:"No explanation for purpose or for how to read",critical:!0,...p||f?{status:"pass",message:"A description/summary is available to explain purpose and how to read the chart."}:c?{status:"manual",message:"ChartContainer's describe option explains how to read the chart (type, stats, trend). Confirm the domain purpose — why this chart exists — is also conveyed (title/subtitle).",fix:"Give the ChartContainer a title/subtitle stating the purpose; describe() covers the how-to-read half."}:h?{status:"warn",message:"Only a title is set — a label, not an explanation of purpose or how to read the chart.",fix:"Add a summary, or enable ChartContainer's describe option for an auto-generated how-to-read description."}:{status:"fail",message:"Nothing explains the chart's purpose or how to read it.",fix:"Add a summary/description, or wrap in a ChartContainer with a title and the describe option (the opt-in full-accessibility layer)."}});{const e=[t.description,t.summary].filter(Kr).join(". "),r=e?na(e):null;a.push({id:"understandable.reading-level",principle:"understandable",heuristic:"Reading level inappropriate",critical:!0,...null==r?{status:"not-applicable",message:"No description/summary text to grade."}:r>9?{status:"warn",message:`Description/summary reads at ~grade ${r.toFixed(0)}; Chartability targets grade 9 or lower.`,fix:"Shorten sentences and prefer common words."}:{status:"pass",message:`Description/summary reads at ~grade ${Math.max(0,Math.round(r))} (≤ 9).`}})}if(ql.has(e)){const e=Kr(t.xLabel),r=Kr(t.yLabel);a.push({id:"understandable.axis-labels",principle:"understandable",heuristic:"Axis labels are unclear or missing",critical:!1,...e&&r?{status:"pass",message:"Both axes are labeled (xLabel, yLabel)."}:{status:"warn",message:`Missing axis label: ${[!e&&"xLabel",!r&&"yLabel"].filter(Boolean).join(", ")}. Ticks alone may not name the variable.`,fix:"Set xLabel and yLabel to name each axis's variable and units."}})}if(eu.has(e)&&a.push({id:"understandable.information-complexity",principle:"understandable",heuristic:"Information complexity is inappropriate",critical:!1,status:"warn",message:"Dual-axis chart: two y-scales are hard to read accurately and notoriously easy to misinterpret (the crossover point is arbitrary).",fix:"Confirm the second axis is necessary; consider two aligned charts (small multiples) or indexing both series to a common baseline. Label each axis and its series unambiguously."}),$.length>1){const e=$.filter(oa).length,t=$.length-e;a.push({id:"understandable.annotation-hierarchy",principle:"understandable",heuristic:"Information complexity is inappropriate",critical:!1,...e===$.length?{status:"pass",message:`All ${$.length} annotation(s) declare hierarchy through emphasis or provenance confidence, so the renderer can resolve reading order and visual priority.`}:0===e?{status:"warn",message:`${$.length} annotations are present with no emphasis or provenance confidence; readers may not know which note is primary.`,fix:'Mark the main annotation with emphasis="primary", set supporting notes to emphasis="secondary", or provide provenance.confidence so Semiotic can infer order.'}:{status:"warn",message:`${t} of ${$.length} annotation(s) have no emphasis or provenance confidence; readers may not know which note is primary among the unordered notes.`,fix:"Set emphasis on each annotation (primary/secondary), or provide provenance.confidence on all annotations so Semiotic can infer order."}})}(null!=t.forecast||null!=t.anomaly||null!=t.band||null!=t.regression)&&a.push({id:"understandable.uncertainty",principle:"understandable",heuristic:"Statistical uncertainty isn't clearly communicated",critical:!1,status:"manual",message:"The chart shows a forecast/regression/band/anomaly overlay. Confirm the uncertainty it represents is explained in text, not just drawn.",fix:"State the confidence interval / method in the summary, and label the band so it isn't mistaken for data."}),null!=t.animate&&!1!==t.animate&&a.push({id:"understandable.changes-followable",principle:"understandable",heuristic:"Changes are not easy to follow",critical:!1,status:C,message:`Transitions animate with object constancy and data changes are mirrored to the live region${S}.`,fix:n?"Keep transition durations in the 250ms–2s range so changes are followable but not slow.":void 0}),a.push({id:"robust.conforms-to-standards",principle:"robust",heuristic:"Does not conform to standards",critical:!1,status:"manual",message:"WCAG 2.1 / Section 508 conformance can't be settled from config alone.",fix:"Run an automated checker (axe) on the rendered output and test with real assistive tech."}),a.push({id:"robust.semantically-valid",principle:"robust",heuristic:"Semantically invalid",critical:!1,status:"manual",message:"Whether interactive elements expose correct roles/names is a render-time, screen-reader question.",fix:"Verify with a screen reader that buttons read as buttons, the chart as an image/group, etc."}),a.push({id:"robust.fragile-technology-support",principle:"robust",heuristic:"Fragile technology support",critical:!1,status:C,message:`Charts render on canvas with an SVG overlay and render to SVG in SSR, so access isn't tied to one rendering path${S}.`,fix:n?"Still test across NVDA+Firefox, JAWS+Chrome, and VoiceOver+Safari — AT support varies.":void 0}),Qr(a,k),u||a.push({id:"compromising.table-static",principle:"compromising",heuristic:"Table/data is static",critical:!1,...s?{status:"manual",message:"Rendered in a ChartContainer. If a data-download action is enabled, the data is exportable.",fix:"Enable the ChartContainer data-download action so users can save the underlying data (keep it opt-in)."}:{status:"warn",message:"The data table is read-only — not downloadable, sortable, or filterable.",fix:"Wrap the chart in a ChartContainer and enable its data-download action (opt-in, so deployments can withhold it where export isn't allowed)."}}),a.push({id:"compromising.shareable-state",principle:"compromising",heuristic:"State is not easy to share and reproduce",critical:!1,status:n?"pass":"manual",message:`Chart state serializes via toConfig/toURL/copyConfig${n?"":S}.`,fix:n?"Expose it to users via the ChartContainer copyConfig action or a shareable URL.":void 0}),ea(a,k),ta(a,k),ra(a,k),a.push({id:"assistive.features-described",principle:"assistive",heuristic:"Visually apparent features and relationships are not described",critical:!1,...c?{status:"pass",message:"ChartContainer's describe option auto-generates an L1–L3 description (chart type, statistics, and trend) via describeChart()."}:f?{status:"manual",message:"A summary is present. Confirm it describes trends, extrema, clusters, and outliers — not just what the chart is.",fix:"Cover the L2/L3 content blind readers value most: direction of trend, peak/trough, notable outliers."}:{status:"warn",message:"No text describes the visually apparent trends, extrema, or outliers.",fix:"Enable ChartContainer's describe option (auto-generates via describeChart()), or write a summary covering the key trend and notable points."}}),aa(a,k),a.push({id:"flexible.user-style-respected",principle:"flexible",heuristic:"User style change not respected",critical:!0,status:C,message:`Styling flows through CSS custom properties and honors forced-colors mode, so user/user-agent style changes cascade in${S}.`,fix:n?"Avoid hardcoding colors via frameProps style fns that bypass theme variables.":void 0}),a.push({id:"flexible.reduced-motion",principle:"flexible",heuristic:"Long animations cannot be controlled",critical:!1,...Jl.has(e)||Ql.has(e)?v?{status:"pass",message:`${e} animates continuously and declares an in-chart pause/stop control.`}:{status:"warn",message:`${e} animates continuously. prefers-reduced-motion is auto-honored, but there's no in-chart pause/stop control for users who don't set that preference.`,fix:"Offer a pause/stop control for looping/streaming motion (Chartability requires it for animation > 2s)."}:{status:C,message:`prefers-reduced-motion is auto-detected; transitions fast-forward and looping animation stops${S}.`}}),o&&(a.push({id:"flexible.sim-pause-control",principle:"flexible",heuristic:"Long animations cannot be controlled",critical:!1,...v?{status:"pass",message:"Physics simulation exposes a pause/stop control for users who need to stop motion."}:{status:"warn",message:"Physics simulation has no declared pause/stop control.",fix:"Provide a visible pause control and set physics.pauseControl=true (or pauseControl=true) so the contract is auditable."}}),a.push({id:"flexible.settled-projection",principle:"flexible",heuristic:"User style change not respected",critical:!1,...A?{status:"pass",message:"A settled-projection table is declared, so non-visual readers get aggregate chart semantics instead of trajectories."}:{status:"warn",message:"Physics chart does not declare a settled projection for its accessible table.",fix:"Provide aggregate rows from the settled projection and set physics.settledProjection=true."}}),a.push({id:"flexible.reduced-motion-settle",principle:"flexible",heuristic:"Long animations cannot be controlled",critical:!1,...x?{status:"pass",message:"Reduced-motion mode settles the simulation to a static chart state instead of freezing bodies mid-flight."}:{status:"warn",message:"Physics chart does not declare reduced-motion synchronous settle behavior.",fix:"In reduced motion, run the world to its settled projection and paint once; set physics.reducedMotionSettle=true."}}));{const r=!0===t.responsiveWidth||!0===t.responsiveHeight,i=tu.has(e)&&!0===t.zoomable;a.push({id:"flexible.zoom-reflow",principle:"flexible",heuristic:"Zoom and reflow are not supported",critical:!1,...r?{status:"pass",message:`Chart reflows to its container (${[!0===t.responsiveWidth&&"responsiveWidth",!0===t.responsiveHeight&&"responsiveHeight"].filter(Boolean).join(", ")}), so page zoom doesn't clip it.`}:i?{status:"pass",message:"Geo chart is zoomable/pannable."}:{status:"manual",message:"Fixed width/height — verify the chart survives browser zoom and reflow without clipping or loss of function.",fix:"Use responsiveWidth/responsiveHeight so the chart reflows to its container."}})}if(i){const e=i.encodings?.some(e=>"color"===e.channel&&(!e.redundantWith||0===e.redundantWith.length));e&&a.push({id:"perceivable.recipe-color-alone",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1,status:"warn",message:`${i.name} declares a color encoding without a redundant cue.`,fix:"Add shape, label, position, texture, or a textual category summary to the recipe encoding."}),"required"!==i.accessibility.description||p||a.push({id:"understandable.recipe-description",principle:"understandable",heuristic:"Features are not described",critical:!1,status:"fail",message:`${i.name} requires a recipe-aware description, but none is attached.`,fix:"Call describeChart with recipeId/recipe metadata and attach the returned text as description."}),i.accessibility.fallbackTable&&!1===t.accessibleTable&&a.push({id:"compromising.recipe-fallback",principle:"compromising",heuristic:"No data table is provided",critical:!0,status:"fail",message:`${i.name} requires a fallback table, but accessibleTable is disabled.`,fix:"Enable accessibleTable and preserve recipe-declared table fields on scene nodes."})}const R=a.filter(e=>"not-applicable"!==e.status).filter(e=>e.critical),P={criticalsPassed:R.filter(e=>"pass"===e.status).length,criticalsEvaluated:R.length,fails:a.filter(e=>"fail"===e.status).length,warnings:a.filter(e=>"warn"===e.status).length,manual:a.filter(e=>"manual"===e.status).length,passes:a.filter(e=>"pass"===e.status).length};return{component:e,ok:!R.some(e=>"fail"===e.status),summary:P,findings:a,reference:Lu}}function ma(e,{onlyCritical:t=!1}={}){const r=[];for(const a of e.findings)"fail"!==a.status&&"warn"!==a.status||t&&!a.critical||r.push(a.message);return r}function ga(e){const t=[],r=e.summary,a=e.ok?`${r.criticalsPassed}/${r.criticalsEvaluated} critical heuristics pass`:`${r.fails} blocking failure(s) — ${r.criticalsPassed}/${r.criticalsEvaluated} critical heuristics pass`;t.push(`${e.ok?"✓":"✗"} ${e.component}: accessibility audit (Chartability POUR-CAF)`),t.push(` ${a} · ${r.warnings} warning(s) · ${r.manual} to verify manually`);for(const r of Du){const a=e.findings.filter(e=>e.principle===r&&"not-applicable"!==e.status);if(0!==a.length){t.push(""),t.push(` ${r.toUpperCase()}`);for(const e of a){const r=e.critical?" [critical]":"";t.push(` ${Bu[e.status]} ${e.id}${r}: ${e.message}`),!e.fix||"fail"!==e.status&&"warn"!==e.status&&"manual"!==e.status||t.push(` → ${e.fix}`)}}}return t.push(""),t.push(` Ref: ${e.reference}`),t.join("\n")}function ya(e){return e.semanticDiagnostics?.length?e.semanticDiagnostics:"degenerate"===e.semanticStatus?[_u]:[]}function ba(e){const{contract:t,transfer:r,binding:a}=e;if(void 0===t&&void 0===r&&void 0===a)return[];const i=[],o=Array.isArray(a?.mismatchPaths)?a.mismatchPaths.filter(e=>"string"==typeof e):[];return r&&"preserved"!==r.status&&"excluded"!==r.status?i.push({id:"artifact.transfer-invalid",status:"fail",message:`The attached artifact transfer is ${r.status}; its contract cannot be relied on for publication.`}):r&&void 0!==t||i.push({id:"artifact.transfer-unknown",status:"unknown",message:"The attached artifact lacks a contract or a transfer report."}),"mismatch"===a?.status||o.length>0?i.push({id:"artifact.identity-mismatch",status:"fail",message:"The attached artifact does not identify this chart input"+(o.length?`: ${o.join(", ")}`:".")}):("match"!==a?.status||!Array.isArray(a.mismatchPaths)||!Array.isArray(a.unknownPaths)||a.mismatchPaths.length>0||a.unknownPaths.length>0)&&i.push({id:"artifact.identity-unknown",status:"unknown",message:"The attached artifact identity has not been fully verified."}),i}function va(e){return e.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function wa(e,t,r){return{id:`${t}.${e.code.toLowerCase()}.${r+1}`,stage:t,severity:e.severity,code:e.code,message:e.message,...e.fix?{fix:e.fix}:{},source:"data"===t?"auditData":"diagnoseConfig",...e.field?{field:e.field}:{},...e.role?{role:e.role}:{},...e.rows?{rows:e.rows}:{},...void 0!==e.count?{count:e.count}:{}}}function Aa(e,t){const r="fail"===e.status?"error":"warn"===e.status?"warning":"manual";return{id:e.id||`accessibility.${t+1}`,stage:"accessibility",severity:r,code:e.id,message:e.message,...e.fix?{fix:e.fix}:{},source:"auditAccessibility",critical:e.critical,principle:e.principle,heuristic:e.heuristic}}function xa(e){return e.map((e,t)=>({finding:e,index:t})).sort((e,t)=>{const r=Uu[e.finding.severity]-Uu[t.finding.severity];if(0!==r)return r;const a=!0===e.finding.critical;if(a!==(!0===t.finding.critical))return a?-1:1;const i=Gu[e.finding.stage]-Gu[t.finding.stage];return 0!==i?i:e.index-t.index}).map(({finding:e},t)=>({...e,rank:t+1}))}function $a(e,t){const r=[];e.component!==t&&r.push({id:"render.component-mismatch",stage:"render",severity:"error",code:"RENDER_COMPONENT_MISMATCH",message:"The render evidence names a different chart component.",source:"renderChartWithEvidence"});for(const t of ba({contract:e.artifactContract,transfer:e.artifactTransfer,binding:e.artifactBinding}))r.push({id:`render.${t.id}`,stage:"render",severity:"fail"===t.status?"error":"manual",code:t.id.toUpperCase().replace(/[.-]/g,"_"),message:t.message,source:"artifactAttachmentIssues"});e.empty&&r.push({id:"render.empty-scene",stage:"render",severity:"error",code:"EMPTY_SCENE",message:"The renderer produced no data marks.",fix:"Check the data shape, accessors, scales, and filters against the rendered evidence.",source:"renderChartWithEvidence"});const a=/* @__PURE__ */new Set;for(const t of ya(e))a.add(t.code),r.push({id:`render.${t.code.toLowerCase()}`,stage:"render",severity:t.severity,code:t.code,message:t.message,...t.fix?{fix:t.fix}:{},source:"capability.semanticViability"});for(const t of e.warnings)a.has(t)||r.push({id:`render.${t.toLowerCase()}`,stage:"render",severity:"warning",code:t,message:`The renderer reported ${va(t).toLowerCase()}.`,fix:"Inspect the render evidence and resolve the warning before relying on the chart.",source:"renderChartWithEvidence"});return r}function Ca(e,t){const r=e.filter(e=>"manual"!==e.severity),a=r.slice(0,t).map(e=>({id:`chart-evaluation-${e.id}`,level:"error"===e.severity?"error":"warning",title:`${e.stage}: ${va(e.code)}`,message:e.fix?`${e.message} ${e.fix}`:e.message,source:"Semiotic chart evaluation",dismissible:!0}));return r.length>t&&a.push({id:"chart-evaluation-overflow",level:"warning",title:"Additional chart evaluation findings",message:r.length-t+" additional finding(s) are available in the ranked evaluation result.",source:"Semiotic chart evaluation",dismissible:!0}),a}function Sa(e){const t=e.ok?"PASS":"ISSUES FOUND",r=[`${e.component}: ${t}`,`${e.summary.errors} error(s) · ${e.summary.warnings} warning(s) · ${e.summary.manual} manual check(s)`];for(const t of e.findings)r.push(`${t.rank}. [${t.stage}/${t.code}] ${t.message}`),t.fix&&r.push(` Fix: ${t.fix}`);return r.join("\n")}function ka(e,t={},r,a={}){const i=void 0===r?t:{...t,data:r},o=Je(e,i),n=sr(e,i,r,a.dataAudit),s=jr(e,i).diagnoses.filter(e=>"data"!==e.domain&&"VALIDATION"!==e.code),c=fa(e,i,{inChartContainer:a.inChartContainer,describe:a.describe,navigable:a.navigable}),l=[];for(const[e,t]of o.errors.entries())l.push({id:`validation.${e+1}`,stage:"deception",severity:"error",code:"VALIDATION",message:t,fix:"Correct the component name, required props, prop types, and data shape.",source:"validateProps"});let u;n.diagnoses.forEach((e,t)=>{l.push(wa(e,"data",t))}),s.forEach((e,t)=>{l.push(wa(e,"deception",t))}),c.findings.filter(e=>"pass"!==e.status&&"not-applicable"!==e.status).forEach((e,t)=>{l.push(Aa(e,t))});const d=l.some(e=>"error"===e.severity&&"accessibility"!==e.stage);if(a.render&&o.valid&&!d)try{u=a.render(e,i).evidence,l.push(...$a(u,e))}catch{l.push({id:"render.failed",stage:"render",severity:"error",code:"RENDER_FAILED",message:"The injected renderer failed before producing render evidence.",fix:"Check the chart configuration and renderer-specific requirements.",source:"renderChartWithEvidence"})}const h=xa(l),p=h.filter(e=>"error"===e.severity).length,f=h.filter(e=>"warning"===e.severity).length,m=h.filter(e=>"manual"===e.severity).length,g=Ca(h,Math.max(0,Math.floor(a.notificationMax??8)));return{component:e,validation:o,data:n,deception:s,accessibility:c,...u?{evidence:u}:{},ok:0===p,summary:{errors:p,warnings:f,manual:m,findings:h.length,notifications:g.length},findings:h,notifications:g}}function Ra(e,t=8){return Ca(e,Math.max(0,Math.floor(t)))}function Pa(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function Ea(e){return"string"==typeof e&&e.trim().length>0}function Na(e){const t=Pa(e.capability)?e.capability:null,r=Pa(e.recipe)?e.recipe:null,a=[e.mobileSemantics,e.mobileVisualization,e.mobile,t?.mobile,r?.mobile];for(const e of a)if(Pa(e))return e;return null}function Ta(e,t){return e.includes("CustomChart")||e.includes("Custom")||null!=t.recipeId||null!=t.mobileSemantics}function Ia(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 Ma(e){return Ia(e.size)||Ia(Pa(e.frameProps)?e.frameProps.size:void 0)||("number"==typeof e.width&&"number"==typeof e.height?[e.width,e.height]:null)}function Oa(e){const t=Na(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}function ja(e){const t=Na(e),r=Pa(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===r?.tapToSelect||!0===r?.tapToLockTooltip||Array.isArray(t?.interaction?.alternatives)&&t.interaction.alternatives.length>0||"tap"===t?.interaction?.primary||"button"===t?.interaction?.primary||Ea(t?.interaction?.hoverFallback)}function Fa(e,t){const r=Na(e),a=Pa(e.mobileInteraction)?e.mobileInteraction:null,i=a?.standardControls,o=Array.isArray(r?.interaction?.alternatives)&&r.interaction.alternatives.length>0;return!(null==e.controls&&null==e.mobileControls&&!0!==e.alternativeControls&&!o)||!0===i||"all"===i||t.every(e=>"brush"===e?Array.isArray(i)?i.includes("brush"):"brush"===i:"pan/zoom"===e?Array.isArray(i)?i.includes("zoom"):"zoom"===i:"legend filtering"===e&&(Array.isArray(i)?i.includes("legend"):"legend"===i))}function za(e){const t=Pa(e.frameProps)?e.frameProps:{};return(!0===e.enableHover||null!=e.tooltipContent||null!=e.tooltip||null!=t.tooltipContent||!0===t.enableHover)&&!ja(e)}function La(e){const t=[e.data,e.points,e.lines,e.nodes,e.edges,e.areas,Pa(e.frameProps)?e.frameProps.data:void 0];let r=0;for(const e of t)Array.isArray(e)&&(r+=e.length);return r}function Ba(e){const t=[e.tickValues,e.xTickValues,e.yTickValues,e.rTickValues,e.oTickValues];let r=0;for(const e of t)Array.isArray(e)&&(r+=e.length);return r>0?r:null}function Da(e,t){const r=ru[e];if("string"!=typeof r)return null;let a=30;for(const e of[r,"hoverRadius"]){const r=t[e];"number"==typeof r&&Number.isFinite(r)&&r>0&&(a=Math.max(a,r))}return 2*a}function _a(e,t){e.push({...t,status:"pass"})}function Ua(e,t){e.push({...t,status:"warn"})}function Ga(e,t){e.push({...t,status:"manual"})}function Va(e,t={},r={}){const a=r.viewportWidth??390,i=r.targetSize??44,o=Ma(t),n=de(t,{width:a,height:o?.[1]}),s=[],c=Ma(t=n.props),l=Na(t),u=Ta(e,t),d=Oa(t),h=!0===r.inChartContainer,p=Ea(t.title)||Ea(t.summary)||Ea(t.description)||!0===l?.summary||Ea(l?.summary);if(n.matches.length>0&&_a(s,{id:"layout.responsive-rule-applied",category:"layout",impact:"medium",message:`${n.matches.length} responsive rule(s) applied for the ${a}px mobile audit.`}),c){const[t,r]=c;t>a&&!d?Ua(s,{id:"layout.fixed-desktop-size",category:"layout",impact:"high",message:`Chart size is ${t}px wide against a ${a}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."}):_a(s,{id:"layout.fixed-desktop-size",category:"layout",impact:"high",message:"No fixed desktop-width overflow risk is visible from the config."}),"number"==typeof l?.minViewportWidth&&l.minViewportWidth>a&&Ua(s,{id:"layout.mobile-min-width",category:"layout",impact:"high",message:`The declared mobile contract supports ${l.minViewportWidth}px minimum, wider than the audited ${a}px viewport.`,fix:"Add a narrower breakpoint, summary-card fallback, or explicit horizontal-scroll affordance with a non-visual equivalent."});const i=t/Math.max(1,r);a<=430&&i>2.4&&"BigNumber"!==e&&Ua(s,{id:"layout.wide-aspect-ratio",category:"layout",impact:"medium",message:`Chart aspect ratio is ${i.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."}),r<160&&"BigNumber"!==e&&Ua(s,{id:"layout.too-short-for-reading",category:"layout",impact:"medium",message:`Chart height is ${r}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 Ga(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=La(t);f>0&&(f>("number"==typeof l?.maxMarks?l.maxMarks:Hu.has(e)?1.25*a:Yl.has(e)?Math.max(8,Math.floor(a/34)):a)?Ua(s,{id:"density.mark-budget",category:"density",impact:Hu.has(e)?"medium":"high",message:`${f} data item(s) exceed the rough mobile density budget for ${e} at ${a}px.`,fix:"Aggregate, filter, facet into small multiples, switch to a summary-card plus detail view, or use progressive disclosure."}):_a(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 m=Ba(t),g=!1!==t.showAxes&&!1!==t.axis;if(g&&null!=m){const e=Math.max(3,Math.floor(a/58));m>e&&Ua(s,{id:"density.explicit-tick-count",category:"density",impact:"medium",message:`${m} explicit tick(s) exceed a phone-friendly budget of about ${e} at ${a}px.`,fix:"Use adaptive ticks, fewer tickValues, direct labels, or move exact values into a tap-accessible detail panel."})}else g&&(Hu.has(e)||Yl.has(e))&&Ga(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."});za(t)?Ua(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."}):_a(s,{id:"interaction.hover-only-detail",category:"interaction",impact:"high",message:"No hover-only detail path is visible from the config."});const y=Da(e,t),b=Pa(t.mobileInteraction)?t.mobileInteraction:null,v="number"==typeof b?.targetSize?b.targetSize:!0===t.mobileInteraction?44:"number"==typeof l?.minimumHitTarget?l.minimumHitTarget:"number"==typeof l?.interaction?.targetSize?l.interaction.targetSize:null,w=y??v;null!=w&&(w<24?Ua(s,{id:"interaction.target-size-minimum",category:"interaction",impact:"high",message:`Small interactive marks expose an estimated ${w}px pointer target, below WCAG's 24px minimum.`,fix:"Increase mark radius/hoverRadius, add tap snapping to nearest datum, or provide larger external controls."}):w<i?Ua(s,{id:"interaction.target-size-comfort",category:"interaction",impact:"medium",message:`Pointer target is about ${w}px, above 24px but below the ${i}px comfortable phone target.`,fix:"Use hoverRadius/tapRadius near 44px while keeping the visible mark small if needed."}):_a(s,{id:"interaction.target-size-comfort",category:"interaction",impact:"medium",message:`Pointer target is about ${w}px, meeting the configured ${i}px target.`}));const A=[];null==t.brush&&null==t.onBrush||A.push("brush"),!0===t.zoomable&&A.push("pan/zoom"),"isolate"!==t.legendInteraction&&"highlight"!==t.legendInteraction||A.push("legend filtering"),A.length>0&&!Fa(t,A)&&Ua(s,{id:"interaction.complex-gesture-alternative",category:"interaction",impact:"high",message:`Mobile-hostile complex interaction detected: ${A.join(", ")} without standard control alternatives.`,fix:"Pair gestures with buttons, range inputs, chips, or a details panel that works with touch and keyboard."});const x=!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"===l?.labels?.strategy||"inline"===l?.labels?.strategy||"external"===l?.labels?.strategy;x&&!$&&a<=430&&Ua(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 C=Array.isArray(t.annotations)?t.annotations.filter(e=>Pa(e)):[],S="number"==typeof l?.maxAnnotations?l.maxAnnotations:3;if(C.length>S&&a<=430&&Ua(s,{id:"annotation.mobile-density",category:"annotation",impact:"medium",message:`${C.length} annotation(s) compete for phone plot space.`,fix:"Assign annotation priority, collapse secondary notes into a callout list, or provide shorter mobileText."}),C.length>0){const e=C.filter(e=>!Ea(e.mobileText)&&!Ea(e.shortText)&&!Ea(e.label));e.length>0&&Ga(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."})}d||"BigNumber"===e||Ga(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&&(l?(_a(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===l.custom?.dataBearingSceneNodes?Ua(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!==l.custom?.dataBearingSceneNodes&&Ga(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."})):Ga(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."})),p||h||Ua(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 k=s.filter(e=>"warn"===e.status),R={highRisk:k.filter(e=>"high"===e.impact).length,warnings:k.length,manual:s.filter(e=>"manual"===e.status).length,passes:s.filter(e=>"pass"===e.status).length};return{component:e,viewportWidth:a,ok:0===R.highRisk,summary:R,findings:s,reference:Vu}}function Ha(e){const t=[],r=e.summary,a=e.ok?`no high-risk mobile blockers at ${e.viewportWidth}px`:`${r.highRisk} high-risk mobile issue(s) at ${e.viewportWidth}px`;t.push(`${e.ok?"PASS":"WARN"} ${e.component}: mobile visualization audit`),t.push(` ${a} - ${r.warnings} warning(s) - ${r.manual} manual check(s)`);for(const r of qu){const a=e.findings.filter(e=>e.category===r&&"not-applicable"!==e.status);if(0!==a.length){t.push(""),t.push(` ${r.toUpperCase()}`);for(const e of a)t.push(` ${Wu[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 Wa(){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."]}function qa(e,t){if("function"==typeof e)return e;const r=e||t;return e=>e[r]}function Ya(e){if(!Array.isArray(e))return[];for(const t of e)if(!Ee(t))return e.filter(Ee);return e}function Ka(e){let t=e;for(const r of["data","nodes","edges","points","areas","lines","flows","spawns","projectionRows","annotations"]){if(!Array.isArray(e[r]))continue;const a=Ya(e[r]);a!==e[r]&&(t===e&&(t={...e}),t[r]=a)}return t}function Ja(e){return e instanceof Date?e.getTime():"number"==typeof e?e:"string"==typeof e&&""!==e.trim()?Number(e):NaN}function Xa(e){return e instanceof Date?Number.isFinite(e.getTime())?e.toISOString():void 0:null!=e&&"object"!=typeof e&&"function"!=typeof e?String(e):void 0}function Za(e,t){const r=qa(e,t);return e=>Ja(r(e))}function Qa(){const e=globalThis;return e[Yu]??(e[Yu]={intents:/* @__PURE__ */new Map}),e[Yu]}function ei(e,t){return Ju.has(e)||Xu.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 ti(e){for(const t of["lineBy","areaBy","stackBy","groupBy","colorBy"]){const r=e[t];if("string"==typeof r&&r)return r}}function ri(e,t){return null==e?"—":e instanceof Date?Xa(e)?.slice(0,10)??"—":"number"==typeof e?t(e):Xa(e)??"—"}function ai(e,t={}){const r=!0===t.showRetractedAnnotations,a=!0===t.showSupersededAnnotations,i=/* @__PURE__ */new Set;for(const t of e){const e=t?.lifecycle?.supersedes;e&&"retracted"!==t?.lifecycle?.status&&i.add(e)}return e.filter(e=>{if("retracted"===e?.lifecycle?.status&&!r)return!1;const t=e?.provenance?.stableId;return!(t&&i.has(t)&&!a)})}function ii(e,t,r){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:r]}function oi(e,t="—"){let r;for(;null!==e&&"object"==typeof e&&!(e instanceof Date);){if(r??(r=/* @__PURE__ */new Set),r.has(e))return t;r.add(e);const a=e;e=a.id??a.name??a.label}return Xa(e)||t}function ni(e){const t=Ja(e);return Number.isFinite(t)?t:void 0}function si(e){return(oi(e,"unknown").toLowerCase().match(/[a-z0-9]+/g)||[]).join("-")||"unknown"}function ci(e,t){return`${e.linkedHover||e.selection||e.linkedBrush?` ${t}`:""}${e.enableHover||e.tooltip?" Hover or focus a mark for its details.":""}`}function li(e,t){return Ya(ii(e,t,"children"))}function ui(e){return"string"==typeof e?e:e.id??e.name}function di(e){return e.layoutConfig&&"object"==typeof e.layoutConfig?e.layoutConfig:{}}function hi(e){return Array.isArray(e.data)?Ya(e.data):Array.isArray(e.nodes)?Ya(e.nodes):Array.isArray(e.points)?Ya(e.points):Array.isArray(e.areas)?Ya(e.areas):[]}function pi(e,t,r){return r??Yr(t.recipe)??Yr(t.recipeId)??Hr(e)}function fi(e,t,r=[]){const a=e.accessor?t[e.accessor]:void 0;if("string"==typeof a&&a)return a;if(e.field)return e.field;const i=r.find(e=>e&&"object"==typeof e);if(!i)return;const o=Object.entries(i).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=>Object.prototype.hasOwnProperty.call(i,e)):o.find(([,e])=>"string"==typeof e)?.[0]}function mi(e,t){return e.dataRoles.find(e=>e.role===t)}function gi(e,t){return e.dataRoles.find(e=>t.includes(e.semanticType))}function yi(e,t,r,a,i,o={}){const n=Object.assign(/* @__PURE__ */Object.create(null),o);if(t)for(const[e,r]of Object.entries(t))n[e]=r;for(const e of r.dataRoles){const r=fi(e,a,i),o=t&&r?t[r]:r;void 0!==o&&(n[e.role]=o)}return e.replace(/\{([^}]+)\}/g,(e,t)=>oi(n[t],`{${t}}`))}function bi(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})}}}function vi(e,t,r,a){const i=gi(e,["nominal","ordinal"]),o=gi(e,["quantitative"]),n=i?fi(i,r,t):void 0,s=o?fi(o,r,t):void 0,c=i?.role??n??"category",l=o?.role??s??"value",u=e.encodings??[],d=u.length?u.slice(0,3).map(e=>e.meaning.replace(/\.$/,"")).join("; "):`${c} and ${l} are mapped through the recipe's declared visual semantics`,{number:h,percent:p}=bi(a),f=/* @__PURE__ */new Map;if(n&&s)for(const e of t){const t=oi(e[n],"Uncategorized"),r=Ja(e[s]);Number.isFinite(r)&&f.set(t,(f.get(t)??0)+r)}const m=[...f].sort((e,t)=>t[1]-e[1]),g=m.reduce((e,[,t])=>e+t,0),y=m[0],b=m[1],v=g>0?((y?.[1]??0)+(b?.[1]??0))/g:0,w=e.intents.map(e=>({id:ui(e),strength:"string"==typeof e?void 0:e.strength})).sort((e,t)=>"primary"===e.strength?-1:"primary"===t.strength?1:0)[0]?.id,A=e.audience?.primary??e.audienceFit?.find(e=>"strong"===e.fit)?.audience;return{l1:`A ${e.name.toLowerCase()} encodes ${c} and ${l}. ${x=d,x?x.charAt(0).toUpperCase()+x.slice(1):x}.`,l2:m.length>0?`${m.length} categories total ${h.format(g)}. ${y[0]} accounts for ${h.format(y[1])}${g>0?` (${p.format(y[1]/g)})`:""}${b?`, followed by ${b[0]} at ${h.format(b[1])}`:""}.`:`${t.length} data ${1===t.length?"item is":"items are"} represented.`,l3:m.length>=2?v>=.5?`Most of the total is concentrated in ${y[0]} and ${b[0]}, which together account for ${p.format(v)}.`:`The total is distributed across ${m.length} categories without the first two forming a majority.`:y?`${y[0]} is the only represented category.`:"No quantitative pattern can be derived from the available data.",l4:`The chart is intended for ${w??"explanation"}${A?` with a ${A} audience`:""}: ${e.designContract.whyCustom}`};var x}function wi(e,t,r={}){const a=hi(t),i=di(t),o=r.locale??"en",n="function"==typeof e.description?e.description({data:a,config:i,locale:o}):void 0,s=n?.levels??vi(e,a,i,o),c=r.levels??["l1","l2","l3","l4"],l={};for(const e of c)s[e]&&(l[e]=s[e]);const u=["l1","l2","l3","l4"].map(e=>l[e]).filter(e=>!!e).join(" "),d=r.includeCaveats?[...e.reception?.risks??[],...e.caveats??[],...(e.designContract.misuse??[]).map(e=>`Misuse: ${e}`)]:void 0;return{text:u,levels:l,...d?.length?{caveats:d}:{}}}function Ai(e){const t=Math.max(2,Math.round(e.bins)),r=Math.max(1,Math.round(e.pegRows??t-1)),a=Math.max(1,Math.round(e.count??Math.max(64,4*t))),i=(o=Number.isFinite(e.branchProbability)?e.branchProbability??.5:.5,Math.max(0,Math.min(1,o)));var o;const n=Xe(e.seed??1),s=e.idPrefix??"mechanical";return Array.from({length:a},(e,t)=>{let a=0;for(let e=0;e<r;e+=1)n()<i&&(a+=1);const o=r/2;return{id:`${s}-${t}`,value:a,mechanical:!0,pegRows:r,branchProbability:i,pathRights:a,side:a<o?"left":a>o?"right":"center"}})}function xi(e){return{...e,bySource:Object.fromEntries(Object.entries(e.bySource).map(([e,t])=>[e,{...t}]))}}function $i(e){const{windowSize:t,watermark:r,watermarkAtArrivalAccessor:a}=e;if(!(Number.isFinite(t)&&t>0))throw new RangeError("EventDrop windows.size must be a finite positive number");const{rows:i}=Rt(e.data,"event"),o=i.flatMap((t,r)=>{const a=xt(At(t,r,e.timeAccessor));return null==a?[]:[{datum:t,index:r,eventTime:a,arrivalTime:xt(At(t,r,e.arrivalAccessor))??a,watermarkAtArrival:0,late:!1}]}),n="function"==typeof r?null:xt(r?.value),s="function"==typeof r?t:xt(r?.delay)??t,c=new Qu(t,r,e.sourceIds);for(const t of o.slice().sort((e,t)=>e.arrivalTime-t.arrivalTime||e.index-t.index)){const r=a?xt(At(t.datum,t.index,a)):null,i=c.append({eventTime:t.eventTime,arrivalTime:t.arrivalTime,source:String(At(t.datum,t.index,e.sourceAccessor??"source")??""),watermarkAtArrival:r??void 0});t.watermarkAtArrival=i.watermarkAtArrival,t.late=i.late}return{events:o,watermarkValue:o.length?c.getWatermark():n??-s,ledger:c.getLedger(),lifecycleEvents:c.drainEvents()}}function Ci(e,t){const r="mechanical"===(t.simulationMode??t.mode)&&("GaltonBoardChart"===e||"UnitPileChart"===e);if(!Array.isArray(t.data)&&!r)return null;let a=Array.isArray(t.data)?t.data:[];const i=Math.max(2,Math.round(xt(t.bins)??21)),o=Math.max(1,Math.round(xt(t.pegRows)??i-1));if(r&&(a="GaltonBoardChart"===e?Ai({bins:i,count:t.mechanicalCount,pegRows:o,branchProbability:t.branchProbability,seed:t.seed}):St({count:t.mechanicalCount,categories:t.mechanicalCategories,unitValue:t.unitValue,seed:t.seed})),a=Rt(a,"UnitPileChart"===e?"pile":"GaltonBoardChart"===e?"galton":"EventDropChart"===e?"event":"collision-swarm").rows,"UnitPileChart"===e){const e=/* @__PURE__ */new Map,i=t.valueAccessor??(r?"value":void 0);return a.forEach((r,a)=>{const o=oi(At(r,a,t.categoryAccessor??"category"),"unknown"),n=i?xt(At(r,a,i)):1;e.set(o,(e.get(o)??0)+Math.max(0,n??0))}),{generated:r,rows:Array.from(e,([e,t])=>({label:e,value:t}))}}if("GaltonBoardChart"===e){const e=a.map((e,r)=>xt(At(e,r,t.valueAccessor??"value"))).filter(e=>null!=e),n=r?[0,o]:Ct(t.valueExtent),[s,c]=n??(e.length?P(e):[0,1]),l=s===c?1:c-s,u=Array.from({length:i},(e,t)=>({label:String(t+1),value:0}));for(const t of e)u[Math.max(0,Math.min(i-1,Math.floor((t-s)/l*i)))].value+=1;return{generated:r,rows:u}}if("CollisionSwarmChart"===e){const e=/* @__PURE__ */new Map;return a.forEach((r,a)=>{if(null==xt(At(r,a,t.xAccessor??"x")))return;const i=t.groupAccessor?oi(At(r,a,t.groupAccessor),"All"):"All";e.set(i,(e.get(i)??0)+1)}),{generated:r,rows:Array.from(e,([e,t])=>({label:e,value:t}))}}if("EventDropChart"===e){const e=xt(t.windows?.size??10);if(null==e||e<=0)return null;const{events:i}=$i({data:a,timeAccessor:t.timeAccessor??"time",arrivalAccessor:t.arrivalAccessor??"arrivalTime",windowSize:e,watermark:t.watermark,watermarkAtArrivalAccessor:t.watermarkAtArrivalAccessor}),o=i.map(e=>e.eventTime),[n,s]=o.length?P(o):[0,e],c=Math.min(xt(t.timeExtent?.[0])??n,n),l=Math.max(xt(t.timeExtent?.[1])??s,s),u=Math.floor(c/e)*e,d=Math.max(1,Math.ceil((l-u+e)/e)),h=Array.from({length:d},(t,r)=>({label:`${u+r*e}-${u+(r+1)*e}`,value:0,secondary:0,secondaryLabel:"late"}));for(const t of i){const r=h[Math.max(0,Math.min(d-1,Math.floor((t.eventTime-u)/e)))];t.late?r.secondary+=1:r.value+=1}return{generated:r,rows:h}}return null}function Si(e){const t="number"==typeof e?e:"string"==typeof e?Number(e):NaN;return Number.isFinite(t)?t:void 0}function ki(e,t){const r=e.physics&&"object"==typeof e.physics?e.physics:null,a=e.settledProjection&&"object"==typeof e.settledProjection?e.settledProjection:null,i=[e.settledProjectionRows,e.projectionRows,a?.rows,r?.settledProjectionRows,r?.projectionRows,r?.settledProjection&&"object"==typeof r.settledProjection?r.settledProjection.rows:void 0].find(e=>Array.isArray(e));return Array.isArray(i)?i.map((e,r)=>{if(!e||"object"!=typeof e)return null;const a=e,i=Si(a.count??a.value??a.total??a.bodies??a.events);if(null==i)return null;const o=a.label??a.id??a.name??`container ${r+1}`,n=Si(a.secondary??a.secondaryCount),s=Si(a.observed??a.observedCount);return{label:ri(o,t),count:i,...null!=n?{secondary:n}:{},..."string"==typeof a.secondaryLabel&&a.secondaryLabel?{secondaryLabel:a.secondaryLabel}:{},...null!=s?{observed:s}:{}}}).filter(e=>null!=e):null}function Ri(e){return"EventDropChart"===e?"time window":"GaltonBoardChart"===e?"bin":"CollisionSwarmChart"===e?"group lane":"PacketFlowChart"===e?"flow node":"CrucibleChart"===e?"result group":"container"}function Pi(e){return"EventDropChart"===e?"event":"GaltonBoardChart"===e?"sample":"CollisionSwarmChart"===e?"point":"PacketFlowChart"===e?"packet":"CrucibleChart"===e?"settled item":"UnitPileChart"===e?"unit":"body"}function Ei(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.":"UnitPileChart"===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.":"PacketFlowChart"===e?"A physical flow chart that keeps authored routes visible while packet bodies show throughput and proximity events.":"CrucibleChart"===e?"A crucible physics chart that replays authored phases and events into declared products and outlets; the settled ledger, not collisions, determines the result.":`A ${t} whose accessible reading is the settled projection rather than individual trajectories.`}function Ni(e,t){if(!(t>0))return"0%";const r=e/t*100;return`${r>=10?Math.round(r):Math.round(10*r)/10}%`}function Ti(e,t,r,a,i,o,n=null){const s=Ri(e),c=n&&"EventDropChart"===e?"accepted event":Pi(e),l=n?n.generated?"The generated sample projection":"The source projection":"The settled projection";if(i.has("l1")&&(a.l1=Ei(e,t)),!i.has("l2")&&!i.has("l3"))return;if(!r||0===r.length)return void(i.has("l2")&&(a.l2=n?"No valid source records are available.":"No settled projection is loaded yet."));const u=r.reduce((e,t)=>e+t.count,0),d=r.filter(e=>e.count>0).sort((e,t)=>t.count-e.count),h=d[0]??r.slice().sort((e,t)=>t.count-e.count)[0];if(!h)return;const p=r.reduce((e,t)=>e+(t.secondary??0),0),f=r.find(e=>e.secondaryLabel)?.secondaryLabel??"secondary";if(i.has("l2"))if(n&&"EventDropChart"===e)a.l2=`${l} classifies ${o(u+p)} ${Ii(u+p,"event")} across ${r.length} ${Ii(r.length,s)}: ${o(u)} accepted and ${o(p)} late.`;else if(0===d.length)a.l2=`${l} contains ${o(u)} ${Ii(u,c)} across ${r.length} ${Ii(r.length,s)}; no ${Ii(2,s)} are non-empty yet.`;else{const e=p>0?` ${o(p)} ${Ii(p,c)} ${1===p?"is":"are"} marked ${f}.`:"";a.l2=`${l} contains ${o(u)} ${Ii(u,c)} across ${r.length} ${Ii(r.length,s)}; ${d.length} ${Ii(d.length,s)} ${1===d.length?"is":"are"} non-empty. The largest ${s} is ${h.label} with ${o(h.count)} ${Ii(h.count,c)}.${e}`}if(i.has("l3")&&u>0&&d.length>0){const e=d.find(e=>e!==h),t=Ni(h.count,u);a.l3=e?`${l} is most concentrated in ${h.label}, which holds ${o(h.count)} ${Ii(h.count,c)} (${t}); ${e.label} follows with ${o(e.count)} ${Ii(e.count,c)}.`:`${l} is concentrated in ${h.label}, which holds all ${o(h.count)} ${Ii(h.count,c)}.`}}function Ii(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:`${t}s`}function Mi(e){return Object.prototype.hasOwnProperty.call(ed,e)?ed[e]:`${t=e,t.replace(/([a-z])([A-Z])/g,"$1 $2").toLowerCase()} chart`;var t}function Oi(e){const t=/* @__PURE__ */new Set,r=e=>{const a=Object.prototype.hasOwnProperty.call(id,e)?id[e]:void 0;if(a)return a;if(t.has(e))return;const i=Qa().intents.get(e);if(!i?.composes?.length)return;t.add(e);const o=[...i.composes].sort((e,t)=>{const r=e=>{const t=nd.indexOf(e);return t<0?nd.length:t};return(i.weights?.[t]??1)-(i.weights?.[e]??1)||r(e)-r(t)});for(const a of o){const i=r(a);if(i)return t.delete(e),i}t.delete(e)};return r(e)}function ji(e){let t,r=0;for(const[a,i]of Object.entries(e))if("number"==typeof i&&i>0)if(i>r)t=a,r=i;else if(i===r&&void 0!==t){const e=nd.indexOf(a),r=nd.indexOf(t);-1!==e&&(-1===r||e<r)&&(t=a)}return t}function Fi(e){return"BumpChart"===e?"ranking":Xu.has(e)||"StackedAreaChart"===e?"apportioning":ad.has(e)?"relating":Ju.has(e)?"comparing":Zu.has(e)?"characterizing":Ku.has(e)?"tracking":td.has(e)?"tracing":"BigNumber"===e?"presenting":void 0}function zi(e){if(e){if("fits"in e||"buildProps"in e){const t=e,r={};for(const[e,a]of Object.entries(t.intentScores))"number"==typeof a&&Number.isFinite(a)&&(r[e]=a);return{family:t.family,intentScores:Object.keys(r).length?r:void 0}}return e}}function Li(e,t){const r=zi(t);if(r?.act)return r.act;if(r?.intentScores){const e=ji(r.intentScores);if(e&&Object.prototype.hasOwnProperty.call(id,e)&&(r.intentScores[e]??0)>=3)return id[e]}return r?.family&&Object.prototype.hasOwnProperty.call(od,r.family)?od[r.family]:Fi(e)}function Bi(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||!cd.has(t.type))return!1;const r=t.provenance;return!(!r||"object"!=typeof r)&&(ld.has(r.authorKind)||ud.has(r.source)||dd.has(r.basis))})}function Di(e="en"){let t,r;try{t=new Intl.NumberFormat(e,{notation:"compact",maximumFractionDigits:1}),r=new Intl.NumberFormat(e,{maximumFractionDigits:2})}catch{t=new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}),r=new Intl.NumberFormat("en",{maximumFractionDigits:2})}return e=>Number.isFinite(e)?Math.abs(e)>=1e4?t.format(e):r.format(e):String(e)}function _i(e,t,r,a){let i=0,o=0,n=1/0,s=-1/0,c=null,l=null,u=0,d=0,h=null,p=null,f=NaN,m=NaN;for(const r of e){const e=t(r);Number.isFinite(e)&&(0===i&&(f=e,h=r),m=e,p=r,e<n&&(n=e,c=r,u=i),e>s&&(s=e,l=r,d=i),i++,o+=e)}return 0===i?null:{count:i,min:n,max:s,mean:o/i,minLabel:ri(null!=c?r(c):null,a),maxLabel:ri(null!=l?r(l):null,a),first:f,last:m,firstLabel:ri(null!=h?r(h):null,a),lastLabel:ri(null!=p?r(p):null,a),minIndex:u,maxIndex:d}}function Ui(e){return e.length<=1?e[0]??"":2===e.length?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(", ")}, and ${e[e.length-1]}`}function Gi(e){const t=e.provenance&&"object"==typeof e.provenance?e.provenance:null,r=t?.authorKind??t?.source??t?.basis;return"watcher"===r?"a watcher-flagged ":"agent"===r||"ai"===r||"llm-inference"===r?"an AI-suggested ":""}function Vi(e){const t="string"==typeof e.type?e.type:"annotation",r=Object.prototype.hasOwnProperty.call(hd,t)?hd[t]:"an annotation",a=Gi(e),i=a?a+r.replace(/^an? /,""):r,o="string"==typeof e.label?e.label:"string"==typeof e.title?e.title:void 0;return o?`${i} labeled "${o}"`:i}function Hi(e){const t=Array.isArray(e.annotations)?e.annotations:null;if(!t||0===t.length)return;const r=ai(t.filter(e=>!!e&&"object"==typeof e));if(0===r.length)return;const a=r.map(Vi),i=a.slice(0,5),o=a.length-i.length,n=Ui(i)+(o>0?`, and ${o} more`:""),s=r.length;return`The author has marked ${1===s?"one feature":`${s} features`} on this chart: ${n}.`}function Wi(e,t,r={}){t=Ka(t);const a=void 0!==r.levels,i=new Set(r.levels??["l1","l2","l3"]);a||!r.capability&&!Bi(t)||i.add("l4");const o=pi(e,t,r.recipe);if(o){const e=["l1","l2","l3","l4"].filter(e=>i.has(e));a||e.includes("l4")||e.push("l4");const n=wi(o,t,{levels:e,locale:r.locale,audience:r.audience,includeCaveats:r.includeCaveats}),s=Hi(t);return{...n,text:s?`${s} ${n.text}`.trim():n.text,...s?{annotations:s}:{}}}const n=Di(r.locale??"en"),s=Mi(e),c=Array.isArray(t.data)?t.data:null,l=ti(t),u=rd.has(e)?ki(t,n):null,d=rd.has(e)&&null===u?Ci(e,t):null,{measure:h,measureFallback:p,dimension:f,dimensionFallback:m}=ei(e,t),g="string"==typeof h&&h?h:p,y="string"==typeof f&&f?f:m,b={};if(rd.has(e)&&Ti(e,s,u??(d?ki({projectionRows:d.rows},n):null),b,i,n,d),i.has("l1")&&!rd.has(e))if("BumpChart"===e)b.l1=`A ${s} ranking ${l??"series"} by ${g} across ${y}.`;else if(Ku.has(e)||Ju.has(e))b.l1=`A ${s} of ${g} by ${y}`+(l?`, split by ${l}.`:".");else if(Xu.has(e))b.l1=`A ${s} showing ${g} across ${y} categories.`;else if(Zu.has(e))b.l1=`A ${s} of the distribution of ${g}`+(l?` by ${l}.`:".");else if(td.has(e)){const e=Array.isArray(t.nodes)?t.nodes.length:void 0,r=Array.isArray(t.edges)?t.edges.length:void 0,a=[null!=e?`${e} ${to(e,"node")}`:null,null!=r?`${r} ${to(r,"edge")}`:null].filter(Boolean);b.l1=`A ${s}${a.length?` with ${a.join(" and ")}`:""}.`}else if("BigNumber"===e){const e="string"==typeof t.label?t.label:g;b.l1=`A single value${e?` for ${e}`:""}.`}else b.l1=`A ${s}.`;const v=Ku.has(e)||"BumpChart"===e||Ju.has(e)||Xu.has(e)||Zu.has(e);let w=null;if((i.has("l2")||i.has("l3")||i.has("l4"))&&v&&c&&c.length>0&&(w=_i(c,Za(h,p),qa(f,m),n)),i.has("l2")&&v&&(c&&0!==c.length?w&&(Xu.has(e)?b.l2=`${w.count} segments totaling ${n(qi(w))}. Largest is ${w.maxLabel} at ${n(w.max)}; smallest is ${w.minLabel} at ${n(w.min)}.`:b.l2=`${g} ranges from ${n(w.min)} (${w.minLabel}) to ${n(w.max)} (${w.maxLabel}), with a mean of ${n(w.mean)} across ${w.count} points.`):b.l2="No data is loaded yet."),i.has("l3")&&w&&!l&&Ku.has(e)?b.l3=Yi(w,g,n):i.has("l3")&&w&&!l&&Ju.has(e)&&(b.l3=`The highest ${y} is ${w.maxLabel} and the lowest is ${w.minLabel}.`),i.has("l4")){const a=Bi(t)?"alerting":Li(e,r.capability);if(a){const i=l?null:w;b.l4=Ki(a,e,t,i,g,y,n,r.audience)}}const A=["l1","l2","l3","l4"].filter(e=>i.has(e)&&b[e]).map(e=>b[e]).join(" "),x=Hi(t);return{text:x?`${x} ${A}`.trim():A,levels:b,...x?{annotations:x}:{}}}function qi(e){return e.mean*e.count}function Yi(e,t,r){const{first:a,last:i,min:o,max:n,maxLabel:s,minLabel:c,firstLabel:l,lastLabel:u,minIndex:d,maxIndex:h,count:p}=e,f=n-o,m=i-a;if(0===f)return`${eo(t)} is constant at ${r(a)} across the series.`;if(f/(Math.abs(e.mean)||1)<.04)return`${eo(t)} ends roughly where it started (${r(a)} at ${l} to ${r(i)} at ${u}), ranging between ${r(o)} and ${r(n)}.`;const g=h>0&&h<p-1,y=d>0&&d<p-1,b=(n-Math.max(a,i))/f,v=(Math.min(a,i)-o)/f;return g&&b>.15?`Overall ${t} climbs to a peak of ${r(n)} (${s}), then falls to ${r(i)} (${u}).`:y&&v>.15?`Overall ${t} drops to a low of ${r(o)} (${c}), then recovers to ${r(i)} (${u}).`:Math.abs(m)/f<.05?`${eo(t)} ends roughly where it started (${r(a)} at ${l} to ${r(i)} at ${u}), ranging between ${r(o)} and ${r(n)}.`:m>0?h===p-1?`Overall ${t} rises from ${r(a)} (${l}) to a peak of ${r(i)} (${u}).`:`Overall ${t} rises from ${r(a)} (${l}) to ${r(i)} (${u}), after peaking at ${r(n)} (${s}).`:d===p-1?`Overall ${t} falls from ${r(a)} (${l}) to a low of ${r(i)} (${u}).`:`Overall ${t} falls from ${r(a)} (${l}) to ${r(i)} (${u}), after dipping to ${r(o)} (${c}).`}function Ki(e,t,r,a,i,o,n,s){const c=sd[e],l=/^[aeiou]/i.test(c)?"an":"a";let u,d;switch(e){case"locating":u="This is a map",d="read values by location";break;case"presenting":u="This is a single-value display",d=`read ${"string"==typeof r.label&&r.label?r.label:i} as the headline number`;break;case"tracing":u=`This is ${l} ${c} chart`,d="follow the movement between states";break;case"nesting":u=`This is ${l} ${c} chart`,d="read it for nested structure and how children sum into their parents";break;case"relating":u=`This is ${l} ${c} chart`,d=`read it for whether ${o} and ${i} move together`;break;default:u=`This is ${l} ${c} chart`,d=Ji(e,a,i,o,n,t)}return`${u}; ${d}.${Qi(t,s)}`}function Ji(e,t,r,a,i,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 ${r}`;case"comparing":return`compare ${r} across ${a}`;case"ranking":return`read it top to bottom by ${r}`;case"apportioning":return`read each ${a}'s share of the whole`;case"characterizing":return`read it for the spread and shape of ${r}`;default:return"read the highlighted features"}switch(e){case"alerting":return Xi(t,i,o);case"tracking":return`read it for the trajectory of ${r}, which ${Zi(t)} from ${i(t.first)} (${t.firstLabel}) to ${i(t.last)} (${t.lastLabel})`;case"comparing":return`compare ${r} across ${a}; ${t.maxLabel} leads at ${i(t.max)}`;case"ranking":return`read it top to bottom by ${r}; ${t.maxLabel} ranks highest at ${i(t.max)}`;case"apportioning":{const e=t.mean*t.count,r=e>0?Math.round(t.max/e*100):null;return`read each ${a}'s share of the ${i(e)} total; ${t.maxLabel} is the largest at ${i(t.max)}${null!=r?` (${r}%)`:""}`}case"characterizing":return`read it for the spread of ${r}, from ${i(t.min)} to ${i(t.max)}`;default:return"read the highlighted features"}}function Xi(e,t,r){if(Ju.has(r)||Xu.has(r))return`${e.maxLabel} stands out at ${t(e.max)} — check it first`;const{first:a,last:i,min:o,max:n,minLabel:s,maxLabel:c,lastLabel:l,minIndex:u,maxIndex:d,count:h}=e,p=n-o;if(p>0){const e=d>0&&d<h-1,r=u>0&&u<h-1,f=(n-Math.max(a,i))/p,m=(Math.min(a,i)-o)/p;if(e&&f>.15)return`the peak of ${t(n)} at ${c} is the point to investigate`;if(r&&m>.15)return`the dip to ${t(o)} at ${s} is the point to investigate`;if(i>=n)return`the climb to ${t(i)} at ${l} warrants a closer look`;if(i<=o)return`the drop to ${t(i)} at ${l} warrants a closer look`}return`the extremes — ${c} (${t(n)}) and ${s} (${t(o)}) — are the points to check`}function Zi(e){const t=e.max-e.min,r=e.last-e.first;return 0===t||Math.abs(r)/t<.05?"holds roughly steady":r>0?"rises":"falls"}function Qi(e,t){if(!t)return"";const r=t.familiarity?.[e];return"number"==typeof r&&r<=2?` This ${Mi(e)} may be unfamiliar${t.name?` to ${t.name.toLowerCase()} readers`:""} — lean on this description.`:""}function eo(e){return e.length?e[0].toUpperCase()+e.slice(1):e}function to(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:`${t}s`}function ro(e){return si(e)}function ao(e,t,r,a){const i=gi(t,["nominal","ordinal"]),o=t.dataRoles.filter(e=>"quantitative"===e.semanticType),n=i?fi(i,r,a):void 0,s=[];n&&null!=e[n]&&s.push(oi(e[n]));for(const t of o){const i=fi(t,r,a);i&&null!=e[i]&&s.push(`${t.role}: ${oi(e[i])}`)}return s.length>0?s.join(", "):"Data item"}function io(e,t,r={}){const a=hi(t),i=di(t),o=Math.max(1,r.maxLeaves??200),n=r.locale??"en";if("function"==typeof e.navigation)return e.navigation({data:a,config:i,locale:n});const s=(c=e.navigation)&&"object"==typeof c?e.navigation:void 0;var c;const l=(s?.groupByRole?mi(e,s.groupByRole):void 0)??(s?.groupBy?.[0]?mi(e,s.groupBy[0])??e.dataRoles.find(e=>e.field===s.groupBy?.[0]):void 0)??gi(e,["nominal","ordinal"]),u=l?fi(l,i,a):void 0,d=(s?.idRole?mi(e,s.idRole):void 0)??gi(e,["identifier"]),h=d?fi(d,i,a):void 0,p={id:"root",role:"chart",label:s?.summaryTemplate?yi(s.summaryTemplate,void 0,e,i,a,{count:a.length}):`${e.name}: ${a.length} ${1===a.length?"item":"items"} represented.`,level:1,children:[]};let f=0;const m=(t,r,o)=>{const n=h?t[h]:void 0,c=s?.itemLabelTemplate?yi(s.itemLabelTemplate,t,e,i,a,{count:a.length}):ao(t,e,i,a);return{id:`datum-${ro(n??r)}`,role:"datum",label:c,level:o,datum:t}};if(u){const e=/* @__PURE__ */new Map;for(const t of a){const r=oi(t[u],"Uncategorized"),a=e.get(r);a?a.push(t):e.set(r,[t])}p.children=[...e].map(([e,t],r)=>{const a=Math.max(0,o-f),i=t.slice(0,a);f+=i.length;const n=i.map((e,t)=>m(e,1e5*r+t,3));return i.length<t.length&&n.push({id:`more-${ro(e)}`,role:"datum",label:`…and ${t.length-i.length} more items`,level:3}),{id:`group-${ro(e)}`,role:"series",label:`${e}: ${t.length} ${1===t.length?"item":"items"}.`,level:2,children:n}})}else{const e=a.slice(0,o);p.children=e.map((e,t)=>m(e,t,2)),e.length<a.length&&p.children.push({id:"more",role:"datum",label:`…and ${a.length-e.length} more items`,level:2})}return p}function oo(e,t,r){return`${e} ${1===e?t:r}`}function no(e,t){if(0===e.numericLeaves)return"";const r=t(e.leafTotal);return e.numericLeaves===e.leaves?`, leaf total ${r}`:`, known leaf total ${r} across ${oo(e.numericLeaves,"valued leaf","valued leaves")}`}function so(e){return"TreeDiagram"===e?"tree":"Treemap"===e?"treemap":"CirclePack"===e?"circle-packing":"orbit"}function co(e,t,r,a){const i=Ee(t.data)?t.data:null,o=t.childrenAccessor,n=t.valueAccessor,s=t.nodeLabel??t.nodeIdAccessor,c=/* @__PURE__ */new WeakMap,l=e=>{const t=c.get(e);if(void 0!==t)return t??{descendants:0,depth:0,leaves:0,numericLeaves:0,leafTotal:0};c.set(e,null);const r=li(e,o),a=0===r.length,i=a?ni(ii(e,n,"value")):void 0,s={descendants:0,depth:1,leaves:a?1:0,numericLeaves:null==i?0:1,leafTotal:i??0};for(const e of r){const t=l(e);s.descendants+=1+t.descendants,s.depth=Math.max(s.depth,t.depth+1),s.leaves+=t.leaves,s.numericLeaves+=t.numericLeaves,s.leafTotal+=t.leafTotal}return c.set(e,s),s};let u=0;const d=/* @__PURE__ */new WeakSet,h=(e,t,i)=>{const c=oi(ii(e,s,"name"),`item ${i}`);if(d.has(e))return{id:`hierarchy-${si(i)}-cycle`,role:"datum",level:t,label:`Repeated hierarchy reference to ${c}; branch omitted.`};const p=li(e,o),f=l(e);if(0===p.length){if(u>=r)return null;u+=1;const o=ni(ii(e,n,"value"));return{id:`hierarchy-${si(i)}-${si(c)}`,role:"datum",level:t,label:`${c}${null==o?"":`: ${a(o)}`}.`,...null==o?{}:{value:o},datum:e}}d.add(e);const m=[];let g=0;for(const[e,a]of p.entries()){if(u>=r){g+=l(a).leaves;continue}const o=h(a,t+1,`${i}-${e}`);o&&m.push(o)}return d.delete(e),g>0&&m.push({id:`hierarchy-${si(i)}-more`,role:"datum",level:t+1,label:`${oo(g,"more leaf","more leaves")} in ${c} not shown; navigation is capped at ${r}.`}),{id:`hierarchy-${si(i)}-${si(c)}`,role:"series",level:t,label:`${c}: ${oo(p.length,"direct child","direct children")}, ${oo(f.descendants,"total descendant","total descendants")}, ${oo(f.leaves,"leaf","leaves")}${no(f,a)}.`,datum:e,children:m}},p=i?l(i):null,f={id:"root",role:"chart",level:1,label:i?`A ${so(e)} chart with ${oo(p.leaves,"leaf","leaves")} and ${oo(p.descendants,"total descendant","total descendants")} across ${oo(p.depth,"hierarchy level","hierarchy levels")}${no(p,a)}.`:"A hierarchy chart with no hierarchy data loaded.",children:[]};if(i){const e=h(i,2,"root");if(e){const t=oi(ii(i,s,"name"),"");f.children="series"===e.role&&""===t?e.children:[e]}}return f}function lo(e){if(Array.isArray(e))return Ya(e);if(!e||"object"!=typeof e)return[];const t=e;return Array.isArray(t.features)?Ya(t.features):"Feature"===t.type?[t]:[]}function uo(e,t,r){const a=ii(e,t,r);if(void 0!==a)return a;const i=e.properties;return i&&"object"==typeof i?ii(i,t,r):void 0}function ho(e,t,r){return oi(uo(e,t,"id")??uo(e,"name","name")??uo(e,"NAME","NAME")??uo(e,"label","label"),r)}function po(e){let t=0,r=1/0,a=-1/0,i=0;for(const o of e)null!=o.value&&(t+=1,r=Math.min(r,o.value),a=Math.max(a,o.value),i+=o.value);return 0===t?null:{count:t,min:r,max:a,total:i,average:i/t}}function fo(e,t){const r=po(e);return r?`range ${t(r.min)} to ${t(r.max)}, average ${t(r.average)}, total ${t(r.total)}`:"no numeric values"}function mo(e){const t=e.filter(e=>null!=e.value),r=e.filter(e=>null==e.value),a=[],i=po(t);if(i)if(i.min===i.max)a.push({id:"equal",label:"Equal values",rows:t});else{const e=i.min+(i.max-i.min)/3,r=i.min+2*(i.max-i.min)/3,o=t.filter(e=>e.value>=r),n=t.filter(t=>t.value>=e&&t.value<r),s=t.filter(t=>t.value<e);o.length>0&&a.push({id:"highest",label:"Highest values",rows:o}),n.length>0&&a.push({id:"middle",label:"Middle values",rows:n}),s.length>0&&a.push({id:"lowest",label:"Lowest values",rows:s})}return r.length>0&&a.push({id:"missing",label:"No numeric value",rows:r}),a}function go(e,t,r){const a=e.filter(e=>null!=e.value).sort((e,t)=>t.value-e.value||e.index-t.index),i=/* @__PURE__ */new Map;let o,n=0;for(const[e,t]of a.entries())o!==t.value&&(n=e+1,o=t.value),i.set(t.index,n);let s=0;return mo(e).map(e=>{const o=Math.max(0,t-s),n=e.rows.slice(0,o);s+=n.length;const c=n.map(e=>{const t=i.get(e.index),o=null==t||a.length<2?"":`, rank ${t} of ${a.length}`;return{id:`geo-${si(e.label)}-${e.index}`,role:"datum",level:3,label:null==e.value?`${e.label}: no numeric value.`:`${e.label}: ${r(e.value)}${o}.`,...null==e.value?{}:{value:e.value},datum:e.datum}}),l=e.rows.length-n.length;return l>0&&c.push({id:`geo-${e.id}-more`,role:"datum",level:3,label:`${l} more ${1===l?"region":"regions"} in ${e.label.toLowerCase()} not shown; navigation is capped at ${t}.`}),{id:`regions-${e.id}`,role:"series",level:2,label:`${e.label}: ${e.rows.length} ${1===e.rows.length?"region":"regions"}, ${fo(e.rows,r)}.`,children:c}})}function yo(e,t,r,a){const i=lo(t.areas),o="FlowMap"===e&&Array.isArray(t.nodes)?t.nodes:Array.isArray(t.points)?t.points:[],n=Array.isArray(t.flows)?t.flows:[],s=Array.isArray(t.lines)?t.lines:[],c=t.valueAccessor??t.sizeBy??t.costAccessor??"value",l=t.pointIdAccessor??t.nodeIdAccessor??"id",u=("ChoroplethMap"===e?i:o).map((r,a)=>({datum:r,index:a,label:ho(r,"ChoroplethMap"===e?t.idAccessor:l,`${"ChoroplethMap"===e?"region":"location"} ${a+1}`),value:ni(uo(r,c,"value"))})),d=u.filter(e=>null!=e.value),h={id:"root",role:"chart",level:1,label:`${"ChoroplethMap"===e?`A choropleth map with ${i.length} regions.${d.length>0?` Values are available for ${d.length} of ${i.length} regions; ${fo(d,a)}.`:" No regions have numeric values."}`:"FlowMap"===e?`A flow map with ${n.length} flows and ${o.length} locations.`:"DistanceCartogram"===e?`A distance cartogram with ${o.length} locations and ${s.length} routes.`:`A proportional-symbol map with ${o.length} locations.`}${ci(t,"Use linked highlighting to compare related locations.")}`,children:[]};if("ChoroplethMap"===e)h.children=go(u,r,a);else if(u.length>0){const e=u.slice(0,r).map(e=>({id:`geo-${si(e.label)}-${e.index}`,role:"datum",level:3,label:`${e.label}${null==e.value?"":`: ${a(e.value)}`}.`,...null==e.value?{}:{value:e.value},datum:e.datum}));u.length>r&&e.push({id:"geo-more",role:"datum",level:3,label:`…and ${u.length-r} more locations.`}),h.children?.push({id:"locations",role:"series",level:2,label:`Locations: ${u.length} marks.`,children:e})}const p="FlowMap"===e?n:s;if(p.length>0){const e=p.slice(0,r).map((e,t)=>{const r=oi(e.source,"unknown"),i=oi(e.target,"unknown"),o=ni(ii(e,c,"value"));return{id:`route-${si(r)}-${si(i)}-${t}`,role:"datum",level:3,label:`${r} to ${i}${null==o?"":`: ${a(o)}`}.`,...null==o?{}:{value:o},datum:e}});h.children?.push({id:"routes",role:"series",level:2,label:`Routes: ${p.length} ${1===p.length?"route":"routes"}.`,children:e})}return h}function bo(e,t={},r={}){return!!pi(e,t,r.recipe)||pd.has(e)||fd.has(e)||md.has(e)||Ku.has(e)||Ju.has(e)||Xu.has(e)||Zu.has(e)}function vo(e,t){t&&e.children?.push(t)}function wo(e,t,r,a){t=Ka(t);const i=Array.isArray(t.nodes)?t.nodes:[],o=Array.isArray(t.edges)?t.edges:Array.isArray(t.flows)?t.flows:[],n=t.nodeIdAccessor??t.nodeIDAccessor,s=t.sourceAccessor??"source",c=t.targetAccessor??"target",l=t.valueAccessor??"value",u=e=>oi(ii(e,n,"id"),"unknown"),d=(e,t)=>oi(ii(e,t,""),"unknown"),h=/* @__PURE__ */new Set;for(const e of o)h.add(d(e,s)),h.add(d(e,c));const p=i.length>0?i:[...h].map(e=>({id:e})),f=/* @__PURE__ */new Map;for(const e of p)f.set(u(e),{links:0,value:0});for(const e of o){const t=d(e,s),r=d(e,c),a=ni(ii(e,l,"value"))??0;for(const e of[t,r]){const t=f.get(e)??{links:0,value:0};t.links+=1,t.value+=a,f.set(e,t)}}const m={id:"root",role:"chart",level:1,label:`A ${"SankeyDiagram"===e||"ProcessSankey"===e?"flow diagram":"ChordDiagram"===e?"chord diagram":"network graph"} with ${p.length} nodes and ${o.length} links.${ci(t,"Use linked highlighting to trace related marks.")}`,children:[]};let g=0;const y=/* @__PURE__ */new Map,b=t.colorBy??"group";for(const e of p){const t=oi(ii(e,b,"group"),"Ungrouped"),r=y.get(t);r?r.push(e):y.set(t,[e])}const v=[...y].map(([e,t],i)=>{const o=[];for(const[e,n]of t.entries()){if(g>=r)break;g+=1;const t=u(n),s=f.get(t)??{links:0,value:0},c=s.value>0?`, ${a(s.value)} total flow`:"";o.push({id:`node-${i}-${e}-${si(t)}`,role:"datum",level:3,label:`${t}: ${s.links} ${1===s.links?"link":"links"}${c}.`,value:s.value>0?s.value:void 0,datum:n})}return{id:`nodes-${i}-${si(e)}`,role:"series",level:2,label:`${e}: ${t.length} ${1===t.length?"node":"nodes"}.`,children:o}});v.length>0&&m.children?.push(...v);const w=o.slice(0,r).map((e,t)=>{const r=d(e,s),i=d(e,c),o=ni(ii(e,l,"value"));return{id:`link-${si(r)}-${si(i)}-${t}`,role:"datum",level:3,label:`${r} to ${i}${null==o?"":`: ${a(o)}`}.`,value:o,datum:e}});return o.length>r&&w.push({id:"links-more",role:"datum",level:3,label:`…and ${o.length-r} more links.`,value:void 0}),w.length>0&&m.children?.push({id:"links",role:"series",level:2,label:`Links: ${o.length} ${1===o.length?"connection":"connections"}.`,children:w}),m}function Ao(e,t){const r=Array.isArray(e.annotations)?e.annotations:null;if(!r)return null;const a=ai(r.filter(e=>!!e&&"object"==typeof e));if(0===a.length)return null;let i=0;const o=a.slice(0,t).map(e=>{const t=e.lifecycle?.status,r=t&&"accepted"!==t?` (${t})`:"";return{id:"annotation-"+i++,role:"annotation",level:3,label:`${a=Vi(e),a?a.charAt(0).toUpperCase()+a.slice(1):a}${r}.`,datum:e};var a});a.length>t&&o.push({id:"annotation-"+i++,role:"annotation",level:3,label:`…and ${a.length-t} more annotations.`});const n=a.length;return{id:"annotations",role:"annotation",level:2,label:`Annotations: ${1===n?"one marked feature":`${n} marked features`}.`,children:o}}function xo(e,t,r={}){t=Ka(t);const a=r.locale??"en",i=Math.max(1,r.maxLeaves??200),o=Di(a),n=pi(e,t,r.recipe);if(n)return io(n,t,{maxLeaves:i,locale:a});const s={id:"root",role:"chart",label:Wi(e,t,{locale:a}).text||"Chart.",level:1,children:[]},c=Ao(t,i);if(pd.has(e)){const r=wo(e,t,i,o);return vo(r,c),r}if(fd.has(e)){const r=co(e,t,i,o);return vo(r,c),r}if(md.has(e)){const r=yo(e,t,i,o);return vo(r,c),r}const l=Array.isArray(t.data)?t.data:null,u=bo(e,t,r);if(!l||0===l.length||!u)return c&&(s.children=[c]),s;const{measure:d,measureFallback:h,dimension:p,dimensionFallback:f}=ei(e,t),m=Za(d,h),g=qa(p,f),y="string"==typeof d&&d?d:h,b="string"==typeof p&&p?p:f,v=ti(t);let w=0;const A=e=>`${e}-${w++}`,x=(e,t)=>{const r=m(e),a=ri(g(e),o);return{id:A("datum"),role:"datum",level:t,label:`${a}: ${Number.isFinite(r)?o(r):"—"}`,value:Number.isFinite(r)?r:void 0,datum:e}},$=(e,t)=>{const r=e.slice(0,i).map(e=>x(e,t));return e.length>i&&r.push({id:A("more"),role:"datum",level:t,label:`…and ${e.length-i} more points`}),r},C=[];if(Ku.has(e)||Ju.has(e)){let t=1/0,r=-1/0,a=1/0,i=-1/0;const n=[];let s=!0;for(const e of l){const o=m(e);Number.isFinite(o)&&(o<t&&(t=o),o>r&&(r=o));const c=g(e);n.push(c),"number"==typeof c&&Number.isFinite(c)?(c<a&&(a=c),c>i&&(i=c)):s=!1}const c=/* @__PURE__ */new Set,u=[];for(const e of n){const t=oi(e);c.has(t)||(c.add(t),u.push(e))}const d=s?`${o(a)} to ${o(i)}`:`${ri(u[0],o)} to ${ri(u[u.length-1],o)} (${Ju.has(e)?`${u.length} categories`:`${l.length} points`})`;C.push({id:A("axis"),role:"axis",level:2,label:`${Ju.has(e)?"Category axis":"X axis"}: ${b}, ${d}.`}),r>=t&&C.push({id:A("axis"),role:"axis",level:2,label:`Value axis: ${y}, ${o(t)} to ${o(r)}.`})}if(v){const r=qa(v,v),i=/* @__PURE__ */new Map;for(const e of l){const t=oi(r(e)),a=i.get(t);a?a.push(e):i.set(t,[e])}const o=[];for(const[r,n]of i){const i=Wi(e,{...t,data:n},{levels:["l2","l3"],locale:a}).text;o.push({id:A("series"),role:"series",level:2,label:`Series ${r}: ${i}`,children:$(n,3)})}s.children=[...C,...o]}else s.children=[...C,...$(l,2)];return c&&s.children.push(c),s}function $o(e,t){const r=[],a=e=>{if(r.push(e),e.children&&e.children.length>0&&t.has(e.id))for(const t of e.children)a(t)};return a(e),r}function Co(e){let t=1;if(e.children)for(const r of e.children)t+=Co(r);return t}function So(e){return Ee(e)?e:void 0}function ko(e){const t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:void 0}function Ro(e){const t=ko(e);return null==t?void 0:Math.max(0,Math.floor(t))}function Po(...e){return e.map(So).find(Boolean)}function Eo(...e){return e.find(Array.isArray)}function No(e){const t={};for(const[r,a]of Object.entries(e))void 0!==a&&(t[r]=a);return t}function To(e,t,r){return e["string"==typeof t&&t?t:r]}function Io(e){return"number"==typeof e?Number.isInteger(e)?String(e):String(Math.round(1e3*e)/1e3):oi(e)}function Mo(e,t,r){const a=[];if("GaugeChart"===e){"number"==typeof t.value&&Number.isFinite(t.value)&&a.push(`Current value is ${Io(t.value)}.`);const e="number"==typeof t.min&&Number.isFinite(t.min)?t.min:0,r="number"==typeof t.max&&Number.isFinite(t.max)?t.max:100;a.push(`The gauge scale runs from ${Io(e)} to ${Io(r)}.`)}if("SankeyDiagram"===e||"ProcessSankey"===e){const i=Array.isArray(t.edges)?t.edges:[];if("ProcessSankey"===e&&Array.isArray(t.domain)&&2===t.domain.length&&a.push(`The ProcessSankey time domain runs from ${Io(t.domain[0])} to ${Io(t.domain[1])}.`),i.length>0){a.push(`${i.length} source flow${1===i.length?"":"s"} are supplied.`);for(const o of i.slice(0,r)){const r=To(o,t.sourceAccessor,"source"),i=To(o,t.targetAccessor,"target"),n=To(o,t.valueAccessor,"value"),s="ProcessSankey"===e&&(null!=o.startTime||null!=o.endTime);a.push(s?`${Io(r)} to ${Io(i)} has value ${Io(n)} over ${Io(o.startTime)}–${Io(o.endTime)}.`:`${Io(r)} to ${Io(i)} has value ${Io(n)}.`)}}}if("Treemap"===e||"CirclePack"===e||"TreeDiagram"===e||"OrbitDiagram"===e){const e=Ee(t.data)?t.data:void 0,i="string"==typeof t.valueAccessor&&t.valueAccessor?t.valueAccessor:"value",o="string"==typeof t.nodeIdAccessor&&t.nodeIdAccessor?t.nodeIdAccessor:"string"==typeof t.nodeIDAccessor&&t.nodeIDAccessor?t.nodeIDAccessor:"name",n=[],s=/* @__PURE__ */new WeakSet,c=e=>{if(s.has(e))return;const r=li(e,t.childrenAccessor);if(0!==r.length){s.add(e);for(const e of r)c(e);s.delete(e)}else n.push(e)};if(e&&c(e),n.length>0){a.push(`${n.length} hierarchy leaves are supplied.`);for(const e of n.slice(0,r))a.push(`${Io(e[o])} has value ${Io(e[i])}.`)}}if(gd.has(e)&&Array.isArray(t.data)){const r=t.data;a.push(`${r.length} observed source row${1===r.length?"":"s"} are supplied.`);const i="CollisionSwarmChart"===e?t.xAccessor:t.valueAccessor,o="CollisionSwarmChart"===e?"x":"value",n=r.map(e=>ko(To(e,i,o))).filter(e=>null!=e);if(n.length>0){const[e,t]=P(n);a.push(`Observed ${"string"==typeof i?i:o} ranges from ${Io(e)} to ${Io(t)}.`)}}if(0!==a.length)return{source:"chart-props",statements:a,text:`Exact chart-prop facts: ${a.join(" ")}`}}function Oo(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:`${t}s`}function jo(e){return Number.isInteger(e)?String(e):String(Math.round(1e3*e)/1e3)}function Fo(e,t,r,a){const i=So(e.settledProjection),o=So(t?.settledProjection);return Eo(r?.projectionRows,r?.aggregates,e.settledProjectionRows,e.projectionRows,i?.rows,t?.settledProjectionRows,t?.projectionRows,o?.rows,a?.binCounts)}function zo(e){if(!e||0===e.length)return;const t=e.map((e,t)=>{const r=So(e);if(!r)return;const a=ko(r.count??r.value??r.total??r.bodies??r.events);if(null==a)return;const i=oi(r.label??r.id??r.name,`container ${t+1}`),o=null==r.id?void 0:oi(r.id),n=ko(r.secondary??r.secondaryCount),s=ko(r.observed??r.observedCount);return No({id:o,label:i,count:a,secondary:n,secondaryLabel:"string"==typeof r.secondaryLabel?r.secondaryLabel:void 0,observed:s})}).filter(e=>null!=e);if(0===t.length)return;const r=t.reduce((e,t)=>e+t.count,0),a=t.filter(e=>e.count>0).length,i=t.slice().sort((e,t)=>t.count-e.count)[0];return{rows:t,totalCount:r,populatedCount:a,...i?{leader:i}:{}}}function Lo(e,t){const r=e?.map((e,t)=>{const r=So(e);if(!r)return;const a=ko(r.count)??0,i=ko(r.total),o={label:oi(r.label??r.id,`sediment ${t+1}`),count:a};return null!=r.id&&(o.id=oi(r.id)),null!=i&&(o.total=i),o}).filter(e=>null!=e),a=Ro(t?.bins)??r?.length??0,i=ko(t?.count)??r?.reduce((e,t)=>e+t.count,0)??0,o=ko(t?.total)??r?.reduce((e,t)=>e+(t.total??0),0),n=r?.slice().sort((e,t)=>t.count-e.count)[0];if(0!==a||0!==i||o)return{bins:a,count:i,...null!=o&&o>0?{total:o}:{},...n?{leader:n}:{}}}function Bo(e){const t=So(e);return!!t&&(Ee(t.world)||"simulationState"in t||"liveBodyOrder"in t)}function Do(e){if(e)return e.filter(e=>!0===So(e)?.sleeping).length}function _o(e,t,r){const a=e?.filter(e=>!0===So(e)?.sensor).length,i=So(t?.observation),o=So(i?.sensors),n=Eo(r?.activeSensors);return Math.max(a??0,o?Object.keys(o).length:0,n?.length??0)||void 0}function Uo(e){const t=[],r=e.simulation,a=[r.state??(r.settled?"settled":void 0),null!=r.liveBodies?`${r.liveBodies} live ${Oo(r.liveBodies,"body")}`:void 0,null!=r.sleepingBodies?`${r.sleepingBodies} sleeping`:void 0,null!=r.queued?`${r.queued} queued`:void 0,null!=r.seed?`seed ${jo(r.seed)}`:void 0,r.gravity?`gravity (${jo(r.gravity.x)}, ${jo(r.gravity.y)})`:void 0,null!=r.fixedDt?`fixed step ${jo(r.fixedDt)}s`:void 0,null!=r.timeScale?`${jo(r.timeScale)}x time`:void 0].filter(Boolean);a.length>0&&t.push(`Physics simulation: ${a.join("; ")}.`);const i=e.geometry;if(i){const e=[null!=i.colliders?`${i.colliders} ${Oo(i.colliders,"collider")}`:void 0,null!=i.sensors?`${i.sensors} ${Oo(i.sensors,"sensor")}`:void 0,null!=i.springs?`${i.springs} ${Oo(i.springs,"spring")}`:void 0,null!=i.activeSensorPairs?`${i.activeSensorPairs} active sensor ${Oo(i.activeSensorPairs,"pair")}`:void 0].filter(Boolean);e.length>0&&t.push(`Physics geometry: ${e.join("; ")}.`)}const o=e.aggregates;if(o){const e=o.leader,r=e?` Largest is ${e.label} with ${jo(e.count)}.`:"";t.push(`Physics aggregates: ${jo(o.totalCount)} settled ${Oo(o.totalCount,"body")} across ${o.rows.length} ${Oo(o.rows.length,"container")}; ${o.populatedCount} populated.${r}`)}const n=e.sediment;if(n){const e=null!=n.total?`, value total ${jo(n.total)}`:"",r=n.leader?`; largest sediment bin is ${n.leader.label} with ${jo(n.leader.count)}`:"";t.push(`Physics sediment: ${n.count} retained ${Oo(n.count,"body")} in ${n.bins} ${Oo(n.bins,"bin")}${e}${r}.`)}return t.join(" ")}function Go(e,t,r){if(!1===r)return;const a=So(r),i=So(t.physics),o=Po(a?.snapshot,i?.snapshot,t.physicsSnapshot,Bo(t.snapshot)?t.snapshot:void 0),n=Po(a?.evidence,i?.evidence,t.physicsEvidence,t.settledEvidence),s=Po(a?.config,i?.config,o?.config,t.config),c=Po(So(o?.world),So(i?.world)),l=Po(So(s?.kernel),So(c?.options)),u=Eo(c?.bodies),d=Eo(c?.colliders,s?.colliders),h=Eo(o?.queue,i?.queue),p=Eo(o?.liveBodyOrder),f=Eo(c?.springs),m=Eo(o?.activeSensorPairs),g=zo(Fo(t,i,a,n)),y=Lo(Eo(a?.sediment,i?.sediment,o?.sediment),Po(a?.sedimentTotals,i?.sedimentTotals)),b=p?.length??u?.length??Ro(n?.bodyCount),v=Do(u)??Ro(n?.sleepingCount),w=h?.length,A="string"==typeof o?.simulationState?o.simulationState:void 0,x="boolean"==typeof n?.settled?n.settled:A?"settled"===A:null!=b||null!=v||null!=w?null!=b&&v===b&&0===(w??0):void 0,$=So(l?.gravity),C=ko($?.x),S=ko($?.y),k=No({state:A,settled:x,elapsedSeconds:ko(o?.elapsedSeconds),paused:"boolean"==typeof o?.paused?o.paused:void 0,visible:"boolean"==typeof o?.visible?o.visible:void 0,seed:ko(l?.seed),gravity:null!=C&&null!=S?{x:C,y:S}:void 0,fixedDt:ko(s?.fixedDt??l?.fixedDt),timeScale:ko(s?.timeScale),maxSubsteps:Ro(s?.maxSubsteps),liveBodies:b,sleepingBodies:v,queued:w,bodyLimit:ko(s?.bodyLimit),eviction:"string"==typeof s?.eviction?s.eviction:void 0}),R=No({colliders:d?.length,sensors:_o(d,s,c),springs:f?.length,activeSensorPairs:m?.length}),P=Object.keys(R).length>0,E=gd.has(e);if(!(Object.keys(k).length>0||P||g||y)||!E&&null==r)return;const N={simulation:k,...P?{geometry:R}:{},...g?{aggregates:g}:{},...y?{sediment:y}:{}},T=Uo(N);return{...N,text:T}}function Vo(e){if(!e)return{};if("fits"in e||"buildProps"in e)return{family:e.family};const t=e;return{family:t.family,intentScores:t.intentScores}}function Ho(e,t,r={}){t=Ka(t);const{capability:a,audience:i,locale:o}=r,n=r.levels??["l1","l2","l3"],s=!1!==r.includeStructure,c=Li(e,a),l=Wi(e,t,{levels:c?[...n,"l4"]:n,locale:o,capability:a,audience:i}),{l4:u,...d}=l.levels,h=["l1","l2","l3"].map(e=>l.levels[e]).filter(Boolean).join(" "),p={levels:d,text:l.annotations?`${l.annotations} ${h}`.trim():h,...l.annotations?{annotations:l.annotations}:{}};let f;if(c&&u){const e=Vo(a);f={act:c,sentence:u,family:e.family,intentScores:e.intentScores}}const m=s?xo(e,t,{maxLeaves:r.maxLeaves,locale:o}):void 0,g=Go(e,t,r.physics),y=Mo(e,t,Math.max(1,r.maxLeaves??200)),b=[p.text,f?.sentence,g?.text,y?.text].filter(Boolean).join(" ");return{component:e,description:p,intent:f,structure:m,physics:g,facts:y,text:b}}function Wo(e,t=30,r=1){return Math.max((e??4)+5/r,12/r,t)}function qo(e,t){return t?.length?(Object.defineProperty(e,yd,{configurable:!0,enumerable:!1,value:t}),e):e}function Yo(e){return e?.[yd]}function Ko(e){const t=e;return Yo(!0===t?.__semioticHoverData?t.data:e)}function Jo(e,t){return Object.defineProperty(e,bd,{configurable:!0,enumerable:!1,value:t}),e}function Xo(e){if(null==e||"string"==typeof e&&""===e.trim())return NaN;if(e instanceof Date)return e.getTime();if("string"==typeof e){const t=Tt(e);if(Number.isFinite(t))return t}return Number(e)}function Zo(e){return t=>"number"!=typeof t.binStart||"number"!=typeof t.binEnd?t:Jo(qo({...t},Yo(t)),{ranges:{[e]:[t.binStart,t.binEnd]},toNumber:Xo})}function Qo(e,t){return vd.has(e)&&!("reading"===e&&"string"==typeof t)}function en(e){const t=[...xd],r=Array.from((new TextEncoder).encode(e)),a=8*r.length;for(r.push(128);r.length%64!=56;)r.push(0);const i=Math.floor(a/4294967296),o=a>>>0;r.push(i>>>24&255,i>>>16&255,i>>>8&255,255&i,o>>>24&255,o>>>16&255,o>>>8&255,255&o);const n=[];for(let e=0;e<r.length;e+=4)n.push((r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0);for(let e=0;e<n.length;e+=16){const r=[...n.slice(e,e+16)];for(let e=16;e<64;e+=1){const t=wd(r[e-15],7)^wd(r[e-15],18)^r[e-15]>>>3,a=wd(r[e-2],17)^wd(r[e-2],19)^r[e-2]>>>10;r[e]=r[e-16]+t+r[e-7]+a>>>0}let[a,i,o,s,c,l,u,d]=t;for(let e=0;e<64;e+=1){const t=d+(wd(c,6)^wd(c,11)^wd(c,25))+(c&l^~c&u)+$d[e]+r[e]>>>0,n=a&i^a&o^i&o;d=u,u=l,l=c,c=s+t>>>0,s=o,o=i,i=a,a=t+((wd(a,2)^wd(a,13)^wd(a,22))+n>>>0)>>>0}const h=[a,i,o,s,c,l,u,d];for(let e=0;e<8;e+=1)t[e]=t[e]+h[e]>>>0}return t.map(e=>e.toString(16).padStart(8,"0")).join("")}function tn(e,t){return`${e}[Symbol(${t.description??""})]`}function rn(e,t){if(!/^(0|[1-9][0-9]*)$/.test(e))return!1;const r=Number(e);return Number.isSafeInteger(r)&&r>=0&&r<t}function an(e,t){return"number"==typeof t?`${e}[${t}]`:e?`${e}.${t}`:t}function on(e){return e.sort((e,t)=>{const r=JSON.stringify(e),a=JSON.stringify(t);return r<a?-1:r>a?1:0})}function nn(e,t,r){if(null===e)return null;if(e instanceof Date){const a=e.getTime();return Number.isFinite(a)?{$type:"date",value:e.toISOString()}:void r.excluded.push(t)}switch(typeof e){case"string":case"boolean":return e;case"number":return Number.isNaN(e)?{$type:"number",value:"NaN"}:e===1/0?{$type:"number",value:"Infinity"}:e===-1/0?{$type:"number",value:"-Infinity"}:Object.is(e,-0)?{$type:"number",value:"-0"}:e;case"bigint":return{$type:"bigint",value:e.toString()};case"undefined":case"function":case"symbol":return void r.excluded.push(t);case"object":{const a=e;if(r.ancestors.has(a))return void r.excluded.push(t);r.ancestors.add(a);try{if(Array.isArray(e)){for(const a of Reflect.ownKeys(e))"length"===a||"string"==typeof a&&rn(a,e.length)||r.excluded.push("symbol"==typeof a?tn(t,a):an(t,a));return Array.from({length:e.length},(a,i)=>{const o=an(t,i),n=Object.getOwnPropertyDescriptor(e,String(i));if(!n||!("value"in n)||!n.enumerable)return r.excluded.push(o),null;const s=nn(n.value,o,r);return void 0===s?null:s})}const a={},i=Object.getPrototypeOf(e);if(i!==Object.prototype&&null!==i)return void r.excluded.push(t);const o=[];for(const a of Reflect.ownKeys(e)){if("symbol"==typeof a){r.excluded.push(tn(t,a));continue}const i=Object.getOwnPropertyDescriptor(e,a);i&&"value"in i&&i.enumerable?o.push(a):r.excluded.push(an(t,a))}for(const i of o.sort()){const o=Object.getOwnPropertyDescriptor(e,i),n=nn(o&&"value"in o?o.value:void 0,an(t,i),r);void 0!==n&&Object.defineProperty(a,i,{value:n,enumerable:!0,configurable:!0,writable:!0})}return a}finally{r.ancestors.delete(a)}}default:return void r.excluded.push(t)}}function sn(e,t=/* @__PURE__ */new Set){if(null===e)return["null"];if(e instanceof Date)return Number.isFinite(e.getTime())?["date",e.toISOString()]:["excluded"];switch(typeof e){case"string":return["string",e];case"boolean":return["boolean",e];case"number":return["number",Number.isNaN(e)?"NaN":e===1/0?"Infinity":e===-1/0?"-Infinity":Object.is(e,-0)?"-0":String(e)];case"bigint":return["bigint",e.toString()];case"undefined":case"function":case"symbol":return["excluded"];case"object":if(t.has(e))return["excluded"];t.add(e);try{const r=r=>{const a="symbol"==typeof r?["symbol-key",r.description??""]:["string-key",r],i=Object.getOwnPropertyDescriptor(e,r);return i?"value"in i?[a,"data",Boolean(i.enumerable),sn(i.value,t)]:[a,"accessor",Boolean(i.enumerable),Boolean(i.get),Boolean(i.set)]:[a,"missing"]};if(Array.isArray(e))return["array",Array.from({length:e.length},(t,a)=>{const i=String(a);return Object.prototype.hasOwnProperty.call(e,i)?r(i):["hole"]}),on(Reflect.ownKeys(e).filter(t=>"length"!==t&&!("string"==typeof t&&rn(t,e.length))).map(r))];const a=Object.getPrototypeOf(e);return[a!==Object.prototype&&null!==a?"non-json-object":"object",on(Reflect.ownKeys(e).map(r))]}finally{t.delete(e)}default:return["excluded"]}}function cn(e){const t={excluded:[],ancestors:/* @__PURE__ */new Set},r=nn(e,"$",t)??null;return{value:r,text:JSON.stringify(r),excludedPaths:t.excluded}}function ln(e){const t=cn(e),r=en(JSON.stringify(["semiotic-value-fingerprint","v2",sn(e)]));return{...t,algorithm:"sha256",digest:r,fingerprint:`sha256:${r}`}}function un(e,t,r,a){yn(e,Object.keys(t),r,a);for(const[i,o]of Object.entries(t))o.values?(o.required||void 0!==e[i])&&vn(e,i,r,o.values,a):o.required?bn(e,i,r,a):Cn(e,i,r,a)}function dn(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function hn(e,t,r,a){void 0===e[t]||"number"==typeof e[t]&&Number.isFinite(e[t])||a.push({path:`${r}.${t}`,message:"Expected a finite number."})}function pn(e,t,r,a){void 0!==e[t]&&"boolean"!=typeof e[t]&&a.push({path:`${r}.${t}`,message:"Expected a boolean."})}function fn(e){return null===e||"string"==typeof e||"boolean"==typeof e||("number"==typeof e?Number.isFinite(e):Array.isArray(e)?e.every(fn):dn(e)&&Object.values(e).every(fn))}function mn(e,t,r,a){void 0===e[t]||dn(e[t])&&fn(e[t])||a.push({path:`${r}.${t}`,message:"Expected a JSON object."})}function gn(e){return e.every(fn)}function yn(e,t,r,a){const i=new Set(t);for(const t of Object.keys(e))i.has(t)||a.push({path:`${r}.${t}`,message:"Unexpected property."})}function bn(e,t,r,a){"string"==typeof e[t]&&e[t]||a.push({path:`${r}.${t}`,message:"Expected a non-empty string."})}function vn(e,t,r,a,i){"string"==typeof e[t]&&a.includes(e[t])||i.push({path:`${r}.${t}`,message:`Expected one of: ${a.join(", ")}.`})}function wn(e,t,r,a){const i=e[t];if(void 0!==i){if(dn(i))return i;a.push({path:`${r}.${t}`,message:"Expected an object."})}}function An(e,t,r,a){const i=e[t];if(void 0!==i){if(Array.isArray(i))return i;a.push({path:`${r}.${t}`,message:"Expected an array."})}}function xn(e,t,r){e?.some(e=>"string"!=typeof e||!e)&&r.push({path:t,message:"Expected non-empty string values."})}function $n(e,t,r,a,i){void 0!==e[t]&&vn(e,t,r,a,i)}function Cn(e,t,r,a){void 0!==e[t]&&"string"!=typeof e[t]&&a.push({path:`${r}.${t}`,message:"Expected a string."})}function Sn(e,t,r){dn(e)?(yn(e,["id","name","kind"],t,r),bn(e,"kind",t,r),Cn(e,"id",t,r),Cn(e,"name",t,r)):r.push({path:t,message:"Expected an actor object."})}function kn(e,t){const r=wn(e,"reception","$",t);if(!r)return;yn(r,["channels","audience","strengths","risks","scaffolds","description","dataFallback","manualChecks"],"$.reception",t);const a=An(r,"channels","$.reception",t);a||t.push({path:"$.reception.channels",message:"Expected a reception-channel array."}),a?.forEach((e,r)=>{const a=`$.reception.channels[${r}]`;dn(e)?(yn(e,["channel","disclosure","navigation","interactionInstructions","rawData","tokenBudget","privacyNotes"],a,t),vn(e,"channel",a,["visual","screen-reader","sonified","agent","print","low-bandwidth"],t),$n(e,"disclosure",a,["summary","standard","detailed"],t),$n(e,"rawData",a,["deny","bounded","allow"],t),pn(e,"navigation",a,t),pn(e,"interactionInstructions",a,t),hn(e,"tokenBudget",a,t),xn(An(e,"privacyNotes",a,t),`${a}.privacyNotes`,t)):t.push({path:a,message:"Expected a channel object."})});for(const e of["strengths","risks","scaffolds","manualChecks"])xn(An(r,e,"$.reception",t),`$.reception.${e}`,t);Cn(r,"audience","$.reception",t),Cn(r,"description","$.reception",t),pn(r,"dataFallback","$.reception",t)}function Rn(e,t){const r=wn(e,"form","$",t);r&&(yn(r,["chartFamily","whyThisForm","rejectedAlternatives","risks","misuse"],"$.form",t),Cn(r,"chartFamily","$.form",t),Cn(r,"whyThisForm","$.form",t),xn(An(r,"risks","$.form",t),"$.form.risks",t),xn(An(r,"misuse","$.form",t),"$.form.misuse",t),An(r,"rejectedAlternatives","$.form",t)?.forEach((e,r)=>{const a=`$.form.rejectedAlternatives[${r}]`;dn(e)?(yn(e,["representation","reason"],a,t),bn(e,"representation",a,t),bn(e,"reason",a,t)):t.push({path:a,message:"Expected an alternative object."})}))}function Pn(e,t){const r=wn(e,"contestability","$",t);r&&(yn(r,["sourceRequestsAllowed","alternativeViews","challenges","corrections","editorialExceptions"],"$.contestability",t),pn(r,"sourceRequestsAllowed","$.contestability",t),An(r,"challenges","$.contestability",t)?.forEach((e,r)=>{const a=`$.contestability.challenges[${r}]`;if(dn(e)){yn(e,["id","claimId","status","reason","raisedBy","raisedAt","counterclaimId","resolution"],a,t),bn(e,"id",a,t),bn(e,"claimId",a,t),bn(e,"reason",a,t),vn(e,"status",a,["open","accepted","declined","resolved"],t),void 0!==e.raisedBy&&Sn(e.raisedBy,`${a}.raisedBy`,t);for(const r of["raisedAt","counterclaimId","resolution"])Cn(e,r,a,t)}else t.push({path:a,message:"Expected a challenge object."})}),An(r,"corrections","$.contestability",t)?.forEach((e,r)=>{const a=`$.contestability.corrections[${r}]`;if(!dn(e))return void t.push({path:a,message:"Expected a correction object."});yn(e,["id","affectedClaimIds","replacementClaimIds","reason","createdAt","createdBy"],a,t),bn(e,"id",a,t),bn(e,"reason",a,t);const i=An(e,"affectedClaimIds",a,t);i||t.push({path:`${a}.affectedClaimIds`,message:"Expected an affected-claim array."}),xn(i,`${a}.affectedClaimIds`,t),xn(An(e,"replacementClaimIds",a,t),`${a}.replacementClaimIds`,t),Cn(e,"createdAt",a,t),void 0!==e.createdBy&&Sn(e.createdBy,`${a}.createdBy`,t)}),An(r,"alternativeViews","$.contestability",t)?.forEach((e,r)=>{const a=`$.contestability.alternativeViews[${r}]`;dn(e)?(yn(e,["id","label","rationale"],a,t),bn(e,"id",a,t),bn(e,"label",a,t),Cn(e,"rationale",a,t)):t.push({path:a,message:"Expected an alternative-view object."})}),An(r,"editorialExceptions","$.contestability",t)?.forEach((e,r)=>{const a=`$.contestability.editorialExceptions[${r}]`;dn(e)?(yn(e,["ruleId","rationale","owner","reviewAt"],a,t),bn(e,"ruleId",a,t),bn(e,"rationale",a,t),Cn(e,"owner",a,t),Cn(e,"reviewAt",a,t)):t.push({path:a,message:"Expected an editorial-exception object."})}))}function En(e,t){const r=wn(e,"accountability","$",t);r&&(yn(r,["authors","generatedBy","dataSources","codeRef","reviews","actions"],"$.accountability",t),An(r,"authors","$.accountability",t)?.forEach((e,r)=>Sn(e,`$.accountability.authors[${r}]`,t)),xn(An(r,"dataSources","$.accountability",t),"$.accountability.dataSources",t),Cn(r,"generatedBy","$.accountability",t),Cn(r,"codeRef","$.accountability",t),An(r,"reviews","$.accountability",t)?.forEach((e,r)=>{const a=`$.accountability.reviews[${r}]`;if(dn(e)){yn(e,["id","status","reviewer","reviewedAt","rationale","policyId"],a,t),bn(e,"id",a,t),vn(e,"status",a,["pending","approved","changes-requested","rejected"],t),void 0!==e.reviewer&&Sn(e.reviewer,`${a}.reviewer`,t);for(const r of["reviewedAt","rationale","policyId"])Cn(e,r,a,t)}else t.push({path:a,message:"Expected a review object."})}),An(r,"actions","$.accountability",t)?.forEach((e,r)=>{const a=`$.accountability.actions[${r}]`;if(!dn(e))return void t.push({path:a,message:"Expected an action object."});yn(e,["id","action","actor","actedAt","claimIds","artifactId","artifactRevision","policyId","status","invalidatedByClaimId"],a,t),bn(e,"id",a,t),bn(e,"action",a,t);const i=An(e,"claimIds",a,t);i||t.push({path:`${a}.claimIds`,message:"Expected a claim identifier array."}),xn(i,`${a}.claimIds`,t),void 0!==e.actor&&Sn(e.actor,`${a}.actor`,t);for(const r of["actedAt","artifactId","artifactRevision","policyId","invalidatedByClaimId"])Cn(e,r,a,t);$n(e,"status",a,["proposed","taken","reversed","invalidated"],t)}))}function Nn(e,t){const r=wn(e,"inheritance","$",t);if(r){yn(r,["requiredPaths","prohibitedExports","privacy","rawDataDefault","preservation","sourceArtifactIds"],"$.inheritance",t);for(const e of["requiredPaths","prohibitedExports","sourceArtifactIds"])xn(An(r,e,"$.inheritance",t),`$.inheritance.${e}`,t);$n(r,"privacy","$.inheritance",["public","restricted","confidential","unknown"],t),$n(r,"rawDataDefault","$.inheritance",["exclude","bounded","include"],t),$n(r,"preservation","$.inheritance",["full-fidelity","claim-evidence-preserved","visual-only","lossy","unknown"],t)}}function Tn(e,t){kn(e,t),Rn(e,t),Pn(e,t),En(e,t),Nn(e,t)}function In(e){for(const t of Object.values(e))Object.freeze(t.suppliedBy),Object.freeze(t);return Object.freeze(e)}function Mn(e,t){if(void 0===e||dn(e)){if(dn(e))for(const[r,a]of Object.entries(e)){const e=`$.fieldStatus.${r}`;if(!dn(a)||"string"!=typeof a.status){t.push({path:e,message:"Expected a field state with a status."});continue}yn(a,["status","reason","suppliedBy","derived","reviewedBy"],e,t),["known","unknown","manual","not-applicable"].includes(a.status)||t.push({path:`${e}.status`,message:"Expected one of: known, unknown, manual, not-applicable."}),void 0===a.suppliedBy||"string"==typeof a.suppliedBy&&["author","system","model-proposal","import"].includes(a.suppliedBy)||t.push({path:`${e}.suppliedBy`,message:"Expected one of: author, system, model-proposal, import."}),Cn(a,"reason",e,t),Cn(a,"reviewedBy",e,t),pn(a,"derived",e,t);const i=Object.prototype.hasOwnProperty.call(Sd,r)?Sd[r]:void 0,o="model-proposal"===a.suppliedBy,n=o&&!0===i?.modelMayPropose&&"known"!==a.status;i&&"known"===a.status&&"string"!=typeof a.suppliedBy&&t.push({path:`${e}.suppliedBy`,message:`Known field "${r}" must identify an allowed supplier.`}),!i||"string"!=typeof a.suppliedBy||n||i.suppliedBy.includes(a.suppliedBy)||t.push({path:`${e}.suppliedBy`,message:`Field "${r}" cannot be supplied by ${a.suppliedBy}.`}),i&&!0===a.derived&&!i.derivable&&t.push({path:`${e}.derived`,message:`Field "${r}" cannot be marked as derived.`}),!i||!o||i.modelMayPropose&&"known"!==a.status||t.push({path:`${e}.suppliedBy`,message:"known"===a.status?`A model proposal cannot finalize field "${r}" as known.`:`Field "${r}" does not accept model proposals.`}),"required"!==i?.humanReview||"known"!==a.status||"string"==typeof a.reviewedBy&&a.reviewedBy.trim()||t.push({path:`${e}.reviewedBy`,message:`Known field "${r}" requires an attributable human review.`})}}else t.push({path:"$.fieldStatus",message:"Expected a field-state object."})}function On(e,t){const r="$.time";yn(e,[...Pd,...Object.keys(Ed),"sources"],r,t);for(const a of Pd)Cn(e,a,r,t);for(const[a,i]of Object.entries(Ed)){const o=wn(e,a,r,t);o&&un(o,i,`${r}.${a}`,t)}An(e,"sources",r,t)?.forEach((e,a)=>{const i=`${r}.sources[${a}]`;dn(e)?un(e,Nd,i,t):t.push({path:i,message:"Expected a source object."})})}function jn(e){try{return Fn(e)}catch{return{valid:!1,errors:[{path:"$",message:"Artifact contract could not be inspected safely."}],warnings:[]}}}function Fn(e){const t=[],r=[];if(!dn(e))return{valid:!1,errors:[{path:"$",message:"Expected an object."}],warnings:r};const a=Gr(e);if(a.length>0)return{valid:!1,errors:a.map(e=>({path:e,message:"Expected a JSON-compatible value that survives serialization unchanged."})),warnings:r};if(yn(e,["contractVersion","artifact","purpose","claims","evidence","time","reception","form","contestability","accountability","inheritance","fieldStatus","extensions"],"$",t),e.contractVersion!==Cd&&t.push({path:"$.contractVersion",message:`Expected contract version ${Cd}.`}),dn(e.artifact)){yn(e.artifact,["id","kind","component","title","createdAt","configFingerprint","dataFingerprint","revision"],"$.artifact",t),bn(e.artifact,"id","$.artifact",t),vn(e.artifact,"kind","$.artifact",["chart","dashboard","story","alert","agent-answer"],t);for(const r of["component","title","createdAt","configFingerprint","dataFingerprint","revision"])Cn(e.artifact,r,"$.artifact",t)}else t.push({path:"$.artifact",message:"Expected an artifact identity object."});if(dn(e.purpose))if(Array.isArray(e.purpose.intents)){yn(e.purpose,["intents","communicativeAct","decisionContext","stakes","allowedUses","prohibitedUses"],"$.purpose",t),e.purpose.intents.forEach((e,r)=>{dn(e)&&"string"==typeof e.id&&e.id||t.push({path:`$.purpose.intents[${r}].id`,message:"Expected a non-empty intent identifier."}),dn(e)&&yn(e,["id","strength","source","rationale"],`$.purpose.intents[${r}]`,t),dn(e)&&void 0!==e.strength&&vn(e,"strength",`$.purpose.intents[${r}]`,["primary","secondary"],t),dn(e)&&($n(e,"source",`$.purpose.intents[${r}]`,["author","derived","model-proposal","import"],t),Cn(e,"rationale",`$.purpose.intents[${r}]`,t))});for(const r of["allowedUses","prohibitedUses"])xn(An(e.purpose,r,"$.purpose",t),`$.purpose.${r}`,t);$n(e.purpose,"stakes","$.purpose",["exploratory","informational","operational","high"],t),Cn(e.purpose,"communicativeAct","$.purpose",t),Cn(e.purpose,"decisionContext","$.purpose",t)}else t.push({path:"$.purpose.intents",message:"Expected an intent array."});else t.push({path:"$.purpose",message:"Expected a purpose object."});Array.isArray(e.claims)?e.claims.forEach((e,r)=>{if(!dn(e))return void t.push({path:`$.claims[${r}]`,message:"Expected a claim object."});yn(e,["id","text","kind","status","evidenceIds","scope","uncertainty","asOf","supersedes","authoredBy","review","tags"],`$.claims[${r}]`,t),bn(e,"id",`$.claims[${r}]`,t),vn(e,"kind",`$.claims[${r}]`,["description","observation","aggregation","inference","forecast","simulation","alert","recommendation","normative"],t),vn(e,"status",`$.claims[${r}]`,["supported","provisional","disputed","superseded","retracted","unsupported","unknown"],t),Array.isArray(e.evidenceIds)?e.evidenceIds.some(e=>"string"!=typeof e||!e)&&t.push({path:`$.claims[${r}].evidenceIds`,message:"Expected non-empty string evidence identifiers."}):t.push({path:`$.claims[${r}].evidenceIds`,message:"Expected an evidence identifier array."}),xn(An(e,"supersedes",`$.claims[${r}]`,t),`$.claims[${r}].supersedes`,t),Cn(e,"text",`$.claims[${r}]`,t),Cn(e,"asOf",`$.claims[${r}]`,t),mn(e,"scope",`$.claims[${r}]`,t),xn(An(e,"tags",`$.claims[${r}]`,t),`$.claims[${r}].tags`,t),void 0!==e.authoredBy&&Sn(e.authoredBy,`$.claims[${r}].authoredBy`,t);const a=wn(e,"review",`$.claims[${r}]`,t);a&&(yn(a,["status","reviewer","reviewedAt","rationale"],`$.claims[${r}].review`,t),vn(a,"status",`$.claims[${r}].review`,["proposed","reviewed","approved","rejected"],t),void 0!==a.reviewer&&Sn(a.reviewer,`$.claims[${r}].review.reviewer`,t),Cn(a,"reviewedAt",`$.claims[${r}].review`,t),Cn(a,"rationale",`$.claims[${r}].review`,t));const i=wn(e,"uncertainty",`$.claims[${r}]`,t);if(i){yn(i,["kind","lower","upper","confidence","unit","description"],`$.claims[${r}].uncertainty`,t),vn(i,"kind",`$.claims[${r}].uncertainty`,["interval","distribution","qualitative","unknown"],t);for(const e of["lower","upper","confidence"])hn(i,e,`$.claims[${r}].uncertainty`,t);Cn(i,"unit",`$.claims[${r}].uncertainty`,t),Cn(i,"description",`$.claims[${r}].uncertainty`,t)}}):t.push({path:"$.claims",message:"Expected a claim array."}),Array.isArray(e.evidence)?e.evidence.forEach((e,r)=>{if(!dn(e))return void t.push({path:`$.evidence[${r}]`,message:"Expected an evidence object."});yn(e,["id","role","label","source","fingerprint","dataVersion","observedAt","scope","sample","transformation","generatedClaimId","relationship"],`$.evidence[${r}]`,t),bn(e,"id",`$.evidence[${r}]`,t),vn(e,"role",`$.evidence[${r}]`,["source-data","external-source","transformation","statistical-test","model-output","human-observation","policy-rule","quality-check"],t);for(const a of["label","fingerprint","dataVersion","observedAt","generatedClaimId"])Cn(e,a,`$.evidence[${r}]`,t);mn(e,"scope",`$.evidence[${r}]`,t);const a=wn(e,"source",`$.evidence[${r}]`,t);if(a){yn(a,["name","uri","version","retrievedAt","publisher"],`$.evidence[${r}].source`,t);for(const e of["name","uri","version","retrievedAt","publisher"])Cn(a,e,`$.evidence[${r}].source`,t)}const i=wn(e,"transformation",`$.evidence[${r}]`,t);if(i){yn(i,["id","kind","description","inputEvidenceIds","parameters","assumptions","implementation","performedAt","performedBy"],`$.evidence[${r}].transformation`,t),bn(i,"id",`$.evidence[${r}].transformation`,t),vn(i,"kind",`$.evidence[${r}].transformation`,["aggregation","filter","normalization","binning","join","smoothing","forecasting","simulation","other"],t);const e=An(i,"inputEvidenceIds",`$.evidence[${r}].transformation`,t);e?xn(e,`$.evidence[${r}].transformation.inputEvidenceIds`,t):t.push({path:`$.evidence[${r}].transformation.inputEvidenceIds`,message:"Expected an evidence identifier array."}),xn(An(i,"assumptions",`$.evidence[${r}].transformation`,t),`$.evidence[${r}].transformation.assumptions`,t),Cn(i,"description",`$.evidence[${r}].transformation`,t),Cn(i,"implementation",`$.evidence[${r}].transformation`,t),Cn(i,"performedAt",`$.evidence[${r}].transformation`,t),mn(i,"parameters",`$.evidence[${r}].transformation`,t),void 0!==i.performedBy&&Sn(i.performedBy,`$.evidence[${r}].transformation.performedBy`,t)}const o=wn(e,"sample",`$.evidence[${r}]`,t);if(o){yn(o,["rowCount","fields","values","truncated"],`$.evidence[${r}].sample`,t),xn(An(o,"fields",`$.evidence[${r}].sample`,t),`$.evidence[${r}].sample.fields`,t);const e=An(o,"values",`$.evidence[${r}].sample`,t);e&&!gn(e)&&t.push({path:`$.evidence[${r}].sample.values`,message:"Expected JSON values."}),hn(o,"rowCount",`$.evidence[${r}].sample`,t),pn(o,"truncated",`$.evidence[${r}].sample`,t)}$n(e,"relationship",`$.evidence[${r}]`,["descriptive","correlational","causal","unknown"],t)}):t.push({path:"$.evidence",message:"Expected an evidence array."}),Mn(e.fieldStatus,t);const i=wn(e,"time","$",t);return i&&On(i,t),Tn(e,t),mn(e,"extensions","$",t),Array.isArray(e.claims)&&0===e.claims.length&&r.push({path:"$.claims",message:"The contract declares no claims."}),Array.isArray(e.evidence)&&0===e.evidence.length&&r.push({path:"$.evidence",message:"The contract declares no evidence."}),{valid:0===t.length,errors:t,warnings:r}}function zn(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function Ln(e,t){if(!t||!zn(e)||!Array.isArray(e.evidence))return[];const r=[];return e.evidence.forEach((e,t)=>{zn(e)&&Object.prototype.hasOwnProperty.call(e,"sample")&&(delete e.sample,r.push(`$.evidence[${t}].sample`))}),r}function Bn(e,t={}){try{return Dn(e,t)}catch{const t=Gr(e);return{transfer:{status:"invalid",omittedPaths:t.length?t:["$"],warnings:["Artifact contract could not be inspected safely."]}}}}function Dn(e,t){if(!zn(e))return{transfer:{status:"invalid",omittedPaths:["artifactContract"],warnings:["Artifact contract must be a JSON object."]}};const r=cn(e),a=[.../* @__PURE__ */new Set([...r.excludedPaths,...Gr(e)])].sort(),i=r.value,o=Ln(i,t.excludeEvidenceSamples),n=o.length?["Bounded evidence samples were excluded by the transfer policy."]:[],s=i?.contractVersion;if("string"!=typeof s||!s)return{contract:i,transfer:{status:"invalid",omittedPaths:[...a,...o],warnings:["Artifact contract is missing a string contractVersion.",...n]}};if(s!==Cd)return{contract:i,transfer:{status:a.length>0?"invalid":"unsupported-version",omittedPaths:[...a,...o],warnings:[`Contract version ${s} is not interpreted by this runtime.`,...a.length>0?[`Non-JSON values could not be preserved at: ${a.join(", ")}.`]:[],...n]}};const c=jn(i),l=[...c.errors.map(({path:e,message:t})=>`${e}: ${t}`),...c.warnings.map(({path:e,message:t})=>`${e}: ${t}`),...a.length?[`Non-JSON values could not be preserved at: ${a.join(", ")}.`]:[],...n];return{contract:i,transfer:{status:!c.valid||a.length>0?"invalid":o.length>0?"excluded":"preserved",omittedPaths:[...a,...o],warnings:l}}}function _n(e){const t=Bn(e);if(!t.contract||"preserved"!==t.transfer.status)throw new TypeError(t.transfer.warnings.join(" ")||"Artifact contract could not be serialized without loss.");return t}function Un(e){const t=Object.entries(e).filter(([e,t])=>Qo(e,t)&&void 0!==t);if(0!==t.length)return 1===t.length&&"data"===t[0][0]?t[0][1]:Object.fromEntries(t)}function Gn(e,t=[]){if(void 0===e)return;const r=t.filter(e=>Boolean(e.transformation)).map(({id:e,transformation:t})=>({evidenceId:e,transformation:t})).sort(({evidenceId:e},{evidenceId:t})=>e<t?-1:e>t?1:0);return ln(r.length>0?{data:e,transformations:r}:e).fingerprint}function Vn(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>!Qo(e,t)&&"recipeId"!==e))}function Hn(e,t,r,a=Un(t)){const i=Vn(t),o=0===Gr(i).length?ln(i).fingerprint:void 0,n=void 0!==a&&0===Gr(a).length?Gn(a,e.evidence):void 0,s="ChartRecipe"===r&&"string"==typeof t.recipeId?t.recipeId:r,c=[],l=[];return void 0!==s&&(void 0===e.artifact.component?l.push("artifact.component"):e.artifact.component!==s&&c.push("artifact.component")),void 0===e.artifact.configFingerprint||void 0===o?l.push("artifact.configFingerprint"):e.artifact.configFingerprint!==o&&c.push("artifact.configFingerprint"),void 0!==e.artifact.dataFingerprint&&n?e.artifact.dataFingerprint!==n&&c.push("artifact.dataFingerprint"):l.push("artifact.dataFingerprint"),{status:c.length>0?"mismatch":l.length>0?"unknown":"match",mismatchPaths:c,unknownPaths:l}}function Wn(e,t,r){const a=Hn(e,t,r);return{mismatchPaths:[...a.mismatchPaths,...void 0!==r&&a.unknownPaths.includes("artifact.component")?["artifact.component"]:[]]}}function qn(e,t){return[.../* @__PURE__ */new Set([...Object.keys(e),...Object.keys(t)])].filter(r=>{if(Object.prototype.hasOwnProperty.call(e,r)!==Object.prototype.hasOwnProperty.call(t,r))return!0;const a=ln(e[r]),i=ln(t[r]);return a.excludedPaths.length>0||a.fingerprint!==i.fingerprint}).map(e=>`props.${e}`).sort()}function Yn(e){if(e.startsWith("props."))return e.slice(6).split(/[.[\]]/,1)[0]}function Kn(e,t){const r=t.map(Yn).filter(e=>void 0!==e);return"artifact.dataFingerprint"===e?r.some(e=>vd.has(e)):"artifact.configFingerprint"===e&&r.some(e=>!vd.has(e))}function Jn(e){if(!e||"object"!=typeof e)return!1;const t=e,r=t.serializedDataFingerprint;return"string"==typeof t.status&&Td.has(t.status)&&Array.isArray(t.omittedPaths)&&t.omittedPaths.every(e=>"string"==typeof e)&&Array.isArray(t.warnings)&&t.warnings.every(e=>"string"==typeof e)&&(void 0===t.serializedConfigFingerprint||"string"==typeof t.serializedConfigFingerprint)&&(null==r||"string"==typeof r)&&(void 0===t.transferFingerprint||"string"==typeof t.transferFingerprint)}function Xn(e,t,r,a){return ln({component:t,version:a.version,createdAt:a.createdAt,...void 0!==a.recipeId?{recipeId:a.recipeId}:{},...void 0!==a.portable?{portable:a.portable}:{},...void 0!==a.manifest?{manifest:a.manifest}:{},...void 0!==a.reason?{reason:a.reason}:{},...void 0!==a.warnings?{warnings:a.warnings}:{},...void 0!==a.selections?{selections:a.selections}:{},artifactContract:r,status:e.status,omittedPaths:e.omittedPaths,warnings:e.warnings,...void 0!==e.serializedConfigFingerprint?{serializedConfigFingerprint:e.serializedConfigFingerprint}:{},...Object.prototype.hasOwnProperty.call(e,"serializedDataFingerprint")?{serializedDataFingerprint:e.serializedDataFingerprint}:{}}).fingerprint}function Zn(e,t,r,a,i){const o=Un(r),n={...e,serializedConfigFingerprint:ln(Vn(r)).fingerprint,serializedDataFingerprint:void 0===o?null:ln(o).fingerprint};return{...n,transferFingerprint:Xn(n,t,a,i)}}function Qn(e,t){const r=[],a=ln(Vn(t.props)).fingerprint,i=Un(t.props),o=void 0===i?null:ln(i).fingerprint;return void 0!==e.transferFingerprint&&e.transferFingerprint!==Xn(e,t.component,t.artifactContract,t)&&r.push("artifactTransfer.transferFingerprint"),void 0!==e.serializedConfigFingerprint&&e.serializedConfigFingerprint!==a&&r.push("artifactTransfer.serializedConfigFingerprint"),Object.prototype.hasOwnProperty.call(e,"serializedDataFingerprint")&&e.serializedDataFingerprint!==o&&r.push("artifactTransfer.serializedDataFingerprint"),r}function es(e,t){if("artifactContract"===t||"$.artifactContract"===t)return void 0!==e.artifactContract;let r,a;if("props"===t||t.startsWith("props.")?(r=e,a=t):(r=e.artifactContract,a=t.startsWith("$.")?t.slice(2):t),"$"===a||""===a)return void 0!==r;const i=[...a.matchAll(/(?:^|\.)([^.[\]]+)|\[(\d+)\]/g)].map(e=>e[1]??Number(e[2]));if(0===i.length)return!1;for(const e of i){if(null===r||"object"!=typeof r||!Object.prototype.hasOwnProperty.call(r,e))return!1;r=r[e]}return!0}function ts(e,t,r,a,i){if(!t)return{};const o=_n(t),n=i.recipeId??e,s=Wn(t,r,n),c=qn(r,a),l=Wn(t,a,n);return s.mismatchPaths.length>0?{artifactContract:o.contract,artifactTransfer:Zn({status:"invalid",omittedPaths:s.mismatchPaths,warnings:["The artifact contract fingerprints do not match the supplied chart props or data."]},e,a,o.contract,i)}:c.length>0?{artifactContract:o.contract,artifactTransfer:Zn({status:"excluded",omittedPaths:c,warnings:["Chart props or data were excluded from the serialized configuration."]},e,a,o.contract,i)}:l.mismatchPaths.length>0?{artifactContract:o.contract,artifactTransfer:Zn({status:"invalid",omittedPaths:l.mismatchPaths,warnings:["Serialized chart props or data differ from the values bound to the artifact contract."]},e,a,o.contract,i)}:{artifactContract:o.contract,artifactTransfer:Zn(o.transfer,e,a,o.contract,i)}}function rs(e){if(!e.artifactContract){if(!e.artifactTransfer)return{};if(Jn(e.artifactTransfer)&&"excluded"===e.artifactTransfer.status&&e.artifactTransfer.omittedPaths.includes("artifactContract")){const t=e.artifactTransfer.omittedPaths.filter(t=>"artifactContract"!==t&&es(e,t));return 0===t.length?{artifactTransfer:Id(e.artifactTransfer)}:{artifactTransfer:{status:"invalid",omittedPaths:[...e.artifactTransfer.omittedPaths],warnings:[`The declared omitted path is still present: ${t.join(", ")}.`]}}}return{artifactTransfer:{status:"invalid",omittedPaths:["artifactContract"],warnings:["An artifact transfer report cannot claim preservation without an artifact contract."]}}}const t=Bn(e.artifactContract),r=e.artifactTransfer,a=t.transfer;let i=(()=>{if(!r)return{status:"invalid",omittedPaths:[.../* @__PURE__ */new Set([...a.omittedPaths,"artifactTransfer"])],warnings:[...a.warnings,"The artifact contract has no transfer report, so its transport history cannot be verified."]};if(!Jn(r))return{status:"invalid",omittedPaths:a.omittedPaths,warnings:[...a.warnings,"The declared artifact transfer report is malformed."]};const t="excluded"===r.status||"unsupported-version"===r.status?r.omittedPaths.filter(t=>es(e,t)):[];return t.length>0?{status:"invalid",omittedPaths:[.../* @__PURE__ */new Set([...r.omittedPaths,...a.omittedPaths])],warnings:[...a.warnings,`The declared omitted path is still present: ${t.join(", ")}.`]}:"preserved"===r.status&&r.omittedPaths.length>0||"excluded"===r.status&&0===r.omittedPaths.length?{status:"invalid",omittedPaths:[.../* @__PURE__ */new Set([...r.omittedPaths,...a.omittedPaths])],warnings:[...a.warnings,"The declared artifact transfer status contradicts its omitted paths."]}:r.status===a.status||"preserved"===a.status&&("excluded"===r.status||"invalid"===r.status)&&r.omittedPaths.length>0?Id(r):{status:"invalid",omittedPaths:[.../* @__PURE__ */new Set([...r.omittedPaths,...a.omittedPaths])],warnings:[.../* @__PURE__ */new Set([...r.warnings,...a.warnings,`Declared artifact transfer status ${r.status} does not match the restored contract status ${a.status}.`])]}})();if(r&&Jn(r)){const t=Qn(r,e),a="invalid"!==r.status,o=[...a&&void 0===r.serializedConfigFingerprint?["artifactTransfer.serializedConfigFingerprint"]:[],...a&&!Object.prototype.hasOwnProperty.call(r,"serializedDataFingerprint")?["artifactTransfer.serializedDataFingerprint"]:[],...a&&void 0===r.transferFingerprint?["artifactTransfer.transferFingerprint"]:[]];(t.length>0||o.length>0)&&(i={status:"invalid",omittedPaths:[.../* @__PURE__ */new Set([...i.omittedPaths,...t,...o])],warnings:[.../* @__PURE__ */new Set([...i.warnings,t.length>0?"The serialized chart payload no longer matches its transfer fingerprints.":"The declared chart transfer cannot be verified without serialized transfer fingerprints."])]})}if("preserved"===t.transfer.status&&t.contract?.contractVersion===Cd){const r=Wn(t.contract,e.props,e.recipeId??e.component).mismatchPaths.filter(e=>!Kn(e,i.omittedPaths));r.length>0&&(i={status:"invalid",omittedPaths:[.../* @__PURE__ */new Set([...i.omittedPaths,...r])],warnings:[.../* @__PURE__ */new Set([...i.warnings,"Restored chart props or data do not match the artifact contract fingerprints."])]})}return{...t.contract?{artifactContract:t.contract}:{},artifactTransfer:i}}function as(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0})}function is(e,t){return!!Qo(e,t)&&("areas"!==e||"string"!=typeof t)}function os(e,t,r){if(r?.selections&&Gr(r.selections).length>0)throw new TypeError("Serialized selection state must contain only values that survive JSON serialization unchanged.");const a=Hr(e)??Yr(t.recipe)??Yr(t.recipeId);if(a)return ss(a,t,r);if(!De(e))throw new Error(`Unknown component "${e}". Known components: ${Al.join(", ")}`);const i=!1!==r?.includeData,o={};for(const[e,r]of Object.entries(t))if(null!=r&&!Od.has(e)&&(i||!is(e,r))&&"function"!=typeof r&&!(Gr(r).length>0))try{as(o,e,jd(r))}catch{}const n=/* @__PURE__ */(new Date).toISOString(),s={version:Md,createdAt:n,...r?.selections?{selections:r.selections}:{}};return{component:e,props:o,version:Md,createdAt:n,...ts(e,r?.artifactContract,t,o,s),...r?.selections?{selections:r.selections}:{}}}function ns(e,t,r){const a={};for(const[i,o]of Object.entries(e))if(null!=o&&!Od.has(i)&&"recipeId"!==i&&(t||!is(i,o)))if("function"!=typeof o)if(Gr(o).length>0){if(r)throw new Error(`Portable recipe prop "${i}" is not JSON-safe.`)}else as(a,i,jd(o));else if(r)throw new Error(`Portable recipe prop "${i}" is not JSON-safe.`);return a}function ss(e,t,r){const a=!1!==r?.includeData,i=Gr(e);if("portable"===e.portability&&i.length>0)throw new Error(`Portable recipe "${e.id}" has non-JSON definition values at: ${i.join(", ")}.`);const o=ns(t,a,"portable"===e.portability),n=e.intents.map(ui).filter(e=>!!e),s=e.layout&&"object"==typeof e.layout&&"string"==typeof e.layout.id?e.layout.id:void 0,c=s?qr(s):void 0,l=e.layout&&"object"==typeof e.layout&&"string"==typeof e.layout.version&&e.layout.version?{version:e.layout.version,...e.layout.fingerprint?{fingerprint:e.layout.fingerprint}:{}}:void 0;if(c&&l&&(c.version!==l.version||c.fingerprint!==l.fingerprint))throw new Error(`Recipe layout "${s}" registry identity does not match its portable declaration.`);const u=c??l;if("portable"===e.portability&&s&&!u)throw new Error(`Portable recipe layout "${s}" must be registered with an explicit version identity.`);const d={name:e.name,intents:n,...e.audience?.primary?{audience:[e.audience.primary]}:{},frameFamily:e.frameFamily,...e.version?{recipeVersion:e.version}:{},...0===i.length?{definitionFingerprint:ln(e).fingerprint}:{},...s?{layoutId:s}:{},...u?{layoutVersion:u.version}:{},...u?.fingerprint?{layoutFingerprint:u.fingerprint}:{}},h=/* @__PURE__ */(new Date).toISOString();if("portable"===e.portability){if(Gr(o).length>0)throw new Error(`Portable recipe "${e.id}" contains non-JSON-safe props or layoutConfig.`);const a={version:Md,createdAt:h,recipeId:e.id,portable:!0,manifest:d,...r?.selections?{selections:r.selections}:{}};return{component:"ChartRecipe",recipeId:e.id,portable:!0,props:o,manifest:d,version:Md,createdAt:h,...ts("ChartRecipe",r?.artifactContract,t,o,a),...r?.selections?{selections:r.selections}:{}}}const p="Recipe contains or may depend on non-serializable local layout callbacks.",f=["This config is inspectable but cannot be rendered remotely by CLI or MCP."],m={version:Md,createdAt:h,recipeId:e.id,portable:!1,manifest:d,reason:p,warnings:f,...r?.selections?{selections:r.selections}:{}};return{component:"ChartRecipe",recipeId:e.id,portable:!1,reason:p,warnings:f,props:o,manifest:d,version:Md,createdAt:h,...ts("ChartRecipe",r?.artifactContract,t,o,m),...r?.selections?{selections:r.selections}:{}}}function cs(e){try{if(!e||"object"!=typeof e||Array.isArray(e))return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}catch{return!1}}function ls(e){if(!cs(e))throw new Error("Invalid chart config: expected a plain object");const t=Gr(e);if(t.length>0)throw new TypeError(`Chart config contains values that cannot survive JSON serialization at: ${t.join(", ")}.`);if(e.version!==Md)throw new Error(`Unsupported chart config version ${String(e.version)}; expected ${Md}.`);if("string"!=typeof e.component||!e.component.trim())throw new Error("Invalid chart config: missing component");if(!cs(e.props))throw new Error("Invalid chart config: props must be a plain object");if("string"!=typeof e.createdAt||!Number.isFinite(Date.parse(e.createdAt)))throw new Error("Invalid chart config: createdAt must be a valid timestamp");if(void 0!==e.recipeId&&("string"!=typeof e.recipeId||!e.recipeId.trim()))throw new Error("Invalid chart config: recipeId must be a non-empty string");if(void 0!==e.portable&&"boolean"!=typeof e.portable)throw new Error("Invalid chart config: portable must be a boolean");if(void 0!==e.selections&&!cs(e.selections))throw new Error("Invalid chart config: selections must be a plain object");if(void 0!==e.manifest){if(!cs(e.manifest))throw new Error("Invalid chart config: manifest must be a plain object");if("string"!=typeof e.manifest.name||!e.manifest.name.trim()||"string"!=typeof e.manifest.frameFamily||!e.manifest.frameFamily.trim()||!Array.isArray(e.manifest.intents)||e.manifest.intents.some(e=>"string"!=typeof e||!e.trim())||void 0!==e.manifest.audience&&(!Array.isArray(e.manifest.audience)||e.manifest.audience.some(e=>"string"!=typeof e||!e.trim()))||void 0!==e.manifest.recipeVersion&&("string"!=typeof e.manifest.recipeVersion||!e.manifest.recipeVersion.trim())||void 0!==e.manifest.definitionFingerprint&&("string"!=typeof e.manifest.definitionFingerprint||!e.manifest.definitionFingerprint.trim())||void 0!==e.manifest.layoutId&&("string"!=typeof e.manifest.layoutId||!e.manifest.layoutId.trim())||void 0!==e.manifest.layoutVersion&&("string"!=typeof e.manifest.layoutVersion||!e.manifest.layoutVersion.trim())||void 0!==e.manifest.layoutFingerprint&&("string"!=typeof e.manifest.layoutFingerprint||!e.manifest.layoutFingerprint.trim())||void 0!==e.manifest.layoutVersion&&void 0===e.manifest.layoutId||void 0!==e.manifest.layoutFingerprint&&void 0===e.manifest.layoutVersion)throw new Error("Invalid chart config: malformed recipe manifest")}}function us(e){if(ls(e),"ChartRecipe"===e.component||"LocalChartRecipe"===e.component){if(!e.recipeId)throw new Error("Invalid chart recipe config: missing recipeId");const t=Hr(e.recipeId);if(!t)throw new Error(`Unknown chart recipe "${e.recipeId}". Register it before deserializing this config.`);if(e.manifest?.definitionFingerprint&&e.manifest.definitionFingerprint!==ln(t).fingerprint)throw new Error(`Chart recipe "${e.recipeId}" no longer matches the serialized definition.`);if(void 0!==e.manifest?.recipeVersion&&e.manifest.recipeVersion!==t.version)throw new Error(`Chart recipe "${e.recipeId}" version does not match the serialized config.`);if(e.manifest?.layoutVersion){const r=e.manifest.layoutId,a=r?Wr(r):void 0,i=r?qr(r):void 0,o=t.layout&&"object"==typeof t.layout&&t.layout.id===r&&t.layout.version?{version:t.layout.version,fingerprint:t.layout.fingerprint}:void 0,n=a?i:i??o;if(!n||n.version!==e.manifest.layoutVersion||n.fingerprint!==e.manifest.layoutFingerprint)throw new Error(`Chart recipe "${e.recipeId}" layout implementation no longer matches the serialized config.`)}if("LocalChartRecipe"!==e.component&&!1!==e.portable&&"portable"!==t.portability)throw new Error(`Chart recipe "${e.recipeId}" is registered as local, not portable.`);return{componentName:"ChartRecipe",props:{...jd(e.props),recipeId:e.recipeId},...rs(e)}}if(!De(e.component))throw new Error(`Unknown component "${e.component}". This config may require a newer version of semiotic.`);return{componentName:e.component,props:jd(e.props),...rs(e)}}function ds(e,t={}){ls(e);const r=JSON.stringify(e),a=`sc=${btoa(unescape(encodeURIComponent(r))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}`;if(void 0!==t.maxLength&&a.length>Math.max(0,Math.floor(t.maxLength)))throw new RangeError(`Serialized chart config is ${a.length} characters; the declared URL limit is ${t.maxLength}. Use a file or sidecar export instead.`);return a}function hs(e){const t=new URLSearchParams(e.includes("?")?e.split("?")[1]:e).get("sc");if(!t)throw new Error("No chart config found in URL (missing 'sc' parameter)");const r=t.replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(escape(atob(r))),i=JSON.parse(a);return ls(i),i}async function ps(e,t="json"){const r="jsx"===t?fs(e):JSON.stringify(e,null,2);if("undefined"==typeof navigator||!navigator.clipboard)throw new Error("Clipboard API not available. copyConfig requires a browser environment.");await navigator.clipboard.writeText(r)}function fs(e){ls(e);const{props:t}=e,r="LocalChartRecipe"===e.component?"ChartRecipe":e.component;if("ChartRecipe"!==r&&!De(r))throw new Error(`Cannot project unknown component "${r}" to JSX.`);const a=[`<${r}`];e.recipeId&&a.push(` recipeId={${gs(e.recipeId)}}`);for(const[e,r]of Object.entries(t)){if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(e)){const t={};Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),a.push(` {...${gs(t)}}`);continue}if("string"==typeof r)a.push(ms(r)?` ${e}="${r}"`:` ${e}={${gs(r)}}`);else if("boolean"==typeof r&&!0===r)a.push(` ${e}`);else if("boolean"==typeof r&&!1===r)a.push(` ${e}={false}`);else if("number"==typeof r)a.push(` ${e}={${r}}`);else{const t=gs(r);t.length<80?a.push(` ${e}={${t}}`):a.push(` ${e}={${gs(r,2)}}`)}}return a.push("/>"),a.join("\n")}function ms(e){return!/["&<>{}\r\n\u2028\u2029]/.test(e)}function gs(e,t){return JSON.stringify(e,null,t).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function ys(e){const t=[...e.artifactContract?["artifactContract"]:[],...e.artifactTransfer?["artifactTransfer"]:[],...e.selections?["selections"]:[]];return{jsx:fs(e),omittedPaths:t,warnings:t.length?["JSX represents the chart props only. Preserve the reported top-level fields as a separate artifact packet."]:[]}}function bs(e){const t=/* @__PURE__ */Object.create(null);for(const[r,a]of e){const e=[];for(const[,t]of a.clauses){const r=/* @__PURE__ */Object.create(null);for(const[e,a]of Object.entries(t.fields))"point"===a.type?r[e]={type:"point",values:Array.from(a.values)}:r[e]={type:"interval",range:a.range};e.push({clientId:t.clientId,type:t.type,fields:r})}t[r]={name:a.name,resolution:a.resolution,clauses:e}}return t}function vs(e){const t=/* @__PURE__ */new Map;for(const[r,a]of Object.entries(e)){const e=/* @__PURE__ */new Map;for(const t of a.clauses){const r=/* @__PURE__ */Object.create(null);for(const[e,a]of Object.entries(t.fields))"point"===a.type?r[e]={type:"point",values:new Set(a.values)}:r[e]={type:"interval",range:a.range};e.set(t.clientId,{clientId:t.clientId,type:t.type,fields:r})}t.set(r,{name:a.name,resolution:a.resolution,clauses:e})}return t}async function ws(e,t){const{exportChartBrowser:r}=await Promise.resolve().then(()=>(Gc(),Lc));return r(e,t)}function As(e,t,r){const a=/* @__PURE__ */new Map,i=/* @__PURE__ */new Map,o=/* @__PURE__ */new Map,n=e=>{if(e instanceof Date)return`date:${e.getTime()}`;if("object"==typeof e&&null!==e||"symbol"==typeof e||"function"==typeof e){let t=o.get(e);return void 0===t&&(t=o.size,o.set(e,t)),`identity:${t}`}return`${typeof e}:${String(e)}`},s=e=>{if(r.length&&!r.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))return JSON.stringify(r.map(t=>n(e[t])))};e.forEach((e,t)=>{const r=a.get(e);r?r.push(t):a.set(e,[t]);const o=s(e);if(void 0===o)return;const n=i.get(o);n?n.indices.push(t):i.set(o,{indices:[t],cursor:0})});const c=/* @__PURE__ */new Set,l=/* @__PURE__ */new Set,u=e=>{const t=a.get(e);if(t)return l.has(e)||(t.forEach(e=>c.add(e)),l.add(e)),!0;const r=s(e),o=void 0===r?void 0:i.get(r);if(!o)return!1;for(;o.cursor<o.indices.length&&c.has(o.indices[o.cursor]);)o.cursor++;return o.cursor<o.indices.length&&c.add(o.indices[o.cursor++]),!0};let d=0;for(const e of t){const t=Array.isArray(e)?e:[e];let r=!1;for(const e of t)e&&"object"==typeof e&&u(e)&&(r=!0);r||d++}return{represented:c.size,unmatchedMarks:d}}function xs(e){const t={};if(null==e||"object"!=typeof e)return t;for(const[r,a]of Object.entries(e))r.startsWith("_")||null!=a&&""!==a&&("number"==typeof a?Number.isFinite(a)&&(t[r]=a):"string"==typeof a?t[r]=a:"boolean"==typeof a?t[r]=String(a):a instanceof Date&&(t[r]=a.toISOString().slice(0,10)));return t}function $s(e){return e&&"object"==typeof e?e:{}}function Cs(e){return $s(e.accessibility).tableFields??e.accessibleDatum??e.datum}function Ss(e){const t=/* @__PURE__ */new Set;if(!e.some(e=>e&&("point"===e.type||"symbol"===e.type||"glyph"===e.type)))return t;for(const r of e)if(r&&["line","area","boxplot","violin"].includes(String(r.type))&&Array.isArray(r.datum))for(const e of r.datum)t.add(e);return t}function ks(e){const t=[];if(!Array.isArray(e))return t;const r=Ss(e);for(const a of e)if(a&&"object"==typeof a&&null!==a.datum)try{switch(a.type){case"point":case"symbol":case"glyph":if(r.has(a.datum))break;t.push({label:"Point",values:xs(Cs(a))});break;case"line":case"area":{const e=Cs(a),r=Array.isArray(e)?e:null!=e&&"object"==typeof e?[e]:[],i="line"===a.type?"Line point":"Area point";for(const e of r)t.push({label:i,values:xs(e)});break}case"boxplot":case"violin":{const e=Cs(a),r="boxplot"===a.type?"Boxplot":"Distribution",i="string"==typeof a.category?{category:a.category}:{};if(Array.isArray(e)){t.push({label:r,values:{...i,...xs(a.stats)}});for(const a of e)t.push({label:`${r} observation`,values:{...i,...xs(a)}})}else t.push({label:r,values:{...i,...xs(e)}});break}case"rect":{const e=Cs(a),r=null!=e&&"object"==typeof e?e:{},i=r.category??a.group??"",o=r.value??r.__aggregateValue??r.total,n=xs(r);null==n.category&&""!==i&&(n.category=String(i)),null==n.value&&null!=o&&(n.value="number"==typeof o||"string"==typeof o?o:String(o)),t.push({label:"Bar",values:n});break}case"heatcell":{const e=xs(Cs(a));null==e.value&&"number"==typeof a.value&&Number.isFinite(a.value)&&(e.value=a.value),t.push({label:"Cell",values:e});break}case"wedge":{const e=Cs(a),r=xs(e);if(null==r.category){const t=$s(e),a=t.category??t.label;null!=a&&(r.category=String(a))}t.push({label:"Wedge",values:r});break}case"circle":t.push({label:"Node",values:xs(Cs(a))});break;case"arc":t.push({label:"Arc",values:xs(Cs(a))});break;case"candlestick":t.push({label:"Candlestick",values:xs(Cs(a))});break;case"connector":case"trapezoid":case"bezier":case"ribbon":case"curved":t.push({label:"Connection",values:xs(Cs(a))});break;case"geoarea":{const e=$s(Cs(a)),r={...xs(e.properties),...xs(e)};t.push({label:"Region",values:r});break}}}catch{}return t}function Rs(e){if(Array.isArray(e))return e;if(!e||"object"!=typeof e)return[];const t=e;return[...t.nodes??t.sceneNodes??[],...t.sceneEdges??[]]}function Ps(e){const t=e.pointId??e.id??e._transitionKey;return null==t||""===t?void 0:String(t)}function Es(e){return e.accessibility?.tableFields??e.accessibleDatum??e.datum??null}function Ns(e){return"number"==typeof e&&Number.isFinite(e)}function Ts(e){if(Ns(e.x)&&Ns(e.y)&&Ns(e.w)&&Ns(e.h))return{x0:e.x,y0:e.y,x1:e.x+e.w,y1:e.y+e.h};if(Ns(e.x)&&Ns(e.y)&&Ns(e.r))return{x0:e.x-e.r,y0:e.y-e.r,x1:e.x+e.r,y1:e.y+e.r};if(Ns(e.cx)&&Ns(e.cy)&&Ns(e.r))return{x0:e.cx-e.r,y0:e.cy-e.r,x1:e.cx+e.r,y1:e.cy+e.r};if(Ns(e.cx)&&Ns(e.cy)&&Ns(e.outerR))return{x0:e.cx-e.outerR,y0:e.cy-e.outerR,x1:e.cx+e.outerR,y1:e.cy+e.outerR};if(Ns(e.x1)&&Ns(e.x2)&&Ns(e.y1)&&Ns(e.y2))return{x0:Math.min(e.x1,e.x2),x1:Math.max(e.x1,e.x2),y0:Math.min(e.y1,e.y2),y1:Math.max(e.y1,e.y2)};const t=[e.path,e.topPath,e.bottomPath].filter(Array.isArray).flat().filter(e=>Array.isArray(e)&&Ns(e[0])&&Ns(e[1]));if(t.length>0){const[e,r]=P(t,e=>e[0]),[a,i]=P(t,e=>e[1]);return{x0:e,y0:a,x1:r,y1:i}}return null}function Is(e){return[...[e.x,e.y,e.w,e.h,e.r,e.cx,e.cy,e.innerR,e.outerR,e.x1,e.x2,e.y1,e.y2,e.openY,e.closeY,e.highY,e.lowY,e.bodyWidth].filter(e=>void 0!==e),...[e.path,e.topPath,e.bottomPath].filter(Array.isArray).flat(2)]}function Ms(e,t){const r=Math.max(0,Math.min(e.x1,t.x1)-Math.max(e.x0,t.x0))*Math.max(0,Math.min(e.y1,t.y1)-Math.max(e.y0,t.y0)),a=Math.max(0,e.x1-e.x0)*Math.max(0,e.y1-e.y0),i=Math.max(0,t.x1-t.x0)*Math.max(0,t.y1-t.y0),o=Math.min(a,i);return o>0?r/o:0}function Os(e){const t=e.style?.fill??e.fill;return"none"===t||"transparent"===t||null==t&&["line","rule","edge","bezier"].includes(e.type)}function js(e,t,r,a,i,o="warn",n){return{id:e,category:t,status:r?"pass":o,message:r?a:i,...n?{evidence:n}:{}}}function Fs(e){const{recipe:t}=e,r=Rs(e.scene),a=e.layoutConfig??di({layoutConfig:e.layoutConfig}),i=e.dimensions.plot??{x:0,y:0,width:e.dimensions.width,height:e.dimensions.height},n=i.x??0,s=i.y??0,c=[],l=r.filter(e=>null!=Es(e)),u=r.filter(e=>!("string"!=typeof e.pathD||!/NaN|Infinity|undefined/.test(e.pathD))||Is(e).some(e=>"number"!=typeof e||!Number.isFinite(e)));c.push(js("geometry.finite","geometry",0===u.length,"All emitted geometry is finite.",`${u.length} marks contain non-finite geometry.`,"fail",{count:u.length}));const d=r.map(Ts),h=d.filter((e,t)=>e&&(Os(r[t])?e.x1<=e.x0&&e.y1<=e.y0:e.x1<=e.x0||e.y1<=e.y0)).length;c.push(js("geometry.nonzero-area","geometry",0===h,"All bounded marks have positive area.",`${h} marks have zero or negative area.`,"warn",{count:h}));const p=d.filter(e=>e&&(e.x0<n||e.y0<s||e.x1>n+i.width||e.y1>s+i.height)).length;c.push(js("geometry.bounds","geometry",0===p,"All bounded marks stay inside the plot.",`${p} marks extend outside the plot bounds.`,"warn",{count:p}));const f=t.audit?.minimumHitTargetSize??t.accessibility.minimumHitTarget??24,m=d.filter((e,t)=>!(!e||Os(r[t])||null==Es(r[t])||!1===r[t].interactive)&&(e.x1-e.x0<f||e.y1-e.y0<f)).length;c.push(js("interaction.target-size","interaction",0===m,`All bounded targets meet the declared ${f}px minimum.`,`${m} targets are smaller than ${f}px in at least one dimension.`,"warn",{count:m,minimumTarget:f}));const g=l.map(Ps),y=g.filter(e=>!e).length,b=/* @__PURE__ */new Set,v=g.filter(e=>!(!e||!b.has(e)&&(b.add(e),1)));c.push(js("identity.stable-ids","identity",0===y,"Every data-bearing mark exposes a stable id.",`${y} data-bearing marks have no pointId, id, or transition key.`,t.audit?.requireStableIds?"fail":"warn",{missing:y})),c.push(js("identity.unique-ids","identity",0===v.length,"Stable mark ids are unique.",`${v.length} duplicate stable ids were observed.`,"fail",{duplicates:[...new Set(v)].slice(0,10)}));const w=g.filter(e=>e&&/^(datum|mark|node|point|rect)-?\d+$/.test(e)).length;w>0&&c.push({id:"identity.index-pattern",category:"identity",status:"warn",message:`${w} ids look index-derived and may change when data is reordered.`,remediation:"Derive ids from a declared identifier role or stable domain key."});const A=Ya(e.inputData),x=[...new Set(t.dataRoles.map(e=>fi(e,a,A)).filter(e=>!!e))],{represented:$,unmatchedMarks:C}=As(A,l.map(Es),x),S=Math.max(0,A.length-$);c.push(js("coverage.input-data","coverage",0===S,"Every input datum is represented by the observed scene.",`${S} input data items have no matching scene mark.`,t.audit?.requireDatumCoverage?"fail":"warn",{represented:$,input:A.length})),c.push(js("coverage.scene-data","coverage",0===C,"Every data-bearing scene mark maps back to input data.",`${C} scene marks do not map back to an input datum.`,"warn",{count:C}));const k=t.encodings?.some(e=>"count"===e.channel);!k&&l.length>$&&$>0&&c.push({id:"coverage.duplicate-references",category:"coverage",status:"warn",message:"Input data is referenced by multiple marks, but multiplicity is not declared as an encoding.",remediation:"Declare count/repetition semantics or preserve a one-to-one datum-to-mark mapping."});const R=l.filter(e=>!1===e.interactive).length;c.push(js("interaction.hit-targets","interaction",0===R&&l.length>0,"Every observed data-bearing scene node participates in hit testing.",0===l.length?"No data-bearing scene nodes were emitted for interaction.":`${R} data-bearing marks explicitly disable interaction.`,"fail"));const P=(e.annotations??[]).map(e=>e.pointId).filter(e=>null!=e).map(String),E=P.filter(e=>!b.has(e));c.push(js("coverage.annotation-anchors","coverage",0===E.length,P.length?"All pointId annotation anchors resolve to observed scene nodes.":"No pointId annotations require scene resolution.",`${E.length} annotations point to missing scene ids.`,"fail",{unresolved:E}));const N=(e.chart?.selectedIds??[]).filter(e=>!b.has(e));e.chart?.selectedIds&&c.push(js("interaction.selection-reachability","interaction",0===N.length,"Selected/highlighted states resolve to observed marks.",`${N.length} selected ids are not reachable in the scene.`,"fail",{missing:N}));const T=ks(r),I=(t.accessibility.tableFields??t.accessibility.tableRoles?.map(e=>({role:e,label:e}))??[]).map(e=>{if(e.field)return e.field;const r=e.role?t.dataRoles.find(t=>t.role===e.role):void 0;return r?fi(r,a,A):void 0}).filter(e=>!!e),M=new Set(T.flatMap(e=>Object.keys(e.values))),O=I.filter(e=>!M.has(e));c.push(js("accessibility.table-fields","accessibility",0===O.length,I.length?"The accessible table preserves all recipe-declared fields.":"The recipe declares no explicit accessible table field projection.",`The accessible table loses declared fields: ${O.join(", ")}.`,"fail",{expectedFields:I,observedFields:[...M]})),new Set(A.flatMap(e=>Object.entries(e).filter(([,e])=>["string","number","boolean"].includes(typeof e)).map(([e])=>e))).size>2&&M.size<=2&&[...M].every(e=>"category"===e||"value"===e)&&c.push({id:"accessibility.generic-table-loss",category:"accessibility",status:"warn",message:"The table exposes only generic category/value fields although richer input data exists.",remediation:"Emit accessibleDatum or accessibility.tableFields on scene nodes."});const j=(t.encodings?.filter(e=>"color"===e.channel)??[]).filter(e=>!e.redundantWith||0===e.redundantWith.length);c.push(js("accessibility.color-only","accessibility",0===j.length,"Every declared color encoding names a redundant cue.",`${j.length} color encodings have no declared redundant cue.`,"warn"));const F=e.chart;if(F){for(const[e,r]of[["title",t.accessibility.requiresTitle],["summary",t.accessibility.requiresSummary],["description","required"===t.accessibility.description]])r&&c.push(js(`accessibility.${e}`,"accessibility","string"==typeof F[e]&&F[e].trim().length>0,`A chart ${e} is present.`,`The recipe requires a chart ${e}, but none was supplied.`,"fail"));(t.accessibility.requiresAccessibleTable||"required"===t.accessibility.accessibleTable||t.accessibility.fallbackTable)&&c.push(js("accessibility.fallback-table","accessibility",!1!==F.accessibleTable,"The accessible fallback table is enabled.","The recipe requires a fallback table, but accessibleTable is disabled.","fail")),F.navigationTree&&c.push(js("accessibility.navigation-depth","accessibility",(F.navigationTree.children?.length??0)>0,"The navigation tree exposes structure below the root.","The navigation tree is root-only.","fail"))}const z=e.theme?.background??"#ffffff",L=r.filter(e=>[e.style?.stroke??e.stroke,...Os(e)?[]:[e.style?.fill??e.fill]].some(e=>{if("string"!=typeof e||"none"===e||"transparent"===e)return!1;const t=o(e,z);return null!=t&&t<3})).length;c.push(js("visual.contrast","visual",0===L,"All statically checkable mark fills and strokes meet 3:1 contrast.",`${L} marks have fill or stroke contrast below 3:1.`,"warn",{background:z}));let B=0;const D=d.filter(e=>!!e).slice(0,500);for(let e=0;e<D.length;e+=1)for(let t=e+1;t<D.length;t+=1)Ms(D[e],D[t])>=.8&&(B+=1);B>D.length&&c.push({id:"visual.overlap-density",category:"visual",status:"warn",message:`${B} near-total mark overlaps suggest occlusion or excessive density.`,remediation:"Aggregate, jitter, layer explicitly, or declare overlap as intentional."});const _=[["manual-at.screen-reader","Verify real screen-reader behavior with the target browser/AT combinations."],["manual-at.cognitive-load","Assess cognitive load and whether the custom metaphor is understood."],["manual-at.keyboard-order","Verify that keyboard order is meaningful, not merely mechanically available."],["manual-at.animation","Verify that animation is not distracting and reduced-motion behavior is sufficient."],["manual-at.reception","Test whether the memorable form is received as intended by the target audience."],["manual-at.overlay-occlusion","Inspect labels, overlays, annotations, and important marks for clipping or occlusion."],["manual-at.observation","Exercise hover, focus, selection, and observation emission in the rendered chart."]].map(([e,t])=>({id:e,category:"manual-at",status:"manual",message:t})),U={dataRoles:t.dataRoles.map(e=>e.role),intents:t.intents.map(ui).filter(e=>!!e),accessibilityExpectations:[...t.accessibility.requirements??[],...t.accessibility.tableFields?.map(e=>`table field: ${e.label}`)??[]],fallbackDeclared:!0===t.accessibility.fallbackTable||"required"===t.accessibility.accessibleTable||!0===t.accessibility.requiresAccessibleTable,designContractDeclared:!!t.designContract?.whyCustom},G=[...c,..._],V=c.filter(e=>"fail"===e.status).length;return{recipeId:t.id,ok:0===V,summary:{marks:r.length,passes:G.filter(e=>"pass"===e.status).length,warnings:G.filter(e=>"warn"===e.status).length,failures:V,manual:G.filter(e=>"manual"===e.status).length},declaredSemantics:U,observedSceneEvidence:c,manualATChecks:_}}function zs(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function Ls(e){if(!Array.isArray(e))return!1;for(const t of e)if(!zs(t))return!1;return!0}function Bs(e){const t=[],r=(e,r)=>t.push({code:"INVALID_SPEC",severity:"error",path:e,message:r});if(!zs(e))return r("/","A Vega-Lite spec must be an object."),t;if(void 0!==e.encoding)if(zs(e.encoding))for(const[t,a]of Object.entries(e.encoding))if(zs(a))for(const e of["scale","axis"])void 0===a[e]||zs(a[e])||r(`/encoding/${Fd(t)}/${e}`,`${e} must be an object in the supported subset.`);else r(`/encoding/${Fd(t)}`,"An encoding must be an object.");else r("/encoding","encoding must be an object.");if(void 0!==e.data&&(zs(e.data)?void 0===e.data.values||Ls(e.data.values)||(r("/data/values","data.values must be an array of row objects."),zs(e.encoding)&&Object.values(e.encoding).some(e=>zs(e)&&void 0!==e.aggregate)&&(t[t.length-1].code="INVALID_AGGREGATE_DATA")):r("/data","data must be an object.")),void 0===e.layer||Ls(e.layer)||r("/layer","layer must be an array of spec objects."),Array.isArray(e.layer))for(let r=0;r<e.layer.length;r++){const a=e.layer[r];if(zs(a))for(const e of Bs(a))t.push({...e,path:`/layer/${r}${"/"===e.path?"":e.path}`})}return t}function Ds(e){switch(e){case"sum":case"mean":case"count":case"min":case"max":return e;case"average":return"mean";default:return}}function _s(e){let t="value",r=0;for(;e.has(t);)t="value_"+ ++r;return t}function Us(e,t,r){if(!Array.isArray(e))throw new TypeError("aggregate data must be an array of rows");if(t.some(e=>"string"!=typeof e||0===e.length))throw new TypeError("groupBy must contain nonempty field names");const a=[...new Set(t)],i=new Set(a);for(const e of r){if(Ds(e.operation)!==e.operation||!e.operation)throw new TypeError("Unsupported aggregate operation");if("string"!=typeof e.outputField||!e.outputField||i.has(e.outputField))throw new TypeError("outputField must be a nonempty field distinct from groupBy and other aggregate outputs");if("count"!==e.operation&&("string"!=typeof e.field||!e.field))throw new TypeError("A value field is required for this aggregate");i.add(e.outputField)}const o={},n=[];for(let t=0;t<e.length;t++){const i=e[t];if(!i||"object"!=typeof i||Array.isArray(i))throw new TypeError(`aggregate data row ${t} must be an object`);let s=o;for(const e of a){const t=i[e],r=t instanceof Date?s.dates??(s.dates=/* @__PURE__ */new Map):s.values??(s.values=/* @__PURE__ */new Map),a=t instanceof Date?t.getTime():t;let o=r.get(a);o||(o={},r.set(a,o)),s=o}s.group||(s.group={keys:Object.fromEntries(a.map(e=>[e,i[e]])),count:0,measures:r.map(()=>({total:0,count:0}))},n.push(s.group));const c=s.group;c.count++;for(let e=0;e<r.length;e++){const t=r[e];if("count"===t.operation)continue;const a=Bt(i[t.field]);if(void 0===a||!Number.isFinite(a))continue;const o=c.measures[e];"min"===t.operation||"max"===t.operation?o.count&&!("min"===t.operation?a<o.total:a>o.total)||(o.total=a):o.total+=a,o.count++}}return n.map(e=>Object.fromEntries([...Object.entries(e.keys),...r.map((t,r)=>{const a=e.measures[r],i="count"===t.operation?e.count:a.count?"mean"===t.operation?a.total/a.count:a.total:null;return[t.outputField,i]})]))}function Gs(e){const t=e.encoding??{},r=[];if(Object.values(t).some(e=>void 0!==e.aggregate)&&void 0!==e.data?.values){const t=e.data.values;Array.isArray(t)&&!t.some(e=>!e||"object"!=typeof e||Array.isArray(e))||r.push({code:"INVALID_AGGREGATE_DATA",severity:"error",path:"/data/values",message:"Aggregation requires data.values to be an array of row objects."})}for(const[a,i]of Object.entries(t)){if(void 0===i.aggregate)continue;const o=Ds(i.aggregate);let n,s="UNSUPPORTED_AGGREGATE";o?(t.x?.bin||t.y?.bin)&&"count"!==o?n=`Binned aggregate "${i.aggregate}" on ${a} is not supported; Histogram counts source rows.`:"count"===o||i.field?e.data?.values||(s="INVALID_AGGREGATE",n=`aggregate: "${i.aggregate}" on ${a} requires inline data.values; accessors remain unchanged.`):(s="INVALID_AGGREGATE",n=`aggregate: "${i.aggregate}" on ${a} requires an encoded value field.`):n=`Unsupported aggregate "${i.aggregate}" on ${a}; data was not aggregated.`,n&&r.push({code:s,severity:"error",path:`/encoding/${a}/aggregate`,message:n})}return r}function Vs(e,t){const r=e.encoding??{},a=e.data?.values,i=Gs(e);if(t.push(...i.map(({message:e})=>e)),!a||i.length||r.x?.bin||r.y?.bin)return{data:a,encoding:r};const o=new Set(Object.values(r).filter(e=>void 0===e.aggregate&&e.field).map(e=>e.field)),n=new Set(o),s=[],c={...r};for(const[e,t]of Object.entries(r)){const r=Ds(t.aggregate);if(!r)continue;const a=_s(n);n.add(a),s.push({field:t.field,operation:r,outputField:a}),c[e]={...t,field:a,aggregate:void 0}}return s.length?{data:Us(a,[...o],s),encoding:c}:{data:a,encoding:r}}function Hs(e){if(!e||"string"!=typeof e&&!zs(e))return{type:"",markProps:{}};if("string"==typeof e)return{type:e,markProps:{}};const{type:t,...r}=e;return{type:t,markProps:r}}function Ws(e){if(e)return"string"==typeof e?e:e.text}function qs(e){return"nominal"===e||"ordinal"===e}function Ys(e){return"quantitative"===e||"temporal"===e}function Ks(e){return e?.usermeta?.idid}function Js(e){return"annotation-layer"===e?.usermeta?.idid?.role}function Xs(e){if(!Ks(e)||!Array.isArray(e.layer))return e;const t=e.layer.filter(e=>!Js(e));if(1!==t.length)return e;const{layer:r,...a}=e,{usermeta:i,...o}=t[0];return{...a,...o}}function Zs(e){return Qs(e)}function Qs(e,t=!1,r){const a=Bs(e);if(a.length)return rc("Scatterplot",{},a.map(e=>e.message),t,r);e=Xs(e);const i=[],{type:o,markProps:n}=Hs(e.mark),{data:s,encoding:c}=Vs(e,i),l=c.x,u=c.y,d=c.color,h=c.size,p=c.theta,f=c.opacity;!s&&e.data?.url&&i.push("Load data.url into inline data.values before import."),e.transform&&e.transform.length>0&&i.push("Materialize Vega-Lite transforms before import."),e.layer&&i.push('Layered specs ("layer") are unsupported; provide one mark.'),(e.hconcat||e.vconcat||e.concat)&&i.push('Concatenated views ("hconcat"/"vconcat"/"concat") are unsupported; import each view separately.'),(e.facet||c.facet||c.row||c.column)&&i.push("Faceted views are unsupported; use LinkedCharts or separate charts."),e.repeat&&i.push('Repeated views ("repeat") are unsupported; import each field combination separately.'),(e.params||e.selection)&&i.push("Selections/params are unsupported; use LinkedCharts and selection props.");const m={};e.width&&(m.width=e.width),e.height&&(m.height=e.height);const g=Ws(e.title);if(g&&(m.title=g),d?.field){if(m.colorBy=d.field,d.scale?.scheme){const e=Object.prototype.hasOwnProperty.call(zd,d.scale.scheme)?zd[d.scale.scheme]:void 0;e&&(m.colorScheme=e)}Array.isArray(d.scale?.range)&&(m.colorScheme=d.scale.range)}if(void 0!==f?.value&&(m.pointOpacity=f.value),l?.bin||u?.bin){const e="Histogram";s&&(m.data=s),l?.bin?(m.valueAccessor=l.field,l.axis?.title&&(m.valueLabel=l.axis.title)):u?.bin&&(m.valueAccessor=u.field,u.axis?.title&&(m.valueLabel=u.axis.title)),d?.field&&(m.categoryAccessor=d.field);const a=l?.bin||u?.bin,o="object"==typeof a?a.maxbins:void 0;return o&&(m.bins=o),rc(e,m,i,t,r)}let y;switch(o){case"bar":y=ec(l,u,d,m);break;case"line":y="LineChart",tc(l,u,m),d?.field&&(m.lineBy=d.field),!0===n.point&&(m.showPoints=!0);break;case"area":d?.field?(y="StackedAreaChart",m.areaBy=d.field):y="AreaChart",tc(l,u,m),"normalize"!==l?.stack&&"normalize"!==u?.stack||(m.normalize=!0),void 0!==n.opacity&&(m.areaOpacity=n.opacity);break;case"point":case"circle":case"square":h?.field?(y="BubbleChart",m.sizeBy=h.field,h.scale?.range&&(m.sizeRange=h.scale.range)):y="Scatterplot",tc(l,u,m);break;case"rect":y="Heatmap",l?.field&&(m.xAccessor=l.field),u?.field&&(m.yAccessor=u.field),d?.field&&(m.valueAccessor=d.field,delete m.colorBy),l?.axis?.title&&(m.xLabel=l.axis.title),u?.axis?.title&&(m.yLabel=u.axis.title);break;case"arc":n.innerRadius&&n.innerRadius>0?(y="DonutChart",m.innerRadius=n.innerRadius):y="PieChart",p?.field?m.valueAccessor=p.field:u?.field&&(m.valueAccessor=u.field),d?.field&&(m.categoryAccessor=d.field),l?.field&&!p?.field&&(m.categoryAccessor=l.field);break;case"tick":y="DotPlot",qs(l?.type)?(m.categoryAccessor=l.field,u?.field&&(m.valueAccessor=u.field),l?.axis?.title&&(m.categoryLabel=l.axis.title),u?.axis?.title&&(m.valueLabel=u.axis.title)):qs(u?.type)?(m.categoryAccessor=u.field,l?.field&&(m.valueAccessor=l.field),m.orientation="horizontal",u?.axis?.title&&(m.categoryLabel=u.axis.title),l?.axis?.title&&(m.valueLabel=l.axis.title)):(l?.field&&(m.categoryAccessor=l.field),u?.field&&(m.valueAccessor=u.field));break;default:i.push(`Unsupported mark type "${o}". Defaulting to Scatterplot.`),y="Scatterplot",tc(l,u,m)}return("line"===o||"area"===o)&&n.interpolate&&Object.prototype.hasOwnProperty.call(Ld,n.interpolate)&&(m.curve=Ld[n.interpolate]),s&&(m.data=s),rc(y,m,i,t,r)}function ec(e,t,r,a){let i;return r?.field&&!1!==e?.stack&&!1!==t?.stack&&null!==e?.stack&&null!==t?.stack?(i="StackedBarChart",a.stackBy=r.field,"normalize"!==e?.stack&&"normalize"!==t?.stack||(a.normalize=!0)):i="BarChart",qs(e?.type)&&Ys(t?.type)?(a.categoryAccessor=e.field,a.valueAccessor=t.field,e?.axis?.title&&(a.categoryLabel=e.axis.title),t?.axis?.title&&(a.valueLabel=t.axis.title)):Ys(e?.type)&&qs(t?.type)?(a.categoryAccessor=t.field,a.valueAccessor=e.field,a.orientation="horizontal",t?.axis?.title&&(a.categoryLabel=t.axis.title),e?.axis?.title&&(a.valueLabel=e.axis.title)):(e?.field&&(a.categoryAccessor=e.field),t?.field&&(a.valueAccessor=t.field),e?.axis?.title&&(a.categoryLabel=e.axis.title),t?.axis?.title&&(a.valueLabel=t.axis.title)),i}function tc(e,t,r){e?.field&&(r.xAccessor=e.field),t?.field&&(r.yAccessor=t.field),e?.axis?.title&&(r.xLabel=e.axis.title),t?.axis?.title&&(r.yLabel=t.axis.title),"temporal"===e?.type?r.xScaleType="time":"log"===e?.scale?.type&&(r.xScaleType="log"),"log"!==t?.scale?.type&&"symlog"!==t?.scale?.type||(r.yScaleType=t.scale.type)}function rc(e,t,r,a=!1,i){const o={component:e,props:t,version:"1",createdAt:i??/* @__PURE__ */(new Date).toISOString()};if(r.length>0){o.warnings=r;for(const e of a?[]:r)console.warn(`[semiotic/fromVegaLite] ${e}`)}return o}function ac(e){if(!Number.isFinite(e))return String(e);const t=Number.isInteger(e)?e:Number(e.toPrecision(6));return Math.abs(t)>9999?t.toLocaleString():String(t)}function ic(e){const t=!0===e?.__semioticHoverData,r=e&&("node"===e.type||"edge"===e.type||void 0!==e.nodeOrEdge||void 0!==e.allSeries||void 0!==e.stats||void 0!==e.__chartType),a=t||e&&void 0!==e.data&&"number"==typeof e.x&&"number"==typeof e.y&&r;let i=(o=a?e.data??{}:e,Array.isArray(o)?o[0]:o);var o;if(!i)return null;if(("node"===e?.nodeOrEdge&&"number"==typeof i?.x0&&"number"==typeof i?.x1||"edge"===e?.nodeOrEdge&&"number"==typeof i?.sankeyWidth)&&i.data&&"object"==typeof i.data&&(i=i.data),!i)return null;if(a&&(void 0!==e.allSeries||void 0!==e.xValue)){const t=qo({...i},Yo(i));void 0!==e.allSeries&&void 0===t.allSeries&&(t.allSeries=e.allSeries),void 0!==e.xValue&&void 0===t.xValue&&(t.xValue=e.xValue),i=t}return i}function oc(e){return e.getHours()||e.getMinutes()||e.getSeconds()||e.getMilliseconds()?e.toLocaleString():e.toLocaleDateString()}function nc(e,t){for(const r of t){const t=e.find(e=>e.lower===r);if(t)return t}}function sc(e,t={}){if(!e||"object"!=typeof e)return{entries:[]};const r=t.maxEntries??6,a=!1!==t.skipPositional,i=[];for(const[t,r]of Object.entries(e)){if(t.startsWith("_"))continue;if("data"===t)continue;const e=t.toLowerCase();if(a&&Vd.has(e))continue;if(null==r)continue;const o=typeof r;("string"===o||"number"===o||"boolean"===o||r instanceof Date)&&i.push({key:t,lower:e,value:r})}if(0===i.length)return{entries:[]};let o=i.findIndex(e=>_d.includes(e.lower));const n=o>=0;o<0&&(o=i.findIndex(e=>"id"===e.lower)),o<0&&(o=i.findIndex(e=>"string"==typeof e.value));const s=o>=0?i[o]:void 0,c=i.filter((e,t)=>t!==o&&(!n||"id"!==e.lower)),l=nc(c,Ud),u=nc(c,Gd),d=[];l&&d.push({key:l.key,value:l.value}),u&&d.push({key:u.key,value:u.value});for(const e of c){if(d.length>=r)break;Ud.includes(e.lower)||Gd.includes(e.lower)||d.push({key:e.key,value:e.value})}return{titleKey:s?.key,title:s?.value,entries:d}}function cc(e){return null!=e&&"boolean"!=typeof e&&("string"==typeof e?e.trim().length>0:Array.isArray(e)?e.some(cc):!Hd.isValidElement(e)||e.type!==Hd.Fragment||cc(e.props.children))}function lc(){const e=globalThis;return e[Yd]??(e[Yd]=Hd.createContext(void 0))}function uc(e){let t;for(const r of e.childNodes)if(1===r.nodeType){if(t)return!1;t=r}else if(3===r.nodeType&&r.textContent?.trim())return!1;const r=t?.getAttribute("data-semiotic-tooltip-chrome");return!t||null!=r&&"false"!==r}function dc(e,t){const[r,a]=Hd.useState(!1);return("undefined"==typeof window?Hd.useEffect:Hd.useLayoutEffect)(()=>{const i=t&&null!==e.current&&uc(e.current);i!==r&&a(i)}),Hd.useEffect(()=>{const r=e.current;if(!t||!r)return;const i=new MutationObserver(()=>a(uc(r)));return i.observe(r,{childList:!0,subtree:!0,characterData:!0,attributeFilter:["data-semiotic-tooltip-chrome"]}),()=>i.disconnect()},[t,e]),t&&r}function hc(e){return e.ownsChrome=!0,e}function pc(e){if("string"!=typeof e)return null!=e;const t=e.trim().toLowerCase();return!(!t||"transparent"===t||/^rgba\([^)]*,\s*0(?:\.0+)?\s*\)$/.test(t)||/^hsla\([^)]*,\s*0(?:\.0+)?\s*\)$/.test(t))}function fc(e){if("function"==typeof e)return!0===e.ownsChrome;if(!Hd.isValidElement(e))return!1;const t=e.type;if("string"!=typeof t&&t&&!0===t.ownsChrome)return!0;const r=e.props,a=r["data-semiotic-tooltip-chrome"];if(null!=a&&!1!==a&&"false"!==a)return!0;const i=r.style;if(i&&"object"==typeof i){if(pc(i.background))return!0;if(pc(i.backgroundColor))return!0}return!1}function mc(e,t){return"function"==typeof t?t(e):e[t]}function gc(e,t){if(t)return t(e);if(null==e)return"";if("number"==typeof e)return Number.isFinite(e)?ac(e):String(e);if(e instanceof Date)return oc(e);if("object"==typeof e&&null!==e){const t=e;if(void 0!==t.id)return String(t.id);if(void 0!==t.name)return String(t.name);try{return JSON.stringify(e)}catch{return Array.isArray(e)?`[Array(${e.length})]`:"[Object]"}}return String(e)}function yc(e,t,r){const a="string"==typeof t?t:t.accessor||t.key||"";return{label:"string"==typeof t?t:t.label,value:gc(mc(e,a),"string"==typeof t?r:t.format||r)}}function bc(e={}){const{fields:t,chrome:r,title:a,format:i,style:o={},className:n=""}=e;return e=>{if(!e||"object"!=typeof e)return null;let s;const c=[];if(a){const t=mc(e,a);s=gc(t,i)}if(t&&t.length>0)c.push(...t.map(t=>yc(e,t,i)));else if(!a){const t=["value","y","name","id","label"];for(const r of t)if(void 0!==e[r]){s=gc(e[r],i);break}if(!s){const t=Object.keys(e).filter(e=>!e.startsWith("_"));t.length>0&&(s=gc(e[t[0]],i))}}/* @__PURE__ */ /* @__PURE__ */
|
|
2
|
-
return(0,
|
|
3
|
-
return(0,
|
|
4
|
-
return(0,
|
|
1
|
+
"use strict";async function e(e,i){const{format:o="png",filename:n="chart",scale:s=2,background:c="white"}=i||{},l=e.querySelector("svg[data-semiotic-overlay]")||e.querySelector('svg[role="img"]')||e.querySelector("svg");if(!l)throw new Error("No SVG element found in the container");const u=l.cloneNode(!0);if("presentation"===u.getAttribute("role")){u.setAttribute("role","img");const e=l.closest('[role="img"]')?.getAttribute("aria-label");e&&u.setAttribute("aria-label",e)}const d=l.getBoundingClientRect();if(u.getAttribute("width")||u.setAttribute("width",String(d.width)),u.getAttribute("height")||u.setAttribute("height",String(d.height)),u.getAttribute("xmlns")||u.setAttribute("xmlns","http://www.w3.org/2000/svg"),r(l,u),"svg"===o){const e=(new XMLSerializer).serializeToString(u);a(new Blob([e],{type:"image/svg+xml;charset=utf-8"}),`${n}.svg`)}else{const i=d.width*s,o=d.height*s,l=document.createElement("canvas");l.width=i,l.height=o;const h=l.getContext("2d");h.fillStyle=c,h.fillRect(0,0,i,o),h.scale(s,s);const p=e.querySelector("canvas");if(p){for(const e of Array.from(p.parentElement.children)){if(e===p)break;if(e instanceof SVGSVGElement){const a=e.cloneNode(!0);a.setAttribute("xmlns","http://www.w3.org/2000/svg");const i=e.getBoundingClientRect();a.setAttribute("width",String(i.width)),a.setAttribute("height",String(i.height)),r(e,a),await t(h,a,i.x-d.x,i.y-d.y)}}h.drawImage(p,0,0,d.width,d.height)}await t(h,u,0,0),await new Promise((e,t)=>{l.toBlob(r=>{r?(a(r,`${n}.png`),e()):t(new Error("Failed to create PNG blob"))},"image/png")})}}async function t(e,t,r,a){const i=new Blob([(new XMLSerializer).serializeToString(t)],{type:"image/svg+xml;charset=utf-8"}),o=URL.createObjectURL(i);try{const i=new Image;i.width=Number(t.getAttribute("width")),i.height=Number(t.getAttribute("height")),await new Promise((e,t)=>{i.onload=()=>e(),i.onerror=()=>t(new Error("Failed to load SVG image")),i.src=o}),e.drawImage(i,r,a)}finally{URL.revokeObjectURL(o)}}function r(e,t){const a=e.children,i=t.children,o=window.getComputedStyle(e),n=["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 n){const r=o.getPropertyValue(e);r&&"none"!==r&&""!==r&&t.style?.setProperty(e,r)}for(let e=0;e<Math.min(a.length,i.length);e++)r(a[e],i[e])}function a(e,t){const r=URL.createObjectURL(e),a=document.createElement("a");a.href=r,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(r)}function i(e){let t=e.replace(/^#/,"");/^[a-f\d]{3}$/i.test(t)&&(t=t.split("").map(e=>e+e).join(""));const r=t.match(/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i);if(!r)return null;const[a,i,o]=[parseInt(r[1],16)/255,parseInt(r[2],16)/255,parseInt(r[3],16)/255],n=e=>e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4);return.2126*n(a)+.7152*n(i)+.0722*n(o)}function o(e,t){const r=i(e),a=i(t);return null===r||null===a?null:(Math.max(r,a)+.05)/(Math.min(r,a)+.05)}function n(e){return Object.prototype.hasOwnProperty.call(Qc,e)?function e(t){return Array.isArray(t)?t.map(e):null!==t&&"object"==typeof t?Object.fromEntries(Object.entries(t).map(([t,r])=>[t,e(r)])):t}(Qc[e]):void 0}function s(e){for(let t=0;t<e.length;t++){const r=e.charCodeAt(t);if(r<32||127===r)return!0}return!1}function c(e,t){("string"!=typeof e||s(e)||e.includes("<"))&&t();let r="",a="";for(let i=0;i<e.length;i++){const o=e[i];r?"\\"===o?++i===e.length&&t():o===r&&(r=""):'"'===o||"'"===o?(r=o,a+=" "):a+=o}return r&&t(),a}function l(e,t){const r=c(e,()=>{throw new TypeError(`Unsafe theme CSS in ${t}`)});if(/[>{};\\]|\/\*|\*\/|(?:url|expression)\s*\(/i.test(r))throw new TypeError(`Unsafe theme CSS in ${t}`)}function u(e){const t=c(e,()=>{throw new TypeError("Unsafe theme CSS selector")});if(!e.trim()||/[{};\\]|\/\*|\*\//.test(t))throw new TypeError("Unsafe theme CSS selector")}function d(e){const t={"--semiotic-bg":e.colors.background,"--semiotic-text":e.colors.text,"--semiotic-text-secondary":e.colors.textSecondary,"--semiotic-grid":e.colors.grid,"--semiotic-border":e.colors.border,"--semiotic-cell-border":e.colors.cellBorder||e.colors.border,"--semiotic-primary":e.colors.primary,"--semiotic-font-family":e.typography.fontFamily,"--semiotic-secondary":e.colors.secondary||e.colors.primary,"--semiotic-surface":e.colors.surface||e.colors.background};e.colors.categorical.forEach((e,r)=>{t[`--semiotic-category-${r+1}`]=e}),e.colors.focus&&(t["--semiotic-focus"]=e.colors.focus),e.colors.selection&&(t["--semiotic-selection-color"]=e.colors.selection),null!=e.colors.selectionOpacity&&(t["--semiotic-selection-opacity"]=String(e.colors.selectionOpacity)),e.colors.diverging&&(t["--semiotic-diverging"]=e.colors.diverging),e.colors.annotation&&(t["--semiotic-annotation-color"]=e.colors.annotation),e.colors.success&&(t["--semiotic-success"]=e.colors.success),e.colors.danger&&(t["--semiotic-danger"]=e.colors.danger),e.colors.warning&&(t["--semiotic-warning"]=e.colors.warning),e.colors.error&&(t["--semiotic-error"]=e.colors.error),e.colors.info&&(t["--semiotic-info"]=e.colors.info),e.tooltip?.background&&(t["--semiotic-tooltip-bg"]=e.tooltip.background),e.tooltip?.text&&(t["--semiotic-tooltip-text"]=e.tooltip.text),e.tooltip?.borderRadius&&(t["--semiotic-tooltip-radius"]=e.tooltip.borderRadius),e.tooltip?.fontSize&&(t["--semiotic-tooltip-font-size"]=e.tooltip.fontSize),e.tooltip?.shadow&&(t["--semiotic-tooltip-shadow"]=e.tooltip.shadow),e.borderRadius&&(t["--semiotic-border-radius"]=e.borderRadius);const r=e.typography.legendSize??e.typography.labelSize;null!=r&&(t["--semiotic-legend-font-size"]=`${r}px`),null!=e.typography.legendFontFamily&&(t["--semiotic-legend-font-family"]=e.typography.legendFontFamily),null!=e.typography.legendFontWeight&&(t["--semiotic-legend-font-weight"]=String(e.typography.legendFontWeight));const a=e.typography.titleFontSize??e.typography.titleSize;null!=a&&(t["--semiotic-title-font-size"]=`${a}px`),null!=e.typography.titleFontFamily&&(t["--semiotic-title-font-family"]=e.typography.titleFontFamily),null!=e.typography.titleFontWeight&&(t["--semiotic-title-font-weight"]=String(e.typography.titleFontWeight)),null!=e.typography.tickFontFamily&&(t["--semiotic-tick-font-family"]=e.typography.tickFontFamily),null!=e.typography.tickSize&&(t["--semiotic-tick-font-size"]=`${e.typography.tickSize}px`),null!=e.typography.labelSize&&(t["--semiotic-axis-label-font-size"]=`${e.typography.labelSize}px`);for(const[e,r]of Object.entries(t))l(r,e);return t}function h(e,t=":root"){return u(t),`${t} {\n${Object.entries(d(e)).map(([e,t])=>` ${e}: ${t};`).join("\n")}\n}`}function p(e){return{semiotic:{mode:{$value:e.mode,$type:"string"},bg:{$value:e.colors.background,$type:"color"},text:{$value:e.colors.text,$type:"color"},"text-secondary":{$value:e.colors.textSecondary,$type:"color"},grid:{$value:e.colors.grid,$type:"color"},border:{$value:e.colors.border,$type:"color"},primary:{$value:e.colors.primary,$type:"color"},...null!=e.colors.focus?{focus:{$value:e.colors.focus,$type:"color"}}:{},...null!=e.colors.cellBorder?{"cell-border":{$value:e.colors.cellBorder,$type:"color"}}:{},"font-family":{$value:e.typography.fontFamily,$type:"fontFamily"},"title-size":{$value:`${e.typography.titleSize}px`,$type:"dimension"},...null!=e.borderRadius?{"border-radius":{$value:e.borderRadius,$type:"dimension"}}:{},...null!=e.tooltip?{tooltip:{...null!=e.tooltip.background?{bg:{$value:e.tooltip.background,$type:"color"}}:{},...null!=e.tooltip.text?{text:{$value:e.tooltip.text,$type:"color"}}:{},...null!=e.tooltip.borderRadius?{radius:{$value:e.tooltip.borderRadius,$type:"dimension"}}:{},...null!=e.tooltip.fontSize?{"font-size":{$value:e.tooltip.fontSize,$type:"dimension"}}:{},...null!=e.tooltip.shadow?{shadow:{$value:e.tooltip.shadow,$type:"shadow"}}:{},...null!=e.tooltip.chrome?{chrome:{$value:e.tooltip.chrome,$type:"string"}}:{}}}:{},...null!=e.colors.selection||null!=e.colors.selectionOpacity?{selection:{...null!=e.colors.selection?{color:{$value:e.colors.selection,$type:"color"}}:{},...null!=e.colors.selectionOpacity?{opacity:{$value:e.colors.selectionOpacity,$type:"number"}}:{}}}:{},...null!=e.accessibility?{accessibility:Object.fromEntries(Object.entries(e.accessibility).map(([e,t])=>[e,{$value:t,$type:"boolean"}]))}:{},categorical:{$value:[...e.colors.categorical],$type:"color",$description:"Categorical color palette"},sequential:{$value:e.colors.sequential,$type:"string",$description:"d3-scale-chromatic sequential scheme name"},...e.aesthetics?{aesthetics:{...e.aesthetics.name?{profile:{$value:e.aesthetics.name,$type:"string"}}:{},...null!=e.aesthetics.minimumScore?{"minimum-score":{$value:e.aesthetics.minimumScore,$type:"number"}}:{},weights:Object.fromEntries(Object.entries(e.aesthetics.weights??{}).map(([e,t])=>[e,{$value:t,$type:"number"}])),thresholds:Object.fromEntries(Object.entries(e.aesthetics.thresholds??{}).map(([e,t])=>[e,{$value:t,$type:"number"}])),rationales:Object.fromEntries(Object.entries(e.aesthetics.rationales??{}).map(([e,t])=>[e,{$value:t,$type:"string"}]))}}:{},...e.colors.diverging?{diverging:{$value:e.colors.diverging,$type:"string",$description:"d3-scale-chromatic diverging scheme name"}}:{},...e.colors.annotation?{"annotation-color":{$value:e.colors.annotation,$type:"color"}}:{},...null!=e.typography.legendSize?{"legend-font-size":{$value:`${e.typography.legendSize}px`,$type:"dimension"}}:{},...null!=e.typography.legendFontFamily?{"legend-font-family":{$value:e.typography.legendFontFamily,$type:"fontFamily"}}:{},...null!=e.typography.legendFontWeight?{"legend-font-weight":{$value:e.typography.legendFontWeight,$type:"fontWeight"}}:{},...null!=e.typography.titleFontSize?{"title-font-size":{$value:`${e.typography.titleFontSize}px`,$type:"dimension"}}:{},...null!=e.typography.titleFontFamily?{"title-font-family":{$value:e.typography.titleFontFamily,$type:"fontFamily"}}:{},...null!=e.typography.titleFontWeight?{"title-font-weight":{$value:e.typography.titleFontWeight,$type:"fontWeight"}}:{},...null!=e.typography.tickFontFamily?{"tick-font-family":{$value:e.typography.tickFontFamily,$type:"fontFamily"}}:{},...null!=e.typography.tickSize?{"tick-font-size":{$value:`${e.typography.tickSize}px`,$type:"dimension"}}:{},...null!=e.typography.labelSize?{"axis-label-font-size":{$value:`${e.typography.labelSize}px`,$type:"dimension"}}:{},...null!=e.colors.secondary?{secondary:{$value:e.colors.secondary,$type:"color"}}:{},...null!=e.colors.surface?{surface:{$value:e.colors.surface,$type:"color"}}:{},...e.colors.success?{success:{$value:e.colors.success,$type:"color"}}:{},...e.colors.danger?{danger:{$value:e.colors.danger,$type:"color"}}:{},...e.colors.warning?{warning:{$value:e.colors.warning,$type:"color"}}:{},...e.colors.error?{error:{$value:e.colors.error,$type:"color"}}:{},...e.colors.info?{info:{$value:e.colors.info,$type:"color"}}:{}}}}function f(e){return Math.min(255,Math.max(0,Math.round(e)))}function m(e){if("string"!=typeof e)return null;const t=e.trim().toLowerCase(),r=t.match(/^#([a-f\d]{3,4}|[a-f\d]{6}|[a-f\d]{8})$/i)?.[1];if(r){const e=r.length<=4?r.split("").map(e=>`${e}${e}`).join(""):r;return{r:Number.parseInt(e.slice(0,2),16),g:Number.parseInt(e.slice(2,4),16),b:Number.parseInt(e.slice(4,6),16),a:8===e.length?Number.parseInt(e.slice(6,8),16)/255:1}}const a=t.match(/^(rgba?|hsla?)\(([^()]*)\)$/);if(!a)return null;const i=a[2].includes(","),o=a[2].split("/");if(o.length>2||i&&o.length>1)return null;const n=i?a[2].split(",").map(e=>e.trim()):o[0].trim().split(/\s+/);if(!i){if(3!==n.length)return null;2===o.length&&n.push(o[1].trim())}if(3!==n.length&&4!==n.length)return null;const s=(e,t)=>/^[+-]?(?:\d+\.?\d*|\.\d+)%?$/.test(e)?parseFloat(e)*(e.endsWith("%")?t/100:1):NaN,c=void 0===n[3]?1:s(n[3],1);let l;if(a[1].startsWith("hsl")){const e=n[0].match(/^([+-]?(?:\d+\.?\d*|\.\d+))(deg|grad|rad|turn)?$/);if(!e||!n[1].endsWith("%")||!n[2].endsWith("%"))return null;const t=(Number(e[1])*("turn"===e[2]?360:"rad"===e[2]?180/Math.PI:"grad"===e[2]?.9:1)%360+360)%360/60,r=s(n[1],1),a=s(n[2],1);if(!Number.isFinite(t)||r<0||r>1||a<0||a>1)return null;const i=(1-Math.abs(2*a-1))*r,o=i*(1-Math.abs(t%2-1)),c=a-i/2;l=(t<1?[i,o,0]:t<2?[o,i,0]:t<3?[0,i,o]:t<4?[0,o,i]:t<5?[o,0,i]:[i,0,o]).map(e=>255*(e+c))}else l=n.slice(0,3).map(e=>s(e,255));return l.some(e=>!Number.isFinite(e)||e<0||e>255)||!Number.isFinite(c)||c<0||c>1?null:{r:l[0],g:l[1],b:l[2],a:c}}function g(e,t){return t.a<1?null:{r:f(e.r*e.a+t.r*(1-e.a)),g:f(e.g*e.a+t.g*(1-e.a)),b:f(e.b*e.a+t.b*(1-e.a)),a:1}}function y(e){return e.a<1?null:`#${[e.r,e.g,e.b].map(e=>f(e).toString(16).padStart(2,"0")).join("")}`}function b(e){if("string"!=typeof e||""===e.trim())return;const t=m(e);return t?y(t)??`rgba(${f(t.r)},${f(t.g)},${f(t.b)},${t.a})`:e.trim().toLowerCase()}function v(e){if(null==e)return()=>{};const t="function"==typeof e?e:t=>t[e];return e=>x(t(e))}function w(e,t){const r=v(e),a=v(t);return(e,t)=>{const i=a(e);return{value:i,x:r(e),y:i,category:t}}}function A(e,t){const r=v(t??"value"),a=null==e?void 0:"function"==typeof e?e:t=>t[e];return e=>{const t=a?a(e):void 0;return{value:r(e),category:null==t?void 0:String(t)}}}function x(e){if("number"==typeof e)return Number.isFinite(e)?e:void 0;if("string"==typeof e&&""!==e.trim()){const t=Number(e);return Number.isFinite(t)?t:void 0}}function $(e,t,r){const a=null!=e.axis?r[e.axis]:null!=e.field?t[e.field]:r.value;if(void 0!==e.eq&&a!==e.eq)return!1;if(void 0!==e.ne&&a===e.ne)return!1;if(void 0!==e.in&&!e.in.includes(a))return!1;if(void 0===e.gt&&void 0===e.gte&&void 0===e.lt&&void 0===e.lte&&void 0===e.within&&void 0===e.outside)return!0;const i=x(a);if(void 0===i)return!1;if(void 0!==e.gt&&!(i>e.gt))return!1;if(void 0!==e.gte&&!(i>=e.gte))return!1;if(void 0!==e.lt&&!(i<e.lt))return!1;if(void 0!==e.lte&&!(i<=e.lte))return!1;if(void 0!==e.within){const[t,r]=e.within;if(!(i>=t&&i<=r))return!1}if(void 0!==e.outside){const[t,r]=e.outside;if(!(i<t||i>r))return!1}return!0}function C(e,t,r){const a=e.when;return void 0===a||!0===a||!1!==a&&("function"==typeof a?a(t,r):$(a,t,r))}function S(e,t,r){if(!t||0===t.length)return{};let a={};for(const i of t){if(!C(i,e,r))continue;const t="function"==typeof i.style?i.style(e,r):i.style;t&&(a={...a,...t})}return a}function k(e,t,r,a=e=>e){const i=e??(()=>({}));return t&&0!==t.length?(e,o)=>{const n=a(e),s={...i(e,o)};return Object.assign(s,S(n,t,r(n,o))),s}:i}function R(e,t,r){return e&&0!==e.length?(a,i)=>{const o=S(a,e,t(a,i)),n=r?r(a,i):void 0;return n?{...o,...n}:o}:r}function P(e,t){let r=1/0,a=-1/0;for(const i of e){const e=t?t(i):i;e<r&&(r=e),e>a&&(a=e)}return[r,a]}function E(e,t=1/0){let r=t;for(const t of e)t<r&&(r=t);return r}function N(e,t,r){const a=m(e),i=m(t);if(!a||!i)return null;const o=g({...a,a:a.a*Math.min(1,Math.max(0,r))},i);return o?y(o):null}function T(e){const t=m(e.backgroundColor),r=t?y(t):null,a=N(e.scaffoldColor,e.backgroundColor,e.scaffoldOpacity??1),i=a&&r?o(a,r):null,n=e.dataColors.map(t=>N(t,e.backgroundColor,1)).map(e=>e&&r?o(e,r):null).filter(e=>null!==e);if(null===i||n.length!==e.dataColors.length||0===n.length)return{ok:!0,status:"manual",method:"mark-to-scaffold-contrast",finding:{code:"VISUAL_HIERARCHY_MANUAL",status:"manual",message:"Visual hierarchy could not be computed from the supplied colors.",fix:"Resolve CSS variables, gradients, or named colors to solid colors and run the audit again."}};const s=E(n),c=s/i,l={weakestDataContrast:s,scaffoldContrast:i,hierarchyRatio:c},u=Math.max(1,e.minimumScaffoldContrast??1.1),d=Math.max(u,e.maximumScaffoldContrast??2),h=Math.max(1,e.minimumHierarchyRatio??2);return s<3?{ok:!1,status:"warn",method:"mark-to-scaffold-contrast",evidence:l,finding:{code:"DATA_MARK_CONTRAST",status:"warn",message:"Primary data marks have contrast below 3:1 against the background.",fix:"Increase data-mark contrast against the background before adjusting grids or guides."}}:i<u?{ok:!1,status:"warn",method:"mark-to-scaffold-contrast",evidence:l,finding:{code:"SCAFFOLD_VISIBILITY",status:"warn",message:"Reference scaffolding may be too faint to remain useful.",fix:"Increase grid or guide contrast while keeping it below the primary data marks."}}:s>=3&&i<=d&&c>=h?{ok:!0,status:"pass",method:"mark-to-scaffold-contrast",evidence:l,finding:{code:"SCAFFOLD_DOMINANCE",status:"pass",message:"Primary data marks lead while reference scaffolding remains visible and subordinate."}}:{ok:!1,status:"warn",method:"mark-to-scaffold-contrast",evidence:l,finding:{code:"SCAFFOLD_DOMINANCE",status:"warn",message:"Reference scaffolding competes with the primary data marks.",fix:"Increase mark contrast or lighten grid and guide colors until marks have at least twice the scaffold contrast."}}}function I(e){return Math.min(1,Math.max(0,e))}function O(e,t){return Number.isFinite(e)?e:t}function M(e){const t=e.thresholds??{},r=Math.max(1,O(t.scaffoldContrastMin,tl.scaffoldContrastMin)),a=I(O(t.emphasisRatioMin,tl.emphasisRatioMin));return{hierarchyRatio:Math.max(1,O(t.hierarchyRatio,tl.hierarchyRatio)),scaffoldContrastMin:r,scaffoldContrastMax:Math.max(r,O(t.scaffoldContrastMax,tl.scaffoldContrastMax)),titleScaleRatio:Math.max(1.01,O(t.titleScaleRatio,tl.titleScaleRatio)),categoricalColorMax:Math.max(1,Math.round(O(t.categoricalColorMax,tl.categoricalColorMax))),emphasisRatioMin:a,emphasisRatioMax:Math.max(a,I(O(t.emphasisRatioMax,tl.emphasisRatioMax)))}}function j(e){return b(e)}function F(e){return(Array.isArray(e)?e:e&&"object"==typeof e?Object.values(e):[e]).map(j).filter(e=>!!e)}function z(e){return Array.isArray(e)||e&&"object"==typeof e?F(e):[]}function L(e){return!(e.length<4)&&il.some(t=>e.length===t.length&&e.every((e,r)=>e===t[r]))}function B(e){const t=e.frameProps&&"object"==typeof e.frameProps&&e.frameProps.pieceStyle&&"object"==typeof e.frameProps.pieceStyle?e.frameProps.pieceStyle:void 0,r=[...z(e.colorScheme),...F(e.color),...F(e.fill),...F(e.stroke),...F(t?.fill),...F(t?.stroke)],a=Array.isArray(e.styleRules)?e.styleRules:[];for(const e of a)e.style&&"function"!=typeof e.style&&r.push(...F(e.style.fill),...F(e.style.stroke));return Array.from(new Set(r))}function D(e){const t=e.frameProps&&"object"==typeof e.frameProps&&e.frameProps.pieceStyle&&"object"==typeof e.frameProps.pieceStyle?e.frameProps.pieceStyle:void 0,r=[...z(e.colorScheme),...F(e.color),...F(e.fill),...F(t?.fill)],a=Array.isArray(e.styleRules)?e.styleRules:[];for(const e of a)e.style&&"function"!=typeof e.style&&r.push(...F(e.style.fill));return Array.from(new Set(r))}function _(e,t){const r=Array.isArray(e.data)?e.data:[];return"string"==typeof t?Array.from(new Set(r.map(e=>String(e[t])))):"function"==typeof t?Array.from(new Set(r.map((e,r)=>String(t(e,r))))):[]}function U(e){const t=Array.isArray(e.data)?e.data:[],r=Array.isArray(e.styleRules)?e.styleRules:[],a="string"==typeof e.valueAccessor?e.valueAccessor:"string"==typeof e.yAccessor?e.yAccessor:"value",i="string"==typeof e.categoryAccessor?e.categoryAccessor:"category",o=[];for(const e of r)e.style&&"function"!=typeof e.style&&t.some((t,r)=>C(e,t,{value:Number(t[a]),category:String(t[i]??""),index:r}))&&o.push(...F(e.style.fill));return Array.from(new Set(o))}function G(e,t,r){const a=z(t.colorScheme),i=F(t.color),o=_(t,t.colorBy),n=nl.has(e)?_(t,t.categoryAccessor??"category"):[],s=t.colorScheme&&"object"==typeof t.colorScheme&&!Array.isArray(t.colorScheme)?t.colorScheme:void 0,c=(e,t)=>e.map((e,a)=>j(s?.[e])??("gray"===t?"#999999":r.colors.categorical.length>0?r.colors.categorical[a%r.colors.categorical.length]:"#007bff")),l=o.length>0?s?c(o,"gray"):a.length>0?a:r.colors.categorical:i.length>0?i:n.length>0&&s?c(n,"theme"):a.length>0&&!s?a:r.colors.categorical,u=Math.max(1,o.length||n.length||1),d=o.length>0||n.length>0?l.slice(0,Math.min(l.length,u)):l.slice(0,1),h=U(t).filter(e=>!d.includes(e));return Array.from(/* @__PURE__ */new Set([...d,...h]))}function V(e){const t=e.colors.surface??e.colors.background,r=m(t),a=m(e.colors.background);if(!r)return t;if(1===r.a)return y(r)??t;if(!a)return t;const i=g(r,a);return i?y(i)??t:t}function H(e,t){if(!e.evidence)return.5;const{weakestDataContrast:r,scaffoldContrast:a,hierarchyRatio:i}=e.evidence;return Math.min(I(r/3),I(a/t.scaffoldContrastMin),I(t.scaffoldContrastMax/a),I(i/t.hierarchyRatio))}function W(e,t,r,a,i,o,n){const s=r[e];return{id:e,label:sl[e],status:0===s?"disabled":n??(t>=.8?"pass":"warn"),score:t,weight:s,contribution:t*s,message:a,...o?.[e]?{rationale:o[e]}:{},evidence:i}}function q(e){return Math.max(1,e.length)}function Y(e){const t=Array.isArray(e.data)?e.data:[],r=Array.isArray(e.styleRules)?e.styleRules:[];if(0===t.length||0===r.length)return{ratio:0,authored:!1};const a="string"==typeof e.valueAccessor?e.valueAccessor:"string"==typeof e.yAccessor?e.yAccessor:"value",i="string"==typeof e.categoryAccessor?e.categoryAccessor:"category";return{ratio:t.filter((e,t)=>r.some(r=>C(r,e,{value:Number(e[a]),category:String(e[i]??""),index:t}))).length/t.length,authored:!0}}function K(e,t,r={}){const a=r.theme??Yc,i=r.profile??a.aesthetics??rl,o={...el,...i.weights??{}};for(const e of Object.keys(o)){const t=o[e];o[e]=Number.isFinite(t)?Math.max(0,t):0}const n=M(i),s=G(e,t,a),c=T({backgroundColor:V(a),dataColors:s,scaffoldColor:a.colors.grid,minimumHierarchyRatio:n.hierarchyRatio,minimumScaffoldContrast:n.scaffoldContrastMin,maximumScaffoldContrast:n.scaffoldContrastMax}),l=B(t),u=L(a.colors.categorical.map(j).filter(e=>!!e)),d=D(t),h="string"==typeof t.colorScheme?t.colorScheme.trim().toLowerCase():void 0,p=d.length>0||h?"chart":"theme",f="chart"===p?L(d)||!!h&&ol.has(h):u,m=f?.2:"chart"===p?1:.8,g=q(s),y=g<=n.categoricalColorMax?1:I(1-(g-n.categoricalColorMax)/n.categoricalColorMax),b=a.typography.titleFontSize??a.typography.titleSize,v=Math.max(a.typography.tickSize,a.typography.labelSize),w=v>0?b/v:1,A=I((w-1)/(n.titleScaleRatio-1)),x=new Set([...a.colors.categorical,a.colors.primary,a.colors.secondary,a.colors.background,a.colors.surface,a.colors.text,a.colors.textSecondary,a.colors.grid,a.colors.border,a.colors.annotation].map(j).filter(e=>!!e)),$=l.filter(e=>!x.has(e)).length,C=0===l.length?1:I(1-$/l.length),S=Y(t),k=S.authored?S.ratio<n.emphasisRatioMin?I(S.ratio/n.emphasisRatioMin):S.ratio<=n.emphasisRatioMax?1:I(n.emphasisRatioMax/S.ratio):.35,R=[W("mark-scaffold-hierarchy",H(c,n),o,c.finding.message,{hierarchyRatio:c.evidence?.hierarchyRatio??0,markContrast:c.evidence?.weakestDataContrast??0,scaffoldContrast:c.evidence?.scaffoldContrast??0},i.rationales,c.status),W("palette-authorship",m,o,f?"theme"===p?"The chart inherits a ubiquitous categorical default without an organizational palette decision.":"The chart explicitly selects a ubiquitous categorical palette.":"The effective palette records an authored choice beyond the ubiquitous defaults.",{paletteSource:p,ubiquitousDefault:f,colorCount:s.length},i.rationales),W("palette-economy",y,o,`${g} color role(s) are used against a policy ceiling of ${n.categoricalColorMax}.`,{colorRoles:g,maximum:n.categoricalColorMax},i.rationales),W("typographic-hierarchy",A,o,`Title-to-supporting-type scale is ${w.toFixed(2)}×.`,{titleSize:b,supportingSize:v,ratio:w},i.rationales),W("theme-coherence",C,o,`${$} of ${l.length} explicit chart color(s) fall outside the theme vocabulary.`,{explicitColors:l.length,outsideTheme:$},i.rationales),W("editorial-emphasis",k,o,S.authored?`${Math.round(100*S.ratio)}% of marks receive authored emphasis.`:"No machine-visible editorial emphasis rule is declared.",{authored:S.authored,emphasizedRatio:S.ratio},i.rationales)],P=R.reduce((e,t)=>e+t.weight,0),E=R.reduce((e,t)=>e+t.contribution,0),N=0===P?null:E/P*100,F=100*I(O(i.minimumScore,rl.minimumScore??70)/100);return{component:e,profile:i.name??"Unnamed aesthetic profile",ok:null===N||N>=F,score:N,minimumScore:F,weightedPoints:E,totalWeight:P,features:R,method:"weighted-machine-visible-features"}}function J(e){if(e.length<2)return"days";const t=[];for(let r=1;r<e.length;r++)t.push(e[r]-e[r-1]);t.sort((e,t)=>e-t);const r=t[Math.floor(t.length/2)];return r<2*cl?"seconds":r<2*ll?"minutes":r<2*ul?"hours":r<60*ul?"days":r<400*ul?"months":"years"}function X(e){return e<10?`0${e}`:String(e)}function Z(e={}){const t=e.timeZone;return"UTC"===t?{kind:"utc"}:"local"===t?{kind:"local"}:"string"==typeof t&&t.length>0?{kind:"iana",id:t}:!1===e.utc?{kind:"local"}:{kind:"utc"}}function Q(e,t){return t?{month:e.getUTCMonth(),day:e.getUTCDate(),year:e.getUTCFullYear(),hours:e.getUTCHours(),minutes:e.getUTCMinutes(),seconds:e.getUTCSeconds()}:{month:e.getMonth(),day:e.getDate(),year:e.getFullYear(),hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()}}function ee(e){let t;try{t=new Intl.DateTimeFormat("en-US",{timeZone:e,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hourCycle:"h23"})}catch{return e=>Q(e,!0)}return e=>{const r={};for(const a of t.formatToParts(e))"literal"!==a.type&&(r[a.type]=a.value);return{month:Math.max(0,(Number(r.month)||1)-1),day:Number(r.day)||1,year:Number(r.year)||1970,hours:Number(r.hour)||0,minutes:Number(r.minute)||0,seconds:Number(r.second)||0}}}function te(e,t,r,a=hl){const{month:i,day:o,year:n,hours:s,minutes:c,seconds:l}=r(e),u=dl[i],d=X(s),h=X(c),p=X(l),f=a.year?`${u} ${o}, ${n} `:`${u} ${o} `;switch(t){case"seconds":return`${a.date?f:""}${d}:${h}:${p}`;case"minutes":case"hours":return`${a.date?f:""}${d}:${h}`;case"days":return a.year?`${u} ${o}, ${n}`:`${u} ${o}`;case"months":return a.year?`${u} ${n}`:`${u}`;case"years":return`${n}`}}function re(e,t,r,a,i=hl,o=!1){const n=a(e),s=a(t),c=n.year!==s.year,l=c||n.month!==s.month,u=l||n.day!==s.day,d=u||n.hours!==s.hours,h=d||n.minutes!==s.minutes,p=i.date,f=c&&i.year,m=dl[n.month],{day:g,year:y}=n,b=X(n.hours),v=X(n.minutes),w=X(n.seconds);switch(r){case"seconds":return f&&p?`${m} ${g}, ${y} ${b}:${v}:${w}`:u&&p?`${m} ${g} ${b}:${v}:${w}`:d||o?`${b}:${v}:${w}`:h?`${v}:${w}`:`:${w}`;case"minutes":return f&&p?`${m} ${g}, ${y} ${b}:${v}`:u&&p?`${m} ${g} ${b}:${v}`:d||o?`${b}:${v}`:`:${v}`;case"hours":return f&&p?`${m} ${g}, ${y} ${b}:${v}`:u&&p?`${m} ${g} ${b}:${v}`:`${b}:${v}`;case"days":return f?`${m} ${g}, ${y}`:l||o?`${m} ${g}`:`${g}`;case"months":return f?`${m} ${y}`:`${m}`;case"years":return`${y}`}}function ae(e,t={}){let r,a=e;const i="utc"===(o=Z(t)).kind?e=>Q(e,!0):"local"===o.kind?e=>Q(e,!1):ee(o.id);var o;const{includeYear:n="always",includeDate:s="always"}=t,c="clock"===t.deltaStyle,l="auto"===n?i(new Date(t.referenceTime??Date.now())).year:void 0;let u,d={referenceYear:!1,oneDay:!1};const h=e=>{if(e!==u){u=e;const t=e.map(e=>i(new Date(e))),[r]=t;d={referenceYear:t.every(e=>e.year===l),oneDay:t.every(e=>e.year===r.year&&e.month===r.month&&e.day===r.day)}}return d};return(t,o,l)=>{const u=t instanceof Date?t:new Date(t);!e&&l&&l.length>=2&&l!==r&&(r=l,a=J(l));const p=a||"days";if(null==o||!l||0===l.length)return te(u,p,i);const f="seconds"===p||"minutes"===p||"hours"===p,m="always"===n&&"always"===s?hl:{year:"years"===p||"never"!==n,date:!f||"never"!==s};if(0===o){if(m===hl)return te(u,p,i);const{referenceYear:e,oneDay:t}="auto"===n||"auto"===s?h(l):d,r=m.date&&!(f&&"auto"===s&&t),a=r&&m.year&&!("years"!==p&&"auto"===n&&e);return te(u,p,i,{year:a||"years"===p,date:r})}return re(u,new Date(l[o-1]),p,i,m,c)}}function ie(e){if(null==e)return"";if("number"!=typeof e)return String(e);if(!isFinite(e))return String(e);if(0===e)return"0";const t=parseFloat(e.toPrecision(12)),r=Math.abs(t);if(r>=1e4)for(let e=pl.length-1;e>=0;e--){const[a,i]=pl[e];if(r<a)continue;const o=parseFloat((t/a).toPrecision(3));if(Math.abs(o)>=1e3&&e<pl.length-1){const[r,a]=pl[e+1];return`${parseFloat((t/r).toPrecision(3))}${a}`}return`${o}${i}`}return Number.isInteger(t)?String(t):String(parseFloat(t.toPrecision(6)))}function oe(e,t=0,r=1/0,a=0){const i=Number.isFinite(t)?t:0,o=Number.isFinite(r)?Math.max(i,r):1/0,n=Number.isFinite(e)?Math.floor(e):i,s=Math.max(i,Math.min(o,n));return a>0&&Number.isFinite(a)?Math.max(i,Math.min(o,Math.round(s/a)*a)):s}function ne(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function se(e){if(!("number"!=typeof e.height||e.height<=0))return e.width>=e.height?"landscape":"portrait"}function ce(e){if(!("number"!=typeof e.height||e.height<=0))return e.width/e.height}function le(e,t){const{when:r}=e,a=t.width,i=t.height,o=ce(t),n=se(t);return!("number"==typeof r.minWidth&&a<r.minWidth||"number"==typeof r.maxWidth&&a>r.maxWidth||"number"==typeof r.minHeight&&("number"!=typeof i||i<r.minHeight)||"number"==typeof r.maxHeight&&("number"!=typeof i||i>r.maxHeight)||"number"==typeof r.minAspectRatio&&("number"!=typeof o||o<r.minAspectRatio)||"number"==typeof r.maxAspectRatio&&("number"!=typeof o||o>r.maxAspectRatio)||r.orientation&&n!==r.orientation)}function ue(e,t){const r={...e,...t};for(const a of["margin","frameProps","mobileSemantics","style"])ne(e[a])&&ne(t[a])&&(r[a]={...e[a],...t[a]});return"string"==typeof e.className&&"string"==typeof t.className&&(r.className=`${e.className} ${t.className}`),r}function de(e,t,r=e.responsiveRules){if(!Array.isArray(r)||0===r.length)return{props:e,matches:[]};const a=r.map((e,t)=>({rule:e,index:t})).filter(e=>le(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:a.reduce((e,t)=>ue(e,t.rule.transform),e),matches:a}}function he(e,t={}){const r=t.mobileSemantics?.interaction,a="number"==typeof r?.targetSize?r.targetSize:"number"==typeof t.mobileSemantics?.minimumHitTarget?t.mobileSemantics.minimumHitTarget:void 0,i="mobile"===t.mode||"number"==typeof t.width&&t.width<=480,o=!!r||void 0!==a,n=e&&"object"==typeof e?e:void 0;if(!1===e||!1===n?.enabled||void 0===e&&!i&&!o)return ml;const s=n??{};return{enabled:!0,tapToSelect:s.tapToSelect??!0,tapToLockTooltip:s.tapToLockTooltip??!0,clearSelection:s.clearSelection??"backgroundTap",targetSize:s.targetSize??a??fl,snap:s.snap??"nearestDatum",brushHandleSize:s.brushHandleSize??fl,standardControls:s.standardControls??!1}}function pe(e,t,r){const a=gl[e||"primary"],i=e&&"primary"!==e||!r?.width?a.width:r.width,o=e&&"primary"!==e||!r?.height?a.height:r.height,n=de({...t,mode:e},{width:t.width??i,height:t.height??o}).props,s=n.mode||e||"primary",c=gl[s],l="context"===s||"sparkline"===s,u="primary"===s&&r?.width?r.width:c.width,d="primary"===s&&r?.height?r.height:c.height;return{mode:s,width:n.width??u,height:n.height??d,showAxes:n.showAxes??c.showAxes,showGrid:n.showGrid??c.showGrid,enableHover:n.enableHover??(!!n.linkedHover||c.enableHover),showLegend:n.showLegend??c.showLegend,showLabels:n.showLabels??c.showLabels,title:l?void 0:n.title,description:n.description,summary:n.summary,accessibleTable:n.accessibleTable,xLabel:l?void 0:n.xLabel,yLabel:l?void 0:n.yLabel,categoryLabel:l?void 0:n.categoryLabel,valueLabel:l?void 0:n.valueLabel,marginDefaults:fe(c.marginDefaults,n.showCategoryTicks,n.orientation),compactMode:l,mobileInteraction:he(n.mobileInteraction,{mode:s,width:n.width??u,mobileSemantics:n.mobileSemantics}),mobileSemantics:n.mobileSemantics}}function fe(e,t,r){if(!1!==t)return e;const a={...e};return"horizontal"===r?a.left=Math.min(a.left,15):a.bottom=Math.min(a.bottom,15),a}function me(e){const t=ge(e);return(e.height||Al)+(e.margin?.top??t.top)+(e.margin?.bottom??t.bottom)}function ge(e){const t=e.handles&&"object"==typeof e.handles?e.handles:e.handles?{}:null,r="number"==typeof t?.size&&Number.isFinite(t.size)?t.size:12;return{top:t?.move?Math.ceil(wl(r)/2)+2:0,bottom:e.showExtentLabels?34:20}}function ye(e,t={}){if("BigNumber"===e){const e=t,r=e.mode&&Object.hasOwn(yl,e.mode)?yl[e.mode]:yl.tile;return{width:e.width??r.width,height:e.height??r.height}}if(!Object.hasOwn(vl,e))throw new Error(`Unknown chart: ${e}`);const r=t;if("ScatterplotMatrix"===e){const e=r.fields?.length??0,t=bl.labelWidth+e*((r.cellSize??bl.cellSize)+(r.cellGap??bl.cellGap));return{width:t,height:t}}const a=(i=e,["MinimapChart","ProcessSankey","ChainReactionChart","DependencyForestChart","FlowCircuitChart"].includes(i));var i;const o=["GaltonBoardChart","UnitPileChart","CollisionSwarmChart","EventDropChart","PacketFlowChart","ProcessFlowChart","PhysicsCustomChart","GauntletChart","CrucibleChart"].includes(e),n=o||e.startsWith("Realtime")||"TemporalHistogram"===e?r.size:void 0,s=pe("Sparkline"===e?"sparkline":a?void 0:"string"==typeof(c=r.mode)&&Object.prototype.hasOwnProperty.call(gl,c)?r.mode:void 0,{width:!o&&n?n[0]:r.width,height:!o&&n?n[1]:r.height,responsiveRules:a?void 0:r.responsiveRules},vl[e]);var c;let l=n?n[0]:s.width,u=n?n[1]:s.height;return r.responsiveWidth&&void 0!==r.containerSize?.width&&(l=oe(r.containerSize.width)),r.responsiveHeight&&void 0!==r.containerSize?.height&&(u=oe(r.containerSize.height)),"MinimapChart"===e&&(u+=me(r.minimap??{})),(o||"ChainReactionChart"===e||"FlowCircuitChart"===e)&&(l=Math.max(1,l),u=Math.max(1,u)),{width:l,height:u}}function be(e,t=.5){const r=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e);if(!r)return e;const a=Math.round(parseInt(r[1],16)*(1-t)),i=Math.round(parseInt(r[2],16)*(1-t)),o=Math.round(parseInt(r[3],16)*(1-t));return`#${a.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}`}function ve(e,t=.5){const r=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e);if(!r)return e;const a=Math.round(parseInt(r[1],16)+(255-parseInt(r[1],16))*t),i=Math.round(parseInt(r[2],16)+(255-parseInt(r[2],16))*t),o=Math.round(parseInt(r[3],16)+(255-parseInt(r[3],16))*t);return`#${a.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}`}function we(e){const t=Number.isFinite(e)&&e>0?e:6;return{width:Math.max(8,t),height:t,lineY:t/2}}function Ae(e){return{type:"hatch",background:e.background,stroke:e.stroke,lineWidth:e.lineWidth,spacing:e.spacing,angle:e.angle,...1!==e.lineOpacity?{lineOpacity:e.lineOpacity}:{}}}function xe(){const e="undefined"!=typeof window&&window.devicePixelRatio||1;return Math.min(3,Math.max(1,e))}function $e(e,t,r,a){t&&"transparent"!==t&&"none"!==t?(e.fillStyle=t,e.fillRect(0,0,r,a)):e.clearRect(0,0,r,a)}function Ce(e={},t){const{background:r="transparent",stroke:a="#000",lineWidth:i=1.5,spacing:o=6,angle:n=45,lineOpacity:s=1}=e,c={background:r,stroke:a,lineWidth:i,spacing:o,angle:n,lineOpacity:s},l=we(o),u=xe(),d=Math.max(1,Math.round(l.width*u)),h=Math.max(1,Math.round(l.height*u));let p;try{f=d,m=h,p="undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(f,m):(xl||(xl=document.createElement("canvas")),xl.width=f,xl.height=m,xl)}catch{return Ae(c)}var f,m;const g=p.getContext("2d");if(!g)return Ae(c);$e(g,r,d,h);const y=h/l.height,b=Math.max(0,i)*y;g.save(),g.globalAlpha=Math.min(1,Math.max(0,s)),g.fillStyle=a,g.fillRect(0,l.lineY*y-b/2,d,b),g.restore();const v=(t||g).createPattern(p,"repeat");if(!v)return v;const w=n*Math.PI/180,A=Math.cos(w),x=Math.sin(w),$=l.width/d,C=l.height/h;return v.setTransform?.({a:A*$,b:x*$,c:-x*C,d:A*C,e:0,f:0}),v}function Se(e,t=2166136261){let r=t;for(let t=0;t<e.length;t++)r^=e.charCodeAt(t),r=Math.imul(r,16777619);return r>>>0}function ke(e){return"object"==typeof e&&null!==e&&"hatch"===e.type}function Re(e){return["hatch",e.background??"transparent",e.stroke??"#000",e.lineWidth??1.5,e.spacing??6,e.angle??45,e.lineOpacity??1].join("|")}function Pe(e,t){return`${e}-hatch-${Se(Re(t)).toString(36)}`}function Ee(e){return!(null===e||"object"!=typeof e||Array.isArray(e)||e instanceof Date||e instanceof Map||e instanceof Set)}function Ne(e){const t=(e.length<=3?Array.from(e):[e[0],e[Math.floor(e.length/2)],e[e.length-1]]).filter(Ee);return t.length?t:e.filter(Ee)}function Te(e){return[...new Set(Ne(e).flatMap(Object.keys))]}function Ie(e,t){const r=e.length,a=t.length,i=new Array(a+1);for(let e=0;e<=a;e++)i[e]=e;for(let o=1;o<=r;o++){let r=i[0];i[0]=o;for(let n=1;n<=a;n++){const a=i[n];i[n]=e[o-1]===t[n-1]?r:1+Math.min(r,i[n],i[n-1]),r=a}}return i[a]}function Oe(e,t,r=3){let a,i=r+1;for(const r of t){const t=Ie(e.toLowerCase(),r.toLowerCase());t<i&&(i=t,a=r)}return i<=r?a:void 0}function Me(e,t){if(0===t.length)return null;const r=e.toLowerCase();return t.find(e=>Math.min(e.length,r.length)>=3&&(e.toLowerCase().includes(r)||r.includes(e.toLowerCase())))||(Oe(e,t,Math.min(3,Math.floor(e.length/2)))??null)}function je(e){return` Or use a function: ${e}={d => d.myValue}.`}function Fe(e,t,r,a){if(!r)return null;const i=[...new Set(t.flatMap(Object.keys))];for(const[t,o]of Object.entries(r))if(o&&"string"==typeof o&&!i.includes(o)){const r=Me(o,i),n=r?` Try ${t}="${r}".`:"";return`${e}: ${t} "${o}" not found in ${a}. Available fields: ${i.join(", ")}.${n}`+je(t)}return null}function ze({componentName:e,data:t,accessors:r,requiredProps:a}){if(a)for(const[t,r]of Object.entries(a))if(null==r)return`${e}: ${t} is required. Provide a field name or function.`;if(null==t)return null;if(!Array.isArray(t)&&"object"==typeof t)return`${e}: data should be an array, but received an object. If this is hierarchical data, use TreeDiagram, Treemap, or CirclePack instead.`;if(!Array.isArray(t)||0===t.length)return`${e}: No data provided. Pass a non-empty array to the data prop.`;const i=Ne(t);return i.length?Fe(e,i,r,"data"):`${e}: No data records provided. Pass a non-empty array of objects to the data prop.`}function Le({componentName:e,data:t,dataLabel:r="data"}){return null==t?`${e}: No ${r} provided. Pass a hierarchical object with children: { name: "root", children: [...] }.`:Array.isArray(t)?`${e}: ${r} should be a single root object, not an array. Expected: { name: "root", children: [...] }. If you have flat data, use LineChart, BarChart, or Scatterplot instead.`:Ee(t)?null:`${e}: ${r} should be a hierarchical object with children: { name: "root", children: [...] }.`}function Be({componentName:e,nodes:t,edges:r,nodesRequired:a=!1,edgesRequired:i=!0,accessors:o}){if(null==t&&null==r)return null;if(i&&(!r||!Array.isArray(r)||0===r.length))return`${e}: No edges provided. Pass a non-empty array: edges={[{ source: "A", target: "B", value: 10 }, ...]}.`;if(a&&(!t||!Array.isArray(t)||0===t.length))return`${e}: No nodes provided. Pass a non-empty array: nodes={[{ id: "A" }, { id: "B" }, ...]}.`;for(const[a,i]of[["nodes",t],["edges",r]])if(null!=i&&(!Array.isArray(i)||i.length>0&&!Ne(i).length))return`${e}: ${a} should be an array containing data records.`;return o&&t&&t.length>0?Fe(e,Ne(t),o,"node data"):null}function De(e){return Cl.has(e)}function _e(e){const[t,r]=Array.isArray(e)?e:[e,void 0],a=kl[t],i=Array.isArray(a)?[...a]:a;return void 0===r?{type:i}:{type:i,enum:[...Rl[r]]}}function Ue(){return Object.fromEntries(El.map(([e,t,r,a,i],o)=>[$l[o],{required:[...e],dataShape:t,dataAccessors:[...r],props:Object.fromEntries(Object.entries(Object.assign({},...a.map(e=>Pl[e]),i)).map(([e,t])=>[e,_e(t)]))}]))}function Ge(e){if(!Array.isArray(e))return[];const t=[];return e.forEach((e,r)=>{if(e&&"object"==typeof e&&!Array.isArray(e))for(const a of Object.keys(e)){if(Ol(a))continue;const i=e.orient;t.push({index:r,..."string"==typeof i&&{orient:i},key:a,suggestion:Oe(a,Il)})}}),t}function Ve(e,t){const r=Array.isArray(t)?t:[t],a=Array.isArray(e)?"array":typeof e;return r.includes(a)}function He(e,t){return"mechanical"===t.mode&&("GaltonBoardChart"===e||"UnitPileChart"===e)}function We(e){if(!Array.isArray(e.thresholds))return[];const t=[];return 0===e.thresholds.length&&t.push('"thresholds" for GaugeChart must contain at least one { value, color, label? } object.'),e.thresholds.forEach((e,r)=>{if(!e||"object"!=typeof e||Array.isArray(e))return void t.push(`"thresholds[${r}]" for GaugeChart should be an object with numeric "value" and string "color".`);const a=e;"number"==typeof a.value&&Number.isFinite(a.value)||t.push(`"thresholds[${r}].value" is required for GaugeChart and must be a finite number. BigNumber's "at" threshold key is not supported here.`),"string"==typeof a.color&&0!==a.color.length||t.push(`"thresholds[${r}].color" is required for GaugeChart and must be a non-empty string.`),void 0!==a.label&&"string"!=typeof a.label&&t.push(`"thresholds[${r}].label" for GaugeChart should be a string.`);const i=Object.keys(a).filter(e=>"value"!==e&&"color"!==e&&"label"!==e);i.length>0&&t.push(`"thresholds[${r}]" has unsupported GaugeChart key(s): ${i.join(", ")}. Use { value, color, label? }; { at, level } belongs to BigNumber.`)}),t}function qe(e){const t=e.frameProps;return null==t||"object"!=typeof t||Array.isArray(t)?[]:[...Ye(t.axes,"frameProps.axes"),...Ke(t)]}function Ye(e,t){return Ge(e).map(({index:e,key:r,suggestion:a})=>`Unknown "${t}[${e}]" key "${r}" is ignored.`+(a?` Did you mean "${a}"?`:""))}function Ke(e){const t=e.legendLayout;if(null==t||"object"!=typeof t||Array.isArray(t))return null==t?[]:['"frameProps.legendLayout" should be object, got '+(Array.isArray(t)?"array":typeof t)+"."];const r=[],a=t,i=/* @__PURE__ */new Set(["align",...Object.keys(jl)]);for(const e of Object.keys(a))i.has(e)||r.push(`Unknown "frameProps.legendLayout" key "${e}". Valid keys: ${[...i].join(", ")}.`);void 0!==a.align&&"string"!=typeof a.align?r.push(`"frameProps.legendLayout.align" should be string, got ${Array.isArray(a.align)?"array":typeof a.align}.`):"string"!=typeof a.align||Ml.has(a.align)||r.push(`"frameProps.legendLayout.align" value "${a.align}" is not valid. Expected one of: ${[...Ml].join(", ")}.`);for(const[e,t]of Object.entries(jl)){const i=a[e];void 0!==i&&("number"==typeof i&&Number.isFinite(i)?i<t.minimum&&r.push(`"frameProps.legendLayout.${e}" should be ${t.label} (minimum ${t.minimum}), got ${i}.`):r.push(`"frameProps.legendLayout.${e}" should be ${t.label}, got ${Array.isArray(i)?"array":typeof i}.`))}return r}function Je(e,t){const r=[];null!=t&&"object"==typeof t||(t={});const a=Tl[e];if(!a)return{valid:!1,errors:[`Unknown component "${e}". Valid components: ${Object.keys(Tl).join(", ")}`]};for(const i of a.required)void 0!==t[i]&&null!==t[i]||r.push(`"${i}" is required for ${e}.`);"array"!==a.dataShape||!Object.prototype.hasOwnProperty.call(a.props,"data")||a.required.includes("data")||He(e,t)||void 0!==t.data&&null!==t.data||r.push(`"data" is required for ${e}.`);for(const[e,i]of Object.entries(t)){if(null==i)continue;const t=Object.prototype.hasOwnProperty.call(a.props,e)?a.props[e]:void 0;if(t){if(!Ve(i,t.type)){const a=Array.isArray(t.type)?t.type.join(" | "):t.type;r.push(`"${e}" should be ${a}, got ${Array.isArray(i)?"array":typeof i}.`);continue}"width"!==e&&"height"!==e||"number"==typeof i&&Number.isFinite(i)&&!(i<=0)||r.push(`"${e}" must be a finite positive number.`),"size"!==e||!Array.isArray(i)||2===i.length&&Array.from(i).every(e=>"number"==typeof e&&Number.isFinite(e)&&e>0)||r.push('"size" must contain two finite positive dimensions.'),t.enum&&"string"==typeof i&&!t.enum.includes(i)&&r.push(`"${e}" value "${i}" is not valid. Expected one of: ${t.enum.join(", ")}.`)}}const i=Object.keys(a.props),o=new Set(i);for(const a of Object.keys(t))if(void 0!==t[a]&&!o.has(a)){const t=Oe(a,i),o=t?`Unknown prop "${a}" for ${e}. Did you mean "${t}"?`:`Unknown prop "${a}" for ${e}. Valid props: ${i.join(", ")}.`;r.push(o)}if(o.has("axes")&&r.push(...Ye(t.axes,"axes")),"array"===a.dataShape){const i=t.data,o={};for(const e of a.dataAccessors){const r=t[e];"string"==typeof r&&(o[e]=r)}const n=ze({componentName:e,data:i,accessors:Object.keys(o).length>0?o:void 0});n&&r.push(n)}else if("object"===a.dataShape){const a=Le({componentName:e,data:t.data});a&&r.push(a)}else if("network"===a.dataShape){const i=t.nodeIdAccessor??t.nodeIDAccessor??"id",o="string"==typeof i?{nodeIdAccessor:i}:void 0,n=Be({componentName:e,nodes:t.nodes,edges:t.edges,nodesRequired:a.required.includes("nodes"),edgesRequired:a.required.includes("edges"),accessors:o});n&&r.push(n)}return"GaugeChart"===e&&r.push(...We(t)),"ScatterplotMatrix"===e&&null!=t.frameProps&&r.push('"frameProps" is not supported for ScatterplotMatrix; configure its matrix props directly.'),r.push(...qe(t)),{valid:0===r.length,errors:r}}function Xe(e){function t(){r=r+1831565813|0;let e=Math.imul(r^r>>>15,1|r);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}let r=e>>>0;return t.getState=()=>r>>>0,t}function Ze(e){if(null==e)return null;const t=e;return t.data??t.datum??e}function Qe(e){const t=Number(e);return Number.isFinite(t)?Math.max(0,t):0}function et(e,t={}){const r=[],a=e.tokenSemantics,i=e.countStrategy,o=t.maxRecommendedTokens??("fixed-denominator"===i&&Qe(e.denominator)<=zl?zl:Fl);return a||r.push({code:"TOKEN_SEMANTICS_UNCLEAR",severity:"warning",message:"Every tokenized encoding should state what one token represents."}),i||r.push({code:"MISSING_COUNT_STRATEGY",severity:"warning",message:"Every tokenized encoding should state how token counts are produced."}),"icon"!==e.tokenType&&"glyph"!==e.tokenType||"icon-only"!==e.labelPolicy&&"token-only"!==e.labelPolicy||r.push({code:"ICON_ONLY_LABELS",severity:"warning",message:"Icons should supplement text labels, not replace them."}),null!=t.visibleTokens&&t.visibleTokens>o&&r.push({code:"TOO_MANY_VISIBLE_TOKENS",severity:"warning",message:`This encoding renders ${t.visibleTokens} visible tokens. Consider unitizing, sampling, or a hybrid bar/token view.`}),"decorative"!==a||"icon"!==e.tokenType&&"glyph"!==e.tokenType||r.push({code:"DECORATIVE_PICTOGRAPHS",severity:"warning",message:"Decorative pictographs can harm recall and speed when they do not clarify the data."}),"unitized-measure"===a&&i&&"unitized"!==i&&r.push({code:"TOKEN_STRATEGY_MISMATCH",severity:"warning",message:"Unitized measures should use the unitized count strategy so each token has a stable value."}),"risk-case"===a&&i&&"fixed-denominator"!==i&&r.push({code:"TOKEN_STRATEGY_MISMATCH",severity:"warning",message:"Risk cases are usually clearest as a fixed-denominator natural frequency."}),"possible-outcome"!==a&&"posterior-sample"!==a&&"hypothetical-case"!==a||!i||"quantile"===i||"sample"===i||"posterior-sample"===i||"random-sample"===i||r.push({code:"TOKEN_STRATEGY_MISMATCH",severity:"warning",message:"Outcome/sample tokens should come from quantiles or samples, not from a unitized magnitude."}),"unitized-measure"===a&&"unitized"===i&&null==e.unitValue&&null==e.unit&&r.push({code:"MISSING_UNIT_VALUE",severity:"warning",message:"Unitized measures should set unitValue so each token has a declared value."}),"unitized-measure"!==a||"unitized"!==i||e.unitMeaning||r.push({code:"MISSING_UNIT_MEANING",severity:"info",message:"Add unitMeaning so readers know what one full token represents."}),r}function tt(e){return"string"==typeof e?.type?e.type:""}function rt(e){return!!e&&"object"==typeof e&&nu.has(tt(e))}function at(e){return Array.isArray(e?.disable)&&e.disable.includes("connector")}function it(e){return su.has(tt(e))&&!at(e)}function ot(e,t,r={}){if("number"==typeof r.maxAnnotations&&Number.isFinite(r.maxAnnotations))return Math.max(0,Math.floor(r.maxAnnotations));if(!(e>0&&t>0))return 1/0;const a=r.areaPerAnnotation&&r.areaPerAnnotation>0?r.areaPerAnnotation:cu;return Math.max(1,Math.round(e*t/a))}function nt(e){const t=e.provenance,r=e.id??e.stableId??t?.stableId;return null==r||""===r?void 0:String(r)}function st(e){return e.length<=5?1:2}function ct(e,{dataKeys:t=[],accessorFields:r=[]}={}){if(!Array.isArray(e))return[];const a=/* @__PURE__ */new Set([...t,...r]),i=[];return e.forEach((e,t)=>{if(e&&"object"==typeof e&&!Array.isArray(e))for(const r of Object.keys(e)){if(uu.has(r)||a.has(r)||r.startsWith("_")||r.length<3)continue;let o,n=st(r)+1;for(const e of lu){const t=Ie(r.toLowerCase(),e.toLowerCase());t<n&&(o=e,n=t)}if(!o)continue;const s=e.type;i.push({index:t,type:"string"==typeof s?s:"",key:r,suggestion:o})}}),i}function lt(e,t,r){const a=Array.isArray(t.annotations)?t.annotations:null;if(a)for(const e of a)e&&"object"==typeof e&&"widget"===tt(e)&&null!=e.content&&!nt(e)&&r.push({severity:"warning",code:"ANNOTATION_INTERACTIVE_ID",message:"An interactive widget annotation has no stable id, so its activation cannot be normalized or replayed reliably.",fix:"Add id, stableId, or provenance.stableId to the widget annotation. Do not identify interactive annotations by array index."})}function ut(e,t,r){const a=Array.isArray(t.annotations)?t.annotations:null;if(a)for(const e of a){if(!e||"object"!=typeof e)continue;const t=tt(e);if(!rt(e)||"widget"===t)continue;const a="number"==typeof e.dx?e.dx:0,i="number"==typeof e.dy?e.dy:0,o=Math.hypot(a,i),n="string"==typeof e.label?e.label:"string"==typeof e.title?e.title:t,s=it(e);!s&&o>du?r.push({severity:"warning",code:"ANNOTATION_FAR_NO_CONNECTOR",message:`Annotation "${n}" sits ~${Math.round(o)}px from its anchor with no connector — a reader can't tell what it refers to.`,fix:'Add a connector (connector: { end: "arrow" }, the label/callout default) or place the note adjacent to its target (smaller dx/dy).'}):s&&o>hu&&r.push({severity:"warning",code:"ANNOTATION_LONG_CONNECTOR",message:`Annotation "${n}" uses a very long connector (~${Math.round(o)}px); prefer placing the note adjacent to its target when space allows.`,fix:"Reduce dx/dy so the note sits near its target, or keep the long connector only if proximity is genuinely infeasible."})}}function dt(e,t,r){const a=Array.isArray(t.annotations)?t.annotations:null;if(!a)return;const i=a.filter(rt).length;if(0===i)return;const o="number"==typeof t.width?t.width:600,n="number"==typeof t.height?t.height:400,s=ot(o,n);!Number.isFinite(s)||i<=s||r.push({severity:"warning",code:"ANNOTATION_DENSITY",message:`${i} note annotations on a ${o}×${n} chart exceed the ~${s} notes the plot area carries comfortably — the chart may read as cluttered.`,fix:'Mark the essential notes emphasis: "primary" and let density management shed the rest (autoPlaceAnnotations: { density: true }), enable progressive disclosure to reveal secondary notes on hover, or give the chart more room.'})}function ht(e,t,r){if(!Array.isArray(t.annotations)||0===t.annotations.length)return;const a=/* @__PURE__ */new Set;for(const e of[t.data,t.nodes,t.edges,t.points,t.areas])if(Array.isArray(e))for(const t of e)if(t&&"object"==typeof t)for(const e of Object.keys(t))a.add(e);const i=Object.entries(t).filter(([e,t])=>/Accessor$|By$/.test(e)&&"string"==typeof t).map(([,e])=>e);for(const e of ct(t.annotations,{dataKeys:a,accessorFields:i})){const t=e.type?` ${e.type}`:"";r.push({severity:"warning",code:"ANNOTATION_UNKNOWN_FIELD",message:`annotations[${e.index}]${t} has an unknown field "${e.key}", which no renderer reads.`,fix:`Did you mean "${e.suggestion}"? Rename the field; unknown annotation fields are ignored.`})}}function pt(e,t,r){for(const e of pu){const a=t[e];if(!Array.isArray(a)||a.length<2)continue;const[i,o]=a;"number"==typeof i&&"number"==typeof o&&i>o&&r.push({severity:"warning",code:"INVERTED_AXIS",message:`${e}=[${i}, ${o}] is descending — the axis renders inverted, so "up" reads as less. Inverted axes are a classic misleading-design pattern unless the inversion is the point.`,fix:`Order the extent ascending (${e}={[${o}, ${i}]}). If the inversion is deliberate (e.g. rank #1 at top), say so in the title or an annotation so readers aren't misled.`})}}function ft(e,t,r){if("MultiAxisLineChart"!==e)return;const a=t.series;if(!Array.isArray(a)||2!==a.length)return;const i=a.filter(e=>!e||"object"!=typeof e||"string"!=typeof e.label||0===e.label.trim().length);i.length>0&&r.push({severity:"warning",code:"DUAL_AXIS_UNLABELED",message:`Dual-axis chart with ${i.length} unlabeled series. Two y-scales invite false equivalence between the lines; without per-series labels a reader can't tell which scale is whose.`,fix:'Give every series a label: series={[{ yAccessor: "a", label: "Revenue ($)" }, { yAccessor: "b", label: "Users" }]} — and consider whether two separate charts read more honestly.'})}function mt(e,t,r){if(!_l.has(e))return;const a=t.xExtent;if(!Array.isArray(a)||a.length<2)return;const[i,o]=a;if("number"!=typeof i||"number"!=typeof o||i>=o)return;const n=t.data;if(!n||!Array.isArray(n)||n.length<4)return;const s=t.xAccessor??"x";if("string"!=typeof s)return;let c=1/0,l=-1/0;for(const e of n){const t=e?.[s];"number"==typeof t&&Number.isFinite(t)&&(t<c&&(c=t),t>l&&(l=t))}if(!Number.isFinite(c)||!Number.isFinite(l)||l<=c)return;const u=l-c,d=Math.max(0,Math.min(o,l)-Math.max(i,c))/u;d<.7&&r.push({severity:"warning",code:"CHERRY_PICKED_WINDOW",message:`xExtent=[${i}, ${o}] shows only ~${Math.round(100*d)}% of the data's x range [${c}, ${l}] — a trend cropped to a favorable window is a classic misleading-design pattern.`,fix:'Widen xExtent to cover the data, filter the data itself so the chart shows what it has, or annotate the visible window ("Q4 only") so the cropping is explicit.'})}function gt(e,t,r){const a=Hl[e],i=ql[e];if(!a&&!i)return;if(i&&!t.normalize)return;const o=a??i,n=t[o],s="string"==typeof n?n:"yAccessor"===o?"y":"value",c=t.data;if(!c||!Array.isArray(c)||0===c.length)return;const l=c.filter(e=>{const t=e?.[s];return"number"==typeof t&&t<0});l.length>0&&r.push({severity:a?"error":"warning",code:"PART_TO_WHOLE_NEGATIVE",message:`${l.length} negative value(s) in "${s}" — a part-to-whole encoding cannot represent negative parts${a?"; slice angles/areas for negatives are meaningless":"; normalized shares distort when parts are negative"}.`,fix:a?"Filter or transform negative values first, or switch to a BarChart/WaterfallChart, which encode signed values honestly.":"Drop normalize for signed data, or use a diverging BarChart so negative contributions read as negative."})}function yt(e,t,r){Gl.has(e)&&"basis"===t.curve&&r.push({severity:"warning",code:"NON_PASSING_CURVE",message:'curve="basis" draws a B-spline that does NOT pass through your data points — rendered values differ from actual values everywhere except the endpoints.',fix:'Use curve="monotoneX" or curve="catmullRom" (both interpolate through every point), or keep "basis" only for deliberately schematic, clearly-labeled smoothing.'})}function bt(e,t,r){if("LineChart"!==e&&"AreaChart"!==e)return;if("sparkline"===t.mode)return;if(t.responsiveWidth||t.responsiveHeight)return;const a="number"==typeof t.width?t.width:600,i="number"==typeof t.height?t.height:400;if(a<=0||i<=0)return;const o=a/i;if(o>8||o<.25){const e=o>8?"flattens":"exaggerates";r.push({severity:"warning",code:"EXTREME_ASPECT_RATIO",message:`${a}×${i} (${o.toFixed(1)}:1) is an extreme aspect ratio that ${e} the slopes a reader perceives — aspect-ratio distortion is a documented misleading-design pattern.`,fix:o>8?'Use a more balanced aspect (e.g. width/height between 1 and 3), or set mode="sparkline" if this is genuinely a sparkline strip.':"Use a more balanced aspect (e.g. width/height between 1 and 3); very tall trend charts overstate every change."})}}function vt(e,t,r){if(!Vl.has(e))return;const a=t.data;if(!a||!Array.isArray(a)||0===a.length)return;const i=t.categoryAccessor,o="string"==typeof i?i:"category",n=/* @__PURE__ */new Set;for(const e of a){const t=e?.[o];null!=t&&n.add(t)}n.size>fu&&r.push({severity:"warning",code:"PIE_TOO_MANY_SLICES",message:`${n.size} slices — angle judgments degrade rapidly past ~${fu} categories (Cleveland & McGill), and thin slices become unreadable and unlabelable.`,fix:`Use a BarChart or DotPlot for ${n.size} categories, or group the long tail into an "Other" slice before charting.`})}function wt(e,t,r){if(!Bl.has(e)&&!Ll.has(e)&&!/^(Process|Network)(Sankey|CustomChart)$/.test(e))return;const a=t.perspective;"ProcessSankey"===e&&a&&"flat"!==a&&"flat"!==a.type&&r.push({severity:"warning",code:"PERSPECTIVE_MEASURED_POSITION",message:"ProcessSankey positions flows on a time axis; perspective foreshortens it, so equal durations stop looking equal.",fix:"Keep ProcessSankey flat when readers compare durations, or pair it with a flat view."}),void 0!==t.projection&&r.push({severity:"warning",code:"NETWORK_PROJECTION_PROP",message:`${e} has no projection prop (that is the geo map projection).`,fix:'Use perspective instead, e.g. perspective="isometric".'})}function At(e,t,r){return"function"==typeof r?r(e,t):e[r]}function xt(e){if(e instanceof Date){const t=e.getTime();return Number.isFinite(t)?t:null}const t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:null}function $t(e,t){const r=xt(e);return null!=r&&r>0?r:t}function Ct(e){if(!e)return;const t=xt(e[0]),r=xt(e[1]);return null!=t&&null!=r?t<=r?[t,r]:[r,t]:void 0}function St(e={}){const t=(e.categories?.length?e.categories:["Intake","Review","Build","Ship"]).map(e=>String(e).trim()).filter(Boolean),r=t.length?t:["Intake"],a=Math.max(r.length,Math.round(e.count??Math.max(48,12*r.length))),i=$t(e.unitValue,1),o=Xe(e.seed??1),n=e.idPrefix??"mechanical-pile",s=r.map(()=>.65+.9*o()),c=s.reduce((e,t)=>e+t,0)||1,l=a-r.length,u=s.map(e=>e/c*l),d=u.map(e=>1+Math.floor(e));let h=a-d.reduce((e,t)=>e+t,0);const p=u.map((e,t)=>({index:t,fraction:e-Math.floor(e)})).sort((e,t)=>t.fraction-e.fraction);for(let e=0;h>0;e=(e+1)%p.length)d[p[e].index]+=1,h-=1;return r.map((e,t)=>({id:`${n}-${t}`,category:e,value:d[t]*i,mechanical:!0,unitCount:d[t],unitValue:i,share:d[t]/a}))}function kt(e,t){const r=e/t,a=Math.round(r);return Math.ceil(a>0&&Math.abs(r-a)<=Number.EPSILON*r*4?a:r)}function Rt(e,t,r=0){const a=new Set(e.filter(e=>null!=e.id).map(e=>String(e.id))),i=/* @__PURE__ */new Map;for(const o of e){let e=null==o.id?`${t}-${r++}`:String(o.id);for(;null==o.id&&a.has(e);)e=`${t}-${r++}`;a.add(e),i.set(e,null==o.id?{...o,id:e}:o)}return{seed:e,rows:Array.from(i.values()),nextId:r}}function Pt(e){const t=e instanceof Date?e.getTime():Number(e);return Number.isFinite(t)?t:null}function Et(e,t,r){if("function"==typeof t)return t(e);const a="string"==typeof t?t:r;return e?.[a]}function Nt(e,t,r){if(eu.has(e)){if([t.bodyStyle?.glyph,t.frameProps?.bodyStyle?.glyph,...Array.isArray(t.styleRules)?t.styleRules.map(e=>e.style?.glyph):[],...Array.isArray(t.sources)?t.sources.map(e=>e.glyph):[]].some(e=>{const t=e&&"object"==typeof e?e.viewBox:void 0;return Array.isArray(t)&&t[0]>0&&t[1]>0&&Math.max(t[0]/t[1],t[1]/t[0])>1.5})&&r.push({severity:"warning",code:"PHYSICS_GLYPH_ASPECT_RATIO",message:"A physics glyph has aspect ratio above 1.5; its visual bounds differ substantially from the circular collider.",fix:"Use a compact glyph or matching custom collision geometry. Glyphs change paint only, including in settled SVG."}),["GaltonBoardChart","UnitPileChart","EventDropChart","CollisionSwarmChart"].includes(e)&&Array.isArray(t.data)){const e=/* @__PURE__ */new Set;let a=0;for(const r of t.data){if(null==r?.id)continue;const t=String(r.id);e.has(t)&&a++,e.add(t)}a&&r.push({severity:"warning",code:"PHYSICS_DUPLICATE_IDS",message:`${a} physics source rows are replaced by later rows with the same id. Source IDs use upsert semantics, including push and update.`,fix:"Assign a unique id to each observation (rather than each entity), or omit id to retain every row."})}if("GaltonBoardChart"===e){const e=t.bins;null!=e&&(!Number.isInteger(e)||e<1)&&r.push({severity:"error",code:"PHYSICS_BAD_BINS",message:`bins=${e} is normalized to a finite positive integer by the Galton builder.`,fix:"Use a positive integer; 8-24 bins is a practical range for physics distributions."});const a=Pt(t.branchProbability);null!=t.branchProbability&&(null==a||a<0||a>1)&&r.push({severity:"error",code:"PHYSICS_BAD_BRANCH_PROBABILITY",message:`branchProbability=${String(t.branchProbability)} must be between 0 and 1.`,fix:"Use branchProbability={0.5} for a balanced Galton board, or bias it within the [0, 1] range."});const i=Pt(t.mechanicalCount);null!=t.mechanicalCount&&(null==i||i<=0)&&r.push({severity:"error",code:"PHYSICS_BAD_MECHANICAL_COUNT",message:`mechanicalCount=${String(t.mechanicalCount)} cannot generate a mechanical Galton board.`,fix:"Use a positive mechanicalCount, for example 96."})}if("EventDropChart"===e){const e=t.windows,a=e&&"object"==typeof e?Pt(e.size):null;null!=a&&a<=0&&r.push({severity:"error",code:"PHYSICS_BAD_WINDOW_SIZE",message:`windows.size=${a} cannot form event-time barriers.`,fix:"Set windows={{ size: positiveNumber }} so each event can settle into a real time window."}),"number"==typeof t.timeScale&&t.timeScale<=0&&r.push({severity:"error",code:"PHYSICS_BAD_TIME_SCALE",message:`timeScale=${t.timeScale} prevents arrival replay from advancing.`,fix:"Use a positive timeScale, or omit it for the default pace."});const i=Array.isArray(t.data)?t.data:[];if(i.length>0){const e=t.timeAccessor||"time",a=t.arrivalAccessor||"arrivalTime";i.some(t=>{const r=Pt(Et(t,e,"time")),i=Pt(Et(t,a,"arrivalTime"));return null!=r&&null!=i&&r!==i})||r.push({severity:"warning",code:"PHYSICS_EVENTDROP_NO_ARRIVAL_SPREAD",message:"EventDropChart data does not show distinct arrival times, so the physics replay collapses to event order.",fix:"Provide an arrivalAccessor field with event-arrival times when demonstrating lateness, watermarks, or out-of-order streams."})}}if("UnitPileChart"===e){const e="mechanical"===(t.simulationMode??t.mode),a=Pt(t.mechanicalCount);null!=t.mechanicalCount&&(null==a||a<=0)&&r.push({severity:"error",code:"PHYSICS_BAD_MECHANICAL_COUNT",message:`mechanicalCount=${String(t.mechanicalCount)} cannot generate a mechanical pile chart.`,fix:"Use a positive mechanicalCount, for example 80."}),e&&Array.isArray(t.mechanicalCategories)&&0===t.mechanicalCategories.length&&r.push({severity:"error",code:"PHYSICS_EMPTY_MECHANICAL_CATEGORIES",message:"mechanicalCategories=[] leaves no containers for the generated unit pile.",fix:"Provide at least one category label, or omit mechanicalCategories for the default set."});const i=xt(t.unitValue??1);if(null==i||i<=0)return void r.push({severity:"error",code:"PHYSICS_BAD_UNIT_VALUE",message:`unitValue=${t.unitValue} cannot unitize values into physical bodies.`,fix:"Set unitValue to a positive number represented by one body."});const o=e?St({count:a??void 0,categories:Array.isArray(t.mechanicalCategories)?t.mechanicalCategories:void 0,seed:xt(t.seed)??1,unitValue:i}):Array.isArray(t.data)?t.data:[],{rows:n}=Rt(o,"pile"),s=t.valueAccessor??(e?"value":void 0),c=n.reduce((e,t,r)=>{const a="function"==typeof s?s(t,r):"string"==typeof s&&s?t[s]:1;return e+kt(Math.max(0,xt(a)??0),i)},0);c>1500&&r.push({severity:"warning",code:"PHYSICS_BODY_BUDGET",message:`UnitPileChart would create about ${c} live bodies; motion may dominate the chart and stress the frame budget.`,fix:"Sample or aggregate source records, or use a bounded window with sediment. A larger unitValue reduces full circles but still leaves at least one body per positive source record."})}if("CollisionSwarmChart"===e){if((Pt(t.pointRadius??5)??5)<=0&&r.push({severity:"error",code:"PHYSICS_BAD_POINT_RADIUS",message:`pointRadius=${t.pointRadius} cannot produce collision bodies.`,fix:"Use a positive pointRadius, for example 5."}),(Pt(t.collisionIterations??6)??6)<=0&&r.push({severity:"error",code:"PHYSICS_BAD_COLLISION_ITERATIONS",message:`collisionIterations=${t.collisionIterations} disables collision relaxation.`,fix:"Use at least one collision iteration; 4-8 is a practical range for swarms."}),null!=t.xExtent){const e=Array.isArray(t.xExtent)?t.xExtent:[],a=Pt(e[0]),i=Pt(e[1]);(e.length<2||null==a||null==i)&&r.push({severity:"error",code:"PHYSICS_BAD_X_EXTENT",message:"xExtent must be a numeric [min, max] pair for CollisionSwarmChart.",fix:"Pass xExtent={[min, max]} or omit it so the chart infers the domain from data."})}const e=Array.isArray(t.data)?t.data:[];e.length>1200&&r.push({severity:"warning",code:"PHYSICS_BODY_BUDGET",message:`CollisionSwarmChart would create ${e.length} live bodies; collision relaxation may dominate the frame budget.`,fix:"Sample, aggregate, reduce point radius, or move to a static SwarmPlot when every row does not need a physical body."});const a=t.groupAccessor;if(e.length>0&&a){const t=/* @__PURE__ */new Set;for(const r of e){const e=Et(r,a,"group");null!=e&&t.add(e)}t.size>12&&r.push({severity:"warning",code:"PHYSICS_TOO_MANY_SWARM_LANES",message:`CollisionSwarmChart has ${t.size} group lanes, which leaves little vertical room for collision separation.`,fix:"Facet or filter groups, or use an ordinary SwarmPlot/BoxPlot for dense grouped comparison."})}}if("GaltonBoardChart"!==e&&"UnitPileChart"!==e&&"CollisionSwarmChart"!==e&&"ProcessFlowChart"!==e&&"EventDropChart"!==e||(null!=t.massBy||null!=t.massAccessor||t.frameProps&&"object"==typeof t.frameProps&&null!=t.frameProps.bodyMassBy)&&r.push({severity:"warning",code:"PHYSICS_DATA_IN_DYNAMICS",message:`${e} appears to map a data field to mass/dynamics. Mass is not a readable quantitative channel.`,fix:"Encode quantities in spawn position, bin, size, color, or glyph — keep mass/friction/restitution as process texture. Use showProjection for the truth layer."}),"UnitPileChart"!==e&&"GaltonBoardChart"!==e&&"CollisionSwarmChart"!==e&&"ProcessFlowChart"!==e&&"CrucibleChart"!==e||!1!==t.showProjection||r.push({severity:"warning",code:"PHYSICS_NO_PROJECTION",message:`${e} has showProjection={false}. Without a settled projection, motion is easy to over-read as data.`,fix:"Keep showProjection enabled (default) so the chart collapses to a legible static reading, or document why the process alone is the claim."}),"ProcessFlowChart"===e){const e=Array.isArray(t.stages)?t.stages:[];if(0===e.length)r.push({severity:"error",code:"PROCESS_FLOW_MISSING_STAGES",message:"ProcessFlowChart requires a non-empty stages array.",fix:'Provide stages={[{ id: "coding", force: 12 }, { id: "merged", absorb: true }]}.'});else{e.some(e=>!e||null==e.id||""===String(e.id).trim())&&r.push({severity:"error",code:"PROCESS_FLOW_BAD_STAGE",message:"Every ProcessFlowChart stage needs a stable id.",fix:'Use stages like { id: "review", label: "Review", capacity: { unitsPerSecond: 4 } }.'});const a=e.filter(e=>e?.absorb).length;t.groupBy&&0===a&&r.push({severity:"warning",code:"PROCESS_FLOW_GROUP_NO_ABSORB",message:"groupBy is set but no stage has absorb: true, so all-members completion cannot resolve.",fix:'Mark a terminal stage with absorb: true (e.g. merged), or set groupCompletion="none".'})}}if("GauntletChart"===e&&(Array.isArray(t.negativeProperties)||r.push({severity:"warning",code:"GAUNTLET_MISSING_NEGATIVE_PROPERTIES",message:"GauntletChart usually needs negativeProperties for drag/cost bodies (empty array is ok if intentional).",fix:'Provide negativeProperties={[{ id: "cost", label: "Cost", load: 1 }]} or explicitly pass [].'})),"CrucibleChart"===e){const e=Array.isArray(t.phases)?t.phases:[],a=Array.isArray(t.products)?t.products:[],i=Array.isArray(t.events)?t.events:[],o=Array.isArray(t.outlets)?t.outlets:[];0===e.length?r.push({severity:"error",code:"CRUCIBLE_MISSING_PHASES",message:"CrucibleChart requires an authored, non-empty phases array; a treatment program cannot be inferred from flat data.",fix:'Provide phases={[{ id: "charge", label: "Charge", duration: 1, motion: "charge" }]}.'}):e.some(e=>!e||null==e.id||""===String(e.id).trim()||null==Pt(e.duration)||Number(e.duration)<=0)&&r.push({severity:"error",code:"CRUCIBLE_BAD_PHASE",message:"Every CrucibleChart phase needs a stable id and a positive finite duration.",fix:'Use phases like { id: "assay", label: "Assay", duration: 2, motion: "mix" }.'}),0===a.length&&r.push({severity:"warning",code:"CRUCIBLE_NO_PRODUCTS",message:"CrucibleChart has no declared product molds. Products are never discovered from collisions or source fields.",fix:'Declare products={[{ id: "accepted", label: "Accepted", outletId: "product" }]} when the treatment forms an output.'}),0===i.length&&r.push({severity:"warning",code:"CRUCIBLE_NO_EVENTS",message:"CrucibleChart has no authored events, so its phases cannot transform, combine, split, or route the charge.",fix:"Supply an explicit events array; do not ask the chart or an AI layer to infer a treatment from the rows."}),Array.isArray(t.outlets)||r.push({severity:"warning",code:"CRUCIBLE_IMPLICIT_OUTLETS",message:"CrucibleChart is using generic default outlets rather than domain-specific destinations.",fix:"Provide reason-labelled outlets and reference their ids from products, complete-product, and eject effects."});const n=new Set(a.map(e=>e?.id).filter(e=>null!=e).map(String)),s=/* @__PURE__ */new Set(["product","retained","residue","failed","recovered",...o.map(e=>e?.id).filter(e=>null!=e).map(String)]),c=/* @__PURE__ */new Set,l=/* @__PURE__ */new Set;for(const e of i)if(e&&Array.isArray(e.effects))for(const t of e.effects){if(!t||"object"!=typeof t)continue;const e=t.type;if("combine"!==e&&"contribute"!==e&&"complete-product"!==e||null==t.productId||n.has(String(t.productId))||c.add(String(t.productId)),"split"===e&&Array.isArray(t.products))for(const e of t.products)null==e?.productId||n.has(String(e.productId))||c.add(String(e.productId));null==t.outletId||s.has(String(t.outletId))||l.add(String(t.outletId))}c.size>0&&r.push({severity:"error",code:"CRUCIBLE_UNKNOWN_PRODUCT",message:`CrucibleChart events reference undeclared product molds: ${[...c].sort().join(", ")}.`,fix:"Declare every referenced product id in products; do not create product definitions implicitly inside events."}),l.size>0&&r.push({severity:"error",code:"CRUCIBLE_UNKNOWN_OUTLET",message:`CrucibleChart events reference undeclared outlets: ${[...l].sort().join(", ")}.`,fix:"Declare every domain outlet in outlets and reuse its stable id in authored effects."});const u=Pt(t.playbackRate);null!=t.playbackRate&&(null==u||u<=0)&&r.push({severity:"error",code:"CRUCIBLE_BAD_PLAYBACK_RATE",message:`playbackRate=${String(t.playbackRate)} cannot advance the authored CrucibleChart tape.`,fix:"Use a positive playbackRate such as 0.5 for half speed or 2 for double speed."});const d=Pt(t.rerunMS);null!=t.rerunMS&&(null==d||d<0)&&r.push({severity:"error",code:"CRUCIBLE_BAD_RERUN_MS",message:`rerunMS=${String(t.rerunMS)} must be a finite non-negative delay or null.`,fix:"Use rerunMS={3000}, rerunMS={0}, or omit the prop for a single run."})}if("GaltonBoardChart"===e||"CollisionSwarmChart"===e||"ProcessFlowChart"===e||"EventDropChart"===e||"CrucibleChart"===e){const a=Array.isArray(t.data)?t.data:[],i=Pt(t.mechanicalCount)??0,o=a.length>0?a.length:i;o>2500&&r.push({severity:"warning",code:"PHYSICS_BODY_BUDGET",message:`${e} may spawn ~${Math.round(o)} live bodies, which can overwhelm the simulation loop.`,fix:"Lower mechanicalCount / unitize with a larger unitValue, enable sediment/windowSize, or sample the data before spawn."})}}}function Tt(e){const t=e.trim();if(!t||!Number.isNaN(Number(t)))return NaN;const r=mu.exec(t);if(r){const e=Number(r[1]),t=Number(r[2])-1,a=Number(r[3]??1),i=/* @__PURE__ */new Date(0);return i.setUTCFullYear(e,t,a),i.getUTCFullYear()===e&&i.getUTCMonth()===t&&i.getUTCDate()===a?i.getTime():NaN}if(t.length<10)return NaN;const a=Date.parse(t);return Number.isFinite(a)?a:NaN}function It(e){if(e instanceof Date)return e.getTime();if("number"==typeof e)return Number.isFinite(e)?e:NaN;if("string"!=typeof e||!e.trim())return NaN;const t=e.trim(),r=Number(t);if(!Number.isNaN(r))return Number.isFinite(r)?r:NaN;if(/^\d{4}-\d{1,2}(?:-\d{1,2})?$/.test(t))return Tt(t);const a=/^(\d{4}-\d{2}-\d{2})[Tt ](\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)([Zz]|[+-]\d{2}:?\d{2})?$/.exec(t);return a&&Number.isFinite(Tt(a[1]))?Date.parse(`${a[1]}T${a[2]}${a[3]||"Z"}`):NaN}function Ot(e){const t=[],r=e.domain,a=Array.isArray(r)?It(r[0]):NaN,i=Array.isArray(r)?It(r[1]):NaN;null==r?t.push({severity:"error",code:"PROCESS_SANKEY_MISSING_DOMAIN",message:"ProcessSankey requires domain: [tStart, tEnd].",fix:"Pass domain={[start, end]} using numbers, Dates, numeric strings, or ISO date strings."}):Array.isArray(r)&&2===r.length&&Number.isFinite(a)&&Number.isFinite(i)&&!(a>i)||t.push({severity:"error",code:"PROCESS_SANKEY_BAD_DOMAIN",message:"domain must be a 2-tuple of finite times with start <= end.",fix:"Use domain={[t0, t1]} with t0 <= t1."});const o=e.edges;if(Array.isArray(o)&&o.length>0){const e=o[0];null!=e.startTime&&null!=e.endTime||t.push({severity:"warning",code:"PROCESS_SANKEY_EDGE_TIMES",message:"Edges should carry startTime and endTime for temporal layout.",fix:"Add startTime/endTime fields or set startTimeAccessor/endTimeAccessor."})}const n=e.nodes,s=Array.isArray(n)?n.length:0;return!0===e.showLabels&&s>=24&&t.push({severity:"warning",code:"PROCESS_SANKEY_LABEL_DENSITY",message:`showLabels={true} with ${s} nodes may overcrowd the plot.`,fix:'Use showLabels="auto" with optional labelPriorityAccessor / maxLabels.'}),(Array.isArray(o)?o.length:0)>=80&&null==e.layoutExecution&&"off"!==e.packing&&t.push({severity:"warning",code:"PROCESS_SANKEY_WORKER_HINT",message:"Dense ProcessSankey layouts benefit from worker packing/order.",fix:'layoutExecution defaults to "auto"; set layoutExecution="worker" or raise layoutWorkerThreshold deliberately.'}),t}function Mt(e,t){const r=e.nestedDataAccessorProp?t[e.nestedDataAccessorProp]:void 0;return"string"==typeof r?r:e.defaultNestedDataAccessor}function jt(e,t,r){const a=e.dataProp??"data",i=t[a],o=r??(Array.isArray(i)?i:[]),n=Mt(e,t);if(!n)return{dataProp:a,rows:o};const s=[];let c=!1;for(const e of o){const t=e?.[n];if(Array.isArray(t)){c=!0;for(const e of t)e&&"object"==typeof e&&s.push(e)}}return{dataProp:a,rows:c?s:o}}function Ft(e,t,r){const a=/* @__PURE__ */new Set;for(const i of e.fields){const e=i.dataProp??"data",o=r??t[e];if(!Array.isArray(o))continue;if(0===o.length){a.add(e);continue}const n=Mt(i,t);if(!n)continue;const s=o.map(e=>e?.[n]).filter(Array.isArray);s.length>0&&s.every(e=>0===e.length)&&a.add(`${e}.${n}`)}return[...a]}function zt(){const e=globalThis;return e[Nu]??(e[Nu]={contracts:/* @__PURE__ */new Map}),e[Nu]}function Lt(e){return zt().contracts.get(e)??Eu[e]}function Bt(e){if("number"==typeof e)return e;if("string"!=typeof e)return;const t=e.trim();return/^[+-]?nan$/i.test(t)?NaN:/^[+-]?Infinity$/.test(t)||/^[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?$/.test(t)&&!/^[+-]?0\d+$/.test(t)?Number(t):void 0}function Dt(e){return null==e||"string"==typeof e&&""===e.trim()}function _t(e,t,r){const a={numbers:r?[]:void 0,finite:0,min:1/0,max:-1/0,missing:0,nonFinite:0,nonNumeric:0,zero:0,negative:0,fractional:0};for(const r of e){const e=r&&Object.prototype.hasOwnProperty.call(r,t)?r[t]:void 0;if(Dt(e)){a.missing++;continue}const i=Bt(e);void 0!==i?Number.isFinite(i)?(a.numbers?.push(i),a.finite++,i<a.min&&(a.min=i),i>a.max&&(a.max=i),0===i&&a.zero++,i<0&&a.negative++,Number.isInteger(i)||a.fractional++):a.nonFinite++:a.nonNumeric++}return a}function Ut(e,t){if(0===e.length)return;const r=(e.length-1)*t,a=Math.floor(r),i=Math.ceil(r);if(a===i)return e[a];const o=r-a;return e[a]*(1-o)+e[i]*o}function Gt(e,t={}){if(!Array.isArray(e)||0===e.length)return{};const r=/* @__PURE__ */new Set;for(const t of e)if(t&&"object"==typeof t)for(const e of Object.keys(t))r.add(e);const a={};for(const i of r){const r=_t(e,i,!1!==t.quantiles),o=r.numbers?.sort((e,t)=>e-t);Object.defineProperty(a,i,{enumerable:!0,writable:!0,configurable:!0,value:{field:i,observedCount:e.length-r.missing,finiteCount:r.finite,missingCount:r.missing,nonFiniteCount:r.nonFinite,nonNumericCount:r.nonNumeric,zeroCount:r.zero,negativeCount:r.negative,fractionalCount:r.fractional,...r.finite>0?{min:r.min,...o?{q1:Ut(o,.25),median:Ut(o,.5),q3:Ut(o,.75)}:{},max:r.max}:{}}})}return a}function Vt(e){const t=e.ok?"✓ numerically safe":"✗ numeric hazards found",r=[`${e.component}: ${t}`,`${e.rowCount} rows · ${e.summary.fieldsChecked} numeric fields · ${e.summary.errors} errors · ${e.summary.warnings} warnings`];for(const t of e.diagnoses)r.push(`${"error"===t.severity?"ERROR":"WARN"} ${t.code}${t.field?` [${t.field}]`:""}: ${t.message}`),t.fix&&r.push(` Fix: ${t.fix}`);return r.join("\n")}function Ht(e){return e.code.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Wt(e,t={}){const r=Number.isFinite(t.max)?Math.max(0,Math.floor(t.max)):6,a=e.diagnoses.map((e,t)=>({item:e,diagnosisIndex:t})).filter(({item:e})=>!t.errorsOnly||"error"===e.severity),i=a.slice(0,r).map(({item:e,diagnosisIndex:t})=>({id:`data-audit:${e.code}:${e.role??"chart"}:${e.field??"chart"}:${t}`,level:e.severity,title:e.field?`${Ht(e)} · ${e.field}`:Ht(e),message:e.fix?`${e.message} ${e.fix}`:e.message,source:"Semiotic data audit",dismissible:!0}));return a.length>r&&i.push({id:"data-audit:overflow:chart",level:a.slice(r).some(({item:e})=>"error"===e.severity)?"error":"warning",title:`${a.length-r} more numeric finding${a.length-r===1?"":"s"}`,message:"Run auditData() or diagnoseConfig() to inspect the complete report.",source:"Semiotic data audit",dismissible:!0}),i}function qt(e){const t=[];for(const[r,a]of Object.entries(Iu))"string"!=typeof e[r]&&"function"!=typeof e[r]||t.push({role:a,accessor:r,..."size"===a?{requirements:["finite","non-negative"]}:{},..."x"===a||"y"===a?{domain:!0}:{}});return t.length>0?{fields:t}:void 0}function Yt(e,t,r){return"function"==typeof e?e(t,r):t[e]}function Kt(e,t){if("number"==typeof e)return Number.isFinite(e)?e:null;if(e instanceof Date){const r=e.getTime();return t&&Number.isFinite(r)?r:null}if("string"==typeof e){const r=e.trim(),a=Number(r);if(r&&Number.isFinite(a))return a;if("date-like"===t){const e=Tt(r);return Number.isFinite(e)?e:null}}return null}function Jt(e){return"number"==typeof e&&!Number.isFinite(e)}function Xt(e,t,r,a,i){const o={field:r,numbers:[],finiteRows:[],missingRows:[],nonFiniteRows:[],nonNumericRows:[],accessorErrorRows:[],zeroRows:[],negativeRows:[],fractionalRows:[]};for(let r=0;r<e.length;r++){let n;try{n=Yt(t,e[r],r)}catch{o.accessorErrorRows.push(r);continue}if(null==n||""===n){if(void 0!==i){o.numbers.push(i),o.finiteRows.push(r),0===i&&o.zeroRows.push(r),i<0&&o.negativeRows.push(r),Number.isInteger(i)||o.fractionalRows.push(r);continue}o.missingRows.push(r);continue}const s=Kt(n,a);null!=s?(o.numbers.push(s),o.finiteRows.push(r),0===s&&o.zeroRows.push(r),s<0&&o.negativeRows.push(r),Number.isInteger(s)||o.fractionalRows.push(r)):Jt(n)?o.nonFiniteRows.push(r):o.nonNumericRows.push(r)}return o}function Zt(e,t){const r=new Set(e.requirements??["finite"]);return r.add("finite"),("x"===e.role&&"log"===t.xScaleType||"y"===e.role&&"log"===t.yScaleType)&&r.add("positive"),[...r]}function Qt(e){let t=1/0,r=-1/0;for(const a of e)a<t&&(t=a),a>r&&(r=a);return[t,r]}function er(e,t,r){const a=[],i=/* @__PURE__ */new Set;for(const o of e.fields){if(o.whenProps?.some(e=>null==t[e]))continue;const e=t[o.accessor],n="string"==typeof e||"function"==typeof e?e:o.defaultAccessor;if("string"!=typeof n&&"function"!=typeof n)continue;const{dataProp:s,rows:c}=jt(o,t,r);if(0===c.length)continue;const l="string"==typeof n?n:`${o.accessor}()`,u=`${s}:${o.role}:${l}`;if(i.has(u))continue;i.add(u);const d=o.temporalValues??("time"===o.role||"x"===o.role&&"time"===t.xScaleType?"date-like":void 0),h="x"===o.role&&"log"===t.xScaleType||"y"===o.role&&"log"===t.yScaleType,p=Zt(o,t);a.push({contract:o,accessor:n,accessorLabel:l,dataProp:s,rows:c,requirements:p,logScale:h,observation:Xt(c,n,l,d,o.missingValue)})}return a}function tr(e){return e.slice(0,Tu)}function rr(e){return{domain:"data",...e}}function ar(e){const t=e.observation.numbers.map((t,r)=>({value:t,row:e.observation.finiteRows[r]})).sort((e,t)=>e.value-t.value);if(t.length<8)return[];const r=t.map(e=>e.value),a=Ut(r,.25),i=Ut(r,.75),o=Ut(r,.5),n=i-a;if(n>0){const e=a-10*n,r=i+10*n;return t.filter(t=>t.value<e||t.value>r).map(e=>e.row)}const s=100*Math.max(1,Math.abs(o));return t.filter(e=>Math.abs(e.value-o)>s).map(e=>e.row)}function ir(e,t){const r=[],{observation:a,contract:i,accessorLabel:o,requirements:n}=e,s={field:o,role:i.role},c=[...a.nonFiniteRows,...a.nonNumericRows,...a.accessorErrorRows].sort((e,t)=>e-t);if(0===a.numbers.length)return r.push(rr({severity:"error",code:"DEGENERATE_EXTENT",message:`${i.accessor}="${o}" produces no finite numeric values; the chart cannot resolve its ${i.role} input.`,fix:`Ensure ${o} contains finite numbers${"x"===i.role?" (or valid dates for a time scale)":""}.`,...s,...c.length>0?{rows:tr(c),count:c.length}:{}})),r;a.nonFiniteRows.length>0&&r.push(rr({severity:"error",code:"NON_FINITE_VALUE",message:`${o} contains ${a.nonFiniteRows.length} NaN or infinite value${1===a.nonFiniteRows.length?"":"s"}; scale and layout math require finite numbers.`,fix:`Filter or replace NaN/Infinity in ${o} before rendering.`,...s,rows:tr(a.nonFiniteRows),count:a.nonFiniteRows.length})),!i.allowMissing&&a.missingRows.length>0&&r.push(rr({severity:"error",code:"MISSING_NUMERIC_VALUE",message:`${o} is missing for ${a.missingRows.length} row${1===a.missingRows.length?"":"s"}; the ${i.role} role requires an explicit numeric value.`,fix:`Fill or filter missing ${o} values before rendering.`,...s,rows:tr(a.missingRows),count:a.missingRows.length}));const l=[...a.nonNumericRows,...a.accessorErrorRows].sort((e,t)=>e-t);if(l.length>0&&r.push(rr({severity:"error",code:"NON_NUMERIC_VALUE",message:`${o} produces ${l.length} non-numeric value${1===l.length?"":"s"} for the ${i.role} role.`,fix:`Bind ${i.accessor} to a numeric field or return finite numbers from the accessor.`,...s,rows:tr(l),count:l.length})),i.domain&&a.numbers.length>=2){const[e,t]=Qt(a.numbers);e===t&&r.push(rr({severity:"warning",code:"ZERO_SPAN_DOMAIN",message:`${o} is constant at ${e}; its ${i.role} scale has a zero-span data domain.`,fix:`Provide varying ${i.role} values, set an explicit extent around ${e}, or use a single-value display.`,...s,rows:tr(a.finiteRows),count:a.finiteRows.length}))}if(n.includes("positive")){const t=a.numbers.map((e,t)=>({number:e,row:a.finiteRows[t]})).filter(({number:e})=>e<=0).map(({row:e})=>e);if(t.length>0){const a=e.logScale;r.push(rr({severity:"error",code:a?"LOG_NON_POSITIVE":"NON_POSITIVE_VALUE",message:`${o} contains ${t.length} non-positive value${1===t.length?"":"s"}, which ${a?"cannot be represented on a log scale":"violate the positive-value contract"}.`,fix:a?"Remove or transform values ≤ 0, or use a linear/symlog scale.":"Provide values greater than zero.",...s,rows:tr(t),count:t.length}))}}if(n.includes("non-negative")&&a.negativeRows.length>0&&r.push(rr({severity:"error",code:"size"===i.role?"NEGATIVE_SIZE":"NEGATIVE_VALUE",message:`${o} contains ${a.negativeRows.length} negative ${i.role} value${1===a.negativeRows.length?"":"s"}; the chart maps this role to non-negative geometry.`,fix:"Use a non-negative measure, clamp intentionally, or encode sign with position/color instead.",...s,rows:tr(a.negativeRows),count:a.negativeRows.length})),n.includes("integer")){const e=[.../* @__PURE__ */new Set([...a.negativeRows,...a.zeroRows,...a.fractionalRows])].sort((e,t)=>e-t);e.length>0&&r.push(rr({severity:"error",code:"INVALID_COUNT",message:`${o} contains ${e.length} value${1===e.length?"":"s"} that are not positive integers.`,fix:"Counts must be integers ≥ 1; aggregate, round intentionally, or use a continuous-value encoding.",...s,rows:tr(e),count:e.length}))}if(n.includes("unit-interval")){const e=a.numbers.map((e,t)=>({number:e,row:a.finiteRows[t]})).filter(({number:e})=>e<0||e>1).map(({row:e})=>e);e.length>0&&r.push(rr({severity:"error",code:"OUTSIDE_UNIT_INTERVAL",message:`${o} contains ${e.length} value${1===e.length?"":"s"} outside [0, 1].`,fix:`Normalize ${o} to [0, 1] before using it as ${i.role}.`,...s,rows:tr(e),count:e.length}))}if(t&&i.domain){const t=ar(e);t.length>0&&r.push(rr({severity:"warning",code:"OUTLIER_DOMINATED_DOMAIN",message:`${o} has ${t.length} extreme value${1===t.length?"":"s"} beyond the 10×IQR guardrail; the main distribution may collapse visually.`,fix:"Verify the extreme values, then consider a log scale, robust extent, inset, or explicit annotation rather than silently clipping them.",...s,rows:tr(t),count:t.length}))}return r}function or(e,t,r){if(!e)return"__all__";try{return String(Yt(e,t,r))}catch{return"__accessor_error__"}}function nr(e,t,r){if(e.whenProp&&!0!==r[e.whenProp])return[];const a=t.find(t=>t.contract.role===e.role);if(!a||0===a.observation.numbers.length)return[];const i=e.groupAccessor?r[e.groupAccessor]:void 0,o="string"==typeof i||"function"==typeof i?i:e.defaultGroupAccessor,n=/* @__PURE__ */new Map;for(let e=0;e<a.rows.length;e++){let t;try{t=Yt(a.accessor,a.rows[e],e)}catch{continue}const r=Kt(t,void 0);if(null==r)continue;const i=or(o,a.rows[e],e),s=n.get(i)??{sum:0,magnitude:0,positive:!1,negative:!1,rows:[],negativeRows:[]};s.sum+=r,s.magnitude+=Math.abs(r),s.positive||(s.positive=r>0),s.negative||(s.negative=r<0),s.rows.push(e),r<0&&s.negativeRows.push(e),n.set(i,s)}const s=[],c=[],l=[],u=[],d=[],h=[];for(const[t,r]of n){const a=Math.abs(r.sum)<=Number.EPSILON*Math.max(1,r.magnitude)*10;("positive-total"===e.kind&&r.sum<=0||"normalized-total"===e.kind&&a)&&(s.push(t),u.push(...r.rows)),"normalized-total"===e.kind&&r.positive&&r.negative&&(c.push(t),d.push(...r.rows)),"normalized-total"===e.kind&&r.negative&&(l.push(t),h.push(...r.negativeRows))}const p=[];return s.length>0&&p.push(rr({severity:"error",code:"normalized-total"===e.kind?"ZERO_NORMALIZED_TOTAL":"NON_POSITIVE_TOTAL",message:"normalized-total"===e.kind?`${s.length} normalization group${1===s.length?" has":"s have"} a zero total, so division would be undefined.`:"The part-to-whole total is not positive, so meaningful shares cannot be computed.",fix:"normalized-total"===e.kind?"Remove empty/zero-sum groups or disable normalization.":"Provide at least one positive value and ensure the total is greater than zero.",field:a.accessorLabel,role:e.role,rows:tr([...new Set(u)].sort((e,t)=>e-t)),count:s.length})),l.length>0&&p.push(rr({severity:"error",code:"NEGATIVE_NORMALIZED_VALUE",message:`${l.length} normalization group${1===l.length?" contains":"s contain"} negative contributions, so conventional percentage shares are not defined.`,fix:"Use non-negative contributions, a diverging stack, or disable normalization.",field:a.accessorLabel,role:e.role,rows:tr([...new Set(h)].sort((e,t)=>e-t)),count:h.length})),c.length>0&&p.push(rr({severity:"warning",code:"MIXED_SIGN_NORMALIZATION",message:`${c.length} normalization group${1===c.length?" mixes":"s mix"} positive and negative contributions; percentage shares may be unstable or misleading.`,fix:"Separate positive and negative contributions, use diverging stacks, or disable normalization.",field:a.accessorLabel,role:e.role,rows:tr([...new Set(d)].sort((e,t)=>e-t)),count:c.length})),p}function sr(e,t,r,a={}){const i=a.contracts??Lt(e)??qt(t);if(!i)return{component:e,ok:!0,rowCount:r?.length??(Array.isArray(t.data)?t.data.length:0),summary:{fieldsChecked:0,errors:0,warnings:0},contracts:[],diagnoses:[]};const o=er(i,t,r),n=[],s=!1!==a.checkOutliers;for(const e of Ft(i,t,r))n.push(rr({severity:"error",code:"EMPTY_DATA",message:`${e} is an explicitly empty array; there are no numeric inputs to render.`,fix:`Provide at least one valid row, render an intentional empty state, or omit ${e} when using the ref push API.`,count:0,rows:[]}));const c=new Set(o.filter(e=>e.contract.domain&&1===e.rows.length).map(e=>e.dataProp));for(const e of c)n.push(rr({severity:"warning",code:"SINGLE_ROW_DOMAIN",message:`${e} has one row; a quantitative scale cannot establish variation from a single observation.`,fix:"Provide at least two observations or use a single-value display such as BigNumber.",count:1,rows:[0]}));for(const e of o)n.push(...ir(e,s));for(const e of i.aggregates??[])n.push(...nr(e,o,t));const l=n.filter(e=>"error"===e.severity).length,u=n.length-l;return{component:e,ok:0===l,rowCount:o.reduce((e,t)=>Math.max(e,t.rows.length),r?.length??(Array.isArray(t.data)?t.data.length:0)),summary:{fieldsChecked:o.length,errors:l,warnings:u},contracts:o.map(e=>({role:e.contract.role,accessor:e.accessorLabel,dataProp:e.dataProp,requirements:e.requirements,allowMissing:!0===e.contract.allowMissing,...void 0!==e.contract.missingValue?{missingValue:e.contract.missingValue}:{},domain:!0===e.contract.domain})),diagnoses:n}}function cr(e,t,r){const a=Tl[e];if(a){if("array"===a.dataShape||"realtime"===a.dataShape){const e=t.data;e&&Array.isArray(e)&&0===e.length&&r.push({severity:"error",code:"EMPTY_DATA",message:"data is an empty array — chart will render blank.",fix:"realtime"===a.dataShape?"Provide at least one observation: data={[{ time: 0, value: 1 }]}, or omit data for React ref push mode.":"Provide at least one data point: data={[{ x: 1, y: 2 }]}."})}"network"===a.dataShape&&t.edges&&Array.isArray(t.edges)&&0===t.edges.length&&r.push({severity:"error",code:"EMPTY_EDGES",message:"edges is an empty array — network chart will render blank.",fix:'Provide at least one edge: edges={[{ source: "A", target: "B" }]}.'})}}function lr(e,t){for(const[r,a]of[["width",600],["height",400]]){const i=e[r];void 0!==i&&("number"!=typeof i||!Number.isFinite(i)||i<=0)&&t.push({severity:"error",code:"width"===r?"BAD_WIDTH":"BAD_HEIGHT",message:`${r} must be a finite positive number.`,fix:`Set ${r}={${a}}.`})}if(e.size&&Array.isArray(e.size)){const[r,a]=e.size;(2!==e.size.length||[r,a].some(e=>"number"!=typeof e||!Number.isFinite(e)||e<=0))&&t.push({severity:"error",code:"BAD_SIZE",message:"size must contain two finite positive dimensions.",fix:"Set size={[600, 400]}."})}}function ur(e,t,r){const a=Tl[e];if(!a||"array"!==a.dataShape)return;const i=t.data;if(!i||!Array.isArray(i)||0===i.length)return;const o=Te(i);if(o.length)for(const e of a.dataAccessors){const a=t[e];"string"==typeof a&&(o.includes(a)||r.push({severity:"error",code:"ACCESSOR_MISSING",message:`${e}="${a}" not found in data. Available fields: ${o.join(", ")}.`,fix:`Change ${e} to one of: ${o.map(e=>`"${e}"`).join(", ")}, or use a function: ${e}={d => d.myValue}.`}))}}function dr(e,t,r){Ll.has(e)&&Array.isArray(t.data)&&r.push({severity:"error",code:"HIERARCHY_FLAT_ARRAY",message:`${e} expects hierarchical data but received a flat array.`,fix:'Pass a root object: data={{ name: "root", children: [...] }}. For flat data, use BarChart or LineChart.'})}function hr(e,t,r){Bl.has(e)&&(t.edges||t.data||r.push({severity:"error",code:"NETWORK_NO_EDGES",message:`${e} requires an edges prop.`,fix:'Provide edges={[{ source: "A", target: "B", value: 10 }]}.'}))}function pr(e,t,r){const a=Tl[e];if(!a||"array"!==a.dataShape)return;const i=t.data;if(!i||!Array.isArray(i)||0===i.length)return;const o=i[0];if(!o||"object"!=typeof o)return;const n=t.xAccessor;"string"==typeof n&&o[n]instanceof Date&&!t.xFormat&&r.push({severity:"warning",code:"DATE_NO_FORMAT",message:`xAccessor "${n}" contains Date objects but no xFormat is provided. Axis ticks may display "[object Object]".`,fix:"Add xFormat={d => d.toLocaleDateString()} or use timestamps (d.getTime()) instead of Date objects."})}function fr(e,t,r){t.linkedHover&&!t.selection&&r.push({severity:"warning",code:"LINKED_HOVER_NO_SELECTION",message:"linkedHover is set but selection is not — this chart emits hover events but won't highlight from others.",fix:`Add selection={{ name: "${"object"==typeof t.linkedHover&&t.linkedHover.name||"hl"}" }} to receive cross-highlights.`})}function mr(e,t,r){if(!_l.has(e))return;if(t.gapStrategy)return;const a=t.data;if(!a||!Array.isArray(a)||0===a.length)return;const i=t.yAccessor||"y";"string"==typeof i&&a.some(e=>{const t=e?.[i];return null==t||Number.isNaN(t)})&&r.push({severity:"warning",code:"DATA_GAPS",message:`Data contains null/undefined/NaN values in "${i}". Default behavior breaks the line at gaps.`,fix:'Set gapStrategy="break" (default), "interpolate", or "zero" to control gap handling.'})}function gr(e,t,r){if(!Dl.has(e))return;const a=t.rExtent||t.yExtent||t.valueExtent;a&&Array.isArray(a)&&a.length>=1&&null!=a[0]&&0!==a[0]&&r.push({severity:"warning",code:"NON_ZERO_BASELINE",message:`${e} has a non-zero baseline (${a[0]}). Bar and area charts should start at zero to avoid exaggerating differences.`,fix:`Remove the custom extent minimum or set it to 0: rExtent={[0, ${a[1]??"auto"}]}. For trend-focused charts, use LineChart instead.`})}function yr(e,t,r){if(!Ul.has(e))return;const a=t.barPadding;"number"==typeof a&&a<10&&r.push({severity:"warning",code:"BAR_PADDING_INVISIBLE",message:`barPadding=${a} is very small — bars may appear to have no spacing between them.`,fix:"Increase barPadding to at least 10 for visible gaps, e.g. barPadding={12}."})}function br(e,t,r){if("Heatmap"!==e)return;const a=t.data;if(!a||!Array.isArray(a)||0===a.length)return;const i=a[0];if(i&&"object"==typeof i)for(const e of["xAccessor","yAccessor"]){const a=t[e];if("string"!=typeof a)continue;const o=i[a];"string"==typeof o&&r.push({severity:"warning",code:"HEATMAP_STRING_ACCESSOR",message:`${e}="${a}" resolves to string values (e.g. "${o}"). Heatmap will use categorical axis handling which may produce unexpected cell layout.`,fix:"If you intend categorical axes this is fine. Otherwise, convert values to numbers before passing data."})}}function vr(e,t,r){const a=t.colorScheme;if(!a||!Array.isArray(a))return;const i="string"==typeof t.background?t.background:"#ffffff";if(!i.startsWith("#"))return;const n=[];for(const e of a){if("string"!=typeof e||!e.startsWith("#"))continue;const t=o(e,i);null!==t&&t<3&&n.push(`${e} (${t.toFixed(1)}:1)`)}n.length>0&&r.push({severity:"warning",code:"LOW_COLOR_CONTRAST",message:`${n.length} color(s) in colorScheme have < 3:1 contrast against background "${i}": ${n.join(", ")}. Data marks may be hard to see.`,fix:"Choose colors with at least 3:1 contrast against the chart background."})}function wr(e,t){const r=e.width??600,a=e.height??400,i=e.margin;if(!i||"object"!=typeof i)return;const o=(i.left||0)+(i.right||0),n=(i.top||0)+(i.bottom||0);o>=r&&t.push({severity:"error",code:"MARGIN_OVERFLOW_H",message:`Horizontal margins (${o}px) >= width (${r}px) — no drawing area left.`,fix:"Reduce margin.left/right or increase width."}),n>=a&&t.push({severity:"error",code:"MARGIN_OVERFLOW_V",message:`Vertical margins (${n}px) >= height (${a}px) — no drawing area left.`,fix:"Reduce margin.top/bottom or increase height."})}function Ar(e,t,r){const a=Tl[e]?.props,i=e=>!!a?.[e]&&"string"==typeof t[e]&&t[e].trim().length>0,o=i("title"),n=i("description"),s=i("summary");o||n||s||r.push({severity:"warning",code:"MISSING_DESCRIPTION",message:"No title, description, or summary provided. Screen readers will fall back to a generic chart-type label.",fix:'Add a title="..." prop for a brief label, or description="..." for a detailed aria-label, or summary="..." for a screen-reader-only note describing the chart\'s purpose.'})}function xr(e,t,r){const a=t.colorScheme;if("string"!=typeof a)return;const i=Tl[e];i?.props?.colorScheme?.enum||Ou.has(a)||r.push({severity:"warning",code:"UNKNOWN_COLOR_SCHEME",message:`colorScheme "${a}" is not a recognized named scheme — the chart will fall back to the default palette.`,fix:`Use a known scheme name (${[...Ou].join(", ")}) or pass an explicit color array, e.g. colorScheme={["#1f77b4", "#ff7f0e"]}.`})}function $r(e,t,r){const a=t.colorScheme;if(!a||!Array.isArray(a)||a.length<2)return;const i=a.filter(e=>"string"==typeof e&&e.startsWith("#"));if(i.length<2)return;const n=[];for(let e=0;e<i.length-1;e++){const t=o(i[e],i[e+1]);null!==t&&t<1.5&&n.push(`${i[e]} / ${i[e+1]} (${t.toFixed(1)}:1)`)}n.length>0&&r.push({severity:"warning",code:"LOW_ADJACENT_CONTRAST",message:`${n.length} adjacent color pair(s) in colorScheme have very similar luminance: ${n.join("; ")}. Categories may be hard to distinguish.`,fix:'Alternate light and dark colors in the scheme, or use COLOR_BLIND_SAFE_CATEGORICAL from "semiotic" for a pre-tested palette.'})}function Cr(e,t,r){const a=[];for(const e of Mu)"function"==typeof t[e]&&a.push(e);a.length>0&&r.push({severity:"warning",code:"FUNCTION_ACCESSOR",message:`Function accessor${a.length>1?"s":""} detected: ${a.join(", ")}. If defined inline (e.g. \`xAccessor={d => d.value}\`), every parent re-render creates a new reference; closures over changing values can force unnecessary scene rebuilds on resize/rotation.`,fix:'Use string accessors when possible (e.g. xAccessor="value"), or memoize with useCallback / define outside the component.'})}function Sr(e,t,r){const a=t.hoverRadius,i=!1!==t.enableHover&&(!1!==t.hoverAnnotation||t.tooltip||t.customHoverBehavior||t.customClickBehavior||t.onClick);"number"==typeof a&&a>0&&a<24&&i&&r.push({severity:"warning",code:"TOUCH_TARGET_SMALL",message:`hoverRadius=${a}px is below the ~24px radius needed for reliable 48px touch targets on mobile screens.`,fix:"Use hoverRadius={24} or larger for touch-heavy views. Semiotic floors touch pointer hit testing to 24px, but explicit desktop-only radii should be documented."})}function kr(e,t,r){!0===t.responsiveWidth&&!0===t.responsiveHeight&&r.push({severity:"warning",code:"RESPONSIVE_BOTH_AXES",message:"responsiveWidth and responsiveHeight are both true. On mobile this can create resize feedback loops when the parent height depends on chart content.",fix:"Prefer responsiveWidth={true} with a fixed parent height or size={[width, fixedHeight]}; use a ResizeObserver outside the chart if the height must follow aspect ratio."})}function Rr(e,t,r){if(!0!==t.showParticles)return;const a=t.particleStyle&&"object"==typeof t.particleStyle?t.particleStyle:{},i="number"==typeof a.maxPerLine?a.maxPerLine:void 0,o="number"==typeof a.spawnRate?a.spawnRate:void 0;("number"==typeof i&&i>20||"number"==typeof o&&o>.08)&&r.push({severity:"warning",code:"GEO_PARTICLE_MOBILE_COST",message:"Animated geo particles run a continuous canvas loop that can drain battery and trigger thermal throttling on mobile GPUs.",fix:"Set particleStyle={{ maxPerLine: 12, spawnRate: 0.06 }} for mobile-heavy views, or disable showParticles when reduced-motion or low-power modes are active."})}function Pr(e){return"object"==typeof e&&null!==e&&("tokenType"in e||"tokenSemantics"in e||"countStrategy"in e||"unitValue"in e||"unit"in e)}function Er(e){return"number"==typeof e&&Number.isFinite(e)&&e>=0?e:void 0}function Nr(e,t){const r=Er(e.visibleTokens);if(null!=r)return r;const a=Er(t.denominator);if("fixed-denominator"===t.countStrategy&&null!=a)return a;const i=Er(t.tokenCount),o=Er(t.maxTokens);return null!=i&&null!=o?Math.min(i,o):i??a??o}function Tr(e,t,r){const a=[];Pr(t.tokenEncoding)&&a.push({source:"tokenEncoding",encoding:t.tokenEncoding}),Pr(t.encoding)&&a.push({source:"encoding",encoding:t.encoding});for(const{source:e,encoding:i}of a){const a=Nr(t,i);for(const t of et(i,{visibleTokens:a}))r.push({severity:"warning",code:`TOKEN_${t.code}`,message:t.message,fix:"MISSING_UNIT_VALUE"===t.code?`Set ${e}.unitValue to the value represented by one full token.`:"MISSING_UNIT_MEANING"===t.code?`Set ${e}.unitMeaning so readers know what one full token represents.`:"MISSING_COUNT_STRATEGY"===t.code?`Set ${e}.countStrategy to actual, unitized, fixed-denominator, quantile, sample, posterior-sample, or random-sample.`:"TOKEN_SEMANTICS_UNCLEAR"===t.code?`Set ${e}.tokenSemantics to observed-unit, unitized-measure, risk-case, possible-outcome, posterior-sample, hypothetical-case, topic-anchor, or decorative.`:`Adjust ${e} so its semantics, strategy, labels, and visible token count match the task.`})}}function Ir(e){const t={...e};return delete t.tokenEncoding,delete t.visibleTokens,Pr(t.encoding)&&delete t.encoding,t}function Or(e,t){const r=t.match(/^Unknown prop "([^"]+)"/);if(r)return`Remove \`${r[1]}\` or replace it with a documented ${e} prop.`;const a=t.match(/^"([^"]+)" is required for .+\.$/i)??t.match(/(?:Missing|required) prop "?([^". ]+)/i);return a?`Add the required \`${a[1]}\` prop using the ${e} schema and example.`:t.startsWith("Unknown component")?"Choose a component returned by getSchema() or check the component name for a typo.":`Correct this ${e} prop configuration to match its schema: ${t}`}function Mr(e,t){void 0!==e.accessibleTable&&t.push({severity:"error",code:"BIGNUMBER_ACCESSIBLE_TABLE",message:"BigNumber is a value component and does not support accessibleTable.",fix:"Remove accessibleTable. Use label, description, and summary to provide BigNumber's accessible text."})}function jr(e,t){Ee(t)||(t={});const r=[],a=()=>({ok:r.every(e=>"warning"===e.severity),diagnoses:r}),i=/^(XY|Ordinal|Network|Physics|Geo)CustomChart$/.test(e),o=i?[]:Je(e,Ir(t)).errors;if(i){"function"!=typeof t.layout&&o.push("Provide a layout function.");const r="NetworkCustomChart"===e?["nodes","edges"]:"GeoCustomChart"===e?["points","areas","lines"]:["data"];for(const e of r)null==t[e]||Array.isArray(t[e])||o.push(`Provide an array for ${e}.`)}for(const a of o)"BigNumber"===e&&void 0!==t.accessibleTable&&a.startsWith('Unknown prop "accessibleTable"')||r.push({severity:"error",code:"VALIDATION",message:a,fix:i?a:Or(e,a)});if("BigNumber"===e&&Mr(t,r),(i||Tl[e])&&(lr(t,r),wr(t,r),lt(0,t,r)),!Tl[e])return a();cr(e,t,r),ur(e,t,r),dr(e,t,r),hr(e,t,r),pr(e,t,r),fr(0,t,r),gr(e,t,r),mr(e,t,r);const n=sr(e,t,void 0,{checkOutliers:!1}).diagnoses;for(const e of n)"EMPTY_DATA"===e.code&&r.some(e=>"EMPTY_DATA"===e.code||"EMPTY_EDGES"===e.code)||r.push(e);if(yr(e,t,r),br(e,t,r),vr(0,t,r),$r(0,t,r),xr(e,t,r),Ar(e,t,r),Cr(0,t,r),Sr(0,t,r),kr(0,t,r),Rr(0,t,r),Tr(0,t,r),ut(0,t,r),dt(0,t,r),ht(0,t,r),pt(0,t,r),wt(e,t,r),ft(e,t,r),mt(e,t,r),r.some(e=>"NEGATIVE_VALUE"===e.code||"NEGATIVE_NORMALIZED_VALUE"===e.code)||gt(e,t,r),yt(e,t,r),bt(e,t,r),vt(e,t,r),Nt(e,t,r),"ProcessSankey"===e)for(const e of Ot(t))r.push(e);return a()}function Fr(e){return!!Array.isArray(e.styleRules)&&e.styleRules.some(e=>{if("object"!=typeof e||null===e)return!1;const t=e.style;if("object"!=typeof t||null===t||Array.isArray(t))return!1;const r=t.fill;return"object"==typeof r&&null!==r&&"hatch"===r.type})}function zr(e){if(!Array.isArray(e))return!1;const t=e.filter(e=>"string"==typeof e&&e.startsWith("#")).map(e=>e.toLowerCase());return t.length>0&&t.every(e=>ju.has(e))}function Lr(e,t){return"number"==typeof t?`${e}[${t}]`:`${e}.${t}`}function Br(e,t){return`${e}[Symbol(${t.description??""})]`}function Dr(e,t){if(!/^(0|[1-9][0-9]*)$/.test(e))return!1;const r=Number(e);return Number.isSafeInteger(r)&&r>=0&&r<t}function _r(e,t){try{return Object.getOwnPropertyDescriptor(e,t)}catch{return}}function Ur(e,t,r,a){const i=_r(e,t);return i&&"value"in i&&i.enumerable?Gr(i.value,r,a):[r]}function Gr(e,t="$",r=/* @__PURE__ */new Set){if(null===e||"string"==typeof e||"boolean"==typeof e)return[];if("number"==typeof e)return Number.isFinite(e)&&!Object.is(e,-0)?[]:[t];if("object"!=typeof e)return[t];if(r.has(e))return[t];let a,i,o;try{o=Array.isArray(e),a=Object.getPrototypeOf(e),i=Reflect.ownKeys(e)}catch{return[t]}if(a!==(o?Array.prototype:Object.prototype)&&null!==a)return[t];r.add(e);const n=[];try{if(o){const a=_r(e,"length")?.value;if(!Number.isSafeInteger(a)||a<0)return[Lr(t,"length")];for(const e of i)"length"===e||"string"==typeof e&&Dr(e,a)||n.push("symbol"==typeof e?Br(t,e):Lr(t,e));for(let i=0;i<a;i+=1)n.push(...Ur(e,String(i),Lr(t,i),r))}else for(const a of i)"symbol"!=typeof a?n.push(...Ur(e,a,Lr(t,a),r)):n.push(Br(t,a));return n}catch{return[t]}finally{r.delete(e)}}function Vr(){const e=globalThis;return e[Fu]||(e[Fu]={recipes:/* @__PURE__ */new Map,capabilities:/* @__PURE__ */new Map,layouts:/* @__PURE__ */new Map}),e[Fu]}function Hr(e){return Vr().recipes.get(e)}function Wr(e){return Vr().layouts.get(e)?.layout}function qr(e){const t=Vr().layouts.get(e)?.identity;return t?{...t}:void 0}function Yr(e){return"string"==typeof e?Hr(e):e&&"object"==typeof e&&"string"==typeof e.id?e:void 0}function Kr(e){return"string"==typeof e&&e.trim().length>0}function Jr(e,t,r){const a=Lu.has(e)||void 0!==r&&Bu.has(r),i=t=>{return i=t,De(r=e)&&!Sl[i].includes(r)||a;var r,i},o=zu.filter(e=>Kr(t[e])&&!i(e));return{hasTitle:i("title")&&Kr(t.title),hasDescription:i("description")&&Kr(t.description),hasSummary:i("summary")&&Kr(t.summary),unsupportedFinding:o.length>0?{id:"understandable.unsupported-description-prop",principle:"understandable",heuristic:"Descriptive text is connected to the rendered chart",critical:!0,status:"warn",message:`Useful ${o.join(" and ")} text was supplied, but ${1===o.length?"that prop is":"those props are"} not supported by ${e}'s declared chart API and cannot be credited as rendered accessibility text.`,fix:"Use the component's declared title, description, and summary props when available; for richer generated description or navigation, use ChartContainer with chartConfig plus describe and/or navigable."}:void 0}}function Xr(e,{isValue:t,tableEnabled:r,hasDescription:a,hasSummary:i}){e.push({id:"perceivable.content-only-visual",principle:"perceivable",heuristic:"Content is only visual",critical:!0,...t?{status:"pass",message:"BigNumber renders its value as real text with an ARIA label — available without vision."}:r?{status:"pass",message:"A screen-reader data table + live region expose the data non-visually (accessibleTable is on)."}:a&&i?{status:"manual",message:"accessibleTable is off; a description + summary are present. Verify they convey everything the chart shows.",fix:"Re-enable accessibleTable, or confirm via screen reader that the text alternative is complete."}:{status:"fail",message:"accessibleTable is disabled and there's no full text alternative — the data is only available visually.",fix:"Remove accessibleTable={false}, or provide a complete description/summary plus a data table."}})}function Zr(e,{props:t}){if(null!=t.colorBy){const r=!0===t.directLabel||!0===t.showLabels,a=Fr(t);e.push({id:"perceivable.color-alone",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1,...r?{status:"pass",message:"Categories are encoded by color (colorBy) and also directly labeled, so color isn't the only channel."}:{status:"warn",message:a?"Categories use colorBy and this config authors a HatchFill through styleRules, but a static audit cannot prove those rules give every category a distinct non-color cue. Semiotic does not automatically assign per-category textures.":"Categories are encoded by color (colorBy) with no declared redundant channel. Semiotic supports author-supplied HatchFill patterns through styleRules, but this config has no statically visible HatchFill descriptor and there is no automatic per-category texture assignment.",fix:a?"Verify every category remains distinguishable with color removed; add direct labels where hatching is incomplete, keep categories ≤ ~7, and use a CVD-safe palette.":"Add direct labels (directLabel on LineChart/AreaChart, showLabels on network/hierarchy) or category-targeted styleRules with distinct HatchFill descriptors; keep categories ≤ ~7 and use a CVD-safe palette."}})}}function Qr(e,{isValue:t,tableEnabled:r}){e.push({id:"compromising.table",principle:"compromising",heuristic:"No table",critical:!0,...t?{status:"not-applicable",message:"Single-value display — a table isn't meaningful."}:r?{status:"pass",message:"A human-readable data table is provided (accessibleTable)."}:{status:"fail",message:"accessibleTable is disabled — no human-readable table of the underlying data.",fix:"Remove accessibleTable={false} (unless title/summary/annotations already convey all the data)."}})}function ea(e,{navigable:t,isHierarchy:r,builtIn:a,builtInNote:i,known:o}){e.push({id:"compromising.navigable-structure",principle:"compromising",heuristic:"Information cannot be navigated according to narrative or structure",critical:!1,...t?r?{status:"pass",message:"ChartContainer's navigable option mounts a structured navigation tree, including hierarchy/network branches and their data items."}:{status:"pass",message:"ChartContainer's navigable option mounts a structured tree (chart → axes/series → data points) that screen readers can traverse."}:r?{status:"warn",message:"Hierarchical chart: built-in keyboard navigation is largely flat — it doesn't descend the tree structure.",fix:"Enable ChartContainer's navigable option for a structured navigation tree, or lean on the data table and a summary that conveys the hierarchy."}:{status:a,message:`Keyboard navigation steps through points and switches series/groups${i}.`,fix:o?"For deeper structure (axis → series → datum), enable ChartContainer's navigable option.":void 0}})}function ta(e,{component:t,props:r}){{const a=Array.isArray(r.data)?r.data:null,i=Array.isArray(r.nodes)?r.nodes:null,o={id:"assistive.data-density",principle:"assistive",heuristic:"Data density is inappropriate",critical:!0};let n;n=Wl.has(t)&&a&&a.length>7?{...o,status:"warn",message:`${a.length} slices in a part-to-whole chart. Chartability suggests ≤ 5 categories; many thin slices are hard to perceive and to describe.`,fix:'Group small slices into an "Other" category, or switch to a ranked bar chart.'}:i&&i.length>200?{...o,status:"warn",message:`${i.length} nodes. A network this size is hard to navigate non-visually node by node.`,fix:"Provide a summary of structure (clusters, hubs, components) and consider filtering or aggregating the graph."}:a&&a.length>5e3?{...o,status:"warn",message:`${a.length} data points. Canvas renders this fine, but the non-visual table/navigation become unwieldy.`,fix:"Aggregate or bin for the accessible representation, or expose summary statistics rather than every row."}:a?{...o,status:"pass",message:`${a.length} data points — a reasonable density for non-visual consumption.`}:i?{...o,status:"pass",message:`${i.length} nodes — a reasonable density for non-visual consumption.`}:{...o,status:"manual",message:"Data not provided inline (push mode); verify density at runtime."},e.push(n)}}function ra(e,{props:t}){{const r=Array.isArray(t.data)?t.data:null,a=["valueFormat","yFormat","xFormat","tickFormat","format"].some(e=>"function"==typeof t[e]||"string"==typeof t[e]);let i=!1;if(r&&!a)for(const e of r.slice(0,50))if(e&&"object"==typeof e){for(const t of Object.values(e))if("number"==typeof t&&Number.isFinite(t)&&Math.abs(t)>=1e5){i=!0;break}if(i)break}i&&e.push({id:"assistive.human-readable-numbers",principle:"assistive",heuristic:"Data in text is not human-readable",critical:!1,status:"warn",message:'Data includes large numbers (≥ 100,000) and no value/tick formatter — screen readers will read every digit (e.g. "six hundred fifty thousand…").',fix:'Pass valueFormat / yFormat (e.g. a compact formatter so 6,500,000 reads as "6.5M"); the formatter flows to ticks, tooltips, and the data table.'})}}function aa(e,{isValue:t,tableEnabled:r}){e.push({id:"assistive.skippable-navigation",principle:"assistive",heuristic:"Navigation and interaction is tedious",critical:!0,...t?{status:"not-applicable",message:"Single value — nothing to skip."}:r?{status:"pass",message:'A "Skip to data table" link lets screen-reader users bypass point-by-point navigation.'}:{status:"warn",message:"accessibleTable is off, removing the skip-to-table affordance.",fix:"Keep accessibleTable enabled so users can skip past dense point navigation."}})}function ia(e){const t=e?.provenance?.confidence;return"number"==typeof t&&Number.isFinite(t)?t:null}function oa(e){return"primary"===e?.emphasis||"secondary"===e?.emphasis||null!=ia(e)}function na(e){const t=e.split(/[.!?]+/).map(e=>e.trim()).filter(Boolean),r=e.trim().split(/\s+/).filter(Boolean);if(0===r.length||0===t.length)return null;let a=0;for(const e of r)a+=sa(e);return r.length/t.length*.39+a/r.length*11.8-15.59}function sa(e){const t=e.toLowerCase().replace(/[^a-z]/g,"");if(!t)return 0;if(t.length<=3)return 1;const r=t.replace(/(?:[^laeiouy]es|ed|[^laeiouy]e)$/,"").replace(/^y/,"").match(/[aeiouy]{1,2}/g);return r?r.length:1}function ca(e){return!1!==e.tooltip||null!=e.onClick||null!=e.brush||null!=e.onBrush||null!=e.selection||null!=e.linkedHover||null!=e.linkedBrush}function la(e){return e.physics&&"object"==typeof e.physics?e.physics:{}}function ua(e){const t=la(e),r=e.controls&&"object"==typeof e.controls?e.controls:{};return!0===e.pauseControl||!0===t.pauseControl||!0===r.pause||"function"==typeof r.pause}function da(e){const t=la(e);return!0===e.settledProjection||!0===t.settledProjection}function ha(e){const t=la(e);return!0===e.reducedMotionSettle||"settle"===e.reducedMotion||!0===t.reducedMotionSettle||"settle"===t.reducedMotion}function pa(e){const t={id:"perceivable.low-contrast",principle:"perceivable",heuristic:"Low contrast",critical:!0},r=e.colorScheme,a="string"==typeof e.background?e.background:null;if(a&&!a.startsWith("#"))return{...t,status:"manual",message:`Background "${a}" isn't a hex literal (theme/CSS variable) — contrast can't be verified statically.`,fix:'Pass a hex `background` (e.g. "#ffffff"/"#000000"), or verify contrast manually once the theme resolves.'};const i=a??"#ffffff";if(!Array.isArray(r))return{...t,status:"manual",message:"Mark colors come from the theme/CSS variables — contrast can't be verified statically.",fix:"Confirm geometries/large text have ≥ 3:1 and regular text ≥ 4.5:1 contrast against the background."};const n=[];let s=0;for(const e of r){if("string"!=typeof e||!e.startsWith("#"))continue;const t=o(e,i);null!=t&&(s++,t<3&&n.push(`${e} (${t.toFixed(1)}:1)`))}return 0===s?{...t,status:"manual",message:"colorScheme has no parseable hex colors to check.",fix:"Verify contrast manually for non-hex colors."}:n.length>0?{...t,status:"fail",message:`${n.length} color(s) fall below 3:1 contrast vs ${i}: ${n.join(", ")}.`,fix:"Darken (light background) or lighten (dark background) those colors, or use COLOR_BLIND_SAFE_CATEGORICAL."}:{...t,status:"pass",message:`All ${s} checked colorScheme color(s) meet ≥ 3:1 contrast vs ${i}.`}}function fa(e,t,r={}){const a=[],i=Hr(e),o=Xl.has(e),n=De(e)||!!i||o,s=!0===r.inChartContainer,c=!0===r.describe,l=!0===r.navigable,u=Yl.has(e),d=Ll.has(e),{hasTitle:h,hasDescription:p,hasSummary:f,unsupportedFinding:m}=Jr(e,t,i?.frameFamily),g=!1!==t.accessibleTable&&!u,y=h||p||f,b=ca(t),v=ua(t),w=o,A=da(t)||Ql.has(e)&&g,x=ha(t)||w,$=Array.isArray(t.annotations)?t.annotations.filter(e=>!!e&&"object"==typeof e):[],C=n?"pass":"manual",S=n?"":` (unrecognized component "${e}" — verify manually that the built-in applies)`,k={component:e,props:t,isValue:u,tableEnabled:g,hasDescription:p,hasSummary:f,known:n,builtIn:C,builtInNote:S,navigable:l,isHierarchy:d};if(m&&a.push(m),a.push(pa(t)),Xr(a,k),a.push({id:"perceivable.small-text",principle:"perceivable",heuristic:"Small text size",critical:!0,status:"pass",message:"Semiotic's default tick and axis-label fonts are 12px, meeting Chartability's 9pt/12px floor.",fix:"If a theme or override lowers --semiotic-tick-font-size below 12px, raise it back for low-vision audiences."}),a.push({id:"perceivable.seizure-risk",principle:"perceivable",heuristic:"Visual presents seizure risk",critical:!0,...null!=t.pulse||Zl.has(e)?{status:"manual",message:"Pulse/continuous animation is in use. Confirm nothing flashes more than 3×/sec, especially saturated red.",fix:"Avoid red flashes and rapid (>3 Hz) flicker; reduced-motion is auto-honored, but verify the default presentation."}:{status:"manual",message:"No flashing detected statically. Confirm no element flashes more than 3×/sec.",fix:"Manual check — most static charts pass trivially."}}),Zr(a,k),null!=t.colorBy){const e=Fr(t),r=zr(t.colorScheme);a.push({id:"perceivable.cvd-safe",principle:"perceivable",heuristic:"Not CVD-friendly",critical:!1,...r?{status:"pass",message:"colorScheme uses Semiotic's Wong colorblind-safe palette."}:{status:"manual",message:"Color encodes meaning; statically we can't confirm the palette is colorblind-safe.",fix:'Use COLOR_BLIND_SAFE_CATEGORICAL from "semiotic", or test your scheme with Viz Palette / Chroma.'}}),a.push({id:"flexible.textures-adjustable",principle:"flexible",heuristic:"Contrast and textures cannot be adjusted",critical:!1,status:"warn",message:e?"This config uses an author-supplied HatchFill through styleRules, but Semiotic has no automatic, theme-aware per-category texture channel or user-facing texture toggle.":"Semiotic supports author-supplied HatchFill patterns through styleRules, but this config has no statically visible HatchFill descriptor; there is no automatic, theme-aware per-category texture channel or user-facing texture toggle.",fix:e?"Verify the authored hatches cover every meaningful category and remain legible in the active theme; pair them with direct labels and a CVD-safe palette.":"Use category-targeted styleRules with distinct HatchFill descriptors or direct labels so the encoding survives color removal. Contrast itself is themeable via CSS variables."})}{const e=$.filter(rt);if(e.length>0){const r=t.autoPlaceAnnotations,i="object"==typeof r&&null!==r&&!0===r.redundantCues,o=e.filter(e=>{if("string"!=typeof e.color)return!1;const t=tt(e),r=i&&"text"===t;return!(it(e)||r)});a.push({id:"perceivable.annotation-association",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1,...0===o.length?{status:"pass",message:"No annotation relies on color alone to indicate its target — wherever color is used, a connector, enclosure, or reference-line cue is present too."}:{status:"warn",message:`${o.length} of ${e.length} annotation(s) carry a color but no connector, enclosure, or reference-line cue, so a color-blind or non-visual reader can't tie them to their target (the correspondence problem).`,fix:"Add a connector (the label/callout default), place the note adjacent to its target, enclose the target, or enable autoPlaceAnnotations: { redundantCues: true } to give colored text notes a leader line — don't rely on color matching alone."}})}}a.push({id:"operable.single-input-modality",principle:"operable",heuristic:"Interaction modality only has one input type",critical:!0,...n?{status:"pass",message:"Built-in keyboard navigation (arrows/Home/End/PageUp-Down/Enter) mirrors mouse hover."}:{status:"manual",message:`Can't confirm keyboard support for "${e}".`,fix:"Verify Tab + arrow-key operation."}});{const e=[];null==t.brush&&null==t.onBrush||e.push("brushing"),!0===t.zoomable&&e.push("zoom/pan"),"isolate"!==t.legendInteraction&&"highlight"!==t.legendInteraction||e.push("legend filtering"),e.length>0&&a.push({id:"operable.complex-action-alternatives",principle:"operable",heuristic:"Complex actions have no alternatives",critical:!1,status:"warn",message:`Mouse-driven ${e.join(", ")} ${e.length>1?"have":"has"} no built-in keyboard/standard-UI equivalent.`,fix:"Pair the complex interaction with a standard control (range inputs for a brush, buttons for zoom, a checkbox list for legend filtering) operable by keyboard and screen reader."})}{const r=iu[e];if(r&&b){const e=t[r];"number"==typeof e&&e>0&&2*e<24&&a.push({id:"operable.target-size",principle:"operable",heuristic:"Target pointer interaction size is too small",critical:!1,status:"warn",message:`${r}=${e} gives a ~${2*e}px hit target, below the 24×24px minimum for pointer interaction.`,fix:"Increase the radius, or rely on the chart's hoverRadius / keyboard navigation as the alternative for precise selection."})}}a.push({id:"operable.tab-stops",principle:"operable",heuristic:"Inappropriate tab stops",critical:!1,status:C,message:`The chart takes a single tab stop and navigates data with arrow keys${S} — the recommended pattern for dense charts (no per-datum tab stops to wade through).`}),a.push({id:"operable.interaction-cues",principle:"operable",heuristic:"No interaction cues or instructions",critical:!0,...b?f||p?{status:"manual",message:"Chart is interactive and has descriptive text. Confirm that text explains how to interact (keyboard + pointer).",fix:'State the interaction model in summary, e.g. "Use arrow keys to move between points."'}:{status:"warn",message:"Chart is interactive but nothing explains how to use it.",fix:"Describe the interaction in a summary or nearby text (keyboard navigation, what hover/click reveals)."}:{status:"not-applicable",message:"No interactive behavior detected."}}),a.push({id:"operable.controls-override-at",principle:"operable",heuristic:"Controls override AT controls",critical:!0,status:C,message:`Keyboard handlers fire only while the chart has focus, so they don't hijack page/app screen-reader shortcuts${S}.`}),a.push({id:"operable.focus-indicator",principle:"operable",heuristic:"Keyboard focus indicator missing, obscured, or low contrast",critical:!1,status:C,message:`A shape-adaptive focus ring (var(--semiotic-focus)) marks the focused element${S}.`,fix:n?"Ensure --semiotic-focus keeps ≥ 3:1 contrast against your background.":void 0}),a.push({id:"understandable.title-summary-caption",principle:"understandable",heuristic:"No title, summary, or caption",critical:!0,...y?{status:"pass",message:`Provided: ${[h&&"title",p&&"description",f&&"summary"].filter(Boolean).join(", ")}.`}:s?{status:"manual",message:"No title/description/summary on the chart. If the wrapping ChartContainer supplies a title/subtitle, this is covered at that layer — verify it does.",fix:"Give the ChartContainer a title (and optionally enable describe), or set title/description/summary on the chart."}:{status:"fail",message:"No title, description, or summary — the screen reader falls back to a generic label.",fix:"Add title/description/summary on the chart, or wrap it in a ChartContainer (the opt-in layer for title/caption/description chrome)."}}),a.push({id:"understandable.explain-purpose",principle:"understandable",heuristic:"No explanation for purpose or for how to read",critical:!0,...p||f?{status:"pass",message:"A description/summary is available to explain purpose and how to read the chart."}:c?{status:"manual",message:"ChartContainer's describe option explains how to read the chart (type, stats, trend). Confirm the domain purpose — why this chart exists — is also conveyed (title/subtitle).",fix:"Give the ChartContainer a title/subtitle stating the purpose; describe() covers the how-to-read half."}:h?{status:"warn",message:"Only a title is set — a label, not an explanation of purpose or how to read the chart.",fix:"Add a summary, or enable ChartContainer's describe option for an auto-generated how-to-read description."}:{status:"fail",message:"Nothing explains the chart's purpose or how to read it.",fix:"Add a summary/description, or wrap in a ChartContainer with a title and the describe option (the opt-in full-accessibility layer)."}});{const e=[t.description,t.summary].filter(Kr).join(". "),r=e?na(e):null;a.push({id:"understandable.reading-level",principle:"understandable",heuristic:"Reading level inappropriate",critical:!0,...null==r?{status:"not-applicable",message:"No description/summary text to grade."}:r>9?{status:"warn",message:`Description/summary reads at ~grade ${r.toFixed(0)}; Chartability targets grade 9 or lower.`,fix:"Shorten sentences and prefer common words."}:{status:"pass",message:`Description/summary reads at ~grade ${Math.max(0,Math.round(r))} (≤ 9).`}})}if(Kl.has(e)){const e=Kr(t.xLabel),r=Kr(t.yLabel);a.push({id:"understandable.axis-labels",principle:"understandable",heuristic:"Axis labels are unclear or missing",critical:!1,...e&&r?{status:"pass",message:"Both axes are labeled (xLabel, yLabel)."}:{status:"warn",message:`Missing axis label: ${[!e&&"xLabel",!r&&"yLabel"].filter(Boolean).join(", ")}. Ticks alone may not name the variable.`,fix:"Set xLabel and yLabel to name each axis's variable and units."}})}if(ru.has(e)&&a.push({id:"understandable.information-complexity",principle:"understandable",heuristic:"Information complexity is inappropriate",critical:!1,status:"warn",message:"Dual-axis chart: two y-scales are hard to read accurately and notoriously easy to misinterpret (the crossover point is arbitrary).",fix:"Confirm the second axis is necessary; consider two aligned charts (small multiples) or indexing both series to a common baseline. Label each axis and its series unambiguously."}),$.length>1){const e=$.filter(oa).length,t=$.length-e;a.push({id:"understandable.annotation-hierarchy",principle:"understandable",heuristic:"Information complexity is inappropriate",critical:!1,...e===$.length?{status:"pass",message:`All ${$.length} annotation(s) declare hierarchy through emphasis or provenance confidence, so the renderer can resolve reading order and visual priority.`}:0===e?{status:"warn",message:`${$.length} annotations are present with no emphasis or provenance confidence; readers may not know which note is primary.`,fix:'Mark the main annotation with emphasis="primary", set supporting notes to emphasis="secondary", or provide provenance.confidence so Semiotic can infer order.'}:{status:"warn",message:`${t} of ${$.length} annotation(s) have no emphasis or provenance confidence; readers may not know which note is primary among the unordered notes.`,fix:"Set emphasis on each annotation (primary/secondary), or provide provenance.confidence on all annotations so Semiotic can infer order."}})}(null!=t.forecast||null!=t.anomaly||null!=t.band||null!=t.regression)&&a.push({id:"understandable.uncertainty",principle:"understandable",heuristic:"Statistical uncertainty isn't clearly communicated",critical:!1,status:"manual",message:"The chart shows a forecast/regression/band/anomaly overlay. Confirm the uncertainty it represents is explained in text, not just drawn.",fix:"State the confidence interval / method in the summary, and label the band so it isn't mistaken for data."}),null!=t.animate&&!1!==t.animate&&a.push({id:"understandable.changes-followable",principle:"understandable",heuristic:"Changes are not easy to follow",critical:!1,status:C,message:`Transitions animate with object constancy and data changes are mirrored to the live region${S}.`,fix:n?"Keep transition durations in the 250ms–2s range so changes are followable but not slow.":void 0}),a.push({id:"robust.conforms-to-standards",principle:"robust",heuristic:"Does not conform to standards",critical:!1,status:"manual",message:"WCAG 2.1 / Section 508 conformance can't be settled from config alone.",fix:"Run an automated checker (axe) on the rendered output and test with real assistive tech."}),a.push({id:"robust.semantically-valid",principle:"robust",heuristic:"Semantically invalid",critical:!1,status:"manual",message:"Whether interactive elements expose correct roles/names is a render-time, screen-reader question.",fix:"Verify with a screen reader that buttons read as buttons, the chart as an image/group, etc."}),a.push({id:"robust.fragile-technology-support",principle:"robust",heuristic:"Fragile technology support",critical:!1,status:C,message:`Charts render on canvas with an SVG overlay and render to SVG in SSR, so access isn't tied to one rendering path${S}.`,fix:n?"Still test across NVDA+Firefox, JAWS+Chrome, and VoiceOver+Safari — AT support varies.":void 0}),Qr(a,k),u||a.push({id:"compromising.table-static",principle:"compromising",heuristic:"Table/data is static",critical:!1,...s?{status:"manual",message:"Rendered in a ChartContainer. If a data-download action is enabled, the data is exportable.",fix:"Enable the ChartContainer data-download action so users can save the underlying data (keep it opt-in)."}:{status:"warn",message:"The data table is read-only — not downloadable, sortable, or filterable.",fix:"Wrap the chart in a ChartContainer and enable its data-download action (opt-in, so deployments can withhold it where export isn't allowed)."}}),a.push({id:"compromising.shareable-state",principle:"compromising",heuristic:"State is not easy to share and reproduce",critical:!1,status:n?"pass":"manual",message:`Chart state serializes via toConfig/toURL/copyConfig${n?"":S}.`,fix:n?"Expose it to users via the ChartContainer copyConfig action or a shareable URL.":void 0}),ea(a,k),ta(a,k),ra(a,k),a.push({id:"assistive.features-described",principle:"assistive",heuristic:"Visually apparent features and relationships are not described",critical:!1,...c?{status:"pass",message:"ChartContainer's describe option auto-generates an L1–L3 description (chart type, statistics, and trend) via describeChart()."}:f?{status:"manual",message:"A summary is present. Confirm it describes trends, extrema, clusters, and outliers — not just what the chart is.",fix:"Cover the L2/L3 content blind readers value most: direction of trend, peak/trough, notable outliers."}:{status:"warn",message:"No text describes the visually apparent trends, extrema, or outliers.",fix:"Enable ChartContainer's describe option (auto-generates via describeChart()), or write a summary covering the key trend and notable points."}}),aa(a,k),a.push({id:"flexible.user-style-respected",principle:"flexible",heuristic:"User style change not respected",critical:!0,status:C,message:`Styling flows through CSS custom properties and honors forced-colors mode, so user/user-agent style changes cascade in${S}.`,fix:n?"Avoid hardcoding colors via frameProps style fns that bypass theme variables.":void 0}),a.push({id:"flexible.reduced-motion",principle:"flexible",heuristic:"Long animations cannot be controlled",critical:!1,...Zl.has(e)||tu.has(e)?v?{status:"pass",message:`${e} animates continuously and declares an in-chart pause/stop control.`}:{status:"warn",message:`${e} animates continuously. prefers-reduced-motion is auto-honored, but there's no in-chart pause/stop control for users who don't set that preference.`,fix:"Offer a pause/stop control for looping/streaming motion (Chartability requires it for animation > 2s)."}:{status:C,message:`prefers-reduced-motion is auto-detected; transitions fast-forward and looping animation stops${S}.`}}),o&&(a.push({id:"flexible.sim-pause-control",principle:"flexible",heuristic:"Long animations cannot be controlled",critical:!1,...v?{status:"pass",message:"Physics simulation exposes a pause/stop control for users who need to stop motion."}:{status:"warn",message:"Physics simulation has no declared pause/stop control.",fix:"Provide a visible pause control and set physics.pauseControl=true (or pauseControl=true) so the contract is auditable."}}),a.push({id:"flexible.settled-projection",principle:"flexible",heuristic:"User style change not respected",critical:!1,...A?{status:"pass",message:"A settled-projection table is declared, so non-visual readers get aggregate chart semantics instead of trajectories."}:{status:"warn",message:"Physics chart does not declare a settled projection for its accessible table.",fix:"Provide aggregate rows from the settled projection and set physics.settledProjection=true."}}),a.push({id:"flexible.reduced-motion-settle",principle:"flexible",heuristic:"Long animations cannot be controlled",critical:!1,...x?{status:"pass",message:"Reduced-motion mode settles the simulation to a static chart state instead of freezing bodies mid-flight."}:{status:"warn",message:"Physics chart does not declare reduced-motion synchronous settle behavior.",fix:"In reduced motion, run the world to its settled projection and paint once; set physics.reducedMotionSettle=true."}}));{const r=!0===t.responsiveWidth||!0===t.responsiveHeight,i=au.has(e)&&!0===t.zoomable;a.push({id:"flexible.zoom-reflow",principle:"flexible",heuristic:"Zoom and reflow are not supported",critical:!1,...r?{status:"pass",message:`Chart reflows to its container (${[!0===t.responsiveWidth&&"responsiveWidth",!0===t.responsiveHeight&&"responsiveHeight"].filter(Boolean).join(", ")}), so page zoom doesn't clip it.`}:i?{status:"pass",message:"Geo chart is zoomable/pannable."}:{status:"manual",message:"Fixed width/height — verify the chart survives browser zoom and reflow without clipping or loss of function.",fix:"Use responsiveWidth/responsiveHeight so the chart reflows to its container."}})}if(i){const e=i.encodings?.some(e=>"color"===e.channel&&(!e.redundantWith||0===e.redundantWith.length));e&&a.push({id:"perceivable.recipe-color-alone",principle:"perceivable",heuristic:"Color is used alone to communicate meaning",critical:!1,status:"warn",message:`${i.name} declares a color encoding without a redundant cue.`,fix:"Add shape, label, position, texture, or a textual category summary to the recipe encoding."}),"required"!==i.accessibility.description||p||a.push({id:"understandable.recipe-description",principle:"understandable",heuristic:"Features are not described",critical:!1,status:"fail",message:`${i.name} requires a recipe-aware description, but none is attached.`,fix:"Call describeChart with recipeId/recipe metadata and attach the returned text as description."}),i.accessibility.fallbackTable&&!1===t.accessibleTable&&a.push({id:"compromising.recipe-fallback",principle:"compromising",heuristic:"No data table is provided",critical:!0,status:"fail",message:`${i.name} requires a fallback table, but accessibleTable is disabled.`,fix:"Enable accessibleTable and preserve recipe-declared table fields on scene nodes."})}const R=a.filter(e=>"not-applicable"!==e.status).filter(e=>e.critical),P={criticalsPassed:R.filter(e=>"pass"===e.status).length,criticalsEvaluated:R.length,fails:a.filter(e=>"fail"===e.status).length,warnings:a.filter(e=>"warn"===e.status).length,manual:a.filter(e=>"manual"===e.status).length,passes:a.filter(e=>"pass"===e.status).length};return{component:e,ok:!R.some(e=>"fail"===e.status),summary:P,findings:a,reference:Du}}function ma(e,{onlyCritical:t=!1}={}){const r=[];for(const a of e.findings)"fail"!==a.status&&"warn"!==a.status||t&&!a.critical||r.push(a.message);return r}function ga(e){const t=[],r=e.summary,a=e.ok?`${r.criticalsPassed}/${r.criticalsEvaluated} critical heuristics pass`:`${r.fails} blocking failure(s) — ${r.criticalsPassed}/${r.criticalsEvaluated} critical heuristics pass`;t.push(`${e.ok?"✓":"✗"} ${e.component}: accessibility audit (Chartability POUR-CAF)`),t.push(` ${a} · ${r.warnings} warning(s) · ${r.manual} to verify manually`);for(const r of Uu){const a=e.findings.filter(e=>e.principle===r&&"not-applicable"!==e.status);if(0!==a.length){t.push(""),t.push(` ${r.toUpperCase()}`);for(const e of a){const r=e.critical?" [critical]":"";t.push(` ${_u[e.status]} ${e.id}${r}: ${e.message}`),!e.fix||"fail"!==e.status&&"warn"!==e.status&&"manual"!==e.status||t.push(` → ${e.fix}`)}}}return t.push(""),t.push(` Ref: ${e.reference}`),t.join("\n")}function ya(e){return e.semanticDiagnostics?.length?e.semanticDiagnostics:"degenerate"===e.semanticStatus?[Gu]:[]}function ba(e){const{contract:t,transfer:r,binding:a}=e;if(void 0===t&&void 0===r&&void 0===a)return[];const i=[],o=Array.isArray(a?.mismatchPaths)?a.mismatchPaths.filter(e=>"string"==typeof e):[];return r&&"preserved"!==r.status&&"excluded"!==r.status?i.push({id:"artifact.transfer-invalid",status:"fail",message:`The attached artifact transfer is ${r.status}; its contract cannot be relied on for publication.`}):r&&void 0!==t||i.push({id:"artifact.transfer-unknown",status:"unknown",message:"The attached artifact lacks a contract or a transfer report."}),"mismatch"===a?.status||o.length>0?i.push({id:"artifact.identity-mismatch",status:"fail",message:"The attached artifact does not identify this chart input"+(o.length?`: ${o.join(", ")}`:".")}):("match"!==a?.status||!Array.isArray(a.mismatchPaths)||!Array.isArray(a.unknownPaths)||a.mismatchPaths.length>0||a.unknownPaths.length>0)&&i.push({id:"artifact.identity-unknown",status:"unknown",message:"The attached artifact identity has not been fully verified."}),i}function va(e,t){try{Promise.resolve(t?.(e)).catch(()=>{})}catch{}}function wa(e){return e.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Aa(e,t,r){return{id:`${t}.${e.code.toLowerCase()}.${r+1}`,stage:t,severity:e.severity,code:e.code,message:e.message,...e.fix?{fix:e.fix}:{},source:"data"===t?"auditData":"diagnoseConfig",...e.field?{field:e.field}:{},...e.role?{role:e.role}:{},...e.rows?{rows:e.rows}:{},...void 0!==e.count?{count:e.count}:{}}}function xa(e,t){const r="fail"===e.status?"error":"warn"===e.status?"warning":"manual";return{id:e.id||`accessibility.${t+1}`,stage:"accessibility",severity:r,code:e.id,message:e.message,...e.fix?{fix:e.fix}:{},source:"auditAccessibility",critical:e.critical,principle:e.principle,heuristic:e.heuristic}}function $a(e){return e.map((e,t)=>({finding:e,index:t})).sort((e,t)=>{const r=Vu[e.finding.severity]-Vu[t.finding.severity];if(0!==r)return r;const a=!0===e.finding.critical;if(a!==(!0===t.finding.critical))return a?-1:1;const i=Hu[e.finding.stage]-Hu[t.finding.stage];return 0!==i?i:e.index-t.index}).map(({finding:e},t)=>({...e,rank:t+1}))}function Ca(e,t){const r=[];e.component!==t&&r.push({id:"render.component-mismatch",stage:"render",severity:"error",code:"RENDER_COMPONENT_MISMATCH",message:"The render evidence names a different chart component.",source:"renderChartWithEvidence"});for(const t of ba({contract:e.artifactContract,transfer:e.artifactTransfer,binding:e.artifactBinding}))r.push({id:`render.${t.id}`,stage:"render",severity:"fail"===t.status?"error":"manual",code:t.id.toUpperCase().replace(/[.-]/g,"_"),message:t.message,source:"artifactAttachmentIssues"});e.empty&&r.push({id:"render.empty-scene",stage:"render",severity:"error",code:"EMPTY_SCENE",message:"The renderer produced no data marks.",fix:"Check the data shape, accessors, scales, and filters against the rendered evidence.",source:"renderChartWithEvidence"});const a=/* @__PURE__ */new Set;for(const t of ya(e))a.add(t.code),r.push({id:`render.${t.code.toLowerCase()}`,stage:"render",severity:t.severity,code:t.code,message:t.message,...t.fix?{fix:t.fix}:{},source:"capability.semanticViability"});for(const t of e.warnings)a.has(t)||r.push({id:`render.${t.toLowerCase()}`,stage:"render",severity:"warning",code:t,message:`The renderer reported ${wa(t).toLowerCase()}.`,fix:"Inspect the render evidence and resolve the warning before relying on the chart.",source:"renderChartWithEvidence"});return r}function Sa(e,t){const r=e.filter(e=>"manual"!==e.severity),a=r.slice(0,t).map(e=>({id:`chart-evaluation-${e.id}`,level:"error"===e.severity?"error":"warning",title:`${e.stage}: ${wa(e.code)}`,message:e.fix?`${e.message} ${e.fix}`:e.message,source:"Semiotic chart evaluation",dismissible:!0}));return r.length>t&&a.push({id:"chart-evaluation-overflow",level:"warning",title:"Additional chart evaluation findings",message:r.length-t+" additional finding(s) are available in the ranked evaluation result.",source:"Semiotic chart evaluation",dismissible:!0}),a}function ka(e){const t=e.ok?"PASS":"ISSUES FOUND",r=[`${e.component}: ${t}`,`${e.summary.errors} error(s) · ${e.summary.warnings} warning(s) · ${e.summary.manual} manual check(s)`];for(const t of e.findings)r.push(`${t.rank}. [${t.stage}/${t.code}] ${t.message}`),t.fix&&r.push(` Fix: ${t.fix}`);return r.join("\n")}function Ra(e,t={},r,a={}){const i=void 0===r?t:{...t,data:r},o=Je(e,i),n=sr(e,i,r,a.dataAudit),s=jr(e,i).diagnoses.filter(e=>"data"!==e.domain&&"VALIDATION"!==e.code),c=fa(e,i,{inChartContainer:a.inChartContainer,describe:a.describe,navigable:a.navigable}),l=[];for(const[e,t]of o.errors.entries())l.push({id:`validation.${e+1}`,stage:"validation",severity:"error",code:"VALIDATION",message:t,fix:"Correct the component name, required props, prop types, and data shape.",source:"validateProps"});let u;n.diagnoses.forEach((e,t)=>{l.push(Aa(e,"data",t))}),s.forEach((e,t)=>{l.push(Aa(e,"deception",t))}),c.findings.filter(e=>"pass"!==e.status&&"not-applicable"!==e.status).forEach((e,t)=>{l.push(xa(e,t))});const d=l.some(e=>"error"===e.severity&&"accessibility"!==e.stage);if(a.render&&o.valid&&!d)try{u=a.render(e,i).evidence,l.push(...Ca(u,e))}catch(e){u=void 0,va(e,a.onRenderError),l.push({id:"render.failed",stage:"render",severity:"error",code:"RENDER_FAILED",message:"The injected renderer failed before producing render evidence.",fix:"Check the chart configuration and renderer-specific requirements.",source:"renderChartWithEvidence"})}const h=$a(l),p=h.filter(e=>"error"===e.severity).length,f=h.filter(e=>"warning"===e.severity).length,m=h.filter(e=>"manual"===e.severity).length,g=Sa(h,Ea(a.notificationMax));return{component:e,validation:o,data:n,deception:s,accessibility:c,...u?{evidence:u}:{},ok:0===p,summary:{errors:p,warnings:f,manual:m,findings:h.length,notifications:g.length},findings:h,notifications:g}}function Pa(e,t=8){return Sa(e,Ea(t))}function Ea(e){return void 0!==e&&Number.isFinite(e)?Math.max(0,Math.floor(e)):8}function Na(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function Ta(e){return"string"==typeof e&&e.trim().length>0}function Ia(e){const t=Na(e.capability)?e.capability:null,r=Na(e.recipe)?e.recipe:null,a=[e.mobileSemantics,e.mobileVisualization,e.mobile,t?.mobile,r?.mobile];for(const e of a)if(Na(e))return e;return null}function Oa(e,t){return e.includes("CustomChart")||e.includes("Custom")||null!=t.recipeId||null!=t.mobileSemantics}function Ma(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 ja(e){return Ma(e.size)||Ma(Na(e.frameProps)?e.frameProps.size:void 0)||("number"==typeof e.width&&"number"==typeof e.height?[e.width,e.height]:null)}function Fa(e){const t=Ia(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}function za(e){const t=Ia(e),r=Na(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===r?.tapToSelect||!0===r?.tapToLockTooltip||Array.isArray(t?.interaction?.alternatives)&&t.interaction.alternatives.length>0||"tap"===t?.interaction?.primary||"button"===t?.interaction?.primary||Ta(t?.interaction?.hoverFallback)}function La(e,t){const r=Ia(e),a=Na(e.mobileInteraction)?e.mobileInteraction:null,i=a?.standardControls,o=Array.isArray(r?.interaction?.alternatives)&&r.interaction.alternatives.length>0;return!(null==e.controls&&null==e.mobileControls&&!0!==e.alternativeControls&&!o)||!0===i||"all"===i||t.every(e=>"brush"===e?Array.isArray(i)?i.includes("brush"):"brush"===i:"pan/zoom"===e?Array.isArray(i)?i.includes("zoom"):"zoom"===i:"legend filtering"===e&&(Array.isArray(i)?i.includes("legend"):"legend"===i))}function Ba(e){const t=Na(e.frameProps)?e.frameProps:{};return(!0===e.enableHover||null!=e.tooltipContent||null!=e.tooltip||null!=t.tooltipContent||!0===t.enableHover)&&!za(e)}function Da(e){const t=[e.data,e.points,e.lines,e.nodes,e.edges,e.areas,Na(e.frameProps)?e.frameProps.data:void 0];let r=0;for(const e of t)Array.isArray(e)&&(r+=e.length);return r}function _a(e){const t=[e.tickValues,e.xTickValues,e.yTickValues,e.rTickValues,e.oTickValues];let r=0;for(const e of t)Array.isArray(e)&&(r+=e.length);return r>0?r:null}function Ua(e,t){const r=iu[e];if("string"!=typeof r)return null;let a=30;for(const e of[r,"hoverRadius"]){const r=t[e];"number"==typeof r&&Number.isFinite(r)&&r>0&&(a=Math.max(a,r))}return 2*a}function Ga(e,t){e.push({...t,status:"pass"})}function Va(e,t){e.push({...t,status:"warn"})}function Ha(e,t){e.push({...t,status:"manual"})}function Wa(e,t={},r={}){const a=r.viewportWidth??390,i=r.targetSize??44,o=ja(t),n=de(t,{width:a,height:o?.[1]}),s=[],c=ja(t=n.props),l=Ia(t),u=Oa(e,t),d=Fa(t),h=!0===r.inChartContainer,p=Ta(t.title)||Ta(t.summary)||Ta(t.description)||!0===l?.summary||Ta(l?.summary);if(n.matches.length>0&&Ga(s,{id:"layout.responsive-rule-applied",category:"layout",impact:"medium",message:`${n.matches.length} responsive rule(s) applied for the ${a}px mobile audit.`}),c){const[t,r]=c;t>a&&!d?Va(s,{id:"layout.fixed-desktop-size",category:"layout",impact:"high",message:`Chart size is ${t}px wide against a ${a}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."}):Ga(s,{id:"layout.fixed-desktop-size",category:"layout",impact:"high",message:"No fixed desktop-width overflow risk is visible from the config."}),"number"==typeof l?.minViewportWidth&&l.minViewportWidth>a&&Va(s,{id:"layout.mobile-min-width",category:"layout",impact:"high",message:`The declared mobile contract supports ${l.minViewportWidth}px minimum, wider than the audited ${a}px viewport.`,fix:"Add a narrower breakpoint, summary-card fallback, or explicit horizontal-scroll affordance with a non-visual equivalent."});const i=t/Math.max(1,r);a<=430&&i>2.4&&"BigNumber"!==e&&Va(s,{id:"layout.wide-aspect-ratio",category:"layout",impact:"medium",message:`Chart aspect ratio is ${i.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."}),r<160&&"BigNumber"!==e&&Va(s,{id:"layout.too-short-for-reading",category:"layout",impact:"medium",message:`Chart height is ${r}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 Ha(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=Da(t);f>0&&(f>("number"==typeof l?.maxMarks?l.maxMarks:qu.has(e)?1.25*a:Jl.has(e)?Math.max(8,Math.floor(a/34)):a)?Va(s,{id:"density.mark-budget",category:"density",impact:qu.has(e)?"medium":"high",message:`${f} data item(s) exceed the rough mobile density budget for ${e} at ${a}px.`,fix:"Aggregate, filter, facet into small multiples, switch to a summary-card plus detail view, or use progressive disclosure."}):Ga(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 m=_a(t),g=!1!==t.showAxes&&!1!==t.axis;if(g&&null!=m){const e=Math.max(3,Math.floor(a/58));m>e&&Va(s,{id:"density.explicit-tick-count",category:"density",impact:"medium",message:`${m} explicit tick(s) exceed a phone-friendly budget of about ${e} at ${a}px.`,fix:"Use adaptive ticks, fewer tickValues, direct labels, or move exact values into a tap-accessible detail panel."})}else g&&(qu.has(e)||Jl.has(e))&&Ha(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."});Ba(t)?Va(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."}):Ga(s,{id:"interaction.hover-only-detail",category:"interaction",impact:"high",message:"No hover-only detail path is visible from the config."});const y=Ua(e,t),b=Na(t.mobileInteraction)?t.mobileInteraction:null,v="number"==typeof b?.targetSize?b.targetSize:!0===t.mobileInteraction?44:"number"==typeof l?.minimumHitTarget?l.minimumHitTarget:"number"==typeof l?.interaction?.targetSize?l.interaction.targetSize:null,w=y??v;null!=w&&(w<24?Va(s,{id:"interaction.target-size-minimum",category:"interaction",impact:"high",message:`Small interactive marks expose an estimated ${w}px pointer target, below WCAG's 24px minimum.`,fix:"Increase mark radius/hoverRadius, add tap snapping to nearest datum, or provide larger external controls."}):w<i?Va(s,{id:"interaction.target-size-comfort",category:"interaction",impact:"medium",message:`Pointer target is about ${w}px, above 24px but below the ${i}px comfortable phone target.`,fix:"Use hoverRadius/tapRadius near 44px while keeping the visible mark small if needed."}):Ga(s,{id:"interaction.target-size-comfort",category:"interaction",impact:"medium",message:`Pointer target is about ${w}px, meeting the configured ${i}px target.`}));const A=[];null==t.brush&&null==t.onBrush||A.push("brush"),!0===t.zoomable&&A.push("pan/zoom"),"isolate"!==t.legendInteraction&&"highlight"!==t.legendInteraction||A.push("legend filtering"),A.length>0&&!La(t,A)&&Va(s,{id:"interaction.complex-gesture-alternative",category:"interaction",impact:"high",message:`Mobile-hostile complex interaction detected: ${A.join(", ")} without standard control alternatives.`,fix:"Pair gestures with buttons, range inputs, chips, or a details panel that works with touch and keyboard."});const x=!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"===l?.labels?.strategy||"inline"===l?.labels?.strategy||"external"===l?.labels?.strategy;x&&!$&&a<=430&&Va(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 C=Array.isArray(t.annotations)?t.annotations.filter(e=>Na(e)):[],S="number"==typeof l?.maxAnnotations?l.maxAnnotations:3;if(C.length>S&&a<=430&&Va(s,{id:"annotation.mobile-density",category:"annotation",impact:"medium",message:`${C.length} annotation(s) compete for phone plot space.`,fix:"Assign annotation priority, collapse secondary notes into a callout list, or provide shorter mobileText."}),C.length>0){const e=C.filter(e=>!Ta(e.mobileText)&&!Ta(e.shortText)&&!Ta(e.label));e.length>0&&Ha(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."})}d||"BigNumber"===e||Ha(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&&(l?(Ga(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===l.custom?.dataBearingSceneNodes?Va(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!==l.custom?.dataBearingSceneNodes&&Ha(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."})):Ha(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."})),p||h||Va(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 k=s.filter(e=>"warn"===e.status),R={highRisk:k.filter(e=>"high"===e.impact).length,warnings:k.length,manual:s.filter(e=>"manual"===e.status).length,passes:s.filter(e=>"pass"===e.status).length};return{component:e,viewportWidth:a,ok:0===R.highRisk,summary:R,findings:s,reference:Wu}}function qa(e){const t=[],r=e.summary,a=e.ok?`no high-risk mobile blockers at ${e.viewportWidth}px`:`${r.highRisk} high-risk mobile issue(s) at ${e.viewportWidth}px`;t.push(`${e.ok?"PASS":"WARN"} ${e.component}: mobile visualization audit`),t.push(` ${a} - ${r.warnings} warning(s) - ${r.manual} manual check(s)`);for(const r of Ku){const a=e.findings.filter(e=>e.category===r&&"not-applicable"!==e.status);if(0!==a.length){t.push(""),t.push(` ${r.toUpperCase()}`);for(const e of a)t.push(` ${Yu[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 Ya(){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."]}function Ka(e,t){if("function"==typeof e)return e;const r=e||t;return e=>e[r]}function Ja(e){if(!Array.isArray(e))return[];for(const t of e)if(!Ee(t))return e.filter(Ee);return e}function Xa(e){let t=e;for(const r of["data","nodes","edges","points","areas","lines","flows","spawns","projectionRows","annotations"]){if(!Array.isArray(e[r]))continue;const a=Ja(e[r]);a!==e[r]&&(t===e&&(t={...e}),t[r]=a)}return t}function Za(e){return e instanceof Date?e.getTime():"number"==typeof e?e:"string"==typeof e&&""!==e.trim()?Number(e):NaN}function Qa(e){return e instanceof Date?Number.isFinite(e.getTime())?e.toISOString():void 0:null!=e&&"object"!=typeof e&&"function"!=typeof e?String(e):void 0}function ei(e,t){const r=Ka(e,t);return e=>Za(r(e))}function ti(){const e=globalThis;return e[Ju]??(e[Ju]={intents:/* @__PURE__ */new Map}),e[Ju]}function ri(e,t){return Zu.has(e)||Qu.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 ai(e){for(const t of["lineBy","areaBy","stackBy","groupBy","colorBy"]){const r=e[t];if("string"==typeof r&&r)return r}}function ii(e,t){return null==e?"—":e instanceof Date?Qa(e)?.slice(0,10)??"—":"number"==typeof e?t(e):Qa(e)??"—"}function oi(e,t={}){const r=!0===t.showRetractedAnnotations,a=!0===t.showSupersededAnnotations,i=/* @__PURE__ */new Set;for(const t of e){const e=t?.lifecycle?.supersedes;e&&"retracted"!==t?.lifecycle?.status&&i.add(e)}return e.filter(e=>{if("retracted"===e?.lifecycle?.status&&!r)return!1;const t=e?.provenance?.stableId;return!(t&&i.has(t)&&!a)})}function ni(e,t,r){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:r]}function si(e,t="—"){let r;for(;null!==e&&"object"==typeof e&&!(e instanceof Date);){if(r??(r=/* @__PURE__ */new Set),r.has(e))return t;r.add(e);const a=e;e=a.id??a.name??a.label}return Qa(e)||t}function ci(e){const t=Za(e);return Number.isFinite(t)?t:void 0}function li(e){return(si(e,"unknown").toLowerCase().match(/[a-z0-9]+/g)||[]).join("-")||"unknown"}function ui(e,t){return`${e.linkedHover||e.selection||e.linkedBrush?` ${t}`:""}${e.enableHover||e.tooltip?" Hover or focus a mark for its details.":""}`}function di(e,t){return Ja(ni(e,t,"children"))}function hi(e){return"string"==typeof e?e:e.id??e.name}function pi(e){return e.layoutConfig&&"object"==typeof e.layoutConfig?e.layoutConfig:{}}function fi(e){return Array.isArray(e.data)?Ja(e.data):Array.isArray(e.nodes)?Ja(e.nodes):Array.isArray(e.points)?Ja(e.points):Array.isArray(e.areas)?Ja(e.areas):[]}function mi(e,t,r){return r??Yr(t.recipe)??Yr(t.recipeId)??Hr(e)}function gi(e,t,r=[]){const a=e.accessor?t[e.accessor]:void 0;if("string"==typeof a&&a)return a;if(e.field)return e.field;const i=r.find(e=>e&&"object"==typeof e);if(!i)return;const o=Object.entries(i).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=>Object.prototype.hasOwnProperty.call(i,e)):o.find(([,e])=>"string"==typeof e)?.[0]}function yi(e,t){return e.dataRoles.find(e=>e.role===t)}function bi(e,t){return e.dataRoles.find(e=>t.includes(e.semanticType))}function vi(e,t,r,a,i,o={}){const n=Object.assign(/* @__PURE__ */Object.create(null),o);if(t)for(const[e,r]of Object.entries(t))n[e]=r;for(const e of r.dataRoles){const r=gi(e,a,i),o=t&&r?t[r]:r;void 0!==o&&(n[e.role]=o)}return e.replace(/\{([^}]+)\}/g,(e,t)=>si(n[t],`{${t}}`))}function wi(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})}}}function Ai(e,t,r,a){const i=bi(e,["nominal","ordinal"]),o=bi(e,["quantitative"]),n=i?gi(i,r,t):void 0,s=o?gi(o,r,t):void 0,c=i?.role??n??"category",l=o?.role??s??"value",u=e.encodings??[],d=u.length?u.slice(0,3).map(e=>e.meaning.replace(/\.$/,"")).join("; "):`${c} and ${l} are mapped through the recipe's declared visual semantics`,{number:h,percent:p}=wi(a),f=/* @__PURE__ */new Map;if(n&&s)for(const e of t){const t=si(e[n],"Uncategorized"),r=Za(e[s]);Number.isFinite(r)&&f.set(t,(f.get(t)??0)+r)}const m=[...f].sort((e,t)=>t[1]-e[1]),g=m.reduce((e,[,t])=>e+t,0),y=m[0],b=m[1],v=g>0?((y?.[1]??0)+(b?.[1]??0))/g:0,w=e.intents.map(e=>({id:hi(e),strength:"string"==typeof e?void 0:e.strength})).sort((e,t)=>"primary"===e.strength?-1:"primary"===t.strength?1:0)[0]?.id,A=e.audience?.primary??e.audienceFit?.find(e=>"strong"===e.fit)?.audience;return{l1:`A ${e.name.toLowerCase()} encodes ${c} and ${l}. ${x=d,x?x.charAt(0).toUpperCase()+x.slice(1):x}.`,l2:m.length>0?`${m.length} categories total ${h.format(g)}. ${y[0]} accounts for ${h.format(y[1])}${g>0?` (${p.format(y[1]/g)})`:""}${b?`, followed by ${b[0]} at ${h.format(b[1])}`:""}.`:`${t.length} data ${1===t.length?"item is":"items are"} represented.`,l3:m.length>=2?v>=.5?`Most of the total is concentrated in ${y[0]} and ${b[0]}, which together account for ${p.format(v)}.`:`The total is distributed across ${m.length} categories without the first two forming a majority.`:y?`${y[0]} is the only represented category.`:"No quantitative pattern can be derived from the available data.",l4:`The chart is intended for ${w??"explanation"}${A?` with a ${A} audience`:""}: ${e.designContract.whyCustom}`};var x}function xi(e,t,r={}){const a=fi(t),i=pi(t),o=r.locale??"en",n="function"==typeof e.description?e.description({data:a,config:i,locale:o}):void 0,s=n?.levels??Ai(e,a,i,o),c=r.levels??["l1","l2","l3","l4"],l={};for(const e of c)s[e]&&(l[e]=s[e]);const u=["l1","l2","l3","l4"].map(e=>l[e]).filter(e=>!!e).join(" "),d=r.includeCaveats?[...e.reception?.risks??[],...e.caveats??[],...(e.designContract.misuse??[]).map(e=>`Misuse: ${e}`)]:void 0;return{text:u,levels:l,...d?.length?{caveats:d}:{}}}function $i(e){const t=Math.max(2,Math.round(e.bins)),r=Math.max(1,Math.round(e.pegRows??t-1)),a=Math.max(1,Math.round(e.count??Math.max(64,4*t))),i=(o=Number.isFinite(e.branchProbability)?e.branchProbability??.5:.5,Math.max(0,Math.min(1,o)));var o;const n=Xe(e.seed??1),s=e.idPrefix??"mechanical";return Array.from({length:a},(e,t)=>{let a=0;for(let e=0;e<r;e+=1)n()<i&&(a+=1);const o=r/2;return{id:`${s}-${t}`,value:a,mechanical:!0,pegRows:r,branchProbability:i,pathRights:a,side:a<o?"left":a>o?"right":"center"}})}function Ci(e){return{...e,bySource:Object.fromEntries(Object.entries(e.bySource).map(([e,t])=>[e,{...t}]))}}function Si(e){const{windowSize:t,watermark:r,watermarkAtArrivalAccessor:a}=e;if(!(Number.isFinite(t)&&t>0))throw new RangeError("EventDrop windows.size must be a finite positive number");const{rows:i}=Rt(e.data,"event"),o=i.flatMap((t,r)=>{const a=xt(At(t,r,e.timeAccessor));return null==a?[]:[{datum:t,index:r,eventTime:a,arrivalTime:xt(At(t,r,e.arrivalAccessor))??a,watermarkAtArrival:0,late:!1}]}),n="function"==typeof r?null:xt(r?.value),s="function"==typeof r?t:xt(r?.delay)??t,c=new td(t,r,e.sourceIds);for(const t of o.slice().sort((e,t)=>e.arrivalTime-t.arrivalTime||e.index-t.index)){const r=a?xt(At(t.datum,t.index,a)):null,i=c.append({eventTime:t.eventTime,arrivalTime:t.arrivalTime,source:String(At(t.datum,t.index,e.sourceAccessor??"source")??""),watermarkAtArrival:r??void 0});t.watermarkAtArrival=i.watermarkAtArrival,t.late=i.late}return{events:o,watermarkValue:o.length?c.getWatermark():n??-s,ledger:c.getLedger(),lifecycleEvents:c.drainEvents()}}function ki(e,t){const r="mechanical"===(t.simulationMode??t.mode)&&("GaltonBoardChart"===e||"UnitPileChart"===e);if(!Array.isArray(t.data)&&!r)return null;let a=Array.isArray(t.data)?t.data:[];const i=Math.max(2,Math.round(xt(t.bins)??21)),o=Math.max(1,Math.round(xt(t.pegRows)??i-1));if(r&&(a="GaltonBoardChart"===e?$i({bins:i,count:t.mechanicalCount,pegRows:o,branchProbability:t.branchProbability,seed:t.seed}):St({count:t.mechanicalCount,categories:t.mechanicalCategories,unitValue:t.unitValue,seed:t.seed})),a=Rt(a,"UnitPileChart"===e?"pile":"GaltonBoardChart"===e?"galton":"EventDropChart"===e?"event":"collision-swarm").rows,"UnitPileChart"===e){const e=/* @__PURE__ */new Map,i=t.valueAccessor??(r?"value":void 0);return a.forEach((r,a)=>{const o=si(At(r,a,t.categoryAccessor??"category"),"unknown"),n=i?xt(At(r,a,i)):1;e.set(o,(e.get(o)??0)+Math.max(0,n??0))}),{generated:r,rows:Array.from(e,([e,t])=>({label:e,value:t}))}}if("GaltonBoardChart"===e){const e=a.map((e,r)=>xt(At(e,r,t.valueAccessor??"value"))).filter(e=>null!=e),n=r?[0,o]:Ct(t.valueExtent),[s,c]=n??(e.length?P(e):[0,1]),l=s===c?1:c-s,u=Array.from({length:i},(e,t)=>({label:String(t+1),value:0}));for(const t of e)u[Math.max(0,Math.min(i-1,Math.floor((t-s)/l*i)))].value+=1;return{generated:r,rows:u}}if("CollisionSwarmChart"===e){const e=/* @__PURE__ */new Map;return a.forEach((r,a)=>{if(null==xt(At(r,a,t.xAccessor??"x")))return;const i=t.groupAccessor?si(At(r,a,t.groupAccessor),"All"):"All";e.set(i,(e.get(i)??0)+1)}),{generated:r,rows:Array.from(e,([e,t])=>({label:e,value:t}))}}if("EventDropChart"===e){const e=xt(t.windows?.size??10);if(null==e||e<=0)return null;const{events:i}=Si({data:a,timeAccessor:t.timeAccessor??"time",arrivalAccessor:t.arrivalAccessor??"arrivalTime",windowSize:e,watermark:t.watermark,watermarkAtArrivalAccessor:t.watermarkAtArrivalAccessor}),o=i.map(e=>e.eventTime),[n,s]=o.length?P(o):[0,e],c=Math.min(xt(t.timeExtent?.[0])??n,n),l=Math.max(xt(t.timeExtent?.[1])??s,s),u=Math.floor(c/e)*e,d=Math.max(1,Math.ceil((l-u+e)/e)),h=Array.from({length:d},(t,r)=>({label:`${u+r*e}-${u+(r+1)*e}`,value:0,secondary:0,secondaryLabel:"late"}));for(const t of i){const r=h[Math.max(0,Math.min(d-1,Math.floor((t.eventTime-u)/e)))];t.late?r.secondary+=1:r.value+=1}return{generated:r,rows:h}}return null}function Ri(e){const t="number"==typeof e?e:"string"==typeof e?Number(e):NaN;return Number.isFinite(t)?t:void 0}function Pi(e,t){const r=e.physics&&"object"==typeof e.physics?e.physics:null,a=e.settledProjection&&"object"==typeof e.settledProjection?e.settledProjection:null,i=[e.settledProjectionRows,e.projectionRows,a?.rows,r?.settledProjectionRows,r?.projectionRows,r?.settledProjection&&"object"==typeof r.settledProjection?r.settledProjection.rows:void 0].find(e=>Array.isArray(e));return Array.isArray(i)?i.map((e,r)=>{if(!e||"object"!=typeof e)return null;const a=e,i=Ri(a.count??a.value??a.total??a.bodies??a.events);if(null==i)return null;const o=a.label??a.id??a.name??`container ${r+1}`,n=Ri(a.secondary??a.secondaryCount),s=Ri(a.observed??a.observedCount);return{label:ii(o,t),count:i,...null!=n?{secondary:n}:{},..."string"==typeof a.secondaryLabel&&a.secondaryLabel?{secondaryLabel:a.secondaryLabel}:{},...null!=s?{observed:s}:{}}}).filter(e=>null!=e):null}function Ei(e){return"EventDropChart"===e?"time window":"GaltonBoardChart"===e?"bin":"CollisionSwarmChart"===e?"group lane":"PacketFlowChart"===e?"flow node":"CrucibleChart"===e?"result group":"container"}function Ni(e){return"EventDropChart"===e?"event":"GaltonBoardChart"===e?"sample":"CollisionSwarmChart"===e?"point":"PacketFlowChart"===e?"packet":"CrucibleChart"===e?"settled item":"UnitPileChart"===e?"unit":"body"}function Ti(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.":"UnitPileChart"===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.":"PacketFlowChart"===e?"A physical flow chart that keeps authored routes visible while packet bodies show throughput and proximity events.":"CrucibleChart"===e?"A crucible physics chart that replays authored phases and events into declared products and outlets; the settled ledger, not collisions, determines the result.":`A ${t} whose accessible reading is the settled projection rather than individual trajectories.`}function Ii(e,t){if(!(t>0))return"0%";const r=e/t*100;return`${r>=10?Math.round(r):Math.round(10*r)/10}%`}function Oi(e,t,r,a,i,o,n=null){const s=Ei(e),c=n&&"EventDropChart"===e?"accepted event":Ni(e),l=n?n.generated?"The generated sample projection":"The source projection":"The settled projection";if(i.has("l1")&&(a.l1=Ti(e,t)),!i.has("l2")&&!i.has("l3"))return;if(!r||0===r.length)return void(i.has("l2")&&(a.l2=n?"No valid source records are available.":"No settled projection is loaded yet."));const u=r.reduce((e,t)=>e+t.count,0),d=r.filter(e=>e.count>0).sort((e,t)=>t.count-e.count),h=d[0]??r.slice().sort((e,t)=>t.count-e.count)[0];if(!h)return;const p=r.reduce((e,t)=>e+(t.secondary??0),0),f=r.find(e=>e.secondaryLabel)?.secondaryLabel??"secondary";if(i.has("l2"))if(n&&"EventDropChart"===e)a.l2=`${l} classifies ${o(u+p)} ${Mi(u+p,"event")} across ${r.length} ${Mi(r.length,s)}: ${o(u)} accepted and ${o(p)} late.`;else if(0===d.length)a.l2=`${l} contains ${o(u)} ${Mi(u,c)} across ${r.length} ${Mi(r.length,s)}; no ${Mi(2,s)} are non-empty yet.`;else{const e=p>0?` ${o(p)} ${Mi(p,c)} ${1===p?"is":"are"} marked ${f}.`:"";a.l2=`${l} contains ${o(u)} ${Mi(u,c)} across ${r.length} ${Mi(r.length,s)}; ${d.length} ${Mi(d.length,s)} ${1===d.length?"is":"are"} non-empty. The largest ${s} is ${h.label} with ${o(h.count)} ${Mi(h.count,c)}.${e}`}if(i.has("l3")&&u>0&&d.length>0){const e=d.find(e=>e!==h),t=Ii(h.count,u);a.l3=e?`${l} is most concentrated in ${h.label}, which holds ${o(h.count)} ${Mi(h.count,c)} (${t}); ${e.label} follows with ${o(e.count)} ${Mi(e.count,c)}.`:`${l} is concentrated in ${h.label}, which holds all ${o(h.count)} ${Mi(h.count,c)}.`}}function Mi(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:`${t}s`}function ji(e){return Object.prototype.hasOwnProperty.call(rd,e)?rd[e]:`${t=e,t.replace(/([a-z])([A-Z])/g,"$1 $2").toLowerCase()} chart`;var t}function Fi(e){const t=/* @__PURE__ */new Set,r=e=>{const a=Object.prototype.hasOwnProperty.call(nd,e)?nd[e]:void 0;if(a)return a;if(t.has(e))return;const i=ti().intents.get(e);if(!i?.composes?.length)return;t.add(e);const o=[...i.composes].sort((e,t)=>{const r=e=>{const t=cd.indexOf(e);return t<0?cd.length:t};return(i.weights?.[t]??1)-(i.weights?.[e]??1)||r(e)-r(t)});for(const a of o){const i=r(a);if(i)return t.delete(e),i}t.delete(e)};return r(e)}function zi(e){let t,r=0;for(const[a,i]of Object.entries(e))if("number"==typeof i&&i>0)if(i>r)t=a,r=i;else if(i===r&&void 0!==t){const e=cd.indexOf(a),r=cd.indexOf(t);-1!==e&&(-1===r||e<r)&&(t=a)}return t}function Li(e){return"BumpChart"===e?"ranking":Qu.has(e)||"StackedAreaChart"===e?"apportioning":od.has(e)?"relating":Zu.has(e)?"comparing":ed.has(e)?"characterizing":Xu.has(e)?"tracking":ad.has(e)?"tracing":"BigNumber"===e?"presenting":void 0}function Bi(e){if(e){if("fits"in e||"buildProps"in e){const t=e,r={};for(const[e,a]of Object.entries(t.intentScores))"number"==typeof a&&Number.isFinite(a)&&(r[e]=a);return{family:t.family,intentScores:Object.keys(r).length?r:void 0}}return e}}function Di(e,t){const r=Bi(t);if(r?.act)return r.act;if(r?.intentScores){const e=zi(r.intentScores);if(e&&Object.prototype.hasOwnProperty.call(nd,e)&&(r.intentScores[e]??0)>=3)return nd[e]}return r?.family&&Object.prototype.hasOwnProperty.call(sd,r.family)?sd[r.family]:Li(e)}function _i(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||!ud.has(t.type))return!1;const r=t.provenance;return!(!r||"object"!=typeof r)&&(dd.has(r.authorKind)||hd.has(r.source)||pd.has(r.basis))})}function Ui(e="en"){let t,r;try{t=new Intl.NumberFormat(e,{notation:"compact",maximumFractionDigits:1}),r=new Intl.NumberFormat(e,{maximumFractionDigits:2})}catch{t=new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}),r=new Intl.NumberFormat("en",{maximumFractionDigits:2})}return e=>Number.isFinite(e)?Math.abs(e)>=1e4?t.format(e):r.format(e):String(e)}function Gi(e,t,r,a){let i=0,o=0,n=1/0,s=-1/0,c=null,l=null,u=0,d=0,h=null,p=null,f=NaN,m=NaN;for(const r of e){const e=t(r);Number.isFinite(e)&&(0===i&&(f=e,h=r),m=e,p=r,e<n&&(n=e,c=r,u=i),e>s&&(s=e,l=r,d=i),i++,o+=e)}return 0===i?null:{count:i,min:n,max:s,mean:o/i,minLabel:ii(null!=c?r(c):null,a),maxLabel:ii(null!=l?r(l):null,a),first:f,last:m,firstLabel:ii(null!=h?r(h):null,a),lastLabel:ii(null!=p?r(p):null,a),minIndex:u,maxIndex:d}}function Vi(e){return e.length<=1?e[0]??"":2===e.length?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(", ")}, and ${e[e.length-1]}`}function Hi(e){const t=e.provenance&&"object"==typeof e.provenance?e.provenance:null,r=t?.authorKind??t?.source??t?.basis;return"watcher"===r?"a watcher-flagged ":"agent"===r||"ai"===r||"llm-inference"===r?"an AI-suggested ":""}function Wi(e){const t="string"==typeof e.type?e.type:"annotation",r=Object.prototype.hasOwnProperty.call(fd,t)?fd[t]:"an annotation",a=Hi(e),i=a?a+r.replace(/^an? /,""):r,o="string"==typeof e.label?e.label:"string"==typeof e.title?e.title:void 0;return o?`${i} labeled "${o}"`:i}function qi(e){const t=Array.isArray(e.annotations)?e.annotations:null;if(!t||0===t.length)return;const r=oi(t.filter(e=>!!e&&"object"==typeof e));if(0===r.length)return;const a=r.map(Wi),i=a.slice(0,5),o=a.length-i.length,n=Vi(i)+(o>0?`, and ${o} more`:""),s=r.length;return`The author has marked ${1===s?"one feature":`${s} features`} on this chart: ${n}.`}function Yi(e,t,r={}){t=Xa(t);const a=void 0!==r.levels,i=new Set(r.levels??["l1","l2","l3"]);a||!r.capability&&!_i(t)||i.add("l4");const o=mi(e,t,r.recipe);if(o){const e=["l1","l2","l3","l4"].filter(e=>i.has(e));a||e.includes("l4")||e.push("l4");const n=xi(o,t,{levels:e,locale:r.locale,audience:r.audience,includeCaveats:r.includeCaveats}),s=qi(t);return{...n,text:s?`${s} ${n.text}`.trim():n.text,...s?{annotations:s}:{}}}const n=Ui(r.locale??"en"),s=ji(e),c=Array.isArray(t.data)?t.data:null,l=ai(t),u=id.has(e)?Pi(t,n):null,d=id.has(e)&&null===u?ki(e,t):null,{measure:h,measureFallback:p,dimension:f,dimensionFallback:m}=ri(e,t),g="string"==typeof h&&h?h:p,y="string"==typeof f&&f?f:m,b={};if(id.has(e)&&Oi(e,s,u??(d?Pi({projectionRows:d.rows},n):null),b,i,n,d),i.has("l1")&&!id.has(e))if("BumpChart"===e)b.l1=`A ${s} ranking ${l??"series"} by ${g} across ${y}.`;else if(Xu.has(e)||Zu.has(e))b.l1=`A ${s} of ${g} by ${y}`+(l?`, split by ${l}.`:".");else if(Qu.has(e))b.l1=`A ${s} showing ${g} across ${y} categories.`;else if(ed.has(e))b.l1=`A ${s} of the distribution of ${g}`+(l?` by ${l}.`:".");else if(ad.has(e)){const e=Array.isArray(t.nodes)?t.nodes.length:void 0,r=Array.isArray(t.edges)?t.edges.length:void 0,a=[null!=e?`${e} ${ao(e,"node")}`:null,null!=r?`${r} ${ao(r,"edge")}`:null].filter(Boolean);b.l1=`A ${s}${a.length?` with ${a.join(" and ")}`:""}.`}else if("BigNumber"===e){const e="string"==typeof t.label?t.label:g;b.l1=`A single value${e?` for ${e}`:""}.`}else b.l1=`A ${s}.`;const v=Xu.has(e)||"BumpChart"===e||Zu.has(e)||Qu.has(e)||ed.has(e);let w=null;if((i.has("l2")||i.has("l3")||i.has("l4"))&&v&&c&&c.length>0&&(w=Gi(c,ei(h,p),Ka(f,m),n)),i.has("l2")&&v&&(c&&0!==c.length?w&&(Qu.has(e)?b.l2=`${w.count} segments totaling ${n(Ki(w))}. Largest is ${w.maxLabel} at ${n(w.max)}; smallest is ${w.minLabel} at ${n(w.min)}.`:b.l2=`${g} ranges from ${n(w.min)} (${w.minLabel}) to ${n(w.max)} (${w.maxLabel}), with a mean of ${n(w.mean)} across ${w.count} ${ao(w.count,"point")}.`):b.l2="No data is loaded yet."),i.has("l3")&&w&&!l&&Xu.has(e)?b.l3=Ji(w,g,n):i.has("l3")&&w&&!l&&Zu.has(e)&&(b.l3=`The highest ${y} is ${w.maxLabel} and the lowest is ${w.minLabel}.`),i.has("l4")){const a=_i(t)?"alerting":Di(e,r.capability);if(a){const i=l?null:w;b.l4=Xi(a,e,t,i,g,y,n,r.audience)}}const A=["l1","l2","l3","l4"].filter(e=>i.has(e)&&b[e]).map(e=>b[e]).join(" "),x=qi(t);return{text:x?`${x} ${A}`.trim():A,levels:b,...x?{annotations:x}:{}}}function Ki(e){return e.mean*e.count}function Ji(e,t,r){const{first:a,last:i,min:o,max:n,maxLabel:s,minLabel:c,firstLabel:l,lastLabel:u,minIndex:d,maxIndex:h,count:p}=e,f=n-o,m=i-a;if(0===f)return`${ro(t)} is constant at ${r(a)} across the series.`;if(f/(Math.abs(e.mean)||1)<.04)return`${ro(t)} ends roughly where it started (${r(a)} at ${l} to ${r(i)} at ${u}), ranging between ${r(o)} and ${r(n)}.`;const g=h>0&&h<p-1,y=d>0&&d<p-1,b=(n-Math.max(a,i))/f,v=(Math.min(a,i)-o)/f;return g&&b>.15?`Overall ${t} climbs to a peak of ${r(n)} (${s}), then falls to ${r(i)} (${u}).`:y&&v>.15?`Overall ${t} drops to a low of ${r(o)} (${c}), then recovers to ${r(i)} (${u}).`:Math.abs(m)/f<.05?`${ro(t)} ends roughly where it started (${r(a)} at ${l} to ${r(i)} at ${u}), ranging between ${r(o)} and ${r(n)}.`:m>0?h===p-1?`Overall ${t} rises from ${r(a)} (${l}) to a peak of ${r(i)} (${u}).`:`Overall ${t} rises from ${r(a)} (${l}) to ${r(i)} (${u}), after peaking at ${r(n)} (${s}).`:d===p-1?`Overall ${t} falls from ${r(a)} (${l}) to a low of ${r(i)} (${u}).`:`Overall ${t} falls from ${r(a)} (${l}) to ${r(i)} (${u}), after dipping to ${r(o)} (${c}).`}function Xi(e,t,r,a,i,o,n,s){const c=ld[e],l=/^[aeiou]/i.test(c)?"an":"a";let u,d;switch(e){case"locating":u="This is a map",d="read values by location";break;case"presenting":u="This is a single-value display",d=`read ${"string"==typeof r.label&&r.label?r.label:i} as the headline number`;break;case"tracing":u=`This is ${l} ${c} chart`,d="follow the movement between states";break;case"nesting":u=`This is ${l} ${c} chart`,d="read it for nested structure and how children sum into their parents";break;case"relating":u=`This is ${l} ${c} chart`,d=`read it for whether ${o} and ${i} move together`;break;default:u=`This is ${l} ${c} chart`,d=Zi(e,a,i,o,n,t)}return`${u}; ${d}.${to(t,s)}`}function Zi(e,t,r,a,i,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 ${r}`;case"comparing":return`compare ${r} across ${a}`;case"ranking":return`read it top to bottom by ${r}`;case"apportioning":return`read each ${a}'s share of the whole`;case"characterizing":return`read it for the spread and shape of ${r}`;default:return"read the highlighted features"}switch(e){case"alerting":return Qi(t,i,o);case"tracking":return`read it for the trajectory of ${r}, which ${eo(t)} from ${i(t.first)} (${t.firstLabel}) to ${i(t.last)} (${t.lastLabel})`;case"comparing":return`compare ${r} across ${a}; ${t.maxLabel} leads at ${i(t.max)}`;case"ranking":return`read it top to bottom by ${r}; ${t.maxLabel} ranks highest at ${i(t.max)}`;case"apportioning":{const e=t.mean*t.count,r=e>0?Math.round(t.max/e*100):null;return`read each ${a}'s share of the ${i(e)} total; ${t.maxLabel} is the largest at ${i(t.max)}${null!=r?` (${r}%)`:""}`}case"characterizing":return`read it for the spread of ${r}, from ${i(t.min)} to ${i(t.max)}`;default:return"read the highlighted features"}}function Qi(e,t,r){if(Zu.has(r)||Qu.has(r))return`${e.maxLabel} stands out at ${t(e.max)} — check it first`;const{first:a,last:i,min:o,max:n,minLabel:s,maxLabel:c,lastLabel:l,minIndex:u,maxIndex:d,count:h}=e,p=n-o;if(p>0){const e=d>0&&d<h-1,r=u>0&&u<h-1,f=(n-Math.max(a,i))/p,m=(Math.min(a,i)-o)/p;if(e&&f>.15)return`the peak of ${t(n)} at ${c} is the point to investigate`;if(r&&m>.15)return`the dip to ${t(o)} at ${s} is the point to investigate`;if(i>=n)return`the climb to ${t(i)} at ${l} warrants a closer look`;if(i<=o)return`the drop to ${t(i)} at ${l} warrants a closer look`}return`the extremes — ${c} (${t(n)}) and ${s} (${t(o)}) — are the points to check`}function eo(e){const t=e.max-e.min,r=e.last-e.first;return 0===t||Math.abs(r)/t<.05?"holds roughly steady":r>0?"rises":"falls"}function to(e,t){if(!t)return"";const r=t.familiarity?.[e];return"number"==typeof r&&r<=2?` This ${ji(e)} may be unfamiliar${t.name?` to ${t.name.toLowerCase()} readers`:""} — lean on this description.`:""}function ro(e){return e.length?e[0].toUpperCase()+e.slice(1):e}function ao(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:`${t}s`}function io(e){return li(e)}function oo(e,t,r,a){const i=bi(t,["nominal","ordinal"]),o=t.dataRoles.filter(e=>"quantitative"===e.semanticType),n=i?gi(i,r,a):void 0,s=[];n&&null!=e[n]&&s.push(si(e[n]));for(const t of o){const i=gi(t,r,a);i&&null!=e[i]&&s.push(`${t.role}: ${si(e[i])}`)}return s.length>0?s.join(", "):"Data item"}function no(e,t,r={}){const a=fi(t),i=pi(t),o=Math.max(1,r.maxLeaves??200),n=r.locale??"en";if("function"==typeof e.navigation)return e.navigation({data:a,config:i,locale:n});const s=(c=e.navigation)&&"object"==typeof c?e.navigation:void 0;var c;const l=(s?.groupByRole?yi(e,s.groupByRole):void 0)??(s?.groupBy?.[0]?yi(e,s.groupBy[0])??e.dataRoles.find(e=>e.field===s.groupBy?.[0]):void 0)??bi(e,["nominal","ordinal"]),u=l?gi(l,i,a):void 0,d=(s?.idRole?yi(e,s.idRole):void 0)??bi(e,["identifier"]),h=d?gi(d,i,a):void 0,p={id:"root",role:"chart",label:s?.summaryTemplate?vi(s.summaryTemplate,void 0,e,i,a,{count:a.length}):`${e.name}: ${a.length} ${1===a.length?"item":"items"} represented.`,level:1,children:[]};let f=0;const m=(t,r,o)=>{const n=h?t[h]:void 0,c=s?.itemLabelTemplate?vi(s.itemLabelTemplate,t,e,i,a,{count:a.length}):oo(t,e,i,a);return{id:`datum-${io(n??r)}`,role:"datum",label:c,level:o,datum:t}};if(u){const e=/* @__PURE__ */new Map;for(const t of a){const r=si(t[u],"Uncategorized"),a=e.get(r);a?a.push(t):e.set(r,[t])}p.children=[...e].map(([e,t],r)=>{const a=Math.max(0,o-f),i=t.slice(0,a);f+=i.length;const n=i.map((e,t)=>m(e,1e5*r+t,3));return i.length<t.length&&n.push({id:`more-${io(e)}`,role:"datum",label:`…and ${t.length-i.length} more items`,level:3}),{id:`group-${io(e)}`,role:"series",label:`${e}: ${t.length} ${1===t.length?"item":"items"}.`,level:2,children:n}})}else{const e=a.slice(0,o);p.children=e.map((e,t)=>m(e,t,2)),e.length<a.length&&p.children.push({id:"more",role:"datum",label:`…and ${a.length-e.length} more items`,level:2})}return p}function so(e,t,r){return`${e} ${1===e?t:r}`}function co(e,t){if(0===e.numericLeaves)return"";const r=t(e.leafTotal);return e.numericLeaves===e.leaves?`, leaf total ${r}`:`, known leaf total ${r} across ${so(e.numericLeaves,"valued leaf","valued leaves")}`}function lo(e){return"TreeDiagram"===e?"tree":"Treemap"===e?"treemap":"CirclePack"===e?"circle-packing":"orbit"}function uo(e,t,r,a){const i=Ee(t.data)?t.data:null,o=t.childrenAccessor,n=t.valueAccessor,s=t.nodeLabel??t.nodeIdAccessor,c=/* @__PURE__ */new WeakMap,l=e=>{const t=c.get(e);if(void 0!==t)return t??{descendants:0,depth:0,leaves:0,numericLeaves:0,leafTotal:0};c.set(e,null);const r=di(e,o),a=0===r.length,i=a?ci(ni(e,n,"value")):void 0,s={descendants:0,depth:1,leaves:a?1:0,numericLeaves:null==i?0:1,leafTotal:i??0};for(const e of r){const t=l(e);s.descendants+=1+t.descendants,s.depth=Math.max(s.depth,t.depth+1),s.leaves+=t.leaves,s.numericLeaves+=t.numericLeaves,s.leafTotal+=t.leafTotal}return c.set(e,s),s};let u=0;const d=/* @__PURE__ */new WeakSet,h=(e,t,i)=>{const c=si(ni(e,s,"name"),`item ${i}`);if(d.has(e))return{id:`hierarchy-${li(i)}-cycle`,role:"datum",level:t,label:`Repeated hierarchy reference to ${c}; branch omitted.`};const p=di(e,o),f=l(e);if(0===p.length){if(u>=r)return null;u+=1;const o=ci(ni(e,n,"value"));return{id:`hierarchy-${li(i)}-${li(c)}`,role:"datum",level:t,label:`${c}${null==o?"":`: ${a(o)}`}.`,...null==o?{}:{value:o},datum:e}}d.add(e);const m=[];let g=0;for(const[e,a]of p.entries()){if(u>=r){g+=l(a).leaves;continue}const o=h(a,t+1,`${i}-${e}`);o&&m.push(o)}return d.delete(e),g>0&&m.push({id:`hierarchy-${li(i)}-more`,role:"datum",level:t+1,label:`${so(g,"more leaf","more leaves")} in ${c} not shown; navigation is capped at ${r}.`}),{id:`hierarchy-${li(i)}-${li(c)}`,role:"series",level:t,label:`${c}: ${so(p.length,"direct child","direct children")}, ${so(f.descendants,"total descendant","total descendants")}, ${so(f.leaves,"leaf","leaves")}${co(f,a)}.`,datum:e,children:m}},p=i?l(i):null,f={id:"root",role:"chart",level:1,label:i?`A ${lo(e)} chart with ${so(p.leaves,"leaf","leaves")} and ${so(p.descendants,"total descendant","total descendants")} across ${so(p.depth,"hierarchy level","hierarchy levels")}${co(p,a)}.`:"A hierarchy chart with no hierarchy data loaded.",children:[]};if(i){const e=h(i,2,"root");if(e){const t=si(ni(i,s,"name"),"");f.children="series"===e.role&&""===t?e.children:[e]}}return f}function ho(e){if(Array.isArray(e))return Ja(e);if(!e||"object"!=typeof e)return[];const t=e;return Array.isArray(t.features)?Ja(t.features):"Feature"===t.type?[t]:[]}function po(e,t,r){const a=ni(e,t,r);if(void 0!==a)return a;const i=e.properties;return i&&"object"==typeof i?ni(i,t,r):void 0}function fo(e,t,r){return si(po(e,t,"id")??po(e,"name","name")??po(e,"NAME","NAME")??po(e,"label","label"),r)}function mo(e){let t=0,r=1/0,a=-1/0,i=0;for(const o of e)null!=o.value&&(t+=1,r=Math.min(r,o.value),a=Math.max(a,o.value),i+=o.value);return 0===t?null:{count:t,min:r,max:a,total:i,average:i/t}}function go(e,t){const r=mo(e);return r?`range ${t(r.min)} to ${t(r.max)}, average ${t(r.average)}, total ${t(r.total)}`:"no numeric values"}function yo(e){const t=e.filter(e=>null!=e.value),r=e.filter(e=>null==e.value),a=[],i=mo(t);if(i)if(i.min===i.max)a.push({id:"equal",label:"Equal values",rows:t});else{const e=i.min+(i.max-i.min)/3,r=i.min+2*(i.max-i.min)/3,o=t.filter(e=>e.value>=r),n=t.filter(t=>t.value>=e&&t.value<r),s=t.filter(t=>t.value<e);o.length>0&&a.push({id:"highest",label:"Highest values",rows:o}),n.length>0&&a.push({id:"middle",label:"Middle values",rows:n}),s.length>0&&a.push({id:"lowest",label:"Lowest values",rows:s})}return r.length>0&&a.push({id:"missing",label:"No numeric value",rows:r}),a}function bo(e,t,r){const a=e.filter(e=>null!=e.value).sort((e,t)=>t.value-e.value||e.index-t.index),i=/* @__PURE__ */new Map;let o,n=0;for(const[e,t]of a.entries())o!==t.value&&(n=e+1,o=t.value),i.set(t.index,n);let s=0;return yo(e).map(e=>{const o=Math.max(0,t-s),n=e.rows.slice(0,o);s+=n.length;const c=n.map(e=>{const t=i.get(e.index),o=null==t||a.length<2?"":`, rank ${t} of ${a.length}`;return{id:`geo-${li(e.label)}-${e.index}`,role:"datum",level:3,label:null==e.value?`${e.label}: no numeric value.`:`${e.label}: ${r(e.value)}${o}.`,...null==e.value?{}:{value:e.value},datum:e.datum}}),l=e.rows.length-n.length;return l>0&&c.push({id:`geo-${e.id}-more`,role:"datum",level:3,label:`${l} more ${1===l?"region":"regions"} in ${e.label.toLowerCase()} not shown; navigation is capped at ${t}.`}),{id:`regions-${e.id}`,role:"series",level:2,label:`${e.label}: ${e.rows.length} ${1===e.rows.length?"region":"regions"}, ${go(e.rows,r)}.`,children:c}})}function vo(e,t,r,a){const i=ho(t.areas),o="FlowMap"===e&&Array.isArray(t.nodes)?t.nodes:Array.isArray(t.points)?t.points:[],n=Array.isArray(t.flows)?t.flows:[],s=Array.isArray(t.lines)?t.lines:[],c=t.valueAccessor??t.sizeBy??t.costAccessor??"value",l=t.pointIdAccessor??t.nodeIdAccessor??"id",u=("ChoroplethMap"===e?i:o).map((r,a)=>({datum:r,index:a,label:fo(r,"ChoroplethMap"===e?t.idAccessor:l,`${"ChoroplethMap"===e?"region":"location"} ${a+1}`),value:ci(po(r,c,"value"))})),d=u.filter(e=>null!=e.value),h={id:"root",role:"chart",level:1,label:`${"ChoroplethMap"===e?`A choropleth map with ${i.length} regions.${d.length>0?` Values are available for ${d.length} of ${i.length} regions; ${go(d,a)}.`:" No regions have numeric values."}`:"FlowMap"===e?`A flow map with ${n.length} flows and ${o.length} locations.`:"DistanceCartogram"===e?`A distance cartogram with ${o.length} locations and ${s.length} routes.`:`A proportional-symbol map with ${o.length} locations.`}${ui(t,"Use linked highlighting to compare related locations.")}`,children:[]};if("ChoroplethMap"===e)h.children=bo(u,r,a);else if(u.length>0){const e=u.slice(0,r).map(e=>({id:`geo-${li(e.label)}-${e.index}`,role:"datum",level:3,label:`${e.label}${null==e.value?"":`: ${a(e.value)}`}.`,...null==e.value?{}:{value:e.value},datum:e.datum}));u.length>r&&e.push({id:"geo-more",role:"datum",level:3,label:`…and ${u.length-r} more locations.`}),h.children?.push({id:"locations",role:"series",level:2,label:`Locations: ${u.length} marks.`,children:e})}const p="FlowMap"===e?n:s;if(p.length>0){const e=p.slice(0,r).map((e,t)=>{const r=si(e.source,"unknown"),i=si(e.target,"unknown"),o=ci(ni(e,c,"value"));return{id:`route-${li(r)}-${li(i)}-${t}`,role:"datum",level:3,label:`${r} to ${i}${null==o?"":`: ${a(o)}`}.`,...null==o?{}:{value:o},datum:e}});h.children?.push({id:"routes",role:"series",level:2,label:`Routes: ${p.length} ${1===p.length?"route":"routes"}.`,children:e})}return h}function wo(e,t={},r={}){return!!mi(e,t,r.recipe)||md.has(e)||gd.has(e)||yd.has(e)||Xu.has(e)||Zu.has(e)||Qu.has(e)||ed.has(e)}function Ao(e,t){t&&e.children?.push(t)}function xo(e,t,r,a){t=Xa(t);const i=Array.isArray(t.nodes)?t.nodes:[],o=Array.isArray(t.edges)?t.edges:Array.isArray(t.flows)?t.flows:[],n=t.nodeIdAccessor??t.nodeIDAccessor,s=t.sourceAccessor??"source",c=t.targetAccessor??"target",l=t.valueAccessor??"value",u=e=>si(ni(e,n,"id"),"unknown"),d=(e,t)=>si(ni(e,t,""),"unknown"),h=/* @__PURE__ */new Set;for(const e of o)h.add(d(e,s)),h.add(d(e,c));const p=i.length>0?i:[...h].map(e=>({id:e})),f=/* @__PURE__ */new Map;for(const e of p)f.set(u(e),{links:0,value:0});for(const e of o){const t=d(e,s),r=d(e,c),a=ci(ni(e,l,"value"))??0;for(const e of[t,r]){const t=f.get(e)??{links:0,value:0};t.links+=1,t.value+=a,f.set(e,t)}}const m={id:"root",role:"chart",level:1,label:`A ${"SankeyDiagram"===e||"ProcessSankey"===e?"flow diagram":"ChordDiagram"===e?"chord diagram":"network graph"} with ${p.length} nodes and ${o.length} links.${ui(t,"Use linked highlighting to trace related marks.")}`,children:[]};let g=0;const y=/* @__PURE__ */new Map,b=t.colorBy??"group";for(const e of p){const t=si(ni(e,b,"group"),"Ungrouped"),r=y.get(t);r?r.push(e):y.set(t,[e])}const v=[...y].map(([e,t],i)=>{const o=[];for(const[e,n]of t.entries()){if(g>=r)break;g+=1;const t=u(n),s=f.get(t)??{links:0,value:0},c=s.value>0?`, ${a(s.value)} total flow`:"";o.push({id:`node-${i}-${e}-${li(t)}`,role:"datum",level:3,label:`${t}: ${s.links} ${1===s.links?"link":"links"}${c}.`,value:s.value>0?s.value:void 0,datum:n})}return{id:`nodes-${i}-${li(e)}`,role:"series",level:2,label:`${e}: ${t.length} ${1===t.length?"node":"nodes"}.`,children:o}});v.length>0&&m.children?.push(...v);const w=o.slice(0,r).map((e,t)=>{const r=d(e,s),i=d(e,c),o=ci(ni(e,l,"value"));return{id:`link-${li(r)}-${li(i)}-${t}`,role:"datum",level:3,label:`${r} to ${i}${null==o?"":`: ${a(o)}`}.`,value:o,datum:e}});return o.length>r&&w.push({id:"links-more",role:"datum",level:3,label:`…and ${o.length-r} more links.`,value:void 0}),w.length>0&&m.children?.push({id:"links",role:"series",level:2,label:`Links: ${o.length} ${1===o.length?"connection":"connections"}.`,children:w}),m}function $o(e,t){const r=Array.isArray(e.annotations)?e.annotations:null;if(!r)return null;const a=oi(r.filter(e=>!!e&&"object"==typeof e));if(0===a.length)return null;let i=0;const o=a.slice(0,t).map(e=>{const t=e.lifecycle?.status,r=t&&"accepted"!==t?` (${t})`:"";return{id:"annotation-"+i++,role:"annotation",level:3,label:`${a=Wi(e),a?a.charAt(0).toUpperCase()+a.slice(1):a}${r}.`,datum:e};var a});a.length>t&&o.push({id:"annotation-"+i++,role:"annotation",level:3,label:`…and ${a.length-t} more annotations.`});const n=a.length;return{id:"annotations",role:"annotation",level:2,label:`Annotations: ${1===n?"one marked feature":`${n} marked features`}.`,children:o}}function Co(e,t,r={}){t=Xa(t);const a=r.locale??"en",i=Math.max(1,r.maxLeaves??200),o=Ui(a),n=mi(e,t,r.recipe);if(n)return no(n,t,{maxLeaves:i,locale:a});const s={id:"root",role:"chart",label:Yi(e,t,{locale:a}).text||"Chart.",level:1,children:[]},c=$o(t,i);if(md.has(e)){const r=xo(e,t,i,o);return Ao(r,c),r}if(gd.has(e)){const r=uo(e,t,i,o);return Ao(r,c),r}if(yd.has(e)){const r=vo(e,t,i,o);return Ao(r,c),r}const l=Array.isArray(t.data)?t.data:null,u=wo(e,t,r);if(!l||0===l.length||!u)return c&&(s.children=[c]),s;const{measure:d,measureFallback:h,dimension:p,dimensionFallback:f}=ri(e,t),m=ei(d,h),g=Ka(p,f),y="string"==typeof d&&d?d:h,b="string"==typeof p&&p?p:f,v=ai(t);let w=0;const A=e=>`${e}-${w++}`,x=(e,t)=>{const r=m(e),a=ii(g(e),o);return{id:A("datum"),role:"datum",level:t,label:`${a}: ${Number.isFinite(r)?o(r):"—"}`,value:Number.isFinite(r)?r:void 0,datum:e}},$=(e,t)=>{const r=e.slice(0,i).map(e=>x(e,t));return e.length>i&&r.push({id:A("more"),role:"datum",level:t,label:`…and ${e.length-i} more points`}),r},C=[];if(Xu.has(e)||Zu.has(e)){let t=1/0,r=-1/0,a=1/0,i=-1/0;const n=[];let s=!0;for(const e of l){const o=m(e);Number.isFinite(o)&&(o<t&&(t=o),o>r&&(r=o));const c=g(e);n.push(c),"number"==typeof c&&Number.isFinite(c)?(c<a&&(a=c),c>i&&(i=c)):s=!1}const c=/* @__PURE__ */new Set,u=[];for(const e of n){const t=si(e);c.has(t)||(c.add(t),u.push(e))}const d=s?`${o(a)} to ${o(i)}`:`${ii(u[0],o)} to ${ii(u[u.length-1],o)} (${Zu.has(e)?`${u.length} categories`:`${l.length} points`})`;C.push({id:A("axis"),role:"axis",level:2,label:`${Zu.has(e)?"Category axis":"X axis"}: ${b}, ${d}.`}),r>=t&&C.push({id:A("axis"),role:"axis",level:2,label:`Value axis: ${y}, ${o(t)} to ${o(r)}.`})}if(v){const r=Ka(v,v),i=/* @__PURE__ */new Map;for(const e of l){const t=si(r(e)),a=i.get(t);a?a.push(e):i.set(t,[e])}const o=[];for(const[r,n]of i){const i=Yi(e,{...t,data:n},{levels:["l2","l3"],locale:a}).text;o.push({id:A("series"),role:"series",level:2,label:`Series ${r}: ${i}`,children:$(n,3)})}s.children=[...C,...o]}else s.children=[...C,...$(l,2)];return c&&s.children.push(c),s}function So(e,t){const r=[],a=e=>{if(r.push(e),e.children&&e.children.length>0&&t.has(e.id))for(const t of e.children)a(t)};return a(e),r}function ko(e){let t=1;if(e.children)for(const r of e.children)t+=ko(r);return t}function Ro(e){return Ee(e)?e:void 0}function Po(e){const t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:void 0}function Eo(e){const t=Po(e);return null==t?void 0:Math.max(0,Math.floor(t))}function No(...e){return e.map(Ro).find(Boolean)}function To(...e){return e.find(Array.isArray)}function Io(e){const t={};for(const[r,a]of Object.entries(e))void 0!==a&&(t[r]=a);return t}function Oo(e,t,r){return e["string"==typeof t&&t?t:r]}function Mo(e){return"number"==typeof e?Number.isInteger(e)?String(e):String(Math.round(1e3*e)/1e3):si(e)}function jo(e,t,r){const a=[];if("GaugeChart"===e){"number"==typeof t.value&&Number.isFinite(t.value)&&a.push(`Current value is ${Mo(t.value)}.`);const e="number"==typeof t.min&&Number.isFinite(t.min)?t.min:0,r="number"==typeof t.max&&Number.isFinite(t.max)?t.max:100;a.push(`The gauge scale runs from ${Mo(e)} to ${Mo(r)}.`)}if("SankeyDiagram"===e||"ProcessSankey"===e){const i=Array.isArray(t.edges)?t.edges:[];if("ProcessSankey"===e&&Array.isArray(t.domain)&&2===t.domain.length&&a.push(`The ProcessSankey time domain runs from ${Mo(t.domain[0])} to ${Mo(t.domain[1])}.`),i.length>0){a.push(`${i.length} source flow${1===i.length?"":"s"} are supplied.`);for(const o of i.slice(0,r)){const r=Oo(o,t.sourceAccessor,"source"),i=Oo(o,t.targetAccessor,"target"),n=Oo(o,t.valueAccessor,"value"),s="ProcessSankey"===e&&(null!=o.startTime||null!=o.endTime);a.push(s?`${Mo(r)} to ${Mo(i)} has value ${Mo(n)} over ${Mo(o.startTime)}–${Mo(o.endTime)}.`:`${Mo(r)} to ${Mo(i)} has value ${Mo(n)}.`)}}}if("Treemap"===e||"CirclePack"===e||"TreeDiagram"===e||"OrbitDiagram"===e){const e=Ee(t.data)?t.data:void 0,i="string"==typeof t.valueAccessor&&t.valueAccessor?t.valueAccessor:"value",o="string"==typeof t.nodeIdAccessor&&t.nodeIdAccessor?t.nodeIdAccessor:"string"==typeof t.nodeIDAccessor&&t.nodeIDAccessor?t.nodeIDAccessor:"name",n=[],s=/* @__PURE__ */new WeakSet,c=e=>{if(s.has(e))return;const r=di(e,t.childrenAccessor);if(0!==r.length){s.add(e);for(const e of r)c(e);s.delete(e)}else n.push(e)};if(e&&c(e),n.length>0){a.push(`${n.length} hierarchy leaves are supplied.`);for(const e of n.slice(0,r))a.push(`${Mo(e[o])} has value ${Mo(e[i])}.`)}}if(bd.has(e)&&Array.isArray(t.data)){const r=t.data;a.push(`${r.length} observed source row${1===r.length?"":"s"} are supplied.`);const i="CollisionSwarmChart"===e?t.xAccessor:t.valueAccessor,o="CollisionSwarmChart"===e?"x":"value",n=r.map(e=>Po(Oo(e,i,o))).filter(e=>null!=e);if(n.length>0){const[e,t]=P(n);a.push(`Observed ${"string"==typeof i?i:o} ranges from ${Mo(e)} to ${Mo(t)}.`)}}if(0!==a.length)return{source:"chart-props",statements:a,text:`Exact chart-prop facts: ${a.join(" ")}`}}function Fo(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:`${t}s`}function zo(e){return Number.isInteger(e)?String(e):String(Math.round(1e3*e)/1e3)}function Lo(e,t,r,a){const i=Ro(e.settledProjection),o=Ro(t?.settledProjection);return To(r?.projectionRows,r?.aggregates,e.settledProjectionRows,e.projectionRows,i?.rows,t?.settledProjectionRows,t?.projectionRows,o?.rows,a?.binCounts)}function Bo(e){if(!e||0===e.length)return;const t=e.map((e,t)=>{const r=Ro(e);if(!r)return;const a=Po(r.count??r.value??r.total??r.bodies??r.events);if(null==a)return;const i=si(r.label??r.id??r.name,`container ${t+1}`),o=null==r.id?void 0:si(r.id),n=Po(r.secondary??r.secondaryCount),s=Po(r.observed??r.observedCount);return Io({id:o,label:i,count:a,secondary:n,secondaryLabel:"string"==typeof r.secondaryLabel?r.secondaryLabel:void 0,observed:s})}).filter(e=>null!=e);if(0===t.length)return;const r=t.reduce((e,t)=>e+t.count,0),a=t.filter(e=>e.count>0).length,i=t.slice().sort((e,t)=>t.count-e.count)[0];return{rows:t,totalCount:r,populatedCount:a,...i?{leader:i}:{}}}function Do(e,t){const r=e?.map((e,t)=>{const r=Ro(e);if(!r)return;const a=Po(r.count)??0,i=Po(r.total),o={label:si(r.label??r.id,`sediment ${t+1}`),count:a};return null!=r.id&&(o.id=si(r.id)),null!=i&&(o.total=i),o}).filter(e=>null!=e),a=Eo(t?.bins)??r?.length??0,i=Po(t?.count)??r?.reduce((e,t)=>e+t.count,0)??0,o=Po(t?.total)??r?.reduce((e,t)=>e+(t.total??0),0),n=r?.slice().sort((e,t)=>t.count-e.count)[0];if(0!==a||0!==i||o)return{bins:a,count:i,...null!=o&&o>0?{total:o}:{},...n?{leader:n}:{}}}function _o(e){const t=Ro(e);return!!t&&(Ee(t.world)||"simulationState"in t||"liveBodyOrder"in t)}function Uo(e){if(e)return e.filter(e=>!0===Ro(e)?.sleeping).length}function Go(e,t,r){const a=e?.filter(e=>!0===Ro(e)?.sensor).length,i=Ro(t?.observation),o=Ro(i?.sensors),n=To(r?.activeSensors);return Math.max(a??0,o?Object.keys(o).length:0,n?.length??0)||void 0}function Vo(e){const t=[],r=e.simulation,a=[r.state??(r.settled?"settled":void 0),null!=r.liveBodies?`${r.liveBodies} live ${Fo(r.liveBodies,"body")}`:void 0,null!=r.sleepingBodies?`${r.sleepingBodies} sleeping`:void 0,null!=r.queued?`${r.queued} queued`:void 0,null!=r.seed?`seed ${zo(r.seed)}`:void 0,r.gravity?`gravity (${zo(r.gravity.x)}, ${zo(r.gravity.y)})`:void 0,null!=r.fixedDt?`fixed step ${zo(r.fixedDt)}s`:void 0,null!=r.timeScale?`${zo(r.timeScale)}x time`:void 0].filter(Boolean);a.length>0&&t.push(`Physics simulation: ${a.join("; ")}.`);const i=e.geometry;if(i){const e=[null!=i.colliders?`${i.colliders} ${Fo(i.colliders,"collider")}`:void 0,null!=i.sensors?`${i.sensors} ${Fo(i.sensors,"sensor")}`:void 0,null!=i.springs?`${i.springs} ${Fo(i.springs,"spring")}`:void 0,null!=i.activeSensorPairs?`${i.activeSensorPairs} active sensor ${Fo(i.activeSensorPairs,"pair")}`:void 0].filter(Boolean);e.length>0&&t.push(`Physics geometry: ${e.join("; ")}.`)}const o=e.aggregates;if(o){const e=o.leader,r=e?` Largest is ${e.label} with ${zo(e.count)}.`:"";t.push(`Physics aggregates: ${zo(o.totalCount)} settled ${Fo(o.totalCount,"body")} across ${o.rows.length} ${Fo(o.rows.length,"container")}; ${o.populatedCount} populated.${r}`)}const n=e.sediment;if(n){const e=null!=n.total?`, value total ${zo(n.total)}`:"",r=n.leader?`; largest sediment bin is ${n.leader.label} with ${zo(n.leader.count)}`:"";t.push(`Physics sediment: ${n.count} retained ${Fo(n.count,"body")} in ${n.bins} ${Fo(n.bins,"bin")}${e}${r}.`)}return t.join(" ")}function Ho(e,t,r){if(!1===r)return;const a=Ro(r),i=Ro(t.physics),o=No(a?.snapshot,i?.snapshot,t.physicsSnapshot,_o(t.snapshot)?t.snapshot:void 0),n=No(a?.evidence,i?.evidence,t.physicsEvidence,t.settledEvidence),s=No(a?.config,i?.config,o?.config,t.config),c=No(Ro(o?.world),Ro(i?.world)),l=No(Ro(s?.kernel),Ro(c?.options)),u=To(c?.bodies),d=To(c?.colliders,s?.colliders),h=To(o?.queue,i?.queue),p=To(o?.liveBodyOrder),f=To(c?.springs),m=To(o?.activeSensorPairs),g=Bo(Lo(t,i,a,n)),y=Do(To(a?.sediment,i?.sediment,o?.sediment),No(a?.sedimentTotals,i?.sedimentTotals)),b=p?.length??u?.length??Eo(n?.bodyCount),v=Uo(u)??Eo(n?.sleepingCount),w=h?.length,A="string"==typeof o?.simulationState?o.simulationState:void 0,x="boolean"==typeof n?.settled?n.settled:A?"settled"===A:null!=b||null!=v||null!=w?null!=b&&v===b&&0===(w??0):void 0,$=Ro(l?.gravity),C=Po($?.x),S=Po($?.y),k=Io({state:A,settled:x,elapsedSeconds:Po(o?.elapsedSeconds),paused:"boolean"==typeof o?.paused?o.paused:void 0,visible:"boolean"==typeof o?.visible?o.visible:void 0,seed:Po(l?.seed),gravity:null!=C&&null!=S?{x:C,y:S}:void 0,fixedDt:Po(s?.fixedDt??l?.fixedDt),timeScale:Po(s?.timeScale),maxSubsteps:Eo(s?.maxSubsteps),liveBodies:b,sleepingBodies:v,queued:w,bodyLimit:Po(s?.bodyLimit),eviction:"string"==typeof s?.eviction?s.eviction:void 0}),R=Io({colliders:d?.length,sensors:Go(d,s,c),springs:f?.length,activeSensorPairs:m?.length}),P=Object.keys(R).length>0,E=bd.has(e);if(!(Object.keys(k).length>0||P||g||y)||!E&&null==r)return;const N={simulation:k,...P?{geometry:R}:{},...g?{aggregates:g}:{},...y?{sediment:y}:{}},T=Vo(N);return{...N,text:T}}function Wo(e){if(!e)return{};if("fits"in e||"buildProps"in e)return{family:e.family};const t=e;return{family:t.family,intentScores:t.intentScores}}function qo(e,t,r={}){t=Xa(t);const{capability:a,audience:i,locale:o}=r,n=r.levels??["l1","l2","l3"],s=!1!==r.includeStructure,c=Di(e,a),l=Yi(e,t,{levels:c?[...n,"l4"]:n,locale:o,capability:a,audience:i}),{l4:u,...d}=l.levels,h=["l1","l2","l3"].map(e=>l.levels[e]).filter(Boolean).join(" "),p={levels:d,text:l.annotations?`${l.annotations} ${h}`.trim():h,...l.annotations?{annotations:l.annotations}:{}};let f;if(c&&u){const e=Wo(a);f={act:c,sentence:u,family:e.family,intentScores:e.intentScores}}const m=s?Co(e,t,{maxLeaves:r.maxLeaves,locale:o}):void 0,g=Ho(e,t,r.physics),y=jo(e,t,Math.max(1,r.maxLeaves??200)),b=[p.text,f?.sentence,g?.text,y?.text].filter(Boolean).join(" ");return{component:e,description:p,intent:f,structure:m,physics:g,facts:y,text:b}}function Yo(e,t=30,r=1){return Math.max((e??4)+5/r,12/r,t)}function Ko(e,t){return t?.length?(Object.defineProperty(e,vd,{configurable:!0,enumerable:!1,value:t}),e):e}function Jo(e){return e?.[vd]}function Xo(e){const t=e;return Jo(!0===t?.__semioticHoverData?t.data:e)}function Zo(e,t){return Object.defineProperty(e,wd,{configurable:!0,enumerable:!1,value:t}),e}function Qo(e){if(null==e||"string"==typeof e&&""===e.trim())return NaN;if(e instanceof Date)return e.getTime();if("string"==typeof e){const t=Tt(e);if(Number.isFinite(t))return t}return Number(e)}function en(e){return t=>"number"!=typeof t.binStart||"number"!=typeof t.binEnd?t:Zo(Ko({...t},Jo(t)),{ranges:{[e]:[t.binStart,t.binEnd]},toNumber:Qo})}function tn(e,t){return Ad.has(e)&&!("reading"===e&&"string"==typeof t)}function rn(e){const t=[...Cd],r=Array.from((new TextEncoder).encode(e)),a=8*r.length;for(r.push(128);r.length%64!=56;)r.push(0);const i=Math.floor(a/4294967296),o=a>>>0;r.push(i>>>24&255,i>>>16&255,i>>>8&255,255&i,o>>>24&255,o>>>16&255,o>>>8&255,255&o);const n=[];for(let e=0;e<r.length;e+=4)n.push((r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0);for(let e=0;e<n.length;e+=16){const r=[...n.slice(e,e+16)];for(let e=16;e<64;e+=1){const t=xd(r[e-15],7)^xd(r[e-15],18)^r[e-15]>>>3,a=xd(r[e-2],17)^xd(r[e-2],19)^r[e-2]>>>10;r[e]=r[e-16]+t+r[e-7]+a>>>0}let[a,i,o,s,c,l,u,d]=t;for(let e=0;e<64;e+=1){const t=d+(xd(c,6)^xd(c,11)^xd(c,25))+(c&l^~c&u)+Sd[e]+r[e]>>>0,n=a&i^a&o^i&o;d=u,u=l,l=c,c=s+t>>>0,s=o,o=i,i=a,a=t+((xd(a,2)^xd(a,13)^xd(a,22))+n>>>0)>>>0}const h=[a,i,o,s,c,l,u,d];for(let e=0;e<8;e+=1)t[e]=t[e]+h[e]>>>0}return t.map(e=>e.toString(16).padStart(8,"0")).join("")}function an(e,t){return`${e}[Symbol(${t.description??""})]`}function on(e,t){if(!/^(0|[1-9][0-9]*)$/.test(e))return!1;const r=Number(e);return Number.isSafeInteger(r)&&r>=0&&r<t}function nn(e,t){return"number"==typeof t?`${e}[${t}]`:e?`${e}.${t}`:t}function sn(e){return e.sort((e,t)=>{const r=JSON.stringify(e),a=JSON.stringify(t);return r<a?-1:r>a?1:0})}function cn(e,t,r){if(null===e)return null;if(e instanceof Date){const a=e.getTime();return Number.isFinite(a)?{$type:"date",value:e.toISOString()}:void r.excluded.push(t)}switch(typeof e){case"string":case"boolean":return e;case"number":return Number.isNaN(e)?{$type:"number",value:"NaN"}:e===1/0?{$type:"number",value:"Infinity"}:e===-1/0?{$type:"number",value:"-Infinity"}:Object.is(e,-0)?{$type:"number",value:"-0"}:e;case"bigint":return{$type:"bigint",value:e.toString()};case"undefined":case"function":case"symbol":return void r.excluded.push(t);case"object":{const a=e;if(r.ancestors.has(a))return void r.excluded.push(t);r.ancestors.add(a);try{if(Array.isArray(e)){for(const a of Reflect.ownKeys(e))"length"===a||"string"==typeof a&&on(a,e.length)||r.excluded.push("symbol"==typeof a?an(t,a):nn(t,a));return Array.from({length:e.length},(a,i)=>{const o=nn(t,i),n=Object.getOwnPropertyDescriptor(e,String(i));if(!n||!("value"in n)||!n.enumerable)return r.excluded.push(o),null;const s=cn(n.value,o,r);return void 0===s?null:s})}const a={},i=Object.getPrototypeOf(e);if(i!==Object.prototype&&null!==i)return void r.excluded.push(t);const o=[];for(const a of Reflect.ownKeys(e)){if("symbol"==typeof a){r.excluded.push(an(t,a));continue}const i=Object.getOwnPropertyDescriptor(e,a);i&&"value"in i&&i.enumerable?o.push(a):r.excluded.push(nn(t,a))}for(const i of o.sort()){const o=Object.getOwnPropertyDescriptor(e,i),n=cn(o&&"value"in o?o.value:void 0,nn(t,i),r);void 0!==n&&Object.defineProperty(a,i,{value:n,enumerable:!0,configurable:!0,writable:!0})}return a}finally{r.ancestors.delete(a)}}default:return void r.excluded.push(t)}}function ln(e,t=/* @__PURE__ */new Set){if(null===e)return["null"];if(e instanceof Date)return Number.isFinite(e.getTime())?["date",e.toISOString()]:["excluded"];switch(typeof e){case"string":return["string",e];case"boolean":return["boolean",e];case"number":return["number",Number.isNaN(e)?"NaN":e===1/0?"Infinity":e===-1/0?"-Infinity":Object.is(e,-0)?"-0":String(e)];case"bigint":return["bigint",e.toString()];case"undefined":case"function":case"symbol":return["excluded"];case"object":if(t.has(e))return["excluded"];t.add(e);try{const r=r=>{const a="symbol"==typeof r?["symbol-key",r.description??""]:["string-key",r],i=Object.getOwnPropertyDescriptor(e,r);return i?"value"in i?[a,"data",Boolean(i.enumerable),ln(i.value,t)]:[a,"accessor",Boolean(i.enumerable),Boolean(i.get),Boolean(i.set)]:[a,"missing"]};if(Array.isArray(e))return["array",Array.from({length:e.length},(t,a)=>{const i=String(a);return Object.prototype.hasOwnProperty.call(e,i)?r(i):["hole"]}),sn(Reflect.ownKeys(e).filter(t=>"length"!==t&&!("string"==typeof t&&on(t,e.length))).map(r))];const a=Object.getPrototypeOf(e);return[a!==Object.prototype&&null!==a?"non-json-object":"object",sn(Reflect.ownKeys(e).map(r))]}finally{t.delete(e)}default:return["excluded"]}}function un(e){const t={excluded:[],ancestors:/* @__PURE__ */new Set},r=cn(e,"$",t)??null;return{value:r,text:JSON.stringify(r),excludedPaths:t.excluded}}function dn(e){const t=un(e),r=rn(JSON.stringify(["semiotic-value-fingerprint","v2",ln(e)]));return{...t,algorithm:"sha256",digest:r,fingerprint:`sha256:${r}`}}function hn(e,t,r,a){vn(e,Object.keys(t),r,a);for(const[i,o]of Object.entries(t))o.values?(o.required||void 0!==e[i])&&An(e,i,r,o.values,a):o.required?wn(e,i,r,a):kn(e,i,r,a)}function pn(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function fn(e,t,r,a){void 0===e[t]||"number"==typeof e[t]&&Number.isFinite(e[t])||a.push({path:`${r}.${t}`,message:"Expected a finite number."})}function mn(e,t,r,a){void 0!==e[t]&&"boolean"!=typeof e[t]&&a.push({path:`${r}.${t}`,message:"Expected a boolean."})}function gn(e){return null===e||"string"==typeof e||"boolean"==typeof e||("number"==typeof e?Number.isFinite(e):Array.isArray(e)?e.every(gn):pn(e)&&Object.values(e).every(gn))}function yn(e,t,r,a){void 0===e[t]||pn(e[t])&&gn(e[t])||a.push({path:`${r}.${t}`,message:"Expected a JSON object."})}function bn(e){return e.every(gn)}function vn(e,t,r,a){const i=new Set(t);for(const t of Object.keys(e))i.has(t)||a.push({path:`${r}.${t}`,message:"Unexpected property."})}function wn(e,t,r,a){"string"==typeof e[t]&&e[t]||a.push({path:`${r}.${t}`,message:"Expected a non-empty string."})}function An(e,t,r,a,i){"string"==typeof e[t]&&a.includes(e[t])||i.push({path:`${r}.${t}`,message:`Expected one of: ${a.join(", ")}.`})}function xn(e,t,r,a){const i=e[t];if(void 0!==i){if(pn(i))return i;a.push({path:`${r}.${t}`,message:"Expected an object."})}}function $n(e,t,r,a){const i=e[t];if(void 0!==i){if(Array.isArray(i))return i;a.push({path:`${r}.${t}`,message:"Expected an array."})}}function Cn(e,t,r){e?.some(e=>"string"!=typeof e||!e)&&r.push({path:t,message:"Expected non-empty string values."})}function Sn(e,t,r,a,i){void 0!==e[t]&&An(e,t,r,a,i)}function kn(e,t,r,a){void 0!==e[t]&&"string"!=typeof e[t]&&a.push({path:`${r}.${t}`,message:"Expected a string."})}function Rn(e,t,r){pn(e)?(vn(e,["id","name","kind"],t,r),wn(e,"kind",t,r),kn(e,"id",t,r),kn(e,"name",t,r)):r.push({path:t,message:"Expected an actor object."})}function Pn(e,t){const r=xn(e,"reception","$",t);if(!r)return;vn(r,["channels","audience","strengths","risks","scaffolds","description","dataFallback","manualChecks"],"$.reception",t);const a=$n(r,"channels","$.reception",t);a||t.push({path:"$.reception.channels",message:"Expected a reception-channel array."}),a?.forEach((e,r)=>{const a=`$.reception.channels[${r}]`;pn(e)?(vn(e,["channel","disclosure","navigation","interactionInstructions","rawData","tokenBudget","privacyNotes"],a,t),An(e,"channel",a,["visual","screen-reader","sonified","agent","print","low-bandwidth"],t),Sn(e,"disclosure",a,["summary","standard","detailed"],t),Sn(e,"rawData",a,["deny","bounded","allow"],t),mn(e,"navigation",a,t),mn(e,"interactionInstructions",a,t),fn(e,"tokenBudget",a,t),Cn($n(e,"privacyNotes",a,t),`${a}.privacyNotes`,t)):t.push({path:a,message:"Expected a channel object."})});for(const e of["strengths","risks","scaffolds","manualChecks"])Cn($n(r,e,"$.reception",t),`$.reception.${e}`,t);kn(r,"audience","$.reception",t),kn(r,"description","$.reception",t),mn(r,"dataFallback","$.reception",t)}function En(e,t){const r=xn(e,"form","$",t);r&&(vn(r,["chartFamily","whyThisForm","rejectedAlternatives","risks","misuse"],"$.form",t),kn(r,"chartFamily","$.form",t),kn(r,"whyThisForm","$.form",t),Cn($n(r,"risks","$.form",t),"$.form.risks",t),Cn($n(r,"misuse","$.form",t),"$.form.misuse",t),$n(r,"rejectedAlternatives","$.form",t)?.forEach((e,r)=>{const a=`$.form.rejectedAlternatives[${r}]`;pn(e)?(vn(e,["representation","reason"],a,t),wn(e,"representation",a,t),wn(e,"reason",a,t)):t.push({path:a,message:"Expected an alternative object."})}))}function Nn(e,t){const r=xn(e,"contestability","$",t);r&&(vn(r,["sourceRequestsAllowed","alternativeViews","challenges","corrections","editorialExceptions"],"$.contestability",t),mn(r,"sourceRequestsAllowed","$.contestability",t),$n(r,"challenges","$.contestability",t)?.forEach((e,r)=>{const a=`$.contestability.challenges[${r}]`;if(pn(e)){vn(e,["id","claimId","status","reason","raisedBy","raisedAt","counterclaimId","resolution"],a,t),wn(e,"id",a,t),wn(e,"claimId",a,t),wn(e,"reason",a,t),An(e,"status",a,["open","accepted","declined","resolved"],t),void 0!==e.raisedBy&&Rn(e.raisedBy,`${a}.raisedBy`,t);for(const r of["raisedAt","counterclaimId","resolution"])kn(e,r,a,t)}else t.push({path:a,message:"Expected a challenge object."})}),$n(r,"corrections","$.contestability",t)?.forEach((e,r)=>{const a=`$.contestability.corrections[${r}]`;if(!pn(e))return void t.push({path:a,message:"Expected a correction object."});vn(e,["id","affectedClaimIds","replacementClaimIds","reason","createdAt","createdBy"],a,t),wn(e,"id",a,t),wn(e,"reason",a,t);const i=$n(e,"affectedClaimIds",a,t);i||t.push({path:`${a}.affectedClaimIds`,message:"Expected an affected-claim array."}),Cn(i,`${a}.affectedClaimIds`,t),Cn($n(e,"replacementClaimIds",a,t),`${a}.replacementClaimIds`,t),kn(e,"createdAt",a,t),void 0!==e.createdBy&&Rn(e.createdBy,`${a}.createdBy`,t)}),$n(r,"alternativeViews","$.contestability",t)?.forEach((e,r)=>{const a=`$.contestability.alternativeViews[${r}]`;pn(e)?(vn(e,["id","label","rationale"],a,t),wn(e,"id",a,t),wn(e,"label",a,t),kn(e,"rationale",a,t)):t.push({path:a,message:"Expected an alternative-view object."})}),$n(r,"editorialExceptions","$.contestability",t)?.forEach((e,r)=>{const a=`$.contestability.editorialExceptions[${r}]`;pn(e)?(vn(e,["ruleId","rationale","owner","reviewAt"],a,t),wn(e,"ruleId",a,t),wn(e,"rationale",a,t),kn(e,"owner",a,t),kn(e,"reviewAt",a,t)):t.push({path:a,message:"Expected an editorial-exception object."})}))}function Tn(e,t){const r=xn(e,"accountability","$",t);r&&(vn(r,["authors","generatedBy","dataSources","codeRef","reviews","actions"],"$.accountability",t),$n(r,"authors","$.accountability",t)?.forEach((e,r)=>Rn(e,`$.accountability.authors[${r}]`,t)),Cn($n(r,"dataSources","$.accountability",t),"$.accountability.dataSources",t),kn(r,"generatedBy","$.accountability",t),kn(r,"codeRef","$.accountability",t),$n(r,"reviews","$.accountability",t)?.forEach((e,r)=>{const a=`$.accountability.reviews[${r}]`;if(pn(e)){vn(e,["id","status","reviewer","reviewedAt","rationale","policyId"],a,t),wn(e,"id",a,t),An(e,"status",a,["pending","approved","changes-requested","rejected"],t),void 0!==e.reviewer&&Rn(e.reviewer,`${a}.reviewer`,t);for(const r of["reviewedAt","rationale","policyId"])kn(e,r,a,t)}else t.push({path:a,message:"Expected a review object."})}),$n(r,"actions","$.accountability",t)?.forEach((e,r)=>{const a=`$.accountability.actions[${r}]`;if(!pn(e))return void t.push({path:a,message:"Expected an action object."});vn(e,["id","action","actor","actedAt","claimIds","artifactId","artifactRevision","policyId","status","invalidatedByClaimId"],a,t),wn(e,"id",a,t),wn(e,"action",a,t);const i=$n(e,"claimIds",a,t);i||t.push({path:`${a}.claimIds`,message:"Expected a claim identifier array."}),Cn(i,`${a}.claimIds`,t),void 0!==e.actor&&Rn(e.actor,`${a}.actor`,t);for(const r of["actedAt","artifactId","artifactRevision","policyId","invalidatedByClaimId"])kn(e,r,a,t);Sn(e,"status",a,["proposed","taken","reversed","invalidated"],t)}))}function In(e,t){const r=xn(e,"inheritance","$",t);if(r){vn(r,["requiredPaths","prohibitedExports","privacy","rawDataDefault","preservation","sourceArtifactIds"],"$.inheritance",t);for(const e of["requiredPaths","prohibitedExports","sourceArtifactIds"])Cn($n(r,e,"$.inheritance",t),`$.inheritance.${e}`,t);Sn(r,"privacy","$.inheritance",["public","restricted","confidential","unknown"],t),Sn(r,"rawDataDefault","$.inheritance",["exclude","bounded","include"],t),Sn(r,"preservation","$.inheritance",["full-fidelity","claim-evidence-preserved","visual-only","lossy","unknown"],t)}}function On(e,t){Pn(e,t),En(e,t),Nn(e,t),Tn(e,t),In(e,t)}function Mn(e){for(const t of Object.values(e))Object.freeze(t.suppliedBy),Object.freeze(t);return Object.freeze(e)}function jn(e,t){if(void 0===e||pn(e)){if(pn(e))for(const[r,a]of Object.entries(e)){const e=`$.fieldStatus.${r}`;if(!pn(a)||"string"!=typeof a.status){t.push({path:e,message:"Expected a field state with a status."});continue}vn(a,["status","reason","suppliedBy","derived","reviewedBy"],e,t),["known","unknown","manual","not-applicable"].includes(a.status)||t.push({path:`${e}.status`,message:"Expected one of: known, unknown, manual, not-applicable."}),void 0===a.suppliedBy||"string"==typeof a.suppliedBy&&["author","system","model-proposal","import"].includes(a.suppliedBy)||t.push({path:`${e}.suppliedBy`,message:"Expected one of: author, system, model-proposal, import."}),kn(a,"reason",e,t),kn(a,"reviewedBy",e,t),mn(a,"derived",e,t);const i=Object.prototype.hasOwnProperty.call(Rd,r)?Rd[r]:void 0,o="model-proposal"===a.suppliedBy,n=o&&!0===i?.modelMayPropose&&"known"!==a.status;i&&"known"===a.status&&"string"!=typeof a.suppliedBy&&t.push({path:`${e}.suppliedBy`,message:`Known field "${r}" must identify an allowed supplier.`}),!i||"string"!=typeof a.suppliedBy||n||i.suppliedBy.includes(a.suppliedBy)||t.push({path:`${e}.suppliedBy`,message:`Field "${r}" cannot be supplied by ${a.suppliedBy}.`}),i&&!0===a.derived&&!i.derivable&&t.push({path:`${e}.derived`,message:`Field "${r}" cannot be marked as derived.`}),!i||!o||i.modelMayPropose&&"known"!==a.status||t.push({path:`${e}.suppliedBy`,message:"known"===a.status?`A model proposal cannot finalize field "${r}" as known.`:`Field "${r}" does not accept model proposals.`}),"required"!==i?.humanReview||"known"!==a.status||"string"==typeof a.reviewedBy&&a.reviewedBy.trim()||t.push({path:`${e}.reviewedBy`,message:`Known field "${r}" requires an attributable human review.`})}}else t.push({path:"$.fieldStatus",message:"Expected a field-state object."})}function Fn(e,t){const r="$.time";vn(e,[...Nd,...Object.keys(Td),"sources"],r,t);for(const a of Nd)kn(e,a,r,t);for(const[a,i]of Object.entries(Td)){const o=xn(e,a,r,t);o&&hn(o,i,`${r}.${a}`,t)}$n(e,"sources",r,t)?.forEach((e,a)=>{const i=`${r}.sources[${a}]`;pn(e)?hn(e,Id,i,t):t.push({path:i,message:"Expected a source object."})})}function zn(e){try{return Ln(e)}catch{return{valid:!1,errors:[{path:"$",message:"Artifact contract could not be inspected safely."}],warnings:[]}}}function Ln(e){const t=[],r=[];if(!pn(e))return{valid:!1,errors:[{path:"$",message:"Expected an object."}],warnings:r};const a=Gr(e);if(a.length>0)return{valid:!1,errors:a.map(e=>({path:e,message:"Expected a JSON-compatible value that survives serialization unchanged."})),warnings:r};if(vn(e,["contractVersion","artifact","purpose","claims","evidence","time","reception","form","contestability","accountability","inheritance","fieldStatus","extensions"],"$",t),e.contractVersion!==kd&&t.push({path:"$.contractVersion",message:`Expected contract version ${kd}.`}),pn(e.artifact)){vn(e.artifact,["id","kind","component","title","createdAt","configFingerprint","dataFingerprint","revision"],"$.artifact",t),wn(e.artifact,"id","$.artifact",t),An(e.artifact,"kind","$.artifact",["chart","dashboard","story","alert","agent-answer"],t);for(const r of["component","title","createdAt","configFingerprint","dataFingerprint","revision"])kn(e.artifact,r,"$.artifact",t)}else t.push({path:"$.artifact",message:"Expected an artifact identity object."});if(pn(e.purpose))if(Array.isArray(e.purpose.intents)){vn(e.purpose,["intents","communicativeAct","decisionContext","stakes","allowedUses","prohibitedUses"],"$.purpose",t),e.purpose.intents.forEach((e,r)=>{pn(e)&&"string"==typeof e.id&&e.id||t.push({path:`$.purpose.intents[${r}].id`,message:"Expected a non-empty intent identifier."}),pn(e)&&vn(e,["id","strength","source","rationale"],`$.purpose.intents[${r}]`,t),pn(e)&&void 0!==e.strength&&An(e,"strength",`$.purpose.intents[${r}]`,["primary","secondary"],t),pn(e)&&(Sn(e,"source",`$.purpose.intents[${r}]`,["author","derived","model-proposal","import"],t),kn(e,"rationale",`$.purpose.intents[${r}]`,t))});for(const r of["allowedUses","prohibitedUses"])Cn($n(e.purpose,r,"$.purpose",t),`$.purpose.${r}`,t);Sn(e.purpose,"stakes","$.purpose",["exploratory","informational","operational","high"],t),kn(e.purpose,"communicativeAct","$.purpose",t),kn(e.purpose,"decisionContext","$.purpose",t)}else t.push({path:"$.purpose.intents",message:"Expected an intent array."});else t.push({path:"$.purpose",message:"Expected a purpose object."});Array.isArray(e.claims)?e.claims.forEach((e,r)=>{if(!pn(e))return void t.push({path:`$.claims[${r}]`,message:"Expected a claim object."});vn(e,["id","text","kind","status","evidenceIds","scope","uncertainty","asOf","supersedes","authoredBy","review","tags"],`$.claims[${r}]`,t),wn(e,"id",`$.claims[${r}]`,t),An(e,"kind",`$.claims[${r}]`,["description","observation","aggregation","inference","forecast","simulation","alert","recommendation","normative"],t),An(e,"status",`$.claims[${r}]`,["supported","provisional","disputed","superseded","retracted","unsupported","unknown"],t),Array.isArray(e.evidenceIds)?e.evidenceIds.some(e=>"string"!=typeof e||!e)&&t.push({path:`$.claims[${r}].evidenceIds`,message:"Expected non-empty string evidence identifiers."}):t.push({path:`$.claims[${r}].evidenceIds`,message:"Expected an evidence identifier array."}),Cn($n(e,"supersedes",`$.claims[${r}]`,t),`$.claims[${r}].supersedes`,t),kn(e,"text",`$.claims[${r}]`,t),kn(e,"asOf",`$.claims[${r}]`,t),yn(e,"scope",`$.claims[${r}]`,t),Cn($n(e,"tags",`$.claims[${r}]`,t),`$.claims[${r}].tags`,t),void 0!==e.authoredBy&&Rn(e.authoredBy,`$.claims[${r}].authoredBy`,t);const a=xn(e,"review",`$.claims[${r}]`,t);a&&(vn(a,["status","reviewer","reviewedAt","rationale"],`$.claims[${r}].review`,t),An(a,"status",`$.claims[${r}].review`,["proposed","reviewed","approved","rejected"],t),void 0!==a.reviewer&&Rn(a.reviewer,`$.claims[${r}].review.reviewer`,t),kn(a,"reviewedAt",`$.claims[${r}].review`,t),kn(a,"rationale",`$.claims[${r}].review`,t));const i=xn(e,"uncertainty",`$.claims[${r}]`,t);if(i){vn(i,["kind","lower","upper","confidence","unit","description"],`$.claims[${r}].uncertainty`,t),An(i,"kind",`$.claims[${r}].uncertainty`,["interval","distribution","qualitative","unknown"],t);for(const e of["lower","upper","confidence"])fn(i,e,`$.claims[${r}].uncertainty`,t);kn(i,"unit",`$.claims[${r}].uncertainty`,t),kn(i,"description",`$.claims[${r}].uncertainty`,t)}}):t.push({path:"$.claims",message:"Expected a claim array."}),Array.isArray(e.evidence)?e.evidence.forEach((e,r)=>{if(!pn(e))return void t.push({path:`$.evidence[${r}]`,message:"Expected an evidence object."});vn(e,["id","role","label","source","fingerprint","dataVersion","observedAt","scope","sample","transformation","generatedClaimId","relationship"],`$.evidence[${r}]`,t),wn(e,"id",`$.evidence[${r}]`,t),An(e,"role",`$.evidence[${r}]`,["source-data","external-source","transformation","statistical-test","model-output","human-observation","policy-rule","quality-check"],t);for(const a of["label","fingerprint","dataVersion","observedAt","generatedClaimId"])kn(e,a,`$.evidence[${r}]`,t);yn(e,"scope",`$.evidence[${r}]`,t);const a=xn(e,"source",`$.evidence[${r}]`,t);if(a){vn(a,["name","uri","version","retrievedAt","publisher"],`$.evidence[${r}].source`,t);for(const e of["name","uri","version","retrievedAt","publisher"])kn(a,e,`$.evidence[${r}].source`,t)}const i=xn(e,"transformation",`$.evidence[${r}]`,t);if(i){vn(i,["id","kind","description","inputEvidenceIds","parameters","assumptions","implementation","performedAt","performedBy"],`$.evidence[${r}].transformation`,t),wn(i,"id",`$.evidence[${r}].transformation`,t),An(i,"kind",`$.evidence[${r}].transformation`,["aggregation","filter","normalization","binning","join","smoothing","forecasting","simulation","other"],t);const e=$n(i,"inputEvidenceIds",`$.evidence[${r}].transformation`,t);e?Cn(e,`$.evidence[${r}].transformation.inputEvidenceIds`,t):t.push({path:`$.evidence[${r}].transformation.inputEvidenceIds`,message:"Expected an evidence identifier array."}),Cn($n(i,"assumptions",`$.evidence[${r}].transformation`,t),`$.evidence[${r}].transformation.assumptions`,t),kn(i,"description",`$.evidence[${r}].transformation`,t),kn(i,"implementation",`$.evidence[${r}].transformation`,t),kn(i,"performedAt",`$.evidence[${r}].transformation`,t),yn(i,"parameters",`$.evidence[${r}].transformation`,t),void 0!==i.performedBy&&Rn(i.performedBy,`$.evidence[${r}].transformation.performedBy`,t)}const o=xn(e,"sample",`$.evidence[${r}]`,t);if(o){vn(o,["rowCount","fields","values","truncated"],`$.evidence[${r}].sample`,t),Cn($n(o,"fields",`$.evidence[${r}].sample`,t),`$.evidence[${r}].sample.fields`,t);const e=$n(o,"values",`$.evidence[${r}].sample`,t);e&&!bn(e)&&t.push({path:`$.evidence[${r}].sample.values`,message:"Expected JSON values."}),fn(o,"rowCount",`$.evidence[${r}].sample`,t),mn(o,"truncated",`$.evidence[${r}].sample`,t)}Sn(e,"relationship",`$.evidence[${r}]`,["descriptive","correlational","causal","unknown"],t)}):t.push({path:"$.evidence",message:"Expected an evidence array."}),jn(e.fieldStatus,t);const i=xn(e,"time","$",t);return i&&Fn(i,t),On(e,t),yn(e,"extensions","$",t),Array.isArray(e.claims)&&0===e.claims.length&&r.push({path:"$.claims",message:"The contract declares no claims."}),Array.isArray(e.evidence)&&0===e.evidence.length&&r.push({path:"$.evidence",message:"The contract declares no evidence."}),{valid:0===t.length,errors:t,warnings:r}}function Bn(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function Dn(e,t){if(!t||!Bn(e)||!Array.isArray(e.evidence))return[];const r=[];return e.evidence.forEach((e,t)=>{Bn(e)&&Object.prototype.hasOwnProperty.call(e,"sample")&&(delete e.sample,r.push(`$.evidence[${t}].sample`))}),r}function _n(e,t={}){try{return Un(e,t)}catch{const t=Gr(e);return{transfer:{status:"invalid",omittedPaths:t.length?t:["$"],warnings:["Artifact contract could not be inspected safely."]}}}}function Un(e,t){if(!Bn(e))return{transfer:{status:"invalid",omittedPaths:["artifactContract"],warnings:["Artifact contract must be a JSON object."]}};const r=un(e),a=[.../* @__PURE__ */new Set([...r.excludedPaths,...Gr(e)])].sort(),i=r.value,o=Dn(i,t.excludeEvidenceSamples),n=o.length?["Bounded evidence samples were excluded by the transfer policy."]:[],s=i?.contractVersion;if("string"!=typeof s||!s)return{contract:i,transfer:{status:"invalid",omittedPaths:[...a,...o],warnings:["Artifact contract is missing a string contractVersion.",...n]}};if(s!==kd)return{contract:i,transfer:{status:a.length>0?"invalid":"unsupported-version",omittedPaths:[...a,...o],warnings:[`Contract version ${s} is not interpreted by this runtime.`,...a.length>0?[`Non-JSON values could not be preserved at: ${a.join(", ")}.`]:[],...n]}};const c=zn(i),l=[...c.errors.map(({path:e,message:t})=>`${e}: ${t}`),...c.warnings.map(({path:e,message:t})=>`${e}: ${t}`),...a.length?[`Non-JSON values could not be preserved at: ${a.join(", ")}.`]:[],...n];return{contract:i,transfer:{status:!c.valid||a.length>0?"invalid":o.length>0?"excluded":"preserved",omittedPaths:[...a,...o],warnings:l}}}function Gn(e){const t=_n(e);if(!t.contract||"preserved"!==t.transfer.status)throw new TypeError(t.transfer.warnings.join(" ")||"Artifact contract could not be serialized without loss.");return t}function Vn(e){const t=Object.entries(e).filter(([e,t])=>tn(e,t)&&void 0!==t);if(0!==t.length)return 1===t.length&&"data"===t[0][0]?t[0][1]:Object.fromEntries(t)}function Hn(e,t=[]){if(void 0===e)return;const r=t.filter(e=>Boolean(e.transformation)).map(({id:e,transformation:t})=>({evidenceId:e,transformation:t})).sort(({evidenceId:e},{evidenceId:t})=>e<t?-1:e>t?1:0);return dn(r.length>0?{data:e,transformations:r}:e).fingerprint}function Wn(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>!tn(e,t)&&"recipeId"!==e))}function qn(e,t,r,a=Vn(t)){const i=Wn(t),o=0===Gr(i).length?dn(i).fingerprint:void 0,n=void 0!==a&&0===Gr(a).length?Hn(a,e.evidence):void 0,s="ChartRecipe"===r&&"string"==typeof t.recipeId?t.recipeId:r,c=[],l=[];return void 0!==s&&(void 0===e.artifact.component?l.push("artifact.component"):e.artifact.component!==s&&c.push("artifact.component")),void 0===e.artifact.configFingerprint||void 0===o?l.push("artifact.configFingerprint"):e.artifact.configFingerprint!==o&&c.push("artifact.configFingerprint"),void 0!==e.artifact.dataFingerprint&&n?e.artifact.dataFingerprint!==n&&c.push("artifact.dataFingerprint"):l.push("artifact.dataFingerprint"),{status:c.length>0?"mismatch":l.length>0?"unknown":"match",mismatchPaths:c,unknownPaths:l}}function Yn(e,t,r){const a=qn(e,t,r);return{mismatchPaths:[...a.mismatchPaths,...void 0!==r&&a.unknownPaths.includes("artifact.component")?["artifact.component"]:[]]}}function Kn(e,t){return[.../* @__PURE__ */new Set([...Object.keys(e),...Object.keys(t)])].filter(r=>{if(Object.prototype.hasOwnProperty.call(e,r)!==Object.prototype.hasOwnProperty.call(t,r))return!0;const a=dn(e[r]),i=dn(t[r]);return a.excludedPaths.length>0||a.fingerprint!==i.fingerprint}).map(e=>`props.${e}`).sort()}function Jn(e){if(e.startsWith("props."))return e.slice(6).split(/[.[\]]/,1)[0]}function Xn(e,t){const r=t.map(Jn).filter(e=>void 0!==e);return"artifact.dataFingerprint"===e?r.some(e=>Ad.has(e)):"artifact.configFingerprint"===e&&r.some(e=>!Ad.has(e))}function Zn(e){if(!e||"object"!=typeof e)return!1;const t=e,r=t.serializedDataFingerprint;return"string"==typeof t.status&&Od.has(t.status)&&Array.isArray(t.omittedPaths)&&t.omittedPaths.every(e=>"string"==typeof e)&&Array.isArray(t.warnings)&&t.warnings.every(e=>"string"==typeof e)&&(void 0===t.serializedConfigFingerprint||"string"==typeof t.serializedConfigFingerprint)&&(null==r||"string"==typeof r)&&(void 0===t.transferFingerprint||"string"==typeof t.transferFingerprint)}function Qn(e,t,r,a){return dn({component:t,version:a.version,createdAt:a.createdAt,...void 0!==a.recipeId?{recipeId:a.recipeId}:{},...void 0!==a.portable?{portable:a.portable}:{},...void 0!==a.manifest?{manifest:a.manifest}:{},...void 0!==a.reason?{reason:a.reason}:{},...void 0!==a.warnings?{warnings:a.warnings}:{},...void 0!==a.selections?{selections:a.selections}:{},artifactContract:r,status:e.status,omittedPaths:e.omittedPaths,warnings:e.warnings,...void 0!==e.serializedConfigFingerprint?{serializedConfigFingerprint:e.serializedConfigFingerprint}:{},...Object.prototype.hasOwnProperty.call(e,"serializedDataFingerprint")?{serializedDataFingerprint:e.serializedDataFingerprint}:{}}).fingerprint}function es(e,t,r,a,i){const o=Vn(r),n={...e,serializedConfigFingerprint:dn(Wn(r)).fingerprint,serializedDataFingerprint:void 0===o?null:dn(o).fingerprint};return{...n,transferFingerprint:Qn(n,t,a,i)}}function ts(e,t){const r=[],a=dn(Wn(t.props)).fingerprint,i=Vn(t.props),o=void 0===i?null:dn(i).fingerprint;return void 0!==e.transferFingerprint&&e.transferFingerprint!==Qn(e,t.component,t.artifactContract,t)&&r.push("artifactTransfer.transferFingerprint"),void 0!==e.serializedConfigFingerprint&&e.serializedConfigFingerprint!==a&&r.push("artifactTransfer.serializedConfigFingerprint"),Object.prototype.hasOwnProperty.call(e,"serializedDataFingerprint")&&e.serializedDataFingerprint!==o&&r.push("artifactTransfer.serializedDataFingerprint"),r}function rs(e,t){if("artifactContract"===t||"$.artifactContract"===t)return void 0!==e.artifactContract;let r,a;if("props"===t||t.startsWith("props.")?(r=e,a=t):(r=e.artifactContract,a=t.startsWith("$.")?t.slice(2):t),"$"===a||""===a)return void 0!==r;const i=[...a.matchAll(/(?:^|\.)([^.[\]]+)|\[(\d+)\]/g)].map(e=>e[1]??Number(e[2]));if(0===i.length)return!1;for(const e of i){if(null===r||"object"!=typeof r||!Object.prototype.hasOwnProperty.call(r,e))return!1;r=r[e]}return!0}function as(e,t,r,a,i){if(!t)return{};const o=Gn(t),n=i.recipeId??e,s=Yn(t,r,n),c=Kn(r,a),l=Yn(t,a,n);return s.mismatchPaths.length>0?{artifactContract:o.contract,artifactTransfer:es({status:"invalid",omittedPaths:s.mismatchPaths,warnings:["The artifact contract fingerprints do not match the supplied chart props or data."]},e,a,o.contract,i)}:c.length>0?{artifactContract:o.contract,artifactTransfer:es({status:"excluded",omittedPaths:c,warnings:["Chart props or data were excluded from the serialized configuration."]},e,a,o.contract,i)}:l.mismatchPaths.length>0?{artifactContract:o.contract,artifactTransfer:es({status:"invalid",omittedPaths:l.mismatchPaths,warnings:["Serialized chart props or data differ from the values bound to the artifact contract."]},e,a,o.contract,i)}:{artifactContract:o.contract,artifactTransfer:es(o.transfer,e,a,o.contract,i)}}function is(e){if(!e.artifactContract){if(!e.artifactTransfer)return{};if(Zn(e.artifactTransfer)&&"excluded"===e.artifactTransfer.status&&e.artifactTransfer.omittedPaths.includes("artifactContract")){const t=e.artifactTransfer.omittedPaths.filter(t=>"artifactContract"!==t&&rs(e,t));return 0===t.length?{artifactTransfer:Md(e.artifactTransfer)}:{artifactTransfer:{status:"invalid",omittedPaths:[...e.artifactTransfer.omittedPaths],warnings:[`The declared omitted path is still present: ${t.join(", ")}.`]}}}return{artifactTransfer:{status:"invalid",omittedPaths:["artifactContract"],warnings:["An artifact transfer report cannot claim preservation without an artifact contract."]}}}const t=_n(e.artifactContract),r=e.artifactTransfer,a=t.transfer;let i=(()=>{if(!r)return{status:"invalid",omittedPaths:[.../* @__PURE__ */new Set([...a.omittedPaths,"artifactTransfer"])],warnings:[...a.warnings,"The artifact contract has no transfer report, so its transport history cannot be verified."]};if(!Zn(r))return{status:"invalid",omittedPaths:a.omittedPaths,warnings:[...a.warnings,"The declared artifact transfer report is malformed."]};const t="excluded"===r.status||"unsupported-version"===r.status?r.omittedPaths.filter(t=>rs(e,t)):[];return t.length>0?{status:"invalid",omittedPaths:[.../* @__PURE__ */new Set([...r.omittedPaths,...a.omittedPaths])],warnings:[...a.warnings,`The declared omitted path is still present: ${t.join(", ")}.`]}:"preserved"===r.status&&r.omittedPaths.length>0||"excluded"===r.status&&0===r.omittedPaths.length?{status:"invalid",omittedPaths:[.../* @__PURE__ */new Set([...r.omittedPaths,...a.omittedPaths])],warnings:[...a.warnings,"The declared artifact transfer status contradicts its omitted paths."]}:r.status===a.status||"preserved"===a.status&&("excluded"===r.status||"invalid"===r.status)&&r.omittedPaths.length>0?Md(r):{status:"invalid",omittedPaths:[.../* @__PURE__ */new Set([...r.omittedPaths,...a.omittedPaths])],warnings:[.../* @__PURE__ */new Set([...r.warnings,...a.warnings,`Declared artifact transfer status ${r.status} does not match the restored contract status ${a.status}.`])]}})();if(r&&Zn(r)){const t=ts(r,e),a="invalid"!==r.status,o=[...a&&void 0===r.serializedConfigFingerprint?["artifactTransfer.serializedConfigFingerprint"]:[],...a&&!Object.prototype.hasOwnProperty.call(r,"serializedDataFingerprint")?["artifactTransfer.serializedDataFingerprint"]:[],...a&&void 0===r.transferFingerprint?["artifactTransfer.transferFingerprint"]:[]];(t.length>0||o.length>0)&&(i={status:"invalid",omittedPaths:[.../* @__PURE__ */new Set([...i.omittedPaths,...t,...o])],warnings:[.../* @__PURE__ */new Set([...i.warnings,t.length>0?"The serialized chart payload no longer matches its transfer fingerprints.":"The declared chart transfer cannot be verified without serialized transfer fingerprints."])]})}if("preserved"===t.transfer.status&&t.contract?.contractVersion===kd){const r=Yn(t.contract,e.props,e.recipeId??e.component).mismatchPaths.filter(e=>!Xn(e,i.omittedPaths));r.length>0&&(i={status:"invalid",omittedPaths:[.../* @__PURE__ */new Set([...i.omittedPaths,...r])],warnings:[.../* @__PURE__ */new Set([...i.warnings,"Restored chart props or data do not match the artifact contract fingerprints."])]})}return{...t.contract?{artifactContract:t.contract}:{},artifactTransfer:i}}function os(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0})}function ns(e,t){return!!tn(e,t)&&("areas"!==e||"string"!=typeof t)}function ss(e,t,r){if(r?.selections&&Gr(r.selections).length>0)throw new TypeError("Serialized selection state must contain only values that survive JSON serialization unchanged.");const a=Hr(e)??Yr(t.recipe)??Yr(t.recipeId);if(a)return ls(a,t,r);if(!De(e))throw new Error(`Unknown component "${e}". Known components: ${$l.join(", ")}`);const i=!1!==r?.includeData,o={};for(const[e,r]of Object.entries(t))if(null!=r&&!Fd.has(e)&&(i||!ns(e,r))&&"function"!=typeof r&&!(Gr(r).length>0))try{os(o,e,zd(r))}catch{}const n=/* @__PURE__ */(new Date).toISOString(),s={version:jd,createdAt:n,...r?.selections?{selections:r.selections}:{}};return{component:e,props:o,version:jd,createdAt:n,...as(e,r?.artifactContract,t,o,s),...r?.selections?{selections:r.selections}:{}}}function cs(e,t,r){const a={};for(const[i,o]of Object.entries(e))if(null!=o&&!Fd.has(i)&&"recipeId"!==i&&(t||!ns(i,o)))if("function"!=typeof o)if(Gr(o).length>0){if(r)throw new Error(`Portable recipe prop "${i}" is not JSON-safe.`)}else os(a,i,zd(o));else if(r)throw new Error(`Portable recipe prop "${i}" is not JSON-safe.`);return a}function ls(e,t,r){const a=!1!==r?.includeData,i=Gr(e);if("portable"===e.portability&&i.length>0)throw new Error(`Portable recipe "${e.id}" has non-JSON definition values at: ${i.join(", ")}.`);const o=cs(t,a,"portable"===e.portability),n=e.intents.map(hi).filter(e=>!!e),s=e.layout&&"object"==typeof e.layout&&"string"==typeof e.layout.id?e.layout.id:void 0,c=s?qr(s):void 0,l=e.layout&&"object"==typeof e.layout&&"string"==typeof e.layout.version&&e.layout.version?{version:e.layout.version,...e.layout.fingerprint?{fingerprint:e.layout.fingerprint}:{}}:void 0;if(c&&l&&(c.version!==l.version||c.fingerprint!==l.fingerprint))throw new Error(`Recipe layout "${s}" registry identity does not match its portable declaration.`);const u=c??l;if("portable"===e.portability&&s&&!u)throw new Error(`Portable recipe layout "${s}" must be registered with an explicit version identity.`);const d={name:e.name,intents:n,...e.audience?.primary?{audience:[e.audience.primary]}:{},frameFamily:e.frameFamily,...e.version?{recipeVersion:e.version}:{},...0===i.length?{definitionFingerprint:dn(e).fingerprint}:{},...s?{layoutId:s}:{},...u?{layoutVersion:u.version}:{},...u?.fingerprint?{layoutFingerprint:u.fingerprint}:{}},h=/* @__PURE__ */(new Date).toISOString();if("portable"===e.portability){if(Gr(o).length>0)throw new Error(`Portable recipe "${e.id}" contains non-JSON-safe props or layoutConfig.`);const a={version:jd,createdAt:h,recipeId:e.id,portable:!0,manifest:d,...r?.selections?{selections:r.selections}:{}};return{component:"ChartRecipe",recipeId:e.id,portable:!0,props:o,manifest:d,version:jd,createdAt:h,...as("ChartRecipe",r?.artifactContract,t,o,a),...r?.selections?{selections:r.selections}:{}}}const p="Recipe contains or may depend on non-serializable local layout callbacks.",f=["This config is inspectable but cannot be rendered remotely by CLI or MCP."],m={version:jd,createdAt:h,recipeId:e.id,portable:!1,manifest:d,reason:p,warnings:f,...r?.selections?{selections:r.selections}:{}};return{component:"ChartRecipe",recipeId:e.id,portable:!1,reason:p,warnings:f,props:o,manifest:d,version:jd,createdAt:h,...as("ChartRecipe",r?.artifactContract,t,o,m),...r?.selections?{selections:r.selections}:{}}}function us(e){try{if(!e||"object"!=typeof e||Array.isArray(e))return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}catch{return!1}}function ds(e){if(!us(e))throw new Error("Invalid chart config: expected a plain object");const t=Gr(e);if(t.length>0)throw new TypeError(`Chart config contains values that cannot survive JSON serialization at: ${t.join(", ")}.`);if(e.version!==jd)throw new Error(`Unsupported chart config version ${String(e.version)}; expected ${jd}.`);if("string"!=typeof e.component||!e.component.trim())throw new Error("Invalid chart config: missing component");if(!us(e.props))throw new Error("Invalid chart config: props must be a plain object");if("string"!=typeof e.createdAt||!Number.isFinite(Date.parse(e.createdAt)))throw new Error("Invalid chart config: createdAt must be a valid timestamp");if(void 0!==e.recipeId&&("string"!=typeof e.recipeId||!e.recipeId.trim()))throw new Error("Invalid chart config: recipeId must be a non-empty string");if(void 0!==e.portable&&"boolean"!=typeof e.portable)throw new Error("Invalid chart config: portable must be a boolean");if(void 0!==e.selections&&!us(e.selections))throw new Error("Invalid chart config: selections must be a plain object");if(void 0!==e.manifest){if(!us(e.manifest))throw new Error("Invalid chart config: manifest must be a plain object");if("string"!=typeof e.manifest.name||!e.manifest.name.trim()||"string"!=typeof e.manifest.frameFamily||!e.manifest.frameFamily.trim()||!Array.isArray(e.manifest.intents)||e.manifest.intents.some(e=>"string"!=typeof e||!e.trim())||void 0!==e.manifest.audience&&(!Array.isArray(e.manifest.audience)||e.manifest.audience.some(e=>"string"!=typeof e||!e.trim()))||void 0!==e.manifest.recipeVersion&&("string"!=typeof e.manifest.recipeVersion||!e.manifest.recipeVersion.trim())||void 0!==e.manifest.definitionFingerprint&&("string"!=typeof e.manifest.definitionFingerprint||!e.manifest.definitionFingerprint.trim())||void 0!==e.manifest.layoutId&&("string"!=typeof e.manifest.layoutId||!e.manifest.layoutId.trim())||void 0!==e.manifest.layoutVersion&&("string"!=typeof e.manifest.layoutVersion||!e.manifest.layoutVersion.trim())||void 0!==e.manifest.layoutFingerprint&&("string"!=typeof e.manifest.layoutFingerprint||!e.manifest.layoutFingerprint.trim())||void 0!==e.manifest.layoutVersion&&void 0===e.manifest.layoutId||void 0!==e.manifest.layoutFingerprint&&void 0===e.manifest.layoutVersion)throw new Error("Invalid chart config: malformed recipe manifest")}}function hs(e){if(ds(e),"ChartRecipe"===e.component||"LocalChartRecipe"===e.component){if(!e.recipeId)throw new Error("Invalid chart recipe config: missing recipeId");const t=Hr(e.recipeId);if(!t)throw new Error(`Unknown chart recipe "${e.recipeId}". Register it before deserializing this config.`);if(e.manifest?.definitionFingerprint&&e.manifest.definitionFingerprint!==dn(t).fingerprint)throw new Error(`Chart recipe "${e.recipeId}" no longer matches the serialized definition.`);if(void 0!==e.manifest?.recipeVersion&&e.manifest.recipeVersion!==t.version)throw new Error(`Chart recipe "${e.recipeId}" version does not match the serialized config.`);if(e.manifest?.layoutVersion){const r=e.manifest.layoutId,a=r?Wr(r):void 0,i=r?qr(r):void 0,o=t.layout&&"object"==typeof t.layout&&t.layout.id===r&&t.layout.version?{version:t.layout.version,fingerprint:t.layout.fingerprint}:void 0,n=a?i:i??o;if(!n||n.version!==e.manifest.layoutVersion||n.fingerprint!==e.manifest.layoutFingerprint)throw new Error(`Chart recipe "${e.recipeId}" layout implementation no longer matches the serialized config.`)}if("LocalChartRecipe"!==e.component&&!1!==e.portable&&"portable"!==t.portability)throw new Error(`Chart recipe "${e.recipeId}" is registered as local, not portable.`);return{componentName:"ChartRecipe",props:{...zd(e.props),recipeId:e.recipeId},...is(e)}}if(!De(e.component))throw new Error(`Unknown component "${e.component}". This config may require a newer version of semiotic.`);return{componentName:e.component,props:zd(e.props),...is(e)}}function ps(e,t={}){ds(e);const r=JSON.stringify(e),a=`sc=${btoa(unescape(encodeURIComponent(r))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}`;if(void 0!==t.maxLength&&a.length>Math.max(0,Math.floor(t.maxLength)))throw new RangeError(`Serialized chart config is ${a.length} characters; the declared URL limit is ${t.maxLength}. Use a file or sidecar export instead.`);return a}function fs(e){const t=new URLSearchParams(e.includes("?")?e.split("?")[1]:e).get("sc");if(!t)throw new Error("No chart config found in URL (missing 'sc' parameter)");const r=t.replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(escape(atob(r))),i=JSON.parse(a);return ds(i),i}async function ms(e,t="json"){const r="jsx"===t?gs(e):JSON.stringify(e,null,2);if("undefined"==typeof navigator||!navigator.clipboard)throw new Error("Clipboard API not available. copyConfig requires a browser environment.");await navigator.clipboard.writeText(r)}function gs(e){ds(e);const{props:t}=e,r="LocalChartRecipe"===e.component?"ChartRecipe":e.component;if("ChartRecipe"!==r&&!De(r))throw new Error(`Cannot project unknown component "${r}" to JSX.`);const a=[`<${r}`];e.recipeId&&a.push(` recipeId={${bs(e.recipeId)}}`);for(const[e,r]of Object.entries(t)){if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(e)){const t={};Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),a.push(` {...${bs(t)}}`);continue}if("string"==typeof r)a.push(ys(r)?` ${e}="${r}"`:` ${e}={${bs(r)}}`);else if("boolean"==typeof r&&!0===r)a.push(` ${e}`);else if("boolean"==typeof r&&!1===r)a.push(` ${e}={false}`);else if("number"==typeof r)a.push(` ${e}={${r}}`);else{const t=bs(r);t.length<80?a.push(` ${e}={${t}}`):a.push(` ${e}={${bs(r,2)}}`)}}return a.push("/>"),a.join("\n")}function ys(e){return!/["&<>{}\r\n\u2028\u2029]/.test(e)}function bs(e,t){return JSON.stringify(e,null,t).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function vs(e){const t=[...e.artifactContract?["artifactContract"]:[],...e.artifactTransfer?["artifactTransfer"]:[],...e.selections?["selections"]:[]];return{jsx:gs(e),omittedPaths:t,warnings:t.length?["JSX represents the chart props only. Preserve the reported top-level fields as a separate artifact packet."]:[]}}function ws(e){const t=/* @__PURE__ */Object.create(null);for(const[r,a]of e){const e=[];for(const[,t]of a.clauses){const r=/* @__PURE__ */Object.create(null);for(const[e,a]of Object.entries(t.fields))"point"===a.type?r[e]={type:"point",values:Array.from(a.values)}:r[e]={type:"interval",range:a.range};e.push({clientId:t.clientId,type:t.type,fields:r})}t[r]={name:a.name,resolution:a.resolution,clauses:e}}return t}function As(e){const t=/* @__PURE__ */new Map;for(const[r,a]of Object.entries(e)){const e=/* @__PURE__ */new Map;for(const t of a.clauses){const r=/* @__PURE__ */Object.create(null);for(const[e,a]of Object.entries(t.fields))"point"===a.type?r[e]={type:"point",values:new Set(a.values)}:r[e]={type:"interval",range:a.range};e.set(t.clientId,{clientId:t.clientId,type:t.type,fields:r})}t.set(r,{name:a.name,resolution:a.resolution,clauses:e})}return t}async function xs(e,t){const{exportChartBrowser:r}=await Promise.resolve().then(()=>(Hc(),Dc));return r(e,t)}function $s(e,t,r){const a=/* @__PURE__ */new Map,i=/* @__PURE__ */new Map,o=/* @__PURE__ */new Map,n=e=>{if(e instanceof Date)return`date:${e.getTime()}`;if("object"==typeof e&&null!==e||"symbol"==typeof e||"function"==typeof e){let t=o.get(e);return void 0===t&&(t=o.size,o.set(e,t)),`identity:${t}`}return`${typeof e}:${String(e)}`},s=e=>{if(r.length&&!r.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))return JSON.stringify(r.map(t=>n(e[t])))};e.forEach((e,t)=>{const r=a.get(e);r?r.push(t):a.set(e,[t]);const o=s(e);if(void 0===o)return;const n=i.get(o);n?n.indices.push(t):i.set(o,{indices:[t],cursor:0})});const c=/* @__PURE__ */new Set,l=/* @__PURE__ */new Set,u=e=>{const t=a.get(e);if(t)return l.has(e)||(t.forEach(e=>c.add(e)),l.add(e)),!0;const r=s(e),o=void 0===r?void 0:i.get(r);if(!o)return!1;for(;o.cursor<o.indices.length&&c.has(o.indices[o.cursor]);)o.cursor++;return o.cursor<o.indices.length&&c.add(o.indices[o.cursor++]),!0};let d=0;for(const e of t){const t=Array.isArray(e)?e:[e];let r=!1;for(const e of t)e&&"object"==typeof e&&u(e)&&(r=!0);r||d++}return{represented:c.size,unmatchedMarks:d}}function Cs(e){const t={};if(null==e||"object"!=typeof e)return t;for(const[r,a]of Object.entries(e))r.startsWith("_")||null!=a&&""!==a&&("number"==typeof a?Number.isFinite(a)&&(t[r]=a):"string"==typeof a?t[r]=a:"boolean"==typeof a?t[r]=String(a):a instanceof Date&&(t[r]=a.toISOString().slice(0,10)));return t}function Ss(e){return e&&"object"==typeof e?e:{}}function ks(e){return Ss(e.accessibility).tableFields??e.accessibleDatum??e.datum}function Rs(e){const t=/* @__PURE__ */new Set;if(!e.some(e=>e&&("point"===e.type||"symbol"===e.type||"glyph"===e.type)))return t;for(const r of e)if(r&&["line","area","boxplot","violin"].includes(String(r.type))&&Array.isArray(r.datum))for(const e of r.datum)t.add(e);return t}function Ps(e){const t=[];if(!Array.isArray(e))return t;const r=Rs(e);for(const a of e)if(a&&"object"==typeof a&&null!==a.datum)try{switch(a.type){case"point":case"symbol":case"glyph":if(r.has(a.datum))break;t.push({label:"Point",values:Cs(ks(a))});break;case"line":case"area":{const e=ks(a),r=Array.isArray(e)?e:null!=e&&"object"==typeof e?[e]:[],i="line"===a.type?"Line point":"Area point";for(const e of r)t.push({label:i,values:Cs(e)});break}case"boxplot":case"violin":{const e=ks(a),r="boxplot"===a.type?"Boxplot":"Distribution",i="string"==typeof a.category?{category:a.category}:{};if(Array.isArray(e)){t.push({label:r,values:{...i,...Cs(a.stats)}});for(const a of e)t.push({label:`${r} observation`,values:{...i,...Cs(a)}})}else t.push({label:r,values:{...i,...Cs(e)}});break}case"rect":{const e=ks(a),r=null!=e&&"object"==typeof e?e:{},i=r.category??a.group??"",o=r.value??r.__aggregateValue??r.total,n=Cs(r);null==n.category&&""!==i&&(n.category=String(i)),null==n.value&&null!=o&&(n.value="number"==typeof o||"string"==typeof o?o:String(o)),t.push({label:"Bar",values:n});break}case"heatcell":{const e=Cs(ks(a));null==e.value&&"number"==typeof a.value&&Number.isFinite(a.value)&&(e.value=a.value),t.push({label:"Cell",values:e});break}case"wedge":{const e=ks(a),r=Cs(e);if(null==r.category){const t=Ss(e),a=t.category??t.label;null!=a&&(r.category=String(a))}t.push({label:"Wedge",values:r});break}case"circle":t.push({label:"Node",values:Cs(ks(a))});break;case"arc":t.push({label:"Arc",values:Cs(ks(a))});break;case"candlestick":t.push({label:"Candlestick",values:Cs(ks(a))});break;case"connector":case"trapezoid":case"bezier":case"ribbon":case"curved":t.push({label:"Connection",values:Cs(ks(a))});break;case"geoarea":{const e=Ss(ks(a)),r={...Cs(e.properties),...Cs(e)};t.push({label:"Region",values:r});break}}}catch{}return t}function Es(e){if(Array.isArray(e))return e;if(!e||"object"!=typeof e)return[];const t=e;return[...t.nodes??t.sceneNodes??[],...t.sceneEdges??[]]}function Ns(e){const t=e.pointId??e.id??e._transitionKey;return null==t||""===t?void 0:String(t)}function Ts(e){return e.accessibility?.tableFields??e.accessibleDatum??e.datum??null}function Is(e){return"number"==typeof e&&Number.isFinite(e)}function Os(e){if(Is(e.x)&&Is(e.y)&&Is(e.w)&&Is(e.h))return{x0:e.x,y0:e.y,x1:e.x+e.w,y1:e.y+e.h};if(Is(e.x)&&Is(e.y)&&Is(e.r))return{x0:e.x-e.r,y0:e.y-e.r,x1:e.x+e.r,y1:e.y+e.r};if(Is(e.cx)&&Is(e.cy)&&Is(e.r))return{x0:e.cx-e.r,y0:e.cy-e.r,x1:e.cx+e.r,y1:e.cy+e.r};if(Is(e.cx)&&Is(e.cy)&&Is(e.outerR))return{x0:e.cx-e.outerR,y0:e.cy-e.outerR,x1:e.cx+e.outerR,y1:e.cy+e.outerR};if(Is(e.x1)&&Is(e.x2)&&Is(e.y1)&&Is(e.y2))return{x0:Math.min(e.x1,e.x2),x1:Math.max(e.x1,e.x2),y0:Math.min(e.y1,e.y2),y1:Math.max(e.y1,e.y2)};const t=[e.path,e.topPath,e.bottomPath].filter(Array.isArray).flat().filter(e=>Array.isArray(e)&&Is(e[0])&&Is(e[1]));if(t.length>0){const[e,r]=P(t,e=>e[0]),[a,i]=P(t,e=>e[1]);return{x0:e,y0:a,x1:r,y1:i}}return null}function Ms(e){return[...[e.x,e.y,e.w,e.h,e.r,e.cx,e.cy,e.innerR,e.outerR,e.x1,e.x2,e.y1,e.y2,e.openY,e.closeY,e.highY,e.lowY,e.bodyWidth].filter(e=>void 0!==e),...[e.path,e.topPath,e.bottomPath].filter(Array.isArray).flat(2)]}function js(e,t){const r=Math.max(0,Math.min(e.x1,t.x1)-Math.max(e.x0,t.x0))*Math.max(0,Math.min(e.y1,t.y1)-Math.max(e.y0,t.y0)),a=Math.max(0,e.x1-e.x0)*Math.max(0,e.y1-e.y0),i=Math.max(0,t.x1-t.x0)*Math.max(0,t.y1-t.y0),o=Math.min(a,i);return o>0?r/o:0}function Fs(e){const t=e.style?.fill??e.fill;return"none"===t||"transparent"===t||null==t&&["line","rule","edge","bezier"].includes(e.type)}function zs(e,t,r,a,i,o="warn",n){return{id:e,category:t,status:r?"pass":o,message:r?a:i,...n?{evidence:n}:{}}}function Ls(e){const{recipe:t}=e,r=Es(e.scene),a=e.layoutConfig??pi({layoutConfig:e.layoutConfig}),i=e.dimensions.plot??{x:0,y:0,width:e.dimensions.width,height:e.dimensions.height},n=i.x??0,s=i.y??0,c=[],l=r.filter(e=>null!=Ts(e)),u=r.filter(e=>!("string"!=typeof e.pathD||!/NaN|Infinity|undefined/.test(e.pathD))||Ms(e).some(e=>"number"!=typeof e||!Number.isFinite(e)));c.push(zs("geometry.finite","geometry",0===u.length,"All emitted geometry is finite.",`${u.length} marks contain non-finite geometry.`,"fail",{count:u.length}));const d=r.map(Os),h=d.filter((e,t)=>e&&(Fs(r[t])?e.x1<=e.x0&&e.y1<=e.y0:e.x1<=e.x0||e.y1<=e.y0)).length;c.push(zs("geometry.nonzero-area","geometry",0===h,"All bounded marks have positive area.",`${h} marks have zero or negative area.`,"warn",{count:h}));const p=d.filter(e=>e&&(e.x0<n||e.y0<s||e.x1>n+i.width||e.y1>s+i.height)).length;c.push(zs("geometry.bounds","geometry",0===p,"All bounded marks stay inside the plot.",`${p} marks extend outside the plot bounds.`,"warn",{count:p}));const f=t.audit?.minimumHitTargetSize??t.accessibility.minimumHitTarget??24,m=d.filter((e,t)=>!(!e||Fs(r[t])||null==Ts(r[t])||!1===r[t].interactive)&&(e.x1-e.x0<f||e.y1-e.y0<f)).length;c.push(zs("interaction.target-size","interaction",0===m,`All bounded targets meet the declared ${f}px minimum.`,`${m} targets are smaller than ${f}px in at least one dimension.`,"warn",{count:m,minimumTarget:f}));const g=l.map(Ns),y=g.filter(e=>!e).length,b=/* @__PURE__ */new Set,v=g.filter(e=>!(!e||!b.has(e)&&(b.add(e),1)));c.push(zs("identity.stable-ids","identity",0===y,"Every data-bearing mark exposes a stable id.",`${y} data-bearing marks have no pointId, id, or transition key.`,t.audit?.requireStableIds?"fail":"warn",{missing:y})),c.push(zs("identity.unique-ids","identity",0===v.length,"Stable mark ids are unique.",`${v.length} duplicate stable ids were observed.`,"fail",{duplicates:[...new Set(v)].slice(0,10)}));const w=g.filter(e=>e&&/^(datum|mark|node|point|rect)-?\d+$/.test(e)).length;w>0&&c.push({id:"identity.index-pattern",category:"identity",status:"warn",message:`${w} ids look index-derived and may change when data is reordered.`,remediation:"Derive ids from a declared identifier role or stable domain key."});const A=Ja(e.inputData),x=[...new Set(t.dataRoles.map(e=>gi(e,a,A)).filter(e=>!!e))],{represented:$,unmatchedMarks:C}=$s(A,l.map(Ts),x),S=Math.max(0,A.length-$);c.push(zs("coverage.input-data","coverage",0===S,"Every input datum is represented by the observed scene.",`${S} input data items have no matching scene mark.`,t.audit?.requireDatumCoverage?"fail":"warn",{represented:$,input:A.length})),c.push(zs("coverage.scene-data","coverage",0===C,"Every data-bearing scene mark maps back to input data.",`${C} scene marks do not map back to an input datum.`,"warn",{count:C}));const k=t.encodings?.some(e=>"count"===e.channel);!k&&l.length>$&&$>0&&c.push({id:"coverage.duplicate-references",category:"coverage",status:"warn",message:"Input data is referenced by multiple marks, but multiplicity is not declared as an encoding.",remediation:"Declare count/repetition semantics or preserve a one-to-one datum-to-mark mapping."});const R=l.filter(e=>!1===e.interactive).length;c.push(zs("interaction.hit-targets","interaction",0===R&&l.length>0,"Every observed data-bearing scene node participates in hit testing.",0===l.length?"No data-bearing scene nodes were emitted for interaction.":`${R} data-bearing marks explicitly disable interaction.`,"fail"));const P=(e.annotations??[]).map(e=>e.pointId).filter(e=>null!=e).map(String),E=P.filter(e=>!b.has(e));c.push(zs("coverage.annotation-anchors","coverage",0===E.length,P.length?"All pointId annotation anchors resolve to observed scene nodes.":"No pointId annotations require scene resolution.",`${E.length} annotations point to missing scene ids.`,"fail",{unresolved:E}));const N=(e.chart?.selectedIds??[]).filter(e=>!b.has(e));e.chart?.selectedIds&&c.push(zs("interaction.selection-reachability","interaction",0===N.length,"Selected/highlighted states resolve to observed marks.",`${N.length} selected ids are not reachable in the scene.`,"fail",{missing:N}));const T=Ps(r),I=(t.accessibility.tableFields??t.accessibility.tableRoles?.map(e=>({role:e,label:e}))??[]).map(e=>{if(e.field)return e.field;const r=e.role?t.dataRoles.find(t=>t.role===e.role):void 0;return r?gi(r,a,A):void 0}).filter(e=>!!e),O=new Set(T.flatMap(e=>Object.keys(e.values))),M=I.filter(e=>!O.has(e));c.push(zs("accessibility.table-fields","accessibility",0===M.length,I.length?"The accessible table preserves all recipe-declared fields.":"The recipe declares no explicit accessible table field projection.",`The accessible table loses declared fields: ${M.join(", ")}.`,"fail",{expectedFields:I,observedFields:[...O]})),new Set(A.flatMap(e=>Object.entries(e).filter(([,e])=>["string","number","boolean"].includes(typeof e)).map(([e])=>e))).size>2&&O.size<=2&&[...O].every(e=>"category"===e||"value"===e)&&c.push({id:"accessibility.generic-table-loss",category:"accessibility",status:"warn",message:"The table exposes only generic category/value fields although richer input data exists.",remediation:"Emit accessibleDatum or accessibility.tableFields on scene nodes."});const j=(t.encodings?.filter(e=>"color"===e.channel)??[]).filter(e=>!e.redundantWith||0===e.redundantWith.length);c.push(zs("accessibility.color-only","accessibility",0===j.length,"Every declared color encoding names a redundant cue.",`${j.length} color encodings have no declared redundant cue.`,"warn"));const F=e.chart;if(F){for(const[e,r]of[["title",t.accessibility.requiresTitle],["summary",t.accessibility.requiresSummary],["description","required"===t.accessibility.description]])r&&c.push(zs(`accessibility.${e}`,"accessibility","string"==typeof F[e]&&F[e].trim().length>0,`A chart ${e} is present.`,`The recipe requires a chart ${e}, but none was supplied.`,"fail"));(t.accessibility.requiresAccessibleTable||"required"===t.accessibility.accessibleTable||t.accessibility.fallbackTable)&&c.push(zs("accessibility.fallback-table","accessibility",!1!==F.accessibleTable,"The accessible fallback table is enabled.","The recipe requires a fallback table, but accessibleTable is disabled.","fail")),F.navigationTree&&c.push(zs("accessibility.navigation-depth","accessibility",(F.navigationTree.children?.length??0)>0,"The navigation tree exposes structure below the root.","The navigation tree is root-only.","fail"))}const z=e.theme?.background??"#ffffff",L=r.filter(e=>[e.style?.stroke??e.stroke,...Fs(e)?[]:[e.style?.fill??e.fill]].some(e=>{if("string"!=typeof e||"none"===e||"transparent"===e)return!1;const t=o(e,z);return null!=t&&t<3})).length;c.push(zs("visual.contrast","visual",0===L,"All statically checkable mark fills and strokes meet 3:1 contrast.",`${L} marks have fill or stroke contrast below 3:1.`,"warn",{background:z}));let B=0;const D=d.filter(e=>!!e).slice(0,500);for(let e=0;e<D.length;e+=1)for(let t=e+1;t<D.length;t+=1)js(D[e],D[t])>=.8&&(B+=1);B>D.length&&c.push({id:"visual.overlap-density",category:"visual",status:"warn",message:`${B} near-total mark overlaps suggest occlusion or excessive density.`,remediation:"Aggregate, jitter, layer explicitly, or declare overlap as intentional."});const _=[["manual-at.screen-reader","Verify real screen-reader behavior with the target browser/AT combinations."],["manual-at.cognitive-load","Assess cognitive load and whether the custom metaphor is understood."],["manual-at.keyboard-order","Verify that keyboard order is meaningful, not merely mechanically available."],["manual-at.animation","Verify that animation is not distracting and reduced-motion behavior is sufficient."],["manual-at.reception","Test whether the memorable form is received as intended by the target audience."],["manual-at.overlay-occlusion","Inspect labels, overlays, annotations, and important marks for clipping or occlusion."],["manual-at.observation","Exercise hover, focus, selection, and observation emission in the rendered chart."]].map(([e,t])=>({id:e,category:"manual-at",status:"manual",message:t})),U={dataRoles:t.dataRoles.map(e=>e.role),intents:t.intents.map(hi).filter(e=>!!e),accessibilityExpectations:[...t.accessibility.requirements??[],...t.accessibility.tableFields?.map(e=>`table field: ${e.label}`)??[]],fallbackDeclared:!0===t.accessibility.fallbackTable||"required"===t.accessibility.accessibleTable||!0===t.accessibility.requiresAccessibleTable,designContractDeclared:!!t.designContract?.whyCustom},G=[...c,..._],V=c.filter(e=>"fail"===e.status).length;return{recipeId:t.id,ok:0===V,summary:{marks:r.length,passes:G.filter(e=>"pass"===e.status).length,warnings:G.filter(e=>"warn"===e.status).length,failures:V,manual:G.filter(e=>"manual"===e.status).length},declaredSemantics:U,observedSceneEvidence:c,manualATChecks:_}}function Bs(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function Ds(e){if(!Array.isArray(e))return!1;for(const t of e)if(!Bs(t))return!1;return!0}function _s(e){const t=[],r=(e,r)=>t.push({code:"INVALID_SPEC",severity:"error",path:e,message:r});if(!Bs(e))return r("/","A Vega-Lite spec must be an object."),t;if(void 0!==e.encoding)if(Bs(e.encoding))for(const[t,a]of Object.entries(e.encoding))if(Bs(a))for(const e of["scale","axis"])void 0===a[e]||Bs(a[e])||r(`/encoding/${Ld(t)}/${e}`,`${e} must be an object in the supported subset.`);else r(`/encoding/${Ld(t)}`,"An encoding must be an object.");else r("/encoding","encoding must be an object.");if(void 0!==e.data&&(Bs(e.data)?void 0===e.data.values||Ds(e.data.values)||(r("/data/values","data.values must be an array of row objects."),Bs(e.encoding)&&Object.values(e.encoding).some(e=>Bs(e)&&void 0!==e.aggregate)&&(t[t.length-1].code="INVALID_AGGREGATE_DATA")):r("/data","data must be an object.")),void 0===e.layer||Ds(e.layer)||r("/layer","layer must be an array of spec objects."),Array.isArray(e.layer))for(let r=0;r<e.layer.length;r++){const a=e.layer[r];if(Bs(a))for(const e of _s(a))t.push({...e,path:`/layer/${r}${"/"===e.path?"":e.path}`})}return t}function Us(e){switch(e){case"sum":case"mean":case"count":case"min":case"max":return e;case"average":return"mean";default:return}}function Gs(e){let t="value",r=0;for(;e.has(t);)t="value_"+ ++r;return t}function Vs(e,t,r){if(!Array.isArray(e))throw new TypeError("aggregate data must be an array of rows");if(t.some(e=>"string"!=typeof e||0===e.length))throw new TypeError("groupBy must contain nonempty field names");const a=[...new Set(t)],i=new Set(a);for(const e of r){if(Us(e.operation)!==e.operation||!e.operation)throw new TypeError("Unsupported aggregate operation");if("string"!=typeof e.outputField||!e.outputField||i.has(e.outputField))throw new TypeError("outputField must be a nonempty field distinct from groupBy and other aggregate outputs");if("count"!==e.operation&&("string"!=typeof e.field||!e.field))throw new TypeError("A value field is required for this aggregate");i.add(e.outputField)}const o={},n=[];for(let t=0;t<e.length;t++){const i=e[t];if(!i||"object"!=typeof i||Array.isArray(i))throw new TypeError(`aggregate data row ${t} must be an object`);let s=o;for(const e of a){const t=i[e],r=t instanceof Date?s.dates??(s.dates=/* @__PURE__ */new Map):s.values??(s.values=/* @__PURE__ */new Map),a=t instanceof Date?t.getTime():t;let o=r.get(a);o||(o={},r.set(a,o)),s=o}s.group||(s.group={keys:Object.fromEntries(a.map(e=>[e,i[e]])),count:0,measures:r.map(()=>({total:0,count:0}))},n.push(s.group));const c=s.group;c.count++;for(let e=0;e<r.length;e++){const t=r[e];if("count"===t.operation)continue;const a=Bt(i[t.field]);if(void 0===a||!Number.isFinite(a))continue;const o=c.measures[e];"min"===t.operation||"max"===t.operation?o.count&&!("min"===t.operation?a<o.total:a>o.total)||(o.total=a):o.total+=a,o.count++}}return n.map(e=>Object.fromEntries([...Object.entries(e.keys),...r.map((t,r)=>{const a=e.measures[r],i="count"===t.operation?e.count:a.count?"mean"===t.operation?a.total/a.count:a.total:null;return[t.outputField,i]})]))}function Hs(e){const t=e.encoding??{},r=[];if(Object.values(t).some(e=>void 0!==e.aggregate)&&void 0!==e.data?.values){const t=e.data.values;Array.isArray(t)&&!t.some(e=>!e||"object"!=typeof e||Array.isArray(e))||r.push({code:"INVALID_AGGREGATE_DATA",severity:"error",path:"/data/values",message:"Aggregation requires data.values to be an array of row objects."})}for(const[a,i]of Object.entries(t)){if(void 0===i.aggregate)continue;const o=Us(i.aggregate);let n,s="UNSUPPORTED_AGGREGATE";o?(t.x?.bin||t.y?.bin)&&"count"!==o?n=`Binned aggregate "${i.aggregate}" on ${a} is not supported; Histogram counts source rows.`:"count"===o||i.field?e.data?.values||(s="INVALID_AGGREGATE",n=`aggregate: "${i.aggregate}" on ${a} requires inline data.values; accessors remain unchanged.`):(s="INVALID_AGGREGATE",n=`aggregate: "${i.aggregate}" on ${a} requires an encoded value field.`):n=`Unsupported aggregate "${i.aggregate}" on ${a}; data was not aggregated.`,n&&r.push({code:s,severity:"error",path:`/encoding/${a}/aggregate`,message:n})}return r}function Ws(e,t){const r=e.encoding??{},a=e.data?.values,i=Hs(e);if(t.push(...i.map(({message:e})=>e)),!a||i.length||r.x?.bin||r.y?.bin)return{data:a,encoding:r};const o=new Set(Object.values(r).filter(e=>void 0===e.aggregate&&e.field).map(e=>e.field)),n=new Set(o),s=[],c={...r};for(const[e,t]of Object.entries(r)){const r=Us(t.aggregate);if(!r)continue;const a=Gs(n);n.add(a),s.push({field:t.field,operation:r,outputField:a}),c[e]={...t,field:a,aggregate:void 0}}return s.length?{data:Vs(a,[...o],s),encoding:c}:{data:a,encoding:r}}function qs(e){if(!e||"string"!=typeof e&&!Bs(e))return{type:"",markProps:{}};if("string"==typeof e)return{type:e,markProps:{}};const{type:t,...r}=e;return{type:t,markProps:r}}function Ys(e){if(e)return"string"==typeof e?e:e.text}function Ks(e){return"nominal"===e||"ordinal"===e}function Js(e){return"quantitative"===e||"temporal"===e}function Xs(e){return e?.usermeta?.idid}function Zs(e){return"annotation-layer"===e?.usermeta?.idid?.role}function Qs(e){if(!Xs(e)||!Array.isArray(e.layer))return e;const t=e.layer.filter(e=>!Zs(e));if(1!==t.length)return e;const{layer:r,...a}=e,{usermeta:i,...o}=t[0];return{...a,...o}}function ec(e){return tc(e)}function tc(e,t=!1,r){const a=_s(e);if(a.length)return ic("Scatterplot",{},a.map(e=>e.message),t,r);e=Qs(e);const i=[],{type:o,markProps:n}=qs(e.mark),{data:s,encoding:c}=Ws(e,i),l=c.x,u=c.y,d=c.color,h=c.size,p=c.theta,f=c.opacity;!s&&e.data?.url&&i.push("Load data.url into inline data.values before import."),e.transform&&e.transform.length>0&&i.push("Materialize Vega-Lite transforms before import."),e.layer&&i.push('Layered specs ("layer") are unsupported; provide one mark.'),(e.hconcat||e.vconcat||e.concat)&&i.push('Concatenated views ("hconcat"/"vconcat"/"concat") are unsupported; import each view separately.'),(e.facet||c.facet||c.row||c.column)&&i.push("Faceted views are unsupported; use LinkedCharts or separate charts."),e.repeat&&i.push('Repeated views ("repeat") are unsupported; import each field combination separately.'),(e.params||e.selection)&&i.push("Selections/params are unsupported; use LinkedCharts and selection props.");const m={};e.width&&(m.width=e.width),e.height&&(m.height=e.height);const g=Ys(e.title);if(g&&(m.title=g),d?.field){if(m.colorBy=d.field,d.scale?.scheme){const e=Object.prototype.hasOwnProperty.call(Bd,d.scale.scheme)?Bd[d.scale.scheme]:void 0;e&&(m.colorScheme=e)}Array.isArray(d.scale?.range)&&(m.colorScheme=d.scale.range)}if(void 0!==f?.value&&(m.pointOpacity=f.value),l?.bin||u?.bin){const e="Histogram";s&&(m.data=s),l?.bin?(m.valueAccessor=l.field,l.axis?.title&&(m.valueLabel=l.axis.title)):u?.bin&&(m.valueAccessor=u.field,u.axis?.title&&(m.valueLabel=u.axis.title)),d?.field&&(m.categoryAccessor=d.field);const a=l?.bin||u?.bin,o="object"==typeof a?a.maxbins:void 0;return o&&(m.bins=o),ic(e,m,i,t,r)}let y;switch(o){case"bar":y=rc(l,u,d,m);break;case"line":y="LineChart",ac(l,u,m),d?.field&&(m.lineBy=d.field),!0===n.point&&(m.showPoints=!0);break;case"area":d?.field?(y="StackedAreaChart",m.areaBy=d.field):y="AreaChart",ac(l,u,m),"normalize"!==l?.stack&&"normalize"!==u?.stack||(m.normalize=!0),void 0!==n.opacity&&(m.areaOpacity=n.opacity);break;case"point":case"circle":case"square":h?.field?(y="BubbleChart",m.sizeBy=h.field,h.scale?.range&&(m.sizeRange=h.scale.range)):y="Scatterplot",ac(l,u,m);break;case"rect":y="Heatmap",l?.field&&(m.xAccessor=l.field),u?.field&&(m.yAccessor=u.field),d?.field&&(m.valueAccessor=d.field,delete m.colorBy),l?.axis?.title&&(m.xLabel=l.axis.title),u?.axis?.title&&(m.yLabel=u.axis.title);break;case"arc":n.innerRadius&&n.innerRadius>0?(y="DonutChart",m.innerRadius=n.innerRadius):y="PieChart",p?.field?m.valueAccessor=p.field:u?.field&&(m.valueAccessor=u.field),d?.field&&(m.categoryAccessor=d.field),l?.field&&!p?.field&&(m.categoryAccessor=l.field);break;case"tick":y="DotPlot",Ks(l?.type)?(m.categoryAccessor=l.field,u?.field&&(m.valueAccessor=u.field),l?.axis?.title&&(m.categoryLabel=l.axis.title),u?.axis?.title&&(m.valueLabel=u.axis.title)):Ks(u?.type)?(m.categoryAccessor=u.field,l?.field&&(m.valueAccessor=l.field),m.orientation="horizontal",u?.axis?.title&&(m.categoryLabel=u.axis.title),l?.axis?.title&&(m.valueLabel=l.axis.title)):(l?.field&&(m.categoryAccessor=l.field),u?.field&&(m.valueAccessor=u.field));break;default:i.push(`Unsupported mark type "${o}". Defaulting to Scatterplot.`),y="Scatterplot",ac(l,u,m)}return("line"===o||"area"===o)&&n.interpolate&&Object.prototype.hasOwnProperty.call(Dd,n.interpolate)&&(m.curve=Dd[n.interpolate]),s&&(m.data=s),ic(y,m,i,t,r)}function rc(e,t,r,a){let i;return r?.field&&!1!==e?.stack&&!1!==t?.stack&&null!==e?.stack&&null!==t?.stack?(i="StackedBarChart",a.stackBy=r.field,"normalize"!==e?.stack&&"normalize"!==t?.stack||(a.normalize=!0)):i="BarChart",Ks(e?.type)&&Js(t?.type)?(a.categoryAccessor=e.field,a.valueAccessor=t.field,e?.axis?.title&&(a.categoryLabel=e.axis.title),t?.axis?.title&&(a.valueLabel=t.axis.title)):Js(e?.type)&&Ks(t?.type)?(a.categoryAccessor=t.field,a.valueAccessor=e.field,a.orientation="horizontal",t?.axis?.title&&(a.categoryLabel=t.axis.title),e?.axis?.title&&(a.valueLabel=e.axis.title)):(e?.field&&(a.categoryAccessor=e.field),t?.field&&(a.valueAccessor=t.field),e?.axis?.title&&(a.categoryLabel=e.axis.title),t?.axis?.title&&(a.valueLabel=t.axis.title)),i}function ac(e,t,r){e?.field&&(r.xAccessor=e.field),t?.field&&(r.yAccessor=t.field),e?.axis?.title&&(r.xLabel=e.axis.title),t?.axis?.title&&(r.yLabel=t.axis.title),"temporal"===e?.type?r.xScaleType="time":"log"===e?.scale?.type&&(r.xScaleType="log"),"log"!==t?.scale?.type&&"symlog"!==t?.scale?.type||(r.yScaleType=t.scale.type)}function ic(e,t,r,a=!1,i){const o={component:e,props:t,version:"1",createdAt:i??/* @__PURE__ */(new Date).toISOString()};if(r.length>0){o.warnings=r;for(const e of a?[]:r)console.warn(`[semiotic/fromVegaLite] ${e}`)}return o}function oc(e){if(!Number.isFinite(e))return String(e);const t=Number.isInteger(e)?e:Number(e.toPrecision(6));return Math.abs(t)>9999?t.toLocaleString():String(t)}function nc(e){const t=!0===e?.__semioticHoverData,r=e&&("node"===e.type||"edge"===e.type||void 0!==e.nodeOrEdge||void 0!==e.allSeries||void 0!==e.stats||void 0!==e.__chartType),a=t||e&&void 0!==e.data&&"number"==typeof e.x&&"number"==typeof e.y&&r;let i=(o=a?e.data??{}:e,Array.isArray(o)?o[0]:o);var o;if(!i)return null;if(("node"===e?.nodeOrEdge&&"number"==typeof i?.x0&&"number"==typeof i?.x1||"edge"===e?.nodeOrEdge&&"number"==typeof i?.sankeyWidth)&&i.data&&"object"==typeof i.data&&(i=i.data),!i)return null;if(a&&(void 0!==e.allSeries||void 0!==e.xValue)){const t=Ko({...i},Jo(i));void 0!==e.allSeries&&void 0===t.allSeries&&(t.allSeries=e.allSeries),void 0!==e.xValue&&void 0===t.xValue&&(t.xValue=e.xValue),i=t}return i}function sc(e){return e.getHours()||e.getMinutes()||e.getSeconds()||e.getMilliseconds()?e.toLocaleString():e.toLocaleDateString()}function cc(e,t){for(const r of t){const t=e.find(e=>e.lower===r);if(t)return t}}function lc(e,t={}){if(!e||"object"!=typeof e)return{entries:[]};const r=t.maxEntries??6,a=!1!==t.skipPositional,i=[];for(const[t,r]of Object.entries(e)){if(t.startsWith("_"))continue;if("data"===t)continue;const e=t.toLowerCase();if(a&&Wd.has(e))continue;if(null==r)continue;const o=typeof r;("string"===o||"number"===o||"boolean"===o||r instanceof Date)&&i.push({key:t,lower:e,value:r})}if(0===i.length)return{entries:[]};let o=i.findIndex(e=>Gd.includes(e.lower));const n=o>=0;o<0&&(o=i.findIndex(e=>"id"===e.lower)),o<0&&(o=i.findIndex(e=>"string"==typeof e.value));const s=o>=0?i[o]:void 0,c=i.filter((e,t)=>t!==o&&(!n||"id"!==e.lower)),l=cc(c,Vd),u=cc(c,Hd),d=[];l&&d.push({key:l.key,value:l.value}),u&&d.push({key:u.key,value:u.value});for(const e of c){if(d.length>=r)break;Vd.includes(e.lower)||Hd.includes(e.lower)||d.push({key:e.key,value:e.value})}return{titleKey:s?.key,title:s?.value,entries:d}}function uc(e){return null!=e&&"boolean"!=typeof e&&("string"==typeof e?e.trim().length>0:Array.isArray(e)?e.some(uc):!qd.isValidElement(e)||e.type!==qd.Fragment||uc(e.props.children))}function dc(){const e=globalThis;return e[Jd]??(e[Jd]=qd.createContext(void 0))}function hc(e){let t;for(const r of e.childNodes)if(1===r.nodeType){if(t)return!1;t=r}else if(3===r.nodeType&&r.textContent?.trim())return!1;const r=t?.getAttribute("data-semiotic-tooltip-chrome");return!t||null!=r&&"false"!==r}function pc(e,t){const[r,a]=qd.useState(!1);return("undefined"==typeof window?qd.useEffect:qd.useLayoutEffect)(()=>{const i=t&&null!==e.current&&hc(e.current);i!==r&&a(i)}),qd.useEffect(()=>{const r=e.current;if(!t||!r)return;const i=new MutationObserver(()=>a(hc(r)));return i.observe(r,{childList:!0,subtree:!0,characterData:!0,attributeFilter:["data-semiotic-tooltip-chrome"]}),()=>i.disconnect()},[t,e]),t&&r}function fc(e){return e.ownsChrome=!0,e}function mc(e){if("string"!=typeof e)return null!=e;const t=e.trim().toLowerCase();return!(!t||"transparent"===t||/^rgba\([^)]*,\s*0(?:\.0+)?\s*\)$/.test(t)||/^hsla\([^)]*,\s*0(?:\.0+)?\s*\)$/.test(t))}function gc(e){if("function"==typeof e)return!0===e.ownsChrome;if(!qd.isValidElement(e))return!1;const t=e.type;if("string"!=typeof t&&t&&!0===t.ownsChrome)return!0;const r=e.props,a=r["data-semiotic-tooltip-chrome"];if(null!=a&&!1!==a&&"false"!==a)return!0;const i=r.style;if(i&&"object"==typeof i){if(mc(i.background))return!0;if(mc(i.backgroundColor))return!0}return!1}function yc(e,t){return"function"==typeof t?t(e):e[t]}function bc(e,t){if(t)return t(e);if(null==e)return"";if("number"==typeof e)return Number.isFinite(e)?oc(e):String(e);if(e instanceof Date)return sc(e);if("object"==typeof e&&null!==e){const t=e;if(void 0!==t.id)return String(t.id);if(void 0!==t.name)return String(t.name);try{return JSON.stringify(e)}catch{return Array.isArray(e)?`[Array(${e.length})]`:"[Object]"}}return String(e)}function vc(e,t,r){const a="string"==typeof t?t:t.accessor||t.key||"";return{label:"string"==typeof t?t:t.label,value:bc(yc(e,a),"string"==typeof t?r:t.format||r)}}function wc(e={}){const{fields:t,chrome:r,title:a,format:i,style:o={},className:n=""}=e;return e=>{if(!e||"object"!=typeof e)return null;let s;const c=[];if(a){const t=yc(e,a);s=bc(t,i)}if(t&&t.length>0)c.push(...t.map(t=>vc(e,t,i)));else if(!a){const t=["value","y","name","id","label"];for(const r of t)if(void 0!==e[r]){s=bc(e[r],i);break}if(!s){const t=Object.keys(e).filter(e=>!e.startsWith("_"));t.length>0&&(s=bc(e[t[0]],i))}}/* @__PURE__ */ /* @__PURE__ */
|
|
2
|
+
return(0,Qd.jsxs)(Zd,{chrome:r,className:n,style:o,children:[s&&/* @__PURE__ */ /* @__PURE__ */(0,Qd.jsx)("div",{style:{fontWeight:c.length>0?"bold":"normal"},children:s}),c.map((e,t)=>/* @__PURE__ */ /* @__PURE__ */(0,Qd.jsxs)("div",{style:{marginTop:0===t&&s?"4px":0},children:[e.label&&/* @__PURE__ */ /* @__PURE__ */(0,Qd.jsxs)("span",{children:[e.label,": "]}),e.value]},t))]})}}function Ac(e={}){const{fields:t=[],chrome:r,title:a,format:i,style:o={},className:n="",showLabels:s=!0,separator:c=": "}=e;return e=>{if(!e||"object"!=typeof e)return null;const l=[];if(a){const t=yc(e,a);l.push({value:bc(t,i)})}if(t&&Array.isArray(t)&&t.length>0)for(const r of t){const t=vc(e,r,i);l.push({...t,label:s?t.label:void 0})}else{const t=lc(e,{skipPositional:!1});null!=t.title&&l.push({label:void 0,value:bc(t.title,i),bold:!0}),t.entries.forEach(e=>{l.push({label:s?e.key:void 0,value:bc(e.value,i)})})}return Array.isArray(l)&&0!==l.length?/* @__PURE__ */ /* @__PURE__ */(0,Qd.jsx)(Zd,{chrome:r,className:`semiotic-tooltip-multiline ${n}`.trim(),style:o,children:l.map((e,t)=>/* @__PURE__ */ /* @__PURE__ */(0,Qd.jsxs)("div",{style:{marginBottom:t<l.length-1?"4px":0,fontWeight:e.bold?"bold":void 0},children:[e.label&&/* @__PURE__ */ /* @__PURE__ */(0,Qd.jsxs)("strong",{children:[e.label,c]}),e.value]},t))}):null}}function xc(e){return"multi"===e||$c(e)}function $c(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&"mode"in e&&"multi"===e.mode}function Cc(e){const{tooltip:t,defaultTooltipContent:r,multiDefaultContent:a=kc(),customFunctionContext:i="datum"}=e,o=t;if(!1===t)return{tooltipContent:()=>null};if(xc(o)){const e=$c(o)&&"function"==typeof o.content?Rc(void 0===o.chrome?o.content:{content:o.content,chrome:o.chrome}):void 0,t=$c(o)?o.chrome:void 0;return{tooltipContent:e||(void 0===t?a:e=>{const r=a(e);return uc(r)?/* @__PURE__ */ /* @__PURE__ */(0,Qd.jsx)(Xd,{chrome:t,children:r}):null}),tooltipMode:"multi"}}return"hover"===i&&"function"==typeof t?{tooltipContent:t}:{tooltipContent:Rc(o)||r}}function Sc(e){const{tooltip:t,defaultTooltipContent:r,customFunctionContext:a="datum"}=e;return!1===t?{tooltipContent:()=>null}:"hover"===a&&"function"==typeof t?{tooltipContent:t}:{tooltipContent:Rc(t)||r}}function kc({xFormat:e,yFormat:t}={}){function r(e,t){if(t)try{const r=t(e);if(null!=r)return r}catch{}return bc(e)}return a=>{const i=a.allSeries;if(!i||0===i.length){const e=a.data?.value??a.data?.y;/* @__PURE__ */ /* @__PURE__ */
|
|
3
|
+
return(0,Qd.jsx)(Zd,{children:/* @__PURE__ */ /* @__PURE__ */(0,Qd.jsx)("div",{children:r(e,t)})})}const o=a.xValue??a.data?.time??a.data?.x;/* @__PURE__ */ /* @__PURE__ */
|
|
4
|
+
return(0,Qd.jsxs)(Zd,{children:[null!=o&&/* @__PURE__ */ /* @__PURE__ */(0,Qd.jsx)("div",{style:{fontWeight:600,marginBottom:4,fontSize:"0.9em",borderBottom:"1px solid var(--semiotic-border, #eee)",paddingBottom:4},children:r(o,e)}),i.map((e,a)=>/* @__PURE__ */ /* @__PURE__ */(0,Qd.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"1px 0"},children:[
|
|
5
5
|
/* @__PURE__ */
|
|
6
|
-
/* @__PURE__ */(0,
|
|
6
|
+
/* @__PURE__ */(0,Qd.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:e.color,flexShrink:0}}),
|
|
7
7
|
/* @__PURE__ */
|
|
8
|
-
/* @__PURE__ */(0,
|
|
8
|
+
/* @__PURE__ */(0,Qd.jsx)("span",{style:{flex:1,fontSize:"0.85em"},children:e.group}),
|
|
9
9
|
/* @__PURE__ */
|
|
10
|
-
/* @__PURE__ */(0,Xd.jsx)("span",{style:{fontWeight:500,fontSize:"0.85em"},children:r(e.value,t&&(r=>t(r,e.group)))})]},a))]})}}function Sc(e){if(!0!==e){if("function"==typeof e||"object"==typeof e&&null!==e&&"content"in e&&"function"==typeof e.content&&!Ac(e)){const t="function"==typeof e?e:e.content,r="function"==typeof e?void 0:e.chrome,a=e=>{const a=ic(e);if(!a)return null;const i=t(a);return cc(i)?void 0===r&&(fc(t)||fc(i))?i:/* @__PURE__ */ /* @__PURE__ */(0,Xd.jsx)(Jd,{chrome:r,children:i}):null};return void 0===r&&fc(t)?hc(a):a}if(!1===e||void 0===e)return!1;if(Ac(e)){if("function"==typeof e.content)return Zd||"production"===process.env.NODE_ENV||(Zd=!0,console.warn('[semiotic] tooltip={{ mode: "multi", content }} reached a chart without multi-series hover. content receives one datum and no allSeries.')),Sc(void 0===e.chrome?e.content:{content:e.content,chrome:e.chrome});"production"!==process.env.NODE_ENV&&console.warn('[semiotic] tooltip={{ mode: "multi" }} reached normalizeTooltip without a chart that wires tooltipMode. Use a line/area-family chart with multi support, or pass frameProps.tooltipMode: "multi" to StreamXYFrame.');const t=vc({chrome:e.chrome});return Sc(e=>t(e))}if("object"==typeof e&&null!==e&&("fields"in e||"title"in e||"chrome"in e)){const t=bc(e);return Sc(e=>t(e))}if("multi"===e){"production"!==process.env.NODE_ENV&&console.warn('[semiotic] tooltip="multi" reached normalizeTooltip on a single-tooltip chart. Rendering multi-field content as a backward-compatible fallback.');const e=vc();return Sc(t=>e(t))}return bc()}}function kc(e=240){const t=e*Math.PI/180,r=360-e,a=180+r/2,i=a*Math.PI/180;return{sweepRad:t,gapDeg:r,startAngleDeg:a,startAngleRad:i,offsetRad:-Math.PI/2+i}}function Rc(e,t,r,a,i){const o=r-t||1;return i+(Math.max(t,Math.min(r,e))-t)/o*a}function Pc(e=240){const{sweepRad:t,offsetRad:r}=kc(e),a=[[Math.cos(r),Math.sin(r)],[Math.cos(r+t),Math.sin(r+t)],[0,0]];for(let e=0;e<2*Math.PI;e+=Math.PI/2)((e-r)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)<=t+.001&&a.push([Math.cos(e),Math.sin(e)]);const i=a.map(e=>e[0]),o=a.map(e=>e[1]),[n,s]=P(i),[c,l]=P(o);return{minX:n,maxX:s,minY:c,maxY:l,width:s-n,height:l-c,cx:(n+s)/2,cy:(c+l)/2}}var Ec=Object.create,Nc=Object.defineProperty,Tc=Object.getOwnPropertyDescriptor,Ic=Object.getOwnPropertyNames,Mc=Object.getPrototypeOf,Oc=Object.prototype.hasOwnProperty,jc=(e,t)=>{for(var r in t)Nc(e,r,{get:t[r],enumerable:!0})},Fc=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of Ic(t))Oc.call(e,i)||i===r||Nc(e,i,{get:()=>t[i],enumerable:!(a=Tc(t,i))||a.enumerable});return e},zc=(e,t,r)=>(r=null!=e?Ec(Mc(e)):{},Fc(!t&&e&&e.__esModule?r:Nc(r,"default",{value:e,enumerable:!0}),e)),Lc={};jc(Lc,{exportChartBrowser:()=>e});var Bc,Dc,_c,Uc,Gc=(Bc={"src/components/export/exportChartBrowser.ts"(){}},function(){if(_c)throw _c[0];try{return Bc&&(Dc=(0,Bc[Ic(Bc)[0]])(Bc=0)),Dc}catch(e){throw _c=[e],e}}),Vc={};jc(Vc,{AESTHETICS_OFF_PROFILE:()=>tl,CARBON_ALERT:()=>Jc,CARBON_CATEGORICAL_14:()=>Kc,COLOR_BLIND_SAFE_CATEGORICAL:()=>Hc,DARK_THEME:()=>qc,DEFAULT_AESTHETIC_PROFILE:()=>el,DEFAULT_AESTHETIC_THRESHOLDS:()=>Qc,DEFAULT_AESTHETIC_WEIGHTS:()=>Zc,HIGH_CONTRAST_THEME:()=>Yc,IncrementalExtent:()=>Dd,LIGHT_THEME:()=>Wc,MultiLineTooltip:()=>vc,MultiPointTooltip:()=>Cc,RingBuffer:()=>Bd,THEME_PRESETS:()=>Xc,Tooltip:()=>bc,TooltipRoot:()=>Jd,accessibilityCaveats:()=>ma,adaptiveTimeTicks:()=>ae,auditAccessibility:()=>fa,auditData:()=>sr,auditMobileVisualization:()=>Va,auditObservedScene:()=>Fs,auditVisualHierarchy:()=>T,buildNavigationTree:()=>xo,buildReaderGrounding:()=>Ho,communicativeActForIntent:()=>Oi,composeStyleRules:()=>k,computeArcBoundingBox:()=>Pc,configToJSX:()=>fs,configToJSXWithReport:()=>ys,copyConfig:()=>ps,countNodes:()=>Co,createHatchPattern:()=>Ce,darkenColor:()=>be,describeChart:()=>Wi,deserializeSelections:()=>vs,diagnoseConfig:()=>jr,evaluateAesthetics:()=>K,evaluateChart:()=>ka,exportChart:()=>ws,flattenVisible:()=>$o,formatAccessibilityAudit:()=>ga,formatDataAudit:()=>Vt,formatEvaluateChart:()=>Sa,formatMobileVisualizationAudit:()=>Ha,fromConfig:()=>us,fromURL:()=>hs,fromVegaLite:()=>Zs,getHitRadius:()=>Wo,getSourceRows:()=>Ko,hasOwnTooltipChrome:()=>fc,hasTooltipContent:()=>cc,hatchFillId:()=>Pe,hatchFillKey:()=>Re,histogramBinSelectionDatum:()=>Zo,isHatchFill:()=>ke,isMultiTooltip:()=>wc,lightenColor:()=>ve,makeNodeRuleContext:()=>A,makeRuleValueResolver:()=>v,makeStyleRuleStyleFn:()=>R,makeXYRuleContext:()=>w,markTooltipChrome:()=>hc,matchesThreshold:()=>$,mobileVisualizationCaveats:()=>Wa,normalizeTooltip:()=>Sc,profileNumericFields:()=>Gt,resolveChartSize:()=>ye,resolveCommunicativeAct:()=>Li,resolveMultiCapableTooltip:()=>xc,resolveResponsiveDimension:()=>oe,resolveResponsiveRules:()=>de,resolveStyleRules:()=>S,resolveThemePreset:()=>n,resolveTooltipContent:()=>$c,responsiveRuleMatches:()=>le,ruleMatches:()=>C,serializeSelections:()=>bs,smartTickFormat:()=>ie,sweepToAngles:()=>kc,themeToCSS:()=>h,themeToCSSVariables:()=>d,themeToTokens:()=>p,toConfig:()=>os,toDataAuditNotifications:()=>Wt,toEvaluateChartNotifications:()=>Ra,toURL:()=>ds,unwrapDatum:()=>Ze,validateProps:()=>Je,valueToAngle:()=>Rc}),module.exports=(Uc=Vc,Fc(Nc({},"__esModule",{value:!0}),Uc));var Hc=["#0072B2","#E69F00","#009E73","#CC79A7","#56B4E9","#D55E00","#F0E442","#000000"],Wc={mode:"light",colors:{primary:"#00a2ce",secondary:"#6c757d",categorical:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#333",textSecondary:"#666",grid:"#e0e0e0",border:"#ccc",selection:"#00a2ce",selectionOpacity:.15,success:"#2ca02c",danger:"#d62728",warning:"#f0ad4e",error:"#b4181b",info:"#00a2ce"},typography:{fontFamily:"sans-serif",titleSize:16,labelSize:12,tickSize:12}},qc={mode:"dark",colors:{primary:"#4fc3f7",secondary:"#90a4ae",categorical:["#4fc3f7","#ffb74d","#81c784","#ef5350","#ba68c8","#a1887f","#f06292","#90a4ae","#dce775","#4dd0e1"],sequential:"blues",diverging:"RdBu",background:"#1a1a2e",surface:"#252540",text:"#e0e0e0",textSecondary:"#aaa",grid:"#333",border:"#555",selection:"#4fc3f7",selectionOpacity:.15,success:"#81c784",danger:"#ef5350",warning:"#ffb74d",error:"#d84848",info:"#4fc3f7"},typography:{fontFamily:"sans-serif",titleSize:16,labelSize:12,tickSize:12}},Yc={mode:"light",colors:{primary:"#0000cc",secondary:"#333333",categorical:Hc,sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#000000",textSecondary:"#333333",grid:"#999999",border:"#000000",focus:"#0000cc",selection:"#0000cc",selectionOpacity:.1,success:"#006400",danger:"#cc0000",warning:"#b15a00",error:"#8b0000",info:"#0000cc"},typography:{fontFamily:"system-ui, sans-serif",titleSize:18,labelSize:14,tickSize:12},tooltip:{background:"#000000",text:"#ffffff",borderRadius:"4px",fontSize:"14px",shadow:"0 2px 8px rgba(0, 0, 0, 0.3)"},borderRadius:"4px"},Kc=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"],Jc={danger:"#da1e28",warning:"#f1c21b",success:"#24a148",info:"#0043ce"},Xc={light:Wc,dark:qc,"high-contrast":Yc,pastels:{mode:"light",colors:{primary:"#c9a0dc",secondary:"#b8a8c8",categorical:["#f0a0c0","#88d4ab","#b0a0e8","#f0c888"],sequential:"purples",background:"#fdf6f0",surface:"#fff5ee",text:"#4a3728",textSecondary:"#7a644a",grid:"#e8d5c4",border:"#e8d5c4",focus:"#8a5fae",annotation:"#8a5fae",success:"#9ad4a3",danger:"#e8869a",warning:"#f0c888",error:"#c86070",info:"#9cb8e0"},typography:{fontFamily:"Inter, system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#fff5ee",text:"#4a3728",borderRadius:"8px",shadow:"0 2px 8px rgba(0, 0, 0, 0.12)"},borderRadius:"10px"},"pastels-dark":{mode:"dark",colors:{primary:"#c9a0dc",secondary:"#a899c0",categorical:["#f0a0c0","#88d4ab","#b0a0e8","#f0c888"],sequential:"purples",background:"#1a1525",surface:"#251e35",text:"#e8ddf0",textSecondary:"#a899c0",grid:"#3d3455",border:"#3d3455",focus:"#c9a0dc",annotation:"#c9a0dc",success:"#88d4ab",danger:"#f0a0c0",warning:"#f0c888",error:"#e87690",info:"#9cb8e0"},typography:{fontFamily:"Inter, system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#251e35",text:"#e8ddf0",borderRadius:"8px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"10px"},"bi-tool":{mode:"light",colors:{primary:"#2563eb",secondary:"#6b7280",categorical:["#2563eb","#0d9488","#ea580c","#6b7280"],sequential:"blues",background:"#f5f6f8",surface:"#ffffff",text:"#2c3e50",textSecondary:"#64717f",grid:"#d8dce3",border:"#d8dce3",focus:"#2563eb",annotation:"#2563eb",success:"#10b981",danger:"#ef4444",warning:"#f59e0b",error:"#dc2626",info:"#2563eb"},typography:{fontFamily:"'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#2c3e50",borderRadius:"6px",shadow:"0 2px 8px rgba(0, 0, 0, 0.12)"},borderRadius:"8px"},"bi-tool-dark":{mode:"dark",colors:{primary:"#3b82f6",secondary:"#9ca3af",categorical:["#3b82f6","#14b8a6","#f97316","#9ca3af"],sequential:"blues",background:"#111827",surface:"#1f2937",text:"#f3f4f6",textSecondary:"#9ca3af",grid:"#374151",border:"#374151",focus:"#3b82f6",annotation:"#3b82f6",success:"#34d399",danger:"#f87171",warning:"#fbbf24",error:"#ef4444",info:"#60a5fa"},typography:{fontFamily:"'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1f2937",text:"#f3f4f6",borderRadius:"6px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"8px"},italian:{mode:"light",colors:{primary:"#cc0000",secondary:"#666666",categorical:["#cc0000","#333333","#c8a415","#4682b4"],sequential:"reds",background:"#fafafa",surface:"#ffffff",text:"#1a1a1a",textSecondary:"#666666",grid:"#e0e0e0",border:"#e0e0e0",focus:"#cc0000",annotation:"#cc0000",success:"#556b2f",danger:"#cc0000",warning:"#c8a415",error:"#8b0000",info:"#4682b4"},typography:{fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#1a1a1a",borderRadius:"2px",shadow:"0 2px 4px rgba(0, 0, 0, 0.15)"},borderRadius:"2px"},"italian-dark":{mode:"dark",colors:{primary:"#ff3333",secondary:"#aaaaaa",categorical:["#ff3333","#aaaaaa","#d4a843","#6aa4d4"],sequential:"reds",background:"#0a0a0a",surface:"#1a1a1a",text:"#f5f5f5",textSecondary:"#aaaaaa",grid:"#333333",border:"#333333",focus:"#ff3333",annotation:"#ff3333",success:"#7a8b5a",danger:"#ff3333",warning:"#d4a843",error:"#cc0000",info:"#6aa4d4"},typography:{fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1a1a1a",text:"#f5f5f5",borderRadius:"2px",shadow:"0 2px 8px rgba(0, 0, 0, 0.5)"},borderRadius:"2px"},tufte:{mode:"light",colors:{primary:"#8b0000",secondary:"#555555",categorical:["#8b4513","#556b2f","#4a5568","#800020"],sequential:"oranges",background:"#fffff8",surface:"#fffff8",text:"#111111",textSecondary:"#555555",grid:"#e0ddd0",border:"#e0ddd0",focus:"#8b0000",annotation:"#8b0000",success:"#556b2f",danger:"#8b0000",warning:"#b88700",error:"#6b0000",info:"#4a5568"},typography:{fontFamily:"Georgia, 'Times New Roman', serif",titleSize:16,labelSize:12,tickSize:12,tickFontFamily:"'Courier New', Courier, monospace",legendSize:11},tooltip:{background:"#fffff8",text:"#111111",borderRadius:"2px",shadow:"0 1px 3px rgba(0, 0, 0, 0.1)"},borderRadius:"0px"},"tufte-dark":{mode:"dark",colors:{primary:"#c05050",secondary:"#a09880",categorical:["#c08050","#7a8b5a","#8090a0","#a05060"],sequential:"oranges",background:"#1c1b18",surface:"#262520",text:"#e8e4d8",textSecondary:"#a09880",grid:"#3d3c35",border:"#3d3c35",focus:"#c05050",annotation:"#d06a6a",success:"#7a8b5a",danger:"#c05050",warning:"#c8a060",error:"#a04040",info:"#8090a0"},typography:{fontFamily:"Georgia, 'Times New Roman', serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#262520",text:"#e8e4d8",borderRadius:"2px",shadow:"0 2px 6px rgba(0, 0, 0, 0.4)"},borderRadius:"0px"},journalist:{mode:"light",colors:{primary:"#e45050",secondary:"#666666",categorical:["#3a86c8","#e45050","#d4a843","#888888"],sequential:"blues",background:"#ffffff",surface:"#f8f8f8",text:"#222222",textSecondary:"#666666",grid:"#d4d4d4",border:"#d4d4d4",focus:"#e45050",annotation:"#c63b3b",success:"#2d7a3d",danger:"#c8303a",warning:"#d4a843",error:"#a02028",info:"#3a86c8"},typography:{fontFamily:"'Franklin Gothic Medium', 'Libre Franklin', Arial, sans-serif",titleSize:18,labelSize:12,tickSize:12,tickFontFamily:"'Courier New', Courier, monospace",legendSize:11},tooltip:{background:"#f8f8f8",text:"#222222",borderRadius:"4px",shadow:"0 2px 6px rgba(0, 0, 0, 0.12)"},borderRadius:"4px"},"journalist-dark":{mode:"dark",colors:{primary:"#ff6b6b",secondary:"#a0a0a0",categorical:["#5a9fd8","#ff6b6b","#e0c060","#aaaaaa"],sequential:"blues",background:"#141414",surface:"#1e1e1e",text:"#ededed",textSecondary:"#a0a0a0",grid:"#383838",border:"#383838",focus:"#ff6b6b",annotation:"#ff6b6b",success:"#6fba78",danger:"#ff6b6b",warning:"#e0c060",error:"#d04040",info:"#5a9fd8"},typography:{fontFamily:"'Franklin Gothic Medium', 'Libre Franklin', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1e1e1e",text:"#ededed",borderRadius:"4px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"4px"},playful:{mode:"light",colors:{primary:"#8b5cf6",secondary:"#7c5a9e",categorical:["#8b5cf6","#ec4899","#06b6d4","#84cc16"],sequential:"viridis",background:"#fdf8ff",surface:"#ffffff",text:"#2d1b4e",textSecondary:"#7c5a9e",grid:"#e8d0f8",border:"#e8d0f8",focus:"#8b5cf6",annotation:"#7a47e8",success:"#10d870",danger:"#ff4b6e",warning:"#ffaa33",error:"#e11d48",info:"#06b6d4"},typography:{fontFamily:"'Nunito', 'Poppins', system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#2d1b4e",borderRadius:"12px",shadow:"0 4px 12px rgba(139, 92, 246, 0.15)"},borderRadius:"12px"},"playful-dark":{mode:"dark",colors:{primary:"#a78bfa",secondary:"#b8a0d8",categorical:["#a78bfa","#f472b6","#22d3ee","#a3e635"],sequential:"viridis",background:"#150a28",surface:"#1f1138",text:"#f0e8ff",textSecondary:"#b8a0d8",grid:"#3a2560",border:"#3a2560",focus:"#a78bfa",annotation:"#a78bfa",success:"#4ade80",danger:"#fb7185",warning:"#fbbf24",error:"#f43f5e",info:"#22d3ee"},typography:{fontFamily:"'Nunito', 'Poppins', system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1f1138",text:"#f0e8ff",borderRadius:"12px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"12px"},carbon:{mode:"light",colors:{primary:"#0f62fe",secondary:"#525252",categorical:["#6929c4","#1192e8","#005d5d","#9f1853"],sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#161616",textSecondary:"#525252",grid:"#e0e0e0",border:"#e0e0e0",focus:"#0f62fe",annotation:"#0f62fe",success:"#24a148",danger:"#da1e28",warning:"#f1c21b",error:"#a2191f",info:"#0043ce"},typography:{fontFamily:"'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#161616",borderRadius:"2px",shadow:"0 2px 6px rgba(0, 0, 0, 0.2)"},borderRadius:"0px"},"carbon-dark":{mode:"dark",colors:{primary:"#4589ff",secondary:"#a8a8a8",categorical:["#a56eff","#33b1ff","#08bdba","#ff7eb6"],sequential:"blues",diverging:"RdBu",background:"#161616",surface:"#262626",text:"#f4f4f4",textSecondary:"#a8a8a8",grid:"#393939",border:"#393939",focus:"#4589ff",annotation:"#4589ff",success:"#42be65",danger:"#fa4d56",warning:"#f1c21b",error:"#da1e28",info:"#4589ff"},typography:{fontFamily:"'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#262626",text:"#f4f4f4",borderRadius:"2px",shadow:"0 4px 12px rgba(0, 0, 0, 0.5)"},borderRadius:"0px"}},Zc=Object.freeze({"mark-scaffold-hierarchy":3,"palette-authorship":1,"palette-economy":1,"typographic-hierarchy":1,"theme-coherence":2,"editorial-emphasis":1}),Qc=Object.freeze({hierarchyRatio:2,scaffoldContrastMin:1.1,scaffoldContrastMax:2,titleScaleRatio:1.25,categoricalColorMax:7,emphasisRatioMin:.05,emphasisRatioMax:.35}),el=Object.freeze({name:"Semiotic balanced",weights:Zc,thresholds:Qc,minimumScore:70}),tl=Object.freeze({name:"Aesthetics off",weights:/* @__PURE__ */Object.freeze(
|
|
10
|
+
/* @__PURE__ */(0,Qd.jsx)("span",{style:{fontWeight:500,fontSize:"0.85em"},children:r(e.value,t&&(r=>t(r,e.group)))})]},a))]})}}function Rc(e){if(!0!==e){if("function"==typeof e||"object"==typeof e&&null!==e&&"content"in e&&"function"==typeof e.content&&!$c(e)){const t="function"==typeof e?e:e.content,r="function"==typeof e?void 0:e.chrome,a=e=>{const a=nc(e);if(!a)return null;const i=t(a);return uc(i)?void 0===r&&(gc(t)||gc(i))?i:/* @__PURE__ */ /* @__PURE__ */(0,Qd.jsx)(Zd,{chrome:r,children:i}):null};return void 0===r&&gc(t)?fc(a):a}if(!1===e||void 0===e)return!1;if($c(e)){if("function"==typeof e.content)return eh||"production"===process.env.NODE_ENV||(eh=!0,console.warn('[semiotic] tooltip={{ mode: "multi", content }} reached a chart without multi-series hover. content receives one datum and no allSeries.')),Rc(void 0===e.chrome?e.content:{content:e.content,chrome:e.chrome});"production"!==process.env.NODE_ENV&&console.warn('[semiotic] tooltip={{ mode: "multi" }} reached normalizeTooltip without a chart that wires tooltipMode. Use a line/area-family chart with multi support, or pass frameProps.tooltipMode: "multi" to StreamXYFrame.');const t=Ac({chrome:e.chrome});return Rc(e=>t(e))}if("object"==typeof e&&null!==e&&("fields"in e||"title"in e||"chrome"in e)){const t=wc(e);return Rc(e=>t(e))}if("multi"===e){"production"!==process.env.NODE_ENV&&console.warn('[semiotic] tooltip="multi" reached normalizeTooltip on a single-tooltip chart. Rendering multi-field content as a backward-compatible fallback.');const e=Ac();return Rc(t=>e(t))}return wc()}}function Pc(e=240){const t=e*Math.PI/180,r=360-e,a=180+r/2,i=a*Math.PI/180;return{sweepRad:t,gapDeg:r,startAngleDeg:a,startAngleRad:i,offsetRad:-Math.PI/2+i}}function Ec(e,t,r,a,i){const o=r-t||1;return i+(Math.max(t,Math.min(r,e))-t)/o*a}function Nc(e=240){const{sweepRad:t,offsetRad:r}=Pc(e),a=[[Math.cos(r),Math.sin(r)],[Math.cos(r+t),Math.sin(r+t)],[0,0]];for(let e=0;e<2*Math.PI;e+=Math.PI/2)((e-r)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)<=t+.001&&a.push([Math.cos(e),Math.sin(e)]);const i=a.map(e=>e[0]),o=a.map(e=>e[1]),[n,s]=P(i),[c,l]=P(o);return{minX:n,maxX:s,minY:c,maxY:l,width:s-n,height:l-c,cx:(n+s)/2,cy:(c+l)/2}}var Tc=Object.create,Ic=Object.defineProperty,Oc=Object.getOwnPropertyDescriptor,Mc=Object.getOwnPropertyNames,jc=Object.getPrototypeOf,Fc=Object.prototype.hasOwnProperty,zc=(e,t)=>{for(var r in t)Ic(e,r,{get:t[r],enumerable:!0})},Lc=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of Mc(t))Fc.call(e,i)||i===r||Ic(e,i,{get:()=>t[i],enumerable:!(a=Oc(t,i))||a.enumerable});return e},Bc=(e,t,r)=>(r=null!=e?Tc(jc(e)):{},Lc(!t&&e&&e.__esModule?r:Ic(r,"default",{value:e,enumerable:!0}),e)),Dc={};zc(Dc,{exportChartBrowser:()=>e});var _c,Uc,Gc,Vc,Hc=(_c={"src/components/export/exportChartBrowser.ts"(){}},function(){if(Gc)throw Gc[0];try{return _c&&(Uc=(0,_c[Mc(_c)[0]])(_c=0)),Uc}catch(e){throw Gc=[e],e}}),Wc={};zc(Wc,{AESTHETICS_OFF_PROFILE:()=>al,CARBON_ALERT:()=>Zc,CARBON_CATEGORICAL_14:()=>Xc,COLOR_BLIND_SAFE_CATEGORICAL:()=>qc,DARK_THEME:()=>Kc,DEFAULT_AESTHETIC_PROFILE:()=>rl,DEFAULT_AESTHETIC_THRESHOLDS:()=>tl,DEFAULT_AESTHETIC_WEIGHTS:()=>el,HIGH_CONTRAST_THEME:()=>Jc,IncrementalExtent:()=>Ud,LIGHT_THEME:()=>Yc,MultiLineTooltip:()=>Ac,MultiPointTooltip:()=>kc,RingBuffer:()=>_d,THEME_PRESETS:()=>Qc,Tooltip:()=>wc,TooltipRoot:()=>Zd,accessibilityCaveats:()=>ma,adaptiveTimeTicks:()=>ae,auditAccessibility:()=>fa,auditData:()=>sr,auditMobileVisualization:()=>Wa,auditObservedScene:()=>Ls,auditVisualHierarchy:()=>T,buildNavigationTree:()=>Co,buildReaderGrounding:()=>qo,communicativeActForIntent:()=>Fi,composeStyleRules:()=>k,computeArcBoundingBox:()=>Nc,configToJSX:()=>gs,configToJSXWithReport:()=>vs,copyConfig:()=>ms,countNodes:()=>ko,createHatchPattern:()=>Ce,darkenColor:()=>be,describeChart:()=>Yi,deserializeSelections:()=>As,diagnoseConfig:()=>jr,evaluateAesthetics:()=>K,evaluateChart:()=>Ra,exportChart:()=>xs,flattenVisible:()=>So,formatAccessibilityAudit:()=>ga,formatDataAudit:()=>Vt,formatEvaluateChart:()=>ka,formatMobileVisualizationAudit:()=>qa,fromConfig:()=>hs,fromURL:()=>fs,fromVegaLite:()=>ec,getHitRadius:()=>Yo,getSourceRows:()=>Xo,hasOwnTooltipChrome:()=>gc,hasTooltipContent:()=>uc,hatchFillId:()=>Pe,hatchFillKey:()=>Re,histogramBinSelectionDatum:()=>en,isHatchFill:()=>ke,isMultiTooltip:()=>xc,lightenColor:()=>ve,makeNodeRuleContext:()=>A,makeRuleValueResolver:()=>v,makeStyleRuleStyleFn:()=>R,makeXYRuleContext:()=>w,markTooltipChrome:()=>fc,matchesThreshold:()=>$,mobileVisualizationCaveats:()=>Ya,normalizeTooltip:()=>Rc,profileNumericFields:()=>Gt,resolveChartSize:()=>ye,resolveCommunicativeAct:()=>Di,resolveMultiCapableTooltip:()=>Cc,resolveResponsiveDimension:()=>oe,resolveResponsiveRules:()=>de,resolveStyleRules:()=>S,resolveThemePreset:()=>n,resolveTooltipContent:()=>Sc,responsiveRuleMatches:()=>le,ruleMatches:()=>C,serializeSelections:()=>ws,smartTickFormat:()=>ie,sweepToAngles:()=>Pc,themeToCSS:()=>h,themeToCSSVariables:()=>d,themeToTokens:()=>p,toConfig:()=>ss,toDataAuditNotifications:()=>Wt,toEvaluateChartNotifications:()=>Pa,toURL:()=>ps,unwrapDatum:()=>Ze,validateProps:()=>Je,valueToAngle:()=>Ec}),module.exports=(Vc=Wc,Lc(Ic({},"__esModule",{value:!0}),Vc));var qc=["#0072B2","#E69F00","#009E73","#CC79A7","#56B4E9","#D55E00","#F0E442","#000000"],Yc={mode:"light",colors:{primary:"#00a2ce",secondary:"#6c757d",categorical:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#333",textSecondary:"#666",grid:"#e0e0e0",border:"#ccc",selection:"#00a2ce",selectionOpacity:.15,success:"#2ca02c",danger:"#d62728",warning:"#f0ad4e",error:"#b4181b",info:"#00a2ce"},typography:{fontFamily:"sans-serif",titleSize:16,labelSize:12,tickSize:12}},Kc={mode:"dark",colors:{primary:"#4fc3f7",secondary:"#90a4ae",categorical:["#4fc3f7","#ffb74d","#81c784","#ef5350","#ba68c8","#a1887f","#f06292","#90a4ae","#dce775","#4dd0e1"],sequential:"blues",diverging:"RdBu",background:"#1a1a2e",surface:"#252540",text:"#e0e0e0",textSecondary:"#aaa",grid:"#333",border:"#555",selection:"#4fc3f7",selectionOpacity:.15,success:"#81c784",danger:"#ef5350",warning:"#ffb74d",error:"#d84848",info:"#4fc3f7"},typography:{fontFamily:"sans-serif",titleSize:16,labelSize:12,tickSize:12}},Jc={mode:"light",colors:{primary:"#0000cc",secondary:"#333333",categorical:qc,sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#000000",textSecondary:"#333333",grid:"#999999",border:"#000000",focus:"#0000cc",selection:"#0000cc",selectionOpacity:.1,success:"#006400",danger:"#cc0000",warning:"#b15a00",error:"#8b0000",info:"#0000cc"},typography:{fontFamily:"system-ui, sans-serif",titleSize:18,labelSize:14,tickSize:12},tooltip:{background:"#000000",text:"#ffffff",borderRadius:"4px",fontSize:"14px",shadow:"0 2px 8px rgba(0, 0, 0, 0.3)"},borderRadius:"4px"},Xc=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"],Zc={danger:"#da1e28",warning:"#f1c21b",success:"#24a148",info:"#0043ce"},Qc={light:Yc,dark:Kc,"high-contrast":Jc,pastels:{mode:"light",colors:{primary:"#c9a0dc",secondary:"#b8a8c8",categorical:["#f0a0c0","#88d4ab","#b0a0e8","#f0c888"],sequential:"purples",background:"#fdf6f0",surface:"#fff5ee",text:"#4a3728",textSecondary:"#7a644a",grid:"#e8d5c4",border:"#e8d5c4",focus:"#8a5fae",annotation:"#8a5fae",success:"#9ad4a3",danger:"#e8869a",warning:"#f0c888",error:"#c86070",info:"#9cb8e0"},typography:{fontFamily:"Inter, system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#fff5ee",text:"#4a3728",borderRadius:"8px",shadow:"0 2px 8px rgba(0, 0, 0, 0.12)"},borderRadius:"10px"},"pastels-dark":{mode:"dark",colors:{primary:"#c9a0dc",secondary:"#a899c0",categorical:["#f0a0c0","#88d4ab","#b0a0e8","#f0c888"],sequential:"purples",background:"#1a1525",surface:"#251e35",text:"#e8ddf0",textSecondary:"#a899c0",grid:"#3d3455",border:"#3d3455",focus:"#c9a0dc",annotation:"#c9a0dc",success:"#88d4ab",danger:"#f0a0c0",warning:"#f0c888",error:"#e87690",info:"#9cb8e0"},typography:{fontFamily:"Inter, system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#251e35",text:"#e8ddf0",borderRadius:"8px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"10px"},"bi-tool":{mode:"light",colors:{primary:"#2563eb",secondary:"#6b7280",categorical:["#2563eb","#0d9488","#ea580c","#6b7280"],sequential:"blues",background:"#f5f6f8",surface:"#ffffff",text:"#2c3e50",textSecondary:"#64717f",grid:"#d8dce3",border:"#d8dce3",focus:"#2563eb",annotation:"#2563eb",success:"#10b981",danger:"#ef4444",warning:"#f59e0b",error:"#dc2626",info:"#2563eb"},typography:{fontFamily:"'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#2c3e50",borderRadius:"6px",shadow:"0 2px 8px rgba(0, 0, 0, 0.12)"},borderRadius:"8px"},"bi-tool-dark":{mode:"dark",colors:{primary:"#3b82f6",secondary:"#9ca3af",categorical:["#3b82f6","#14b8a6","#f97316","#9ca3af"],sequential:"blues",background:"#111827",surface:"#1f2937",text:"#f3f4f6",textSecondary:"#9ca3af",grid:"#374151",border:"#374151",focus:"#3b82f6",annotation:"#3b82f6",success:"#34d399",danger:"#f87171",warning:"#fbbf24",error:"#ef4444",info:"#60a5fa"},typography:{fontFamily:"'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1f2937",text:"#f3f4f6",borderRadius:"6px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"8px"},italian:{mode:"light",colors:{primary:"#cc0000",secondary:"#666666",categorical:["#cc0000","#333333","#c8a415","#4682b4"],sequential:"reds",background:"#fafafa",surface:"#ffffff",text:"#1a1a1a",textSecondary:"#666666",grid:"#e0e0e0",border:"#e0e0e0",focus:"#cc0000",annotation:"#cc0000",success:"#556b2f",danger:"#cc0000",warning:"#c8a415",error:"#8b0000",info:"#4682b4"},typography:{fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#1a1a1a",borderRadius:"2px",shadow:"0 2px 4px rgba(0, 0, 0, 0.15)"},borderRadius:"2px"},"italian-dark":{mode:"dark",colors:{primary:"#ff3333",secondary:"#aaaaaa",categorical:["#ff3333","#aaaaaa","#d4a843","#6aa4d4"],sequential:"reds",background:"#0a0a0a",surface:"#1a1a1a",text:"#f5f5f5",textSecondary:"#aaaaaa",grid:"#333333",border:"#333333",focus:"#ff3333",annotation:"#ff3333",success:"#7a8b5a",danger:"#ff3333",warning:"#d4a843",error:"#cc0000",info:"#6aa4d4"},typography:{fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1a1a1a",text:"#f5f5f5",borderRadius:"2px",shadow:"0 2px 8px rgba(0, 0, 0, 0.5)"},borderRadius:"2px"},tufte:{mode:"light",colors:{primary:"#8b0000",secondary:"#555555",categorical:["#8b4513","#556b2f","#4a5568","#800020"],sequential:"oranges",background:"#fffff8",surface:"#fffff8",text:"#111111",textSecondary:"#555555",grid:"#e0ddd0",border:"#e0ddd0",focus:"#8b0000",annotation:"#8b0000",success:"#556b2f",danger:"#8b0000",warning:"#b88700",error:"#6b0000",info:"#4a5568"},typography:{fontFamily:"Georgia, 'Times New Roman', serif",titleSize:16,labelSize:12,tickSize:12,tickFontFamily:"'Courier New', Courier, monospace",legendSize:11},tooltip:{background:"#fffff8",text:"#111111",borderRadius:"2px",shadow:"0 1px 3px rgba(0, 0, 0, 0.1)"},borderRadius:"0px"},"tufte-dark":{mode:"dark",colors:{primary:"#c05050",secondary:"#a09880",categorical:["#c08050","#7a8b5a","#8090a0","#a05060"],sequential:"oranges",background:"#1c1b18",surface:"#262520",text:"#e8e4d8",textSecondary:"#a09880",grid:"#3d3c35",border:"#3d3c35",focus:"#c05050",annotation:"#d06a6a",success:"#7a8b5a",danger:"#c05050",warning:"#c8a060",error:"#a04040",info:"#8090a0"},typography:{fontFamily:"Georgia, 'Times New Roman', serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#262520",text:"#e8e4d8",borderRadius:"2px",shadow:"0 2px 6px rgba(0, 0, 0, 0.4)"},borderRadius:"0px"},journalist:{mode:"light",colors:{primary:"#e45050",secondary:"#666666",categorical:["#3a86c8","#e45050","#d4a843","#888888"],sequential:"blues",background:"#ffffff",surface:"#f8f8f8",text:"#222222",textSecondary:"#666666",grid:"#d4d4d4",border:"#d4d4d4",focus:"#e45050",annotation:"#c63b3b",success:"#2d7a3d",danger:"#c8303a",warning:"#d4a843",error:"#a02028",info:"#3a86c8"},typography:{fontFamily:"'Franklin Gothic Medium', 'Libre Franklin', Arial, sans-serif",titleSize:18,labelSize:12,tickSize:12,tickFontFamily:"'Courier New', Courier, monospace",legendSize:11},tooltip:{background:"#f8f8f8",text:"#222222",borderRadius:"4px",shadow:"0 2px 6px rgba(0, 0, 0, 0.12)"},borderRadius:"4px"},"journalist-dark":{mode:"dark",colors:{primary:"#ff6b6b",secondary:"#a0a0a0",categorical:["#5a9fd8","#ff6b6b","#e0c060","#aaaaaa"],sequential:"blues",background:"#141414",surface:"#1e1e1e",text:"#ededed",textSecondary:"#a0a0a0",grid:"#383838",border:"#383838",focus:"#ff6b6b",annotation:"#ff6b6b",success:"#6fba78",danger:"#ff6b6b",warning:"#e0c060",error:"#d04040",info:"#5a9fd8"},typography:{fontFamily:"'Franklin Gothic Medium', 'Libre Franklin', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1e1e1e",text:"#ededed",borderRadius:"4px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"4px"},playful:{mode:"light",colors:{primary:"#8b5cf6",secondary:"#7c5a9e",categorical:["#8b5cf6","#ec4899","#06b6d4","#84cc16"],sequential:"viridis",background:"#fdf8ff",surface:"#ffffff",text:"#2d1b4e",textSecondary:"#7c5a9e",grid:"#e8d0f8",border:"#e8d0f8",focus:"#8b5cf6",annotation:"#7a47e8",success:"#10d870",danger:"#ff4b6e",warning:"#ffaa33",error:"#e11d48",info:"#06b6d4"},typography:{fontFamily:"'Nunito', 'Poppins', system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#2d1b4e",borderRadius:"12px",shadow:"0 4px 12px rgba(139, 92, 246, 0.15)"},borderRadius:"12px"},"playful-dark":{mode:"dark",colors:{primary:"#a78bfa",secondary:"#b8a0d8",categorical:["#a78bfa","#f472b6","#22d3ee","#a3e635"],sequential:"viridis",background:"#150a28",surface:"#1f1138",text:"#f0e8ff",textSecondary:"#b8a0d8",grid:"#3a2560",border:"#3a2560",focus:"#a78bfa",annotation:"#a78bfa",success:"#4ade80",danger:"#fb7185",warning:"#fbbf24",error:"#f43f5e",info:"#22d3ee"},typography:{fontFamily:"'Nunito', 'Poppins', system-ui, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#1f1138",text:"#f0e8ff",borderRadius:"12px",shadow:"0 4px 12px rgba(0, 0, 0, 0.4)"},borderRadius:"12px"},carbon:{mode:"light",colors:{primary:"#0f62fe",secondary:"#525252",categorical:["#6929c4","#1192e8","#005d5d","#9f1853"],sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#161616",textSecondary:"#525252",grid:"#e0e0e0",border:"#e0e0e0",focus:"#0f62fe",annotation:"#0f62fe",success:"#24a148",danger:"#da1e28",warning:"#f1c21b",error:"#a2191f",info:"#0043ce"},typography:{fontFamily:"'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#ffffff",text:"#161616",borderRadius:"2px",shadow:"0 2px 6px rgba(0, 0, 0, 0.2)"},borderRadius:"0px"},"carbon-dark":{mode:"dark",colors:{primary:"#4589ff",secondary:"#a8a8a8",categorical:["#a56eff","#33b1ff","#08bdba","#ff7eb6"],sequential:"blues",diverging:"RdBu",background:"#161616",surface:"#262626",text:"#f4f4f4",textSecondary:"#a8a8a8",grid:"#393939",border:"#393939",focus:"#4589ff",annotation:"#4589ff",success:"#42be65",danger:"#fa4d56",warning:"#f1c21b",error:"#da1e28",info:"#4589ff"},typography:{fontFamily:"'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif",titleSize:16,labelSize:12,tickSize:12},tooltip:{background:"#262626",text:"#f4f4f4",borderRadius:"2px",shadow:"0 4px 12px rgba(0, 0, 0, 0.5)"},borderRadius:"0px"}},el=Object.freeze({"mark-scaffold-hierarchy":3,"palette-authorship":1,"palette-economy":1,"typographic-hierarchy":1,"theme-coherence":2,"editorial-emphasis":1}),tl=Object.freeze({hierarchyRatio:2,scaffoldContrastMin:1.1,scaffoldContrastMax:2,titleScaleRatio:1.25,categoricalColorMax:7,emphasisRatioMin:.05,emphasisRatioMax:.35}),rl=Object.freeze({name:"Semiotic balanced",weights:el,thresholds:tl,minimumScore:70}),al=Object.freeze({name:"Aesthetics off",weights:/* @__PURE__ */Object.freeze(
|
|
11
11
|
/* @__PURE__ */Object.fromEntries(
|
|
12
|
-
/* @__PURE__ */ /* @__PURE__ */Object.keys(Zc).map(e=>[e,0]))),minimumScore:0}),rl=[["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"]],al=/* @__PURE__ */new Set(["category10","tableau10"]),il=/* @__PURE__ */new Set(["DonutChart","PieChart","SwimlaneChart"]),ol={"mark-scaffold-hierarchy":"Mark–scaffold hierarchy","palette-authorship":"Palette authorship","palette-economy":"Palette economy","typographic-hierarchy":"Typographic hierarchy","theme-coherence":"Theme coherence","editorial-emphasis":"Editorial emphasis"},nl=(zc(require("react")),6e4),sl=60*nl,cl=24*sl,ll=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ul={year:!0,date:!0},dl=[[1e3,"K"],[1e6,"M"],[1e9,"B"]],hl=44,pl={enabled:!0,tapToSelect:!0,tapToLockTooltip:!0,clearSelection:"backgroundTap",targetSize:hl,snap:"nearestDatum",brushHandleSize:hl,standardControls:!1,enabled:!1,tapToSelect:!1,tapToLockTooltip:!1},fl={primary:{width:600,height:400,showAxes:!0,showGrid:!1,enableHover:!0,showLegend:void 0,showLabels:void 0,marginDefaults:{top:50,bottom:60,left:70,right:40}},context:{width:400,height:250,showAxes:!1,showGrid:!1,enableHover:!1,showLegend:!1,showLabels:!1,marginDefaults:{top:10,bottom:10,left:10,right:10}},sparkline:{width:120,height:24,showAxes:!1,showGrid:!1,enableHover:!1,showLegend:!1,showLabels:!1,marginDefaults:{top:2,bottom:2,left:0,right:0}},mobile:{width:390,height:300,showAxes:!0,showGrid:!1,enableHover:!0,showLegend:!1,showLabels:!0,marginDefaults:{top:28,bottom:42,left:44,right:16}}},ml={tile:{width:280,height:184},presentation:{width:540,height:320},inline:{width:void 0,height:void 0},thumbnail:{width:96,height:56}},gl={cellSize:150,cellGap:4,labelWidth:40},yl={MultiAxisLineChart:{width:800,height:400},PieChart:{width:400,height:400},DonutChart:{width:400,height:400},GaugeChart:{width:300,height:250},ForceDirectedGraph:{width:600,height:600},SankeyDiagram:{width:800,height:600},ChordDiagram:{width:600,height:600},TreeDiagram:{width:600,height:600},Treemap:{width:600,height:600},CirclePack:{width:600,height:600},OrbitDiagram:{width:600,height:600},GaltonBoardChart:{width:700,height:420},UnitPileChart:{width:700,height:380},CollisionSwarmChart:{width:700,height:360},EventDropChart:{width:760,height:360},PacketFlowChart:{width:760,height:420},ProcessFlowChart:{width:900,height:420},PhysicsCustomChart:{width:700,height:380},GauntletChart:{width:900,height:520},CrucibleChart:{width:900,height:520},ChainReactionChart:{width:920,height:620},DependencyForestChart:{width:920,height:440},FlowCircuitChart:{width:980,height:860},LineChart:void 0,AreaChart:void 0,StackedAreaChart:void 0,DifferenceChart:void 0,BumpChart:void 0,Scatterplot:void 0,BubbleChart:void 0,Heatmap:void 0,QuadrantChart:void 0,WaterfallChart:void 0,CandlestickChart:void 0,ConnectedScatterplot:void 0,MinimapChart:void 0,ScatterplotMatrix:void 0,BarChart:void 0,StackedBarChart:void 0,GroupedBarChart:void 0,SwarmPlot:void 0,BoxPlot:void 0,Histogram:void 0,ViolinPlot:void 0,RidgelinePlot:void 0,DotPlot:void 0,FunnelChart:void 0,RadarChart:void 0,SwimlaneChart:void 0,LikertChart:void 0,ProcessSankey:void 0,ChoroplethMap:void 0,ProportionalSymbolMap:void 0,FlowMap:void 0,DistanceCartogram:void 0,RealtimeLineChart:void 0,RealtimeHistogram:void 0,TemporalHistogram:void 0,RealtimeTemporalHistogram:void 0,RealtimeSwarmChart:void 0,RealtimeWaterfallChart:void 0,RealtimeHeatmap:void 0,XYCustomChart:void 0,OrdinalCustomChart:void 0,NetworkCustomChart:void 0,GeoCustomChart:void 0,MotifBraidChart:void 0,Sparkline:void 0},bl=e=>Math.max(6,Math.round(2*e/3)),vl=60,wl=null,Al=(require("react/jsx-runtime"),["MotifBraidChart","DependencyForestChart","FlowCircuitChart","BarChart","StackedBarChart","GroupedBarChart","SwarmPlot","BoxPlot","Histogram","ViolinPlot","RidgelinePlot","DotPlot","PieChart","DonutChart","GaugeChart","FunnelChart","RadarChart","SwimlaneChart","LikertChart","LineChart","BumpChart","AreaChart","DifferenceChart","StackedAreaChart","Scatterplot","BubbleChart","Heatmap","QuadrantChart","MultiAxisLineChart","WaterfallChart","CandlestickChart","ConnectedScatterplot","ScatterplotMatrix","MinimapChart","ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram","TreeDiagram","Treemap","CirclePack","OrbitDiagram","ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram","RealtimeLineChart","RealtimeHistogram","TemporalHistogram","RealtimeSwarmChart","RealtimeWaterfallChart","RealtimeHeatmap","GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","GauntletChart","CrucibleChart","ProcessFlowChart","PacketFlowChart","ChainReactionChart","BigNumber"]),xl=/* @__PURE__ */new Set(Al),$l={title:["BigNumber"],description:[],summary:[]},Cl=["string","number",["number","object"],["boolean","object"],"boolean",["array","object"],["string","function"],["string","array","object"],["boolean","function","object","string"],"array","object",["boolean","string"],"function",["string","object"],["boolean","string","function","object"],["boolean","string","object"],["boolean","string","function"],["number","function"],["boolean","object","string","number"],["object","string","number","function"],["boolean","array"],["object","array"],["object","function"],["string","boolean"],["number","string","function"],["number","string"],["boolean","string","number","object"],["string","array"],["array","string"],["string","object","function"],["boolean","number","array"],["number","null"],["string","function","object"],["array","function"],["string","number","array","object","function"]],Sl=[["primary","context","sparkline","mobile"],["highlight","isolate","none"],["right","left","top","bottom"],["nice","exact"],["primary","secondary"],["linear","log","time"],["linear","log","symlog"],["sliding","growing"],["left","right"],["organize","required-paths"],["vertical","horizontal"],["horizontal","vertical"],["linear","monotoneX","monotoneY","step","stepAfter","stepBefore","basis","cardinal","catmullRom"],["break","interpolate","zero"],["descending","ascending"],["smooth","linear"],["start","end","both","auto"],["series"],["zero","wiggle","silhouette","diverging"],["key","input","insideOut","asc","desc"],["blues","reds","greens","viridis","oranges","purples","greys","plasma","inferno","magma","cividis","turbo","custom"],["count","sum","mean"],["histogram","density","label"],["crossfilter","intersect"],["auto","worker","sync"],["source","target","gradient"],["justify","left","right","center"],["value","temporal"],["off","reuse"],["insertion","crossing-min","inside-out","crossing-min+inside-out"],["stack","hug"],["temporal","max"],["auto"],["raw","scene"],["source","target","both"],["full","half"],["source","target"],["tree","cluster","partition","treemap","circlepack"],["vertical","horizontal","radial"],["line","curve"],["leaf","parent","all"],["locked","decay","alternate"],["geo","line"],["basic","offset","arc"],["butt","round","square"],["straight","fractional"],["radial","strip"],["start","center"],["up","down"],["primary","context","sparkline","mobile","sample","mechanical"],["sample","mechanical"],["ms","s"],["route","net"],["outcome","hold-last"],["replay","snapshot"],["horizontal"],["allAbsorbed","none"],["circle","halo","faceted","pill","diamond","square","triangle","hexagon"],["auto","normalized","pixels"],["path","none"],["snapshot","replay","mechanical"],["none","blocker-amplification"],["domino-ball"],["vertical"],["settle"],["number","currency","percent","compact","duration"],["higher-is-better","lower-is-better","neutral"],["auto","positive","negative","neutral"],["tile","presentation","inline","thumbnail"],["start","center","end"]],kl={common:{mode:[0,0],width:1,height:1,margin:2,className:0,title:0,description:0,summary:0,accessibleTable:3,enableHover:4,showLegend:4,legendInteraction:[0,1],legendPosition:[0,2],legend:5,showGrid:4,colorBy:6,colorScheme:7,tooltip:8,annotations:9,autoPlaceAnnotations:3,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,maxDevicePixelRatio:1,axisExtent:[0,3],animate:3,loading:4,loadingContent:3,emptyContent:3,hoverHighlight:11,chartId:0,emphasis:[0,4],responsiveWidth:4,responsiveHeight:4,color:0,stroke:0,strokeWidth:1,opacity:1,onObservation:12,frameProps:10,onClick:12},network:{styleRules:9,perspective:13},xyAxis:{showAxes:4,xLabel:0,yLabel:0,xFormat:12,yFormat:12,xScaleType:[0,5],yScaleType:[0,6]},ordinalAxis:{categoryLabel:0,valueLabel:0,showCategoryTicks:4,valueFormat:12,categoryFormat:12,dataIdAccessor:6},realtime:{data:9,mode:[0,0],size:9,responsiveWidth:4,responsiveHeight:4,width:1,height:1,maxDevicePixelRatio:1,margin:2,className:0,title:0,description:0,summary:0,accessibleTable:3,showLegend:4,legendPosition:[0,2],legendInteraction:[0,1],timeAccessor:6,valueAccessor:6,windowSize:1,windowMode:[0,7],capacity:1,capacityMode:[0,7],arrowOfTime:[0,8],timeExtent:9,valueExtent:9,extentPadding:1,showAxes:4,background:0,cursor:0,enableHover:3,tooltip:14,tooltipContent:12,onHover:12,annotations:9,autoPlaceAnnotations:3,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,svgAnnotationRules:12,tickFormatTime:12,tickFormatValue:12,decay:10,pulse:10,staleness:10,linkedHover:15,selection:10,loading:4,loadingContent:3,emptyContent:3,chartId:0,emphasis:[0,4],pointIdAccessor:6,onObservation:12},realtimeStatic:{data:9,mode:[0,0],size:9,responsiveWidth:4,responsiveHeight:4,width:1,height:1,maxDevicePixelRatio:1,margin:2,className:0,title:0,description:0,summary:0,accessibleTable:3,showLegend:4,legendPosition:[0,2],legendInteraction:[0,1],timeAccessor:6,valueAccessor:6,arrowOfTime:[0,8],timeExtent:9,valueExtent:9,extentPadding:1,showAxes:4,background:0,cursor:0,enableHover:3,tooltip:14,tooltipContent:12,onHover:12,annotations:9,autoPlaceAnnotations:3,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,svgAnnotationRules:12,tickFormatTime:12,tickFormatValue:12,decay:10,pulse:10,staleness:10,linkedHover:15,selection:10,loading:4,loadingContent:3,emptyContent:3,chartId:0,emphasis:[0,4],pointIdAccessor:6,onObservation:12},physics:{data:9,mode:[0,0],size:9,width:1,height:1,maxDevicePixelRatio:1,className:0,title:0,description:0,summary:0,accessibleTable:3,chartId:0,emphasis:[0,4],responsiveWidth:4,responsiveHeight:4,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,colorBy:6,color:0,stroke:0,strokeWidth:1,opacity:1,seed:1,ballRadius:1,hoverRadius:1,paused:4,tooltip:14,annotations:9,autoPlaceAnnotations:3,background:0,legend:5,legendPosition:[0,2],legendLayout:10,selection:10,linkedHover:15,onSimulationStateChange:12,loading:4,loadingContent:3,emptyContent:3,frameProps:10}},Rl=[[["atlas"],"none",[],[],{width:1,height:1,className:0,title:0,description:0,summary:0,accessibleTable:3,chartId:0,onObservation:12,annotations:9,frameProps:10,tooltip:8,perspective:13,atlas:10,colorScheme:7,linkedHover:15,selection:10,onClick:12}],[["forest"],"none",[],[],{width:1,height:1,className:0,title:0,description:0,summary:0,accessibleTable:3,chartId:0,onObservation:12,annotations:9,frameProps:10,tooltip:8,perspective:13,linkedHover:15,linkedSelection:10,onSelectNode:12,forest:10,reading:[0,9],selection:10,collapsedNodeIds:9,highlightedEdgeIds:9,colors:10}],[["circuit","edition","reading"],"none",[],[],{width:1,height:1,className:0,title:0,description:0,summary:0,accessibleTable:3,chartId:0,onObservation:12,annotations:9,frameProps:10,tooltip:8,perspective:13,linkedHover:15,linkedSelection:10,onSelectNode:12,networkFrameProps:10,circuit:10,edition:10,reading:10,selection:10,colors:10,particleBudget:1,placementSeed:1,reducedMotion:4,highlightedEdgeIds:9,layoutSelection:10}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,10],sort:16,barPadding:1,roundedTop:17,valueExtent:9,styleRules:9,gradientFill:3,baselinePadding:4,brush:4,linkedBrush:13,onBrush:12,regression:15}],[["data","stackBy"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,stackBy:6,categoryAccessor:6,valueAccessor:6,orientation:[0,10],normalize:4,sort:16,barPadding:1,roundedTop:17,valueExtent:9,styleRules:9,gradientFill:3,baselinePadding:4,showLegend:4,brush:4,linkedBrush:13,onBrush:12}],[["data","groupBy"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,groupBy:6,categoryAccessor:6,valueAccessor:6,orientation:[0,10],sort:16,barPadding:1,roundedTop:17,valueExtent:9,styleRules:9,gradientFill:3,baselinePadding:4,showLegend:4,brush:4,linkedBrush:13,onBrush:12}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,10],sizeBy:6,sizeRange:9,symbolBy:6,symbolMap:10,pointRadius:1,pointOpacity:1,categoryPadding:1,valueExtent:9,styleRules:9,brush:4,onBrush:12,linkedBrush:13}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,10],showOutliers:4,outlierRadius:1,categoryPadding:1,valueExtent:9,styleRules:9}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,bins:1,relative:4,categoryPadding:1,valueExtent:9,styleRules:9,brush:4,onBrush:12,linkedBrush:13}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,10],bins:1,curve:0,showIQR:4,categoryPadding:1,valueExtent:9,styleRules:9,brush:4,onBrush:12,linkedBrush:13}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,orientation:[0,10],categoryAccessor:6,valueAccessor:6,bins:1,amplitude:1,categoryPadding:1,valueExtent:9,styleRules:9}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,10],sort:16,dotRadius:1,categoryPadding:1,valueExtent:9,styleRules:9,showGrid:4,regression:15}],[["data"],"array",["categoryAccessor","valueAccessor"],["common"],{data:9,categoryAccessor:6,valueAccessor:6,styleRules:9,startAngle:1,valueFormat:12,cornerRadius:1,showCategoryTicks:4,dataIdAccessor:6}],[["data"],"array",["categoryAccessor","valueAccessor"],["common"],{data:9,categoryAccessor:6,valueAccessor:6,styleRules:9,innerRadius:1,centerContent:18,valueFormat:12,startAngle:1,cornerRadius:1,showCategoryTicks:4,dataIdAccessor:6}],[["value"],"none",[],["common"],{value:1,min:1,max:1,thresholds:9,gradientFill:10,arcWidth:1,cornerRadius:1,sweep:1,fillZones:4,showNeedle:4,needleColor:0,color:0,valueFormat:12,centerContent:19,centerLabel:0,showScaleLabels:4,backgroundColor:0,styleRules:9}],[["data"],"array",["stepAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,stepAccessor:6,valueAccessor:6,categoryAccessor:6,orientation:[0,11],connectorOpacity:1,showLabels:4,showAxes:4,showCategoryTicks:4,responsiveWidth:4,legendPosition:[0,2],styleRules:9}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,seriesAccessor:6,pointRadius:1,valueExtent:9,styleRules:9}],[["subcategoryAccessor"],"array",["categoryAccessor","subcategoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,subcategoryAccessor:6,valueAccessor:6,orientation:[0,11],barPadding:1,roundedTop:17,valueExtent:9,trackFill:13,gradientFill:3,brush:4,onBrush:12,linkedBrush:13,showCategoryTicks:4,rTickValues:9,tickLabelEdgeAlign:4,responsiveWidth:4,legendPosition:[0,2],styleRules:9}],[[],"array",["categoryAccessor","valueAccessor","levelAccessor","countAccessor"],["common","ordinalAxis"],{data:9,levels:9,categoryAccessor:6,valueAccessor:6,levelAccessor:6,countAccessor:6,orientation:[0,10],barPadding:1,valueExtent:9,styleRules:9}],[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{frameProps:10,styleRules:9,data:9,xAccessor:6,yAccessor:6,lineBy:6,lineDataAccessor:0,curve:[0,12],lineWidth:1,showPoints:4,pointRadius:1,pointIdAccessor:6,fillArea:20,areaOpacity:1,lineGradient:10,directLabel:3,gapStrategy:[0,13],forecast:10,anomaly:10,band:21,xExtent:9,yExtent:9,brush:4,linkedBrush:13,onBrush:12}],[["data"],"array",["xAccessor","yAccessor"],["common"],{data:9,xAccessor:6,yAccessor:6,xLabel:0,yLabel:0,xFormat:12,yFormat:12,lineBy:6,rankDirection:[0,14],ribbon:4,curve:[0,15],ribbonSizeRange:9,samplesPerSegment:1,lineWidth:1,highlightTop:1,neutralColor:0,ribbonOpacity:1,lineOpacity:1,showPoints:4,pointRadius:1,showLabels:[11,16],labelPriorityAccessor:0,maxLabels:1,showAxes:4,styleRules:9,labelStyle:22,legend:5,legendInteraction:[0,1],legendPosition:[0,2],hoverHighlight:[11,17]}],[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,areaBy:6,lineDataAccessor:0,curve:[0,12],y0Accessor:6,gradientFill:3,semanticGradient:21,semanticLine:4,lineGradient:10,areaOpacity:1,showLine:4,lineWidth:1,showPoints:4,pointRadius:1,pointIdAccessor:6,forecast:10,anomaly:10,band:21,xExtent:9,yExtent:9}],[[],"array",["xAccessor","seriesAAccessor","seriesBAccessor"],["common","xyAxis"],{data:9,xAccessor:6,seriesAAccessor:6,seriesBAccessor:6,seriesALabel:0,seriesBLabel:0,seriesAColor:0,seriesBColor:0,showLines:4,lineWidth:1,showPoints:4,pointRadius:1,curve:[0,12],areaOpacity:1,gradientFill:3,xExtent:9,yExtent:9,pointIdAccessor:6,windowSize:1,styleRules:9}],[["data","areaBy"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,xLabel:0,yLabel:0,xFormat:12,yFormat:12,areaBy:6,lineDataAccessor:0,curve:[0,12],areaOpacity:1,showLine:4,lineWidth:1,showPoints:4,pointRadius:1,normalize:4,baseline:[0,18],stackOrder:[0,19],pointIdAccessor:6,xExtent:9,yExtent:9}],[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,sizeBy:6,sizeRange:9,symbolBy:6,symbolMap:10,pointRadius:1,pointOpacity:1,pointIdAccessor:6,pulse:10,decay:10,staleness:10,marginalGraphics:22,xExtent:9,yExtent:9,regression:15,forecast:10,anomaly:10,brush:4,linkedBrush:13,onBrush:12}],[["data","sizeBy"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,sizeBy:6,xAccessor:6,yAccessor:6,sizeRange:9,bubbleOpacity:1,bubbleStrokeWidth:1,bubbleStrokeColor:0,pointIdAccessor:6,pulse:10,decay:10,staleness:10,marginalGraphics:22,xExtent:9,yExtent:9,regression:15,brush:4,linkedBrush:13,onBrush:12}],[["data"],"array",["xAccessor","yAccessor","valueAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,valueAccessor:6,colorScheme:[0,20],customColorScale:12,showValues:4,valueFormat:12,cellBorderColor:0,cellBorderWidth:1,pointIdAccessor:6,xExtent:9,yExtent:9,legendPosition:[0,2],heatmapAggregation:[0,21],heatmapXBins:1,heatmapYBins:1}],[[],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,xCenter:1,yCenter:1,quadrants:10,centerlineStyle:10,showQuadrantLabels:4,quadrantLabelSize:1,sizeBy:6,sizeRange:9,pointRadius:1,pointOpacity:1,pointIdAccessor:6}],[["series"],"array",["xAccessor"],["common","xyAxis"],{data:9,xAccessor:6,series:9,colorScheme:7,pointIdAccessor:6,curve:0,lineWidth:1,styleRules:9}],[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{data:9,xAccessor:6,yAccessor:6,positiveColor:0,negativeColor:0,connectorStroke:0,connectorWidth:1,gap:1,styleRules:9,xExtent:9,yExtent:9,pointIdAccessor:6}],[[],"array",["xAccessor","highAccessor","lowAccessor"],["common","xyAxis"],{data:9,xAccessor:6,highAccessor:6,lowAccessor:6,openAccessor:6,closeAccessor:6,candlestickStyle:10,styleRules:9,pointIdAccessor:6,xExtent:9,yExtent:9,mode:[0,0]}],[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,orderAccessor:6,orderLabel:0,pointRadius:1,pointIdAccessor:6,pulse:10,decay:10,staleness:10,xExtent:9,yExtent:9,regression:15,forecast:10,anomaly:10}],[["data","fields"],"array",[],["common"],{frameProps:10,data:9,fields:9,fieldLabels:10,cellSize:1,cellGap:1,pointRadius:1,pointOpacity:1,diagonal:[0,22],histogramBins:1,brushMode:[23,23],hoverMode:4,unselectedOpacity:1,idAccessor:6,styleRules:9}],[["data"],"array",[],["common"],{data:9,xAccessor:6,yAccessor:6,xLabel:0,yLabel:0,xFormat:12,yFormat:12,showAxes:4,lineBy:6,lineDataAccessor:0,curve:[0,12],lineWidth:1,styleRules:9,fillArea:4,areaOpacity:1,showPoints:4,pointRadius:1,minimap:10,renderBefore:4,onBrush:12,onBrushEnd:12,brushExtent:9,yExtent:9}],[["nodes","edges"],"network",["nodeIdAccessor","sourceAccessor","targetAccessor"],["common","network"],{nodes:9,edges:9,nodeIdAccessor:6,nodeIDAccessor:6,sourceAccessor:6,targetAccessor:6,nodeLabel:6,nodeSize:24,nodeSizeRange:9,edgeWidth:24,edgeColor:0,edgeOpacity:1,nodeStroke:0,nodeStrokeWidth:1,iterations:1,forceStrength:1,layoutExecution:[0,24],layoutLoadingContent:3,onLayoutStateChange:12,showLabels:4}],[["edges"],"network",["sourceAccessor","targetAccessor"],["common","network"],{edges:9,nodes:9,sourceAccessor:6,targetAccessor:6,valueAccessor:6,nodeIdAccessor:6,edgeColorBy:[6,25],orientation:[0,10],nodeAlign:[0,26],nodePaddingRatio:1,nodeWidth:1,nodeLabel:6,showLabels:4,edgeOpacity:1,edgeSort:12}],[["domain"],"network",["sourceAccessor","targetAccessor"],["common","network"],{edges:9,nodes:9,domain:9,axisTicks:9,sourceAccessor:6,targetAccessor:6,valueAccessor:6,nodeIdAccessor:6,nodeLabel:6,startTimeAccessor:6,endTimeAccessor:6,systemInTimeAccessor:6,systemOutTimeAccessor:6,xExtentAccessor:6,groupBy:6,edgeIdAccessor:6,orientation:[0,11],legendPosition:[0,2],pairing:[0,27],packing:[0,28],laneOrder:[0,29],maxValueScale:1,lanePlacement:[0,30],nodeSizing:[0,31],showLabels:[11,32],labelPriorityAccessor:0,maxLabels:1,selectionDatum:[0,33],groupPadding:1,ribbonLane:[0,34],ribbonMinRun:25,lifetimeMode:[0,35],showLaneRails:4,showQualityReadout:4,edgeOpacity:1,layoutExecution:[0,24],layoutWorkerThreshold:1,layoutLoadingContent:26,onLayoutStateChange:12,timeFormat:12,valueFormat:12,showParticles:4,particleStyle:10}],[["edges"],"network",["sourceAccessor","targetAccessor"],["common","network"],{edges:9,nodes:9,sourceAccessor:6,targetAccessor:6,valueAccessor:6,nodeIdAccessor:6,edgeColorBy:[6,36],padAngle:1,groupWidth:1,sortGroups:12,nodeLabel:6,showLabels:4,edgeOpacity:1}],[["data"],"object",[],["common","network"],{data:10,layout:[0,37],orientation:[0,38],childrenAccessor:6,valueAccessor:6,nodeIdAccessor:6,colorByDepth:4,edgeStyle:[0,39],nodeLabel:6,showLabels:4,nodeSize:1}],[["data"],"object",[],["common","network"],{data:10,childrenAccessor:6,valueAccessor:6,nodeIdAccessor:6,colorByDepth:4,showLabels:4,labelMode:[0,40],padding:1,paddingTop:1,nodeLabel:6,nodeStyle:12}],[["data"],"object",[],["common","network"],{data:10,childrenAccessor:6,valueAccessor:6,nodeIdAccessor:6,colorByDepth:4,showLabels:4,nodeLabel:6,circleOpacity:1,padding:1}],[["data"],"object",[],["common","network"],{data:10,childrenAccessor:6,nodeIdAccessor:6,colorByDepth:4,orbitMode:27,orbitSize:17,speed:1,eccentricity:17,showRings:4,nodeRadius:17,showLabels:4,animated:4,revolution:12,revolutionStyle:[0,41],foregroundGraphics:10}],[["areas","valueAccessor"],"array",["valueAccessor"],["common"],{styleRules:9,areas:28,valueAccessor:6,colorScheme:27,projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1,areaOpacity:1}],[["points","sizeBy"],"array",["xAccessor","yAccessor"],["common"],{styleRules:9,points:9,xAccessor:6,yAccessor:6,sizeBy:6,sizeRange:9,areas:28,pointIdAccessor:6,areaStyle:10,projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1}],[["flows"],"array",[],["common"],{flows:9,nodes:9,nodeIdAccessor:0,xAccessor:6,yAccessor:6,valueAccessor:6,lineIdAccessor:6,lineType:[0,42],flowStyle:[0,43],areas:28,areaStyle:10,edgeColorBy:6,styleRules:9,edgeOpacity:1,edgeWidthRange:9,pointRadius:1,edgeLinecap:[0,44],showParticles:4,particleStyle:10,projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1}],[["points","center","costAccessor"],"array",[],["common"],{styleRules:9,points:9,lines:9,xAccessor:6,yAccessor:6,nodeIdAccessor:0,center:0,costAccessor:6,strength:1,lineMode:[0,45],transition:1,pointRadius:1,showRings:30,showRingLabels:4,ringStyle:10,showNorth:4,costLabel:0,cartogramLayout:[0,46],projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1}],[[],"realtime",[],["realtime"],{tooltip:14,styleRules:9,stroke:0,strokeWidth:1,strokeDasharray:0,opacity:1,seriesAccessor:6,aggregate:10,eventTime:10,transition:10}],[["binSize"],"realtime",[],["realtime"],{tooltip:14,showTimeAxis:4,showGrid:4,hoverHighlight:4,showValueAxis:4,axes:9,styleRules:9,valueBands:9,binSize:1,binAlign:[0,47],direction:[0,48],categoryAccessor:6,colors:10,fill:0,stroke:0,strokeWidth:1,opacity:1,gap:1,legend:5,brush:15,onBrush:12,linkedBrush:13,transition:10}],[["data","binSize"],"array",["timeAccessor","valueAccessor","categoryAccessor"],["realtimeStatic"],{showTimeAxis:4,showGrid:4,hoverHighlight:4,showValueAxis:4,axes:9,styleRules:9,valueBands:9,data:9,binSize:1,capacity:1,capacityMode:[0,7],size:9,width:1,height:1,margin:2,className:0,timeAccessor:6,valueAccessor:6,binAlign:[0,47],direction:[0,48],categoryAccessor:6,colors:10,timeExtent:9,valueExtent:9,extentPadding:1,showAxes:4,background:0,enableHover:3,tooltip:14,tooltipContent:12,onHover:12,annotations:9,autoPlaceAnnotations:3,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,svgAnnotationRules:12,tickFormatTime:12,tickFormatValue:12,fill:0,stroke:0,strokeWidth:1,opacity:1,gap:1,legend:5,transition:10,linkedHover:15,linkedBrush:13,brush:15,onBrush:12}],[[],"realtime",[],["realtime"],{styleRules:9,categoryAccessor:6,colors:10,radius:1,fill:0,opacity:1,stroke:0,strokeWidth:1,pointStyle:12,yScaleType:[0,6],transition:10}],[[],"realtime",[],["realtime"],{styleRules:9,positiveColor:0,negativeColor:0,connectorStroke:0,connectorWidth:1,gap:1,stroke:0,strokeWidth:1,opacity:1,transition:10}],[[],"realtime",[],["realtime"],{styleRules:9,heatmapXBins:1,heatmapYBins:1,aggregation:[0,21],categoryAccessor:6,colorScheme:[0,20],customColorScale:12}],[[],"array",["valueAccessor"],["physics"],{styleRules:9,valueAccessor:6,valueExtent:9,bins:1,mode:[0,49],simulationMode:[0,50],pegRows:1,mechanicalCount:1,branchProbability:1,referenceLines:21,rerunMS:31,showProjection:4}],[["data"],"array",["timeAccessor","arrivalAccessor","watermarkAtArrivalAccessor","sourceAccessor"],["physics"],{live:3,emitters:10,styleRules:9,sources:9,sourceAccessor:6,sourceRail:10,onSourceClick:12,timeUnit:[0,51],onLedgerChange:12,onWatermarkChange:12,onClockTick:12,clockTickMs:1,colorBy:32,windowChrome:10,timeAccessor:6,arrivalAccessor:6,arrival:13,watermarkAtArrivalAccessor:6,windows:10,watermark:22,timeExtent:9,timeScale:1,rerunMS:31,showProjection:4}],[[],"array",["categoryAccessor","valueAccessor"],["physics"],{styleRules:9,categoryAccessor:6,valueAccessor:6,mode:[0,49],simulationMode:[0,50],mechanicalCount:1,mechanicalCategories:9,unitValue:1,showProjection:4,sediment:4,rerunMS:31}],[[],"array",["xAccessor","groupAccessor","radiusAccessor"],["physics"],{styleRules:9,xAccessor:6,groupAccessor:6,radiusAccessor:6,pointRadius:1,xExtent:9,collisionIterations:1,settle:4,rerunMS:31,showProjection:4}],[["negativeProperties"],"array",["idAccessor","positiveAccessor","negativeAccessor","metricsAccessor","startTimeAccessor"],["physics"],{idAccessor:6,labelAccessor:6,positiveAccessor:6,negativeAccessor:6,metricsAccessor:6,initialViability:6,positiveProperties:9,negativeProperties:9,gates:9,events:33,bodyGroups:33,crashOffset:1,initialSpawnPacing:10,startTimeAccessor:6,onCapacityChange:12,crashDetection:4,rerunMS:31,showChrome:4,showProjection:4,showTethers:4,coreForceMode:[0,52],terminalBehavior:[0,53]}],[["data","phases"],"array",["idAccessor","labelAccessor","categoryAccessor","amountAccessor","metricsAccessor","initialStateAccessor"],["physics"],{description:0,summary:0,phases:9,products:9,events:9,outlets:9,idAccessor:6,labelAccessor:6,categoryAccessor:6,amountAccessor:6,metricsAccessor:6,initialStateAccessor:6,metrics:10,amountLabel:0,conservation:3,projection:10,playback:[0,54],snapshotAt:2,controls:3,paused:4,playbackRate:1,rerunMS:31,seed:25,bodyRadius:1,radiusRange:9,colorBy:6,showBonds:4,showChrome:4,showProjection:4,initialSpawnPacing:10,loading:4,loadingContent:3,emptyContent:3,onStateChange:12,onCrucibleObservation:12,onDiagnostic:12,onConservation:12,onClick:12}],[["stages"],"array",["idAccessor","stageAccessor","groupBy","workAccessor","radiusAccessor"],["physics"],{stages:9,stageAccessor:6,idAccessor:6,groupBy:6,groupLabelAccessor:6,workAccessor:6,styleRules:9,radiusAccessor:6,ballRadius:1,route:[0,55],groupCompletion:[0,56],groupAnchorAlong:1,showProjection:4,showChrome:4,chromeOptions:10,settle:4,gravityX:1,gravityY:1,springStiffness:1,springDamping:1,rerunMS:31,initialSpawnPacing:10,liveCapacity:4,bodyLimit:1,bodyMark:[0,57],seed:1}],[[],"network",["nodeIdAccessor","nodeXAccessor","nodeYAccessor","sourceAccessor","targetAccessor","throughputAccessor","pathAccessor"],["common"],{size:9,background:0,legendLayout:10,nodes:9,links:9,edges:9,data:9,nodeIdAccessor:6,nodeXAccessor:6,nodeYAccessor:6,sourceAccessor:6,targetAccessor:6,throughputAccessor:6,pathAccessor:6,styleRules:9,coordinateMode:[0,58],particleRate:1,maxParticles:1,particleRadius:1,flowSpeed:1,pathConstraint:[0,59],reducedMotion:4,showStaticFlow:4,showNodeLabels:4,showSensors:4,paused:4,rerunMS:31,seed:1}],[["data","taskIDAccessor","labelAccessor","laneAccessor","dependencyAccessor"],"array",["taskIDAccessor","labelAccessor","laneAccessor","dependencyAccessor","startAccessor","endAccessor","progressAccessor","statusAccessor","completionTimeAccessor","blockerAccessor","milestoneAccessor"],["physics"],{taskIDAccessor:6,labelAccessor:6,laneAccessor:6,dependencyAccessor:6,startAccessor:6,endAccessor:6,progressAccessor:6,statusAccessor:6,completionTimeAccessor:6,blockerAccessor:6,milestoneAccessor:6,mode:[0,60],insight:[0,61],currentTime:2,controls:20,mechanism:[0,62],orientation:[0,63],reducedMotion:[0,64],enableHover:4,seed:1,selectedTaskIDs:9,onSelectionChange:12,onObservation:12}],[[],"none",[],[],{width:25,height:25,className:0,chartId:0,description:0,summary:0,loading:4,loadingContent:3,emptyContent:3,value:1,label:0,caption:0,format:[6,65],locale:0,currency:0,precision:1,prefix:0,suffix:0,unit:0,comparison:10,target:10,delta:1,deltaFormat:[6,65],showDeltaPercent:4,direction:[0,66],sentiment:[0,67],thresholds:9,chartSlot:34,chartSize:1,windowSize:1,mode:[0,68],align:[0,69],padding:2,emphasis:[0,4],color:0,background:0,borderColor:0,borderRadius:25,animate:3,stalenessThreshold:1,staleLabel:0,headerSlot:34,valueSlot:34,deltaSlot:34,trendSlot:34,footerSlot:34,onClick:12,onObservation:12}]],Pl=/* @__PURE__ */Ue(),El=/* @__PURE__ */Object.assign(/* @__PURE__ */Object.create(null),Pl),Nl=["orient","visible","label","ticks","tickCount","extent","tickFormat","baseline","jaggedBase","tickValues","gridStyle","axisStyle","grid","includeMax","autoRotate","landmarkTicks","tickAnchor"],Tl=e=>Nl.includes(e),Il=/* @__PURE__ */new Set(["start","center","end","left","right"]),Ml={swatchSize:{minimum:1,label:"a positive number"},labelGap:{minimum:0,label:"a non-negative number"},itemGap:{minimum:0,label:"a non-negative number"},rowHeight:{minimum:1,label:"a positive number"},maxWidth:{minimum:1,label:"a positive number"},edgeGutter:{minimum:0,label:"a non-negative number"},sideGutter:{minimum:0,label:"a non-negative number"},axisGutter:{minimum:0,label:"a non-negative number"}},Ol=(require("d3-interpolate"),80),jl=100,Fl=/* @__PURE__ */new Set(["TreeDiagram","Treemap","CirclePack","OrbitDiagram"]),zl=/* @__PURE__ */new Set(["ForceDirectedGraph","SankeyDiagram","ChordDiagram"]),Ll=/* @__PURE__ */new Set(["BarChart","StackedBarChart","GroupedBarChart","AreaChart","StackedAreaChart"]),Bl=/* @__PURE__ */new Set(["LineChart","AreaChart","StackedAreaChart"]),Dl=/* @__PURE__ */new Set(["BarChart","StackedBarChart","GroupedBarChart","FunnelChart"]),_l=/* @__PURE__ */new Set(["LineChart","AreaChart","StackedAreaChart","ConnectedScatterplot"]),Ul=/* @__PURE__ */new Set(["PieChart","DonutChart"]),Gl={PieChart:"valueAccessor",DonutChart:"valueAccessor",FunnelChart:"valueAccessor"},Vl=/* @__PURE__ */new Set(
|
|
13
|
-
/* @__PURE__ */Object.keys(Gl)),Hl={StackedBarChart:"valueAccessor",StackedAreaChart:"yAccessor"},Wl=/* @__PURE__ */new Set(["BigNumber"]),ql=/* @__PURE__ */new Set(["LineChart","AreaChart","DifferenceChart","StackedAreaChart","Scatterplot","ConnectedScatterplot","BubbleChart","QuadrantChart","MultiAxisLineChart","CandlestickChart","Heatmap","MinimapChart"]),Yl=/* @__PURE__ */new Set(["BarChart","StackedBarChart","GroupedBarChart","SwarmPlot","BoxPlot","Histogram","ViolinPlot","DotPlot","RidgelinePlot","FunnelChart","LikertChart","SwimlaneChart"]),Kl=/* @__PURE__ */new Set(["StreamPhysicsFrame","GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","PhysicsCustomChart"]),Jl=/* @__PURE__ */new Set(["OrbitDiagram",...Kl]),Xl=/* @__PURE__ */new Set(["GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart"]),Zl=/* @__PURE__ */new Set(["GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart","PhysicsCustomChart"]),Ql=/* @__PURE__ */new Set(["RealtimeLineChart","RealtimeHistogram","RealtimeSwarmChart","RealtimeWaterfallChart","RealtimeHeatmap","ProcessSankey"]),eu=/* @__PURE__ */new Set(["MultiAxisLineChart"]),tu=/* @__PURE__ */new Set(["ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram"]),ru={Scatterplot:"pointRadius",BubbleChart:"pointRadius",ConnectedScatterplot:"pointRadius",QuadrantChart:"pointRadius",SwarmPlot:"pointRadius",DotPlot:"dotRadius"},au=["label","callout","callout-circle","callout-rect"],iu=/* @__PURE__ */new Set(["label","callout","callout-circle","callout-rect","text","widget"]),ou=/* @__PURE__ */new Set(au),nu=2e4,su=["type","id","stableId","provenance","lifecycle","status","emphasis","rank","priority","x","y","x0","x1","y0","y1","dx","dy","nx","ny","px","py","coordinates","points","pointId","nodeId","category","field","value","threshold","anchor","position","label","title","text","note","content","shortText","mobileText","wrap","labelPosition","labelBackground","labelColor","textAnchor","dominantBaseline","fontSize","fontWeight","fontStyle","fontFamily","letterSpacing","titleFontWeight","color","fill","fillOpacity","opacity","stroke","strokeWidth","strokeDasharray","strokeColor","width","height","radius","radiusPadding","padding","layer","style","className","connector","disable","subject","bracketType","endCap","showBand","filter","method","steps","trainEnd","bandwidth","order","upperAccessor","lowerAccessor","confidenceAccessor","bandColor","bandOpacity","uncertaintyOpacity","anomalyColor","anomalyRadius","anomalyStyle","cohesion","depth","defensive","gradient"],cu=/* @__PURE__ */new Set(su),lu=120,uu=250,du=["xExtent","yExtent","rExtent"],hu=8,pu=/^(\d{4})-(\d{1,2})(?:-(\d{1,2}))?$/,fu=[{role:"x",accessor:"xAccessor",defaultAccessor:"x",temporalValues:"date-like",domain:!0},{role:"y",accessor:"yAccessor",defaultAccessor:"y",domain:!0}],mu={fields:fu},gu=[{...fu[0],nestedDataAccessorProp:"lineDataAccessor",defaultNestedDataAccessor:"coordinates"},{...fu[1],nestedDataAccessorProp:"lineDataAccessor",defaultNestedDataAccessor:"coordinates",allowMissing:!0}],yu={fields:gu},bu={role:"value",accessor:"valueAccessor",defaultAccessor:"value"},vu={...bu,domain:!0},wu={fields:[{...bu,requirements:["finite","non-negative"]}],aggregates:[{kind:"positive-total",role:"value"}]},Au={fields:[bu],aggregates:[{kind:"normalized-total",role:"value",groupAccessor:"categoryAccessor",defaultGroupAccessor:"category",whenProp:"normalize"}]},xu={fields:gu,aggregates:[{kind:"normalized-total",role:"y",groupAccessor:"xAccessor",defaultGroupAccessor:"x",whenProp:"normalize"}]},$u={fields:[...fu,{role:"size",accessor:"sizeBy",requirements:["finite","non-negative"]}]},Cu={fields:[...fu,{role:"size",accessor:"sizeBy",requirements:["finite","non-negative"]}]},Su={fields:[bu]},ku={fields:[{...bu,dataProp:"edges",requirements:["finite","non-negative"],missingValue:1}]},Ru={LineChart:yu,AreaChart:yu,BumpChart:yu,Scatterplot:Cu,ConnectedScatterplot:mu,QuadrantChart:Cu,MinimapChart:yu,BubbleChart:$u,StackedAreaChart:xu,DifferenceChart:{fields:[{role:"x",accessor:"xAccessor",defaultAccessor:"x",temporalValues:"date",domain:!0},{role:"value",accessor:"seriesAAccessor",defaultAccessor:"a"},{role:"value",accessor:"seriesBAccessor",defaultAccessor:"b"}]},WaterfallChart:{fields:[{role:"y",accessor:"yAccessor",defaultAccessor:"y"}]},CandlestickChart:{fields:[{role:"x",accessor:"xAccessor",defaultAccessor:"x",temporalValues:"date-like",domain:!0},{role:"high",accessor:"highAccessor",defaultAccessor:"high",requirements:["finite"]},{role:"low",accessor:"lowAccessor",defaultAccessor:"low",requirements:["finite"]},{role:"open",accessor:"openAccessor",whenProps:["openAccessor","closeAccessor"],requirements:["finite"]},{role:"close",accessor:"closeAccessor",whenProps:["openAccessor","closeAccessor"],requirements:["finite"]}]},Heatmap:Su,BarChart:{fields:[bu]},GroupedBarChart:{fields:[bu]},StackedBarChart:Au,DotPlot:{fields:[vu]},Histogram:{fields:[vu]},BoxPlot:{fields:[vu]},SwarmPlot:{fields:[vu,{role:"size",accessor:"sizeBy",requirements:["finite","non-negative"]}]},ViolinPlot:{fields:[vu]},RidgelinePlot:{fields:[vu]},PieChart:wu,DonutChart:wu,FunnelChart:wu,SankeyDiagram:ku,ChordDiagram:ku,ProportionalSymbolMap:{fields:[{role:"x",accessor:"xAccessor",defaultAccessor:"lon",dataProp:"points",requirements:["finite"]},{role:"y",accessor:"yAccessor",defaultAccessor:"lat",dataProp:"points",requirements:["finite"]},{role:"size",accessor:"sizeBy",dataProp:"points",requirements:["finite","non-negative"]}]}},Pu=/* @__PURE__ */Symbol.for("semiotic.numericContractRegistry"),Eu=5,Nu={xAccessor:"x",yAccessor:"y",valueAccessor:"value",sizeBy:"size",sizeAccessor:"size",radiusAccessor:"size",countAccessor:"count",amountAccessor:"value",highAccessor:"high",lowAccessor:"low",openAccessor:"open",closeAccessor:"close",lowerAccessor:"lower",upperAccessor:"upper",positiveAccessor:"value",negativeAccessor:"value",progressAccessor:"value",confidenceAccessor:"value",costAccessor:"value",throughputAccessor:"value"},Tu=/* @__PURE__ */new Set(["category10","tableau10","set3","blues","reds","greens","oranges","purples","greys","viridis","plasma","inferno","magma","cividis","turbo"]),Iu=["xAccessor","yAccessor","timeAccessor","valueAccessor","categoryAccessor","colorBy","sizeBy","lineBy","areaBy","stackBy","groupBy","orderAccessor","y0Accessor","sourceAccessor","targetAccessor","nodeIdAccessor","nodeIDAccessor","childrenAccessor","costAccessor"],Mu=/* @__PURE__ */new Set(["#0072b2","#e69f00","#009e73","#cc79a7","#56b4e9","#d55e00","#f0e442","#000000"]),Ou=/* @__PURE__ */Symbol.for("semiotic.chartRecipeRegistry"),ju=["title","description","summary"],Fu=/* @__PURE__ */new Set(["XYCustomChart","OrdinalCustomChart","NetworkCustomChart","GeoCustomChart","PhysicsCustomChart"]),zu=/* @__PURE__ */new Set([...Fu,"XYFrame","OrdinalFrame","NetworkFrame","GeoFrame"]),Lu="Chartability (POUR-CAF) — https://chartability.github.io/POUR-CAF/. Not a pass/fail cert; pair with manual screen-reader testing (NVDA+Firefox, JAWS+Chrome, VoiceOver+Safari).",Bu={pass:"✓",fail:"✗",warn:"⚠",manual:"○","not-applicable":"·"},Du=["perceivable","operable","understandable","robust","compromising","assistive","flexible"],_u={code:"SEMANTIC_DEGENERATE",severity:"error",message:"Marks painted, but the capability reported a semantically degenerate encoding.",fix:"Choose fields that support the chart's intended encoding."},Uu={error:0,warning:1,manual:2},Gu={data:0,deception:1,accessibility:2,render:3},Vu="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.",Hu=/* @__PURE__ */new Set([...ql,"RealtimeLineChart","RealtimeHeatmap"]),Wu={pass:"PASS",warn:"WARN",manual:"MANUAL","not-applicable":"N/A"},qu=["layout","density","interaction","annotation","semantics"],Yu=/* @__PURE__ */Symbol.for("semiotic.intentRegistry"),Ku=/* @__PURE__ */new Set(["LineChart","AreaChart","StackedAreaChart","DifferenceChart","Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","MultiAxisLineChart","MinimapChart"]),Ju=/* @__PURE__ */new Set(["BarChart","StackedBarChart","GroupedBarChart","DotPlot"]),Xu=/* @__PURE__ */new Set(["PieChart","DonutChart","FunnelChart"]),Zu=/* @__PURE__ */new Set(["Histogram","BoxPlot","ViolinPlot","RidgelinePlot","SwarmPlot"]),Qu=class{constructor(e,t={},r=[]){if(this.windowSize=e,this.policy=t,this.windows=/* @__PURE__ */new Map,this.openWindows=/* @__PURE__ */new Set,this.sources=/* @__PURE__ */new Map,this.latest=-1/0,this.frontier=-1/0,this.value=-1/0,this.pending=[],!Number.isFinite(e)||e<=0)throw new RangeError("EventDrop windows.size must be a finite positive number");for(const e of r)this.sources.set(e,{latest:-1/0,arrival:-1/0,idle:!1});this.validatePolicy(t)}validatePolicy(e){if("function"!=typeof e){for(const t of["delay","idleTimeout","allowedLateness"]){const r=e[t];if(null!=r&&(!Number.isFinite(r)||r<0))throw new RangeError(`watermark.${t} must be finite and nonnegative`)}if(null!=e.value&&!Number.isFinite(e.value))throw new RangeError("watermark.value must be finite")}}setWatermark(e){this.validatePolicy(e),this.policy=e}getWatermark(){return this.value}getLatestEventTime(){return this.latest}getArrivalFrontier(){return this.frontier}getLedger(){return Array.from(this.windows.values(),xi).sort((e,t)=>e.start-t.start)}drainEvents(){const e=this.pending;return this.pending=[],e}snapshot(){return this.state(this.getLedger())}drainDelta(){const e=Array.from(this.changedWindows??[],e=>xi(this.windows.get(e)));return this.changedWindows=/* @__PURE__ */new Set,this.state(e)}state(e){return{windows:e,sources:Array.from(this.sources,([e,t])=>[e,{...t}]),latest:this.latest,frontier:this.frontier,value:this.value,heldBy:this.heldBy}}restore(e){this.applySnapshot(e,!0)}applyDelta(e){this.applySnapshot(e,!1)}applySnapshot(e,t){const r=e=>Number.isFinite(e)||e===-1/0,a=e=>Number.isSafeInteger(e)&&e>=0;if(![e.latest,e.frontier,e.value].every(r)||new Set(e.windows.map(e=>e.windowId)).size!==e.windows.length||new Set(e.sources.map(([e])=>e)).size!==e.sources.length||e.sources.some(([,e])=>!r(e.latest)||!r(e.arrival))||e.windows.some(e=>!Number.isFinite(e.start)||!Number.isFinite(e.end)||e.end<=e.start||!a(e.accepted)||!a(e.late)||Object.values(e.bySource).some(e=>!a(e.accepted)||!a(e.late))||Object.values(e.bySource).reduce((e,t)=>e+t.accepted,0)!==e.accepted||Object.values(e.bySource).reduce((e,t)=>e+t.late,0)!==e.late))throw new RangeError("Invalid EventDrop ledger snapshot");t&&(this.windows.clear(),this.openWindows.clear());for(const t of e.windows){const e=this.windows.get(t.windowId);e&&this.openWindows.delete(e);const r=xi(t);Object.setPrototypeOf(r.bySource,null),this.windows.set(t.windowId,r),r.open&&this.openWindows.add(r)}this.changedWindows?.clear(),this.sources=new Map(e.sources.map(([e,t])=>[e,{...t}])),this.latest=e.latest,this.frontier=e.frontier,this.value=e.value,this.heldBy=e.heldBy,this.pending=[]}advance(e,t="external"){if(!Number.isFinite(e))return;this.frontier=Math.max(this.frontier,e);const r=this.policy;let a;if("function"==typeof r)a=r(this.latest);else if(r.external)a=r.external();else if(null!=r.value)a=r.value;else{let t=this.latest;if(r.perSource){let a;t=1/0;for(const[i,o]of this.sources){Number.isFinite(o.arrival)||(o.arrival=e);const n=null!=r.idleTimeout&&e-o.arrival>=r.idleTimeout;n&&!o.idle&&this.pending.push({type:"physics-source-idle",sourceId:i}),o.idle=n,!n&&o.latest<t&&(t=o.latest,a=i)}a&&a!==this.heldBy&&t<this.latest&&this.pending.push({type:"physics-watermark-held",sourceId:a}),this.heldBy=a,t===1/0&&(t=this.latest)}a=t-(r.delay??this.windowSize)}if(!Number.isFinite(a)||a<=this.value)return;const i=this.value;this.value=a,this.pending.push({type:"physics-watermark-advance",from:i,to:a,cause:t});for(const t of this.openWindows)t.end<=this.value&&this.close(t,e)}close(e,t){this.changedWindows?.add(e.windowId),e.open=!1,e.closedAt=t,e.watermarkAtClose=this.value,this.openWindows.delete(e),this.pending.push({type:"physics-window-close",...xi(e),watermark:this.value})}append(e){var t;const{eventTime:r,arrivalTime:a,source:i=""}=e;if(!Number.isFinite(r)||!Number.isFinite(a))throw new RangeError("Event and arrival times must be finite");if(a<this.frontier)throw new RangeError("Incremental admissions require nondecreasing arrival times");this.latest=Math.max(this.latest,r);const o=this.sources.get(i);this.sources.set(i,{latest:Math.max(o?.latest??-1/0,r),arrival:a,idle:!1}),this.advance(a,"arrival");const n=Math.floor(r/this.windowSize)*this.windowSize,s=n+this.windowSize,c=`${n}-${s}`;let l=this.windows.get(c);l||(l={windowId:c,start:n,end:s,accepted:0,late:0,bySource:/* @__PURE__ */Object.create(null),open:!0},this.windows.set(c,l),this.openWindows.add(l),this.pending.push({type:"physics-window-open",windowId:c,start:n,end:s}));const u=e.watermarkAtArrival??this.value,d=s+("function"==typeof this.policy?0:this.policy.allowedLateness??0)<=u,h=(t=l.bySource)[i]??(t[i]={accepted:0,late:0}),p=d?"late":"accepted";return l[p]++,this.changedWindows?.add(c),h[p]++,l.open||d||this.pending.push({type:"physics-window-update",windowId:c,accepted:l.accepted,late:l.late,bySource:xi(l).bySource,watermark:this.value,retractions:1}),l.open&&s<=this.value&&this.close(l,a),{windowId:c,start:n,end:s,late:d,watermarkAtArrival:u}}},ed={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",BumpChart:"bump 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",UnitPileChart:"physics pile chart",CollisionSwarmChart:"collision swarm chart",PacketFlowChart:"physical flow chart",ProcessFlowChart:"process flow physics chart",CrucibleChart:"crucible physics chart",PhysicsCustomChart:"custom physics chart"},td=/* @__PURE__ */new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]),rd=/* @__PURE__ */new Set(["StreamPhysicsFrame","EventDropChart","GaltonBoardChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart","PhysicsCustomChart"]),ad=/* @__PURE__ */new Set(["Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","ScatterplotMatrix"]),id={"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"},od={"time-series":"tracking",categorical:"comparing",distribution:"characterizing",relationship:"relating",flow:"tracing",network:"tracing",hierarchy:"nesting",geo:"locating",realtime:"tracking",value:"presenting",custom:"presenting"},nd=["trend","compare-series","compare-categories","rank","part-to-whole","distribution","correlation","flow","hierarchy","geo","composition-over-time","change-detection","outlier-detection"],sd={alerting:"alerting",tracking:"trend",comparing:"comparison",ranking:"ranking",apportioning:"composition",characterizing:"distribution",relating:"correlation",tracing:"flow",nesting:"hierarchy",locating:"locator",presenting:"single-value"},cd=/* @__PURE__ */new Set(["y-threshold","x-threshold","band","x-band","callout","label"]),ld=/* @__PURE__ */new Set(["system","agent","watcher"]),ud=/* @__PURE__ */new Set(["ai","agent","system","computed","dbt","great-expectations"]),dd=/* @__PURE__ */new Set(["rule","statistical-test","llm-inference","computed"]),hd={"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"},pd=/* @__PURE__ */new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]),fd=/* @__PURE__ */new Set(["TreeDiagram","Treemap","CirclePack","OrbitDiagram"]),md=/* @__PURE__ */new Set(["ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram"]),gd=/* @__PURE__ */new Set(["StreamPhysicsFrame","EventDropChart","GaltonBoardChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","PhysicsCustomChart"]),yd="__semioticSelectionData",bd="__semioticSelectionCoverage",vd=/* @__PURE__ */new Set(["data","nodes","edges","points","areas","lines","flows","atlas","forest","circuit","edition","reading"]),wd=(e,t)=>(e>>>t|e<<32-t)>>>0,Ad=e=>Math.floor(4294967296*(e-Math.floor(e)))>>>0,[xd,$d]=/* @__PURE__ */(()=>{const e=[],t=[];for(let r=2;t.length<64;r+=1){let a=!0;for(let e=2;e*e<=r;e+=1)if(r%e===0){a=!1;break}a&&(e.length<8&&e.push(Ad(Math.sqrt(r))),t.push(Ad(Math.cbrt(r))))}return[e,t]})(),Cd="0.1",Sd=/* @__PURE__ */In({"artifact.id":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"never"},"artifact.createdAt":{suppliedBy:["author","system","import"],derivable:!1,modelMayPropose:!1,humanReview:"never"},"artifact.configFingerprint":{suppliedBy:["system"],derivable:!0,modelMayPropose:!1,humanReview:"never"},"artifact.dataFingerprint":{suppliedBy:["system"],derivable:!0,modelMayPropose:!1,humanReview:"never"},"purpose.intents":{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},"purpose.communicativeAct":{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},"purpose.stakes":{suppliedBy:["author","import"],derivable:!1,modelMayPropose:!0,humanReview:"required"},claims:{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},"claims.status":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},evidence:{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},"evidence.source":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},"evidence.fingerprint":{suppliedBy:["system"],derivable:!0,modelMayPropose:!1,humanReview:"never"},time:{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},"time.completeness":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},reception:{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},form:{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},contestability:{suppliedBy:["author","system","import"],derivable:!1,modelMayPropose:!1,humanReview:"required"},accountability:{suppliedBy:["author","system","import"],derivable:!1,modelMayPropose:!1,humanReview:"policy-dependent"},inheritance:{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"}}),kd=["fresh","stale","unknown"],Rd=["partial","provisional","settled","unknown"],Pd=["observedAt","ingestedAt","processedAt","publishedAt","snapshotAt"],Ed={eventTime:{field:{},value:{},timezone:{},granularity:{}},presentation:{state:{values:["live","historical","mixed"]},label:{}},freshness:{status:{required:!0,values:kd},checkedAt:{},heartbeatAt:{},expiresAt:{},basis:{}},watermark:{value:{required:!0},policy:{},allowedLateness:{}},window:{start:{required:!0},end:{required:!0},status:{required:!0,values:["open","provisional","settled","reopened","corrected"]}},completeness:{status:{required:!0,values:Rd},basis:{}},revision:{status:{required:!0,values:["original","backfilled","corrected","superseded"]},previousArtifactId:{},correctionId:{},reason:{}},snapshot:{id:{},format:{values:["iceberg","delta","other"]},schemaVersion:{},catalogRef:{}}},Nd={id:{required:!0},kind:{required:!0,values:["stream","processing-job","quality-check","snapshot","publication"]},label:{},observedAt:{},version:{},timezone:{},granularity:{},freshness:{values:kd},completeness:{values:Rd}},Td=/* @__PURE__ */new Set(["preserved","unsupported-version","invalid","excluded"]),Id="function"==typeof structuredClone?structuredClone:e=>JSON.parse(JSON.stringify(e)),Md="1",Od=/* @__PURE__ */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","interactiveGraphics","legend","recipe","layout"]),jd="function"==typeof structuredClone?structuredClone:e=>JSON.parse(JSON.stringify(e)),Fd=e=>e.replace(/~/g,"~0").replace(/\//g,"~1"),zd={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"},Ld={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"},Bd=class{constructor(e){if(this._capacity=e,this.head=0,this._size=0,e<1)throw new Error("RingBuffer capacity must be at least 1");this.buffer=new Array(e)}push(e){let t;return this._size===this._capacity?t=this.buffer[this.head]:this._size++,this.buffer[this.head]=e,this.head=(this.head+1)%this._capacity,t}pushMany(e){const t=[];for(const r of e){const e=this.push(r);void 0!==e&&t.push(e)}return t}get(e){if(e<0||e>=this._size)return;const t=(this.head-this._size+e+this._capacity)%this._capacity;return this.buffer[t]}peek(){if(0!==this._size)return this.buffer[(this.head-1+this._capacity)%this._capacity]}peekOldest(){if(0!==this._size)return this.buffer[(this.head-this._size+this._capacity)%this._capacity]}[Symbol.iterator](){let e=0;return{next:()=>e>=this._size?{done:!0,value:void 0}:{done:!1,value:this.get(e++)}}}forEach(e){const t=(this.head-this._size+this._capacity)%this._capacity;for(let r=0;r<this._size;r++)e(this.buffer[(t+r)%this._capacity],r)}toArray(){const e=new Array(this._size),t=(this.head-this._size+this._capacity)%this._capacity;for(let r=0;r<this._size;r++)e[r]=this.buffer[(t+r)%this._capacity];return e}resize(e){if(e<1)throw new Error("RingBuffer capacity must be at least 1");const t=this.toArray();let r=0,a=[];t.length>e&&(r=t.length-e,a=t.slice(0,r)),this._capacity=e,this.buffer=new Array(e),this.head=0,this._size=0;for(let e=r;e<t.length;e++)this.push(t[e]);return a}update(e,t){const r=[],a=(this.head-this._size+this._capacity)%this._capacity;for(let i=0;i<this._size;i++){const o=(a+i)%this._capacity,n=this.buffer[o];if(e(n)){let e;e="object"!=typeof n||null===n?n:Array.isArray(n)?[...n]:{...n},r.push(e),this.buffer[o]=t(n)}}return r}remove(e){const t=[],r=[];if(this.forEach(a=>{e(a)?r.push(a):t.push(a)}),0===r.length)return r;this.buffer=new Array(this._capacity),this.head=0,this._size=0;for(const e of t)this.push(e);return r}clear(){this.buffer=new Array(this._capacity),this.head=0,this._size=0}get size(){return this._size}get capacity(){return this._capacity}get full(){return this._size===this._capacity}},Dd=class{constructor(){this._min=1/0,this._max=-1/0,this._dirty=!1}push(e){Number.isFinite(e)&&(e<this._min&&(this._min=e),e>this._max&&(this._max=e))}evict(e){e!==this._min&&e!==this._max||(this._dirty=!0)}recalculate(e,t){this._min=1/0,this._max=-1/0;for(const r of e){const e=t?t(r):r;Number.isFinite(e)&&(e<this._min&&(this._min=e),e>this._max&&(this._max=e))}this._dirty=!1}clear(){this._min=1/0,this._max=-1/0,this._dirty=!1}get extent(){return[this._min,this._max]}get min(){return this._min}get max(){return this._max}get dirty(){return this._dirty}},_d=["name","label","title"],Ud=["type","kind","category","group","class","status","role","shape"],Gd=["value","amount","total","count","weight","score"],Vd=/* @__PURE__ */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"]),Hd=zc(require("react")),Wd=require("react/jsx-runtime"),qd={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"},Yd=/* @__PURE__ */Symbol.for("semiotic.tooltipChromeContext"),Kd=/* @__PURE__ */hc(function({chrome:e,children:t}){const r=lc();/* @__PURE__ */ /* @__PURE__ */
|
|
14
|
-
return(0,
|
|
15
|
-
return(0,
|
|
12
|
+
/* @__PURE__ */ /* @__PURE__ */Object.keys(el).map(e=>[e,0]))),minimumScore:0}),il=[["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"]],ol=/* @__PURE__ */new Set(["category10","tableau10"]),nl=/* @__PURE__ */new Set(["DonutChart","PieChart","SwimlaneChart"]),sl={"mark-scaffold-hierarchy":"Mark–scaffold hierarchy","palette-authorship":"Palette authorship","palette-economy":"Palette economy","typographic-hierarchy":"Typographic hierarchy","theme-coherence":"Theme coherence","editorial-emphasis":"Editorial emphasis"},cl=(Bc(require("react")),6e4),ll=60*cl,ul=24*ll,dl=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],hl={year:!0,date:!0},pl=[[1e3,"K"],[1e6,"M"],[1e9,"B"]],fl=44,ml={enabled:!0,tapToSelect:!0,tapToLockTooltip:!0,clearSelection:"backgroundTap",targetSize:fl,snap:"nearestDatum",brushHandleSize:fl,standardControls:!1,enabled:!1,tapToSelect:!1,tapToLockTooltip:!1},gl={primary:{width:600,height:400,showAxes:!0,showGrid:!1,enableHover:!0,showLegend:void 0,showLabels:void 0,marginDefaults:{top:50,bottom:60,left:70,right:40}},context:{width:400,height:250,showAxes:!1,showGrid:!1,enableHover:!1,showLegend:!1,showLabels:!1,marginDefaults:{top:10,bottom:10,left:10,right:10}},sparkline:{width:120,height:24,showAxes:!1,showGrid:!1,enableHover:!1,showLegend:!1,showLabels:!1,marginDefaults:{top:2,bottom:2,left:0,right:0}},mobile:{width:390,height:300,showAxes:!0,showGrid:!1,enableHover:!0,showLegend:!1,showLabels:!0,marginDefaults:{top:28,bottom:42,left:44,right:16}}},yl={tile:{width:280,height:184},presentation:{width:540,height:320},inline:{width:void 0,height:void 0},thumbnail:{width:96,height:56}},bl={cellSize:150,cellGap:4,labelWidth:40},vl={MultiAxisLineChart:{width:800,height:400},PieChart:{width:400,height:400},DonutChart:{width:400,height:400},GaugeChart:{width:300,height:250},ForceDirectedGraph:{width:600,height:600},SankeyDiagram:{width:800,height:600},ChordDiagram:{width:600,height:600},TreeDiagram:{width:600,height:600},Treemap:{width:600,height:600},CirclePack:{width:600,height:600},OrbitDiagram:{width:600,height:600},GaltonBoardChart:{width:700,height:420},UnitPileChart:{width:700,height:380},CollisionSwarmChart:{width:700,height:360},EventDropChart:{width:760,height:360},PacketFlowChart:{width:760,height:420},ProcessFlowChart:{width:900,height:420},PhysicsCustomChart:{width:700,height:380},GauntletChart:{width:900,height:520},CrucibleChart:{width:900,height:520},ChainReactionChart:{width:920,height:620},DependencyForestChart:{width:920,height:440},FlowCircuitChart:{width:980,height:860},LineChart:void 0,AreaChart:void 0,StackedAreaChart:void 0,DifferenceChart:void 0,BumpChart:void 0,Scatterplot:void 0,BubbleChart:void 0,Heatmap:void 0,QuadrantChart:void 0,WaterfallChart:void 0,CandlestickChart:void 0,ConnectedScatterplot:void 0,MinimapChart:void 0,ScatterplotMatrix:void 0,BarChart:void 0,StackedBarChart:void 0,GroupedBarChart:void 0,SwarmPlot:void 0,BoxPlot:void 0,Histogram:void 0,ViolinPlot:void 0,RidgelinePlot:void 0,DotPlot:void 0,FunnelChart:void 0,RadarChart:void 0,SwimlaneChart:void 0,LikertChart:void 0,ProcessSankey:void 0,ChoroplethMap:void 0,ProportionalSymbolMap:void 0,FlowMap:void 0,DistanceCartogram:void 0,RealtimeLineChart:void 0,RealtimeHistogram:void 0,TemporalHistogram:void 0,RealtimeTemporalHistogram:void 0,RealtimeSwarmChart:void 0,RealtimeWaterfallChart:void 0,RealtimeHeatmap:void 0,XYCustomChart:void 0,OrdinalCustomChart:void 0,NetworkCustomChart:void 0,GeoCustomChart:void 0,MotifBraidChart:void 0,Sparkline:void 0},wl=e=>Math.max(6,Math.round(2*e/3)),Al=60,xl=null,$l=(require("react/jsx-runtime"),["MotifBraidChart","DependencyForestChart","FlowCircuitChart","BarChart","StackedBarChart","GroupedBarChart","SwarmPlot","BoxPlot","Histogram","ViolinPlot","RidgelinePlot","DotPlot","PieChart","DonutChart","GaugeChart","FunnelChart","RadarChart","SwimlaneChart","LikertChart","LineChart","BumpChart","AreaChart","DifferenceChart","StackedAreaChart","Scatterplot","BubbleChart","Heatmap","QuadrantChart","MultiAxisLineChart","WaterfallChart","CandlestickChart","ConnectedScatterplot","ScatterplotMatrix","MinimapChart","ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram","TreeDiagram","Treemap","CirclePack","OrbitDiagram","ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram","RealtimeLineChart","RealtimeHistogram","TemporalHistogram","RealtimeSwarmChart","RealtimeWaterfallChart","RealtimeHeatmap","GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","GauntletChart","CrucibleChart","ProcessFlowChart","PacketFlowChart","ChainReactionChart","BigNumber"]),Cl=/* @__PURE__ */new Set($l),Sl={title:["BigNumber"],description:[],summary:[]},kl=["string","number",["number","object"],["boolean","object"],"boolean",["array","object"],["string","function"],["string","array","object"],["boolean","function","object","string"],"array","object",["boolean","string"],"function",["string","object"],["boolean","string","function","object"],["boolean","string","object"],["boolean","string","function"],["number","function"],["boolean","object","string","number"],["object","string","number","function"],["boolean","array"],["object","array"],["object","function"],["string","boolean"],["number","string","function"],["number","string"],["boolean","string","number","object"],["string","array"],["array","string"],["string","object","function"],["boolean","number","array"],["number","null"],["string","function","object"],["array","function"],["string","number","array","object","function"]],Rl=[["primary","context","sparkline","mobile"],["highlight","isolate","none"],["right","left","top","bottom"],["nice","exact"],["primary","secondary"],["linear","log","time"],["linear","log","symlog"],["sliding","growing"],["left","right"],["organize","required-paths"],["vertical","horizontal"],["horizontal","vertical"],["linear","monotoneX","monotoneY","step","stepAfter","stepBefore","basis","cardinal","catmullRom"],["break","interpolate","zero"],["descending","ascending"],["smooth","linear"],["start","end","both","auto"],["series"],["zero","wiggle","silhouette","diverging"],["key","input","insideOut","asc","desc"],["blues","reds","greens","viridis","oranges","purples","greys","plasma","inferno","magma","cividis","turbo","custom"],["count","sum","mean"],["histogram","density","label"],["crossfilter","intersect"],["auto","worker","sync"],["source","target","gradient"],["justify","left","right","center"],["value","temporal"],["off","reuse"],["insertion","crossing-min","inside-out","crossing-min+inside-out"],["stack","hug"],["temporal","max"],["auto"],["raw","scene"],["source","target","both"],["full","half"],["source","target"],["tree","cluster","partition","treemap","circlepack"],["vertical","horizontal","radial"],["line","curve"],["leaf","parent","all"],["locked","decay","alternate"],["geo","line"],["basic","offset","arc"],["butt","round","square"],["straight","fractional"],["radial","strip"],["start","center"],["up","down"],["primary","context","sparkline","mobile","sample","mechanical"],["sample","mechanical"],["ms","s"],["route","net"],["outcome","hold-last"],["replay","snapshot"],["horizontal"],["allAbsorbed","none"],["circle","halo","faceted","pill","diamond","square","triangle","hexagon"],["auto","normalized","pixels"],["path","none"],["snapshot","replay","mechanical"],["none","blocker-amplification"],["domino-ball"],["vertical"],["settle"],["number","currency","percent","compact","duration"],["higher-is-better","lower-is-better","neutral"],["auto","positive","negative","neutral"],["tile","presentation","inline","thumbnail"],["start","center","end"]],Pl={common:{mode:[0,0],width:1,height:1,margin:2,className:0,title:0,description:0,summary:0,accessibleTable:3,enableHover:4,showLegend:4,legendInteraction:[0,1],legendPosition:[0,2],legend:5,showGrid:4,colorBy:6,colorScheme:7,tooltip:8,annotations:9,autoPlaceAnnotations:3,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,maxDevicePixelRatio:1,axisExtent:[0,3],animate:3,loading:4,loadingContent:3,emptyContent:3,hoverHighlight:11,chartId:0,emphasis:[0,4],responsiveWidth:4,responsiveHeight:4,color:0,stroke:0,strokeWidth:1,opacity:1,onObservation:12,frameProps:10,onClick:12},network:{styleRules:9,perspective:13},xyAxis:{showAxes:4,xLabel:0,yLabel:0,xFormat:12,yFormat:12,xScaleType:[0,5],yScaleType:[0,6]},ordinalAxis:{categoryLabel:0,valueLabel:0,showCategoryTicks:4,valueFormat:12,categoryFormat:12,dataIdAccessor:6},realtime:{data:9,mode:[0,0],size:9,responsiveWidth:4,responsiveHeight:4,width:1,height:1,maxDevicePixelRatio:1,margin:2,className:0,title:0,description:0,summary:0,accessibleTable:3,showLegend:4,legendPosition:[0,2],legendInteraction:[0,1],timeAccessor:6,valueAccessor:6,windowSize:1,windowMode:[0,7],capacity:1,capacityMode:[0,7],arrowOfTime:[0,8],timeExtent:9,valueExtent:9,extentPadding:1,showAxes:4,background:0,cursor:0,enableHover:3,tooltip:14,tooltipContent:12,onHover:12,annotations:9,autoPlaceAnnotations:3,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,svgAnnotationRules:12,tickFormatTime:12,tickFormatValue:12,decay:10,pulse:10,staleness:10,linkedHover:15,selection:10,loading:4,loadingContent:3,emptyContent:3,chartId:0,emphasis:[0,4],pointIdAccessor:6,onObservation:12},realtimeStatic:{data:9,mode:[0,0],size:9,responsiveWidth:4,responsiveHeight:4,width:1,height:1,maxDevicePixelRatio:1,margin:2,className:0,title:0,description:0,summary:0,accessibleTable:3,showLegend:4,legendPosition:[0,2],legendInteraction:[0,1],timeAccessor:6,valueAccessor:6,arrowOfTime:[0,8],timeExtent:9,valueExtent:9,extentPadding:1,showAxes:4,background:0,cursor:0,enableHover:3,tooltip:14,tooltipContent:12,onHover:12,annotations:9,autoPlaceAnnotations:3,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,svgAnnotationRules:12,tickFormatTime:12,tickFormatValue:12,decay:10,pulse:10,staleness:10,linkedHover:15,selection:10,loading:4,loadingContent:3,emptyContent:3,chartId:0,emphasis:[0,4],pointIdAccessor:6,onObservation:12},physics:{data:9,mode:[0,0],size:9,width:1,height:1,maxDevicePixelRatio:1,className:0,title:0,description:0,summary:0,accessibleTable:3,chartId:0,emphasis:[0,4],responsiveWidth:4,responsiveHeight:4,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,colorBy:6,color:0,stroke:0,strokeWidth:1,opacity:1,seed:1,ballRadius:1,hoverRadius:1,paused:4,tooltip:14,annotations:9,autoPlaceAnnotations:3,background:0,legend:5,legendPosition:[0,2],legendLayout:10,selection:10,linkedHover:15,onSimulationStateChange:12,loading:4,loadingContent:3,emptyContent:3,frameProps:10}},El=[[["atlas"],"none",[],[],{width:1,height:1,className:0,title:0,description:0,summary:0,accessibleTable:3,chartId:0,onObservation:12,annotations:9,frameProps:10,tooltip:8,perspective:13,atlas:10,colorScheme:7,linkedHover:15,selection:10,onClick:12}],[["forest"],"none",[],[],{width:1,height:1,className:0,title:0,description:0,summary:0,accessibleTable:3,chartId:0,onObservation:12,annotations:9,frameProps:10,tooltip:8,perspective:13,linkedHover:15,linkedSelection:10,onSelectNode:12,forest:10,reading:[0,9],selection:10,collapsedNodeIds:9,highlightedEdgeIds:9,colors:10}],[["circuit","edition","reading"],"none",[],[],{width:1,height:1,className:0,title:0,description:0,summary:0,accessibleTable:3,chartId:0,onObservation:12,annotations:9,frameProps:10,tooltip:8,perspective:13,linkedHover:15,linkedSelection:10,onSelectNode:12,networkFrameProps:10,circuit:10,edition:10,reading:10,selection:10,colors:10,particleBudget:1,placementSeed:1,reducedMotion:4,highlightedEdgeIds:9,layoutSelection:10}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,10],sort:16,barPadding:1,roundedTop:17,valueExtent:9,styleRules:9,gradientFill:3,baselinePadding:4,brush:4,linkedBrush:13,onBrush:12,regression:15}],[["data","stackBy"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,stackBy:6,categoryAccessor:6,valueAccessor:6,orientation:[0,10],normalize:4,sort:16,barPadding:1,roundedTop:17,valueExtent:9,styleRules:9,gradientFill:3,baselinePadding:4,showLegend:4,brush:4,linkedBrush:13,onBrush:12}],[["data","groupBy"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,groupBy:6,categoryAccessor:6,valueAccessor:6,orientation:[0,10],sort:16,barPadding:1,roundedTop:17,valueExtent:9,styleRules:9,gradientFill:3,baselinePadding:4,showLegend:4,brush:4,linkedBrush:13,onBrush:12}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,10],sizeBy:6,sizeRange:9,symbolBy:6,symbolMap:10,pointRadius:1,pointOpacity:1,categoryPadding:1,valueExtent:9,styleRules:9,brush:4,onBrush:12,linkedBrush:13}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,10],showOutliers:4,outlierRadius:1,categoryPadding:1,valueExtent:9,styleRules:9}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,bins:1,relative:4,categoryPadding:1,valueExtent:9,styleRules:9,brush:4,onBrush:12,linkedBrush:13}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,10],bins:1,curve:0,showIQR:4,categoryPadding:1,valueExtent:9,styleRules:9,brush:4,onBrush:12,linkedBrush:13}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,orientation:[0,10],categoryAccessor:6,valueAccessor:6,bins:1,amplitude:1,categoryPadding:1,valueExtent:9,styleRules:9}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,orientation:[0,10],sort:16,dotRadius:1,categoryPadding:1,valueExtent:9,styleRules:9,showGrid:4,regression:15}],[["data"],"array",["categoryAccessor","valueAccessor"],["common"],{data:9,categoryAccessor:6,valueAccessor:6,styleRules:9,startAngle:1,valueFormat:12,cornerRadius:1,showCategoryTicks:4,dataIdAccessor:6}],[["data"],"array",["categoryAccessor","valueAccessor"],["common"],{data:9,categoryAccessor:6,valueAccessor:6,styleRules:9,innerRadius:1,centerContent:18,valueFormat:12,startAngle:1,cornerRadius:1,showCategoryTicks:4,dataIdAccessor:6}],[["value"],"none",[],["common"],{value:1,min:1,max:1,thresholds:9,gradientFill:10,arcWidth:1,cornerRadius:1,sweep:1,fillZones:4,showNeedle:4,needleColor:0,color:0,valueFormat:12,centerContent:19,centerLabel:0,showScaleLabels:4,backgroundColor:0,styleRules:9}],[["data"],"array",["stepAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,stepAccessor:6,valueAccessor:6,categoryAccessor:6,orientation:[0,11],connectorOpacity:1,showLabels:4,showAxes:4,showCategoryTicks:4,responsiveWidth:4,legendPosition:[0,2],styleRules:9}],[["data"],"array",["categoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,valueAccessor:6,seriesAccessor:6,pointRadius:1,valueExtent:9,styleRules:9}],[["subcategoryAccessor"],"array",["categoryAccessor","subcategoryAccessor","valueAccessor"],["common","ordinalAxis"],{data:9,categoryAccessor:6,subcategoryAccessor:6,valueAccessor:6,orientation:[0,11],barPadding:1,roundedTop:17,valueExtent:9,trackFill:13,gradientFill:3,brush:4,onBrush:12,linkedBrush:13,showCategoryTicks:4,rTickValues:9,tickLabelEdgeAlign:4,responsiveWidth:4,legendPosition:[0,2],styleRules:9}],[[],"array",["categoryAccessor","valueAccessor","levelAccessor","countAccessor"],["common","ordinalAxis"],{data:9,levels:9,categoryAccessor:6,valueAccessor:6,levelAccessor:6,countAccessor:6,orientation:[0,10],barPadding:1,valueExtent:9,styleRules:9}],[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{frameProps:10,styleRules:9,data:9,xAccessor:6,yAccessor:6,lineBy:6,lineDataAccessor:0,curve:[0,12],lineWidth:1,showPoints:4,pointRadius:1,pointIdAccessor:6,fillArea:20,areaOpacity:1,lineGradient:10,directLabel:3,gapStrategy:[0,13],forecast:10,anomaly:10,band:21,xExtent:9,yExtent:9,brush:4,linkedBrush:13,onBrush:12}],[["data"],"array",["xAccessor","yAccessor"],["common"],{data:9,xAccessor:6,yAccessor:6,xLabel:0,yLabel:0,xFormat:12,yFormat:12,lineBy:6,rankDirection:[0,14],ribbon:4,curve:[0,15],ribbonSizeRange:9,samplesPerSegment:1,lineWidth:1,highlightTop:1,neutralColor:0,ribbonOpacity:1,lineOpacity:1,showPoints:4,pointRadius:1,showLabels:[11,16],labelPriorityAccessor:0,maxLabels:1,showAxes:4,styleRules:9,labelStyle:22,legend:5,legendInteraction:[0,1],legendPosition:[0,2],hoverHighlight:[11,17]}],[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,areaBy:6,lineDataAccessor:0,curve:[0,12],y0Accessor:6,gradientFill:3,semanticGradient:21,semanticLine:4,lineGradient:10,areaOpacity:1,showLine:4,lineWidth:1,showPoints:4,pointRadius:1,pointIdAccessor:6,forecast:10,anomaly:10,band:21,xExtent:9,yExtent:9}],[[],"array",["xAccessor","seriesAAccessor","seriesBAccessor"],["common","xyAxis"],{data:9,xAccessor:6,seriesAAccessor:6,seriesBAccessor:6,seriesALabel:0,seriesBLabel:0,seriesAColor:0,seriesBColor:0,showLines:4,lineWidth:1,showPoints:4,pointRadius:1,curve:[0,12],areaOpacity:1,gradientFill:3,xExtent:9,yExtent:9,pointIdAccessor:6,windowSize:1,styleRules:9}],[["data","areaBy"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,xLabel:0,yLabel:0,xFormat:12,yFormat:12,areaBy:6,lineDataAccessor:0,curve:[0,12],areaOpacity:1,showLine:4,lineWidth:1,showPoints:4,pointRadius:1,normalize:4,baseline:[0,18],stackOrder:[0,19],pointIdAccessor:6,xExtent:9,yExtent:9}],[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,sizeBy:6,sizeRange:9,symbolBy:6,symbolMap:10,pointRadius:1,pointOpacity:1,pointIdAccessor:6,pulse:10,decay:10,staleness:10,marginalGraphics:22,xExtent:9,yExtent:9,regression:15,forecast:10,anomaly:10,brush:4,linkedBrush:13,onBrush:12}],[["data","sizeBy"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,sizeBy:6,xAccessor:6,yAccessor:6,sizeRange:9,bubbleOpacity:1,bubbleStrokeWidth:1,bubbleStrokeColor:0,pointIdAccessor:6,pulse:10,decay:10,staleness:10,marginalGraphics:22,xExtent:9,yExtent:9,regression:15,brush:4,linkedBrush:13,onBrush:12}],[["data"],"array",["xAccessor","yAccessor","valueAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,valueAccessor:6,colorScheme:[0,20],customColorScale:12,showValues:4,valueFormat:12,cellBorderColor:0,cellBorderWidth:1,pointIdAccessor:6,xExtent:9,yExtent:9,legendPosition:[0,2],heatmapAggregation:[0,21],heatmapXBins:1,heatmapYBins:1}],[[],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,xCenter:1,yCenter:1,quadrants:10,centerlineStyle:10,showQuadrantLabels:4,quadrantLabelSize:1,sizeBy:6,sizeRange:9,pointRadius:1,pointOpacity:1,pointIdAccessor:6}],[["series"],"array",["xAccessor"],["common","xyAxis"],{data:9,xAccessor:6,series:9,colorScheme:7,pointIdAccessor:6,curve:0,lineWidth:1,styleRules:9}],[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{data:9,xAccessor:6,yAccessor:6,positiveColor:0,negativeColor:0,connectorStroke:0,connectorWidth:1,gap:1,styleRules:9,xExtent:9,yExtent:9,pointIdAccessor:6}],[[],"array",["xAccessor","highAccessor","lowAccessor"],["common","xyAxis"],{data:9,xAccessor:6,highAccessor:6,lowAccessor:6,openAccessor:6,closeAccessor:6,candlestickStyle:10,styleRules:9,pointIdAccessor:6,xExtent:9,yExtent:9,mode:[0,0]}],[["data"],"array",["xAccessor","yAccessor"],["common","xyAxis"],{styleRules:9,data:9,xAccessor:6,yAccessor:6,orderAccessor:6,orderLabel:0,pointRadius:1,pointIdAccessor:6,pulse:10,decay:10,staleness:10,xExtent:9,yExtent:9,regression:15,forecast:10,anomaly:10}],[["data","fields"],"array",[],["common"],{frameProps:10,data:9,fields:9,fieldLabels:10,cellSize:1,cellGap:1,pointRadius:1,pointOpacity:1,diagonal:[0,22],histogramBins:1,brushMode:[23,23],hoverMode:4,unselectedOpacity:1,idAccessor:6,styleRules:9}],[["data"],"array",[],["common"],{data:9,xAccessor:6,yAccessor:6,xLabel:0,yLabel:0,xFormat:12,yFormat:12,showAxes:4,lineBy:6,lineDataAccessor:0,curve:[0,12],lineWidth:1,styleRules:9,fillArea:4,areaOpacity:1,showPoints:4,pointRadius:1,minimap:10,renderBefore:4,onBrush:12,onBrushEnd:12,brushExtent:9,yExtent:9}],[["nodes","edges"],"network",["nodeIdAccessor","sourceAccessor","targetAccessor"],["common","network"],{nodes:9,edges:9,nodeIdAccessor:6,nodeIDAccessor:6,sourceAccessor:6,targetAccessor:6,nodeLabel:6,nodeSize:24,nodeSizeRange:9,edgeWidth:24,edgeColor:0,edgeOpacity:1,nodeStroke:0,nodeStrokeWidth:1,iterations:1,forceStrength:1,layoutExecution:[0,24],layoutLoadingContent:3,onLayoutStateChange:12,showLabels:4}],[["edges"],"network",["sourceAccessor","targetAccessor"],["common","network"],{edges:9,nodes:9,sourceAccessor:6,targetAccessor:6,valueAccessor:6,nodeIdAccessor:6,edgeColorBy:[6,25],orientation:[0,10],nodeAlign:[0,26],nodePaddingRatio:1,nodeWidth:1,nodeLabel:6,showLabels:4,edgeOpacity:1,edgeSort:12}],[["domain"],"network",["sourceAccessor","targetAccessor"],["common","network"],{edges:9,nodes:9,domain:9,axisTicks:9,sourceAccessor:6,targetAccessor:6,valueAccessor:6,nodeIdAccessor:6,nodeLabel:6,startTimeAccessor:6,endTimeAccessor:6,systemInTimeAccessor:6,systemOutTimeAccessor:6,xExtentAccessor:6,groupBy:6,edgeIdAccessor:6,orientation:[0,11],legendPosition:[0,2],pairing:[0,27],packing:[0,28],laneOrder:[0,29],maxValueScale:1,lanePlacement:[0,30],nodeSizing:[0,31],showLabels:[11,32],labelPriorityAccessor:0,maxLabels:1,selectionDatum:[0,33],groupPadding:1,ribbonLane:[0,34],ribbonMinRun:25,lifetimeMode:[0,35],showLaneRails:4,showQualityReadout:4,edgeOpacity:1,layoutExecution:[0,24],layoutWorkerThreshold:1,layoutLoadingContent:26,onLayoutStateChange:12,timeFormat:12,valueFormat:12,showParticles:4,particleStyle:10}],[["edges"],"network",["sourceAccessor","targetAccessor"],["common","network"],{edges:9,nodes:9,sourceAccessor:6,targetAccessor:6,valueAccessor:6,nodeIdAccessor:6,edgeColorBy:[6,36],padAngle:1,groupWidth:1,sortGroups:12,nodeLabel:6,showLabels:4,edgeOpacity:1}],[["data"],"object",[],["common","network"],{data:10,layout:[0,37],orientation:[0,38],childrenAccessor:6,valueAccessor:6,nodeIdAccessor:6,colorByDepth:4,edgeStyle:[0,39],nodeLabel:6,showLabels:4,nodeSize:1}],[["data"],"object",[],["common","network"],{data:10,childrenAccessor:6,valueAccessor:6,nodeIdAccessor:6,colorByDepth:4,showLabels:4,labelMode:[0,40],padding:1,paddingTop:1,nodeLabel:6,nodeStyle:12}],[["data"],"object",[],["common","network"],{data:10,childrenAccessor:6,valueAccessor:6,nodeIdAccessor:6,colorByDepth:4,showLabels:4,nodeLabel:6,circleOpacity:1,padding:1}],[["data"],"object",[],["common","network"],{data:10,childrenAccessor:6,nodeIdAccessor:6,colorByDepth:4,orbitMode:27,orbitSize:17,speed:1,eccentricity:17,showRings:4,nodeRadius:17,showLabels:4,animated:4,revolution:12,revolutionStyle:[0,41],foregroundGraphics:10}],[["areas","valueAccessor"],"array",["valueAccessor"],["common"],{styleRules:9,areas:28,valueAccessor:6,colorScheme:27,projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1,areaOpacity:1}],[["points","sizeBy"],"array",["xAccessor","yAccessor"],["common"],{styleRules:9,points:9,xAccessor:6,yAccessor:6,sizeBy:6,sizeRange:9,areas:28,pointIdAccessor:6,areaStyle:10,projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1}],[["flows"],"array",[],["common"],{flows:9,nodes:9,nodeIdAccessor:0,xAccessor:6,yAccessor:6,valueAccessor:6,lineIdAccessor:6,lineType:[0,42],flowStyle:[0,43],areas:28,areaStyle:10,edgeColorBy:6,styleRules:9,edgeOpacity:1,edgeWidthRange:9,pointRadius:1,edgeLinecap:[0,44],showParticles:4,particleStyle:10,projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1}],[["points","center","costAccessor"],"array",[],["common"],{styleRules:9,points:9,lines:9,xAccessor:6,yAccessor:6,nodeIdAccessor:0,center:0,costAccessor:6,strength:1,lineMode:[0,45],transition:1,pointRadius:1,showRings:30,showRingLabels:4,ringStyle:10,showNorth:4,costLabel:0,cartogramLayout:[0,46],projection:29,graticule:3,fitPadding:1,zoomable:4,zoomExtent:9,onZoom:12,dragRotate:4,tileURL:6,tileAttribution:0,tileCacheSize:1}],[[],"realtime",[],["realtime"],{tooltip:14,styleRules:9,stroke:0,strokeWidth:1,strokeDasharray:0,opacity:1,seriesAccessor:6,aggregate:10,eventTime:10,transition:10}],[["binSize"],"realtime",[],["realtime"],{tooltip:14,showTimeAxis:4,showGrid:4,hoverHighlight:4,showValueAxis:4,axes:9,styleRules:9,valueBands:9,binSize:1,binAlign:[0,47],direction:[0,48],categoryAccessor:6,colors:10,fill:0,stroke:0,strokeWidth:1,opacity:1,gap:1,legend:5,brush:15,onBrush:12,linkedBrush:13,transition:10}],[["data","binSize"],"array",["timeAccessor","valueAccessor","categoryAccessor"],["realtimeStatic"],{showTimeAxis:4,showGrid:4,hoverHighlight:4,showValueAxis:4,axes:9,styleRules:9,valueBands:9,data:9,binSize:1,capacity:1,capacityMode:[0,7],size:9,width:1,height:1,margin:2,className:0,timeAccessor:6,valueAccessor:6,binAlign:[0,47],direction:[0,48],categoryAccessor:6,colors:10,timeExtent:9,valueExtent:9,extentPadding:1,showAxes:4,background:0,enableHover:3,tooltip:14,tooltipContent:12,onHover:12,annotations:9,autoPlaceAnnotations:3,responsiveRules:9,mobileSemantics:10,mobileInteraction:3,svgAnnotationRules:12,tickFormatTime:12,tickFormatValue:12,fill:0,stroke:0,strokeWidth:1,opacity:1,gap:1,legend:5,transition:10,linkedHover:15,linkedBrush:13,brush:15,onBrush:12}],[[],"realtime",[],["realtime"],{styleRules:9,categoryAccessor:6,colors:10,radius:1,fill:0,opacity:1,stroke:0,strokeWidth:1,pointStyle:12,yScaleType:[0,6],transition:10}],[[],"realtime",[],["realtime"],{styleRules:9,positiveColor:0,negativeColor:0,connectorStroke:0,connectorWidth:1,gap:1,stroke:0,strokeWidth:1,opacity:1,transition:10}],[[],"realtime",[],["realtime"],{styleRules:9,heatmapXBins:1,heatmapYBins:1,aggregation:[0,21],categoryAccessor:6,colorScheme:[0,20],customColorScale:12}],[[],"array",["valueAccessor"],["physics"],{styleRules:9,valueAccessor:6,valueExtent:9,bins:1,mode:[0,49],simulationMode:[0,50],pegRows:1,mechanicalCount:1,branchProbability:1,referenceLines:21,rerunMS:31,showProjection:4}],[["data"],"array",["timeAccessor","arrivalAccessor","watermarkAtArrivalAccessor","sourceAccessor"],["physics"],{live:3,emitters:10,styleRules:9,sources:9,sourceAccessor:6,sourceRail:10,onSourceClick:12,timeUnit:[0,51],onLedgerChange:12,onWatermarkChange:12,onClockTick:12,clockTickMs:1,colorBy:32,windowChrome:10,timeAccessor:6,arrivalAccessor:6,arrival:13,watermarkAtArrivalAccessor:6,windows:10,watermark:22,timeExtent:9,timeScale:1,rerunMS:31,showProjection:4}],[[],"array",["categoryAccessor","valueAccessor"],["physics"],{styleRules:9,categoryAccessor:6,valueAccessor:6,mode:[0,49],simulationMode:[0,50],mechanicalCount:1,mechanicalCategories:9,unitValue:1,showProjection:4,sediment:4,rerunMS:31}],[[],"array",["xAccessor","groupAccessor","radiusAccessor"],["physics"],{styleRules:9,xAccessor:6,groupAccessor:6,radiusAccessor:6,pointRadius:1,xExtent:9,collisionIterations:1,settle:4,rerunMS:31,showProjection:4}],[["negativeProperties"],"array",["idAccessor","positiveAccessor","negativeAccessor","metricsAccessor","startTimeAccessor"],["physics"],{idAccessor:6,labelAccessor:6,positiveAccessor:6,negativeAccessor:6,metricsAccessor:6,initialViability:6,positiveProperties:9,negativeProperties:9,gates:9,events:33,bodyGroups:33,crashOffset:1,initialSpawnPacing:10,startTimeAccessor:6,onCapacityChange:12,crashDetection:4,rerunMS:31,showChrome:4,showProjection:4,showTethers:4,coreForceMode:[0,52],terminalBehavior:[0,53]}],[["data","phases"],"array",["idAccessor","labelAccessor","categoryAccessor","amountAccessor","metricsAccessor","initialStateAccessor"],["physics"],{description:0,summary:0,phases:9,products:9,events:9,outlets:9,idAccessor:6,labelAccessor:6,categoryAccessor:6,amountAccessor:6,metricsAccessor:6,initialStateAccessor:6,metrics:10,amountLabel:0,conservation:3,projection:10,playback:[0,54],snapshotAt:2,controls:3,paused:4,playbackRate:1,rerunMS:31,seed:25,bodyRadius:1,radiusRange:9,colorBy:6,showBonds:4,showChrome:4,showProjection:4,initialSpawnPacing:10,loading:4,loadingContent:3,emptyContent:3,onStateChange:12,onCrucibleObservation:12,onDiagnostic:12,onConservation:12,onClick:12}],[["stages"],"array",["idAccessor","stageAccessor","groupBy","workAccessor","radiusAccessor"],["physics"],{stages:9,stageAccessor:6,idAccessor:6,groupBy:6,groupLabelAccessor:6,workAccessor:6,styleRules:9,radiusAccessor:6,ballRadius:1,route:[0,55],groupCompletion:[0,56],groupAnchorAlong:1,showProjection:4,showChrome:4,chromeOptions:10,settle:4,gravityX:1,gravityY:1,springStiffness:1,springDamping:1,rerunMS:31,initialSpawnPacing:10,liveCapacity:4,bodyLimit:1,bodyMark:[0,57],seed:1}],[[],"network",["nodeIdAccessor","nodeXAccessor","nodeYAccessor","sourceAccessor","targetAccessor","throughputAccessor","pathAccessor"],["common"],{size:9,background:0,legendLayout:10,nodes:9,links:9,edges:9,data:9,nodeIdAccessor:6,nodeXAccessor:6,nodeYAccessor:6,sourceAccessor:6,targetAccessor:6,throughputAccessor:6,pathAccessor:6,styleRules:9,coordinateMode:[0,58],particleRate:1,maxParticles:1,particleRadius:1,flowSpeed:1,pathConstraint:[0,59],reducedMotion:4,showStaticFlow:4,showNodeLabels:4,showSensors:4,paused:4,rerunMS:31,seed:1}],[["data","taskIDAccessor","labelAccessor","laneAccessor","dependencyAccessor"],"array",["taskIDAccessor","labelAccessor","laneAccessor","dependencyAccessor","startAccessor","endAccessor","progressAccessor","statusAccessor","completionTimeAccessor","blockerAccessor","milestoneAccessor"],["physics"],{taskIDAccessor:6,labelAccessor:6,laneAccessor:6,dependencyAccessor:6,startAccessor:6,endAccessor:6,progressAccessor:6,statusAccessor:6,completionTimeAccessor:6,blockerAccessor:6,milestoneAccessor:6,mode:[0,60],insight:[0,61],currentTime:2,controls:20,mechanism:[0,62],orientation:[0,63],reducedMotion:[0,64],enableHover:4,seed:1,selectedTaskIDs:9,onSelectionChange:12,onObservation:12}],[[],"none",[],[],{width:25,height:25,className:0,chartId:0,description:0,summary:0,loading:4,loadingContent:3,emptyContent:3,value:1,label:0,caption:0,format:[6,65],locale:0,currency:0,precision:1,prefix:0,suffix:0,unit:0,comparison:10,target:10,delta:1,deltaFormat:[6,65],showDeltaPercent:4,direction:[0,66],sentiment:[0,67],thresholds:9,chartSlot:34,chartSize:1,windowSize:1,mode:[0,68],align:[0,69],padding:2,emphasis:[0,4],color:0,background:0,borderColor:0,borderRadius:25,animate:3,stalenessThreshold:1,staleLabel:0,headerSlot:34,valueSlot:34,deltaSlot:34,trendSlot:34,footerSlot:34,onClick:12,onObservation:12}]],Nl=/* @__PURE__ */Ue(),Tl=/* @__PURE__ */Object.assign(/* @__PURE__ */Object.create(null),Nl),Il=["orient","visible","label","ticks","tickCount","extent","tickFormat","baseline","jaggedBase","tickValues","gridStyle","axisStyle","grid","includeMax","autoRotate","landmarkTicks","tickAnchor"],Ol=e=>Il.includes(e),Ml=/* @__PURE__ */new Set(["start","center","end","left","right"]),jl={swatchSize:{minimum:1,label:"a positive number"},labelGap:{minimum:0,label:"a non-negative number"},itemGap:{minimum:0,label:"a non-negative number"},rowHeight:{minimum:1,label:"a positive number"},maxWidth:{minimum:1,label:"a positive number"},edgeGutter:{minimum:0,label:"a non-negative number"},sideGutter:{minimum:0,label:"a non-negative number"},axisGutter:{minimum:0,label:"a non-negative number"}},Fl=(require("d3-interpolate"),80),zl=100,Ll=/* @__PURE__ */new Set(["TreeDiagram","Treemap","CirclePack","OrbitDiagram"]),Bl=/* @__PURE__ */new Set(["ForceDirectedGraph","SankeyDiagram","ChordDiagram"]),Dl=/* @__PURE__ */new Set(["BarChart","StackedBarChart","GroupedBarChart","AreaChart","StackedAreaChart"]),_l=/* @__PURE__ */new Set(["LineChart","AreaChart","StackedAreaChart"]),Ul=/* @__PURE__ */new Set(["BarChart","StackedBarChart","GroupedBarChart","FunnelChart"]),Gl=/* @__PURE__ */new Set(["LineChart","AreaChart","StackedAreaChart","ConnectedScatterplot"]),Vl=/* @__PURE__ */new Set(["PieChart","DonutChart"]),Hl={PieChart:"valueAccessor",DonutChart:"valueAccessor",FunnelChart:"valueAccessor"},Wl=/* @__PURE__ */new Set(
|
|
13
|
+
/* @__PURE__ */Object.keys(Hl)),ql={StackedBarChart:"valueAccessor",StackedAreaChart:"yAccessor"},Yl=/* @__PURE__ */new Set(["BigNumber"]),Kl=/* @__PURE__ */new Set(["LineChart","AreaChart","DifferenceChart","StackedAreaChart","Scatterplot","ConnectedScatterplot","BubbleChart","QuadrantChart","MultiAxisLineChart","CandlestickChart","Heatmap","MinimapChart"]),Jl=/* @__PURE__ */new Set(["BarChart","StackedBarChart","GroupedBarChart","SwarmPlot","BoxPlot","Histogram","ViolinPlot","DotPlot","RidgelinePlot","FunnelChart","LikertChart","SwimlaneChart"]),Xl=/* @__PURE__ */new Set(["StreamPhysicsFrame","GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","PhysicsCustomChart"]),Zl=/* @__PURE__ */new Set(["OrbitDiagram",...Xl]),Ql=/* @__PURE__ */new Set(["GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart"]),eu=/* @__PURE__ */new Set(["GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart","PhysicsCustomChart"]),tu=/* @__PURE__ */new Set(["RealtimeLineChart","RealtimeHistogram","RealtimeSwarmChart","RealtimeWaterfallChart","RealtimeHeatmap","ProcessSankey"]),ru=/* @__PURE__ */new Set(["MultiAxisLineChart"]),au=/* @__PURE__ */new Set(["ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram"]),iu={Scatterplot:"pointRadius",BubbleChart:"pointRadius",ConnectedScatterplot:"pointRadius",QuadrantChart:"pointRadius",SwarmPlot:"pointRadius",DotPlot:"dotRadius"},ou=["label","callout","callout-circle","callout-rect"],nu=/* @__PURE__ */new Set(["label","callout","callout-circle","callout-rect","text","widget"]),su=/* @__PURE__ */new Set(ou),cu=2e4,lu=["type","id","stableId","provenance","lifecycle","status","emphasis","rank","priority","x","y","x0","x1","y0","y1","dx","dy","nx","ny","px","py","coordinates","points","pointId","nodeId","category","field","value","threshold","anchor","position","label","title","text","note","content","shortText","mobileText","wrap","labelPosition","labelBackground","labelColor","textAnchor","dominantBaseline","fontSize","fontWeight","fontStyle","fontFamily","letterSpacing","titleFontWeight","color","fill","fillOpacity","opacity","stroke","strokeWidth","strokeDasharray","strokeColor","width","height","radius","radiusPadding","padding","layer","style","className","connector","disable","subject","bracketType","endCap","showBand","filter","method","steps","trainEnd","bandwidth","order","upperAccessor","lowerAccessor","confidenceAccessor","bandColor","bandOpacity","uncertaintyOpacity","anomalyColor","anomalyRadius","anomalyStyle","cohesion","depth","defensive","gradient"],uu=/* @__PURE__ */new Set(lu),du=120,hu=250,pu=["xExtent","yExtent","rExtent"],fu=8,mu=/^(\d{4})-(\d{1,2})(?:-(\d{1,2}))?$/,gu=[{role:"x",accessor:"xAccessor",defaultAccessor:"x",temporalValues:"date-like",domain:!0},{role:"y",accessor:"yAccessor",defaultAccessor:"y",domain:!0}],yu={fields:gu},bu=[{...gu[0],nestedDataAccessorProp:"lineDataAccessor",defaultNestedDataAccessor:"coordinates"},{...gu[1],nestedDataAccessorProp:"lineDataAccessor",defaultNestedDataAccessor:"coordinates",allowMissing:!0}],vu={fields:bu},wu={role:"value",accessor:"valueAccessor",defaultAccessor:"value"},Au={...wu,domain:!0},xu={fields:[{...wu,requirements:["finite","non-negative"]}],aggregates:[{kind:"positive-total",role:"value"}]},$u={fields:[wu],aggregates:[{kind:"normalized-total",role:"value",groupAccessor:"categoryAccessor",defaultGroupAccessor:"category",whenProp:"normalize"}]},Cu={fields:bu,aggregates:[{kind:"normalized-total",role:"y",groupAccessor:"xAccessor",defaultGroupAccessor:"x",whenProp:"normalize"}]},Su={fields:[...gu,{role:"size",accessor:"sizeBy",requirements:["finite","non-negative"]}]},ku={fields:[...gu,{role:"size",accessor:"sizeBy",requirements:["finite","non-negative"]}]},Ru={fields:[wu]},Pu={fields:[{...wu,dataProp:"edges",requirements:["finite","non-negative"],missingValue:1}]},Eu={LineChart:vu,AreaChart:vu,BumpChart:vu,Scatterplot:ku,ConnectedScatterplot:yu,QuadrantChart:ku,MinimapChart:vu,BubbleChart:Su,StackedAreaChart:Cu,DifferenceChart:{fields:[{role:"x",accessor:"xAccessor",defaultAccessor:"x",temporalValues:"date",domain:!0},{role:"value",accessor:"seriesAAccessor",defaultAccessor:"a"},{role:"value",accessor:"seriesBAccessor",defaultAccessor:"b"}]},WaterfallChart:{fields:[{role:"y",accessor:"yAccessor",defaultAccessor:"y"}]},CandlestickChart:{fields:[{role:"x",accessor:"xAccessor",defaultAccessor:"x",temporalValues:"date-like",domain:!0},{role:"high",accessor:"highAccessor",defaultAccessor:"high",requirements:["finite"]},{role:"low",accessor:"lowAccessor",defaultAccessor:"low",requirements:["finite"]},{role:"open",accessor:"openAccessor",whenProps:["openAccessor","closeAccessor"],requirements:["finite"]},{role:"close",accessor:"closeAccessor",whenProps:["openAccessor","closeAccessor"],requirements:["finite"]}]},Heatmap:Ru,BarChart:{fields:[wu]},GroupedBarChart:{fields:[wu]},StackedBarChart:$u,DotPlot:{fields:[Au]},Histogram:{fields:[Au]},BoxPlot:{fields:[Au]},SwarmPlot:{fields:[Au,{role:"size",accessor:"sizeBy",requirements:["finite","non-negative"]}]},ViolinPlot:{fields:[Au]},RidgelinePlot:{fields:[Au]},PieChart:xu,DonutChart:xu,FunnelChart:xu,SankeyDiagram:Pu,ChordDiagram:Pu,ProportionalSymbolMap:{fields:[{role:"x",accessor:"xAccessor",defaultAccessor:"lon",dataProp:"points",requirements:["finite"]},{role:"y",accessor:"yAccessor",defaultAccessor:"lat",dataProp:"points",requirements:["finite"]},{role:"size",accessor:"sizeBy",dataProp:"points",requirements:["finite","non-negative"]}]}},Nu=/* @__PURE__ */Symbol.for("semiotic.numericContractRegistry"),Tu=5,Iu={xAccessor:"x",yAccessor:"y",valueAccessor:"value",sizeBy:"size",sizeAccessor:"size",radiusAccessor:"size",countAccessor:"count",amountAccessor:"value",highAccessor:"high",lowAccessor:"low",openAccessor:"open",closeAccessor:"close",lowerAccessor:"lower",upperAccessor:"upper",positiveAccessor:"value",negativeAccessor:"value",progressAccessor:"value",confidenceAccessor:"value",costAccessor:"value",throughputAccessor:"value"},Ou=/* @__PURE__ */new Set(["category10","tableau10","set3","blues","reds","greens","oranges","purples","greys","viridis","plasma","inferno","magma","cividis","turbo"]),Mu=["xAccessor","yAccessor","timeAccessor","valueAccessor","categoryAccessor","colorBy","sizeBy","lineBy","areaBy","stackBy","groupBy","orderAccessor","y0Accessor","sourceAccessor","targetAccessor","nodeIdAccessor","nodeIDAccessor","childrenAccessor","costAccessor"],ju=/* @__PURE__ */new Set(["#0072b2","#e69f00","#009e73","#cc79a7","#56b4e9","#d55e00","#f0e442","#000000"]),Fu=/* @__PURE__ */Symbol.for("semiotic.chartRecipeRegistry"),zu=["title","description","summary"],Lu=/* @__PURE__ */new Set(["XYCustomChart","OrdinalCustomChart","NetworkCustomChart","GeoCustomChart","PhysicsCustomChart"]),Bu=/* @__PURE__ */new Set([...Lu,"XYFrame","OrdinalFrame","NetworkFrame","GeoFrame"]),Du="Chartability (POUR-CAF) — https://chartability.github.io/POUR-CAF/. Not a pass/fail cert; pair with manual screen-reader testing (NVDA+Firefox, JAWS+Chrome, VoiceOver+Safari).",_u={pass:"✓",fail:"✗",warn:"⚠",manual:"○","not-applicable":"·"},Uu=["perceivable","operable","understandable","robust","compromising","assistive","flexible"],Gu={code:"SEMANTIC_DEGENERATE",severity:"error",message:"Marks painted, but the capability reported a semantically degenerate encoding.",fix:"Choose fields that support the chart's intended encoding."},Vu={error:0,warning:1,manual:2},Hu={validation:-1,data:0,deception:1,accessibility:2,render:3},Wu="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.",qu=/* @__PURE__ */new Set([...Kl,"RealtimeLineChart","RealtimeHeatmap"]),Yu={pass:"PASS",warn:"WARN",manual:"MANUAL","not-applicable":"N/A"},Ku=["layout","density","interaction","annotation","semantics"],Ju=/* @__PURE__ */Symbol.for("semiotic.intentRegistry"),Xu=/* @__PURE__ */new Set(["LineChart","AreaChart","StackedAreaChart","DifferenceChart","Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","MultiAxisLineChart","MinimapChart"]),Zu=/* @__PURE__ */new Set(["BarChart","StackedBarChart","GroupedBarChart","DotPlot"]),Qu=/* @__PURE__ */new Set(["PieChart","DonutChart","FunnelChart"]),ed=/* @__PURE__ */new Set(["Histogram","BoxPlot","ViolinPlot","RidgelinePlot","SwarmPlot"]),td=class{constructor(e,t={},r=[]){if(this.windowSize=e,this.policy=t,this.windows=/* @__PURE__ */new Map,this.openWindows=/* @__PURE__ */new Set,this.sources=/* @__PURE__ */new Map,this.latest=-1/0,this.frontier=-1/0,this.value=-1/0,this.pending=[],!Number.isFinite(e)||e<=0)throw new RangeError("EventDrop windows.size must be a finite positive number");for(const e of r)this.sources.set(e,{latest:-1/0,arrival:-1/0,idle:!1});this.validatePolicy(t)}validatePolicy(e){if("function"!=typeof e){for(const t of["delay","idleTimeout","allowedLateness"]){const r=e[t];if(null!=r&&(!Number.isFinite(r)||r<0))throw new RangeError(`watermark.${t} must be finite and nonnegative`)}if(null!=e.value&&!Number.isFinite(e.value))throw new RangeError("watermark.value must be finite")}}setWatermark(e){this.validatePolicy(e),this.policy=e}getWatermark(){return this.value}getLatestEventTime(){return this.latest}getArrivalFrontier(){return this.frontier}getLedger(){return Array.from(this.windows.values(),Ci).sort((e,t)=>e.start-t.start)}drainEvents(){const e=this.pending;return this.pending=[],e}snapshot(){return this.state(this.getLedger())}drainDelta(){const e=Array.from(this.changedWindows??[],e=>Ci(this.windows.get(e)));return this.changedWindows=/* @__PURE__ */new Set,this.state(e)}state(e){return{windows:e,sources:Array.from(this.sources,([e,t])=>[e,{...t}]),latest:this.latest,frontier:this.frontier,value:this.value,heldBy:this.heldBy}}restore(e){this.applySnapshot(e,!0)}applyDelta(e){this.applySnapshot(e,!1)}applySnapshot(e,t){const r=e=>Number.isFinite(e)||e===-1/0,a=e=>Number.isSafeInteger(e)&&e>=0;if(![e.latest,e.frontier,e.value].every(r)||new Set(e.windows.map(e=>e.windowId)).size!==e.windows.length||new Set(e.sources.map(([e])=>e)).size!==e.sources.length||e.sources.some(([,e])=>!r(e.latest)||!r(e.arrival))||e.windows.some(e=>!Number.isFinite(e.start)||!Number.isFinite(e.end)||e.end<=e.start||!a(e.accepted)||!a(e.late)||Object.values(e.bySource).some(e=>!a(e.accepted)||!a(e.late))||Object.values(e.bySource).reduce((e,t)=>e+t.accepted,0)!==e.accepted||Object.values(e.bySource).reduce((e,t)=>e+t.late,0)!==e.late))throw new RangeError("Invalid EventDrop ledger snapshot");t&&(this.windows.clear(),this.openWindows.clear());for(const t of e.windows){const e=this.windows.get(t.windowId);e&&this.openWindows.delete(e);const r=Ci(t);Object.setPrototypeOf(r.bySource,null),this.windows.set(t.windowId,r),r.open&&this.openWindows.add(r)}this.changedWindows?.clear(),this.sources=new Map(e.sources.map(([e,t])=>[e,{...t}])),this.latest=e.latest,this.frontier=e.frontier,this.value=e.value,this.heldBy=e.heldBy,this.pending=[]}advance(e,t="external"){if(!Number.isFinite(e))return;this.frontier=Math.max(this.frontier,e);const r=this.policy;let a;if("function"==typeof r)a=r(this.latest);else if(r.external)a=r.external();else if(null!=r.value)a=r.value;else{let t=this.latest;if(r.perSource){let a;t=1/0;for(const[i,o]of this.sources){Number.isFinite(o.arrival)||(o.arrival=e);const n=null!=r.idleTimeout&&e-o.arrival>=r.idleTimeout;n&&!o.idle&&this.pending.push({type:"physics-source-idle",sourceId:i}),o.idle=n,!n&&o.latest<t&&(t=o.latest,a=i)}a&&a!==this.heldBy&&t<this.latest&&this.pending.push({type:"physics-watermark-held",sourceId:a}),this.heldBy=a,t===1/0&&(t=this.latest)}a=t-(r.delay??this.windowSize)}if(!Number.isFinite(a)||a<=this.value)return;const i=this.value;this.value=a,this.pending.push({type:"physics-watermark-advance",from:i,to:a,cause:t});for(const t of this.openWindows)t.end<=this.value&&this.close(t,e)}close(e,t){this.changedWindows?.add(e.windowId),e.open=!1,e.closedAt=t,e.watermarkAtClose=this.value,this.openWindows.delete(e),this.pending.push({type:"physics-window-close",...Ci(e),watermark:this.value})}append(e){var t;const{eventTime:r,arrivalTime:a,source:i=""}=e;if(!Number.isFinite(r)||!Number.isFinite(a))throw new RangeError("Event and arrival times must be finite");if(a<this.frontier)throw new RangeError("Incremental admissions require nondecreasing arrival times");this.latest=Math.max(this.latest,r);const o=this.sources.get(i);this.sources.set(i,{latest:Math.max(o?.latest??-1/0,r),arrival:a,idle:!1}),this.advance(a,"arrival");const n=Math.floor(r/this.windowSize)*this.windowSize,s=n+this.windowSize,c=`${n}-${s}`;let l=this.windows.get(c);l||(l={windowId:c,start:n,end:s,accepted:0,late:0,bySource:/* @__PURE__ */Object.create(null),open:!0},this.windows.set(c,l),this.openWindows.add(l),this.pending.push({type:"physics-window-open",windowId:c,start:n,end:s}));const u=e.watermarkAtArrival??this.value,d=s+("function"==typeof this.policy?0:this.policy.allowedLateness??0)<=u,h=(t=l.bySource)[i]??(t[i]={accepted:0,late:0}),p=d?"late":"accepted";return l[p]++,this.changedWindows?.add(c),h[p]++,l.open||d||this.pending.push({type:"physics-window-update",windowId:c,accepted:l.accepted,late:l.late,bySource:Ci(l).bySource,watermark:this.value,retractions:1}),l.open&&s<=this.value&&this.close(l,a),{windowId:c,start:n,end:s,late:d,watermarkAtArrival:u}}},rd={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",BumpChart:"bump 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",UnitPileChart:"physics pile chart",CollisionSwarmChart:"collision swarm chart",PacketFlowChart:"physical flow chart",ProcessFlowChart:"process flow physics chart",CrucibleChart:"crucible physics chart",PhysicsCustomChart:"custom physics chart"},ad=/* @__PURE__ */new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]),id=/* @__PURE__ */new Set(["StreamPhysicsFrame","EventDropChart","GaltonBoardChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart","PhysicsCustomChart"]),od=/* @__PURE__ */new Set(["Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","ScatterplotMatrix"]),nd={"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"},sd={"time-series":"tracking",categorical:"comparing",distribution:"characterizing",relationship:"relating",flow:"tracing",network:"tracing",hierarchy:"nesting",geo:"locating",realtime:"tracking",value:"presenting",custom:"presenting"},cd=["trend","compare-series","compare-categories","rank","part-to-whole","distribution","correlation","flow","hierarchy","geo","composition-over-time","change-detection","outlier-detection"],ld={alerting:"alerting",tracking:"trend",comparing:"comparison",ranking:"ranking",apportioning:"composition",characterizing:"distribution",relating:"correlation",tracing:"flow",nesting:"hierarchy",locating:"locator",presenting:"single-value"},ud=/* @__PURE__ */new Set(["y-threshold","x-threshold","band","x-band","callout","label"]),dd=/* @__PURE__ */new Set(["system","agent","watcher"]),hd=/* @__PURE__ */new Set(["ai","agent","system","computed","dbt","great-expectations"]),pd=/* @__PURE__ */new Set(["rule","statistical-test","llm-inference","computed"]),fd={"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"},md=/* @__PURE__ */new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]),gd=/* @__PURE__ */new Set(["TreeDiagram","Treemap","CirclePack","OrbitDiagram"]),yd=/* @__PURE__ */new Set(["ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram"]),bd=/* @__PURE__ */new Set(["StreamPhysicsFrame","EventDropChart","GaltonBoardChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","PhysicsCustomChart"]),vd="__semioticSelectionData",wd="__semioticSelectionCoverage",Ad=/* @__PURE__ */new Set(["data","nodes","edges","points","areas","lines","flows","atlas","forest","circuit","edition","reading"]),xd=(e,t)=>(e>>>t|e<<32-t)>>>0,$d=e=>Math.floor(4294967296*(e-Math.floor(e)))>>>0,[Cd,Sd]=/* @__PURE__ */(()=>{const e=[],t=[];for(let r=2;t.length<64;r+=1){let a=!0;for(let e=2;e*e<=r;e+=1)if(r%e===0){a=!1;break}a&&(e.length<8&&e.push($d(Math.sqrt(r))),t.push($d(Math.cbrt(r))))}return[e,t]})(),kd="0.1",Rd=/* @__PURE__ */Mn({"artifact.id":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"never"},"artifact.createdAt":{suppliedBy:["author","system","import"],derivable:!1,modelMayPropose:!1,humanReview:"never"},"artifact.configFingerprint":{suppliedBy:["system"],derivable:!0,modelMayPropose:!1,humanReview:"never"},"artifact.dataFingerprint":{suppliedBy:["system"],derivable:!0,modelMayPropose:!1,humanReview:"never"},"purpose.intents":{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},"purpose.communicativeAct":{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},"purpose.stakes":{suppliedBy:["author","import"],derivable:!1,modelMayPropose:!0,humanReview:"required"},claims:{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},"claims.status":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},evidence:{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},"evidence.source":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},"evidence.fingerprint":{suppliedBy:["system"],derivable:!0,modelMayPropose:!1,humanReview:"never"},time:{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},"time.completeness":{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"},reception:{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},form:{suppliedBy:["author","system","model-proposal","import"],derivable:!0,modelMayPropose:!0,humanReview:"policy-dependent"},contestability:{suppliedBy:["author","system","import"],derivable:!1,modelMayPropose:!1,humanReview:"required"},accountability:{suppliedBy:["author","system","import"],derivable:!1,modelMayPropose:!1,humanReview:"policy-dependent"},inheritance:{suppliedBy:["author","system","import"],derivable:!0,modelMayPropose:!1,humanReview:"policy-dependent"}}),Pd=["fresh","stale","unknown"],Ed=["partial","provisional","settled","unknown"],Nd=["observedAt","ingestedAt","processedAt","publishedAt","snapshotAt"],Td={eventTime:{field:{},value:{},timezone:{},granularity:{}},presentation:{state:{values:["live","historical","mixed"]},label:{}},freshness:{status:{required:!0,values:Pd},checkedAt:{},heartbeatAt:{},expiresAt:{},basis:{}},watermark:{value:{required:!0},policy:{},allowedLateness:{}},window:{start:{required:!0},end:{required:!0},status:{required:!0,values:["open","provisional","settled","reopened","corrected"]}},completeness:{status:{required:!0,values:Ed},basis:{}},revision:{status:{required:!0,values:["original","backfilled","corrected","superseded"]},previousArtifactId:{},correctionId:{},reason:{}},snapshot:{id:{},format:{values:["iceberg","delta","other"]},schemaVersion:{},catalogRef:{}}},Id={id:{required:!0},kind:{required:!0,values:["stream","processing-job","quality-check","snapshot","publication"]},label:{},observedAt:{},version:{},timezone:{},granularity:{},freshness:{values:Pd},completeness:{values:Ed}},Od=/* @__PURE__ */new Set(["preserved","unsupported-version","invalid","excluded"]),Md="function"==typeof structuredClone?structuredClone:e=>JSON.parse(JSON.stringify(e)),jd="1",Fd=/* @__PURE__ */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","interactiveGraphics","legend","recipe","layout"]),zd="function"==typeof structuredClone?structuredClone:e=>JSON.parse(JSON.stringify(e)),Ld=e=>e.replace(/~/g,"~0").replace(/\//g,"~1"),Bd={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"},Dd={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"},_d=class{constructor(e){if(this._capacity=e,this.head=0,this._size=0,e<1)throw new Error("RingBuffer capacity must be at least 1");this.buffer=new Array(e)}push(e){let t;return this._size===this._capacity?t=this.buffer[this.head]:this._size++,this.buffer[this.head]=e,this.head=(this.head+1)%this._capacity,t}pushMany(e){const t=[];for(const r of e){const e=this.push(r);void 0!==e&&t.push(e)}return t}get(e){if(e<0||e>=this._size)return;const t=(this.head-this._size+e+this._capacity)%this._capacity;return this.buffer[t]}peek(){if(0!==this._size)return this.buffer[(this.head-1+this._capacity)%this._capacity]}peekOldest(){if(0!==this._size)return this.buffer[(this.head-this._size+this._capacity)%this._capacity]}[Symbol.iterator](){let e=0;return{next:()=>e>=this._size?{done:!0,value:void 0}:{done:!1,value:this.get(e++)}}}forEach(e){const t=(this.head-this._size+this._capacity)%this._capacity;for(let r=0;r<this._size;r++)e(this.buffer[(t+r)%this._capacity],r)}toArray(){const e=new Array(this._size),t=(this.head-this._size+this._capacity)%this._capacity;for(let r=0;r<this._size;r++)e[r]=this.buffer[(t+r)%this._capacity];return e}resize(e){if(e<1)throw new Error("RingBuffer capacity must be at least 1");const t=this.toArray();let r=0,a=[];t.length>e&&(r=t.length-e,a=t.slice(0,r)),this._capacity=e,this.buffer=new Array(e),this.head=0,this._size=0;for(let e=r;e<t.length;e++)this.push(t[e]);return a}update(e,t){const r=[],a=(this.head-this._size+this._capacity)%this._capacity;for(let i=0;i<this._size;i++){const o=(a+i)%this._capacity,n=this.buffer[o];if(e(n)){let e;e="object"!=typeof n||null===n?n:Array.isArray(n)?[...n]:{...n},r.push(e),this.buffer[o]=t(n)}}return r}remove(e){const t=[],r=[];if(this.forEach(a=>{e(a)?r.push(a):t.push(a)}),0===r.length)return r;this.buffer=new Array(this._capacity),this.head=0,this._size=0;for(const e of t)this.push(e);return r}clear(){this.buffer=new Array(this._capacity),this.head=0,this._size=0}get size(){return this._size}get capacity(){return this._capacity}get full(){return this._size===this._capacity}},Ud=class{constructor(){this._min=1/0,this._max=-1/0,this._dirty=!1}push(e){Number.isFinite(e)&&(e<this._min&&(this._min=e),e>this._max&&(this._max=e))}evict(e){e!==this._min&&e!==this._max||(this._dirty=!0)}recalculate(e,t){this._min=1/0,this._max=-1/0;for(const r of e){const e=t?t(r):r;Number.isFinite(e)&&(e<this._min&&(this._min=e),e>this._max&&(this._max=e))}this._dirty=!1}clear(){this._min=1/0,this._max=-1/0,this._dirty=!1}get extent(){return[this._min,this._max]}get min(){return this._min}get max(){return this._max}get dirty(){return this._dirty}},Gd=["name","label","title"],Vd=["type","kind","category","group","class","status","role","shape"],Hd=["value","amount","total","count","weight","score"],Wd=/* @__PURE__ */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"]),qd=Bc(require("react")),Yd=require("react/jsx-runtime"),Kd={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"},Jd=/* @__PURE__ */Symbol.for("semiotic.tooltipChromeContext"),Xd=/* @__PURE__ */fc(function({chrome:e,children:t}){const r=dc();/* @__PURE__ */ /* @__PURE__ */
|
|
14
|
+
return(0,Yd.jsx)(r.Provider,{value:e,children:t})}),Zd=/* @__PURE__ */fc(function({chrome:e,className:t="",style:r,children:a,...i}){const o=qd.useContext(dc()),n="default"===(e??o??"default"),s=qd.useRef(null);qd.useImperativeHandle(i.ref,()=>s.current);const c=pc(s,void 0===e&&n);/* @__PURE__ */ /* @__PURE__ */
|
|
15
|
+
return(0,Yd.jsx)("div",{...i,ref:s,"data-semiotic-tooltip-chrome":!0,className:c?t:`semiotic-tooltip ${t}`.trim(),style:n&&!c?{...Kd,...r}:r,children:a})}),Qd=require("react/jsx-runtime"),eh=!1;
|