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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){let t=e.trim();if(!t||!Number.isNaN(Number(t)))return NaN;let a=fe.exec(t);if(a){let e=Number(a[1]),t=Number(a[2])-1,r=Number(a[3]??1),n=new Date(0);return n.setUTCFullYear(e,t,r),n.getUTCFullYear()===e&&n.getUTCMonth()===t&&n.getUTCDate()===r?n.getTime():NaN}if(t.length<10)return NaN;let r=Date.parse(t);return Number.isFinite(r)?r:NaN}function t(t){if(t instanceof Date)return t.getTime();if("number"==typeof t)return Number.isFinite(t)?t:NaN;if("string"!=typeof t||!t.trim())return NaN;let a=t.trim(),r=Number(a);if(!Number.isNaN(r))return Number.isFinite(r)?r:NaN;if(/^\d{4}-\d{1,2}(?:-\d{1,2})?$/.test(a))return e(a);let n=/^(\d{4}-\d{2}-\d{2})[Tt ](\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)([Zz]|[+-]\d{2}:?\d{2})?$/.exec(a);return n&&Number.isFinite(e(n[1]))?Date.parse(`${n[1]}T${n[2]}${n[3]||"Z"}`):NaN}function a(e,t){if("function"==typeof e)return e;let a=e||t;return e=>e[a]}function r(e){return!(null===e||"object"!=typeof e||Array.isArray(e)||e instanceof Date||e instanceof Map||e instanceof Set)}function n(e){let t=(e.length<=3?Array.from(e):[e[0],e[Math.floor(e.length/2)],e[e.length-1]]).filter(r);return t.length?t:e.filter(r)}function l(e){return[...new Set(n(e).flatMap(Object.keys))]}function i(e){if(!Array.isArray(e))return[];for(let t of e)if(!r(t))return e.filter(r);return e}function o(e){let t=e;for(let a of["data","nodes","edges","points","areas","lines","flows","spawns","projectionRows","annotations"]){if(!Array.isArray(e[a]))continue;let r=i(e[a]);r!==e[a]&&(t===e&&(t={...e}),t[a]=r)}return t}function s(e){return e instanceof Date?e.getTime():"number"==typeof e?e:"string"==typeof e&&""!==e.trim()?Number(e):NaN}function c(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 u(e,t){let r=a(e,t);return e=>s(r(e))}function h(e,t){return ge.has(e)||$e.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 d(e){for(let t of["lineBy","areaBy","stackBy","groupBy","colorBy"]){let a=e[t];if("string"==typeof a&&a)return a}}function m(e,t){return null==e?"—":e instanceof Date?c(e)?.slice(0,10)??"—":"number"==typeof e?t(e):c(e)??"—"}function f(e,t={}){let a=!0===t.showRetractedAnnotations,r=!0===t.showSupersededAnnotations,n=new Set;for(let t of e){let e=t?.lifecycle?.supersedes;e&&"retracted"!==t?.lifecycle?.status&&n.add(e)}return e.filter(e=>{if("retracted"===e?.lifecycle?.status&&!a)return!1;let t=e?.provenance?.stableId;return!(t&&n.has(t)&&!r)})}function p(e,t,a){return"function"==typeof t?t(e):e["string"==typeof t&&t?t:a]}function g(e,t="—"){let a;for(;null!==e&&"object"==typeof e&&!(e instanceof Date);){if(a??(a=new Set),a.has(e))return t;a.add(e);let r=e;e=r.id??r.name??r.label}return c(e)||t}function $(e){let t=s(e);return Number.isFinite(t)?t:void 0}function b(e){return(g(e,"unknown").toLowerCase().match(/[a-z0-9]+/g)||[]).join("-")||"unknown"}function v(e,t){return`${e.linkedHover||e.selection||e.linkedBrush?` ${t}`:""}${e.enableHover||e.tooltip?" Hover or focus a mark for its details.":""}`}function y(e,t){return i(p(e,t,"children"))}function w(){let e=globalThis;return e[ve]||(e[ve]={recipes:new Map,capabilities:new Map,layouts:new Map}),e[ve]}function C(e){return w().recipes.get(e)}function A(e){let t=w().layouts.get(e)?.identity;return t?{...t}:void 0}function k(e){return"string"==typeof e?C(e):e&&"object"==typeof e&&"string"==typeof e.id?e:void 0}function x(e){return"string"==typeof e?e:e.id??e.name}function S(e){return e.layoutConfig&&"object"==typeof e.layoutConfig?e.layoutConfig:{}}function M(e){return Array.isArray(e.data)?i(e.data):Array.isArray(e.nodes)?i(e.nodes):Array.isArray(e.points)?i(e.points):Array.isArray(e.areas)?i(e.areas):[]}function N(e,t,a){return a??k(t.recipe)??k(t.recipeId)??C(e)}function F(e,t,a=[]){let r=e.accessor?t[e.accessor]:void 0;if("string"==typeof r&&r)return r;if(e.field)return e.field;let n=a.find(e=>e&&"object"==typeof e);if(!n)return;let l=Object.entries(n).filter(([e,t])=>!e.startsWith("_")&&null!=t);return"quantitative"===e.semanticType?l.find(([,e])=>"number"==typeof e)?.[0]:"identifier"===e.semanticType?["id","key","name"].find(e=>Object.prototype.hasOwnProperty.call(n,e)):l.find(([,e])=>"string"==typeof e)?.[0]}function P(e,t){return e.dataRoles.find(e=>e.role===t)}function D(e,t){return e.dataRoles.find(e=>t.includes(e.semanticType))}function j(e,t,a,r,n,l={}){let i=Object.assign(Object.create(null),l);if(t)for(let[e,a]of Object.entries(t))i[e]=a;for(let e of a.dataRoles){let a=F(e,r,n),l=t&&a?t[a]:a;void 0!==l&&(i[e.role]=l)}return e.replace(/\{([^}]+)\}/g,(e,t)=>g(i[t],`{${t}}`))}function L(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function T(e){function t(){a=a+1831565813|0;let e=Math.imul(a^a>>>15,1|a);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}let a=e>>>0;return t.getState=()=>a>>>0,t}function B(e,t,a){return"function"==typeof a?a(e,t):e[a]}function R(e){if(e instanceof Date){let t=e.getTime();return Number.isFinite(t)?t:null}let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:null}function I(e,t,a=0){let r=new Set(e.filter(e=>null!=e.id).map(e=>String(e.id))),n=new Map;for(let l of e){let e=null==l.id?`${t}-${a++}`:String(l.id);for(;null==l.id&&r.has(e);)e=`${t}-${a++}`;r.add(e),n.set(e,null==l.id?{...l,id:e}:l)}return{seed:e,rows:Array.from(n.values()),nextId:a}}function O(e={}){let t=(e.categories?.length?e.categories:["Intake","Review","Build","Ship"]).map(e=>String(e).trim()).filter(Boolean),a=t.length?t:["Intake"],r=Math.max(a.length,Math.round(e.count??Math.max(48,12*a.length))),n=function(e){let t=R(e);return null!=t&&t>0?t:1}(e.unitValue),l=T(e.seed??1),i=e.idPrefix??"mechanical-pile",o=a.map(()=>.65+.9*l()),s=o.reduce((e,t)=>e+t,0)||1,c=r-a.length,u=o.map(e=>e/s*c),h=u.map(e=>1+Math.floor(e)),d=r-h.reduce((e,t)=>e+t,0),m=u.map((e,t)=>({index:t,fraction:e-Math.floor(e)})).sort((e,t)=>t.fraction-e.fraction);for(let e=0;d>0;e=(e+1)%m.length)h[m[e].index]+=1,d-=1;return a.map((e,t)=>({id:`${i}-${t}`,category:e,value:h[t]*n,mechanical:!0,unitCount:h[t],unitValue:n,share:h[t]/r}))}function E(e,t){let a=e/t,r=Math.round(a);return Math.ceil(r>0&&Math.abs(a-r)<=Number.EPSILON*a*4?r:a)}function z(e){return{...e,bySource:Object.fromEntries(Object.entries(e.bySource).map(([e,t])=>[e,{...t}]))}}function G(e){let t="number"==typeof e?e:"string"==typeof e?Number(e):NaN;return Number.isFinite(t)?t:void 0}function U(e,t){let a=e.physics&&"object"==typeof e.physics?e.physics:null,r=e.settledProjection&&"object"==typeof e.settledProjection?e.settledProjection:null,n=[e.settledProjectionRows,e.projectionRows,r?.rows,a?.settledProjectionRows,a?.projectionRows,a?.settledProjection&&"object"==typeof a.settledProjection?a.settledProjection.rows:void 0].find(e=>Array.isArray(e));return Array.isArray(n)?n.map((e,a)=>{if(!e||"object"!=typeof e)return null;let r=e,n=G(r.count??r.value??r.total??r.bodies??r.events);if(null==n)return null;let l=r.label??r.id??r.name??`container ${a+1}`,i=G(r.secondary??r.secondaryCount),o=G(r.observed??r.observedCount);return{label:m(l,t),count:n,...null!=i?{secondary:i}:{},..."string"==typeof r.secondaryLabel&&r.secondaryLabel?{secondaryLabel:r.secondaryLabel}:{},...null!=o?{observed:o}:{}}}).filter(e=>null!=e):null}function W(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:`${t}s`}function H(e){return Object.prototype.hasOwnProperty.call(we,e)?we[e]:`${function(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").toLowerCase()}(e)} chart`}function V(e,t){let a=function(e){if(e){if("fits"in e||"buildProps"in e){let t=e,a={};for(let[e,r]of Object.entries(t.intentScores))"number"==typeof r&&Number.isFinite(r)&&(a[e]=r);return{family:t.family,intentScores:Object.keys(a).length?a:void 0}}return e}}(t);if(a?.act)return a.act;if(a?.intentScores){let e=function(e){let t,a=0;for(let[r,n]of Object.entries(e))if("number"==typeof n&&n>0){if(n>a){t=r,a=n;continue}if(n===a&&void 0!==t){let e=Me.indexOf(r),a=Me.indexOf(t);-1!==e&&(-1===a||e<a)&&(t=r)}}return t}(a.intentScores);if(e&&Object.prototype.hasOwnProperty.call(xe,e)&&(a.intentScores[e]??0)>=3)return xe[e]}return a?.family&&Object.prototype.hasOwnProperty.call(Se,a.family)?Se[a.family]:function(e){return"BumpChart"===e?"ranking":$e.has(e)||"StackedAreaChart"===e?"apportioning":ke.has(e)?"relating":ge.has(e)?"comparing":be.has(e)?"characterizing":pe.has(e)?"tracking":Ce.has(e)?"tracing":"BigNumber"===e?"presenting":void 0}(e)}function q(e){let t=e.annotations;return!!Array.isArray(t)&&t.some(e=>{if(!e||"object"!=typeof e)return!1;let t=e;if("string"!=typeof t.type||!Fe.has(t.type))return!1;let a=t.provenance;return!(!a||"object"!=typeof a)&&(Pe.has(a.authorKind)||De.has(a.source)||je.has(a.basis))})}function Q(e="en"){let t,a;try{t=new Intl.NumberFormat(e,{notation:"compact",maximumFractionDigits:1}),a=new Intl.NumberFormat(e,{maximumFractionDigits:2})}catch{t=new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}),a=new Intl.NumberFormat("en",{maximumFractionDigits:2})}return e=>Number.isFinite(e)?Math.abs(e)>=1e4?t.format(e):a.format(e):String(e)}function Z(e){let t="string"==typeof e.type?e.type:"annotation",a=Object.prototype.hasOwnProperty.call(Le,t)?Le[t]:"an annotation",r=function(e){let t=e.provenance&&"object"==typeof e.provenance?e.provenance:null,a=t?.authorKind??t?.source??t?.basis;return"watcher"===a?"a watcher-flagged ":"agent"===a||"ai"===a||"llm-inference"===a?"an AI-suggested ":""}(e),n=r?r+a.replace(/^an? /,""):a,l="string"==typeof e.label?e.label:"string"==typeof e.title?e.title:void 0;return l?`${n} labeled "${l}"`:n}function K(e){let t=Array.isArray(e.annotations)?e.annotations:null;if(!t||0===t.length)return;let a=f(t.filter(e=>!!e&&"object"==typeof e));if(0===a.length)return;let r=a.map(Z),n=r.slice(0,5),l=r.length-n.length,i=function(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]}`}(n)+(l>0?`, and ${l} more`:""),o=a.length;return`The author has marked ${1===o?"one feature":`${o} features`} on this chart: ${i}.`}function Y(e,t,r={}){t=o(t);let n=void 0!==r.levels,l=new Set(r.levels??["l1","l2","l3"]);!n&&(r.capability||q(t))&&l.add("l4");let i=N(e,t,r.recipe);if(i){let e=["l1","l2","l3","l4"].filter(e=>l.has(e));!n&&!e.includes("l4")&&e.push("l4");let a=function(e,t,a={}){let r=M(t),n=S(t),l=a.locale??"en",i=("function"==typeof e.description?e.description({data:r,config:n,locale:l}):void 0)?.levels??function(e,t,a,r){let n=D(e,["nominal","ordinal"]),l=D(e,["quantitative"]),i=n?F(n,a,t):void 0,o=l?F(l,a,t):void 0,c=n?.role??i??"category",u=l?.role??o??"value",h=e.encodings??[],d=h.length?h.slice(0,3).map(e=>e.meaning.replace(/\.$/,"")).join("; "):`${c} and ${u} are mapped through the recipe's declared visual semantics`,{number:m,percent:f}=function(e){try{return{number:new Intl.NumberFormat(e,{maximumFractionDigits:2}),percent:new Intl.NumberFormat(e,{style:"percent",maximumFractionDigits:1})}}catch{return{number:new Intl.NumberFormat("en",{maximumFractionDigits:2}),percent:new Intl.NumberFormat("en",{style:"percent",maximumFractionDigits:1})}}}(r),p=new Map;if(i&&o)for(let e of t){let t=g(e[i],"Uncategorized"),a=s(e[o]);Number.isFinite(a)&&p.set(t,(p.get(t)??0)+a)}let $=[...p].sort((e,t)=>t[1]-e[1]),b=$.reduce((e,[,t])=>e+t,0),v=$[0],y=$[1],w=b>0?((v?.[1]??0)+(y?.[1]??0))/b:0,C=e.intents.map(e=>({id:x(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 ${u}. ${L(d)}.`,l2:$.length>0?`${$.length} categories total ${m.format(b)}. ${v[0]} accounts for ${m.format(v[1])}${b>0?` (${f.format(v[1]/b)})`:""}${y?`, followed by ${y[0]} at ${m.format(y[1])}`:""}.`:`${t.length} data ${1===t.length?"item is":"items are"} represented.`,l3:$.length>=2?w>=.5?`Most of the total is concentrated in ${v[0]} and ${y[0]}, which together account for ${f.format(w)}.`:`The total is distributed across ${$.length} categories without the first two forming a majority.`:v?`${v[0]} is the only represented category.`:"No quantitative pattern can be derived from the available data.",l4:`The chart is intended for ${C??"explanation"}${A?` with a ${A} audience`:""}: ${e.designContract.whyCustom}`}}(e,r,n,l),o=a.levels??["l1","l2","l3","l4"],c={};for(let e of o)i[e]&&(c[e]=i[e]);let u=["l1","l2","l3","l4"].map(e=>c[e]).filter(e=>!!e).join(" "),h=a.includeCaveats?[...e.reception?.risks??[],...e.caveats??[],...(e.designContract.misuse??[]).map(e=>`Misuse: ${e}`)]:void 0;return{text:u,levels:c,...h?.length?{caveats:h}:{}}}(i,t,{levels:e,locale:r.locale,audience:r.audience,includeCaveats:r.includeCaveats}),o=K(t);return{...a,text:o?`${o} ${a.text}`.trim():a.text,...o?{annotations:o}:{}}}let c=Q(r.locale??"en"),f=H(e),p=Array.isArray(t.data)?t.data:null,$=d(t),b=Ae.has(e)?U(t,c):null,v=Ae.has(e)&&null===b?function(e,t){let a="mechanical"===(t.simulationMode??t.mode)&&("GaltonBoardChart"===e||"UnitPileChart"===e);if(!Array.isArray(t.data)&&!a)return null;let r=Array.isArray(t.data)?t.data:[],n=Math.max(2,Math.round(R(t.bins)??21)),l=Math.max(1,Math.round(R(t.pegRows)??n-1));if(a&&(r="GaltonBoardChart"===e?function(e){let t=Math.max(2,Math.round(e.bins)),a=Math.max(1,Math.round(e.pegRows??t-1)),r=Math.max(1,Math.round(e.count??Math.max(64,4*t))),n=function(e){return Math.max(0,Math.min(1,e))}(Number.isFinite(e.branchProbability)?e.branchProbability??.5:.5),l=T(e.seed??1),i=e.idPrefix??"mechanical";return Array.from({length:r},(e,t)=>{let r=0;for(let e=0;e<a;e+=1)l()<n&&(r+=1);let o=a/2;return{id:`${i}-${t}`,value:r,mechanical:!0,pegRows:a,branchProbability:n,pathRights:r,side:r<o?"left":r>o?"right":"center"}})}({bins:n,count:t.mechanicalCount,pegRows:l,branchProbability:t.branchProbability,seed:t.seed}):O({count:t.mechanicalCount,categories:t.mechanicalCategories,unitValue:t.unitValue,seed:t.seed})),r=I(r,"UnitPileChart"===e?"pile":"GaltonBoardChart"===e?"galton":"EventDropChart"===e?"event":"collision-swarm").rows,"UnitPileChart"===e){let e=new Map,n=t.valueAccessor??(a?"value":void 0);return r.forEach((a,r)=>{let l=g(B(a,r,t.categoryAccessor??"category"),"unknown"),i=n?R(B(a,r,n)):1;e.set(l,(e.get(l)??0)+Math.max(0,i??0))}),{generated:a,rows:Array.from(e,([e,t])=>({label:e,value:t}))}}if("GaltonBoardChart"===e){let e=r.map((e,a)=>R(B(e,a,t.valueAccessor??"value"))).filter(e=>null!=e),i=a?[0,l]:function(e){if(!e)return;let t=R(e[0]),a=R(e[1]);return null!=t&&null!=a?t<=a?[t,a]:[a,t]:void 0}(t.valueExtent),[o,s]=i??(e.length?me(e):[0,1]),c=o===s?1:s-o,u=Array.from({length:n},(e,t)=>({label:String(t+1),value:0}));for(let t of e)u[Math.max(0,Math.min(n-1,Math.floor((t-o)/c*n)))].value+=1;return{generated:a,rows:u}}if("CollisionSwarmChart"===e){let e=new Map;return r.forEach((a,r)=>{if(null==R(B(a,r,t.xAccessor??"x")))return;let n=t.groupAccessor?g(B(a,r,t.groupAccessor),"All"):"All";e.set(n,(e.get(n)??0)+1)}),{generated:a,rows:Array.from(e,([e,t])=>({label:e,value:t}))}}if("EventDropChart"===e){let e=R(t.windows?.size??10);if(null==e||e<=0)return null;let{events:n}=function(e){let{windowSize:t,watermark:a,watermarkAtArrivalAccessor:r}=e;if(!(Number.isFinite(t)&&t>0))throw new RangeError("EventDrop windows.size must be a finite positive number");let{rows:n}=I(e.data,"event"),l=n.flatMap((t,a)=>{let r=R(B(t,a,e.timeAccessor));return null==r?[]:[{datum:t,index:a,eventTime:r,arrivalTime:R(B(t,a,e.arrivalAccessor))??r,watermarkAtArrival:0,late:!1}]}),i="function"==typeof a?null:R(a?.value),o="function"==typeof a?t:R(a?.delay)??t,s=new ye(t,a,e.sourceIds);for(let t of l.slice().sort((e,t)=>e.arrivalTime-t.arrivalTime||e.index-t.index)){let a=r?R(B(t.datum,t.index,r)):null,n=s.append({eventTime:t.eventTime,arrivalTime:t.arrivalTime,source:String(B(t.datum,t.index,e.sourceAccessor??"source")??""),watermarkAtArrival:a??void 0});t.watermarkAtArrival=n.watermarkAtArrival,t.late=n.late}return{events:l,watermarkValue:l.length?s.getWatermark():i??-o,ledger:s.getLedger(),lifecycleEvents:s.drainEvents()}}({data:r,timeAccessor:t.timeAccessor??"time",arrivalAccessor:t.arrivalAccessor??"arrivalTime",windowSize:e,watermark:t.watermark,watermarkAtArrivalAccessor:t.watermarkAtArrivalAccessor}),l=n.map(e=>e.eventTime),[i,o]=l.length?me(l):[0,e],s=Math.min(R(t.timeExtent?.[0])??i,i),c=Math.max(R(t.timeExtent?.[1])??o,o),u=Math.floor(s/e)*e,h=Math.max(1,Math.ceil((c-u+e)/e)),d=Array.from({length:h},(t,a)=>({label:`${u+a*e}-${u+(a+1)*e}`,value:0,secondary:0,secondaryLabel:"late"}));for(let t of n){let a=d[Math.max(0,Math.min(h-1,Math.floor((t.eventTime-u)/e)))];t.late?a.secondary+=1:a.value+=1}return{generated:a,rows:d}}return null}(e,t):null,{measure:y,measureFallback:w,dimension:C,dimensionFallback:A}=h(e,t),k="string"==typeof y&&y?y:w,P="string"==typeof C&&C?C:A,j={};if(Ae.has(e)&&function(e,t,a,r,n,l,i=null){let o=function(e){return"EventDropChart"===e?"time window":"GaltonBoardChart"===e?"bin":"CollisionSwarmChart"===e?"group lane":"PacketFlowChart"===e?"flow node":"CrucibleChart"===e?"result group":"container"}(e),s=i&&"EventDropChart"===e?"accepted event":function(e){return"EventDropChart"===e?"event":"GaltonBoardChart"===e?"sample":"CollisionSwarmChart"===e?"point":"PacketFlowChart"===e?"packet":"CrucibleChart"===e?"settled item":"UnitPileChart"===e?"unit":"body"}(e),c=i?i.generated?"The generated sample projection":"The source projection":"The settled projection";if(n.has("l1")&&(r.l1=function(e,t){return"EventDropChart"===e?"An event-drop physics chart that collapses moving events into a settled projection by event-time window.":"GaltonBoardChart"===e?"A Galton board chart that collapses falling samples into a settled histogram projection.":"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.`}(e,t)),!n.has("l2")&&!n.has("l3"))return;if(!a||0===a.length)return void(n.has("l2")&&(r.l2=i?"No valid source records are available.":"No settled projection is loaded yet."));let u=a.reduce((e,t)=>e+t.count,0),h=a.filter(e=>e.count>0).sort((e,t)=>t.count-e.count),d=h[0]??a.slice().sort((e,t)=>t.count-e.count)[0];if(!d)return;let m=a.reduce((e,t)=>e+(t.secondary??0),0),f=a.find(e=>e.secondaryLabel)?.secondaryLabel??"secondary";if(n.has("l2"))if(i&&"EventDropChart"===e)r.l2=`${c} classifies ${l(u+m)} ${W(u+m,"event")} across ${a.length} ${W(a.length,o)}: ${l(u)} accepted and ${l(m)} late.`;else if(0===h.length)r.l2=`${c} contains ${l(u)} ${W(u,s)} across ${a.length} ${W(a.length,o)}; no ${W(2,o)} are non-empty yet.`;else{let e=m>0?` ${l(m)} ${W(m,s)} ${1===m?"is":"are"} marked ${f}.`:"";r.l2=`${c} contains ${l(u)} ${W(u,s)} across ${a.length} ${W(a.length,o)}; ${h.length} ${W(h.length,o)} ${1===h.length?"is":"are"} non-empty. The largest ${o} is ${d.label} with ${l(d.count)} ${W(d.count,s)}.${e}`}if(n.has("l3")&&u>0&&h.length>0){let e=h.find(e=>e!==d),t=function(e,t){if(!(t>0))return"0%";let a=e/t*100;return`${a>=10?Math.round(a):Math.round(10*a)/10}%`}(d.count,u);r.l3=e?`${c} is most concentrated in ${d.label}, which holds ${l(d.count)} ${W(d.count,s)} (${t}); ${e.label} follows with ${l(e.count)} ${W(e.count,s)}.`:`${c} is concentrated in ${d.label}, which holds all ${l(d.count)} ${W(d.count,s)}.`}}(e,f,b??(v?U({projectionRows:v.rows},c):null),j,l,c,v),l.has("l1")&&!Ae.has(e))if("BumpChart"===e)j.l1=`A ${f} ranking ${$??"series"} by ${k} across ${P}.`;else if(pe.has(e)||ge.has(e))j.l1=`A ${f} of ${k} by ${P}`+($?`, split by ${$}.`:".");else if($e.has(e))j.l1=`A ${f} showing ${k} across ${P} categories.`;else if(be.has(e))j.l1=`A ${f} of the distribution of ${k}`+($?` by ${$}.`:".");else if(Ce.has(e)){let e=Array.isArray(t.nodes)?t.nodes.length:void 0,a=Array.isArray(t.edges)?t.edges.length:void 0,r=[null!=e?`${e} ${_(e,"node")}`:null,null!=a?`${a} ${_(a,"edge")}`:null].filter(Boolean);j.l1=`A ${f}${r.length?` with ${r.join(" and ")}`:""}.`}else if("BigNumber"===e){let e="string"==typeof t.label?t.label:k;j.l1=`A single value${e?` for ${e}`:""}.`}else j.l1=`A ${f}.`;let E=pe.has(e)||"BumpChart"===e||ge.has(e)||$e.has(e)||be.has(e),z=null;if((l.has("l2")||l.has("l3")||l.has("l4"))&&E&&p&&p.length>0&&(z=function(e,t,a,r){let n=0,l=0,i=1/0,o=-1/0,s=null,c=null,u=0,h=0,d=null,f=null,p=NaN,g=NaN;for(let a of e){let e=t(a);Number.isFinite(e)&&(0===n&&(p=e,d=a),g=e,f=a,e<i&&(i=e,s=a,u=n),e>o&&(o=e,c=a,h=n),n++,l+=e)}return 0===n?null:{count:n,min:i,max:o,mean:l/n,minLabel:m(null!=s?a(s):null,r),maxLabel:m(null!=c?a(c):null,r),first:p,last:g,firstLabel:m(null!=d?a(d):null,r),lastLabel:m(null!=f?a(f):null,r),minIndex:u,maxIndex:h}}(p,u(y,w),a(C,A),c)),l.has("l2")&&E&&(p&&0!==p.length?z&&($e.has(e)?j.l2=`${z.count} segments totaling ${c(function(e){return e.mean*e.count}(z))}. Largest is ${z.maxLabel} at ${c(z.max)}; smallest is ${z.minLabel} at ${c(z.min)}.`:j.l2=`${k} ranges from ${c(z.min)} (${z.minLabel}) to ${c(z.max)} (${z.maxLabel}), with a mean of ${c(z.mean)} across ${z.count} ${_(z.count,"point")}.`):j.l2="No data is loaded yet."),l.has("l3")&&z&&!$&&pe.has(e)?j.l3=function(e,t,a){let{first:r,last:n,min:l,max:i,maxLabel:o,minLabel:s,firstLabel:c,lastLabel:u,minIndex:h,maxIndex:d,count:m}=e,f=i-l,p=n-r;if(0===f)return`${X(t)} is constant at ${a(r)} across the series.`;if(f/(Math.abs(e.mean)||1)<.04)return`${X(t)} ends roughly where it started (${a(r)} at ${c} to ${a(n)} at ${u}), ranging between ${a(l)} and ${a(i)}.`;let g=d>0&&d<m-1,$=h>0&&h<m-1,b=(i-Math.max(r,n))/f,v=(Math.min(r,n)-l)/f;return g&&b>.15?`Overall ${t} climbs to a peak of ${a(i)} (${o}), then falls to ${a(n)} (${u}).`:$&&v>.15?`Overall ${t} drops to a low of ${a(l)} (${s}), then recovers to ${a(n)} (${u}).`:Math.abs(p)/f<.05?`${X(t)} ends roughly where it started (${a(r)} at ${c} to ${a(n)} at ${u}), ranging between ${a(l)} and ${a(i)}.`:p>0?d===m-1?`Overall ${t} rises from ${a(r)} (${c}) to a peak of ${a(n)} (${u}).`:`Overall ${t} rises from ${a(r)} (${c}) to ${a(n)} (${u}), after peaking at ${a(i)} (${o}).`:h===m-1?`Overall ${t} falls from ${a(r)} (${c}) to a low of ${a(n)} (${u}).`:`Overall ${t} falls from ${a(r)} (${c}) to ${a(n)} (${u}), after dipping to ${a(l)} (${s}).`}(z,k,c):l.has("l3")&&z&&!$&&ge.has(e)&&(j.l3=`The highest ${P} is ${z.maxLabel} and the lowest is ${z.minLabel}.`),l.has("l4")){let a=q(t)?"alerting":V(e,r.capability);if(a){let n=$?null:z;j.l4=function(e,t,a,r,n,l,i,o){let s,c,u=Ne[e],h=/^[aeiou]/i.test(u)?"an":"a";switch(e){case"locating":s="This is a map",c="read values by location";break;case"presenting":s="This is a single-value display",c=`read ${"string"==typeof a.label&&a.label?a.label:n} as the headline number`;break;case"tracing":s=`This is ${h} ${u} chart`,c="follow the movement between states";break;case"nesting":s=`This is ${h} ${u} chart`,c="read it for nested structure and how children sum into their parents";break;case"relating":s=`This is ${h} ${u} chart`,c=`read it for whether ${l} and ${n} move together`;break;default:s=`This is ${h} ${u} chart`,c=function(e,t,a,r,n,l){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 ${a}`;case"comparing":return`compare ${a} across ${r}`;case"ranking":return`read it top to bottom by ${a}`;case"apportioning":return`read each ${r}'s share of the whole`;case"characterizing":return`read it for the spread and shape of ${a}`;default:return"read the highlighted features"}switch(e){case"alerting":return function(e,t,a){if(ge.has(a)||$e.has(a))return`${e.maxLabel} stands out at ${t(e.max)} — check it first`;let{first:r,last:n,min:l,max:i,minLabel:o,maxLabel:s,lastLabel:c,minIndex:u,maxIndex:h,count:d}=e,m=i-l;if(m>0){let e=h>0&&h<d-1,a=u>0&&u<d-1,f=(i-Math.max(r,n))/m,p=(Math.min(r,n)-l)/m;if(e&&f>.15)return`the peak of ${t(i)} at ${s} is the point to investigate`;if(a&&p>.15)return`the dip to ${t(l)} at ${o} is the point to investigate`;if(n>=i)return`the climb to ${t(n)} at ${c} warrants a closer look`;if(n<=l)return`the drop to ${t(n)} at ${c} warrants a closer look`}return`the extremes — ${s} (${t(i)}) and ${o} (${t(l)}) — are the points to check`}(t,n,l);case"tracking":return`read it for the trajectory of ${a}, which ${function(e){let t=e.max-e.min,a=e.last-e.first;return 0===t||Math.abs(a)/t<.05?"holds roughly steady":a>0?"rises":"falls"}(t)} from ${n(t.first)} (${t.firstLabel}) to ${n(t.last)} (${t.lastLabel})`;case"comparing":return`compare ${a} across ${r}; ${t.maxLabel} leads at ${n(t.max)}`;case"ranking":return`read it top to bottom by ${a}; ${t.maxLabel} ranks highest at ${n(t.max)}`;case"apportioning":{let e=t.mean*t.count,a=e>0?Math.round(t.max/e*100):null;return`read each ${r}'s share of the ${n(e)} total; ${t.maxLabel} is the largest at ${n(t.max)}${null!=a?` (${a}%)`:""}`}case"characterizing":return`read it for the spread of ${a}, from ${n(t.min)} to ${n(t.max)}`;default:return"read the highlighted features"}}(e,r,n,l,i,t)}return`${s}; ${c}.${function(e,t){if(!t)return"";let a=t.familiarity?.[e];return"number"==typeof a&&a<=2?` This ${H(e)} may be unfamiliar${t.name?` to ${t.name.toLowerCase()} readers`:""} — lean on this description.`:""}(t,o)}`}(a,e,t,n,k,P,c,r.audience)}}let G=["l1","l2","l3","l4"].filter(e=>l.has(e)&&j[e]).map(e=>j[e]).join(" "),Z=K(t);return{text:Z?`${Z} ${G}`.trim():G,levels:j,...Z?{annotations:Z}:{}}}function X(e){return e.length?e[0].toUpperCase()+e.slice(1):e}function _(e,t){return 1!==e&&"body"===t?"bodies":1===e?t:`${t}s`}function J(e){return b(e)}function ee(e,t,a){return`${e} ${1===e?t:a}`}function te(e,t){if(0===e.numericLeaves)return"";let a=t(e.leafTotal);return e.numericLeaves===e.leaves?`, leaf total ${a}`:`, known leaf total ${a} across ${ee(e.numericLeaves,"valued leaf","valued leaves")}`}function ae(e){return"TreeDiagram"===e?"tree":"Treemap"===e?"treemap":"CirclePack"===e?"circle-packing":"orbit"}function re(e,t,a){let r=p(e,t,a);if(void 0!==r)return r;let n=e.properties;return n&&"object"==typeof n?p(n,t,a):void 0}function ne(e,t,a){return g(re(e,t,"id")??re(e,"name","name")??re(e,"NAME","NAME")??re(e,"label","label"),a)}function le(e){let t=0,a=1/0,r=-1/0,n=0;for(let l of e)null!=l.value&&(t+=1,a=Math.min(a,l.value),r=Math.max(r,l.value),n+=l.value);return 0===t?null:{count:t,min:a,max:r,total:n,average:n/t}}function ie(e,t){let a=le(e);return a?`range ${t(a.min)} to ${t(a.max)}, average ${t(a.average)}, total ${t(a.total)}`:"no numeric values"}function oe(e,t={},a={}){return!!N(e,t,a.recipe)||Te.has(e)||Be.has(e)||Re.has(e)||pe.has(e)||ge.has(e)||$e.has(e)||be.has(e)}function se(e,t){t&&e.children?.push(t)}function ce(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function ue(e,t,n={}){t=o(t);let l=n.locale??"en",s=Math.max(1,n.maxLeaves??200),c=Q(l),w=N(e,t,n.recipe);if(w)return function(e,t,a={}){let r=M(t),n=S(t),l=Math.max(1,a.maxLeaves??200),i=a.locale??"en";if("function"==typeof e.navigation)return e.navigation({data:r,config:n,locale:i});let o=function(e){return!!e&&"object"==typeof e}(e.navigation)?e.navigation:void 0,s=(o?.groupByRole?P(e,o.groupByRole):void 0)??(o?.groupBy?.[0]?P(e,o.groupBy[0])??e.dataRoles.find(e=>e.field===o.groupBy?.[0]):void 0)??D(e,["nominal","ordinal"]),c=s?F(s,n,r):void 0,u=(o?.idRole?P(e,o.idRole):void 0)??D(e,["identifier"]),h=u?F(u,n,r):void 0,d={id:"root",role:"chart",label:o?.summaryTemplate?j(o.summaryTemplate,void 0,e,n,r,{count:r.length}):`${e.name}: ${r.length} ${1===r.length?"item":"items"} represented.`,level:1,children:[]},m=0,f=(t,a,l)=>{let i=h?t[h]:void 0,s=o?.itemLabelTemplate?j(o.itemLabelTemplate,t,e,n,r,{count:r.length}):function(e,t,a,r){let n=D(t,["nominal","ordinal"]),l=t.dataRoles.filter(e=>"quantitative"===e.semanticType),i=n?F(n,a,r):void 0,o=[];i&&null!=e[i]&&o.push(g(e[i]));for(let t of l){let n=F(t,a,r);n&&null!=e[n]&&o.push(`${t.role}: ${g(e[n])}`)}return o.length>0?o.join(", "):"Data item"}(t,e,n,r);return{id:`datum-${J(i??a)}`,role:"datum",label:s,level:l,datum:t}};if(c){let e=new Map;for(let t of r){let a=g(t[c],"Uncategorized"),r=e.get(a);r?r.push(t):e.set(a,[t])}d.children=[...e].map(([e,t],a)=>{let r=Math.max(0,l-m),n=t.slice(0,r);m+=n.length;let i=n.map((e,t)=>f(e,1e5*a+t,3));return n.length<t.length&&i.push({id:`more-${J(e)}`,role:"datum",label:`…and ${t.length-n.length} more items`,level:3}),{id:`group-${J(e)}`,role:"series",label:`${e}: ${t.length} ${1===t.length?"item":"items"}.`,level:2,children:i}})}else{let e=r.slice(0,l);d.children=e.map((e,t)=>f(e,t,2)),e.length<r.length&&d.children.push({id:"more",role:"datum",label:`…and ${r.length-e.length} more items`,level:2})}return d}(w,t,{maxLeaves:s,locale:l});let C={id:"root",role:"chart",label:Y(e,t,{locale:l}).text||"Chart.",level:1,children:[]},A=function(e,t){let a=Array.isArray(e.annotations)?e.annotations:null;if(!a)return null;let r=f(a.filter(e=>!!e&&"object"==typeof e));if(0===r.length)return null;let n=0,l=r.slice(0,t).map(e=>{let t=e.lifecycle?.status,a=t&&"accepted"!==t?` (${t})`:"";return{id:"annotation-"+n++,role:"annotation",level:3,label:`${ce(Z(e))}${a}.`,datum:e}});r.length>t&&l.push({id:"annotation-"+n++,role:"annotation",level:3,label:`…and ${r.length-t} more annotations.`});let i=r.length;return{id:"annotations",role:"annotation",level:2,label:`Annotations: ${1===i?"one marked feature":`${i} marked features`}.`,children:l}}(t,s);if(Te.has(e)){let a=function(e,t,a,r){t=o(t);let n=Array.isArray(t.nodes)?t.nodes:[],l=Array.isArray(t.edges)?t.edges:Array.isArray(t.flows)?t.flows:[],i=t.nodeIdAccessor??t.nodeIDAccessor,s=t.sourceAccessor??"source",c=t.targetAccessor??"target",u=t.valueAccessor??"value",h=e=>g(p(e,i,"id"),"unknown"),d=(e,t)=>g(p(e,t,""),"unknown"),m=new Set;for(let e of l)m.add(d(e,s)),m.add(d(e,c));let f=n.length>0?n:[...m].map(e=>({id:e})),y=new Map;for(let e of f)y.set(h(e),{links:0,value:0});for(let e of l){let t=d(e,s),a=d(e,c),r=$(p(e,u,"value"))??0;for(let e of[t,a]){let t=y.get(e)??{links:0,value:0};t.links+=1,t.value+=r,y.set(e,t)}}let w={id:"root",role:"chart",level:1,label:`A ${"SankeyDiagram"===e||"ProcessSankey"===e?"flow diagram":"ChordDiagram"===e?"chord diagram":"network graph"} with ${f.length} nodes and ${l.length} links.${v(t,"Use linked highlighting to trace related marks.")}`,children:[]},C=0,A=new Map,k=t.colorBy??"group";for(let e of f){let t=g(p(e,k,"group"),"Ungrouped"),a=A.get(t);a?a.push(e):A.set(t,[e])}let x=[...A].map(([e,t],n)=>{let l=[];for(let[e,i]of t.entries()){if(C>=a)break;C+=1;let t=h(i),o=y.get(t)??{links:0,value:0},s=o.value>0?`, ${r(o.value)} total flow`:"";l.push({id:`node-${n}-${e}-${b(t)}`,role:"datum",level:3,label:`${t}: ${o.links} ${1===o.links?"link":"links"}${s}.`,value:o.value>0?o.value:void 0,datum:i})}return{id:`nodes-${n}-${b(e)}`,role:"series",level:2,label:`${e}: ${t.length} ${1===t.length?"node":"nodes"}.`,children:l}});x.length>0&&w.children?.push(...x);let S=l.slice(0,a).map((e,t)=>{let a=d(e,s),n=d(e,c),l=$(p(e,u,"value"));return{id:`link-${b(a)}-${b(n)}-${t}`,role:"datum",level:3,label:`${a} to ${n}${null==l?"":`: ${r(l)}`}.`,value:l,datum:e}});return l.length>a&&S.push({id:"links-more",role:"datum",level:3,label:`…and ${l.length-a} more links.`,value:void 0}),S.length>0&&w.children?.push({id:"links",role:"series",level:2,label:`Links: ${l.length} ${1===l.length?"connection":"connections"}.`,children:S}),w}(e,t,s,c);return se(a,A),a}if(Be.has(e)){let a=function(e,t,a,n){let l=r(t.data)?t.data:null,i=t.childrenAccessor,o=t.valueAccessor,s=t.nodeLabel??t.nodeIdAccessor,c=new WeakMap,u=e=>{let t=c.get(e);if(void 0!==t)return t??{descendants:0,depth:0,leaves:0,numericLeaves:0,leafTotal:0};c.set(e,null);let a=y(e,i),r=0===a.length,n=r?$(p(e,o,"value")):void 0,l={descendants:0,depth:1,leaves:r?1:0,numericLeaves:null==n?0:1,leafTotal:n??0};for(let e of a){let t=u(e);l.descendants+=1+t.descendants,l.depth=Math.max(l.depth,t.depth+1),l.leaves+=t.leaves,l.numericLeaves+=t.numericLeaves,l.leafTotal+=t.leafTotal}return c.set(e,l),l},h=0,d=new WeakSet,m=(e,t,r)=>{let l=g(p(e,s,"name"),`item ${r}`);if(d.has(e))return{id:`hierarchy-${b(r)}-cycle`,role:"datum",level:t,label:`Repeated hierarchy reference to ${l}; branch omitted.`};let c=y(e,i),f=u(e);if(0===c.length){if(h>=a)return null;h+=1;let i=$(p(e,o,"value"));return{id:`hierarchy-${b(r)}-${b(l)}`,role:"datum",level:t,label:`${l}${null==i?"":`: ${n(i)}`}.`,...null==i?{}:{value:i},datum:e}}d.add(e);let v=[],w=0;for(let[e,n]of c.entries()){if(h>=a){w+=u(n).leaves;continue}let l=m(n,t+1,`${r}-${e}`);l&&v.push(l)}return d.delete(e),w>0&&v.push({id:`hierarchy-${b(r)}-more`,role:"datum",level:t+1,label:`${ee(w,"more leaf","more leaves")} in ${l} not shown; navigation is capped at ${a}.`}),{id:`hierarchy-${b(r)}-${b(l)}`,role:"series",level:t,label:`${l}: ${ee(c.length,"direct child","direct children")}, ${ee(f.descendants,"total descendant","total descendants")}, ${ee(f.leaves,"leaf","leaves")}${te(f,n)}.`,datum:e,children:v}},f=l?u(l):null,v={id:"root",role:"chart",level:1,label:l?`A ${ae(e)} chart with ${ee(f.leaves,"leaf","leaves")} and ${ee(f.descendants,"total descendant","total descendants")} across ${ee(f.depth,"hierarchy level","hierarchy levels")}${te(f,n)}.`:"A hierarchy chart with no hierarchy data loaded.",children:[]};if(l){let e=m(l,2,"root");if(e){let t=g(p(l,s,"name"),"");v.children="series"===e.role&&""===t?e.children:[e]}}return v}(e,t,s,c);return se(a,A),a}if(Re.has(e)){let a=function(e,t,a,r){let n=function(e){if(Array.isArray(e))return i(e);if(!e||"object"!=typeof e)return[];let t=e;return Array.isArray(t.features)?i(t.features):"Feature"===t.type?[t]:[]}(t.areas),l="FlowMap"===e&&Array.isArray(t.nodes)?t.nodes:Array.isArray(t.points)?t.points:[],o=Array.isArray(t.flows)?t.flows:[],s=Array.isArray(t.lines)?t.lines:[],c=t.valueAccessor??t.sizeBy??t.costAccessor??"value",u=t.pointIdAccessor??t.nodeIdAccessor??"id",h=("ChoroplethMap"===e?n:l).map((a,r)=>({datum:a,index:r,label:ne(a,"ChoroplethMap"===e?t.idAccessor:u,`${"ChoroplethMap"===e?"region":"location"} ${r+1}`),value:$(re(a,c,"value"))})),d=h.filter(e=>null!=e.value),m={id:"root",role:"chart",level:1,label:`${"ChoroplethMap"===e?`A choropleth map with ${n.length} regions.${d.length>0?` Values are available for ${d.length} of ${n.length} regions; ${ie(d,r)}.`:" No regions have numeric values."}`:"FlowMap"===e?`A flow map with ${o.length} flows and ${l.length} locations.`:"DistanceCartogram"===e?`A distance cartogram with ${l.length} locations and ${s.length} routes.`:`A proportional-symbol map with ${l.length} locations.`}${v(t,"Use linked highlighting to compare related locations.")}`,children:[]};if("ChoroplethMap"===e)m.children=function(e,t,a){let r,n=e.filter(e=>null!=e.value).sort((e,t)=>t.value-e.value||e.index-t.index),l=new Map,i=0;for(let[e,t]of n.entries())r!==t.value&&(i=e+1,r=t.value),l.set(t.index,i);let o=0;return function(e){let t=e.filter(e=>null!=e.value),a=e.filter(e=>null==e.value),r=[],n=le(t);if(n)if(n.min===n.max)r.push({id:"equal",label:"Equal values",rows:t});else{let e=n.min+(n.max-n.min)/3,a=n.min+2*(n.max-n.min)/3,l=t.filter(e=>e.value>=a),i=t.filter(t=>t.value>=e&&t.value<a),o=t.filter(t=>t.value<e);l.length>0&&r.push({id:"highest",label:"Highest values",rows:l}),i.length>0&&r.push({id:"middle",label:"Middle values",rows:i}),o.length>0&&r.push({id:"lowest",label:"Lowest values",rows:o})}return a.length>0&&r.push({id:"missing",label:"No numeric value",rows:a}),r}(e).map(e=>{let r=Math.max(0,t-o),i=e.rows.slice(0,r);o+=i.length;let s=i.map(e=>{let t=l.get(e.index),r=null==t||n.length<2?"":`, rank ${t} of ${n.length}`;return{id:`geo-${b(e.label)}-${e.index}`,role:"datum",level:3,label:null==e.value?`${e.label}: no numeric value.`:`${e.label}: ${a(e.value)}${r}.`,...null==e.value?{}:{value:e.value},datum:e.datum}}),c=e.rows.length-i.length;return c>0&&s.push({id:`geo-${e.id}-more`,role:"datum",level:3,label:`${c} more ${1===c?"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"}, ${ie(e.rows,a)}.`,children:s}})}(h,a,r);else if(h.length>0){let e=h.slice(0,a).map(e=>({id:`geo-${b(e.label)}-${e.index}`,role:"datum",level:3,label:`${e.label}${null==e.value?"":`: ${r(e.value)}`}.`,...null==e.value?{}:{value:e.value},datum:e.datum}));h.length>a&&e.push({id:"geo-more",role:"datum",level:3,label:`…and ${h.length-a} more locations.`}),m.children?.push({id:"locations",role:"series",level:2,label:`Locations: ${h.length} marks.`,children:e})}let f="FlowMap"===e?o:s;if(f.length>0){let e=f.slice(0,a).map((e,t)=>{let a=g(e.source,"unknown"),n=g(e.target,"unknown"),l=$(p(e,c,"value"));return{id:`route-${b(a)}-${b(n)}-${t}`,role:"datum",level:3,label:`${a} to ${n}${null==l?"":`: ${r(l)}`}.`,...null==l?{}:{value:l},datum:e}});m.children?.push({id:"routes",role:"series",level:2,label:`Routes: ${f.length} ${1===f.length?"route":"routes"}.`,children:e})}return m}(e,t,s,c);return se(a,A),a}let k=Array.isArray(t.data)?t.data:null,x=oe(e,t,n);if(!k||0===k.length||!x)return A&&(C.children=[A]),C;let{measure:L,measureFallback:T,dimension:B,dimensionFallback:R}=h(e,t),I=u(L,T),O=a(B,R),E="string"==typeof L&&L?L:T,z="string"==typeof B&&B?B:R,G=d(t),U=0,W=e=>`${e}-${U++}`,H=(e,t)=>{let a=e.slice(0,s).map(e=>((e,t)=>{let a=I(e),r=m(O(e),c);return{id:W("datum"),role:"datum",level:t,label:`${r}: ${Number.isFinite(a)?c(a):"—"}`,value:Number.isFinite(a)?a:void 0,datum:e}})(e,t));return e.length>s&&a.push({id:W("more"),role:"datum",level:t,label:`…and ${e.length-s} more points`}),a},V=[];if(pe.has(e)||ge.has(e)){let t=1/0,a=-1/0,r=1/0,n=-1/0,l=[],i=!0;for(let e of k){let o=I(e);Number.isFinite(o)&&(o<t&&(t=o),o>a&&(a=o));let s=O(e);l.push(s),"number"==typeof s&&Number.isFinite(s)?(s<r&&(r=s),s>n&&(n=s)):i=!1}let o=new Set,s=[];for(let e of l){let t=g(e);o.has(t)||(o.add(t),s.push(e))}let u=i?`${c(r)} to ${c(n)}`:`${m(s[0],c)} to ${m(s[s.length-1],c)} (${ge.has(e)?`${s.length} categories`:`${k.length} points`})`;V.push({id:W("axis"),role:"axis",level:2,label:`${ge.has(e)?"Category axis":"X axis"}: ${z}, ${u}.`}),a>=t&&V.push({id:W("axis"),role:"axis",level:2,label:`Value axis: ${E}, ${c(t)} to ${c(a)}.`})}if(G){let r=a(G,G),n=new Map;for(let e of k){let t=g(r(e)),a=n.get(t);a?a.push(e):n.set(t,[e])}let i=[];for(let[a,r]of n){let n=Y(e,{...t,data:r},{levels:["l2","l3"],locale:l}).text;i.push({id:W("series"),role:"series",level:2,label:`Series ${a}: ${n}`,children:H(r,3)})}C.children=[...V,...i]}else C.children=[...V,...H(k,2)];return A&&C.children.push(A),C}function he(e){return Oe.has(e)}function de(e,t){return he(e)&&!Ee[t].includes(e)}import{a as me}from"./c-5H6IMPPV.min.js";var fe=/^(\d{4})-(\d{1,2})(?:-(\d{1,2}))?$/,pe=/*#__PURE__*/new Set(["LineChart","AreaChart","StackedAreaChart","DifferenceChart","Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","MultiAxisLineChart","MinimapChart"]),ge=/*#__PURE__*/new Set(["BarChart","StackedBarChart","GroupedBarChart","DotPlot"]),$e=/*#__PURE__*/new Set(["PieChart","DonutChart","FunnelChart"]),be=/*#__PURE__*/new Set(["Histogram","BoxPlot","ViolinPlot","RidgelinePlot","SwarmPlot"]),ve=/*#__PURE__*/Symbol.for("semiotic.chartRecipeRegistry"),ye=class{constructor(e,t={},a=[]){if(this.windowSize=e,this.policy=t,this.windows=new Map,this.openWindows=new Set,this.sources=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(let e of a)this.sources.set(e,{latest:-1/0,arrival:-1/0,idle:!1});this.validatePolicy(t)}validatePolicy(e){if("function"!=typeof e){for(let t of["delay","idleTimeout","allowedLateness"]){let a=e[t];if(null!=a&&(!Number.isFinite(a)||a<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(),z).sort((e,t)=>e.start-t.start)}drainEvents(){let e=this.pending;return this.pending=[],e}snapshot(){return this.state(this.getLedger())}drainDelta(){let e=Array.from(this.changedWindows??[],e=>z(this.windows.get(e)));return this.changedWindows=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){let a=e=>Number.isFinite(e)||e===-1/0,r=e=>Number.isSafeInteger(e)&&e>=0;if(![e.latest,e.frontier,e.value].every(a)||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])=>!a(e.latest)||!a(e.arrival))||e.windows.some(e=>!Number.isFinite(e.start)||!Number.isFinite(e.end)||e.end<=e.start||!r(e.accepted)||!r(e.late)||Object.values(e.bySource).some(e=>!r(e.accepted)||!r(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(let t of e.windows){let e=this.windows.get(t.windowId);e&&this.openWindows.delete(e);let a=z(t);Object.setPrototypeOf(a.bySource,null),this.windows.set(t.windowId,a),a.open&&this.openWindows.add(a)}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);let a,r=this.policy;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(let[n,l]of this.sources){Number.isFinite(l.arrival)||(l.arrival=e);let i=null!=r.idleTimeout&&e-l.arrival>=r.idleTimeout;i&&!l.idle&&this.pending.push({type:"physics-source-idle",sourceId:n}),l.idle=i,!i&&l.latest<t&&(t=l.latest,a=n)}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;let n=this.value;this.value=a,this.pending.push({type:"physics-watermark-advance",from:n,to:a,cause:t});for(let 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",...z(e),watermark:this.value})}append(e){var t;let{eventTime:a,arrivalTime:r,source:n=""}=e;if(!Number.isFinite(a)||!Number.isFinite(r))throw new RangeError("Event and arrival times must be finite");if(r<this.frontier)throw new RangeError("Incremental admissions require nondecreasing arrival times");this.latest=Math.max(this.latest,a);let l=this.sources.get(n);this.sources.set(n,{latest:Math.max(l?.latest??-1/0,a),arrival:r,idle:!1}),this.advance(r,"arrival");let i=Math.floor(a/this.windowSize)*this.windowSize,o=i+this.windowSize,s=`${i}-${o}`,c=this.windows.get(s);c||(c={windowId:s,start:i,end:o,accepted:0,late:0,bySource:Object.create(null),open:!0},this.windows.set(s,c),this.openWindows.add(c),this.pending.push({type:"physics-window-open",windowId:s,start:i,end:o}));let u=e.watermarkAtArrival??this.value,h=o+("function"==typeof this.policy?0:this.policy.allowedLateness??0)<=u,d=(t=c.bySource)[n]??(t[n]={accepted:0,late:0}),m=h?"late":"accepted";return c[m]++,this.changedWindows?.add(s),d[m]++,!c.open&&!h&&this.pending.push({type:"physics-window-update",windowId:s,accepted:c.accepted,late:c.late,bySource:z(c).bySource,watermark:this.value,retractions:1}),c.open&&o<=this.value&&this.close(c,r),{windowId:s,start:i,end:o,late:h,watermarkAtArrival:u}}},we={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"},Ce=/*#__PURE__*/new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]),Ae=/*#__PURE__*/new Set(["StreamPhysicsFrame","EventDropChart","GaltonBoardChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart","PhysicsCustomChart"]),ke=/*#__PURE__*/new Set(["Scatterplot","BubbleChart","ConnectedScatterplot","QuadrantChart","ScatterplotMatrix"]),xe={"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"},Se={"time-series":"tracking",categorical:"comparing",distribution:"characterizing",relationship:"relating",flow:"tracing",network:"tracing",hierarchy:"nesting",geo:"locating",realtime:"tracking",value:"presenting",custom:"presenting"},Me=["trend","compare-series","compare-categories","rank","part-to-whole","distribution","correlation","flow","hierarchy","geo","composition-over-time","change-detection","outlier-detection"],Ne={alerting:"alerting",tracking:"trend",comparing:"comparison",ranking:"ranking",apportioning:"composition",characterizing:"distribution",relating:"correlation",tracing:"flow",nesting:"hierarchy",locating:"locator",presenting:"single-value"},Fe=/*#__PURE__*/new Set(["y-threshold","x-threshold","band","x-band","callout","label"]),Pe=/*#__PURE__*/new Set(["system","agent","watcher"]),De=/*#__PURE__*/new Set(["ai","agent","system","computed","dbt","great-expectations"]),je=/*#__PURE__*/new Set(["rule","statistical-test","llm-inference","computed"]),Le={"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"},Te=/*#__PURE__*/new Set(["ForceDirectedGraph","SankeyDiagram","ProcessSankey","ChordDiagram"]),Be=/*#__PURE__*/new Set(["TreeDiagram","Treemap","CirclePack","OrbitDiagram"]),Re=/*#__PURE__*/new Set(["ChoroplethMap","ProportionalSymbolMap","FlowMap","DistanceCartogram"]),Ie=["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"],Oe=/*#__PURE__*/new Set(Ie),Ee={title:["BigNumber"],description:[],summary:[]};export{r as a,n as b,l as c,o as d,e,t as f,g,y as h,C as i,A as j,k,x as l,R as m,I as n,O as o,E as p,V as q,Y as r,oe as s,ue as t,Ie as u,he as v,de as w};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{a as registerBuiltInXYPlugins}from"./c-AQUX6L2O.min.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(){x(S),x(k),x(w)}function t(e){let{colorBy:t,colorScale:o,color:r,pointRadius:a=5,radiusFn:i,fillOpacity:n=1,fallbackFill:s,baseStyleExtras:l,stroke:c,strokeWidth:u,opacity:f,effectiveSelectionHook:m,resolvedSelection:p,colorDatumAccessor:y,selectionDatumAccessor:d,styleRules:h,ruleContext:g}=e,v=U(()=>e=>{let c="function"==typeof l?l(e):l,u=c?{...c}:{};if(void 0===u.fillOpacity&&(u.fillOpacity=n),void 0===u.fill)if(t){if(o){let r=y?y(e):e;u.fill=Y(r,t,o)}}else u.fill=s?s(e):r||$;return void 0===u.r&&(u.r=i?i(e):a),h&&h.length>0&&Object.assign(u,j(e,h,g?g(e):{value:void 0})),u},[t,o,r,a,i,n,s,l,y,h,g]),b=U(()=>C(v,{stroke:c,strokeWidth:u,opacity:f}),[v,c,u,f]);return U(()=>X(b,m??null,p,d),[b,m,p,d])}function o(e){let{lineWidth:t=2,colorBy:o,colorScale:r,color:a,resolveStroke:i,fillArea:n,areaOpacity:s=.3,stroke:l,strokeWidth:c,opacity:u,effectiveSelectionHook:f,resolvedSelection:m,styleRules:p,ruleContext:y}=e,d=U(()=>function(e){let{lineWidth:t=2,colorBy:o,colorScale:r,color:a,resolveStroke:i,fillArea:n,areaOpacity:s=.3,styleRules:l,ruleContext:c}=e;return(e,u)=>{let f,m={strokeWidth:t},p=!0===n||Array.isArray(n)&&null!=u&&n.includes(u);return i?f=i(e,u):o?r&&(f=Y(e,o,r)):f=a||$,void 0!==f&&(m.stroke=f,p&&(m.fill=f,m.fillOpacity=s)),l?.length&&Object.assign(m,j(e,l,c?c(e,u):{value:void 0,category:u})),m}}({lineWidth:t,colorBy:o,colorScale:r,color:a,resolveStroke:i,fillArea:n,areaOpacity:s,styleRules:p,ruleContext:y}),[t,o,r,a,i,n,s,p,y]),h=U(()=>C(d,{stroke:l,strokeWidth:c,opacity:u}),[d,l,c,u]);return U(()=>X(h,f??null,m),[h,f,m])}async function r(){return l||(l=await(import("./c-PX2XTYMN.min.js"))),l}function a(e){let{data:t,xAccessor:o,yAccessor:a,groupBy:i}=e,n=H(e.forecast),s=H(e.anomaly),l="string"==typeof o?o:u,m="string"==typeof a?a:f,p=U(()=>{if(!n&&!s)return t;let e="function"==typeof o,r="function"==typeof a;return e||r?t.map(t=>{let i={...t};return e&&(i[u]=o(t)),r&&(i[f]=a(t)),i}):t},[t,n,s,o,a]),y=U(()=>({overlayData:p,forecast:n,anomaly:s,xAccessorKey:l,yAccessorKey:m,groupBy:i}),[p,n,s,l,m,i]),[d,h]=V(null);q(()=>{if(!n&&!s)return void h(null);let e=!1;return(n?async function(...e){return(await r()).buildForecast(...e)}(p,l,m,i?{...n,_groupBy:i}:n,s):async function(...e){return(await r()).buildAnomalyAnnotations(...e)}(s).then(e=>({processedData:p,annotations:e}))).then(t=>{e||h({request:y,result:t,hasForecast:!!n})}).catch(t=>{e||("production"!==process.env.NODE_ENV&&console.warn("[Semiotic] Unable to compute statistical overlays:",t),h(null))}),()=>{e=!0}},[y,p,n,s,l,m,i]);let g=d?.request===y?d:null;return{effectiveData:g?.result.processedData??t,statisticalAnnotations:g?.result.annotations??c,hasForecast:g?.hasForecast??!1,xAccessorKey:l,yAccessorKey:m}}function i(e,t){if(!t)return e;let o=new Set(e),r=[];for(let[e,a]of t.seriesOf)o.has(a)&&r.push(e);return r}function n(e,t){if(!t)return e;let o=e.tooltipContent,r=e=>{let r=e?.allSeries;return Array.isArray(r)?o({...e,allSeries:r.map(e=>({...e,group:t.seriesOf.get(e.group)??e.group}))}):o(e)};return{...e,tooltipContent:z(o)?J(r):r}}import{e as d}from"./c-YSMCBJOI.min.js";import{c as h,b as g}from"./c-C3YQVUB6.min.js";import{a as v,g as b,f as A}from"./c-LEICSI5V.min.js";import{e as x,j as S,l as k,m as w}from"./c-ZWJDTDEV.min.js";import{j as L}from"./c-ZYMXDR42.min.js";import{S as C,I as D,F as B,H as O,Q as R}from"./c-W5ATXREF.min.js";import{bN as j,am as H,aX as _,bH as F,r as G,b as P,bb as W,v as N,bJ as I,aO as T,aQ as E,aY as M,a$ as K}from"./c-SU6Z75M2.min.js";import{f as X}from"./c-KLJDKRD5.min.js";import{r as Y,n as $}from"./c-WPL6PGP3.min.js";import{z,y as J}from"./c-TC47SNSI.min.js";import{d as Q}from"./c-5PCO2P5Q.min.js";import{useMemo as U,useState as V,useEffect as q,forwardRef as Z,useRef as ee,useCallback as te}from"react";import{jsx as oe}from"react/jsx-runtime";var s="__forecastSegment",l=null,c=[],u="__semiotic_resolvedX",f="__semiotic_resolvedY",m="__lineObjectSeries",p=e=>e.parentLine||e,y=/*#__PURE__*/_(/*#__PURE__*/Z(function(l,c){e();let u=ee(null);h(c,{variant:"xy",frameRef:u});let f=F(l.mode,{width:l.width,height:l.height,showAxes:l.showAxes,showGrid:l.showGrid,enableHover:l.enableHover,showLegend:l.showLegend,title:l.title,description:l.description,summary:l.summary,accessibleTable:l.accessibleTable,xLabel:l.xLabel,yLabel:l.yLabel,mobileInteraction:l.mobileInteraction,mobileSemantics:l.mobileSemantics,responsiveRules:l.responsiveRules}),{data:y,margin:x,className:S,xFormat:k,yFormat:w,axisExtent:C,xAccessor:j="x",yAccessor:H="y",lineBy:_,lineDataAccessor:X="coordinates",colorBy:Y,colorScheme:z,styleRules:J,curve:Z="linear",showPoints:re=!1,pointRadius:ae=3,fillArea:ie=!1,areaOpacity:ne=.3,lineWidth:se=2,lineGradient:le,tooltip:ce,pointIdAccessor:ue,annotations:fe,directLabel:me,gapStrategy:pe="break",anomaly:ye,forecast:de,band:he,xExtent:ge,yExtent:ve,frameProps:be={},selection:Ae,linkedHover:xe,linkedBrush:Se,brush:ke,onBrush:we,onObservation:Le,onClick:Ce,hoverHighlight:De,hoverRadius:Be,chartId:Oe,loading:Re,loadingContent:je,emptyContent:He,legendInteraction:_e,legendPosition:Fe,legend:Ge,xScaleType:Pe,yScaleType:We,color:Ne,stroke:Ie,strokeWidth:Te,opacity:Ee}=l,{legend:Me,...Ke}=be,Xe=U(()=>G(Me,Ge),[Me,Ge]),{width:Ye,height:$e,enableHover:ze,showGrid:Je,showLegend:Qe,title:Ue,description:Ve,summary:qe,accessibleTable:Ze,xLabel:et,yLabel:tt}=f,ot=U(()=>P(y),[y]),rt=Array.isArray(ot[0]?.[X])?ot[0][X]:ot;W("LineChart",rt,"xAccessor",j),W("LineChart",rt,"yAccessor",H);let{effectiveData:at,statisticalAnnotations:it,hasForecast:nt,xAccessorKey:st,yAccessorKey:lt}=a({data:ot,xAccessor:j,yAccessor:H,forecast:de,anomaly:ye,groupBy:_}),ct=nt?st:j,ut=nt?lt:H,ft="__compoundGroup",mt=!(!de||!_),pt=mt?ft:de?s:_,yt=U(()=>{if(!mt)return at;let e="function"==typeof _?_:e=>e[_];return at.map(t=>{let o={...t};return o[ft]=`${e(t)}__${t[s]||"observed"}`,o})},[at,mt,_]),dt=mt?yt:at,ht=Y||_,gt=U(()=>function(e,t,o){if(!o)return;let r=[t,o.upperBounds??"__forecastUpper",o.lowerBounds??"__forecastLower"].map(e=>"function"==typeof e?e:t=>t[e]),a=!(!o.upperBounds&&!o.lowerBounds),i=1/0,n=-1/0;for(let t of e){let e=r[1](t),o=r[2](t);(null!=e||null!=o)&&(a=!0);for(let a of[Number(r[0](t)),e,o])"number"==typeof a&&Number.isFinite(a)&&(i=Math.min(i,a),n=Math.max(n,a))}return a&&i<=n?[i,n]:void 0}(at,ut,de),[de,at,ut]),vt=te(e=>{let t="function"==typeof ct?ct(e):e[ct],o="function"==typeof ut?ut(e):e[ut];return null==t||null==o||Number.isNaN(t)||Number.isNaN(o)},[ct,ut]),bt=void 0!==dt[0]?.[X],At=bt?m:pt,xt=U(()=>{if(bt)return dt.map((e,t)=>{let o="function"==typeof _?_(e):"string"==typeof _?e[_]:void 0,r=null==o?`line-${t}`:String(o),a=Array.isArray(e[X])?e[X]:[];return{...e,[m]:r,[X]:a.map(t=>({...t,[m]:r,parentLine:e,..."string"==typeof _&&void 0!==e[_]?{[_]:e[_]}:{}}))}});if(pt){let e=dt.reduce((e,t)=>{let o="function"==typeof pt?pt(t):t[pt];if(!e[o]){let r={[X]:[]};"string"==typeof pt&&(r[pt]=o),mt&&(r[s]=t[s],"string"==typeof _&&(r[_]=t[_])),e[o]=r}return e[o][X].push(t),e},{});return Object.values(e)}return[{[X]:dt}]},[bt,pt,X,dt,_,mt]),{lines:St,hasGaps:kt,segments:wt}=U(()=>function({lineData:e,strategy:t,lineDataAccessor:o,isGap:r,yField:a,seriesOfLine:i}){let n=e=>e[o]||[];if("interpolate"===t){let t=!1,a=[];for(let i of e){let e=n(i).filter(e=>!r(e)||(t=!0,!1));e.length>0&&a.push({...i,[o]:e})}return{lines:a,hasGaps:t}}if("zero"===t){let t=!1;return{lines:e.map(e=>({...e,[o]:n(e).map(e=>r(e)?(t=!0,{...e,[a]:0}):e)})),hasGaps:t}}if(!e.some(e=>n(e).some(r)))return{lines:e,hasGaps:!1};let s=[],l=new WeakMap,c=new Map;return e.forEach((e,t)=>{let a=i(e),u=[],f=0,m=()=>{if(0===u.length)return;let r={...e,[o]:u},i=`seg:${t}:${f}`;l.set(r,i),c.set(i,a),s.push(r),u=[],f++};for(let t of n(e))r(t)?m():u.push(t);m()}),{lines:s,hasGaps:!0,segments:{keyOf:l,seriesOf:c}}}({lineData:xt,strategy:pe,lineDataAccessor:X,isGap:vt,yField:"string"==typeof ut?ut:"y",seriesOfLine:e=>{if(!At)return"";if("string"==typeof At){let t=e[At];return null==t?"":String(t)}let t=e[X]?.[0],o=t?At(t):void 0;return null==o?"":String(o)}}),[xt,pe,X,vt,At,ut]),Lt="object"==typeof me?me:{},Ct=Lt.position||"end",Dt=Lt.fontSize||11,Bt=(!me||void 0!==Qe)&&Qe,Ot=g({responsive:l,data:at,rawData:y,colorBy:ht,colorScheme:z,legendInteraction:_e,legendPosition:Fe,frameLegend:Ke,selection:Ae,linkedHover:xe,fallbackFields:ht?["string"==typeof ht?ht:""]:[],unwrapData:!1,onObservation:Le,onClick:Ce,hoverHighlight:De,mobileInteraction:f.mobileInteraction,mobileSemantics:f.mobileSemantics,chartType:"LineChart",chartId:Oe,showLegend:Bt,legend:Xe,userMargin:x,marginDefaults:f.marginDefaults,loading:Re,loadingContent:je,emptyContent:He,width:Ye,height:$e,hasTitle:!!Ue,axisChrome:N(be,{showAxes:f.showAxes,xLabel:et,yLabel:tt})}),Rt=Ot.categoryColorScale,jt=Ot.effectiveSelectionHook,Ht=Ot.resolvedSelection,_t=Ot.customHoverBehavior,Ft=Ot.customClickBehavior,Gt=Ot.crosshairProps,Pt=U(()=>{if(ht)return bt?e=>{let t=e.parentLine||e;return"function"==typeof ht?ht(t):t[ht]}:ht},[ht,bt]),Wt=U(()=>I(ct,ut),[ct,ut]),Nt=o({lineWidth:se,colorBy:Pt,colorScale:Rt,color:Ne,fillArea:ie,areaOpacity:ne,stroke:Ie,strokeWidth:Te,opacity:Ee,effectiveSelectionHook:jt,resolvedSelection:Ht,styleRules:J,ruleContext:Wt}),[It,Tt]=V(null);q(()=>{if(!de)return void Tt(null);let e=!1;return async function(...e){return(await r()).createSegmentLineStyle(...e)}(Nt,de).then(t=>{e||Tt(()=>t)}).catch(()=>{e||Tt(null)}),()=>{e=!0}},[Nt,de]);let Et=It||Nt,Mt=t({colorBy:ht,colorScale:Rt,color:Ne,pointRadius:ae,colorDatumAccessor:p,selectionDatumAccessor:Q,effectiveSelectionHook:jt,resolvedSelection:Ht}),Kt=Array.isArray(ie)?"mixed":ie?"area":"line",Xt=U(()=>{if(!me||!ht)return[];let e={position:Ct,fontSize:Dt,colorBy:ht,color:e=>Rt?.(e)??$};return void 0===y?[{type:"text",_directLabelRequest:e}]:v(St.flatMap(e=>(e[X]||[]).map(t=>({...t,parentLine:t.parentLine||e}))),e,ct,ut)},[y,me,ht,Rt,St,X,ct,ut,Ct,Dt]),Yt=U(()=>{if(!me)return Ot.margin;let e="end"===Ct?"right":"left";if("number"==typeof x||"number"==typeof x?.[e])return Ot.margin;let t=(void 0===y?Ot.allCategories:Xt.map(e=>String(e.label))).reduce((e,t)=>Math.max(e,Array.from(t).length*Dt*.65),0);return{...Ot.margin,[e]:Math.max(Ot.margin[e],t+10)}},[y,me,Xt,Ct,Dt,x,Ot.margin,Ot.allCategories]),$t=_||Y,zt=U(()=>D([{label:et||B(j),accessor:ct,role:"x",format:k},{label:tt||B(H),accessor:ut,role:"y",format:w},...$t?[{label:B($t),accessor:$t,role:"group"}]:[],...O(he,w)]),[ct,ut,j,H,et,tt,$t,k,w,he]),Jt=bt?at[0]?.[X]||[]:y,Qt=d({componentName:"LineChart",data:Jt,accessors:{xAccessor:j,yAccessor:H}}),{brushStreamProps:Ut}=b({brush:ke,onBrush:we,linkedBrush:Se,xAccessor:ct,yAccessor:ut,defaultDimension:"x"}),{flattenedData:Vt,segmentGroupAccessor:qt}=U(()=>{if(!(bt||At||kt))return{flattenedData:dt,segmentGroupAccessor:void 0};let e=wt?new WeakMap:void 0;return{flattenedData:St.flatMap(t=>{let o=t[X]||[],r=At&&"string"==typeof At?o.map(e=>({...e,[At]:e[At]??t[At]})):o,a=wt?.keyOf.get(t);if(e&&void 0!==a)for(let t of r)e.set(t,a);return r}),segmentGroupAccessor:e?t=>e.get(t)??"":void 0}},[St,X,bt,At,dt,kt,wt]),Zt=U(()=>function(e,t){return t?(o,r)=>e(o,void 0===r?r:t.seriesOf.get(r)??r):e}(Et,wt),[Et,wt]),eo=L(le),to={chartType:Kt,...Array.isArray(ie)&&{areaGroups:i(ie,wt)},...eo&&{lineGradient:eo},...null!=y&&{data:Vt},xAccessor:ct,yAccessor:ut,xScaleType:Pe,yScaleType:We,...ge&&{xExtent:ge},...!ve||null==ve[0]&&null==ve[1]?gt?{yExtent:gt}:{}:{yExtent:ve},groupAccessor:qt??(At||void 0),...he&&{band:he},curve:Z,lineStyle:Zt,...re&&{pointStyle:Mt},size:[Ye,$e],responsiveWidth:l.responsiveWidth,responsiveHeight:l.responsiveHeight,...void 0!==l.maxDevicePixelRatio&&{maxDevicePixelRatio:l.maxDevicePixelRatio},margin:Yt,showAxes:f.showAxes,xLabel:et,yLabel:tt,xFormat:k,yFormat:w,...void 0!==C&&{axisExtent:C},...void 0!==l.autoPlaceAnnotations&&{autoPlaceAnnotations:l.autoPlaceAnnotations},enableHover:ze,showGrid:Je,...Ot.legendBehaviorProps,...Ue&&{title:Ue},...Ve&&{description:Ve},...qe&&{summary:qe},...void 0!==Ze&&{accessibleTable:Ze},...S&&{className:S},...null!=l.animate&&{animate:l.animate},...n(T({tooltip:ce,defaultTooltipContent:zt,multiDefaultContent:E({xFormat:k,yFormat:w})}),wt),...R({linkedHover:xe,selection:Ae,onObservation:Le,onClick:Ce,hoverRadius:Be,hoverHighlight:De,mobileInteraction:Ot.mobileInteraction,customHoverBehavior:_t,customClickBehavior:Ft}),...ue&&{pointIdAccessor:ue},...(fe?.length||it.length||Xt.length)&&{annotations:[...fe||[],...it,...Xt]},...Gt,...Ut,...Ke};return Ot.earlyReturn?Ot.earlyReturn:Qt?oe(M,{componentName:"LineChart",message:Qt,width:Ye,height:$e}):oe(K,{componentName:"LineChart",width:Ye,height:$e,children:oe(A,{ref:u,...to})})}),"LineChart");export{t as a,a as b,e as c,o as d,y as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a({scene:a,sceneRevision:d,chartType:h,revealRows:u}){let[g,f]=o.useState(5),y=d??a,{allRows:j,summary:b}=o.useMemo(()=>{let s=n(a);return{allRows:s,summary:e(s.length,t(s))}},[y]),w=Math.min(g,j.length),x=j.length-w;return m(c,{children:[p("div",{className:"semiotic-accessible-data-table-summary",role:"note",style:i,children:b}),p(s,{rows:j.slice(0,w),label:`Sample data for ${h}`,typeLabel:"type",caption:x>0?`First ${w} of ${l(j.length,"data point","data points")}`:`All ${l(j.length,"data point","data points")}`}),p(r,{remaining:x,onClick:a=>{u(a.currentTarget,w,Math.min(w+25,j.length),j.length),f(a=>a+25)},kind:"row"})]})}import{c as e,b as t,d as s}from"./c-SQQZPFVY.min.js";import{a as r}from"./c-ISHYKYII.min.js";import{e as n,k as i,r as l}from"./c-7UN2WUMI.min.js";import*as o from"react";import{jsxs as m,Fragment as c,jsx as p}from"react/jsx-runtime";export{a as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,p as t,n,o as a,m as l}from"./c-7UN2WUMI.min.js";import{jsxs as r,jsx as i}from"react/jsx-runtime";var s=e=>{if(null==e)return"";let t=Math.round(100*e)/100;return Number.isNaN(t)?"":String(t)};function o(e){return null==e||""===e?"—":"number"==typeof e?Number.isNaN(e)?"—":s(e):"boolean"==typeof e?e?"true":"false":"object"==typeof e?"—":String(e)}function u(e){let t=new Map;for(let n of e??[])for(let[e,a]of Object.entries(n?.values??{})){if(null==a||""===a)continue;let n=t.get(e);if(n||(n={count:0,min:1/0,max:-1/0,sum:0,strings:new Set},t.set(e,n)),"number"==typeof a){if(!Number.isFinite(a))continue;n.count++,n.sum+=a,a<n.min&&(n.min=a),a>n.max&&(n.max=a)}else"object"!=typeof a&&"function"!=typeof a&&n.strings.add(String(a))}return Array.from(t,([e,t])=>{if(t.count)return{name:e,count:t.count,numeric:!0,min:t.min,max:t.max,mean:t.sum/t.count};let n=Array.from(t.strings);return{name:e,count:n.length,numeric:!1,uniqueValues:n.slice(0,5)}}).filter(e=>e.count>0)}function m(t,n){let a=[`${e(t,"data point","data points")}.`];for(let e of n)if(e.numeric)a.push(`${e.name}: ${s(e.min)} to ${s(e.max)}, mean ${s(e.mean)}.`);else{let t=e.uniqueValues,n=t.length<=3?t.join(", "):`${t.slice(0,3).join(", ")}… (${e.count} unique)`;a.push(`${e.name}: ${n}.`)}return a.join(" ")}function c({rows:e,label:s,caption:u,typeLabel:m,labelRows:c=!1,className:f="semiotic-accessible-data-table-table",style:b,extraColumns:d=[]}){let p=Array.from(new Set(e.flatMap(e=>Object.keys(e.values))));return r("table",{className:f,role:"table","aria-label":s,style:b??l,children:[i("caption",{className:"semiotic-accessible-data-table-caption",style:t,children:u}),i("thead",{children:i("tr",{children:[m,...p,...d.map(e=>e.label)].map((e,t)=>i("th",{style:n,children:e},t))})}),i("tbody",{children:e.map((e,t)=>r("tr",{tabIndex:-1,"aria-label":c?e.label:void 0,children:[i("td",{style:a,children:e.label}),p.map(t=>i("td",{style:a,children:o(e.values[t])},t)),d.map((e,n)=>i("td",{style:a,children:o(e.values[t])},n))]},t))})]})}export{s as a,u as b,m as c,c as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,t,n={}){if(!Number.isFinite(t)||t<=0||Number.isNaN(e))return"fresh";if(e===1/0)return"expired";if(e<0)return"fresh";let i=n.fresh??ao.fresh,r=n.aging??ao.aging,o=n.stale??ao.stale;return e<t*i?"fresh":e<t*r?"aging":e<t*o?"stale":"expired"}function t(e,t,n){if(null!=e)return"function"==typeof e?e(t,n):"object"==typeof e&&null!==e&&"constant"in e?e.constant:t[e]}function n(e){let{data:n,encoding:i}=e,r=[],o=new Map;return n.forEach((e,n)=>{let l=t(i.id,e,n);if(null==l||""===l)throw new Error(`[semiotic] Motion encoding row ${n} resolved an empty id.`);let a=String(l);if(o.has(a))throw new Error(`[semiotic] Duplicate motion encoding id "${a}".`);let s=t(i.process?.group,e,n),u=t(i.process?.stage,e,n),c=t(i.accessible?.group,e,n)??(null!=s?String(s):null!=u?String(u):void 0),d={};for(let r of Object.keys(i.evidence??{}))d[r]=t(i.evidence?.[r],e,n);let h={id:a,datum:e,time:{arrival:t(i.time?.arrival,e,n),basis:i.time?.basis,unit:i.time?.unit},placement:{x:t(i.placement?.x,e,n),y:t(i.placement?.y,e,n),lane:t(i.placement?.lane,e,n),space:i.placement?.space},kinematics:{velocityX:t(i.kinematics?.velocityX,e,n),velocityY:t(i.kinematics?.velocityY,e,n),space:i.kinematics?.space},process:{group:s,stage:u,target:t(i.process?.target,e,n),work:t(i.process?.work,e,n)},evidence:d,accessible:{description:t(i.accessible?.description,e,n),group:c,label:t(i.accessible?.label,e,n)??a}};r.push(h),o.set(a,h)}),{rows:r,byId:o}}function i(t){let n=t.now-t.arrival;return{age:n,progress:Number.isFinite(n)&&Number.isFinite(t.ttl)&&t.ttl>0?Math.max(0,n)/t.ttl:n===1/0&&Number.isFinite(t.ttl)&&t.ttl>0?1/0:0,lifecycle:e(n,t.ttl,t.thresholds)}}function r(e){let t=Math.max(0,Math.min(1,e.minOpacity??.1));if(Number.isNaN(e.age))return 1;if(e.age===1/0)return t;if(!Number.isFinite(e.extent)||e.extent<=0)return 1;let n=Math.max(0,e.age);if("step"===e.type)return n<(e.threshold??.5*e.extent)?1:t;if("exponential"===e.type){let i=e.halfLife??e.extent/2,r=i>0?i:e.extent/2;return t+Math.pow(.5,n/r)*(1-t)}return t+Math.max(0,Math.min(1,1-n/e.extent))*(1-t)}function o(e,t){let n=Number.isFinite(e)?e:0,i=Number.isFinite(t)?t:0;return{velocityX:n,velocityY:i,speed:Math.hypot(n,i),direction:Math.atan2(i,n)}}function l(e,t,n){return!Number.isFinite(n)||n<=0?o(0,0):o((t.x-e.x)/n,(t.y-e.y)/n)}function a(e){return"string"==typeof e&&e.includes("var(")}function s(e){let t=so.exec(e);if(!t)return a(e)?void 0:e;let n=t[1]?.trim();return n?s(n):void 0}function u(e,t){return String(e).length*t*.6}function c(e){let{x:t,y:n,text:i,fill:r,fontSize:o=12,fontWeight:l,fontFamily:c,textAnchor:d="start",dominantBaseline:h,background:f,className:m}=e,y=function(e){return void 0===e||!0===e||"halo"===e?{type:"halo"}:!1===e||"none"===e?null:"box"===e?{type:"box"}:{...e,type:e.type??"halo"}}(f),p=e=>zr("text",{x:t,y:n,textAnchor:d,dominantBaseline:h,fill:r,fontSize:o,fontWeight:l,fontFamily:c,className:m,...e?{style:{stroke:e.stroke,strokeWidth:e.strokeWidth,paintOrder:"stroke"}}:{},children:i});if(!y)return p();if("halo"===y.type)return p({stroke:y.fill??uo,strokeWidth:y.haloWidth??3});let g,b,x=y.padding??{x:6,y:3},v="number"==typeof x?x:x.x,w="number"==typeof x?x:x.y,k=u(i,o),M=k+2*v,A=o+2*w;g="middle"===d?t-k/2-v:"end"===d?t-k-v:t-v,b="middle"===h||"central"===h?n-A/2:"hanging"===h||"text-before-edge"===h?n-w:n-.8*o-w;let S=y.fill??uo,$={};return a(S)&&($.fill=S),a(y.stroke)&&($.stroke=y.stroke),Ir("g",{className:m,children:[zr("rect",{x:g,y:b,width:M,height:A,rx:y.radius??3,ry:y.radius??3,fill:a(S)?s(S):S,fillOpacity:y.opacity??.85,stroke:a(y.stroke)?s(y.stroke):y.stroke,strokeWidth:y.strokeWidth,...$.fill||$.stroke?{style:$}:{}}),p()]})}function d(e){let t=e.provenance,n=e.id??e.stableId??t?.stableId;return null==n||""===n?void 0:String(n)}function h(e){let t=rr(e=>e.pushObservation),n=jr.useCallback(n=>{e.onObservation?.(n),t?.(n)},[e,t]);return jr.useMemo(()=>({...e,onObservation:n}),[n,e])}function f(e,t={}){let n=d(e);return{"data-semiotic-annotation-widget":"",...n?{"data-semiotic-annotation-id":n}:{},onClickCapture(i){let r=function(e){let t=e.nativeEvent;return"touch"===t.pointerType?"touch":0===t.detail?"keyboard":"pointer"}(i);t.onAnnotationActivate?.({annotation:e,annotationId:n,chartId:t.chartId,inputType:r}),n&&t.onObservation&&t.onObservation({type:"annotation-activate",annotationId:n,inputType:r,timestamp:Date.now(),chartType:t.chartType??"unknown",chartId:t.chartId})}}}function m(e){return e instanceof Element&&null!=e.closest("[data-semiotic-annotation-widget]")}function y(e,t){return e===t||!(!e||!t||e.xValue!==t.xValue||e.sourceId!==t.sourceId||!!e.locked!=!!t.locked)}function p(e){return e&&Number.isFinite(e.xValue)?{...e,sourceId:e.sourceId??"external"}:null}function g(){let e=new Map,t=new Set;return{getSnapshot:()=>e,subscribe:e=>(t.add(e),()=>t.delete(e)),set:(n,i)=>{if(!y(e.get(n)??null,i)){e=new Map(e),i?e.set(n,i):e.delete(n);for(let e of t)e()}}}}function b(){return ro??(ro=g())}function x({children:e,control:t}){let[n]=Tr(g),i=Fr(()=>({store:n,control:t}),[n,t]);return Wr(()=>{let e=v(n,t),i=i=>{if("Escape"===i.key){t&&e.unlockCrosshair(t.name);for(let i of n.getSnapshot().keys())i!==t?.name&&e.unlockCrosshair(i)}};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[n,t]),zr(co.Provider,{value:i,children:e})}function v(e,t){let n=e=>t?.name===e&&void 0!==t.position,i=i=>n(i)?p(t.position):e.getSnapshot().get(i)??null,r=(r,o)=>{let l=p(o);y(i(r),l)||(n(r)||e.set(r,l),t?.name===r&&t.onPositionChange?.(l))};return{setPosition:r,setCrosshairPosition(e,t,n){i(e)?.locked||r(e,{xValue:t,sourceId:n})},clearCrosshairPosition(e,t){let n=i(e);n&&!n.locked&&n.sourceId===t&&r(e,null)},toggleCrosshairLock:(e,t,n)=>i(e)?.locked?(r(e,null),!1):(r(e,{xValue:t,sourceId:n,locked:!0}),!0),unlockCrosshair(e,t){let n=i(e);n?.locked&&(!t||n.sourceId===t)&&r(e,null)},releaseCrosshair(e,t){!n(e)&&i(e)?.sourceId===t&&r(e,null)}}}function w(){let e=Er(co),t=e?.store??b(),n=null!==e;return Fr(()=>({...v(t,e?.control),handlesEscape:n}),[t,e?.control,n])}function k(e){let t=Er(co),n=t?.store??b(),i=Dr(e?n.subscribe:mo,n.getSnapshot,fo),r=t?.control,o=null!=r&&r.name===e&&void 0!==r.position,l=o?r.position??null:null,a=Fr(()=>p(l),[l]);return o?a:e?i.get(e)??null:null}function M(e){let t=k(e),n=w();return{position:t,setPosition:Pr(t=>n.setPosition(e,t),[n,e])}}function A(e,t){for(let n of t){let t=e.find(e=>e.lower===n);if(t)return t}}function S(e,t={}){if(!e||"object"!=typeof e)return{entries:[]};let n=t.maxEntries??6,i=!1!==t.skipPositional,r=[];for(let[t,n]of Object.entries(e)){if(t.startsWith("_")||"data"===t)continue;let e=t.toLowerCase();if(i&&bo.has(e)||null==n)continue;let o=typeof n;"string"!==o&&"number"!==o&&"boolean"!==o&&!(n instanceof Date)||r.push({key:t,lower:e,value:n})}if(0===r.length)return{entries:[]};let o=r.findIndex(e=>yo.includes(e.lower)),l=o>=0;o<0&&(o=r.findIndex(e=>"id"===e.lower)),o<0&&(o=r.findIndex(e=>"string"==typeof e.value));let a=o>=0?r[o]:void 0,s=r.filter((e,t)=>t!==o&&(!l||"id"!==e.lower)),u=A(s,po),c=A(s,go),d=[];u&&d.push({key:u.key,value:u.value}),c&&d.push({key:c.key,value:c.value});for(let e of s){if(d.length>=n)break;po.includes(e.lower)||go.includes(e.lower)||d.push({key:e.key,value:e.value})}return{titleKey:a?.key,title:a?.value,entries:d}}function $(e){if(!Number.isFinite(e))return String(e);let t=Number.isInteger(e)?e:Number(e.toPrecision(6));return Math.abs(t)>9999?t.toLocaleString():String(t)}function C(e){return e.getHours()||e.getMinutes()||e.getSeconds()||e.getMilliseconds()?e.toLocaleString():e.toLocaleDateString()}function L(e,t){return"function"==typeof t?t(e):e[t]}function N(e,t){if(t)return t(e);if(null==e)return"";if("number"==typeof e)return Number.isFinite(e)?$(e):String(e);if(e instanceof Date)return C(e);if("object"==typeof e&&null!==e){let 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 z(e,t,n){let i="string"==typeof t?t:t.accessor||t.key||"";return{label:"string"==typeof t?t:t.label,value:N(L(e,i),"string"==typeof t?n:t.format||n)}}function I(e={}){let{fields:t,chrome:n,title:i,format:r,style:o={},className:l=""}=e;return e=>{if(!e||"object"!=typeof e)return null;let a,s=[];if(i){let t=L(e,i);a=N(t,r)}if(t&&t.length>0)s.push(...t.map(t=>z(e,t,r)));else if(!i){let t=["value","y","name","id","label"];for(let n of t)if(void 0!==e[n]){a=N(e[n],r);break}if(!a){let t=Object.keys(e).filter(e=>!e.startsWith("_"));t.length>0&&(a=N(e[t[0]],r))}}return Ir(or,{chrome:n,className:l,style:o,children:[a&&zr("div",{style:{fontWeight:s.length>0?"bold":"normal"},children:a}),s.map((e,t)=>Ir("div",{style:{marginTop:0===t&&a?"4px":0},children:[e.label&&Ir("span",{children:[e.label,": "]}),e.value]},t))]})}}function R(e={}){let{fields:t=[],chrome:n,title:i,format:r,style:o={},className:l="",showLabels:a=!0,separator:s=": "}=e;return e=>{if(!e||"object"!=typeof e)return null;let u=[];if(i){let t=L(e,i);u.push({value:N(t,r)})}if(t&&Array.isArray(t)&&t.length>0)for(let n of t){let t=z(e,n,r);u.push({...t,label:a?t.label:void 0})}else{let t=S(e,{skipPositional:!1});null!=t.title&&u.push({label:void 0,value:N(t.title,r),bold:!0}),t.entries.forEach(e=>{u.push({label:a?e.key:void 0,value:N(e.value,r)})})}return Array.isArray(u)&&0!==u.length?zr(or,{chrome:n,className:`semiotic-tooltip-multiline ${l}`.trim(),style:o,children:u.map((e,t)=>Ir("div",{style:{marginBottom:t<u.length-1?"4px":0,fontWeight:e.bold?"bold":void 0},children:[e.label&&Ir("strong",{children:[e.label,s]}),e.value]},t))}):null}}function j(e){return"multi"===e||O(e)}function O(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&"mode"in e&&"multi"===e.mode}function T(e){let{tooltip:t,defaultTooltipContent:n,multiDefaultContent:i=W(),customFunctionContext:r="datum"}=e,o=t;if(!1===t)return{tooltipContent:()=>null};if(j(o)){let e=O(o)&&"function"==typeof o.content?E(void 0===o.chrome?o.content:{content:o.content,chrome:o.chrome}):void 0,t=O(o)?o.chrome:void 0;return{tooltipContent:e||(void 0===t?i:e=>{let n=i(e);return lr(n)?zr(ar,{chrome:t,children:n}):null}),tooltipMode:"multi"}}return"hover"===r&&"function"==typeof t?{tooltipContent:t}:{tooltipContent:E(o)||n}}function F(e){let{tooltip:t,defaultTooltipContent:n,customFunctionContext:i="datum"}=e;return!1===t?{tooltipContent:()=>null}:"hover"===i&&"function"==typeof t?{tooltipContent:t}:{tooltipContent:E(t)||n}}function W({xFormat:e,yFormat:t}={}){function n(e,t){if(t)try{let n=t(e);if(null!=n)return n}catch{}return N(e)}return i=>{let r=i.allSeries;if(!r||0===r.length){let e=i.data?.value??i.data?.y;return zr(or,{children:zr("div",{children:n(e,t)})})}let o=i.xValue??i.data?.time??i.data?.x;return Ir(or,{children:[null!=o&&zr("div",{style:{fontWeight:600,marginBottom:4,fontSize:"0.9em",borderBottom:"1px solid var(--semiotic-border, #eee)",paddingBottom:4},children:n(o,e)}),r.map((e,i)=>Ir("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"1px 0"},children:[zr("span",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:e.color,flexShrink:0}}),zr("span",{style:{flex:1,fontSize:"0.85em"},children:e.group}),zr("span",{style:{fontWeight:500,fontSize:"0.85em"},children:n(e.value,t&&(n=>t(n,e.group)))})]},i))]})}}function E(e){if(!0!==e){if("function"==typeof e||"object"==typeof e&&null!==e&&"content"in e&&"function"==typeof e.content&&!O(e)){let t="function"==typeof e?e:e.content,n="function"==typeof e?void 0:e.chrome,i=e=>{let i=function(e){let t=!0===e?.__semioticHoverData,n=e&&("node"===e.type||"edge"===e.type||void 0!==e.nodeOrEdge||void 0!==e.allSeries||void 0!==e.stats||void 0!==e.__chartType),i=t||e&&void 0!==e.data&&"number"==typeof e.x&&"number"==typeof e.y&&n,r=Ni(i?e.data??{}:e);if(!r||(("node"===e?.nodeOrEdge&&"number"==typeof r?.x0&&"number"==typeof r?.x1||"edge"===e?.nodeOrEdge&&"number"==typeof r?.sankeyWidth)&&r.data&&"object"==typeof r.data&&(r=r.data),!r))return null;if(i&&(void 0!==e.allSeries||void 0!==e.xValue)){let t=kr({...r},Mr(r));void 0!==e.allSeries&&void 0===t.allSeries&&(t.allSeries=e.allSeries),void 0!==e.xValue&&void 0===t.xValue&&(t.xValue=e.xValue),r=t}return r}(e);if(!i)return null;let r=t(i);return lr(r)?void 0===n&&(sr(t)||sr(r))?r:zr(or,{chrome:n,children:r}):null};return void 0===n&&sr(t)?ur(i):i}if(!1===e||void 0===e)return!1;if(O(e)){if("function"==typeof e.content)return!xo&&"production"!==process.env.NODE_ENV&&(xo=!0,console.warn('[semiotic] tooltip={{ mode: "multi", content }} reached a chart without multi-series hover. content receives one datum and no allSeries.')),E(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.');let t=R({chrome:e.chrome});return E(e=>t(e))}if("object"==typeof e&&null!==e&&("fields"in e||"title"in e||"chrome"in e)){let t=I(e);return E(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.');let e=R();return E(t=>e(t))}return I()}}function D({componentName:e,message:t,diagnosticHint:n,width:i,height:r}){return zr("div",{role:"alert",style:{width:i,height:Math.max(r,120),display:"flex",alignItems:"center",justifyContent:"center",border:"1px dashed rgba(128, 128, 128, 0.4)",borderRadius:8,background:"rgba(128, 128, 128, 0.04)",padding:24,boxSizing:"border-box"},children:Ir("div",{style:{textAlign:"center",maxWidth:400},children:[zr("div",{style:{fontSize:13,fontWeight:600,color:"rgba(128, 128, 128, 0.7)",marginBottom:6,fontFamily:"monospace"},children:e}),zr("div",{style:{fontSize:14,color:"rgba(128, 128, 128, 0.9)",lineHeight:1.5},children:t}),n&&zr("div",{"data-testid":"semiotic-diagnostic-hint",style:{marginTop:10,padding:"8px 12px",background:"rgba(128, 128, 128, 0.06)",borderRadius:4,fontSize:12,color:"rgba(128, 128, 128, 0.8)",fontFamily:"monospace",textAlign:"left",whiteSpace:"pre-wrap",lineHeight:1.6},children:n})]})})}function P(e,t){return e.displayName=t,e}function H({colors:e,children:t}){return zr(wo.Provider,{value:e,children:t})}function B(e){let t=Er(wo),n=Er(ko);return e?n:t}function G(){return Er(wo)}function _(e){let t=Br(),n=e.clientId||t,{name:i}=e,r=cr(e=>e.selections.get(i)),o=cr(e=>e.setClause),l=cr(e=>e.clearClause),a=Fr(()=>!!r&&r.clauses.size>0,[r]);return{predicate:Fr(()=>r&&0!==r.clauses.size?dr(r,n):()=>!0,[r,n]),isActive:a,selectPoints:Pr(e=>{let t={},r=!1;for(let[n,i]of Object.entries(e))t[n]={type:"point",values:new Set(i)},r=!0;r&&o(i,{clientId:n,type:"point",fields:t})},[n,i,o]),selectInterval:Pr(e=>{let t={},r=!1;for(let[n,i]of Object.entries(e))t[n]={type:"interval",range:i},r=!0;r&&o(i,{clientId:n,type:"interval",fields:t})},[n,i,o]),clear:Pr(()=>{l(i,n)},[l,i,n]),clientId:n}}function V(e,t){let n=Br(),i=t||n,r=cr(e=>e.setClause),o=cr(e=>e.clearClause);return{selectPoints:Pr(t=>{let n={},o=!1;for(let[e,i]of Object.entries(t))n[e]={type:"point",values:new Set(i)},o=!0;o&&r(e,{clientId:i,type:"point",fields:n})},[e,i,r]),clear:Pr(()=>o(e,i),[e,i,o]),clientId:i}}function Y(e){let t=e.name||"hover",{fields:n}=e,{predicate:i,isActive:r,selectPoints:o,clear:l}=_({name:t,fields:n});return{onHover:Pr(e=>{if(!e)return void l();let t=Ar(e,n);hr(t)?o(t):l()},[n,o,l]),predicate:i,isActive:r}}function U(e){return 2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1]}function q(e){let{name:t,xField:n,yField:i}=e,{predicate:r,isActive:o,selectInterval:l,clear:a}=_({name:t,fields:[n,i].filter(Boolean)}),s=n&&i?"xyBrush":n?"xBrush":"yBrush",u=Pr(e=>{if(!e)return void a();let t={};"xyBrush"===s&&function(e){return 2===e.length&&Array.isArray(e[0])&&2===e[0].length&&Array.isArray(e[1])&&2===e[1].length}(e)?(n&&(t[n]=[Math.min(e[0][0],e[1][0]),Math.max(e[0][0],e[1][0])]),i&&(t[i]=[Math.min(e[0][1],e[1][1]),Math.max(e[0][1],e[1][1])])):"xBrush"===s&&U(e)?n&&(t[n]=[Math.min(e[0],e[1]),Math.max(e[0],e[1])]):"yBrush"===s&&U(e)&&i&&(t[i]=[Math.min(e[0],e[1]),Math.max(e[0],e[1])]),hr(t)&&l(t)},[s,n,i,l,a]);return{brushInteraction:Fr(()=>({brush:s,during:u,end:u}),[s,u]),predicate:r,isActive:o,clear:a}}function X(e,t,n){let i=cr(e=>e.selections.get(t));return Fr(()=>{if(!i||0===i.clauses.size)return e;let t=dr(i,n);return e.filter(t)},[e,i,n])}function K(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function J(e,t){let{when:n}=e,i=t.width,r=t.height,o=function(e){if(!("number"!=typeof e.height||e.height<=0))return e.width/e.height}(t),l=function(e){if(!("number"!=typeof e.height||e.height<=0))return e.width>=e.height?"landscape":"portrait"}(t);return!("number"==typeof n.minWidth&&i<n.minWidth||"number"==typeof n.maxWidth&&i>n.maxWidth||"number"==typeof n.minHeight&&("number"!=typeof r||r<n.minHeight)||"number"==typeof n.maxHeight&&("number"!=typeof r||r>n.maxHeight)||"number"==typeof n.minAspectRatio&&("number"!=typeof o||o<n.minAspectRatio)||"number"==typeof n.maxAspectRatio&&("number"!=typeof o||o>n.maxAspectRatio)||n.orientation&&l!==n.orientation)}function Q(e,t,n=e.responsiveRules){if(!Array.isArray(n)||0===n.length)return{props:e,matches:[]};let i=n.map((e,t)=>({rule:e,index:t})).filter(e=>J(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:i.reduce((e,t)=>function(e,t){let n={...e,...t};for(let i of["margin","frameProps","mobileSemantics","style"])K(e[i])&&K(t[i])&&(n[i]={...e[i],...t[i]});return"string"==typeof e.className&&"string"==typeof t.className&&(n.className=`${e.className} ${t.className}`),n}(e,t.rule.transform),e),matches:i}}function Z(e={}){let{limit:t=50,types:n,chartId:i}=e,r=rr(e=>e.version),o=rr(e=>e.observations),l=rr(e=>e.clearObservations),a=Fr(()=>{let e=o;if(n&&n.length>0){let t=new Set(n);e=e.filter(e=>t.has(e.type))}return i&&(e=e.filter(e=>e.chartId===i)),e.length>t&&(e=e.slice(e.length-t)),e},[o,n,i,t,r]);return{observations:a,latest:a.length>0?a[a.length-1]:null,clear:l}}function ee(e,t){let n=e.get(t);if(void 0!==n)return n;if(e.size>=4096)return Fi(t);let i=e.size;return e.set(t,i),i}function te(e,t){let{key:n,currentTarget:i}=e,r=t?"ArrowRight":"ArrowDown";if(n!==(t?"ArrowLeft":"ArrowUp")&&n!==r&&"Home"!==n&&"End"!==n)return;e.preventDefault();let o=Array.from(i.closest("[role='listbox']")?.querySelectorAll("[role='option']")??[]),l="Home"===n?0:"End"===n?o.length-1:(o.indexOf(i)+(n===r?1:-1)+o.length)%o.length;o[l]?.focus()}function ne(e){let t=e?.find(e=>"bottom"===e.orient),n=e?.find(e=>"top"===e.orient),i=e?.find(e=>"left"===e.orient),r=e?.find(e=>"right"===e.orient);return{bottomAxis:t,topAxis:n,leftAxis:i,rightAxis:r,xAxis:t??n,yAxis:i??r,xOrient:t||!n?"bottom":"top",yOrient:i||!r?"left":"right"}}function ie(e){let t=6;for(let n=1;n<e.length;n++){let i=Math.abs(e[n]-e[n-1]);if(i>0&&Number.isFinite(i)){let r=Math.max(Math.abs(e[n]),Math.abs(e[n-1]));t=Math.max(t,Math.ceil(Math.log10(r/i))+1)}}let n=Math.min(17,t);return e=>Number.isInteger(e)?String(e):String(Number(e.toPrecision(n)))}function re(...e){let t;for(let n of e)n&&(t=oe(t)&&oe(n)?{legendGroups:[...t.legendGroups,...n.legendGroups],legendDistance:n.legendDistance??t.legendDistance}:n);return t}function oe(e){return"object"==typeof e&&null!==e&&"legendGroups"in e&&Array.isArray(e.legendGroups)}function le(e){return"object"==typeof e&&null!==e&&"gradient"in e}function ae(e,t,n,i,r=8){let o="left"===i||"right"===i,l=i,a="left"===i?"right":"right"===i?"left":"top"===i?"bottom":"top",s=Math.max(0,(o?n[0]:n[1])-r),u=Math.max(t[l],s-e[a]);e[l]>u&&(e[l]=u)}function se(e){return Math.ceil(7*e.length)}function ue(e,t){if(oe(e)){let n=ve(t),i=100;for(let t of e.legendGroups){t.label&&(i=Math.max(i,se(t.label)));for(let e of t.items)i=Math.max(i,n.swatchSize+n.labelGap+se(e.label))}return i}if(le(e)){let{gradient:t}=e,n=t.format||ie(t.domain),i=Math.max(se(n(t.domain[0])),se(n(t.domain[1]))),r=t.label?se(t.label):0;return Math.max(100,19+i,r)}return 100}function ce(e){return(oe(e)||le(e))&&Number.isFinite(e.legendDistance)?Math.max(0,e.legendDistance):10}function de(e,t){return null!=e?.sideGutter?Math.max(0,e.sideGutter):t?.hasAxis?t.hasAxisLabel?Co:$o:0}function he(e){return Math.max(0,e?.edgeGutter??3)}function fe(e,t){return null!=t?.axisGutter?Math.max(0,t.axisGutter):e?.hasAxis?e.hasAxisLabel?e.rotatedTicks?64:46:22:0}function me(e){let{bottomAxis:t,topAxis:n,leftAxis:i,rightAxis:r}=ne(e.axes),o=!(n&&!t||!1===t?.visible),l=!!n&&!t&&!1!==n.visible,a=!(r&&!i||!1===i?.visible),s=!!r&&!1!==r.visible,u=!1!==e.showAxes;return{hasAxis:u&&o,hasAxisLabel:u&&o&&!!(t?.label??e.xLabel),rotatedTicks:u&&o&&(e.rotatedTicks??!!t?.autoRotate),topAxis:l?{hasAxis:u,hasAxisLabel:u&&!!(n?.label??e.xLabel),rotatedTicks:u&&(e.rotatedTicks??!!n?.autoRotate)}:void 0,leftAxis:a?{hasAxis:u,hasAxisLabel:u&&!!(i?.label??e.yLabel)}:void 0,rightAxis:s?{hasAxis:u,hasAxisLabel:u&&!!(r?.label??e.yLabelRight??e.yLabel)}:void 0}}function ye(e,t){return me({showAxes:e.showAxes??t.showAxes,xLabel:e.xLabel??t.xLabel,yLabel:e.yLabel??t.yLabel,yLabelRight:e.yLabelRight??t.yLabelRight,axes:e.axes??t.axes})}function pe(e){let t=e.projection??"vertical",n=!1!==e.showAxes&&"radial"!==t;return{hasAxis:n,hasAxisLabel:n&&("horizontal"===t?e.hasValueLabel:e.hasCategoryLabel),leftAxis:{hasAxis:n,hasAxisLabel:n&&("horizontal"===t?e.hasCategoryLabel:e.hasValueLabel)}}}function ge(e,t,n){if(le(e))return e.gradient.label?46:26;if(!oe(e))return 20;let i=ve(n),r=Math.max(1,n?.maxWidth??t),o=i.rowHeight;for(let t of e.legendGroups){let e=0,n=0;for(let o of t.items){let t=i.swatchSize+i.labelGap+se(o.label),l=0===n?t:n+i.itemGap+t;n>0&&l>r?(e+=1,n=t):n=l}t.items.length>0&&(e+=1),o=Math.max(o,e*i.rowHeight,t.label?se(t.label):0)}return o+(e.legendGroups.length>1?16:0)}function be(e,t,n){return ue(e,t)+ce(e)+de(t,n)+he(t)}function xe(e,t){let{legend:n}=t;if(!n)return;let i=t.position??"right",r=ge(n,Math.max(1,t.size[0]-e.left-e.right),t.legendLayout)+ce(n)+fe("bottom"===i?t.axisChrome:"top"===i?t.axisChrome?.topAxis:void 0,t.legendLayout)+("top"===i&&t.hasTitle?24:0),o=Math.max(t.minimumMargin??0,"top"===i?t.hasTitle?58:34:0);"right"===i?e.right=Math.max(e.right,o,be(n,t.legendLayout,t.axisChrome?.rightAxis)):"left"===i?e.left=Math.max(e.left,o,be(n,t.legendLayout,t.axisChrome?.leftAxis)):"top"===i?e.top=Math.max(e.top,o,r):e.bottom=Math.max(e.bottom,o,r)}function ve(e){let t=Math.max(1,e?.swatchSize??16),n=Math.max(t,e?.rowHeight??22);return{swatchSize:t,labelGap:Math.max(0,e?.labelGap??6),itemGap:Math.max(0,e?.itemGap??10),rowHeight:n,align:"left"===e?.align?"start":"right"===e?.align?"end":e?.align??"start",maxWidth:e?.maxWidth}}function we(e,t,n=!1){let i={...e};for(let e of t??[])!1===e.visible&&("top"!==e.orient||!n)&&(i[e.orient]=0);return i}function ke({config:e,orientation:t="vertical",width:n=100,customClickBehavior:i,customHoverBehavior:r,highlightedCategory:o,isolatedCategories:l,legendInteraction:a}){let{colorFn:s,domain:u,label:c,format:d}=e,h="horizontal"===t,f=d||ie(u),m=`grad-legend-${jr.useId()}`,y=!(!i&&!r),p="isolate"===a||void 0===a&&null!=l,[g,b]=jr.useState(0),[x,v]=jr.useState(null),[w,k]=u,M=jr.useMemo(()=>Array.from({length:65},(e,t)=>{let n=t/64;return zr("stop",{offset:n,stopColor:s(h?w+n*(k-w):k-n*(k-w))},t)}),[s,w,k,h]),A=h?Math.min(n,200):14,S=h?12:100,$=h?Math.max(0,(n-A)/2):0,C=c?18:0;return Ir("g",{"aria-label":c||"Gradient legend",role:y?"listbox":void 0,"aria-orientation":y?t:void 0,"aria-multiselectable":!(!y||!p)||void 0,style:Ao,children:[zr("defs",{children:zr("linearGradient",{id:m,x1:"0%",y1:"0%",x2:h?"100%":"0%",y2:h?"0%":"100%",children:M})}),c&&zr("text",{x:h?$+A/2:0,y:12,textAnchor:h?"middle":"start",fontSize:11,fill:"var(--semiotic-text, #333)",children:c}),zr("rect",{x:$,y:C,width:A,height:S,fill:`url(#${m})`,rx:2}),y&&Array.from({length:5},(e,t)=>((e,t,n)=>{let a="string"==typeof e.interactionKey?e.interactionKey:e.label,s=l?.has(a)??!1,u=o===a,c=x===n;return zr("rect",{className:"semiotic-gradient-legend-bin",...t,fill:l?.size&&!s||null!=o&&!u?"rgba(255,255,255,0.65)":"transparent",stroke:c||s||u?"var(--semiotic-focus, #005fcc)":"transparent",strokeWidth:c?3:2,tabIndex:n===g?0:-1,role:"option","aria-label":e.label,"aria-selected":p?s:void 0,"aria-current":!(p||!u)||void 0,onClick:i?()=>i(e):void 0,onMouseEnter:r?()=>r(e):void 0,onMouseLeave:r?()=>r(null):void 0,onFocus:()=>{b(n),v(n),r?.(e)},onBlur:()=>{v(null),r?.(null)},onKeyDown:t=>{if(("Enter"===t.key||" "===t.key)&&i)return t.preventDefault(),void i(e);te(t,h)},style:{cursor:"pointer",pointerEvents:"all"}},`gradient-interaction-${n}`)})((e=>{let t=h?e:5-e-1,n=u[0]+t/5*(u[1]-u[0]),i=u[0]+(t+1)/5*(u[1]-u[0]);return{label:`${f(n)} – ${f(i)}`,valueRange:[n,i],interactionKey:`${n}:${i}`}})(t),{x:h?$+t*A/5:0,y:h?C:C+t*S/5,width:h?A/5:A,height:h?S:S/5},t)),[0,1].map(e=>zr("text",{x:h?$+e*A:A+5,y:C+(h?S+12:e?S:10),textAnchor:h?e?"end":"start":void 0,fontSize:10,fill:"var(--semiotic-text-secondary, #666)",children:f(u[h?e:1-e])},e))]})}function Me(e,t,n,i,r){if("function"==typeof n)return n(e);let o=i(e,t);return"fill"===n?zr("rect",{style:o,width:r,height:r}):zr("line",{style:o,x1:0,y1:0,x2:r,y2:r})}function Ae({swatchSize:e}){return zr("path",{d:`M${.25*e},${.55*e} L${.45*e},${.75*e} L${.8*e},${.3*e}`,fill:"none",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})}function Se(e,t,n){return n&&n.size>0?n.has(e.label)?1:.3:null!=t?e.label===t?1:.3:1}function $e(e,t,n,i,r){let{legendGroup:{type:o="fill",styleFn:l},customClickBehavior:a,customHoverBehavior:s,highlightedCategory:u,isolatedCategories:c,focusedGroupIndex:d,focusedItemIndex:h,groupIndex:f,onFocusedIndexChange:m,interactive:y,useIsolateAria:p,metrics:{swatchSize:g,labelGap:b}}=e,x=!!c?.size&&c.has(t.label);return Ir("g",{transform:i,onClick:a?()=>a(t):void 0,onMouseEnter:s?()=>s(t):void 0,onMouseLeave:s?()=>s(null):void 0,tabIndex:y?f===d&&n===h?0:-1:void 0,role:y?"option":void 0,"aria-selected":y&&p?x:void 0,"aria-label":t.label,onKeyDown:y?e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),a?.(t)),te(e,r)}:void 0,onFocus:y?e=>{m(f,n),s?.(t),e.currentTarget.querySelector(".semiotic-legend-focus-ring")?.setAttribute("visibility","visible")}:void 0,onBlur:y?e=>{s?.(null),e.currentTarget.querySelector(".semiotic-legend-focus-ring")?.setAttribute("visibility","hidden")}:void 0,style:{cursor:y?"pointer":"default",opacity:Se(t,u,c),transition:"opacity 150ms ease",pointerEvents:"all",outline:"none"},children:[y&&zr("rect",{className:"semiotic-legend-focus-ring",x:-2,y:-2,width:g+b+2+7*t.label.length,height:g+4,fill:"none",stroke:"var(--semiotic-focus, #005fcc)",strokeWidth:2,rx:3,visibility:"hidden"}),Me(t,n,o,l,g),x&&zr(Ae,{swatchSize:g}),zr("text",{y:g/2,x:g+b,dominantBaseline:"central",fontSize:12,style:So,fill:"var(--semiotic-text, #333)",children:t.label})]},`legend-item-${n}`)}function Ce(e){let{legendGroups:t,customClickBehavior:n,customHoverBehavior:i,highlightedCategory:r,isolatedCategories:o,legendInteraction:l,title:a="Legend",width:s=100,height:u=20,orientation:c="vertical",legendLayout:d}=e,h=ve(d),[f,m]=jr.useState({group:0,item:0}),y=jr.useRef(null),p=jr.useRef(null),g=t||[],b=g[f.group]?.items.length?f.group:g.findIndex(e=>e.items.length>0),x=Math.min(f.item,(g[b]?.items.length??1)-1);jr.useEffect(()=>{let e=p.current;e&&!e.isConnected&&document.activeElement===document.body&&y.current?.querySelector("[tabindex='0']")?.focus()});let v=!(!n&&!i),w={customClickBehavior:n,customHoverBehavior:i,highlightedCategory:r,isolatedCategories:o,focusedGroupIndex:b,focusedItemIndex:x,onFocusedIndexChange:jr.useCallback((e,t)=>{m({group:e,item:t})},[]),interactive:v,useIsolateAria:"isolate"===l||void 0===l&&null!=o,metrics:h},k="vertical"===c?((e,t,n)=>{let i=[],r=function(e,t){let n=24;return e.map(({hasLabel:e,itemCount:i})=>{n+=5;let r,o=n;n+=8,e&&(n+=16,r=n,n+=8);let l=n;return n+=i*t+8,{lineY:o,labelY:r,itemsY:l,endY:n}})}(e.map(e=>({hasLabel:!!e.label,itemCount:e.items.length})),n.metrics.rowHeight);return e.forEach((e,o)=>{let l=r[o];i.push(zr("line",{"aria-hidden":"true",stroke:"var(--semiotic-border, #808080)",x1:0,y1:l.lineY,x2:t,y2:l.lineY},`legend-top-line legend-symbol-${o}`)),e.label&&null!=l.labelY&&i.push(zr("text",{y:l.labelY,className:"legend-group-label","aria-hidden":n.interactive||void 0,fontSize:12,style:So,fill:"var(--semiotic-text, #333)",children:e.label},`legend-text-${o}`)),i.push(zr("g",{className:"legend-item",role:n.interactive?"group":void 0,"aria-label":e.label,transform:`translate(0,${l.itemsY})`,children:Lo({...n,legendGroup:e,groupIndex:o})},`legend-group-${o}`))}),i})(g,s,w):((e,t,n,i)=>{let{metrics:r}=i,o=0,l=[];e.forEach((e,n)=>{let a=0;e.label&&(a+=16);let s=((e,t)=>{let{items:n}=e.legendGroup,i=[],{swatchSize:r,labelGap:o,itemGap:l,rowHeight:a,align:s}=e.metrics,u=n.map(e=>r+o+7*e.label.length),c=[],d=0,h=0;u.forEach((e,n)=>{let i=0===h?e:h+l+e;t&&t>0&&h>0&&i>t?(c.push({start:d,end:n,width:h}),d=n,h=e):h=i}),n.length>0&&c.push({start:d,end:n.length,width:h}),c.forEach((r,o)=>{let c="center"===s?Math.max(0,((t??r.width)-r.width)/2):"end"===s?Math.max(0,(t??r.width)-r.width):0;for(let t=r.start;t<r.end;t++)i.push($e(e,n[t],t,`translate(${c},${o*a})`,!0)),c+=u[t]+l});let f=c.reduce((e,t)=>Math.max(e,t.width),0),m=c.length;return{items:i,offset:f,totalRows:m,totalHeight:m*a}})({...i,legendGroup:e,groupIndex:n},r.maxWidth??t);a+=s.offset+5,l.push({...s,offset:a}),o+=a+12});let a=r.maxWidth??t,s=o>a?0:"center"===r.align?Math.max(0,(a-o)/2):"end"===r.align?Math.max(0,a-o):0,u=[];return l.forEach((t,r)=>{let o=e[r];if(o.label&&(u.push(zr("text",{transform:`translate(${s},0) rotate(90)`,textAnchor:"start",className:"legend-group-label","aria-hidden":i.interactive||void 0,fontSize:12,style:So,fill:"var(--semiotic-text, #333)",children:o.label},`legend-text-${r}`)),s+=16),u.push(zr("g",{className:"legend-item",role:i.interactive?"group":void 0,"aria-label":o.label,transform:`translate(${s},0)`,children:t.items},`legend-group-${r}`)),s+=t.offset+5,e[r+1]){let e=t.totalHeight||n;u.push(zr("line",{"aria-hidden":"true",stroke:"var(--semiotic-border, #808080)",x1:s,y1:-8,x2:s,y2:e+0+8},`legend-top-line legend-symbol-${r}`))}s+=12}),zr("g",{children:u})})(g,s,u,w);return Ir("g",{ref:y,onFocusCapture:e=>{e.target instanceof SVGElement&&"option"===e.target.getAttribute("role")&&(p.current=e.target)},onBlurCapture:e=>{e.currentTarget.contains(e.relatedTarget)||(p.current=null)},role:v?"listbox":void 0,"aria-multiselectable":!(!v||!w.useIsolateAria)||void 0,"aria-label":"string"==typeof a&&a?a:"Chart legend","aria-orientation":v?"vertical"===c?"vertical":"horizontal":void 0,style:Ao,children:[void 0!==a&&""!==a&&"vertical"===c&&zr("text",{className:"legend-title","aria-hidden":v||void 0,y:16,x:s/2,textAnchor:"middle",fontSize:12,style:So,fill:"var(--semiotic-text, #333)",children:a}),k]})}function Le(e,t=0,n=1/0,i=0){let r=Number.isFinite(t)?t:0,o=Number.isFinite(n)?Math.max(r,n):1/0,l=Number.isFinite(e)?Math.floor(e):r,a=Math.max(r,Math.min(o,l));return i>0&&Number.isFinite(i)?Math.max(r,Math.min(o,Math.round(a/i)*i)):a}function Ne(e,t,n,i={}){let r=_r(null),[o,l]=Tr(null);No(()=>{if(!t&&!n)return;let e=r.current;if(!e||typeof ResizeObserver>"u")return;let o=(e,t)=>({w:Le(e,i.minWidth,i.maxWidth,i.widthStep),h:Le(t,i.minHeight,i.maxHeight,i.heightStep)}),a=e.getBoundingClientRect();(a.width>0||a.height>0)&&l(o(a.width,a.height));let s=new ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t.contentRect,i=o(e,n);l(e=>e&&e.w===i.w&&e.h===i.h?e:i)}});return s.observe(e),()=>s.disconnect()},[t,n,i.minWidth,i.maxWidth,i.widthStep,i.minHeight,i.maxHeight,i.heightStep]);let a=[t&&o?o.w:e[0],n&&o?o.h:e[1]];return[r,a]}function ze(){return Er(Io)}function Ie(e){let t=new Set,n=[];for(let i of e)t.has(i)||(t.add(i),n.push(i));return n}function Re(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function je(e,t){let n=Er(Ro),i=Br(),r=Ie(e),o=r.map(e=>t?.(e)),l=_r({categories:[],colors:[]});(!Re(l.current.categories,r)||!Re(l.current.colors,o))&&(l.current={categories:r,colors:o});let a=l.current;jo(()=>{if(n)return()=>n.unregisterCategories(i)},[n,i]),jo(()=>{n&&n.registerCategories(i,a)},[n,i,a])}function Oe(){return null!==Er(Ro)}function Te({categoryColors:e,interaction:t,selectionName:n,field:i}){let r=Object.entries(e),o=r.map(([e])=>e),l=[{styleFn:e=>({fill:e.color||"#333",stroke:e.color||"#333"}),type:"fill",items:r.map(([e,t])=>({label:e,color:t})),label:""}],{selectPoints:a,clear:s}=_({name:n,fields:[i],clientId:Oo}),{selectPoints:u,clear:c}=_({name:n,fields:[i],clientId:To}),d=cr(e=>e.selections.get(n)),{isolatedCategories:h,highlightedCategory:f}=Fr(()=>{let e=new Set,t=null,n=d?.clauses.get(Oo)?.fields[i];if("point"===n?.type)for(let t of n.values)e.add(String(t));let r=d?.clauses.get(To)?.fields[i];if("point"===r?.type){let e=r.values.values().next().value;null!=e&&(t=String(e))}return{isolatedCategories:e,highlightedCategory:t}},[d,i]),m=Pr(e=>{"highlight"===t&&(e?u({[i]:[e.label]}):c())},[t,i,u,c]),y=Pr(e=>{if("isolate"!==t)return;let n=new Set(h);n.has(e.label)?n.delete(e.label):n.add(e.label),0===n.size||n.size===o.length?s():a({[i]:Array.from(n)})},[t,i,h,o.length,a,s]),[p,[g]]=Ne([0,0],!0,!1),b=Fr(()=>function(e,t){if(!t||0===e.length)return 1;let n=0,i=1;for(let r of e){let e=26+7*r.length;n>0&&n+e>t&&(i++,n=0),n+=e}return i}(r.map(([e])=>e),g),[r,g]),x=Math.max(30,22*b+8);return 0===r.length?null:zr("div",{ref:p,style:{width:"100%",display:"block"},children:zr("svg",{width:"100%",height:x,style:{display:"block",overflow:"visible"},children:zr(Ce,{legendGroups:l,title:!1,orientation:"horizontal",width:g,height:20,customHoverBehavior:"highlight"===t?m:void 0,customClickBehavior:"isolate"===t?y:void 0,highlightedCategory:f,isolatedCategories:h})})})}function Fe({children:e,crosshair:t,selections:n,showLegend:i,legendPosition:r="top",legendInteraction:o="none",legendSelectionName:l="legend",legendField:a="category"}){let s=Fr(()=>{if(!n)return;let e=new Map;for(let[t,i]of Object.entries(n))i.resolution&&e.set(t,{name:t,resolution:i.resolution,clauses:new Map});return e.size>0?{selections:e}:void 0},[n]),u=G(),c=fr(e=>e.theme.colors.categorical),d=c.length>0?c:zi,[h,f]=Tr({}),m=_r(new Map),y=Fr(()=>({registerCategories:(e,t)=>{f(n=>Re(n[e]?.categories??[],t.categories)&&Re(n[e]?.colors??[],t.colors)?n:{...n,[e]:t})},unregisterCategories:e=>{f(t=>{if(!Object.prototype.hasOwnProperty.call(t,e))return t;let n={...t};return delete n[e],n})}}),[]),p=Fr(()=>{let e=[];for(let{categories:t}of Object.values(h))for(let n of t)e.push(n);return Ie(e)},[h]),g=Fr(()=>{let e=u??{},t=new Map(m.current),n=Object.entries(e).filter(e=>"string"==typeof e[1]&&e[1].length>0),i=p.map(n=>{let i=ee(t,n);return[n,Ii(e,n)??d[i%d.length]]});return{categoryIndexes:t,colors:Object.fromEntries([...n,...i])}},[u,p,d]);jo(()=>{m.current=g.categoryIndexes},[g]);let b=g.colors,v=Fr(()=>{let e=new Map,t=!1;for(let{categories:n,colors:i}of Object.values(h))n.forEach((n,r)=>{let o=i[r];o&&(e.has(n)&&e.get(n)!==o&&(t=!0),e.set(n,o))});return{colors:{...b,...Object.fromEntries(e)},conflicting:t}},[b,h]),w=(i??!0)&&!v.conflicting,k=Object.keys(b).length>0,M=w&&k;return zr(x,{control:t,children:zr(mr,{initialState:s,children:zr(yr,{children:zr(Io.Provider,{value:!0,children:zr(Ro.Provider,{value:y,children:zr(H,{colors:b,children:Ir(zo.Provider,{value:M,children:[w&&"top"===r&&zr(Te,{categoryColors:v.colors,interaction:o,selectionName:l,field:a}),e,w&&"bottom"===r&&zr(Te,{categoryColors:v.colors,interaction:o,selectionName:l,field:a})]})})})})})})})}function We(e){if(null==e)return()=>{};let t="function"==typeof e?e:t=>t[e];return e=>Pe(t(e))}function Ee(e,t){let n=We(e),i=We(t);return(e,t)=>{let r=i(e);return{value:r,x:n(e),y:r,category:t}}}function De(e,t){let n=We(t??"value"),i=null==e?void 0:"function"==typeof e?e:t=>t[e];return e=>{let t=i?i(e):void 0;return{value:n(e),category:null==t?void 0:String(t)}}}function Pe(e){if("number"==typeof e)return Number.isFinite(e)?e:void 0;if("string"==typeof e&&""!==e.trim()){let t=Number(e);return Number.isFinite(t)?t:void 0}}function He(e,t,n){let i=null!=e.axis?n[e.axis]:null!=e.field?t[e.field]:n.value;if(void 0!==e.eq&&i!==e.eq||void 0!==e.ne&&i===e.ne||void 0!==e.in&&!e.in.includes(i))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;let r=Pe(i);if(!(void 0!==r&&(void 0===e.gt||r>e.gt)&&(void 0===e.gte||r>=e.gte)&&(void 0===e.lt||r<e.lt)&&(void 0===e.lte||r<=e.lte)))return!1;if(void 0!==e.within){let[t,n]=e.within;if(!(r>=t&&r<=n))return!1}if(void 0!==e.outside){let[t,n]=e.outside;if(!(r<t||r>n))return!1}return!0}function Be(e,t,n){let i=e.when;return void 0===i||!0===i||!1!==i&&("function"==typeof i?i(t,n):He(i,t,n))}function Ge(e,t,n){if(!t||0===t.length)return{};let i={};for(let r of t){if(!Be(r,e,n))continue;let t="function"==typeof r.style?r.style(e,n):r.style;t&&(i={...i,...t})}return i}function _e(e,t,n,i=e=>e){let r=e??(()=>({}));return t&&0!==t.length?(e,o)=>{let l=i(e),a={...r(e,o)};return Object.assign(a,Ge(l,t,n(l,o))),a}:r}function Ve(e,t,n){return e&&0!==e.length?(i,r)=>{let o=Ge(i,e,t(i,r)),l=n?n(i,r):void 0;return l?{...o,...l}:o}:n}function Ye(e,t,n,i){if(!e||0===e.length)return i;let r=De(t,n);return(t,n)=>{let o=t&&t.data||t,l=Ge(o,e,r(o)),a=i?i(t,n):void 0;return a?{...l,...a}:l}}function Ue(e,t,n,i){return Ve(e,Ee(t,n),i)}function qe(e,t,n){let i=We(t);return Ve(e,(e,t)=>({value:i(e),category:t}),n)}function Xe(e){if(!e)return Fo;for(let t of e)if(null==t||"object"!=typeof t)return e.filter(e=>null!=e&&"object"==typeof e);return e}function Ke(e,t){let n={...e};for(let e of t)n[Eo[e]]++;return n}function Je(e,t,n){let i=new Set(t);return{changeSet:{...e,...e.keys?{keys:[...e.keys]}:{}},changed:i,revisions:Ke(n,i)}}function Qe(e){let{domain:t,layout:n,sceneGeometry:i}=e.revisions;return{domain:t,layout:n,sceneGeometry:i}}function Ze(e,t){return{sceneGeometry:Math.max(e.sceneGeometry,t.sceneGeometry),layout:Math.max(e.layout,t.layout),domain:Math.max(e.domain,t.domain)}}function et(e){return _r(new Go(e))}function tt(e,t,n,i=!1,r=!1){let o=e.beforeCompute(t.getLastUpdateResult(),i);n(),e.afterCompute(o,!0,r)}function nt(e){let{legend:t,totalWidth:n,totalHeight:i,margin:r,legendPosition:o="right",legendLayout:l,legendHoverBehavior:a,legendClickBehavior:s,legendHighlightedCategory:u,legendIsolatedCategories:c,legendInteraction:d}=e;if(!t)return null;let{x:h,y:f,width:m}=function(e,t){let n=t.position??"right",i="top"===n||"bottom"===n,r=Math.max(0,t.totalWidth-t.margin.left-t.margin.right),o=Math.max(1,i?t.legendLayout?.maxWidth??r:t.reservedWidth??ue(e,t.legendLayout)),l=ce(e),a=de(t.legendLayout,"left"===n?t.axisChrome?.leftAxis:t.axisChrome?.rightAxis),s=he(t.legendLayout),u=ge(e,r,t.legendLayout),c=fe(t.axisChrome,t.legendLayout),d=fe(t.axisChrome?.topAxis,t.legendLayout);if("left"===n)return{x:Math.max(s,t.margin.left-a-o-l),y:t.margin.top,width:o,height:u};if("top"===n)return{x:t.margin.left,y:t.margin.top-d-l-u,width:o,height:u};if("bottom"===n){let e=t.totalHeight-t.margin.bottom;return{x:t.margin.left,y:Math.max(e+l,Math.min(e+c+l,t.totalHeight-u)),width:o,height:u}}return{x:Math.min(t.totalWidth-o-s,t.totalWidth-t.margin.right+a+l),y:t.margin.top,width:o,height:u}}(t,{totalWidth:n,totalHeight:i,margin:r,position:o,legendLayout:l,axisChrome:e.axisChrome}),y="top"===o||"bottom"===o;return zr("g",{transform:`translate(${h}, ${f})`,children:le(t)?zr(ke,{config:t.gradient,orientation:y?"horizontal":"vertical",width:m,customHoverBehavior:a,customClickBehavior:s,highlightedCategory:u,isolatedCategories:c,legendInteraction:d}):oe(t)?zr(Ce,{legendGroups:t.legendGroups,title:"",width:m,orientation:y?"horizontal":"vertical",legendLayout:l,customHoverBehavior:a,customClickBehavior:s,highlightedCategory:u,isolatedCategories:c,legendInteraction:d}):t})}function it(e){return!0===e?._annotationDeferred}function rt(e){return"blended"===e?.cohesion||"layer"===e?.cohesion?e.cohesion:null}function ot(e){let t=e?.provenance?.confidence;return"number"==typeof t&&Number.isFinite(t)?Math.max(0,Math.min(1,t)):null}function lt(e){return Math.max(.72,.95-.06*e)}function at(e){let t=e.map((e,t)=>{return{p:e,i:t,emphasis:(n=e.annotation,"primary"===n?.emphasis||"secondary"===n?.emphasis?n.emphasis:null),confidence:ot(e.annotation),readingOrder:null,rank:1};var n}),n=t.some(e=>null!=e.emphasis||null!=e.confidence),i=e.some(e=>it(e.annotation)),r=e.some(e=>null!=rt(e.annotation)),o=e.some(e=>"layer"===rt(e.annotation));if(!n&&!i&&!r)return e.map(e=>e.node);let l=t.filter(e=>null==e.emphasis&&null!=e.confidence).slice().sort((e,t)=>(t.confidence??0)-(e.confidence??0)||e.i-t.i);l.forEach((e,t)=>{e.readingOrder=t,e.rank=2-t/Math.max(1,l.length)});for(let e of t)e.emphasis&&(e.rank=Vo[e.emphasis]);let a=t.sort((e,t)=>e.rank-t.rank||e.i-t.i).map(e=>{let{p:t,i:n,emphasis:i,readingOrder:r}=e,o=it(t.annotation),l=t.node;if("primary"===i||"secondary"===i||null!=r){let e=null==i&&null!=r;l=zr("g",{className:e?"annotation-emphasis annotation-emphasis--inferred":`annotation-emphasis annotation-emphasis--${i}`,..."secondary"===i?{opacity:.6,fontSize:"0.88em"}:{},...e?{opacity:lt(r),"data-annotation-reading-order":r}:{},children:t.node},`annotation-emphasis-${n}`)}let a=rt(t.annotation);return a&&(l=zr("g",{className:`annotation-cohesion--${a}`,children:l},`annotation-cohesion-${n}`)),o&&(l=zr("g",{className:"annotation-deferred","data-annotation-disclosure":"deferred",children:l},`annotation-deferred-${n}`)),l});return i&&a.unshift(zr("style",{children:Yo},"annotation-disclosure-style")),o&&a.unshift(zr("style",{children:".annotation-cohesion--layer text,.annotation-cohesion--layer tspan{fill:var(--semiotic-annotation-color,var(--semiotic-text-secondary,#666));font-style:italic}"},"annotation-cohesion-style")),a}function st(e,t,n,i){return function(e,t,n,i){let r=[];return e.forEach((e,o)=>{let l;l=n?n(e,o,i)??t(e,o,i):t(e,o,i),l&&r.push({node:l,annotation:e})}),{nodes:at(r),renderedAnnotations:r.map(e=>e.annotation)}}(e,t,n,i).nodes}function ut(e,t,n){if(!e)return null;let i="object"==typeof e?e:{};return zr("circle",{className:"semiotic-threshold-end-cap",cx:t[0],cy:t[1],r:Math.max(0,i.radius??4),fill:i.fill??n})}function ct(e,t){return Math.max(Math.min(e,t),0)+16}function dt({ann:e,position:t,vertical:n,width:i,height:r,color:o,fontSize:l=12,fontFamily:a,bold:s,background:u,dash:d="6,3",labelGap:h=4}){let f=e.labelPosition,m=t>.6*i,y=n?t+(m?-4:4):"left"===f?4:"center"===f?i/2:i-4,p=n?"bottom"===f?r-4:"center"===f?r/2:16:t<20?Math.min(r-4,t+16):t-h,g=n?m?"end":"start":"left"===f?"start":"center"===f?"middle":"end",b=n?[t,0]:[0,t],x=n?[t,r]:[i,t];return Ir("g",{opacity:e.opacity,children:[zr("line",{x1:b[0],y1:b[1],x2:x[0],y2:x[1],stroke:o,strokeWidth:e.strokeWidth??1.5,strokeDasharray:e.strokeDasharray||d}),ut(e.endCap,b,o),e.label&&zr(c,{x:y,y:p,text:e.label,textAnchor:g,fill:e.labelColor??o,fontSize:l,fontFamily:a,fontWeight:s?"bold":void 0,background:u??e.labelBackground??"halo"})]})}function ht(e){return{label:e.label,title:e.title,wrap:e.wrap||120,noWrap:"function"==typeof e._noteLayout?e.noWrap:void 0,_noteLayout:e._noteLayout}}function ft(e){return"function"==typeof e._noteLayout?e._noteLayout(e):void 0}function mt(e,t,n){if(!e)return[];let i=Math.max(1,Math.floor(t/n)),r=[],o="";for(let t of e.split(/\s+/))t&&(o&&o.length+1+t.length>i?(r.push(o),o=t):o=o?`${o} ${t}`:t);return o&&r.push(o),r}function yt(e,t,n,i){return"curly"===e?i?`M0,0 C${.6*n},0 ${.4*n},${t/2} ${n},${t/2} C${.4*n},${t/2} ${.6*n},${t} 0,${t}`:`M0,0 C0,${.6*n} ${t/2},${.4*n} ${t/2},${n} C${t/2},${.4*n} ${t},${.6*n} ${t},0`:i?`M0,0 L${n},0 L${n},${t} L0,${t}`:`M0,0 L0,${n} L${t},${n} L${t},0`}function pt(e,t,n,i){if(!e)return zr("g",{className:"annotation-note"});let{label:r,title:o,orientation:l,align:a,wrap:s=120,noWrap:u}=e;if(!r&&!o)return zr("g",{className:"annotation-note"});let c=l;c||(c=Math.abs(t)>Math.abs(n)?"leftRight":"topBottom");let d="topBottom"===c,h="leftRight"===c,f=a;(!f||"dynamic"===f)&&(f=d?t>=0?"left":"right":n>=0?"top":"bottom");let m="start";d?"right"===f?m="end":"middle"===f&&(m="middle"):m=t>=0?"start":"end";let y=e.useHTML||e.html,p=y?void 0:ft(e),g=p?.lineHeight??16,b=p?.titleLines??(o?u?[o]:mt(o,s,8):[]),x=p?.labelLines??(r?u?[r]:mt(r,s,8):[]),v=b.length+x.length,w=h?"end"===m?-4:4:0,k=[],M=i||"var(--semiotic-annotation-color, var(--semiotic-text, #333))";if(y){let e=s,t=Math.max(g,v*g+(o&&r?2:0)),n="end"===m?w-e:"middle"===m?w-e/2:w,i="end"===m?"right":"middle"===m?"center":"left";k.push(zr("foreignObject",{className:"annotation-note-html",x:n,y:-g,width:e,height:t+g,style:{overflow:"visible"},children:Ir("div",{xmlns:"http://www.w3.org/1999/xhtml",style:{color:M,fontSize:"12px",lineHeight:`${g}px`,overflow:"visible",textAlign:i,whiteSpace:u?"nowrap":"normal",wordBreak:"break-word"},children:[o&&zr("div",{className:"annotation-note-title",style:{fontWeight:"bold"},children:o}),r&&zr("div",{className:"annotation-note-label",children:r})]})},"annotation-note-html"))}else for(let e of[!0,!1]){let t=e?b:x;if(0===t.length)continue;let n="annotation-note-"+(e?"title":"label");k.push(zr("text",{className:n,fill:M,textAnchor:m,fontWeight:e?p?.titleFontWeight??"bold":void 0,y:e?void 0:b.length*g,children:t.map((e,t)=>zr("tspan",{x:w,dy:0===t?0:g,children:e},t))},n))}let A=null;if((o||r)&&(0!==t||0!==n)){let e=d?p?p.width:Math.min(s,120):(b.length+x.length+(x.length>0?1:0))*g,t=d?m:f,n="end"===t||"bottom"===t?-e:"middle"===t?-e/2:0;A=zr("line",{className:"note-line",x1:d?n:0,x2:d?n+e:0,y1:d?0:n,y2:d?0:n+e,stroke:i||"var(--semiotic-text-secondary, currentColor)"})}let S=Math.max(0,v-1)*g,$=x.length>0&&b.length>0?2:0,C=0;(d||h)&&(C=h&&"middle"===f?-(S+g+$)/2+g/2:n<0||h&&"bottom"===f?-(S+2):2+g);let L=0!==C?`translate(0,${C})`:void 0;return Ir("g",{className:"annotation-note",transform:`translate(${t},${n})`,...p?.textProps,children:[zr("g",{className:"annotation-note-content",transform:L,children:k}),A]})}function gt(e,t,n,i,r){let o=null,l=n||"var(--semiotic-text-secondary, currentColor)";switch(e){case"callout-circle":{let e=(t?.radius||0)+(t?.radiusPadding||0);e>0&&(o=zr("circle",{r:e,fill:"none",stroke:l},"subject-circle"));break}case"callout-rect":{let e=t?.width||0,n=t?.height||0;(e>0||n>0)&&(o=zr("rect",{width:e,height:n,fill:"none",stroke:l},"subject-rect"));break}case"callout-custom":o=t?.custom;break;case"xy-threshold":{let e=i||0,n=r||0,a=0,s=0,u=0,c=0;if(void 0!==t?.x)a=s=(t.x||0)-e,u=(t.y1||0)-n,c=(t.y2||0)-n;else if(void 0!==t?.y)u=c=(t.y||0)-n,a=(t.x1||0)-e,s=(t.x2||0)-e;else if(void 0!==t?.x1||void 0!==t?.x2)a=(t.x1||0)-e,s=(t.x2||0)-e;else{if(void 0===t?.y1&&void 0===t?.y2)break;u=(t.y1||0)-n,c=(t.y2||0)-n}o=zr("line",{x1:a,y1:u,x2:s,y2:c,stroke:l,strokeDasharray:"5,5"},"threshold-line");break}case"bracket":{let e=t?.type||"curly",n=t?.width??t?.height;void 0!==n&&(o=zr("path",{d:yt(e,n,t?.depth||30,void 0===t?.width),fill:"none",stroke:l},"bracket-path"));break}}return zr("g",{className:"annotation-subject",children:o})}function bt(e,t,n,i,r,o){let l,a,s=0,u=0;if("callout-circle"!==r&&"label"!==r||!o?.radius){if("callout-rect"===r&&o){let n=o.width||0,i=o.height||0;if(n>0||i>0){let r=n/2,o=i/2,l=e-r,a=t-o;if(0!==l||0!==a){let e=Math.abs(l),t=Math.abs(a),c=n/2,d=i/2,h=e*d>t*c?c/e:d/t;s=r+l*h,u=o+a*h}}}else if("bracket"===r&&o){let e=o.width,t=o.height,n=o.depth||30;void 0!==e?(s=e/2,u=n):void 0!==t&&(s=n,u=t/2)}}else{let n=(o.radius||0)+(o.radiusPadding||0);if(n>0&&(0!==e||0!==t)){let i=Math.atan2(t,e);s=Math.cos(i)*n,u=Math.sin(i)*n}}let c=e-s,d=t-u,h=Math.hypot(c,d);if(h>.5){let r=i||"var(--semiotic-text-secondary, currentColor)",o="curve"===n?.type,f=Math.atan2(d,c);if(o){let i=(s+e)/2,o=(u+t)/2,a=-d/h,m=c/h,y=(n?.curve??.25)*h,p=i+a*y,g=o+m*y;l=zr("path",{className:"connector-curve",d:`M${s},${u}Q${p},${g} ${e},${t}`,fill:"none",stroke:r},"connector-line"),f=Math.atan2(g-u,p-s)}else l=zr("line",{x1:s,y1:u,x2:e,y2:t,stroke:r},"connector-line");if("arrow"===n?.end){let e=.08888888888888889*Math.PI,t=s+10*Math.cos(f+e),n=u+10*Math.sin(f+e),i=s+10*Math.cos(f-e),o=u+10*Math.sin(f-e);a=zr("path",{d:`M${s},${u}L${t},${n}L${i},${o}Z`,fill:r,stroke:"none"},"connector-arrow")}}return Ir("g",{className:"annotation-connector",children:[l,a]})}function xt(e){let{x:t=0,y:n=0,dx:i,dy:r,nx:o,ny:l,note:a,connector:s,subject:u,type:c,color:d,className:h,disable:f,opacity:m,strokeDasharray:y,events:p={},"data-testid":g}=e,b=Array.isArray(t)?t[0]??0:t,x=Array.isArray(n)?n[0]??0:n,v=Array.isArray(f)?f:[],w=i||0,k=r||0;null!=o&&(w=o-b),null!=l&&(k=l-x);let M="string"==typeof c?c:"label";if("bracket"===M&&u&&0===w&&0===k)if(void 0!==u.width){w=u.width/2;let e=u.depth||30;k=e+(e>=0?5:-5)}else if(void 0!==u.height){let e=u.depth||30;w=e+(e>=0?5:-5),k=u.height/2}return Ir("g",{className:`annotation ${h||""}`.trim(),transform:`translate(${b},${x})`,"data-testid":g,...null!=m&&{opacity:m},...y&&{strokeDasharray:y},...p,children:[!v.includes("connector")&&bt(w,k,s,d,M,u),!v.includes("subject")&>(M,u,d,b,x),!v.includes("note")&&pt(a,w,k,d)]})}function vt(e){let{noteData:t}=e,{screenCoordinates:n}=t,i="string"==typeof t.type?t.type:"label",r=t.eventListeners||t.events||{};if(t.coordinates&&n){let e=t.nx||n[0][0]+(t.dx??0),r=t.ny||n[0][1]+(t.dy??0),o=n.map((n,o)=>{let l=Object.assign({},t,{note:0===o?t.note:{label:""},x:n[0],y:n[1],nx:e,ny:r});return zr(xt,{"data-testid":"semiotic-annotation",...l,type:i},`multi-annotation-${o}`)});return zr("g",{children:o})}let o=t.note||{title:"none",label:t.label},l=`${o.label}-${o.title}-${t.i}`;return zr(xt,{"data-testid":"semiotic-annotation",events:r,...t,type:i},l)}function wt(e,t){let n=t.scales?.x??t.scales?.time;return n?null!=e.x?$r(n,e.x):t.xAccessor&&null!=e[t.xAccessor]?$r(n,e[t.xAccessor]):null:null}function kt(e,t){let n=t.scales?.y??t.scales?.value;return n?null!=e.y?$r(n,e.y):t.yAccessor&&null!=e[t.yAccessor]?$r(n,e[t.yAccessor]):null:null}function Mt(e){return null==e?null:String(e)}function At(e,t,n){return t.stickyPositionCache?.set(e,n),n}function St(e,t,n){let i=e.anchor||e.lifecycle?.anchor||"fixed";if("latest"===i){if(null!=e.pointId&&n.pointNodes&&n.pointNodes.length>0)for(let i=n.pointNodes.length-1;i>=0;i--){let r=n.pointNodes[i];if(r.pointId===e.pointId)return At(t,n,{x:r.x,y:r.y})}let i=function(e){let t=e.data;if(!t||0===t.length)return null;let n=t[t.length-1],i=e.scales?.x??e.scales?.time,r=e.scales?.y??e.scales?.value;if(!i||!r)return null;let o=e.xAccessor||"x",l=e.yAccessor||"y",a=n[o],s=n[l];if(null==a||null==s)return null;let u=$r(i,a),c=$r(r,s);return null==u||null==c?null:{x:u,y:c}}(n);return i?At(t,n,i):null}if("semantic"===i){let i=function(e,t,n){let i=function(e){return Mt(e.provenance?.stableId??e.stableId)}(e);if(!i)return null;let r=n.pointNodes?.find(e=>Mt(e.pointId)===i);if(r)return At(t,n,{x:r.x,y:r.y});let o=n.data?.find(e=>function(e){return Mt(e.stableId??e.id??e.provenance?.stableId)}(e)===i);if(!o)return null;let l=wt(o,n),a=kt(o,n);return null==l||null==a?null:At(t,n,{x:l,y:a})}(e,t,n);if(i)return i}let r=null,o=null;if(null!=e.pointId&&n.pointNodes){let t=n.pointNodes.find(t=>t.pointId===e.pointId);t&&(r=t.x,o=t.y)}if((null==r||null==o)&&(r=wt(e,n),o=kt(e,n)),null!=r&&null!=o)return At(t,n,{x:r,y:o});if("sticky"===i){let e=n.stickyPositionCache?.get(t);if(e)return e}return null}function $t(e,t,n,i=50){let r=n.width||0,o=n.height||0;return e>=-i&&e<=r+i&&t>=-i&&t<=o+i}function Ct(e,t,n,i){let r=Wi(e.fill??e.color,t,i),o="string"==typeof e.fill&&e.fill?e.fill:"string"==typeof e.color&&e.color?e.color:i;return Ei(e.gradient,t,n,o)??r}function Lt(e,t,n){let i=e.position,r="string"==typeof i&&Uo.has(i)?i:"bottom-left",o=r.endsWith("left")?"left":r.endsWith("right")?"right":"center",l=r.startsWith("top")?"top":r.startsWith("bottom")?"bottom":"middle",a="top"===l?0:"bottom"===l?n:n/2;return{x:("left"===o?0:"right"===o?t:t/2)+("number"==typeof e.dx&&Number.isFinite(e.dx)?e.dx:0),y:a+("number"==typeof e.dy&&Number.isFinite(e.dy)?e.dy:0),textAnchor:"start"===e.textAnchor||"middle"===e.textAnchor||"end"===e.textAnchor?e.textAnchor:"left"===o?"start":"right"===o?"end":"middle",dominantBaseline:"auto"===e.dominantBaseline||"middle"===e.dominantBaseline||"hanging"===e.dominantBaseline?e.dominantBaseline:"top"===l?"hanging":"bottom"===l?"auto":"middle"}}function Nt(e,t,n,i){return{...Lt(e,t,n),fill:e.fill??e.color??i.fill,fontSize:e.fontSize??i.fontSize,fontFamily:e.fontFamily??i.fontFamily,fontWeight:e.fontWeight,fontStyle:e.fontStyle,letterSpacing:e.letterSpacing,opacity:e.opacity,className:e.className,style:{pointerEvents:"none"}}}function zt({annotation:e,width:t,height:n,defaults:i=qo}){let r=e.label??e.text;return null==r?null:zr("text",{...Nt(e,t,n,i),children:r})}function It(e,t){let n=Sr(e,t);return null!=n&&Number.isFinite(n)?n:Number.NaN}function Rt(e,t={},n=!1){return function(e,i,r){switch(e.type){case"label":case"callout":case"callout-circle":case"callout-rect":{let t=St(e,i,r);if(!t)return null;let{x:n,y:o}=t;if(!$t(n,o,r))return null;let l="callout"===e.type?"callout-circle":e.type,a="callout-circle"===l?{radius:e.radius??12,radiusPadding:e.radiusPadding}:"callout-rect"===l?{width:e.width,height:e.height}:void 0;return zr(vt,{noteData:{x:n,y:o,dx:e.dx??30,dy:e.dy??-30,note:ht(e),type:l,...a?{subject:a}:{},connector:e.connector||{end:"arrow"},color:e.color,disable:e.disable,opacity:e.opacity,strokeDasharray:e.strokeDasharray,className:e.className}},`ann-${i}`)}case"x-threshold":case"y-threshold":{let t="x-threshold"===e.type,n=null!=e.value?{...e,[t?"x":"y"]:e.value}:e,o=t?wt(n,r):kt(n,r);return null==o?null:zr(dt,{ann:e,position:o,vertical:t,width:r.width||0,height:r.height||0,color:e.color||"#f97316",bold:!0},`ann-${i}`)}case"enclose":{let t=(e.coordinates||[]).map(e=>({x:wt({...e,type:"point"},r),y:kt({...e,type:"point"},r),r:1})).filter(e=>null!=e.x&&null!=e.y);if(t.length<2)return null;let n=Yr(t),o=e.padding||10;return Ir("g",{children:[zr("circle",{cx:n.x,cy:n.y,r:n.r+o,fill:e.fill||"none",fillOpacity:e.fillOpacity??.1,stroke:e.color||"var(--semiotic-text-secondary, #666)",strokeWidth:1.5,strokeDasharray:"4,2"}),e.label&&zr(c,{x:n.x,y:n.y-n.r-o-4,textAnchor:"middle",fill:e.color||"var(--semiotic-text-secondary, #666)",fontSize:12,text:e.label,background:e.labelBackground??"none"})]},`ann-${i}`)}case"rect-enclose":{let t=(e.coordinates||[]).map(e=>({x:wt({...e,type:"point"},r),y:kt({...e,type:"point"},r)})).filter(e=>null!=e.x&&null!=e.y);if(t.length<2)return null;let n=e.padding||10,o=t.map(e=>e.x),l=t.map(e=>e.y),[a,s]=Nr(o),[u,d]=Nr(l),h=a-n,f=s+n,m=u-n;return Ir("g",{children:[zr("rect",{x:h,y:m,width:f-h,height:d+n-m,fill:e.fill||"none",fillOpacity:e.fillOpacity??.1,stroke:e.color||"var(--semiotic-text-secondary, #666)",strokeWidth:1.5,strokeDasharray:"4,2"}),e.label&&zr(c,{x:(h+f)/2,y:m-4,textAnchor:"middle",fill:e.color||"var(--semiotic-text-secondary, #666)",fontSize:12,text:e.label,background:e.labelBackground??"none"})]},`ann-${i}`)}case"highlight":{let t=r.data||[],n="function"==typeof e.filter?t.filter(e.filter):e.field&&null!=e.value?t.filter(t=>t[e.field]===e.value):[],o={stroke:e.color||"#f97316",strokeWidth:2,fill:"none"};return zr("g",{children:n.map((t,n)=>{let i=wt(t,r),l=kt(t,r);if(null==i||null==l)return null;let a="function"==typeof e.r?e.r(t):e.r||6,s="function"==typeof e.style?e.style(t):e.style||o;return zr("circle",{cx:i,cy:l,r:a,...s},`hl-${n}`)})},`ann-${i}`)}case"bracket":{let t=wt(e,r),n=kt(e,r);return zr(vt,{noteData:{x:t??0,y:n??0,dx:e.dx||0,dy:e.dy||0,note:ht(e),type:"bracket",subject:{type:e.bracketType||"curly",width:e.width,height:e.height,depth:e.depth||30},color:e.color}},`ann-${i}`)}case"trend":{let t=function(e,t){let n=t.scales?.x??t.scales?.time,i=t.scales?.y??t.scales?.value;if(!n||!i)return[];let r=t.data||[],o=t.xAccessor||"x",l=t.yAccessor||"y",a="horizontal"===t.projection,s="ordinal"===t.frameType;s&&a&&([o,l]=[l,o]);let u=e=>Sr(n,e)??Number.NaN,c=e=>Sr(i,e)??Number.NaN,d=a?c:u,h=s?t.scales?.o?.domain().map(String)??[...new Set(r.filter(e=>null!=e[o]).map(e=>String(e[o])))].sort((e,t)=>d(e)-d(t)):[],f=new Map(h.map((e,t)=>[e,t])),m=wi(r.map(e=>[s?null==e[o]?void 0:f.get(String(e[o])):e[o],e[l]]));return m.length<2?[]:("loess"===e.method?ki(m,e.bandwidth??.3):("polynomial"===e.method?Mi(m,e.order??2):Ai(m)).points).map(([e,t])=>{if(!s)return[u(e),c(t)];let n=d(h[e]);return a?[u(t),n]:[n,c(t)]}).filter(([e,t])=>Number.isFinite(e)&&Number.isFinite(t))}(e,r);if(t.length<2)return null;let n=t.map(([e,t])=>`${e},${t}`).join(" "),o=e.color||"#6366f1",[l,a]=t[t.length-1];return Ir("g",{children:[zr("polyline",{points:n,fill:"none",stroke:o,strokeWidth:e.strokeWidth??2,strokeDasharray:e.strokeDasharray||"6,3"}),e.label&&zr("text",{x:l+4,y:a-4,fill:o,fontSize:11,children:e.label})]},`ann-${i}`)}case"band":{let t=r.scales?.y??r.scales?.value,o=Cr(t,e.y0,0),l=Cr(t,e.y1,1);if(t&&(null!=e.y0&&null==o||null!=e.y1&&null==l))return null;let a=o??0,s=l??(r.height||0),u=Ct(e,`ann-${i}`,"vertical","var(--semiotic-primary, #6366f1)"),d=n&&"under"===e.layer;return Ir("g",{opacity:e.opacity,children:[!d&&u.def&&zr("defs",{children:u.def}),!d&&zr("rect",{x:0,y:Math.min(a,s),width:r.width||0,height:Math.abs(s-a),fill:u.fill,fillOpacity:e.fillOpacity??.1}),e.label&&zr(c,{x:(r.width||0)-4,y:ct(a,s),textAnchor:"end",fill:e.labelColor??(e.color||"var(--semiotic-primary, #6366f1)"),fontSize:11,fontWeight:"bold",text:e.label,background:e.labelBackground??"halo"})]},`ann-${i}`)}case"x-band":{let t=r.scales?.x??r.scales?.time,o=Cr(t,e.x0,0),l=Cr(t,e.x1,1);if(null!=e.x0&&null==o||null!=e.x1&&null==l)return null;let a=o??0,s=l??(r.width||0),u=Ct(e,`ann-${i}`,"horizontal","var(--semiotic-primary, #6366f1)"),d=n&&"under"===e.layer;return Ir("g",{opacity:e.opacity,children:[!d&&u.def&&zr("defs",{children:u.def}),!d&&zr("rect",{x:Math.min(a,s),y:0,width:Math.abs(s-a),height:r.height||0,fill:u.fill,fillOpacity:e.fillOpacity??.1}),e.label&&zr(c,{x:Math.min(a,s)+4,y:16,textAnchor:"start",fill:e.labelColor??(e.color||"var(--semiotic-primary, #6366f1)"),fontSize:11,fontWeight:"bold",text:e.label,background:e.labelBackground??"halo"})]},`ann-${i}`)}case"envelope":{let t=r.data||[];if(t.length<2)return null;let n=r.xAccessor||"x",o=r.scales?.x??r.scales?.time,l=r.scales?.y??r.scales?.value;if(!o||!l)return null;let a=e=>It(o,e),s=e=>It(l,e),u=e.upperAccessor||"upperBounds",c=e.lowerAccessor||"lowerBounds",d=e.filter,h=t.filter(e=>!(null==e[u]||null==e[c]||d&&!d(e))).sort((e,t)=>e[n]-t[n]);if(h.length<2)return null;let f=Xo[r.curve||"linear"]||to,m=no().x(e=>a(e[n])).y0(e=>s(e[c])).y1(e=>s(e[u])).curve(f)(h);if(!m)return null;let y=e.fill||"#6366f1";return Ir("g",{children:[zr("path",{d:m,fill:y,fillOpacity:e.fillOpacity??.15,stroke:"none"}),e.label&&h.length>0&&zr("text",{x:a(h[h.length-1][n])+4,y:s(h[h.length-1][u])-4,fill:y,fontSize:11,children:e.label})]},`ann-${i}`)}case"anomaly-band":{let t=(r.data||[]).filter(t=>!e.filter||e.filter(t));if(t.length<2)return null;let n=r.yAccessor||"y",o=r.scales?.x??r.scales?.time,l=r.scales?.y??r.scales?.value;if(!o||!l)return null;let a=e=>It(l,e),s=t.map(e=>$i(e[n])).filter(e=>null!==e);if(s.length<2)return null;let u=s.reduce((e,t)=>e+t,0)/s.length,c=s.reduce((e,t)=>e+(t-u)**2,0)/s.length,d=Math.sqrt(c),h=e.threshold??2,f=u+h*d,m=u-h*d,y=!1!==e.showBand,p=e.fill||"#6366f1",g=e.fillOpacity??.1,b=e.anomalyColor||"#ef4444",x=e.anomalyRadius??6,v=a(f),w=a(m),k=t.filter(e=>{let t=$i(e[n]);return null!=t&&Math.abs(t-u)>h*d});return Ir("g",{children:[y&&zr("rect",{x:0,y:Math.min(v,w),width:r.width||0,height:Math.abs(w-v),fill:p,fillOpacity:g}),k.map((e,t)=>{let n=wt(e,r),i=kt(e,r);return null==n||null==i?null:zr("circle",{cx:n,cy:i,r:x,fill:b,fillOpacity:.7,stroke:b,strokeWidth:1.5},`anomaly-${t}`)}),e.label&&zr("text",{x:(r.width||0)-4,y:Math.min(v,w)-4,textAnchor:"end",fill:p,fontSize:11,children:e.label})]},`ann-${i}`)}case"forecast":{let t=r.data||[],n=r.xAccessor||"x",o=r.yAccessor||"y",l=r.scales?.x??r.scales?.time,a=r.scales?.y??r.scales?.value;if(!l||!a)return null;let s=e=>It(l,e),u=e=>It(a,e),c=wi(t.map(e=>[e[n],e[o]])),d=Si(c,e);if(!d)return null;let{predict:h}=d,f=c[c.length-1][0],m=d.forecast(e.steps??5);if(!m.length)return null;let y=no().x(e=>s(e.x)).y0(e=>u(e.lower)).y1(e=>u(e.upper))(m);if(!y)return null;let p=m.map(e=>`${s(e.x)},${u(e.y)}`).join(" "),g=`${s(f)},${u(h(f))}`,b=e.fill||"#6366f1",x=e.strokeColor||"#6366f1";return Ir("g",{children:[zr("path",{d:y,fill:b,fillOpacity:e.fillOpacity??.15,stroke:"none"}),zr("polyline",{points:`${g} ${p}`,fill:"none",stroke:x,strokeWidth:e.strokeWidth??2,strokeDasharray:e.strokeDasharray??"6,3"}),e.label&&m.length>0&&zr("text",{x:s(m[m.length-1].x)+4,y:u(m[m.length-1].y)-4,fill:x,fontSize:11,children:e.label})]},`ann-${i}`)}case"widget":{let n,o;if(null!=e.px&&null!=e.py)n=e.px,o=e.py;else{let t=St(e,i,r);if(!t)return null;n=t.x,o=t.y}if(!$t(n,o,r))return null;let l=e.dx??0,a=e.dy??0,s=e.width??32,u=e.height??32,c=e.content??zr("span",{style:{fontSize:18,cursor:"default"},title:e.label||"Info",children:"ℹ️"});return zr("foreignObject",{x:n+l-s/2,y:o+a-u/2,width:s,height:u,style:{overflow:"visible",pointerEvents:"auto"},children:zr("div",{...f(e,t),style:{width:s,height:u,display:"flex",alignItems:"center",justifyContent:"center"},children:c})},`ann-${i}`)}case"text":{let t=St(e,i,r);if(!t)return null;let{x:n,y:o}=t,l=n+(e.dx||0),a=o+(e.dy||0),s=e.color||"var(--semiotic-text, #333)",u=zr("text",{x:l,y:a,fill:s,fontSize:e.fontSize||11,opacity:e.opacity,strokeDasharray:e.strokeDasharray,dominantBaseline:"middle",style:{fontFamily:"inherit"},children:e.label});return!0!==e._redundantConnector?jr.cloneElement(u,{key:`ann-text-${i}`}):Ir("g",{opacity:e.opacity,strokeDasharray:e.strokeDasharray,children:[zr("line",{x1:n,y1:o,x2:l,y2:a,stroke:s,strokeWidth:1,strokeOpacity:.5,style:{pointerEvents:"none"}}),jr.cloneElement(u,{opacity:void 0,strokeDasharray:void 0})]},`ann-text-${i}`)}case"frame-text":return zr(zt,{annotation:e,width:r.width||0,height:r.height||0},`ann-frame-text-${i}`);case"category-highlight":{let t=e.category;if(null==t)return null;let n=e=>"function"==typeof e&&"function"==typeof e.bandwidth,o=r.scales?.o,l=r.scales?.x,a=r.scales?.y,s=n(o)?o:n(l)?l:n(a)?a:null;if(!s)return null;let u=s(String(t));if(null==u)return null;let d=s.bandwidth(),h=r.projection?"vertical"===r.projection:s===l,f=e.color||"var(--semiotic-primary, #4589ff)",m=e.opacity??.15,y=e.label;return Ir("g",h?{children:[zr("rect",{x:u,y:0,width:d,height:r.height||0,fill:f,fillOpacity:m}),y&&zr(c,{x:u+d/2,y:16,textAnchor:"middle",fill:f,fontSize:12,fontWeight:"bold",text:y,background:e.labelBackground??"none"})]}:{children:[zr("rect",{x:0,y:u,width:r.width||0,height:d,fill:f,fillOpacity:m}),y&&zr(c,{x:12,y:u+d/2,dominantBaseline:"middle",fill:f,fontSize:12,fontWeight:"bold",text:y,background:e.labelBackground??"none"})]},`ann-${i}`)}default:return null}}}function jt(e){return"string"==typeof e?.type?e.type:""}function Ot(e){return!!e&&"object"==typeof e&&Jo.has(jt(e))}function Tt(e){return Qo.has(jt(e))&&!function(e){return Array.isArray(e?.disable)&&e.disable.includes("connector")}(e)}function Ft(e,t,n){return Math.max(t,Math.min(n,e))}function Wt(e){return Ot(e)}function Et(e){return"primary"===e?.emphasis||!0===e?.defensive}function Dt(e,t,n={}){if("number"==typeof n.maxAnnotations&&Number.isFinite(n.maxAnnotations))return Math.max(0,Math.floor(n.maxAnnotations));if(!(e>0&&t>0))return 1/0;let i=n.areaPerAnnotation&&n.areaPerAnnotation>0?n.areaPerAnnotation:2e4;return Math.max(1,Math.round(e*t/i))}function Pt(e){let t,n=e?.emphasis;t="primary"===n?100:"secondary"===n?10:50;let i=e?.provenance?.confidence;switch("number"==typeof i&&Number.isFinite(i)&&(t+=15*Ft(i,0,1)),e?.lifecycle?.freshness){case"fresh":t+=8;break;case"aging":t+=4;break;case"stale":t+=1;break;case"expired":t-=200}return t}function Ht(e){let t=e?.provenance;if(!t||"object"!=typeof t)return e;let n="string"==typeof t.source?Object.prototype.hasOwnProperty.call(rl,t.source)?rl[t.source]:t.source:null,i="number"==typeof t.confidence&&Number.isFinite(t.confidence)?`${Math.round(100*Math.max(0,Math.min(1,t.confidence)))}%`:null;if(!n&&!i||null!=e.label&&"string"!=typeof e.label)return e;let r=[n,i].filter(Boolean).join(" · "),o="string"==typeof e.label?e.label:"";return o.includes(`(${r})`)?e:{...e,label:o?`${o} (${r})`:`(${r})`}}function Bt(e){if(!Gt(e))return e;let t="string"==typeof e.mobileText?e.mobileText:void 0,n="string"==typeof e.shortText?e.shortText:void 0,i=t??n;return!i||"string"!=typeof e.label&&null!=e.label?e:{...e,label:i}}function Gt(e){return Ot(e)}function _t(e,t,n,i,r){let o=e+n,l=t+i;return Math.abs(n)>Math.abs(i)?{x:n>=0?o+4:o-r.width-4,y:i<0?l-r.height:l,width:r.width,height:r.height}:{x:n>=0?o:o-r.width,y:i<0?l-r.height-4:l+4,width:r.width,height:r.height}}function Vt(e,t){return{x:e.x-t,y:e.y-t,width:e.width+2*t,height:e.height+2*t}}function Yt(e,t){return Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x))*Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y))}function Ut(e,t,n,i,r,o,l,a){let s=Vt(e,l),u=.4*Math.hypot(t.dx,t.dy)+80*function(e,t,n,i){let r=Math.max(0,i-e.x),o=Math.max(0,i-e.y),l=Math.max(0,e.x+e.width-(t-i)),a=Math.max(0,e.y+e.height-(n-i));return(r+l)*e.height+(o+a)*e.width}(s,r,o,a);for(let e of n)u+=12*Yt(s,e);for(let e of i)u+=4*Yt(s,e);return u}function qt(e){let{annotations:t,context:n,defaultOffset:i=Zo,notePadding:r=el,markPadding:o=tl,edgePadding:l=nl,preserveManualOffsets:a=!0,routeLongConnectors:s=!0,connectorThreshold:u=il,density:c,progressiveDisclosure:d=!1,redundantCues:h=!1,responsive:f,mobile:m,cohesion:y,audience:p}=e,g=n.width||0,b=n.height||0,x="object"==typeof m?m:{},v=x.breakpoint??480,w=!!m&&g<=v,k=w&&!1!==x.preferShortText?t.map(Bt):t,M=w&&!c?{maxAnnotations:x.maxAnnotations??("callout-list"===x.strategy?1:2),minVisible:x.minVisible??1}:c,A=d||w&&(!1!==x.progressiveDisclosure||"callout-list"===x.strategy),S=w&&!f?x.responsive??{minWidth:v}:f,$=w&&!y?x.cohesion:y;if(0===k.length||g<=0||b<=0)return k.slice();let C=[],L=function(e,t){return(e.pointNodes||[]).map(e=>{let n=Math.max(1,e.r||1)+t;return{x:e.x-n,y:e.y-n,width:2*n,height:2*n}})}(n,o),N=!1,z=k.map((e,t)=>{if(!Gt(e))return e;let o=function(e,t,n){if("widget"===e.type&&"number"==typeof e.px&&"number"==typeof e.py)return{x:e.px,y:e.py};let i=e.pointId??e.nodeId;if(null!=i&&n.pointNodes){let e=n.pointNodes.find(e=>e.pointId===i);if(e)return{x:e.x,y:e.y}}let r=e.coordinates,o=n.scales?.geoProjection;if(Array.isArray(r)&&r.length>=2&&o){let e=r[0],t=r[1];if("number"==typeof e&&"number"==typeof t){let n=o([e,t]);if(n&&"number"==typeof n[0]&&"number"==typeof n[1])return{x:n[0],y:n[1]}}}return n.scales||"number"!=typeof e.x||"number"!=typeof e.y?St(e,t,n):{x:e.x,y:e.y}}(e,t,n);if(!o)return e;let c=function(e){if("widget"===e.type)return{width:"number"==typeof e.width?e.width:32,height:"number"==typeof e.height?e.height:32};let t=ft(e);if(t)return{width:Math.max(24,t.width+10),height:Math.max(18,t.height+6)};let n="number"==typeof e.wrap?e.wrap:120,i=[...mt("string"==typeof e.title?e.title:void 0,n,7),...mt("string"==typeof e.label?e.label:void 0,n,7)],r=i.reduce((e,t)=>Math.max(e,t.length),0);return{width:Math.max(24,Math.min(n,7*r)+10),height:Math.max(18,16*i.length+6)}}(!0===e.defensive?Ht(e):e);if(a&&function(e){return"number"==typeof e.dx||"number"==typeof e.dy}(e)){let t=function(e){return"text"===e.type||"widget"===e.type?{dx:0,dy:0}:{dx:30,dy:-30}}(e),n="number"==typeof e.dx?e.dx:t.dx,i="number"==typeof e.dy?e.dy:t.dy;return C.push(Vt(_t(o.x,o.y,n,i,c),r)),e}let d=null,h=1/0;for(let e of function(e){let t=1.6*e;return[{dx:e,dy:-e},{dx:-e,dy:-e},{dx:e,dy:e},{dx:-e,dy:e},{dx:e,dy:0},{dx:-e,dy:0},{dx:0,dy:-e},{dx:0,dy:e},{dx:t,dy:-t},{dx:-t,dy:-t},{dx:t,dy:t},{dx:-t,dy:t}]}(i)){let t=Ut(_t(o.x,o.y,e.dx,e.dy,c),e,C,L,g,b,r,l);t<h&&(d=e,h=t)}if(!d)return e;let f=Vt(_t(o.x,o.y,d.dx,d.dy,c),r);C.push(f);let m=Math.hypot(d.dx,d.dy),y=s&&m>=u&&"text"!==e.type&&"widget"!==e.type?{...e.connector||{end:"arrow"},type:"curve"}:e.connector;return N=!0,{...e,dx:d.dx,dy:d.dy,...y?{connector:y}:{}}}),I=N?z:k.slice(),R=I;if(h){let e=!1,t=I.map(t=>{let n=function(e){if("text"!==e.type||"string"!=typeof e.color)return e;let t="number"==typeof e.dx?e.dx:0,n="number"==typeof e.dy?e.dy:0;return Math.hypot(t,n)<8?e:{...e,_redundantConnector:!0}}(t);return n!==t&&(e=!0),n});R=e?t:I}{let e=!1,t=R.map(t=>{if(!0!==t?.defensive)return t;let n=Ht(t);return n!==t&&(e=!0),n});R=e?t:R}let j,O=new Set;if(M){let e="object"==typeof M?M:{},t=function(e){if(!e)return 1;let t=function(e){let t=e?.familiarity;if(!t)return 3;let n=Object.values(t).filter(e=>"number"==typeof e&&Number.isFinite(e));return 0===n.length?3:n.reduce((e,t)=>e+t,0)/n.length}(e);return t<=2?1.5:t>=4?.6:1}(p),n=1===t?e:{...e,maxAnnotations:Math.max(0,Math.round((e.maxAnnotations??Dt(g,b,e))*t))},{deferred:i}=function(e){let{annotations:t,width:n,height:i}=e,r=Math.max(0,e.minVisible??1),o=Dt(n,i,e),l=t.map((e,t)=>({annotation:e,index:t,note:Wt(e)})),a=l.filter(e=>e.note);if(0===a.length||a.length<=o)return{visible:t.slice(),deferred:[],budget:o};let s=a.filter(e=>Et(e.annotation)),u=a.filter(e=>!Et(e.annotation)).sort((e,t)=>Pt(t.annotation)-Pt(e.annotation)||e.index-t.index),c=Math.max(0,o-s.length),d=Math.max(0,r-s.length),h=Math.min(u.length,Math.max(c,d)),f=new Set([...s.map(e=>e.index),...u.slice(0,h).map(e=>e.index)]),m=[],y=[];for(let{annotation:e,index:t,note:n}of l)!n||f.has(t)?m.push(e):y.push(e);return{visible:m,deferred:y,budget:o}}({annotations:R,width:g,height:b,...n});for(let e of i)O.add(e)}if(S){let e="object"==typeof S&&"number"==typeof S.minWidth?S.minWidth:480;if(g<=e)for(let e of R)Gt(e)&&"secondary"===e.emphasis&&O.add(e)}if(O.size>0)for(let e of R)!0===e?.defensive&&O.delete(e);return j=0===O.size?R:A?R.map(e=>O.has(e)?{...e,_annotationDeferred:!0}:e):R.filter(e=>!O.has(e)),$?function(e,t){let n=!1,i=e.map(e=>Gt(e)&&"blended"!==e.cohesion&&"layer"!==e.cohesion?(n=!0,{...e,cohesion:t}):e);return n?i:e}(j,$):j}function Xt({title:e,totalWidth:t,marginTop:n}){return e?"string"!=typeof e?zr("foreignObject",{x:0,y:0,width:t,height:n,children:e}):zr("text",{x:t/2,y:22,textAnchor:"middle",fontWeight:"bold",fill:"var(--semiotic-text, #333)",fontSize:14,className:"semiotic-chart-title",style:{userSelect:"none",fontSize:"var(--semiotic-title-font-size, 14px)",fontFamily:"var(--semiotic-title-font-family, var(--semiotic-font-family, sans-serif))",fontWeight:"var(--semiotic-title-font-weight, bold)"},children:e}):null}function Kt(e){if(!1!==e?.interactive)return e?.style?.cursor}function Jt(e){if(!e)return!1;for(let t of e)if(Kt(t))return!0;return!1}function Qt(e,t){if(!e)return;let n=t??"";e.style.cursor!==n&&(e.style.cursor=n)}function Zt(e,t){return Qt(e),Jt(t)}function en(e,t,n){if(e){if(!t.inside||"touch"===t.pointerType)return void Qt(e);Qt(e,n(t))}}function tn(e){let t=jr.useRef(null);jr.useEffect(()=>{e.current&&(t.current=e.current)}),jr.useEffect(()=>()=>Qt(t.current),[])}function nn(e,t,n){let i=Kt(t);return i&&null!=e&&!1!==e?zr("g",{style:{cursor:i},"data-semiotic-mark-cursor":i,children:e},n):e}function rn(){let e=Dr(ll,al,sl),[t,n]=Tr(()=>!e);return ol(()=>{n(!0)},[]),t}function on(){let e=Dr(ll,al,sl);return _r(e).current}function ln(e,t){return an(e,t,2)}function an(e,t,n){if(Object.is(e,t))return!0;if(0===n)return!1;if(Array.isArray(e)&&Array.isArray(t))return function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}(e,t);if(!sn(e)||!sn(t))return!1;let i=Object.keys(e),r=Object.keys(t);if(i.length!==r.length)return!1;for(let r of i)if(!Object.prototype.hasOwnProperty.call(t,r)||!an(e[r],t[r],n-1))return!1;return!0}function sn(e){if(null===e||"object"!=typeof e||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function un(e){let t=_r(e);return ln(t.current,e)||(t.current=e),t.current}function cn({hoverPoint:e,scene:t,active:n=!0}){let i="";if(n&&e){let n=e.data??e,r="stats"in e?e.stats:void 0,o=r&&t?.find(e=>e.stats===r)||t?.find(e=>e.datum===n)||t?.find(e=>Array.isArray(e.datum)&&e.datum.includes(n)),l=o?qi(o):n,a=r&&o&&("boxplot"===o.type||"violin"===o.type)&&Array.isArray(l)?{category:o.category,...Xi(o.stats)}:l;if(null!=a&&"object"==typeof a){let e=(Array.isArray(a)?a:[a]).map(e=>Object.entries(Xi(e)).map(([e,t])=>`${e}: ${t}`).join(", ")).filter(Boolean);i=e.length>0?`Data point: ${e.join("; ")}`:""}else i=`Data point: ${String(a)}`}return zr("div",{"aria-live":"polite","aria-atomic":"true",style:Ci,children:i})}function dn({children:e}){let[t,n]=jr.useState(!1),i=jr.useCallback(()=>n(e=>!e),[]),r=jr.useMemo(()=>({visible:t,setVisible:n,toggle:i}),[t,i]);return zr(ul.Provider,{value:r,children:e})}function hn(){let e=jr.useContext(ul);return e?e.toggle:null}function fn(e){let t=1;for(let n of e)dl.get(n)?.(t),t+=1}function mn({interaction:e,tableId:t,regionLabel:n,countLabel:i,summary:r,children:o,className:l=er}){let{isExpanded:a,containerRef:s,triggerRef:u,open:c,handleFocus:d,handleBlur:h,dismiss:f,announcement:m}=e,[y,p]=jr.useState(!1),g=function(e){let t=jr.useId(),n=jr.useRef(null);null==n.current&&(n.current=Symbol("summary-region"));let i=n.current,r=jr.useContext(hl),o=jr.useRef(null);null==o.current&&(o.current=function(e,t,n){let i=e.ordinals.get(n);if(null!=i)return i;let r=(e.counts.get(t)??0)+1;return e.counts.set(t,r),e.ordinals.set(n,r),r}(r??function(e){return fl?.ordinals.has(e)&&(fl=null),fl||(fl={counts:new Map,ordinals:new Map},ml||(ml=!0,queueMicrotask(()=>{fl=null,ml=!1}))),fl}(t),e,t));let[l,a]=jr.useState(o.current);return jr.useLayoutEffect(()=>{dl.set(i,a);let t=cl.get(e);return t||(t=new Set,cl.set(e,t)),t.add(i),fn(t),()=>{dl.delete(i),t.delete(i),0===t.size?cl.delete(e):fn(t)}},[e,i]),1===l?e:`${e} (${l})`}(n);return zr("div",{ref:s,id:t,className:a?l:tr,tabIndex:-1,onFocus:a?void 0:d,onBlur:a?h:void 0,style:a?Zi:y?Li:Ci,role:"region","aria-label":g,children:a?Ir(Rr,{children:[zr("div",{role:"status","aria-atomic":"true",style:Ci,children:m}),zr("button",{type:"button",className:"semiotic-accessible-data-table-close",onClick:f,"aria-label":"Close data summary",style:Ki,children:"×"}),r&&zr("div",{className:"semiotic-accessible-data-table-summary",role:"note",style:Ji,children:r}),o]}):Ir("button",{ref:u,type:"button",onClick:c,onFocus:()=>p(!0),onBlur:()=>p(!1),style:Qi,children:["View data summary (",i,")"]})})}function yn(){let[e,t]=jr.useState(!1),[n,i]=jr.useState(""),r=jr.useContext(ul),o=r?.visible??!1,l=e||o,a=jr.useRef(null),s=jr.useRef(null),u=jr.useRef(null),c=jr.useRef(!1),d=jr.useRef(!1),h=jr.useRef(null);yl(()=>{if(l&&!d.current){let e=document.activeElement;e instanceof HTMLElement&&e!==document.body&&!a.current?.contains(e)&&(u.current=e),a.current?.focus()}else!l&&d.current&&(c.current&&(u.current?.isConnected?u.current:s.current)?.focus(),c.current=!1,u.current=null,h.current=null,i(""));d.current=l;let e=h.current;l&&e&&(e.table.querySelectorAll("tbody tr")[e.index]?.focus(),h.current=null)});let f=()=>t(!0);return{isExpanded:l,containerRef:a,triggerRef:s,open:f,handleFocus:e=>{e.target!==e.currentTarget||l||(e.relatedTarget instanceof HTMLElement&&(u.current=e.relatedTarget),f())},handleBlur:e=>{o||a.current?.contains(e.relatedTarget)||t(!1)},dismiss:()=>{c.current=!0,o&&r?.setVisible(!1),t(!1)},revealRows:(e,t,n,r,o="rows")=>{let l=e.previousElementSibling;l&&(h.current={table:l,index:t}),i(`${n} of ${r} ${o} shown.`)},announcement:n}}function pn({accessibleTable:e,children:t}){let n=rn();return"object"!=typeof e?t:n?zr(jr.Suspense,{fallback:null,children:zr(pl,{target:e.portalTarget,children:t})}):null}function gn(e,t){if(!e||0===e.length)return`${t}, empty`;let n={};for(let t of e){if(null===t?.datum)continue;let e=String(t.type);n[e]=(n[e]||0)+1}if(0===Object.keys(n).length)return`${t}, empty`;let i=[],r={point:["point","points"],line:["line","lines"],area:["area","areas"],rect:["bar","bars"],heatcell:["cell","cells"],circle:["node","nodes"],candlestick:["candlestick","candlesticks"],wedge:["wedge","wedges"],arc:["arc","arcs"],geoarea:["region","regions"]},o=Object.keys(r),l=Object.keys(n).sort((e,t)=>{let n=o.indexOf(e),i=o.indexOf(t);return(-1===n?999:n)-(-1===i?999:i)});for(let e of l){let t=r[e];i.push(t?nr(n[e],t[0],t[1]):nr(n[e],e))}return`${t}, ${i.join(", ")}`}function bn(e,t,n){let i=[];return e>0&&i.push(nr(e,"node")),t>0&&i.push(nr(t,"edge")),0===i.length?`${n}, empty`:`${n}, ${i.join(", ")}`}function xn({accessibleTable:e,...t}){return e?Ir(pn,{accessibleTable:e,children:[zr(kn,{tableId:t.tableId}),zr(vn,{...t})]}):null}function vn(e){let{scene:t,chartType:n,tableId:i,chartTitle:r}=e,o=yn(),l=`Data summary for ${r||n}`;return t&&0!==t.length?zr(mn,{interaction:o,tableId:i,regionLabel:l,countLabel:nr(ir(t),"element"),children:o.isExpanded&&zr(jr.Suspense,{fallback:zr("div",{role:"status",children:"Loading data summary…"}),children:zr(gl,{...e,revealRows:o.revealRows})})}):i?zr("span",{id:i,tabIndex:-1,style:Ci}):null}function wn({summary:e}){return e?zr("div",{role:"note",style:Ci,children:e}):null}function kn({tableId:e}){let[t,n]=jr.useState(!1);return zr("a",{href:`#${e}`,style:t?Li:Ci,onClick:t=>{t.preventDefault();let n=document.getElementById(e);n&&requestAnimationFrame(()=>n.focus())},onFocus:()=>n(!0),onBlur:()=>n(!1),children:"Skip to data table"})}function Mn({active:e,hoverPoint:t,margin:n,size:i,shape:r="circle",width:o,height:l,pathData:a}){if(!e||!t)return null;let s,u=t.x+n.left,c=t.y+n.top;if("geoarea"!==r&&"path"!==r||!a)if("rect"===r&&null!=o&&null!=l){let e=Math.max(o,4),t=Math.max(l,4);s=zr("rect",{x:u-e/2-3,y:c-t/2-3,width:e+6,height:t+6,rx:3,fill:"none",stroke:bl,strokeWidth:2,strokeDasharray:"4,2"})}else s=zr("circle","wedge"===r?{cx:u,cy:c,r:12,fill:"none",stroke:bl,strokeWidth:2.5,strokeDasharray:"6,3"}:{cx:u,cy:c,r:8,fill:"none",stroke:bl,strokeWidth:2,strokeDasharray:"4,2"});else s=zr("g",{transform:`translate(${n.left},${n.top})`,children:zr("path",{d:a,fill:"none",stroke:bl,strokeWidth:2.5,strokeDasharray:"6,3"})});return zr("svg",{style:{position:"absolute",left:0,top:0,width:i[0],height:i[1],pointerEvents:"none",zIndex:2},"aria-hidden":"true",children:s})}function An(e,t,n){return"function"==typeof e?e({size:t,margin:n}):e}function Sn(e){let t=pr(),n=_r(t);n.current=t;let[i,r]=Ne(e.sizeProp,e.responsiveWidth,e.responsiveHeight),o=r[0],l=r[1],a=Fr(()=>[o,l],[o,l]),s=!!e.title,u=Fr(()=>{let t=function(e,t){let n=t?36:0;return e.top>=n?e:{...e,top:n}}({...e.marginDefault,...e.userMargin},s);if(e.legend&&!e.legendMarginReserved){let n={...t},i=e.legendPosition??"right";xe(t,{legend:e.legend,position:i,size:a,hasTitle:s,legendLayout:e.legendLayout,axisChrome:e.axisChrome}),ae(t,n,a,i)}return t},[e.marginDefault,e.userMargin,e.legend,e.legendPosition,e.legendLayout,e.axisChrome,e.legendMarginReserved,s,a]),c=Math.max(1,r[0]-u.left-u.right),d=Math.max(1,r[1]-u.top-u.bottom),h=An(e.foregroundGraphics,r,u),f=An(e.backgroundGraphics,r,u),m=fr(e=>e.theme),{transition:y,introEnabled:p}=Lr(e.animate,e.transitionProp),g=`semiotic-table-${jr.useId()}`,b=_r(null);if(!b.current){let t=!e.suspendWhenHidden||typeof document>"u"||!document.hidden;b.current=new xi({clock:e.clock,random:e.random,seed:e.seed,paused:e.paused,visible:t})}let x=b.current;x.configure({clock:e.clock,random:e.random,seed:e.seed});let v=_r(null),w=_r(e.frameScheduler??vl);w.current=e.frameScheduler??vl;let k=_r(null),M=_r(!1),A=_r(()=>{}),S=Pr(()=>{if(null!==v.current||M.current)return;let e=w.current,t=!1,n=!1,i=e.requestAnimationFrame(()=>{t=!0;let e=!n;e&&(M.current=!0),v.current=null,k.current=null;try{e?A.current():io(A.current)}finally{e&&(M.current=!1)}});n=!0,t||(v.current=i,k.current=e)},[]),$=Pr(()=>{null!==v.current&&((k.current??w.current).cancelAnimationFrame(v.current),v.current=null,k.current=null)},[]),C=Pr(()=>{null!==v.current&&($(),A.current())},[$]);xl(()=>{x.setPaused(!0===e.paused)},[x,e.paused]),Wr(()=>{if(!e.suspendWhenHidden||typeof document>"u")return void x.setVisible(!0);let t=()=>x.setVisible(!document.hidden);return t(),document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)},[x,e.suspendWhenHidden]),Wr(()=>()=>{$()},[$]);let L=_r(()=>{}),N=_r(()=>{}),z=_r({inside:!1,clientX:0,clientY:0,pointerType:void 0}),I=_r(null),R=_r(null),j=_r(null),O=Pr(()=>{let e=I.current;I.current=null,e&&L.current(e)},[]),T=Pr(e=>{let t=z.current;if(t.inside=!0,t.clientX=e.clientX,t.clientY=e.clientY,t.pointerType=e.pointerType,I.current={clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType},null===R.current){let e=w.current,t=!1,n=e.requestAnimationFrame(()=>{t=!0,R.current=null,j.current=null,O()});t||(R.current=n,j.current=e)}},[O]),F=Pr(()=>{null!==R.current&&((j.current??w.current).cancelAnimationFrame(R.current),R.current=null,j.current=null),O()},[O]),W=Pr(()=>{z.current.inside=!1,I.current=null,F(),N.current()},[F]);Wr(()=>{if(typeof document>"u")return;let e=e=>{"Escape"===e.key&&z.current.inside&&W()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[W]),Wr(()=>()=>{I.current=null,null!==R.current&&((j.current??w.current).cancelAnimationFrame(R.current),R.current=null,j.current=null)},[]);let E=e.themeDirtyRef,D=_r(!1);return xl(()=>{if(!E)return;let t=!D.current;D.current=!0,(!t||!e.skipInitialThemeInvalidation)&&(Di(),E.current=!0,S())},[m,e.skipInitialThemeInvalidation,S,E]),Wr(()=>{if(E)return Pi(()=>i.current,()=>{E.current=!0,S()})},[i,S,E]),{reducedMotion:t,reducedMotionRef:n,responsiveRef:i,size:r,margin:u,adjustedWidth:c,adjustedHeight:d,resolvedForeground:h,resolvedBackground:f,currentTheme:m,transition:y,introEnabled:p,tableId:g,frameRuntime:x,rafRef:v,renderFnRef:A,scheduleRender:S,cancelRender:$,flushRender:C,hoverHandlerRef:L,hoverLeaveRef:N,onPointerMove:T,flushPointerMove:F,onPointerLeave:W,pointerStateRef:z}}function $n(e,t,n){let i=Math.round(t[0]*n),r=Math.round(t[1]*n),o=0===t[0]?n:i/t[0],l=0===t[1]?n:r/t[1],a=`${t[0]}px`,s=`${t[1]}px`;e.style.width!==a&&(e.style.width=a),e.style.height!==s&&(e.style.height=s);let u=e.width!==i||e.height!==r;return e.width!==i&&(e.width=i),e.height!==r&&(e.height=r),{effectiveDprX:o,effectiveDprY:l,resized:u}}function Cn(){if(!(typeof window>"u"||"function"!=typeof window.matchMedia))return lo!==window.matchMedia&&(lo=window.matchMedia,oo=window.matchMedia("(pointer: coarse)")),oo}function Ln(e,t,n,i){let r=e.getContext("2d");if(!r)return null;let{effectiveDprX:o,effectiveDprY:l}=$n(e,t,i);return r.setTransform(o,0,0,l,0,0),r.translate(n.left,n.top),r}function Nn(e,t){if(typeof window>"u")return 1;let n=window.devicePixelRatio||1,i=typeof window>"u"||!(!0===Cn()?.matches||Math.min(window.innerWidth||1/0,window.innerHeight||1/0)<768)?3:2,r="number"==typeof e&&e>0?e:i;if(!t)return Math.max(1,Math.min(n,r));let[o,l]=t,a=Math.min(Math.sqrt(8388608/(o*l)),16384/Math.max(o,l));return Math.max(a<1?0:1,Math.min(n,r,a))}function zn(e,t){return function(e){let{cancelRender:t,dirtyRef:n,frameRuntime:i,manageFrameRuntime:r,maxDevicePixelRatio:o,scheduleRender:l}=e,a=_r(null),s=_r(null),u=_r(!1),c=_r(!1),d=_r(!1);return wl(()=>{if(!e.size)return;let t=Nn(o,e.size);for(let n of[a.current,s.current])n&&$n(n,e.size,t)},[e.size?.[0],e.size?.[1],o,e.hydrated]),wl(()=>{!c.current&&(c.current=!0,e.skipInitialCanvasPaintInvalidation)||(e.canvasPaintInvalidator?e.canvasPaintInvalidator():e.dirtyRef.current=!0,e.scheduleRender())},e.canvasPaintDependencies),function(e){let{hydrated:t,wasHydratingFromSSR:n,storeRef:i,dirtyRef:r,renderFnRef:o,cancelRender:l,flushRender:a,cleanup:s}=e;ol(()=>{t&&n&&(i.current?.cancelIntroAnimation?.(),r.current=!0,l?.(),o.current())},[t,n]);let u=_r(a);u.current=a;let[c,d]=Tr(!1);ol(()=>{!n&&u.current&&d(!0)},[n]),ol(()=>{c&&u.current?.()},[c]);let h=_r(s);h.current=s,Wr(()=>()=>h.current?.(),[])}({hydrated:e.hydrated,wasHydratingFromSSR:e.wasHydratingFromSSR,storeRef:e.storeRef,dirtyRef:e.dirtyRef,renderFnRef:e.renderFnRef,cancelRender:e.cancelRender,flushRender:e.flushRender,cleanup:e.cleanup}),Wr(()=>{if(!1!==r)return i.subscribe(()=>{i.isActive?(n.current=!0,l()):t()})},[t,n,i,r,l]),Wr(()=>function(e){function t(){i||(n(),r=Nn(),e(),queueMicrotask(()=>{i||o()}))}if(typeof window>"u")return()=>{};let n=()=>{},i=!1,r=0,o=()=>{if("function"!=typeof window.matchMedia)return;let e=`(resolution: ${window.devicePixelRatio||1}dppx)`,i=window.matchMedia(e);i.media.includes("resolution")&&(n=gr(i,t))};o(),r=Nn();let l=Cn(),a=()=>{if(i)return;let t=Nn();t!==r&&(r=t,e())};window.addEventListener("resize",a);let s=gr(l,a);return()=>{i=!0,window.removeEventListener("resize",a),s(),n()}}(()=>{u.current=!0,l()}),[l]),Wr(()=>{d.current?(u.current=!0,l()):d.current=!0},[o,l]),{canvasRef:a,interactionCanvasRef:s,resolutionDirtyRef:u}}({...t,size:e.size,renderFnRef:e.renderFnRef,scheduleRender:e.scheduleRender,cancelRender:e.cancelRender,flushRender:e.flushRender,frameRuntime:e.frameRuntime})}function In({children:e,size:t,margin:n,backdropFill:i,overflowVisible:r=!1}){return e||i?Ir("svg",{role:"presentation",style:{position:"absolute",left:0,top:0,width:t[0],height:t[1],pointerEvents:"none",overflow:r?"visible":void 0},children:[i&&"transparent"!==i?zr("rect",{className:"stream-frame-background__backdrop",x:0,y:0,width:t[0],height:t[1],fill:i}):null,zr("g",{transform:`translate(${n.left},${n.top})`,children:e})]}):null}function Rn({x:e,y:t,containerWidth:n,containerHeight:i,margin:r,children:o,contentOwnsChrome:l=!1,className:a="stream-frame-tooltip",zIndex:s=1}){let u=br(),c=Number.isFinite(e)&&Number.isFinite(t),d=lr(o),h=jr.useRef(null),f="none"===u||l||sr(o),m=xr(h,!f&&c&&d),y=f||m,[p,g]=jr.useState(null);jr.useLayoutEffect(()=>{let e=h.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect(),n=getComputedStyle(e),i=parseFloat(n.width)||t.width,r=parseFloat(n.height)||t.height;!Number.isFinite(i)||!Number.isFinite(r)||g(e=>e&&e.ownsChrome===y&&Math.abs(e.width-i)<.5&&Math.abs(e.height-r)<.5?e:{width:i,height:r,ownsChrome:y})};if(t(),typeof ResizeObserver>"u")return;let n=new ResizeObserver(()=>io(t));return n.observe(e),()=>n.disconnect()},[a,n,i,c,d,y]);let b,x=jr.useRef(null),v=p?.ownsChrome===y?p:null,w=e,k=t,M=!1,A=!1;if(v){let r=i-t;M=n-e<v.width+12,A=r<v.height+12,w=Math.max(0,Math.min(e+(M?-v.width-12:12),n-v.width)),k=Math.max(0,Math.min(t+(A?-v.height-4:4),i-v.height)),b="none"}else b=`translate(${e>.7*n?"calc(-100% - 12px)":"12px"}, ${t<.3*i?"4px":"calc(-100% - 4px)"})`;let S=v?{flipX:M,flipY:A}:null,$=x.current,C=!S||!$||$.flipX!==S.flipX||$.flipY!==S.flipY;jr.useLayoutEffect(()=>{x.current=S});let L=y?null:vr,N=y?a:`${a} semiotic-tooltip`.trim();return c&&d?zr("div",{ref:h,className:N,"data-placement":S?"placed":"pending","data-flip-x":M?"true":"false","data-flip-y":A?"true":"false",style:{...L||{},position:"absolute",left:r.left+w,top:r.top+k,transform:b,...C&&{transition:"none"},pointerEvents:"none",zIndex:s,width:"max-content",maxWidth:y?n:`min(${n}px, ${vr.maxWidth})`,boxSizing:"border-box"},children:o}):null}function jn(e){return"touch"===e?"touch":"pointer"}function On(e){let t=e.target;return t instanceof Element&&t!==e.currentTarget&&null!=t.closest("button, a[href], input, select, textarea, summary, [contenteditable='true'], [role='button'], [role='link'], [role='checkbox'], [role='radio'], [role='switch']")}function Tn(e){let{onObservation:t,datum:n,x:i=0,y:r=0,chartType:o,chartId:l,context:a,timestamp:s=Date.now()}=e;if(t){if(!n)return void t({type:"hover-end",timestamp:s,chartType:o,chartId:l});t({type:"hover",datum:n,x:i,y:r,timestamp:s,chartType:o,chartId:l}),"focus"===a?.type&&t({type:"focus",datum:n,inputType:"touch"===a.inputType?"pointer":a.inputType,timestamp:s,chartType:o,chartId:l})}}function Fn(e){let{onObservation:t,datum:n,x:i=0,y:r=0,chartType:o,chartId:l,context:a,timestamp:s=Date.now()}=e;if(t){if(!n)return void t({type:"click-end",timestamp:s,chartType:o,chartId:l});t({type:"click",datum:n,x:i,y:r,timestamp:s,chartType:o,chartId:l}),"activate"===a?.type&&t({type:"activate",datum:n,inputType:a.inputType,timestamp:s,chartType:o,chartId:l})}}function Wn(e,t,n){return{width:n?.responsiveWidth?"100%":e,height:n?.responsiveHeight?"100%":t}}function En({componentName:e,width:t,height:n,children:i}){return zr(vo,{fallback:i=>zr(D,{componentName:e,message:i.message,width:t,height:n}),children:i})}function Dn(e,t,n,i,r){return!1===i||null==e||!Array.isArray(e)||e.some(e=>null!=e&&"object"==typeof e)?null:zr("div",{style:{...kl,...Wn(t,n,r)},children:i||"No data available"})}function Pn(e,t,n,i,r){if(!e||!1===i)return null;if(null!=i)return zr("div",{style:{...Wn(t,n,r),display:"flex",flexDirection:"column",alignItems:"stretch",textAlign:"center",justifyContent:"center",boxSizing:"border-box"},children:i});let o=Math.max(1,Math.min(5,Math.floor(n/40))),l=Math.max(8,Math.floor(n/(3*o))),a=Math.max(6,Math.floor(n/(2.5*o))),s=Math.floor((n-(o*(l+a)-a))/2),u=e=>r?.responsiveHeight?100*e/Math.max(1,n)+"%":e,c=Array.from({length:o},(e,t)=>zr("div",{className:"semiotic-loading-bar",style:{...Ml,position:"absolute",top:u(s+t*(l+a)),left:"10%",width:30+(37*t+13)%50+"%",height:u(l),opacity:.5+t%2*.2}},t));return zr("div",{style:{...Wn(t,n,r),position:"relative",overflow:"hidden",border:"1px solid var(--semiotic-border, #e0e0e0)",borderRadius:4,boxSizing:"border-box"},children:c})}function Hn(e,t,n,i){if("production"===process.env.NODE_ENV||!t||0===t.length||"string"!=typeof i)return;let r=t[0];if(!r||"object"!=typeof r||i in r)return;let o=Object.keys(r).join(", ");console.warn(`[semiotic] ${e}: ${n} "${i}" not found in data. Available keys: ${o}`)}function Bn(e,t={}){let n=t.mobileSemantics?.interaction,i="number"==typeof n?.targetSize?n.targetSize:"number"==typeof t.mobileSemantics?.minimumHitTarget?t.mobileSemantics.minimumHitTarget:void 0,r="mobile"===t.mode||"number"==typeof t.width&&t.width<=480,o=!!n||void 0!==i,l=e&&"object"==typeof e?e:void 0;if(!1===e||!1===l?.enabled||void 0===e&&!r&&!o)return Al;let a=l??{};return{enabled:!0,tapToSelect:a.tapToSelect??!0,tapToLockTooltip:a.tapToLockTooltip??!0,clearSelection:a.clearSelection??"backgroundTap",targetSize:a.targetSize??i??44,snap:a.snap??"nearestDatum",brushHandleSize:a.brushHandleSize??44,standardControls:a.standardControls??!1}}function Gn(e,t,n){let i=Sl[e||"primary"],r=e&&"primary"!==e||!n?.width?i.width:n.width,o=e&&"primary"!==e||!n?.height?i.height:n.height,l=Q({...t,mode:e},{width:t.width??r,height:t.height??o}).props,a=l.mode||e||"primary",s=Sl[a],u="context"===a||"sparkline"===a,c="primary"===a&&n?.width?n.width:s.width,d="primary"===a&&n?.height?n.height:s.height;return{mode:a,width:l.width??c,height:l.height??d,showAxes:l.showAxes??s.showAxes,showGrid:l.showGrid??s.showGrid,enableHover:l.enableHover??(!!l.linkedHover||s.enableHover),showLegend:l.showLegend??s.showLegend,showLabels:l.showLabels??s.showLabels,title:u?void 0:l.title,description:l.description,summary:l.summary,accessibleTable:l.accessibleTable,xLabel:u?void 0:l.xLabel,yLabel:u?void 0:l.yLabel,categoryLabel:u?void 0:l.categoryLabel,valueLabel:u?void 0:l.valueLabel,marginDefaults:Vn(s.marginDefaults,l.showCategoryTicks,l.orientation),compactMode:u,mobileInteraction:Bn(l.mobileInteraction,{mode:a,width:l.width??c,mobileSemantics:l.mobileSemantics}),mobileSemantics:l.mobileSemantics}}function _n(e){return e.compactMode?e.marginDefaults:$l}function Vn(e,t,n){if(!1!==t)return e;let i={...e};return"horizontal"===n?i.left=Math.min(i.left,15):i.bottom=Math.min(i.bottom,15),i}function Yn({data:e,colorBy:t,colorScale:n,getColor:i,strokeColor:r,strokeWidth:o,categories:l}){let a=(void 0!==l?l:Array.from(new Set(e.map(e=>"function"==typeof t?t(e):e[t])))).map((r,o)=>{let l="function"==typeof t?e.find(e=>t(e)===r):e.find(e=>e[t]===r),a=l?i(l,t,n):n?n(r):ji[o%ji.length];return{label:String(r),color:a,__semioticCategory:!0}});return{legendGroups:[{styleFn:e=>{let t=e.color||"#333",n={fill:t,stroke:t};return void 0!==r&&(n.stroke=r),void 0!==o&&(n.strokeWidth=o),n},type:"fill",items:a,label:""}]}}function Un(e,t){if(!t)return[];let n=new Set;for(let i of e){let e="function"==typeof t?t(i):i[t];null!=e&&n.add(String(e))}return Array.from(n)}function qn(e,t){return null!=e&&Object.hasOwn(e,t)}function Xn({data:e,colorBy:t,colorScale:n,showLegend:i,legendPosition:r,userMargin:o,defaults:l={top:50,bottom:60,left:70,right:40},categories:a,additionalLegend:s,chartWidth:u,chartHeight:c,legendLayout:d,frameLegend:h,hasTitle:f=!1,axisChrome:m}){let{legendPosition:y,legendLayout:p}=function(e,t,n){let i=qn(n,"legendPosition"),r=qn(n,"legendLayout");return{legendPosition:i?n?.legendPosition??"right":e??"right",legendLayout:r?n?.legendLayout:t}}(r,d,h),g=qn(h,"legend"),b=Er(zo),x=Oe(),v=void 0!==i?i:!b&&!!t,w=!!t&&(v||x),k=Fr(()=>w?void 0!==a?a:Un(e,t):[],[a,t,e,w]);je(x&&t?k:[],n);let M=Fr(()=>{if(!v||!t)return;let i=Yn({data:e,colorBy:t,colorScale:n,getColor:Oi,categories:k});return 0!==i.legendGroups.reduce((e,t)=>e+t.items.length,0)?i:void 0},[v,t,e,n,k]),A=Fr(()=>g?h?.legend:re(M,s),[M,s,h?.legend,g]),{hasAxis:S,hasAxisLabel:$,rotatedTicks:C,topAxis:L,leftAxis:N,rightAxis:z}=m??{},I=void 0!==L,R=void 0!==N,j=void 0!==z,{hasAxis:O,hasAxisLabel:T,rotatedTicks:F}=L??{},{hasAxis:W,hasAxisLabel:E}=N??{},{hasAxis:D,hasAxisLabel:P}=z??{},H=Fr(()=>{let e="number"==typeof o?{top:o,bottom:o,left:o,right:o}:o??{},t=we(l,h?.axes,f),n=n=>{let i=e[n];return"number"==typeof i?i:t[n]},i={top:n("top"),right:n("right"),bottom:n("bottom"),left:n("left")},r={...i};return A&&(xe(i,{legend:A,position:y,size:[u??600,c??400],hasTitle:f,legendLayout:p,minimumMargin:"bottom"===y?80:"top"===y?50:0,axisChrome:void 0===S?{hasAxis:!0,hasAxisLabel:!0}:{hasAxis:S,hasAxisLabel:$,rotatedTicks:C,topAxis:I?{hasAxis:O,hasAxisLabel:T,rotatedTicks:F}:void 0,leftAxis:R?{hasAxis:W,hasAxisLabel:E}:void 0,rightAxis:j?{hasAxis:D,hasAxisLabel:P}:void 0}}),null!=u&&null!=c&&ae(i,r,[u,c],y)),i},[l,h?.axes,o,A,y,u,c,p,f,S,$,C,I,O,T,F,R,W,E,j,D,P]);return{legend:A,margin:H,legendPosition:y,legendLayout:p,legendMarginReserved:void 0!==A&&!qn(h,"margin"),hasAutomaticLegend:void 0!==M}}function Kn(e){let t=e.valueRange;return Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]?[t[0],t[1]]:null}function Jn(e,t){return"string"==typeof e.interactionKey?e.interactionKey:`${t[0]}:${t[1]}`}function Qn(e,t,n,i=!0,r=!1){let[o,l]=Tr(null),[a,s]=Tr(new Set),u=Fr(()=>new Set,[]),c=Fr(()=>new Set(n),[n]),d=null!=o&&c.has(o)?o:null,h=Fr(()=>{if(0===a.size)return a;let e=new Set(Array.from(a).filter(e=>c.has(e)));return 0===e.size||e.size===c.size?u:e.size===a.size?a:e},[c,u,a]);Wr(()=>{(!i||!t||!e||"none"===e)&&(l(null),s(e=>0===e.size?e:new Set))},[t,i,e]),Wr(()=>{l(e=>null==e||c.has(e)?e:null),s(e=>{if(0===e.size)return e;let t=new Set(Array.from(e).filter(e=>c.has(e)));return 0===t.size||t.size===c.size?new Set:t.size===e.size?e:t})},[c]);let f=Pr(t=>{!i||"highlight"!==e||l(!t||!c.has(t.label)||r&&!0!==t.__semioticCategory?null:t.label)},[c,i,e,r]),m=Pr(t=>{!i||"isolate"!==e||!c.has(t.label)||r&&!0!==t.__semioticCategory||s(e=>{let n=new Set(Array.from(e).filter(e=>c.has(e)));return n.has(t.label)?n.delete(t.label):n.add(t.label),n.size===c.size?new Set:n})},[c,i,e,r]),y=Fr(()=>{if(!i||!e||"none"===e||!t)return null;let n=e=>{let n="function"==typeof t?t(e):e[t];return"string"==typeof n?n:String(n)};return"highlight"===e&&null!=d?{isActive:!0,predicate:e=>n(e)===d}:"isolate"===e&&h.size>0?{isActive:!0,predicate:e=>h.has(n(e))}:null},[t,i,e,d,h]);return{highlightedCategory:i&&"highlight"===e?d:null,isolatedCategories:i&&"isolate"===e?h:u,onLegendHover:f,onLegendClick:m,legendSelectionHook:y}}function Zn(e,t,n,i=5){let[r,o]=n,[l,a]=Tr(null),[s,u]=Tr(new Map),c=Fr(()=>new Set,[]);Wr(()=>{a(null),u(new Map)},[r,o,i,e]);let d=Pr(t=>{if("highlight"!==e||!t)return void("highlight"===e&&a(null));let n=Kn(t);n&&a({key:Jn(t,n),range:n})},[e]),h=Pr(t=>{if("isolate"!==e)return;let n=Kn(t);n&&u(e=>{let r=new Map(e),o=Jn(t,n);return r.has(o)?r.delete(o):r.set(o,n),r.size===i?new Map:r})},[i,e]),f=Fr(()=>{let n="highlight"===e&&l?[l.range]:"isolate"===e?[...s.values()]:[];return 0===n.length?null:{isActive:!0,predicate:e=>{let i=t(e);return Number.isFinite(i)&&n.some(([e,t])=>i>=Math.min(e,t)&&i<=Math.max(e,t))}}},[l,s,e,t]);return{highlightedCategory:"highlight"===e?l?.key??null:null,isolatedCategories:"isolate"===e?new Set(s.keys()):c,onLegendHover:d,onLegendClick:h,legendSelectionHook:f}}function ei(e,t,n){let i=e.xValue??t?.[n];if(null==i)return null;let r=Number(i);return Number.isFinite(r)?r:null}function ti(e){let t=e.data||e.datum||e;return Array.isArray(t)&&(t=t[0]),null!=e.xValue&&t&&"object"==typeof t&&!Array.isArray(t)&&null==t.xValue?kr({...t,xValue:e.xValue},Mr(t)):t||{}}function ni(e){if(!e)return!1;for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1}function ii(){let e=wr()?.colors?.categorical;return e&&e.length>0?e:void 0}function ri(){return wr()?.colors?.sequential||void 0}function oi(){return wr()?.colors?.diverging||void 0}function li(e,t,n){let i=B(null!=n),r=ii();return Fr(()=>{if(!t)return;let o=i??void 0,l=n??(r&&r.length>0?r:void 0)??"category10";if(0!==e.length){if("function"==typeof t){let n=Array.from(new Set(e.map(e=>String(t(e)))));if(o&&ni(o)){let e=n.map(e=>({_cat:e})),t=Ti(e,"_cat",l);return e=>Ii(o,e)??t(e)}let i=n.map(e=>({_cat:e}));return Ti(i,"_cat",l)}if(o&&ni(o)){let n=Ti(e,t,l);return e=>Ii(o,e)??n(e)}return Ti(e,t,l)}if(o&&ni(o)){let e=Ti([{_:"a"}],"_",l);return t=>Ii(o,t)??e(t)}},[e,t,n,i,r])}function ai(e,t,n){return Fr(()=>{if(!t||"auto"===t||"function"==typeof t)return e;let i=[...e],r="function"==typeof(o=n)?o:e=>e[o];var o;return"asc"===t?i.sort((e,t)=>r(e)-r(t)):i.sort((e,t)=>r(t)-r(e))},[e,t,n])}function si({selection:e,linkedHover:t,fallbackFields:n=Cl,unwrapData:i=!1,onObservation:r,chartType:o,chartId:l,onClick:a,hoverHighlight:s,hoverHighlightField:u,colorByField:c,mobileInteraction:d,emitObservations:h=!0}){let f=Br(),m=w(),{setCrosshairPosition:y,clearCrosshairPosition:p,toggleCrosshairLock:g,unlockCrosshair:b}=m,x=_r(m);x.current=m;let v=Fr(()=>vi(t,n),[t,n]),k=Fr(()=>"series"===v?.mode?[v.seriesField||c||n[0]].filter(e=>!!e):v?.fields||n,[v,c,n]),M=_({name:e?.name||"__unused__",fields:k}),A=Y({name:v?.name||"hover",fields:k}),S=rr(e=>e.pushObservation),$=Pr(e=>{r?.(e),S?.(e)},[r,S]),C=e?{isActive:M.isActive,predicate:M.predicate}:null,[L,N]=Tr(null),z=_r(!1),I=u||c||n[0],R=Fr(()=>{if(!s||null==L||!I)return null;let e=L,t=I;return{isActive:!0,predicate:n=>("string"==typeof n[t]?n[t]:String(n[t]??""))===e}},[s,L,I]),j=Pr((e,n)=>{let i=!e&&z.current&&!!d?.enabled&&d.tapToLockTooltip;if(t)if(e){let t=e.data||e.datum||e;if(Array.isArray(t)&&(t=t[0]),"x-position"===v?.mode&&v.xField){let n=ei(e,t,v.xField);null!=n&&y(v.name||"hover",n,f)}"x-position"!==v?.mode&&A.onHover(t)}else"x-position"===v?.mode&&!i&&p(v.name||"hover",f),"x-position"!==v?.mode&&!i&&A.onHover(null);if(s&&I)if(e){let t=e.data||e.datum||e;Array.isArray(t)&&(t=t[0]);let n=t?.[I];N(null!=n?String(n):null)}else i||N(null);h&&(r||S)&&Tn({onObservation:$,datum:e?ti(e):null,x:e?.x,y:e?.y,chartType:o||"unknown",chartId:l,context:n})},[t,A,v,f,r,o,l,S,$,h,s,I,d,y,p]),O=Pr((n=!0)=>{z.current=!1,t&&"x-position"!==v?.mode&&A.onHover(null),e&&d?.tapToSelect&&M.clear(),n&&s&&N(null),"x-position"===v?.mode&&(b(v.name||"hover",f),p(v.name||"hover",f))},[t,v,A,e,d,M,s,f,p,b]),T=Pr((n,i)=>{let u=!!d?.enabled&&(d.tapToLockTooltip||d.tapToSelect),c=!!d?.enabled&&"backgroundTap"===d.clearSelection;if("x-position"===v?.mode&&v.xField&&n){let e=n.data||n.datum||n;Array.isArray(e)&&(e=e[0]);let t=ei(n,e,v.xField);null!=t&&g(v.name||"hover",t,f)}if(u)if(n){z.current=!0;let i=ti(n);if(t&&"x-position"!==v?.mode&&A.onHover(i),e&&d?.tapToSelect&&k.length>0){let e=Ar(i,k);ni(e)&&M.selectPoints(e)}if(s&&I){let e=i?.[I];N(null!=e?String(e):null)}}else c&&O();if(n||c){if(n&&a){let e=n.data||n.datum||n;Array.isArray(e)&&(e=e[0]),a(e,{x:n.x??0,y:n.y??0})}h&&(r||S)&&Fn({onObservation:$,datum:n?ti(n):null,x:n?.x,y:n?.y,chartType:o||"unknown",chartId:l,context:i})}},[a,h,r,S,$,o,l,v,f,d,t,A,e,M,k,s,I,O,g]);Wr(()=>{if(!d?.enabled||typeof document>"u")return;let e=e=>{"Escape"===e.key&&z.current&&O()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[d?.enabled,O]);let F=_r(O);return F.current=O,Wr(()=>()=>{z.current&&F.current(!1)},[]),Wr(()=>{if("x-position"!==v?.mode)return;let e=v.name||"hover";return()=>{x.current.releaseCrosshair(e,f)}},[v?.mode,v?.name,f]),{activeSelectionHook:C,hoverSelectionHook:R,customHoverBehavior:j,customClickBehavior:T,crosshairSourceId:f}}function ui(e,t){let n="object"==typeof e&&null!==e?e:void 0;if("x-position"===n?.mode)return{linkedCrosshairName:n.name||"hover",linkedCrosshairSourceId:t}}function ci(e,t,n){return Gn(e,t,n)}function di(e,t="#4e79a7"){return Hi(e)?e.background&&"transparent"!==e.background?e.background:t:e&&"string"==typeof e?e:t}function hi(e){let t=e.replace(/[^A-Za-z0-9_-]/g,"_");return!t||/^\d/.test(t)?`s_${t}`:t}function fi(e,t,n,i){let r=e.glyph;if(!r?.parts?.length||e.size<=0)return null;let o=_i(r,e.size);if(o.scale<=0)return null;let l=`translate(${t},${n})${e.rotation?` rotate(${180*e.rotation/Math.PI})`:""} translate(${o.offsetX},${o.offsetY}) scale(${o.scale})`,a=e.color??("string"==typeof e.style.fill?e.style.fill:void 0),s=Vi(r,e.fraction??1,e.fractionStart??0,e.fractionDirection??"horizontal"),u=s?hi(`${i}-clip`):void 0,c=(e.style.opacity??1)*(e._decayOpacity??1)*(e.style.fillOpacity??1),d=t=>r.parts.map((n,i)=>{let r=t?"none"===n.fill?void 0:t:Yi(n.fill,a,e.accent),o=t?n.stroke&&"none"!==n.stroke?t:void 0:Yi(n.stroke??"none",a,e.accent);return r||o?zr("path",{d:n.d,fill:r??"none",stroke:o,strokeWidth:o?n.strokeWidth??1:void 0,strokeLinecap:n.strokeLinecap,strokeLinejoin:n.strokeLinejoin,opacity:n.opacity},i):null});return Ir("g",{transform:l,opacity:1===c?void 0:c,children:[s&&u&&zr("clipPath",{id:u,children:zr("rect",{x:s.x,y:s.y,width:s.width,height:s.height})}),s&&e.ghostColor?zr("g",{children:d(e.ghostColor)}):null,s&&u?zr("g",{clipPath:`url(#${u})`,children:d()}):d()]},i)}function mi(e,t){let n=e.filter(e=>Number.isFinite(e.offset)&&(null==e.opacity||Number.isFinite(e.opacity))).map(e=>({offset:Math.max(0,Math.min(1,e.offset)),color:e.color??t,opacity:null==e.opacity?void 0:Math.max(0,Math.min(1,e.opacity))}));return n.length<2?null:n.map((e,t)=>zr("stop",{offset:e.offset,stopColor:e.color,stopOpacity:e.opacity},t))}function yi(e,t){let n=e.fillGradient;if(!n||"object"!=typeof n)return null;let i=e.x,r=e.y,o=e.x,l=e.y+e.h;"bottom"===e.roundedEdge?(r=e.y+e.h,l=e.y):"right"===e.roundedEdge?(i=e.x+e.w,r=e.y,o=e.x,l=e.y):"left"===e.roundedEdge&&(i=e.x,r=e.y,o=e.x+e.w,l=e.y);let a=mi(n.stops,di(e.style.fill));return a?zr("linearGradient",{id:t,gradientUnits:"userSpaceOnUse",x1:i,y1:r,x2:o,y2:l,children:a}):null}function pi(e){let{x:t,y:n,w:i,h:r}=e,{tl:o,tr:l,br:a,bl:s}=Bi(e),u=`M${t+o},${n}`;return u+=` L${t+i-l},${n}`,l>0&&(u+=` A${l},${l} 0 0 1 ${t+i},${n+l}`),u+=` L${t+i},${n+r-a}`,a>0&&(u+=` A${a},${a} 0 0 1 ${t+i-a},${n+r}`),u+=` L${t+s},${n+r}`,s>0&&(u+=` A${s},${s} 0 0 1 ${t},${n+r-s}`),u+=` L${t},${n+o}`,o>0&&(u+=` A${o},${o} 0 0 1 ${t+o},${n}`),u+=" Z",u}function gi(e,t,n){let i=Ui(e.symbolType,e.size,e.path),r=e.rotation?`translate(${e.x},${e.y}) rotate(${180*e.rotation/Math.PI})`:`translate(${e.x},${e.y})`;return zr("path",{d:i,transform:r,fill:e.style.fill?di(e.style.fill):"none",fillOpacity:e.style.fillOpacity,opacity:e.style.opacity,stroke:e.style.stroke,strokeWidth:e.style.strokeWidth},`${n??""}symbol-${t}`)}function bi(e,t,n){let i="point"===e.type,r=i?"circle":"rect",o=i?{cx:e.x,cy:e.y,r:e.r}:{x:e.x,y:e.y,width:e.w,height:e.h},l=`${n?`${n}-`:""}${i?"point":"xyrect"}-${t}-hatch`;if(!i&&e.fillBands&&e.fillBands.length>0)return function(e,t,n){let i=e.y,r=e.y+e.h,o=[],l=[];e.fillBands.forEach((t,a)=>{let s,u=Math.max(Math.min(t.y0,t.y1),i),c=Math.min(Math.max(t.y0,t.y1),r);if(c>u){if(Hi(t.fill)){let e=`${n}-band-${a}`;o.push(Gi(t.fill,e)),s=`url(#${e})`}else s=di(t.fill);l.push(zr("rect",{x:e.x,y:u,width:e.w,height:c-u,fill:s},a))}});let a=e.style.stroke&&"none"!==e.style.stroke;return Ir("g",{opacity:e.style.opacity,children:[o.length>0&&zr("defs",{children:o}),l,a&&zr("rect",{x:e.x,y:e.y,width:e.w,height:e.h,fill:"none",stroke:e.style.stroke,strokeWidth:e.style.strokeWidth})]},`rect-${t}`)}(e,t,l);let a=Hi(e.style.fill)?Gi(e.style.fill,l):void 0;return Ir(jr.Fragment,{children:[a&&zr("defs",{children:a}),jr.createElement(r,{...o,fill:a?`url(#${l})`:di(e.style.fill),opacity:i?e.style.opacity??e.style.fillOpacity??.8:e.style.opacity,stroke:e.style.stroke,strokeWidth:e.style.strokeWidth})]},`${e.type}-${t}`)}import{b as xi,c as vi}from"./c-KLJDKRD5.min.js";import{b as wi,e as ki,d as Mi,c as Ai,f as Si,a as $i}from"./c-GHJ27Q4I.min.js";import{a as Ci,b as Li}from"./c-WUAFPLTD.min.js";import{b as Ni}from"./c-SIQVOV6A.min.js";import{m as zi,s as Ii,o as Ri,p as ji,r as Oi,t as Ti}from"./c-WPL6PGP3.min.js";import{g as Fi,l as Wi,n as Ei,d as Di,b as Pi,i as Hi,y as Bi,k as Gi}from"./c-VZNIIKL6.min.js";import{d as _i,h as Vi,f as Yi,a as Ui}from"./c-ELGOCAEY.min.js";import{b as qi,a as Xi,l as Ki,k as Ji,i as Qi,j as Zi,g as er,f as tr,r as nr,d as ir}from"./c-7UN2WUMI.min.js";import{o as rr,w as or,s as lr,v as ar,z as sr,y as ur,C as cr,A as dr,k as hr,m as fr,B as mr,n as yr,q as pr,p as gr,u as br,x as xr,t as vr,D as wr}from"./c-TC47SNSI.min.js";import{a as kr,b as Mr,i as Ar}from"./c-5PCO2P5Q.min.js";import{h as Sr,e as $r,f as Cr}from"./c-7BVQDXFU.min.js";import{e as Lr}from"./c-I4BEWAKT.min.js";import{a as Nr}from"./c-GRTKU3C7.min.js";import{jsx as zr,jsxs as Ir,Fragment as Rr}from"react/jsx-runtime";import*as jr from"react";import{createContext as Or,useState as Tr,useMemo as Fr,useEffect as Wr,useContext as Er,useSyncExternalStore as Dr,useCallback as Pr,Component as Hr,useId as Br,useLayoutEffect as Gr,useRef as _r,memo as Vr}from"react";import{packEnclose as Yr}from"d3-hierarchy";import{curveCatmullRom as Ur,curveCardinal as qr,curveBasis as Xr,curveStepBefore as Kr,curveStepAfter as Jr,curveStep as Qr,curveMonotoneY as Zr,curveMonotoneX as eo,curveLinear as to,area as no}from"d3-shape";import{flushSync as io}from"react-dom";var ro,oo,lo,ao={fresh:1,aging:1.5,stale:3},so=/^\s*var\(\s*--[^,)\s]+\s*(?:,\s*([\s\S]*))?\)\s*$/,uo="var(--semiotic-bg, #ffffff)",co=/*#__PURE__*/Or(null),ho=/*#__PURE__*/new Map,fo=()=>ho,mo=()=>()=>{},yo=["name","label","title"],po=["type","kind","category","group","class","status","role","shape"],go=["value","amount","total","count","weight","score"],bo=/*#__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"]),xo=!1,vo=class extends Hr{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onError?.(e,t)}render(){if(this.state.error){let{fallback:e}=this.props,t=this.state.error;return"function"==typeof e?e(t):void 0!==e?e:zr(D,{componentName:"ChartErrorBoundary",message:t.message||"An unexpected error occurred while rendering this chart.",width:600,height:400})}return this.props.children}},wo=/*#__PURE__*/Or(null),ko=/*#__PURE__*/Or(null),Mo=/*#__PURE__*/P(function({colors:e,categories:t,colorScheme:n="category10",children:i}){let r=Fr(()=>{if(e)return e;if(t){if(n&&"object"==typeof n&&!Array.isArray(n)){let e=n,i=0;return Object.fromEntries(t.map(t=>[t,Ii(e,t)??zi[i++%zi.length]]))}let e=Array.isArray(n)?n:Ri(n,void 0);return Object.fromEntries(t.map((t,n)=>[t,e[n%e.length]]))}return{}},[e,t,n]);return zr(ko.Provider,{value:r,children:zr(wo.Provider,{value:r,children:i})})},"CategoryColorProvider"),Ao={fontFamily:"var(--semiotic-legend-font-family, var(--semiotic-font-family, sans-serif))",fontWeight:"var(--semiotic-legend-font-weight, normal)"},So={fontSize:"var(--semiotic-legend-font-size, 12px)"},$o=34,Co=70,Lo=e=>e.legendGroup.items.map((t,n)=>$e(e,t,n,`translate(0,${n*e.metrics.rowHeight})`,!1)),No=typeof window>"u"?Wr:Gr,zo=/*#__PURE__*/Or(!1),Io=/*#__PURE__*/Or(!1),Ro=/*#__PURE__*/Or(null),jo=typeof window>"u"?Wr:Gr,Oo="__linked-legend-isolate__",To="__linked-legend-highlight__",Fo=Object.freeze([]),Wo=typeof window>"u"||typeof document>"u",Eo={data:"data",domain:"domain",layout:"layout","scene-geometry":"sceneGeometry","scene-style":"sceneStyle","data-paint":"dataPaint","interaction-paint":"interactionPaint",overlay:"overlay",accessibility:"accessibility",evidence:"evidence"},Do=class{constructor(){this.revisions={data:0,domain:0,layout:0,sceneGeometry:0,sceneStyle:0,dataPaint:0,interactionPaint:0,overlay:0,accessibility:0,evidence:0},this.latest=Je({kind:"initialize"},[],this.revisions),this.listeners=new Set}get last(){return this.latest}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}record(e,t){let n=Je(e,t,this.revisions);this.revisions=n.revisions,this.latest=n;for(let e of[...this.listeners])e();return n}},Po={sceneGeometry:0,layout:0,domain:0},Ho="production"!==process.env.NODE_ENV,Bo={revisions:Po,signature:"",sawSignals:!1,wasUnconsumed:!1,warnUnconsumed:!1},Go=class{constructor(e="scene host"){this.hostName=e,this.lastConsumed=Po,this.lastObserved=Po,this.lastDuplicateWarning="",this.lastUnconsumedWarning=""}observeUpdateResult(e){Ho&&(this.lastObserved=Ze(this.lastObserved,Qe(e)))}beforeCompute(e,t){if(!Ho)return Bo;let n=Ze(Qe(e),this.lastObserved),i=function(e){return`${e.sceneGeometry}|${e.layout}|${e.domain}`}(n),r=!function(e,t){return e.sceneGeometry===t.sceneGeometry&&e.layout===t.layout&&e.domain===t.domain}(n,this.lastConsumed);return{revisions:n,signature:i,sawSignals:e.changed.has("scene-geometry")||e.changed.has("layout")||e.changed.has("domain"),wasUnconsumed:r,warnUnconsumed:!t&&r&&this.lastUnconsumedWarning!==i}}afterCompute(e,t,n){if(Ho){if(t&&e.wasUnconsumed&&(this.lastConsumed=e.revisions),e.warnUnconsumed&&!t)return console.warn(`[semiotic] ${this.hostName} observed scene-affecting revisions without a scene rebuild: ${e.signature}.`),void(this.lastUnconsumedWarning=e.signature);t&&e.sawSignals&&!e.wasUnconsumed&&!n&&this.lastDuplicateWarning!==e.signature?(console.warn(`[semiotic] ${this.hostName} performed scene rebuild with unchanged scene revisions: ${e.signature}.`),this.lastDuplicateWarning=e.signature):t&&!e.sawSignals&&(this.lastDuplicateWarning="")}}},_o=/*#__PURE__*/Vr(function({store:e,diagnostics:t}){return Wr(()=>{let n=()=>t.observeUpdateResult(e.getUpdateSnapshot());return n(),e.subscribeUpdateResult(n)},[t,e]),null}),Vo={secondary:0,primary:3},Yo=".annotation-deferred{opacity:0;pointer-events:none;transition:opacity .12s ease}.stream-xy-frame:hover .annotation-deferred,.stream-ordinal-frame:hover .annotation-deferred,.stream-network-frame:hover .annotation-deferred,.stream-geo-frame:hover .annotation-deferred,.stream-xy-frame:focus-within .annotation-deferred,.stream-ordinal-frame:focus-within .annotation-deferred,.stream-network-frame:focus-within .annotation-deferred,.stream-geo-frame:focus-within .annotation-deferred{opacity:1;pointer-events:auto}@media (prefers-reduced-motion:reduce){.annotation-deferred{transition:none}}",Uo=/*#__PURE__*/new Set(["top-left","top-center","top-right","middle-left","center","middle-right","bottom-left","bottom-center","bottom-right"]),qo={fill:"var(--semiotic-text, #333)",fontSize:11,fontFamily:"inherit"},Xo={linear:to,monotoneX:eo,monotoneY:Zr,step:Qr,stepAfter:Jr,stepBefore:Kr,basis:Xr,cardinal:qr,catmullRom:Ur},Ko=["label","callout","callout-circle","callout-rect"],Jo=/*#__PURE__*/new Set(["label","callout","callout-circle","callout-rect","text","widget"]),Qo=/*#__PURE__*/new Set(Ko),Zo=32,el=6,tl=4,nl=8,il=72,rl={ai:"AI",agent:"agent",watcher:"watcher",system:"system",import:"imported",computed:"computed",user:"you"},ol=typeof window<"u"?Gr:Wr,ll=()=>()=>{},al=()=>!1,sl=()=>!0,ul=/*#__PURE__*/jr.createContext(null),cl=/*#__PURE__*/new Map,dl=/*#__PURE__*/new Map,hl=/*#__PURE__*/jr.createContext(null),fl=null,ml=!1,yl=typeof window>"u"?jr.useEffect:jr.useLayoutEffect,pl=/*#__PURE__*/jr.lazy(()=>import("./c-E4JDJH4I.min.js")),gl=/*#__PURE__*/jr.lazy(()=>import("./c-SDGGMIYI.min.js")),bl="var(--semiotic-focus, #005fcc)",xl=typeof window>"u"?Wr:Gr,vl={requestAnimationFrame:e=>(typeof window>"u"?globalThis:window).requestAnimationFrame(e),cancelAnimationFrame:e=>(typeof window>"u"?globalThis:window).cancelAnimationFrame(e)},wl=typeof window>"u"?Wr:Gr,kl={display:"flex",alignItems:"stretch",flexDirection:"column",textAlign:"center",justifyContent:"center",color:"var(--semiotic-text-secondary, #666)",fontSize:13,fontFamily:"inherit",border:"1px dashed var(--semiotic-border, #ddd)",borderRadius:4,boxSizing:"border-box"},Ml={background:"var(--semiotic-border, #e0e0e0)",borderRadius:2},Al={enabled:!0,tapToSelect:!0,tapToLockTooltip:!0,clearSelection:"backgroundTap",targetSize:44,snap:"nearestDatum",brushHandleSize:44,standardControls:!1,enabled:!1,tapToSelect:!1,tapToLockTooltip:!1},Sl={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}}},$l={top:10,bottom:10,left:10,right:10},Cl=[],Ll={innerRadius:0,outerRadius:0,startAngle:0,endAngle:0};export{yi as $,nt as A,u as B,c as C,d as D,h as E,f as F,m as G,Ct as H,Yo as I,st as J,Rt as K,jt as L,Ot as M,Tt as N,Ft as O,Dt as P,qt as Q,w as R,k as S,M as T,Xt as U,Ll as V,di as W,hi as X,fi as Y,mi as Z,pi as _,Fo as a,En as a$,Ne as aA,Sn as aB,$n as aC,Ln as aD,Nn as aE,zn as aF,In as aG,$ as aH,C as aI,S as aJ,I as aK,R as aL,j as aM,O as aN,T as aO,F as aP,W as aQ,E as aR,Rn as aS,jn as aT,On as aU,Tn as aV,Fn as aW,P as aX,D as aY,vo as aZ,Dn as a_,gi as aa,bi as ab,Kt as ac,Jt as ad,Qt as ae,Zt as af,en as ag,tn as ah,nn as ai,rn as aj,on as ak,ln as al,un as am,cn as an,mn as ao,dn as ap,hn as aq,yn as ar,pn as as,gn as at,bn as au,xn as av,vn as aw,wn as ax,kn as ay,Mn as az,Xe as b,ii as bA,ri as bB,oi as bC,li as bD,ai as bE,si as bF,ui as bG,ci as bH,We as bI,Ee as bJ,De as bK,He as bL,Be as bM,Ge as bN,_e as bO,Ve as bP,Ye as bQ,Ue as bR,qe as bS,Pn as ba,Hn as bb,B as bc,Mo as bd,G as be,_ as bf,V as bg,Y as bh,q as bi,X as bj,J as bk,Q as bl,Bn as bm,Gn as bn,_n as bo,ee as bp,Z as bq,ze as br,je as bs,Oe as bt,Fe as bu,Yn as bv,Un as bw,Xn as bx,Qn as by,Zn as bz,ao as c,e as d,t as e,n as f,i as g,r as h,o as i,l as j,Wo as k,Do as l,et as m,tt as n,_o as o,ne as p,ie as q,re as r,ae as s,de as t,me as u,ye as v,pe as w,be as x,xe as y,we as z};
|