semiotic 3.10.2 → 3.10.4
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 +21 -26
- package/ai/artifact-surface-inventory.json +1 -1
- package/ai/behaviorContracts.cjs +15 -5
- package/ai/behaviorContracts.d.cts +3 -0
- package/ai/cli.js +17 -166
- package/ai/componentMetadata.cjs +68 -15
- package/ai/componentMetadata.d.cts +3 -0
- package/ai/dist/diagnose-operation.js +3 -0
- package/ai/dist/mcp-server.js +59 -59
- package/ai/reference.md +6 -6
- package/ai/schema.json +1 -1
- package/ai/surface-manifest.json +1 -1
- package/ai/system-prompt.md +2 -2
- package/ai/task-packets/compare-category-totals.json +7 -7
- package/ai/task-packets/compare-category-totals.md +3 -3
- package/ai/task-packets/correct-published-chart.json +7 -7
- 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 +7 -7
- package/ai/task-packets/update-live-chart.md +3 -3
- package/dist/c-2MHSD3TN.min.js +209 -0
- package/dist/{c-PZ3NEGNG.min.js → c-6XGGN5OS.min.js} +1 -1
- package/dist/{c-FDUQDCBC.min.js → c-CO4NDAD6.min.js} +23 -23
- package/dist/c-EK6XI2U7.min.js +26 -0
- package/dist/c-FMCUQ6JX.min.js +1 -0
- package/dist/{c-C4KIXUWU.min.js → c-GK263BF4.min.js} +1 -1
- package/dist/{c-TTKWXGAI.min.js → c-HNHKIMIV.min.js} +3 -3
- package/dist/c-IJCZGUG6.min.js +31 -0
- package/dist/{c-4XLHPQTP.min.js → c-JBWPJNTJ.min.js} +1 -1
- package/dist/{c-4MD53L2J.min.js → c-JC76YAHB.min.js} +28 -28
- package/dist/{c-VXIYF7V2.min.js → c-JOPGDP6N.min.js} +1 -1
- package/dist/c-KWP4QTCM.min.js +4 -0
- package/dist/c-LRV7PO45.min.js +393 -0
- package/dist/c-LVHJJUOF.min.js +1 -0
- package/dist/c-M43PK7K4.min.js +1 -0
- package/dist/c-NUBZ63VU.min.js +1 -0
- package/dist/{c-7ASK4WBF.min.js → c-PITYSOPK.min.js} +1 -1
- package/dist/{c-2TW5H5PD.min.js → c-QPO24R7Q.min.js} +1 -1
- package/dist/{c-SG2Y7EBY.min.js → c-RWHLEUX6.min.js} +1 -1
- package/dist/{c-4JKDJUYD.min.js → c-S746GRV4.min.js} +1 -1
- package/dist/{c-KGROWFT2.min.js → c-SAP5KY6R.min.js} +2 -2
- package/dist/c-UMGHCBH5.min.js +114 -0
- package/dist/c-UQBWSYKI.min.js +41 -0
- package/dist/{c-6ZU3QVLB.min.js → c-VEMCBQZZ.min.js} +33 -33
- package/dist/{c-IPYGNVN6.min.js → c-WD2RL76M.min.js} +45 -45
- package/dist/{c-PQOZPM4G.min.js → c-YL7HJL5J.min.js} +1 -1
- package/dist/c-Z6GRGS53.min.js +1 -0
- package/dist/components/CategoryColors.d.ts +7 -0
- package/dist/components/LinkedCharts.d.ts +2 -1
- package/dist/components/ai/chartClinic.d.ts +1 -1
- package/dist/components/ai/chartClinicMetadata.generated.d.ts +2 -2
- package/dist/components/charts/shared/{chartDefinitionPilot.d.ts → chartDefinition.d.ts} +30 -34
- package/dist/components/charts/shared/chartDefinitions.d.ts +10 -0
- package/dist/components/charts/shared/chartDefinitionsNetwork.d.ts +17 -0
- package/dist/components/charts/shared/chartDefinitionsOrdinal.d.ts +23 -0
- package/dist/components/charts/shared/chartDefinitionsPhysics.d.ts +17 -0
- package/dist/components/charts/shared/chartDefinitionsRealtime.d.ts +12 -0
- package/dist/components/charts/shared/chartDefinitionsXY.d.ts +26 -0
- package/dist/components/charts/shared/useChartSetup.d.ts +1 -1
- package/dist/components/charts/shared/useNetworkChartSetup.d.ts +1 -1
- package/dist/components/data/transforms.d.ts +1 -0
- package/dist/components/server/serverChartConfigs.d.ts +36 -36
- package/dist/components/server/serverChartConfigsNetwork.generated.d.ts +17 -0
- package/dist/components/server/serverChartConfigsOrdinal.generated.d.ts +23 -0
- package/dist/components/server/serverChartConfigsPhysics.generated.d.ts +17 -0
- package/dist/components/server/serverChartConfigsRealtime.generated.d.ts +13 -0
- package/dist/components/server/serverChartConfigsXY.generated.d.ts +22 -0
- package/dist/components/stream/physics/PhysicsOptionalEngineAdapters.d.ts +5 -0
- package/dist/geo.min.js +3 -3
- package/dist/geo.module.min.js +10 -10
- package/dist/network.module.min.js +1 -1
- package/dist/ordinal.module.min.js +1 -1
- package/dist/physics-matter.min.js +4 -1
- package/dist/physics-matter.module.min.js +1 -1
- package/dist/physics-rapier.min.js +4 -1
- package/dist/physics-rapier.module.min.js +1 -1
- package/dist/physics.module.min.js +1 -1
- package/dist/physicsWorker.js +1 -1
- package/dist/semiotic-ai-core.min.js +3 -3
- package/dist/semiotic-ai-core.module.min.js +3 -3
- package/dist/semiotic-ai.module.min.js +7 -7
- package/dist/semiotic-artifact.min.js +1 -1
- package/dist/semiotic-artifact.module.min.js +1 -1
- package/dist/semiotic-atlas-selection.module.min.js +1 -1
- package/dist/semiotic-client-cjs-shared.min.js +903 -902
- package/dist/semiotic-data.min.js +1 -1
- package/dist/semiotic-data.module.min.js +1 -1
- package/dist/semiotic-experimental-auxiliary.module.min.js +3 -3
- package/dist/semiotic-experimental-node-auxiliary.module.min.js +3 -3
- 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.module.min.js +13 -13
- package/dist/semiotic-server-edge-node.module.min.js +393 -391
- package/dist/semiotic-server-edge.min.js +393 -391
- package/dist/semiotic-server-edge.module.min.js +374 -372
- package/dist/semiotic-server-node.min.js +393 -391
- package/dist/semiotic-server-node.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 +10 -10
- package/dist/server.min.js +393 -391
- package/dist/server.module.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +12 -8
- package/dist/c-3OFVBWQY.min.js +0 -1
- package/dist/c-6IVBV5NO.min.js +0 -1
- package/dist/c-72CBVNYX.min.js +0 -209
- package/dist/c-7LY46QUI.min.js +0 -41
- package/dist/c-AKLBQMQF.min.js +0 -391
- package/dist/c-F2GGJB2S.min.js +0 -31
- package/dist/c-G53AVC42.min.js +0 -113
- package/dist/c-HQ27AHMC.min.js +0 -1
- package/dist/c-IHWZ2C6D.min.js +0 -26
- package/dist/c-MOP2NGLH.min.js +0 -1
- package/dist/c-PKY4JFY5.min.js +0 -1
- package/dist/c-UBHICVSC.min.js +0 -1
package/dist/c-F2GGJB2S.min.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
function e(e){let t=2166136261;for(let i=0;e.length>i;i++)t^=e.charCodeAt(i),t=Math.imul(t,16777619);return t^=t>>>16,t=Math.imul(t,2146121005),t^=t>>>15,t=Math.imul(t,2221713035),t^=t>>>16,t>>>0}function t(e){return"p"+(Math.round(1e3*e)/10+"").replace(".","_")}function i(e,t,i){let s=e.length;for(e.push(t);s>0;){let n=s-1>>>1;if(0>=i(e[n],t))break;e[s]=e[n],s=n}e[s]=t}function s(e,t){let i=e[0],s=e.pop();if(e.length>0){let i=0;for(;e.length>2*i+1;){let n=2*i+1;if(e.length>n+1&&0>t(e[n+1],e[n])&&n++,0>=t(s,e[n]))break;e[i]=e[n],i=n}e[i]=s}return i}function n(e,t){switch(t){case"distinct":return e.distinct??0;case"p50":case"p95":case"p99":return e.percentiles?.[t]??NaN;default:return e[t]??e.mean}}function o(e,t,i,s=1){if("none"===t)return null;if("minmax"===t)return[e.min,e.max];let o=n(e,i),r=e.stddev*s;return[o-r,o+r]}function r(e){if("number"==typeof e)return Number.isFinite(e)&&e>0?e:null;if("string"!=typeof e)return null;let t=e.trim();if(""===t)return null;pe.lastIndex=0;let i,s=0,n=0;for(;null!==(i=pe.exec(t));){let e=parseFloat(i[1]),t=ge[i[2]];if(null==t||!Number.isFinite(e))return null;s+=e*t,n+=i[0].length}return n!==t.length?null:s>0?s:null}function a(e,t){return e.time-t.time||e.order-t.order}function l(e,t,i){return null==e?void 0:"function"==typeof t?t(e):e["string"==typeof t?t:i]}function c(e){return null==e?"":"number"==typeof e?Number.isInteger(e)?e+"":e.toFixed(2):e instanceof Date?e.toLocaleString():e+""}function u(e={}){let{timeAccessor:t,valueAccessor:i,xLabel:s="x",yLabel:n="y"}=e;return e=>{let o=e?.data??null,r=l(o,t,"time"),a=l(o,i,"value");/* @__PURE__ */
|
|
2
|
-
return _e("div",{className:"semiotic-tooltip",style:Se,children:[
|
|
3
|
-
/* @__PURE__ */_e("div",{children:[
|
|
4
|
-
/* @__PURE__ */_e("span",{style:He,children:[s,":"]}),c(r)]}),
|
|
5
|
-
/* @__PURE__ */_e("div",{children:[
|
|
6
|
-
/* @__PURE__ */_e("span",{style:He,children:[n,":"]}),c(a)]})]})}}function h(e={}){let{timeAccessor:t,valueAccessor:i}=e;return e=>{let s=e?.data??null,n=l(s,t,"time"),o=s?.delta??l(s,i,"value"),r=s?.cumEnd,a="number"!=typeof o||0>o?c(o):"+"+c(o);/* @__PURE__ */
|
|
7
|
-
return _e("div",{className:"semiotic-tooltip",style:Se,children:[
|
|
8
|
-
/* @__PURE__ */_e("div",{children:[
|
|
9
|
-
/* @__PURE__ */Ce("span",{style:He,children:"x:"}),c(n)]}),
|
|
10
|
-
/* @__PURE__ */_e("div",{children:[
|
|
11
|
-
/* @__PURE__ */Ce("span",{style:He,children:"Δ:"}),a]}),null!=r&&/* @__PURE__ */_e("div",{children:[
|
|
12
|
-
/* @__PURE__ */Ce("span",{style:He,children:"total:"}),c(r)]})]})}}function m(e={}){let{timeAccessor:t,valueAccessor:i}=e;return e=>{let s=e?.data??null;if(null==s?.binStart||null==s?.binEnd){let e=l(s,t,"time"),n=l(s,i,"value");/* @__PURE__ */
|
|
13
|
-
return _e("div",{className:"semiotic-tooltip",style:Se,children:[
|
|
14
|
-
/* @__PURE__ */_e("div",{children:[
|
|
15
|
-
/* @__PURE__ */Ce("span",{style:He,children:"x:"}),c(e)]}),
|
|
16
|
-
/* @__PURE__ */_e("div",{children:[
|
|
17
|
-
/* @__PURE__ */Ce("span",{style:He,children:"y:"}),c(n)]})]})}/* @__PURE__ */
|
|
18
|
-
return _e("div",{className:"semiotic-tooltip",style:Se,children:[
|
|
19
|
-
/* @__PURE__ */_e("div",{children:[
|
|
20
|
-
/* @__PURE__ */Ce("span",{style:He,children:"range:"}),c(s.binStart),"–",c(s.binEnd)]}),null!=s.total&&/* @__PURE__ */_e("div",{children:[
|
|
21
|
-
/* @__PURE__ */Ce("span",{style:He,children:"count:"}),c(s.total)]}),null!=s.category&&/* @__PURE__ */_e("div",{children:[
|
|
22
|
-
/* @__PURE__ */Ce("span",{style:He,children:"category:"}),c(s.category)]})]})}}function d(e={}){let{timeAccessor:t,valueAccessor:i,xLabel:s="x",yLabel:n="y"}=e;return e=>{let o=e?.data??null,r=o?.xCenter??l(o,t,"time"),a=o?.yCenter??l(o,i,"value"),u=o?.count,h=o?.sum,m=o?.value,d=o?.agg??"count";/* @__PURE__ */
|
|
23
|
-
return _e("div",{className:"semiotic-tooltip",style:Se,children:[
|
|
24
|
-
/* @__PURE__ */_e("div",{children:[
|
|
25
|
-
/* @__PURE__ */_e("span",{style:He,children:[s,":"]}),c(r)]}),
|
|
26
|
-
/* @__PURE__ */_e("div",{children:[
|
|
27
|
-
/* @__PURE__ */_e("span",{style:He,children:[n,":"]}),c(a)]}),null!=u&&/* @__PURE__ */_e("div",{children:[
|
|
28
|
-
/* @__PURE__ */Ce("span",{style:He,children:"count:"}),c(u)]}),"sum"===d&&null!=h&&/* @__PURE__ */_e("div",{children:[
|
|
29
|
-
/* @__PURE__ */Ce("span",{style:He,children:"sum:"}),c(h)]}),"mean"===d&&null!=m&&/* @__PURE__ */_e("div",{children:[
|
|
30
|
-
/* @__PURE__ */Ce("span",{style:He,children:"mean:"}),c(m)]})]})}}function g(e,t,i){return e??i??Math.max(t?.length??0,200)}function p(e){let t=e.window??"tumbling",i=r("session"===t?e.gap??e.size:e.size);if(null==i)return null;let s=null!=e.hop?r(e.hop):void 0,n=null!=e.gap?r(e.gap):void 0;return new de({window:t,size:i,hop:s??void 0,gap:n??void 0,retain:e.retain,percentiles:e.percentiles,distinct:e.distinct})}function v(e,t){let i=t.stat??"mean",s=t.band??"none",r=t.sigma??1;return e.emit().map(e=>{let t={[Me]:(e.start+e.end)/2,[Pe]:n(e,i),[Ne]:e.count,[Re]:e.partial,[ze]:e.start,[Be]:e.end},a=o(e,s,i,r);return a&&(t[Te]=a[0],t[Ie]=a[1]),t})}function f(e,t,i){let s="function"==typeof t?t(e):e[(t??i)+""];if(null==s||"string"==typeof s&&""===s.trim())return null;let n=Number(s);return Number.isFinite(n)?n:null}function w(e,t){let i=r(e.lateness);return null==i?null:new ve({lateness:i,getTime:t,latePolicy:e.latePolicy??"drop"})}function y(e){return{...K(e.mode,{width:e.size?.[0]??e.width,height:e.size?.[1]??e.height,showAxes:e.showAxes,showLegend:e.showLegend,enableHover:null==e.enableHover?void 0:!!e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight}}function b(e,t){Le.useImperativeHandle(e,()=>({push:e=>t.current?.push(e),pushMany:e=>t.current?.pushMany(e),remove:e=>t.current?.remove(e)??[],update:(e,i)=>t.current?.update(e,e=>i(e))??[],clear:()=>t.current?.clear(),getData:()=>t.current?.getData()??[],getScales:()=>t.current?.getScales()??null}),[t])}function x(e,t,i){let s=t.find(Boolean)??null;return Le.useMemo(()=>s?ee(e??Oe,s,i):e,[s,e,i])}function A(e,t,i){return{responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,legendHoverBehavior:t.onLegendHover,legendClickBehavior:t.onLegendClick,legendHighlightedCategory:t.highlightedCategory,legendIsolatedCategories:"isolate"===i?t.isolatedCategories:void 0}}function k(e,t,i,s=!1){let n=se({axes:t,showAxes:i});return{...j(e,t,s),...!n.hasAxis&&{bottom:0},...!n.leftAxis?.hasAxis&&{left:0}}}function C({enabled:e,categories:t,colors:i,fallbackColor:s,order:n="discovery",domainKey:o}){let r=Z(),a=ie(),l=V(),c="function"==typeof o?qe:o,u=Ue(null),h=Ge(()=>{let e=u.current,s=e&&Object.is(e.domainKey,c)?new Map(e.indexes):/* @__PURE__ */new Map,o=new Set(t),r="explicit-then-alpha"===n?[...Object.keys(i??{}).filter(e=>o.has(e)),...t.filter(e=>!Object.prototype.hasOwnProperty.call(i??{},e)).sort()]:t;for(let e of r)te(s,e);return{domainKey:c,indexes:s}},[t,i,n,c]);Je(()=>{u.current=h},[h]);let m=h.indexes,d=Ge(()=>{if(!e)return;let t=l&&l.length>0?l:a?oe:re;return e=>{let n=te(m,e);return(r?ae(r,e):void 0)||(i?ae(i,e):void 0)||s||t[n%t.length]}},[m,i,e,s,a,r,l]),g=Ge(()=>{if(!e||!d)return i;let s=Object.keys(i??{}),o=new Set(s),r=t.filter(e=>!o.has(e));"explicit-then-alpha"===n&&r.sort();let a=[...s,...r];if(0===a.length)return;let l=new Set(t),c=[];for(let e of a){if(l.has(e)){c.push([e,d(e)]);continue}let t=i?ae(i,e):void 0;t&&c.push([e,t])}return c.length>0?Object.fromEntries(c):void 0},[t,d,i,e,n]);return{colorScale:d,colorMap:g}}function _(e){/* @__PURE__ */
|
|
31
|
-
return Qe(et,{...e,windowMode:"growing"})}import{a as S}from"./c-C4KIXUWU.min.js";import{d as H,e as M,f as P,g as T}from"./c-AXJ2QI3F.min.js";import{d as I,e as R}from"./c-TTKWXGAI.min.js";import{a as N,h as z}from"./c-MTX2AO5S.min.js";import{a as B}from"./c-PKY4JFY5.min.js";import{C as F,Y as D,_ as L}from"./c-KGROWFT2.min.js";import{Bb as O,C as j,Cb as E,Db as W,Eb as V,Kb as $,Mb as K,Ob as Y,Sa as X,Ta as G,Tb as U,Ua as q,bb as J,cb as Q,fb as Z,jb as ee,tb as te,vb as ie,y as se}from"./c-G53AVC42.min.js";import{d as ne,m as oe,p as re,s as ae}from"./c-Y342FJ6K.min.js";var le=class e{constructor(){this._count=0,this._mean=0,this._m2=0,this._min=1/0,this._max=-1/0}push(e){if(!Number.isFinite(e))return;this._count+=1;let t=e-this._mean;this._mean+=t/this._count,this._m2+=t*(e-this._mean),this._min>e&&(this._min=e),e>this._max&&(this._max=e)}merge(e){if(0===e._count)return;if(0===this._count)return this._count=e._count,this._mean=e._mean,this._m2=e._m2,this._min=e._min,void(this._max=e._max);let t=this._count+e._count,i=e._mean-this._mean;this._mean+=i*e._count/t,this._m2+=e._m2+i*i*this._count*e._count/t,this._count=t,this._min>e._min&&(this._min=e._min),e._max>this._max&&(this._max=e._max)}clear(){this._count=0,this._mean=0,this._m2=0,this._min=1/0,this._max=-1/0}clone(){let t=new e;return t.merge(this),t}get count(){return this._count}get mean(){return this._mean}get sum(){return this._mean*this._count}get variance(){return 2>this._count?0:this._m2/this._count}get stddev(){return Math.sqrt(this.variance)}get sampleVariance(){return 2>this._count?0:this._m2/(this._count-1)}get sampleStddev(){return Math.sqrt(this.sampleVariance)}get min(){return this._min}get max(){return this._max}},ce=class t{constructor(e=10){let t=Math.max(4,Math.min(16,Math.floor(e)));this.p=t,this.m=1<<t,this.registers=new Uint8Array(this.m),this.alpha=.7213/(1+1.079/this.m),this.harmonicSum=this.m,this.zeros=this.m}add(t){let i=e(t+""),s=i>>>32-this.p,n=Math.min(Math.clz32(i<<this.p),32-this.p)+1;this.updateRegister(s,n)}updateRegister(e,t){let i=this.registers[e];i>=t||(this.registers[e]=t,this.harmonicSum+=2**-t-2**-i,0===i&&this.zeros--)}merge(e){if(e.m===this.m)for(let t=0;this.m>t;t++)this.updateRegister(t,e.registers[t])}clone(){let e=new t(this.p);return e.registers.set(this.registers),e.harmonicSum=this.harmonicSum,e.zeros=this.zeros,e}count(){let e=this.alpha*this.m*this.m/this.harmonicSum;return Math.round(2.5*this.m>=e&&this.zeros>0?this.m*Math.log(this.m/this.zeros):e)}},ue=class e{constructor(e=100){this.centroids=[],this.total=0,this.pending=0,this.compression=Math.max(20,e)}push(e){Number.isFinite(e)&&(this.centroids.push({mean:e,weight:1}),this.total+=1,this.pending++,this.pending>=2*this.compression&&this.compress())}merge(e){if(0===e.total)return;let t=0===this.total,i=e.centroids.length;for(let t=0;i>t;t++)this.centroids.push({...e.centroids[t]});this.total+=e.total,this.pending=t&&this.compression===e.compression?e.pending:this.pending+i,t||this.compress()}clone(){let t=new e(this.compression);return t.merge(this),t}quantile(e){if(0===this.total||Number.isNaN(e))return NaN;let t=Math.min(1,Math.max(0,e));this.compress();let i=t*this.total,s=this.centroids[0].weight/2;if(s>=i)return this.centroids[0].mean;for(let e=1;this.centroids.length>e;e++){let t=this.centroids[e-1],n=this.centroids[e],o=(t.weight+n.weight)/2,r=s+o;if(r>=i)return t.mean+(i-s)/o*(n.mean-t.mean);s=r}return this.centroids[this.centroids.length-1].mean}get count(){return this.total}compress(){if(0===this.pending||(this.pending=0,1>=this.centroids.length))return;this.centroids.sort((e,t)=>e.mean-t.mean);let e=0,t=0,i=this.total,s=this.compression;for(let n=1;this.centroids.length>n;n++){let o=this.centroids[e],r=this.centroids[n],a=(t+o.weight/2)/i;if(o.weight+r.weight>Math.max(1,4*i*a*(1-a)/s))t+=o.weight,this.centroids[++e]=r;else{let e=o.weight+r.weight;o.mean=(o.mean*o.weight+r.mean*r.weight)/e,o.weight=e}}this.centroids.length=e+1}},he=(e,t)=>e-t,me=class{constructor(e,t){this.stats=new le,this.digest=e?new ue:null,this.hll=t?new ce:null}push(e,t){this.stats.push(e),this.digest?.push(e),this.hll&&this.hll.add(t??e)}merge(e){this.stats.merge(e.stats),this.digest?.merge(e.digest),this.hll?.merge(e.hll)}},de=class{constructor(e){this.windows=/* @__PURE__ */new Map,this.starts=[],this.sessions=[],this.latest=-1/0,this.type=e.window??"tumbling",this.size=e.size;let t=e.hop??e.size;this.hop=t>0&&e.size>=t?t:e.size,this.gap=e.gap??e.size,this.retain=null!=e.retain&&e.retain>0?e.retain:1/0,this.percentiles=e.percentiles??[],this.wantDistinct=!0===e.distinct}newBucket(){return new me(this.percentiles.length>0,this.wantDistinct)}push(e,t,i){!Number.isFinite(e)||!Number.isFinite(t)||(e>this.latest&&(this.latest=e),"session"===this.type?this.pushSession(e,t,i):this.pushFixed(e,t,i),this.prune())}pushFixed(e,t,i){if("tumbling"===this.type||this.hop>=this.size)return void this.bump(Math.floor(e/this.size)*this.size,t,i);let s=this.hop,n=Math.floor(e/s);for(let o=Math.floor((e-this.size)/s)+1;n>=o;o++)this.bump(o*s,t,i)}bump(e,t,s){let n=this.windows.get(e);if(!n){if(this.windows.size>=this.retain&&this.starts[0]>e)return;n=this.newBucket(),this.windows.set(e,n),this.retain!==1/0&&i(this.starts,e,he)}n.push(t,s)}pushSession(e,t,i){let s=e-this.gap,n=e+this.gap,o=0,r=this.sessions.length,a=this.sessions[r-1];if(a&&a.end>e)for(;r>o;){let e=o+r>>>1;s>this.sessions[e].end?o=e+1:r=e}else o=r,a&&a.end>=s&&n>=a.start&&o--;let l=this.sessions[o];if(!l||l.start>n){let s=this.newBucket();return s.push(t,i),void this.sessions.splice(o,0,{start:e,end:e,bucket:s})}l.bucket.push(t,i),l.start=Math.min(l.start,e),l.end=Math.max(l.end,e);let c=o+1;for(;this.sessions.length>c&&n>=this.sessions[c].start;){let e=this.sessions[c++];l.bucket.merge(e.bucket),l.end=Math.max(l.end,e.end)}c>o+1&&this.sessions.splice(o+1,c-o-1)}prune(){if(this.retain!==1/0){if("session"===this.type)return void(this.sessions.length>this.retain&&this.sessions.splice(0,this.sessions.length-this.retain));for(;this.windows.size>this.retain;)this.windows.delete(s(this.starts,he))}}emit(){if("session"===this.type)return this.sessions.map(e=>this.row(e.start,e.end,e.bucket,this.gap>this.latest-e.end));let e=[];for(let[t,i]of this.windows){let s=t+this.size;e.push(this.row(t,s,i,s>this.latest))}return e.sort((e,t)=>e.start-t.start),e}row(e,i,s,n){let o=s.stats,r={start:e,end:i,count:o.count,mean:o.mean,sum:o.sum,min:o.min,max:o.max,stddev:o.stddev,partial:n};if(s.digest){let e={};for(let i of this.percentiles)e[t(i)]=s.digest.quantile(i);r.percentiles=e}return s.hll&&(r.distinct=s.hll.count()),r}get windowCount(){return"session"===this.type?this.sessions.length:this.windows.size}get watermark(){return this.latest}clear(){this.windows.clear(),this.starts=[],this.sessions=[],this.latest=-1/0}},ge={ms:1,s:1e3,m:6e4,h:36e5,d:864e5},pe=/(\d+(?:\.\d+)?)(ms|s|m|h|d)/g,ve=class{constructor(e){this.held=[],this.nextOrder=0,this._watermark=-1/0,this._releasedThrough=-1/0,this._lateCount=0,this.lateness=e.lateness>0?e.lateness:0,this.getTime=e.getTime,this.latePolicy=e.latePolicy??"drop"}push(e){let t=this.getTime(e);if(!Number.isFinite(t))return{released:[e],late:[]};let s=[];return this._watermark!==-1/0&&Math.max(this._watermark-this.lateness,this._releasedThrough)>t?(this._lateCount+=1,s.push(e),"drop"===this.latePolicy?{released:[],late:s}:{released:[e],late:s}):(t>this._watermark&&(this._watermark=t),i(this.held,{item:e,time:t,order:this.nextOrder++},a),{released:this.drain(this._watermark-this.lateness),late:s})}drain(e){let t=[],i=this.held[0];for(;i&&e>=i.time;)s(this.held,a),t.push(i.item),this._releasedThrough=Math.max(this._releasedThrough,i.time),i=this.held[0];return t}flush(){return this.drain(1/0)}clear(){this.held=[],this.nextOrder=0,this._watermark=-1/0,this._releasedThrough=-1/0,this._lateCount=0}get watermark(){return this._watermark}get lateCount(){return this._lateCount}get heldCount(){return this.held.length}};import{useRef as fe,useImperativeHandle as we,forwardRef as ye,useCallback as be,useState as xe,useEffect as Ae,useMemo as ke}from"react";import{jsx as Ce,jsxs as _e}from"react/jsx-runtime";var Se={background:"var(--semiotic-tooltip-bg, rgba(0, 0, 0, 0.85))",color:"var(--semiotic-tooltip-text, #f3f4f6)",padding:"6px 10px",borderRadius:"var(--semiotic-tooltip-radius, 4px)",fontSize:"var(--semiotic-tooltip-font-size, 12px)",fontFamily:"var(--semiotic-tick-font-family, var(--semiotic-font-family, sans-serif))",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0, 0, 0, 0.25))",lineHeight:1.4,pointerEvents:"none",whiteSpace:"nowrap"},He={opacity:.7,marginRight:4},Me="time",Pe="value",Te="__aggLower",Ie="__aggUpper",Re="__aggPartial",Ne="count",ze="__aggStart",Be="__aggEnd",Fe="__aggSeries",De=class{constructor(e,t){this.config=e,this.seriesAccessor=t,this.groups=/* @__PURE__ */new Map}push(e,t,i){let s=f(e,t,"time"),n=f(e,i,"value");if(null==s||null==n)return;let o=null==this.seriesAccessor?"":("function"==typeof this.seriesAccessor?this.seriesAccessor(e):e[this.seriesAccessor])+"",r=this.groups.get(o);if(!r){if(r=p(this.config),!r)return;this.groups.set(o,r)}r.push(s,n)}emit(e){let t=[];for(let[i,s]of this.groups)for(let n of v(s,e))t.push(null==this.seriesAccessor?n:{...n,[Fe]:i});return t}clear(){this.groups.clear()}};import*as Le from"react";var Oe=()=>({});import{jsx as je}from"react/jsx-runtime";N(z);var Ee=ye(function(e,t){let i=y(e),{size:s,margin:n,className:o,arrowOfTime:r="right",windowMode:a,capacityMode:l,windowSize:c,capacity:h,seriesAccessor:m,data:d,timeAccessor:p,valueAccessor:v,timeExtent:b,valueExtent:k,extentPadding:C,stroke:_,strokeWidth:S,strokeDasharray:H,opacity:M,cursor:P,styleRules:T,background:R,tooltipContent:N,tooltip:z,onHover:B,annotations:F,autoPlaceAnnotations:j,svgAnnotationRules:W,tickFormatTime:V,tickFormatValue:K,decay:G,pulse:Z,staleness:ee,transition:te,linkedHover:ie,selection:se,onObservation:ne,chartId:oe,loading:re,loadingContent:ae,emptyContent:le,emphasis:ce,legendPosition:ue,aggregate:he,eventTime:me}=e,de=i.showAxes,ge=i.enableHover,pe=s??[i.width,i.height],ve=_??"#007bff",ye=S??2,Ce="string"==typeof v?v:"Value",_e=ke(()=>{if(i.showLegend)return{legendGroups:[{label:"Series",type:"line",items:[{label:Ce,color:ve}],styleFn:e=>({stroke:e.color||"var(--semiotic-primary, #007bff)",strokeWidth:ye??2})}]}},[i.showLegend,Ce,ve,ye]),Se=E(e.legendInteraction,()=>Ce,[Ce]),{legend:He,margin:Re,legendPosition:Ne}=O({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:ue,userMargin:n,defaults:i.marginDefaults,additionalLegend:_e,chartWidth:pe[0],chartHeight:pe[1],axisChrome:{hasAxis:!1!==i.showAxes}}),ze=u({timeAccessor:p,valueAccessor:v}),Be=q(),Le=X({tooltip:z,defaultTooltipContent:ze,customFunctionContext:"hover",multiDefaultContent:e=>Be({...e,allSeries:Array.isArray(e.allSeries)?e.allSeries.map(e=>({...e,group:e.group||("string"==typeof v?v:"value")})):e.allSeries})}),Oe=N??Le.tooltipContent,Ee=fe(null),{activeSelectionHook:We,customHoverBehavior:Ve,customClickBehavior:$e}=$({selection:se,linkedHover:ie,unwrapData:!0,onObservation:ne,chartType:"RealtimeLineChart",chartId:oe,mobileInteraction:i.mobileInteraction}),Ke=be(e=>{B&&B(e),Ve(e)},[B,Ve]),Ye=null!=he,[Xe,Ge]=xe([]),Ue=fe(null),qe=fe(he);qe.current=he;let Je=fe(Ye);Je.current=Ye;let Qe=fe(Xe),Ze=be(e=>{Qe.current=e,Ge(e)},[]),et=fe({timeAccessor:p,valueAccessor:v});et.current={timeAccessor:p,valueAccessor:v};let tt=Ye?[he.window??"tumbling",he.size,he.hop??"",he.gap??"",he.retain??"",(he.percentiles??[]).join(","),!0===he.distinct?"1":"0"].join("|"):"";Ae(()=>{if(!Ye)return void(Ue.current=null);let e=qe.current,t=new De(e,m);if(Ue.current=t,d){let{timeAccessor:e,valueAccessor:i}=et.current;for(let s of d)t.push(s,e,i)}Ze(t.emit(e))},[tt,Ye,d,p,v,m,Ze]),Ae(()=>{Ye&&Ue.current&&Ze(Ue.current.emit(qe.current))},[he?.stat,he?.band,he?.sigma]);let it=be(e=>{let t=Ue.current,i=qe.current;if(!t||!i)return;let{timeAccessor:s,valueAccessor:n}=et.current;for(let i of e)t.push(i,s,n);Ze(t.emit(i))},[Ze]),st=null!=me,nt=fe(null),ot=fe(me);ot.current=me;let rt=fe(st);rt.current=st;let at=fe(ne);at.current=ne;let lt=fe(oe);lt.current=oe;let ct=st?`${me.lateness}|${me.latePolicy??"drop"}`:"",ut=be(e=>{0!==e.length&&(Je.current?it(e):Ee.current?.pushMany(e))},[it]);Ae(()=>{let e=nt.current;if(e&&ut(e.flush()),!st)return void(nt.current=null);let t=p;nt.current=w(ot.current,e=>f(e,t,"time")??NaN)},[ct,st,ut,p]);let ht=be(e=>{let t=nt.current;if(!rt.current||!t)return void ut(e);let i=[];for(let s of e){let e=t.push(s);for(let t of e.released)i.push(t);if(e.late.length){let i=at.current;if(i){let{timeAccessor:s}=et.current,n=ot.current?.latePolicy??"drop";for(let o of e.late)i({type:"late-data",datum:o,eventTime:f(o,s,"time")??NaN,watermark:t.watermark,policy:n,lateCount:t.lateCount,timestamp:Date.now(),chartType:"RealtimeLineChart",chartId:lt.current})}}}ut(i)},[ut]),mt=be(()=>{let e=nt.current;!rt.current||!e||ut(e.flush())},[ut]);we(t,()=>({push:e=>ht([e]),pushMany:e=>ht(e),flush:mt,remove:e=>Je.current?[]:Ee.current?.remove(e)??[],update:(e,t)=>Je.current?[]:Ee.current?.update(e,t)??[],clear:()=>{nt.current?.clear(),Je.current?(Ue.current?.clear(),Ze([])):Ee.current?.clear()},getData:()=>Je.current?Qe.current:Ee.current?.getData()??[],getScales:()=>Ee.current?.getScales()??null}),[mt,ht,Ze]);let dt=Q(re,pe[0],pe[1],ae),gt=dt?null:J(Ye?void 0:d,pe[0],pe[1],le),pt=ke(()=>()=>({stroke:"#007bff",strokeWidth:2}),[]),vt=ke(()=>Y(Ye?Me:p??"time",Ye?Pe:v??"value"),[Ye,p,v]),ft=ke(()=>U(pt,T,vt),[pt,T,vt]),wt=ke(()=>{let e=L(ft,{stroke:_,strokeWidth:S,opacity:M});return t=>({...e(t),...null!=H&&{strokeDasharray:H},...null!=P&&{cursor:P}})},[ft,_,S,M,H,P]),yt=x(wt,[We],se),bt=a??l??"sliding",xt=g(c,d,h),At=ce?`${o||""} semiotic-emphasis-${ce}`.trim():o,kt=Ye?Xe:d,Ct=Ye?Me:p,_t=Ye?Pe:v,St=Ye?"growing":bt,Ht=Ye?Math.max(1,he?.retain??Math.max(Xe.length,600)):xt,Mt=Ye&&he&&"none"!==(he.band??"none")?{y0Accessor:Te,y1Accessor:Ie,perSeries:null!=m}:void 0;return dt||gt||/* @__PURE__ */je(I,{ref:Ee,chartType:"line",runtimeMode:"streaming",size:pe,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:Re,className:At,...A(i,Se,e.legendInteraction),arrowOfTime:r,windowMode:St,windowSize:Ht,data:kt,timeAccessor:Ct,valueAccessor:_t,groupAccessor:Ye&&null!=m?Fe:m,xExtent:b,yExtent:k,extentPadding:C,band:Mt,lineStyle:yt??wt,showAxes:de,background:R,hoverAnnotation:ge,tooltipContent:Oe,tooltipMode:Le.tooltipMode,...D({linkedHover:ie,selection:se,onObservation:ne,forceHoverBehavior:!0,mobileInteraction:i.mobileInteraction,customHoverBehavior:Ke,customClickBehavior:$e}),annotations:F,legend:He,legendPosition:Ne,autoPlaceAnnotations:j,svgAnnotationRules:W,tickFormatTime:V,tickFormatValue:K,decay:G,pulse:Z,staleness:ee,transition:te,pointIdAccessor:e.pointIdAccessor})});Ee.displayName="RealtimeLineChart";import{useRef as We,forwardRef as Ve,useCallback as $e,useMemo as Ke}from"react";import{useEffect as Ye,useLayoutEffect as Xe,useMemo as Ge,useRef as Ue}from"react";var qe=/* @__PURE__ */Symbol("realtime-function-category-domain"),Je=typeof window>"u"?Ye:Xe;import{jsx as Qe}from"react/jsx-runtime";N(M);var Ze=[],et=Ve(function(e,t){let i=y(e),{binSize:s,size:n,margin:o,className:r,arrowOfTime:a="right",windowMode:l,capacityMode:c,windowSize:u,capacity:h,data:d,timeAccessor:p,valueAccessor:v,direction:w="up",timeExtent:_,valueExtent:S,extentPadding:H,categoryAccessor:M,colors:P,fill:T,stroke:N,strokeWidth:z,opacity:L,cursor:j,styleRules:W,gap:V,background:K,tooltipContent:Y,tooltip:X,onHover:q,annotations:Z,autoPlaceAnnotations:ee,svgAnnotationRules:te,tickFormatTime:ie,tickFormatValue:ne,linkedHover:oe,selection:re,decay:ae,pulse:le,staleness:ce,transition:ue,onObservation:he,chartId:me,loading:de,loadingContent:ge,emptyContent:pe,emphasis:ve,legendPosition:fe,legend:we,brush:ye,onBrush:be,linkedBrush:xe}=e,Ae=i.showAxes,ke=Ke(()=>{return(t={axes:e.axes,showTimeAxis:e.showTimeAxis,showValueAxis:e.showValueAxis}).axes??[{orient:"bottom",visible:!1!==t.showTimeAxis},{orient:"left",visible:!1!==t.showValueAxis}];var t},[e.axes,e.showTimeAxis,e.showValueAxis]),Ce=se({showAxes:Ae,axes:ke}),_e=k(i.marginDefaults,ke,Ae,!!i.title),Se=i.enableHover,He=n??[i.width,i.height],Me=B({isPushMode:void 0===d,colorBy:M,colorScheme:P,showLegend:!1,legendPosition:fe,trackCategoryDomain:!1!==i.showLegend,registerLinkedCategories:!1}),Pe=Ke(()=>F(d??[],M),[d,M]),Te=void 0===d?Me.categories:Pe,{colorScale:Ie,colorMap:Re}=C({enabled:!!M,categories:Te,colors:P,fallbackColor:T,order:"explicit-then-alpha",domainKey:M}),Ne=Ke(()=>{if(!Re)return Te;let e=new Set(Te);return Object.keys(Re).filter(t=>e.has(t))},[Te,Re]),ze=$e(e=>null!=e.category?e.category+"":("function"==typeof M?M(e):M?e[M]:"")+"",[M]),{legend:Be,margin:Fe,legendPosition:De,hasAutomaticLegend:Le}=O({data:Ze,colorBy:M,colorScale:Ie,showLegend:i.showLegend,legendPosition:fe,userMargin:o,defaults:_e,categories:Ne,additionalLegend:we,chartWidth:He[0],chartHeight:He[1],axisChrome:Ce}),Oe=E(e.legendInteraction,M?ze:void 0,Ne,Le,!0),je=Y??G({tooltip:X,defaultTooltipContent:m({timeAccessor:p,valueAccessor:v}),customFunctionContext:"hover"}).tooltipContent,Ee=We(null),{activeSelectionHook:Ve,hoverSelectionHook:Ye,customHoverBehavior:Xe,customClickBehavior:Ge}=$({selection:re,linkedHover:oe,unwrapData:!0,onObservation:he,chartType:"RealtimeHistogram",chartId:me,mobileInteraction:i.mobileInteraction}),Ue=$e(e=>{q&&q(e),Xe(e)},[q,Xe]),qe=!0===ye?{dimension:"x",snap:"bin"}:"x"===ye?{dimension:"x"}:"object"==typeof ye?ye:void 0,Je=$e(e=>{be&&be(e),he&&he(e?{type:"brush",extent:e,timestamp:Date.now(),chartType:"RealtimeHistogram",chartId:me}:{type:"brush-end",timestamp:Date.now(),chartType:"RealtimeHistogram",chartId:me})},[be,he,me]),{brushStreamProps:et}=R({linkedBrush:xe,xAccessor:"string"==typeof p?p:"time",defaultDimension:"x",onBrush:Je});b(t,Ee);let tt=Q(de,He[0],He[1],ge),it=tt?null:J(d,He[0],He[1],pe),st={};null!=T&&(st.fill=T),null!=N&&(st.stroke=N),null!=z&&(st.strokeWidth=z),null!=L&&(st.opacity=L),null!=j&&(st.cursor=j),null!=V&&(st.gap=V);let nt=Ke(()=>{if(M&&Ie)return e=>null==e.category?{}:{fill:Ie(e.category+"")}},[M,Ie]),ot=Ke(()=>e=>{let t=e.categoryValue??e.total,i="number"==typeof t&&Number.isFinite(t)?t:void 0,s=Number(e.binStart),n=Number(e.binEnd);return{value:i,x:Number.isFinite(s)&&Number.isFinite(n)?(s+n)/2:void 0,y:i,category:null==e.category?void 0:e.category+""}},[]),rt=Ke(()=>U(nt,W,ot),[nt,W,ot]),at=x(Ke(()=>e=>({...rt(e),...!M&&null!=T&&{fill:T},...null!=N&&{stroke:N},...null!=z&&{strokeWidth:z},...null!=L&&{opacity:L},...null!=j&&{cursor:j}}),[rt,M,T,N,z,L,j]),[Ye||Oe.legendSelectionHook||Ve],re),lt=ve?`${r||""} semiotic-emphasis-${ve}`.trim():r,ct=$e(e=>f(e,p,"time")??NaN,[p]),ut=$e(e=>f(e,v,"value")??NaN,[v]),ht=l??c??"sliding",mt=g(u,d,h);return tt||it||/* @__PURE__ */Qe(I,{ref:Ee,chartType:"bar",runtimeMode:"streaming",size:He,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:Fe,className:lt,...A(i,Oe,e.legendInteraction),arrowOfTime:a,windowMode:ht,windowSize:mt,data:d,timeAccessor:ct,valueAccessor:ut,xExtent:_,yExtent:S,invertY:"down"===w,extentPadding:H,binSize:s,categoryAccessor:M,barColors:Re,barStyle:st,areaStyle:at,showAxes:Ae,axes:ke,background:K,hoverAnnotation:Se,tooltipContent:je,...D({linkedHover:oe,selection:re,onObservation:he,forceHoverBehavior:!0,mobileInteraction:i.mobileInteraction,customHoverBehavior:Ue,customClickBehavior:Ge}),annotations:Z,autoPlaceAnnotations:ee,svgAnnotationRules:te,tickFormatTime:ie,tickFormatValue:ne,decay:ae,pulse:le,staleness:ce,transition:ue,pointIdAccessor:e.pointIdAccessor,legend:Be,legendPosition:De,...Me.categoryDomainProps,brush:qe||(xe?et.brush:void 0),onBrush:qe||xe?et.onBrush:void 0})});et.displayName="RealtimeHistogram",_.displayName="TemporalHistogram";var tt=et;import{useRef as it,forwardRef as st,useCallback as nt,useMemo as ot}from"react";import{jsx as rt}from"react/jsx-runtime";N(P);var at=[],lt=st(function(e,t){let i=y(e),{size:s,margin:n,className:o,arrowOfTime:r="right",windowMode:a,capacityMode:l,windowSize:c,capacity:h,data:m,timeAccessor:d,valueAccessor:p,timeExtent:v,valueExtent:f,yScaleType:w,extentPadding:k,decay:_,pulse:S,staleness:H,transition:M,categoryAccessor:P,colors:T,radius:R,fill:N,opacity:z,stroke:L,strokeWidth:j,cursor:W,pointStyle:V,styleRules:K,background:X,tooltipContent:q,tooltip:Z,onHover:ee,annotations:te,autoPlaceAnnotations:ie,svgAnnotationRules:se,tickFormatTime:ne,tickFormatValue:oe,linkedHover:re,selection:ae,onObservation:le,chartId:ce,loading:ue,loadingContent:he,emptyContent:me,emphasis:de,legendPosition:ge}=e,pe=i.showAxes,ve=i.enableHover,fe=!0===i.showLegend,we=s??[i.width,i.height],ye=B({isPushMode:void 0===m,colorBy:P,colorScheme:T,showLegend:!1,legendPosition:ge,trackCategoryDomain:fe,registerLinkedCategories:!1}),be=ot(()=>F(m??[],P),[m,P]),xe=void 0===m?ye.categories:be,{colorScale:Ae}=C({enabled:!!P,categories:xe,colors:T,fallbackColor:N,domainKey:P}),{legend:ke,margin:Ce,legendPosition:_e,hasAutomaticLegend:Se}=O({data:at,colorBy:P,colorScale:Ae,showLegend:fe,legendPosition:ge,userMargin:n,defaults:i.marginDefaults,categories:xe,chartWidth:we[0],chartHeight:we[1],axisChrome:{hasAxis:!1!==i.showAxes}}),He=E(e.legendInteraction,P,xe,Se,!0),Me=q??G({tooltip:Z,defaultTooltipContent:u({timeAccessor:d,valueAccessor:p}),customFunctionContext:"hover"}).tooltipContent,Pe=it(null),{activeSelectionHook:Te,hoverSelectionHook:Ie,customHoverBehavior:Re,customClickBehavior:Ne}=$({selection:ae,linkedHover:re,unwrapData:!0,onObservation:le,chartType:"RealtimeSwarmChart",chartId:ce,mobileInteraction:i.mobileInteraction}),ze=nt(e=>{ee&&ee(e),Re(e)},[ee,Re]);b(t,Pe);let Be=Q(ue,we[0],we[1],he),Fe=Be?null:J(m,we[0],we[1],me),De={};null!=R&&(De.radius=R),null!=N&&(De.fill=N),null!=z&&(De.opacity=z),null!=L&&(De.stroke=L),null!=j&&(De.strokeWidth=j),null!=W&&(De.cursor=W);let Le=V,Oe=ot(()=>{if(P)return e=>{let t="function"==typeof P?P(e):P?e[P]:void 0;return{...P&&Ae?{fill:Ae(t+"")}:void 0}}},[P,Ae]),je=ot(()=>{let e=Y(d??"time",p??"value");return t=>{let i="function"==typeof P?P(t):P?t[P]:void 0;return e(t,null==i?void 0:i+"")}},[d,p,P]),Ee=ot(()=>U(Oe,K,je),[Oe,K,je]),We=x(ot(()=>e=>({...Ee(e),...Le?.(e)}),[Ee,Le]),[Ie||He.legendSelectionHook||Te],ae),Ve=de?`${o||""} semiotic-emphasis-${de}`.trim():o,$e=a??l??"sliding",Ke=g(c,m,h);return Be||Fe||/* @__PURE__ */rt(I,{ref:Pe,chartType:"swarm",runtimeMode:"streaming",size:we,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:Ce,className:Ve,...A(i,He,e.legendInteraction),arrowOfTime:r,windowMode:$e,windowSize:Ke,data:m,timeAccessor:d,valueAccessor:p,xExtent:v,yExtent:f,yScaleType:w,extentPadding:k,decay:_,pulse:S,staleness:H,transition:M,categoryAccessor:P,swarmStyle:De,pointStyle:We,showAxes:pe,background:X,hoverAnnotation:ve,tooltipContent:Me,...D({linkedHover:re,selection:ae,onObservation:le,forceHoverBehavior:!0,mobileInteraction:i.mobileInteraction,customHoverBehavior:ze,customClickBehavior:Ne}),annotations:te,autoPlaceAnnotations:ie,svgAnnotationRules:se,tickFormatTime:ne,tickFormatValue:oe,legend:ke,legendPosition:_e,...ye.categoryDomainProps,pointIdAccessor:e.pointIdAccessor})});lt.displayName="RealtimeSwarmChart";import{useRef as ct,forwardRef as ut,useCallback as ht,useMemo as mt}from"react";import{jsx as dt}from"react/jsx-runtime";N(T);var gt=ut(function(e,t){let i=y(e),{size:s,margin:n,className:o,arrowOfTime:r="right",windowMode:a,capacityMode:l,windowSize:c,capacity:u,data:m,timeAccessor:d,valueAccessor:p,timeExtent:v,valueExtent:f,extentPadding:w,decay:k,pulse:C,staleness:_,transition:S,positiveColor:H,negativeColor:M,connectorStroke:P,connectorWidth:T,gap:R,stroke:N,strokeWidth:z,opacity:B,cursor:F,styleRules:L,background:j,tooltipContent:W,tooltip:V,onHover:K,annotations:X,autoPlaceAnnotations:q,svgAnnotationRules:Z,tickFormatTime:ee,tickFormatValue:te,linkedHover:ie,selection:se,onObservation:ne,chartId:oe,loading:re,loadingContent:ae,emptyContent:le,emphasis:ce,legendPosition:ue}=e,he=i.showAxes,me=i.enableHover,de=s??[i.width,i.height],ge=mt(()=>{if(i.showLegend)return{legendGroups:[{label:"Change",type:"fill",items:[{label:"Positive",color:H},{label:"Negative",color:M}],styleFn:e=>({fill:e.color||("Positive"===e.label?"var(--semiotic-success, #28a745)":"var(--semiotic-danger, #dc3545)")})}]}},[M,H,i.showLegend]),pe=ht(e=>{let t=e.delta??("function"==typeof p?p(e):e[p??"value"]);return 0>Number(t)?"Negative":"Positive"},[p]),ve=E(e.legendInteraction,pe,["Positive","Negative"]),{legend:fe,margin:we,legendPosition:ye}=O({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:ue,userMargin:n,defaults:i.marginDefaults,additionalLegend:ge,chartWidth:de[0],chartHeight:de[1],axisChrome:{hasAxis:!1!==i.showAxes}}),be=W??G({tooltip:V,defaultTooltipContent:h({timeAccessor:d,valueAccessor:p}),customFunctionContext:"hover"}).tooltipContent,xe=ct(null),{activeSelectionHook:Ae,hoverSelectionHook:ke,customHoverBehavior:Ce,customClickBehavior:_e}=$({selection:se,linkedHover:ie,unwrapData:!0,onObservation:ne,chartType:"RealtimeWaterfallChart",chartId:oe,mobileInteraction:i.mobileInteraction}),Se=ht(e=>{K&&K(e),Ce(e)},[K,Ce]);b(t,xe);let He=Q(re,de[0],de[1],ae),Me=He?null:J(m,de[0],de[1],le),Pe={};null!=H&&(Pe.positiveColor=H),null!=M&&(Pe.negativeColor=M),null!=P&&(Pe.connectorStroke=P),null!=T&&(Pe.connectorWidth=T),null!=R&&(Pe.gap=R),null!=N&&(Pe.stroke=N),null!=z&&(Pe.strokeWidth=z),null!=B&&(Pe.opacity=B),null!=F&&(Pe.cursor=F);let Te=ke||ve.legendSelectionHook||Ae,Ie=mt(()=>Y(d??"time",p??"value"),[d,p]),Re=mt(()=>U(void 0,L,Ie),[L,Ie]),Ne=x(mt(()=>e=>({...Re(e),...null!=N&&{stroke:N},...null!=z&&{strokeWidth:z},...null!=B&&{opacity:B},...null!=F&&{cursor:F}}),[Re,N,z,B,F]),[Te],se),ze=ce?`${o||""} semiotic-emphasis-${ce}`.trim():o,Be=a??l??"sliding",Fe=g(c,m,u);return He||Me||/* @__PURE__ */dt(I,{ref:xe,chartType:"waterfall",runtimeMode:"streaming",size:de,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:we,className:ze,...A(i,ve,e.legendInteraction),arrowOfTime:r,windowMode:Be,windowSize:Fe,data:m,timeAccessor:d,valueAccessor:p,xExtent:v,yExtent:f,extentPadding:w,decay:k,pulse:C,staleness:_,transition:S,waterfallStyle:Pe,areaStyle:Ne,showAxes:he,background:j,hoverAnnotation:me,tooltipContent:be,...D({linkedHover:ie,selection:se,onObservation:ne,forceHoverBehavior:!0,mobileInteraction:i.mobileInteraction,customHoverBehavior:Se,customClickBehavior:_e}),annotations:X,autoPlaceAnnotations:q,svgAnnotationRules:Z,tickFormatTime:ee,tickFormatValue:te,legend:fe,legendPosition:ye,pointIdAccessor:e.pointIdAccessor})});gt.displayName="RealtimeWaterfallChart";import{useRef as pt,forwardRef as vt,useCallback as ft,useMemo as wt,useState as yt}from"react";import{jsx as bt}from"react/jsx-runtime";N(H);var xt=vt(function(e,t){let i=y(e),{size:s,margin:n,className:o,arrowOfTime:r="right",windowMode:a,capacityMode:l,windowSize:c,capacity:u,data:h,timeAccessor:m,valueAccessor:p,categoryAccessor:v,timeExtent:f,valueExtent:w,extentPadding:k,heatmapXBins:C=20,heatmapYBins:_=20,aggregation:H="count",colorScheme:M,customColorScale:P,cursor:T,styleRules:R,background:N,tooltipContent:z,tooltip:B,onHover:F,annotations:L,autoPlaceAnnotations:j,svgAnnotationRules:E,tickFormatTime:V,tickFormatValue:K,decay:Y,pulse:X,staleness:q,linkedHover:Z,selection:ee,onObservation:te,chartId:ie,loading:se,loadingContent:oe,emptyContent:re,emphasis:ae,legendPosition:le}=e,ce=i.showAxes,ue=i.enableHover,he=s??[i.width,i.height],[me,de]=yt(null),ge=wt(()=>me??[0,1],[me]),pe=wt(()=>{if("custom"===M&&P)return P;let e=ne(M||"blues");return t=>e(Math.max(0,Math.min(1,(t-ge[0])/(ge[1]-ge[0]||1))))},[M,P,ge]),ve=W(e.legendInteraction,e=>Number(e.value),ge),fe=wt(()=>i.showLegend?{gradient:{colorFn:pe,domain:ge,label:H}}:void 0,[H,pe,i.showLegend,ge]),{legend:we,margin:ye,legendPosition:be}=O({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:le,userMargin:n,defaults:i.marginDefaults,additionalLegend:fe,chartWidth:he[0],chartHeight:he[1],axisChrome:{hasAxis:!1!==i.showAxes}}),xe=z??G({tooltip:B,defaultTooltipContent:d({timeAccessor:m,valueAccessor:p}),customFunctionContext:"hover"}).tooltipContent,Ae=pt(null),{activeSelectionHook:ke,hoverSelectionHook:Ce,customHoverBehavior:_e,customClickBehavior:Se}=$({selection:ee,linkedHover:Z,unwrapData:!0,onObservation:te,chartType:"RealtimeHeatmap",chartId:ie,mobileInteraction:i.mobileInteraction}),He=ft(e=>{F&&F(e),_e(e)},[F,_e]);b(t,Ae);let Me=Q(se,he[0],he[1],oe),Pe=Me?null:J(h,he[0],he[1],re),Te=ae?`${o||""} semiotic-emphasis-${ae}`.trim():o,Ie=a??l??"sliding",Re=g(c,h,u),Ne=wt(()=>{if(null==T)return;let e={cursor:T};return()=>e},[T]),ze=wt(()=>S(m??"time",p??"value",p??"value"),[m,p]),Be=x(wt(()=>U(Ne,R,ze),[Ne,R,ze]),[Ce,ve.legendSelectionHook,ke],ee);return Me||Pe||/* @__PURE__ */bt(I,{ref:Ae,chartType:"heatmap",runtimeMode:"streaming",size:he,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:ye,className:Te,...A(i,ve,e.legendInteraction),arrowOfTime:r,windowMode:Ie,windowSize:Re,data:h,timeAccessor:m,valueAccessor:p,categoryAccessor:v,xExtent:f,yExtent:w,extentPadding:k,heatmapXBins:C,heatmapYBins:_,heatmapAggregation:H,colorScheme:"custom"!==M?M:void 0,heatmapColorScale:"custom"===M&&"function"==typeof P?P:void 0,onColorDomainChange:de,areaStyle:Be,showAxes:ce,background:N,hoverAnnotation:ue,tooltipContent:xe,...D({linkedHover:Z,selection:ee,onObservation:te,forceHoverBehavior:!0,mobileInteraction:i.mobileInteraction,customHoverBehavior:He,customClickBehavior:Se}),annotations:L,autoPlaceAnnotations:j,svgAnnotationRules:E,tickFormatTime:V,tickFormatValue:K,decay:Y,pulse:X,staleness:q,legend:we,legendPosition:be,pointIdAccessor:e.pointIdAccessor})});xt.displayName="RealtimeHeatmap";export{le as a,ce as b,ue as c,de as d,n as e,o as f,r as g,ve as h,Ee as i,et as j,_ as k,tt as l,lt as m,gt as n,xt as o};
|
package/dist/c-G53AVC42.min.js
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
function e(e,t,n={}){return Number.isFinite(t)&&t>0&&!Number.isNaN(e)?e===1/0?"expired":0>e||t*(n.fresh??1)>e?"fresh":t*(n.aging??1.5)>e?"aging":t*(n.stale??3)>e?"stale":"expired":"fresh"}function t(e,t,n){if(null!=e)return"function"==typeof e?e(t,n):"object"==typeof e&&null!==e&&"constant"in e?e.constant:t[e]}function n(e){let{data:n,encoding:i}=e,r=[],a=/* @__PURE__ */new Map;return n.forEach((e,n)=>{let o=t(i.id,e,n);if(null==o||""===o)throw Error(`[semiotic] Motion encoding row ${n} resolved an empty id.`);let l=o+"";if(a.has(l))throw Error(`[semiotic] Duplicate motion encoding id "${l}".`);let s=t(i.process?.group,e,n),c=t(i.process?.stage,e,n),u=t(i.accessible?.group,e,n)??(null!=s?s+"":null!=c?c+"":void 0),d={};for(let r of Object.keys(i.evidence??{}))d[r]=t(i.evidence?.[r],e,n);let h={id:l,datum:e,time:{arrival:t(i.time?.arrival,e,n),basis:i.time?.basis,unit:i.time?.unit},placement:{x:t(i.placement?.x,e,n),y:t(i.placement?.y,e,n),lane:t(i.placement?.lane,e,n),space:i.placement?.space},kinematics:{velocityX:t(i.kinematics?.velocityX,e,n),velocityY:t(i.kinematics?.velocityY,e,n),space:i.kinematics?.space},process:{group:s,stage:c,target:t(i.process?.target,e,n),work:t(i.process?.work,e,n)},evidence:d,accessible:{description:t(i.accessible?.description,e,n),group:u,label:t(i.accessible?.label,e,n)??l}};r.push(h),a.set(l,h)}),{rows:r,byId:a}}function i(t){let n=t.now-t.arrival;return{age:n,progress:Number.isFinite(n)&&Number.isFinite(t.ttl)&&t.ttl>0?Math.max(0,n)/t.ttl:n===1/0&&Number.isFinite(t.ttl)&&t.ttl>0?1/0:0,lifecycle:e(n,t.ttl,t.thresholds)}}function r(e){let t=Math.max(0,Math.min(1,e.minOpacity??.1));if(Number.isNaN(e.age))return 1;if(e.age===1/0)return t;if(!Number.isFinite(e.extent)||0>=e.extent)return 1;let n=Math.max(0,e.age);if("step"===e.type)return(e.threshold??.5*e.extent)>n?1:t;if("exponential"===e.type){let i=e.halfLife??e.extent/2;return t+Math.pow(.5,n/(i>0?i:e.extent/2))*(1-t)}return t+Math.max(0,Math.min(1,1-n/e.extent))*(1-t)}function a(e,t){let n=Number.isFinite(e)?e:0,i=Number.isFinite(t)?t:0;return{velocityX:n,velocityY:i,speed:Math.hypot(n,i),direction:Math.atan2(i,n)}}function o(e,t,n){return Number.isFinite(n)&&n>0?a((t.x-e.x)/n,(t.y-e.y)/n):a(0,0)}function l(e,t){return(e+"").length*t*.6}function s(e){return void 0===e||!0===e||"halo"===e?{type:"halo"}:!1===e||"none"===e?null:"box"===e?{type:"box"}:{...e,type:e.type??"halo"}}function c(e){let{x:t,y:n,text:i,fill:r,fontSize:a=12,fontWeight:o,fontFamily:c,textAnchor:u="start",dominantBaseline:d,background:h,className:f}=e,m=s(h),p=e=>/* @__PURE__ */ea("text",{x:t,y:n,textAnchor:u,dominantBaseline:d,fill:r,fontSize:a,fontWeight:o,fontFamily:c,className:f,...e?{style:{stroke:e.stroke,strokeWidth:e.strokeWidth,paintOrder:"stroke"}}:{},children:i});if(!m)return p();if("halo"===m.type)return p({stroke:m.fill??na,strokeWidth:m.haloWidth??3});let y,g,b=m.padding??{x:6,y:3},x="number"==typeof b?b:b.x,v="number"==typeof b?b:b.y,w=l(i,a),k=a+2*v;return y="middle"===u?t-w/2-x:"end"===u?t-w-x:t-x,g="middle"===d||"central"===d?n-k/2:"hanging"===d||"text-before-edge"===d?n-v:n-.8*a-v,/* @__PURE__ */ta("g",{className:f,children:[
|
|
2
|
-
/* @__PURE__ */ea("rect",{x:y,y:g,width:w+2*x,height:k,rx:m.radius??3,ry:m.radius??3,fill:m.fill??na,fillOpacity:m.opacity??.85,stroke:m.stroke,strokeWidth:m.strokeWidth}),p()]})}function u(e){let t=e.provenance,n=e.id??e.stableId??t?.stableId;return null==n||""===n?void 0:n+""}function d(e){let t=Gr(e=>e.pushObservation),n=ia.useCallback(n=>{e.onObservation?.(n),t?.(n)},[e,t]);return ia.useMemo(()=>({...e,onObservation:n}),[n,e])}function h(e){let t=e.nativeEvent;return"touch"===t.pointerType?"touch":0===t.detail?"keyboard":"pointer"}function f(e,t={}){let n=u(e);return{"data-semiotic-annotation-widget":"",...n?{"data-semiotic-annotation-id":n}:{},onClickCapture(i){let r=h(i);t.onAnnotationActivate?.({annotation:e,annotationId:n,chartId:t.chartId,inputType:r}),n&&t.onObservation&&t.onObservation({type:"annotation-activate",annotationId:n,inputType:r,timestamp:Date.now(),chartType:t.chartType??"unknown",chartId:t.chartId})}}}function m(e){return e instanceof Element&&null!=e.closest("[data-semiotic-annotation-widget]")}function p({chrome:e="default",className:t="",style:n,children:i,...r}){let a="default"===e?{...oa,...n}:n;/* @__PURE__ */
|
|
3
|
-
return aa("div",{...r,"data-semiotic-tooltip-chrome":!0,className:("semiotic-tooltip "+t).trim(),style:a,children:i})}function y(e){return e.ownsChrome=!0,e}function g(e){if("string"!=typeof e)return null!=e;let t=e.trim().toLowerCase();return!(!t||"transparent"===t||/^rgba\([^)]*,\s*0(?:\.0+)?\s*\)$/.test(t)||/^hsla\([^)]*,\s*0(?:\.0+)?\s*\)$/.test(t))}function b(e){if(!ra.isValidElement(e))return!1;let t=e.type;if("string"!=typeof t&&t&&!0===t.ownsChrome)return!0;let n=e.props,i=n["data-semiotic-tooltip-chrome"];if(null!=i&&!1!==i&&"false"!==i)return!0;let r=n.style;return!(!r||"object"!=typeof r||!g(r.background)&&!g(r.backgroundColor))}function x(e,t){for(let n of t){let t=e.find(e=>e.lower===n);if(t)return t}}function v(e,t={}){if(!e||"object"!=typeof e)return{entries:[]};let n=t.maxEntries??6,i=!1!==t.skipPositional,r=[];for(let[t,n]of Object.entries(e)){if(t.startsWith("_")||"data"===t)continue;let e=t.toLowerCase();if(i&&ua.has(e)||null==n)continue;let a=typeof n;"string"!==a&&"number"!==a&&"boolean"!==a&&!(n instanceof Date)||r.push({key:t,lower:e,value:n})}if(0===r.length)return{entries:[]};let a=r.findIndex(e=>la.includes(e.lower)),o=a>=0;0>a&&(a=r.findIndex(e=>"id"===e.lower)),0>a&&(a=r.findIndex(e=>"string"==typeof e.value));let l=0>a?void 0:r[a],s=r.filter((e,t)=>t!==a&&(!o||"id"!==e.lower)),c=x(s,sa),u=x(s,ca),d=[];c&&d.push({key:c.key,value:c.value}),u&&d.push({key:u.key,value:u.value});for(let e of s){if(d.length>=n)break;sa.includes(e.lower)||ca.includes(e.lower)||d.push({key:e.key,value:e.value})}return{titleKey:l?.key,title:l?.value,entries:d}}function w(e,t){return"touch"===t?Math.max(e,24):e}function k(e){return Array.isArray(e)?e[0]:e}function M(e,t,n,i){return{data:k(e),x:t,y:n,__semioticHoverData:!0,...i}}function A(e,t){return"function"==typeof t?t(e):e[t]}function S(e,t){if(t)return t(e);if(null==e)return"";if("number"==typeof e){if(!Number.isFinite(e))return e+"";let t=Number.isInteger(e)?e:parseFloat(e.toPrecision(6));return Math.abs(t)>9999?t.toLocaleString():t+""}if(e instanceof Date)return e.toLocaleDateString();if("object"==typeof e&&null!==e){if(void 0!==e.id)return e.id+"";if(void 0!==e.name)return e.name+"";try{return JSON.stringify(e)}catch{return Array.isArray(e)?`[Array(${e.length})]`:"[Object]"}}return e+""}function C(e={}){let{fields:t,title:n,format:i,style:r={},className:a=""}=e;return e=>{if(!e||"object"!=typeof e)return null;let o,l=[];if(n){let t=A(e,n);o=S(t,i)}if(t&&t.length>0)t.forEach(t=>{let n,r,a;"string"==typeof t?(n=t,r=t,a=i):(n=t.label,r=t.accessor||t.key||"",a=t.format||i);let o=A(e,r);l.push({label:n,value:S(o,a)})});else if(!n){let t=["value","y","name","id","label"];for(let n of t)if(void 0!==e[n]){o=S(e[n],i);break}if(!o){let t=Object.keys(e).filter(e=>!e.startsWith("_"));t.length>0&&(o=S(e[t[0]],i))}}/* @__PURE__ */
|
|
4
|
-
return ha(p,{className:a,style:r,children:[o&&/* @__PURE__ */da("div",{style:{fontWeight:l.length>0?"bold":"normal"},children:o}),l.map((e,t)=>/* @__PURE__ */ha("div",{style:{marginTop:0===t&&o?"4px":0},children:[e.label&&/* @__PURE__ */ha("span",{children:[e.label,": "]}),e.value]},t))]})}}function $(e={}){let{fields:t=[],title:n,format:i,style:r={},className:a="",showLabels:o=!0,separator:l=": "}=e;return e=>{if(!e||"object"!=typeof e)return null;let s=[];if(n){let t=A(e,n);s.push({value:S(t,i)})}if(t&&Array.isArray(t)&&t.length>0)t.forEach(t=>{let n,r,a;"string"==typeof t?(n=t,r=t,a=i):(n=t.label,r=t.accessor||t.key||"",a=t.format||i);let l=S(A(e,r),a);s.push({label:o?n:void 0,value:l})});else{let t=v(e,{skipPositional:!1});null!=t.title&&s.push({label:void 0,value:S(t.title,i),bold:!0}),t.entries.forEach(e=>{s.push({label:o?e.key:void 0,value:S(e.value,i)})})}return Array.isArray(s)&&0!==s.length?/* @__PURE__ */da(p,{className:("semiotic-tooltip-multiline "+a).trim(),style:r,children:s.map((e,t)=>/* @__PURE__ */ha("div",{style:{marginBottom:s.length-1>t?"4px":0,fontWeight:e.bold?"bold":void 0},children:[e.label&&/* @__PURE__ */ha("strong",{children:[e.label,l]}),e.value]},t))}):null}}function j(e){return"multi"===e||L(e)}function L(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&"mode"in e&&"multi"===e.mode}function N(e){let{tooltip:t,defaultTooltipContent:n,multiDefaultContent:i=z(),customFunctionContext:r="datum"}=e,a=t;return!1===t?{tooltipContent:()=>null}:j(a)?{tooltipContent:(L(a)&&"function"==typeof a.content?F(a.content):void 0)||i,tooltipMode:"multi"}:"hover"===r&&"function"==typeof t?{tooltipContent:t}:{tooltipContent:F(a)||n}}function I(e){let{tooltip:t,defaultTooltipContent:n,customFunctionContext:i="datum"}=e;return!1===t?{tooltipContent:()=>null}:"hover"===i&&"function"==typeof t?{tooltipContent:t}:{tooltipContent:F(t)||n}}function z(){return e=>{let t=e.allSeries;if(!t||0===t.length)/* @__PURE__ */
|
|
5
|
-
return da(p,{children:/* @__PURE__ */da("div",{children:S(e.data?.value??e.data?.y)})});let n=e.xValue??e.data?.time??e.data?.x;/* @__PURE__ */
|
|
6
|
-
return ha(p,{children:[null!=n&&/* @__PURE__ */da("div",{style:{fontWeight:600,marginBottom:4,fontSize:"0.9em",borderBottom:"1px solid var(--semiotic-border, #eee)",paddingBottom:4},children:S(n)}),t.map((e,t)=>/* @__PURE__ */ha("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"1px 0"},children:[
|
|
7
|
-
/* @__PURE__ */da("span",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:e.color,flexShrink:0}}),
|
|
8
|
-
/* @__PURE__ */da("span",{style:{flex:1,fontSize:"0.85em"},children:e.group}),
|
|
9
|
-
/* @__PURE__ */da("span",{style:{fontWeight:500,fontSize:"0.85em"},children:S(e.value)})]},t))]})}}function F(e){if(!0!==e){if("function"==typeof e){let t=e;return e=>{let n=!0===e?.__semioticHoverData||e&&void 0!==e.data&&"number"==typeof e.x&&"number"==typeof e.y&&e&&("node"===e.type||"edge"===e.type||void 0!==e.nodeOrEdge||void 0!==e.allSeries||void 0!==e.stats||void 0!==e.__chartType),i=k(n?e.data??{}:e);if(!i||(("node"===e?.nodeOrEdge&&"number"==typeof i?.x0&&"number"==typeof i?.x1||"edge"===e?.nodeOrEdge&&"number"==typeof i?.sankeyWidth)&&i.data&&"object"==typeof i.data&&(i=i.data),!i))return null;if(n&&(void 0!==e.allSeries||void 0!==e.xValue)){let t={...i};void 0!==e.allSeries&&void 0===t.allSeries&&(t.allSeries=e.allSeries),void 0!==e.xValue&&void 0===t.xValue&&(t.xValue=e.xValue),i=t}let r=t(i);return null==r?null:b(r)?r:/* @__PURE__ */da(p,{children:r})}}if(!1===e||void 0===e)return!1;if(L(e)){if("function"==typeof e.content)return F(e.content);"u">typeof process&&"production"!==process.env?.NODE_ENV&&console.warn('[semiotic] tooltip={{ mode: "multi" }} reached normalizeTooltip without a chart that wires tooltipMode. Use a line/area-family chart with multi support, or pass frameProps.tooltipMode: "multi" to StreamXYFrame.');let t=$();return F(e=>t(e))}if("object"==typeof e&&null!==e&&("fields"in e||"title"in e)){let t=C(e);return F(e=>t(e))}if("multi"===e){"u">typeof process&&"production"!==process.env?.NODE_ENV&&console.warn('[semiotic] tooltip="multi" reached normalizeTooltip on a single-tooltip chart. Rendering multi-field content as a backward-compatible fallback.');let e=$();return F(t=>e(t))}return C()}}function T({componentName:e,message:t,diagnosticHint:n,width:i,height:r}){/* @__PURE__ */
|
|
10
|
-
return ma("div",{role:"alert",style:{width:i,height:Math.max(r,120),display:"flex",alignItems:"center",justifyContent:"center",border:"1px dashed rgba(128, 128, 128, 0.4)",borderRadius:8,background:"rgba(128, 128, 128, 0.04)",padding:24,boxSizing:"border-box"},children:/* @__PURE__ */pa("div",{style:{textAlign:"center",maxWidth:400},children:[
|
|
11
|
-
/* @__PURE__ */ma("div",{style:{fontSize:13,fontWeight:600,color:"rgba(128, 128, 128, 0.7)",marginBottom:6,fontFamily:"monospace"},children:e}),
|
|
12
|
-
/* @__PURE__ */ma("div",{style:{fontSize:14,color:"rgba(128, 128, 128, 0.9)",lineHeight:1.5},children:t}),n&&/* @__PURE__ */ma("div",{"data-testid":"semiotic-diagnostic-hint",style:{marginTop:10,padding:"8px 12px",background:"rgba(128, 128, 128, 0.06)",borderRadius:4,fontSize:12,color:"rgba(128, 128, 128, 0.8)",fontFamily:"monospace",textAlign:"left",whiteSpace:"pre-wrap",lineHeight:1.6},children:n})]})})}function R({colors:e,categories:t,colorScheme:n="category10",children:i}){let r=va(()=>{if(e)return e;if(t){if(n&&"object"==typeof n&&!Array.isArray(n)){let e=n,i=0;return Object.fromEntries(t.map(t=>[t,kr(e,t)??gr[i++%gr.length]]))}let e=Array.isArray(n)?n:xr(n,void 0);return Object.fromEntries(t.map((t,n)=>[t,e[n%e.length]]))}return{}},[e,t,n]);/* @__PURE__ */
|
|
13
|
-
return wa(ka.Provider,{value:r,children:i})}function O(){return xa(ka)}function W(){for(let e of ja)e()}function D(e,t,n){let i=$a.positions.get(e);i?.locked||i&&i.xValue===t&&i.sourceId===n||($a={positions:new Map($a.positions).set(e,{xValue:t,sourceId:n})},W())}function E(e,t){let n=$a.positions.get(e);if(n?.locked||!n||n.sourceId!==t)return;let i=new Map($a.positions);i.delete(e),$a={positions:i},W()}function B(e,t,n){if($a.positions.get(e)?.locked){let t=new Map($a.positions);return t.delete(e),$a={positions:t},W(),!1}return $a={positions:new Map($a.positions).set(e,{xValue:t,sourceId:n,locked:!0})},W(),!0}function H(e,t){let n=$a.positions.get(e);if(!n?.locked||t&&n.sourceId!==t)return;let i=new Map($a.positions);i.delete(e),$a={positions:i},W()}function P(){return $a}function G(e){return ja.add(e),()=>ja.delete(e)}function V(){return()=>{}}function _(){return La}function Y(e){let t=Ca(e?G:V,e?P:_,e?P:_);return e?t.positions.get(e)??null:null}function U(e){let t=Ma(),n=e.clientId||t,{name:i}=e,r=Ur(e=>e.selections.get(i)),a=Ur(e=>e.setClause),o=Ur(e=>e.clearClause),l=Aa(()=>!!r&&r.clauses.size>0,[r]);return{predicate:Aa(()=>r&&0!==r.clauses.size?_r(r,n):()=>!0,[r,n]),isActive:l,selectPoints:Sa(e=>{let t={},r=!1;for(let[n,i]of Object.entries(e))t[n]={type:"point",values:new Set(i)},r=!0;r&&a(i,{clientId:n,type:"point",fields:t})},[n,i,a]),selectInterval:Sa(e=>{let t={},r=!1;for(let[n,i]of Object.entries(e))t[n]={type:"interval",range:i},r=!0;r&&a(i,{clientId:n,type:"interval",fields:t})},[n,i,a]),clear:Sa(()=>{o(i,n)},[o,i,n]),clientId:n}}function X(e,t){let n=Ma(),i=t||n,r=Ur(e=>e.setClause),a=Ur(e=>e.clearClause);return{selectPoints:Sa(t=>{let n={},a=!1;for(let[e,i]of Object.entries(t))n[e]={type:"point",values:new Set(i)},a=!0;a&&r(e,{clientId:i,type:"point",fields:n})},[e,i,r]),clear:Sa(()=>a(e,i),[e,i,a]),clientId:i}}function q(e){let t=e.name||"hover",{fields:n}=e,{predicate:i,isActive:r,selectPoints:a,clear:o}=U({name:t,fields:n});return{onHover:Sa(e=>{if(!e)return void o();let t=Zr(e),i={};for(let r of n){let n=t[r];if(void 0!==n)i[r]=[n];else{let t=Kr(e)?.map(e=>Zr(e)[r]).filter(e=>void 0!==e);t?.length&&(i[r]=[...new Set(t)])}}Br(i)?a(i):o()},[n,a,o]),predicate:i,isActive:r}}function K(e){return 2===e.length&&Array.isArray(e[0])&&2===e[0].length&&Array.isArray(e[1])&&2===e[1].length}function Z(e){return 2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1]}function J(e){let{name:t,xField:n,yField:i}=e,{predicate:r,isActive:a,selectInterval:o,clear:l}=U({name:t,fields:[n,i].filter(Boolean)}),s=n&&i?"xyBrush":n?"xBrush":"yBrush",c=Sa(e=>{if(!e)return void l();let t={};"xyBrush"===s&&K(e)?(n&&(t[n]=[Math.min(e[0][0],e[1][0]),Math.max(e[0][0],e[1][0])]),i&&(t[i]=[Math.min(e[0][1],e[1][1]),Math.max(e[0][1],e[1][1])])):"xBrush"===s&&Z(e)?n&&(t[n]=[Math.min(e[0],e[1]),Math.max(e[0],e[1])]):"yBrush"===s&&Z(e)&&i&&(t[i]=[Math.min(e[0],e[1]),Math.max(e[0],e[1])]),Br(t)&&o(t)},[s,n,i,o,l]);return{brushInteraction:Aa(()=>({brush:s,during:c,end:c}),[s,c]),predicate:r,isActive:a,clear:l}}function Q(e,t,n){let i=Ur(e=>e.selections.get(t));return Aa(()=>{if(!i||0===i.clauses.size)return e;let t=_r(i,n);return e.filter(t)},[e,i,n])}function ee(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function te(e){if("number"==typeof e.height&&e.height>0)return e.height>e.width?"portrait":"landscape"}function ne(e){if("number"==typeof e.height&&e.height>0)return e.width/e.height}function ie(e,t){let{when:n}=e,i=t.width,r=t.height,a=ne(t),o=te(t);return!("number"==typeof n.minWidth&&n.minWidth>i||"number"==typeof n.maxWidth&&i>n.maxWidth||"number"==typeof n.minHeight&&("number"!=typeof r||n.minHeight>r)||"number"==typeof n.maxHeight&&("number"!=typeof r||r>n.maxHeight)||"number"==typeof n.minAspectRatio&&("number"!=typeof a||n.minAspectRatio>a)||"number"==typeof n.maxAspectRatio&&("number"!=typeof a||a>n.maxAspectRatio)||n.orientation&&o!==n.orientation)}function re(e,t){let n={...e,...t};for(let i of["margin","frameProps","mobileSemantics","style"])ee(e[i])&&ee(t[i])&&(n[i]={...e[i],...t[i]});return"string"==typeof e.className&&"string"==typeof t.className&&(n.className=`${e.className} ${t.className}`),n}function ae(e,t,n=e.responsiveRules){if(!Array.isArray(n)||0===n.length)return{props:e,matches:[]};let i=n.map((e,t)=>({rule:e,index:t})).filter(e=>ie(e.rule,t)).sort((e,t)=>("number"==typeof e.rule.priority?e.rule.priority:e.index)-("number"==typeof t.rule.priority?t.rule.priority:t.index));return{props:i.reduce((e,t)=>re(e,t.rule.transform),e),matches:i}}function oe(e={}){let{limit:t=50,types:n,chartId:i}=e,r=Gr(e=>e.version),a=Gr(e=>e.observations),o=Gr(e=>e.clearObservations),l=Na(()=>{let e=a;if(n&&n.length>0){let t=new Set(n);e=e.filter(e=>t.has(e.type))}return i&&(e=e.filter(e=>e.chartId===i)),e.length>t&&(e=e.slice(e.length-t)),e},[a,n,i,t,r]);return{observations:l,latest:l.length>0?l[l.length-1]:null,clear:o}}function le(e){let t=2166136261;for(let n=0;e.length>n;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}function se(e,t){let n=e.get(t);if(void 0!==n)return n;if(e.size>=4096)return le(t);let i=e.size;return e.set(t,i),i}function ce(e){let t=e?.find(e=>"bottom"===e.orient),n=e?.find(e=>"top"===e.orient),i=e?.find(e=>"left"===e.orient),r=e?.find(e=>"right"===e.orient);return{bottomAxis:t,topAxis:n,leftAxis:i,rightAxis:r,xAxis:t??n,yAxis:i??r,xOrient:t||!n?"bottom":"top",yOrient:i||!r?"left":"right"}}function ue(e){let t=6;for(let n=1;e.length>n;n++){let i=Math.abs(e[n]-e[n-1]);i>0&&Number.isFinite(i)&&(t=Math.max(t,Math.ceil(Math.log10(Math.max(Math.abs(e[n]),Math.abs(e[n-1]))/i))+1))}let n=Math.min(17,t);return e=>Number.isInteger(e)?e+"":Number(e.toPrecision(n))+""}function de(...e){let t;for(let n of e)n&&(t=he(t)&&he(n)?{legendGroups:[...t.legendGroups,...n.legendGroups],legendDistance:n.legendDistance??t.legendDistance}:n);return t}function he(e){return"object"==typeof e&&null!==e&&"legendGroups"in e&&Array.isArray(e.legendGroups)}function fe(e){return"object"==typeof e&&null!==e&&"gradient"in e}function me(e,t,n=!1){let i=n?t?58:34:t?36:0;return i>e.top?{...e,top:i}:e}function pe(e,t,n,i,r=8){let a=i,o="left"===i?"right":"right"===i?"left":"top"===i?"bottom":"top",l=Math.max(t[a],Math.max(0,("left"===i||"right"===i?n[0]:n[1])-r)-e[o]);e[a]>l&&(e[a]=l)}function ye(e){return Math.ceil(7*e.length)}function ge(e,t){if(he(e)){let n=Le(t),i=100;for(let t of e.legendGroups){t.label&&(i=Math.max(i,ye(t.label)));for(let e of t.items)i=Math.max(i,n.swatchSize+n.labelGap+ye(e.label))}return i}if(fe(e)){let{gradient:t}=e,n=t.format||ue(t.domain),i=Math.max(ye(n(t.domain[0])),ye(n(t.domain[1]))),r=t.label?ye(t.label):0;return Math.max(100,19+i,r)}return 100}function be(e){return(he(e)||fe(e))&&Number.isFinite(e.legendDistance)?Math.max(0,e.legendDistance):10}function xe(e,t){return null!=e?.sideGutter?Math.max(0,e.sideGutter):t?.hasAxis?t.hasAxisLabel?Va:Ga:0}function ve(e){return Math.max(0,e?.edgeGutter??3)}function we(e,t){return null!=t?.axisGutter?Math.max(0,t.axisGutter):e?.hasAxis?e.hasAxisLabel?e.rotatedTicks?64:46:22:0}function ke(e){let{bottomAxis:t,topAxis:n,leftAxis:i,rightAxis:r}=ce(e.axes),a=!(n&&!t||!1===t?.visible),o=!!n&&!t&&!1!==n.visible,l=!(r&&!i||!1===i?.visible),s=!!r&&!1!==r.visible,c=!1!==e.showAxes;return{hasAxis:c&&a,hasAxisLabel:c&&a&&!!(t?.label??e.xLabel),rotatedTicks:c&&a&&(e.rotatedTicks??!!t?.autoRotate),topAxis:o?{hasAxis:c,hasAxisLabel:c&&!!(n?.label??e.xLabel),rotatedTicks:c&&(e.rotatedTicks??!!n?.autoRotate)}:void 0,leftAxis:l?{hasAxis:c,hasAxisLabel:c&&!!(i?.label??e.yLabel)}:void 0,rightAxis:s?{hasAxis:c,hasAxisLabel:c&&!!(r?.label??e.yLabelRight??e.yLabel)}:void 0}}function Me(e,t){return ke({showAxes:e.showAxes??t.showAxes,xLabel:e.xLabel??t.xLabel,yLabel:e.yLabel??t.yLabel,yLabelRight:e.yLabelRight??t.yLabelRight,axes:e.axes??t.axes})}function Ae(e){let t=e.projection??"vertical",n=!1!==e.showAxes&&"radial"!==t;return{hasAxis:n,hasAxisLabel:n&&("horizontal"===t?e.hasValueLabel:e.hasCategoryLabel),leftAxis:{hasAxis:n,hasAxisLabel:n&&("horizontal"===t?e.hasCategoryLabel:e.hasValueLabel)}}}function Se(e,t,n){if(fe(e))return e.gradient.label?46:26;if(!he(e))return 20;let i=Le(n),r=Math.max(1,n?.maxWidth??t),a=i.rowHeight;for(let t of e.legendGroups){let e=0,n=0;for(let a of t.items){let t=i.swatchSize+i.labelGap+ye(a.label),o=0===n?t:n+i.itemGap+t;n>0&&o>r?(e+=1,n=t):n=o}t.items.length>0&&(e+=1),a=Math.max(a,e*i.rowHeight,t.label?ye(t.label):0)}return a+(e.legendGroups.length>1?16:0)}function Ce(e,t,n){return ge(e,t)+be(e)+xe(t,n)+ve(t)}function $e(e,t){let{legend:n}=t;if(!n)return;let i=t.position??"right",r=Se(n,Math.max(1,t.size[0]-e.left-e.right),t.legendLayout)+be(n)+we("bottom"===i?t.axisChrome:"top"===i?t.axisChrome?.topAxis:void 0,t.legendLayout)+("top"===i&&t.hasTitle?24:0),a=Math.max(t.minimumMargin??0,"top"===i?t.hasTitle?58:34:0);"right"===i?e.right=Math.max(e.right,a,Ce(n,t.legendLayout,t.axisChrome?.rightAxis)):"left"===i?e.left=Math.max(e.left,a,Ce(n,t.legendLayout,t.axisChrome?.leftAxis)):"top"===i?e.top=Math.max(e.top,a,r):e.bottom=Math.max(e.bottom,a,r)}function je(e,t){let n=t.position??"right",i="top"===n||"bottom"===n,r=Math.max(0,t.totalWidth-t.margin.left-t.margin.right),a=Math.max(1,i?t.legendLayout?.maxWidth??r:t.reservedWidth??ge(e,t.legendLayout)),o=be(e),l=xe(t.legendLayout,"left"===n?t.axisChrome?.leftAxis:t.axisChrome?.rightAxis),s=ve(t.legendLayout),c=Se(e,r,t.legendLayout),u=we(t.axisChrome,t.legendLayout),d=we(t.axisChrome?.topAxis,t.legendLayout);if("left"===n)return{x:Math.max(s,t.margin.left-l-a-o),y:t.margin.top,width:a,height:c};if("top"===n)return{x:t.margin.left,y:t.margin.top-d-o-c,width:a,height:c};if("bottom"===n){let e=t.totalHeight-t.margin.bottom;return{x:t.margin.left,y:Math.max(e+o,Math.min(e+u+o,t.totalHeight-c)),width:a,height:c}}return{x:Math.min(t.totalWidth-a-s,t.totalWidth-t.margin.right+l+o),y:t.margin.top,width:a,height:c}}function Le(e){let t=Math.max(1,e?.swatchSize??16),n=Math.max(t,e?.rowHeight??22);return{swatchSize:t,labelGap:Math.max(0,e?.labelGap??6),itemGap:Math.max(0,e?.itemGap??10),rowHeight:n,align:"left"===e?.align?"start":"right"===e?.align?"end":e?.align??"start",maxWidth:e?.maxWidth}}function Ne(e,t){let n=24;return e.map(({hasLabel:e,itemCount:i})=>{n+=5;let r,a=n;n+=8,e&&(n+=16,r=n,n+=8);let o=n;return n+=i*t+8,{lineY:a,labelY:r,itemsY:o,endY:n}})}function Ie(e,t,n=!1){let i={...e};for(let e of t??[])!1===e.visible&&("top"!==e.orient||!n)&&(i[e.orient]=0);return i}function ze({config:e,orientation:t="vertical",width:n=100,customClickBehavior:i,customHoverBehavior:r,highlightedCategory:a,isolatedCategories:o,legendInteraction:l}){let{colorFn:s,domain:c,label:u,format:d}=e,h="horizontal"===t,f=d||ue(c),m="grad-legend-"+_a.useId(),p=!(!i&&!r),y="isolate"===l||void 0===l&&null!=o,[g,b]=_a.useState(0),[x,v]=_a.useState(null),w=_a.useRef([]),k=e=>{let t=h?e:5-e-1,n=c[0]+t/5*(c[1]-c[0]),i=c[0]+(t+1)/5*(c[1]-c[0]);return{label:`${f(n)} – ${f(i)}`,valueRange:[n,i],interactionKey:`${n}:${i}`}},M=(e,n,l)=>{let s="string"==typeof e.interactionKey?e.interactionKey:e.label,c=o?.has(s)??!1,u=a===s,d=x===l,h=e=>{let t=(e+5)%5;b(t),w.current[t]?.focus()};/* @__PURE__ */
|
|
14
|
-
return Ya("rect",{ref:e=>{w.current[l]=e},className:"semiotic-gradient-legend-bin",...n,fill:o?.size&&!c||null!=a&&!u?"rgba(255,255,255,0.65)":"transparent",stroke:d||c||u?"var(--semiotic-focus, #005fcc)":"transparent",strokeWidth:d?3:2,tabIndex:l===g?0:-1,role:"option","aria-label":e.label,"aria-selected":y?c:void 0,"aria-current":!(y||!u)||void 0,onClick:i?()=>i(e):void 0,onMouseEnter:r?()=>r(e):void 0,onMouseLeave:r?()=>r(null):void 0,onFocus:()=>{b(l),v(l),r?.(e)},onBlur:()=>{v(null),r?.(null)},onKeyDown:n=>{if(("Enter"===n.key||" "===n.key)&&i)return n.preventDefault(),void i(e);let r="horizontal"===t?"ArrowRight":"ArrowDown";n.key===("horizontal"===t?"ArrowLeft":"ArrowUp")||n.key===r?(n.preventDefault(),h(l+(n.key===r?1:-1))):("Home"===n.key||"End"===n.key)&&(n.preventDefault(),h("Home"===n.key?0:4))},style:{cursor:"pointer",pointerEvents:"all"}},"gradient-interaction-"+l)},[A,S]=c,C=_a.useMemo(()=>Array.from({length:65},(e,t)=>{let n=t/64;/* @__PURE__ */
|
|
15
|
-
return Ya("stop",{offset:n,stopColor:s(h?A+n*(S-A):S-n*(S-A))},t)}),[s,A,S,h]),$=h?Math.min(n,200):14,j=h?12:100,L=h?Math.max(0,(n-$)/2):0,N=u?18:0;/* @__PURE__ */
|
|
16
|
-
return Ua("g",{"aria-label":u||"Gradient legend",role:p?"listbox":void 0,"aria-orientation":p?t:void 0,"aria-multiselectable":!(!p||!y)||void 0,style:Ha,children:[
|
|
17
|
-
/* @__PURE__ */Ya("defs",{children:/* @__PURE__ */Ya("linearGradient",{id:m,x1:"0%",y1:"0%",x2:h?"100%":"0%",y2:h?"0%":"100%",children:C})}),u&&/* @__PURE__ */Ya("text",{x:h?L+$/2:0,y:12,textAnchor:h?"middle":"start",fontSize:11,fill:"var(--semiotic-text, #333)",children:u}),
|
|
18
|
-
/* @__PURE__ */Ya("rect",{x:L,y:N,width:$,height:j,fill:`url(#${m})`,rx:2}),p&&Array.from({length:5},(e,t)=>M(k(t),{x:h?L+t*$/5:0,y:h?N:N+t*j/5,width:h?$/5:$,height:h?j:j/5},t)),[0,1].map(e=>/* @__PURE__ */Ya("text",{x:h?L+e*$:$+5,y:N+(h?j+12:e?j:10),textAnchor:h?e?"end":"start":void 0,fontSize:10,fill:"var(--semiotic-text-secondary, #666)",children:f(c[h?e:1-e])},e))]})}function Fe(e,t,n,i,r){if("function"==typeof n)return n(e);let a=i(e,t);return"fill"===n?/* @__PURE__ */Xa("rect",{style:a,width:r,height:r}):/* @__PURE__ */Xa("line",{style:a,x1:0,y1:0,x2:r,y2:r})}function Te({swatchSize:e}){/* @__PURE__ */
|
|
19
|
-
return Xa("path",{d:`M${.25*e},${.55*e} L${.45*e},${.75*e} L${.8*e},${.3*e}`,fill:"none",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})}function Re(e,t,n){return n&&n.size>0?n.has(e.label)?1:.3:null!=t?e.label===t?1:.3:1}function Oe(e,t,n,i,r,a){let{legendGroup:{type:o="fill",styleFn:l,items:s},customClickBehavior:c,customHoverBehavior:u,highlightedCategory:d,isolatedCategories:h,focusedGroupIndex:f,focusedItemIndex:m,groupIndex:p,onFocusedIndexChange:y,interactive:g,useIsolateAria:b,metrics:{swatchSize:x,labelGap:v}}=e,w=!!h?.size&&h.has(t.label);/* @__PURE__ */
|
|
20
|
-
return qa("g",{transform:i,onClick:c?()=>c(t):void 0,onMouseEnter:u?()=>u(t):void 0,onMouseLeave:u?()=>u(null):void 0,tabIndex:g?p===f&&n===m?0:-1:void 0,role:g?"option":void 0,"aria-selected":g&&b?w:void 0,"aria-current":!(!g||b||null==d||t.label!==d)||void 0,"aria-label":t.label,onKeyDown:g?e=>{if(("Enter"===e.key||" "===e.key)&&(e.preventDefault(),c?.(t)),e.key===r||e.key===a){e.preventDefault();let t=(n+(e.key===a?1:-1)+s.length)%s.length;y(p,t);let i=e.currentTarget.parentElement?.children[t];i instanceof SVGElement&&i.focus()}}:void 0,onFocus:g?e=>{y(p,n),u?.(t),e.currentTarget.querySelector(".semiotic-legend-focus-ring")?.setAttribute("visibility","visible")}:void 0,onBlur:g?e=>{u?.(null),e.currentTarget.querySelector(".semiotic-legend-focus-ring")?.setAttribute("visibility","hidden")}:void 0,style:{cursor:g?"pointer":"default",opacity:Re(t,d,h),transition:"opacity 150ms ease",pointerEvents:"all",outline:"none"},children:[g&&/* @__PURE__ */Xa("rect",{className:"semiotic-legend-focus-ring",x:-2,y:-2,width:x+v+2+7*t.label.length,height:x+4,fill:"none",stroke:"var(--semiotic-focus, #005fcc)",strokeWidth:2,rx:3,visibility:"hidden"}),Fe(t,n,o,l,x),w&&/* @__PURE__ */Xa(Te,{swatchSize:x}),
|
|
21
|
-
/* @__PURE__ */Xa("text",{y:x/2,x:x+v,dominantBaseline:"central",fontSize:12,style:Pa,fill:"var(--semiotic-text, #333)",children:t.label})]},"legend-item-"+n)}function We(e){let{legendGroups:t,customClickBehavior:n,customHoverBehavior:i,highlightedCategory:r,isolatedCategories:a,legendInteraction:o,title:l="Legend",width:s=100,height:c=20,orientation:u="vertical",legendLayout:d}=e,h=Le(d),[f,m]=Ba.useState(0),[p,y]=Ba.useState(0),g=Ba.useCallback((e,t)=>{m(e),y(t)},[]),b="vertical"===u?Ja({legendGroups:t||[],width:s,customClickBehavior:n,customHoverBehavior:i,highlightedCategory:r,isolatedCategories:a,focusedGroupIndex:f,focusedItemIndex:p,onFocusedIndexChange:g,legendInteraction:o,metrics:h}):Qa({legendGroups:t||[],title:l,height:c,width:s,customClickBehavior:n,customHoverBehavior:i,highlightedCategory:r,isolatedCategories:a,focusedGroupIndex:f,focusedItemIndex:p,onFocusedIndexChange:g,legendInteraction:o,metrics:h}),x=!(!n&&!i);/* @__PURE__ */
|
|
22
|
-
return qa("g",{role:x?"listbox":void 0,"aria-multiselectable":!(!x||"isolate"!==o&&(void 0!==o||null==a))||void 0,"aria-label":"Chart legend",style:Ha,children:[void 0!==l&&""!==l&&"vertical"===u&&/* @__PURE__ */Xa("text",{className:"legend-title",y:16,x:s/2,textAnchor:"middle",fontSize:12,style:Pa,fill:"var(--semiotic-text, #333)",children:l}),b]})}function De(e,t=0,n=1/0,i=0){let r=Number.isFinite(t)?t:0,a=Number.isFinite(n)?Math.max(r,n):1/0,o=Number.isFinite(e)?Math.floor(e):r,l=Math.max(r,Math.min(a,o));return i>0&&Number.isFinite(i)?Math.max(r,Math.min(a,Math.round(l/i)*i)):l}function Ee(e,t,n,i={}){let r=eo(null),[a,o]=to(null);return ro(()=>{if(!t&&!n)return;let e=r.current;if(!e||typeof ResizeObserver>"u")return;let a=(e,t)=>({w:De(e,i.minWidth,i.maxWidth,i.widthStep),h:De(t,i.minHeight,i.maxHeight,i.heightStep)}),l=e.getBoundingClientRect();(l.width>0||l.height>0)&&o(a(l.width,l.height));let s=new ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t.contentRect,i=a(e,n);o(e=>e&&e.w===i.w&&e.h===i.h?e:i)}});return s.observe(e),()=>s.disconnect()},[t,n,i.minWidth,i.maxWidth,i.widthStep,i.minHeight,i.maxHeight,i.heightStep]),[r,[t&&a?a.w:e[0],n&&a?a.h:e[1]]]}function Be(){return za(so)}function He(e){let t=/* @__PURE__ */new Set,n=[];for(let i of e)t.has(i)||(t.add(i),n.push(i));return n}function Pe(e,t){if(e.length!==t.length)return!1;for(let n=0;e.length>n;n++)if(e[n]!==t[n])return!1;return!0}function Ge(e){let t=za(co),n=Ta(),i=He(e),r=Wa([]);Pe(r.current,i)||(r.current=i);let a=r.current;uo(()=>{if(t)return()=>t.unregisterCategories(n)},[t,n]),uo(()=>{t&&t.registerCategories(n,a)},[t,n,a])}function Ve(){return null!==za(co)}function _e({categoryColors:e,interaction:t,selectionName:n,field:i}){let r=Object.entries(e),a=r.map(([e])=>e),o=[{styleFn:e=>({fill:e.color||"#333",stroke:e.color||"#333"}),type:"fill",items:r.map(([e,t])=>({label:e,color:t})),label:""}],{selectPoints:l,clear:s}=U({name:n,fields:[i],clientId:ho}),{selectPoints:c,clear:u}=U({name:n,fields:[i],clientId:fo}),d=Ur(e=>e.selections.get(n)),{isolatedCategories:h,highlightedCategory:f}=Oa(()=>{let e=/* @__PURE__ */new Set,t=null,n=d?.clauses.get(ho)?.fields[i];if("point"===n?.type)for(let t of n.values)e.add(t+"");let r=d?.clauses.get(fo)?.fields[i];if("point"===r?.type){let e=r.values.values().next().value;null!=e&&(t=e+"")}return{isolatedCategories:e,highlightedCategory:t}},[d,i]),m=Ea(e=>{"highlight"===t&&(e?c({[i]:[e.label]}):u())},[t,i,c,u]),p=Ea(e=>{if("isolate"!==t)return;let n=new Set(h);n.has(e.label)?n.delete(e.label):n.add(e.label),0===n.size||n.size===a.length?s():l({[i]:Array.from(n)})},[t,i,h,a.length,l,s]),[y,[g]]=Ee([0,0],!0,!1),b=Oa(()=>Ye(r.map(([e])=>e),g),[r,g]);return 0===r.length?null:/* @__PURE__ */ao("div",{ref:y,style:{width:"100%",display:"block"},children:/* @__PURE__ */ao("svg",{width:"100%",height:Math.max(30,22*b+8),style:{display:"block",overflow:"visible"},children:/* @__PURE__ */ao(We,{legendGroups:o,title:!1,orientation:"horizontal",width:g,height:20,customHoverBehavior:"highlight"===t?m:void 0,customClickBehavior:"isolate"===t?p:void 0,highlightedCategory:f,isolatedCategories:h})})})}function Ye(e,t){if(!t||0===e.length)return 1;let n=0,i=1;for(let r of e){let e=26+7*r.length;n>0&&n+e>t&&(i++,n=0),n+=e}return i}function Ue({children:e,selections:t,showLegend:n,legendPosition:i="top",legendInteraction:r="none",legendSelectionName:a="legend",legendField:o="category"}){let l=Oa(()=>{if(!t)return;let e=/* @__PURE__ */new Map;for(let[n,i]of Object.entries(t))i.resolution&&e.set(n,{name:n,resolution:i.resolution,clauses:/* @__PURE__ */new Map});return e.size>0?{selections:e}:void 0},[t]),s=O(),c=Hr(e=>e.theme.colors.categorical),u=c.length>0?c:gr,[d,h]=Da({}),f=Wa(/* @__PURE__ */new Map),m=Oa(()=>({registerCategories:(e,t)=>{let n=He(t);h(t=>Pe(t[e]??[],n)?t:{...t,[e]:n})},unregisterCategories:e=>{h(t=>{if(!Object.prototype.hasOwnProperty.call(t,e))return t;let n={...t};return delete n[e],n})}}),[]),p=Oa(()=>{let e=[];for(let t of Object.values(d))for(let n of t)e.push(n);return He(e)},[d]),y=Oa(()=>{let e=s??{},t=new Map(f.current),n=Object.entries(e).filter(e=>"string"==typeof e[1]&&e[1].length>0),i=p.map(n=>{let i=se(t,n);return[n,kr(e,n)??u[i%u.length]]});return{categoryIndexes:t,colors:Object.fromEntries([...n,...i])}},[s,p,u]);uo(()=>{f.current=y.categoryIndexes},[y]);let g=y.colors,b=void 0===n||n,x=Object.keys(g).length>0;/* @__PURE__ */
|
|
23
|
-
return ao(Yr,{initialState:l,children:/* @__PURE__ */ao(Pr,{children:/* @__PURE__ */ao(so.Provider,{value:!0,children:/* @__PURE__ */ao(co.Provider,{value:m,children:/* @__PURE__ */ao(R,{colors:g,children:/* @__PURE__ */oo(lo.Provider,{value:b&&x,children:[b&&"top"===i&&/* @__PURE__ */ao(_e,{categoryColors:g,interaction:r,selectionName:a,field:o}),e,b&&"bottom"===i&&/* @__PURE__ */ao(_e,{categoryColors:g,interaction:r,selectionName:a,field:o})]})})})})})})}function Xe(e){if(null==e)return()=>{};let t="function"==typeof e?e:t=>t[e];return e=>Ze(t(e))}function qe(e,t){let n=Xe(e),i=Xe(t);return(e,t)=>{let r=i(e);return{value:r,x:n(e),y:r,category:t}}}function Ke(e,t){let n=Xe(t??"value"),i=null==e?void 0:"function"==typeof e?e:t=>t[e];return e=>{let t=i?i(e):void 0;return{value:n(e),category:null==t?void 0:t+""}}}function Ze(e){if("number"==typeof e)return Number.isFinite(e)?e:void 0;if("string"==typeof e&&""!==e.trim()){let t=Number(e);return Number.isFinite(t)?t:void 0}}function Je(e,t,n){let i=null!=e.axis?n[e.axis]:null!=e.field?t[e.field]:n.value;if(void 0!==e.eq&&i!==e.eq||void 0!==e.ne&&i===e.ne||void 0!==e.in&&!e.in.includes(i))return!1;if(void 0===e.gt&&void 0===e.gte&&void 0===e.lt&&void 0===e.lte&&void 0===e.within&&void 0===e.outside)return!0;let r=Ze(i);if(void 0===r||void 0!==e.gt&&e.gt>=r||void 0!==e.gte&&e.gte>r||void 0!==e.lt&&r>=e.lt||void 0!==e.lte&&r>e.lte)return!1;if(void 0!==e.within){let[t,n]=e.within;if(t>r||r>n)return!1}if(void 0!==e.outside){let[t,n]=e.outside;if(r>=t&&n>=r)return!1}return!0}function Qe(e,t,n){let i=e.when;return void 0===i||!0===i||!1!==i&&("function"==typeof i?i(t,n):Je(i,t,n))}function et(e,t,n){if(!t||0===t.length)return{};let i={};for(let r of t){if(!Qe(r,e,n))continue;let t="function"==typeof r.style?r.style(e,n):r.style;t&&(i={...i,...t})}return i}function tt(e,t,n,i=e=>e){let r=e??(()=>({}));return t&&0!==t.length?(e,a)=>{let o=i(e),l={...r(e,a)};return Object.assign(l,et(o,t,n(o,a))),l}:r}function nt(e,t,n){return e&&0!==e.length?(i,r)=>{let a=et(i,e,t(i,r)),o=n?n(i,r):void 0;return o?{...a,...o}:a}:n}function it(e,t,n,i){if(!e||0===e.length)return i;let r=Ke(t,n);return(t,n)=>{let a=t&&t.data||t,o=et(a,e,r(a)),l=i?i(t,n):void 0;return l?{...o,...l}:o}}function rt(e,t,n,i){return nt(e,qe(t,n),i)}function at(e,t,n){let i=Xe(t);return nt(e,(e,t)=>({value:i(e),category:t}),n)}function ot(e){if(!e)return mo;let t=!1;for(let n=0;e.length>n;n++){let i=e[n];if(null==i||"object"!=typeof i){t=!0;break}}if(!t)return e;let n=[];for(let t of e)null!=t&&"object"==typeof t&&n.push(t);return n}function lt(e,t){let n={...e};for(let e of t)n[yo[e]]++;return n}function st(e,t,n){let i=new Set(t);return{changeSet:{...e,...e.keys?{keys:[...e.keys]}:{}},changed:i,revisions:lt(n,i)}}function ct(e){let{domain:t,layout:n,sceneGeometry:i}=e.revisions;return{domain:t,layout:n,sceneGeometry:i}}function ut(e,t){return e.sceneGeometry===t.sceneGeometry&&e.layout===t.layout&&e.domain===t.domain}function dt(e,t){return{sceneGeometry:Math.max(e.sceneGeometry,t.sceneGeometry),layout:Math.max(e.layout,t.layout),domain:Math.max(e.domain,t.domain)}}function ht(e){return vo(new Ao(e))}function ft(e,t,n,i=!1,r=!1){let a=e.beforeCompute(t.getLastUpdateResult(),i);n(),e.afterCompute(a,!0,r)}function mt(e){let{legend:t,totalWidth:n,totalHeight:i,margin:r,legendPosition:a="right",legendLayout:o,legendHoverBehavior:l,legendClickBehavior:s,legendHighlightedCategory:c,legendIsolatedCategories:u,legendInteraction:d}=e;if(!t)return null;let{x:h,y:f,width:m}=je(t,{totalWidth:n,totalHeight:i,margin:r,position:a,legendLayout:o,axisChrome:e.axisChrome}),p="top"===a||"bottom"===a;/* @__PURE__ */
|
|
24
|
-
return Co("g",{transform:`translate(${h}, ${f})`,children:fe(t)?/* @__PURE__ */Co(ze,{config:t.gradient,orientation:p?"horizontal":"vertical",width:m,customHoverBehavior:l,customClickBehavior:s,highlightedCategory:c,isolatedCategories:u,legendInteraction:d}):he(t)?/* @__PURE__ */Co(We,{legendGroups:t.legendGroups,title:"",width:m,orientation:p?"horizontal":"vertical",legendLayout:o,customHoverBehavior:l,customClickBehavior:s,highlightedCategory:c,isolatedCategories:u,legendInteraction:d}):t})}function pt(e){return!0===e?._annotationDeferred}function yt(e){return"blended"===e?.cohesion||"layer"===e?.cohesion?e.cohesion:null}function gt(e){return"primary"===e?.emphasis||"secondary"===e?.emphasis?e.emphasis:null}function bt(e){let t=e?.provenance?.confidence;return"number"==typeof t&&Number.isFinite(t)?Math.max(0,Math.min(1,t)):null}function xt(e){return Math.max(.72,.95-.06*e)}function vt(e){let t=e.map((e,t)=>({p:e,i:t,emphasis:gt(e.annotation),confidence:bt(e.annotation),readingOrder:null,rank:1})),n=t.some(e=>null!=e.emphasis||null!=e.confidence),i=e.some(e=>pt(e.annotation)),r=e.some(e=>null!=yt(e.annotation)),a=e.some(e=>"layer"===yt(e.annotation));if(!n&&!i&&!r)return e.map(e=>e.node);let o=t.filter(e=>null==e.emphasis&&null!=e.confidence).slice().sort((e,t)=>(t.confidence??0)-(e.confidence??0)||e.i-t.i);o.forEach((e,t)=>{e.readingOrder=t,e.rank=2-t/Math.max(1,o.length)});for(let e of t)e.emphasis&&(e.rank=jo[e.emphasis]);let l=t.sort((e,t)=>e.rank-t.rank||e.i-t.i).map(e=>{let{p:t,i:n,emphasis:i,readingOrder:r}=e,a=pt(t.annotation),o=t.node;if("primary"===i||"secondary"===i||null!=r){let e=null==i&&null!=r;o=/* @__PURE__ */$o("g",{className:e?"annotation-emphasis annotation-emphasis--inferred":"annotation-emphasis annotation-emphasis--"+i,..."secondary"===i?{opacity:.6,fontSize:"0.88em"}:{},...e?{opacity:xt(r),"data-annotation-reading-order":r}:{},children:t.node},"annotation-emphasis-"+n)}let l=yt(t.annotation);return l&&(o=/* @__PURE__ */$o("g",{className:"annotation-cohesion--"+l,children:o},"annotation-cohesion-"+n)),a&&(o=/* @__PURE__ */$o("g",{className:"annotation-deferred","data-annotation-disclosure":"deferred",children:o},"annotation-deferred-"+n)),o});return i&&l.unshift(
|
|
25
|
-
/* @__PURE__ */$o("style",{children:Lo},"annotation-disclosure-style")),a&&l.unshift(
|
|
26
|
-
/* @__PURE__ */$o("style",{children:".annotation-cohesion--layer text,.annotation-cohesion--layer tspan{fill:var(--semiotic-annotation-color,var(--semiotic-text-secondary,#666));font-style:italic}"},"annotation-cohesion-style")),l}function wt(e,t,n,i){return kt(e,t,n,i).nodes}function kt(e,t,n,i){let r=[];return e.forEach((e,a)=>{let o;o=n?n(e,a,i)??t(e,a,i):t(e,a,i),o&&r.push({node:o,annotation:e})}),{nodes:vt(r),renderedAnnotations:r.map(e=>e.annotation)}}function Mt(e,t,n){if(!e)return null;let i="object"==typeof e?e:{};/* @__PURE__ */
|
|
27
|
-
return No("circle",{className:"semiotic-threshold-end-cap",cx:t[0],cy:t[1],r:Math.max(0,i.radius??4),fill:i.fill??n})}function At(e,t){return Math.max(Math.min(e,t),0)+16}function St({ann:e,position:t,vertical:n,width:i,height:r,color:a,fontSize:o=12,fontFamily:l,bold:s,background:u,dash:d="6,3",labelGap:h=4}){let f=e.labelPosition,m=t>.6*i,p=n?t+(m?-4:4):"left"===f?4:"center"===f?i/2:i-4,y=n?"bottom"===f?r-4:"center"===f?r/2:16:20>t?Math.min(r-4,t+16):t-h,g=n?m?"end":"start":"left"===f?"start":"center"===f?"middle":"end",b=n?[t,0]:[0,t],x=n?[t,r]:[i,t];/* @__PURE__ */
|
|
28
|
-
return zo("g",{opacity:e.opacity,children:[
|
|
29
|
-
/* @__PURE__ */Io("line",{x1:b[0],y1:b[1],x2:x[0],y2:x[1],stroke:a,strokeWidth:e.strokeWidth??1.5,strokeDasharray:e.strokeDasharray||d}),Mt(e.endCap,b,a),e.label&&/* @__PURE__ */Io(c,{x:p,y:y,text:e.label,textAnchor:g,fill:a,fontSize:o,fontFamily:l,fontWeight:s?"bold":void 0,background:u??e.labelBackground??"halo"})]})}function Ct(e){return{label:e.label,title:e.title,wrap:e.wrap||120,noWrap:"function"==typeof e._noteLayout?e.noWrap:void 0,_noteLayout:e._noteLayout}}function $t(e){return"function"==typeof e._noteLayout?e._noteLayout(e):void 0}function jt(e,t,n){if(!e)return[];let i=Math.max(1,Math.floor(t/n)),r=[],a="";for(let t of e.split(/\s+/))t&&(a&&a.length+1+t.length>i?(r.push(a),a=t):a=a?`${a} ${t}`:t);return a&&r.push(a),r}function Lt(e,t,n,i){return"curly"===e?i?`M0,0 C${.6*n},0 ${.4*n},${t/2} ${n},${t/2} C${.4*n},${t/2} ${.6*n},${t} 0,${t}`:`M0,0 C0,${.6*n} ${t/2},${.4*n} ${t/2},${n} C${t/2},${.4*n} ${t},${.6*n} ${t},0`:i?`M0,0 L${n},0 L${n},${t} L0,${t}`:`M0,0 L0,${n} L${t},${n} L${t},0`}function Nt(e,t,n,i){if(!e)/* @__PURE__ */return To("g",{className:"annotation-note"});let{label:r,title:a,orientation:o,align:l,wrap:s=120,noWrap:c}=e;if(!r&&!a)/* @__PURE__ */return To("g",{className:"annotation-note"});let u=o;u||(u=Math.abs(t)>Math.abs(n)?"leftRight":"topBottom");let d="topBottom"===u,h="leftRight"===u,f=l;(!f||"dynamic"===f)&&(f=d?0>t?"right":"left":0>n?"bottom":"top");let m="start";d?"right"===f?m="end":"middle"===f&&(m="middle"):m=0>t?"end":"start";let p=e.useHTML||e.html,y=p?void 0:$t(e),g=y?.lineHeight??16,b=y?.titleLines??(a?c?[a]:jt(a,s,8):[]),x=y?.labelLines??(r?c?[r]:jt(r,s,8):[]),v=b.length+x.length,w=h?"end"===m?-4:4:0,k=[],M=i||"var(--semiotic-annotation-color, var(--semiotic-text, #333))";if(p)k.push(
|
|
30
|
-
/* @__PURE__ */To("foreignObject",{className:"annotation-note-html",x:"end"===m?w-s:"middle"===m?w-s/2:w,y:-g,width:s,height:Math.max(g,v*g+(a&&r?2:0))+g,style:{overflow:"visible"},children:/* @__PURE__ */Ro("div",{xmlns:"http://www.w3.org/1999/xhtml",style:{color:M,fontSize:"12px",lineHeight:g+"px",overflow:"visible",textAlign:"end"===m?"right":"middle"===m?"center":"left",whiteSpace:c?"nowrap":"normal",wordBreak:"break-word"},children:[a&&/* @__PURE__ */To("div",{className:"annotation-note-title",style:{fontWeight:"bold"},children:a}),r&&/* @__PURE__ */To("div",{className:"annotation-note-label",children:r})]})},"annotation-note-html"));else for(let e of[!0,!1]){let t=e?b:x;if(0===t.length)continue;let n="annotation-note-"+(e?"title":"label");k.push(
|
|
31
|
-
/* @__PURE__ */To("text",{className:n,fill:M,textAnchor:m,fontWeight:e?y?.titleFontWeight??"bold":void 0,y:e?void 0:b.length*g,children:t.map((e,t)=>/* @__PURE__ */To("tspan",{x:w,dy:0===t?0:g,children:e},t))},n))}let A=null;if((a||r)&&(0!==t||0!==n)){let e=d?y?y.width:Math.min(s,120):(b.length+x.length+(x.length>0?1:0))*g,t=d?m:f,n="end"===t||"bottom"===t?-e:"middle"===t?-e/2:0;A=/* @__PURE__ */To("line",{className:"note-line",x1:d?n:0,x2:d?n+e:0,y1:d?0:n,y2:d?0:n+e,stroke:i||"var(--semiotic-text-secondary, currentColor)"})}let S=Math.max(0,v-1)*g,C=0;(d||h)&&(C=h&&"middle"===f?-(S+g+(x.length>0&&b.length>0?2:0))/2+g/2:0>n||h&&"bottom"===f?-(S+2):2+g);let $=0!==C?`translate(0,${C})`:void 0;/* @__PURE__ */
|
|
32
|
-
return Ro("g",{className:"annotation-note",transform:`translate(${t},${n})`,...y?.textProps,children:[
|
|
33
|
-
/* @__PURE__ */To("g",{className:"annotation-note-content",transform:$,children:k}),A]})}function It(e,t,n,i,r){let a=null,o=n||"var(--semiotic-text-secondary, currentColor)";switch(e){case"callout-circle":{let e=(t?.radius||0)+(t?.radiusPadding||0);e>0&&(a=/* @__PURE__ */To("circle",{r:e,fill:"none",stroke:o},"subject-circle"));break}case"callout-rect":{let e=t?.width||0,n=t?.height||0;(e>0||n>0)&&(a=/* @__PURE__ */To("rect",{width:e,height:n,fill:"none",stroke:o},"subject-rect"));break}case"callout-custom":a=t?.custom;break;case"xy-threshold":{let e=i||0,n=r||0,l=0,s=0,c=0,u=0;if(void 0!==t?.x)l=s=(t.x||0)-e,c=(t.y1||0)-n,u=(t.y2||0)-n;else if(void 0!==t?.y)c=u=(t.y||0)-n,l=(t.x1||0)-e,s=(t.x2||0)-e;else if(void 0!==t?.x1||void 0!==t?.x2)l=(t.x1||0)-e,s=(t.x2||0)-e;else{if(void 0===t?.y1&&void 0===t?.y2)break;c=(t.y1||0)-n,u=(t.y2||0)-n}a=/* @__PURE__ */To("line",{x1:l,y1:c,x2:s,y2:u,stroke:o,strokeDasharray:"5,5"},"threshold-line");break}case"bracket":{let e=t?.type||"curly",n=t?.width??t?.height;void 0!==n&&(a=/* @__PURE__ */To("path",{d:Lt(e,n,t?.depth||30,void 0===t?.width),fill:"none",stroke:o},"bracket-path"));break}}/* @__PURE__ */
|
|
34
|
-
return To("g",{className:"annotation-subject",children:a})}function zt(e,t,n,i,r,a){let o,l,s=0,c=0;if("callout-circle"!==r&&"label"!==r||!a?.radius){if("callout-rect"===r&&a){let n=a.width||0,i=a.height||0;if(n>0||i>0){let r=n/2,a=i/2,o=e-r,l=t-a;if(0!==o||0!==l){let e=Math.abs(o),t=Math.abs(l),u=n/2,d=i/2,h=e*d>t*u?u/e:d/t;s=r+o*h,c=a+l*h}}}else if("bracket"===r&&a){let e=a.width,t=a.height,n=a.depth||30;void 0!==e?(s=e/2,c=n):void 0!==t&&(s=n,c=t/2)}}else{let n=(a.radius||0)+(a.radiusPadding||0);if(n>0&&(0!==e||0!==t)){let i=Math.atan2(t,e);s=Math.cos(i)*n,c=Math.sin(i)*n}}let u=e-s,d=t-c,h=Math.hypot(u,d);if(h>.5){let r=i||"var(--semiotic-text-secondary, currentColor)",a="curve"===n?.type,f=Math.atan2(d,u);if(a){let i=(s+e)/2,a=(c+t)/2,l=-d/h,m=u/h,p=(n?.curve??.25)*h,y=i+l*p,g=a+m*p;o=/* @__PURE__ */To("path",{className:"connector-curve",d:`M${s},${c}Q${y},${g} ${e},${t}`,fill:"none",stroke:r},"connector-line"),f=Math.atan2(g-c,y-s)}else o=/* @__PURE__ */To("line",{x1:s,y1:c,x2:e,y2:t,stroke:r},"connector-line");if("arrow"===n?.end){let e=.2792526803190927;l=/* @__PURE__ */To("path",{d:`M${s},${c}L${s+10*Math.cos(f+e)},${c+10*Math.sin(f+e)}L${s+10*Math.cos(f-e)},${c+10*Math.sin(f-e)}Z`,fill:r,stroke:"none"},"connector-arrow")}}/* @__PURE__ */
|
|
35
|
-
return Ro("g",{className:"annotation-connector",children:[o,l]})}function Ft(e){let{x:t=0,y:n=0,dx:i,dy:r,nx:a,ny:o,note:l,connector:s,subject:c,type:u,color:d,className:h,disable:f,opacity:m,strokeDasharray:p,events:y={},"data-testid":g}=e,b=Array.isArray(t)?t[0]??0:t,x=Array.isArray(n)?n[0]??0:n,v=Array.isArray(f)?f:[],w=i||0,k=r||0;null!=a&&(w=a-b),null!=o&&(k=o-x);let M="string"==typeof u?u:"label";if("bracket"===M&&c&&0===w&&0===k)if(void 0!==c.width){w=c.width/2;let e=c.depth||30;k=e+(0>e?-5:5)}else if(void 0!==c.height){let e=c.depth||30;w=e+(0>e?-5:5),k=c.height/2}/* @__PURE__ */
|
|
36
|
-
return Ro("g",{className:("annotation "+(h||"")).trim(),transform:`translate(${b},${x})`,"data-testid":g,...null!=m&&{opacity:m},...p&&{strokeDasharray:p},...y,children:[!v.includes("connector")&&zt(w,k,s,d,M,c),!v.includes("subject")&&It(M,c,d,b,x),!v.includes("note")&&Nt(l,w,k,d)]})}function Tt(e){let{noteData:t}=e,{screenCoordinates:n}=t,i="string"==typeof t.type?t.type:"label",r=t.eventListeners||t.events||{};if(t.coordinates&&n){let e=t.nx||n[0][0]+(t.dx??0),r=t.ny||n[0][1]+(t.dy??0),a=n.map((n,a)=>{let o=Object.assign({},t,{note:0===a?t.note:{label:""},x:n[0],y:n[1],nx:e,ny:r});/* @__PURE__ */
|
|
37
|
-
return To(Ft,{"data-testid":"semiotic-annotation",...o,type:i},"multi-annotation-"+a)});/* @__PURE__ */
|
|
38
|
-
return To("g",{children:a})}let a=t.note||{title:"none",label:t.label},o=`${a.label}-${a.title}-${t.i}`;/* @__PURE__ */
|
|
39
|
-
return To(Ft,{"data-testid":"semiotic-annotation",events:r,...t,type:i},o)}function Rt(e,t=.3){let n=e.length;if(2>n)return e.slice();let i=e.slice().sort((e,t)=>e[0]-t[0]),r=i.map(e=>e[0]),a=i.map(e=>e[1]),o=Math.min(n,Math.max(2,Math.ceil(t*n))),l=Number.isFinite(o)&&r.every(Number.isFinite),s=0,c=o-1,u=[];for(let e=0;n>e;e++){let t,i=r[e],d=0,h=n-1;if(l){for(;n-1>c&&Math.abs(r[s]-i)>=Math.abs(r[c+1]-i);)s++,c++;let e=Math.max(Math.abs(r[s]-i),Math.abs(r[c]-i));t=e||1,e>0&&(d=s,h=c)}else t=r.map(e=>Math.abs(e-i)).sort((e,t)=>e-t)[o-1]||1;let f=0,m=0,p=0,y=0,g=0;for(let e=d;h>=e;e++){let n=Math.abs(r[e]-i)/t,o=1>n?Math.pow(1-Math.pow(n,3),3):0;0!==o&&(f+=o,m+=o*r[e],p+=o*a[e],y+=o*r[e]*r[e],g+=o*r[e]*a[e])}if(0===f){u.push([i,a[e]]);continue}let b=f*y-m*m;if(1e-12>Math.abs(b))u.push([i,p/f]);else{let e=(f*g-m*p)/b;u.push([i,(p-e*m)/f+e*i])}}return u}function Ot(e,t){let n=t.scales?.x??t.scales?.time;return n?null!=e.x?n(e.x):t.xAccessor&&null!=e[t.xAccessor]?n(e[t.xAccessor]):null:null}function Wt(e,t){let n=t.scales?.y??t.scales?.value;return n?null!=e.y?n(e.y):t.yAccessor&&null!=e[t.yAccessor]?n(e[t.yAccessor]):null:null}function Dt(e){let t=e.data;if(!t||0===t.length)return null;let n=t[t.length-1],i=e.scales?.x??e.scales?.time,r=e.scales?.y??e.scales?.value;if(!i||!r)return null;let a=n[e.xAccessor||"x"],o=n[e.yAccessor||"y"];return null==a||null==o?null:{x:i(a),y:r(o)}}function Et(e){return null==e?null:e+""}function Bt(e){return Et(e.provenance?.stableId??e.stableId)}function Ht(e){return Et(e.stableId??e.id??e.provenance?.stableId)}function Pt(e,t,n){return t.stickyPositionCache?.set(e,n),n}function Gt(e,t,n){let i=Bt(e);if(!i)return null;let r=n.pointNodes?.find(e=>Et(e.pointId)===i);if(r)return Pt(t,n,{x:r.x,y:r.y});let a=n.data?.find(e=>Ht(e)===i);if(!a)return null;let o=Ot(a,n),l=Wt(a,n);return null==o||null==l?null:Pt(t,n,{x:o,y:l})}function Vt(e,t,n){let i=e.anchor||e.lifecycle?.anchor||"fixed";if("latest"===i){if(null!=e.pointId&&n.pointNodes&&n.pointNodes.length>0)for(let i=n.pointNodes.length-1;i>=0;i--){let r=n.pointNodes[i];if(r.pointId===e.pointId)return Pt(t,n,{x:r.x,y:r.y})}let i=Dt(n);return i?Pt(t,n,i):null}if("semantic"===i){let i=Gt(e,t,n);if(i)return i}let r=null,a=null;if(null!=e.pointId&&n.pointNodes){let t=n.pointNodes.find(t=>t.pointId===e.pointId);t&&(r=t.x,a=t.y)}if((null==r||null==a)&&(r=Ot(e,n),a=Wt(e,n)),null!=r&&null!=a)return Pt(t,n,{x:r,y:a});if("sticky"===i){let e=n.stickyPositionCache?.get(t);if(e)return e}return null}function _t(e,t,n,i=50){return!(-i>e||e>(n.width||0)+i||-i>t||t>(n.height||0)+i)}function Yt(e,t,n,i){let r=Fr(e.fill??e.color,t,i);return Tr(e.gradient,t,n,"string"==typeof e.fill&&e.fill?e.fill:"string"==typeof e.color&&e.color?e.color:i)??r}function Ut(e,t,n){let i=e.position,r="string"==typeof i&&Uo.has(i)?i:"bottom-left",a=r.endsWith("left")?"left":r.endsWith("right")?"right":"center",o=r.startsWith("top")?"top":r.startsWith("bottom")?"bottom":"middle",l="top"===o?0:"bottom"===o?n:n/2;return{x:("left"===a?0:"right"===a?t:t/2)+("number"==typeof e.dx&&Number.isFinite(e.dx)?e.dx:0),y:l+("number"==typeof e.dy&&Number.isFinite(e.dy)?e.dy:0),textAnchor:"start"===e.textAnchor||"middle"===e.textAnchor||"end"===e.textAnchor?e.textAnchor:"left"===a?"start":"right"===a?"end":"middle",dominantBaseline:"auto"===e.dominantBaseline||"middle"===e.dominantBaseline||"hanging"===e.dominantBaseline?e.dominantBaseline:"top"===o?"hanging":"bottom"===o?"auto":"middle"}}function Xt(e,t,n,i){return{...Ut(e,t,n),fill:e.fill??e.color??i.fill,fontSize:e.fontSize??i.fontSize,fontFamily:e.fontFamily??i.fontFamily,fontWeight:e.fontWeight,fontStyle:e.fontStyle,letterSpacing:e.letterSpacing,opacity:e.opacity,className:e.className,style:{pointerEvents:"none"}}}function qt({annotation:e,width:t,height:n,defaults:i=qo}){let r=e.label??e.text;return null==r?null:/* @__PURE__ */Xo("text",{...Xt(e,t,n,i),children:r})}function Kt(e,t={}){return function(e,n,i){switch(e.type){case"label":case"callout":case"callout-circle":case"callout-rect":{let t=Vt(e,n,i);if(!t)return null;let{x:r,y:a}=t;if(!_t(r,a,i))return null;let o="callout"===e.type?"callout-circle":e.type,l="callout-circle"===o?{radius:e.radius??12,radiusPadding:e.radiusPadding}:"callout-rect"===o?{width:e.width,height:e.height}:void 0;/* @__PURE__ */
|
|
40
|
-
return Ko(Tt,{noteData:{x:r,y:a,dx:e.dx??30,dy:e.dy??-30,note:Ct(e),type:o,...l?{subject:l}:{},connector:e.connector||{end:"arrow"},color:e.color,disable:e.disable,opacity:e.opacity,strokeDasharray:e.strokeDasharray,className:e.className}},"ann-"+n)}case"x-threshold":case"y-threshold":{let t="x-threshold"===e.type,r=null!=e.value?{...e,[t?"x":"y"]:e.value}:e,a=t?Ot(r,i):Wt(r,i);return null==a?null:/* @__PURE__ */Ko(St,{ann:e,position:a,vertical:t,width:i.width||0,height:i.height||0,color:e.color||"#f97316",bold:!0},"ann-"+n)}case"enclose":{let t=(e.coordinates||[]).map(e=>({x:Ot({...e,type:"point"},i),y:Wt({...e,type:"point"},i),r:1})).filter(e=>null!=e.x&&null!=e.y);if(2>t.length)return null;let r=Oo(t),a=e.padding||10;/* @__PURE__ */
|
|
41
|
-
return Zo("g",{children:[
|
|
42
|
-
/* @__PURE__ */Ko("circle",{cx:r.x,cy:r.y,r:r.r+a,fill:e.fill||"none",fillOpacity:e.fillOpacity??.1,stroke:e.color||"var(--semiotic-text-secondary, #666)",strokeWidth:1.5,strokeDasharray:"4,2"}),e.label&&/* @__PURE__ */Ko(c,{x:r.x,y:r.y-r.r-a-4,textAnchor:"middle",fill:e.color||"var(--semiotic-text-secondary, #666)",fontSize:12,text:e.label,background:e.labelBackground??"none"})]},"ann-"+n)}case"rect-enclose":{let t=(e.coordinates||[]).map(e=>({x:Ot({...e,type:"point"},i),y:Wt({...e,type:"point"},i)})).filter(e=>null!=e.x&&null!=e.y);if(2>t.length)return null;let r=e.padding||10,a=t.map(e=>e.x),o=t.map(e=>e.y),[l,s]=Jr(a),[u,d]=Jr(o),h=l-r,f=s+r,m=u-r;/* @__PURE__ */
|
|
43
|
-
return Zo("g",{children:[
|
|
44
|
-
/* @__PURE__ */Ko("rect",{x:h,y:m,width:f-h,height:d+r-m,fill:e.fill||"none",fillOpacity:e.fillOpacity??.1,stroke:e.color||"var(--semiotic-text-secondary, #666)",strokeWidth:1.5,strokeDasharray:"4,2"}),e.label&&/* @__PURE__ */Ko(c,{x:(h+f)/2,y:m-4,textAnchor:"middle",fill:e.color||"var(--semiotic-text-secondary, #666)",fontSize:12,text:e.label,background:e.labelBackground??"none"})]},"ann-"+n)}case"highlight":{let t=i.data||[],r="function"==typeof e.filter?t.filter(e.filter):e.field&&null!=e.value?t.filter(t=>t[e.field]===e.value):[],a={stroke:e.color||"#f97316",strokeWidth:2,fill:"none"};/* @__PURE__ */
|
|
45
|
-
return Ko("g",{children:r.map((t,n)=>{let r=Ot(t,i),o=Wt(t,i);if(null==r||null==o)return null;let l="function"==typeof e.r?e.r(t):e.r||6,s="function"==typeof e.style?e.style(t):e.style||a;/* @__PURE__ */
|
|
46
|
-
return Ko("circle",{cx:r,cy:o,r:l,...s},"hl-"+n)})},"ann-"+n)}case"bracket":{let t=Ot(e,i),r=Wt(e,i);/* @__PURE__ */
|
|
47
|
-
return Ko(Tt,{noteData:{x:t??0,y:r??0,dx:e.dx||0,dy:e.dy||0,note:Ct(e),type:"bracket",subject:{type:e.bracketType||"curly",width:e.width,height:e.height,depth:e.depth||30},color:e.color}},"ann-"+n)}case"trend":{let t=i.data||[];if(2>t.length)return null;let r,a=i.xAccessor||"x",o=i.yAccessor||"y",l="ordinal"===i.frameType,s="horizontal"===i.projection,c=l?a:null,u=l?o:null,d=[],h=/* @__PURE__ */new Map;if(l&&c&&u){for(let e of t){let t=e[c];if(null==t)continue;let n=t+"";h.has(n)||(h.set(n,d.length),d.push(n))}r=t.map(e=>{let t=e[c],n=e[u];if(null==t||null==n)return null;let i=h.get(t+"");return null!=i?[i,+n]:null}).filter(e=>null!==e)}else r=t.map(e=>[e[a],e[o]]).filter(e=>null!=e[0]&&null!=e[1]);if(2>r.length)return null;let f=i.scales?.x??i.scales?.time,m=i.scales?.y??i.scales?.value;if(!f||!m)return null;let p,y=e=>t=>{let n=Math.max(0,Math.floor(t)),i=Math.min(d.length-1,n+1),r=t-n,a=e(d[n]);return a+(e(d[i])-a)*r},g=f,b=m;if(l)if(s){let e=y(b);p=(t,n)=>[g(n),e(t)]}else{let e=y(g);p=(t,n)=>[e(t),b(n)]}else p=(e,t)=>[g(e),b(t)];let x,v=e.method||"linear";x="loess"===v?Rt(r,e.bandwidth??.3):("polynomial"===v?Or(r,e.order||2):Rr(r)).points;let w=x.map(([e,t])=>{let[n,i]=p(e,t);return`${n},${i}`}).join(" "),k=e.color||"#6366f1",M=x[x.length-1],[A,S]=p(M[0],M[1]);/* @__PURE__ */
|
|
48
|
-
return Zo("g",{children:[
|
|
49
|
-
/* @__PURE__ */Ko("polyline",{points:w,fill:"none",stroke:k,strokeWidth:e.strokeWidth??2,strokeDasharray:e.strokeDasharray||"6,3"}),e.label&&/* @__PURE__ */Ko("text",{x:A+4,y:S-4,fill:k,fontSize:11,children:e.label})]},"ann-"+n)}case"band":{let t=i.scales?.y??i.scales?.value,r=t?.domain?.(),a=e.y0??r?.[0],o=e.y1??r?.[1],l=null!=a&&t?t(a):0,s=null!=o&&t?t(o):i.height||0,u=Yt(e,"ann-"+n,"vertical","var(--semiotic-primary, #6366f1)");/* @__PURE__ */
|
|
50
|
-
return Zo("g",{opacity:e.opacity,children:[u.def&&/* @__PURE__ */Ko("defs",{children:u.def}),
|
|
51
|
-
/* @__PURE__ */Ko("rect",{x:0,y:Math.min(l,s),width:i.width||0,height:Math.abs(s-l),fill:u.fill,fillOpacity:e.fillOpacity??.1}),e.label&&/* @__PURE__ */Ko(c,{x:(i.width||0)-4,y:At(l,s),textAnchor:"end",fill:e.color||"var(--semiotic-primary, #6366f1)",fontSize:11,fontWeight:"bold",text:e.label,background:e.labelBackground??"halo"})]},"ann-"+n)}case"x-band":{let t=i.scales?.x??i.scales?.time,r=t?.domain?.(),a=e.x0??r?.[0],o=e.x1??r?.[1],l=null!=a&&t?t(a):null,s=null!=o&&t?t(o):null;if(null==l||null==s)return null;let u=Yt(e,"ann-"+n,"horizontal","var(--semiotic-primary, #6366f1)");/* @__PURE__ */
|
|
52
|
-
return Zo("g",{opacity:e.opacity,children:[u.def&&/* @__PURE__ */Ko("defs",{children:u.def}),
|
|
53
|
-
/* @__PURE__ */Ko("rect",{x:Math.min(l,s),y:0,width:Math.abs(s-l),height:i.height||0,fill:u.fill,fillOpacity:e.fillOpacity??.1}),e.label&&/* @__PURE__ */Ko(c,{x:Math.min(l,s)+4,y:16,textAnchor:"start",fill:e.color||"var(--semiotic-primary, #6366f1)",fontSize:11,fontWeight:"bold",text:e.label,background:e.labelBackground??"halo"})]},"ann-"+n)}case"envelope":{let t=i.data||[];if(2>t.length)return null;let r=i.xAccessor||"x",a=i.scales?.x??i.scales?.time,o=i.scales?.y??i.scales?.value;if(!a||!o)return null;let l=e.upperAccessor||"upperBounds",s=e.lowerAccessor||"lowerBounds",c=e.filter,u=t.filter(e=>!(null==e[l]||null==e[s]||c&&!c(e))).sort((e,t)=>e[r]-t[r]);if(2>u.length)return null;let d=Jo[i.curve||"linear"]||Do,h=Wo().x(e=>a(e[r])).y0(e=>o(e[s])).y1(e=>o(e[l])).curve(d)(u);if(!h)return null;let f=e.fill||"#6366f1";/* @__PURE__ */
|
|
54
|
-
return Zo("g",{children:[
|
|
55
|
-
/* @__PURE__ */Ko("path",{d:h,fill:f,fillOpacity:e.fillOpacity??.15,stroke:"none"}),e.label&&u.length>0&&/* @__PURE__ */Ko("text",{x:a(u[u.length-1][r])+4,y:o(u[u.length-1][l])-4,fill:f,fontSize:11,children:e.label})]},"ann-"+n)}case"anomaly-band":{let t=i.data||[];if(2>t.length)return null;let r=i.yAccessor||"y",a=i.scales?.x??i.scales?.time,o=i.scales?.y??i.scales?.value;if(!a||!o)return null;let l=t.map(e=>e[r]).filter(e=>null!=e&&isFinite(e));if(2>l.length)return null;let s=l.reduce((e,t)=>e+t,0)/l.length,c=l.reduce((e,t)=>e+(t-s)**2,0)/l.length,u=Math.sqrt(c),d=e.threshold??2,h=s-d*u,f=!1!==e.showBand,m=e.fill||"#6366f1",p=e.fillOpacity??.1,y=e.anomalyColor||"#ef4444",g=e.anomalyRadius??6,b=o(s+d*u),x=o(h),v=t.filter(e=>{let t=e[r];return null!=t&&Math.abs(t-s)>d*u});/* @__PURE__ */
|
|
56
|
-
return Zo("g",{children:[f&&/* @__PURE__ */Ko("rect",{x:0,y:Math.min(b,x),width:i.width||0,height:Math.abs(x-b),fill:m,fillOpacity:p}),v.map((e,t)=>{let n=Ot(e,i),r=Wt(e,i);return null==n||null==r?null:/* @__PURE__ */Ko("circle",{cx:n,cy:r,r:g,fill:y,fillOpacity:.7,stroke:y,strokeWidth:1.5},"anomaly-"+t)}),e.label&&/* @__PURE__ */Ko("text",{x:(i.width||0)-4,y:Math.min(b,x)-4,textAnchor:"end",fill:m,fontSize:11,children:e.label})]},"ann-"+n)}case"forecast":{let t=i.data||[];if(3>t.length)return null;let r=i.xAccessor||"x",a=i.yAccessor||"y",o=i.scales?.x??i.scales?.time,l=i.scales?.y??i.scales?.value;if(!o||!l)return null;let s,c=t.map(e=>[e[r],e[a]]).filter(e=>null!=e[0]&&null!=e[1]&&isFinite(e[0])&&isFinite(e[1])).sort((e,t)=>e[0]-t[0]);if(3>c.length)return null;if("polynomial"===(e.method||"linear")){let t=Or(c,e.order||2).equation;s=e=>t.reduce((t,n,i)=>t+n*Math.pow(e,i),0)}else{let e=Wr(c);if(!e)return null;s=e}let u=c.length,{se:d,meanX:h,ssX:f}=Dr(c,s),m=Er(e.confidence??.95),p=e.steps??5,y=c[u-1][0],g=(y-c[0][0])/Math.max(u-1,1),b=[];for(let e=1;p>=e;e++)b.push(y+e*g);let x=[];for(let e of b){let t=s(e),n=d*Math.sqrt(1+1/u+(f>0?(e-h)**2/f:0))*m;x.push({x:e,yCenter:t,yUpper:t+n,yLower:t-n})}let v=`M${x.map(e=>`${o(e.x)},${l(e.yUpper)}`).join(" L")} L${x.slice().reverse().map(e=>`${o(e.x)},${l(e.yLower)}`).join(" L")} Z`,w=x.map(e=>`${o(e.x)},${l(e.yCenter)}`).join(" "),k=`${o(y)},${l(s(y))}`,M=e.strokeColor||"#6366f1";/* @__PURE__ */
|
|
57
|
-
return Zo("g",{children:[
|
|
58
|
-
/* @__PURE__ */Ko("path",{d:v,fill:e.fill||"#6366f1",fillOpacity:e.fillOpacity??.15,stroke:"none"}),
|
|
59
|
-
/* @__PURE__ */Ko("polyline",{points:`${k} ${w}`,fill:"none",stroke:M,strokeWidth:e.strokeWidth??2,strokeDasharray:e.strokeDasharray??"6,3"}),e.label&&x.length>0&&/* @__PURE__ */Ko("text",{x:o(x[x.length-1].x)+4,y:l(x[x.length-1].yCenter)-4,fill:M,fontSize:11,children:e.label})]},"ann-"+n)}case"widget":{let r,a;if(null!=e.px&&null!=e.py)r=e.px,a=e.py;else{let t=Vt(e,n,i);if(!t)return null;r=t.x,a=t.y}if(!_t(r,a,i))return null;let o=e.dx??0,l=e.dy??0,s=e.width??32,c=e.height??32,u=e.content??/* @__PURE__ */Ko("span",{style:{fontSize:18,cursor:"default"},title:e.label||"Info",children:"ℹ️"});/* @__PURE__ */
|
|
60
|
-
return Ko("foreignObject",{x:r+o-s/2,y:a+l-c/2,width:s,height:c,style:{overflow:"visible",pointerEvents:"auto"},children:/* @__PURE__ */Ko("div",{...f(e,t),style:{width:s,height:c,display:"flex",alignItems:"center",justifyContent:"center"},children:u})},"ann-"+n)}case"text":{let t=Vt(e,n,i);if(!t)return null;let{x:r,y:a}=t,o=r+(e.dx||0),l=a+(e.dy||0),s=e.color||"var(--semiotic-text, #333)",c=/* @__PURE__ */Ko("text",{x:o,y:l,fill:s,fontSize:e.fontSize||11,opacity:e.opacity,strokeDasharray:e.strokeDasharray,dominantBaseline:"middle",style:{fontFamily:"inherit"},children:e.label});return!0!==e._redundantConnector?Fo.cloneElement(c,{key:"ann-text-"+n}):/* @__PURE__ */Zo("g",{opacity:e.opacity,strokeDasharray:e.strokeDasharray,children:[
|
|
61
|
-
/* @__PURE__ */Ko("line",{x1:r,y1:a,x2:o,y2:l,stroke:s,strokeWidth:1,strokeOpacity:.5,style:{pointerEvents:"none"}}),Fo.cloneElement(c,{opacity:void 0,strokeDasharray:void 0})]},"ann-text-"+n)}case"frame-text":/* @__PURE__ */
|
|
62
|
-
return Ko(qt,{annotation:e,width:i.width||0,height:i.height||0},"ann-frame-text-"+n);case"category-highlight":{let t=e.category;if(null==t)return null;let r=e=>"function"==typeof e&&"function"==typeof e.bandwidth,a=i.scales?.o,o=i.scales?.x,l=i.scales?.y,s=r(a)?a:r(o)?o:r(l)?l:null;if(!s)return null;let u=s(t+"");if(null==u)return null;let d=s.bandwidth(),h=e.color||"var(--semiotic-primary, #4589ff)",f=e.opacity??.15,m=e.label;/* @__PURE__ */
|
|
63
|
-
return Zo("g",(i.projection?"vertical"===i.projection:s===o)?{children:[
|
|
64
|
-
/* @__PURE__ */Ko("rect",{x:u,y:0,width:d,height:i.height||0,fill:h,fillOpacity:f}),m&&/* @__PURE__ */Ko(c,{x:u+d/2,y:16,textAnchor:"middle",fill:h,fontSize:12,fontWeight:"bold",text:m,background:e.labelBackground??"none"})]}:{children:[
|
|
65
|
-
/* @__PURE__ */Ko("rect",{x:0,y:u,width:i.width||0,height:d,fill:h,fillOpacity:f}),m&&/* @__PURE__ */Ko(c,{x:12,y:u+d/2,dominantBaseline:"middle",fill:h,fontSize:12,fontWeight:"bold",text:m,background:e.labelBackground??"none"})]},"ann-"+n)}default:return null}}}function Zt(e){return"string"==typeof e?.type?e.type:""}function Jt(e){return!!e&&"object"==typeof e&&Qo.has(Zt(e))}function Qt(e){return Array.isArray(e?.disable)&&e.disable.includes("connector")}function en(e){return el.has(Zt(e))&&!Qt(e)}function tn(e){return Jt(e)}function nn(e){return"primary"===e?.emphasis||!0===e?.defensive}function rn(e,t,n){return Math.max(t,Math.min(n,e))}function an(e,t,n={}){return"number"==typeof n.maxAnnotations&&Number.isFinite(n.maxAnnotations)?Math.max(0,Math.floor(n.maxAnnotations)):e>0&&t>0?Math.max(1,Math.round(e*t/(n.areaPerAnnotation&&n.areaPerAnnotation>0?n.areaPerAnnotation:2e4))):1/0}function on(e){let t,n=e?.emphasis;t="primary"===n?100:"secondary"===n?10:50;let i=e?.provenance?.confidence;switch("number"==typeof i&&Number.isFinite(i)&&(t+=15*rn(i,0,1)),e?.lifecycle?.freshness){case"fresh":t+=8;break;case"aging":t+=4;break;case"stale":t+=1;break;case"expired":t-=200}return t}function ln(e){let{annotations:t,width:n,height:i}=e,r=Math.max(0,e.minVisible??1),a=an(n,i,e),o=t.map((e,t)=>({annotation:e,index:t,note:tn(e)})),l=o.filter(e=>e.note);if(0===l.length||a>=l.length)return{visible:t.slice(),deferred:[],budget:a};let s=l.filter(e=>nn(e.annotation)),c=l.filter(e=>!nn(e.annotation)).sort((e,t)=>on(t.annotation)-on(e.annotation)||e.index-t.index),u=Math.min(c.length,Math.max(Math.max(0,a-s.length),Math.max(0,r-s.length))),d=/* @__PURE__ */new Set([...s.map(e=>e.index),...c.slice(0,u).map(e=>e.index)]),h=[],f=[];for(let{annotation:e,index:t,note:n}of o)!n||d.has(t)?h.push(e):f.push(e);return{visible:h,deferred:f,budget:a}}function sn(e){return"number"==typeof e.dx||"number"==typeof e.dy}function cn(e){return"text"===e.type||"widget"===e.type?{dx:0,dy:0}:{dx:30,dy:-30}}function un(e){let t=e?.familiarity;if(!t)return 3;let n=Object.values(t).filter(e=>"number"==typeof e&&Number.isFinite(e));return 0===n.length?3:n.reduce((e,t)=>e+t,0)/n.length}function dn(e){if(!e)return 1;let t=un(e);return t>2?4>t?1:.6:1.5}function hn(e){let t=e?.provenance;if(!t||"object"!=typeof t)return e;let n="string"==typeof t.source?Object.prototype.hasOwnProperty.call(ol,t.source)?ol[t.source]:t.source:null,i="number"==typeof t.confidence&&Number.isFinite(t.confidence)?Math.round(100*Math.max(0,Math.min(1,t.confidence)))+"%":null;if(!n&&!i||null!=e.label&&"string"!=typeof e.label)return e;let r=[n,i].filter(Boolean).join(" · "),a="string"==typeof e.label?e.label:"";return a.includes(`(${r})`)?e:{...e,label:a?`${a} (${r})`:`(${r})`}}function fn(e,t){let n=!1,i=e.map(e=>yn(e)&&"blended"!==e.cohesion&&"layer"!==e.cohesion?(n=!0,{...e,cohesion:t}):e);return n?i:e}function mn(e){if(!yn(e))return e;let t=("string"==typeof e.mobileText?e.mobileText:void 0)??("string"==typeof e.shortText?e.shortText:void 0);return!t||"string"!=typeof e.label&&null!=e.label?e:{...e,label:t}}function pn(e){return"text"!==e.type||"string"!=typeof e.color||8>Math.hypot("number"==typeof e.dx?e.dx:0,"number"==typeof e.dy?e.dy:0)?e:{...e,_redundantConnector:!0}}function yn(e){return Jt(e)}function gn(e){if("widget"===e.type)return{width:"number"==typeof e.width?e.width:32,height:"number"==typeof e.height?e.height:32};let t=$t(e);if(t)return{width:Math.max(24,t.width+10),height:Math.max(18,t.height+6)};let n="number"==typeof e.wrap?e.wrap:120,i=[...jt("string"==typeof e.title?e.title:void 0,n,7),...jt("string"==typeof e.label?e.label:void 0,n,7)],r=i.reduce((e,t)=>Math.max(e,t.length),0);return{width:Math.max(24,Math.min(n,7*r)+10),height:Math.max(18,16*i.length+6)}}function bn(e,t,n,i,r){let a=e+n,o=t+i;return Math.abs(n)>Math.abs(i)?{x:0>n?a-r.width-4:a+4,y:0>i?o-r.height:o,width:r.width,height:r.height}:{x:0>n?a-r.width:a,y:0>i?o-r.height-4:o+4,width:r.width,height:r.height}}function xn(e,t){return{x:e.x-t,y:e.y-t,width:e.width+2*t,height:e.height+2*t}}function vn(e,t){return Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x))*Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y))}function wn(e,t,n,i){let r=Math.max(0,i-e.x),a=Math.max(0,i-e.y);return(r+Math.max(0,e.x+e.width-(t-i)))*e.height+(a+Math.max(0,e.y+e.height-(n-i)))*e.width}function kn(e){let t=1.6*e;return[{dx:e,dy:-e},{dx:-e,dy:-e},{dx:e,dy:e},{dx:-e,dy:e},{dx:e,dy:0},{dx:-e,dy:0},{dx:0,dy:-e},{dx:0,dy:e},{dx:t,dy:-t},{dx:-t,dy:-t},{dx:t,dy:t},{dx:-t,dy:t}]}function Mn(e,t){return(e.pointNodes||[]).map(e=>{let n=Math.max(1,e.r||1)+t;return{x:e.x-n,y:e.y-n,width:2*n,height:2*n}})}function An(e,t,n,i,r,a,o,l){let s=xn(e,o),c=.4*Math.hypot(t.dx,t.dy)+80*wn(s,r,a,l);for(let e of n)c+=12*vn(s,e);for(let e of i)c+=4*vn(s,e);return c}function Sn(e,t,n){if("widget"===e.type&&"number"==typeof e.px&&"number"==typeof e.py)return{x:e.px,y:e.py};let i=e.pointId??e.nodeId;if(null!=i&&n.pointNodes){let e=n.pointNodes.find(e=>e.pointId===i);if(e)return{x:e.x,y:e.y}}let r=e.coordinates,a=n.scales?.geoProjection;if(Array.isArray(r)&&r.length>=2&&a){let e=r[0],t=r[1];if("number"==typeof e&&"number"==typeof t){let n=a([e,t]);if(n&&"number"==typeof n[0]&&"number"==typeof n[1])return{x:n[0],y:n[1]}}}return n.scales||"number"!=typeof e.x||"number"!=typeof e.y?Vt(e,t,n):{x:e.x,y:e.y}}function Cn(e){let{annotations:t,context:n,defaultOffset:i=tl,notePadding:r=nl,markPadding:a=il,edgePadding:o=rl,preserveManualOffsets:l=!0,routeLongConnectors:s=!0,connectorThreshold:c=al,density:u,progressiveDisclosure:d=!1,redundantCues:h=!1,responsive:f,mobile:m,cohesion:p,audience:y}=e,g=n.width||0,b=n.height||0,x="object"==typeof m?m:{},v=x.breakpoint??480,w=!!m&&v>=g,k=w&&!1!==x.preferShortText?t.map(mn):t,M=w&&!u?{maxAnnotations:x.maxAnnotations??("callout-list"===x.strategy?1:2),minVisible:x.minVisible??1}:u,A=d||w&&(!1!==x.progressiveDisclosure||"callout-list"===x.strategy),S=w&&!f?x.responsive??{minWidth:v}:f,C=w&&!p?x.cohesion:p;if(0===k.length||0>=g||0>=b)return k.slice();let $=[],j=Mn(n,a),L=!1,N=k.map((e,t)=>{if(!yn(e))return e;let a=Sn(e,t,n);if(!a)return e;let u=gn(!0===e.defensive?hn(e):e);if(l&&sn(e)){let t=cn(e);return $.push(xn(bn(a.x,a.y,"number"==typeof e.dx?e.dx:t.dx,"number"==typeof e.dy?e.dy:t.dy,u),r)),e}let d=null,h=1/0;for(let e of kn(i)){let t=An(bn(a.x,a.y,e.dx,e.dy,u),e,$,j,g,b,r,o);h>t&&(d=e,h=t)}if(!d)return e;let f=xn(bn(a.x,a.y,d.dx,d.dy,u),r);$.push(f);let m=Math.hypot(d.dx,d.dy),p=s&&m>=c&&"text"!==e.type&&"widget"!==e.type?{...e.connector||{end:"arrow"},type:"curve"}:e.connector;return L=!0,{...e,dx:d.dx,dy:d.dy,...p?{connector:p}:{}}}),I=L?N:k.slice(),z=I;if(h){let e=!1,t=I.map(t=>{let n=pn(t);return n!==t&&(e=!0),n});z=e?t:I}{let e=!1,t=z.map(t=>{if(!0!==t?.defensive)return t;let n=hn(t);return n!==t&&(e=!0),n});z=e?t:z}let F,T=/* @__PURE__ */new Set;if(M){let e="object"==typeof M?M:{},t=dn(y),n=1===t?e:{...e,maxAnnotations:Math.max(0,Math.round((e.maxAnnotations??an(g,b,e))*t))},{deferred:i}=ln({annotations:z,width:g,height:b,...n});for(let e of i)T.add(e)}if(S&&("object"==typeof S&&"number"==typeof S.minWidth?S.minWidth:480)>=g)for(let e of z)yn(e)&&"secondary"===e.emphasis&&T.add(e);if(T.size>0)for(let e of z)!0===e?.defensive&&T.delete(e);return F=0===T.size?z:A?z.map(e=>T.has(e)?{...e,_annotationDeferred:!0}:e):z.filter(e=>!T.has(e)),C?fn(F,C):F}function $n({title:e,totalWidth:t,marginTop:n}){return e?"string"!=typeof e?/* @__PURE__ */ll("foreignObject",{x:0,y:0,width:t,height:n,children:e}):/* @__PURE__ */ll("text",{x:t/2,y:22,textAnchor:"middle",fontWeight:"bold",fill:"var(--semiotic-text, #333)",fontSize:14,className:"semiotic-chart-title",style:{userSelect:"none",fontSize:"var(--semiotic-title-font-size, 14px)",fontFamily:"var(--semiotic-title-font-family, var(--semiotic-font-family, sans-serif))",fontWeight:"var(--semiotic-title-font-weight, bold)"},children:e}):null}function jn(e){if(!1!==e?.interactive)return e?.style?.cursor}function Ln(e){if(!e)return!1;for(let t of e)if(jn(t))return!0;return!1}function Nn(e,t){if(!e)return;let n=t??"";e.style.cursor!==n&&(e.style.cursor=n)}function In(e,t){return Nn(e),Ln(t)}function zn(e,t,n){if(e){if(!t.inside||"touch"===t.pointerType)return void Nn(e);Nn(e,n(t))}}function Fn(e){let t=sl.useRef(null);sl.useEffect(()=>{e.current&&(t.current=e.current)}),sl.useEffect(()=>()=>Nn(t.current),[])}function Tn(e,t,n){let i=jn(t);return i&&null!=e&&!1!==e?/* @__PURE__ */cl("g",{style:{cursor:i},"data-semiotic-mark-cursor":i,children:e},n):e}function Rn(){let[e,t]=fl(!1);return pl(()=>{t(!0)},[]),e}function On(){let e=ml(yl,gl,bl);return hl(e).current}function Wn(e){let{hydrated:t,wasHydratingFromSSR:n,storeRef:i,dirtyRef:r,renderFnRef:a,cancelRender:o,cleanup:l}=e;pl(()=>{if(!t)return;let e=i.current;t&&n&&e?.cancelIntroAnimation?.(),!n&&e?.sceneNodes&&e.sceneNodes.length>0&&e?.markStylePaintPending?e.markStylePaintPending():r.current=!0,o?.(),a.current()},[t,n]);let s=hl(l);s.current=l,ul(()=>()=>s.current?.(),[])}function Dn({children:e}){let[t,n]=xl.useState(!1),i=xl.useCallback(()=>n(e=>!e),[]),r=xl.useMemo(()=>({visible:t,setVisible:n,toggle:i}),[t,i]);/* @__PURE__ */
|
|
66
|
-
return vl(wl.Provider,{value:r,children:e})}function En(){return xl.useContext(wl)}function Bn(){let e=xl.useContext(wl);return e?e.toggle:null}function Hn({hoverPoint:e}){let t="";if(e){let n=e.data||e;t="object"==typeof n?"Data point: "+Object.entries(n).filter(([,e])=>"object"!=typeof e&&"function"!=typeof e).map(([e,t])=>`${e}: ${t}`).join(", "):"Data point: "+n}/* @__PURE__ */
|
|
67
|
-
return kl("div",{"aria-live":"polite","aria-atomic":"true",style:Ml,children:t})}function Pn(e){let t={};if(null==e||"object"!=typeof e)return t;for(let[n,i]of Object.entries(e))n.startsWith("_")||null==i||""===i||("number"==typeof i?Number.isFinite(i)&&(t[n]=i):"string"==typeof i?t[n]=i:"boolean"==typeof i?t[n]=i+"":i instanceof Date&&(t[n]=i.toISOString().slice(0,10)));return t}function Gn(e){return e&&"object"==typeof e?e:{}}function Vn(e){return Gn(e.accessibility).tableFields??e.accessibleDatum??e.datum}function _n(e,t){let n=Gn(e.accessibility);return{label:"string"==typeof n.label&&n.label.length>0?n.label:"string"==typeof e.label&&e.label.length>0?e.label:t,values:Pn(Vn(e))}}function Yn(e){let t=[];if(!Array.isArray(e))return t;let n=e.some(e=>e&&("line"===e.type||"area"===e.type));for(let i of e)if(i&&"object"==typeof i&&null!==i.datum)try{switch(i.type){case"point":if(n)break;t.push({label:"Point",values:Pn(Vn(i))});break;case"line":case"area":{let e=Vn(i),n=Array.isArray(e)?e:[],r="line"===i.type?"Line point":"Area point";for(let e of n)t.push({label:r,values:Pn(e)});break}case"rect":{let e=Vn(i),n=null!=e&&"object"==typeof e?e:{},r=n.category??i.group??"",a=n.value??n.__aggregateValue??n.total,o=Pn(n);null==o.category&&""!==r&&(o.category=r+""),null==o.value&&null!=a&&(o.value="number"==typeof a||"string"==typeof a?a:a+""),t.push({label:"Bar",values:o});break}case"heatcell":{let e=Pn(Vn(i));null==e.value&&"number"==typeof i.value&&Number.isFinite(i.value)&&(e.value=i.value),t.push({label:"Cell",values:e});break}case"wedge":{let e=Vn(i),n=Pn(e);if(null==n.category){let t=Gn(e),i=t.category??t.label;null!=i&&(n.category=i+"")}t.push({label:"Wedge",values:n});break}case"circle":t.push({label:"Node",values:Pn(Vn(i))});break;case"arc":t.push({label:"Arc",values:Pn(Vn(i))});break;case"candlestick":t.push({label:"Candlestick",values:Pn(Vn(i))});break;case"geoarea":{let e=Gn(Vn(i)),n=Pn(e);if(null==n.name){let t=Gn(e.properties).name??e.name;null!=t&&(n.name=t+"")}t.push({label:"Region",values:n});break}}}catch{}return t}function Un(e){return null==e||""===e?"—":"number"==typeof e?Number.isNaN(e)?"—":Sl(e):"boolean"==typeof e?e?"true":"false":"object"==typeof e?"—":e+""}function Xn(e){let t=/* @__PURE__ */new Map;for(let n of e??[])for(let[e,i]of Object.entries(n?.values??{})){if(null==i||""===i)continue;let n=t.get(e);if(n||(n={count:0,min:1/0,max:-1/0,sum:0,strings:/* @__PURE__ */new Set},t.set(e,n)),"number"==typeof i){if(!Number.isFinite(i))continue;n.count++,n.sum+=i,n.min>i&&(n.min=i),i>n.max&&(n.max=i)}else"object"!=typeof i&&"function"!=typeof i&&n.strings.add(i+"")}return Array.from(t,([e,t])=>{if(t.count)return{name:e,count:t.count,numeric:!0,min:t.min,max:t.max,mean:t.sum/t.count};let n=Array.from(t.strings);return{name:e,count:n.length,numeric:!1,uniqueValues:n.slice(0,5)}}).filter(e=>e.count>0)}function qn(e,t){let n=[e+" data points."];for(let e of t)if(e.numeric)n.push(`${e.name}: ${Sl(e.min)} to ${Sl(e.max)}, mean ${Sl(e.mean)}.`);else{let t=e.uniqueValues,i=t.length>3?`${t.slice(0,3).join(", ")}… (${e.count} unique)`:t.join(", ");n.push(`${e.name}: ${i}.`)}return n.join(" ")}function Kn(e){return null==e||"object"!=typeof e||Array.isArray(e)?{}:e}function Zn(e){return null!=e&&"object"==typeof e?Kn(e).id:e}function Jn(e){let t=Kn(e.datum);return{source:Zn(t.source??e.source),target:Zn(t.target??e.target)}}function Qn(e,t){let n=/* @__PURE__ */new Map,i=[],r=!1;for(let e=0;t.length>e;e++){let a=t[e];if(!a||"object"!=typeof a)continue;let o=Kn(a.datum),{source:l,target:s}=Jn(a),c="number"==typeof o.value&&Number.isFinite(o.value),u=c?o.value:0;r||(r=c);for(let[e,t,i]of[[l,1,3],[s,0,2]]){if(null==e||""===e)continue;let r=e+"",a=n.get(r)??[0,0,0,0];a[t]++,a[i]+=u,n.set(r,a)}i.push(_n(a,null!=l||null!=s?`${null==l?"?":l+""} → ${null==s?"?":s+""}`:"Edge "+(e+1)))}let a=[],o=0,l=0;for(let t=0;e.length>t;t++){let i=e[t];if(!i||"object"!=typeof i||null===i.datum)continue;let r=Kn(i.datum).id??i.id,s=null!=r?r+"":"node-"+t,[c,u,d,h]=n.get(s)??[0,0,0,0],f=c+u;o+=f,f>l&&(l=f),a.push({id:s,degree:f,inDeg:c,outDeg:u,wDegree:d+h,wInDeg:d,wOutDeg:h,semantic:_n(i,s)})}a.sort((e,t)=>t.degree-e.degree);let s=[`${a.length} nodes, ${t.length} edges.`];return a.length>0&&s.push(`Mean degree: ${Sl(o/a.length)}, max degree: ${l}.`),{nodeRows:a,edgeRows:i,hasWeights:r,summary:s.join(" ")}}function ei({accessibleTable:e,children:t}){return"object"!=typeof e?t:typeof document>"u"?null:/* @__PURE__ */Cl(Al.Suspense,{fallback:null,children:/* @__PURE__ */Cl(jl,{target:e.portalTarget,children:t})})}function ti(e,t){if(!e||0===e.length)return t+", empty";let n={};for(let t of e){if(null===t?.datum)continue;let e=t.type+"";n[e]=(n[e]||0)+1}if(0===Object.keys(n).length)return t+", empty";let i=[],r={point:"points",line:"lines",area:"areas",rect:"bars",heatcell:"cells",circle:"nodes",candlestick:"candlesticks",wedge:"wedges",arc:"arcs",geoarea:"regions"},a=["point","line","area","rect","heatcell","circle","candlestick","wedge","arc","geoarea"],o=Object.keys(n).sort((e,t)=>{let n=a.indexOf(e),i=a.indexOf(t);return(-1===n?999:n)-(-1===i?999:i)});for(let e of o)i.push(`${n[e]} ${r[e]||e}`);return`${t}, ${i.join(", ")}`}function ni(e,t,n){let i=[];return e>0&&i.push(e+" nodes"),t>0&&i.push(t+" edges"),0===i.length?n+", empty":`${n}, ${i.join(", ")}`}function ii({scene:e,chartType:t,tableId:n,chartTitle:i}){let[r,a]=Al.useState(!1),[o,l]=Al.useState(5),s=En(),c=s?.visible??!1,u=r||c,d=Al.useRef(null),h=i?"Data summary for "+i:n?`Data summary for ${t} ${n}`:"Data summary for "+t;Al.useEffect(()=>{u||l(5)},[u]);let f=Al.useCallback(e=>{e.target===e.currentTarget&&!r&&!c&&a(!0)},[r,c]),m=Al.useCallback(e=>{c||d.current?.contains(e.relatedTarget)||a(!1)},[c]);if(!e||0===e.length)return n?/* @__PURE__ */Cl("span",{id:n,tabIndex:-1,style:Ml}):null;if(!u)/* @__PURE__ */
|
|
68
|
-
return Cl("div",{id:n,className:Il,tabIndex:-1,onFocus:f,style:Ml,role:"region","aria-label":h,children:/* @__PURE__ */$l("button",{type:"button",onClick:()=>a(!0),style:Tl,children:["View data summary (",e.length," elements)"]})});let p=Yn(e),y=Xn(p),g=qn(p.length,y),b=Math.min(o,p.length),x=p.slice(0,b),v=p.length-b,w=/* @__PURE__ */new Set;for(let e of x)for(let t of Object.keys(e.values))w.add(t);let k=Array.from(w);/* @__PURE__ */
|
|
69
|
-
return $l("div",{ref:d,id:n,className:zl,tabIndex:-1,onBlur:m,style:Rl,role:"region","aria-label":h,children:[
|
|
70
|
-
/* @__PURE__ */Cl("button",{type:"button",className:"semiotic-accessible-data-table-close",onClick:()=>{c&&s&&s.setVisible(!1),a(!1)},"aria-label":"Close data summary",style:Wl,children:"×"}),
|
|
71
|
-
/* @__PURE__ */Cl("div",{className:"semiotic-accessible-data-table-summary",role:"note",style:Ol,children:g}),
|
|
72
|
-
/* @__PURE__ */$l("table",{className:"semiotic-accessible-data-table-table",role:"table","aria-label":"Sample data for "+t,style:Dl,children:[
|
|
73
|
-
/* @__PURE__ */Cl("caption",{className:"semiotic-accessible-data-table-caption",style:Hl,children:v>0?`First ${b} of ${p.length} data points`:`All ${p.length} data points`}),
|
|
74
|
-
/* @__PURE__ */Cl("thead",{children:/* @__PURE__ */$l("tr",{children:[
|
|
75
|
-
/* @__PURE__ */Cl("th",{style:El,children:"type"}),k.map(e=>/* @__PURE__ */Cl("th",{style:El,children:e},e))]})}),
|
|
76
|
-
/* @__PURE__ */Cl("tbody",{children:x.map((e,t)=>/* @__PURE__ */$l("tr",{children:[
|
|
77
|
-
/* @__PURE__ */Cl("td",{style:Bl,children:e.label}),k.map(t=>/* @__PURE__ */Cl("td",{style:Bl,children:Un(e.values[t])},t))]},t))})]}),v>0&&/* @__PURE__ */$l("button",{type:"button",className:"semiotic-accessible-data-table-show-more",onClick:()=>l(e=>e+Ll),style:Pl,children:["Show ",Math.min(Ll,v)," more"," ",1===v?"row":"rows"," (",v," remaining)"]})]})}function ri({nodes:e,edges:t,chartType:n,tableId:i,chartTitle:r}){let[a,o]=Al.useState(!1),[l,s]=Al.useState(5),[c,u]=Al.useState(5),d=En(),h=d?.visible??!1,f=a||h,m=r?"Data summary for "+r:i?`Data summary for ${n} ${i}`:"Data summary for "+n,p=Al.useRef(null);Al.useEffect(()=>{f||(s(5),u(5))},[f]);let y=Al.useCallback(e=>{e.target===e.currentTarget&&!a&&!h&&o(!0)},[a,h]),g=Al.useCallback(e=>{h||p.current?.contains(e.relatedTarget)||o(!1)},[h]),b=e.filter(e=>null!==e.datum);if(0===b.length&&0===t.length)return i?/* @__PURE__ */Cl("span",{id:i,tabIndex:-1,style:Ml}):null;if(!f)/* @__PURE__ */
|
|
78
|
-
return Cl("div",{id:i,className:Il,tabIndex:-1,onFocus:y,style:Ml,role:"region","aria-label":m,children:/* @__PURE__ */$l("button",{type:"button",onClick:()=>o(!0),style:Tl,children:["View data summary (",b.length," nodes, ",t.length," edges)"]})});let{nodeRows:x,edgeRows:v,hasWeights:w,summary:k}=Qn(b,t),M=Math.min(l,x.length),A=x.slice(0,M),S=x.length-M,C=Math.min(c,v.length),$=v.slice(0,C),j=v.length-C,L=/* @__PURE__ */new Set;for(let e of A)for(let t of Object.keys(e.semantic.values))L.add(t);let N=Array.from(L),I=/* @__PURE__ */new Set;for(let e of $)for(let t of Object.keys(e.values))I.add(t);let z=Array.from(I);/* @__PURE__ */
|
|
79
|
-
return $l("div",{ref:p,id:i,className:Fl,tabIndex:-1,onBlur:g,style:Rl,role:"region","aria-label":m,children:[
|
|
80
|
-
/* @__PURE__ */Cl("button",{type:"button",className:"semiotic-accessible-data-table-close",onClick:()=>{h&&d&&d.setVisible(!1),o(!1)},"aria-label":"Close data summary",style:Wl,children:"×"}),
|
|
81
|
-
/* @__PURE__ */Cl("div",{className:"semiotic-accessible-data-table-summary",role:"note",style:Ol,children:k}),x.length>0&&/* @__PURE__ */$l("table",{className:"semiotic-accessible-data-table-table",role:"table","aria-label":"Node data and degree summary for "+n,style:Dl,children:[
|
|
82
|
-
/* @__PURE__ */Cl("caption",{className:"semiotic-accessible-data-table-caption",style:Hl,children:S>0?`Top ${M} of ${x.length} nodes by degree`:`All ${x.length} nodes by degree`}),
|
|
83
|
-
/* @__PURE__ */Cl("thead",{children:/* @__PURE__ */$l("tr",{children:[
|
|
84
|
-
/* @__PURE__ */Cl("th",{style:El,children:"node"}),N.map(e=>/* @__PURE__ */Cl("th",{style:El,children:e},e)),
|
|
85
|
-
/* @__PURE__ */Cl("th",{style:El,children:"degree"}),
|
|
86
|
-
/* @__PURE__ */Cl("th",{style:El,children:"in"}),
|
|
87
|
-
/* @__PURE__ */Cl("th",{style:El,children:"out"}),w&&/* @__PURE__ */Cl("th",{style:El,children:"w. degree"}),w&&/* @__PURE__ */Cl("th",{style:El,children:"w. in"}),w&&/* @__PURE__ */Cl("th",{style:El,children:"w. out"})]})}),
|
|
88
|
-
/* @__PURE__ */Cl("tbody",{children:A.map((e,t)=>/* @__PURE__ */$l("tr",{"aria-label":e.semantic.label,children:[
|
|
89
|
-
/* @__PURE__ */Cl("td",{style:Bl,children:e.semantic.label}),N.map(t=>/* @__PURE__ */Cl("td",{style:Bl,children:Un(e.semantic.values[t])},t)),
|
|
90
|
-
/* @__PURE__ */Cl("td",{style:Bl,children:e.degree}),
|
|
91
|
-
/* @__PURE__ */Cl("td",{style:Bl,children:e.inDeg}),
|
|
92
|
-
/* @__PURE__ */Cl("td",{style:Bl,children:e.outDeg}),w&&/* @__PURE__ */Cl("td",{style:Bl,children:Sl(e.wDegree)}),w&&/* @__PURE__ */Cl("td",{style:Bl,children:Sl(e.wInDeg)}),w&&/* @__PURE__ */Cl("td",{style:Bl,children:Sl(e.wOutDeg)})]},t))})]}),S>0&&/* @__PURE__ */$l("button",{type:"button",className:"semiotic-accessible-data-table-show-more",onClick:()=>s(e=>e+Ll),style:Pl,children:["Show ",Math.min(Ll,S)," more"," ",1===S?"node":"nodes"," (",S," remaining)"]}),v.length>0&&/* @__PURE__ */$l("table",{className:"semiotic-accessible-data-table-table semiotic-accessible-data-table-edges",role:"table","aria-label":"Edge data for "+n,style:{...Dl,marginTop:12},children:[
|
|
93
|
-
/* @__PURE__ */Cl("caption",{className:"semiotic-accessible-data-table-caption",style:Hl,children:j>0?`First ${C} of ${v.length} edges`:`All ${v.length} edges`}),
|
|
94
|
-
/* @__PURE__ */Cl("thead",{children:/* @__PURE__ */$l("tr",{children:[
|
|
95
|
-
/* @__PURE__ */Cl("th",{style:El,children:"edge"}),z.map(e=>/* @__PURE__ */Cl("th",{style:El,children:e},e))]})}),
|
|
96
|
-
/* @__PURE__ */Cl("tbody",{children:$.map((e,t)=>/* @__PURE__ */$l("tr",{"aria-label":e.label,children:[
|
|
97
|
-
/* @__PURE__ */Cl("td",{style:Bl,children:e.label}),z.map(t=>/* @__PURE__ */Cl("td",{style:Bl,children:Un(e.values[t])},t))]},t))})]}),j>0&&/* @__PURE__ */$l("button",{type:"button",className:"semiotic-accessible-data-table-show-more",onClick:()=>u(e=>e+Ll),style:Pl,children:["Show ",Math.min(Ll,j)," more"," ",1===j?"edge":"edges"," (",j," remaining)"]})]})}function ai({summary:e}){return e?/* @__PURE__ */Cl("div",{role:"note",style:Ml,children:e}):null}function oi({tableId:e}){/* @__PURE__ */
|
|
98
|
-
return Cl("a",{href:"#"+e,style:Ml,onClick:t=>{t.preventDefault();let n=document.getElementById(e);n&&requestAnimationFrame(()=>n.focus())},onFocus:e=>{Object.assign(e.currentTarget.style,{position:"absolute",width:"auto",height:"auto",overflow:"visible",clip:"auto",whiteSpace:"normal",padding:"4px 8px",background:"var(--semiotic-bg, #fff)",color:"var(--semiotic-text, #000)",border:"2px solid var(--semiotic-focus, #005fcc)",borderRadius:"4px",zIndex:"10",fontSize:"12px",top:"4px",left:"4px"})},onBlur:e=>{let t=e.currentTarget;t.removeAttribute("style"),Object.assign(t.style,Ml)},children:"Skip to data table"})}function li({active:e,hoverPoint:t,margin:n,size:i,shape:r="circle",width:a,height:o,pathData:l}){if(!e||!t)return null;let s,c=t.x+n.left,u=t.y+n.top;if("geoarea"!==r&&"path"!==r||!l)if("rect"===r&&null!=a&&null!=o){let e=Math.max(a,4),t=Math.max(o,4);s=/* @__PURE__ */Gl("rect",{x:c-e/2-3,y:u-t/2-3,width:e+6,height:t+6,rx:3,fill:"none",stroke:Vl,strokeWidth:2,strokeDasharray:"4,2"})}else s=/* @__PURE__ */Gl("circle","wedge"===r?{cx:c,cy:u,r:12,fill:"none",stroke:Vl,strokeWidth:2.5,strokeDasharray:"6,3"}:{cx:c,cy:u,r:8,fill:"none",stroke:Vl,strokeWidth:2,strokeDasharray:"4,2"});else s=/* @__PURE__ */Gl("g",{transform:`translate(${n.left},${n.top})`,children:/* @__PURE__ */Gl("path",{d:l,fill:"none",stroke:Vl,strokeWidth:2.5,strokeDasharray:"6,3"})});/* @__PURE__ */
|
|
99
|
-
return Gl("svg",{style:{position:"absolute",left:0,top:0,width:i[0],height:i[1],pointerEvents:"none",zIndex:2},"aria-hidden":"true",children:s})}function si({x:e,y:t,containerWidth:n,containerHeight:i,margin:r,children:a,className:o="stream-frame-tooltip",zIndex:l=1}){let s,c=Number.isFinite(e)&&Number.isFinite(t),u=_l.useRef(null),[d,h]=_l.useState(null);_l.useLayoutEffect(()=>{let e=u.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect();!Number.isFinite(t.width)||!Number.isFinite(t.height)||h(e=>e&&.5>Math.abs(e.width-t.width)&&.5>Math.abs(e.height-t.height)?e:{width:t.width,height:t.height})};if(t(),typeof ResizeObserver>"u")return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[o,n,i,c]),s=d?`translate(${d.width+12>n-e?"calc(-100% - 12px)":"12px"}, ${d.height+12>i-t?"calc(-100% - 4px)":"4px"})`:`translate(${e>.7*n?"calc(-100% - 12px)":"12px"}, ${.3*i>t?"4px":"calc(-100% - 4px)"})`;let f=b(a),m=f?null:oa;return c?/* @__PURE__ */Yl("div",{ref:u,className:f?o:(o+" semiotic-tooltip").trim(),style:{...m||{},position:"absolute",left:r.left+e,top:r.top+t,transform:s,pointerEvents:"none",zIndex:l,width:"max-content"},children:a}):null}function ci(e,t="ease-out-cubic"){return"linear"===t?e:1-Math.pow(1-e,3)}function ui(e,t){return Math.min((e-t.startTime)/t.duration,1)}function di(e,t,n){return e+(t-e)*n}function hi(){return"u">typeof performance?performance.now():Date.now()}function fi(e,t){if(!1===e)return{transition:void 0,introEnabled:!1};let n="u">typeof window&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;return{transition:e?!0===e?{duration:300}:{duration:e.duration??300,easing:"linear"===e.easing?"linear":"ease-out"}:t,introEnabled:!(n||!e||!0!==e&&!1===e.intro)}}function mi(e){let t=e>>>0;return()=>{t+=1831565813;let e=t;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296}}function pi(e,t){let n=e();return Number.isFinite(n)?n:t}function yi(e,t,n){return"function"==typeof e?e({size:t,margin:n}):e}function gi(e){let t=Vr(),n=Jl(t);n.current=t;let[i,r]=Ee(e.sizeProp,e.responsiveWidth,e.responsiveHeight),a=r[0],o=r[1],l=Zl(()=>[a,o],[a,o]),s=!!e.title,c=!!e.legend&&"top"===e.legendPosition,u=Zl(()=>{let t=me({...e.marginDefault,...e.userMargin},s,c);if(e.legend&&!e.legendMarginReserved){let n={...t},i=e.legendPosition??"right";$e(t,{legend:e.legend,position:i,size:l,hasTitle:s,legendLayout:e.legendLayout,axisChrome:e.axisChrome}),pe(t,n,l,i)}return t},[e.marginDefault,e.userMargin,e.legend,e.legendPosition,e.legendLayout,e.axisChrome,e.legendMarginReserved,s,c,l]),d=r[0]-u.left-u.right,h=r[1]-u.top-u.bottom,f=yi(e.foregroundGraphics,r,u),m=yi(e.backgroundGraphics,r,u),p=Hr(e=>e.theme),{transition:y,introEnabled:g}=fi(e.animate,e.transitionProp),b="semiotic-table-"+Ul.useId(),x=Jl(null);if(!x.current){let t=!e.suspendWhenHidden||typeof document>"u"||!document.hidden;x.current=new es({clock:e.clock,random:e.random,seed:e.seed,paused:e.paused,visible:t})}let v=x.current;v.configure({clock:e.clock,random:e.random,seed:e.seed});let w=Jl(null),k=Jl(e.frameScheduler??ns);k.current=e.frameScheduler??ns;let M=Jl(null),A=Jl(!1),S=Jl(()=>{}),C=Xl(()=>{if(null!==w.current||A.current)return;let e=k.current,t=!1,n=!1,i=e.requestAnimationFrame(()=>{t=!0;let e=!n;e&&(A.current=!0),w.current=null,M.current=null;try{S.current()}finally{e&&(A.current=!1)}});n=!0,t||(w.current=i,M.current=e)},[]),$=Xl(()=>{null!==w.current&&((M.current??k.current).cancelAnimationFrame(w.current),w.current=null,M.current=null)},[]);ts(()=>{v.setPaused(!0===e.paused)},[v,e.paused]),ql(()=>{if(!e.suspendWhenHidden||typeof document>"u")return void v.setVisible(!0);let t=()=>v.setVisible(!document.hidden);return t(),document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)},[v,e.suspendWhenHidden]),ql(()=>()=>{$()},[$]);let j=Jl(()=>{}),L=Jl(()=>{}),N=Jl({inside:!1,clientX:0,clientY:0,pointerType:void 0}),I=Jl(null),z=Jl(null),F=Jl(null),T=Xl(()=>{let e=I.current;I.current=null,e&&j.current(e)},[]),R=Xl(e=>{let t=N.current;if(t.inside=!0,t.clientX=e.clientX,t.clientY=e.clientY,t.pointerType=e.pointerType,I.current={clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType},null===z.current){let e=k.current,t=!1,n=e.requestAnimationFrame(()=>{t=!0,z.current=null,F.current=null,T()});t||(z.current=n,F.current=e)}},[T]),O=Xl(()=>{N.current.inside=!1,I.current=null,null!==z.current&&((F.current??k.current).cancelAnimationFrame(z.current),z.current=null,F.current=null),L.current()},[]);ql(()=>()=>{I.current=null,null!==z.current&&((F.current??k.current).cancelAnimationFrame(z.current),z.current=null,F.current=null)},[]);let W=e.themeDirtyRef,D=Jl(!1);return ts(()=>{if(!W)return;let t=!D.current;D.current=!0,(!t||!e.skipInitialThemeInvalidation)&&(Nr(),W.current=!0,C())},[p,e.skipInitialThemeInvalidation,C,W]),ql(()=>{if(W)return Lr(()=>i.current,()=>{W.current=!0,C()})},[i,C,W]),{reducedMotion:t,reducedMotionRef:n,responsiveRef:i,size:r,margin:u,adjustedWidth:d,adjustedHeight:h,resolvedForeground:f,resolvedBackground:m,currentTheme:p,transition:y,introEnabled:g,tableId:b,frameRuntime:v,rafRef:w,renderFnRef:S,scheduleRender:C,cancelRender:$,hoverHandlerRef:j,hoverLeaveRef:L,onPointerMove:R,onPointerLeave:O,pointerStateRef:N}}function bi(e,t,n){let i=Math.round(t[0]*n),r=Math.round(t[1]*n),a=0===t[0]?n:i/t[0],o=0===t[1]?n:r/t[1],l=t[0]+"px",s=t[1]+"px";return e.style.width!==l&&(e.style.width=l),e.style.height!==s&&(e.style.height=s),e.width!==i&&(e.width=i),e.height!==r&&(e.height=r),{effectiveDprX:a,effectiveDprY:o}}function xi(e,t,n,i){let r=e.getContext("2d");if(!r)return null;let{effectiveDprX:a,effectiveDprY:o}=bi(e,t,i);return r.setTransform(a,0,0,o,0,0),r.translate(n.left,n.top),r}function vi(e,t){if(typeof window>"u")return 1;let n=window.devicePixelRatio||1,i="u">=typeof window&&("function"==typeof window.matchMedia&&window.matchMedia("(pointer: coarse)").matches||768>Math.min(window.innerWidth||1/0,window.innerHeight||1/0))?2:3,r="number"==typeof e&&e>0?e:i;if(!t)return Math.max(1,Math.min(n,r));let[a,o]=t,l=Math.min(Math.sqrt(8388608/(a*o)),16384/Math.max(a,o));return Math.max(1>l?0:1,Math.min(n,r,l))}function wi(e){function t(){i||(r(),n=null,e(),queueMicrotask(()=>{i||a()}))}if(typeof window>"u"||"function"!=typeof window.matchMedia)return()=>{};let n=null,i=!1,r=()=>{n&&("function"==typeof n.removeEventListener?n.removeEventListener("change",t):"function"==typeof n.removeListener&&n.removeListener(t))},a=()=>{let e=`(resolution: ${window.devicePixelRatio||1}dppx)`;n=window.matchMedia(e),n.media.includes("resolution")?"function"==typeof n.addEventListener?n.addEventListener("change",t):"function"==typeof n.addListener&&n.addListener(t):n=null};return a(),()=>{i=!0,r(),n=null}}function ki(e){let{cancelRender:t,dirtyRef:n,frameRuntime:i,manageFrameRuntime:r,maxDevicePixelRatio:a,scheduleRender:o}=e,l=as(null),s=as(null),c=as(!1),u=as(!1),d=as(!1);return ss(()=>{!u.current&&(u.current=!0,e.skipInitialCanvasPaintInvalidation)||(e.canvasPaintInvalidator?e.canvasPaintInvalidator():e.dirtyRef.current=!0,e.scheduleRender())},e.canvasPaintDependencies),Wn({hydrated:e.hydrated,wasHydratingFromSSR:e.wasHydratingFromSSR,storeRef:e.storeRef,dirtyRef:e.dirtyRef,renderFnRef:e.renderFnRef,cancelRender:e.cancelRender,cleanup:e.cleanup}),is(()=>{if(!1!==r)return i.subscribe(()=>{i.isActive?(n.current=!0,o()):t()})},[t,n,i,r,o]),is(()=>wi(()=>{c.current=!0,o()}),[o]),is(()=>{d.current?(c.current=!0,o()):d.current=!0},[a,o]),{canvasRef:l,interactionCanvasRef:s,resolutionDirtyRef:c}}function Mi(e,t){return ki({...t,renderFnRef:e.renderFnRef,scheduleRender:e.scheduleRender,cancelRender:e.cancelRender,frameRuntime:e.frameRuntime})}function Ai({children:e,size:t,margin:n,backdropFill:i,overflowVisible:r=!1}){return e||i?/* @__PURE__ */ls("svg",{style:{position:"absolute",left:0,top:0,width:t[0],height:t[1],pointerEvents:"none",overflow:r?"visible":void 0},children:[i&&"transparent"!==i?/* @__PURE__ */os("rect",{className:"stream-frame-background__backdrop",x:0,y:0,width:t[0],height:t[1],fill:i}):null,
|
|
100
|
-
/* @__PURE__ */os("g",{transform:`translate(${n.left},${n.top})`,children:e})]}):null}function Si(e){return"touch"===e?"touch":"pointer"}function Ci(e){let t=e.target;return t instanceof Element&&t!==e.currentTarget&&null!=t.closest("button, a[href], input, select, textarea, summary, [contenteditable='true'], [role='button'], [role='link'], [role='checkbox'], [role='radio'], [role='switch']")}function $i(e){let{onObservation:t,datum:n,x:i=0,y:r=0,chartType:a,chartId:o,context:l,timestamp:s=Date.now()}=e;if(t){if(!n)return void t({type:"hover-end",timestamp:s,chartType:a,chartId:o});t({type:"hover",datum:n,x:i,y:r,timestamp:s,chartType:a,chartId:o}),"focus"===l?.type&&t({type:"focus",datum:n,inputType:"touch"===l.inputType?"pointer":l.inputType,timestamp:s,chartType:a,chartId:o})}}function ji(e){let{onObservation:t,datum:n,x:i=0,y:r=0,chartType:a,chartId:o,context:l,timestamp:s=Date.now()}=e;if(t){if(!n)return void t({type:"click-end",timestamp:s,chartType:a,chartId:o});t({type:"click",datum:n,x:i,y:r,timestamp:s,chartType:a,chartId:o}),"activate"===l?.type&&t({type:"activate",datum:n,inputType:l.inputType,timestamp:s,chartType:a,chartId:o})}}function Li({componentName:e,width:t,height:n,children:i}){/* @__PURE__ */
|
|
101
|
-
return cs(ga,{fallback:i=>/* @__PURE__ */cs(T,{componentName:e,message:i.message,width:t,height:n}),children:i})}function Ni(e,t,n,i){return!1===i||null==e||Array.isArray(e)&&e.length>0||!Array.isArray(e)?null:/* @__PURE__ */cs("div",{style:{...ds,width:t,height:n},children:i||"No data available"})}function Ii(e,t,n,i){if(!e||!1===i)return null;if(null!=i)/* @__PURE__ */
|
|
102
|
-
return cs("div",{style:{width:t,height:n,display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box"},children:i});let r=Math.min(5,Math.floor(n/40)),a=Math.max(8,Math.floor(n/(3*r))),o=Math.max(6,Math.floor(n/(2.5*r))),l=Math.floor((n-(r*(a+o)-o))/2);/* @__PURE__ */
|
|
103
|
-
return cs("div",{style:{width:t,height:n,position:"relative",overflow:"hidden",border:"1px solid var(--semiotic-border, #e0e0e0)",borderRadius:4,boxSizing:"border-box"},children:Array.from({length:r},(e,n)=>/* @__PURE__ */cs("div",{className:"semiotic-loading-bar",style:{...hs,position:"absolute",top:l+n*(a+o),left:Math.floor(.1*t),width:30+(37*n+13)%50+"%",height:a,opacity:.5+n%2*.2}},n))})}function zi(e,t,n,i){if(!us||!t||0===t.length||"string"!=typeof i)return;let r=t[0];if(!r||"object"!=typeof r||i in r)return;let a=Object.keys(r).join(", ");console.warn(`[semiotic] ${e}: ${n} "${i}" not found in data. Available keys: ${a}`)}function Fi(e,t){return e?!0===e?{name:"hover",fields:t||[]}:"string"==typeof e?{name:e,fields:t||[]}:{name:e.name||"hover",fields:e.fields||t||[],mode:e.mode,xField:e.xField,seriesField:e.seriesField}:null}function Ti(e){return e?"string"==typeof e?{name:e}:e:null}function Ri(e,t,n,i){if(!t)return e;let r=(r,...a)=>{let o={...e(r,...a)};if(t.isActive)if(t.predicate(i?i(r):r))n?.selectedStyle&&Object.assign(o,n.selectedStyle);else{let e=n?.unselectedOpacity??.5;o.opacity=e,o.fillOpacity=e,o.strokeOpacity=e,n?.unselectedStyle&&Object.assign(o,n.unselectedStyle)}return o};return qr(r,[r])}function Oi(e,t={}){let n=t.mobileSemantics?.interaction,i="number"==typeof n?.targetSize?n.targetSize:"number"==typeof t.mobileSemantics?.minimumHitTarget?t.mobileSemantics.minimumHitTarget:void 0,r="mobile"===t.mode||"number"==typeof t.width&&480>=t.width,a=!!n||void 0!==i,o=e&&"object"==typeof e?e:void 0;if(!1===e||!1===o?.enabled||void 0===e&&!r&&!a)return ms;let l=o??{};return{enabled:!0,tapToSelect:l.tapToSelect??!0,tapToLockTooltip:l.tapToLockTooltip??!0,clearSelection:l.clearSelection??"backgroundTap",targetSize:l.targetSize??i??44,snap:l.snap??"nearestDatum",brushHandleSize:l.brushHandleSize??44,standardControls:l.standardControls??!1}}function Wi(e,t,n){let i=ps[e||"primary"],r=e&&"primary"!==e||!n?.width?i.width:n.width,a=e&&"primary"!==e||!n?.height?i.height:n.height,o=ae({...t,mode:e},{width:t.width??r,height:t.height??a}).props,l=o.mode||e||"primary",s=ps[l],c="context"===l||"sparkline"===l,u="primary"===l&&n?.width?n.width:s.width;return{mode:l,width:o.width??u,height:o.height??("primary"===l&&n?.height?n.height:s.height),showAxes:o.showAxes??s.showAxes,showGrid:o.showGrid??s.showGrid,enableHover:o.enableHover??(!!o.linkedHover||s.enableHover),showLegend:o.showLegend??s.showLegend,showLabels:o.showLabels??s.showLabels,title:c?void 0:o.title,description:o.description,summary:o.summary,accessibleTable:o.accessibleTable,xLabel:c?void 0:o.xLabel,yLabel:c?void 0:o.yLabel,categoryLabel:c?void 0:o.categoryLabel,valueLabel:c?void 0:o.valueLabel,marginDefaults:Ei(s.marginDefaults,o.showCategoryTicks,o.orientation),compactMode:c,mobileInteraction:Oi(o.mobileInteraction,{mode:l,width:o.width??u,mobileSemantics:o.mobileSemantics}),mobileSemantics:o.mobileSemantics}}function Di(e){return e.compactMode?e.marginDefaults:ys}function Ei(e,t,n){if(!1!==t)return e;let i={...e};return"horizontal"===n?i.left=Math.min(i.left,15):i.bottom=Math.min(i.bottom,15),i}function Bi({data:e,colorBy:t,colorScale:n,getColor:i,strokeColor:r,strokeWidth:a,categories:o}){return{legendGroups:[{styleFn:e=>{let t=e.color||"#333",n={fill:t,stroke:t};return void 0!==r&&(n.stroke=r),void 0!==a&&(n.strokeWidth=a),n},type:"fill",items:(void 0!==o?o:Array.from(new Set(e.map(e=>"function"==typeof t?t(e):e[t])))).map((r,a)=>{let o=e.find("function"==typeof t?e=>t(e)===r:e=>e[t]===r),l=o?i(o,t,n):n?n(r):vr[a%vr.length];return{label:r+"",color:l,__semioticCategory:!0}}),label:""}]}}function Hi(e,t){if(!t)return[];let n=/* @__PURE__ */new Set;for(let i of e){let e="function"==typeof t?t(i):i[t];null!=e&&n.add(e+"")}return Array.from(n)}function Pi(e,t){return null!=e&&Object.hasOwn(e,t)}function Gi(e,t,n){let i=Pi(n,"legendPosition"),r=Pi(n,"legendLayout");return{legendPosition:i?n?.legendPosition??"right":e??"right",legendLayout:r?n?.legendLayout:t}}function Vi({data:e,colorBy:t,colorScale:n,showLegend:i,legendPosition:r,userMargin:a,defaults:o={top:50,bottom:60,left:70,right:40},categories:l,additionalLegend:s,chartWidth:c,chartHeight:u,legendLayout:d,frameLegend:h,hasTitle:f=!1,axisChrome:m}){let{legendPosition:p,legendLayout:y}=Gi(r,d,h),g=Pi(h,"legend"),b=za(lo),x=Ve(),v=void 0!==i?i:!b&&!!t,w=!!t&&(v||x),k=gs(()=>w?void 0!==l?l:Hi(e,t):[],[l,t,e,w]);Ge(x&&t?k:[]);let M=gs(()=>{if(!v||!t)return;let i=Bi({data:e,colorBy:t,colorScale:n,getColor:wr,categories:k});return 0!==i.legendGroups.reduce((e,t)=>e+t.items.length,0)?i:void 0},[v,t,e,n,k]),A=gs(()=>g?h?.legend:de(M,s),[M,s,h?.legend,g]),{hasAxis:S,hasAxisLabel:C,rotatedTicks:$,topAxis:j,leftAxis:L,rightAxis:N}=m??{},I=void 0!==j,z=void 0!==L,F=void 0!==N,{hasAxis:T,hasAxisLabel:R,rotatedTicks:O}=j??{},{hasAxis:W,hasAxisLabel:D}=L??{},{hasAxis:E,hasAxisLabel:B}=N??{},H=gs(()=>{let e="number"==typeof a?{top:a,bottom:a,left:a,right:a}:a??{},t=Ie(o,h?.axes,f),n=n=>{let i=e[n];return"number"==typeof i?i:t[n]},i={top:n("top"),right:n("right"),bottom:n("bottom"),left:n("left")},r={...i};return A&&($e(i,{legend:A,position:p,size:[c??600,u??400],hasTitle:f,legendLayout:y,minimumMargin:"bottom"===p?80:"top"===p?50:0,axisChrome:void 0===S?{hasAxis:!0,hasAxisLabel:!0}:{hasAxis:S,hasAxisLabel:C,rotatedTicks:$,topAxis:I?{hasAxis:T,hasAxisLabel:R,rotatedTicks:O}:void 0,leftAxis:z?{hasAxis:W,hasAxisLabel:D}:void 0,rightAxis:F?{hasAxis:E,hasAxisLabel:B}:void 0}}),null!=c&&null!=u&&pe(i,r,[c,u],p)),i},[o,h?.axes,a,A,p,c,u,y,f,S,C,$,I,T,R,O,z,W,D,F,E,B]);return{legend:A,margin:H,legendPosition:p,legendLayout:y,legendMarginReserved:void 0!==A&&!Pi(h,"margin"),hasAutomaticLegend:void 0!==M}}function _i(e){let t=e.valueRange;return Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]?[t[0],t[1]]:null}function Yi(e,t){return"string"==typeof e.interactionKey?e.interactionKey:`${t[0]}:${t[1]}`}function Ui(e,t,n,i=!0,r=!1){let[a,o]=vs(null),[l,s]=vs(
|
|
104
|
-
/* @__PURE__ */new Set),c=gs(()=>/* @__PURE__ */new Set,[]),u=gs(()=>new Set(n),[n]),d=null!=a&&u.has(a)?a:null,h=gs(()=>{if(0===l.size)return l;let e=new Set(Array.from(l).filter(e=>u.has(e)));return 0===e.size||e.size===u.size?c:e.size===l.size?l:e},[u,c,l]);xs(()=>{(!i||!t||!e||"none"===e)&&(o(null),s(e=>0===e.size?e:/* @__PURE__ */new Set))},[t,i,e]),xs(()=>{o(e=>null==e||u.has(e)?e:null),s(e=>{if(0===e.size)return e;let t=new Set(Array.from(e).filter(e=>u.has(e)));return 0===t.size||t.size===u.size?/* @__PURE__ */new Set:t.size===e.size?e:t})},[u]);let f=bs(t=>{!i||"highlight"!==e||o(!t||!u.has(t.label)||r&&!0!==t.__semioticCategory?null:t.label)},[u,i,e,r]),m=bs(t=>{!i||"isolate"!==e||!u.has(t.label)||r&&!0!==t.__semioticCategory||s(e=>{let n=new Set(Array.from(e).filter(e=>u.has(e)));return n.has(t.label)?n.delete(t.label):n.add(t.label),n.size===u.size?/* @__PURE__ */new Set:n})},[u,i,e,r]),p=gs(()=>{if(!i||!e||"none"===e||!t)return null;let n=e=>{let n="function"==typeof t?t(e):e[t];return"string"==typeof n?n:n+""};return"highlight"===e&&null!=d?{isActive:!0,predicate:e=>n(e)===d}:"isolate"===e&&h.size>0?{isActive:!0,predicate:e=>h.has(n(e))}:null},[t,i,e,d,h]);return{highlightedCategory:i&&"highlight"===e?d:null,isolatedCategories:i&&"isolate"===e?h:c,onLegendHover:f,onLegendClick:m,legendSelectionHook:p}}function Xi(e,t,n,i=5){let[r,a]=n,[o,l]=vs(null),[s,c]=vs(/* @__PURE__ */new Map),u=gs(()=>/* @__PURE__ */new Set,[]);xs(()=>{l(null),c(/* @__PURE__ */new Map)},[r,a,i,e]);let d=bs(t=>{if("highlight"!==e||!t)return void("highlight"===e&&l(null));let n=_i(t);n&&l({key:Yi(t,n),range:n})},[e]),h=bs(t=>{if("isolate"!==e)return;let n=_i(t);n&&c(e=>{let r=new Map(e),a=Yi(t,n);return r.has(a)?r.delete(a):r.set(a,n),r.size===i?/* @__PURE__ */new Map:r})},[i,e]),f=gs(()=>{let n="highlight"===e&&o?[o.range]:"isolate"===e?[...s.values()]:[];return 0===n.length?null:{isActive:!0,predicate:e=>{let i=t(e);return Number.isFinite(i)&&n.some(([e,t])=>i>=Math.min(e,t)&&Math.max(e,t)>=i)}}},[o,s,e,t]);return{highlightedCategory:"highlight"===e?o?.key??null:null,isolatedCategories:"isolate"===e?new Set(s.keys()):u,onLegendHover:d,onLegendClick:h,legendSelectionHook:f}}function qi(e,t,n){let i=e.xValue??t?.[n];if(null==i)return null;let r=Number(i);return Number.isFinite(r)?r:null}function Ki(e){let t=e.data||e.datum||e;return Array.isArray(t)&&(t=t[0]),null!=e.xValue&&t&&"object"==typeof t&&!Array.isArray(t)&&null==t.xValue?{...t,xValue:e.xValue}:t||{}}function Zi(e){if(!e)return!1;for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1}function Ji(){let e=Xr()?.colors?.categorical;return e&&e.length>0?e:void 0}function Qi(){return Xr()?.colors?.sequential||void 0}function er(){return Xr()?.colors?.diverging||void 0}function tr(e,t,n,i,r){if(e)return e;if(n&&"object"==typeof n&&!Array.isArray(n)){let e=kr(n,i);if(e)return e}let a;if(Array.isArray(n))a=n;else if(t&&t.length>0)a=t;else if("string"==typeof n){let e=yr[n];Array.isArray(e)&&(a=e)}return a&&0!==a.length?null!=i?(r.has(i)||r.set(i,r.size),a[r.get(i)%a.length]):a[0]:br}function nr(e){return"function"==typeof e?e:t=>t[e]}function ir(e,t,n){let i=O(),r=Ji();return ws(()=>{if(!t)return;let a=i??void 0,o=n??(r&&r.length>0?r:void 0)??"category10";if(0!==e.length){if("function"==typeof t){let n=Array.from(new Set(e.map(e=>t(e)+"")));if(a&&Zi(a)){let e=n.map(e=>({_cat:e})),t=Mr(e,"_cat",o);return e=>kr(a,e)??t(e)}let i=n.map(e=>({_cat:e}));return Mr(i,"_cat",o)}if(a&&Zi(a)){let n=Mr(e,t,o);return e=>kr(a,e)??n(e)}return Mr(e,t,o)}if(a&&Zi(a)){let e=Mr([{_:"a"}],"_",o);return t=>kr(a,t)??e(t)}},[e,t,n,i,r])}function rr(e,t,n){return ws(()=>{if(!t||"auto"===t||"function"==typeof t)return e;let i=[...e],r=nr(n);return i.sort("asc"===t?(e,t)=>r(e)-r(t):(e,t)=>r(t)-r(e))},[e,t,n])}function ar({selection:e,linkedHover:t,fallbackFields:n=$s,unwrapData:i=!1,onObservation:r,chartType:a,chartId:o,onClick:l,hoverHighlight:s,colorByField:c,mobileInteraction:u,emitObservations:d=!0}){let h=As(),f=ws(()=>Fi(t,n),[t,n]),m=ws(()=>"series"===f?.mode?[f.seriesField||c||n[0]].filter(e=>!!e):f?.fields||n,[f,c,n]),p=U({name:e?.name||"__unused__",fields:m}),y=q({name:f?.name||"hover",fields:m}),g=Gr(e=>e.pushObservation),b=ks(e=>{r?.(e),g?.(e)},[r,g]),x=e?{isActive:p.isActive,predicate:p.predicate}:null,[v,w]=Ms(null),k=Cs(!1),M=c||n[0],A=ws(()=>{if(!s||null==v||!M)return null;let e=v,t=M;return{isActive:!0,predicate:n=>("string"==typeof n[t]?n[t]:(n[t]??"")+"")===e}},[s,v,M]),S=ks((e,n)=>{let i=!e&&k.current&&!!u?.enabled&&u.tapToLockTooltip;if(t)if(e){let t=e.data||e.datum||e;if(Array.isArray(t)&&(t=t[0]),"x-position"===f?.mode&&f.xField){let n=qi(e,t,f.xField);null!=n&&D(f.name||"hover",n,h)}"x-position"!==f?.mode&&y.onHover(t)}else"x-position"===f?.mode&&!i&&E(f.name||"hover",h),"x-position"!==f?.mode&&!i&&y.onHover(null);if(s&&M)if(e){let t=e.data||e.datum||e;Array.isArray(t)&&(t=t[0]);let n=t?.[M];w(null!=n?n+"":null)}else i||w(null);d&&(r||g)&&$i({onObservation:b,datum:e?Ki(e):null,x:e?.x,y:e?.y,chartType:a||"unknown",chartId:o,context:n})},[t,y,f,h,r,a,o,g,b,d,s,M,u]),C=ks((n=!0)=>{k.current=!1,t&&"x-position"!==f?.mode&&y.onHover(null),e&&u?.tapToSelect&&p.clear(),n&&s&&w(null),"x-position"===f?.mode&&(H(f.name||"hover",h),E(f.name||"hover",h))},[t,f,y,e,u,p,s,h]),$=ks((n,i)=>{let c=!!u?.enabled&&(u.tapToLockTooltip||u.tapToSelect),x=!!u?.enabled&&"backgroundTap"===u.clearSelection;if("x-position"===f?.mode&&f.xField&&n){let e=n.data||n.datum||n;Array.isArray(e)&&(e=e[0]);let t=qi(n,e,f.xField);null!=t&&B(f.name||"hover",t,h)}if(c)if(n){k.current=!0;let i=Ki(n);if(t&&"x-position"!==f?.mode&&y.onHover(i),e&&u?.tapToSelect&&m.length>0){let e={};for(let t of m){let n=i[t];void 0!==n&&(e[t]=[n])}Zi(e)&&p.selectPoints(e)}if(s&&M){let e=i?.[M];w(null!=e?e+"":null)}}else x&&C();if(n||x){if(n&&l){let e=n.data||n.datum||n;Array.isArray(e)&&(e=e[0]),l(e,{x:n.x??0,y:n.y??0})}d&&(r||g)&&ji({onObservation:b,datum:n?Ki(n):null,x:n?.x,y:n?.y,chartType:a||"unknown",chartId:o,context:i})}},[l,d,r,g,b,a,o,f,h,u,t,y,e,p,m,s,M,C]);return Ss(()=>{if(!u?.enabled||typeof document>"u")return;let e=e=>{"Escape"===e.key&&k.current&&C()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[u?.enabled,C]),Ss(()=>()=>{k.current&&C(!1)},[C]),Ss(()=>{if("x-position"!==f?.mode)return;let e=f.name||"hover";return()=>{H(e,h),E(e,h)}},[f?.mode,f?.name,h]),{activeSelectionHook:x,hoverSelectionHook:A,customHoverBehavior:S,customClickBehavior:$,crosshairSourceId:h}}function or(e,t){let n="object"==typeof e&&null!==e?e:void 0;if("x-position"===n?.mode)return{linkedCrosshairName:n.name||"hover",linkedCrosshairSourceId:t}}function lr(e,t,n){return Wi(e,t,n)}function sr(e,t="#4e79a7"){return Ir(e)?e.background&&"transparent"!==e.background?e.background:t:e&&"string"==typeof e?e:t}function cr(e){let t=e.replace(/[^A-Za-z0-9_-]/g,"_");return!t||/^\d/.test(t)?"s_"+t:t}function ur(e,t,n,i){let r=e.glyph;if(!r?.parts?.length||0>=e.size)return null;let a=Cr(r,e.size);if(0>=a.scale)return null;let o=`translate(${t},${n})${e.rotation?` rotate(${180*e.rotation/Math.PI})`:""} translate(${a.offsetX},${a.offsetY}) scale(${a.scale})`,l=e.color??("string"==typeof e.style.fill?e.style.fill:void 0),s=jr(r,e.fraction??1,e.fractionStart??0,e.fractionDirection??"horizontal"),c=s?cr(i+"-clip"):void 0,u=(e.style.opacity??1)*(e._decayOpacity??1)*(e.style.fillOpacity??1),d=t=>r.parts.map((n,i)=>{let r=t?"none"===n.fill?void 0:t:$r(n.fill,l,e.accent),a=t?n.stroke&&"none"!==n.stroke?t:void 0:$r(n.stroke??"none",l,e.accent);return r||a?/* @__PURE__ */Ls("path",{d:n.d,fill:r??"none",stroke:a,strokeWidth:a?n.strokeWidth??1:void 0,strokeLinecap:n.strokeLinecap,strokeLinejoin:n.strokeLinejoin,opacity:n.opacity},i):null});/* @__PURE__ */
|
|
105
|
-
return Ns("g",{transform:o,opacity:1===u?void 0:u,children:[s&&c&&/* @__PURE__ */Ls("clipPath",{id:c,children:/* @__PURE__ */Ls("rect",{x:s.x,y:s.y,width:s.width,height:s.height})}),s&&e.ghostColor?/* @__PURE__ */Ls("g",{children:d(e.ghostColor)}):null,s&&c?/* @__PURE__ */Ls("g",{clipPath:`url(#${c})`,children:d()}):d()]},i)}function dr(e,t){let n=e.filter(e=>Number.isFinite(e.offset)&&(null==e.opacity||Number.isFinite(e.opacity))).map(e=>({offset:Math.max(0,Math.min(1,e.offset)),color:e.color??t,opacity:null==e.opacity?void 0:Math.max(0,Math.min(1,e.opacity))}));return 2>n.length?null:n.map((e,t)=>/* @__PURE__ */Ls("stop",{offset:e.offset,stopColor:e.color,stopOpacity:e.opacity},t))}function hr(e,t){let n=e.fillGradient;if(!n||"object"!=typeof n)return null;let i=e.x,r=e.y,a=e.x,o=e.y+e.h;"bottom"===e.roundedEdge?(r=e.y+e.h,o=e.y):"right"===e.roundedEdge?(i=e.x+e.w,r=e.y,a=e.x,o=e.y):"left"===e.roundedEdge&&(i=e.x,r=e.y,a=e.x+e.w,o=e.y);let l=dr(n.stops,sr(e.style.fill));return l?/* @__PURE__ */Ls("linearGradient",{id:t,gradientUnits:"userSpaceOnUse",x1:i,y1:r,x2:a,y2:o,children:l}):null}function fr(e){let{x:t,y:n,w:i,h:r}=e,{tl:a,tr:o,br:l,bl:s}=Ar(e),c=`M${t+a},${n}`;return c+=` L${t+i-o},${n}`,o>0&&(c+=` A${o},${o} 0 0 1 ${t+i},${n+o}`),c+=` L${t+i},${n+r-l}`,l>0&&(c+=` A${l},${l} 0 0 1 ${t+i-l},${n+r}`),c+=` L${t+s},${n+r}`,s>0&&(c+=` A${s},${s} 0 0 1 ${t},${n+r-s}`),c+=` L${t},${n+a}`,a>0&&(c+=` A${a},${a} 0 0 1 ${t+a},${n}`),c+=" Z",c}function mr(e,t,n){let i=Sr(e.symbolType,e.size,e.path);/* @__PURE__ */
|
|
106
|
-
return Ls("path",{d:i,transform:e.rotation?`translate(${e.x},${e.y}) rotate(${180*e.rotation/Math.PI})`:`translate(${e.x},${e.y})`,fill:e.style.fill?sr(e.style.fill):"none",fillOpacity:e.style.fillOpacity,opacity:e.style.opacity,stroke:e.style.stroke,strokeWidth:e.style.strokeWidth},`${n??""}symbol-${t}`)}function pr(e,t,n){let i="point"===e.type,r=i?"circle":"rect",a=i?{cx:e.x,cy:e.y,r:e.r}:{x:e.x,y:e.y,width:e.w,height:e.h},o=`${n?n+"-":""}${i?"point":"xyrect"}-${t}-hatch`,l=Ir(e.style.fill)?zr(e.style.fill,o):void 0;/* @__PURE__ */
|
|
107
|
-
return Ns(js.Fragment,{children:[l&&/* @__PURE__ */Ls("defs",{children:l}),js.createElement(r,{...a,fill:l?`url(#${o})`:sr(e.style.fill),opacity:i?e.style.opacity??e.style.fillOpacity??.8:e.style.opacity,stroke:e.style.stroke,strokeWidth:e.style.strokeWidth})]},`${e.type}-${t}`)}import{l as yr,m as gr,n as br,o as xr,p as vr,r as wr,s as kr,t as Mr}from"./c-Y342FJ6K.min.js";import{E as Ar,a as Sr,d as Cr,f as $r,h as jr,l as Lr,n as Nr,r as Ir,t as zr,u as Fr,v as Tr}from"./c-3BYZXCX3.min.js";import{a as Rr,b as Or,c as Wr,d as Dr,e as Er}from"./c-JXVYIXTV.min.js";import{g as Br,h as Hr,i as Pr,j as Gr,k as Vr,m as _r,n as Yr,o as Ur,v as Xr}from"./c-5NYONM6V.min.js";import{a as qr,b as Kr,c as Zr}from"./c-U6NLVFN4.min.js";import{a as Jr}from"./c-3PFVJFBK.min.js";var Qr={fresh:1,aging:1.5,stale:3};import{jsx as ea,jsxs as ta}from"react/jsx-runtime";var na="var(--semiotic-bg, #ffffff)";import*as ia from"react";import*as ra from"react";import{jsx as aa}from"react/jsx-runtime";var oa={background:"var(--semiotic-tooltip-bg, rgba(0, 0, 0, 0.85))",color:"var(--semiotic-tooltip-text, white)",padding:"8px 12px",borderRadius:"var(--semiotic-tooltip-radius, 6px)",fontSize:"var(--semiotic-tooltip-font-size, 14px)",fontFamily:"var(--semiotic-font-family, inherit)",lineHeight:"1.5",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0, 0, 0, 0.15))",pointerEvents:"none",maxWidth:"300px",wordWrap:"break-word"};y(p);var la=["name","label","title"],sa=["type","kind","category","group","class","status","role","shape"],ca=["value","amount","total","count","weight","score"],ua=/* @__PURE__ */new Set(["x","y","z","x0","x1","y0","y1","r","cx","cy","radius","layer","row","rowindex","col","column","depth","index","order","sankeywidth","coincidentpoints","sourcelinks","targetlinks","parent","children","fx","fy","vx","vy"]);import{jsx as da,jsxs as ha}from"react/jsx-runtime";import*as fa from"react";import{jsx as ma,jsxs as pa}from"react/jsx-runtime";import{jsx as ya}from"react/jsx-runtime";var ga=class extends fa.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onError?.(e,t)}render(){if(this.state.error){let{fallback:e}=this.props,t=this.state.error;return"function"==typeof e?e(t):void 0!==e?e:/* @__PURE__ */ya(T,{componentName:"ChartErrorBoundary",message:t.message||"An unexpected error occurred while rendering this chart.",width:600,height:400})}return this.props.children}};import{createContext as ba,useContext as xa,useMemo as va}from"react";import{jsx as wa}from"react/jsx-runtime";var ka=ba(null);R.displayName="CategoryColorProvider";import{useId as Ma,useMemo as Aa,useCallback as Sa}from"react";import{useSyncExternalStore as Ca}from"react";var $a={positions:/* @__PURE__ */new Map},ja=/* @__PURE__ */new Set,La={positions:/* @__PURE__ */new Map};import{useMemo as Na}from"react";import{createContext as Ia,useContext as za,useEffect as Fa,useId as Ta,useLayoutEffect as Ra,useMemo as Oa,useRef as Wa,useState as Da,useCallback as Ea}from"react";import*as Ba from"react";var Ha={fontFamily:"var(--semiotic-legend-font-family, var(--semiotic-font-family, sans-serif))",fontWeight:"var(--semiotic-legend-font-weight, normal)"},Pa={fontSize:"var(--semiotic-legend-font-size, 12px)"},Ga=34,Va=70;import*as _a from"react";import{jsx as Ya,jsxs as Ua}from"react/jsx-runtime";import{jsx as Xa,jsxs as qa}from"react/jsx-runtime";var Ka=(e,t,n,i,r,a,o,l,s,c,u)=>{let{items:d}=e,h=[],f=0,m={legendGroup:e,customClickBehavior:t,customHoverBehavior:n,highlightedCategory:i,isolatedCategories:r,focusedGroupIndex:a,focusedItemIndex:o,groupIndex:l,onFocusedIndexChange:s,interactive:!(!t&&!n),useIsolateAria:"isolate"===c||void 0===c&&null!=r,metrics:u};return d.forEach((e,t)=>{h.push(Oe(m,e,t,`translate(0,${f})`,"ArrowUp","ArrowDown")),f+=u.rowHeight}),h},Za=(e,t,n,i,r,a,o,l,s,c,u,d)=>{let{items:h}=e,f=[],{swatchSize:m,labelGap:p,itemGap:y,rowHeight:g,align:b}=u,x={legendGroup:e,customClickBehavior:t,customHoverBehavior:n,highlightedCategory:i,isolatedCategories:r,focusedGroupIndex:a,focusedItemIndex:o,groupIndex:l,onFocusedIndexChange:s,interactive:!(!t&&!n),useIsolateAria:"isolate"===c||void 0===c&&null!=r,metrics:u},v=h.map(e=>m+p+7*e.label.length),w=[],k=0,M=0;v.forEach((e,t)=>{let n=0===M?e:M+y+e;d&&d>0&&M>0&&n>d?(w.push({start:k,end:t,width:M}),k=t,M=e):M=n}),h.length>0&&w.push({start:k,end:h.length,width:M}),w.forEach((e,t)=>{let n="center"===b?Math.max(0,((d??e.width)-e.width)/2):"end"===b?Math.max(0,(d??e.width)-e.width):0;for(let i=e.start;e.end>i;i++)f.push(Oe(x,h[i],i,`translate(${n},${t*g})`,"ArrowLeft","ArrowRight")),n+=v[i]+y});let A=w.reduce((e,t)=>Math.max(e,t.width),0),S=w.length;return{items:f,offset:A,totalRows:S,totalHeight:S*g}},Ja=({legendGroups:e,width:t,customClickBehavior:n,customHoverBehavior:i,highlightedCategory:r,isolatedCategories:a,focusedGroupIndex:o,focusedItemIndex:l,onFocusedIndexChange:s,legendInteraction:c,metrics:u})=>{let d=[],h=Ne(e.map(e=>({hasLabel:!!e.label,itemCount:e.items.length})),u.rowHeight);return e.forEach((e,f)=>{let m=h[f];d.push(
|
|
108
|
-
/* @__PURE__ */Xa("line",{stroke:"gray",x1:0,y1:m.lineY,x2:t,y2:m.lineY},"legend-top-line legend-symbol-"+f)),e.label&&null!=m.labelY&&d.push(
|
|
109
|
-
/* @__PURE__ */Xa("text",{y:m.labelY,className:"legend-group-label",fontSize:12,style:Pa,fill:"var(--semiotic-text, #333)",children:e.label},"legend-text-"+f)),d.push(
|
|
110
|
-
/* @__PURE__ */Xa("g",{className:"legend-item",transform:`translate(0,${m.itemsY})`,children:Ka(e,n,i,r,a,o,l,f,s,c,u)},"legend-group-"+f))}),d},Qa=({legendGroups:e,height:t,width:n,customClickBehavior:i,customHoverBehavior:r,highlightedCategory:a,isolatedCategories:o,focusedGroupIndex:l,focusedItemIndex:s,onFocusedIndexChange:c,legendInteraction:u,metrics:d})=>{let h=0,f=[];e.forEach((e,t)=>{let m=0;e.label&&(m+=16);let p=Za(e,i,r,a,o,l,s,t,c,u,d,d.maxWidth??n);m+=p.offset+5,f.push({label:e.label,...p,offset:m,totalRows:p.totalRows,totalHeight:p.totalHeight}),h+=m+12});let m=d.maxWidth??n,p=h>m?0:"center"===d.align?Math.max(0,(m-h)/2):"end"===d.align?Math.max(0,m-h):0,y=[];return f.forEach((n,i)=>{let r=e[i];r.label&&(y.push(
|
|
111
|
-
/* @__PURE__ */Xa("text",{transform:`translate(${p},0) rotate(90)`,textAnchor:"start",className:"legend-group-label",fontSize:12,style:Pa,fill:"var(--semiotic-text, #333)",children:r.label},"legend-text-"+i)),p+=16),y.push(
|
|
112
|
-
/* @__PURE__ */Xa("g",{className:"legend-item",transform:`translate(${p},0)`,children:n.items},"legend-group-"+i)),p+=n.offset+5,e[i+1]&&y.push(
|
|
113
|
-
/* @__PURE__ */Xa("line",{stroke:"gray",x1:p,y1:-8,x2:p,y2:(n.totalHeight||t)+0+8},"legend-top-line legend-symbol-"+i)),p+=12}),/* @__PURE__ */Xa("g",{children:y})};import{useRef as eo,useState as to,useEffect as no,useLayoutEffect as io}from"react";var ro=typeof window>"u"?no:io;import{jsx as ao,jsxs as oo}from"react/jsx-runtime";var lo=Ia(!1),so=Ia(!1),co=Ia(null),uo=typeof window>"u"?Fa:Ra,ho="__linked-legend-isolate__",fo="__linked-legend-highlight__",mo=Object.freeze([]),po=typeof window>"u"||typeof document>"u",yo={data:"data",domain:"domain",layout:"layout","scene-geometry":"sceneGeometry","scene-style":"sceneStyle","data-paint":"dataPaint","interaction-paint":"interactionPaint",overlay:"overlay",accessibility:"accessibility",evidence:"evidence"},go=class{constructor(){this.revisions={data:0,domain:0,layout:0,sceneGeometry:0,sceneStyle:0,dataPaint:0,interactionPaint:0,overlay:0,accessibility:0,evidence:0},this.latest=st({kind:"initialize"},[],this.revisions),this.listeners=/* @__PURE__ */new Set}get last(){return this.latest}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}record(e,t){let n=st(e,t,this.revisions);this.revisions=n.revisions,this.latest=n;for(let e of[...this.listeners])e();return n}};import{memo as bo,useEffect as xo,useRef as vo}from"react";var wo={sceneGeometry:0,layout:0,domain:0},ko="production"!==process.env.NODE_ENV,Mo={revisions:wo,signature:"",sawSignals:!1,wasUnconsumed:!1,warnUnconsumed:!1},Ao=class{constructor(e="scene host"){this.hostName=e,this.lastConsumed=wo,this.lastObserved=wo,this.lastDuplicateWarning="",this.lastUnconsumedWarning=""}observeUpdateResult(e){ko&&(this.lastObserved=dt(this.lastObserved,ct(e)))}beforeCompute(e,t){if(!ko)return Mo;let n=dt(ct(e),this.lastObserved),i=`${(a=n).sceneGeometry}|${a.layout}|${a.domain}`,r=!ut(n,this.lastConsumed);var a;return{revisions:n,signature:i,sawSignals:e.changed.has("scene-geometry")||e.changed.has("layout")||e.changed.has("domain"),wasUnconsumed:r,warnUnconsumed:!t&&r&&this.lastUnconsumedWarning!==i}}afterCompute(e,t,n){if(ko){if(t&&e.wasUnconsumed&&(this.lastConsumed=e.revisions),e.warnUnconsumed&&!t)return console.warn(`[semiotic] ${this.hostName} observed scene-affecting revisions without a scene rebuild: ${e.signature}.`),void(this.lastUnconsumedWarning=e.signature);t&&e.sawSignals&&!e.wasUnconsumed&&!n&&this.lastDuplicateWarning!==e.signature?(console.warn(`[semiotic] ${this.hostName} performed scene rebuild with unchanged scene revisions: ${e.signature}.`),this.lastDuplicateWarning=e.signature):t&&!e.sawSignals&&(this.lastDuplicateWarning="")}}},So=bo(function({store:e,diagnostics:t}){return xo(()=>{let n=()=>t.observeUpdateResult(e.getUpdateSnapshot());return n(),e.subscribeUpdateResult(n)},[t,e]),null});import{jsx as Co}from"react/jsx-runtime";import{jsx as $o}from"react/jsx-runtime";var jo={secondary:0,primary:3},Lo=".annotation-deferred{opacity:0;pointer-events:none;transition:opacity .12s ease}.stream-xy-frame:hover .annotation-deferred,.stream-ordinal-frame:hover .annotation-deferred,.stream-network-frame:hover .annotation-deferred,.stream-geo-frame:hover .annotation-deferred,.stream-xy-frame:focus-within .annotation-deferred,.stream-ordinal-frame:focus-within .annotation-deferred,.stream-network-frame:focus-within .annotation-deferred,.stream-geo-frame:focus-within .annotation-deferred{opacity:1;pointer-events:auto}@media (prefers-reduced-motion:reduce){.annotation-deferred{transition:none}}";import{jsx as No}from"react/jsx-runtime";import{jsx as Io,jsxs as zo}from"react/jsx-runtime";import*as Fo from"react";import{jsx as To,jsxs as Ro}from"react/jsx-runtime";import{packEnclose as Oo}from"d3-hierarchy";import{area as Wo,curveLinear as Do,curveMonotoneX as Eo,curveMonotoneY as Bo,curveStep as Ho,curveStepAfter as Po,curveStepBefore as Go,curveBasis as Vo,curveCardinal as _o,curveCatmullRom as Yo}from"d3-shape";var Uo=new Set(["top-left","top-center","top-right","middle-left","center","middle-right","bottom-left","bottom-center","bottom-right"]);import{jsx as Xo}from"react/jsx-runtime";var qo={fill:"var(--semiotic-text, #333)",fontSize:11,fontFamily:"inherit"};import{jsx as Ko,jsxs as Zo}from"react/jsx-runtime";var Jo={linear:Do,monotoneX:Eo,monotoneY:Bo,step:Ho,stepAfter:Po,stepBefore:Go,basis:Vo,cardinal:_o,catmullRom:Yo},Qo=new Set(["label","callout","callout-circle","callout-rect","text","widget"]),el=new Set(["label","callout","callout-circle","callout-rect"]),tl=32,nl=6,il=4,rl=8,al=72,ol={ai:"AI",agent:"agent",watcher:"watcher",system:"system",import:"imported",computed:"computed",user:"you"};import{jsx as ll}from"react/jsx-runtime";import*as sl from"react";import{jsx as cl}from"react/jsx-runtime";import{useEffect as ul,useLayoutEffect as dl,useRef as hl,useState as fl,useSyncExternalStore as ml}from"react";var pl="u">typeof window?dl:ul,yl=()=>()=>{},gl=()=>!1,bl=()=>!0;import*as xl from"react";import{jsx as vl}from"react/jsx-runtime";var wl=xl.createContext(null);import{jsx as kl}from"react/jsx-runtime";var Ml={position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0};import*as Al from"react";var Sl=e=>{if(null==e)return"";let t=Math.round(100*e)/100;return Number.isNaN(t)?"":t+""};import{jsx as Cl,jsxs as $l}from"react/jsx-runtime";var jl=Al.lazy(()=>import("./c-P3SKRNZN.min.js")),Ll=25,Nl="semiotic-accessible-data-table",Il=Nl+" semiotic-accessible-data-table-hidden",zl=Nl+" semiotic-accessible-data-table-visible",Fl=zl+" semiotic-accessible-data-table-network",Tl={boxSizing:"border-box",maxWidth:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},Rl={position:"absolute",top:0,left:0,right:0,zIndex:"var(--semiotic-data-table-z-index, var(--semiotic-overlay-z-index, 20))",padding:"14px 16px 12px",borderBottom:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))",fontFamily:"var(--semiotic-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif)",fontSize:13,lineHeight:1.5,color:"var(--semiotic-data-table-text, var(--semiotic-text, #333))",background:"var(--semiotic-data-table-bg, var(--semiotic-surface, var(--semiotic-bg, #fff)))",borderRadius:"var(--semiotic-border-radius, 0px) var(--semiotic-border-radius, 0px) 0 0"},Ol={marginBottom:8,paddingRight:28,color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))",fontSize:12,letterSpacing:"0.01em"},Wl={position:"absolute",top:10,right:10,width:22,height:22,display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))",background:"var(--semiotic-data-table-bg, var(--semiotic-surface, var(--semiotic-bg, #fff)))",cursor:"pointer",color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))",fontSize:13,lineHeight:1,padding:0,borderRadius:"var(--semiotic-border-radius, 4px)"},Dl={width:"100%",borderCollapse:"collapse",fontSize:12,marginTop:4,fontVariantNumeric:"tabular-nums"},El={textAlign:"left",padding:"5px 10px",borderBottom:"2px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))",fontWeight:600,fontSize:11,textTransform:"uppercase",letterSpacing:"0.04em",color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))"},Bl={padding:"4px 10px",borderBottom:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))"},Hl={textAlign:"left",fontSize:11,color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))",marginBottom:4,fontStyle:"italic"},Pl={marginTop:8,padding:"4px 10px",fontSize:12,cursor:"pointer",border:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))",borderRadius:"var(--semiotic-border-radius, 4px)",background:"var(--semiotic-data-table-bg, var(--semiotic-surface, var(--semiotic-bg, #fff)))",color:"var(--semiotic-data-table-text, var(--semiotic-text, #333))",fontFamily:"inherit"};import{jsx as Gl}from"react/jsx-runtime";var Vl="var(--semiotic-focus, #005fcc)";import*as _l from"react";import{jsx as Yl}from"react/jsx-runtime";import*as Ul from"react";import{useCallback as Xl,useEffect as ql,useLayoutEffect as Kl,useMemo as Zl,useRef as Jl}from"react";var Ql=()=>"u">typeof performance?performance.now():Date.now(),es=class{constructor(e={}){this.randomSource=Math.random,this.subscribers=/* @__PURE__ */new Set,this.now=()=>this.advance(),this.random=()=>this.randomSource(),this.clock=e.clock??Ql,this.lastWallTime=pi(this.clock,0),this.logicalTime=this.lastWallTime,this.pausedValue=!0===e.paused,this.visibleValue=!1!==e.visible,this.setRandomSource(e.random,e.seed)}get isActive(){return!this.pausedValue&&this.visibleValue}get paused(){return this.pausedValue}get seed(){return this.seedValue}get visible(){return this.visibleValue}configure(e){this.setClock(e.clock),this.setRandomSource(e.random,e.seed)}setPaused(e){this.pausedValue!==e&&(this.advance(),this.pausedValue=e,this.emit())}setVisible(e){this.visibleValue!==e&&(this.advance(),this.visibleValue=e,this.emit())}snapshot(){return{now:this.now(),paused:this.pausedValue,seed:this.seedValue,visible:this.visibleValue}}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}advance(){let e=pi(this.clock,this.lastWallTime),t=Math.max(0,e-this.lastWallTime);return this.lastWallTime=e,this.isActive&&(this.logicalTime+=t),this.logicalTime}emit(){for(let e of this.subscribers)e()}setClock(e){let t=e??Ql;t!==this.clock&&(this.advance(),this.clock=t,this.lastWallTime=pi(t,this.lastWallTime))}setRandomSource(e,t){let n="number"==typeof(i=t)&&Number.isFinite(i)?Math.trunc(i):void 0;var i;e===this.randomInput&&n===this.seedValue||(this.randomInput=e,this.seedValue=n,this.randomSource=e??(void 0===n?Math.random:mi(n)))}},ts=typeof window>"u"?ql:Kl,ns={requestAnimationFrame:e=>(typeof window>"u"?globalThis:window).requestAnimationFrame(e),cancelAnimationFrame:e=>(typeof window>"u"?globalThis:window).cancelAnimationFrame(e)};import{useEffect as is,useLayoutEffect as rs,useRef as as}from"react";import{jsx as os,jsxs as ls}from"react/jsx-runtime";var ss=typeof window>"u"?is:rs;import{jsx as cs}from"react/jsx-runtime";var us="u">typeof process&&"production"!==process.env?.NODE_ENV,ds={display:"flex",alignItems:"center",justifyContent:"center",color:"var(--semiotic-text-secondary, #666)",fontSize:13,fontFamily:"inherit",border:"1px dashed var(--semiotic-border, #ddd)",borderRadius:4,boxSizing:"border-box"},hs={background:"var(--semiotic-border, #e0e0e0)",borderRadius:2},fs=.5,ms={enabled:!0,tapToSelect:!0,tapToLockTooltip:!0,clearSelection:"backgroundTap",targetSize:44,snap:"nearestDatum",brushHandleSize:44,standardControls:!1,enabled:!1,tapToSelect:!1,tapToLockTooltip:!1},ps={primary:{width:600,height:400,showAxes:!0,showGrid:!1,enableHover:!0,showLegend:void 0,showLabels:void 0,marginDefaults:{top:50,bottom:60,left:70,right:40}},context:{width:400,height:250,showAxes:!1,showGrid:!1,enableHover:!1,showLegend:!1,showLabels:!1,marginDefaults:{top:10,bottom:10,left:10,right:10}},sparkline:{width:120,height:24,showAxes:!1,showGrid:!1,enableHover:!1,showLegend:!1,showLabels:!1,marginDefaults:{top:2,bottom:2,left:0,right:0}},mobile:{width:390,height:300,showAxes:!0,showGrid:!1,enableHover:!0,showLegend:!1,showLabels:!0,marginDefaults:{top:28,bottom:42,left:44,right:16}}},ys={top:10,bottom:10,left:10,right:10};import{useMemo as gs,useCallback as bs,useEffect as xs,useState as vs}from"react";import{useMemo as ws,useCallback as ks,useState as Ms,useId as As,useEffect as Ss,useRef as Cs}from"react";var $s=[];import*as js from"react";import{jsx as Ls,jsxs as Ns}from"react/jsx-runtime";var Is={innerRadius:0,outerRadius:0,startAngle:0,endAngle:0};export{mo as a,ot as b,ci as c,ui as d,di as e,hi as f,Qr as g,e as h,t as i,n as j,i as k,r as l,a as m,o as n,po as o,go as p,ht as q,ft as r,So as s,ce as t,ue as u,de as v,pe as w,xe as x,ke as y,Me as z,Ae as A,$e as B,Ie as C,mt as D,l as E,c as F,u as G,d as H,f as I,m as J,Lo as K,wt as L,Kt as M,Zt as N,Jt as O,en as P,an as Q,Cn as R,H as S,Y as T,$n as U,Is as V,sr as W,cr as X,ur as Y,dr as Z,hr as _,fr as $,mr as aa,pr as ba,jn as ca,Ln as da,Nn as ea,In as fa,zn as ga,Fn as ha,Tn as ia,Rn as ja,On as ka,Dn as la,En as ma,Bn as na,Hn as oa,Yn as pa,ei as qa,ti as ra,ni as sa,ii as ta,ri as ua,ai as va,oi as wa,li as xa,oa as ya,p as za,y as Aa,b as Ba,si as Ca,Ee as Da,mi as Ea,gi as Fa,bi as Ga,xi as Ha,vi as Ia,Mi as Ja,Ai as Ka,w as La,M as Ma,v as Na,C as Oa,$ as Pa,j as Qa,L as Ra,N as Sa,I as Ta,z as Ua,F as Va,Si as Wa,Ci as Xa,$i as Ya,ji as Za,T as _a,ga as $a,Li as ab,Ni as bb,Ii as cb,zi as db,R as eb,O as fb,Fi as gb,Ti as hb,fs as ib,Ri as jb,U as kb,X as lb,q as mb,J as nb,Q as ob,ie as pb,ae as qb,Oi as rb,Di as sb,se as tb,oe as ub,Be as vb,Ge as wb,Ve as xb,Ue as yb,Bi as zb,Hi as Ab,Vi as Bb,Ui as Cb,Xi as Db,Ji as Eb,Qi as Fb,er as Gb,tr as Hb,ir as Ib,rr as Jb,ar as Kb,or as Lb,lr as Mb,Xe as Nb,qe as Ob,Ke as Pb,Je as Qb,Qe as Rb,et as Sb,tt as Tb,nt as Ub,it as Vb,rt as Wb,at as Xb};
|
package/dist/c-HQ27AHMC.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e){let t=L(e=>e.theme.colors.selectionOpacity);return C(()=>{if(void 0!==e||void 0!==t)return{name:e?.name??"",...e,unselectedOpacity:e?.unselectedOpacity??t}},[e,t])}function t(t){let{data:r,rawData:o,colorBy:L,colorScheme:C,legendInteraction:S,legendPosition:M,selection:A,linkedHover:F,fallbackFields:B,unwrapData:D=!1,onObservation:I,chartType:P,chartId:w,showLegend:R,legend:O,legendLayout:T,frameLegend:x,userMargin:j,marginDefaults:N,onClick:_,hoverHighlight:K,mobileInteraction:V,mobileSemantics:Y,loading:E,loadingContent:G,emptyContent:J,width:W,height:q,hasTitle:z,axisChrome:Q}=t,U=void 0===o,X=k(()=>g(r),[r]),[Z,$]=H([]),ee=b(e=>{$(t=>t.length===e.length&&t.every((t,r)=>t===e[r])?t:e)},[]),te="string"==typeof L?L:void 0,re=k(()=>m(V,{width:W,mobileSemantics:Y}),[V,W,Y]),{activeSelectionHook:oe,hoverSelectionHook:ne,customHoverBehavior:ae,customClickBehavior:le,crosshairSourceId:ie}=s({selection:A,linkedHover:F,fallbackFields:B,unwrapData:D,onObservation:I,chartType:P,chartId:w,onClick:_,hoverHighlight:K,colorByField:te,mobileInteraction:re}),ue=c(F,ie),se=u(X,L,C),ce=k(()=>n(X,L),[X,L]),ge=k(()=>U&&Z.length>0?Z:ce,[U,Z,ce]),de=l(S,L,ge),he=k(()=>ne||(de.legendSelectionHook?de.legendSelectionHook:oe),[ne,de.legendSelectionHook,oe]),ye=e(A),me=i(),pe=y(),fe=k(()=>{if(se)return se;if(!L||0===ge.length)return;let e=Array.isArray(C)&&C.length>0||"string"==typeof C&&C.length>0?C:me&&me.length>0?me:p,t="__streamCat",r=ge.map(e=>({[t]:e})),o=v(r,t,e);return e=>(pe?f(pe,e):void 0)??(C&&"object"==typeof C&&!Array.isArray(C)?f(C,e):void 0)??o(e)??"#999"},[se,L,ge,C,me,pe]),{legend:ve,margin:Le,legendPosition:Ce,legendLayout:be,legendMarginReserved:ke}=a({data:X,colorBy:L,colorScale:fe,showLegend:R,legendPosition:M,userMargin:j,defaults:N,categories:ge,additionalLegend:O,chartWidth:W,chartHeight:q,legendLayout:T,frameLegend:x,hasTitle:z,axisChrome:Q}),He=k(()=>{let e={};return ve&&(e.legend=ve,e.legendPosition=Ce,ke&&(e.__legendMarginReservedFor=ve),be&&(e.legendLayout=be)),S&&"none"!==S&&(e.legendHoverBehavior=de.onLegendHover,e.legendClickBehavior=de.onLegendClick,e.legendHighlightedCategory=de.highlightedCategory,e.legendIsolatedCategories=de.isolatedCategories),U&&L&&(e.legendCategoryAccessor=L,e.onCategoriesChange=ee),e},[ve,Ce,be,ke,S,de.onLegendHover,de.onLegendClick,de.highlightedCategory,de.isolatedCategories,U,L,ee]),Se=Array.isArray(o)?g(o):o,Me=h(E,W,q,G),Ae=Me?null:d(Se,W,q,J);return{data:X,colorScale:se,categoryColorScale:fe,allCategories:ge,legendState:de,effectiveSelectionHook:he,activeSelectionHook:oe,customHoverBehavior:ae,customClickBehavior:le,mobileInteraction:re,legend:ve,margin:Le,legendPosition:Ce,earlyReturn:Me||Ae||null,legendBehaviorProps:He,crosshairProps:ue,resolvedSelection:ye}}function r(e,t){let{variant:r,frameRef:n,overrides:a}=t,l=M(a);l.current=a,S(e,()=>{let e=o(r,n);return new Proxy(e,{get(e,t,r){if("string"==typeof t){let e=l.current?.[t];if("function"==typeof e)return e}return Reflect.get(e,t,r)},has:(e,t)=>!("string"!=typeof t||!l.current||!(t in l.current))||Reflect.has(e,t)})},[])}function o(e,t){if("xy"===e){let e=t;return{push:t=>e.current?.push(t),pushMany:t=>e.current?.pushMany(t),remove:t=>e.current?.remove(t)??[],update:(t,r)=>e.current?.update(t,r)??[],replace:t=>e.current?.replace?.(t),clear:()=>e.current?.clear(),getData:()=>e.current?.getData()??[],getScales:()=>e.current?.getScales()??null,getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}if("network"===e){let e=t;return{push:t=>e.current?.push(t),pushMany:t=>e.current?.pushMany(t),remove:t=>{let r=Array.isArray(t)?t:[t],o=e.current?.getTopology()?.nodes??[],n=[];for(let t of r){let r=o.find(e=>e.id===t);r&&n.push({...r.data??{},id:t}),e.current?.removeNode(t)}return n},update:(t,r)=>(Array.isArray(t)?t:[t]).flatMap(t=>{let o=e.current?.updateNode(t,r);return o?[{...o,id:t}]:[]}),clear:()=>e.current?.clear(),getData:()=>e.current?.getTopology()?.nodes?.map(e=>e.data)??[],getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}if("geo-points"===e){let e=t;return{push:t=>e.current?.push(t),pushMany:t=>e.current?.pushMany(t),remove:t=>e.current?.removePoint(t)??[],update:(t,r)=>{let o=e.current?.removePoint(t)??[];for(let t of o)e.current?.push(r(t));return o},clear:()=>e.current?.clear(),getData:()=>e.current?.getData()??[],getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}let r=t;return{push:e=>r.current?.pushLine(e),pushMany:e=>r.current?.pushManyLines(e),remove:e=>r.current?.removeLine(e)??[],update:(e,t)=>{let o=r.current?.removeLine(e)??[];for(let e of o)r.current?.pushLine(t(e));return o},clear:()=>r.current?.clear(),getData:()=>r.current?.getLines()??[],getCustomLayout:()=>r.current?.getCustomLayout?.()??null,getLayoutFailure:()=>r.current?.getLayoutFailure?.()??null}}import{Ab as n,Bb as a,Cb as l,Eb as i,Ib as u,Kb as s,Lb as c,b as g,bb as d,cb as h,fb as y,rb as m}from"./c-G53AVC42.min.js";import{p,s as f,t as v}from"./c-Y342FJ6K.min.js";import{h as L}from"./c-5NYONM6V.min.js";import{useMemo as C}from"react";import{useCallback as b,useMemo as k,useState as H}from"react";import{useImperativeHandle as S,useRef as M}from"react";export{e as a,t as b,r as c};
|