semiotic 3.10.0 → 3.10.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 +55 -59
- package/ai/artifact-surface-inventory.json +1 -1
- package/ai/componentMetadata.cjs +3 -1
- package/ai/dist/mcp-server.js +45 -45
- package/ai/examples.md +67 -0
- package/ai/reference.md +75 -1
- package/ai/schema.json +5199 -1
- package/ai/surface-manifest.json +24 -3
- package/ai/task-packets/compare-category-totals.json +6 -6
- package/ai/task-packets/compare-category-totals.md +3 -3
- package/ai/task-packets/correct-published-chart.json +6 -6
- package/ai/task-packets/correct-published-chart.md +3 -3
- package/ai/task-packets/index.json +6 -6
- package/ai/task-packets/update-live-chart.json +6 -6
- package/ai/task-packets/update-live-chart.md +3 -3
- package/dist/c-2RL2QPZJ.min.js +1 -0
- package/dist/c-45CQWZZ6.min.js +1 -0
- package/dist/{c-PP6VY3QU.min.js → c-4BRHKVKV.min.js} +1 -1
- package/dist/c-7DVPSB5C.min.js +1 -0
- package/dist/{c-XDQKXPX4.min.js → c-A7OGOFSL.min.js} +1 -1
- package/dist/{c-AZKPVBOC.min.js → c-AH5HWZWS.min.js} +1 -1
- package/dist/c-B7GW7IHJ.min.js +1 -0
- package/dist/{c-ROEHCIGV.min.js → c-C3TZLTZK.min.js} +1 -1
- package/dist/c-CGQAQWBV.min.js +1 -0
- package/dist/c-DIPEYUOW.min.js +1 -0
- package/dist/{c-WNGH47HF.min.js → c-E72OTUZU.min.js} +1 -1
- package/dist/{c-DY2676CR.min.js → c-EUMPMDCS.min.js} +1 -1
- package/dist/c-EZZT2WAE.min.js +1 -0
- package/dist/c-FHBVFCQB.min.js +1 -0
- package/dist/{c-E32M6XW5.min.js → c-G4HCO2IQ.min.js} +1 -1
- package/dist/{c-ZYPXQF7B.min.js → c-G5VIJEOK.min.js} +1 -1
- package/dist/c-GHVOXAYH.min.js +1 -0
- package/dist/{c-EBOQ7ER7.min.js → c-HP4ZFM47.min.js} +1 -1
- package/dist/{c-IDJV3CZK.min.js → c-HYDTS5OP.min.js} +1 -1
- package/dist/c-IK33LNZ6.min.js +1 -0
- package/dist/c-IK3PZHRY.min.js +1 -0
- package/dist/{c-JO2UGTCP.min.js → c-J6DVC236.min.js} +1 -1
- package/dist/{c-MXCP7GNZ.min.js → c-JIMJF6F6.min.js} +1 -1
- package/dist/{c-4FN7Q6VQ.min.js → c-KKPMHAZC.min.js} +1 -1
- package/dist/c-L6WNDBHV.min.js +1 -0
- package/dist/c-LDEX5OFW.min.js +1 -0
- package/dist/{c-CPSPZH6A.min.js → c-LESEUVC5.min.js} +1 -1
- package/dist/c-MB6CV5NC.min.js +1 -0
- package/dist/{c-OO5QLMJC.min.js → c-MOKJOIPE.min.js} +1 -1
- package/dist/{c-BNG5ECK5.min.js → c-N3FXLRNT.min.js} +1 -1
- package/dist/c-N5NPTJVJ.min.js +1 -0
- package/dist/{c-DE5Q3U2X.min.js → c-NHBL4J67.min.js} +1 -1
- package/dist/{c-LMGSSD2E.min.js → c-ODG6TFSY.min.js} +1 -1
- package/dist/{c-HXDKPIKR.min.js → c-PSKKFZNP.min.js} +1 -1
- package/dist/{c-NYZ2QNAM.min.js → c-R2P4RR7Q.min.js} +1 -1
- package/dist/{c-KCRJGUHP.min.js → c-RFC7UAG7.min.js} +1 -1
- package/dist/c-SGAURYHG.min.js +1 -0
- package/dist/{c-DK662R77.min.js → c-SJMWU6UX.min.js} +1 -1
- package/dist/c-STIIGQOD.min.js +1 -0
- package/dist/c-T2ASIJVZ.min.js +1 -0
- package/dist/c-TX3THUTO.min.js +1 -0
- package/dist/{c-55BAJ333.min.js → c-TX7XJM3Z.min.js} +1 -1
- package/dist/c-UMXSJIOV.min.js +1 -0
- package/dist/{c-JLGRHXGZ.min.js → c-VRSXMLYF.min.js} +1 -1
- package/dist/c-VSLWSAN2.min.js +1 -0
- package/dist/{c-33QOXEUG.min.js → c-WCBRPILW.min.js} +1 -1
- package/dist/{c-WH2O53VI.min.js → c-WGHT7OCY.min.js} +1 -1
- package/dist/c-WWCW3APR.min.js +1 -0
- package/dist/c-Y6PYUMFU.min.js +1 -0
- package/dist/c-ZIVPFTOC.min.js +1 -0
- package/dist/components/charts/shared/chartDataProps.d.ts +3 -0
- package/dist/components/charts/shared/chartSpecAtlasSchemas.d.ts +5 -0
- package/dist/components/charts/shared/chartSpecCore.d.ts +4 -0
- package/dist/components/charts/shared/chartSpecsAtlas.d.ts +2 -0
- package/dist/components/charts/shared/hooks.d.ts +3 -1
- package/dist/components/charts/shared/knownChartComponents.d.ts +1 -1
- package/dist/components/recipes/atlas/DependencyForestChart.d.ts +20 -0
- package/dist/components/recipes/atlas/DependencyMatrix.d.ts +7 -0
- package/dist/components/recipes/atlas/FlowCircuitChart.d.ts +20 -0
- package/dist/components/recipes/atlas/MotifBraidChart.d.ts +17 -0
- package/dist/components/recipes/atlas/atlasChartOptions.d.ts +11 -0
- package/dist/components/recipes/atlas/braid.d.ts +62 -0
- package/dist/components/recipes/atlas/capsules.d.ts +18 -0
- package/dist/components/recipes/atlas/compare.d.ts +4 -0
- package/dist/components/recipes/atlas/completeness.d.ts +2 -0
- package/dist/components/recipes/atlas/dependencyForest.d.ts +32 -0
- package/dist/components/recipes/atlas/dependencyForestChartProps.d.ts +58 -0
- package/dist/components/recipes/atlas/dependencyForestLayout.d.ts +17 -0
- package/dist/components/recipes/atlas/dependencyQueries.d.ts +20 -0
- package/dist/components/recipes/atlas/dependencyTypes.d.ts +21 -0
- package/dist/components/recipes/atlas/directedGraph.d.ts +9 -0
- package/dist/components/recipes/atlas/entityCounts.d.ts +3 -0
- package/dist/components/recipes/atlas/flowCircuit.d.ts +32 -0
- package/dist/components/recipes/atlas/flowCircuitChartProps.d.ts +72 -0
- package/dist/components/recipes/atlas/flowCircuitChrome.d.ts +18 -0
- package/dist/components/recipes/atlas/flowCircuitGeometry.d.ts +11 -0
- package/dist/components/recipes/atlas/flowCircuitLayout.d.ts +20 -0
- package/dist/components/recipes/atlas/flowCircuitSemantics.d.ts +26 -0
- package/dist/components/recipes/atlas/flowCircuitTape.d.ts +22 -0
- package/dist/components/recipes/atlas/flowCircuitTypes.d.ts +144 -0
- package/dist/components/recipes/atlas/forests.d.ts +11 -0
- package/dist/components/recipes/atlas/ids.d.ts +6 -0
- package/dist/components/recipes/atlas/index.d.ts +26 -0
- package/dist/components/recipes/atlas/ledger.d.ts +7 -0
- package/dist/components/recipes/atlas/motifBraidChartProps.d.ts +51 -0
- package/dist/components/recipes/atlas/motifBraidGeometry.d.ts +5 -0
- package/dist/components/recipes/atlas/motifBraidLayout.d.ts +11 -0
- package/dist/components/recipes/atlas/motifs.d.ts +3 -0
- package/dist/components/recipes/atlas/prefixForest.d.ts +9 -0
- package/dist/components/recipes/atlas/prepare.d.ts +14 -0
- package/dist/components/recipes/atlas/prepareAsync.d.ts +7 -0
- package/dist/components/recipes/atlas/profile.d.ts +19 -0
- package/dist/components/recipes/atlas/publish.d.ts +10 -0
- package/dist/components/recipes/atlas/queries.d.ts +34 -0
- package/dist/components/recipes/atlas/requiredPaths.d.ts +9 -0
- package/dist/components/recipes/atlas/rootedForest.d.ts +4 -0
- package/dist/components/recipes/atlas/sections.d.ts +3 -0
- package/dist/components/recipes/atlas/support.d.ts +7 -0
- package/dist/components/recipes/atlas/types.d.ts +278 -0
- package/dist/components/recipes/atlas/validate.d.ts +12 -0
- package/dist/components/semiotic-atlas-core.d.ts +20 -0
- package/dist/components/semiotic-atlas.d.ts +8 -0
- package/dist/components/semiotic-recipes-core.d.ts +9 -0
- package/dist/components/server/serverChartConfigs.d.ts +3 -0
- package/dist/components/server/serverChartConfigsAtlas.d.ts +4 -0
- package/dist/components/stream/NetworkPipelineStore.d.ts +1 -0
- package/dist/components/stream/canvasSetup.d.ts +1 -2
- package/dist/components/stream/fontLoading.d.ts +4 -0
- package/dist/components/stream/networkCustomLayout.d.ts +8 -0
- package/dist/components/stream/networkCustomLayoutCache.d.ts +12 -0
- package/dist/components/stream/networkPipelineConfig.d.ts +0 -7
- package/dist/components/stream/physics/physicsSemanticUI.d.ts +2 -0
- package/dist/components/stream/physics/usePhysicsCanvasPointer.d.ts +3 -1
- package/dist/components/stream/physics/usePhysicsSemanticNavigation.d.ts +2 -0
- package/dist/components/stream/shallowEqual.d.ts +2 -0
- package/dist/components/stream/useEnsureCustomXYRenderers.d.ts +4 -2
- package/dist/geo.min.js +1 -1
- 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/rough.module.min.js +1 -1
- package/dist/semiotic-access.module.min.js +1 -1
- package/dist/semiotic-ai-core.min.js +1 -1
- package/dist/semiotic-ai-core.module.min.js +1 -1
- package/dist/semiotic-ai.module.min.js +1 -1
- package/dist/semiotic-artifact.min.js +1 -1
- package/dist/semiotic-artifact.module.min.js +1 -1
- package/dist/semiotic-atlas-core.d.ts +20 -0
- package/dist/semiotic-atlas-core.min.js +1 -0
- package/dist/semiotic-atlas-core.module.min.js +1 -0
- package/dist/semiotic-atlas-selection.module.min.js +2 -0
- package/dist/semiotic-atlas.d.ts +8 -0
- package/dist/semiotic-atlas.min.js +2 -0
- package/dist/semiotic-atlas.module.min.js +2 -0
- package/dist/semiotic-client-cjs-shared.min.js +1 -1
- package/dist/semiotic-evidence.min.js +1 -1
- package/dist/semiotic-evidence.module.min.js +1 -1
- 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 +1 -1
- package/dist/semiotic-recipes-core.d.ts +9 -0
- package/dist/semiotic-recipes-core.module.min.js +1 -1
- package/dist/semiotic-server-edge-node.module.min.js +1 -1
- package/dist/semiotic-server-edge.min.js +1 -1
- package/dist/semiotic-server-edge.module.min.js +1 -1
- package/dist/semiotic-server-node.min.js +1 -1
- package/dist/semiotic-server-node.module.min.js +1 -1
- package/dist/semiotic-text.min.js +1 -1
- package/dist/semiotic-text.module.min.js +1 -1
- package/dist/semiotic-utils-core.min.js +1 -1
- package/dist/semiotic-utils-core.module.min.js +1 -1
- package/dist/semiotic.module.min.js +1 -1
- package/dist/server.min.js +1 -1
- package/dist/server.module.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +16 -1
- package/dist/c-447VIMRO.min.js +0 -1
- package/dist/c-553QUDKA.min.js +0 -1
- package/dist/c-7HP7MB2I.min.js +0 -1
- package/dist/c-7NBU5ZKS.min.js +0 -1
- package/dist/c-CCTGN5CK.min.js +0 -1
- package/dist/c-GSZRZRD6.min.js +0 -1
- package/dist/c-GWX7JGMF.min.js +0 -1
- package/dist/c-ITKX3RC5.min.js +0 -1
- package/dist/c-JG2JCQLP.min.js +0 -1
- package/dist/c-LYVKDBQJ.min.js +0 -1
- package/dist/c-NG7BLZTR.min.js +0 -1
- package/dist/c-PYNW54D2.min.js +0 -1
- package/dist/c-TIXX5CAU.min.js +0 -1
- /package/dist/{c-OOVX2JPQ.min.js → c-UC7SIU2W.min.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e){let[t,i]=Ri.useState(()=>Ti);return Ri.useEffect(()=>{if(t)return;let e=!1;return(Ti?Promise.resolve(Ti):(Di||(Di=import("./c-7EGHJU2F.min.js").then(e=>Ti=e.XYBrushOverlay).catch(e=>{throw Di=null,e})),Di)).then(t=>{e||i(()=>t)}),()=>{e=!0}},[t]),t?Yi(t,{...e}):null}function t(e,t,i){if(t._transitionKey)return t._transitionKey;switch(t.type){case"point":if(t.pointId)return"p:"+t.pointId;if("streaming"===e.runtimeMode&&t.datum){let i=e.getX(t.datum),r=e.getY(t.datum);if(e.getCategory)return`p:${e.getCategory(t.datum)}:${i}:${r}`;if(null!=i&&null!=r)return`p:${i}:${r}`}return"p:"+i;case"glyph":return t.pointId?"g:"+t.pointId:"g:"+i;case"rect":return`r:${t.group||""}:${t.datum?.binStart??t.datum?.category??i}`;case"heatcell":return`h:${t.x}_${t.y}`;case"candlestick":return null==t.datum?"c:"+i:"c:"+e.getX(t.datum);case"line":return"l:"+(t.group||"_default");case"area":return"a:"+(t.group||"_default");default:return null}}function i(e){return e?null!=e.opacity?e.opacity:null!=e.fillOpacity?e.fillOpacity:1:1}function r(e,t){let i="function"==typeof e?e:i=>i[e||t];return e=>{let t=i(e);return null==t?NaN:+t}}function s(e){let t=[],i=["bar","swarm","waterfall"].includes(e.chartType)||"streaming"===e.runtimeMode,s=r(i&&e.valueAccessor||e.yAccessor,i?"value":"y");if(e.boundsAccessor){let i=Pe(e.boundsAccessor,"bounds");t.push({kind:"bounds",getTop:e=>{let t=s(e);if(!Number.isFinite(t))return NaN;let r=i(e);return Number.isFinite(r)&&0!==r?t+r:t},getBottom:e=>{let t=s(e);if(!Number.isFinite(t))return NaN;let r=i(e);return Number.isFinite(r)&&0!==r?t-r:t},style:e.boundsStyle,perSeries:!0,interactive:!1})}if(e.band){let i=Array.isArray(e.band)?e.band:[e.band];for(let e of i)t.push({kind:"band",getTop:r(e.y1Accessor,"y1"),getBottom:r(e.y0Accessor,"y0"),style:e.style,perSeries:!1!==e.perSeries,interactive:!0===e.interactive})}return t}function o(e,t){return t?[t[0]??e[0],t[1]??e[1]]:e}function a(e,t,i){if("log"===e){let e=[Math.max(t[0],1e-6),Math.max(t[1],1e-6)];return Bi().domain(e).range(i).clamp(!0)}return"symlog"===e?Li().domain(t).range(i):"time"===e?zi().domain([new Date(t[0]),new Date(t[1])]).range(i):Oi().domain(t).range(i)}function n(e,t){return e&&"object"==typeof e&&!Array.isArray(e)?ui(e,t):void 0}function l(e,t){let i=xi(t);if(!i)return e;let r=sr.get(e),s=r?.get(i);if(s)return s;let o=function(e,t,i=8){if(!t||2>e.length)return e.map(([e,t])=>[e,t]);let r=[],s=null,o={moveTo(e,t){s=[e,t],r.push([e,t])},lineTo(e,t){s=[e,t],r.push([e,t])},bezierCurveTo(e,t,o,a,n,l){if(!s)return s=[n,l],void r.push([n,l]);let[c,h]=s;for(let s=1;i>=s;s++){let u=s/i,d=1-u;r.push([d*d*d*c+3*d*d*u*e+3*d*u*u*o+u*u*u*n,d*d*d*h+3*d*d*u*t+3*d*u*u*a+u*u*u*l])}s=[n,l]},closePath(){},arc(){},rect(){},arcTo(){},quadraticCurveTo(e,t,i,o){s=[i,o],r.push([i,o])}};return rr().x(e=>e[0]).y(e=>e[1]).curve(t).context(o)(e),r}(e,i);return r||(r=new Map,sr.set(e,r)),r.set(i,o),o}function c(e,t,i,r=30,s,o=0){let a=null;if(s){let e=Le(s,t,i,r,o);e&&!1!==e.node.interactive&&(a={node:e.node,datum:e.node.datum,x:e.node.x,y:e.node.y,distance:e.distance})}for(let o of e){let e=null;switch(o.type){case"point":if(!1===o.interactive||s)break;e=u(o,t,i,r);break;case"symbol":e=d(o,t,i,r);break;case"glyph":e=p(o,t,i,r);break;case"line":e=g(o,t,i,r);break;case"rect":if(null==o.datum)break;e=y(o,t,i);break;case"heatcell":e=f(o,t,i);break;case"area":if(!1===o.interactive)break;e=x(o,t,i,r);break;case"candlestick":e=m(o,t,i)}e&&(!a||a.distance>e.distance)&&(a=e)}return a}function h(e,t,i){if(0===e.length)return null;if(e[0][0]>t||t>e[e.length-1][0])return null;let r=v(e,t);if(0>r||Math.abs(e[r][0]-t)>i)return null;let s=r,o=r;r>0&&e[r][0]>=t?(s=r-1,o=r):e.length-1>r&&(s=r,o=r+1);let[a,n]=e[s],[l,c]=e[o];return l===a?n:n+Math.max(0,Math.min(1,(t-a)/(l-a)))*(c-n)}function u(e,t,i,r=30){let s=t-e.x,o=i-e.y,a=Math.sqrt(s*s+o*o);return a>ze(e.r,r)?null:{node:e,datum:e.datum,x:e.x,y:e.y,distance:a}}function d(e,t,i,r=30){let s=t-e.x,o=i-e.y,a=Math.sqrt(s*s+o*o);return a>ze(vi(e.size),r)?null:{node:e,datum:e.datum,x:e.x,y:e.y,distance:a}}function p(e,t,i,r=30){if(null==e.datum)return null;let s=yi(e.glyph,e.size),o=e.x+s.centerDx,a=e.y+s.centerDy,n=t-o,l=i-a,c=Math.sqrt(n*n+l*l);return c>ze(s.radius,r)?null:{node:e,datum:e.datum,x:o,y:a,distance:c}}function g(e,t,i,r=30){if(0===e.path.length)return null;let s=v(e.path,t);if(0>s)return null;let o,[a,n]=e.path[s];if(e.path.length>1){let r=1/0,a=Math.max(0,s-1),n=Math.min(e.path.length-2,s);for(let s=a;n>=s;s++){let[o,a]=e.path[s],[n,l]=e.path[s+1],c=Ve(t,i,o,a,n,l);r>c&&(r=c)}o=r}else{let e=t-a,r=i-n;o=Math.sqrt(e*e+r*r)}let l=e.style;return o>Math.max(5,(l.strokeWidth??l.lineWidth??1)/2+2,r)?null:{node:e,datum:Array.isArray(e.datum)&&e.datum[s]?e.datum[s]:e.datum,x:a,y:n,distance:o}}function y(e,t,i){let r=Fe(t,i,e);return r.hit?{node:e,datum:e.datum,x:r.cx,y:r.cy,distance:0}:null}function f(e,t,i){let r=Fe(t,i,e);return r.hit?{node:e,datum:e.datum,x:r.cx,y:r.cy,distance:0}:null}function m(e,t,i){let r=e.bodyWidth/2,s=Math.min(e.openY,e.closeY);if(!(e.x-r-3>t||t>e.x+r+3||e.highY-3>i||i>e.lowY+3)){let r=s+Math.max(Math.max(e.openY,e.closeY)-s,1)/2,o=t-e.x,a=i-r;return{node:e,datum:e.datum,x:e.x,y:r,distance:Math.sqrt(o*o+a*a)}}return null}function x(e,t,i,r){if(0===e.topPath.length||e.clipRect&&(e.clipRect.x>t||t>e.clipRect.x+e.clipRect.width||e.clipRect.y>i||i>e.clipRect.y+e.clipRect.height))return null;let s,o=l(e.topPath,e.curve),a=v(o,t),n=v(e.topPath,t);if(0>a||0>n)return null;if(o.length>1){let e=1/0,r=Math.max(0,a-1),n=Math.min(o.length-2,a);for(let s=r;n>=s;s++){let[r,a]=o[s],[n,l]=o[s+1];e=Math.min(e,Ve(t,i,r,a,n,l))}s=e}else{let e=t-o[0][0],r=i-o[0][1];s=Math.sqrt(e*e+r*r)}if(s>r)return null;let[c,h]=e.topPath[n];return{node:e,datum:Array.isArray(e.datum)&&e.datum[n]?e.datum[n]:e.datum,x:c,y:h,distance:s}}function v(e,t){if(0===e.length)return-1;let i=0,r=e.length-1;for(;r>i;){let s=i+r>>1;t>e[s][0]?i=s+1:r=s}return i>0&&Math.abs(e[i][0]-t)>=Math.abs(e[i-1][0]-t)?i-1:i}function b(e,t,i){if("edges"===e){if(t)return"start";if(i)return"end"}return"middle"}function w(e,t,i){if("edges"===e){if(t)return"hanging";if(i)return"auto"}return"middle"}function k(e){if(0===e.length)return{min:null,max:null};let t=1/0,i=-1/0;for(let r of e)t>r.pixel&&(t=r.pixel),r.pixel>i&&(i=r.pixel);return{min:t,max:i}}function A(e){if(e)return"object"==typeof e?e.strokeDasharray:"dashed"===e?"6,4":"dotted"===e?"2,4":e}function _(e,t){return e&&"string"!=typeof e?{stroke:e.stroke??t.stroke,strokeWidth:e.strokeWidth??t.strokeWidth,...null!=e.strokeOpacity&&{strokeOpacity:e.strokeOpacity},...e.strokeDasharray&&{strokeDasharray:e.strokeDasharray}}:{...t,..."string"==typeof e&&{strokeDasharray:A(e)}}}function C(e,t,i){if("left"===e||"right"===e){let r="left"===e?i:0,s="left"===e?-1:1,o=Math.ceil(t/8),a="M0,"+r;for(let e=0;o>e;e++){let i=8*(e+1);a+=`L${Math.min(8*e+4,t)},${r+4*s}`,a+=`L${Math.min(i,t)},${r}`}return a}let r="bottom"===e?0:t,s="bottom"===e?1:-1,o=Math.ceil(i/8),a=`M${r},0`;for(let e=0;o>e;e++){let t=8*(e+1);a+=`L${r+4*s},${Math.min(8*e+4,i)}`,a+=`L${r},${Math.min(t,i)}`}return a}function S({axes:e,xTicks:t,yTicks:i,width:r,height:s}){let{xAxis:o,yAxis:a}=Nt(e);return or("g",{className:"stream-grid",children:[o,a].map((e,o)=>{if(!1===e?.grid)return null;let a=0===o,n=_(e?.gridStyle,{stroke:"var(--semiotic-grid, #e0e0e0)",strokeWidth:1});return(a?t:i).map((t,i)=>or("line",{x1:a?t.pixel:0,y1:a?0:t.pixel,x2:a?t.pixel:r,y2:a?s:t.pixel,...n,strokeDasharray:A(e?.gridStyle)??n.strokeDasharray},`${o}-${i}`))})})}function P(e){dr=e}function M(e,t,i){let r="function"==typeof t?t:e=>e[t||"x"],s="function"==typeof i?i:e=>e[i||"y"],o=[],a=[];for(let t of e){let e=r(t),i=s(t);"number"==typeof e&&isFinite(e)&&o.push(e),"number"==typeof i&&isFinite(i)&&a.push(i)}return{xValues:o,yValues:a}}function R(e){let[t,i]=hr.useState(()=>dr);return hr.useEffect(()=>{if(t)return;let e=!1;return(dr?Promise.resolve(dr):(pr||(pr=import("./c-PRIKOLTE.min.js").then(e=>dr=e.MarginalGraphics).catch(e=>{throw pr=null,e})),pr)).then(t=>{e||i(()=>t)}),()=>{e=!0}},[t]),t?ur(t,{...e}):null}function Y(e){let t=new Date(e instanceof Date?e.valueOf():e);return`${gr[t.getUTCMonth()]} ${t.getUTCDate()}`}function T(e){let t=Math.abs(e[1]-e[0]);return 864e5>t?e=>{let i=new Date(e instanceof Date?e.valueOf():e),r=`${(i.getUTCHours()+"").padStart(2,"0")}:${(i.getUTCMinutes()+"").padStart(2,"0")}`;return 3e5>t&&(r+=":"+(i.getUTCSeconds()+"").padStart(2,"0")),1e4>t&&(r+="."+(i.getUTCMilliseconds()+"").padStart(3,"0")),r}:3156e7>t?Y:1578e8>t?e=>{let t=new Date(e instanceof Date?e.valueOf():e);return`${gr[t.getUTCMonth()]} ${t.getUTCFullYear()}`}:e=>new Date(e instanceof Date?e.valueOf():e).getUTCFullYear()+""}function D(e){return"string"==typeof e||"number"==typeof e?6.5*(e+"").length:60}function E(e){let{scale:t,axis:i,size:r,horizontal:s=!1,axisExtent:o}=e,a=i?.extent??o,n=t.domain(),l=function(e){return e?.ticks??e?.tickCount??5}(i),c=Math.max(2,Math.floor(r/(s?70:30))),h="exact"===a?Math.max(2,l):Math.min(l,c),u=i?.tickValues??ae(t,h,a),d=u.map(e=>e.valueOf()),p=i?.tickFormat||e.format||(n[0]instanceof Date||u[0]instanceof Date?T([n[0].valueOf(),n[n.length-1].valueOf()]):Et(d)),g=(e,t)=>s?p(e,t,d):p(e),y=u.map((e,i)=>({value:e,pixel:t(e),label:g(e,i)})),f=22;if(s){let e=y.reduce((e,t)=>Math.max(e,D(t.label)),0);f=i?.autoRotate?Math.max(20,Math.min(e+8,55)):Math.max(55,e+8)}let m=function(e,t){if(2>=e.length)return e;let i=[e[0]];for(let r=1;e.length-1>r;r++)Math.abs(e[r].pixel-i[i.length-1].pixel)>=t&&i.push(e[r]);let r=e[e.length-1];return t>Math.abs(r.pixel-i[i.length-1].pixel)?i[i.length-1]=r:i.push(r),i}(y,f);if(m.length>1&&(m=m.filter((e,t)=>{return 0===t||(r=m[t-1].label,!!("string"!=typeof(i=e.label)&&"number"!=typeof i||"string"!=typeof r&&"number"!=typeof r||i+""!=r+""));var i,r})),i?.includeMax&&m.length>0&&"exact"!==a&&!i.tickValues){let e=n[n.length-1];if(null!=e){let i=t(e),r=Math.abs(i-m[m.length-1].pixel);if(r>1){let t=g(e,m.length);f>r&&m.length>1&&(m=m.slice(0,-1)),m=[...m,{value:e,pixel:i,label:t}]}}}return m}function O(e){let{width:t,height:i,totalWidth:r,totalHeight:s,margin:o,scales:a,showAxes:n,axes:l,showGrid:c,xFormat:h,yFormat:u,axisExtent:d}=e,p=yr(()=>{if(!a||!c)return[];let e=l?.find(e=>"bottom"===e.orient)??l?.find(e=>"top"===e.orient);return E({scale:a.x,axis:e,size:t,horizontal:!0,format:h,axisExtent:d})},[a,l,h,t,d,c]),g=yr(()=>{if(!a||!c)return[];let e=l?.find(e=>"left"===e.orient)??l?.find(e=>"right"===e.orient);return E({scale:a.y,axis:e,size:i,format:u,axisExtent:d})},[a,l,u,i,d,c]),y=c&&a,f=n&&a;if(!y&&!f)return null;let{xAxis:m,yAxis:x,xOrient:v,yOrient:b}=Nt(l),w="top"===v?0:i,k="right"===b?t:0,A=f&&!1!==m?.visible&&(!m||!1!==m.baseline),P=f&&!1!==x?.visible&&(!x||!1!==x.baseline),M=m?.jaggedBase||!1,R=x?.jaggedBase||!1,Y=_(m?.axisStyle,{stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),T=_(x?.axisStyle,{stroke:"var(--semiotic-border, #ccc)",strokeWidth:1});return fr("svg",{width:r,height:s,style:{position:"absolute",top:0,left:0,pointerEvents:"none"},children:mr("g",{transform:`translate(${o.left},${o.top})`,children:[y&&fr(S,{axes:l,xTicks:p,yTicks:g,width:t,height:i}),A&&!M&&fr("line",{x1:0,y1:w,x2:t,y2:w,...Y}),f&&!1!==m?.visible&&M&&fr("path",{d:C(v,t,i),fill:"none",...Y}),P&&!R&&fr("line",{x1:k,y1:0,x2:k,y2:i,...T}),f&&!1!==x?.visible&&R&&fr("path",{d:C(b,t,i),fill:"none",...T})]})})}function B(e){let{width:t,height:i,totalWidth:r,totalHeight:s,margin:o,scales:a,showAxes:n,axes:l,xLabel:c,yLabel:h,yLabelRight:u,xFormat:d,yFormat:p,axisExtent:g,showGrid:y,title:f,description:m,idPrefix:x,legend:v,legendHoverBehavior:A,legendClickBehavior:P,legendHighlightedCategory:M,legendIsolatedCategories:Y,legendPosition:T="right",legendLayout:O,foregroundGraphics:B,marginalGraphics:L,xValues:z,yValues:F,annotations:$,onAnnotationActivate:I,onObservation:N,chartId:W,chartType:X,autoPlaceAnnotations:j,svgAnnotationRules:V,xAccessor:H,yAccessor:G,annotationData:U,pointNodes:q,curve:K,underlayRendered:J,canvasObscuresUnderlay:Q=!0,linkedCrosshairName:ee,linkedCrosshairSourceId:te,children:ie}=e,re=Zt({onAnnotationActivate:I,onObservation:N,chartId:W,chartType:X}),se=Wt({showAxes:n,xLabel:c,yLabel:h,yLabelRight:u,axes:l}),oe=It(O,se.leftAxis),ae=It(O,se.rightAxis),ne=v&&"left"===T&&oe>0?oe:o.left,le=v&&"right"===T&&ae>0?ae:o.right,ce=ar(()=>{if(!n&&!y||!a)return[];let e=l?.find(e=>"bottom"===e.orient)??l?.find(e=>"top"===e.orient);return E({scale:a.x,axis:e,size:t,horizontal:!0,format:d,axisExtent:g})},[n,y,a,l,d,t,g]),he=ar(()=>!(!(l?.find(e=>"bottom"===e.orient)??l?.find(e=>"top"===e.orient))?.autoRotate||!function(e){for(let t=1;e.length>t;t++){let i=e[t-1],r=e[t];if(Math.abs(r.pixel-i.pixel)<(D(i.label)+D(r.label))/2+8)return!0}return!1}(ce)),[l,ce]),ue=ar(()=>{if(!n&&!y||!a)return[];let e=l?.find(e=>"left"===e.orient)??l?.find(e=>"right"===e.orient);return E({scale:a.y,axis:e,size:i,format:p,axisExtent:g})},[n,y,a,l,p,i,g]),de=ar(()=>{if(!n||!a||!l?.some(e=>"left"===e.orient))return[];let e=l?.find(e=>"right"===e.orient);return e?E({scale:a.y,axis:e,size:i,format:p,axisExtent:g}):[]},[n,a,l,p,i,g]),pe=nr(new Map),ge=nr($?.length??0),ye=$?.length??0;ge.current!==ye&&(ge.current=ye,pe.current=new Map);let fe=ar(()=>{if(!$||0===$.length)return null;let e=Be($),r=kt("xy",re),s={scales:a?{x:a.x,y:a.y,time:a.x,value:a.y}:null,timeAxis:"x",xAccessor:H,yAccessor:G,width:t,height:i,data:U,frameType:"xy",pointNodes:q,curve:K,stickyPositionCache:pe.current},o=j?ft({annotations:e,context:s,..."object"==typeof j?j:{}}):e;return Ft(o,r,V,s)},[$,j,V,t,i,H,G,U,a,q,K,re]),me=ii(ee);lr(()=>{if(!me?.locked||!ee)return;let e=e=>{"Escape"===e.key&&Qt(ee)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[me?.locked,ee]);let xe=n||f||m||v||B||L||fe&&fe.length>0||y||ie||me,ve=cr(),{titleId:be,descId:we,labelledBy:ke}=Ne(x||W||ve);return xe?br("svg",{role:"img","aria-labelledby":ke,width:r,height:s,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:[vr("title",{id:be,children:We(f,"XY Chart")}),vr("desc",{id:we,children:Ie(f,m,{familyPhrase:"XY data visualization",fallback:"XY data visualization"})}),br("g",{transform:`translate(${o.left},${o.top})`,children:[y&&a&&(!J||Q)&&vr(S,{axes:l,xTicks:ce,yTicks:ue,width:t,height:i}),n&&a&&(()=>{let{xAxis:e,yAxis:r,xOrient:s,yOrient:o,leftAxis:a}=Nt(l),n="top"===s?0:i,d="right"===o?t:0,p="top"===s?-1:1,g="right"===o?1:-1,y=!e||!1!==e.baseline,f=!r||!1!==r.baseline,m=e?.jaggedBase||!1,x=r?.jaggedBase||!1,v=e?.landmarkTicks,A=r?.landmarkTicks,S=_(e?.axisStyle,{stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),P=_(r?.axisStyle,{stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),M="var(--semiotic-text-secondary, var(--semiotic-text, #666))",R="var(--semiotic-text, #333)",Y=he,T={fontSize:"var(--semiotic-tick-font-size, 12px)"},D={fontSize:"calc(var(--semiotic-tick-font-size, 12px) + 1px)"},E={fontSize:"var(--semiotic-axis-label-font-size, 12px)"},O=e?.tickAnchor,B=r?.tickAnchor,L=e?.label??c,z=r?.label??("right"===o?u??h:h),F="right"===o?t+le-15:15-ne,$=k(ce),I=k(ue);return br("g",{className:"stream-axes",style:{fontFamily:"var(--semiotic-font-family, sans-serif)"},children:[!1!==e?.visible&&br("g",{className:"semiotic-axis semiotic-axis-"+s,"data-orient":s,children:[(!J||Q)&&y&&!m&&vr("line",{x1:0,y1:n,x2:t,y2:n,...S}),(!J||Q)&&m&&vr("path",{d:C(s,t,i),fill:"none",...S}),ce.map((e,t)=>{let i=!!v&&("function"==typeof v?v(e.value,t):$e(e.value,t>0?ce[t-1].value:void 0));return br("g",{transform:`translate(${e.pixel},${n})`,children:[vr("line",{y2:5*p,...S}),"string"==typeof e.label||"number"==typeof e.label?vr("text",{y:p*(Y?12:18),textAnchor:Y?"end":b(O,e.pixel===$.min,e.pixel===$.max),fontWeight:i?600:400,fill:M,fontSize:i?13:12,className:"semiotic-axis-tick",style:{userSelect:"none",...i?D:T},transform:Y?"top"===s?"rotate(45)":"rotate(-45)":void 0,children:e.label}):vr("foreignObject",{x:-30,y:"top"===s?-30:6,width:60,height:24,style:{overflow:"visible"},children:vr("div",{style:{textAlign:"center",userSelect:"none",...T},children:e.label})})]},"xtick-"+t)}),L&&vr("text",{x:t/2,y:"top"===s?-(Y?58:40):i+(Y?58:40),textAnchor:"middle",fill:R,fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...E},children:L})]}),!1!==r?.visible&&br("g",{className:"semiotic-axis semiotic-axis-"+o,"data-orient":o,children:[(!J||Q)&&f&&!x&&vr("line",{x1:d,y1:0,x2:d,y2:i,...P}),(!J||Q)&&x&&vr("path",{d:C(o,t,i),fill:"none",...P}),ue.map((e,t)=>{let i=!!A&&("function"==typeof A?A(e.value,t):$e(e.value,t>0?ue[t-1].value:void 0));return br("g",{transform:`translate(${d},${e.pixel})`,children:[vr("line",{x2:5*g,...P}),"string"==typeof e.label||"number"==typeof e.label?vr("text",{x:8*g,textAnchor:"right"===o?"start":"end",dominantBaseline:w(B,e.pixel===I.min,e.pixel===I.max),fontWeight:i?600:400,fill:M,fontSize:i?13:12,className:"semiotic-axis-tick",style:{userSelect:"none",...i?D:T},children:e.label}):vr("foreignObject",{x:"right"===o?8:-68,y:-12,width:60,height:24,style:{overflow:"visible"},children:vr("div",{style:{textAlign:"right"===o?"left":"right",userSelect:"none",...T},children:e.label})})]},"ytick-"+t)}),z&&vr("text",{x:F,y:i/2,textAnchor:"middle",fill:R,transform:`rotate(${"right"===o?90:-90}, ${F}, ${i/2})`,fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...E},children:z})]}),(()=>{let e=l?.find(e=>"right"===e.orient);if(!a||!e||!1===e.visible||0===de.length)return null;let r=!1!==e.baseline,s=e.landmarkTicks,o=e.label||u,n=e.tickAnchor,c=_(e.axisStyle,{stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),h=k(de);return br("g",{className:"semiotic-axis semiotic-axis-right","data-orient":"right",children:[r&&!e.jaggedBase&&vr("line",{x1:t,y1:0,x2:t,y2:i,...c}),e.jaggedBase&&vr("path",{d:C("right",t,i),fill:"none",...c}),de.map((e,i)=>{let r=!!s&&("function"==typeof s?s(e.value,i):$e(e.value,i>0?de[i-1].value:void 0));return br("g",{transform:`translate(${t},${e.pixel})`,children:[vr("line",{x2:5,...c}),"string"==typeof e.label||"number"==typeof e.label?vr("text",{x:8,textAnchor:"start",dominantBaseline:w(n,e.pixel===h.min,e.pixel===h.max),fontWeight:r?600:400,fill:M,fontSize:r?13:12,className:"semiotic-axis-tick",style:{userSelect:"none",...r?D:T},children:e.label}):vr("foreignObject",{x:8,y:-12,width:60,height:24,style:{overflow:"visible"},children:vr("div",{style:{textAlign:"left",userSelect:"none",...T},children:e.label})})]},"ytick-r-"+i)}),o&&vr("text",{x:t+le-15,y:i/2,textAnchor:"middle",fill:R,transform:`rotate(90, ${t+le-15}, ${i/2})`,fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...E},children:o})]})})()]})})(),fe,L&&a&&z&&F&&br(xr,{children:[L.top&&vr("g",{transform:"translate(0, 0)",children:vr(R,{orient:"top",config:Z(L.top),values:z,scale:a.x,size:o.top,length:t})}),L.bottom&&vr("g",{transform:`translate(0, ${i})`,children:vr(R,{orient:"bottom",config:Z(L.bottom),values:z,scale:a.x,size:o.bottom,length:t})}),L.left&&vr("g",{transform:"translate(0, 0)",children:vr(R,{orient:"left",config:Z(L.left),values:F,scale:a.y,size:o.left,length:i})}),L.right&&vr("g",{transform:`translate(${t}, 0)`,children:vr(R,{orient:"right",config:Z(L.right),values:F,scale:a.y,size:o.right,length:i})})]}),B,me&&me.sourceId!==te&&a?.x&&(()=>{let e=a.x(me.xValue);if(null==e||0>e||e>t)return null;let r=me.locked;return vr("line",{x1:e,y1:0,x2:e,y2:i,stroke:r?"white":"var(--semiotic-text-secondary, rgba(0,0,0,0.25))",strokeWidth:r?1.5:1,strokeDasharray:r?"6,3":"4,4",pointerEvents:"none"})})(),ie]}),vr(ut,{title:f,totalWidth:r,marginTop:o.top}),$t({legend:v,totalWidth:r,totalHeight:s,margin:o,legendPosition:T,title:f,legendLayout:O,axisChrome:se,legendHoverBehavior:A,legendClickBehavior:P,legendHighlightedCategory:M,legendIsolatedCategories:Y})]}):null}function L(e,t,i,r){if(!e||2>t.length)return null;let s=xt(e.stops,r);return s?Pr("linearGradient",{id:i,gradientUnits:"userSpaceOnUse",x1:t[0][0],y1:0,x2:t[t.length-1][0],y2:0,children:s}):null}function z(e,t){let i=e.trim();if(/^#[0-9a-f]{3}$/i.test(i)){let e=i[1],r=i[2],s=i[3];return`#${e}${e}${r}${r}${s}${s}${t}`}if(/^#[0-9a-f]{6}$/i.test(i))return`${i}${t}`;let r=i.match(/^rgb\s*\(\s*([^)]+?)\s*\)$/i);return r?`rgba(${r[1]}, ${(parseInt(t,16)/255).toFixed(3)})`:i}function F(e){if(!e)return;let t=[];for(let i of e)if("point"===i.type)t.push(i);else if("symbol"===i.type)t.push({pointId:i.pointId,x:i.x,y:i.y,r:vi(i.size)});else if("glyph"===i.type){let e=yi(i.glyph,i.size);t.push({pointId:i.pointId,x:i.x+e.centerDx,y:i.y+e.centerDy,r:e.radius})}return t}function $(e){return null==e?"":"number"==typeof e?Number.isInteger(e)?e+"":e.toFixed(2):e instanceof Date?e.toLocaleString():e+""}function I({hover:e}){let t=e.data??{},i=t.__aggregateValue??t.y??t.value,r=t.x??t.time;if(void 0===i&&void 0===r){let e=Gt(t);if(null!=e.title||e.entries.length>0)return Dr("div",{className:"semiotic-tooltip",style:At,children:[null!=e.title&&Tr("div",{style:{fontWeight:600,marginBottom:e.entries.length?2:0},children:e.title+""}),e.entries.map(e=>Dr("div",{style:{opacity:.7,fontSize:11},children:[e.key,":"," ",Tr("span",{style:{fontWeight:600},children:$(e.value)})]},e.key))]})}return Dr("div",{className:"semiotic-tooltip",style:At,children:[Tr("div",{style:{fontWeight:600,marginBottom:2},children:$(i)}),Tr("div",{style:{opacity:.7,fontSize:11},children:$(r)})]})}function N(e,t){if(!t||0===e.length||!e.some(e=>null!=e&&"object"==typeof e&&Array.isArray(e[t])))return e;let i=[];for(let r of e){if(null==r||"object"!=typeof r)continue;let e=r[t];if(!Array.isArray(e))continue;let s=r.label??r.id??r.key;for(let t of e)null==t||"object"!=typeof t||i.push(null==s?t:{...t,_lineGroup:s})}return i}function W(e){if(e)return"x"===e.dimension?"pan-y":"y"===e.dimension?"pan-x":"none"}function X({brush:e,onBrush:t,linkedBrush:i,xAccessor:r,yAccessor:s,defaultDimension:o="xy"}){let a=Tt(i),n=!!e||!!a||!!t,l=a?.xField||("string"==typeof r?r:void 0),c=a?.yField||("string"==typeof s?s:void 0),h="y"!==o||a?.xField?l:void 0,u="x"!==o||a?.yField?c:void 0,d=ei({name:a?.name||"__unused_brush__",xField:h,yField:u}),p=a?"xyBrush"===d.brushInteraction.brush?"xy":"xBrush"===d.brushInteraction.brush?"x":"y":o,g=Ir(d.brushInteraction);g.current=d.brushInteraction;let y=$r(e=>{let i=g.current;if(!e)return a&&i.end(null),void t?.(null);a&&i.end("xyBrush"===i.brush?[[e.x[0],e.y[0]],[e.x[1],e.y[1]]]:"xBrush"===i.brush?e.x:e.y),t?.(e)},[a,t]);return n?{brushStreamProps:{brush:{dimension:p},onBrush:y}}:{brushStreamProps:{}}}import{computeBinExtent as j,getXYCanvasRenderers as V,getXYPlugin as H,getXYSceneBuilder as G,registerXYPlugin as U,unwrapXYScene as q}from"./c-ZYPXQF7B.min.js";import{coerceDateLikeValue as K,parseDateLikeString as J}from"./c-P65V6HLO.min.js";import{resolveNodeColor as Q}from"./c-ORLEBW72.min.js";import{normalizeMarginalConfig as Z}from"./c-QAVFOEUY.min.js";import{buildThresholdLineSegments as ee}from"./c-NYZ2QNAM.min.js";import{DataSourceAdapter as te,IncrementalExtent as ie,buildEnrichAnnotationData as re,resolveAnnotationAccessor as se,snapXYIntroTargets as oe,ticksForMode as ae,toIdSet as ne,xyFrameLegendOptions as le}from"./c-ROEHCIGV.min.js";import{computeDivergingStackExtent as ce,computeStackOffsets as he,normalizeColorGradient as ue,normalizeGradient as de}from"./c-AVO3Q7T7.min.js";import{RingBuffer as pe,applyPulse as ge,compactTimestampBufferForRemoval as ye,createTimestampBufferForData as fe,ensureRingBufferCapacity as me,hasActivePulses as xe,pushWithTimestamp as ve,refreshIdlePulse as be,useSemanticFrameInteractions as we,useXYKeyboardNavigation as ke}from"./c-BNG5ECK5.min.js";import{enrichDatumWithBand as Ae}from"./c-TKG2NP7G.min.js";import{needsInteractionCanvasPaint as _e}from"./c-V4XMSLC3.min.js";import{AXIS_FRAME_DEFAULT_MARGIN as Ce}from"./c-2N7IU2NY.min.js";import{accessorsEquivalent as Se,resolveAccessor as Pe,resolveStringAccessor as Me}from"./c-YLZIV3VS.min.js";import{StalenessBadge as Re,applyDecay as Ye,attachUpdateResultStore as Te,buildDatumIndexMap as De,composeOverlays as Ee,computeDecayOpacity as Oe,filterAnnotationsByStatus as Be,findHitPointInQuadtree as Le,getHitRadius as ze,hitTestRect as Fe,isTimeLandmark as $e,overlayAccessibleDescription as Ie,overlayAccessibleIds as Ne,overlayAccessibleTitle as We,paintCanvasBackground as Xe,paintSceneWithBackend as je,pointToSegmentDistance as Ve,renderSceneWithBackend as He,resolveCanvasBackground as Ge,resolveFrameGraphics as Ue,resolveStaleness as qe,runCustomLayoutAttempt as Ke,shouldHandleFramePointer as Je,useConfigSync as Qe,useLayoutSelectionSync as Ze,useLegendCategoryEmission as et,useStableShallow as tt,useStalenessCheck as it,warnCustomLayoutDiagnostics as rt}from"./c-ITKX3RC5.min.js";import{wrapWithCustomLayoutSelection as st}from"./c-YDECTEUW.min.js";import{AccessibleDataTable as ot,AccessibleTablePortal as at,AriaLiveTooltip as nt,CanvasFrameBackground as lt,FlippingTooltip as ct,FocusRing as ht,SVGChartTitle as ut,SceneRevisionDiagnosticsObserver as dt,ScreenReaderSummary as pt,SkipToTableLink as gt,UpdateResultTracker as yt,annotationLayout as ft,buildHoverData as mt,colorStopElements as xt,computeCanvasAriaLabel as vt,computeEasing as bt,computeRawProgress as wt,createDefaultAnnotationRules as kt,defaultTooltipStyle as At,filterSparseArray as _t,getDevicePixelRatio as Ct,getPointerHitRadius as St,glyphNodeToSVG as Pt,isAnnotationActivationTarget as Mt,isServerEnvironment as Rt,lerp as Yt,normalizeLinkedBrush as Tt,now as Dt,numericTickFormatter as Et,observationInputType as Ot,pointOrRectSceneNodeToSVG as Bt,prepareCanvas as Lt,rehitCanvasMarkCursor as zt,renderAnnotationPass as Ft,renderLegendFromConfig as $t,resolveLegendSideGutter as It,resolveXYAxes as Nt,resolveXYAxisChrome as Wt,safeSvgId as Xt,sceneHasAuthoredCursor as jt,sceneMarkCursor as Vt,setCanvasMarkCursor as Ht,smartTooltipEntries as Gt,subscribeToCanvasFontInvalidation as Ut,svgFill as qt,symbolSceneNodeToSVG as Kt,syncCanvasSize as Jt,unlockCrosshair as Qt,useAnnotationActivationOptions as Zt,useBrushSelection as ei,useCanvasMarkCursorCleanup as ti,useCrosshairPosition as ii,useFrame as ri,useFrameCanvasHost as si,useHydration as oi,useSceneRevisionDiagnostics as ai,useWasHydratingFromSSR as ni,withSceneMarkCursor as li}from"./c-LMGSSD2E.min.js";import{STREAMING_PALETTE as ci,resolveCategoricalPalette as hi,resolveExplicitColor as ui}from"./c-CPV4N35K.min.js";import{resolveThemeSemanticColors as di}from"./c-JUKIWTBJ.min.js";import{requestsSelectionProvenance as pi}from"./c-T2V7O2LO.min.js";import{getCSSColorCacheVersion as gi,glyphHitGeometry as yi,hatchPatternDef as fi,isHatchFill as mi,resolveCurveFactory as xi,symbolRadius as vi}from"./c-553QUDKA.min.js";import*as bi from"react";import{forwardRef as wi,memo as ki,useCallback as Ai,useEffect as _i,useId as Ci,useMemo as Si,useRef as Pi,useState as Mi}from"react";import*as Ri from"react";import{jsx as Yi}from"react/jsx-runtime";var Ti=null,Di=null,Ei=new Set;import{scaleLinear as Oi,scaleLog as Bi,scaleSymlog as Li,scaleTime as zi}from"d3-scale";var Fi=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],$i=["scene-style","data-paint","accessibility","evidence"],Ii=(e,t)=>({retainedData:e,invalidations:t}),Ni=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Wi=["layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Xi=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],ji=["layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Vi=["scene-geometry","data-paint","accessibility","evidence"],Hi=["scene-style","data-paint","accessibility","evidence"],Gi=[],Ui={chartType:Ii("rebuild",Ni),runtimeMode:Ii("rebuild",Ni),xAccessor:Ii("rebuild",Ni),yAccessor:Ii("rebuild",Ni),timeAccessor:Ii("rebuild",Ni),valueAccessor:Ii("rebuild",Ni),y0Accessor:Ii("rebuild",Ni),boundsAccessor:Ii("rebuild",Ni),band:Ii("rebuild",Ni),openAccessor:Ii("rebuild",Ni),highAccessor:Ii("rebuild",Ni),lowAccessor:Ii("rebuild",Ni),closeAccessor:Ii("rebuild",Ni),candlestickRangeMode:Ii("rebuild",Ni),accessorRevision:Ii("rebuild",Ni),groupAccessor:Ii("rebuild",Wi),categoryAccessor:Ii("rebuild",Wi),lineDataAccessor:Ii("rebuild",Wi),colorAccessor:Ii("rebuild",Hi),sizeAccessor:Ii("rebuild",Vi),symbolAccessor:Ii("rebuild",Vi),pointIdAccessor:Ii("rebuild",Vi),xScaleType:Ii("preserve",Xi),yScaleType:Ii("preserve",Xi),xExtent:Ii("preserve",Xi),invertY:Ii("preserve",Xi),yExtent:Ii("preserve",Xi),extentPadding:Ii("preserve",Xi),scalePadding:Ii("preserve",Xi),axisExtent:Ii("preserve",Xi),yAxisExtent:Ii("preserve",Xi),binSize:Ii("preserve",Xi),normalize:Ii("preserve",Xi),heatmapAggregation:Ii("preserve",Xi),heatmapXBins:Ii("preserve",Xi),heatmapYBins:Ii("preserve",Xi),arrowOfTime:Ii("preserve",ji),baseline:Ii("preserve",ji),stackOrder:Ii("preserve",ji),sizeRange:Ii("preserve",ji),curve:Ii("preserve",ji),areaGroups:Ii("preserve",ji),customLayout:Ii("preserve",ji),layoutConfig:Ii("preserve",ji),layoutMargin:Ii("preserve",ji),symbolMap:Ii("preserve",Vi),showValues:Ii("preserve",Vi),heatmapValueFormat:Ii("preserve",Vi),trackHoverRows:Ii("preserve",Vi),lineStyle:Ii("preserve",Hi),pointStyle:Ii("preserve",Hi),areaStyle:Ii("preserve",Hi),barStyle:Ii("preserve",Hi),swarmStyle:Ii("preserve",Hi),waterfallStyle:Ii("preserve",Hi),candlestickStyle:Ii("preserve",Hi),boundsStyle:Ii("preserve",Hi),gradientFill:Ii("preserve",Hi),lineGradient:Ii("preserve",Hi),semanticLineStops:Ii("preserve",Hi),colorScheme:Ii("preserve",Hi),themeCategorical:Ii("preserve",Hi),themeSemantic:Ii("preserve",Hi),themeSequential:Ii("preserve",Hi),themeDiverging:Ii("preserve",Hi),barColors:Ii("preserve",Hi),decay:Ii("preserve",Hi),pulse:Ii("preserve",Hi),staleness:Ii("preserve",Hi),layoutSelection:Ii("preserve",Hi),annotations:Ii("preserve",["overlay","accessibility","evidence"]),windowSize:Ii("preserve",Gi),windowMode:Ii("preserve",Gi),maxCapacity:Ii("preserve",Gi),clock:Ii("preserve",Gi),transition:Ii("preserve",Gi),introAnimation:Ii("preserve",Gi),onLayoutError:Ii("preserve",Gi)},qi=Ii("preserve",ji),Ki=class{constructor(){this.tracker=new yt}get last(){return this.tracker.last}subscribe(e){return this.tracker.subscribe(e)}recordData(e,t){return this.tracker.record({kind:e,...void 0===t?{}:{count:t}},Fi)}recordNoop(e){return this.tracker.record({kind:e,..."restyle"===e?{}:{count:0}},[])}recordRestyle(e){return e?this.tracker.record({kind:"restyle"},$i):this.recordNoop("restyle")}recordConfig(e,t=!1){let i=function(e){let t="preserve",i=new Set;for(let r of e){let e=Ui[r]??qi;"rebuild"===e.retainedData&&(t="rebuild");for(let t of e.invalidations)i.add(t)}return{retainedData:t,invalidations:i}}(e);return this.tracker.record({kind:"config",keys:e},t?new Set([...i.invalidations,...Vi]):i.invalidations)}};import{quadtree as Ji}from"d3-quadtree";var Qi=class{constructor(){this.maxRadius=0,this.tree=null}get quadtree(){return this.tree}get maxPointRadius(){return this.maxRadius}clear(){this.tree=null,this.maxRadius=0}rebuild(e,t){if("scatter"!==e&&"bubble"!==e&&"custom"!==e)return void this.clear();let i=0,r=0;for(let e of t)"point"===e.type&&!1!==e.interactive&&(i++,e.r>r&&(r=e.r));if(this.maxRadius=r,500>=i)return void(this.tree=null);let s=Array(i),o=0;for(let e of t)"point"===e.type&&!1!==e.interactive&&(s[o++]=e);this.tree=Ji().x(e=>e.x).y(e=>e.y).addAll(s)}},Zi=class e{constructor(e){if(this.xExtent=new ie,this.yExtent=new ie,this.growingCapacityWarned=!1,this.windowSizeWarned=!1,this.resolvedRibbons=[],this.timestampBuffer=null,this.activeTransition=null,this._hasRenderedOnce=!1,this.prevPositionMap=new Map,this.prevPathMap=new Map,this.exitNodes=[],this.lastIngestTime=0,this._colorMapCache=null,this._groupDataCache=null,this._groupColorMap=new Map,this._groupColorCounter=0,this._barCategoryCache=null,this._binBoundaries=[],this._stackExtentCache=null,this._ingestVersion=0,this._datumIndexCache=null,this._bufferArrayCache=null,this._bufferDirty=!0,this.needsFullRebuild=!0,this.lastLayout=null,this.updateResults=new Ki,this.scales=null,this.scene=[],this.version=0,this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customLayoutFailedThisBuild=!1,this._customLayoutDiagnosticsWarned=new Set,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this.xIsDate=!1,this.spatialIndex=new Qi,this._lastBoundedInsertsRef=null,this.applyPulse=(e,t,i)=>!(!this.config.pulse||!this.timestampBuffer)&&ge(this.config.pulse,e,t,this.timestampBuffer,this.getDatumIndexMap(t),i),this.config=e,this.buffer=new pe(e.windowSize),this.growingCap=e.windowSize,["bar","swarm","waterfall"].includes(e.chartType)||"streaming"===e.runtimeMode?(this.getX=Pe(e.timeAccessor||e.xAccessor,"time"),this.getY=Pe(e.valueAccessor||e.yAccessor,"value")):(this.getX=Pe(e.xAccessor,"x"),this.getY=Pe(e.yAccessor,"y")),this.getGroup=Me(e.groupAccessor),this.getCategory=Me(e.categoryAccessor),this.getSize=e.sizeAccessor?Pe(e.sizeAccessor,"size"):void 0,this.getColor=Me(e.colorAccessor),this.getSymbol=Me(e.symbolAccessor),this.getY0=e.y0Accessor?Pe(e.y0Accessor,"y0"):void 0,this.resolvedRibbons=s(e),this.getPointId=Me(e.pointIdAccessor),"candlestick"===e.chartType){let t=null!=e.openAccessor,i=null!=e.closeAccessor;this.getOpen=t?Pe(e.openAccessor,"open"):void 0,this.getHigh=Pe(e.highAccessor,"high"),this.getLow=Pe(e.lowAccessor,"low"),this.getClose=i?Pe(e.closeAccessor,"close"):void 0,this.config.candlestickRangeMode=!t&&!i}e.pulse&&(this.timestampBuffer=new pe(e.windowSize))}currentTime(){return this.config.clock?.()??Dt()}syncPulseTimestampBuffer(){this.config.pulse?null!=this.timestampBuffer&&this.timestampBuffer.capacity===this.buffer.capacity&&this.timestampBuffer.size===this.buffer.size||(this.timestampBuffer=fe(this.buffer,this.currentTime())):this.timestampBuffer=null}pushDatumYExtent(e){if("candlestick"===this.config.chartType&&this.getHigh&&this.getLow)return this.yExtent.push(this.getHigh(e)),void this.yExtent.push(this.getLow(e));this.yExtent.push(this.getY(e)),this.getY0&&this.yExtent.push(this.getY0(e));for(let t of this.resolvedRibbons){let i=t.getTop(e),r=t.getBottom(e);Number.isFinite(i)&&this.yExtent.push(i),Number.isFinite(r)&&this.yExtent.push(r)}}evictDatumYExtent(e){if("candlestick"===this.config.chartType&&this.getHigh&&this.getLow)return this.yExtent.evict(this.getHigh(e)),void this.yExtent.evict(this.getLow(e));this.yExtent.evict(this.getY(e)),this.getY0&&this.yExtent.evict(this.getY0(e));for(let t of this.resolvedRibbons){let i=t.getTop(e),r=t.getBottom(e);Number.isFinite(i)&&this.yExtent.evict(i),Number.isFinite(r)&&this.yExtent.evict(r)}}rebuildYExtent(){this.yExtent.clear();for(let e of this.buffer)this.pushDatumYExtent(e)}rebuildExtents(){this.xExtent.clear(),this.yExtent.clear();for(let e of this.buffer)this.xExtent.push(this.getX(e)),this.pushDatumYExtent(e)}ingest(e){if(e.bounded&&this._lastBoundedInsertsRef===e.inserts)return this.updateResults.recordNoop("replace"),!1;let t=this.currentTime();if(this.lastIngestTime=t,this.needsFullRebuild=!0,this._bufferDirty=!0,this._ingestVersion++,e.bounded){this._lastBoundedInsertsRef=e.inserts,this.buffer.clear(),this.xExtent.clear(),this.yExtent.clear(),this.timestampBuffer&&this.timestampBuffer.clear();let i=["bar","swarm","waterfall"].includes(this.config.chartType)||"streaming"===this.config.runtimeMode;if(this.getX=i?Pe(this.config.timeAccessor||this.config.xAccessor,"time"):Pe(this.config.xAccessor,"x"),this.xIsDate=!1,e.inserts.length>0){let t=e.inserts[0],i=this.config.xAccessor,r="function"==typeof i?i(t):t[i||"x"],s=r instanceof Date,o="string"==typeof r&&Number.isFinite(J(r));if(this.xIsDate=s||o,o){let e="string"==typeof i?i:void 0;this.getX=e?t=>K(t[e]):e=>K(i(e))}}me(this.buffer,e.totalSize||e.inserts.length,this.timestampBuffer);for(let i of e.inserts)ve(this.buffer,i,this.timestampBuffer,t),this.xExtent.push(this.getX(i)),this.pushDatumYExtent(i)}else for(let i of e.inserts){if("growing"===this.config.windowMode&&this.buffer.full){let e=this.config.maxCapacity??1e5;e>this.growingCap&&(this.growingCap=Math.min(2*this.growingCap,e),this.buffer.resize(this.growingCap),this.timestampBuffer&&this.timestampBuffer.resize(this.growingCap),"production"!==process.env.NODE_ENV&&!this.growingCapacityWarned&&this.growingCap>=5e4&&(this.growingCapacityWarned=!0,console.warn(`[Semiotic] Growing window buffer reached ${this.growingCap} points (cap ${e}). Large canvas scenes are expensive — prefer a sliding window, aggregation, or an explicit maxCapacity if this is intentional.`)))}let e=ve(this.buffer,i,this.timestampBuffer,t);this.xExtent.push(this.getX(i)),this.pushDatumYExtent(i),null!=e&&(this.xExtent.evict(this.getX(e)),this.evictDatumYExtent(e))}return this.updateResults.recordData(e.bounded?"replace":"ingest",e.inserts.length),!0}ingestWithResult(e){return this.ingest(e),this.updateResults.last}computeScene(e){let{config:t,buffer:i}=this,r=this.scales,s=this.lastLayout;if(!this.needsFullRebuild&&!t.customLayout&&this.lastLayout&&this.scene.length>0&&this.scales&&0>=(this.config.scalePadding??0)&&(this.lastLayout.width!==e.width||this.lastLayout.height!==e.height))return void this.remapScene(e);this.xExtent.dirty&&this.xExtent.recalculate(i,this.getX),this.yExtent.dirty&&this.rebuildYExtent();let n=this.getBufferArray(),l=this.xExtent.extent,c=this.yExtent.extent,h="waterfall"===t.chartType&&i.size>0?function(e,t,i,r,s){let a=Array.from(new Set(e.map(t).filter(e=>Number.isFinite(e)))).sort((e,t)=>e-t);if(2>a.length)return o(i,r);let n=a[0],l=a[1],c=a[a.length-1],h=a[a.length-2];return o("log"===s&&n>0?[n/Math.sqrt(l/n),c*Math.sqrt(c/h)]:[n-(l-n)/2,c+(c-h)/2],r)}(n,this.getX,l,t.xExtent,t.xScaleType):o(l,t.xExtent),u=o(c,t.yExtent),d=!(!(g=t.yExtent)||null==g[0]||null==g[1]),p="exact"===(t.yAxisExtent??t.axisExtent);var g;if("stackedarea"===t.chartType&&!d&&i.size>0){let e=function(e){let{config:t,groups:i,getX:r,getY:s}=e,o="exact"===(t.yAxisExtent??t.axisExtent);if(t.normalize){let i=[0,o?1:1+t.extentPadding];return{yDomain:i,stackExtentCache:{key:`${e.bufferSize}:${e.ingestVersion}:norm`,yDomain:i}}}let a=`${e.bufferSize}:${e.ingestVersion}:${t.baseline??"zero"}:${t.stackOrder??"key"}`;if(e.stackExtentCache&&e.stackExtentCache.key===a)return{yDomain:e.stackExtentCache.yDomain,stackExtentCache:e.stackExtentCache};let n=new Map,l=new Set,c=0,h=new Map,u=new Map;for(let e of i){let t=new Map,i=0;for(let o of e.data){let e=r(o),a=s(o);if(!Number.isFinite(e)||!Number.isFinite(a))continue;t.set(e,(t.get(e)||0)+a),l.add(e),i+=a;let n=(h.get(e)||0)+a;h.set(e,n),n>c&&(c=n)}n.set(e.key,t),u.set(e.key,i)}let d,p,g=t.stackOrder??"key",y=(e,t)=>t>e?-1:e>t?1:0;if("input"===g)d=i.map(e=>e.key);else if("insideOut"===g){let e=[...i].map(e=>e.key).sort((e,t)=>{let i=(u.get(t)??0)-(u.get(e)??0);return 0!==i?i:y(e,t)}),t=[],r=[],s=0,o=0;for(let i of e)o>s?(t.push(i),s+=u.get(i)??0):(r.push(i),o+=u.get(i)??0);d=[...r.reverse(),...t]}else d="asc"===g?i.map(e=>e.key).sort((e,t)=>{let i=(u.get(e)??0)-(u.get(t)??0);return 0!==i?i:y(e,t)}):"desc"===g?i.map(e=>e.key).sort((e,t)=>{let i=(u.get(t)??0)-(u.get(e)??0);return 0!==i?i:y(e,t)}):i.map(e=>e.key).sort(y);if("wiggle"===t.baseline||"silhouette"===t.baseline){let e=Array.from(l).sort((e,t)=>e-t),i=he(e,d,(e,t)=>n.get(e)?.get(t)||0,t.baseline),r=1/0,s=-1/0;for(let t of e){let e=i.get(t)??0,o=h.get(t)??0;r>e&&(r=e),e+o>s&&(s=e+o)}(!Number.isFinite(r)||!Number.isFinite(s))&&(r=0,s=0);let a=s-r,c=o?0:a>0?a*t.extentPadding:1;p=[r-c,s+c]}else if("diverging"===t.baseline){let e=Array.from(l).sort((e,t)=>e-t),[i,r]=ce(e,d,(e,t)=>n.get(e)?.get(t)||0),s=r-i,a=o?0:s>0?s*t.extentPadding:1;p=[i-a,r+a]}else p=[0,c+(o?0:c>0?c*t.extentPadding:1)];return{yDomain:p,stackExtentCache:{key:a,yDomain:p}}}({config:t,groups:this.groupData(n),getX:this.getX,getY:this.getY,bufferSize:i.size,ingestVersion:this._ingestVersion,stackExtentCache:this._stackExtentCache});u=e.yDomain,this._stackExtentCache=e.stackExtentCache}else"bar"===t.chartType&&t.binSize&&!d&&i.size>0?u=function(e,t,i,r,s,o,a){let[,n]=j(e,t,i,r,s);return[0,a?n:n+n*o]}(i,this.getX,this.getY,t.binSize,this.getCategory,t.extentPadding,p):"waterfall"===t.chartType&&!d&&i.size>0?u=function(e,t,i,r){let[s,o]=function(e,t){let i=0,r=0,s=0;for(let o of e){let e=t(o);null==e||Number.isNaN(e)||(s+=e,i>s&&(i=s),s>r&&(r=s))}return[i,r]}(e,t),a=o-s,n=r?0:a>0?a*i:1;return[Math.min(0,s-Math.abs(n)),Math.max(0,o+Math.abs(n))]}(i,this.getY,t.extentPadding,p):!d&&u[0]!==1/0&&(u=function(e,t,i){if(!i.length)return e;let[r,s]=e;for(let e of t)for(let t of i){let i=t.getTop(e),o=t.getBottom(e);Number.isFinite(i)&&(r>i&&(r=i),i>s&&(s=i)),Number.isFinite(o)&&(r>o&&(r=o),o>s&&(s=o))}return[r,s]}(u,n,this.resolvedRibbons),u=function(e,t){let i=e[1]-e[0],r=t.exactMode?0:i>0?i*t.extentPadding:1,s=[null!=t.userMin?e[0]:e[0]-r,null!=t.userMax?e[1]:e[1]+r];return"log"!==t.yScaleType||s[0]>0||0>=t.dataYDomain[0]||t.exactMode||null==t.userMin&&(s[0]=t.dataYDomain[0]/(1+t.extentPadding)),s}(u,{exactMode:p,extentPadding:t.extentPadding,userMin:t.yExtent?.[0],userMax:t.yExtent?.[1],yScaleType:t.yScaleType,dataYDomain:c}));u=function(e,t,i){if(!t||i)return e;let r=t[0],s=t[1];return null==r&&null==s?e:[r??e[0],s??e[1]]}(u,t.yExtent,!!d),({xDomain:h,yDomain:u}=function(e,t,i){let r=e,s=t;if(r[0]===1/0||r[1]===-1/0)if("time"===i){let e=Date.now();r=[e-864e5,e]}else r=[0,1];return(s[0]===1/0||s[1]===-1/0)&&(s=[0,1]),{xDomain:r,yDomain:s}}(h,u,t.xScaleType)),this.scales=function(e){let{config:t,layout:i,xDomain:r}=e,s=t.invertY?[e.yDomain[1],e.yDomain[0]]:e.yDomain,o="streaming"===t.runtimeMode,n=Math.max(0,Math.min(t.scalePadding||0,Math.min(i.width,i.height)/2-1));if(o){let e="left"===t.arrowOfTime?[i.width-n,n]:[n,i.width-n];return{x:Oi().domain(r).range(e),y:a(t.yScaleType,s,[i.height-n,n])}}return{x:a(t.xScaleType,r,[n,i.width-n]),y:a(t.yScaleType,s,[i.height-n,n])}}({config:t,layout:e,xDomain:h,yDomain:u}),this._customLayoutFailedThisBuild=!1;let y=this.buildSceneNodes(e,n);if(this._customLayoutFailedThisBuild)return!0===this.lastCustomLayoutFailure?.preservedLastGoodScene?(this.scales=r,this.lastLayout=s):(this.scene=[],this.spatialIndex.rebuild(this.config.chartType,this.scene)),void(this.needsFullRebuild=!0);this.config.transition&&this.scene.length>0&&this.snapshotPositions(),this.scene=y,this.config.decay&&this.applyDecay(this.scene,n),this.config.pulse&&this.applyPulse(this.scene,n,this.currentTime()),this.config.transition&&!this._hasRenderedOnce&&this.scene.length>0&&(this.config.introAnimation&&this.synthesizeIntroPositions(),this._hasRenderedOnce=!0),this.config.transition&&(this.prevPositionMap.size>0||this.prevPathMap.size>0)&&this.startTransition(),this.spatialIndex.rebuild(this.config.chartType,this.scene),this.needsFullRebuild=!1,this.lastLayout={width:e.width,height:e.height},this.version++}get quadtree(){return this.spatialIndex.quadtree}get maxPointRadius(){return this.spatialIndex.maxPointRadius}remapScene(e){let t=e.width/this.lastLayout.width,i=e.height/this.lastLayout.height;for(let e of this.scene)switch(e.type){case"line":for(let r of e.path)r[0]*=t,r[1]*=i;break;case"area":for(let r of e.topPath)r[0]*=t,r[1]*=i;for(let r of e.bottomPath)r[0]*=t,r[1]*=i;e.clipRect&&(e.clipRect={x:e.clipRect.x*t,y:e.clipRect.y*i,width:e.clipRect.width*t,height:e.clipRect.height*i}),e.strokeColorBands&&(e.strokeColorBands=e.strokeColorBands.map(e=>({...e,y:e.y*i,height:e.height*i})));break;case"point":case"glyph":e.x*=t,e.y*=i;break;case"rect":case"heatcell":e.x*=t,e.y*=i,e.w*=t,e.h*=i;break;case"candlestick":e.x*=t,e.openY*=i,e.closeY*=i,e.highY*=i,e.lowY*=i}let r=this.scales.x.domain(),s=this.scales.y.domain(),o=this.scales.x.range(),n=this.scales.y.range(),l=a,c=Math.max(0,Math.min(this.config.scalePadding||0,Math.min(e.width,e.height)/2-1)),h=n[1]>n[0];this.scales={x:l(this.config.xScaleType,r,o[0]>o[1]?[e.width-c,c]:[c,e.width-c]),y:l(this.config.yScaleType,s,h?[c,e.height-c]:[e.height-c,c])},this.lastLayout={width:e.width,height:e.height},this.spatialIndex.rebuild(this.config.chartType,this.scene),this.version++}buildSceneNodes(e,t){let{config:i,scales:r}=this;if(!r)return[];if(i.customLayout){let s={data:t,scales:r,dimensions:{width:e.width,height:e.height,margin:i.layoutMargin??{top:0,right:0,bottom:0,left:0},plot:{x:0,y:0,width:e.width,height:e.height}},theme:{semantic:i.themeSemantic??{},categorical:i.themeCategorical??ci},resolveColor:(e,t)=>{let r=this.resolveGroupColor(e);if(r)return r;let s=this.resolveLineStyle(e,t);return s.stroke?s.stroke:"string"==typeof s.fill?s.fill:i.themeSemantic?.primary??"#4e79a7"},config:i.layoutConfig??{},selection:i.layoutSelection??null},o=Ke({family:"xy",logLabel:"customLayout",revision:this.version,hasPreviousResult:null!==this.lastCustomLayoutResult,onLayoutError:i.onLayoutError,run:()=>i.customLayout(s)});if("failure"===o.kind)return this.lastCustomLayoutFailure=o.diagnostic,this._customLayoutFailedThisBuild=!0,o.preservedLastGoodScene?this.scene:(this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,[]);let a=o.result;this.customLayoutOverlays=a.overlays??null,this.lastCustomLayoutResult=a,this.lastCustomLayoutFailure=null;let n=a.nodes??[];if(this._customRestyle=a.restyle,this.hasCustomRestyle=!!a.restyle,this.hasCustomRestyle){this._baseStyles=new WeakMap;for(let e of n)e.style&&this._baseStyles.set(e,e.style);this.applyCustomRestyle(n,i.layoutSelection??null)}return rt({label:"customLayout",nodes:n,overlays:this.customLayoutOverlays,warned:this._customLayoutDiagnosticsWarned}),n}if(this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,0===t.length)return[];let s={scales:r,config:i,getX:this.getX,getY:this.getY,getY0:this.getY0,getSize:this.getSize,getColor:this.getColor,getSymbol:this.getSymbol,getGroup:this.getGroup,getCategory:this.getCategory,getPointId:this.getPointId,ribbons:this.resolvedRibbons,getOpen:this.getOpen,getHigh:this.getHigh,getLow:this.getLow,getClose:this.getClose,resolveLineStyle:(e,t)=>this.resolveLineStyle(e,t),resolveAreaStyle:(e,t)=>this.resolveAreaStyle(e,t),resolveBoundsStyle:(e,t)=>this.resolveBoundsStyle(e,t),resolveColorMap:e=>this.resolveColorMap(e),resolveGroupColor:e=>this.resolveGroupColor(e),groupData:e=>this.groupData(e),barCategoryCache:this._barCategoryCache},o=G(i.chartType);if(!o)return H(a=i.chartType)||Rt&&(Ei.has(a)||(Ei.add(a),console.warn(`[semiotic] StreamXYFrame: no XY plugin registered for "${a}" during SSR. Import a chart HOC, or call registerBuiltInXYPlugins() from "semiotic/xy" or "semiotic/realtime/core" before render.`))),[];var a;let n=q(o(s,t,e));return"bar"===i.chartType&&(this._barCategoryCache=s.barCategoryCache??null,this._binBoundaries=n.binBoundaries),n.nodes}resolveBoundsStyle(e,t){return function(e,t,i,r){let s=e.boundsStyle;if("function"==typeof s)return s(i||{},t);if(s&&"object"==typeof s)return s;let o=r(t,i);return{fill:o.stroke||e.themeSemantic?.primary||"#4e79a7",fillOpacity:.2,...null!=o.opacity&&{opacity:o.opacity},stroke:"none",cursor:o.cursor}}(this.config,e,t,(e,t)=>this.resolveLineStyle(e,t))}computeDecayOpacity(e,t){let i=this.config.decay;return i&&t>1?Oe(i,e,t):1}getDatumIndexMap(e){if(this._datumIndexCache&&this._datumIndexCache.version===this._ingestVersion)return this._datumIndexCache.map;let t=De(e);return this._datumIndexCache={version:this._ingestVersion,map:t},t}applyDecay(e,t){this.config.decay&&Ye(this.config.decay,e,t,this.getDatumIndexMap(t))}refreshPulse(e){return!0!==this.lastCustomLayoutFailure?.preservedLastGoodScene&&this.applyPulse(this.scene,this.getBufferArray(),e)}hasActivePulsesAt(e){return!!this.config.pulse&&xe(this.config.pulse,this.timestampBuffer,e)}get hasActivePulses(){return this.hasActivePulsesAt(this.currentTime())}get transitionContext(){return{runtimeMode:this.config.runtimeMode,getX:this.getX,getY:this.getY,getCategory:this.getCategory}}snapshotPositions(){!function(e,r,s,o){s.clear(),o.clear();for(let a=0;r.length>a;a++){let n=r[a],l=t(e,n,a);l&&("point"===n.type?s.set(l,{x:n.x,y:n.y,r:n.r,opacity:i(n.style)}):"glyph"===n.type?s.set(l,{x:n.x,y:n.y,r:n.size,opacity:i(n.style),glyph:n.glyph}):"rect"===n.type||"heatcell"===n.type?s.set(l,{x:n.x,y:n.y,w:n.w,h:n.h,opacity:i(n.style)}):"candlestick"===n.type?s.set(l,{x:n.x,y:n.openY,w:n.bodyWidth,openY:n.openY,closeY:n.closeY,highY:n.highY,lowY:n.lowY,opacity:i(n.style)}):"line"===n.type?o.set(l,{path:n.path.map(e=>[e[0],e[1]]),opacity:n.style?.opacity}):"area"===n.type&&o.set(l,{topPath:n.topPath.map(e=>[e[0],e[1]]),bottomPath:n.bottomPath.map(e=>[e[0],e[1]]),opacity:n.style?.opacity}))}}(this.transitionContext,this.scene,this.prevPositionMap,this.prevPathMap)}synthesizeIntroPositions(){this.prevPositionMap.clear(),this.prevPathMap.clear();let e=this.scales?.y(0)??0;for(let i=0;this.scene.length>i;i++){let r=this.scene[i],s=t(this.transitionContext,r,i);s&&("point"===r.type?this.prevPositionMap.set(s,{x:r.x,y:r.y,r:0,opacity:0}):"rect"===r.type?this.prevPositionMap.set(s,{x:r.x,y:e,w:r.w,h:0,opacity:r.style.opacity??1}):"heatcell"===r.type?this.prevPositionMap.set(s,{x:r.x,y:r.y,w:r.w,h:r.h,opacity:0}):"line"===r.type?(r._introClipFraction=0,this.prevPathMap.set(s,{path:r.path.map(e=>[e[0],e[1]]),opacity:r.style.opacity})):"area"===r.type&&(r._introClipFraction=0,this.prevPathMap.set(s,{topPath:r.topPath.map(e=>[e[0],e[1]]),bottomPath:r.bottomPath.map(e=>[e[0],e[1]]),opacity:r.style.opacity})))}}startTransition(){if(!this.config.transition)return;let e=function(e,r,s,o,a,n=Dt()){if(0===o.size&&0===a.size)return s;let l=r.duration??300;if(s.exitNodes.length>0){let e=new Set(s.exitNodes);s.scene=s.scene.filter(t=>!e.has(t)),s.exitNodes=[]}let c=!1,h=new Set,u=new Set;for(let r=0;s.scene.length>r;r++){let n=s.scene[r],l=t(e,n,r);if(!l)continue;if(n._transitionKey=l,"line"===n.type||"area"===n.type){let e=a.get(l);if(e){if(u.add(l),"line"===n.type&&e.path&&e.path.length===n.path.length){n._targetPath=n.path.map(e=>[e[0],e[1]]),n._prevPath=e.path;for(let t=0;n.path.length>t;t++)n.path[t]=[e.path[t][0],e.path[t][1]];c=!0}else if("area"===n.type&&e.topPath&&e.bottomPath&&e.topPath.length===n.topPath.length&&e.bottomPath.length===n.bottomPath.length){n._targetTopPath=n.topPath.map(e=>[e[0],e[1]]),n._targetBottomPath=n.bottomPath.map(e=>[e[0],e[1]]),n._prevTopPath=e.topPath,n._prevBottomPath=e.bottomPath;for(let t=0;n.topPath.length>t;t++)n.topPath[t]=[e.topPath[t][0],e.topPath[t][1]];for(let t=0;n.bottomPath.length>t;t++)n.bottomPath[t]=[e.bottomPath[t][0],e.bottomPath[t][1]];c=!0}n._targetOpacity=n.style.opacity??1,n._startOpacity=e.opacity??n.style.opacity??1}else n._targetOpacity=n.style.opacity??1,n._startOpacity=0,n.style={...n.style,opacity:0},c=!0;continue}let d=o.get(l);if("point"===n.type)if(d){h.add(l);let e={x:n.x,y:n.y,r:n.r};n._targetOpacity=i(n.style),(d.x!==e.x||d.y!==e.y||d.r!==e.r)&&(n._targetX=e.x,n._targetY=e.y,n._targetR=e.r,n.x=d.x,n.y=d.y,n.r=d.r??n.r,c=!0)}else n._targetOpacity=i(n.style),n.style={...n.style,opacity:0},c=!0;else if("glyph"===n.type)if(d){h.add(l);let e={x:n.x,y:n.y,size:n.size};n._targetOpacity=i(n.style),(d.x!==e.x||d.y!==e.y||d.r!==e.size)&&(n._targetX=e.x,n._targetY=e.y,n._targetR=e.size,n.x=d.x,n.y=d.y,n.size=d.r??n.size,c=!0)}else n._targetOpacity=i(n.style),n.style={...n.style,opacity:0},c=!0;else if("rect"===n.type)if(d){h.add(l);let e={x:n.x,y:n.y,w:n.w,h:n.h};n._targetOpacity=i(n.style),(d.x!==e.x||d.y!==e.y||d.w!==e.w||d.h!==e.h)&&(n._targetX=e.x,n._targetY=e.y,n._targetW=e.w,n._targetH=e.h,n.x=d.x,n.y=d.y,n.w=d.w??n.w,n.h=d.h??n.h,c=!0)}else n._targetOpacity=i(n.style),n.style={...n.style,opacity:0},c=!0;else if("heatcell"===n.type)if(d){h.add(l);let e={x:n.x,y:n.y,w:n.w,h:n.h};n._targetOpacity=i(n.style),(d.x!==e.x||d.y!==e.y||d.w!==e.w||d.h!==e.h)&&(n._targetX=e.x,n._targetY=e.y,n._targetW=e.w,n._targetH=e.h,n.x=d.x,n.y=d.y,n.w=d.w??n.w,n.h=d.h??n.h,c=!0)}else n._targetOpacity=i(n.style),n.style={...n.style||{},opacity:0},c=!0;else if("candlestick"===n.type)if(d&&null!=d.openY){h.add(l);let e={x:n.x,openY:n.openY,closeY:n.closeY,highY:n.highY,lowY:n.lowY};n._targetOpacity=i(n.style),(d.x!==e.x||d.openY!==e.openY||d.closeY!==e.closeY||d.highY!==e.highY||d.lowY!==e.lowY)&&(n._targetX=e.x,n._targetOpenY=e.openY,n._targetCloseY=e.closeY,n._targetHighY=e.highY,n._targetLowY=e.lowY,n.x=d.x,n.openY=d.openY,n.closeY=d.closeY??n.closeY,n.highY=d.highY??n.highY,n.lowY=d.lowY??n.lowY,c=!0)}else n._targetOpacity=i(n.style),n.style={...n.style||{},opacity:0},c=!0}for(let[e,t]of a)if(!u.has(e))if(e.startsWith("l:")&&t.path){let i={type:"line",path:t.path.map(e=>[e[0],e[1]]),group:e.slice(2),style:{stroke:"#999",strokeWidth:1,opacity:t.opacity??1},_targetOpacity:0,_transitionKey:e,datum:null};s.exitNodes.push(i),c=!0}else if(e.startsWith("a:")&&t.topPath&&t.bottomPath){let i={type:"area",topPath:t.topPath.map(e=>[e[0],e[1]]),bottomPath:t.bottomPath.map(e=>[e[0],e[1]]),group:e.slice(2),style:{fill:"#999",opacity:t.opacity??1},_targetOpacity:0,_transitionKey:e,datum:null};s.exitNodes.push(i),c=!0}for(let[e,t]of o)if(!h.has(e)){if(e.startsWith("p:"))s.exitNodes.push({type:"point",x:t.x,y:t.y,r:t.r??3,style:{opacity:t.opacity??1},datum:null,_targetOpacity:0,_transitionKey:e});else if(e.startsWith("g:")&&t.glyph)s.exitNodes.push({type:"glyph",x:t.x,y:t.y,size:t.r??12,glyph:t.glyph,color:"#999",accent:"#999",style:{opacity:t.opacity??1},datum:null,_targetOpacity:0,_transitionKey:e});else if(e.startsWith("r:"))s.exitNodes.push({type:"rect",x:t.x,y:t.y,w:t.w??0,h:t.h??0,style:{opacity:t.opacity??1,fill:"#999"},datum:null,_targetOpacity:0,_transitionKey:e});else if(e.startsWith("h:"))s.exitNodes.push({type:"heatcell",x:t.x,y:t.y,w:t.w??0,h:t.h??0,fill:"#999",datum:null,style:{opacity:t.opacity??1},_targetOpacity:0,_transitionKey:e});else if(e.startsWith("c:")){let i=t.openY??t.y;s.exitNodes.push({type:"candlestick",x:t.x,openY:i,closeY:t.closeY??i,highY:t.highY??i,lowY:t.lowY??i,bodyWidth:t.w??6,upColor:"#999",downColor:"#999",wickColor:"#999",wickWidth:1,isUp:!0,datum:null,style:{opacity:t.opacity??1},_targetOpacity:0,_transitionKey:e})}c=!0}return s.exitNodes.length>0&&(s.scene=[...s.scene,...s.exitNodes]),c&&(s.activeTransition={startTime:n,duration:l}),s}(this.transitionContext,this.config.transition,{scene:this.scene,exitNodes:this.exitNodes,activeTransition:this.activeTransition},this.prevPositionMap,this.prevPathMap,this.currentTime());this.scene=e.scene,this.exitNodes=e.exitNodes,this.activeTransition=e.activeTransition}advanceTransition(e){if(!this.activeTransition||!this.config.transition)return!1;let t={scene:this.scene,exitNodes:this.exitNodes,activeTransition:this.activeTransition},i=function(e,t,i,r){if(!i.activeTransition)return!1;let s=wt(e,i.activeTransition),o=bt(s,"linear"===t.easing?"linear":"ease-out-cubic");for(let e of i.scene){let t=e._transitionKey;if("point"===e.type){if(void 0!==e._targetOpacity){let i=t?r.get(t):void 0;e.style.opacity=Yt(i?i.opacity??1:0,e._targetOpacity,o)}if(void 0===e._targetX||!t)continue;let i=r.get(t);if(!i)continue;e.x=Yt(i.x,e._targetX,o),e.y=Yt(i.y,e._targetY,o),void 0!==e._targetR&&void 0!==i.r&&(e.r=Yt(i.r,e._targetR,o))}else if("glyph"===e.type){if(void 0!==e._targetOpacity){let i=t?r.get(t):void 0;e.style.opacity=Yt(i?i.opacity??1:0,e._targetOpacity,o)}if(void 0===e._targetX||!t)continue;let i=r.get(t);if(!i)continue;e.x=Yt(i.x,e._targetX,o),e.y=Yt(i.y,e._targetY,o),void 0!==e._targetR&&void 0!==i.r&&(e.size=Yt(i.r,e._targetR,o))}else if("rect"===e.type){if(void 0!==e._targetOpacity){let i=t?r.get(t):void 0;e.style.opacity=Yt(i?i.opacity??1:0,e._targetOpacity,o)}if(void 0===e._targetX||!t)continue;let i=r.get(t);if(!i)continue;e.x=Yt(i.x,e._targetX,o),e.y=Yt(i.y,e._targetY,o),void 0!==i.w&&(e.w=Yt(i.w,e._targetW,o)),void 0!==i.h&&(e.h=Yt(i.h,e._targetH,o))}else if("heatcell"===e.type){if(void 0!==e._targetOpacity){let i=t?r.get(t):void 0;e.style={...e.style||{},opacity:Yt(i?i.opacity??1:0,e._targetOpacity,o)}}if(void 0===e._targetX||!t)continue;let i=r.get(t);if(!i)continue;e.x=Yt(i.x,e._targetX,o),e.y=Yt(i.y,e._targetY,o),void 0!==i.w&&(e.w=Yt(i.w,e._targetW,o)),void 0!==i.h&&(e.h=Yt(i.h,e._targetH,o))}else if("candlestick"===e.type){if(void 0!==e._targetOpacity){let i=t?r.get(t):void 0;e.style={...e.style||{},opacity:Yt(i?i.opacity??1:0,e._targetOpacity,o)}}if(void 0===e._targetX||!t)continue;let i=r.get(t);if(!i)continue;e.x=Yt(i.x,e._targetX,o),void 0!==i.openY&&(e.openY=Yt(i.openY,e._targetOpenY,o)),void 0!==i.closeY&&(e.closeY=Yt(i.closeY,e._targetCloseY,o)),void 0!==i.highY&&(e.highY=Yt(i.highY,e._targetHighY,o)),void 0!==i.lowY&&(e.lowY=Yt(i.lowY,e._targetLowY,o))}else if("line"===e.type){void 0!==e._targetOpacity&&(e.style={...e.style,opacity:Yt(e._startOpacity??0,e._targetOpacity,o)}),void 0!==e._introClipFraction&&(e._introClipFraction=o);let t=e._prevPath,i=e._targetPath;if(t&&i&&t.length===e.path.length)for(let r=0;e.path.length>r;r++)e.path[r][0]=Yt(t[r][0],i[r][0],o),e.path[r][1]=Yt(t[r][1],i[r][1],o)}else if("area"===e.type){void 0!==e._targetOpacity&&(e.style={...e.style,opacity:Yt(e._startOpacity??0,e._targetOpacity,o)}),void 0!==e._introClipFraction&&(e._introClipFraction=o);let t=e._prevTopPath,i=e._prevBottomPath,r=e._targetTopPath,s=e._targetBottomPath;if(t&&r&&t.length===e.topPath.length)for(let i=0;e.topPath.length>i;i++)e.topPath[i][0]=Yt(t[i][0],r[i][0],o),e.topPath[i][1]=Yt(t[i][1],r[i][1],o);if(i&&s&&i.length===e.bottomPath.length)for(let t=0;e.bottomPath.length>t;t++)e.bottomPath[t][0]=Yt(i[t][0],s[t][0],o),e.bottomPath[t][1]=Yt(i[t][1],s[t][1],o)}}if(s>=1){for(let e of i.scene){if(void 0!==e._targetOpacity){let t=e._targetOpacity;e.style="line"===e.type||"area"===e.type?{...e.style,opacity:0===t?0:t}:{...e.style||{},opacity:0===t?0:t},e._targetOpacity=void 0}if("point"===e.type){if(void 0===e._targetX)continue;e.x=e._targetX,e.y=e._targetY,void 0!==e._targetR&&(e.r=e._targetR),e._targetX=void 0,e._targetY=void 0,e._targetR=void 0}else if("glyph"===e.type){if(void 0===e._targetX)continue;e.x=e._targetX,e.y=e._targetY,void 0!==e._targetR&&(e.size=e._targetR),e._targetX=void 0,e._targetY=void 0,e._targetR=void 0}else if("rect"===e.type){if(void 0===e._targetX)continue;e.x=e._targetX,e.y=e._targetY,e.w=e._targetW,e.h=e._targetH,e._targetX=void 0,e._targetY=void 0,e._targetW=void 0,e._targetH=void 0}else if("heatcell"===e.type){if(void 0===e._targetX)continue;e.x=e._targetX,e.y=e._targetY,e.w=e._targetW,e.h=e._targetH,e._targetX=void 0,e._targetY=void 0,e._targetW=void 0,e._targetH=void 0}else if("candlestick"===e.type){if(void 0===e._targetX)continue;e.x=e._targetX,void 0!==e._targetOpenY&&(e.openY=e._targetOpenY),void 0!==e._targetCloseY&&(e.closeY=e._targetCloseY),void 0!==e._targetHighY&&(e.highY=e._targetHighY),void 0!==e._targetLowY&&(e.lowY=e._targetLowY),e._targetX=void 0,e._targetOpenY=void 0,e._targetCloseY=void 0,e._targetHighY=void 0,e._targetLowY=void 0}else if("line"===e.type){let t=e._targetPath;if(t)for(let i=0;e.path.length>i;i++)e.path[i]=t[i];e._prevPath=void 0,e._targetPath=void 0,e._introClipFraction=void 0}else if("area"===e.type){let t=e._targetTopPath,i=e._targetBottomPath;if(t)for(let i=0;e.topPath.length>i;i++)e.topPath[i]=t[i];if(i)for(let t=0;e.bottomPath.length>t;t++)e.bottomPath[t]=i[t];e._prevTopPath=void 0,e._prevBottomPath=void 0,e._targetTopPath=void 0,e._targetBottomPath=void 0,e._introClipFraction=void 0}}if(i.exitNodes.length>0){let e=new Set(i.exitNodes);i.scene=i.scene.filter(t=>!e.has(t)),i.exitNodes=[]}return i.activeTransition=null,!1}return!0}(e,this.config.transition,t,this.prevPositionMap);return this.scene=t.scene,this.exitNodes=t.exitNodes,this.activeTransition=t.activeTransition,i}cancelIntroAnimation(){this.prevPositionMap.clear(),this.prevPathMap.clear(),this.activeTransition=null,oe(this.scene),this.exitNodes=[]}groupData(e){let{result:t,cache:i}=function(e,t,i,r){if(r&&r.version===i&&r.group===t&&r.data===e)return{result:r.result,cache:r};let s;if(t){let i=new Map;for(let r of e){let e=t(r);i.has(e)||i.set(e,[]),i.get(e).push(r)}s=Array.from(i.entries()).map(([e,t])=>({key:e,data:t}))}else s=[{key:"_default",data:e}];return{result:s,cache:{version:i,group:t,data:e,result:s}}}(e,this.getGroup,this._ingestVersion,this._groupDataCache);return this._groupDataCache=i,t}resolveColorMap(e){let{map:t,cache:i}=function(e,t,i,r,s){if(s&&s.version===r)return{map:s.map,cache:s};let o=new Set;if(t)for(let i of e){let e=t(i);e&&o.add(e)}let a=Array.from(o).sort(),l=a.join("\0");if(s&&s.key===l){let e={...s,version:r};return{map:e.map,cache:e}}let c=hi(i.colorScheme,i.themeCategorical,ci),h=new Map;for(let e=0;a.length>e;e++)h.set(a[e],n(i.colorScheme,a[e])??c[e%c.length]);return{map:h,cache:{key:l,map:h,version:r}}}(e,this.getColor,this.config,this._ingestVersion,this._colorMapCache);return this._colorMapCache=i,t}resolveLineStyle(e,t){return function(e,t,i,r){let s=e.lineStyle;if("function"==typeof s){let e=s(i||{},t);if(e&&!e.stroke&&t){let i=r(t);if(i)return{...e,stroke:i}}return e}let o=e.themeSemantic?.primary;return s&&"object"==typeof s?{stroke:s.stroke||o||"#007bff",strokeWidth:s.strokeWidth??2,strokeDasharray:s.strokeDasharray,fill:s.fill,fillOpacity:s.fillOpacity,opacity:s.opacity,cursor:s.cursor}:{stroke:r(t)||o||"#007bff",strokeWidth:2}}(this.config,e,t,e=>this.resolveGroupColor(e))}resolveAreaStyle(e,t){return function(e,t,i,r){if(e.areaStyle){let s=e.areaStyle(i||{});if(s&&!s.fill&&t){let e=r(t);if(e)return{...s,fill:e,stroke:s.stroke||e}}return s}let s=e.lineStyle;if("function"==typeof s){let e=s(i||{},t);if(e&&!e.fill&&t){let i=r(t);if(i)return{...e,fill:i,stroke:e.stroke||i}}return e}let o=e.themeSemantic?.primary;if(s&&"object"==typeof s)return{fill:s.fill||s.stroke||o||"#4e79a7",fillOpacity:s.fillOpacity??.7,stroke:s.stroke||o||"#4e79a7",strokeWidth:s.strokeWidth??2,cursor:s.cursor};let a=r(t)||o||"#4e79a7";return{fill:a,fillOpacity:.7,stroke:a,strokeWidth:2}}(this.config,e,t,e=>this.resolveGroupColor(e))}resolveGroupColor(t){let{color:i,groupColorCounter:r}=function(e){let{group:t,colorMapCache:i,groupColorMap:r,groupColorMapCap:s,config:o}=e,{groupColorCounter:a}=e,l=n(o.colorScheme,t);if(l)return{color:l,groupColorCounter:a};if(i){let e=i.map.get(t);if(e)return{color:e,groupColorCounter:a}}let c=r.get(t);if(c)return{color:c,groupColorCounter:a};let h=hi(o.colorScheme,o.themeCategorical,ci);if(0===h.length)return{color:null,groupColorCounter:a};let u=h[a%h.length];if(a++,r.set(t,u),r.size>s){let e=r.keys().next().value;void 0!==e&&r.delete(e)}return{color:u,groupColorCounter:a}}({group:t,colorMapCache:this._colorMapCache,groupColorMap:this._groupColorMap,groupColorCounter:this._groupColorCounter,groupColorMapCap:e.GROUP_COLOR_MAP_CAP,config:this.config});return this._groupColorCounter=r,i}getBufferArray(){return(this._bufferDirty||!this._bufferArrayCache)&&(this._bufferArrayCache=this.buffer.toArray(),this._bufferDirty=!1),this._bufferArrayCache}getData(){return this.getBufferArray()}remove(e){if(!this.getPointId)throw Error("remove() requires pointIdAccessor to be configured");this.config.transition&&this.scene.length>0&&this.snapshotPositions();let t=ne(e),i=this.getPointId,r=e=>t.has(i(e));ye(this.buffer,this.timestampBuffer,r);let s=this.buffer.remove(r);if(0===s.length)return this.updateResults.recordNoop("remove"),s;for(let e of s)this.xExtent.evict(this.getX(e)),this.evictDatumYExtent(e);return this.needsFullRebuild=!0,this._bufferDirty=!0,this._ingestVersion++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("remove",s.length),s}update(e,t){if(!this.getPointId)throw Error("update() requires pointIdAccessor to be configured");let i=ne(e),r=this.getPointId,s=new Set;this.buffer.forEach((e,t)=>{i.has(r(e))&&s.add(t)});let o=this.buffer.update(e=>i.has(r(e)),t);if(0===o.length)return this.updateResults.recordNoop("update"),o;for(let e of o)this.xExtent.evict(this.getX(e)),this.evictDatumYExtent(e);return this.buffer.forEach((e,t)=>{s.has(t)&&(this.xExtent.push(this.getX(e)),this.pushDatumYExtent(e))}),this.needsFullRebuild=!0,this._bufferDirty=!0,this._ingestVersion++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("update",o.length),o}getBinBoundaries(){return this._binBoundaries}getExtents(){return this.xExtent.min===1/0?null:{x:this.xExtent.extent,y:this.yExtent.extent}}clear(){this.buffer.clear(),this.xExtent.clear(),this.yExtent.clear(),this._hasRenderedOnce=!1,this.timestampBuffer&&this.timestampBuffer.clear(),this.prevPositionMap.clear(),this.prevPathMap.clear(),this.exitNodes=[],this.activeTransition=null,this.lastIngestTime=0,this._lastBoundedInsertsRef=null,this.needsFullRebuild=!0,this._bufferDirty=!0,this._bufferArrayCache=null,this._datumIndexCache=null,this.lastLayout=null,this.scales=null,this.scene=[],this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this.spatialIndex.clear(),this._colorMapCache=null,this._groupDataCache=null,this._groupColorMap=new Map,this._groupColorCounter=0,this._barCategoryCache=null,this._binBoundaries=[],this._stackExtentCache=null,this.version++,this.updateResults.recordData("clear")}get size(){return this.buffer.size}getBuffer(){return this.buffer}getXAccessor(){return this.getX}getYAccessor(){return this.getY}getCategoryAccessor(){return this.getCategory}applyCustomRestyle(e,t){let i=this._customRestyle;if(i)for(let r of e){let e=this._baseStyles.get(r)??r.style??{},s=i(r,t);r.style=s?{...e,...s}:e}}restyleScene(e){this._customRestyle?(this.applyCustomRestyle(this.scene,e),this.markStylePaintPending(),this.updateResults.recordRestyle(!0)):this.updateResults.recordRestyle(!1)}updateConfig(e){let t={...this.config},i=Object.keys(e).filter(i=>e[i]!==t[i]);"production"!==process.env.NODE_ENV&&!this.windowSizeWarned&&"windowSize"in e&&e.windowSize!==t.windowSize&&(this.windowSizeWarned=!0,console.warn(`[Semiotic] windowSize changed after mount (${t.windowSize} → ${e.windowSize}) but it is a mount-only setting — the ring buffer keeps its original capacity. Remount the chart (e.g. via a React key) to apply a new windowSize.`)),("colorScheme"in e||"themeCategorical"in e||"colorAccessor"in e)&&(this._colorMapCache=null,this._groupColorMap=new Map,this._groupColorCounter=0),("barColors"in e||"colorScheme"in e)&&(this._barCategoryCache=null),("normalize"in e||"extentPadding"in e||"xAccessor"in e||"yAccessor"in e||"timeAccessor"in e||"valueAccessor"in e||"boundsAccessor"in e||"band"in e||"y0Accessor"in e||"openAccessor"in e||"highAccessor"in e||"lowAccessor"in e||"closeAccessor"in e||"groupAccessor"in e||"categoryAccessor"in e||"chartType"in e||"runtimeMode"in e)&&(this._stackExtentCache=null);let r=!1,o=!1;Object.assign(this.config,e),"pulse"in e&&this.syncPulseTimestampBuffer();let a="chartType"in e&&e.chartType!==t.chartType||"runtimeMode"in e&&e.runtimeMode!==t.runtimeMode;if(a||"xAccessor"in e||"yAccessor"in e||"timeAccessor"in e||"valueAccessor"in e){let e=["bar","swarm","waterfall"].includes(this.config.chartType)||"streaming"===this.config.runtimeMode,i=e&&this.config.valueAccessor||this.config.yAccessor,n=e&&t.valueAccessor||t.yAccessor,l=a||!Se(e&&this.config.timeAccessor||this.config.xAccessor,e&&t.timeAccessor||t.xAccessor),c=a||!Se(i,n);(l||c)&&(e?(this.getX=Pe(this.config.timeAccessor||this.config.xAccessor,"time"),this.getY=Pe(this.config.valueAccessor||this.config.yAccessor,"value")):(this.getX=Pe(this.config.xAccessor,"x"),this.getY=Pe(this.config.yAccessor,"y")),c&&this.resolvedRibbons.some(e=>"bounds"===e.kind)&&(this.resolvedRibbons=s(this.config)),r=!0,o=!0)}if("groupAccessor"in e&&!Se(e.groupAccessor,t.groupAccessor)&&(this.getGroup=null!=this.config.groupAccessor?Me(this.config.groupAccessor):void 0,r=!0),"categoryAccessor"in e&&!Se(e.categoryAccessor,t.categoryAccessor)&&(this.getCategory=null!=this.config.categoryAccessor?Me(this.config.categoryAccessor):void 0,r=!0),"sizeAccessor"in e&&!Se(e.sizeAccessor,t.sizeAccessor)&&(this.getSize=this.config.sizeAccessor?Pe(this.config.sizeAccessor,"size"):void 0,r=!0),"symbolAccessor"in e&&!Se(e.symbolAccessor,t.symbolAccessor)&&(this.getSymbol=null!=this.config.symbolAccessor?Me(this.config.symbolAccessor):void 0,r=!0),"colorAccessor"in e&&!Se(e.colorAccessor,t.colorAccessor)&&(this.getColor=null!=this.config.colorAccessor?Me(this.config.colorAccessor):void 0,r=!0),"y0Accessor"in e&&!Se(e.y0Accessor,t.y0Accessor)&&(this.getY0=this.config.y0Accessor?Pe(this.config.y0Accessor,"y0"):void 0,r=!0,o=!0),("boundsAccessor"in e&&!Se(e.boundsAccessor,t.boundsAccessor)||"band"in e&&e.band!==t.band||"boundsStyle"in e&&e.boundsStyle!==t.boundsStyle)&&(this.resolvedRibbons=s(this.config),r=!0,o=!0),"pointIdAccessor"in e&&!Se(e.pointIdAccessor,t.pointIdAccessor)&&(this.getPointId=null!=this.config.pointIdAccessor?Me(this.config.pointIdAccessor):void 0,r=!0),"candlestick"===this.config.chartType&&(a||"openAccessor"in e&&!Se(e.openAccessor,t.openAccessor)||"closeAccessor"in e&&!Se(e.closeAccessor,t.closeAccessor)||"highAccessor"in e&&!Se(e.highAccessor,t.highAccessor)||"lowAccessor"in e&&!Se(e.lowAccessor,t.lowAccessor))){let e=null!=this.config.openAccessor,t=null!=this.config.closeAccessor;this.getOpen=e?Pe(this.config.openAccessor,"open"):void 0,this.getHigh=Pe(this.config.highAccessor,"high"),this.getLow=Pe(this.config.lowAccessor,"low"),this.getClose=t?Pe(this.config.closeAccessor,"close"):void 0,this.config.candlestickRangeMode=!e&&!t,r=!0,o=!0}if("accessorRevision"in e&&e.accessorRevision!==t.accessorRevision&&(r=!0,o=!0),!r){let i=Object.keys(e).filter(e=>!e.endsWith("Accessor")&&"timeAccessor"!==e&&"valueAccessor"!==e);for(let s of i)if(e[s]!==t[s]){r=!0;break}}r&&(o&&this.rebuildExtents(),this.needsFullRebuild=!0),this.updateResults.recordConfig(i,("bar"===this.config.chartType||"heatmap"===this.config.chartType)&&!this.config.trackHoverRows&&pi(t.areaStyle)!==pi(this.config.areaStyle))}updateConfigWithResult(e){return this.updateConfig(e),this.updateResults.last}};Zi.GROUP_COLOR_MAP_CAP=1e3;var er=Zi;Te(er);import{useCallback as tr,useImperativeHandle as ir}from"react";import{line as rr}from"d3-shape";var sr=new WeakMap;import{jsx as or}from"react/jsx-runtime";import{useMemo as ar,useRef as nr,useEffect as lr,useId as cr}from"react";import*as hr from"react";import{jsx as ur}from"react/jsx-runtime";var dr=null,pr=null,gr=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];import{useMemo as yr}from"react";import{jsx as fr,jsxs as mr}from"react/jsx-runtime";import{Fragment as xr,jsx as vr,jsxs as br}from"react/jsx-runtime";import{useCallback as wr,useEffect as kr,useState as Ar}from"react";import*as _r from"react";import{area as Cr,line as Sr}from"d3-shape";import{jsx as Pr,jsxs as Mr}from"react/jsx-runtime";var Rr={axisStroke:"#ccc",tickText:"#666",crosshair:"rgba(0, 0, 0, 0.25)",hoverFill:"rgba(255, 255, 255, 0.3)",hoverStroke:"rgba(0, 0, 0, 0.4)",pointRing:"white",primary:"#007bff",background:""};import{useEffect as Yr}from"react";import{jsx as Tr,jsxs as Dr}from"react/jsx-runtime";I.ownsChrome=!0;import{jsx as Er,jsxs as Or}from"react/jsx-runtime";var Br=Ce,Lr=Rr,zr=ki(wi(function(t,i){let{chartType:r,runtimeMode:s,data:o,chunkThreshold:a,chunkSize:n,xAccessor:u,yAccessor:d,accessorRevision:p,colorAccessor:g,sizeAccessor:y,symbolAccessor:f,symbolMap:m,groupAccessor:x,lineDataAccessor:b,curve:w,normalize:k,baseline:A,stackOrder:_,binSize:C,valueAccessor:S,arrowOfTime:P="right",windowMode:R="sliding",windowSize:Y=200,timeAccessor:D,xExtent:E,yExtent:$,invertY:X,extentPadding:j=.1,scalePadding:G,sizeRange:q,size:K=[500,300],responsiveWidth:J,responsiveHeight:Z,margin:ie,className:oe,background:ae,maxDevicePixelRatio:ne,renderMode:ce,lineStyle:he,pointStyle:pe,areaStyle:ge,barStyle:ye,waterfallStyle:fe,swarmStyle:me,barColors:xe,colorScheme:ve,boundsAccessor:Ce,boundsStyle:Se,y0Accessor:Pe,band:Me,gradientFill:Ye,lineGradient:Te,semanticLineStops:De,areaGroups:Oe,openAccessor:Be,highAccessor:Le,lowAccessor:ze,closeAccessor:Fe,candlestickStyle:$e,showAxes:Ie=!0,axes:Ne,xLabel:We,yLabel:Ve,yLabelRight:Ke,xFormat:rt,yFormat:ut,axisExtent:yt,tickFormatTime:ft,tickFormatValue:bt,hoverAnnotation:wt,tooltipContent:kt,customHoverBehavior:At,customClickBehavior:Yt,onObservation:Tt,annotationObservationCallback:Dt,chartId:Et,enableHover:Ft,hoverRadius:$t=30,tooltipMode:It,annotations:Nt,onAnnotationActivate:Wt,autoPlaceAnnotations:Gt,svgAnnotationRules:Qt,showGrid:Zt,legend:ei,legendHoverBehavior:ii,legendClickBehavior:ci,legendHighlightedCategory:hi,legendIsolatedCategories:ui,legendPosition:pi,legendLayout:yi,legendCategoryAccessor:vi,onCategoriesChange:wi,backgroundGraphics:ki,foregroundGraphics:Ri,canvasPreRenderers:Yi,svgPreRenderers:Ti,title:Di,categoryAccessor:Ei,brush:Oi,onBrush:Bi,decay:Li,pulse:zi,transition:Fi,animate:$i,staleness:Ii,frameScheduler:Ni,clock:Wi,random:Xi,seed:ji,paused:Vi=!1,suspendWhenHidden:Hi=!0,heatmapAggregation:Gi,heatmapXBins:Ui,heatmapYBins:qi,showValues:Ki,heatmapValueFormat:Ji,heatmapColorScale:Qi,onColorDomainChange:Zi,marginalGraphics:rr,pointIdAccessor:sr,xScaleType:or,yScaleType:ar,accessibleTable:nr=!0,description:lr,summary:cr,linkedCrosshairName:hr,linkedCrosshairSourceId:ur,customLayout:dr,onLayoutError:pr,layoutConfig:gr,layoutSelection:yr}=t,{customHoverBehavior:fr,customClickBehavior:mr,hasClickBehavior:xr}=we({customHoverBehavior:At,customClickBehavior:Yt,onObservation:Tt,chartId:Et,chartType:"StreamXYFrame"}),vr=Ci().replace(/:/g,""),br=Pi(!1),Tr=Pi({w:-1,h:-1}),Dr=Pi(!1),zr=ri({sizeProp:K,responsiveWidth:J,responsiveHeight:Z,userMargin:ie,marginDefault:Br,title:Di,legend:ei,legendPosition:pi,...le(t,ei),animate:$i,transitionProp:Fi,frameScheduler:Ni,clock:Wi,random:Xi,seed:ji,paused:Vi,suspendWhenHidden:Hi,themeDirtyRef:br}),Fr=oi(),$r=ni(),{reducedMotionRef:Ir,responsiveRef:Nr,size:Wr,currentTheme:Xr,transition:jr,introEnabled:Vr,tableId:Hr,rafRef:Gr,renderFnRef:Ur,scheduleRender:qr,frameRuntime:Kr}=zr;_i(()=>Ut(()=>{br.current=!0,qr()}),[qr]);let Jr=zr.margin;if(rr){let e={...zr.margin};rr.top&&60>e.top&&(e.top=60),rr.bottom&&60>e.bottom&&(e.bottom=60),rr.left&&60>e.left&&(e.left=60),rr.right&&60>e.right&&(e.right=60),Jr=e}let Qr=Wr[0]-Jr.left-Jr.right,Zr=Wr[1]-Jr.top-Jr.bottom,es=(Ne?.find(e=>"left"===e.orient)??Ne?.find(e=>"right"===e.orient))?.extent??yt,ts=Si(()=>_t(o),[o]),is=wt??Ft,[rs,ss]=Mi(0),os=Pi(0),[as,ns]=Mi(null),ls=Ue(Ri,Wr,Jr,as),cs=Ue(ki,Wr,Jr,as),hs=Pi(null),us=Pi(!1),ds=Pi(null),ps=Pi(void 0),[gs,ys]=Mi(null),fs=Pi(Lr.primary),ms=Pi(function(){let e=-1,t=Rr;return{resolve(i){if(!i)return Rr;let r=gi();return r===e||(t=function(e){if(!e)return Rr;let t=getComputedStyle(e),i=t.getPropertyValue("--semiotic-border").trim(),r=t.getPropertyValue("--semiotic-text-secondary").trim(),s=t.getPropertyValue("--semiotic-bg").trim(),o=t.getPropertyValue("--semiotic-primary").trim(),a=r||t.getPropertyValue("--text-secondary").trim(),n=t.getPropertyValue("--text-primary").trim(),l=i||t.getPropertyValue("--surface-3").trim(),c=s||t.getPropertyValue("--surface-0").trim();return a||n||i||o?{axisStroke:l||Rr.axisStroke,tickText:a||Rr.tickText,crosshair:a?z(a,"66"):Rr.crosshair,hoverFill:c?z(c,"4D"):Rr.hoverFill,hoverStroke:a?z(a,"99"):Rr.hoverStroke,pointRing:c||Rr.pointRing,primary:o||Rr.primary,background:c||Rr.background}:Rr}(i),e=r),t},invalidate(){e=-1}}}()),xs=Pi(!1),vs=ai("StreamXYFrame"),[bs,ws]=Mi(!1),ks="streaming"===s||["bar","swarm","waterfall"].includes(r),As=!!fr,_s=Si(()=>({chartType:r,runtimeMode:ks?"streaming":"bounded",windowSize:Y,windowMode:R,arrowOfTime:ks?P:"right",extentPadding:j,scalePadding:G,axisExtent:yt,yAxisExtent:es,xAccessor:u,yAccessor:d,accessorRevision:p,timeAccessor:ks?D:void 0,valueAccessor:S,colorAccessor:g,sizeAccessor:y,symbolAccessor:f,symbolMap:m,groupAccessor:x||(b?"_lineGroup":void 0),categoryAccessor:Ei,lineDataAccessor:b,xScaleType:or,yScaleType:ar,xExtent:E,yExtent:$,invertY:X,sizeRange:q,binSize:C,normalize:k,baseline:A,stackOrder:_,boundsAccessor:Ce,boundsStyle:Se,y0Accessor:Pe,band:Me,gradientFill:de(Ye),areaGroups:Oe?new Set(Oe):void 0,lineGradient:ue(Te),semanticLineStops:De,openAccessor:Be,highAccessor:Le,lowAccessor:ze,closeAccessor:Fe,candlestickStyle:$e,lineStyle:he,trackHoverRows:As,pointStyle:pe,areaStyle:ge,swarmStyle:me,waterfallStyle:fe,colorScheme:ve,barColors:xe,barStyle:ye,annotations:Nt,decay:Li,pulse:zi,transition:jr,introAnimation:Vr,staleness:Ii,clock:Kr.now,heatmapAggregation:Gi,heatmapXBins:Ui,heatmapYBins:qi,showValues:Ki,heatmapValueFormat:Ji,heatmapColorScale:Qi,pointIdAccessor:sr,curve:w,themeCategorical:Xr?.colors?.categorical,themeSemantic:di(Xr),themeSequential:Xr?.colors?.sequential,themeDiverging:Xr?.colors?.diverging,customLayout:dr,onLayoutError:pr,layoutConfig:gr,layoutMargin:Jr}),[r,ks,Y,R,P,j,G,yt,es,u,d,p,D,S,g,y,f,m,x,b,Ei,or,ar,E,$,X,q,C,k,A,_,Ce,Se,Pe,Me,Ye,Oe,Te,De,Be,Le,ze,Fe,$e,he,As,pe,ge,me,fe,ve,xe,ye,Nt,Li,zi,jr,Vr,Ii,Kr.now,Gi,Ui,qi,Ki,Ji,Qi,sr,w,Xr,dr,pr,gr,Jr]),Cs=tt(_s),Ss=Pi(null);Ss.current||(Ss.current=new er(Cs));let Ps=et(Ss,vi,wi,e=>e.getData()),Ms=Pi({onColorDomainChange:Zi,chartType:r}),Rs=Pi(void 0);Ms.current={onColorDomainChange:Zi,chartType:r};let Ys=Ai(()=>{let{onColorDomainChange:e,chartType:t}=Ms.current;if(!e||"heatmap"!==t)return;let i=1/0,r=-1/0;for(let e of Ss.current?.scene??[]){if("heatcell"!==e.type)continue;let t=Number(e.value??e.datum?.value);Number.isFinite(t)&&(i>t&&(i=t),t>r&&(r=t))}let s=Number.isFinite(i)&&Number.isFinite(r)?[i,r]:null,o=Rs.current;null===o&&null===s||o&&s&&o[0]===s[0]&&o[1]===s[1]||(Rs.current=s,e(s))},[]);(function(e,t,i,r){Yr(()=>{let s=!1,o=[];if(t&&!H("custom")&&o.push(import("./c-7HP7MB2I.min.js").then(e=>{U(e.customXYPlugin)})),"custom"!==e&&!H(e)&&o.push(import("./c-LYVKDBQJ.min.js").then(e=>{e.registerBuiltInXYPlugins()})),0!==o.length)return Promise.all(o).then(()=>{s||(i.current=!0,r())}),()=>{s=!0}},[e,t,i,r])})(r,dr,br,qr),Qe(Ss,Cs,br,qr),Ze(Ss,yr,br,qr);let Ts=Pi(null);Ts.current||(Ts.current=new te(e=>{let t=Ss.current;t&&t.ingest(e)&&(br.current=!0,qr())},{chunkThreshold:a,chunkSize:n})),_i(()=>{Ts.current?.updateChunkOptions({chunkThreshold:a,chunkSize:n})},[a,n]),function(e,{storeRef:t,adapterRef:i,dirtyRef:r,scheduleRender:s,hoverRef:o,setHoverPoint:a}){let n=tr(e=>{i.current?.push(e)},[i]),l=tr(e=>{i.current?.pushMany(e)},[i]),c=tr(()=>{i.current?.clear(),t.current?.clear(),r.current=!0,s()},[i,t,r,s]);ir(e,()=>({push:n,pushMany:l,remove:e=>{i.current?.flush();let n=t.current?.remove(e)??[];return n.length>0&&(o.current&&n.some(e=>e===o.current?.data)&&(o.current=null,a(null)),r.current=!0,s()),n},update:(e,o)=>{i.current?.flush();let a=t.current?.update(e,o)??[];return a.length>0&&(r.current=!0,s()),a},clear:c,getData:()=>(i.current?.flush(),t.current?.getData()??[]),getScales:()=>t.current?.scales??null,getExtents:()=>t.current?.getExtents()??null,getCustomLayout:()=>t.current?.lastCustomLayoutResult??null,getLayoutFailure:()=>t.current?.lastCustomLayoutFailure??null}),[n,l,c,s,i,t,r,o,a])}(i,{storeRef:Ss,adapterRef:Ts,dirtyRef:br,scheduleRender:qr,hoverRef:hs,setHoverPoint:ys}),_i(()=>{o&&Ts.current?.setBoundedData(N(ts,b))},[o,ts,b]);let{marginalXValues:Ds,marginalYValues:Es,refreshMarginalValues:Os}=function(e,t,i,r,s){let[o,a]=Ar([]),[n,l]=Ar([]),c=null!=t,h=c?[t.top,t.bottom,t.left,t.right].join("|"):"",u=wr((t=e.current?.getData()??[])=>{let i=M(t,r,s);a(i.xValues),l(i.yValues)},[e,r,s]);return kr(()=>{if(!c)return a([]),void l([]);u()},[i,c,h,u]),{marginalXValues:o,marginalYValues:n,refreshMarginalValues:u}}(Ss,rr,ts,u,d),{canvasRef:Bs,interactionCanvasRef:Ls,resolutionDirtyRef:zs}=si(zr,{storeRef:Ss,dirtyRef:br,hydrated:Fr,wasHydratingFromSSR:$r,cleanup:()=>Ts.current?.clear(),maxDevicePixelRatio:ne,canvasPaintDependencies:[r,Qr,Zr,Ie,ae,ki,he,ce,Yi,qr]}),{hoverHandlerRef:Fs,hoverLeaveRef:$s,onPointerMove:Is,onPointerLeave:Ns,pointerStateRef:Ws}=zr;Fs.current=e=>{let t=Bs.current;if(!t)return;let i=t.getBoundingClientRect(),s=e.clientX-i.left-Jr.left,o=e.clientY-i.top-Jr.top;if(0>s||s>Qr||0>o||o>Zr){if(Ht(t),!is)return;return void(hs.current&&(hs.current=null,ds.current=null,ys(null),fr?.(null),qr()))}let a=Ss.current;if(!a||0===a.scene.length)return void Ht(t);let n=St($t,e.pointerType),d=c(a.scene,s,o,n,a.quadtree,a.maxPointRadius);if(Ht(t,Vt(d?.node)),!is)return;let p="multi"===It,g=()=>{hs.current&&(hs.current=null,ds.current=null,ys(null),fr&&fr(null),qr())};if(!d&&!p)return void g();let y=p||!d?s:d.x,f=p||!d?o:d.y,m=d?.datum?Ae(d.datum,a.resolvedRibbons):{},x=a.scales?.x?.invert,b="function"==typeof x?x(y):void 0,w=mt(m,y,f,null!=b?{xValue:b,xPx:y}:void 0);if(p&&a.scene.length>0&&a.scales){let e=function(e,t,i=30){let r=[];for(let s of e)if("line"===s.type){let e=s;if(2>e.path.length)continue;let o=h(l(e.path,e.curve),t,i);if(null===o)continue;let a=v(e.path,t);r.push({node:s,datum:Array.isArray(e.datum)&&e.datum[a]?e.datum[a]:e.datum,x:e.path[a][0],y:o,group:e.group,color:e.style.stroke})}else if("area"===s.type){let e=s;if(!1===e.interactive||2>e.topPath.length)continue;let o=l(e.topPath,e.curve),a=l(e.bottomPath,e.curve),n=h(o,t,i);if(null===n)continue;let c=h(a,t,i),u=v(e.topPath,t);r.push({node:s,datum:Array.isArray(e.datum)&&e.datum[u]?e.datum[u]:e.datum,x:e.topPath[u][0],y:n,y0:c??void 0,group:e.group,color:"string"==typeof e.style.stroke?e.style.stroke:"string"==typeof e.style.fill?e.style.fill:void 0})}return r}(a.scene,y,Math.max(n,Qr));if(e.length>0){let t=a.scales.y.invert,i=fs.current,s=x?x(y):y;if(d)w.xValue=s,w.xPx=y;else{let e={xValue:s};"string"==typeof u&&(e[u]=s),w=mt(e,y,f,{xValue:s,xPx:y})}w.allSeries=e.map(e=>{let s=t?t(e.y):e.y,o=null!=e.y0?t?t(e.y0):e.y0:void 0;return{group:e.group||"",value:"stackedarea"===r&&null!=o?s-o:s,valuePx:e.y,color:e.color||i,datum:Ae(e.datum,a.resolvedRibbons)}})}}d||w.allSeries?.length?(hs.current=w,ds.current=d?.node??null,ys(w),fr?.(w),qr()):g()},$s.current=()=>{Ht(Bs.current),hs.current&&(hs.current=null,ds.current=null,ys(null),fr?.(null),qr())},ti(Bs);let Xs=Pi(()=>{});Xs.current=e=>{if(Mt(e.target)||!mr)return;let t=Bs.current;if(!t)return;let i=t.getBoundingClientRect(),r=e.clientX-i.left-Jr.left,s=e.clientY-i.top-Jr.top;if(0>r||r>Qr||0>s||s>Zr)return void mr(null);let o=Ss.current;if(!o||0===o.scene.length)return void mr(null);let a=St($t,ps.current),n=c(o.scene,r,s,a,o.quadtree,o.maxPointRadius);if(!n)return void mr(null);let l=n.datum||{},h=o.scales?.x?.invert,u="function"==typeof h?h(n.x):void 0;mr(mt(l,n.x,n.y,null!=u?{xValue:u,xPx:n.x}:void 0),{type:"activate",inputType:Ot(ps.current)})};let js=Ai(e=>Xs.current(e),[]),{kbFocusIndexRef:Vs,focusedNavPointRef:Hs,onKeyDown:Gs}=ke({storeRef:Ss,hoverRef:hs,hoveredNodeRef:ds,setHoverPoint:ys,customHoverBehavior:fr,customClickBehavior:mr,scheduleRender:qr}),Us=Ai(e=>{Je(Ws,e,!!is,us.current,Bs.current)&&(ps.current=e.pointerType,Vs.current=-1,Hs.current=null,Is(e))},[Bs,is,Hs,Vs,Is,Ws]),qs=Ai(e=>{Je(Ws,e,!!is,us.current,Bs.current,"mouse")&&(ps.current="mouse",Vs.current=-1,Hs.current=null,Is({clientX:e.clientX,clientY:e.clientY,pointerType:"mouse"}))},[Bs,is,Hs,Vs,Is,Ws]),Ks=Ai(e=>{ps.current=e.pointerType},[]);Ur.current=()=>{if(Gr.current=null,!Kr.isActive)return;let e=Bs.current,t=Ls.current;if(!e||!t)return;let i=Ss.current;if(!i)return;let s=Kr.now(),o=null!=i.activeTransition,a=i.advanceTransition(Ir.current?s+1e6:s),n=!Ir.current&&a,l=Tr.current.w!==Qr||Tr.current.h!==Zr,h=zs.current,u=br.current||o||l,d=o&&!a,p=i.consumeStylePaintPending(),g=!1,y=i.getLastUpdateResult(),f=vs.current.beforeCompute(y,n);(br.current||l)&&(!n||l)&&(i.computeScene({width:Qr,height:Zr}),Tr.current={w:Qr,h:Zr},g=!0,Ps(),Ys()),(g||p)&&(us.current=jt(i.scene),us.current||Ht(e)),us.current&&(o||g||p)&&function(e){let{canvas:t,pointer:i,store:r,margin:s,width:o,height:a}=e;zt(t,i,i=>{let n=t.getBoundingClientRect(),l=i.clientX-n.left-s.left,h=i.clientY-n.top-s.top;if(0>l||l>o||0>h||h>a)return;let u=c(r.scene,l,h,St(e.hoverRadius,i.pointerType),e.geometryMoved?null:r.quadtree,r.maxPointRadius);return Vt(u?.node)})}({canvas:e,pointer:Ws.current,store:i,margin:Jr,width:Qr,height:Zr,hoverRadius:$t,geometryMoved:o||g}),vs.current.afterCompute(f,g,l);let m=be(i,s,g,Dr),x=Ct(ne,Wr);Jt(e,Wr,x),Jt(t,Wr,x);let v=ms.current.resolve(e);fs.current=v.primary;let b=qe(Ii,i.lastIngestTime>0?s-i.lastIngestTime:0),w=Ii&&b.isStale;if(u||p||m.changed||h){let t=Lt(e,Wr,Jr,x);if(t){if(t.clearRect(-Jr.left,-Jr.top,Wr[0],Wr[1]),Ii&&1>b.alpha&&(t.globalAlpha=b.alpha),Xe(t,{background:ae,hasBackgroundGraphics:!!ki,themeBackground:v.background,x:-Jr.left,y:-Jr.top,width:Wr[0],height:Wr[1]}),t.save(),"function"==typeof t.rect&&(t.beginPath(),t.rect(0,0,Qr,Zr),t.clip()),Yi&&i.scales)for(let e of Yi)t.save(),e(t,i.scene,i.scales,{width:Qr,height:Zr}),t.restore();let e=V(r,!!dr);je({context:t,nodes:i.scene,renderMode:ce,pixelRatio:x,paintBuiltIn:r=>{if(e&&i.scales)for(let s of e)s(t,r,i.scales,{width:Qr,height:Zr})}}),t.restore(),Ii&&1>b.alpha&&(t.globalAlpha=1)}}let k=!!(is&&hs.current&&i.scales),A=!!(ds.current&&Array.isArray(wt)&&wt.some(e=>e&&"object"==typeof e&&"highlight"===e.type)),_=k||A;if(_e(_,xs.current)){let e=Lt(t,Wr,Jr,x);if(e&&(e.clearRect(-Jr.left,-Jr.top,Wr[0],Wr[1]),k&&hs.current&&function(e,t,i,r,s,o,a){if(!1===s.crosshair)return;let n=t.allSeries,l=n&&n.length>0,c=t.xPx??t.x;e.save();let h="object"==typeof s.crosshair?s.crosshair:{};e.strokeStyle=h.stroke||a.crosshair;let u=h.strokeWidth??1;if(e.setLineDash(h.strokeDasharray?h.strokeDasharray.split(/[\s,]+/).map(Number):[4,4]),u>0&&(e.lineWidth=u,e.beginPath(),e.moveTo(l?c:t.x,0),e.lineTo(l?c:t.x,r),e.stroke(),l||(e.beginPath(),e.moveTo(0,t.y),e.lineTo(i,t.y),e.stroke())),e.restore(),l){e.lineWidth=2,e.strokeStyle=a.pointRing;for(let t of n)null!=t.valuePx&&(e.beginPath(),e.arc(c,t.valuePx,4,0,2*Math.PI),e.fillStyle=t.color||a.primary,e.fill(),e.stroke())}else{let i=s.pointColor||Q(o)||a.primary;e.beginPath(),e.arc(t.x,t.y,4,0,2*Math.PI),e.fillStyle=i,e.fill(),e.strokeStyle=a.pointRing,e.lineWidth=2,e.stroke()}}(e,hs.current,Qr,Zr,"object"==typeof is?is:{},ds.current,v),A&&ds.current&&Array.isArray(wt))){let t=wt.find(e=>e&&"object"==typeof e&&"highlight"===e.type);t&&function(e,t,i,r,s){if(!i)return;let o="group"in i?i.group:void 0;if(void 0!==o)for(let i of t){if("line"!==i.type||i.group!==o||2>i.path.length)continue;let t="function"==typeof r.style?i.datum?r.style(i.datum):{}:r.style||{};e.save(),e.beginPath(),e.moveTo(i.path[0][0],i.path[0][1]);for(let t=1;i.path.length>t;t++)e.lineTo(i.path[t][0],i.path[t][1]);e.strokeStyle=t.stroke||i.style.stroke||s.primary;let a=t.strokeWidth??(i.style.strokeWidth??2)+2;a>0?(e.lineWidth=a,e.globalAlpha=t.opacity??1,e.stroke(),e.restore()):e.restore()}}(e,i.scene,ds.current,t,v)}xs.current=_}u&&e&&e.setAttribute("aria-label",vt(i.scene,r+" chart"));let C=br.current;if(br.current=C&&n&&!g,zs.current=!1,C&&i.scales){let e=e=>"object"==typeof e&&null!==e&&"function"==typeof e.valueOf?e.valueOf():e;(!as||e(as.x.domain()[0])!==e(i.scales.x.domain()[0])||e(as.x.domain()[1])!==e(i.scales.x.domain()[1])||e(as.y.domain()[0])!==e(i.scales.y.domain()[0])||e(as.y.domain()[1])!==e(i.scales.y.domain()[1])||as.x.range()[0]!==i.scales.x.range()[0]||as.x.range()[1]!==i.scales.x.range()[1]||as.y.range()[0]!==i.scales.y.range()[0]||as.y.range()[1]!==i.scales.y.range()[1])&&ns(i.scales),rr&&Os(i.getData())}(Nt&&Nt.length>0||dr)&&(g||o)&&(g||d||s-os.current>=33)&&(ss(e=>e+1),os.current=s),Ii?.showBadge&&ws(!!w),(n||null!=i.activeTransition||m.pending)&&qr()},it(Ii,Ss,br,qr,Kr.now,bs,ws);let Js=Si(()=>{if(!rt&&!ft&&Ss.current?.xIsDate&&as)return T(as.x.domain())},[rt,ft,as]),Qs=rt||ft||Js,Zs=is&&gs?kt?kt(gs):Er(I,{hover:gs}):null,eo=Zs?Er(ct,{x:gs.x,y:gs.y,containerWidth:Qr,containerHeight:Zr,margin:Jr,className:"stream-frame-tooltip",children:Zs}):null,to=Hs.current,io=Er(ht,{active:Vs.current>=0,hoverPoint:gs,margin:Jr,size:Wr,shape:to?.shape,width:to?.w,height:to?.h}),ro=se(u,D,"__semiotic_resolvedX","__semiotic_resolvedTime"),so=se(d,S,"__semiotic_resolvedY","__semiotic_resolvedValue"),oo=ro.key,ao=so.key,no=re(ro,so,Nt&&Nt.length>0||!1);if(Rt||!Fr&&$r){let e=Ss.current;e&&o&&(e.ingest({inserts:N(ts,b),bounded:!0}),e.computeScene({width:Qr,height:Zr}));let t=e?.scene??[],i=e?.scales??null,r=Ue(Ri,Wr,Jr,i),s=Ue(ki,Wr,Jr,i),a=Qs||(()=>{if(e?.xIsDate&&i)return T(i.x.domain())})(),n=lr||("string"==typeof Di?Di:"XY chart"),l=rr&&e?M(e.getData(),u,d):{xValues:[],yValues:[]};return Or("div",{ref:Nr,className:"stream-xy-frame"+(oe?" "+oe:""),role:"img","aria-label":n,style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:J?"100%":Wr[0],height:Z?"100%":Wr[1]},children:[Er(pt,{summary:cr}),Or("svg",{xmlns:"http://www.w3.org/2000/svg",width:Wr[0],height:Wr[1],style:{position:"absolute",left:0,top:0},children:[Or("g",{transform:`translate(${Jr.left},${Jr.top})`,children:[ae&&Er("rect",{x:0,y:0,width:Qr,height:Zr,fill:ae}),s]}),Or("g",{transform:`translate(${Jr.left},${Jr.top})`,children:[Ti&&i&&Ti.map((e,r)=>Er(bi.Fragment,{children:e(t,i,{width:Qr,height:Zr})},"svgpre-"+r)),t.map((e,t)=>He({node:e,index:t,renderMode:ce,fallback:()=>function(e,t,i,r=30){let s=function(e,t,i,r=30){switch(e.type){case"line":{let r=e;if(0===r.path.length)return null;let s=xi(r.curve),o=s?Sr().x(([e])=>e).y(([,e])=>e).curve(s)(r.path)??"":"M"+r.path.map(([e,t])=>`${e},${t}`).join("L"),a=Xt(`${i?i+"-":""}line-${t}-stroke-gradient`),n=L(r.strokeGradient,r.path,a,r.style.stroke||"#4e79a7");return Mr(_r.Fragment,{children:[n&&Pr("defs",{children:n}),Pr("path",{d:o,fill:"none",stroke:n?`url(#${a})`:r.style.stroke||"#4e79a7",strokeWidth:r.style.strokeWidth??2,strokeDasharray:r.style.strokeDasharray,opacity:r.style.opacity})]},"line-"+t)}case"area":{let s=e;if(0===s.topPath.length)return null;let o=xi(s.curve),a=!o||2>s.topPath.length||2>s.bottomPath.length?`M${s.topPath.map(([e,t])=>`${e},${t}`).join("L")}L${[...s.bottomPath].reverse().map(([e,t])=>`${e},${t}`).join("L")}Z`:Cr().x(([e])=>e).y0((e,t)=>s.bottomPath[t][1]).y1(([,e])=>e).curve(o)(s.topPath)??"",n=`${i?i+"-":""}area-${t}-hatch`,l=mi(s.style.fill)?fi(s.style.fill,n):void 0,c=Xt(`${i?i+"-":""}area-${t}-gradient`),h=function(e,t){let i=e.fillGradient;if(!i||"object"!=typeof i)return null;let r=1/0;for(let[,t]of e.topPath)r=Math.min(r,t);let s=-1/0;for(let[,t]of e.bottomPath)s=Math.max(s,t);if(!Number.isFinite(r)||!Number.isFinite(s))return null;let o=xt(i.stops,qt(e.style.fill));return o?Pr("linearGradient",{id:t,gradientUnits:"userSpaceOnUse",x1:0,y1:r,x2:0,y2:s,children:o}):null}(s,c),u=h?`url(#${c})`:l?`url(#${n})`:qt(s.style.fill),d=h?void 0:s.style.fillOpacity??s.style.opacity??.7,p=o?Sr().x(([e])=>e).y(([,e])=>e).curve(o)(s.topPath)??"":"M"+s.topPath.map(([e,t])=>`${e},${t}`).join("L"),g=Vt(s),y=g&&r>=0?Pr("path",{d:p,fill:"none",stroke:"transparent",strokeWidth:Math.max(1,2*r),strokeLinecap:"round",pointerEvents:"stroke",style:{cursor:g},"data-semiotic-mark-cursor":g,"data-semiotic-cursor-hit-target":"area-top-path","aria-hidden":"true"},`area-${t}-cursor-target`):null,f=Xt(`${i?i+"-":""}area-${t}-stroke-gradient`),m=!(!s.colorThresholds?.length||!s.rawValues||s.rawValues.length!==s.topPath.length),x=!!s.strokeColorBands?.length,v=m||x?null:L(s.strokeGradient,s.topPath,f,s.style.stroke||"#4e79a7"),b=s.style.strokeWidth??2,w=1/0,k=-1/0;for(let[e]of s.topPath)w>e&&(w=e),e>k&&(k=e);let A=x?s.strokeColorBands.map((e,r)=>Xt(`${i?i+"-":""}area-${t}-stroke-band-${r}`)):[],_=x?s.strokeColorBands.map((e,t)=>Pr("clipPath",{id:A[t],children:Pr("rect",{x:w-b,y:e.y,width:k-w+2*b,height:e.height})},A[t])):null,C=s.style.stroke&&"none"!==s.style.stroke?x?s.strokeColorBands.map((e,i)=>Pr("path",{d:p,fill:"none",stroke:e.color??qt(s.style.stroke),strokeWidth:b,opacity:(s.style.opacity??1)*(e.opacity??1),clipPath:`url(#${A[i]})`},`area-${t}-stroke-band-${i}`)):m?ee(s.topPath,s.rawValues,s.colorThresholds,qt(s.style.stroke)).map((e,i)=>Pr("path",{d:"M"+e.path.map(([e,t])=>`${e},${t}`).join("L"),fill:"none",stroke:e.color,strokeWidth:b,opacity:s.style.opacity},`area-${t}-threshold-${i}`)):Pr("path",{d:p,fill:"none",stroke:v?`url(#${f})`:qt(s.style.stroke),strokeWidth:b,opacity:s.style.opacity}):null;if(s.clipRect){let e=`${i?i+"-":""}area-clip-${t}`;return Mr("g",{children:[Mr("defs",{children:[h,!h&&l,v,_,Pr("clipPath",{id:e,children:Pr("rect",{x:s.clipRect.x,y:s.clipRect.y,width:s.clipRect.width,height:s.clipRect.height})})]}),Mr("g",{clipPath:`url(#${e})`,children:[Pr("path",{d:a,fill:u,fillOpacity:d,opacity:h?s.style.opacity:void 0,stroke:"none"}),C,y]})]},"area-"+t)}return Mr(_r.Fragment,{children:[(h||l||v||_)&&Mr("defs",{children:[h,!h&&l,v,_]}),Pr("path",{d:a,fill:u,fillOpacity:d,opacity:h?s.style.opacity:void 0,stroke:"none"}),C,y]},"area-"+t)}case"point":case"rect":return Bt(e,t,i);case"symbol":return Kt(e,t);case"glyph":return Pt(e,e.x,e.y,`${i??""}glyph-${e.pointId??t}`);case"heatcell":{let i=e,r={x:i.x,y:i.y,width:i.w,height:i.h,fill:i.fill,stroke:i.style?.stroke,strokeWidth:i.style?.strokeWidth,...null!=i.style?.opacity&&{opacity:i.style.opacity}};if(i.showValues&&null!=i.value&&i.w>=20&&i.h>=20){let e=i.valueFormat?i.valueFormat(i.value):Number.isInteger(i.value)?i.value+"":100>Math.abs(i.value)?1>Math.abs(i.value)?i.value.toPrecision(3):i.value.toFixed(1):i.value.toFixed(0),[s,o,a]=function(e){if(e.startsWith("#")){let t=e.slice(1);if(3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),6===t.length)return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)]}let t=e.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return t?[+t[1],+t[2],+t[3]]:[128,128,128]}(i.fill),n=.299*s+.587*o+.114*a>128?"#000":"#fff",l=Math.max(10,Math.min(16,.3*Math.min(i.w,i.h)));return Mr("g",{children:[Pr("rect",{...r}),Pr("text",{className:"semiotic-heatmap-value",x:i.x+i.w/2,y:i.y+i.h/2,textAnchor:"middle",dominantBaseline:"middle",fill:n,fontSize:l+"px",fontFamily:"var(--semiotic-font-family, sans-serif)",children:e})]},"heatcell-"+t)}return Pr("rect",{...r},"heatcell-"+t)}case"candlestick":{let r=e,s=`${i?i+"-":""}candle-${t}-hatch`,o=mi(r.style?.fill)?fi(r.style.fill,s):void 0,a=o?`url(#${s})`:void 0,{fill:n,...l}=r.style??{};if(r.isRange){let e=r.dotRadius??Math.max(2,r.bodyWidth/2),i=a??r.wickColor;return Mr(_r.Fragment,{children:[o&&Pr("defs",{children:o}),Mr("g",{style:l,children:[Pr("line",{x1:r.x,y1:r.highY,x2:r.x,y2:r.lowY,stroke:r.wickColor,strokeWidth:r.wickWidth,opacity:r.style?.opacity}),Pr("circle",{cx:r.x,cy:r.highY,r:e,fill:i,opacity:r.style?.opacity}),Pr("circle",{cx:r.x,cy:r.lowY,r:e,fill:i,opacity:r.style?.opacity})]})]},"candle-"+t)}let c=Math.min(r.openY,r.closeY),h=Math.max(Math.abs(r.openY-r.closeY),1),u=r.isUp?r.upColor:r.downColor,d=a??u;return Mr(_r.Fragment,{children:[o&&Pr("defs",{children:o}),Mr("g",{style:l,children:[Pr("line",{x1:r.x,y1:r.highY,x2:r.x,y2:r.lowY,stroke:r.wickColor,strokeWidth:r.wickWidth,opacity:r.style?.opacity}),Pr("rect",{x:r.x-r.bodyWidth/2,y:c,width:r.bodyWidth,height:h,fill:d,stroke:a?r.wickColor:u,strokeWidth:1,opacity:r.style?.opacity})]})]},"candle-"+t)}default:return null}}(e,t,i,r);return"area"===e.type?s:li(s,e,"xy-cursor-"+t)}(e,t,vr,$t)})).filter(Boolean)]})]}),Er(B,{width:Qr,height:Zr,totalWidth:Wr[0],totalHeight:Wr[1],margin:Jr,scales:i,showAxes:Ie,axes:Ne,xLabel:We,yLabel:Ve,yLabelRight:Ke,xFormat:a,yFormat:ut||bt,axisExtent:yt,showGrid:Zt,title:Di,description:lr,legend:ei,legendHoverBehavior:ii,legendClickBehavior:ci,legendHighlightedCategory:hi,legendIsolatedCategories:ui,legendPosition:pi,legendLayout:yi,foregroundGraphics:Ee(r,st(Ss.current?.customLayoutOverlays,yr??null)),marginalGraphics:rr,xValues:l.xValues,yValues:l.yValues,annotations:Nt,onAnnotationActivate:Wt,onObservation:Dt??Tt,chartId:Et,chartType:"StreamXYFrame",autoPlaceAnnotations:Gt,svgAnnotationRules:Qt,annotationFrame:0,xAccessor:oo,yAccessor:ao,annotationData:no(Ss.current?.getData()),pointNodes:F(Ss.current?.scene),curve:"string"==typeof w?w:void 0,linkedCrosshairName:hr,linkedCrosshairSourceId:ur})]})}return Or("div",{ref:Nr,className:"stream-xy-frame"+(oe?" "+oe:""),role:"group","aria-label":lr||("string"==typeof Di?Di:"XY chart"),tabIndex:0,style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:J?"100%":Wr[0],height:Z?"100%":Wr[1],overflow:"visible",touchAction:W(Oi)},onKeyDown:Gs,children:["production"!==process.env.NODE_ENV&&Ss.current&&Er(dt,{store:Ss.current,diagnostics:vs.current}),nr&&Or(at,{accessibleTable:nr,children:[Er(gt,{tableId:Hr}),Er(ot,{scene:Ss.current?.scene??[],chartType:r+" chart",tableId:Hr,chartTitle:"string"==typeof Di?Di:void 0})]}),Er(pt,{summary:cr}),Er(nt,{hoverPoint:gs}),Or("div",{role:"img","aria-label":lr||("string"==typeof Di?Di:"XY chart"),style:{position:"relative",width:"100%",height:"100%"},onPointerMove:Us,onMouseMove:qs,onPointerLeave:Ns,onMouseLeave:Ns,onPointerDown:is||xr?Ks:void 0,onClick:xr?js:void 0,children:[Er(lt,{size:Wr,margin:Jr,backdropFill:ki?ae:void 0,children:cs}),Er(O,{width:Qr,height:Zr,totalWidth:Wr[0],totalHeight:Wr[1],margin:Jr,scales:as,showAxes:Ie,axes:Ne,showGrid:Zt,xFormat:Qs,yFormat:ut||bt,axisExtent:yt}),Er("canvas",{ref:Bs,"aria-label":vt(Ss.current?.scene??[],r+" chart"),style:{position:"absolute",left:0,top:0}}),Er("canvas",{ref:Ls,style:{position:"absolute",left:0,top:0,pointerEvents:"none"}}),Er(B,{width:Qr,height:Zr,totalWidth:Wr[0],totalHeight:Wr[1],margin:Jr,scales:as,showAxes:Ie,axes:Ne,xLabel:We,yLabel:Ve,yLabelRight:Ke,xFormat:Qs,yFormat:ut||bt,axisExtent:yt,showGrid:Zt,title:Di,description:lr,legend:ei,legendHoverBehavior:ii,legendClickBehavior:ci,legendHighlightedCategory:hi,legendIsolatedCategories:ui,legendPosition:pi,legendLayout:yi,foregroundGraphics:Ee(ls,st(Ss.current?.customLayoutOverlays,yr??null)),marginalGraphics:rr,xValues:Ds,yValues:Es,annotations:Nt,onAnnotationActivate:Wt,onObservation:Dt??Tt,chartId:Et,chartType:"StreamXYFrame",autoPlaceAnnotations:Gt,svgAnnotationRules:Qt,annotationFrame:rs,xAccessor:oo,yAccessor:ao,annotationData:no(Ss.current?.getData()),pointNodes:F(Ss.current?.scene),curve:"string"==typeof w?w:void 0,underlayRendered:!0,canvasObscuresUnderlay:!!Ge({background:ae,hasBackgroundGraphics:!!ki,themeBackground:Xr?.colors.background}),linkedCrosshairName:hr,linkedCrosshairSourceId:ur}),(Oi||Bi)&&Er(e,{width:Qr,height:Zr,totalWidth:Wr[0],totalHeight:Wr[1],margin:Jr,dimension:Oi?.dimension??"xy",scales:as,onBrush:Bi??(()=>{}),binSize:C,snap:Oi?.snap,binBoundaries:Oi?.binBoundaries??("bar"===r?Ss.current?.getBinBoundaries():void 0),snapDuring:Oi?.snapDuring,streaming:"streaming"===s}),Ii?.showBadge&&Er(Re,{isStale:bs,position:Ii.badgePosition}),io,eo]})]})}));zr.displayName="StreamXYFrame";var Fr=zr;import{useCallback as $r,useRef as Ir}from"react";export{P as provideMarginalGraphics,I as DefaultTooltip,Fr as StreamXYFrame_default,X as useXYBrush};
|
|
1
|
+
function e(e){let[t,i]=Mi.useState(()=>Ti);return Mi.useEffect(()=>{if(t)return;let e=!1;return(Ti?Promise.resolve(Ti):(Di||(Di=import("./c-7EGHJU2F.min.js").then(e=>Ti=e.XYBrushOverlay).catch(e=>{throw Di=null,e})),Di)).then(t=>{e||i(()=>t)}),()=>{e=!0}},[t]),t?Yi(t,{...e}):null}function t(e,t,i){if(t._transitionKey)return t._transitionKey;switch(t.type){case"point":if(t.pointId)return"p:"+t.pointId;if("streaming"===e.runtimeMode&&t.datum){let i=e.getX(t.datum),r=e.getY(t.datum);if(e.getCategory)return`p:${e.getCategory(t.datum)}:${i}:${r}`;if(null!=i&&null!=r)return`p:${i}:${r}`}return"p:"+i;case"glyph":return t.pointId?"g:"+t.pointId:"g:"+i;case"rect":return`r:${t.group||""}:${t.datum?.binStart??t.datum?.category??i}`;case"heatcell":return`h:${t.x}_${t.y}`;case"candlestick":return null==t.datum?"c:"+i:"c:"+e.getX(t.datum);case"line":return"l:"+(t.group||"_default");case"area":return"a:"+(t.group||"_default");default:return null}}function i(e){return e?null!=e.opacity?e.opacity:null!=e.fillOpacity?e.fillOpacity:1:1}function r(e,t){let i="function"==typeof e?e:i=>i[e||t];return e=>{let t=i(e);return null==t?NaN:+t}}function s(e){let t=[],i=["bar","swarm","waterfall"].includes(e.chartType)||"streaming"===e.runtimeMode,s=r(i&&e.valueAccessor||e.yAccessor,i?"value":"y");if(e.boundsAccessor){let i=Se(e.boundsAccessor,"bounds");t.push({kind:"bounds",getTop:e=>{let t=s(e);if(!Number.isFinite(t))return NaN;let r=i(e);return Number.isFinite(r)&&0!==r?t+r:t},getBottom:e=>{let t=s(e);if(!Number.isFinite(t))return NaN;let r=i(e);return Number.isFinite(r)&&0!==r?t-r:t},style:e.boundsStyle,perSeries:!0,interactive:!1})}if(e.band){let i=Array.isArray(e.band)?e.band:[e.band];for(let e of i)t.push({kind:"band",getTop:r(e.y1Accessor,"y1"),getBottom:r(e.y0Accessor,"y0"),style:e.style,perSeries:!1!==e.perSeries,interactive:!0===e.interactive})}return t}function o(e,t){return t?[t[0]??e[0],t[1]??e[1]]:e}function a(e,t,i){if("log"===e){let e=[Math.max(t[0],1e-6),Math.max(t[1],1e-6)];return Bi().domain(e).range(i).clamp(!0)}return"symlog"===e?Li().domain(t).range(i):"time"===e?zi().domain([new Date(t[0]),new Date(t[1])]).range(i):Oi().domain(t).range(i)}function n(e,t){return e&&"object"==typeof e&&!Array.isArray(e)?hi(e,t):void 0}function l(e,t){let i=mi(t);if(!i)return e;let r=sr.get(e),s=r?.get(i);if(s)return s;let o=function(e,t,i=8){if(!t||2>e.length)return e.map(([e,t])=>[e,t]);let r=[],s=null,o={moveTo(e,t){s=[e,t],r.push([e,t])},lineTo(e,t){s=[e,t],r.push([e,t])},bezierCurveTo(e,t,o,a,n,l){if(!s)return s=[n,l],void r.push([n,l]);let[c,h]=s;for(let s=1;i>=s;s++){let u=s/i,d=1-u;r.push([d*d*d*c+3*d*d*u*e+3*d*u*u*o+u*u*u*n,d*d*d*h+3*d*d*u*t+3*d*u*u*a+u*u*u*l])}s=[n,l]},closePath(){},arc(){},rect(){},arcTo(){},quadraticCurveTo(e,t,i,o){s=[i,o],r.push([i,o])}};return rr().x(e=>e[0]).y(e=>e[1]).curve(t).context(o)(e),r}(e,i);return r||(r=new Map,sr.set(e,r)),r.set(i,o),o}function c(e,t,i,r=30,s,o=0){let a=null;if(s){let e=Le(s,t,i,r,o);e&&!1!==e.node.interactive&&(a={node:e.node,datum:e.node.datum,x:e.node.x,y:e.node.y,distance:e.distance})}for(let o of e){let e=null;switch(o.type){case"point":if(!1===o.interactive||s)break;e=u(o,t,i,r);break;case"symbol":e=d(o,t,i,r);break;case"glyph":e=p(o,t,i,r);break;case"line":e=g(o,t,i,r);break;case"rect":if(null==o.datum)break;e=y(o,t,i);break;case"heatcell":e=f(o,t,i);break;case"area":if(!1===o.interactive)break;e=x(o,t,i,r);break;case"candlestick":e=m(o,t,i)}e&&(!a||a.distance>e.distance)&&(a=e)}return a}function h(e,t,i){if(0===e.length)return null;if(e[0][0]>t||t>e[e.length-1][0])return null;let r=v(e,t);if(0>r||Math.abs(e[r][0]-t)>i)return null;let s=r,o=r;r>0&&e[r][0]>=t?(s=r-1,o=r):e.length-1>r&&(s=r,o=r+1);let[a,n]=e[s],[l,c]=e[o];return l===a?n:n+Math.max(0,Math.min(1,(t-a)/(l-a)))*(c-n)}function u(e,t,i,r=30){let s=t-e.x,o=i-e.y,a=Math.sqrt(s*s+o*o);return a>ze(e.r,r)?null:{node:e,datum:e.datum,x:e.x,y:e.y,distance:a}}function d(e,t,i,r=30){let s=t-e.x,o=i-e.y,a=Math.sqrt(s*s+o*o);return a>ze(vi(e.size),r)?null:{node:e,datum:e.datum,x:e.x,y:e.y,distance:a}}function p(e,t,i,r=30){if(null==e.datum)return null;let s=gi(e.glyph,e.size),o=e.x+s.centerDx,a=e.y+s.centerDy,n=t-o,l=i-a,c=Math.sqrt(n*n+l*l);return c>ze(s.radius,r)?null:{node:e,datum:e.datum,x:o,y:a,distance:c}}function g(e,t,i,r=30){if(0===e.path.length)return null;let s=v(e.path,t);if(0>s)return null;let o,[a,n]=e.path[s];if(e.path.length>1){let r=1/0,a=Math.max(0,s-1),n=Math.min(e.path.length-2,s);for(let s=a;n>=s;s++){let[o,a]=e.path[s],[n,l]=e.path[s+1],c=Ve(t,i,o,a,n,l);r>c&&(r=c)}o=r}else{let e=t-a,r=i-n;o=Math.sqrt(e*e+r*r)}let l=e.style;return o>Math.max(5,(l.strokeWidth??l.lineWidth??1)/2+2,r)?null:{node:e,datum:Array.isArray(e.datum)&&e.datum[s]?e.datum[s]:e.datum,x:a,y:n,distance:o}}function y(e,t,i){let r=Fe(t,i,e);return r.hit?{node:e,datum:e.datum,x:r.cx,y:r.cy,distance:0}:null}function f(e,t,i){let r=Fe(t,i,e);return r.hit?{node:e,datum:e.datum,x:r.cx,y:r.cy,distance:0}:null}function m(e,t,i){let r=e.bodyWidth/2,s=Math.min(e.openY,e.closeY);if(!(e.x-r-3>t||t>e.x+r+3||e.highY-3>i||i>e.lowY+3)){let r=s+Math.max(Math.max(e.openY,e.closeY)-s,1)/2,o=t-e.x,a=i-r;return{node:e,datum:e.datum,x:e.x,y:r,distance:Math.sqrt(o*o+a*a)}}return null}function x(e,t,i,r){if(0===e.topPath.length||e.clipRect&&(e.clipRect.x>t||t>e.clipRect.x+e.clipRect.width||e.clipRect.y>i||i>e.clipRect.y+e.clipRect.height))return null;let s,o=l(e.topPath,e.curve),a=v(o,t),n=v(e.topPath,t);if(0>a||0>n)return null;if(o.length>1){let e=1/0,r=Math.max(0,a-1),n=Math.min(o.length-2,a);for(let s=r;n>=s;s++){let[r,a]=o[s],[n,l]=o[s+1];e=Math.min(e,Ve(t,i,r,a,n,l))}s=e}else{let e=t-o[0][0],r=i-o[0][1];s=Math.sqrt(e*e+r*r)}if(s>r)return null;let[c,h]=e.topPath[n];return{node:e,datum:Array.isArray(e.datum)&&e.datum[n]?e.datum[n]:e.datum,x:c,y:h,distance:s}}function v(e,t){if(0===e.length)return-1;let i=0,r=e.length-1;for(;r>i;){let s=i+r>>1;t>e[s][0]?i=s+1:r=s}return i>0&&Math.abs(e[i][0]-t)>=Math.abs(e[i-1][0]-t)?i-1:i}function b(e,t,i){if("edges"===e){if(t)return"start";if(i)return"end"}return"middle"}function w(e,t,i){if("edges"===e){if(t)return"hanging";if(i)return"auto"}return"middle"}function k(e){if(0===e.length)return{min:null,max:null};let t=1/0,i=-1/0;for(let r of e)t>r.pixel&&(t=r.pixel),r.pixel>i&&(i=r.pixel);return{min:t,max:i}}function A(e){if(e)return"object"==typeof e?e.strokeDasharray:"dashed"===e?"6,4":"dotted"===e?"2,4":e}function _(e,t){return e&&"string"!=typeof e?{stroke:e.stroke??t.stroke,strokeWidth:e.strokeWidth??t.strokeWidth,...null!=e.strokeOpacity&&{strokeOpacity:e.strokeOpacity},...e.strokeDasharray&&{strokeDasharray:e.strokeDasharray}}:{...t,..."string"==typeof e&&{strokeDasharray:A(e)}}}function C(e,t,i){if("left"===e||"right"===e){let r="left"===e?i:0,s="left"===e?-1:1,o=Math.ceil(t/8),a="M0,"+r;for(let e=0;o>e;e++){let i=8*(e+1);a+=`L${Math.min(8*e+4,t)},${r+4*s}`,a+=`L${Math.min(i,t)},${r}`}return a}let r="bottom"===e?0:t,s="bottom"===e?1:-1,o=Math.ceil(i/8),a=`M${r},0`;for(let e=0;o>e;e++){let t=8*(e+1);a+=`L${r+4*s},${Math.min(8*e+4,i)}`,a+=`L${r},${Math.min(t,i)}`}return a}function P({axes:e,xTicks:t,yTicks:i,width:r,height:s}){let{xAxis:o,yAxis:a}=It(e);return or("g",{className:"stream-grid",children:[o,a].map((e,o)=>{if(!1===e?.grid)return null;let a=0===o,n=_(e?.gridStyle,{stroke:"var(--semiotic-grid, #e0e0e0)",strokeWidth:1});return(a?t:i).map((t,i)=>or("line",{x1:a?t.pixel:0,y1:a?0:t.pixel,x2:a?t.pixel:r,y2:a?s:t.pixel,...n,strokeDasharray:A(e?.gridStyle)??n.strokeDasharray},`${o}-${i}`))})})}function S(e){dr=e}function R(e,t,i){let r="function"==typeof t?t:e=>e[t||"x"],s="function"==typeof i?i:e=>e[i||"y"],o=[],a=[];for(let t of e){let e=r(t),i=s(t);"number"==typeof e&&isFinite(e)&&o.push(e),"number"==typeof i&&isFinite(i)&&a.push(i)}return{xValues:o,yValues:a}}function M(e){let[t,i]=hr.useState(()=>dr);return hr.useEffect(()=>{if(t)return;let e=!1;return(dr?Promise.resolve(dr):(pr||(pr=import("./c-PRIKOLTE.min.js").then(e=>dr=e.MarginalGraphics).catch(e=>{throw pr=null,e})),pr)).then(t=>{e||i(()=>t)}),()=>{e=!0}},[t]),t?ur(t,{...e}):null}function Y(e){let t=new Date(e instanceof Date?e.valueOf():e);return`${gr[t.getUTCMonth()]} ${t.getUTCDate()}`}function T(e){let t=Math.abs(e[1]-e[0]);return 864e5>t?e=>{let i=new Date(e instanceof Date?e.valueOf():e),r=`${(i.getUTCHours()+"").padStart(2,"0")}:${(i.getUTCMinutes()+"").padStart(2,"0")}`;return 3e5>t&&(r+=":"+(i.getUTCSeconds()+"").padStart(2,"0")),1e4>t&&(r+="."+(i.getUTCMilliseconds()+"").padStart(3,"0")),r}:3156e7>t?Y:1578e8>t?e=>{let t=new Date(e instanceof Date?e.valueOf():e);return`${gr[t.getUTCMonth()]} ${t.getUTCFullYear()}`}:e=>new Date(e instanceof Date?e.valueOf():e).getUTCFullYear()+""}function D(e){return"string"==typeof e||"number"==typeof e?6.5*(e+"").length:60}function E(e){let{scale:t,axis:i,size:r,horizontal:s=!1,axisExtent:o}=e,a=i?.extent??o,n=t.domain(),l=function(e){return e?.ticks??e?.tickCount??5}(i),c=Math.max(2,Math.floor(r/(s?70:30))),h="exact"===a?Math.max(2,l):Math.min(l,c),u=i?.tickValues??ae(t,h,a),d=u.map(e=>e.valueOf()),p=i?.tickFormat||e.format||(n[0]instanceof Date||u[0]instanceof Date?T([n[0].valueOf(),n[n.length-1].valueOf()]):Et(d)),g=(e,t)=>s?p(e,t,d):p(e),y=u.map((e,i)=>({value:e,pixel:t(e),label:g(e,i)})),f=22;if(s){let e=y.reduce((e,t)=>Math.max(e,D(t.label)),0);f=i?.autoRotate?Math.max(20,Math.min(e+8,55)):Math.max(55,e+8)}let m=function(e,t){if(2>=e.length)return e;let i=[e[0]];for(let r=1;e.length-1>r;r++)Math.abs(e[r].pixel-i[i.length-1].pixel)>=t&&i.push(e[r]);let r=e[e.length-1];return t>Math.abs(r.pixel-i[i.length-1].pixel)?i[i.length-1]=r:i.push(r),i}(y,f);if(m.length>1&&(m=m.filter((e,t)=>{return 0===t||(r=m[t-1].label,!!("string"!=typeof(i=e.label)&&"number"!=typeof i||"string"!=typeof r&&"number"!=typeof r||i+""!=r+""));var i,r})),i?.includeMax&&m.length>0&&"exact"!==a&&!i.tickValues){let e=n[n.length-1];if(null!=e){let i=t(e),r=Math.abs(i-m[m.length-1].pixel);if(r>1){let t=g(e,m.length);f>r&&m.length>1&&(m=m.slice(0,-1)),m=[...m,{value:e,pixel:i,label:t}]}}}return m}function O(e){let{width:t,height:i,totalWidth:r,totalHeight:s,margin:o,scales:a,showAxes:n,axes:l,showGrid:c,xFormat:h,yFormat:u,axisExtent:d}=e,p=yr(()=>{if(!a||!c)return[];let e=l?.find(e=>"bottom"===e.orient)??l?.find(e=>"top"===e.orient);return E({scale:a.x,axis:e,size:t,horizontal:!0,format:h,axisExtent:d})},[a,l,h,t,d,c]),g=yr(()=>{if(!a||!c)return[];let e=l?.find(e=>"left"===e.orient)??l?.find(e=>"right"===e.orient);return E({scale:a.y,axis:e,size:i,format:u,axisExtent:d})},[a,l,u,i,d,c]),y=c&&a,f=n&&a;if(!y&&!f)return null;let{xAxis:m,yAxis:x,xOrient:v,yOrient:b}=It(l),w="top"===v?0:i,k="right"===b?t:0,A=f&&!1!==m?.visible&&(!m||!1!==m.baseline),S=f&&!1!==x?.visible&&(!x||!1!==x.baseline),R=m?.jaggedBase||!1,M=x?.jaggedBase||!1,Y=_(m?.axisStyle,{stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),T=_(x?.axisStyle,{stroke:"var(--semiotic-border, #ccc)",strokeWidth:1});return fr("svg",{width:r,height:s,style:{position:"absolute",top:0,left:0,pointerEvents:"none"},children:mr("g",{transform:`translate(${o.left},${o.top})`,children:[y&&fr(P,{axes:l,xTicks:p,yTicks:g,width:t,height:i}),A&&!R&&fr("line",{x1:0,y1:w,x2:t,y2:w,...Y}),f&&!1!==m?.visible&&R&&fr("path",{d:C(v,t,i),fill:"none",...Y}),S&&!M&&fr("line",{x1:k,y1:0,x2:k,y2:i,...T}),f&&!1!==x?.visible&&M&&fr("path",{d:C(b,t,i),fill:"none",...T})]})})}function B(e){let{width:t,height:i,totalWidth:r,totalHeight:s,margin:o,scales:a,showAxes:n,axes:l,xLabel:c,yLabel:h,yLabelRight:u,xFormat:d,yFormat:p,axisExtent:g,showGrid:y,title:f,description:m,idPrefix:x,legend:v,legendHoverBehavior:A,legendClickBehavior:S,legendHighlightedCategory:R,legendIsolatedCategories:Y,legendPosition:T="right",legendLayout:O,foregroundGraphics:B,marginalGraphics:L,xValues:z,yValues:F,annotations:$,onAnnotationActivate:N,onObservation:I,chartId:W,chartType:X,autoPlaceAnnotations:j,svgAnnotationRules:V,xAccessor:H,yAccessor:G,annotationData:U,pointNodes:q,curve:K,underlayRendered:J,canvasObscuresUnderlay:Z=!0,linkedCrosshairName:ee,linkedCrosshairSourceId:te,children:ie}=e,re=Zt({onAnnotationActivate:N,onObservation:I,chartId:W,chartType:X}),se=Wt({showAxes:n,xLabel:c,yLabel:h,yLabelRight:u,axes:l}),oe=Nt(O,se.leftAxis),ae=Nt(O,se.rightAxis),ne=v&&"left"===T&&oe>0?oe:o.left,le=v&&"right"===T&&ae>0?ae:o.right,ce=ar(()=>{if(!n&&!y||!a)return[];let e=l?.find(e=>"bottom"===e.orient)??l?.find(e=>"top"===e.orient);return E({scale:a.x,axis:e,size:t,horizontal:!0,format:d,axisExtent:g})},[n,y,a,l,d,t,g]),he=ar(()=>!(!(l?.find(e=>"bottom"===e.orient)??l?.find(e=>"top"===e.orient))?.autoRotate||!function(e){for(let t=1;e.length>t;t++){let i=e[t-1],r=e[t];if(Math.abs(r.pixel-i.pixel)<(D(i.label)+D(r.label))/2+8)return!0}return!1}(ce)),[l,ce]),ue=ar(()=>{if(!n&&!y||!a)return[];let e=l?.find(e=>"left"===e.orient)??l?.find(e=>"right"===e.orient);return E({scale:a.y,axis:e,size:i,format:p,axisExtent:g})},[n,y,a,l,p,i,g]),de=ar(()=>{if(!n||!a||!l?.some(e=>"left"===e.orient))return[];let e=l?.find(e=>"right"===e.orient);return e?E({scale:a.y,axis:e,size:i,format:p,axisExtent:g}):[]},[n,a,l,p,i,g]),pe=nr(new Map),ge=nr($?.length??0),ye=$?.length??0;ge.current!==ye&&(ge.current=ye,pe.current=new Map);let fe=ar(()=>{if(!$||0===$.length)return null;let e=Be($),r=kt("xy",re),s={scales:a?{x:a.x,y:a.y,time:a.x,value:a.y}:null,timeAxis:"x",xAccessor:H,yAccessor:G,width:t,height:i,data:U,frameType:"xy",pointNodes:q,curve:K,stickyPositionCache:pe.current},o=j?ft({annotations:e,context:s,..."object"==typeof j?j:{}}):e;return Ft(o,r,V,s)},[$,j,V,t,i,H,G,U,a,q,K,re]),me=ti(ee);lr(()=>{if(!me?.locked||!ee)return;let e=e=>{"Escape"===e.key&&Jt(ee)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[me?.locked,ee]);let xe=n||f||m||v||B||L||fe&&fe.length>0||y||ie||me,ve=cr(),{titleId:be,descId:we,labelledBy:ke}=Ie(x||W||ve);return xe?br("svg",{role:"img","aria-labelledby":ke,width:r,height:s,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:[vr("title",{id:be,children:We(f,"XY Chart")}),vr("desc",{id:we,children:Ne(f,m,{familyPhrase:"XY data visualization",fallback:"XY data visualization"})}),br("g",{transform:`translate(${o.left},${o.top})`,children:[y&&a&&(!J||Z)&&vr(P,{axes:l,xTicks:ce,yTicks:ue,width:t,height:i}),n&&a&&(()=>{let{xAxis:e,yAxis:r,xOrient:s,yOrient:o,leftAxis:a}=It(l),n="top"===s?0:i,d="right"===o?t:0,p="top"===s?-1:1,g="right"===o?1:-1,y=!e||!1!==e.baseline,f=!r||!1!==r.baseline,m=e?.jaggedBase||!1,x=r?.jaggedBase||!1,v=e?.landmarkTicks,A=r?.landmarkTicks,P=_(e?.axisStyle,{stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),S=_(r?.axisStyle,{stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),R="var(--semiotic-text-secondary, var(--semiotic-text, #666))",M="var(--semiotic-text, #333)",Y=he,T={fontSize:"var(--semiotic-tick-font-size, 12px)"},D={fontSize:"calc(var(--semiotic-tick-font-size, 12px) + 1px)"},E={fontSize:"var(--semiotic-axis-label-font-size, 12px)"},O=e?.tickAnchor,B=r?.tickAnchor,L=e?.label??c,z=r?.label??("right"===o?u??h:h),F="right"===o?t+le-15:15-ne,$=k(ce),N=k(ue);return br("g",{className:"stream-axes",style:{fontFamily:"var(--semiotic-font-family, sans-serif)"},children:[!1!==e?.visible&&br("g",{className:"semiotic-axis semiotic-axis-"+s,"data-orient":s,children:[(!J||Z)&&y&&!m&&vr("line",{x1:0,y1:n,x2:t,y2:n,...P}),(!J||Z)&&m&&vr("path",{d:C(s,t,i),fill:"none",...P}),ce.map((e,t)=>{let i=!!v&&("function"==typeof v?v(e.value,t):$e(e.value,t>0?ce[t-1].value:void 0));return br("g",{transform:`translate(${e.pixel},${n})`,children:[vr("line",{y2:5*p,...P}),"string"==typeof e.label||"number"==typeof e.label?vr("text",{y:p*(Y?12:18),textAnchor:Y?"end":b(O,e.pixel===$.min,e.pixel===$.max),fontWeight:i?600:400,fill:R,fontSize:i?13:12,className:"semiotic-axis-tick",style:{userSelect:"none",...i?D:T},transform:Y?"top"===s?"rotate(45)":"rotate(-45)":void 0,children:e.label}):vr("foreignObject",{x:-30,y:"top"===s?-30:6,width:60,height:24,style:{overflow:"visible"},children:vr("div",{style:{textAlign:"center",userSelect:"none",...T},children:e.label})})]},"xtick-"+t)}),L&&vr("text",{x:t/2,y:"top"===s?-(Y?58:40):i+(Y?58:40),textAnchor:"middle",fill:M,fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...E},children:L})]}),!1!==r?.visible&&br("g",{className:"semiotic-axis semiotic-axis-"+o,"data-orient":o,children:[(!J||Z)&&f&&!x&&vr("line",{x1:d,y1:0,x2:d,y2:i,...S}),(!J||Z)&&x&&vr("path",{d:C(o,t,i),fill:"none",...S}),ue.map((e,t)=>{let i=!!A&&("function"==typeof A?A(e.value,t):$e(e.value,t>0?ue[t-1].value:void 0));return br("g",{transform:`translate(${d},${e.pixel})`,children:[vr("line",{x2:5*g,...S}),"string"==typeof e.label||"number"==typeof e.label?vr("text",{x:8*g,textAnchor:"right"===o?"start":"end",dominantBaseline:w(B,e.pixel===N.min,e.pixel===N.max),fontWeight:i?600:400,fill:R,fontSize:i?13:12,className:"semiotic-axis-tick",style:{userSelect:"none",...i?D:T},children:e.label}):vr("foreignObject",{x:"right"===o?8:-68,y:-12,width:60,height:24,style:{overflow:"visible"},children:vr("div",{style:{textAlign:"right"===o?"left":"right",userSelect:"none",...T},children:e.label})})]},"ytick-"+t)}),z&&vr("text",{x:F,y:i/2,textAnchor:"middle",fill:M,transform:`rotate(${"right"===o?90:-90}, ${F}, ${i/2})`,fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...E},children:z})]}),(()=>{let e=l?.find(e=>"right"===e.orient);if(!a||!e||!1===e.visible||0===de.length)return null;let r=!1!==e.baseline,s=e.landmarkTicks,o=e.label||u,n=e.tickAnchor,c=_(e.axisStyle,{stroke:"var(--semiotic-border, #ccc)",strokeWidth:1}),h=k(de);return br("g",{className:"semiotic-axis semiotic-axis-right","data-orient":"right",children:[r&&!e.jaggedBase&&vr("line",{x1:t,y1:0,x2:t,y2:i,...c}),e.jaggedBase&&vr("path",{d:C("right",t,i),fill:"none",...c}),de.map((e,i)=>{let r=!!s&&("function"==typeof s?s(e.value,i):$e(e.value,i>0?de[i-1].value:void 0));return br("g",{transform:`translate(${t},${e.pixel})`,children:[vr("line",{x2:5,...c}),"string"==typeof e.label||"number"==typeof e.label?vr("text",{x:8,textAnchor:"start",dominantBaseline:w(n,e.pixel===h.min,e.pixel===h.max),fontWeight:r?600:400,fill:R,fontSize:r?13:12,className:"semiotic-axis-tick",style:{userSelect:"none",...r?D:T},children:e.label}):vr("foreignObject",{x:8,y:-12,width:60,height:24,style:{overflow:"visible"},children:vr("div",{style:{textAlign:"left",userSelect:"none",...T},children:e.label})})]},"ytick-r-"+i)}),o&&vr("text",{x:t+le-15,y:i/2,textAnchor:"middle",fill:M,transform:`rotate(90, ${t+le-15}, ${i/2})`,fontSize:12,className:"semiotic-axis-label",style:{userSelect:"none",...E},children:o})]})})()]})})(),fe,L&&a&&z&&F&&br(xr,{children:[L.top&&vr("g",{transform:"translate(0, 0)",children:vr(M,{orient:"top",config:Q(L.top),values:z,scale:a.x,size:o.top,length:t})}),L.bottom&&vr("g",{transform:`translate(0, ${i})`,children:vr(M,{orient:"bottom",config:Q(L.bottom),values:z,scale:a.x,size:o.bottom,length:t})}),L.left&&vr("g",{transform:"translate(0, 0)",children:vr(M,{orient:"left",config:Q(L.left),values:F,scale:a.y,size:o.left,length:i})}),L.right&&vr("g",{transform:`translate(${t}, 0)`,children:vr(M,{orient:"right",config:Q(L.right),values:F,scale:a.y,size:o.right,length:i})})]}),B,me&&me.sourceId!==te&&a?.x&&(()=>{let e=a.x(me.xValue);if(null==e||0>e||e>t)return null;let r=me.locked;return vr("line",{x1:e,y1:0,x2:e,y2:i,stroke:r?"white":"var(--semiotic-text-secondary, rgba(0,0,0,0.25))",strokeWidth:r?1.5:1,strokeDasharray:r?"6,3":"4,4",pointerEvents:"none"})})(),ie]}),vr(ut,{title:f,totalWidth:r,marginTop:o.top}),$t({legend:v,totalWidth:r,totalHeight:s,margin:o,legendPosition:T,title:f,legendLayout:O,axisChrome:se,legendHoverBehavior:A,legendClickBehavior:S,legendHighlightedCategory:R,legendIsolatedCategories:Y})]}):null}function L(e,t,i,r){if(!e||2>t.length)return null;let s=xt(e.stops,r);return s?Sr("linearGradient",{id:i,gradientUnits:"userSpaceOnUse",x1:t[0][0],y1:0,x2:t[t.length-1][0],y2:0,children:s}):null}function z(e,t){let i=e.trim();if(/^#[0-9a-f]{3}$/i.test(i)){let e=i[1],r=i[2],s=i[3];return`#${e}${e}${r}${r}${s}${s}${t}`}if(/^#[0-9a-f]{6}$/i.test(i))return`${i}${t}`;let r=i.match(/^rgb\s*\(\s*([^)]+?)\s*\)$/i);return r?`rgba(${r[1]}, ${(parseInt(t,16)/255).toFixed(3)})`:i}function F(e){if(!e)return;let t=[];for(let i of e)if("point"===i.type)t.push(i);else if("symbol"===i.type)t.push({pointId:i.pointId,x:i.x,y:i.y,r:vi(i.size)});else if("glyph"===i.type){let e=gi(i.glyph,i.size);t.push({pointId:i.pointId,x:i.x+e.centerDx,y:i.y+e.centerDy,r:e.radius})}return t}function $(e){return null==e?"":"number"==typeof e?Number.isInteger(e)?e+"":e.toFixed(2):e instanceof Date?e.toLocaleString():e+""}function N({hover:e}){let t=e.data??{},i=t.__aggregateValue??t.y??t.value,r=t.x??t.time;if(void 0===i&&void 0===r){let e=Gt(t);if(null!=e.title||e.entries.length>0)return Dr("div",{className:"semiotic-tooltip",style:At,children:[null!=e.title&&Tr("div",{style:{fontWeight:600,marginBottom:e.entries.length?2:0},children:e.title+""}),e.entries.map(e=>Dr("div",{style:{opacity:.7,fontSize:11},children:[e.key,":"," ",Tr("span",{style:{fontWeight:600},children:$(e.value)})]},e.key))]})}return Dr("div",{className:"semiotic-tooltip",style:At,children:[Tr("div",{style:{fontWeight:600,marginBottom:2},children:$(i)}),Tr("div",{style:{opacity:.7,fontSize:11},children:$(r)})]})}function I(e,t){if(!t||0===e.length||!e.some(e=>null!=e&&"object"==typeof e&&Array.isArray(e[t])))return e;let i=[];for(let r of e){if(null==r||"object"!=typeof r)continue;let e=r[t];if(!Array.isArray(e))continue;let s=r.label??r.id??r.key;for(let t of e)null==t||"object"!=typeof t||i.push(null==s?t:{...t,_lineGroup:s})}return i}function W(e){if(e)return"x"===e.dimension?"pan-y":"y"===e.dimension?"pan-x":"none"}function X({brush:e,onBrush:t,linkedBrush:i,xAccessor:r,yAccessor:s,defaultDimension:o="xy"}){let a=Tt(i),n=!!e||!!a||!!t,l=a?.xField||("string"==typeof r?r:void 0),c=a?.yField||("string"==typeof s?s:void 0),h="y"!==o||a?.xField?l:void 0,u="x"!==o||a?.yField?c:void 0,d=Qt({name:a?.name||"__unused_brush__",xField:h,yField:u}),p=a?"xyBrush"===d.brushInteraction.brush?"xy":"xBrush"===d.brushInteraction.brush?"x":"y":o,g=Nr(d.brushInteraction);g.current=d.brushInteraction;let y=$r(e=>{let i=g.current;if(!e)return a&&i.end(null),void t?.(null);a&&i.end("xyBrush"===i.brush?[[e.x[0],e.y[0]],[e.x[1],e.y[1]]]:"xBrush"===i.brush?e.x:e.y),t?.(e)},[a,t]);return n?{brushStreamProps:{brush:{dimension:p},onBrush:y}}:{brushStreamProps:{}}}import{computeBinExtent as j,getXYCanvasRenderers as V,getXYPlugin as H,getXYSceneBuilder as G,registerXYPlugin as U,unwrapXYScene as q}from"./c-G5VIJEOK.min.js";import{coerceDateLikeValue as K,parseDateLikeString as J}from"./c-P65V6HLO.min.js";import{resolveNodeColor as Z}from"./c-ORLEBW72.min.js";import{normalizeMarginalConfig as Q}from"./c-QAVFOEUY.min.js";import{buildThresholdLineSegments as ee}from"./c-R2P4RR7Q.min.js";import{DataSourceAdapter as te,IncrementalExtent as ie,buildEnrichAnnotationData as re,resolveAnnotationAccessor as se,snapXYIntroTargets as oe,ticksForMode as ae,toIdSet as ne,xyFrameLegendOptions as le}from"./c-C3TZLTZK.min.js";import{computeDivergingStackExtent as ce,computeStackOffsets as he,normalizeColorGradient as ue,normalizeGradient as de}from"./c-AVO3Q7T7.min.js";import{RingBuffer as pe,applyPulse as ge,compactTimestampBufferForRemoval as ye,createTimestampBufferForData as fe,ensureRingBufferCapacity as me,hasActivePulses as xe,pushWithTimestamp as ve,refreshIdlePulse as be,useSemanticFrameInteractions as we,useXYKeyboardNavigation as ke}from"./c-N3FXLRNT.min.js";import{enrichDatumWithBand as Ae}from"./c-TKG2NP7G.min.js";import{needsInteractionCanvasPaint as _e}from"./c-V4XMSLC3.min.js";import{AXIS_FRAME_DEFAULT_MARGIN as Ce}from"./c-2N7IU2NY.min.js";import{accessorsEquivalent as Pe,resolveAccessor as Se,resolveStringAccessor as Re}from"./c-YLZIV3VS.min.js";import{StalenessBadge as Me,applyDecay as Ye,attachUpdateResultStore as Te,buildDatumIndexMap as De,composeOverlays as Ee,computeDecayOpacity as Oe,filterAnnotationsByStatus as Be,findHitPointInQuadtree as Le,getHitRadius as ze,hitTestRect as Fe,isTimeLandmark as $e,overlayAccessibleDescription as Ne,overlayAccessibleIds as Ie,overlayAccessibleTitle as We,paintCanvasBackground as Xe,paintSceneWithBackend as je,pointToSegmentDistance as Ve,renderSceneWithBackend as He,resolveCanvasBackground as Ge,resolveFrameGraphics as Ue,resolveStaleness as qe,runCustomLayoutAttempt as Ke,shouldHandleFramePointer as Je,useConfigSync as Ze,useLayoutSelectionSync as Qe,useLegendCategoryEmission as et,useStableShallow as tt,useStalenessCheck as it,warnCustomLayoutDiagnostics as rt}from"./c-SGAURYHG.min.js";import{wrapWithCustomLayoutSelection as st}from"./c-YDECTEUW.min.js";import{AccessibleDataTable as ot,AccessibleTablePortal as at,AriaLiveTooltip as nt,CanvasFrameBackground as lt,FlippingTooltip as ct,FocusRing as ht,SVGChartTitle as ut,SceneRevisionDiagnosticsObserver as dt,ScreenReaderSummary as pt,SkipToTableLink as gt,UpdateResultTracker as yt,annotationLayout as ft,buildHoverData as mt,colorStopElements as xt,computeCanvasAriaLabel as vt,computeEasing as bt,computeRawProgress as wt,createDefaultAnnotationRules as kt,defaultTooltipStyle as At,filterSparseArray as _t,getDevicePixelRatio as Ct,getPointerHitRadius as Pt,glyphNodeToSVG as St,isAnnotationActivationTarget as Rt,isServerEnvironment as Mt,lerp as Yt,normalizeLinkedBrush as Tt,now as Dt,numericTickFormatter as Et,observationInputType as Ot,pointOrRectSceneNodeToSVG as Bt,prepareCanvas as Lt,rehitCanvasMarkCursor as zt,renderAnnotationPass as Ft,renderLegendFromConfig as $t,resolveLegendSideGutter as Nt,resolveXYAxes as It,resolveXYAxisChrome as Wt,safeSvgId as Xt,sceneHasAuthoredCursor as jt,sceneMarkCursor as Vt,setCanvasMarkCursor as Ht,smartTooltipEntries as Gt,svgFill as Ut,symbolSceneNodeToSVG as qt,syncCanvasSize as Kt,unlockCrosshair as Jt,useAnnotationActivationOptions as Zt,useBrushSelection as Qt,useCanvasMarkCursorCleanup as ei,useCrosshairPosition as ti,useFrame as ii,useFrameCanvasHost as ri,useHydration as si,useSceneRevisionDiagnostics as oi,useWasHydratingFromSSR as ai,withSceneMarkCursor as ni}from"./c-ODG6TFSY.min.js";import{STREAMING_PALETTE as li,resolveCategoricalPalette as ci,resolveExplicitColor as hi}from"./c-CPV4N35K.min.js";import{resolveThemeSemanticColors as ui}from"./c-JUKIWTBJ.min.js";import{requestsSelectionProvenance as di}from"./c-T2V7O2LO.min.js";import{getCSSColorCacheVersion as pi,glyphHitGeometry as gi,hatchPatternDef as yi,isHatchFill as fi,resolveCurveFactory as mi,subscribeToCanvasFontInvalidation as xi,symbolRadius as vi}from"./c-MB6CV5NC.min.js";import*as bi from"react";import{forwardRef as wi,memo as ki,useCallback as Ai,useEffect as _i,useId as Ci,useMemo as Pi,useRef as Si,useState as Ri}from"react";import*as Mi from"react";import{jsx as Yi}from"react/jsx-runtime";var Ti=null,Di=null,Ei=new Set;import{scaleLinear as Oi,scaleLog as Bi,scaleSymlog as Li,scaleTime as zi}from"d3-scale";var Fi=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],$i=["scene-style","data-paint","accessibility","evidence"],Ni=(e,t)=>({retainedData:e,invalidations:t}),Ii=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Wi=["layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Xi=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],ji=["layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Vi=["scene-geometry","data-paint","accessibility","evidence"],Hi=["scene-style","data-paint","accessibility","evidence"],Gi=[],Ui={chartType:Ni("rebuild",Ii),runtimeMode:Ni("rebuild",Ii),xAccessor:Ni("rebuild",Ii),yAccessor:Ni("rebuild",Ii),timeAccessor:Ni("rebuild",Ii),valueAccessor:Ni("rebuild",Ii),y0Accessor:Ni("rebuild",Ii),boundsAccessor:Ni("rebuild",Ii),band:Ni("rebuild",Ii),openAccessor:Ni("rebuild",Ii),highAccessor:Ni("rebuild",Ii),lowAccessor:Ni("rebuild",Ii),closeAccessor:Ni("rebuild",Ii),candlestickRangeMode:Ni("rebuild",Ii),accessorRevision:Ni("rebuild",Ii),groupAccessor:Ni("rebuild",Wi),categoryAccessor:Ni("rebuild",Wi),lineDataAccessor:Ni("rebuild",Wi),colorAccessor:Ni("rebuild",Hi),sizeAccessor:Ni("rebuild",Vi),symbolAccessor:Ni("rebuild",Vi),pointIdAccessor:Ni("rebuild",Vi),xScaleType:Ni("preserve",Xi),yScaleType:Ni("preserve",Xi),xExtent:Ni("preserve",Xi),invertY:Ni("preserve",Xi),yExtent:Ni("preserve",Xi),extentPadding:Ni("preserve",Xi),scalePadding:Ni("preserve",Xi),axisExtent:Ni("preserve",Xi),yAxisExtent:Ni("preserve",Xi),binSize:Ni("preserve",Xi),normalize:Ni("preserve",Xi),heatmapAggregation:Ni("preserve",Xi),heatmapXBins:Ni("preserve",Xi),heatmapYBins:Ni("preserve",Xi),arrowOfTime:Ni("preserve",ji),baseline:Ni("preserve",ji),stackOrder:Ni("preserve",ji),sizeRange:Ni("preserve",ji),curve:Ni("preserve",ji),areaGroups:Ni("preserve",ji),customLayout:Ni("preserve",ji),layoutConfig:Ni("preserve",ji),layoutMargin:Ni("preserve",ji),symbolMap:Ni("preserve",Vi),showValues:Ni("preserve",Vi),heatmapValueFormat:Ni("preserve",Vi),trackHoverRows:Ni("preserve",Vi),lineStyle:Ni("preserve",Hi),pointStyle:Ni("preserve",Hi),areaStyle:Ni("preserve",Hi),barStyle:Ni("preserve",Hi),swarmStyle:Ni("preserve",Hi),waterfallStyle:Ni("preserve",Hi),candlestickStyle:Ni("preserve",Hi),boundsStyle:Ni("preserve",Hi),gradientFill:Ni("preserve",Hi),lineGradient:Ni("preserve",Hi),semanticLineStops:Ni("preserve",Hi),colorScheme:Ni("preserve",Hi),themeCategorical:Ni("preserve",Hi),themeSemantic:Ni("preserve",Hi),themeSequential:Ni("preserve",Hi),themeDiverging:Ni("preserve",Hi),barColors:Ni("preserve",Hi),decay:Ni("preserve",Hi),pulse:Ni("preserve",Hi),staleness:Ni("preserve",Hi),layoutSelection:Ni("preserve",Hi),annotations:Ni("preserve",["overlay","accessibility","evidence"]),windowSize:Ni("preserve",Gi),windowMode:Ni("preserve",Gi),maxCapacity:Ni("preserve",Gi),clock:Ni("preserve",Gi),transition:Ni("preserve",Gi),introAnimation:Ni("preserve",Gi),onLayoutError:Ni("preserve",Gi)},qi=Ni("preserve",ji),Ki=class{constructor(){this.tracker=new yt}get last(){return this.tracker.last}subscribe(e){return this.tracker.subscribe(e)}recordData(e,t){return this.tracker.record({kind:e,...void 0===t?{}:{count:t}},Fi)}recordNoop(e){return this.tracker.record({kind:e,..."restyle"===e?{}:{count:0}},[])}recordRestyle(e){return e?this.tracker.record({kind:"restyle"},$i):this.recordNoop("restyle")}recordConfig(e,t=!1){let i=function(e){let t="preserve",i=new Set;for(let r of e){let e=Ui[r]??qi;"rebuild"===e.retainedData&&(t="rebuild");for(let t of e.invalidations)i.add(t)}return{retainedData:t,invalidations:i}}(e);return this.tracker.record({kind:"config",keys:e},t?new Set([...i.invalidations,...Vi]):i.invalidations)}};import{quadtree as Ji}from"d3-quadtree";var Zi=class{constructor(){this.maxRadius=0,this.tree=null}get quadtree(){return this.tree}get maxPointRadius(){return this.maxRadius}clear(){this.tree=null,this.maxRadius=0}rebuild(e,t){if("scatter"!==e&&"bubble"!==e&&"custom"!==e)return void this.clear();let i=0,r=0;for(let e of t)"point"===e.type&&!1!==e.interactive&&(i++,e.r>r&&(r=e.r));if(this.maxRadius=r,500>=i)return void(this.tree=null);let s=Array(i),o=0;for(let e of t)"point"===e.type&&!1!==e.interactive&&(s[o++]=e);this.tree=Ji().x(e=>e.x).y(e=>e.y).addAll(s)}},Qi=class e{constructor(e){if(this.xExtent=new ie,this.yExtent=new ie,this.growingCapacityWarned=!1,this.windowSizeWarned=!1,this.resolvedRibbons=[],this.timestampBuffer=null,this.activeTransition=null,this._hasRenderedOnce=!1,this.prevPositionMap=new Map,this.prevPathMap=new Map,this.exitNodes=[],this.lastIngestTime=0,this._colorMapCache=null,this._groupDataCache=null,this._groupColorMap=new Map,this._groupColorCounter=0,this._barCategoryCache=null,this._binBoundaries=[],this._stackExtentCache=null,this._ingestVersion=0,this._datumIndexCache=null,this._bufferArrayCache=null,this._bufferDirty=!0,this.needsFullRebuild=!0,this.lastLayout=null,this.updateResults=new Ki,this.scales=null,this.scene=[],this.version=0,this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customLayoutFailedThisBuild=!1,this._customLayoutDiagnosticsWarned=new Set,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this.xIsDate=!1,this.spatialIndex=new Zi,this._lastBoundedInsertsRef=null,this.applyPulse=(e,t,i)=>!(!this.config.pulse||!this.timestampBuffer)&&ge(this.config.pulse,e,t,this.timestampBuffer,this.getDatumIndexMap(t),i),this.config=e,this.buffer=new pe(e.windowSize),this.growingCap=e.windowSize,["bar","swarm","waterfall"].includes(e.chartType)||"streaming"===e.runtimeMode?(this.getX=Se(e.timeAccessor||e.xAccessor,"time"),this.getY=Se(e.valueAccessor||e.yAccessor,"value")):(this.getX=Se(e.xAccessor,"x"),this.getY=Se(e.yAccessor,"y")),this.getGroup=Re(e.groupAccessor),this.getCategory=Re(e.categoryAccessor),this.getSize=e.sizeAccessor?Se(e.sizeAccessor,"size"):void 0,this.getColor=Re(e.colorAccessor),this.getSymbol=Re(e.symbolAccessor),this.getY0=e.y0Accessor?Se(e.y0Accessor,"y0"):void 0,this.resolvedRibbons=s(e),this.getPointId=Re(e.pointIdAccessor),"candlestick"===e.chartType){let t=null!=e.openAccessor,i=null!=e.closeAccessor;this.getOpen=t?Se(e.openAccessor,"open"):void 0,this.getHigh=Se(e.highAccessor,"high"),this.getLow=Se(e.lowAccessor,"low"),this.getClose=i?Se(e.closeAccessor,"close"):void 0,this.config.candlestickRangeMode=!t&&!i}e.pulse&&(this.timestampBuffer=new pe(e.windowSize))}currentTime(){return this.config.clock?.()??Dt()}syncPulseTimestampBuffer(){this.config.pulse?null!=this.timestampBuffer&&this.timestampBuffer.capacity===this.buffer.capacity&&this.timestampBuffer.size===this.buffer.size||(this.timestampBuffer=fe(this.buffer,this.currentTime())):this.timestampBuffer=null}pushDatumYExtent(e){if("candlestick"===this.config.chartType&&this.getHigh&&this.getLow)return this.yExtent.push(this.getHigh(e)),void this.yExtent.push(this.getLow(e));this.yExtent.push(this.getY(e)),this.getY0&&this.yExtent.push(this.getY0(e));for(let t of this.resolvedRibbons){let i=t.getTop(e),r=t.getBottom(e);Number.isFinite(i)&&this.yExtent.push(i),Number.isFinite(r)&&this.yExtent.push(r)}}evictDatumYExtent(e){if("candlestick"===this.config.chartType&&this.getHigh&&this.getLow)return this.yExtent.evict(this.getHigh(e)),void this.yExtent.evict(this.getLow(e));this.yExtent.evict(this.getY(e)),this.getY0&&this.yExtent.evict(this.getY0(e));for(let t of this.resolvedRibbons){let i=t.getTop(e),r=t.getBottom(e);Number.isFinite(i)&&this.yExtent.evict(i),Number.isFinite(r)&&this.yExtent.evict(r)}}rebuildYExtent(){this.yExtent.clear();for(let e of this.buffer)this.pushDatumYExtent(e)}rebuildExtents(){this.xExtent.clear(),this.yExtent.clear();for(let e of this.buffer)this.xExtent.push(this.getX(e)),this.pushDatumYExtent(e)}ingest(e){if(e.bounded&&this._lastBoundedInsertsRef===e.inserts)return this.updateResults.recordNoop("replace"),!1;let t=this.currentTime();if(this.lastIngestTime=t,this.needsFullRebuild=!0,this._bufferDirty=!0,this._ingestVersion++,e.bounded){this._lastBoundedInsertsRef=e.inserts,this.buffer.clear(),this.xExtent.clear(),this.yExtent.clear(),this.timestampBuffer&&this.timestampBuffer.clear();let i=["bar","swarm","waterfall"].includes(this.config.chartType)||"streaming"===this.config.runtimeMode;if(this.getX=i?Se(this.config.timeAccessor||this.config.xAccessor,"time"):Se(this.config.xAccessor,"x"),this.xIsDate=!1,e.inserts.length>0){let t=e.inserts[0],i=this.config.xAccessor,r="function"==typeof i?i(t):t[i||"x"],s=r instanceof Date,o="string"==typeof r&&Number.isFinite(J(r));if(this.xIsDate=s||o,o){let e="string"==typeof i?i:void 0;this.getX=e?t=>K(t[e]):e=>K(i(e))}}me(this.buffer,e.totalSize||e.inserts.length,this.timestampBuffer);for(let i of e.inserts)ve(this.buffer,i,this.timestampBuffer,t),this.xExtent.push(this.getX(i)),this.pushDatumYExtent(i)}else for(let i of e.inserts){if("growing"===this.config.windowMode&&this.buffer.full){let e=this.config.maxCapacity??1e5;e>this.growingCap&&(this.growingCap=Math.min(2*this.growingCap,e),this.buffer.resize(this.growingCap),this.timestampBuffer&&this.timestampBuffer.resize(this.growingCap),"production"!==process.env.NODE_ENV&&!this.growingCapacityWarned&&this.growingCap>=5e4&&(this.growingCapacityWarned=!0,console.warn(`[Semiotic] Growing window buffer reached ${this.growingCap} points (cap ${e}). Large canvas scenes are expensive — prefer a sliding window, aggregation, or an explicit maxCapacity if this is intentional.`)))}let e=ve(this.buffer,i,this.timestampBuffer,t);this.xExtent.push(this.getX(i)),this.pushDatumYExtent(i),null!=e&&(this.xExtent.evict(this.getX(e)),this.evictDatumYExtent(e))}return this.updateResults.recordData(e.bounded?"replace":"ingest",e.inserts.length),!0}ingestWithResult(e){return this.ingest(e),this.updateResults.last}computeScene(e){let{config:t,buffer:i}=this,r=this.scales,s=this.lastLayout;if(!this.needsFullRebuild&&!t.customLayout&&this.lastLayout&&this.scene.length>0&&this.scales&&0>=(this.config.scalePadding??0)&&(this.lastLayout.width!==e.width||this.lastLayout.height!==e.height))return void this.remapScene(e);this.xExtent.dirty&&this.xExtent.recalculate(i,this.getX),this.yExtent.dirty&&this.rebuildYExtent();let n=this.getBufferArray(),l=this.xExtent.extent,c=this.yExtent.extent,h="waterfall"===t.chartType&&i.size>0?function(e,t,i,r,s){let a=Array.from(new Set(e.map(t).filter(e=>Number.isFinite(e)))).sort((e,t)=>e-t);if(2>a.length)return o(i,r);let n=a[0],l=a[1],c=a[a.length-1],h=a[a.length-2];return o("log"===s&&n>0?[n/Math.sqrt(l/n),c*Math.sqrt(c/h)]:[n-(l-n)/2,c+(c-h)/2],r)}(n,this.getX,l,t.xExtent,t.xScaleType):o(l,t.xExtent),u=o(c,t.yExtent),d=!(!(g=t.yExtent)||null==g[0]||null==g[1]),p="exact"===(t.yAxisExtent??t.axisExtent);var g;if("stackedarea"===t.chartType&&!d&&i.size>0){let e=function(e){let{config:t,groups:i,getX:r,getY:s}=e,o="exact"===(t.yAxisExtent??t.axisExtent);if(t.normalize){let i=[0,o?1:1+t.extentPadding];return{yDomain:i,stackExtentCache:{key:`${e.bufferSize}:${e.ingestVersion}:norm`,yDomain:i}}}let a=`${e.bufferSize}:${e.ingestVersion}:${t.baseline??"zero"}:${t.stackOrder??"key"}`;if(e.stackExtentCache&&e.stackExtentCache.key===a)return{yDomain:e.stackExtentCache.yDomain,stackExtentCache:e.stackExtentCache};let n=new Map,l=new Set,c=0,h=new Map,u=new Map;for(let e of i){let t=new Map,i=0;for(let o of e.data){let e=r(o),a=s(o);if(!Number.isFinite(e)||!Number.isFinite(a))continue;t.set(e,(t.get(e)||0)+a),l.add(e),i+=a;let n=(h.get(e)||0)+a;h.set(e,n),n>c&&(c=n)}n.set(e.key,t),u.set(e.key,i)}let d,p,g=t.stackOrder??"key",y=(e,t)=>t>e?-1:e>t?1:0;if("input"===g)d=i.map(e=>e.key);else if("insideOut"===g){let e=[...i].map(e=>e.key).sort((e,t)=>{let i=(u.get(t)??0)-(u.get(e)??0);return 0!==i?i:y(e,t)}),t=[],r=[],s=0,o=0;for(let i of e)o>s?(t.push(i),s+=u.get(i)??0):(r.push(i),o+=u.get(i)??0);d=[...r.reverse(),...t]}else d="asc"===g?i.map(e=>e.key).sort((e,t)=>{let i=(u.get(e)??0)-(u.get(t)??0);return 0!==i?i:y(e,t)}):"desc"===g?i.map(e=>e.key).sort((e,t)=>{let i=(u.get(t)??0)-(u.get(e)??0);return 0!==i?i:y(e,t)}):i.map(e=>e.key).sort(y);if("wiggle"===t.baseline||"silhouette"===t.baseline){let e=Array.from(l).sort((e,t)=>e-t),i=he(e,d,(e,t)=>n.get(e)?.get(t)||0,t.baseline),r=1/0,s=-1/0;for(let t of e){let e=i.get(t)??0,o=h.get(t)??0;r>e&&(r=e),e+o>s&&(s=e+o)}(!Number.isFinite(r)||!Number.isFinite(s))&&(r=0,s=0);let a=s-r,c=o?0:a>0?a*t.extentPadding:1;p=[r-c,s+c]}else if("diverging"===t.baseline){let e=Array.from(l).sort((e,t)=>e-t),[i,r]=ce(e,d,(e,t)=>n.get(e)?.get(t)||0),s=r-i,a=o?0:s>0?s*t.extentPadding:1;p=[i-a,r+a]}else p=[0,c+(o?0:c>0?c*t.extentPadding:1)];return{yDomain:p,stackExtentCache:{key:a,yDomain:p}}}({config:t,groups:this.groupData(n),getX:this.getX,getY:this.getY,bufferSize:i.size,ingestVersion:this._ingestVersion,stackExtentCache:this._stackExtentCache});u=e.yDomain,this._stackExtentCache=e.stackExtentCache}else"bar"===t.chartType&&t.binSize&&!d&&i.size>0?u=function(e,t,i,r,s,o,a){let[,n]=j(e,t,i,r,s);return[0,a?n:n+n*o]}(i,this.getX,this.getY,t.binSize,this.getCategory,t.extentPadding,p):"waterfall"===t.chartType&&!d&&i.size>0?u=function(e,t,i,r){let[s,o]=function(e,t){let i=0,r=0,s=0;for(let o of e){let e=t(o);null==e||Number.isNaN(e)||(s+=e,i>s&&(i=s),s>r&&(r=s))}return[i,r]}(e,t),a=o-s,n=r?0:a>0?a*i:1;return[Math.min(0,s-Math.abs(n)),Math.max(0,o+Math.abs(n))]}(i,this.getY,t.extentPadding,p):!d&&u[0]!==1/0&&(u=function(e,t,i){if(!i.length)return e;let[r,s]=e;for(let e of t)for(let t of i){let i=t.getTop(e),o=t.getBottom(e);Number.isFinite(i)&&(r>i&&(r=i),i>s&&(s=i)),Number.isFinite(o)&&(r>o&&(r=o),o>s&&(s=o))}return[r,s]}(u,n,this.resolvedRibbons),u=function(e,t){let i=e[1]-e[0],r=t.exactMode?0:i>0?i*t.extentPadding:1,s=[null!=t.userMin?e[0]:e[0]-r,null!=t.userMax?e[1]:e[1]+r];return"log"!==t.yScaleType||s[0]>0||0>=t.dataYDomain[0]||t.exactMode||null==t.userMin&&(s[0]=t.dataYDomain[0]/(1+t.extentPadding)),s}(u,{exactMode:p,extentPadding:t.extentPadding,userMin:t.yExtent?.[0],userMax:t.yExtent?.[1],yScaleType:t.yScaleType,dataYDomain:c}));u=function(e,t,i){if(!t||i)return e;let r=t[0],s=t[1];return null==r&&null==s?e:[r??e[0],s??e[1]]}(u,t.yExtent,!!d),({xDomain:h,yDomain:u}=function(e,t,i){let r=e,s=t;if(r[0]===1/0||r[1]===-1/0)if("time"===i){let e=Date.now();r=[e-864e5,e]}else r=[0,1];return(s[0]===1/0||s[1]===-1/0)&&(s=[0,1]),{xDomain:r,yDomain:s}}(h,u,t.xScaleType)),this.scales=function(e){let{config:t,layout:i,xDomain:r}=e,s=t.invertY?[e.yDomain[1],e.yDomain[0]]:e.yDomain,o="streaming"===t.runtimeMode,n=Math.max(0,Math.min(t.scalePadding||0,Math.min(i.width,i.height)/2-1));if(o){let e="left"===t.arrowOfTime?[i.width-n,n]:[n,i.width-n];return{x:Oi().domain(r).range(e),y:a(t.yScaleType,s,[i.height-n,n])}}return{x:a(t.xScaleType,r,[n,i.width-n]),y:a(t.yScaleType,s,[i.height-n,n])}}({config:t,layout:e,xDomain:h,yDomain:u}),this._customLayoutFailedThisBuild=!1;let y=this.buildSceneNodes(e,n);if(this._customLayoutFailedThisBuild)return!0===this.lastCustomLayoutFailure?.preservedLastGoodScene?(this.scales=r,this.lastLayout=s):(this.scene=[],this.spatialIndex.rebuild(this.config.chartType,this.scene)),void(this.needsFullRebuild=!0);this.config.transition&&this.scene.length>0&&this.snapshotPositions(),this.scene=y,this.config.decay&&this.applyDecay(this.scene,n),this.config.pulse&&this.applyPulse(this.scene,n,this.currentTime()),this.config.transition&&!this._hasRenderedOnce&&this.scene.length>0&&(this.config.introAnimation&&this.synthesizeIntroPositions(),this._hasRenderedOnce=!0),this.config.transition&&(this.prevPositionMap.size>0||this.prevPathMap.size>0)&&this.startTransition(),this.spatialIndex.rebuild(this.config.chartType,this.scene),this.needsFullRebuild=!1,this.lastLayout={width:e.width,height:e.height},this.version++}get quadtree(){return this.spatialIndex.quadtree}get maxPointRadius(){return this.spatialIndex.maxPointRadius}remapScene(e){let t=e.width/this.lastLayout.width,i=e.height/this.lastLayout.height;for(let e of this.scene)switch(e.type){case"line":for(let r of e.path)r[0]*=t,r[1]*=i;break;case"area":for(let r of e.topPath)r[0]*=t,r[1]*=i;for(let r of e.bottomPath)r[0]*=t,r[1]*=i;e.clipRect&&(e.clipRect={x:e.clipRect.x*t,y:e.clipRect.y*i,width:e.clipRect.width*t,height:e.clipRect.height*i}),e.strokeColorBands&&(e.strokeColorBands=e.strokeColorBands.map(e=>({...e,y:e.y*i,height:e.height*i})));break;case"point":case"glyph":e.x*=t,e.y*=i;break;case"rect":case"heatcell":e.x*=t,e.y*=i,e.w*=t,e.h*=i;break;case"candlestick":e.x*=t,e.openY*=i,e.closeY*=i,e.highY*=i,e.lowY*=i}let r=this.scales.x.domain(),s=this.scales.y.domain(),o=this.scales.x.range(),n=this.scales.y.range(),l=a,c=Math.max(0,Math.min(this.config.scalePadding||0,Math.min(e.width,e.height)/2-1)),h=n[1]>n[0];this.scales={x:l(this.config.xScaleType,r,o[0]>o[1]?[e.width-c,c]:[c,e.width-c]),y:l(this.config.yScaleType,s,h?[c,e.height-c]:[e.height-c,c])},this.lastLayout={width:e.width,height:e.height},this.spatialIndex.rebuild(this.config.chartType,this.scene),this.version++}buildSceneNodes(e,t){let{config:i,scales:r}=this;if(!r)return[];if(i.customLayout){let s={data:t,scales:r,dimensions:{width:e.width,height:e.height,margin:i.layoutMargin??{top:0,right:0,bottom:0,left:0},plot:{x:0,y:0,width:e.width,height:e.height}},theme:{semantic:i.themeSemantic??{},categorical:i.themeCategorical??li},resolveColor:(e,t)=>{let r=this.resolveGroupColor(e);if(r)return r;let s=this.resolveLineStyle(e,t);return s.stroke?s.stroke:"string"==typeof s.fill?s.fill:i.themeSemantic?.primary??"#4e79a7"},config:i.layoutConfig??{},selection:i.layoutSelection??null},o=Ke({family:"xy",logLabel:"customLayout",revision:this.version,hasPreviousResult:null!==this.lastCustomLayoutResult,onLayoutError:i.onLayoutError,run:()=>i.customLayout(s)});if("failure"===o.kind)return this.lastCustomLayoutFailure=o.diagnostic,this._customLayoutFailedThisBuild=!0,o.preservedLastGoodScene?this.scene:(this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,[]);let a=o.result;this.customLayoutOverlays=a.overlays??null,this.lastCustomLayoutResult=a,this.lastCustomLayoutFailure=null;let n=a.nodes??[];if(this._customRestyle=a.restyle,this.hasCustomRestyle=!!a.restyle,this.hasCustomRestyle){this._baseStyles=new WeakMap;for(let e of n)e.style&&this._baseStyles.set(e,e.style);this.applyCustomRestyle(n,i.layoutSelection??null)}return rt({label:"customLayout",nodes:n,overlays:this.customLayoutOverlays,warned:this._customLayoutDiagnosticsWarned}),n}if(this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,0===t.length)return[];let s={scales:r,config:i,getX:this.getX,getY:this.getY,getY0:this.getY0,getSize:this.getSize,getColor:this.getColor,getSymbol:this.getSymbol,getGroup:this.getGroup,getCategory:this.getCategory,getPointId:this.getPointId,ribbons:this.resolvedRibbons,getOpen:this.getOpen,getHigh:this.getHigh,getLow:this.getLow,getClose:this.getClose,resolveLineStyle:(e,t)=>this.resolveLineStyle(e,t),resolveAreaStyle:(e,t)=>this.resolveAreaStyle(e,t),resolveBoundsStyle:(e,t)=>this.resolveBoundsStyle(e,t),resolveColorMap:e=>this.resolveColorMap(e),resolveGroupColor:e=>this.resolveGroupColor(e),groupData:e=>this.groupData(e),barCategoryCache:this._barCategoryCache},o=G(i.chartType);if(!o)return H(a=i.chartType)||Mt&&(Ei.has(a)||(Ei.add(a),console.warn(`[semiotic] StreamXYFrame: no XY plugin registered for "${a}" during SSR. Import a chart HOC, or call registerBuiltInXYPlugins() from "semiotic/xy" or "semiotic/realtime/core" before render.`))),[];var a;let n=q(o(s,t,e));return"bar"===i.chartType&&(this._barCategoryCache=s.barCategoryCache??null,this._binBoundaries=n.binBoundaries),n.nodes}resolveBoundsStyle(e,t){return function(e,t,i,r){let s=e.boundsStyle;if("function"==typeof s)return s(i||{},t);if(s&&"object"==typeof s)return s;let o=r(t,i);return{fill:o.stroke||e.themeSemantic?.primary||"#4e79a7",fillOpacity:.2,...null!=o.opacity&&{opacity:o.opacity},stroke:"none",cursor:o.cursor}}(this.config,e,t,(e,t)=>this.resolveLineStyle(e,t))}computeDecayOpacity(e,t){let i=this.config.decay;return i&&t>1?Oe(i,e,t):1}getDatumIndexMap(e){if(this._datumIndexCache&&this._datumIndexCache.version===this._ingestVersion)return this._datumIndexCache.map;let t=De(e);return this._datumIndexCache={version:this._ingestVersion,map:t},t}applyDecay(e,t){this.config.decay&&Ye(this.config.decay,e,t,this.getDatumIndexMap(t))}refreshPulse(e){return!0!==this.lastCustomLayoutFailure?.preservedLastGoodScene&&this.applyPulse(this.scene,this.getBufferArray(),e)}hasActivePulsesAt(e){return!!this.config.pulse&&xe(this.config.pulse,this.timestampBuffer,e)}get hasActivePulses(){return this.hasActivePulsesAt(this.currentTime())}get transitionContext(){return{runtimeMode:this.config.runtimeMode,getX:this.getX,getY:this.getY,getCategory:this.getCategory}}snapshotPositions(){!function(e,r,s,o){s.clear(),o.clear();for(let a=0;r.length>a;a++){let n=r[a],l=t(e,n,a);l&&("point"===n.type?s.set(l,{x:n.x,y:n.y,r:n.r,opacity:i(n.style)}):"glyph"===n.type?s.set(l,{x:n.x,y:n.y,r:n.size,opacity:i(n.style),glyph:n.glyph}):"rect"===n.type||"heatcell"===n.type?s.set(l,{x:n.x,y:n.y,w:n.w,h:n.h,opacity:i(n.style)}):"candlestick"===n.type?s.set(l,{x:n.x,y:n.openY,w:n.bodyWidth,openY:n.openY,closeY:n.closeY,highY:n.highY,lowY:n.lowY,opacity:i(n.style)}):"line"===n.type?o.set(l,{path:n.path.map(e=>[e[0],e[1]]),opacity:n.style?.opacity}):"area"===n.type&&o.set(l,{topPath:n.topPath.map(e=>[e[0],e[1]]),bottomPath:n.bottomPath.map(e=>[e[0],e[1]]),opacity:n.style?.opacity}))}}(this.transitionContext,this.scene,this.prevPositionMap,this.prevPathMap)}synthesizeIntroPositions(){this.prevPositionMap.clear(),this.prevPathMap.clear();let e=this.scales?.y(0)??0;for(let i=0;this.scene.length>i;i++){let r=this.scene[i],s=t(this.transitionContext,r,i);s&&("point"===r.type?this.prevPositionMap.set(s,{x:r.x,y:r.y,r:0,opacity:0}):"rect"===r.type?this.prevPositionMap.set(s,{x:r.x,y:e,w:r.w,h:0,opacity:r.style.opacity??1}):"heatcell"===r.type?this.prevPositionMap.set(s,{x:r.x,y:r.y,w:r.w,h:r.h,opacity:0}):"line"===r.type?(r._introClipFraction=0,this.prevPathMap.set(s,{path:r.path.map(e=>[e[0],e[1]]),opacity:r.style.opacity})):"area"===r.type&&(r._introClipFraction=0,this.prevPathMap.set(s,{topPath:r.topPath.map(e=>[e[0],e[1]]),bottomPath:r.bottomPath.map(e=>[e[0],e[1]]),opacity:r.style.opacity})))}}startTransition(){if(!this.config.transition)return;let e=function(e,r,s,o,a,n=Dt()){if(0===o.size&&0===a.size)return s;let l=r.duration??300;if(s.exitNodes.length>0){let e=new Set(s.exitNodes);s.scene=s.scene.filter(t=>!e.has(t)),s.exitNodes=[]}let c=!1,h=new Set,u=new Set;for(let r=0;s.scene.length>r;r++){let n=s.scene[r],l=t(e,n,r);if(!l)continue;if(n._transitionKey=l,"line"===n.type||"area"===n.type){let e=a.get(l);if(e){if(u.add(l),"line"===n.type&&e.path&&e.path.length===n.path.length){n._targetPath=n.path.map(e=>[e[0],e[1]]),n._prevPath=e.path;for(let t=0;n.path.length>t;t++)n.path[t]=[e.path[t][0],e.path[t][1]];c=!0}else if("area"===n.type&&e.topPath&&e.bottomPath&&e.topPath.length===n.topPath.length&&e.bottomPath.length===n.bottomPath.length){n._targetTopPath=n.topPath.map(e=>[e[0],e[1]]),n._targetBottomPath=n.bottomPath.map(e=>[e[0],e[1]]),n._prevTopPath=e.topPath,n._prevBottomPath=e.bottomPath;for(let t=0;n.topPath.length>t;t++)n.topPath[t]=[e.topPath[t][0],e.topPath[t][1]];for(let t=0;n.bottomPath.length>t;t++)n.bottomPath[t]=[e.bottomPath[t][0],e.bottomPath[t][1]];c=!0}n._targetOpacity=n.style.opacity??1,n._startOpacity=e.opacity??n.style.opacity??1}else n._targetOpacity=n.style.opacity??1,n._startOpacity=0,n.style={...n.style,opacity:0},c=!0;continue}let d=o.get(l);if("point"===n.type)if(d){h.add(l);let e={x:n.x,y:n.y,r:n.r};n._targetOpacity=i(n.style),(d.x!==e.x||d.y!==e.y||d.r!==e.r)&&(n._targetX=e.x,n._targetY=e.y,n._targetR=e.r,n.x=d.x,n.y=d.y,n.r=d.r??n.r,c=!0)}else n._targetOpacity=i(n.style),n.style={...n.style,opacity:0},c=!0;else if("glyph"===n.type)if(d){h.add(l);let e={x:n.x,y:n.y,size:n.size};n._targetOpacity=i(n.style),(d.x!==e.x||d.y!==e.y||d.r!==e.size)&&(n._targetX=e.x,n._targetY=e.y,n._targetR=e.size,n.x=d.x,n.y=d.y,n.size=d.r??n.size,c=!0)}else n._targetOpacity=i(n.style),n.style={...n.style,opacity:0},c=!0;else if("rect"===n.type)if(d){h.add(l);let e={x:n.x,y:n.y,w:n.w,h:n.h};n._targetOpacity=i(n.style),(d.x!==e.x||d.y!==e.y||d.w!==e.w||d.h!==e.h)&&(n._targetX=e.x,n._targetY=e.y,n._targetW=e.w,n._targetH=e.h,n.x=d.x,n.y=d.y,n.w=d.w??n.w,n.h=d.h??n.h,c=!0)}else n._targetOpacity=i(n.style),n.style={...n.style,opacity:0},c=!0;else if("heatcell"===n.type)if(d){h.add(l);let e={x:n.x,y:n.y,w:n.w,h:n.h};n._targetOpacity=i(n.style),(d.x!==e.x||d.y!==e.y||d.w!==e.w||d.h!==e.h)&&(n._targetX=e.x,n._targetY=e.y,n._targetW=e.w,n._targetH=e.h,n.x=d.x,n.y=d.y,n.w=d.w??n.w,n.h=d.h??n.h,c=!0)}else n._targetOpacity=i(n.style),n.style={...n.style||{},opacity:0},c=!0;else if("candlestick"===n.type)if(d&&null!=d.openY){h.add(l);let e={x:n.x,openY:n.openY,closeY:n.closeY,highY:n.highY,lowY:n.lowY};n._targetOpacity=i(n.style),(d.x!==e.x||d.openY!==e.openY||d.closeY!==e.closeY||d.highY!==e.highY||d.lowY!==e.lowY)&&(n._targetX=e.x,n._targetOpenY=e.openY,n._targetCloseY=e.closeY,n._targetHighY=e.highY,n._targetLowY=e.lowY,n.x=d.x,n.openY=d.openY,n.closeY=d.closeY??n.closeY,n.highY=d.highY??n.highY,n.lowY=d.lowY??n.lowY,c=!0)}else n._targetOpacity=i(n.style),n.style={...n.style||{},opacity:0},c=!0}for(let[e,t]of a)if(!u.has(e))if(e.startsWith("l:")&&t.path){let i={type:"line",path:t.path.map(e=>[e[0],e[1]]),group:e.slice(2),style:{stroke:"#999",strokeWidth:1,opacity:t.opacity??1},_targetOpacity:0,_transitionKey:e,datum:null};s.exitNodes.push(i),c=!0}else if(e.startsWith("a:")&&t.topPath&&t.bottomPath){let i={type:"area",topPath:t.topPath.map(e=>[e[0],e[1]]),bottomPath:t.bottomPath.map(e=>[e[0],e[1]]),group:e.slice(2),style:{fill:"#999",opacity:t.opacity??1},_targetOpacity:0,_transitionKey:e,datum:null};s.exitNodes.push(i),c=!0}for(let[e,t]of o)if(!h.has(e)){if(e.startsWith("p:"))s.exitNodes.push({type:"point",x:t.x,y:t.y,r:t.r??3,style:{opacity:t.opacity??1},datum:null,_targetOpacity:0,_transitionKey:e});else if(e.startsWith("g:")&&t.glyph)s.exitNodes.push({type:"glyph",x:t.x,y:t.y,size:t.r??12,glyph:t.glyph,color:"#999",accent:"#999",style:{opacity:t.opacity??1},datum:null,_targetOpacity:0,_transitionKey:e});else if(e.startsWith("r:"))s.exitNodes.push({type:"rect",x:t.x,y:t.y,w:t.w??0,h:t.h??0,style:{opacity:t.opacity??1,fill:"#999"},datum:null,_targetOpacity:0,_transitionKey:e});else if(e.startsWith("h:"))s.exitNodes.push({type:"heatcell",x:t.x,y:t.y,w:t.w??0,h:t.h??0,fill:"#999",datum:null,style:{opacity:t.opacity??1},_targetOpacity:0,_transitionKey:e});else if(e.startsWith("c:")){let i=t.openY??t.y;s.exitNodes.push({type:"candlestick",x:t.x,openY:i,closeY:t.closeY??i,highY:t.highY??i,lowY:t.lowY??i,bodyWidth:t.w??6,upColor:"#999",downColor:"#999",wickColor:"#999",wickWidth:1,isUp:!0,datum:null,style:{opacity:t.opacity??1},_targetOpacity:0,_transitionKey:e})}c=!0}return s.exitNodes.length>0&&(s.scene=[...s.scene,...s.exitNodes]),c&&(s.activeTransition={startTime:n,duration:l}),s}(this.transitionContext,this.config.transition,{scene:this.scene,exitNodes:this.exitNodes,activeTransition:this.activeTransition},this.prevPositionMap,this.prevPathMap,this.currentTime());this.scene=e.scene,this.exitNodes=e.exitNodes,this.activeTransition=e.activeTransition}advanceTransition(e){if(!this.activeTransition||!this.config.transition)return!1;let t={scene:this.scene,exitNodes:this.exitNodes,activeTransition:this.activeTransition},i=function(e,t,i,r){if(!i.activeTransition)return!1;let s=wt(e,i.activeTransition),o=bt(s,"linear"===t.easing?"linear":"ease-out-cubic");for(let e of i.scene){let t=e._transitionKey;if("point"===e.type){if(void 0!==e._targetOpacity){let i=t?r.get(t):void 0;e.style.opacity=Yt(i?i.opacity??1:0,e._targetOpacity,o)}if(void 0===e._targetX||!t)continue;let i=r.get(t);if(!i)continue;e.x=Yt(i.x,e._targetX,o),e.y=Yt(i.y,e._targetY,o),void 0!==e._targetR&&void 0!==i.r&&(e.r=Yt(i.r,e._targetR,o))}else if("glyph"===e.type){if(void 0!==e._targetOpacity){let i=t?r.get(t):void 0;e.style.opacity=Yt(i?i.opacity??1:0,e._targetOpacity,o)}if(void 0===e._targetX||!t)continue;let i=r.get(t);if(!i)continue;e.x=Yt(i.x,e._targetX,o),e.y=Yt(i.y,e._targetY,o),void 0!==e._targetR&&void 0!==i.r&&(e.size=Yt(i.r,e._targetR,o))}else if("rect"===e.type){if(void 0!==e._targetOpacity){let i=t?r.get(t):void 0;e.style.opacity=Yt(i?i.opacity??1:0,e._targetOpacity,o)}if(void 0===e._targetX||!t)continue;let i=r.get(t);if(!i)continue;e.x=Yt(i.x,e._targetX,o),e.y=Yt(i.y,e._targetY,o),void 0!==i.w&&(e.w=Yt(i.w,e._targetW,o)),void 0!==i.h&&(e.h=Yt(i.h,e._targetH,o))}else if("heatcell"===e.type){if(void 0!==e._targetOpacity){let i=t?r.get(t):void 0;e.style={...e.style||{},opacity:Yt(i?i.opacity??1:0,e._targetOpacity,o)}}if(void 0===e._targetX||!t)continue;let i=r.get(t);if(!i)continue;e.x=Yt(i.x,e._targetX,o),e.y=Yt(i.y,e._targetY,o),void 0!==i.w&&(e.w=Yt(i.w,e._targetW,o)),void 0!==i.h&&(e.h=Yt(i.h,e._targetH,o))}else if("candlestick"===e.type){if(void 0!==e._targetOpacity){let i=t?r.get(t):void 0;e.style={...e.style||{},opacity:Yt(i?i.opacity??1:0,e._targetOpacity,o)}}if(void 0===e._targetX||!t)continue;let i=r.get(t);if(!i)continue;e.x=Yt(i.x,e._targetX,o),void 0!==i.openY&&(e.openY=Yt(i.openY,e._targetOpenY,o)),void 0!==i.closeY&&(e.closeY=Yt(i.closeY,e._targetCloseY,o)),void 0!==i.highY&&(e.highY=Yt(i.highY,e._targetHighY,o)),void 0!==i.lowY&&(e.lowY=Yt(i.lowY,e._targetLowY,o))}else if("line"===e.type){void 0!==e._targetOpacity&&(e.style={...e.style,opacity:Yt(e._startOpacity??0,e._targetOpacity,o)}),void 0!==e._introClipFraction&&(e._introClipFraction=o);let t=e._prevPath,i=e._targetPath;if(t&&i&&t.length===e.path.length)for(let r=0;e.path.length>r;r++)e.path[r][0]=Yt(t[r][0],i[r][0],o),e.path[r][1]=Yt(t[r][1],i[r][1],o)}else if("area"===e.type){void 0!==e._targetOpacity&&(e.style={...e.style,opacity:Yt(e._startOpacity??0,e._targetOpacity,o)}),void 0!==e._introClipFraction&&(e._introClipFraction=o);let t=e._prevTopPath,i=e._prevBottomPath,r=e._targetTopPath,s=e._targetBottomPath;if(t&&r&&t.length===e.topPath.length)for(let i=0;e.topPath.length>i;i++)e.topPath[i][0]=Yt(t[i][0],r[i][0],o),e.topPath[i][1]=Yt(t[i][1],r[i][1],o);if(i&&s&&i.length===e.bottomPath.length)for(let t=0;e.bottomPath.length>t;t++)e.bottomPath[t][0]=Yt(i[t][0],s[t][0],o),e.bottomPath[t][1]=Yt(i[t][1],s[t][1],o)}}if(s>=1){for(let e of i.scene){if(void 0!==e._targetOpacity){let t=e._targetOpacity;e.style="line"===e.type||"area"===e.type?{...e.style,opacity:0===t?0:t}:{...e.style||{},opacity:0===t?0:t},e._targetOpacity=void 0}if("point"===e.type){if(void 0===e._targetX)continue;e.x=e._targetX,e.y=e._targetY,void 0!==e._targetR&&(e.r=e._targetR),e._targetX=void 0,e._targetY=void 0,e._targetR=void 0}else if("glyph"===e.type){if(void 0===e._targetX)continue;e.x=e._targetX,e.y=e._targetY,void 0!==e._targetR&&(e.size=e._targetR),e._targetX=void 0,e._targetY=void 0,e._targetR=void 0}else if("rect"===e.type){if(void 0===e._targetX)continue;e.x=e._targetX,e.y=e._targetY,e.w=e._targetW,e.h=e._targetH,e._targetX=void 0,e._targetY=void 0,e._targetW=void 0,e._targetH=void 0}else if("heatcell"===e.type){if(void 0===e._targetX)continue;e.x=e._targetX,e.y=e._targetY,e.w=e._targetW,e.h=e._targetH,e._targetX=void 0,e._targetY=void 0,e._targetW=void 0,e._targetH=void 0}else if("candlestick"===e.type){if(void 0===e._targetX)continue;e.x=e._targetX,void 0!==e._targetOpenY&&(e.openY=e._targetOpenY),void 0!==e._targetCloseY&&(e.closeY=e._targetCloseY),void 0!==e._targetHighY&&(e.highY=e._targetHighY),void 0!==e._targetLowY&&(e.lowY=e._targetLowY),e._targetX=void 0,e._targetOpenY=void 0,e._targetCloseY=void 0,e._targetHighY=void 0,e._targetLowY=void 0}else if("line"===e.type){let t=e._targetPath;if(t)for(let i=0;e.path.length>i;i++)e.path[i]=t[i];e._prevPath=void 0,e._targetPath=void 0,e._introClipFraction=void 0}else if("area"===e.type){let t=e._targetTopPath,i=e._targetBottomPath;if(t)for(let i=0;e.topPath.length>i;i++)e.topPath[i]=t[i];if(i)for(let t=0;e.bottomPath.length>t;t++)e.bottomPath[t]=i[t];e._prevTopPath=void 0,e._prevBottomPath=void 0,e._targetTopPath=void 0,e._targetBottomPath=void 0,e._introClipFraction=void 0}}if(i.exitNodes.length>0){let e=new Set(i.exitNodes);i.scene=i.scene.filter(t=>!e.has(t)),i.exitNodes=[]}return i.activeTransition=null,!1}return!0}(e,this.config.transition,t,this.prevPositionMap);return this.scene=t.scene,this.exitNodes=t.exitNodes,this.activeTransition=t.activeTransition,i}cancelIntroAnimation(){this.prevPositionMap.clear(),this.prevPathMap.clear(),this.activeTransition=null,oe(this.scene),this.exitNodes=[]}groupData(e){let{result:t,cache:i}=function(e,t,i,r){if(r&&r.version===i&&r.group===t&&r.data===e)return{result:r.result,cache:r};let s;if(t){let i=new Map;for(let r of e){let e=t(r);i.has(e)||i.set(e,[]),i.get(e).push(r)}s=Array.from(i.entries()).map(([e,t])=>({key:e,data:t}))}else s=[{key:"_default",data:e}];return{result:s,cache:{version:i,group:t,data:e,result:s}}}(e,this.getGroup,this._ingestVersion,this._groupDataCache);return this._groupDataCache=i,t}resolveColorMap(e){let{map:t,cache:i}=function(e,t,i,r,s){if(s&&s.version===r)return{map:s.map,cache:s};let o=new Set;if(t)for(let i of e){let e=t(i);e&&o.add(e)}let a=Array.from(o).sort(),l=a.join("\0");if(s&&s.key===l){let e={...s,version:r};return{map:e.map,cache:e}}let c=ci(i.colorScheme,i.themeCategorical,li),h=new Map;for(let e=0;a.length>e;e++)h.set(a[e],n(i.colorScheme,a[e])??c[e%c.length]);return{map:h,cache:{key:l,map:h,version:r}}}(e,this.getColor,this.config,this._ingestVersion,this._colorMapCache);return this._colorMapCache=i,t}resolveLineStyle(e,t){return function(e,t,i,r){let s=e.lineStyle;if("function"==typeof s){let e=s(i||{},t);if(e&&!e.stroke&&t){let i=r(t);if(i)return{...e,stroke:i}}return e}let o=e.themeSemantic?.primary;return s&&"object"==typeof s?{stroke:s.stroke||o||"#007bff",strokeWidth:s.strokeWidth??2,strokeDasharray:s.strokeDasharray,fill:s.fill,fillOpacity:s.fillOpacity,opacity:s.opacity,cursor:s.cursor}:{stroke:r(t)||o||"#007bff",strokeWidth:2}}(this.config,e,t,e=>this.resolveGroupColor(e))}resolveAreaStyle(e,t){return function(e,t,i,r){if(e.areaStyle){let s=e.areaStyle(i||{});if(s&&!s.fill&&t){let e=r(t);if(e)return{...s,fill:e,stroke:s.stroke||e}}return s}let s=e.lineStyle;if("function"==typeof s){let e=s(i||{},t);if(e&&!e.fill&&t){let i=r(t);if(i)return{...e,fill:i,stroke:e.stroke||i}}return e}let o=e.themeSemantic?.primary;if(s&&"object"==typeof s)return{fill:s.fill||s.stroke||o||"#4e79a7",fillOpacity:s.fillOpacity??.7,stroke:s.stroke||o||"#4e79a7",strokeWidth:s.strokeWidth??2,cursor:s.cursor};let a=r(t)||o||"#4e79a7";return{fill:a,fillOpacity:.7,stroke:a,strokeWidth:2}}(this.config,e,t,e=>this.resolveGroupColor(e))}resolveGroupColor(t){let{color:i,groupColorCounter:r}=function(e){let{group:t,colorMapCache:i,groupColorMap:r,groupColorMapCap:s,config:o}=e,{groupColorCounter:a}=e,l=n(o.colorScheme,t);if(l)return{color:l,groupColorCounter:a};if(i){let e=i.map.get(t);if(e)return{color:e,groupColorCounter:a}}let c=r.get(t);if(c)return{color:c,groupColorCounter:a};let h=ci(o.colorScheme,o.themeCategorical,li);if(0===h.length)return{color:null,groupColorCounter:a};let u=h[a%h.length];if(a++,r.set(t,u),r.size>s){let e=r.keys().next().value;void 0!==e&&r.delete(e)}return{color:u,groupColorCounter:a}}({group:t,colorMapCache:this._colorMapCache,groupColorMap:this._groupColorMap,groupColorCounter:this._groupColorCounter,groupColorMapCap:e.GROUP_COLOR_MAP_CAP,config:this.config});return this._groupColorCounter=r,i}getBufferArray(){return(this._bufferDirty||!this._bufferArrayCache)&&(this._bufferArrayCache=this.buffer.toArray(),this._bufferDirty=!1),this._bufferArrayCache}getData(){return this.getBufferArray()}remove(e){if(!this.getPointId)throw Error("remove() requires pointIdAccessor to be configured");this.config.transition&&this.scene.length>0&&this.snapshotPositions();let t=ne(e),i=this.getPointId,r=e=>t.has(i(e));ye(this.buffer,this.timestampBuffer,r);let s=this.buffer.remove(r);if(0===s.length)return this.updateResults.recordNoop("remove"),s;for(let e of s)this.xExtent.evict(this.getX(e)),this.evictDatumYExtent(e);return this.needsFullRebuild=!0,this._bufferDirty=!0,this._ingestVersion++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("remove",s.length),s}update(e,t){if(!this.getPointId)throw Error("update() requires pointIdAccessor to be configured");let i=ne(e),r=this.getPointId,s=new Set;this.buffer.forEach((e,t)=>{i.has(r(e))&&s.add(t)});let o=this.buffer.update(e=>i.has(r(e)),t);if(0===o.length)return this.updateResults.recordNoop("update"),o;for(let e of o)this.xExtent.evict(this.getX(e)),this.evictDatumYExtent(e);return this.buffer.forEach((e,t)=>{s.has(t)&&(this.xExtent.push(this.getX(e)),this.pushDatumYExtent(e))}),this.needsFullRebuild=!0,this._bufferDirty=!0,this._ingestVersion++,this.lastIngestTime=this.currentTime(),this.updateResults.recordData("update",o.length),o}getBinBoundaries(){return this._binBoundaries}getExtents(){return this.xExtent.min===1/0?null:{x:this.xExtent.extent,y:this.yExtent.extent}}clear(){this.buffer.clear(),this.xExtent.clear(),this.yExtent.clear(),this._hasRenderedOnce=!1,this.timestampBuffer&&this.timestampBuffer.clear(),this.prevPositionMap.clear(),this.prevPathMap.clear(),this.exitNodes=[],this.activeTransition=null,this.lastIngestTime=0,this._lastBoundedInsertsRef=null,this.needsFullRebuild=!0,this._bufferDirty=!0,this._bufferArrayCache=null,this._datumIndexCache=null,this.lastLayout=null,this.scales=null,this.scene=[],this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this.spatialIndex.clear(),this._colorMapCache=null,this._groupDataCache=null,this._groupColorMap=new Map,this._groupColorCounter=0,this._barCategoryCache=null,this._binBoundaries=[],this._stackExtentCache=null,this.version++,this.updateResults.recordData("clear")}get size(){return this.buffer.size}getBuffer(){return this.buffer}getXAccessor(){return this.getX}getYAccessor(){return this.getY}getCategoryAccessor(){return this.getCategory}applyCustomRestyle(e,t){let i=this._customRestyle;if(i)for(let r of e){let e=this._baseStyles.get(r)??r.style??{},s=i(r,t);r.style=s?{...e,...s}:e}}restyleScene(e){this._customRestyle?(this.applyCustomRestyle(this.scene,e),this.markStylePaintPending(),this.updateResults.recordRestyle(!0)):this.updateResults.recordRestyle(!1)}updateConfig(e){let t={...this.config},i=Object.keys(e).filter(i=>e[i]!==t[i]);"production"!==process.env.NODE_ENV&&!this.windowSizeWarned&&"windowSize"in e&&e.windowSize!==t.windowSize&&(this.windowSizeWarned=!0,console.warn(`[Semiotic] windowSize changed after mount (${t.windowSize} → ${e.windowSize}) but it is a mount-only setting — the ring buffer keeps its original capacity. Remount the chart (e.g. via a React key) to apply a new windowSize.`)),("colorScheme"in e||"themeCategorical"in e||"colorAccessor"in e)&&(this._colorMapCache=null,this._groupColorMap=new Map,this._groupColorCounter=0),("barColors"in e||"colorScheme"in e)&&(this._barCategoryCache=null),("normalize"in e||"extentPadding"in e||"xAccessor"in e||"yAccessor"in e||"timeAccessor"in e||"valueAccessor"in e||"boundsAccessor"in e||"band"in e||"y0Accessor"in e||"openAccessor"in e||"highAccessor"in e||"lowAccessor"in e||"closeAccessor"in e||"groupAccessor"in e||"categoryAccessor"in e||"chartType"in e||"runtimeMode"in e)&&(this._stackExtentCache=null);let r=!1,o=!1;Object.assign(this.config,e),"pulse"in e&&this.syncPulseTimestampBuffer();let a="chartType"in e&&e.chartType!==t.chartType||"runtimeMode"in e&&e.runtimeMode!==t.runtimeMode;if(a||"xAccessor"in e||"yAccessor"in e||"timeAccessor"in e||"valueAccessor"in e){let e=["bar","swarm","waterfall"].includes(this.config.chartType)||"streaming"===this.config.runtimeMode,i=e&&this.config.valueAccessor||this.config.yAccessor,n=e&&t.valueAccessor||t.yAccessor,l=a||!Pe(e&&this.config.timeAccessor||this.config.xAccessor,e&&t.timeAccessor||t.xAccessor),c=a||!Pe(i,n);(l||c)&&(e?(this.getX=Se(this.config.timeAccessor||this.config.xAccessor,"time"),this.getY=Se(this.config.valueAccessor||this.config.yAccessor,"value")):(this.getX=Se(this.config.xAccessor,"x"),this.getY=Se(this.config.yAccessor,"y")),c&&this.resolvedRibbons.some(e=>"bounds"===e.kind)&&(this.resolvedRibbons=s(this.config)),r=!0,o=!0)}if("groupAccessor"in e&&!Pe(e.groupAccessor,t.groupAccessor)&&(this.getGroup=null!=this.config.groupAccessor?Re(this.config.groupAccessor):void 0,r=!0),"categoryAccessor"in e&&!Pe(e.categoryAccessor,t.categoryAccessor)&&(this.getCategory=null!=this.config.categoryAccessor?Re(this.config.categoryAccessor):void 0,r=!0),"sizeAccessor"in e&&!Pe(e.sizeAccessor,t.sizeAccessor)&&(this.getSize=this.config.sizeAccessor?Se(this.config.sizeAccessor,"size"):void 0,r=!0),"symbolAccessor"in e&&!Pe(e.symbolAccessor,t.symbolAccessor)&&(this.getSymbol=null!=this.config.symbolAccessor?Re(this.config.symbolAccessor):void 0,r=!0),"colorAccessor"in e&&!Pe(e.colorAccessor,t.colorAccessor)&&(this.getColor=null!=this.config.colorAccessor?Re(this.config.colorAccessor):void 0,r=!0),"y0Accessor"in e&&!Pe(e.y0Accessor,t.y0Accessor)&&(this.getY0=this.config.y0Accessor?Se(this.config.y0Accessor,"y0"):void 0,r=!0,o=!0),("boundsAccessor"in e&&!Pe(e.boundsAccessor,t.boundsAccessor)||"band"in e&&e.band!==t.band||"boundsStyle"in e&&e.boundsStyle!==t.boundsStyle)&&(this.resolvedRibbons=s(this.config),r=!0,o=!0),"pointIdAccessor"in e&&!Pe(e.pointIdAccessor,t.pointIdAccessor)&&(this.getPointId=null!=this.config.pointIdAccessor?Re(this.config.pointIdAccessor):void 0,r=!0),"candlestick"===this.config.chartType&&(a||"openAccessor"in e&&!Pe(e.openAccessor,t.openAccessor)||"closeAccessor"in e&&!Pe(e.closeAccessor,t.closeAccessor)||"highAccessor"in e&&!Pe(e.highAccessor,t.highAccessor)||"lowAccessor"in e&&!Pe(e.lowAccessor,t.lowAccessor))){let e=null!=this.config.openAccessor,t=null!=this.config.closeAccessor;this.getOpen=e?Se(this.config.openAccessor,"open"):void 0,this.getHigh=Se(this.config.highAccessor,"high"),this.getLow=Se(this.config.lowAccessor,"low"),this.getClose=t?Se(this.config.closeAccessor,"close"):void 0,this.config.candlestickRangeMode=!e&&!t,r=!0,o=!0}if("accessorRevision"in e&&e.accessorRevision!==t.accessorRevision&&(r=!0,o=!0),!r){let i=Object.keys(e).filter(e=>!e.endsWith("Accessor")&&"timeAccessor"!==e&&"valueAccessor"!==e);for(let s of i)if(e[s]!==t[s]){r=!0;break}}r&&(o&&this.rebuildExtents(),this.needsFullRebuild=!0),this.updateResults.recordConfig(i,("bar"===this.config.chartType||"heatmap"===this.config.chartType)&&!this.config.trackHoverRows&&di(t.areaStyle)!==di(this.config.areaStyle))}updateConfigWithResult(e){return this.updateConfig(e),this.updateResults.last}};Qi.GROUP_COLOR_MAP_CAP=1e3;var er=Qi;Te(er);import{useCallback as tr,useImperativeHandle as ir}from"react";import{line as rr}from"d3-shape";var sr=new WeakMap;import{jsx as or}from"react/jsx-runtime";import{useMemo as ar,useRef as nr,useEffect as lr,useId as cr}from"react";import*as hr from"react";import{jsx as ur}from"react/jsx-runtime";var dr=null,pr=null,gr=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];import{useMemo as yr}from"react";import{jsx as fr,jsxs as mr}from"react/jsx-runtime";import{Fragment as xr,jsx as vr,jsxs as br}from"react/jsx-runtime";import{useCallback as wr,useEffect as kr,useState as Ar}from"react";import*as _r from"react";import{area as Cr,line as Pr}from"d3-shape";import{jsx as Sr,jsxs as Rr}from"react/jsx-runtime";var Mr={axisStroke:"#ccc",tickText:"#666",crosshair:"rgba(0, 0, 0, 0.25)",hoverFill:"rgba(255, 255, 255, 0.3)",hoverStroke:"rgba(0, 0, 0, 0.4)",pointRing:"white",primary:"#007bff",background:""};import{useEffect as Yr}from"react";import{jsx as Tr,jsxs as Dr}from"react/jsx-runtime";N.ownsChrome=!0;import{jsx as Er,jsxs as Or}from"react/jsx-runtime";var Br=Ce,Lr=Mr,zr=ki(wi(function(t,i){let{chartType:r,runtimeMode:s,data:o,chunkThreshold:a,chunkSize:n,xAccessor:u,yAccessor:d,accessorRevision:p,colorAccessor:g,sizeAccessor:y,symbolAccessor:f,symbolMap:m,groupAccessor:x,lineDataAccessor:b,curve:w,normalize:k,baseline:A,stackOrder:_,binSize:C,valueAccessor:P,arrowOfTime:S="right",windowMode:M="sliding",windowSize:Y=200,timeAccessor:D,xExtent:E,yExtent:$,invertY:X,extentPadding:j=.1,scalePadding:G,sizeRange:q,size:K=[500,300],responsiveWidth:J,responsiveHeight:Q,margin:ie,className:oe,background:ae,maxDevicePixelRatio:ne,renderMode:ce,lineStyle:he,pointStyle:pe,areaStyle:ge,barStyle:ye,waterfallStyle:fe,swarmStyle:me,barColors:xe,colorScheme:ve,boundsAccessor:Ce,boundsStyle:Pe,y0Accessor:Se,band:Re,gradientFill:Ye,lineGradient:Te,semanticLineStops:De,areaGroups:Oe,openAccessor:Be,highAccessor:Le,lowAccessor:ze,closeAccessor:Fe,candlestickStyle:$e,showAxes:Ne=!0,axes:Ie,xLabel:We,yLabel:Ve,yLabelRight:Ke,xFormat:rt,yFormat:ut,axisExtent:yt,tickFormatTime:ft,tickFormatValue:bt,hoverAnnotation:wt,tooltipContent:kt,customHoverBehavior:At,customClickBehavior:Yt,onObservation:Tt,annotationObservationCallback:Dt,chartId:Et,enableHover:Ft,hoverRadius:$t=30,tooltipMode:Nt,annotations:It,onAnnotationActivate:Wt,autoPlaceAnnotations:Gt,svgAnnotationRules:Jt,showGrid:Zt,legend:Qt,legendHoverBehavior:ti,legendClickBehavior:li,legendHighlightedCategory:ci,legendIsolatedCategories:hi,legendPosition:di,legendLayout:gi,legendCategoryAccessor:vi,onCategoriesChange:wi,backgroundGraphics:ki,foregroundGraphics:Mi,canvasPreRenderers:Yi,svgPreRenderers:Ti,title:Di,categoryAccessor:Ei,brush:Oi,onBrush:Bi,decay:Li,pulse:zi,transition:Fi,animate:$i,staleness:Ni,frameScheduler:Ii,clock:Wi,random:Xi,seed:ji,paused:Vi=!1,suspendWhenHidden:Hi=!0,heatmapAggregation:Gi,heatmapXBins:Ui,heatmapYBins:qi,showValues:Ki,heatmapValueFormat:Ji,heatmapColorScale:Zi,onColorDomainChange:Qi,marginalGraphics:rr,pointIdAccessor:sr,xScaleType:or,yScaleType:ar,accessibleTable:nr=!0,description:lr,summary:cr,linkedCrosshairName:hr,linkedCrosshairSourceId:ur,customLayout:dr,onLayoutError:pr,layoutConfig:gr,layoutSelection:yr}=t,{customHoverBehavior:fr,customClickBehavior:mr,hasClickBehavior:xr}=we({customHoverBehavior:At,customClickBehavior:Yt,onObservation:Tt,chartId:Et,chartType:"StreamXYFrame"}),vr=Ci().replace(/:/g,""),br=Si(!1),Tr=Si({w:-1,h:-1}),Dr=Si(!1),zr=ii({sizeProp:K,responsiveWidth:J,responsiveHeight:Q,userMargin:ie,marginDefault:Br,title:Di,legend:Qt,legendPosition:di,...le(t,Qt),animate:$i,transitionProp:Fi,frameScheduler:Ii,clock:Wi,random:Xi,seed:ji,paused:Vi,suspendWhenHidden:Hi,themeDirtyRef:br}),Fr=si(),$r=ai(),{reducedMotionRef:Nr,responsiveRef:Ir,size:Wr,currentTheme:Xr,transition:jr,introEnabled:Vr,tableId:Hr,rafRef:Gr,renderFnRef:Ur,scheduleRender:qr,frameRuntime:Kr}=zr;_i(()=>xi(()=>{br.current=!0,qr()}),[qr]);let Jr=zr.margin;if(rr){let e={...zr.margin};rr.top&&60>e.top&&(e.top=60),rr.bottom&&60>e.bottom&&(e.bottom=60),rr.left&&60>e.left&&(e.left=60),rr.right&&60>e.right&&(e.right=60),Jr=e}let Zr=Wr[0]-Jr.left-Jr.right,Qr=Wr[1]-Jr.top-Jr.bottom,es=(Ie?.find(e=>"left"===e.orient)??Ie?.find(e=>"right"===e.orient))?.extent??yt,ts=Pi(()=>_t(o),[o]),is=wt??Ft,[rs,ss]=Ri(0),os=Si(0),[as,ns]=Ri(null),ls=Ue(Mi,Wr,Jr,as),cs=Ue(ki,Wr,Jr,as),hs=Si(null),us=Si(!1),ds=Si(null),ps=Si(void 0),[gs,ys]=Ri(null),fs=Si(Lr.primary),ms=Si(function(){let e=-1,t=Mr;return{resolve(i){if(!i)return Mr;let r=pi();return r===e||(t=function(e){if(!e)return Mr;let t=getComputedStyle(e),i=t.getPropertyValue("--semiotic-border").trim(),r=t.getPropertyValue("--semiotic-text-secondary").trim(),s=t.getPropertyValue("--semiotic-bg").trim(),o=t.getPropertyValue("--semiotic-primary").trim(),a=r||t.getPropertyValue("--text-secondary").trim(),n=t.getPropertyValue("--text-primary").trim(),l=i||t.getPropertyValue("--surface-3").trim(),c=s||t.getPropertyValue("--surface-0").trim();return a||n||i||o?{axisStroke:l||Mr.axisStroke,tickText:a||Mr.tickText,crosshair:a?z(a,"66"):Mr.crosshair,hoverFill:c?z(c,"4D"):Mr.hoverFill,hoverStroke:a?z(a,"99"):Mr.hoverStroke,pointRing:c||Mr.pointRing,primary:o||Mr.primary,background:c||Mr.background}:Mr}(i),e=r),t},invalidate(){e=-1}}}()),xs=Si(!1),vs=oi("StreamXYFrame"),[bs,ws]=Ri(!1),ks="streaming"===s||["bar","swarm","waterfall"].includes(r),As=!!fr,_s=Pi(()=>({chartType:r,runtimeMode:ks?"streaming":"bounded",windowSize:Y,windowMode:M,arrowOfTime:ks?S:"right",extentPadding:j,scalePadding:G,axisExtent:yt,yAxisExtent:es,xAccessor:u,yAccessor:d,accessorRevision:p,timeAccessor:ks?D:void 0,valueAccessor:P,colorAccessor:g,sizeAccessor:y,symbolAccessor:f,symbolMap:m,groupAccessor:x||(b?"_lineGroup":void 0),categoryAccessor:Ei,lineDataAccessor:b,xScaleType:or,yScaleType:ar,xExtent:E,yExtent:$,invertY:X,sizeRange:q,binSize:C,normalize:k,baseline:A,stackOrder:_,boundsAccessor:Ce,boundsStyle:Pe,y0Accessor:Se,band:Re,gradientFill:de(Ye),areaGroups:Oe?new Set(Oe):void 0,lineGradient:ue(Te),semanticLineStops:De,openAccessor:Be,highAccessor:Le,lowAccessor:ze,closeAccessor:Fe,candlestickStyle:$e,lineStyle:he,trackHoverRows:As,pointStyle:pe,areaStyle:ge,swarmStyle:me,waterfallStyle:fe,colorScheme:ve,barColors:xe,barStyle:ye,annotations:It,decay:Li,pulse:zi,transition:jr,introAnimation:Vr,staleness:Ni,clock:Kr.now,heatmapAggregation:Gi,heatmapXBins:Ui,heatmapYBins:qi,showValues:Ki,heatmapValueFormat:Ji,heatmapColorScale:Zi,pointIdAccessor:sr,curve:w,themeCategorical:Xr?.colors?.categorical,themeSemantic:ui(Xr),themeSequential:Xr?.colors?.sequential,themeDiverging:Xr?.colors?.diverging,customLayout:dr,onLayoutError:pr,layoutConfig:gr,layoutMargin:Jr}),[r,ks,Y,M,S,j,G,yt,es,u,d,p,D,P,g,y,f,m,x,b,Ei,or,ar,E,$,X,q,C,k,A,_,Ce,Pe,Se,Re,Ye,Oe,Te,De,Be,Le,ze,Fe,$e,he,As,pe,ge,me,fe,ve,xe,ye,It,Li,zi,jr,Vr,Ni,Kr.now,Gi,Ui,qi,Ki,Ji,Zi,sr,w,Xr,dr,pr,gr,Jr]),Cs=tt(_s),Ps=Si(null);Ps.current||(Ps.current=new er(Cs));let Ss=et(Ps,vi,wi,e=>e.getData()),Rs=Si({onColorDomainChange:Qi,chartType:r}),Ms=Si(void 0);Rs.current={onColorDomainChange:Qi,chartType:r};let Ys=Ai(()=>{let{onColorDomainChange:e,chartType:t}=Rs.current;if(!e||"heatmap"!==t)return;let i=1/0,r=-1/0;for(let e of Ps.current?.scene??[]){if("heatcell"!==e.type)continue;let t=Number(e.value??e.datum?.value);Number.isFinite(t)&&(i>t&&(i=t),t>r&&(r=t))}let s=Number.isFinite(i)&&Number.isFinite(r)?[i,r]:null,o=Ms.current;null===o&&null===s||o&&s&&o[0]===s[0]&&o[1]===s[1]||(Ms.current=s,e(s))},[]);(function(e,t,i,r,s){Yr(()=>{let o=!1,a=[];if(t&&!H("custom")&&a.push(import("./c-EZZT2WAE.min.js").then(e=>{U(e.customXYPlugin)})),!t&&"custom"!==e&&!H(e)&&a.push(import("./c-2RL2QPZJ.min.js").then(e=>{e.registerBuiltInXYPlugins()})),0!==a.length)return Promise.all(a).then(()=>{o||(t?s.current?.markStylePaintPending():i.current=!0,r())}),()=>{o=!0}},[e,t,i,r,s])})(r,dr,br,qr,Ps),Ze(Ps,Cs,br,qr),Qe(Ps,yr,br,qr);let Ts=Si(null);Ts.current||(Ts.current=new te(e=>{let t=Ps.current;t&&t.ingest(e)&&(br.current=!0,qr())},{chunkThreshold:a,chunkSize:n})),_i(()=>{Ts.current?.updateChunkOptions({chunkThreshold:a,chunkSize:n})},[a,n]),function(e,{storeRef:t,adapterRef:i,dirtyRef:r,scheduleRender:s,hoverRef:o,setHoverPoint:a}){let n=tr(e=>{i.current?.push(e)},[i]),l=tr(e=>{i.current?.pushMany(e)},[i]),c=tr(()=>{i.current?.clear(),t.current?.clear(),r.current=!0,s()},[i,t,r,s]);ir(e,()=>({push:n,pushMany:l,remove:e=>{i.current?.flush();let n=t.current?.remove(e)??[];return n.length>0&&(o.current&&n.some(e=>e===o.current?.data)&&(o.current=null,a(null)),r.current=!0,s()),n},update:(e,o)=>{i.current?.flush();let a=t.current?.update(e,o)??[];return a.length>0&&(r.current=!0,s()),a},clear:c,getData:()=>(i.current?.flush(),t.current?.getData()??[]),getScales:()=>t.current?.scales??null,getExtents:()=>t.current?.getExtents()??null,getCustomLayout:()=>t.current?.lastCustomLayoutResult??null,getLayoutFailure:()=>t.current?.lastCustomLayoutFailure??null}),[n,l,c,s,i,t,r,o,a])}(i,{storeRef:Ps,adapterRef:Ts,dirtyRef:br,scheduleRender:qr,hoverRef:hs,setHoverPoint:ys}),_i(()=>{o&&Ts.current?.setBoundedData(I(ts,b))},[o,ts,b]);let{marginalXValues:Ds,marginalYValues:Es,refreshMarginalValues:Os}=function(e,t,i,r,s){let[o,a]=Ar([]),[n,l]=Ar([]),c=null!=t,h=c?[t.top,t.bottom,t.left,t.right].join("|"):"",u=wr((t=e.current?.getData()??[])=>{let i=R(t,r,s);a(i.xValues),l(i.yValues)},[e,r,s]);return kr(()=>{if(!c)return a([]),void l([]);u()},[i,c,h,u]),{marginalXValues:o,marginalYValues:n,refreshMarginalValues:u}}(Ps,rr,ts,u,d),{canvasRef:Bs,interactionCanvasRef:Ls,resolutionDirtyRef:zs}=ri(zr,{storeRef:Ps,dirtyRef:br,hydrated:Fr,wasHydratingFromSSR:$r,cleanup:()=>Ts.current?.clear(),maxDevicePixelRatio:ne,canvasPaintDependencies:[r,Zr,Qr,Ne,ae,ki,he,ce,Yi,qr]}),{hoverHandlerRef:Fs,hoverLeaveRef:$s,onPointerMove:Ns,onPointerLeave:Is,pointerStateRef:Ws}=zr;Fs.current=e=>{let t=Bs.current;if(!t)return;let i=t.getBoundingClientRect(),s=e.clientX-i.left-Jr.left,o=e.clientY-i.top-Jr.top;if(0>s||s>Zr||0>o||o>Qr){if(Ht(t),!is)return;return void(hs.current&&(hs.current=null,ds.current=null,ys(null),fr?.(null),qr()))}let a=Ps.current;if(!a||0===a.scene.length)return void Ht(t);let n=Pt($t,e.pointerType),d=c(a.scene,s,o,n,a.quadtree,a.maxPointRadius);if(Ht(t,Vt(d?.node)),!is)return;let p="multi"===Nt,g=()=>{hs.current&&(hs.current=null,ds.current=null,ys(null),fr&&fr(null),qr())};if(!d&&!p)return void g();let y=p||!d?s:d.x,f=p||!d?o:d.y,m=d?.datum?Ae(d.datum,a.resolvedRibbons):{},x=a.scales?.x?.invert,b="function"==typeof x?x(y):void 0,w=mt(m,y,f,null!=b?{xValue:b,xPx:y}:void 0);if(p&&a.scene.length>0&&a.scales){let e=function(e,t,i=30){let r=[];for(let s of e)if("line"===s.type){let e=s;if(2>e.path.length)continue;let o=h(l(e.path,e.curve),t,i);if(null===o)continue;let a=v(e.path,t);r.push({node:s,datum:Array.isArray(e.datum)&&e.datum[a]?e.datum[a]:e.datum,x:e.path[a][0],y:o,group:e.group,color:e.style.stroke})}else if("area"===s.type){let e=s;if(!1===e.interactive||2>e.topPath.length)continue;let o=l(e.topPath,e.curve),a=l(e.bottomPath,e.curve),n=h(o,t,i);if(null===n)continue;let c=h(a,t,i),u=v(e.topPath,t);r.push({node:s,datum:Array.isArray(e.datum)&&e.datum[u]?e.datum[u]:e.datum,x:e.topPath[u][0],y:n,y0:c??void 0,group:e.group,color:"string"==typeof e.style.stroke?e.style.stroke:"string"==typeof e.style.fill?e.style.fill:void 0})}return r}(a.scene,y,Math.max(n,Zr));if(e.length>0){let t=a.scales.y.invert,i=fs.current,s=x?x(y):y;if(d)w.xValue=s,w.xPx=y;else{let e={xValue:s};"string"==typeof u&&(e[u]=s),w=mt(e,y,f,{xValue:s,xPx:y})}w.allSeries=e.map(e=>{let s=t?t(e.y):e.y,o=null!=e.y0?t?t(e.y0):e.y0:void 0;return{group:e.group||"",value:"stackedarea"===r&&null!=o?s-o:s,valuePx:e.y,color:e.color||i,datum:Ae(e.datum,a.resolvedRibbons)}})}}d||w.allSeries?.length?(hs.current=w,ds.current=d?.node??null,ys(w),fr?.(w),qr()):g()},$s.current=()=>{Ht(Bs.current),hs.current&&(hs.current=null,ds.current=null,ys(null),fr?.(null),qr())},ei(Bs);let Xs=Si(()=>{});Xs.current=e=>{if(Rt(e.target)||!mr)return;let t=Bs.current;if(!t)return;let i=t.getBoundingClientRect(),r=e.clientX-i.left-Jr.left,s=e.clientY-i.top-Jr.top;if(0>r||r>Zr||0>s||s>Qr)return void mr(null);let o=Ps.current;if(!o||0===o.scene.length)return void mr(null);let a=Pt($t,ps.current),n=c(o.scene,r,s,a,o.quadtree,o.maxPointRadius);if(!n)return void mr(null);let l=n.datum||{},h=o.scales?.x?.invert,u="function"==typeof h?h(n.x):void 0;mr(mt(l,n.x,n.y,null!=u?{xValue:u,xPx:n.x}:void 0),{type:"activate",inputType:Ot(ps.current)})};let js=Ai(e=>Xs.current(e),[]),{kbFocusIndexRef:Vs,focusedNavPointRef:Hs,onKeyDown:Gs}=ke({storeRef:Ps,hoverRef:hs,hoveredNodeRef:ds,setHoverPoint:ys,customHoverBehavior:fr,customClickBehavior:mr,scheduleRender:qr}),Us=Ai(e=>{Je(Ws,e,!!is,us.current,Bs.current)&&(ps.current=e.pointerType,Vs.current=-1,Hs.current=null,Ns(e))},[Bs,is,Hs,Vs,Ns,Ws]),qs=Ai(e=>{Je(Ws,e,!!is,us.current,Bs.current,"mouse")&&(ps.current="mouse",Vs.current=-1,Hs.current=null,Ns({clientX:e.clientX,clientY:e.clientY,pointerType:"mouse"}))},[Bs,is,Hs,Vs,Ns,Ws]),Ks=Ai(e=>{ps.current=e.pointerType},[]);Ur.current=()=>{if(Gr.current=null,!Kr.isActive)return;let e=Bs.current,t=Ls.current;if(!e||!t)return;let i=Ps.current;if(!i)return;let s=Kr.now(),o=null!=i.activeTransition,a=i.advanceTransition(Nr.current?s+1e6:s),n=!Nr.current&&a,l=Tr.current.w!==Zr||Tr.current.h!==Qr,h=zs.current,u=br.current||o||l,d=o&&!a,p=i.consumeStylePaintPending(),g=!1,y=i.getLastUpdateResult(),f=vs.current.beforeCompute(y,n);(br.current||l)&&(!n||l)&&(i.computeScene({width:Zr,height:Qr}),Tr.current={w:Zr,h:Qr},g=!0,Ss(),Ys()),(g||p)&&(us.current=jt(i.scene),us.current||Ht(e)),us.current&&(o||g||p)&&function(e){let{canvas:t,pointer:i,store:r,margin:s,width:o,height:a}=e;zt(t,i,i=>{let n=t.getBoundingClientRect(),l=i.clientX-n.left-s.left,h=i.clientY-n.top-s.top;if(0>l||l>o||0>h||h>a)return;let u=c(r.scene,l,h,Pt(e.hoverRadius,i.pointerType),e.geometryMoved?null:r.quadtree,r.maxPointRadius);return Vt(u?.node)})}({canvas:e,pointer:Ws.current,store:i,margin:Jr,width:Zr,height:Qr,hoverRadius:$t,geometryMoved:o||g}),vs.current.afterCompute(f,g,l);let m=be(i,s,g,Dr),x=Ct(ne,Wr);Kt(e,Wr,x),Kt(t,Wr,x);let v=ms.current.resolve(e);fs.current=v.primary;let b=qe(Ni,i.lastIngestTime>0?s-i.lastIngestTime:0),w=Ni&&b.isStale;if(u||p||m.changed||h){let t=Lt(e,Wr,Jr,x);if(t){if(t.clearRect(-Jr.left,-Jr.top,Wr[0],Wr[1]),Ni&&1>b.alpha&&(t.globalAlpha=b.alpha),Xe(t,{background:ae,hasBackgroundGraphics:!!ki,themeBackground:v.background,x:-Jr.left,y:-Jr.top,width:Wr[0],height:Wr[1]}),t.save(),"function"==typeof t.rect&&(t.beginPath(),t.rect(0,0,Zr,Qr),t.clip()),Yi&&i.scales)for(let e of Yi)t.save(),e(t,i.scene,i.scales,{width:Zr,height:Qr}),t.restore();let e=V(r,!!dr);je({context:t,nodes:i.scene,renderMode:ce,pixelRatio:x,paintBuiltIn:r=>{if(e&&i.scales)for(let s of e)s(t,r,i.scales,{width:Zr,height:Qr})}}),t.restore(),Ni&&1>b.alpha&&(t.globalAlpha=1)}}let k=!!(is&&hs.current&&i.scales),A=!!(ds.current&&Array.isArray(wt)&&wt.some(e=>e&&"object"==typeof e&&"highlight"===e.type)),_=k||A;if(_e(_,xs.current)){let e=Lt(t,Wr,Jr,x);if(e&&(e.clearRect(-Jr.left,-Jr.top,Wr[0],Wr[1]),k&&hs.current&&function(e,t,i,r,s,o,a){if(!1===s.crosshair)return;let n=t.allSeries,l=n&&n.length>0,c=t.xPx??t.x;e.save();let h="object"==typeof s.crosshair?s.crosshair:{};e.strokeStyle=h.stroke||a.crosshair;let u=h.strokeWidth??1;if(e.setLineDash(h.strokeDasharray?h.strokeDasharray.split(/[\s,]+/).map(Number):[4,4]),u>0&&(e.lineWidth=u,e.beginPath(),e.moveTo(l?c:t.x,0),e.lineTo(l?c:t.x,r),e.stroke(),l||(e.beginPath(),e.moveTo(0,t.y),e.lineTo(i,t.y),e.stroke())),e.restore(),l){e.lineWidth=2,e.strokeStyle=a.pointRing;for(let t of n)null!=t.valuePx&&(e.beginPath(),e.arc(c,t.valuePx,4,0,2*Math.PI),e.fillStyle=t.color||a.primary,e.fill(),e.stroke())}else{let i=s.pointColor||Z(o)||a.primary;e.beginPath(),e.arc(t.x,t.y,4,0,2*Math.PI),e.fillStyle=i,e.fill(),e.strokeStyle=a.pointRing,e.lineWidth=2,e.stroke()}}(e,hs.current,Zr,Qr,"object"==typeof is?is:{},ds.current,v),A&&ds.current&&Array.isArray(wt))){let t=wt.find(e=>e&&"object"==typeof e&&"highlight"===e.type);t&&function(e,t,i,r,s){if(!i)return;let o="group"in i?i.group:void 0;if(void 0!==o)for(let i of t){if("line"!==i.type||i.group!==o||2>i.path.length)continue;let t="function"==typeof r.style?i.datum?r.style(i.datum):{}:r.style||{};e.save(),e.beginPath(),e.moveTo(i.path[0][0],i.path[0][1]);for(let t=1;i.path.length>t;t++)e.lineTo(i.path[t][0],i.path[t][1]);e.strokeStyle=t.stroke||i.style.stroke||s.primary;let a=t.strokeWidth??(i.style.strokeWidth??2)+2;a>0?(e.lineWidth=a,e.globalAlpha=t.opacity??1,e.stroke(),e.restore()):e.restore()}}(e,i.scene,ds.current,t,v)}xs.current=_}u&&e&&e.setAttribute("aria-label",vt(i.scene,r+" chart"));let C=br.current;if(br.current=C&&n&&!g,zs.current=!1,C&&i.scales){let e=e=>"object"==typeof e&&null!==e&&"function"==typeof e.valueOf?e.valueOf():e;(!as||e(as.x.domain()[0])!==e(i.scales.x.domain()[0])||e(as.x.domain()[1])!==e(i.scales.x.domain()[1])||e(as.y.domain()[0])!==e(i.scales.y.domain()[0])||e(as.y.domain()[1])!==e(i.scales.y.domain()[1])||as.x.range()[0]!==i.scales.x.range()[0]||as.x.range()[1]!==i.scales.x.range()[1]||as.y.range()[0]!==i.scales.y.range()[0]||as.y.range()[1]!==i.scales.y.range()[1])&&ns(i.scales),rr&&Os(i.getData())}(It&&It.length>0||dr)&&(g||o)&&(g||d||s-os.current>=33)&&(ss(e=>e+1),os.current=s),Ni?.showBadge&&ws(!!w),(n||null!=i.activeTransition||m.pending)&&qr()},it(Ni,Ps,br,qr,Kr.now,bs,ws);let Js=Pi(()=>{if(!rt&&!ft&&Ps.current?.xIsDate&&as)return T(as.x.domain())},[rt,ft,as]),Zs=rt||ft||Js,Qs=is&&gs?kt?kt(gs):Er(N,{hover:gs}):null,eo=Qs?Er(ct,{x:gs.x,y:gs.y,containerWidth:Zr,containerHeight:Qr,margin:Jr,className:"stream-frame-tooltip",children:Qs}):null,to=Hs.current,io=Er(ht,{active:Vs.current>=0,hoverPoint:gs,margin:Jr,size:Wr,shape:to?.shape,width:to?.w,height:to?.h}),ro=se(u,D,"__semiotic_resolvedX","__semiotic_resolvedTime"),so=se(d,P,"__semiotic_resolvedY","__semiotic_resolvedValue"),oo=ro.key,ao=so.key,no=re(ro,so,It&&It.length>0||!1);if(Mt||!Fr&&$r){let e=Ps.current;e&&o&&(e.ingest({inserts:I(ts,b),bounded:!0}),e.computeScene({width:Zr,height:Qr}));let t=e?.scene??[],i=e?.scales??null,r=Ue(Mi,Wr,Jr,i),s=Ue(ki,Wr,Jr,i),a=Zs||(()=>{if(e?.xIsDate&&i)return T(i.x.domain())})(),n=lr||("string"==typeof Di?Di:"XY chart"),l=rr&&e?R(e.getData(),u,d):{xValues:[],yValues:[]};return Or("div",{ref:Ir,className:"stream-xy-frame"+(oe?" "+oe:""),role:"img","aria-label":n,style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:J?"100%":Wr[0],height:Q?"100%":Wr[1]},children:[Er(pt,{summary:cr}),Or("svg",{xmlns:"http://www.w3.org/2000/svg",width:Wr[0],height:Wr[1],style:{position:"absolute",left:0,top:0},children:[Or("g",{transform:`translate(${Jr.left},${Jr.top})`,children:[ae&&Er("rect",{x:0,y:0,width:Zr,height:Qr,fill:ae}),s]}),Or("g",{transform:`translate(${Jr.left},${Jr.top})`,children:[Ti&&i&&Ti.map((e,r)=>Er(bi.Fragment,{children:e(t,i,{width:Zr,height:Qr})},"svgpre-"+r)),t.map((e,t)=>He({node:e,index:t,renderMode:ce,fallback:()=>function(e,t,i,r=30){let s=function(e,t,i,r=30){switch(e.type){case"line":{let r=e;if(0===r.path.length)return null;let s=mi(r.curve),o=s?Pr().x(([e])=>e).y(([,e])=>e).curve(s)(r.path)??"":"M"+r.path.map(([e,t])=>`${e},${t}`).join("L"),a=Xt(`${i?i+"-":""}line-${t}-stroke-gradient`),n=L(r.strokeGradient,r.path,a,r.style.stroke||"#4e79a7");return Rr(_r.Fragment,{children:[n&&Sr("defs",{children:n}),Sr("path",{d:o,fill:"none",stroke:n?`url(#${a})`:r.style.stroke||"#4e79a7",strokeWidth:r.style.strokeWidth??2,strokeDasharray:r.style.strokeDasharray,opacity:r.style.opacity})]},"line-"+t)}case"area":{let s=e;if(0===s.topPath.length)return null;let o=mi(s.curve),a=!o||2>s.topPath.length||2>s.bottomPath.length?`M${s.topPath.map(([e,t])=>`${e},${t}`).join("L")}L${[...s.bottomPath].reverse().map(([e,t])=>`${e},${t}`).join("L")}Z`:Cr().x(([e])=>e).y0((e,t)=>s.bottomPath[t][1]).y1(([,e])=>e).curve(o)(s.topPath)??"",n=`${i?i+"-":""}area-${t}-hatch`,l=fi(s.style.fill)?yi(s.style.fill,n):void 0,c=Xt(`${i?i+"-":""}area-${t}-gradient`),h=function(e,t){let i=e.fillGradient;if(!i||"object"!=typeof i)return null;let r=1/0;for(let[,t]of e.topPath)r=Math.min(r,t);let s=-1/0;for(let[,t]of e.bottomPath)s=Math.max(s,t);if(!Number.isFinite(r)||!Number.isFinite(s))return null;let o=xt(i.stops,Ut(e.style.fill));return o?Sr("linearGradient",{id:t,gradientUnits:"userSpaceOnUse",x1:0,y1:r,x2:0,y2:s,children:o}):null}(s,c),u=h?`url(#${c})`:l?`url(#${n})`:Ut(s.style.fill),d=h?void 0:s.style.fillOpacity??s.style.opacity??.7,p=o?Pr().x(([e])=>e).y(([,e])=>e).curve(o)(s.topPath)??"":"M"+s.topPath.map(([e,t])=>`${e},${t}`).join("L"),g=Vt(s),y=g&&r>=0?Sr("path",{d:p,fill:"none",stroke:"transparent",strokeWidth:Math.max(1,2*r),strokeLinecap:"round",pointerEvents:"stroke",style:{cursor:g},"data-semiotic-mark-cursor":g,"data-semiotic-cursor-hit-target":"area-top-path","aria-hidden":"true"},`area-${t}-cursor-target`):null,f=Xt(`${i?i+"-":""}area-${t}-stroke-gradient`),m=!(!s.colorThresholds?.length||!s.rawValues||s.rawValues.length!==s.topPath.length),x=!!s.strokeColorBands?.length,v=m||x?null:L(s.strokeGradient,s.topPath,f,s.style.stroke||"#4e79a7"),b=s.style.strokeWidth??2,w=1/0,k=-1/0;for(let[e]of s.topPath)w>e&&(w=e),e>k&&(k=e);let A=x?s.strokeColorBands.map((e,r)=>Xt(`${i?i+"-":""}area-${t}-stroke-band-${r}`)):[],_=x?s.strokeColorBands.map((e,t)=>Sr("clipPath",{id:A[t],children:Sr("rect",{x:w-b,y:e.y,width:k-w+2*b,height:e.height})},A[t])):null,C=s.style.stroke&&"none"!==s.style.stroke?x?s.strokeColorBands.map((e,i)=>Sr("path",{d:p,fill:"none",stroke:e.color??Ut(s.style.stroke),strokeWidth:b,opacity:(s.style.opacity??1)*(e.opacity??1),clipPath:`url(#${A[i]})`},`area-${t}-stroke-band-${i}`)):m?ee(s.topPath,s.rawValues,s.colorThresholds,Ut(s.style.stroke)).map((e,i)=>Sr("path",{d:"M"+e.path.map(([e,t])=>`${e},${t}`).join("L"),fill:"none",stroke:e.color,strokeWidth:b,opacity:s.style.opacity},`area-${t}-threshold-${i}`)):Sr("path",{d:p,fill:"none",stroke:v?`url(#${f})`:Ut(s.style.stroke),strokeWidth:b,opacity:s.style.opacity}):null;if(s.clipRect){let e=`${i?i+"-":""}area-clip-${t}`;return Rr("g",{children:[Rr("defs",{children:[h,!h&&l,v,_,Sr("clipPath",{id:e,children:Sr("rect",{x:s.clipRect.x,y:s.clipRect.y,width:s.clipRect.width,height:s.clipRect.height})})]}),Rr("g",{clipPath:`url(#${e})`,children:[Sr("path",{d:a,fill:u,fillOpacity:d,opacity:h?s.style.opacity:void 0,stroke:"none"}),C,y]})]},"area-"+t)}return Rr(_r.Fragment,{children:[(h||l||v||_)&&Rr("defs",{children:[h,!h&&l,v,_]}),Sr("path",{d:a,fill:u,fillOpacity:d,opacity:h?s.style.opacity:void 0,stroke:"none"}),C,y]},"area-"+t)}case"point":case"rect":return Bt(e,t,i);case"symbol":return qt(e,t);case"glyph":return St(e,e.x,e.y,`${i??""}glyph-${e.pointId??t}`);case"heatcell":{let i=e,r={x:i.x,y:i.y,width:i.w,height:i.h,fill:i.fill,stroke:i.style?.stroke,strokeWidth:i.style?.strokeWidth,...null!=i.style?.opacity&&{opacity:i.style.opacity}};if(i.showValues&&null!=i.value&&i.w>=20&&i.h>=20){let e=i.valueFormat?i.valueFormat(i.value):Number.isInteger(i.value)?i.value+"":100>Math.abs(i.value)?1>Math.abs(i.value)?i.value.toPrecision(3):i.value.toFixed(1):i.value.toFixed(0),[s,o,a]=function(e){if(e.startsWith("#")){let t=e.slice(1);if(3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),6===t.length)return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)]}let t=e.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return t?[+t[1],+t[2],+t[3]]:[128,128,128]}(i.fill),n=.299*s+.587*o+.114*a>128?"#000":"#fff",l=Math.max(10,Math.min(16,.3*Math.min(i.w,i.h)));return Rr("g",{children:[Sr("rect",{...r}),Sr("text",{className:"semiotic-heatmap-value",x:i.x+i.w/2,y:i.y+i.h/2,textAnchor:"middle",dominantBaseline:"middle",fill:n,fontSize:l+"px",fontFamily:"var(--semiotic-font-family, sans-serif)",children:e})]},"heatcell-"+t)}return Sr("rect",{...r},"heatcell-"+t)}case"candlestick":{let r=e,s=`${i?i+"-":""}candle-${t}-hatch`,o=fi(r.style?.fill)?yi(r.style.fill,s):void 0,a=o?`url(#${s})`:void 0,{fill:n,...l}=r.style??{};if(r.isRange){let e=r.dotRadius??Math.max(2,r.bodyWidth/2),i=a??r.wickColor;return Rr(_r.Fragment,{children:[o&&Sr("defs",{children:o}),Rr("g",{style:l,children:[Sr("line",{x1:r.x,y1:r.highY,x2:r.x,y2:r.lowY,stroke:r.wickColor,strokeWidth:r.wickWidth,opacity:r.style?.opacity}),Sr("circle",{cx:r.x,cy:r.highY,r:e,fill:i,opacity:r.style?.opacity}),Sr("circle",{cx:r.x,cy:r.lowY,r:e,fill:i,opacity:r.style?.opacity})]})]},"candle-"+t)}let c=Math.min(r.openY,r.closeY),h=Math.max(Math.abs(r.openY-r.closeY),1),u=r.isUp?r.upColor:r.downColor,d=a??u;return Rr(_r.Fragment,{children:[o&&Sr("defs",{children:o}),Rr("g",{style:l,children:[Sr("line",{x1:r.x,y1:r.highY,x2:r.x,y2:r.lowY,stroke:r.wickColor,strokeWidth:r.wickWidth,opacity:r.style?.opacity}),Sr("rect",{x:r.x-r.bodyWidth/2,y:c,width:r.bodyWidth,height:h,fill:d,stroke:a?r.wickColor:u,strokeWidth:1,opacity:r.style?.opacity})]})]},"candle-"+t)}default:return null}}(e,t,i,r);return"area"===e.type?s:ni(s,e,"xy-cursor-"+t)}(e,t,vr,$t)})).filter(Boolean)]})]}),Er(B,{width:Zr,height:Qr,totalWidth:Wr[0],totalHeight:Wr[1],margin:Jr,scales:i,showAxes:Ne,axes:Ie,xLabel:We,yLabel:Ve,yLabelRight:Ke,xFormat:a,yFormat:ut||bt,axisExtent:yt,showGrid:Zt,title:Di,description:lr,legend:Qt,legendHoverBehavior:ti,legendClickBehavior:li,legendHighlightedCategory:ci,legendIsolatedCategories:hi,legendPosition:di,legendLayout:gi,foregroundGraphics:Ee(r,st(Ps.current?.customLayoutOverlays,yr??null)),marginalGraphics:rr,xValues:l.xValues,yValues:l.yValues,annotations:It,onAnnotationActivate:Wt,onObservation:Dt??Tt,chartId:Et,chartType:"StreamXYFrame",autoPlaceAnnotations:Gt,svgAnnotationRules:Jt,annotationFrame:0,xAccessor:oo,yAccessor:ao,annotationData:no(Ps.current?.getData()),pointNodes:F(Ps.current?.scene),curve:"string"==typeof w?w:void 0,linkedCrosshairName:hr,linkedCrosshairSourceId:ur})]})}return Or("div",{ref:Ir,className:"stream-xy-frame"+(oe?" "+oe:""),role:"group","aria-label":lr||("string"==typeof Di?Di:"XY chart"),tabIndex:0,style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:J?"100%":Wr[0],height:Q?"100%":Wr[1],overflow:"visible",touchAction:W(Oi)},onKeyDown:Gs,children:["production"!==process.env.NODE_ENV&&Ps.current&&Er(dt,{store:Ps.current,diagnostics:vs.current}),nr&&Or(at,{accessibleTable:nr,children:[Er(gt,{tableId:Hr}),Er(ot,{scene:Ps.current?.scene??[],chartType:r+" chart",tableId:Hr,chartTitle:"string"==typeof Di?Di:void 0})]}),Er(pt,{summary:cr}),Er(nt,{hoverPoint:gs}),Or("div",{role:"img","aria-label":lr||("string"==typeof Di?Di:"XY chart"),style:{position:"relative",width:"100%",height:"100%"},onPointerMove:Us,onMouseMove:qs,onPointerLeave:Is,onMouseLeave:Is,onPointerDown:is||xr?Ks:void 0,onClick:xr?js:void 0,children:[Er(lt,{size:Wr,margin:Jr,backdropFill:ki?ae:void 0,children:cs}),Er(O,{width:Zr,height:Qr,totalWidth:Wr[0],totalHeight:Wr[1],margin:Jr,scales:as,showAxes:Ne,axes:Ie,showGrid:Zt,xFormat:Zs,yFormat:ut||bt,axisExtent:yt}),Er("canvas",{ref:Bs,"aria-label":vt(Ps.current?.scene??[],r+" chart"),style:{position:"absolute",left:0,top:0}}),Er("canvas",{ref:Ls,style:{position:"absolute",left:0,top:0,pointerEvents:"none"}}),Er(B,{width:Zr,height:Qr,totalWidth:Wr[0],totalHeight:Wr[1],margin:Jr,scales:as,showAxes:Ne,axes:Ie,xLabel:We,yLabel:Ve,yLabelRight:Ke,xFormat:Zs,yFormat:ut||bt,axisExtent:yt,showGrid:Zt,title:Di,description:lr,legend:Qt,legendHoverBehavior:ti,legendClickBehavior:li,legendHighlightedCategory:ci,legendIsolatedCategories:hi,legendPosition:di,legendLayout:gi,foregroundGraphics:Ee(ls,st(Ps.current?.customLayoutOverlays,yr??null)),marginalGraphics:rr,xValues:Ds,yValues:Es,annotations:It,onAnnotationActivate:Wt,onObservation:Dt??Tt,chartId:Et,chartType:"StreamXYFrame",autoPlaceAnnotations:Gt,svgAnnotationRules:Jt,annotationFrame:rs,xAccessor:oo,yAccessor:ao,annotationData:no(Ps.current?.getData()),pointNodes:F(Ps.current?.scene),curve:"string"==typeof w?w:void 0,underlayRendered:!0,canvasObscuresUnderlay:!!Ge({background:ae,hasBackgroundGraphics:!!ki,themeBackground:Xr?.colors.background}),linkedCrosshairName:hr,linkedCrosshairSourceId:ur}),(Oi||Bi)&&Er(e,{width:Zr,height:Qr,totalWidth:Wr[0],totalHeight:Wr[1],margin:Jr,dimension:Oi?.dimension??"xy",scales:as,onBrush:Bi??(()=>{}),binSize:C,snap:Oi?.snap,binBoundaries:Oi?.binBoundaries??("bar"===r?Ps.current?.getBinBoundaries():void 0),snapDuring:Oi?.snapDuring,streaming:"streaming"===s}),Ni?.showBadge&&Er(Me,{isStale:bs,position:Ni.badgePosition}),io,eo]})]})}));zr.displayName="StreamXYFrame";var Fr=zr;import{useCallback as $r,useRef as Nr}from"react";export{S as provideMarginalGraphics,N as DefaultTooltip,Fr as StreamXYFrame_default,X as useXYBrush};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function t(t,l,i,n,c){if(0>=l.size)return;let f=l.glyph;if(!f||!f.parts?.length)return;let s=a(f,l.size);if(0>=s.scale)return;let p=(l.style.opacity??1)*(l._decayOpacity??1);if(0>=p)return;let y=l=>{let e=r(t,l,l);return"string"==typeof e?e:l},h=l.color??("string"==typeof l.style.fill?l.style.fill:void 0);t.save(),t.translate(i,n),l.rotation&&t.rotate(l.rotation),t.translate(s.offsetX,s.offsetY),t.scale(s.scale,s.scale),t.globalAlpha=c*p*(l.style.fillOpacity??1);let g=o(f,l.fraction??1,l.fractionStart??0,l.fractionDirection??"horizontal");g&&l.ghostColor&&e(t,f,h,l.accent,l.ghostColor,y),g&&(t.beginPath(),t.rect(g.x,g.y,g.width,g.height),t.clip()),e(t,f,h,l.accent,void 0,y),t.restore()}function l(l,e){let o=l.globalAlpha;for(let a of e)"glyph"===a.type&&t(l,a,a.cx,a.cy,o);l.globalAlpha=o}import{drawGlyphParts as e,glyphFractionClipRect as o,glyphPlacement as a,resolveCanvasFill as r}from"./c-
|
|
1
|
+
function t(t,l,i,n,c){if(0>=l.size)return;let f=l.glyph;if(!f||!f.parts?.length)return;let s=a(f,l.size);if(0>=s.scale)return;let p=(l.style.opacity??1)*(l._decayOpacity??1);if(0>=p)return;let y=l=>{let e=r(t,l,l);return"string"==typeof e?e:l},h=l.color??("string"==typeof l.style.fill?l.style.fill:void 0);t.save(),t.translate(i,n),l.rotation&&t.rotate(l.rotation),t.translate(s.offsetX,s.offsetY),t.scale(s.scale,s.scale),t.globalAlpha=c*p*(l.style.fillOpacity??1);let g=o(f,l.fraction??1,l.fractionStart??0,l.fractionDirection??"horizontal");g&&l.ghostColor&&e(t,f,h,l.accent,l.ghostColor,y),g&&(t.beginPath(),t.rect(g.x,g.y,g.width,g.height),t.clip()),e(t,f,h,l.accent,void 0,y),t.restore()}function l(l,e){let o=l.globalAlpha;for(let a of e)"glyph"===a.type&&t(l,a,a.cx,a.cy,o);l.globalAlpha=o}import{drawGlyphParts as e,glyphFractionClipRect as o,glyphPlacement as a,resolveCanvasFill as r}from"./c-MB6CV5NC.min.js";var i=(l,e)=>{let o=l.globalAlpha;for(let a of e)"glyph"===a.type&&t(l,a,a.x,a.y,o);l.globalAlpha=o};export{i as glyphCanvasRenderer,l as networkGlyphRenderer};
|