@divami-artefacts/ai-design-system 1.0.42 → 1.0.44
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/dist/index.cjs +1 -1
- package/dist/index.js +100 -98
- package/dist/types/index.d.ts +5 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require(`react-dom/client`),t=require(`react`),n=require(`react/jsx-runtime`);function r({children:e,className:t=``}){return(0,n.jsx)(`div`,{className:`d3-chart ${t}`.trim(),children:e})}var i={bg:`#0C0E12`,bgL:`#0C1420`,sf:`#13161B`,bd:`#22262F`,blue:`#4C93D9`,cyan:`#36BFFA`,orange:`#EC772A`,red:`#EC772A`,green:`#5DA537`,purple:`#818FF8`,amber:`#EEBF3B`,t1:`#F7F9FA`,t2:`#B3B5B6`,t3:`#94979C`,t4:`#334155`},a=[i.blue,i.amber,i.purple,i.green,i.red],o={font:`400 16px 'Satoshi Variable', 'DM Sans', sans-serif`,color:`#F7F7F7`,letterSpacing:`0px`},s={font:`500 16px 'Satoshi Variable', 'DM Sans', sans-serif`,color:`#F7F7F7`},c={font:`400 18px 'Satoshi Variable', 'DM Sans', sans-serif`,color:`#B3B5B6`,letterSpacing:`0px`};function l(e,t=1){let n=e.replace(`#`,``);return`rgba(${parseInt(n.substring(0,2),16)},${parseInt(n.substring(2,4),16)},${parseInt(n.substring(4,6),16)},${t})`}function u(e,t,n){return e+(t-e)*n}function d(e,t,n){let r=e=>{let t=e.replace(`#`,``);return[parseInt(t.substring(0,2),16),parseInt(t.substring(2,4),16),parseInt(t.substring(4,6),16)]},[i,a,o]=r(e),[s,c,l]=r(t),d=e=>Math.max(0,Math.min(255,Math.round(e)));return[d(u(i,s,n)),d(u(a,c,n)),d(u(o,l,n))].map(e=>e.toString(16).padStart(2,`0`)).join(``).replace(/^/,`#`)}function f(e,t,n,r=2){e.width=t*r,e.height=n*r;let i=e.getContext(`2d`);return i.scale(r,r),i}function p(e,t,n,r,i,a=.3){let o=e.createRadialGradient(t,n,0,t,n,r);o.addColorStop(0,l(i,a)),o.addColorStop(1,l(i,0)),e.fillStyle=o,e.beginPath(),e.arc(t,n,r,0,Math.PI*2),e.fill()}function m(e,t,n,r,a=50,o=l(i.blue,.05)){for(let i=0;i<a;i++)e.beginPath(),e.arc((Math.sin(r*.001+i*23)*.5+.5)*t,(Math.cos(r*8e-4+i*37)*.5+.5)*n,.6,0,Math.PI*2),e.fillStyle=o,e.fill()}function h(e,t,n,r,i=.015){e.fillStyle=`rgba(0,0,0,${i})`;let a=r*.5%6;for(let r=a;r<n;r+=3)e.fillRect(0,r,t,1)}function g(e,t,n,r,a=l(i.t1,.08)){e.strokeStyle=a,e.lineWidth=1,e.setLineDash([3,3]),e.beginPath(),e.moveTo(t,n),e.lineTo(t,r),e.stroke(),e.setLineDash([])}function _({visible:e,x:r,y:a,content:o,parentW:s,parentH:c}){let l=(0,t.useRef)(null);if((0,t.useLayoutEffect)(()=>{let t=l.current;if(!t)return;let n=t.offsetWidth,u=t.offsetHeight,d=s??400,f=c??800,p=r+14,m=a-u-14;p+n>d-4&&(p=r-n-14),m<4&&(m=a+14),p<4&&(p=4),m+u>f-4&&(m=f-u-4),t.style.transform=`translate(${p}px, ${m}px)`,t.style.opacity=e?`1`:`0`;let h=o&&typeof o==`object`&&o.color?o.color:i.blue;t.style.setProperty(`--tooltip-accent`,h??i.blue)},[e,r,a,s,o]),!o)return null;let u=typeof o==`object`,d=u?o.label:null,f=u?o.value:o,p=u?o.sublabel:null;return(0,n.jsxs)(`div`,{ref:l,style:{position:`absolute`,top:0,left:0,minWidth:80,pointerEvents:`none`,background:i.sf,border:`1px solid ${i.bd}`,borderLeft:`2px solid var(--tooltip-accent)`,borderRadius:6,padding:`8px 12px`,opacity:0,transition:`opacity 0.15s ease`,zIndex:20,fontFamily:`'Satoshi Variable', 'DM Sans', sans-serif`},children:[d&&(0,n.jsx)(`div`,{style:{fontSize:14,fontWeight:400,color:i.t2,marginBottom:3,whiteSpace:`nowrap`,lineHeight:`20px`},children:d}),f&&(0,n.jsx)(`div`,{style:{fontSize:16,fontWeight:500,color:i.t1,whiteSpace:`nowrap`,lineHeight:`22px`},children:f}),p&&(0,n.jsx)(`div`,{style:{fontSize:14,fontWeight:400,color:`var(--tooltip-accent)`,marginTop:3,whiteSpace:`nowrap`,lineHeight:`20px`},children:p})]})}function v(e,{width:n,height:r,onClick:i,enabled:a=!0}){let o=(0,t.useRef)({x:-1,y:-1,over:!1}),s=(0,t.useRef)(null),c=(0,t.useRef)([]),[l,u]=(0,t.useState)({visible:!1,x:0,y:0,content:null}),d=(0,t.useCallback)((e,t,n)=>{u({visible:!0,x:e,y:t,content:n})},[]),f=(0,t.useCallback)(()=>{u(e=>e.visible?{visible:!1,x:e.x,y:e.y,content:e.content}:e)},[]);return(0,t.useEffect)(()=>{let t=e.current;if(!t||!a)return;let l=e=>{let i=t.getBoundingClientRect(),a=n/i.width,l=r/i.height;o.current.x=(e.clientX-i.left)*a,o.current.y=(e.clientY-i.top)*l,o.current.over=!0;let u=null,p=c.current;for(let e=p.length-1;e>=0;e--)if(p[e].test(o.current.x,o.current.y)){u=p[e];break}let m=s.current;s.current=u?u.id:null,t.style.cursor=u?`pointer`:`default`,u?d((e.clientX-i.left)*a,(e.clientY-i.top)*l,u.data):m&&f()},u=()=>{o.current={x:-1,y:-1,over:!1},s.current&&(s.current=null,t.style.cursor=`default`,f())},p=()=>{if(s.current&&i){let e=c.current.find(e=>e.id===s.current);e&&i(e.id,e.data)}};return t.addEventListener(`mousemove`,l),t.addEventListener(`mouseleave`,u),t.addEventListener(`click`,p),()=>{t.removeEventListener(`mousemove`,l),t.removeEventListener(`mouseleave`,u),t.removeEventListener(`click`,p)}},[e,n,r,a,i,d,f]),{mouseRef:o,hoveredRef:s,tooltip:l,showTooltip:d,hideTooltip:f,hitZonesRef:c}}function y(e,t,n,r,i,a){e.push({id:t,data:a,test:(e,t)=>(e-n)**2+(t-r)**2<=i*i})}function b(e,t,n,r,i,a,o){e.push({id:t,data:o,test:(e,t)=>e>=n&&e<=n+i&&t>=r&&t<=r+a})}var x=e=>1-(1-e)**3,S=e=>1-(1-e)**4,C=e=>e===1?1:1-2**(-10*e),w=e=>{let t=1.70158;return 1+(t+1)*(e-1)**3+t*(e-1)**2},T=(e,t=.04,n=.001)=>Math.sin(e*t)*Math.exp(-Math.min(e*n,4)),E=(e,t,n,r=x)=>{let i=Math.min(.06,.5/n),a=t*i,o=1-(n-1)*i;return r(Math.max(0,Math.min((e-a)/o,1)))};function D(e,t,n=.12){e.forEach((r,i)=>{let a=i===t?1:0,o=r+(a-r)*n;Math.abs(o-a)<.005?a===0?e.delete(i):e.set(i,1):e.set(i,o)}),t&&!e.has(t)&&e.set(t,0)}var O=760,k=250;function A({rows:e=[],variant:a,className:o,colors:s}){let c=(0,t.useRef)(null),u=(0,t.useRef)(new Map),d=(0,t.useRef)(0),{mouseRef:m,hoveredRef:h,tooltip:b,hitZonesRef:x}=v(c,{width:O,height:k});return(0,t.useEffect)(()=>{let t=c.current;if(!t)return;let n=f(t,O,k);d.current=0;let r=s?.line??i.blue,o=s?.point??i.blue,_=s?.axisLine??i.bd,v=s?.areaFill??i.blue,b={top:24,right:24,bottom:44,left:24},S=O-b.left-b.right,w=k-b.top-b.bottom,E,A=()=>{d.current++;let t=d.current;if(n.clearRect(0,0,O,k),e.length<2){E=requestAnimationFrame(A);return}let s=e.map(e=>e.pricing??0),c=Math.max(100,...s),f=t=>b.left+t/(e.length-1)*S,j=e=>b.top+(1-e/c)*w,M=C(Math.min(t/48,1)),N=Math.max(2,Math.floor(M*e.length));D(u.current,h.current),x.current=[],n.strokeStyle=l(i.bd,.2),n.lineWidth=.5;for(let e=0;e<=4;e++){let t=b.top+e/4*w;n.beginPath(),n.moveTo(b.left,t),n.lineTo(b.left+S,t),n.stroke()}if(n.strokeStyle=l(_,.4),n.lineWidth=1,n.setLineDash([]),n.beginPath(),n.moveTo(b.left,j(0)),n.lineTo(b.left+S,j(0)),n.stroke(),m.current.over&&h.current){let e=parseInt(h.current.split(`-`)[1]);isNaN(e)||g(n,f(e),b.top,b.top+w)}if(a===`area`&&N>1){let t=n.createLinearGradient(0,b.top,0,b.top+w);t.addColorStop(0,l(v,.12)),t.addColorStop(1,l(v,0)),n.fillStyle=t,n.beginPath(),n.moveTo(f(0),b.top+w);for(let t=0;t<N;t++)n.lineTo(f(t),j(e[t].pricing??0));n.lineTo(f(N-1),b.top+w),n.closePath(),n.fill()}if(N>1){n.strokeStyle=l(r,.85),n.lineWidth=2,n.setLineDash([]),n.beginPath();for(let t=0;t<N;t++){let r=f(t),i=j(e[t].pricing??0);t===0?n.moveTo(r,i):n.lineTo(r,i)}n.stroke()}for(let r=0;r<N;r++){let s=f(r),c=j(e[r].pricing??0),d=`sc-${r}`,m=u.current.get(d)??0,h=r===e.length-1;y(x.current,d,s,c,12,{label:e[r].vendor,value:String(e[r].pricing??0),color:h?i.red:o}),m>0&&p(n,s,c,16*m,o,.2*m);let g=h?T(t,.05,5e-4):0,_=a===`area`?5:6;h?(n.shadowColor=l(i.red,.5),n.shadowBlur=(8+g*4)*(1+m*.5),n.fillStyle=i.red,n.beginPath(),n.arc(s,c,(_+g*1.5)*(1+m*.3),0,Math.PI*2),n.fill(),n.shadowBlur=0):(n.fillStyle=l(o,.7+m*.3),n.beginPath(),n.arc(s,c,_+m*2,0,Math.PI*2),n.fill()),n.font=`10px 'JetBrains Mono', monospace`,n.fillStyle=l(i.t3,.6+m*.3),n.textAlign=`center`,n.fillText(e[r].vendor,s,k-14)}E=requestAnimationFrame(A)};return A(),()=>cancelAnimationFrame(E)},[e,a,s]),(0,n.jsx)(r,{className:o,children:(0,n.jsxs)(`div`,{style:{position:`relative`,width:O,height:k},children:[(0,n.jsx)(`canvas`,{ref:c,role:`img`,"aria-label":`${a} chart`,style:{width:O,height:k,display:`block`,borderRadius:8}}),(0,n.jsx)(_,{...b,parentW:O,parentH:k})]})})}function j({rows:e=[],className:t,colors:r}){return(0,n.jsx)(A,{rows:e,variant:`area`,className:t,colors:r})}var M=760,N=280;function P({rows:e=[],className:o,colors:s}){let c=(0,t.useRef)(null),u=(0,t.useRef)(new Map),d=(0,t.useRef)(0),{hoveredRef:m,tooltip:h,hitZonesRef:g}=v(c,{width:M,height:N});return(0,t.useEffect)(()=>{let t=c.current;if(!t)return;let n=f(t,M,N);d.current=0;let r=s?.bars??a,o=s?.axisLine??i.bd,h=s?.valueLabel??i.t2,_={top:24,right:24,bottom:56,left:24},v=N-_.top-_.bottom,y=(M-_.left-_.right)/Math.max(e.length,1),x=Math.max(100,...e.map(e=>e.pricing??0)),C=_.top+v,w,T=()=>{d.current++;let t=d.current;n.clearRect(0,0,M,N);let a=S(Math.min(t/48,1));D(u.current,m.current),g.current=[],n.strokeStyle=l(o,.4),n.lineWidth=1,n.setLineDash([]),n.beginPath(),n.moveTo(_.left,C),n.lineTo(M-_.right,C),n.stroke(),e.forEach((t,o)=>{let s=_.left+o*y,c=E(a,o,e.length,S),d=x>0?(t.pricing??0)/x*v:0,f=Math.max(d>0?4:0,d*c),m=r[o%r.length],w=u.current.get(t.id??`bar-${o}`)??0;b(g.current,t.id??`bar-${o}`,s+4,C-f,y-8,f,{label:t.vendor,value:String(t.pricing??0),color:m}),f>0&&(w>0&&p(n,s+y/2,C-f/2,y*.8,m,.12*w),n.shadowColor=l(m,.2*(w>0?w:0)),n.shadowBlur=w>0?6:0,n.fillStyle=l(m,.5+w*.25),n.beginPath(),n.roundRect(s+4,C-f,y-8,f,[4,4,0,0]),n.fill(),n.shadowBlur=0,w>0&&(n.strokeStyle=l(m,.4*w),n.lineWidth=1,n.beginPath(),n.roundRect(s+4,C-f,y-8,f,[4,4,0,0]),n.stroke())),c>.5&&f>0&&(n.globalAlpha=Math.min(1,(c-.5)*2),n.font=`bold 10px 'JetBrains Mono', monospace`,n.fillStyle=w>0?m:l(h,.7),n.textAlign=`center`,n.fillText(String(t.pricing??``),s+y/2,C-f-6),n.globalAlpha=1),n.font=`${w>0?`bold `:``}9px 'JetBrains Mono', monospace`,n.fillStyle=w>0?m:l(i.t3,.6),n.textAlign=`center`,n.fillText(t.vendor,s+y/2,N-14)}),w=requestAnimationFrame(T)};return T(),()=>cancelAnimationFrame(w)},[e,s]),(0,n.jsx)(r,{className:o,children:(0,n.jsxs)(`div`,{style:{position:`relative`,width:M,height:N},children:[(0,n.jsx)(`canvas`,{ref:c,role:`img`,"aria-label":`bar chart`,style:{width:M,height:N,display:`block`,borderRadius:8}}),(0,n.jsx)(_,{...h,parentW:M,parentH:N})]})})}function F({width:e,height:t,message:r=`No data available`,"data-testid":i}){return(0,n.jsx)(`div`,{"data-testid":i,style:{width:e,height:t,display:`flex`,alignItems:`center`,justifyContent:`center`,borderRadius:8,background:`rgba(255,255,255,0.03)`,color:`rgba(255,255,255,0.35)`,fontSize:14,fontFamily:`'Satoshi Variable', 'DM Sans', sans-serif`},children:r})}function I({expanded:e,onToggle:t,labelExpanded:r=`View Less`,labelCollapsed:i=`View More`,"data-testid":a}){return(0,n.jsxs)(`button`,{type:`button`,"data-testid":a,onClick:t,style:{display:`flex`,width:90,height:20,justifyContent:`center`,alignItems:`center`,gap:4,boxSizing:`border-box`,border:`none`,borderRadius:6,color:`#71B941`,fontSize:14,fontFamily:`'Satoshi Variable', 'DM Sans', sans-serif`,fontStyle:`normal`,fontWeight:400,lineHeight:`19.5px`,textAlign:`center`,cursor:`pointer`,userSelect:`none`},children:[e?r:i,(0,n.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 10 10`,fill:`none`,style:{transform:e?`rotate(180deg)`:`rotate(0deg)`},children:(0,n.jsx)(`path`,{d:`M2 3.5L5 6.5L8 3.5`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})})]})}var L=660,R=42,ee=10,te=24,ne=24,re=8,ie=[i.green,i.blue,i.amber,i.red];function ae(e,t,n){if(e.measureText(t).width<=n)return t;let r=t;for(;r.length>0&&e.measureText(r+`…`).width>n;)r=r.slice(0,-1);return r+`…`}function oe({items:e=[],"data-testid":r}){let a=(0,t.useRef)(null),c=(0,t.useRef)(0),u=(0,t.useRef)(new Map),[d,g]=(0,t.useState)(!1),S=(0,t.useMemo)(()=>e.filter(e=>typeof e==`object`&&!!e),[e]),C=(0,t.useMemo)(()=>[...S].sort((e,t)=>(t.percentage??0)-(e.percentage??0)),[S]),w=(0,t.useMemo)(()=>d?C:C.slice(0,re),[C,d]),T=w.length,E=te+ne+T*R+Math.max(0,T-1)*ee,{hoveredRef:D,tooltip:O,hitZonesRef:k}=v(a,{width:L,height:E});return(0,t.useEffect)(()=>{let e=a.current;if(!e)return;let t=f(e,L,E);c.current=0;let n=L*.08,r=L-150-n,d,g=()=>{c.current++;let e=c.current;t.clearRect(0,0,L,E),t.letterSpacing=o.letterSpacing,k.current=[],u.current.forEach((e,t)=>{let n=t===D.current?1:0,r=e+(n-e)*.12;Math.abs(r-n)<.005?n===0?u.current.delete(t):u.current.set(t,1):u.current.set(t,r)}),D.current&&!u.current.has(D.current)&&u.current.set(D.current,0),m(t,L,E,e,40,l(i.blue,.04)),w.forEach((n,i)=>{let a=ie[i%ie.length],c=u.current.get(n.id)??0,d=te+i*(R+ee);t.fillStyle=l(a,.04+c*.04),t.beginPath(),t.roundRect(150,d,r,R,3),t.fill(),t.strokeStyle=l(a,.08),t.lineWidth=1,t.setLineDash([4,4]),t.beginPath(),t.moveTo(150,d+R/2),t.lineTo(150+r,d+R/2),t.stroke(),t.setLineDash([]);let f=(n.percentage??0)/100,m=150+r*Math.min(f,f*x(Math.min(1,e*.005)));if(m>154){let e=t.createLinearGradient(150,0,m,0);e.addColorStop(0,l(a,.02)),e.addColorStop(1,l(a,.25+c*.15)),t.fillStyle=e,t.beginPath(),t.roundRect(150,d+2,m-150,R-4,2),t.fill()}p(t,m,d+R/2,18+c*8,a,.3+c*.2),t.beginPath(),t.arc(m,d+R/2,5+c*2,0,Math.PI*2),t.fillStyle=l(a,.9),t.fill();let h={label:n.name,value:`${n.percentage??0}%`,sublabel:n.totalLabel,color:a};b(k.current,n.id,0,d,150+r,R,h),y(k.current,n.id,m,d+R/2,14,h),t.font=s.font,t.fillStyle=l(a,.9+c*.1),t.textAlign=`left`,t.textBaseline=`middle`,t.fillText(`${n.percentage??0}%`,m+10,d+R/2),t.font=`${c>0?`bold `:``}`+o.font,t.fillStyle=c>0?a:o.color,t.textAlign=`right`,t.fillText(ae(t,n.abbreviation??n.name??``,134),142,d+R/2)}),t.strokeStyle=l(i.t3,.3),t.lineWidth=1,t.setLineDash([]),t.beginPath(),t.moveTo(150+r,te),t.lineTo(150+r,te+(T-1)*(R+ee)+R),t.stroke(),h(t,L,E,e,.015),d=requestAnimationFrame(g)};return g(),()=>cancelAnimationFrame(d)},[w,E]),C.length===0?(0,n.jsx)(F,{width:L,height:160,"data-testid":r}):(0,n.jsxs)(`div`,{"data-testid":r,style:{width:L},children:[(0,n.jsxs)(`div`,{style:{position:`relative`},children:[(0,n.jsx)(`canvas`,{ref:a,role:`img`,"aria-label":`Commitment race — contractors ranked by commitment percentage`,style:{width:L,height:E,display:`block`,borderRadius:8}}),(0,n.jsx)(_,{...O,parentW:L,parentH:E})]}),S.length>re&&(0,n.jsx)(`div`,{style:{marginTop:8},children:(0,n.jsx)(I,{expanded:d,onToggle:()=>g(e=>!e)})})]})}var se=480,ce=222;function le({confirmed:e,total:r,label:a,"data-testid":s}){let u=(0,t.useRef)(null),d=(0,t.useRef)(0);return(0,t.useEffect)(()=>{let t=u.current;if(!t)return;let n=f(t,se,ce);d.current=0;let s=se/2,m=Math.PI,h=2*Math.PI,g=Math.PI,_,v=()=>{d.current++;let t=d.current;n.clearRect(0,0,se,ce),n.letterSpacing=o.letterSpacing;let u=x(Math.min(t/80,1)),f=w(Math.min(t/72,1));n.beginPath(),n.arc(s,155,120,m,h),n.strokeStyle=l(i.bd,.35),n.lineWidth=46,n.stroke(),[{start:0,end:.33,color:i.red},{start:.33,end:.66,color:i.amber},{start:.66,end:1,color:i.green}].forEach(e=>{let t=m+e.start*g,r=m+e.end*g;n.beginPath(),n.arc(s,155,194/2,t,r),n.strokeStyle=l(e.color,.12),n.lineWidth=42,n.stroke()});let y=Math.round((e??0)/(r||1)*100),b=m+y/100*g*u,S=y>=66?i.green:y>=33?i.amber:i.red;p(n,s+Math.cos(b)*194/2,155+Math.sin(b)*194/2,18,S,.35*u),n.beginPath(),n.arc(s,155,194/2,m,b),n.strokeStyle=l(S,.7*u),n.lineWidth=38,n.lineCap=`round`,n.stroke(),n.lineCap=`butt`;let C=m+y/100*g*f,T=s+Math.cos(C)*82,E=155+Math.sin(C)*82,D=s-Math.cos(C)*14,O=155-Math.sin(C)*14;n.strokeStyle=l(S,.18*f),n.lineWidth=6,n.lineCap=`round`,n.beginPath(),n.moveTo(D,O),n.lineTo(T,E),n.stroke(),n.strokeStyle=l(i.t1,.92*f),n.lineWidth=2,n.lineCap=`round`,n.beginPath(),n.moveTo(D,O),n.lineTo(T,E),n.stroke(),n.beginPath(),n.arc(T,E,3,0,Math.PI*2),n.fillStyle=l(S,.9*f),n.fill(),p(n,s,155,20,S,.25*f),n.beginPath(),n.arc(s,155,9,0,Math.PI*2),n.strokeStyle=l(S,.5*f),n.lineWidth=1.5,n.stroke(),n.beginPath(),n.arc(s,155,5,0,Math.PI*2),n.fillStyle=i.t1,n.fill(),u>.5&&(n.globalAlpha=Math.min(1,(u-.5)/.5),n.font=`500 24px 'Satoshi Variable', 'DM Sans', sans-serif`,n.fillStyle=S,n.textAlign=`center`,n.fillText(`${Math.round(y*f)}%`,s,117),n.globalAlpha=1),u>.7&&a&&(n.globalAlpha=Math.min(1,(u-.7)/.3),n.font=c.font,n.fillStyle=c.color,n.textAlign=`center`,n.fillText(`${e??0} of ${r??0} ${a}`,s,213),n.globalAlpha=1);for(let e=0;e<=10;e++){let t=m+e/10*g;if(n.strokeStyle=l(i.bd,.5),n.lineWidth=e%5==0?1.5:.8,n.beginPath(),n.moveTo(s+Math.cos(t)*122,155+Math.sin(t)*122),n.lineTo(s+Math.cos(t)*128,155+Math.sin(t)*128),n.stroke(),e%5==0){let r=s+Math.cos(t)*138,i=155+Math.sin(t)*138;n.font=o.font,n.fillStyle=o.color,n.textAlign=`center`,n.fillText(`${e*10}%`,r,i+3)}}_=requestAnimationFrame(v)};return v(),()=>cancelAnimationFrame(_)},[e,r,a]),(0,n.jsx)(`div`,{"data-testid":s,style:{position:`relative`,width:se,height:ce},children:(0,n.jsx)(`canvas`,{ref:u,role:`img`,"aria-label":`Compensation event gauge — ${Math.round((e??0)/(r||1)*100)}% of NCEs confirmed as compensation events`,style:{width:se,height:ce,display:`block`}})})}function ue(e,n,r,i,a=!0,o={}){let s=(0,t.useRef)(0),{easing:c=x,durationFrames:l=48}=o;(0,t.useEffect)(()=>{let t=e.current;if(!t||!n||!r)return;let o=t.getContext(`2d`);if(!o)return;t.width=n*2,t.height=r*2,o.scale(2,2);let u;s.current=0;let d=()=>{s.current++;let e=s.current;o.clearRect(0,0,n,r);let t=a?Math.min(e/l,1):1;if(i(o,c(t),e),t<1)u=requestAnimationFrame(d);else{let e=()=>{s.current++,o.clearRect(0,0,n,r),i(o,1,s.current),u=requestAnimationFrame(e)};u=requestAnimationFrame(e)}};return d(),()=>cancelAnimationFrame(u)},[n,r,a])}var z=780,B=234,de=130,fe=52,pe=[i.blue,i.amber,i.purple,i.green],me=[`Base Value`,`Variations`,`Commitment`],he=[`Base`,`Var`,`Commit`];function ge({items:e=[],"data-testid":r}){let a=(0,t.useRef)(null),s=(0,t.useRef)(new Map),{hoveredRef:u,tooltip:d,hitZonesRef:f}=v(a,{width:z,height:B}),g=(0,t.useMemo)(()=>e.filter(e=>typeof e==`object`&&!!e),[e]),b=(0,t.useMemo)(()=>{let e=Math.max(...g.map(e=>e.base??0)),t=Math.max(...g.map(e=>e.variation??0));return g.map((n,r)=>{let i=z*(.12+r*.19),a=de,o=Math.min(z*.075,fe),s=pe[r%pe.length],c=[(n.base??0)/(e||1)*100,(n.variation??0)/(t||1)*100,n.percentage??0],l=[n.baseLabel??String(n.base??0),n.variationLabel??String(n.variation??0),`${n.percentage??0}%`],u=c.map((e,t)=>{let n=-Math.PI/2+t/me.length*Math.PI*2,r=e/100,s=o*Math.max(.08,r);return{name:me[t],short:he[t],label:l[t],val:Math.round(e),x:i+Math.cos(n)*s,y:a+Math.sin(n)*s,angle:n,norm:r}}),d=u.reduce((e,t)=>e+t.x,0)/u.length,f=u.reduce((e,t)=>e+t.y,0)/u.length,p=Math.sqrt(u.reduce((e,t)=>e+(t.x-d)**2+(t.y-f)**2,0)/u.length);return{...n,cx:i,cy:a,baseR:o,stars:u,scatter:p,color:s}})},[g]);return ue(a,z,B,(e,t,n)=>{D(s.current,u.current),f.current=[],m(e,z,B,n,30),b.forEach((t,r)=>{let a=t.color,c=`constellation-${r}`,u=s.current.get(c)??0;e.beginPath(),e.arc(t.cx,t.cy,t.baseR+5,0,Math.PI*2),e.strokeStyle=l(i.bd,.08+.08*u),e.lineWidth=.5,e.stroke(),e.beginPath(),t.stars.forEach((t,n)=>{n===0?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y)}),e.closePath(),e.fillStyle=l(a,.04+.03*u),e.fill(),e.strokeStyle=l(a,.15+.1*u),e.lineWidth=.8,e.stroke(),t.stars.forEach((i,c)=>{let u=T(n,.05,5e-4)*.3+.7,d=3.5*u,p=`star-${r}-${c}`,m=s.current.get(p)??0,h=e.createRadialGradient(i.x,i.y,0,i.x,i.y,d*4);h.addColorStop(0,l(a,(.2+.1*m)*u)),h.addColorStop(1,l(a,0)),e.fillStyle=h,e.beginPath(),e.arc(i.x,i.y,d*4,0,Math.PI*2),e.fill(),e.beginPath(),e.arc(i.x,i.y,d+m*2,0,Math.PI*2),e.fillStyle=l(a,(.8+.2*m)*u),e.fill();let g=Math.sin(i.angle)<-.3;e.textAlign=`center`,e.textBaseline=`middle`,g?(e.font=o.font,e.fillStyle=l(a,.5+.15*m),e.fillText(i.short,i.x,i.y-24),e.font=o.font,e.fillStyle=l(a,.8+.15*m),e.fillText(i.label,i.x,i.y-11)):(e.font=o.font,e.fillStyle=l(a,.5+.15*m),e.fillText(i.short,i.x,i.y+11),e.font=o.font,e.fillStyle=l(a,.8+.15*m),e.fillText(i.label,i.x,i.y+24)),y(f.current,p,i.x,i.y,d*4+2,{label:i.name,value:i.label,sublabel:t.abbreviation??t.name.slice(0,6),color:a})}),u>0&&p(e,t.cx,t.cy,16*u,a,.15*u),e.beginPath(),e.arc(t.cx,t.cy,t.baseR+12,0,Math.PI*2),e.strokeStyle=l(a,.1+T(n,.03,5e-4)*.05),e.lineWidth=1,e.stroke(),e.font=o.font,e.textAlign=`center`,e.textBaseline=`alphabetic`,e.fillStyle=u>0?t.color:o.color,e.fillText(t.abbreviation??t.name.slice(0,6),t.cx,t.cy+t.baseR+26),y(f.current,c,t.cx,t.cy,t.baseR+5,{label:t.name,value:`${t.totalLabel??String(t.total??0)} total`,sublabel:`${t.percentage??0}% committed · scatter ${t.scatter.toFixed(1)}`,color:a})}),e.font=c.font,e.textAlign=`center`,e.textBaseline=`middle`,e.fillStyle=c.color,e.fillText(`▲ top = Base value · ▼▸ lower-right = Variations · ◂▼ lower-left = Commitment % · hover stars for details`,z/2,B-14),h(e,z,B,n,.012)},!0),b.length===0?(0,n.jsx)(F,{width:z,height:B,"data-testid":r}):(0,n.jsxs)(`div`,{"data-testid":r,style:{position:`relative`,width:z,height:B},children:[(0,n.jsx)(`canvas`,{ref:a,role:`img`,"aria-label":`Contract value breakdown per contractor — multi-KPI constellation chart`,style:{width:z,height:B,display:`block`}}),(0,n.jsx)(_,{...d,parentW:z,parentH:B})]})}var _e=680,ve=220,ye=8,be=[i.blue,i.amber,i.purple,i.green],V={left:8,right:80,top:16,bottom:38},xe=150,H=18;function Se(e,t,n){if(e.measureText(t).width<=n)return t;let r=t;for(;r.length>0&&e.measureText(r+`…`).width>n;)r=r.slice(0,-1);return r+`…`}function Ce(e){let t=Math.abs(e),n=e<0?`-`:``;return t>=1e6?`${n}£${(t/1e6).toFixed(1)}M`:t>=1e3?`${n}£${(t/1e3).toFixed(1)}K`:`${n}£${t.toFixed(0)}`}function we({data:e,"data-testid":r}){let a=(0,t.useRef)(null),u=(0,t.useRef)(new Map),[d,f]=(0,t.useState)(!1),{items:m=[],totals:h}=e,g=m.filter(e=>typeof e==`object`&&!!e),y=[...g].sort((e,t)=>(t.total??0)-(e.total??0)),x=d?y:y.slice(0,ye),C=x.length,w=Math.max(...y.map(e=>Math.abs(e.total??0)),1),T=C*H+Math.max(0,C-1)*8,O=V.top+V.bottom+T,k=_e-V.left-xe-V.right,A=g.length===0,{hoveredRef:j,tooltip:M,hitZonesRef:N}=v(a,{width:_e,height:O});return ue(a,_e,O,(e,t)=>{D(u.current,j.current),N.current=[],x.forEach((n,r)=>{let a=be[r%be.length],c=E(t,r,C,S),d=V.top+r*(H+8),f=V.left+xe,m=u.current.get(n.id)??0,h=Math.max(n.base??0,0),g=Math.max(n.total??0,0),_=h/w*k*c,v=g/w*k*c,y=v-_;e.font=o.font,e.fillStyle=m>0?a:o.color,e.textAlign=`right`,e.textBaseline=`middle`,e.fillText(Se(e,n.name??``,xe-16),f-8,d+H/2),b(N.current,n.id,0,d,f,H,{label:n.name,value:`${n.totalLabel??Ce(n.total??0)} total`,sublabel:`Base ${n.baseLabel??Ce(n.base??0)} + Var ${n.variationLabel??Ce(n.variation??0)} · ${n.percentage??0}% committed`,color:a}),e.fillStyle=l(i.bd,.25),e.beginPath(),e.roundRect(f,d,k,H,4),e.fill(),_>0&&(m>0&&p(e,f+_/2,d+H/2,_*.3,a,.1*m),e.fillStyle=l(a,.5+m*.15),e.beginPath(),e.roundRect(f,d,_,H,4),e.fill()),y>2&&(e.fillStyle=l(a,.22+m*.08),e.beginPath(),e.roundRect(f+_,d,y,H,[0,4,4,0]),e.fill(),e.setLineDash([2,3]),e.strokeStyle=l(a,.55),e.lineWidth=1,e.beginPath(),e.moveTo(f+_,d+3),e.lineTo(f+_,d+H-3),e.stroke(),e.setLineDash([])),m>0&&v>0&&(e.strokeStyle=l(a,.5*m),e.lineWidth=1,e.setLineDash([]),e.beginPath(),e.roundRect(f,d,v,H,4),e.stroke()),c>.35&&(e.globalAlpha=Math.min(1,(c-.35)/.4),e.font=s.font,e.fillStyle=m>0?a:s.color,e.textAlign=`left`,e.textBaseline=`middle`,e.fillText(n.totalLabel??Ce(n.total??0),f+v+6,d+H/2),e.globalAlpha=1),b(N.current,n.id,f,d,Math.max(v,1),H,{label:n.name,value:n.totalLabel??Ce(n.total??0),sublabel:`${n.baseLabel??Ce(n.base??0)} + ${n.variationLabel??Ce(n.variation??0)} · ${n.percentage??0}%`,color:a})});let n=O-14;e.textBaseline=`middle`,e.font=c.font,e.textAlign=`left`,e.fillStyle=l(i.blue,.5),e.beginPath(),e.roundRect(V.left+xe,n-3,14,6,2),e.fill(),e.fillStyle=c.color,e.fillText(`base value`,V.left+xe+18,n),e.fillStyle=l(i.blue,.22),e.beginPath(),e.roundRect(V.left+xe+94,n-3,14,6,2),e.fill(),e.setLineDash([2,3]),e.strokeStyle=l(i.blue,.5),e.lineWidth=.5,e.beginPath(),e.moveTo(V.left+xe+101,n-3),e.lineTo(V.left+xe+101,n+3),e.stroke(),e.setLineDash([]),e.fillStyle=c.color,e.fillText(`approved variations`,V.left+xe+112,n),e.font=c.font,e.textAlign=`right`,e.fillStyle=c.color,e.fillText(`Portfolio: ${Ce(h?.total??0)}`,_e-8,n)},!0,{easing:S}),A?(0,n.jsx)(F,{width:_e,height:ve,message:`No contract data available`,"data-testid":r}):(0,n.jsxs)(`div`,{"data-testid":r,style:{width:_e,transition:`all 0.25s ease`},children:[(0,n.jsxs)(`div`,{style:{position:`relative`},children:[(0,n.jsx)(`canvas`,{ref:a,role:`img`,"aria-label":`Total contract value per contractor — horizontal bar chart`,style:{width:_e,height:O,display:`block`,borderRadius:8}}),(0,n.jsx)(_,{...M,parentW:_e,parentH:O})]}),g.length>ye&&(0,n.jsx)(`div`,{style:{marginTop:8},children:(0,n.jsx)(I,{expanded:d,onToggle:()=>f(e=>!e)})})]})}var Te=[{value:0xe8d4a51000,suffix:`T`,divisor:0xe8d4a51000},{value:1e9,suffix:`B`,divisor:1e9},{value:1e6,suffix:`M`,divisor:1e6},{value:1e3,suffix:`K`,divisor:1e3}];function U(e,t=1){let n=Math.abs(e),r=e<0?`-`:``;for(let e of Te)if(n>=e.value)return`${r}${(n/e.divisor).toFixed(t)}${e.suffix}`;return`${r}${n.toFixed(0)}`}var Ee=780,W=240,De=12,Oe=10,ke=5,Ae=(Ee-2*De-(ke-1)*Oe)/ke;function je({items:e=[],"data-testid":r}){let c=(0,t.useRef)(null),u=(0,t.useRef)(0),d=(0,t.useRef)(new Map),m=[...(0,t.useMemo)(()=>e.filter(e=>typeof e==`object`&&!!e),[e])].sort((e,t)=>(t.count??0)-(e.count??0)).slice(0,5),g=m.reduce((e,t)=>e+(t.count??0),0),y=Math.min(ke,m.length),x=y>0?2*De+y*Ae+(y-1)*Oe:Ee,{hoveredRef:S,tooltip:C,hitZonesRef:w}=v(c,{width:x,height:W});return(0,t.useEffect)(()=>{let e=c.current;if(!e)return;let t=f(e,x,W);u.current=0;let n=Ae,r=W*.84,_=W*.08,v=De,y,C=()=>{u.current++;let e=u.current;t.clearRect(0,0,x,W),t.letterSpacing=o.letterSpacing,w.current=[],d.current.forEach((e,t)=>{let n=t===S.current?1:0,r=e+(n-e)*.12;Math.abs(r-n)<.005?n===0?d.current.delete(t):d.current.set(t,1):d.current.set(t,r)}),S.current&&!d.current.has(S.current)&&d.current.set(S.current,0),m.forEach((o,c)=>{let u=c===0,f=c===0?i.red:c===1?i.amber:a[c%a.length],m=v+c*(n+Oe),h=d.current.get(o.id)??0,y=h*8,x=m-y/2,S=n+y,C=u?T(e,.04,3e-4)*.06+.06:0;t.fillStyle=l(f,.08+h*.07),t.beginPath(),t.roundRect(x,_,S,r,6),t.fill(),t.strokeStyle=l(f,.2+h*.4+C),t.lineWidth=u?1.5:1,t.stroke(),(h>.01||u)&&p(t,x+S/2,_+r/2,S*.55,f,C+h*.14),t.font=s.font,t.textAlign=`left`,t.textBaseline=`top`,t.fillStyle=l(f,.5+h*.35),t.fillText(`#${c+1}`,x+7,_+6);let E=Math.min(n*.28,r*.32,72),D=x+S/2,O=_+r*.38,k=t.createRadialGradient(D,O-E*.2,0,D,O,E);k.addColorStop(0,l(f,.5+h*.2)),k.addColorStop(1,l(f,.2+h*.1)),t.beginPath(),t.arc(D,O,E,0,Math.PI*2),t.fillStyle=k,t.fill(),t.strokeStyle=l(f,.4+h*.3),t.lineWidth=1,t.stroke(),t.font=s.font,t.textAlign=`center`,t.textBaseline=`middle`,t.fillStyle=l(i.t1,.9);let A=o.abbreviation??o.name??``,j=E*1.7,M=A;for(;t.measureText(M).width>j&&M.length>1;)M=M.slice(0,-1);M!==A&&(M=M.slice(0,-1)+`…`),t.fillText(M,D,O);let N=U(o.count??0),P=o.count==null?o.label??N:N;t.font=s.font,t.textBaseline=`alphabetic`,t.fillStyle=l(f,.9+h*.1);let F=S-16,I=P;for(;t.measureText(I).width>F&&I.length>1;)I=I.slice(0,-1);I!==P&&(I=I.slice(0,-1)+`…`),t.fillText(I,D,_+r*.74);let L=Math.round((o.count??0)/(g||1)*100);b(w.current,o.id,m,_,n,r,{label:o.name,value:`${P} · ${L}% of total`,sublabel:`Rank #${c+1}`,color:f})}),h(t,x,W,e,.015),y=requestAnimationFrame(C)};return C(),()=>cancelAnimationFrame(y)},[m,g,x]),m.length===0?(0,n.jsx)(F,{width:x,height:W,"data-testid":r}):(0,n.jsxs)(`div`,{"data-testid":r,style:{position:`relative`,width:x,height:W},children:[(0,n.jsx)(`canvas`,{ref:c,role:`img`,"aria-label":`Contractor rank — open EW count per contractor`,style:{width:x,height:W,display:`block`,borderRadius:8}}),(0,n.jsx)(_,{...C,parentW:x,parentH:W})]})}var G=680,K=260;function Me({items:e=[],"data-testid":r}){let a=(0,t.useRef)(null),s=(0,t.useRef)(0),c=(0,t.useRef)(new Map),{hoveredRef:u,tooltip:d,hitZonesRef:g}=v(a,{width:G,height:K}),b=(0,t.useMemo)(()=>e.filter(e=>typeof e==`object`&&!!e),[e]);return(0,t.useEffect)(()=>{let e=a.current;if(!e)return;let t=f(e,G,K);s.current=0;let n=b.length,r=Math.max(...b.map(e=>e.count),1),d=r,_=G*.05,v=K*.1,x=G*.9/n,S=K*.7/d,C=b.reduce((e,t)=>e+t.count,0),w,E=()=>{s.current++;let e=s.current;t.clearRect(0,0,G,K),g.current=[],c.current.forEach((e,t)=>{let n=t===u.current?1:0,r=e+(n-e)*.12;Math.abs(r-n)<.005?n===0?c.current.delete(t):c.current.set(t,1):c.current.set(t,r)}),u.current&&!c.current.has(u.current)&&c.current.set(u.current,0),m(t,G,K,e,40,l(i.blue,.04)),b.forEach((n,a)=>{let s=n.count===r,u=i.blue,f=c.current.get(`${n.category}-col`)??0;for(let i=0;i<d;i++){let o=_+a*x+x/2,d=v+i*S+S/2,m=Math.min(x,S)*.38;if(i>=r-n.count){let r=m*(1+(T(e,.04,5e-4)+Math.sin(a*.6+i*1.2)*.3)*.12);(s||f>.01)&&p(t,o,d,r*3,u,(s?.2:.1)+f*.1),t.beginPath(),t.arc(o,d,r,0,Math.PI*2),t.fillStyle=l(u,s?.8:.5+f*.2),t.fill();let h=`${n.category}-${i}`;y(g.current,h,o,d,m+4,{label:n.fullName,value:`${n.count} Early Warnings`,sublabel:`${Math.round(n.count/C*100)}% of total`,color:u}),c.current.get(`${n.category}-col`)}else t.beginPath(),t.arc(o,d,1,0,Math.PI*2),t.fillStyle=l(u,.08),t.fill()}let m=v+d*S+16;t.font=o.font,t.textAlign=`center`,t.textBaseline=`alphabetic`,t.fillStyle=s?i.blue:l(i.t2,.65),t.fillText(n.category,_+a*x+x/2,m)}),h(t,G,K,e,.015),w=requestAnimationFrame(E)};return E(),()=>cancelAnimationFrame(w)},[b]),b.length===0?(0,n.jsx)(F,{width:G,height:K,"data-testid":r}):(0,n.jsxs)(`div`,{"data-testid":r,style:{position:`relative`,width:G,height:K},children:[(0,n.jsx)(`canvas`,{ref:a,role:`img`,"aria-label":`Early Warning count by category — breathing dot grid`,style:{width:G,height:K,display:`block`,borderRadius:8}}),(0,n.jsx)(_,{...d,parentW:G,parentH:K})]})}function Ne({rows:e=[],className:t,colors:r}){return(0,n.jsx)(A,{rows:e,variant:`line`,className:t,colors:r})}var Pe=[`#4C93D9`,`#5DA537`,`#F3862C`,`#4F72C6`,`#A0B724`,`#EEBF3B`,`#3C45D1`],Fe={nodes:[{id:`supplier-x`,name:`Supplier X`,valueLabel:`Si +0.12%`},{id:`bf3-superheat`,name:`BF-3 Superheat`,valueLabel:`22°C (target 34)`},{id:`ccm3-solidification`,name:`CCM-3 Solidification`,valueLabel:`Rate deviation`},{id:`grade-risk`,name:`Grade Risk`,valueLabel:`Automotive 74%`}],links:[{source:`supplier-x`,target:`bf3-superheat`,value:92},{source:`bf3-superheat`,target:`ccm3-solidification`,value:87},{source:`ccm3-solidification`,target:`grade-risk`,value:74}]};function Ie({rows:e=[],className:t,colors:r}){let i=r?.slices??Pe;return(0,n.jsx)(`div`,{className:[`d3-mini-bars`,t].filter(Boolean).join(` `),children:e.map(([e,t,r],a)=>(0,n.jsxs)(`div`,{className:`d3-mini-row`,children:[(0,n.jsx)(`span`,{children:e}),(0,n.jsx)(`div`,{className:`d3-mini-track`,children:(0,n.jsxs)(`svg`,{viewBox:`0 0 100 12`,className:`d3-mini-svg`,"aria-hidden":`true`,children:[(0,n.jsx)(`rect`,{x:`0`,y:`0`,width:`100`,height:`12`,rx:`6`,className:`d3-mini-track-fill`}),(0,n.jsx)(`rect`,{x:`0`,y:`0`,width:Math.max(0,Math.min(100,t)),height:`12`,rx:`6`,className:`d3-mini-fill tone-${a%Pe.length}`,fill:i[a%i.length]})]})}),(0,n.jsx)(`span`,{children:r})]},`${e}-${a}`))})}var Le=770,Re=320,ze=60,Be=28;function Ve({total:e=0,totalLabel:r,items:c=[],width:u=Le,"data-testid":d}){let m=(0,t.useRef)(null),h=(0,t.useRef)(new Map),g=(0,t.useRef)(0),b=(0,t.useMemo)(()=>c.filter(e=>typeof e==`object`&&!!e),[c]),S=(0,t.useMemo)(()=>Math.max(Re,ze+Math.max(0,b.length-1)*Be),[b.length]),{hoveredRef:C,tooltip:w,hitZonesRef:T}=v(m,{width:u,height:S});return(0,t.useEffect)(()=>{let t=m.current;if(!t)return;let n=f(t,u,S);g.current=0;let c=S/2,d=u-200,_=Math.max(...b.map(e=>e.count??0),1),v=b.length>1?(S-60)/(b.length-1):0,w=b.map((e,t)=>({x:d,y:30+t*v})),O,k=()=>{g.current++;let t=g.current;n.clearRect(0,0,u,S),n.letterSpacing=o.letterSpacing;let f=x(Math.min(t/72,1));if(D(h.current,C.current),T.current=[],p(n,88,c,48*f,i.blue,.15*f),b.forEach((t,r)=>{let u=a[r%a.length],m=E(f,r,b.length,x),g=w[r],v=h.current.get(t.id)??0,S=Math.max(1.5,(t.count??0)/_*6);if(m<.01)return;let C=88+(d-88)*.4,D=c,O=88+(d-88)*.6,k=g.y,A=m;n.beginPath();for(let e=0;e<=40;e++){let t=e/40*A,r=(1-t)**3*88+3*(1-t)**2*t*C+3*(1-t)*t**2*O+t**3*g.x,i=(1-t)**3*c+3*(1-t)**2*t*D+3*(1-t)*t**2*k+t**3*g.y;e===0?n.moveTo(r,i):n.lineTo(r,i)}if(n.strokeStyle=l(u,v>0?.8:.45),n.lineWidth=S*(v>0?1.3:1),n.stroke(),m>.85){let r=Math.min(1,(m-.85)/.15),a=4+(t.count??0)/_*12;p(n,g.x,g.y,a*2.5,u,(.25+v*.2)*r),n.beginPath(),n.arc(g.x,g.y,a*r,0,Math.PI*2),n.fillStyle=l(u,(.7+v*.2)*r),n.fill();let c=U(t.count??0);y(T.current,t.id,g.x,g.y,a+8,{label:t.name,value:c,sublabel:`${Math.round((t.count??0)/(e||1)*100)}% of total`,color:u}),n.globalAlpha=r,n.font=o.font,n.textAlign=`left`;let d=t.abbreviation??t.name?.slice(0,6)??``,f=` ${U(t.count??0)}`,h=g.x+a+6,b=g.y+4;n.fillStyle=v>0?u:l(i.t2,.85),n.fillText(d,h,b);let x=n.measureText(d).width;n.font=s.font,n.fillStyle=v>0?u:i.t1,n.fillText(f,h+x,b),n.globalAlpha=1}}),n.beginPath(),n.arc(88,c,32*f,0,Math.PI*2),n.fillStyle=i.bgL,n.fill(),n.strokeStyle=l(i.blue,.6*f),n.lineWidth=2,n.stroke(),f>.4){n.globalAlpha=Math.min(1,(f-.4)/.4);let t=r??U(e,0);n.font=`500 16px 'Satoshi Variable', 'DM Sans', sans-serif`;let a=t;for(;n.measureText(a).width>54.4&&a.length>1;)a=a.slice(0,-1);a!==t&&(a=a.slice(0,-1)+`…`),n.fillStyle=i.t1,n.textAlign=`center`,n.textBaseline=`middle`,n.fillText(a,88,c),n.globalAlpha=1}y(T.current,`__root__`,88,c,32,{label:r??`Total`,value:U(e,0),sublabel:`${b.length} items`,color:i.blue}),O=requestAnimationFrame(k)};return k(),()=>cancelAnimationFrame(O)},[e,r,b,S,u]),b.length===0?(0,n.jsx)(F,{width:u,height:Re,"data-testid":d}):(0,n.jsxs)(`div`,{"data-testid":d,style:{position:`relative`,width:u,height:S},children:[(0,n.jsx)(`canvas`,{ref:m,role:`img`,"aria-label":`NCE fault tree — NCEs per contractor as branching tree`,style:{width:u,height:S,display:`block`}}),(0,n.jsx)(_,{...w,parentW:u,parentH:S})]})}var He=192,Ue=He,We=He+80;function Ge({rows:e=[],variant:o,className:s,colors:c}){let u=(0,t.useRef)(null),m=(0,t.useRef)(new Map),h=(0,t.useRef)(0),g=c?.slices??a,{hoveredRef:b,tooltip:x,hitZonesRef:S}=v(u,{width:Ue,height:We});return(0,t.useEffect)(()=>{let t=u.current;if(!t)return;let n=f(t,Ue,We);h.current=0;let r=Ue/2,a=He/2,s=He*.4,c=o===`donut`?He*.21:0,_=e.reduce((e,t)=>e+(t.pricing??0),0)||1,v,x=()=>{h.current++;let t=h.current;n.clearRect(0,0,Ue,We);let u=1-(1-Math.min(t/48,1))**3;D(m.current,b.current),S.current=[];let f=-Math.PI/2;e.forEach((e,o)=>{let d=(e.pricing??0)/_,h=d*Math.PI*2*u,v=f+h,b=g[o%g.length],x=m.current.get(e.id??`sl-${o}`)??0,C=f+h/2,w=(s+c)/2,E=r+Math.cos(C)*w,D=a+Math.sin(C)*w,O=(s-c)/2+8;y(S.current,e.id??`sl-${o}`,E,D,O,{label:e.vendor,value:`${e.pricing??0} (${Math.round(d*100)}%)`,color:b}),x>0&&p(n,E,D,O*2*x,b,.2*x);let k=T(t,.03,3e-4),A=s+x*6+(x>0?k*2:0);n.beginPath(),n.moveTo(r+Math.cos(f)*c,a+Math.sin(f)*c),n.arc(r,a,A,f,v),c>0?n.arc(r,a,c,v,f,!0):n.lineTo(r,a),n.closePath(),n.fillStyle=l(b,.7+x*.2),n.fill(),n.strokeStyle=l(i.bg,.8),n.lineWidth=1.5,n.stroke(),f=v}),o===`donut`&&e.length>0&&p(n,r,a,c*.8,i.blue,.06);let C=He+12;e.forEach((e,t)=>{let r=g[t%g.length],a=(e.pricing??0)/_,o=m.current.get(e.id??`sl-${t}`)??0,s=C+t*18;n.beginPath(),n.arc(8,s,4,0,Math.PI*2),n.fillStyle=l(r,.8+o*.2),n.fill(),n.font=`9px 'JetBrains Mono', monospace`,n.fillStyle=l(i.t2,.7+o*.2),n.textAlign=`left`,n.fillText(e.vendor,18,s+3.5),n.font=`bold 9px 'JetBrains Mono', monospace`,n.fillStyle=d(i.t3,r,o),n.textAlign=`right`,n.fillText(`${e.pricing??0} (${Math.round(a*100)}%)`,Ue-4,s+3.5)}),v=requestAnimationFrame(x)};return x(),()=>cancelAnimationFrame(v)},[e,o,c,g]),(0,n.jsx)(r,{className:[`canvas-pie-frame`,s].filter(Boolean).join(` `),children:(0,n.jsxs)(`div`,{style:{position:`relative`,width:Ue,height:We},children:[(0,n.jsx)(`canvas`,{ref:u,role:`img`,"aria-label":`${o} chart`,style:{width:Ue,height:We,display:`block`,borderRadius:8}}),(0,n.jsx)(_,{...x,parentW:Ue,parentH:We})]})})}function Ke(e,t,n,r){let i=new Set(t.map(e=>e.source)),a=new Set(t.map(e=>e.target)),o=new Map,s=[];for(e.forEach(e=>{i.has(e.id)&&!a.has(e.id)&&s.push({id:e.id,depth:0})});s.length>0;){let e=s.shift();if(!e)break;let{id:n,depth:r}=e;o.has(n)||(o.set(n,r),t.filter(e=>e.source===n).forEach(e=>{o.has(e.target)||s.push({id:e.target,depth:r+1})}))}let c=o.size>0?Math.max(...Array.from(o.values())):0;e.forEach(e=>{o.has(e.id)||o.set(e.id,c+1)});let l=new Map;e.forEach(e=>{let t=o.get(e.id)??0;l.has(t)||l.set(t,[]),l.get(t).push(e.id)});let u=Math.max(...Array.from(l.keys()))+1,d={left:100,right:80,top:40,bottom:40},f=new Map;return l.forEach((e,t)=>{let i=d.left+t/Math.max(u-1,1)*(n-d.left-d.right),a=r-d.top-d.bottom,o=Math.max(24,(a-(e.length-1)*12)/e.length),s=e.length*o+(e.length-1)*12,c=d.top+(a-s)/2;e.forEach((e,t)=>{f.set(e,{x:i-20/2,y:c+t*(o+12),w:20,h:o})})}),f}function qe({nodes:e,links:o,width:s=960,height:c=280,ariaLabel:u,selectedEntity:d,className:m,colors:g}){let x=(0,t.useRef)(null),S=(0,t.useRef)(new Map),C=(0,t.useRef)(0),w=(0,t.useRef)([]),E=g?.nodes??a,O=g?.links??i.bd,k=g?.activeLinks??i.blue,A=g?.activeNodes??i.blue,j=(0,t.useMemo)(()=>Ke(e,o,s,c),[e,o,s,c]),{hoveredRef:M,tooltip:N,hitZonesRef:P}=v(x,{width:s,height:c});return(0,t.useEffect)(()=>{let t=x.current;if(!t)return;let n=f(t,s,c);C.current=0,w.current=[];let r=o.length>0?Math.max(...o.map(e=>e.value)):1,a,u=()=>{C.current++;let t=C.current;n.clearRect(0,0,s,c);let f=1-(1-Math.min(t/56,1))**3;D(S.current,M.current),P.current=[],o.forEach((e,a)=>{let o=j.get(e.source),s=j.get(e.target);if(!o||!s)return;let c=!!d&&(e.source===d||e.target===d),u=c?k:O,p=c?.5:.2,m=Math.max(3,e.value/r*36*f),h=m/2,g=o.x+o.w,_=o.y+o.h/2,v=s.x,b=s.y+s.h/2,x=(g+v)/2;for(let e=0;e<30;e++){let r=e/30,i=(e+1)/30,o=1-r,s=1-i,c=o*o*g+2*o*r*x+r*r*v,d=o*o*_+2*o*r*_+r*r*b,f=s*s*g+2*s*i*x+i*i*v,m=s*s*_+2*s*i*_+i*i*b,y=T(t+r*120+a*40,.025,3e-4)*1.2;n.beginPath(),n.moveTo(c,d-h+y),n.lineTo(f,m-h+y),n.lineTo(f,m+h+y),n.lineTo(c,d+h+y),n.closePath(),n.fillStyle=l(u,p*(.5+r*.5)),n.fill()}y(P.current,`link-${a}`,x,(_+b)/2,m+6,{label:`${e.source} → ${e.target}`,value:String(e.value),color:c?k:i.blue}),Math.random()<.08&&w.current.push({linkIdx:a,prog:0,speed:.006+Math.random()*.006,off:(Math.random()-.5)*m*.5,sz:1+Math.random()})}),e.forEach((e,r)=>{let a=j.get(e.id);if(!a)return;let o=d===e.id,s=M.current===`node-${r}`,c=S.current.get(`node-${r}`)??0,u=o?A:E[r%E.length];b(P.current,`node-${r}`,a.x,a.y,a.w,a.h,{label:e.name,value:e.valueLabel??e.id,color:u}),(c>0||o)&&p(n,a.x+a.w/2,a.y+a.h/2,a.w*2,u,.2*Math.max(c,o?.6:0));let f=o?T(t,.03,3e-4)*.15:0;n.fillStyle=l(u,.6+c*.25+f),n.beginPath(),n.roundRect(a.x,a.y,a.w,a.h,4),n.fill(),(o||c>0)&&(n.strokeStyle=l(u,.5*Math.max(c,o?1:0)),n.lineWidth=1,n.beginPath(),n.roundRect(a.x,a.y,a.w,a.h,4),n.stroke());let m=a.x+a.w+8;n.font=`${o||s?`bold `:``}10px 'JetBrains Mono', monospace`,n.fillStyle=l(o?u:i.t2,.7+c*.2),n.textAlign=`left`,n.fillText(e.name,m,a.y+a.h/2+4),e.valueLabel&&(n.font=`9px 'JetBrains Mono', monospace`,n.fillStyle=l(u,.5+c*.2),n.fillText(e.valueLabel,m,a.y+a.h/2+17))}),w.current=w.current.filter(e=>{if(e.prog+=e.speed,e.prog>1)return!1;let t=o[e.linkIdx];if(!t)return!1;let r=j.get(t.source),a=j.get(t.target);if(!r||!a)return!1;let s=r.x+r.w,c=r.y+r.h/2,u=a.x,d=a.y+a.h/2,f=(s+u)/2,p=1-e.prog,m=p*p*s+2*p*e.prog*f+e.prog*e.prog*u,h=p*p*c+2*p*e.prog*c+e.prog*e.prog*d+e.off,_=Math.sin(e.prog*Math.PI)*.5,v=g?.links??i.blue;return n.beginPath(),n.arc(m,h,e.sz,0,Math.PI*2),n.fillStyle=l(v,_),n.fill(),!0}),w.current.length>150&&(w.current=w.current.slice(-150)),h(n,s,c,t,.01),a=requestAnimationFrame(u)};return u(),()=>{cancelAnimationFrame(a),w.current=[]}},[e,o,s,c,d,g,j]),(0,n.jsx)(r,{className:[`canvas-sankey-frame`,m].filter(Boolean).join(` `),children:(0,n.jsxs)(`div`,{role:`img`,"aria-label":u,style:{position:`relative`,width:s,height:c},children:[(0,n.jsx)(`canvas`,{ref:x,style:{width:s,height:c,display:`block`,borderRadius:8}}),(0,n.jsx)(_,{...N,parentW:s,parentH:c})]})})}var Je=[{x:.13,y:.48},{x:.37,y:.28},{x:.63,y:.62},{x:.87,y:.38},{x:.25,y:.72},{x:.5,y:.18},{x:.75,y:.7},{x:.92,y:.22}],Ye=[i.blue,i.orange,i.red,i.purple,i.green,i.amber,i.t2],Xe=[26,24,24,26,22,22,22,22];function Ze(e,t){let n=1-t;return{x:n*n*n*e.p0.x+3*n*n*t*e.p1.x+3*n*t*t*e.p2.x+t*t*t*e.p3.x,y:n*n*n*e.p0.y+3*n*n*t*e.p1.y+3*n*t*t*e.p2.y+t*t*t*e.p3.y}}function Qe(e,t){let n=1-t,r=3*n*n*(e.p1.x-e.p0.x)+6*n*t*(e.p2.x-e.p1.x)+3*t*t*(e.p3.x-e.p2.x),i=3*n*n*(e.p1.y-e.p0.y)+6*n*t*(e.p2.y-e.p1.y)+3*t*t*(e.p3.y-e.p2.y),a=Math.sqrt(r*r+i*i)||1;return{x:-i/a,y:r/a}}function $e(e,t){let n=t.x-e.x,r=t.y-e.y;return{p0:{x:e.x,y:e.y},p1:{x:e.x+n*.3+r*.15,y:e.y+r*.3-n*.15},p2:{x:t.x-n*.3+r*.08,y:t.y-r*.3-n*.08},p3:{x:t.x,y:t.y}}}function et({nodes:e,links:r,width:a=960,height:o=280,selectedEntity:s}){let c=(0,t.useRef)(null),u=(0,t.useRef)(0),g=(0,t.useRef)([]),{hoveredRef:b,tooltip:S,hitZonesRef:C}=v(c,{width:a,height:o}),w=(0,t.useMemo)(()=>{let t=new Map;return e.forEach((e,n)=>t.set(e.id,n)),t},[e]),E=(0,t.useMemo)(()=>r.length>0?Math.max(...r.map(e=>e.value)):100,[r]),D=e=>E>1?e/100:e,O=(0,t.useMemo)(()=>e.map((e,t)=>{let n=Je[t%Je.length];return{id:e.id,label:e.name,sub:e.valueLabel??``,x:n.x*a,y:n.y*o,r:Xe[t%Xe.length],color:Ye[t%Ye.length]}}),[e,a,o]),k=(0,t.useMemo)(()=>r.map(e=>({fromIdx:w.get(e.source)??-1,toIdx:w.get(e.target)??-1,conf:D(e.value)})).filter(e=>e.fromIdx>=0&&e.toIdx>=0),[r,w]);return(0,t.useEffect)(()=>{let e=c.current;if(!e)return;let t=f(e,a,o);u.current=0,g.current=[];let n,r=()=>{u.current++;let e=u.current;if(t.clearRect(0,0,a,o),C.current=[],m(t,a,o,e,50,l(i.blue,.05)),k.forEach((e,n)=>{let r=O[e.fromIdx],a=O[e.toIdx];if(!r||!a)return;let o=!!s&&(r.id===s||a.id===s),c=d(r.color,a.color,.5),u=o?.18:.05,f=o?.25:.1,p=$e(r,a);t.beginPath(),t.moveTo(p.p0.x,p.p0.y),t.bezierCurveTo(p.p1.x,p.p1.y,p.p2.x,p.p2.y,p.p3.x,p.p3.y),t.strokeStyle=l(c,u),t.lineWidth=16,t.lineCap=`round`,t.stroke(),t.strokeStyle=l(c,f),t.lineWidth=1.5,t.stroke();for(let t=0;t<e.conf*2.5;t++)Math.random()<.45&&g.current.push({edgeIdx:n,t:0,speed:.003+Math.random()*.004,off:(Math.random()-.5)*13,sz:.7+Math.random()*2});let m=Ze(p,.5),h=`${Math.round(e.conf*100)}%`;t.font=`bold 12px 'JetBrains Mono', monospace`,t.textBaseline=`middle`;let _=t.measureText(h).width+14;t.fillStyle=`rgba(10,16,24,0.88)`,t.beginPath(),t.roundRect(m.x-_/2,m.y-11,_,22,6),t.fill(),t.strokeStyle=l(i.blue,.25),t.lineWidth=1,t.stroke(),t.fillStyle=l(i.blue,.9),t.textAlign=`center`,t.fillText(h,m.x,m.y)}),g.current=g.current.filter(e=>{if(e.t+=e.speed,e.t>1)return!1;let n=k[e.edgeIdx];if(!n)return!1;let r=O[n.fromIdx],i=O[n.toIdx];if(!r||!i)return!1;let a=$e(r,i),o=Ze(a,e.t),s=Qe(a,e.t),c=o.x+s.x*e.off,u=o.y+s.y*e.off,f=Math.sin(e.t*Math.PI)*.7,m=d(r.color,i.color,e.t);return p(t,c,u,e.sz*3,m,f*.1),t.beginPath(),t.arc(c,u,e.sz,0,Math.PI*2),t.fillStyle=l(m,f),t.fill(),!0}),g.current.length>350&&(g.current=g.current.slice(-350)),O.forEach((n,r)=>{let a=s===n.id,o=b.current===`node-${r}`,c=T(e,.03,3e-4)*.1+1,u=n.r*c*(a?1.15:1);t.beginPath(),t.arc(n.x,n.y,u+6,0,Math.PI*2),t.strokeStyle=l(n.color,a?.3:.1),t.lineWidth=a?1.5:.7,t.stroke(),p(t,n.x,n.y,u*3,n.color,a?.22:.12);let d=t.createRadialGradient(n.x,n.y-u*.2,0,n.x,n.y,u);if(d.addColorStop(0,l(n.color,a?1:.85)),d.addColorStop(1,l(n.color,a?.65:.45)),t.fillStyle=d,t.beginPath(),t.arc(n.x,n.y,u,0,Math.PI*2),t.fill(),a||r===O.length-1){let r=u+16,i=e*.04,a=n.x+Math.cos(i)*r,o=n.y+Math.sin(i)*r;p(t,a,o,6,n.color,.3),t.beginPath(),t.arc(a,o,2,0,Math.PI*2),t.fillStyle=l(n.color,.75),t.fill()}y(C.current,`node-${r}`,n.x,n.y,u+8,{label:n.label,value:n.sub||n.id,color:n.color}),t.font=`${a||o?`bold `:``}12px 'DM Sans', sans-serif`,t.textAlign=`center`,t.textBaseline=`alphabetic`,t.fillStyle=l(n.color,a?1:.9),t.fillText(n.label,n.x,n.y+u+18),n.sub&&(t.font=`10px 'JetBrains Mono', monospace`,t.fillStyle=l(i.t3,.65),t.fillText(n.sub,n.x,n.y+u+32))}),k.length>=2){let n=k.reduce((e,t)=>e*t.conf,1),r=o*.92,s=a*.12,c=a*.76,u=x(Math.min(e*.008,1));t.fillStyle=l(i.bd,.35),t.beginPath(),t.roundRect(s,r,c,5,3),t.fill(),t.fillStyle=l(i.orange,.6),t.beginPath(),t.roundRect(s,r,c*n*u,5,3),t.fill(),t.font=`bold 12px 'JetBrains Mono', monospace`,t.textAlign=`left`,t.textBaseline=`middle`,t.fillStyle=l(i.orange,.85),t.fillText(`${Math.round(n*100)}% compound confidence`,s+c*n*u+10,r+2);let d=k.map(e=>e.conf.toFixed(2)).join(` × `);t.textAlign=`right`,t.font=`9px 'JetBrains Mono', monospace`,t.fillStyle=l(i.t4,.6),t.fillText(d,s-6,r+2)}h(t,a,o,e,.012),n=requestAnimationFrame(r)};return r(),()=>{cancelAnimationFrame(n),g.current=[]}},[O,k,a,o,s]),(0,n.jsxs)(`div`,{style:{position:`relative`,width:a,height:o},children:[(0,n.jsx)(`canvas`,{ref:c,style:{width:a,height:o,display:`block`,borderRadius:8},role:`img`,"aria-label":`causal flow diagram`}),(0,n.jsx)(_,{...S,parentW:a,parentH:o})]})}function tt({selectedEntity:e,colors:t}){return(0,n.jsx)(et,{nodes:Fe.nodes,links:Fe.links,width:960,height:280,selectedEntity:e})}function nt({rows:e=[],className:r,colors:i}){let{nodes:a,links:o}=(0,t.useMemo)(()=>{let t=e.slice(0,5);return{nodes:[{id:`score`,name:`Portfolio Score`},...t.map(e=>({id:e.id??e.vendor,name:e.vendor}))],links:t.map(e=>({source:e.id??e.vendor,target:`score`,value:Math.max(8,e.pricing??0)}))}},[e]);return(0,n.jsx)(qe,{nodes:a,links:o,width:760,height:280,ariaLabel:`sankey chart`,className:r,colors:i})}var rt=500,it=210;function at({left:e,right:r,"data-testid":a}){let c=(0,t.useRef)(null),u=(0,t.useRef)(0);return(0,t.useEffect)(()=>{let t=c.current;if(!t)return;let n=f(t,rt,it);u.current=0;let a=rt/2,d=Math.max(e.value??0,r.value??0,1),m=(e.value-r.value)/d*14,h,g=()=>{u.current++;let t=u.current;n.clearRect(0,0,rt,it),n.letterSpacing=o.letterSpacing;let c=x(Math.min(t/80,1)),f=m*w(Math.min(t/80,1))*Math.PI/180;n.strokeStyle=l(i.bd,.5*c),n.lineWidth=2,n.beginPath(),n.moveTo(a,20),n.lineTo(a,150),n.stroke(),n.beginPath(),n.arc(a,20,5*c,0,Math.PI*2),n.fillStyle=i.t2,n.fill();let _={x:a-Math.cos(f)*160,y:20+Math.sin(-f)*160},v={x:a+Math.cos(f)*160,y:20+Math.sin(f)*160};n.strokeStyle=l(i.t2,.5*c),n.lineWidth=2,n.beginPath(),n.moveTo(_.x,_.y),n.lineTo(v.x,v.y),n.stroke();let y=Math.max(20,e.value/d*100*c),b=_.y+18;p(n,_.x,b+y/2,90*.5,i.green,.18*c),n.fillStyle=l(i.green,.5*c),n.beginPath(),n.roundRect(_.x-90/2,b,90,y,[0,0,6,6]),n.fill(),n.strokeStyle=l(i.green,.7*c),n.lineWidth=1.5,n.stroke(),n.strokeStyle=l(i.t2,.35*c),n.lineWidth=1,[-90/3,90/3].forEach(e=>{n.beginPath(),n.moveTo(_.x+e,_.y+4),n.lineTo(_.x+e,b),n.stroke()}),c>.5&&(n.globalAlpha=Math.min(1,(c-.5)/.5),n.font=s.font,n.fillStyle=i.green,n.textAlign=`center`,n.fillText(e.label,_.x,b+y+18),n.font=o.font,n.fillStyle=o.color,n.fillText(`Accepted`,_.x,b+y+38),n.fillText(`${e.count} quotations`,_.x,b+y+58),n.globalAlpha=1);let S=Math.max(20,r.value/d*100*c),C=v.y+18;n.fillStyle=l(i.amber,.3*c),n.strokeStyle=l(i.amber,.5*c),n.lineWidth=1.5,n.beginPath(),n.roundRect(v.x-90/2,C,90,S,[0,0,6,6]),n.fill(),n.stroke(),n.strokeStyle=l(i.t2,.35*c),n.lineWidth=1,[-90/3,90/3].forEach(e=>{n.beginPath(),n.moveTo(v.x+e,v.y+4),n.lineTo(v.x+e,C),n.stroke()}),c>.5&&(n.globalAlpha=Math.min(1,(c-.5)/.5),n.font=s.font,n.fillStyle=i.amber,n.textAlign=`center`,n.fillText(r.label,v.x,C+S+18),n.font=o.font,n.fillStyle=o.color,n.fillText(`Submitted`,v.x,C+S+38),n.fillText(`${r.count} quotations`,v.x,C+S+58),n.globalAlpha=1),h=requestAnimationFrame(g)};return g(),()=>cancelAnimationFrame(h)},[e,r]),(0,n.jsx)(`div`,{"data-testid":a,style:{position:`relative`,width:rt,height:it},children:(0,n.jsx)(`canvas`,{ref:c,role:`img`,"aria-label":`Quotation balance — accepted vs submitted quotation value`,style:{width:rt,height:it,display:`block`}})})}var ot=680,q=280;function st({points:e=[],"data-testid":r}){let a=(0,t.useRef)(null),s=(0,t.useRef)(new Map),c=(0,t.useRef)(0),{hoveredRef:u,tooltip:d,hitZonesRef:m}=v(a,{width:ot,height:q}),h=(0,t.useMemo)(()=>e.filter(e=>typeof e==`object`&&!!e),[e]);return(0,t.useEffect)(()=>{let e=a.current;if(!e)return;let t=f(e,ot,q);c.current=0;let n=ot-54-28,r=q-30-54,d=Math.max(...h.map(e=>e.count),1),_=h.length,v=_>1?n/(_-1):n,b=h.map((e,t)=>({x:54+t*v,y:30+r-e.count/d*r,point:e})),S,C=()=>{c.current++;let e=c.current;t.clearRect(0,0,ot,q),t.letterSpacing=o.letterSpacing;let a=x(Math.min(e/72,1));D(s.current,u.current),m.current=[],[.25,.5,.75,1].forEach(e=>{let a=30+r-e*r;t.strokeStyle=l(i.bd,.18),t.lineWidth=1,t.setLineDash([3,5]),t.beginPath(),t.moveTo(54,a),t.lineTo(54+n,a),t.stroke(),t.setLineDash([]),t.font=o.font,t.fillStyle=o.color,t.textAlign=`right`,t.fillText(String(Math.round(d*e)),48,a+3)}),t.save(),t.translate(12,30+r/2),t.rotate(-Math.PI/2),t.font=o.font,t.fillStyle=o.color,t.textAlign=`center`,t.fillText(`Submissions`,0,0),t.restore(),t.font=o.font,t.fillStyle=o.color,t.textAlign=`center`,t.fillText(`Week`,54+n/2,q-6),t.strokeStyle=l(i.bd,.3),t.lineWidth=1,t.setLineDash([]),t.beginPath(),t.moveTo(54,30+r),t.lineTo(54+n,30+r),t.stroke();let f=a*(_-1),h=Math.floor(f)+1;if(h>=2){t.beginPath(),t.moveTo(b[0].x,30+r),t.lineTo(b[0].x,b[0].y);for(let e=1;e<h;e++){let n=f-Math.floor(f),r=e<h-1?b[e].x:b[e-1].x+(b[e].x-b[e-1].x)*(e===Math.ceil(f)?n:1),i=e<h-1?b[e].y:b[e-1].y+(b[e].y-b[e-1].y)*(e===Math.ceil(f)?n:1);t.lineTo(r,i)}let e=b[Math.min(h-1,_-1)];t.lineTo(e.x,30+r),t.closePath();let n=t.createLinearGradient(0,30,0,30+r);n.addColorStop(0,l(i.blue,.22)),n.addColorStop(1,l(i.blue,.02)),t.fillStyle=n,t.fill()}t.beginPath();for(let e=0;e<h;e++){let n=f-Math.floor(f),r=e===h-1&&e>0&&e===Math.ceil(f),i=e===0||e<h-1?b[e].x:b[e-1].x+(b[e].x-b[e-1].x)*(r?n:1),a=e===0||e<h-1?b[e].y:b[e-1].y+(b[e].y-b[e-1].y)*(r?n:1);e===0?t.moveTo(i,a):t.lineTo(i,a)}t.strokeStyle=l(i.blue,.85),t.lineWidth=2,t.stroke(),b.forEach((e,n)=>{if(n>=h)return;let a=`pt-${n}`,c=s.current.get(a)??0;y(m.current,a,e.x,e.y,10,{label:e.point.week,value:String(e.point.count),color:i.blue}),c>0&&g(t,e.x,30,30+r,l(i.blue,.15*c));let u=e.point.count===d;(c>0||u)&&p(t,e.x,e.y,14,i.blue,(u?.3:0)+c*.25),t.beginPath(),t.arc(e.x,e.y,c>0?5:3.5,0,Math.PI*2),t.fillStyle=l(i.blue,c>0?1:.8),t.fill(),(c>0||u)&&(t.font=o.font,t.fillStyle=i.blue,t.textAlign=`center`,t.fillText(String(e.point.count),e.x,e.y-10)),t.font=o.font,t.fillStyle=c>0?i.blue:o.color,t.textAlign=`center`,t.fillText(e.point.week,e.x,q-54+14)}),S=requestAnimationFrame(C)};return C(),()=>cancelAnimationFrame(S)},[h]),h.length<2?(0,n.jsx)(F,{width:ot,height:q,"data-testid":r}):(0,n.jsx)(`div`,{"data-testid":r,className:`trend-scroll`,style:{width:`100%`,overflowX:`auto`},children:(0,n.jsxs)(`div`,{style:{position:`relative`,width:ot,height:q},children:[(0,n.jsx)(`canvas`,{ref:a,role:`img`,"aria-label":`Trend chart — count over time`,style:{width:ot,height:q,display:`block`}}),(0,n.jsx)(_,{...d,parentW:ot,parentH:q})]})})}var ct=680,J=280,lt=54,ut=48,dt=64,ft=o.font,pt=12,mt=Math.PI*2,ht=72,gt=20,_t=5e3;function vt({points:e=[],"data-testid":r}){let a=(0,t.useRef)(null),s=(0,t.useRef)(null),c=(0,t.useRef)(0),u=(0,t.useMemo)(()=>e.filter(e=>typeof e==`object`&&!!e),[e]),d=(0,t.useMemo)(()=>{if(u.length<=1)return dt;let e=document.createElement(`canvas`).getContext(`2d`);if(!e)return dt;e.font=ft;let t=Math.max(1,Math.ceil(u.length/gt)),n=Math.max(...u.filter((e,n)=>n%t===0).map(t=>e.measureText(t.week).width));return Math.max(dt,n+pt)},[u]),p=Math.round(d/2),m=ut+p+Math.max(0,u.length-1)*d,h=Math.max(ct-lt,Math.min(m,_t)),{tooltip:g,hitZonesRef:b}=v(a,{width:h,height:J});return(0,t.useEffect)(()=>{let e=a.current;if(!e)return;let t=f(e,h,J),n=s.current?f(s.current,lt,J):null;c.current=0;let r=u.length<=ht?ht:Math.max(24,Math.round(ht*(ht/u.length))),m=h-ut,g=J-42-54,_=u.length>0?u.map(e=>e.count):[0],v=Math.min(..._),S=Math.max(..._),C=S-v||1,w=u.length,T=w>1?(m-p)/(w-1):m-p,E=Math.max(1,Math.ceil(d/T)),D=v<0,O=D?42+g- -v/C*g:42+g,k=u.map((e,t)=>({x:p+t*T,y:42+g-(D?(e.count-v)/C:e.count/(S||1))*g,point:e}));if(n){n.clearRect(0,0,lt,J),n.letterSpacing=o.letterSpacing;let e=D?[v,v+C*.25,v+C*.5,v+C*.75,S]:[0,S*.25,S*.5,S*.75,S];e.forEach((t,r)=>{let i=r/(e.length-1),a=42+g-i*g;n.font=o.font,n.fillStyle=o.color,n.textAlign=`right`,n.fillText(U(t),lt-6,a+3)}),n.save(),n.translate(12,42+g/2),n.rotate(-Math.PI/2),n.font=o.font,n.fillStyle=o.color,n.textAlign=`center`,n.fillText(`Count`,0,0),n.restore()}let A=t.createLinearGradient(0,42,0,42+g);A.addColorStop(0,l(i.blue,.22)),A.addColorStop(1,l(i.blue,.02));let j=0,M,N=e=>{t.font=ft,t.fillStyle=o.color,t.textAlign=`center`;for(let n=0;n<e;n++)n%E===0&&t.fillText(k[n].point.week,k[n].x,J-54+14)},P=()=>{c.current++;let e=Math.min(c.current/r,1),n=x(e),a=e>=1;t.clearRect(0,0,h,J),t.letterSpacing=o.letterSpacing,(D?[0,.25,.5,.75,1]:[.25,.5,.75,1]).forEach(e=>{let n=42+g-e*g;t.strokeStyle=l(i.bd,.18),t.lineWidth=1,t.setLineDash([3,5]),t.beginPath(),t.moveTo(0,n),t.lineTo(m,n),t.stroke(),t.setLineDash([])}),t.font=o.font,t.fillStyle=o.color,t.textAlign=`center`,t.fillText(`Period`,p+(m-p)/2,J-6),t.strokeStyle=l(i.bd,D?.5:.3),t.lineWidth=D?2:1,t.beginPath(),t.moveTo(p,D?O:42+g),t.lineTo(m,D?O:42+g),t.stroke();let s=n*(w-1),u=Math.floor(s)+1;if(u>=2){let e=D?O:42+g;t.beginPath(),t.moveTo(k[0].x,e),t.lineTo(k[0].x,k[0].y);for(let e=1;e<u;e++){let n=s-Math.floor(s),r=e===u-1&&e===Math.ceil(s)&&n>0,i=r?k[e-1].x+(k[e].x-k[e-1].x)*n:k[e].x,a=r?k[e-1].y+(k[e].y-k[e-1].y)*n:k[e].y;t.lineTo(i,a)}t.lineTo(k[u-1].x,e),t.closePath(),t.fillStyle=A,t.fill()}t.beginPath();for(let e=0;e<u;e++){let n=s-Math.floor(s),r=e===u-1&&e>0&&e===Math.ceil(s)&&n>0,i=r?k[e-1].x+(k[e].x-k[e-1].x)*n:k[e].x,a=r?k[e-1].y+(k[e].y-k[e-1].y)*n:k[e].y;e===0?t.moveTo(i,a):t.lineTo(i,a)}t.strokeStyle=l(i.blue,.85),t.lineWidth=2,t.stroke(),t.fillStyle=l(i.blue,.8),t.beginPath();for(let e=0;e<u;e++)t.moveTo(k[e].x+3.5,k[e].y),t.arc(k[e].x,k[e].y,3.5,0,mt);if(t.fill(),u>j){b.current=[];for(let e=0;e<u;e++)y(b.current,`pt-${e}`,k[e].x,k[e].y,10,{label:k[e].point.week,value:String(k[e].point.count),color:i.blue});j=u}a&&N(w),a||(M=requestAnimationFrame(P))};return P(),()=>cancelAnimationFrame(M)},[u,h,d,b]),u.length<2?(0,n.jsx)(F,{width:ct,height:J,"data-testid":r}):(0,n.jsxs)(`div`,{"data-testid":r,style:{position:`relative`,width:`100%`,display:`flex`},children:[(0,n.jsx)(`canvas`,{ref:s,"aria-hidden":`true`,style:{width:lt,height:J,display:`block`,flexShrink:0}}),(0,n.jsx)(`div`,{className:`trend-scroll`,style:{flex:1,minWidth:0,overflowX:`auto`},children:(0,n.jsxs)(`div`,{style:{position:`relative`,width:h,height:J},children:[(0,n.jsx)(`canvas`,{ref:a,role:`img`,"aria-label":`Trend chart — count over time`,style:{width:h,height:J,display:`block`}}),(0,n.jsx)(_,{...g,parentW:h,parentH:J})]})})]})}var yt=680,bt=240,xt=28,St=156;function Ct(e,t,n){if(e.measureText(t).width<=n)return t;let r=t;for(;r.length>0&&e.measureText(`${r}…`).width>n;)r=r.slice(0,-1);return`${r}…`}var wt={Critical:i.red,High:i.orange,Medium:i.amber,Low:i.green};function Tt({severities:e=[],"data-testid":r}){let a=(0,t.useRef)(null),c=(0,t.useRef)(new Map),u=(0,t.useRef)(0),d=(0,t.useMemo)(()=>e.filter(e=>typeof e==`object`&&!!e),[e]),m=d.length>0?Math.min(yt,2*xt+d.length*St):yt,{hoveredRef:h,tooltip:g,hitZonesRef:y}=v(a,{width:m,height:bt});return(0,t.useEffect)(()=>{let e=a.current;if(!e)return;let t=f(e,m,bt);u.current=0;let n=d.reduce((e,t)=>e+(t.count??0),0),r=xt,g=xt,_=m-r-g,v=bt-50-52,x=d.map(e=>(e.count??0)/(n||1)*_),C,w=()=>{u.current++;let e=u.current;t.clearRect(0,0,m,bt),t.letterSpacing=o.letterSpacing;let a=S(Math.min(e/60,1));D(c.current,h.current),y.current=[],t.strokeStyle=l(i.bd,.2),t.lineWidth=1,t.beginPath(),t.rect(r,50,_,v),t.stroke(),t.strokeStyle=l(i.t2,.15),t.lineWidth=1,t.setLineDash([4,4]),t.beginPath(),t.moveTo(m/2,50),t.lineTo(m/2,50+v),t.stroke(),t.setLineDash([]);let f=r;d.forEach((e,r)=>{let u=wt[e.severity]??i.blue,d=x[r],m=c.current.get(e.severity)??0,h=f+d/2,g=d*.85,_=d*a,S=g*a,C=h-S/2;if(_>0&&(m>0&&p(t,f+_/2,50+v/2,_*.4,u,.15*m),t.beginPath(),t.moveTo(C,50),t.lineTo(C+S,50),t.lineTo(f+_,50+v),t.lineTo(f,50+v),t.closePath(),t.fillStyle=l(u,.45+m*.25),t.fill(),t.strokeStyle=l(u,(.5+m*.3)*a),t.lineWidth=m>0?2:1,t.beginPath(),t.moveTo(C,50),t.lineTo(C+S,50),t.stroke(),t.strokeStyle=l(u,(.3+m*.3)*a),t.lineWidth=m>0?2:1,t.beginPath(),t.moveTo(f,50+v),t.lineTo(f+_,50+v),t.stroke()),b(y.current,e.severity,f,50,d,v,{label:e.severity,value:U(e.count??0),sublabel:`${Math.round((e.count??0)/(n||1)*100)}%`,color:u}),a>.5){let r=Math.min(1,(a-.5)/.5),c=f+d/2;t.globalAlpha=r,t.font=o.font,t.fillStyle=m>0?u:l(u,.9),t.textAlign=`center`,t.fillText(Ct(t,e.severity,d-12),c,38),t.font=s.font,t.fillStyle=m>0?i.t1:l(i.t1,.85),t.fillText(U(e.count??0),c,50+v/2+6),t.font=o.font,t.fillStyle=m>0?u:o.color,t.fillText(`${Math.round((e.count??0)/(n||1)*100)}%`,c,50+v+18),t.globalAlpha=1}f+=d});let g=t.createLinearGradient(r,0,r+_,0);g.addColorStop(0,l(i.red,.03)),g.addColorStop(.33,l(i.orange,.03)),g.addColorStop(.66,l(i.amber,.03)),g.addColorStop(1,l(i.green,.03)),t.fillStyle=g,t.fillRect(r,50,_*a,v),C=requestAnimationFrame(w)};return w(),()=>cancelAnimationFrame(C)},[d,m]),d.length===0?(0,n.jsx)(F,{width:m,height:bt,"data-testid":r}):(0,n.jsxs)(`div`,{"data-testid":r,style:{position:`relative`,width:m,height:bt},children:[(0,n.jsx)(`canvas`,{ref:a,role:`img`,"aria-label":`Early Warning severity distribution — prism spectrum bands`,style:{width:m,height:bt,display:`block`}}),(0,n.jsx)(_,{...g,parentW:m,parentH:bt})]})}var Y=300,X=280,Et=100,Dt={Open:i.red,Submitted:i.amber,Closed:i.green};function Ot({segments:e=[],title:r,unitLabel:a=``,"data-testid":c}){let u=(0,t.useRef)(null),d=(0,t.useRef)(0),g=(0,t.useRef)(new Map),{hoveredRef:b,tooltip:x,hitZonesRef:S}=v(u,{width:Y,height:X}),C=(0,t.useMemo)(()=>e.filter(e=>typeof e==`object`&&!!e),[e]);return(0,t.useEffect)(()=>{let e=u.current;if(!e)return;let t=f(e,Y,X);d.current=0;let n=Y*.5,c=X*.56,_=Et,v=C.reduce((e,t)=>e+(t.count??0),0),x=Math.max(...C.map(e=>e.count??0),1),w,T=()=>{d.current++;let e=d.current;t.clearRect(0,0,Y,X),t.letterSpacing=o.letterSpacing,S.current=[],g.current.forEach((e,t)=>{let n=t===b.current?1:0,r=e+(n-e)*.12;Math.abs(r-n)<.005?n===0?g.current.delete(t):g.current.set(t,1):g.current.set(t,r)}),b.current&&!g.current.has(b.current)&&g.current.set(b.current,0),m(t,Y,X,e,40,l(i.blue,.04)),C.forEach((r,a)=>{let o=a/3*Math.PI*2-Math.PI/2,u=n+Math.cos(o)*_,d=c+Math.sin(o)*_,f=Dt[r.status]??i.blue,m=2+r.count/x*8;t.beginPath(),t.moveTo(n,c),t.lineTo(u,d),t.strokeStyle=l(f,.08),t.lineWidth=m*2,t.stroke(),t.beginPath(),t.moveTo(n,c),t.lineTo(u,d),t.strokeStyle=l(f,.25),t.lineWidth=1,t.stroke();let h=(e*.005+a*.33)%1,g=n+(u-n)*h,v=c+(d-c)*h;p(t,g,v,6,f,.4),t.beginPath(),t.arc(g,v,2,0,Math.PI*2),t.fillStyle=l(f,.8),t.fill();let y=(n+u)/2,b=(c+d)/2;t.font=s.font,t.textAlign=`center`,t.textBaseline=`middle`,t.fillStyle=l(f,.85),t.fillText(String(r.count),y,b)}),C.forEach((e,r)=>{let s=r/3*Math.PI*2-Math.PI/2,u=n+Math.cos(s)*_,d=c+Math.sin(s)*_,f=Dt[e.status]??i.blue,m=10+e.count/x*18,h=g.current.get(e.status)??0;p(t,u,d,m*2.5,f,.2+h*.15);let b=t.createRadialGradient(u,d-m*.2,0,u,d,m);b.addColorStop(0,l(f,.8+h*.2)),b.addColorStop(1,l(f,.4+h*.1)),t.beginPath(),t.arc(u,d,m,0,Math.PI*2),t.fillStyle=b,t.fill(),t.font=`bold `+o.font,t.textAlign=`center`,t.textBaseline=`middle`,t.fillStyle=l(i.t1,.9),t.fillText(e.status,u,d),y(S.current,e.status,u,d,m+6,{label:e.status,value:a?`${e.count} ${a}`:String(e.count),sublabel:`${Math.round((e.count??0)/(v||1)*100)}%`,color:f})});let u=g.current.get(`center`)??0;p(t,n,c,36,i.t2,.2+u*.15);let f=t.createRadialGradient(n,c-4,0,n,c,22);f.addColorStop(0,l(i.t2,.9)),f.addColorStop(1,l(i.t2,.5)),t.beginPath(),t.arc(n,c,22,0,Math.PI*2),t.fillStyle=f,t.fill(),t.font=s.font,t.textAlign=`center`,t.textBaseline=`middle`,t.fillStyle=l(i.t1,.9),t.fillText(r??``,n,c-4),t.font=`bold `+o.font,t.fillStyle=i.t1,t.fillText(String(v),n,c+8),y(S.current,`center`,n,c,28,{label:r??`Total`,value:a?`${v} ${a}`:String(v),color:i.t2}),h(t,Y,X,e,.015),w=requestAnimationFrame(T)};return T(),()=>cancelAnimationFrame(w)},[C,r,a]),C.length===0?(0,n.jsx)(F,{width:Y,height:X,"data-testid":c}):(0,n.jsxs)(`div`,{"data-testid":c,style:{position:`relative`,width:Y,height:X},children:[(0,n.jsx)(`canvas`,{ref:u,role:`img`,"aria-label":r??`EW status arc visualization`,style:{width:Y,height:X,display:`block`,borderRadius:8}}),(0,n.jsx)(_,{...x,parentW:Y,parentH:X})]})}var kt=280,Z=96;function At({points:e=[],className:a,colors:o}){let s=(0,t.useRef)(null),c=(0,t.useRef)(new Map),u=(0,t.useRef)(0),d=(0,t.useMemo)(()=>e.filter(Array.isArray).map(([e,t])=>{let n=String(t).match(/-?\d+(\.\d+)?/);return{label:e,value:n?Number(n[0]):0}}),[e]),{mouseRef:m,hoveredRef:h,tooltip:b,hitZonesRef:x}=v(s,{width:kt,height:Z});return(0,t.useEffect)(()=>{let e=s.current;if(!e)return;let t=f(e,kt,Z);u.current=0;let n=o?.line??i.blue,r=o?.point??i.blue,a=o?.axisLine??i.bd,_,v=()=>{u.current++;let e=u.current;if(t.clearRect(0,0,kt,Z),d.length<2){_=requestAnimationFrame(v);return}let o={left:12,right:12,top:16,bottom:20},s=kt-o.left-o.right,f=Z-o.top-o.bottom,b=d.map(e=>e.value),S=Math.min(...b),C=Math.max(...b)-S||1,w=e=>o.left+e/(d.length-1)*s,E=e=>o.top+(1-(e-S)/C)*f,O=1-(1-Math.min(e/48,1))**3,k=Math.max(2,Math.floor(O*d.length));if(D(c.current,h.current),x.current=[],t.strokeStyle=l(a,.3),t.lineWidth=.5,t.setLineDash([]),t.beginPath(),t.moveTo(o.left,Z-o.bottom),t.lineTo(kt-o.right,Z-o.bottom),t.stroke(),t.font=`9px 'JetBrains Mono', monospace`,t.fillStyle=l(i.t4,.9),t.textAlign=`center`,d.forEach((e,n)=>{t.fillText(e.label.replace(`Day `,`D`),w(n),Z-4)}),m.current.over&&h.current){let e=parseInt(h.current.split(`-`)[1]);isNaN(e)||g(t,w(e),o.top,o.top+f)}if(k>1){let e=t.createLinearGradient(0,o.top,0,o.top+f);e.addColorStop(0,l(n,.15)),e.addColorStop(1,l(n,0)),t.fillStyle=e,t.beginPath(),t.moveTo(w(0),o.top+f);for(let e=0;e<k;e++)t.lineTo(w(e),E(d[e].value));t.lineTo(w(k-1),o.top+f),t.closePath(),t.fill(),t.strokeStyle=l(n,.8),t.lineWidth=1.5,t.setLineDash([]),t.beginPath();for(let e=0;e<k;e++){let n=w(e),r=E(d[e].value);e===0?t.moveTo(n,r):t.lineTo(n,r)}t.stroke()}for(let e=0;e<k;e++){let n=w(e),a=E(d[e].value),o=`tp-${e}`,s=c.current.get(o)??0,u=e===d.length-1;y(x.current,o,n,a,10,{label:d[e].label,value:String(d[e].value),color:u?i.red:r}),s>0&&!u&&(p(t,n,a,12*s,r,.2*s),t.fillStyle=l(r,.8),t.beginPath(),t.arc(n,a,3+s*2,0,Math.PI*2),t.fill())}if(k>=d.length){let n=d.length-1,r=w(n),a=E(d[n].value),o=c.current.get(`tp-${n}`)??0,s=T(e,.05,5e-4),u=1+o*.5;t.shadowColor=l(i.red,.5),t.shadowBlur=(8+s*4)*u,t.fillStyle=i.red,t.beginPath(),t.arc(r,a,(3.5+s*1.5)*u,0,Math.PI*2),t.fill(),t.shadowBlur=0}_=requestAnimationFrame(v)};return v(),()=>cancelAnimationFrame(_)},[d,o]),(0,n.jsx)(r,{className:[`canvas-trend-frame`,a].filter(Boolean).join(` `),children:(0,n.jsxs)(`div`,{style:{position:`relative`,width:kt,height:Z},children:[(0,n.jsx)(`canvas`,{ref:s,role:`img`,"aria-label":`trend chart`,style:{width:kt,height:Z,display:`block`,borderRadius:8}}),(0,n.jsx)(_,{...b,parentW:kt,parentH:Z})]})})}function jt(e,t,n){if(e.measureText(t).width<=n)return t;let r=t;for(;r.length>0&&e.measureText(r+`…`).width>n;)r=r.slice(0,-1);return r+`…`}var Mt=680,Nt=8,Pt=26,Ft=14,It=16,Lt=32;function Rt({items:e=[],"data-testid":r}){let a=(0,t.useRef)(null),u=(0,t.useRef)(new Map),d=(0,t.useRef)(0),[m,h]=(0,t.useState)(!1),g=(0,t.useMemo)(()=>e.filter(e=>typeof e==`object`&&!!e),[e]),y=(0,t.useMemo)(()=>m?g:g.slice(0,Nt),[g,m]),x=It+Lt+y.length*(Pt+Ft)-Ft,{hoveredRef:C,tooltip:w,hitZonesRef:T}=v(a,{width:Mt,height:x});return(0,t.useEffect)(()=>{let e=a.current;if(!e)return;let t=f(e,Mt,x);d.current=0;let n=It,r=Lt,m=Pt,h=Ft,g=Mt-150-28,_=Math.max(...y.map(e=>(e.implemented??0)+(e.unimplemented??0)),1),v=y.length*(m+h)-h,w=n+(x-n-r-v)/2,O,k=()=>{d.current++;let e=d.current;t.clearRect(0,0,Mt,x);let n=S(Math.min(e/60,1));D(u.current,C.current),T.current=[],y.forEach((e,r)=>{let a=E(n,r,y.length,S),c=w+r*(m+h),d=(e.implemented??0)+(e.unimplemented??0),f=(e.implemented??0)/_*g*a,v=(e.unimplemented??0)/_*g*a,x=`${e.id}-impl`,C=`${e.id}-un`,D=u.current.get(x)??0,O=u.current.get(C)??0;b(T.current,x,150,c,f||1,m,{label:e.name,value:U(e.implemented??0),sublabel:`${Math.round((e.implemented??0)/(d||1)*100)}%`,color:i.green}),b(T.current,C,150+f,c,v||1,m,{label:e.name,value:U(e.unimplemented??0),sublabel:`${Math.round((e.unimplemented??0)/(d||1)*100)}%`,color:i.amber}),t.font=o.font,t.fillStyle=i.t2,t.textAlign=`right`,t.fillText(jt(t,e.abbreviation??e.name??``,134),142,c+m/2+4),b(T.current,x,0,c,150,m,{label:e.name??e.abbreviation??``,value:`${U((e.implemented??0)+(e.unimplemented??0))} total variations`,sublabel:`Implemented: ${U(e.implemented??0)} · Pending: ${U(e.unimplemented??0)}`,color:i.green}),t.fillStyle=l(i.bd,.15),t.beginPath(),t.roundRect(150,c,d/_*g,m,4),t.fill(),f>0&&(D>0&&p(t,150+f/2,c+m/2,f*.3,i.green,.12*D),t.fillStyle=l(i.green,.6+D*.2),t.beginPath(),t.roundRect(150,c,f,m,[4,0,0,4]),t.fill(),f>28&&a>.5&&(t.font=s.font,t.fillStyle=D>0?i.green:i.t2,t.textAlign=`center`,t.fillText(U(e.implemented??0),150+f/2,c+m/2+4))),v>0&&(O>0&&p(t,150+f+v/2,c+m/2,v*.3,i.amber,.12*O),t.fillStyle=l(i.amber,.18+O*.18),t.strokeStyle=l(i.amber,.3+O*.3),t.lineWidth=1,t.beginPath(),t.roundRect(150+f,c,v,m,[0,4,4,0]),t.fill(),t.stroke(),v>28&&a>.5&&(t.font=s.font,t.fillStyle=O>0?i.amber:i.t2,t.textAlign=`center`,t.fillText(U(e.unimplemented??0),150+f+v/2,c+m/2+4))),f>0&&v>0&&(t.strokeStyle=l(i.bg,.7),t.lineWidth=2,t.beginPath(),t.moveTo(150+f,c),t.lineTo(150+f,c+m),t.stroke())});let r=w+v+24,a=150+g/2;t.font=c.font,t.textAlign=`right`,t.fillStyle=i.green,t.fillText(`■ Implemented`,a-10,r),t.textAlign=`left`,t.fillStyle=c.color,t.fillText(`■ Unimplemented`,a+10,r),O=requestAnimationFrame(k)};return k(),()=>cancelAnimationFrame(O)},[y,x]),g.length===0?(0,n.jsx)(F,{width:Mt,height:160,"data-testid":r}):(0,n.jsxs)(`div`,{"data-testid":r,style:{width:Mt},children:[(0,n.jsxs)(`div`,{style:{position:`relative`,width:Mt,height:x},children:[(0,n.jsx)(`canvas`,{ref:a,role:`img`,"aria-label":`Implemented vs unimplemented variations per contractor — split bar`,style:{width:Mt,height:x,display:`block`}}),(0,n.jsx)(_,{...w,parentW:Mt,parentH:x})]}),g.length>Nt&&(0,n.jsx)(`div`,{style:{marginTop:8},children:(0,n.jsx)(I,{expanded:m,onToggle:()=>h(e=>!e)})})]})}var zt=800,Bt=360;function Vt({items:e=[],"data-testid":r}){let c=(0,t.useRef)(null),u=(0,t.useRef)(new Map),d=(0,t.useRef)(0),{hoveredRef:m,tooltip:h,hitZonesRef:g}=v(c,{width:zt,height:Bt});return(0,t.useEffect)(()=>{let t=c.current;if(!t)return;let n=f(t,zt,Bt);d.current=0;let r=e.reduce((e,t)=>e+(t.base??0),0),h=e.reduce((e,t)=>e+(t.variation??0),0),_=e.reduce((e,t)=>e+(t.total??0),0),v=Bt-20-26,y=v-6*(e.length-1),S=20,C=e.map((e,t)=>{let n=Math.max(24,(e.total??0)/(_||1)*y),r={x:100-110/2,y:S,h:n,cy:S+n/2,c:e,color:a[t%a.length]};return S+=n+6,r}),w=y-14,T=Math.max(28,r/(_||1)*w),O=Math.max(18,h/(_||1)*w),k=20+(v-(T+O+14))/2,A={x:420-110/2,y:k,h:T,cy:k+T/2},j={x:420-110/2,y:k+T+14,h:O,cy:k+T+14+O/2},M={x:720-110/2,y:20,h:v,cy:20+v/2},N,P=()=>{d.current++;let t=d.current;n.clearRect(0,0,zt,Bt),n.letterSpacing=o.letterSpacing;let a=x(Math.min(t/80,1));if(D(u.current,m.current),g.current=[],e.forEach((t,i)=>{let o=C[i],s=E(a,i,e.length,x),c=u.current.get(t.id)??0;if(s<.01)return;let l=(t.base??0)/(t.total||1),d=(t.variation??0)/(t.total||1),f=o.h*l,p=o.h*d,m=o.y+f/2,g=o.y+f+p/2,_=Math.max(2,(t.base??0)/r*T),v=Math.max(2,(t.variation??0)/h*O),y=A.y+e.slice(0,i).reduce((e,t)=>e+(t.base??0)/r*T,0)+_/2,b=j.y+e.slice(0,i).reduce((e,t)=>e+(t.variation??0)/h*O,0)+v/2,S=c*.2+.18;Ht(n,o.x+110,m,420-110/2,y,_*s,o.color,S),Ht(n,o.x+110,g,420-110/2,b,v*s,o.color,S*.75)}),a>.3){let e=Math.min(1,(a-.3)/.7),t=M.y+r/_*v/2,o=M.y+v-h/_*v/2;Ht(n,475,A.cy,720-110/2,t,T*e,i.blue,.25*e),Ht(n,475,j.cy,720-110/2,o,O*e,i.amber,.22*e)}if([`Contractors`,`Components`,`Total`].forEach((e,t)=>{let r=[100,420,720][t];n.font=o.font,n.fillStyle=o.color,n.textAlign=`center`,n.fillText(e,r,Bt-8)}),e.forEach((t,r)=>{let s=C[r],c=E(a,r,e.length,x),d=u.current.get(t.id)??0;b(g.current,t.id,s.x,s.y,110,s.h,{label:t.name,value:t.totalLabel??String(t.total??0),sublabel:`${t.baseLabel??String(t.base??0)} + ${t.variationLabel??String(t.variation??0)}`,color:s.color}),d>0&&p(n,s.x+110/2,s.cy,110*.6,s.color,.12*d),n.fillStyle=l(s.color,(.3+d*.15)*c),n.strokeStyle=l(s.color,(.55+d*.25)*c),n.lineWidth=1,n.beginPath(),n.roundRect(s.x,s.y,110*c,s.h,4),n.fill(),n.stroke(),c>.6&&s.h>=24&&(n.globalAlpha=Math.min(1,(c-.6)/.4),n.font=o.font,n.fillStyle=d>0?s.color:l(i.t2,.9),n.textAlign=`center`,n.textBaseline=`middle`,n.fillText(t.abbreviation??t.name?.slice(0,6)??``,s.x+110/2,s.h>=36?s.cy-5:s.cy),s.h>=36&&(n.font=`400 12px 'Satoshi Variable', 'DM Sans', sans-serif`,n.fillStyle=l(i.t3,.8),n.fillText(t.totalLabel??String(t.total??0),s.x+110/2,s.cy+7)),n.globalAlpha=1,n.textBaseline=`alphabetic`)}),a>.2){let e=Math.min(1,(a-.2)/.4);p(n,420,A.cy,30,i.blue,.1*e),n.fillStyle=l(i.blue,.3*e),n.strokeStyle=l(i.blue,.5*e),n.lineWidth=1,n.beginPath(),n.roundRect(A.x,A.y,110,A.h*e,4),n.fill(),n.stroke(),n.globalAlpha=e,n.textBaseline=`middle`,n.font=o.font,n.fillStyle=i.blue,n.textAlign=`center`,n.fillText(`Base Value`,420,A.cy-6),n.font=s.font,n.fillStyle=s.color,n.fillText(U(r),420,A.cy+8),n.globalAlpha=1,n.textBaseline=`alphabetic`,p(n,420,j.cy,24,i.amber,.1*e),n.fillStyle=l(i.amber,.22*e),n.strokeStyle=l(i.amber,.4*e),n.beginPath(),n.roundRect(j.x,j.y,110,j.h*e,4),n.fill(),n.stroke(),n.globalAlpha=e,n.textBaseline=`middle`,n.font=o.font,n.fillStyle=i.amber,n.textAlign=`center`,n.fillText(`Variations`,420,j.cy-4),n.font=s.font,n.fillStyle=s.color,n.fillText(U(h),420,j.cy+8),n.globalAlpha=1,n.textBaseline=`alphabetic`}if(a>.5){let e=Math.min(1,(a-.5)/.5);p(n,720,M.cy,44,i.blue,.2*e),n.fillStyle=l(i.blue,.25*e),n.strokeStyle=l(i.blue,.6*e),n.lineWidth=1.5,n.beginPath(),n.roundRect(M.x,M.y,110,M.h*e,6),n.fill(),n.stroke(),n.globalAlpha=e,n.textBaseline=`middle`,n.font=o.font,n.fillStyle=i.t2,n.textAlign=`center`,n.fillText(`Total Commitment`,720,M.cy-12),n.font=s.font,n.fillStyle=i.blue,n.fillText(U(_),720,M.cy+6),n.globalAlpha=1,n.textBaseline=`alphabetic`}N=requestAnimationFrame(P)};return P(),()=>cancelAnimationFrame(N)},[e]),(0,n.jsxs)(`div`,{"data-testid":r,style:{position:`relative`,width:zt,height:Bt},children:[(0,n.jsx)(`canvas`,{ref:c,role:`img`,"aria-label":`Weekly report flow — base value and variations per contractor flowing to total commitment`,style:{width:zt,height:Bt,display:`block`}}),(0,n.jsx)(_,{...h,parentW:zt,parentH:Bt})]})}function Ht(e,t,n,r,i,a,o,s){let c=(t+r)/2;e.beginPath(),e.moveTo(t,n-a/2),e.bezierCurveTo(c,n-a/2,c,i-a/2,r,i-a/2),e.lineTo(r,i+a/2),e.bezierCurveTo(c,i+a/2,c,n+a/2,t,n+a/2),e.closePath(),e.fillStyle=l(o,s),e.fill()}function Ut({config:e,className:t}){return e.type===`line`?(0,n.jsx)(Ne,{rows:e.rows,className:t}):e.type===`area`?(0,n.jsx)(j,{rows:e.rows,className:t}):e.type===`bar`?(0,n.jsx)(P,{rows:e.rows,className:t}):e.type===`pie`?(0,n.jsx)(Ge,{rows:e.rows,variant:`pie`,className:t}):e.type===`donut`?(0,n.jsx)(Ge,{rows:e.rows,variant:`donut`,className:t}):e.type===`sankey`?(0,n.jsx)(nt,{rows:e.rows,className:t}):e.type===`flow`?(0,n.jsx)(tt,{selectedEntity:e.selectedEntity,className:t}):e.type===`trend`?(0,n.jsx)(At,{points:e.points,className:t}):e.type===`mini-bars`?(0,n.jsx)(Ie,{rows:e.rows,className:t}):e.type===`stacked-horizontal-bar-chart`?(0,n.jsx)(we,{data:e.data}):e.type===`multi-metric-constellation-chart`?(0,n.jsx)(ge,{items:e.items}):e.type===`progress-race-chart`?(0,n.jsx)(oe,{items:e.items}):e.type===`hub-and-spoke-radial-chart`?(0,n.jsx)(Ot,{segments:e.segments,title:e.title,unitLabel:e.unitLabel}):e.type===`dot-matrix-chart`?(0,n.jsx)(Me,{items:e.items}):e.type===`ranked-card-leaderboard`?(0,n.jsx)(je,{items:e.items}):e.type===`proportional-band-chart`?(0,n.jsx)(Tt,{severities:e.severities}):e.type===`radial-fan-tree-chart`?(0,n.jsx)(Ve,{total:e.total,totalLabel:e.totalLabel,items:e.items}):e.type===`semi-circular-gauge-chart`?(0,n.jsx)(le,{confirmed:e.confirmed,total:e.total,label:e.label}):e.type===`segmented-split-bar-chart`?(0,n.jsx)(Rt,{items:e.items}):e.type===`balance-scale-chart`?(0,n.jsx)(at,{left:e.left,right:e.right}):e.type===`area-line-chart`?(0,n.jsx)(st,{points:e.points}):e.type===`trend-view`?(0,n.jsx)(vt,{points:e.points}):e.type===`weekly-flow`?(0,n.jsx)(Vt,{items:e.items}):(0,n.jsx)(`div`,{className:`viz-empty`,children:`Visualization unavailable`})}var Wt=[];function Gt(e){try{return JSON.parse(decodeURIComponent(e))}catch{return null}}function Kt(){for(;Wt.length;){let e=Wt.pop();e&&e.unmount()}}function qt(){Kt(),document.querySelectorAll(`[data-d3-viz]`).forEach(t=>{let r=t.dataset.d3Viz;if(!r)return;let i=Gt(r);if(!i)return;let a=(0,e.createRoot)(t);Wt.push(a),a.render((0,n.jsx)(Ut,{config:i}))})}function Jt(e){return encodeURIComponent(JSON.stringify(e))}function Yt({rows:e=[],className:t,colors:r}){return(0,n.jsx)(Ge,{rows:e,variant:`donut`,className:t,colors:r})}var Q={bg:`transparent`,border:`transparent`,t1:i.t1,t2:i.t2,t3:i.t3,t4:i.t4,red:i.red,amber:i.amber,green:i.green},$=`'Satoshi Variable', 'DM Sans', sans-serif`,Xt={color:`#F7F7F7`,fontFamily:$,fontSize:24,fontWeight:500,lineHeight:`32px`},Zt={color:`#C2C2C2`,fontFamily:$,fontSize:18,fontWeight:400,lineHeight:`20px`};function Qt({items:e=[]}){let t=e.filter(e=>e.value);return t.length===0?null:(0,n.jsx)(`div`,{style:{display:`flex`,gap:8},children:t.map((e,t)=>(0,n.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`flex-start`,width:260,height:120,padding:`10px 0`,gap:8,flexShrink:0,rowGap:16,border:`1px solid ${Q.border}`,background:Q.bg,boxSizing:`border-box`},children:[(0,n.jsx)(`div`,{style:{...Xt,color:Q.t1},children:e.value}),(0,n.jsx)(`div`,{style:{...Zt},children:e.label})]},t))})}function $t({items:e=[]}){let t=e.filter(e=>e.name??e.value);return t.length===0?null:(0,n.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:5},children:t.map((e,t)=>(0,n.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,padding:`10px 0px`,background:Q.bg,border:`1px solid ${Q.border}`},children:[(0,n.jsx)(`span`,{style:{fontSize:18,fontWeight:500,color:Q.t2,background:`transparent`,padding:`2px 8px`,borderRadius:4,fontFamily:$,flexShrink:0},children:e.name}),(0,n.jsx)(`span`,{style:{...Xt,fontSize:18,color:Q.t1,minWidth:70,flexShrink:0},children:e.value}),(0,n.jsx)(`span`,{style:{...Zt,flex:1},children:e.kpiLabel})]},t))})}function en({items:e=[]}){let t=e.filter(e=>e.value);return t.length===0?null:(0,n.jsx)(`div`,{style:{display:`flex`,gap:8},children:t.map((e,t)=>(0,n.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`flex-start`,width:260,height:120,padding:`10px 0`,gap:8,flexShrink:0,background:Q.bg,boxSizing:`border-box`},children:[(0,n.jsx)(`div`,{style:{...Xt,color:Q.t1},children:e.value}),(0,n.jsx)(`div`,{style:{...Zt},children:e.label})]},t))})}var tn={red:Q.red,amber:Q.amber,green:Q.green};function nn({items:e=[]}){let t=e.filter(e=>e.text);return t.length===0?null:(0,n.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:5},children:t.map((e,t)=>(tn[e.severity],(0,n.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-start`,gap:10,padding:`10px 0px`,background:Q.bg,border:`1px solid ${Q.border}`},children:[(0,n.jsx)(`span`,{style:{width:7,height:7,borderRadius:`50%`,background:i.t2,flexShrink:0,marginTop:5}}),(0,n.jsx)(`span`,{style:{...Zt},children:e.text})]},t)))})}function rn({min:e,max:t,unit:r,dots:a=[],chips:o=[]}){let s=a.filter(e=>e.name);if(s.length===0)return null;let c=t-e;return(0,n.jsxs)(`div`,{children:[(0,n.jsxs)(`div`,{style:{position:`relative`,height:90,padding:`10px 0px`},children:[(0,n.jsx)(`div`,{style:{position:`absolute`,top:38,left:8,right:8,height:2,background:`rgba(255,255,255,0.08)`,borderRadius:1}}),(0,n.jsxs)(`div`,{style:{position:`absolute`,top:43,left:0,fontSize:16,color:Q.t4,fontFamily:$},children:[e,r]}),(0,n.jsxs)(`div`,{style:{position:`absolute`,top:43,right:0,fontSize:16,color:Q.t4,fontFamily:$},children:[t,r]}),s.map((t,a)=>{let o=(t.val-e)/c*100,s=t.color??i.blue,l=a%2==0;return(0,n.jsxs)(`div`,{style:{position:`absolute`,left:`${o}%`,top:0,transform:`translateX(-50%)`},children:[l&&(0,n.jsxs)(`div`,{style:{textAlign:`center`,marginBottom:2},children:[(0,n.jsx)(`div`,{style:{fontSize:18,color:s,fontFamily:$,whiteSpace:`nowrap`},children:t.name}),(0,n.jsxs)(`div`,{style:{fontSize:18,fontWeight:500,color:s,fontFamily:$,whiteSpace:`nowrap`},children:[t.val,r]})]}),(0,n.jsx)(`div`,{style:{width:10,height:10,borderRadius:`50%`,background:s,boxShadow:`0 0 8px ${s}70`,margin:l?`0 auto`:`26px auto 0`}}),!l&&(0,n.jsxs)(`div`,{style:{textAlign:`center`,marginTop:4},children:[(0,n.jsx)(`div`,{style:{fontSize:18,color:s,fontFamily:$,whiteSpace:`nowrap`},children:t.name}),(0,n.jsxs)(`div`,{style:{fontSize:18,fontWeight:500,color:s,fontFamily:$,whiteSpace:`nowrap`},children:[t.val,r]})]})]},a)})]}),o&&o.length>0&&(0,n.jsx)(en,{items:o})]})}function an({leftPct:e,leftLabel:t,leftValue:r,leftColor:a,rightPct:o,rightLabel:s,rightValue:c,rightColor:l,chips:u}){if(!t&&!s)return null;let d=a??i.blue,f=l??i.blue;return(0,n.jsxs)(`div`,{children:[(0,n.jsxs)(`div`,{style:{display:`flex`,borderRadius:6,overflow:`hidden`,height:36,margin:`10px 0`},children:[(0,n.jsx)(`div`,{style:{width:`${e}%`,background:d+`38`,display:`flex`,alignItems:`center`,justifyContent:`flex-end`,paddingRight:12},children:(0,n.jsx)(`span`,{style:{fontSize:18,fontWeight:500,color:Q.t2,fontFamily:$},children:r})}),(0,n.jsx)(`div`,{style:{width:1,background:`rgba(255,255,255,0.12)`,flexShrink:0}}),(0,n.jsx)(`div`,{style:{width:`${o}%`,background:f+`2A`,display:`flex`,alignItems:`center`,paddingLeft:12},children:(0,n.jsx)(`span`,{style:{fontSize:18,fontWeight:500,color:Q.t2,fontFamily:$},children:c})})]}),(0,n.jsxs)(`div`,{style:{display:`flex`,marginBottom:u?4:0},children:[(0,n.jsx)(`div`,{style:{width:`${e}%`},children:(0,n.jsxs)(`span`,{style:{fontSize:18,color:d,fontFamily:$},children:[e,`% `,t]})}),(0,n.jsx)(`div`,{style:{width:`${o}%`,paddingLeft:10},children:(0,n.jsxs)(`span`,{style:{fontSize:18,color:f,fontFamily:$},children:[o,`% `,s]})})]}),u&&u.length>0&&(0,n.jsx)(en,{items:u})]})}function on({pct:e,label:t,color:r,chips:a}){if(e==null&&!t)return null;let o=r??i.blue,s=2*Math.PI*30,c=s*(1-e/100);return(0,n.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:20},children:[(0,n.jsxs)(`div`,{style:{position:`relative`,flexShrink:0,width:80,height:80},children:[(0,n.jsxs)(`svg`,{width:80,height:80,style:{transform:`rotate(-90deg)`},children:[(0,n.jsx)(`circle`,{cx:40,cy:40,r:30,fill:`none`,stroke:`rgba(255,255,255,0.07)`,strokeWidth:8}),(0,n.jsx)(`circle`,{cx:40,cy:40,r:30,fill:`none`,stroke:o,strokeWidth:8,strokeDasharray:s,strokeDashoffset:c,strokeLinecap:`round`})]}),(0,n.jsx)(`div`,{style:{position:`absolute`,top:`50%`,left:`50%`,transform:`translate(-50%, -50%)`,textAlign:`center`},children:(0,n.jsxs)(`div`,{style:{fontSize:18,fontWeight:500,color:o,fontFamily:$},children:[e,`%`]})})]}),(0,n.jsxs)(`div`,{style:{flex:1},children:[(0,n.jsx)(`div`,{style:{...Zt,padding:`10px 0px`},children:t}),a&&(0,n.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:5},children:a.map((e,t)=>(0,n.jsxs)(`div`,{style:{display:`flex`,alignItems:`baseline`,gap:8,padding:`10px 10px`,background:Q.bg,border:`1px solid ${Q.border}`,borderRadius:5},children:[(0,n.jsx)(`span`,{style:{...Xt,color:Q.t2},children:e.value}),(0,n.jsx)(`span`,{style:{...Xt,color:Q.t2,fontWeight:400,userSelect:`none`},children:`|`}),(0,n.jsx)(`span`,{style:{...Zt},children:e.label})]},t))})]})]})}function sn({items:e=[]}){let t=e.filter(e=>e.name??e.value);return t.length===0?null:(0,n.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:5},children:t.map((e,t)=>(0,n.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,padding:`10px 0px`,background:Q.bg,border:`1px solid ${Q.border}`},children:[(0,n.jsx)(`span`,{style:{fontSize:18,fontWeight:500,color:Q.t2,background:`transparent`,padding:`2px 7px`,borderRadius:4,fontFamily:$,flexShrink:0,minWidth:62,textAlign:`center`},children:e.name}),(0,n.jsx)(`div`,{style:{flex:1,height:4,background:`rgba(255,255,255,0.07)`,borderRadius:2,overflow:`hidden`},children:(0,n.jsx)(`div`,{style:{height:`100%`,width:`${e.pct}%`,background:e.color??Q.t2,borderRadius:2,opacity:.75}})}),(0,n.jsx)(`span`,{style:{fontSize:18,fontWeight:400,color:Q.t2,fontFamily:$,flexShrink:0,minWidth:52,textAlign:`right`},children:e.value}),e.badge&&(0,n.jsx)(`span`,{style:{fontSize:18,fontWeight:500,color:Q.t1,background:`transparent`,padding:`2px 7px`,borderRadius:4,fontFamily:$,flexShrink:0,minWidth:72,textAlign:`center`},children:e.badge}),e.sublabel&&(0,n.jsx)(`span`,{style:{...Zt,flexShrink:0,minWidth:80,textAlign:`right`},children:e.sublabel})]},t))})}var cn={red:Q.red,amber:Q.amber,green:Q.green};function ln({items:e=[]}){let t=e.filter(e=>e.text);return t.length===0?null:(0,n.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:5},children:t.map((e,t)=>{let r=cn[e.severity];return(0,n.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-start`,gap:10,padding:`9px 12px`,background:`transparent`},children:[(0,n.jsx)(`span`,{style:{fontSize:18,fontWeight:500,color:r,background:r+`20`,padding:`2px 7px`,borderRadius:4,fontFamily:$,flexShrink:0},children:e.tag}),(0,n.jsx)(`span`,{style:{flex:1,...Zt},children:e.text}),(0,n.jsx)(`span`,{style:{...Zt,flexShrink:0,marginTop:1},children:e.date})]},t)})})}function un({columns:e=[],rows:t=[]}){return t.length===0?null:(0,n.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:5},children:[(0,n.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,padding:`0 0px 6px`,borderBottom:`1px solid ${Q.border}`},children:[(0,n.jsx)(`div`,{style:{minWidth:64}}),e.map((e,t)=>(0,n.jsx)(`div`,{style:{flex:1,fontSize:18,fontWeight:500,color:Q.t2,fontFamily:$,textTransform:`uppercase`,letterSpacing:.6},children:e},t))]}),t.map((e,t)=>(0,n.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,padding:`8px 0px`,background:Q.bg,border:`1px solid ${Q.border}`},children:[(0,n.jsx)(`span`,{style:{fontSize:18,fontWeight:500,color:Q.t1,background:`transparent`,padding:`2px 8px`,borderRadius:4,fontFamily:$,flexShrink:0,minWidth:64,textAlign:`center`},children:e.label}),e.cells.map((e,t)=>(0,n.jsx)(`span`,{style:{flex:1,fontSize:18,fontWeight:500,color:Q.t2,fontFamily:$},children:e},t))]},t))]})}function dn({block:e}){if(!e)return null;switch(e.type){case`stats`:return(0,n.jsx)(Qt,{items:e.items});case`ranked`:return(0,n.jsx)($t,{items:e.items});case`chips`:return(0,n.jsx)(en,{items:e.items});case`badges`:return(0,n.jsx)(nn,{items:e.items});case`dot-strip`:return(0,n.jsx)(rn,{min:e.min,max:e.max,unit:e.unit,dots:e.dots,chips:e.chips});case`proportion`:return(0,n.jsx)(an,{leftPct:e.leftPct,leftLabel:e.leftLabel,leftValue:e.leftValue,leftColor:e.leftColor,rightPct:e.rightPct,rightLabel:e.rightLabel,rightValue:e.rightValue,rightColor:e.rightColor,chips:e.chips});case`ring`:return(0,n.jsx)(on,{pct:e.pct,label:e.label,color:e.color,chips:e.chips});case`scorecard-rows`:return(0,n.jsx)(sn,{items:e.items});case`flags-list`:return(0,n.jsx)(ln,{items:e.items});case`comparison-rows`:return(0,n.jsx)(un,{columns:e.columns,rows:e.rows});default:return null}}var fn=`'Satoshi Variable', 'DM Sans', sans-serif`,pn={color:`#C2C2C2`,fontFamily:fn,fontSize:18,fontWeight:400,lineHeight:1.65};function mn({text:e}){return(0,n.jsxs)(`div`,{style:{padding:`8px 0px`,border:`transparent`,borderRadius:5,background:`transparent`},children:[(0,n.jsx)(`span`,{style:{fontSize:18,fontWeight:500,color:i.t1,fontFamily:fn,lineHeight:1.65,marginRight:8},children:`Takeaway`}),(0,n.jsx)(`span`,{style:{...pn},children:e})]})}exports.AreaChart=j,exports.BarChart=P,exports.ChartFrame=r,exports.DonutChart=Yt,exports.KeyHighlights=dn,exports.LineChart=Ne,exports.MiniBars=Ie,exports.PieChart=Ge,exports.ProcessSankey=tt,exports.RankingSankey=nt,exports.SankeySvg=qe,exports.SeriesChart=A,exports.Takeaway=mn,exports.Trend=vt,exports.TrendChart=At,exports.VisualizationRenderer=Ut,exports.cleanupVisualizationMounts=Kt,exports.hydrateVisualizationMounts=qt,exports.serializeVisualizationConfig=Jt;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require(`react-dom/client`),t=require(`react`),n=require(`react/jsx-runtime`);function r({children:e,className:t=``}){return(0,n.jsx)(`div`,{className:`d3-chart ${t}`.trim(),children:e})}var i={bg:`#0C0E12`,bgL:`#0C1420`,sf:`#13161B`,bd:`#22262F`,blue:`#4C93D9`,cyan:`#36BFFA`,orange:`#EC772A`,red:`#EC772A`,green:`#5DA537`,purple:`#818FF8`,amber:`#EEBF3B`,t1:`#F7F9FA`,t2:`#B3B5B6`,t3:`#94979C`,t4:`#334155`},a=[i.blue,i.amber,i.purple,i.green,i.red],o={font:`400 16px 'Satoshi Variable', 'DM Sans', sans-serif`,color:`#F7F7F7`,letterSpacing:`0px`},s={font:`500 16px 'Satoshi Variable', 'DM Sans', sans-serif`,color:`#F7F7F7`},c={font:`400 18px 'Satoshi Variable', 'DM Sans', sans-serif`,color:`#B3B5B6`,letterSpacing:`0px`};function l(e,t=1){let n=e.replace(`#`,``);return`rgba(${parseInt(n.substring(0,2),16)},${parseInt(n.substring(2,4),16)},${parseInt(n.substring(4,6),16)},${t})`}function u(e,t,n){return e+(t-e)*n}function d(e,t,n){let r=e=>{let t=e.replace(`#`,``);return[parseInt(t.substring(0,2),16),parseInt(t.substring(2,4),16),parseInt(t.substring(4,6),16)]},[i,a,o]=r(e),[s,c,l]=r(t),d=e=>Math.max(0,Math.min(255,Math.round(e)));return[d(u(i,s,n)),d(u(a,c,n)),d(u(o,l,n))].map(e=>e.toString(16).padStart(2,`0`)).join(``).replace(/^/,`#`)}function f(e,t,n,r=2){e.width=t*r,e.height=n*r;let i=e.getContext(`2d`);return i.scale(r,r),i}function p(e,t,n,r,i,a=.3){let o=e.createRadialGradient(t,n,0,t,n,r);o.addColorStop(0,l(i,a)),o.addColorStop(1,l(i,0)),e.fillStyle=o,e.beginPath(),e.arc(t,n,r,0,Math.PI*2),e.fill()}function m(e,t,n,r,a=50,o=l(i.blue,.05)){for(let i=0;i<a;i++)e.beginPath(),e.arc((Math.sin(r*.001+i*23)*.5+.5)*t,(Math.cos(r*8e-4+i*37)*.5+.5)*n,.6,0,Math.PI*2),e.fillStyle=o,e.fill()}function h(e,t,n,r,i=.015){e.fillStyle=`rgba(0,0,0,${i})`;let a=r*.5%6;for(let r=a;r<n;r+=3)e.fillRect(0,r,t,1)}function g(e,t,n,r,a=l(i.t1,.08)){e.strokeStyle=a,e.lineWidth=1,e.setLineDash([3,3]),e.beginPath(),e.moveTo(t,n),e.lineTo(t,r),e.stroke(),e.setLineDash([])}function _({visible:e,x:r,y:a,content:o,parentW:s,parentH:c}){let l=(0,t.useRef)(null);if((0,t.useLayoutEffect)(()=>{let t=l.current;if(!t)return;let n=t.offsetWidth,u=t.offsetHeight,d=s??400,f=c??800,p=r+14,m=a-u-14;p+n>d-4&&(p=r-n-14),m<4&&(m=a+14),p<4&&(p=4),m+u>f-4&&(m=f-u-4),t.style.transform=`translate(${p}px, ${m}px)`,t.style.opacity=e?`1`:`0`;let h=o&&typeof o==`object`&&o.color?o.color:i.blue;t.style.setProperty(`--tooltip-accent`,h??i.blue)},[e,r,a,s,o]),!o)return null;let u=typeof o==`object`,d=u?o.label:null,f=u?o.value:o,p=u?o.sublabel:null;return(0,n.jsxs)(`div`,{ref:l,style:{position:`absolute`,top:0,left:0,minWidth:80,pointerEvents:`none`,background:i.sf,border:`1px solid ${i.bd}`,borderLeft:`2px solid var(--tooltip-accent)`,borderRadius:6,padding:`8px 12px`,opacity:0,transition:`opacity 0.15s ease`,zIndex:20,fontFamily:`'Satoshi Variable', 'DM Sans', sans-serif`},children:[d&&(0,n.jsx)(`div`,{style:{fontSize:14,fontWeight:400,color:i.t2,marginBottom:3,whiteSpace:`nowrap`,lineHeight:`20px`},children:d}),f&&(0,n.jsx)(`div`,{style:{fontSize:16,fontWeight:500,color:i.t1,whiteSpace:`nowrap`,lineHeight:`22px`},children:f}),p&&(0,n.jsx)(`div`,{style:{fontSize:14,fontWeight:400,color:`var(--tooltip-accent)`,marginTop:3,whiteSpace:`nowrap`,lineHeight:`20px`},children:p})]})}function v(e,{width:n,height:r,onClick:i,enabled:a=!0}){let o=(0,t.useRef)({x:-1,y:-1,over:!1}),s=(0,t.useRef)(null),c=(0,t.useRef)([]),[l,u]=(0,t.useState)({visible:!1,x:0,y:0,content:null}),d=(0,t.useCallback)((e,t,n)=>{u({visible:!0,x:e,y:t,content:n})},[]),f=(0,t.useCallback)(()=>{u(e=>e.visible?{visible:!1,x:e.x,y:e.y,content:e.content}:e)},[]);return(0,t.useEffect)(()=>{let t=e.current;if(!t||!a)return;let l=e=>{let i=t.getBoundingClientRect(),a=n/i.width,l=r/i.height;o.current.x=(e.clientX-i.left)*a,o.current.y=(e.clientY-i.top)*l,o.current.over=!0;let u=null,p=c.current;for(let e=p.length-1;e>=0;e--)if(p[e].test(o.current.x,o.current.y)){u=p[e];break}let m=s.current;s.current=u?u.id:null,t.style.cursor=u?`pointer`:`default`,u?d((e.clientX-i.left)*a,(e.clientY-i.top)*l,u.data):m&&f()},u=()=>{o.current={x:-1,y:-1,over:!1},s.current&&(s.current=null,t.style.cursor=`default`,f())},p=()=>{if(s.current&&i){let e=c.current.find(e=>e.id===s.current);e&&i(e.id,e.data)}};return t.addEventListener(`mousemove`,l),t.addEventListener(`mouseleave`,u),t.addEventListener(`click`,p),()=>{t.removeEventListener(`mousemove`,l),t.removeEventListener(`mouseleave`,u),t.removeEventListener(`click`,p)}},[e,n,r,a,i,d,f]),{mouseRef:o,hoveredRef:s,tooltip:l,showTooltip:d,hideTooltip:f,hitZonesRef:c}}function y(e,t,n,r,i,a){e.push({id:t,data:a,test:(e,t)=>(e-n)**2+(t-r)**2<=i*i})}function b(e,t,n,r,i,a,o){e.push({id:t,data:o,test:(e,t)=>e>=n&&e<=n+i&&t>=r&&t<=r+a})}var x=e=>1-(1-e)**3,S=e=>1-(1-e)**4,C=e=>e===1?1:1-2**(-10*e),w=e=>{let t=1.70158;return 1+(t+1)*(e-1)**3+t*(e-1)**2},T=(e,t=.04,n=.001)=>Math.sin(e*t)*Math.exp(-Math.min(e*n,4)),E=(e,t,n,r=x)=>{let i=Math.min(.06,.5/n),a=t*i,o=1-(n-1)*i;return r(Math.max(0,Math.min((e-a)/o,1)))};function D(e,t,n=.12){e.forEach((r,i)=>{let a=i===t?1:0,o=r+(a-r)*n;Math.abs(o-a)<.005?a===0?e.delete(i):e.set(i,1):e.set(i,o)}),t&&!e.has(t)&&e.set(t,0)}var O=760,k=250;function A({rows:e=[],variant:a,className:o,colors:s}){let c=(0,t.useRef)(null),u=(0,t.useRef)(new Map),d=(0,t.useRef)(0),{mouseRef:m,hoveredRef:h,tooltip:b,hitZonesRef:x}=v(c,{width:O,height:k});return(0,t.useEffect)(()=>{let t=c.current;if(!t)return;let n=f(t,O,k);d.current=0;let r=s?.line??i.blue,o=s?.point??i.blue,_=s?.axisLine??i.bd,v=s?.areaFill??i.blue,b={top:24,right:24,bottom:44,left:24},S=O-b.left-b.right,w=k-b.top-b.bottom,E,A=()=>{d.current++;let t=d.current;if(n.clearRect(0,0,O,k),e.length<2){E=requestAnimationFrame(A);return}let s=e.map(e=>e.pricing??0),c=Math.max(100,...s),f=t=>b.left+t/(e.length-1)*S,j=e=>b.top+(1-e/c)*w,M=C(Math.min(t/48,1)),N=Math.max(2,Math.floor(M*e.length));D(u.current,h.current),x.current=[],n.strokeStyle=l(i.bd,.2),n.lineWidth=.5;for(let e=0;e<=4;e++){let t=b.top+e/4*w;n.beginPath(),n.moveTo(b.left,t),n.lineTo(b.left+S,t),n.stroke()}if(n.strokeStyle=l(_,.4),n.lineWidth=1,n.setLineDash([]),n.beginPath(),n.moveTo(b.left,j(0)),n.lineTo(b.left+S,j(0)),n.stroke(),m.current.over&&h.current){let e=parseInt(h.current.split(`-`)[1]);isNaN(e)||g(n,f(e),b.top,b.top+w)}if(a===`area`&&N>1){let t=n.createLinearGradient(0,b.top,0,b.top+w);t.addColorStop(0,l(v,.12)),t.addColorStop(1,l(v,0)),n.fillStyle=t,n.beginPath(),n.moveTo(f(0),b.top+w);for(let t=0;t<N;t++)n.lineTo(f(t),j(e[t].pricing??0));n.lineTo(f(N-1),b.top+w),n.closePath(),n.fill()}if(N>1){n.strokeStyle=l(r,.85),n.lineWidth=2,n.setLineDash([]),n.beginPath();for(let t=0;t<N;t++){let r=f(t),i=j(e[t].pricing??0);t===0?n.moveTo(r,i):n.lineTo(r,i)}n.stroke()}for(let r=0;r<N;r++){let s=f(r),c=j(e[r].pricing??0),d=`sc-${r}`,m=u.current.get(d)??0,h=r===e.length-1;y(x.current,d,s,c,12,{label:e[r].vendor,value:String(e[r].pricing??0),color:h?i.red:o}),m>0&&p(n,s,c,16*m,o,.2*m);let g=h?T(t,.05,5e-4):0,_=a===`area`?5:6;h?(n.shadowColor=l(i.red,.5),n.shadowBlur=(8+g*4)*(1+m*.5),n.fillStyle=i.red,n.beginPath(),n.arc(s,c,(_+g*1.5)*(1+m*.3),0,Math.PI*2),n.fill(),n.shadowBlur=0):(n.fillStyle=l(o,.7+m*.3),n.beginPath(),n.arc(s,c,_+m*2,0,Math.PI*2),n.fill()),n.font=`10px 'JetBrains Mono', monospace`,n.fillStyle=l(i.t3,.6+m*.3),n.textAlign=`center`,n.fillText(e[r].vendor,s,k-14)}E=requestAnimationFrame(A)};return A(),()=>cancelAnimationFrame(E)},[e,a,s]),(0,n.jsx)(r,{className:o,children:(0,n.jsxs)(`div`,{style:{position:`relative`,width:O,height:k},children:[(0,n.jsx)(`canvas`,{ref:c,role:`img`,"aria-label":`${a} chart`,style:{width:O,height:k,display:`block`,borderRadius:8}}),(0,n.jsx)(_,{...b,parentW:O,parentH:k})]})})}function j({rows:e=[],className:t,colors:r}){return(0,n.jsx)(A,{rows:e,variant:`area`,className:t,colors:r})}var M=760,N=280;function P({rows:e=[],className:o,colors:s}){let c=(0,t.useRef)(null),u=(0,t.useRef)(new Map),d=(0,t.useRef)(0),{hoveredRef:m,tooltip:h,hitZonesRef:g}=v(c,{width:M,height:N});return(0,t.useEffect)(()=>{let t=c.current;if(!t)return;let n=f(t,M,N);d.current=0;let r=s?.bars??a,o=s?.axisLine??i.bd,h=s?.valueLabel??i.t2,_={top:24,right:24,bottom:56,left:24},v=N-_.top-_.bottom,y=(M-_.left-_.right)/Math.max(e.length,1),x=Math.max(100,...e.map(e=>e.pricing??0)),C=_.top+v,w,T=()=>{d.current++;let t=d.current;n.clearRect(0,0,M,N);let a=S(Math.min(t/48,1));D(u.current,m.current),g.current=[],n.strokeStyle=l(o,.4),n.lineWidth=1,n.setLineDash([]),n.beginPath(),n.moveTo(_.left,C),n.lineTo(M-_.right,C),n.stroke(),e.forEach((t,o)=>{let s=_.left+o*y,c=E(a,o,e.length,S),d=x>0?(t.pricing??0)/x*v:0,f=Math.max(d>0?4:0,d*c),m=r[o%r.length],w=u.current.get(t.id??`bar-${o}`)??0;b(g.current,t.id??`bar-${o}`,s+4,C-f,y-8,f,{label:t.vendor,value:String(t.pricing??0),color:m}),f>0&&(w>0&&p(n,s+y/2,C-f/2,y*.8,m,.12*w),n.shadowColor=l(m,.2*(w>0?w:0)),n.shadowBlur=w>0?6:0,n.fillStyle=l(m,.5+w*.25),n.beginPath(),n.roundRect(s+4,C-f,y-8,f,[4,4,0,0]),n.fill(),n.shadowBlur=0,w>0&&(n.strokeStyle=l(m,.4*w),n.lineWidth=1,n.beginPath(),n.roundRect(s+4,C-f,y-8,f,[4,4,0,0]),n.stroke())),c>.5&&f>0&&(n.globalAlpha=Math.min(1,(c-.5)*2),n.font=`bold 10px 'JetBrains Mono', monospace`,n.fillStyle=w>0?m:l(h,.7),n.textAlign=`center`,n.fillText(String(t.pricing??``),s+y/2,C-f-6),n.globalAlpha=1),n.font=`${w>0?`bold `:``}9px 'JetBrains Mono', monospace`,n.fillStyle=w>0?m:l(i.t3,.6),n.textAlign=`center`,n.fillText(t.vendor,s+y/2,N-14)}),w=requestAnimationFrame(T)};return T(),()=>cancelAnimationFrame(w)},[e,s]),(0,n.jsx)(r,{className:o,children:(0,n.jsxs)(`div`,{style:{position:`relative`,width:M,height:N},children:[(0,n.jsx)(`canvas`,{ref:c,role:`img`,"aria-label":`bar chart`,style:{width:M,height:N,display:`block`,borderRadius:8}}),(0,n.jsx)(_,{...h,parentW:M,parentH:N})]})})}function F({width:e,height:t,message:r=`No data available`,"data-testid":i}){return(0,n.jsx)(`div`,{"data-testid":i,style:{width:e,height:t,display:`flex`,alignItems:`center`,justifyContent:`center`,borderRadius:8,background:`rgba(255,255,255,0.03)`,color:`rgba(255,255,255,0.35)`,fontSize:14,fontFamily:`'Satoshi Variable', 'DM Sans', sans-serif`},children:r})}function ee({expanded:e,onToggle:t,labelExpanded:r=`View Less`,labelCollapsed:i=`View More`,"data-testid":a}){return(0,n.jsxs)(`button`,{type:`button`,"data-testid":a,onClick:t,style:{display:`flex`,width:90,height:20,justifyContent:`center`,alignItems:`center`,gap:4,boxSizing:`border-box`,border:`none`,borderRadius:6,color:`#71B941`,fontSize:14,fontFamily:`'Satoshi Variable', 'DM Sans', sans-serif`,fontStyle:`normal`,fontWeight:400,lineHeight:`19.5px`,textAlign:`center`,cursor:`pointer`,userSelect:`none`},children:[e?r:i,(0,n.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 10 10`,fill:`none`,style:{transform:e?`rotate(180deg)`:`rotate(0deg)`},children:(0,n.jsx)(`path`,{d:`M2 3.5L5 6.5L8 3.5`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})})]})}var I=660,L=42,te=10,ne=24,re=24,ie=8,ae=[i.green,i.blue,i.amber,i.red];function oe(e,t,n){if(e.measureText(t).width<=n)return t;let r=t;for(;r.length>0&&e.measureText(r+`…`).width>n;)r=r.slice(0,-1);return r+`…`}function se({items:e=[],"data-testid":r}){let a=(0,t.useRef)(null),c=(0,t.useRef)(0),u=(0,t.useRef)(new Map),[d,g]=(0,t.useState)(!1),S=(0,t.useMemo)(()=>e.filter(e=>typeof e==`object`&&!!e),[e]),C=(0,t.useMemo)(()=>[...S].sort((e,t)=>(t.percentage??0)-(e.percentage??0)),[S]),w=(0,t.useMemo)(()=>d?C:C.slice(0,ie),[C,d]),T=w.length,E=ne+re+T*L+Math.max(0,T-1)*te,{hoveredRef:D,tooltip:O,hitZonesRef:k}=v(a,{width:I,height:E});return(0,t.useEffect)(()=>{let e=a.current;if(!e)return;let t=f(e,I,E);c.current=0;let n=I*.08,r=I-150-n,d,g=()=>{c.current++;let e=c.current;t.clearRect(0,0,I,E),t.letterSpacing=o.letterSpacing,k.current=[],u.current.forEach((e,t)=>{let n=t===D.current?1:0,r=e+(n-e)*.12;Math.abs(r-n)<.005?n===0?u.current.delete(t):u.current.set(t,1):u.current.set(t,r)}),D.current&&!u.current.has(D.current)&&u.current.set(D.current,0),m(t,I,E,e,40,l(i.blue,.04)),w.forEach((n,i)=>{let a=ae[i%ae.length],c=u.current.get(n.id)??0,d=ne+i*(L+te);t.fillStyle=l(a,.04+c*.04),t.beginPath(),t.roundRect(150,d,r,L,3),t.fill(),t.strokeStyle=l(a,.08),t.lineWidth=1,t.setLineDash([4,4]),t.beginPath(),t.moveTo(150,d+L/2),t.lineTo(150+r,d+L/2),t.stroke(),t.setLineDash([]);let f=(n.percentage??0)/100,m=150+r*Math.min(f,f*x(Math.min(1,e*.005)));if(m>154){let e=t.createLinearGradient(150,0,m,0);e.addColorStop(0,l(a,.02)),e.addColorStop(1,l(a,.25+c*.15)),t.fillStyle=e,t.beginPath(),t.roundRect(150,d+2,m-150,L-4,2),t.fill()}p(t,m,d+L/2,18+c*8,a,.3+c*.2),t.beginPath(),t.arc(m,d+L/2,5+c*2,0,Math.PI*2),t.fillStyle=l(a,.9),t.fill();let h={label:n.name,value:`${n.percentage??0}%`,sublabel:n.totalLabel,color:a};b(k.current,n.id,0,d,150+r,L,h),y(k.current,n.id,m,d+L/2,14,h),t.font=s.font,t.fillStyle=l(a,.9+c*.1),t.textAlign=`left`,t.textBaseline=`middle`,t.fillText(`${n.percentage??0}%`,m+10,d+L/2),t.font=`${c>0?`bold `:``}`+o.font,t.fillStyle=c>0?a:o.color,t.textAlign=`right`,t.fillText(oe(t,n.abbreviation??n.name??``,134),142,d+L/2)}),t.strokeStyle=l(i.t3,.3),t.lineWidth=1,t.setLineDash([]),t.beginPath(),t.moveTo(150+r,ne),t.lineTo(150+r,ne+(T-1)*(L+te)+L),t.stroke(),h(t,I,E,e,.015),d=requestAnimationFrame(g)};return g(),()=>cancelAnimationFrame(d)},[w,E]),C.length===0?(0,n.jsx)(F,{width:I,height:160,"data-testid":r}):(0,n.jsxs)(`div`,{"data-testid":r,style:{width:I},children:[(0,n.jsxs)(`div`,{style:{position:`relative`},children:[(0,n.jsx)(`canvas`,{ref:a,role:`img`,"aria-label":`Commitment race — contractors ranked by commitment percentage`,style:{width:I,height:E,display:`block`,borderRadius:8}}),(0,n.jsx)(_,{...O,parentW:I,parentH:E})]}),S.length>ie&&(0,n.jsx)(`div`,{style:{marginTop:8},children:(0,n.jsx)(ee,{expanded:d,onToggle:()=>g(e=>!e)})})]})}var ce=480,le=222;function ue({confirmed:e,total:r,label:a,"data-testid":s}){let u=(0,t.useRef)(null),d=(0,t.useRef)(0);return(0,t.useEffect)(()=>{let t=u.current;if(!t)return;let n=f(t,ce,le);d.current=0;let s=ce/2,m=Math.PI,h=2*Math.PI,g=Math.PI,_,v=()=>{d.current++;let t=d.current;n.clearRect(0,0,ce,le),n.letterSpacing=o.letterSpacing;let u=x(Math.min(t/80,1)),f=w(Math.min(t/72,1));n.beginPath(),n.arc(s,155,120,m,h),n.strokeStyle=l(i.bd,.35),n.lineWidth=46,n.stroke(),[{start:0,end:.33,color:i.red},{start:.33,end:.66,color:i.amber},{start:.66,end:1,color:i.green}].forEach(e=>{let t=m+e.start*g,r=m+e.end*g;n.beginPath(),n.arc(s,155,194/2,t,r),n.strokeStyle=l(e.color,.12),n.lineWidth=42,n.stroke()});let y=Math.round((e??0)/(r||1)*100),b=m+y/100*g*u,S=y>=66?i.green:y>=33?i.amber:i.red;p(n,s+Math.cos(b)*194/2,155+Math.sin(b)*194/2,18,S,.35*u),n.beginPath(),n.arc(s,155,194/2,m,b),n.strokeStyle=l(S,.7*u),n.lineWidth=38,n.lineCap=`round`,n.stroke(),n.lineCap=`butt`;let C=m+y/100*g*f,T=s+Math.cos(C)*82,E=155+Math.sin(C)*82,D=s-Math.cos(C)*14,O=155-Math.sin(C)*14;n.strokeStyle=l(S,.18*f),n.lineWidth=6,n.lineCap=`round`,n.beginPath(),n.moveTo(D,O),n.lineTo(T,E),n.stroke(),n.strokeStyle=l(i.t1,.92*f),n.lineWidth=2,n.lineCap=`round`,n.beginPath(),n.moveTo(D,O),n.lineTo(T,E),n.stroke(),n.beginPath(),n.arc(T,E,3,0,Math.PI*2),n.fillStyle=l(S,.9*f),n.fill(),p(n,s,155,20,S,.25*f),n.beginPath(),n.arc(s,155,9,0,Math.PI*2),n.strokeStyle=l(S,.5*f),n.lineWidth=1.5,n.stroke(),n.beginPath(),n.arc(s,155,5,0,Math.PI*2),n.fillStyle=i.t1,n.fill(),u>.5&&(n.globalAlpha=Math.min(1,(u-.5)/.5),n.font=`500 24px 'Satoshi Variable', 'DM Sans', sans-serif`,n.fillStyle=S,n.textAlign=`center`,n.fillText(`${Math.round(y*f)}%`,s,117),n.globalAlpha=1),u>.7&&a&&(n.globalAlpha=Math.min(1,(u-.7)/.3),n.font=c.font,n.fillStyle=c.color,n.textAlign=`center`,n.fillText(`${e??0} of ${r??0} ${a}`,s,213),n.globalAlpha=1);for(let e=0;e<=10;e++){let t=m+e/10*g;if(n.strokeStyle=l(i.bd,.5),n.lineWidth=e%5==0?1.5:.8,n.beginPath(),n.moveTo(s+Math.cos(t)*122,155+Math.sin(t)*122),n.lineTo(s+Math.cos(t)*128,155+Math.sin(t)*128),n.stroke(),e%5==0){let r=s+Math.cos(t)*138,i=155+Math.sin(t)*138;n.font=o.font,n.fillStyle=o.color,n.textAlign=`center`,n.fillText(`${e*10}%`,r,i+3)}}_=requestAnimationFrame(v)};return v(),()=>cancelAnimationFrame(_)},[e,r,a]),(0,n.jsx)(`div`,{"data-testid":s,style:{position:`relative`,width:ce,height:le},children:(0,n.jsx)(`canvas`,{ref:u,role:`img`,"aria-label":`Compensation event gauge — ${Math.round((e??0)/(r||1)*100)}% of NCEs confirmed as compensation events`,style:{width:ce,height:le,display:`block`}})})}function de(e,n,r,i,a=!0,o={}){let s=(0,t.useRef)(0),{easing:c=x,durationFrames:l=48}=o;(0,t.useEffect)(()=>{let t=e.current;if(!t||!n||!r)return;let o=t.getContext(`2d`);if(!o)return;t.width=n*2,t.height=r*2,o.scale(2,2);let u;s.current=0;let d=()=>{s.current++;let e=s.current;o.clearRect(0,0,n,r);let t=a?Math.min(e/l,1):1;if(i(o,c(t),e),t<1)u=requestAnimationFrame(d);else{let e=()=>{s.current++,o.clearRect(0,0,n,r),i(o,1,s.current),u=requestAnimationFrame(e)};u=requestAnimationFrame(e)}};return d(),()=>cancelAnimationFrame(u)},[n,r,a])}var R=780,z=234,fe=130,pe=52,me=[i.blue,i.amber,i.purple,i.green],he=[`Base Value`,`Variations`,`Commitment`],ge=[`Base`,`Var`,`Commit`];function _e({items:e=[],"data-testid":r}){let a=(0,t.useRef)(null),s=(0,t.useRef)(new Map),{hoveredRef:u,tooltip:d,hitZonesRef:f}=v(a,{width:R,height:z}),g=(0,t.useMemo)(()=>e.filter(e=>typeof e==`object`&&!!e),[e]),b=(0,t.useMemo)(()=>{let e=Math.max(...g.map(e=>e.base??0)),t=Math.max(...g.map(e=>e.variation??0));return g.map((n,r)=>{let i=R*(.12+r*.19),a=fe,o=Math.min(R*.075,pe),s=me[r%me.length],c=[(n.base??0)/(e||1)*100,(n.variation??0)/(t||1)*100,n.percentage??0],l=[n.baseLabel??String(n.base??0),n.variationLabel??String(n.variation??0),`${n.percentage??0}%`],u=c.map((e,t)=>{let n=-Math.PI/2+t/he.length*Math.PI*2,r=e/100,s=o*Math.max(.08,r);return{name:he[t],short:ge[t],label:l[t],val:Math.round(e),x:i+Math.cos(n)*s,y:a+Math.sin(n)*s,angle:n,norm:r}}),d=u.reduce((e,t)=>e+t.x,0)/u.length,f=u.reduce((e,t)=>e+t.y,0)/u.length,p=Math.sqrt(u.reduce((e,t)=>e+(t.x-d)**2+(t.y-f)**2,0)/u.length);return{...n,cx:i,cy:a,baseR:o,stars:u,scatter:p,color:s}})},[g]);return de(a,R,z,(e,t,n)=>{D(s.current,u.current),f.current=[],m(e,R,z,n,30),b.forEach((t,r)=>{let a=t.color,c=`constellation-${r}`,u=s.current.get(c)??0;e.beginPath(),e.arc(t.cx,t.cy,t.baseR+5,0,Math.PI*2),e.strokeStyle=l(i.bd,.08+.08*u),e.lineWidth=.5,e.stroke(),e.beginPath(),t.stars.forEach((t,n)=>{n===0?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y)}),e.closePath(),e.fillStyle=l(a,.04+.03*u),e.fill(),e.strokeStyle=l(a,.15+.1*u),e.lineWidth=.8,e.stroke(),t.stars.forEach((i,c)=>{let u=T(n,.05,5e-4)*.3+.7,d=3.5*u,p=`star-${r}-${c}`,m=s.current.get(p)??0,h=e.createRadialGradient(i.x,i.y,0,i.x,i.y,d*4);h.addColorStop(0,l(a,(.2+.1*m)*u)),h.addColorStop(1,l(a,0)),e.fillStyle=h,e.beginPath(),e.arc(i.x,i.y,d*4,0,Math.PI*2),e.fill(),e.beginPath(),e.arc(i.x,i.y,d+m*2,0,Math.PI*2),e.fillStyle=l(a,(.8+.2*m)*u),e.fill();let g=Math.sin(i.angle)<-.3;e.textAlign=`center`,e.textBaseline=`middle`,g?(e.font=o.font,e.fillStyle=l(a,.5+.15*m),e.fillText(i.short,i.x,i.y-24),e.font=o.font,e.fillStyle=l(a,.8+.15*m),e.fillText(i.label,i.x,i.y-11)):(e.font=o.font,e.fillStyle=l(a,.5+.15*m),e.fillText(i.short,i.x,i.y+11),e.font=o.font,e.fillStyle=l(a,.8+.15*m),e.fillText(i.label,i.x,i.y+24)),y(f.current,p,i.x,i.y,d*4+2,{label:i.name,value:i.label,sublabel:t.abbreviation??t.name.slice(0,6),color:a})}),u>0&&p(e,t.cx,t.cy,16*u,a,.15*u),e.beginPath(),e.arc(t.cx,t.cy,t.baseR+12,0,Math.PI*2),e.strokeStyle=l(a,.1+T(n,.03,5e-4)*.05),e.lineWidth=1,e.stroke(),e.font=o.font,e.textAlign=`center`,e.textBaseline=`alphabetic`,e.fillStyle=u>0?t.color:o.color,e.fillText(t.abbreviation??t.name.slice(0,6),t.cx,t.cy+t.baseR+26),y(f.current,c,t.cx,t.cy,t.baseR+5,{label:t.name,value:`${t.totalLabel??String(t.total??0)} total`,sublabel:`${t.percentage??0}% committed · scatter ${t.scatter.toFixed(1)}`,color:a})}),e.font=c.font,e.textAlign=`center`,e.textBaseline=`middle`,e.fillStyle=c.color,e.fillText(`▲ top = Base value · ▼▸ lower-right = Variations · ◂▼ lower-left = Commitment % · hover stars for details`,R/2,z-14),h(e,R,z,n,.012)},!0),b.length===0?(0,n.jsx)(F,{width:R,height:z,"data-testid":r}):(0,n.jsxs)(`div`,{"data-testid":r,style:{position:`relative`,width:R,height:z},children:[(0,n.jsx)(`canvas`,{ref:a,role:`img`,"aria-label":`Contract value breakdown per contractor — multi-KPI constellation chart`,style:{width:R,height:z,display:`block`}}),(0,n.jsx)(_,{...d,parentW:R,parentH:z})]})}var ve=680,ye=220,be=8,xe=[i.blue,i.amber,i.purple,i.green],B={left:8,right:80,top:16,bottom:38},V=150,H=18;function Se(e,t,n){if(e.measureText(t).width<=n)return t;let r=t;for(;r.length>0&&e.measureText(r+`…`).width>n;)r=r.slice(0,-1);return r+`…`}function Ce(e){let t=Math.abs(e),n=e<0?`-`:``;return t>=1e6?`${n}£${(t/1e6).toFixed(1)}M`:t>=1e3?`${n}£${(t/1e3).toFixed(1)}K`:`${n}£${t.toFixed(0)}`}function we({data:e,"data-testid":r}){let a=(0,t.useRef)(null),u=(0,t.useRef)(new Map),[d,f]=(0,t.useState)(!1),{items:m=[],totals:h}=e,g=m.filter(e=>typeof e==`object`&&!!e),y=[...g].sort((e,t)=>(t.total??0)-(e.total??0)),x=d?y:y.slice(0,be),C=x.length,w=Math.max(...y.map(e=>Math.abs(e.total??0)),1),T=C*H+Math.max(0,C-1)*8,O=B.top+B.bottom+T,k=ve-B.left-V-B.right,A=g.length===0,{hoveredRef:j,tooltip:M,hitZonesRef:N}=v(a,{width:ve,height:O});return de(a,ve,O,(e,t)=>{D(u.current,j.current),N.current=[],x.forEach((n,r)=>{let a=xe[r%xe.length],c=E(t,r,C,S),d=B.top+r*(H+8),f=B.left+V,m=u.current.get(n.id)??0,h=Math.max(n.base??0,0),g=Math.max(n.total??0,0),_=h/w*k*c,v=g/w*k*c,y=v-_;e.font=o.font,e.fillStyle=m>0?a:o.color,e.textAlign=`right`,e.textBaseline=`middle`,e.fillText(Se(e,n.name??``,V-16),f-8,d+H/2),b(N.current,n.id,0,d,f,H,{label:n.name,value:`${n.totalLabel??Ce(n.total??0)} total`,sublabel:`Base ${n.baseLabel??Ce(n.base??0)} + Var ${n.variationLabel??Ce(n.variation??0)} · ${n.percentage??0}% committed`,color:a}),e.fillStyle=l(i.bd,.25),e.beginPath(),e.roundRect(f,d,k,H,4),e.fill(),_>0&&(m>0&&p(e,f+_/2,d+H/2,_*.3,a,.1*m),e.fillStyle=l(a,.5+m*.15),e.beginPath(),e.roundRect(f,d,_,H,4),e.fill()),y>2&&(e.fillStyle=l(a,.22+m*.08),e.beginPath(),e.roundRect(f+_,d,y,H,[0,4,4,0]),e.fill(),e.setLineDash([2,3]),e.strokeStyle=l(a,.55),e.lineWidth=1,e.beginPath(),e.moveTo(f+_,d+3),e.lineTo(f+_,d+H-3),e.stroke(),e.setLineDash([])),m>0&&v>0&&(e.strokeStyle=l(a,.5*m),e.lineWidth=1,e.setLineDash([]),e.beginPath(),e.roundRect(f,d,v,H,4),e.stroke()),c>.35&&(e.globalAlpha=Math.min(1,(c-.35)/.4),e.font=s.font,e.fillStyle=m>0?a:s.color,e.textAlign=`left`,e.textBaseline=`middle`,e.fillText(n.totalLabel??Ce(n.total??0),f+v+6,d+H/2),e.globalAlpha=1),b(N.current,n.id,f,d,Math.max(v,1),H,{label:n.name,value:n.totalLabel??Ce(n.total??0),sublabel:`${n.baseLabel??Ce(n.base??0)} + ${n.variationLabel??Ce(n.variation??0)} · ${n.percentage??0}%`,color:a})});let n=O-14;e.textBaseline=`middle`,e.font=c.font,e.textAlign=`left`,e.fillStyle=l(i.blue,.5),e.beginPath(),e.roundRect(B.left+V,n-3,14,6,2),e.fill(),e.fillStyle=c.color,e.fillText(`base value`,B.left+V+18,n),e.fillStyle=l(i.blue,.22),e.beginPath(),e.roundRect(B.left+V+94,n-3,14,6,2),e.fill(),e.setLineDash([2,3]),e.strokeStyle=l(i.blue,.5),e.lineWidth=.5,e.beginPath(),e.moveTo(B.left+V+101,n-3),e.lineTo(B.left+V+101,n+3),e.stroke(),e.setLineDash([]),e.fillStyle=c.color,e.fillText(`approved variations`,B.left+V+112,n),e.font=c.font,e.textAlign=`right`,e.fillStyle=c.color,e.fillText(`Portfolio: ${Ce(h?.total??0)}`,ve-8,n)},!0,{easing:S}),A?(0,n.jsx)(F,{width:ve,height:ye,message:`No contract data available`,"data-testid":r}):(0,n.jsxs)(`div`,{"data-testid":r,style:{width:ve,transition:`all 0.25s ease`},children:[(0,n.jsxs)(`div`,{style:{position:`relative`},children:[(0,n.jsx)(`canvas`,{ref:a,role:`img`,"aria-label":`Total contract value per contractor — horizontal bar chart`,style:{width:ve,height:O,display:`block`,borderRadius:8}}),(0,n.jsx)(_,{...M,parentW:ve,parentH:O})]}),g.length>be&&(0,n.jsx)(`div`,{style:{marginTop:8},children:(0,n.jsx)(ee,{expanded:d,onToggle:()=>f(e=>!e)})})]})}var Te=[{value:0xe8d4a51000,suffix:`T`,divisor:0xe8d4a51000},{value:1e9,suffix:`B`,divisor:1e9},{value:1e6,suffix:`M`,divisor:1e6},{value:1e3,suffix:`K`,divisor:1e3}];function U(e,t=1){let n=Math.abs(e),r=e<0?`-`:``;for(let e of Te)if(n>=e.value)return`${r}${(n/e.divisor).toFixed(t)}${e.suffix}`;return`${r}${n.toFixed(0)}`}var Ee=780,W=240,De=12,Oe=10,ke=5,Ae=(Ee-2*De-(ke-1)*Oe)/ke;function je({items:e=[],"data-testid":r}){let c=(0,t.useRef)(null),u=(0,t.useRef)(0),d=(0,t.useRef)(new Map),m=[...(0,t.useMemo)(()=>e.filter(e=>typeof e==`object`&&!!e),[e])].sort((e,t)=>(t.count??0)-(e.count??0)).slice(0,5),g=m.reduce((e,t)=>e+(t.count??0),0),y=Math.min(ke,m.length),x=y>0?2*De+y*Ae+(y-1)*Oe:Ee,{hoveredRef:S,tooltip:C,hitZonesRef:w}=v(c,{width:x,height:W});return(0,t.useEffect)(()=>{let e=c.current;if(!e)return;let t=f(e,x,W);u.current=0;let n=Ae,r=W*.84,_=W*.08,v=De,y,C=()=>{u.current++;let e=u.current;t.clearRect(0,0,x,W),t.letterSpacing=o.letterSpacing,w.current=[],d.current.forEach((e,t)=>{let n=t===S.current?1:0,r=e+(n-e)*.12;Math.abs(r-n)<.005?n===0?d.current.delete(t):d.current.set(t,1):d.current.set(t,r)}),S.current&&!d.current.has(S.current)&&d.current.set(S.current,0),m.forEach((o,c)=>{let u=c===0,f=c===0?i.red:c===1?i.amber:a[c%a.length],m=v+c*(n+Oe),h=d.current.get(o.id)??0,y=h*8,x=m-y/2,S=n+y,C=u?T(e,.04,3e-4)*.06+.06:0;t.fillStyle=l(f,.08+h*.07),t.beginPath(),t.roundRect(x,_,S,r,6),t.fill(),t.strokeStyle=l(f,.2+h*.4+C),t.lineWidth=u?1.5:1,t.stroke(),(h>.01||u)&&p(t,x+S/2,_+r/2,S*.55,f,C+h*.14),t.font=s.font,t.textAlign=`left`,t.textBaseline=`top`,t.fillStyle=l(f,.5+h*.35),t.fillText(`#${c+1}`,x+7,_+6);let E=Math.min(n*.28,r*.32,72),D=x+S/2,O=_+r*.38,k=t.createRadialGradient(D,O-E*.2,0,D,O,E);k.addColorStop(0,l(f,.5+h*.2)),k.addColorStop(1,l(f,.2+h*.1)),t.beginPath(),t.arc(D,O,E,0,Math.PI*2),t.fillStyle=k,t.fill(),t.strokeStyle=l(f,.4+h*.3),t.lineWidth=1,t.stroke(),t.font=s.font,t.textAlign=`center`,t.textBaseline=`middle`,t.fillStyle=l(i.t1,.9);let A=o.abbreviation??o.name??``,j=E*1.7,M=A;for(;t.measureText(M).width>j&&M.length>1;)M=M.slice(0,-1);M!==A&&(M=M.slice(0,-1)+`…`),t.fillText(M,D,O);let N=o.count==null?null:U(o.count),P=o.label??N;if(P){t.font=s.font,t.textBaseline=`alphabetic`,t.fillStyle=l(f,.9+h*.1);let e=S-16,n=P;for(;t.measureText(n).width>e&&n.length>1;)n=n.slice(0,-1);n!==P&&(n=n.slice(0,-1)+`…`),t.fillText(n,D,_+r*.74)}let F=Math.round((o.count??0)/(g||1)*100);b(w.current,o.id,m,_,n,r,{label:o.name,value:`${P} · ${F}% of total`,sublabel:`Rank #${c+1}`,color:f})}),h(t,x,W,e,.015),y=requestAnimationFrame(C)};return C(),()=>cancelAnimationFrame(y)},[m,g,x]),m.length===0?(0,n.jsx)(F,{width:x,height:W,"data-testid":r}):(0,n.jsxs)(`div`,{"data-testid":r,style:{position:`relative`,width:x,height:W},children:[(0,n.jsx)(`canvas`,{ref:c,role:`img`,"aria-label":`Contractor rank — open EW count per contractor`,style:{width:x,height:W,display:`block`,borderRadius:8}}),(0,n.jsx)(_,{...C,parentW:x,parentH:W})]})}var G=680,K=260;function Me({items:e=[],"data-testid":r}){let a=(0,t.useRef)(null),s=(0,t.useRef)(0),c=(0,t.useRef)(new Map),{hoveredRef:u,tooltip:d,hitZonesRef:g}=v(a,{width:G,height:K}),b=(0,t.useMemo)(()=>e.filter(e=>typeof e==`object`&&!!e),[e]);return(0,t.useEffect)(()=>{let e=a.current;if(!e)return;let t=f(e,G,K);s.current=0;let n=b.length,r=Math.max(...b.map(e=>e.count),1),d=r,_=G*.05,v=K*.1,x=G*.9/n,S=K*.7/d,C=b.reduce((e,t)=>e+t.count,0),w,E=()=>{s.current++;let e=s.current;t.clearRect(0,0,G,K),g.current=[],c.current.forEach((e,t)=>{let n=t===u.current?1:0,r=e+(n-e)*.12;Math.abs(r-n)<.005?n===0?c.current.delete(t):c.current.set(t,1):c.current.set(t,r)}),u.current&&!c.current.has(u.current)&&c.current.set(u.current,0),m(t,G,K,e,40,l(i.blue,.04)),b.forEach((n,a)=>{let s=n.count===r,u=i.blue,f=c.current.get(`${n.category}-col`)??0;for(let i=0;i<d;i++){let o=_+a*x+x/2,d=v+i*S+S/2,m=Math.min(x,S)*.38;if(i>=r-n.count){let r=m*(1+(T(e,.04,5e-4)+Math.sin(a*.6+i*1.2)*.3)*.12);(s||f>.01)&&p(t,o,d,r*3,u,(s?.2:.1)+f*.1),t.beginPath(),t.arc(o,d,r,0,Math.PI*2),t.fillStyle=l(u,s?.8:.5+f*.2),t.fill();let h=`${n.category}-${i}`;y(g.current,h,o,d,m+4,{label:n.fullName,value:`${n.count} Early Warnings`,sublabel:`${Math.round(n.count/C*100)}% of total`,color:u}),c.current.get(`${n.category}-col`)}else t.beginPath(),t.arc(o,d,1,0,Math.PI*2),t.fillStyle=l(u,.08),t.fill()}let m=v+d*S+16;t.font=o.font,t.textAlign=`center`,t.textBaseline=`alphabetic`,t.fillStyle=s?i.blue:l(i.t2,.65),t.fillText(n.category,_+a*x+x/2,m)}),h(t,G,K,e,.015),w=requestAnimationFrame(E)};return E(),()=>cancelAnimationFrame(w)},[b]),b.length===0?(0,n.jsx)(F,{width:G,height:K,"data-testid":r}):(0,n.jsxs)(`div`,{"data-testid":r,style:{position:`relative`,width:G,height:K},children:[(0,n.jsx)(`canvas`,{ref:a,role:`img`,"aria-label":`Early Warning count by category — breathing dot grid`,style:{width:G,height:K,display:`block`,borderRadius:8}}),(0,n.jsx)(_,{...d,parentW:G,parentH:K})]})}function Ne({rows:e=[],className:t,colors:r}){return(0,n.jsx)(A,{rows:e,variant:`line`,className:t,colors:r})}var Pe=[`#4C93D9`,`#5DA537`,`#F3862C`,`#4F72C6`,`#A0B724`,`#EEBF3B`,`#3C45D1`],Fe={nodes:[{id:`supplier-x`,name:`Supplier X`,valueLabel:`Si +0.12%`},{id:`bf3-superheat`,name:`BF-3 Superheat`,valueLabel:`22°C (target 34)`},{id:`ccm3-solidification`,name:`CCM-3 Solidification`,valueLabel:`Rate deviation`},{id:`grade-risk`,name:`Grade Risk`,valueLabel:`Automotive 74%`}],links:[{source:`supplier-x`,target:`bf3-superheat`,value:92},{source:`bf3-superheat`,target:`ccm3-solidification`,value:87},{source:`ccm3-solidification`,target:`grade-risk`,value:74}]};function Ie({rows:e=[],className:t,colors:r}){let i=r?.slices??Pe;return(0,n.jsx)(`div`,{className:[`d3-mini-bars`,t].filter(Boolean).join(` `),children:e.map(([e,t,r],a)=>(0,n.jsxs)(`div`,{className:`d3-mini-row`,children:[(0,n.jsx)(`span`,{children:e}),(0,n.jsx)(`div`,{className:`d3-mini-track`,children:(0,n.jsxs)(`svg`,{viewBox:`0 0 100 12`,className:`d3-mini-svg`,"aria-hidden":`true`,children:[(0,n.jsx)(`rect`,{x:`0`,y:`0`,width:`100`,height:`12`,rx:`6`,className:`d3-mini-track-fill`}),(0,n.jsx)(`rect`,{x:`0`,y:`0`,width:Math.max(0,Math.min(100,t)),height:`12`,rx:`6`,className:`d3-mini-fill tone-${a%Pe.length}`,fill:i[a%i.length]})]})}),(0,n.jsx)(`span`,{children:r})]},`${e}-${a}`))})}var Le=770,Re=320,ze=60,Be=28;function Ve({total:e=0,totalLabel:r,items:c=[],width:u=Le,"data-testid":d}){let m=(0,t.useRef)(null),h=(0,t.useRef)(new Map),g=(0,t.useRef)(0),b=(0,t.useMemo)(()=>c.filter(e=>typeof e==`object`&&!!e),[c]),S=(0,t.useMemo)(()=>Math.max(Re,ze+Math.max(0,b.length-1)*Be),[b.length]),{hoveredRef:C,tooltip:w,hitZonesRef:T}=v(m,{width:u,height:S});return(0,t.useEffect)(()=>{let t=m.current;if(!t)return;let n=f(t,u,S);g.current=0;let c=S/2,d=u-200,_=Math.max(...b.map(e=>e.count??0),1),v=b.length>1?(S-60)/(b.length-1):0,w=b.map((e,t)=>({x:d,y:30+t*v})),O,k=()=>{g.current++;let t=g.current;n.clearRect(0,0,u,S),n.letterSpacing=o.letterSpacing;let f=x(Math.min(t/72,1));if(D(h.current,C.current),T.current=[],p(n,88,c,48*f,i.blue,.15*f),b.forEach((t,r)=>{let u=a[r%a.length],m=E(f,r,b.length,x),g=w[r],v=h.current.get(t.id)??0,S=Math.max(1.5,(t.count??0)/_*6);if(m<.01)return;let C=88+(d-88)*.4,D=c,O=88+(d-88)*.6,k=g.y,A=m;n.beginPath();for(let e=0;e<=40;e++){let t=e/40*A,r=(1-t)**3*88+3*(1-t)**2*t*C+3*(1-t)*t**2*O+t**3*g.x,i=(1-t)**3*c+3*(1-t)**2*t*D+3*(1-t)*t**2*k+t**3*g.y;e===0?n.moveTo(r,i):n.lineTo(r,i)}if(n.strokeStyle=l(u,v>0?.8:.45),n.lineWidth=S*(v>0?1.3:1),n.stroke(),m>.85){let r=Math.min(1,(m-.85)/.15),a=4+(t.count??0)/_*12;p(n,g.x,g.y,a*2.5,u,(.25+v*.2)*r),n.beginPath(),n.arc(g.x,g.y,a*r,0,Math.PI*2),n.fillStyle=l(u,(.7+v*.2)*r),n.fill();let c=U(t.count??0);y(T.current,t.id,g.x,g.y,a+8,{label:t.name,value:c,sublabel:`${Math.round((t.count??0)/(e||1)*100)}% of total`,color:u}),n.globalAlpha=r,n.font=o.font,n.textAlign=`left`;let d=t.abbreviation??t.name?.slice(0,6)??``,f=` ${U(t.count??0)}`,h=g.x+a+6,b=g.y+4;n.fillStyle=v>0?u:l(i.t2,.85),n.fillText(d,h,b);let x=n.measureText(d).width;n.font=s.font,n.fillStyle=v>0?u:i.t1,n.fillText(f,h+x,b),n.globalAlpha=1}}),n.beginPath(),n.arc(88,c,32*f,0,Math.PI*2),n.fillStyle=i.bgL,n.fill(),n.strokeStyle=l(i.blue,.6*f),n.lineWidth=2,n.stroke(),f>.4){n.globalAlpha=Math.min(1,(f-.4)/.4);let t=r??U(e,0);n.font=`500 16px 'Satoshi Variable', 'DM Sans', sans-serif`;let a=t;for(;n.measureText(a).width>54.4&&a.length>1;)a=a.slice(0,-1);a!==t&&(a=a.slice(0,-1)+`…`),n.fillStyle=i.t1,n.textAlign=`center`,n.textBaseline=`middle`,n.fillText(a,88,c),n.globalAlpha=1}y(T.current,`__root__`,88,c,32,{label:r??`Total`,value:U(e,0),sublabel:`${b.length} items`,color:i.blue}),O=requestAnimationFrame(k)};return k(),()=>cancelAnimationFrame(O)},[e,r,b,S,u]),b.length===0?(0,n.jsx)(F,{width:u,height:Re,"data-testid":d}):(0,n.jsxs)(`div`,{"data-testid":d,style:{position:`relative`,width:u,height:S},children:[(0,n.jsx)(`canvas`,{ref:m,role:`img`,"aria-label":`NCE fault tree — NCEs per contractor as branching tree`,style:{width:u,height:S,display:`block`}}),(0,n.jsx)(_,{...w,parentW:u,parentH:S})]})}var He=192,Ue=He,We=He+80;function Ge({rows:e=[],variant:o,className:s,colors:c}){let u=(0,t.useRef)(null),m=(0,t.useRef)(new Map),h=(0,t.useRef)(0),g=c?.slices??a,{hoveredRef:b,tooltip:x,hitZonesRef:S}=v(u,{width:Ue,height:We});return(0,t.useEffect)(()=>{let t=u.current;if(!t)return;let n=f(t,Ue,We);h.current=0;let r=Ue/2,a=He/2,s=He*.4,c=o===`donut`?He*.21:0,_=e.reduce((e,t)=>e+(t.pricing??0),0)||1,v,x=()=>{h.current++;let t=h.current;n.clearRect(0,0,Ue,We);let u=1-(1-Math.min(t/48,1))**3;D(m.current,b.current),S.current=[];let f=-Math.PI/2;e.forEach((e,o)=>{let d=(e.pricing??0)/_,h=d*Math.PI*2*u,v=f+h,b=g[o%g.length],x=m.current.get(e.id??`sl-${o}`)??0,C=f+h/2,w=(s+c)/2,E=r+Math.cos(C)*w,D=a+Math.sin(C)*w,O=(s-c)/2+8;y(S.current,e.id??`sl-${o}`,E,D,O,{label:e.vendor,value:`${e.pricing??0} (${Math.round(d*100)}%)`,color:b}),x>0&&p(n,E,D,O*2*x,b,.2*x);let k=T(t,.03,3e-4),A=s+x*6+(x>0?k*2:0);n.beginPath(),n.moveTo(r+Math.cos(f)*c,a+Math.sin(f)*c),n.arc(r,a,A,f,v),c>0?n.arc(r,a,c,v,f,!0):n.lineTo(r,a),n.closePath(),n.fillStyle=l(b,.7+x*.2),n.fill(),n.strokeStyle=l(i.bg,.8),n.lineWidth=1.5,n.stroke(),f=v}),o===`donut`&&e.length>0&&p(n,r,a,c*.8,i.blue,.06);let C=He+12;e.forEach((e,t)=>{let r=g[t%g.length],a=(e.pricing??0)/_,o=m.current.get(e.id??`sl-${t}`)??0,s=C+t*18;n.beginPath(),n.arc(8,s,4,0,Math.PI*2),n.fillStyle=l(r,.8+o*.2),n.fill(),n.font=`9px 'JetBrains Mono', monospace`,n.fillStyle=l(i.t2,.7+o*.2),n.textAlign=`left`,n.fillText(e.vendor,18,s+3.5),n.font=`bold 9px 'JetBrains Mono', monospace`,n.fillStyle=d(i.t3,r,o),n.textAlign=`right`,n.fillText(`${e.pricing??0} (${Math.round(a*100)}%)`,Ue-4,s+3.5)}),v=requestAnimationFrame(x)};return x(),()=>cancelAnimationFrame(v)},[e,o,c,g]),(0,n.jsx)(r,{className:[`canvas-pie-frame`,s].filter(Boolean).join(` `),children:(0,n.jsxs)(`div`,{style:{position:`relative`,width:Ue,height:We},children:[(0,n.jsx)(`canvas`,{ref:u,role:`img`,"aria-label":`${o} chart`,style:{width:Ue,height:We,display:`block`,borderRadius:8}}),(0,n.jsx)(_,{...x,parentW:Ue,parentH:We})]})})}function Ke(e,t,n,r){let i=new Set(t.map(e=>e.source)),a=new Set(t.map(e=>e.target)),o=new Map,s=[];for(e.forEach(e=>{i.has(e.id)&&!a.has(e.id)&&s.push({id:e.id,depth:0})});s.length>0;){let e=s.shift();if(!e)break;let{id:n,depth:r}=e;o.has(n)||(o.set(n,r),t.filter(e=>e.source===n).forEach(e=>{o.has(e.target)||s.push({id:e.target,depth:r+1})}))}let c=o.size>0?Math.max(...Array.from(o.values())):0;e.forEach(e=>{o.has(e.id)||o.set(e.id,c+1)});let l=new Map;e.forEach(e=>{let t=o.get(e.id)??0;l.has(t)||l.set(t,[]),l.get(t).push(e.id)});let u=Math.max(...Array.from(l.keys()))+1,d={left:100,right:80,top:40,bottom:40},f=new Map;return l.forEach((e,t)=>{let i=d.left+t/Math.max(u-1,1)*(n-d.left-d.right),a=r-d.top-d.bottom,o=Math.max(24,(a-(e.length-1)*12)/e.length),s=e.length*o+(e.length-1)*12,c=d.top+(a-s)/2;e.forEach((e,t)=>{f.set(e,{x:i-20/2,y:c+t*(o+12),w:20,h:o})})}),f}function qe({nodes:e,links:o,width:s=960,height:c=280,ariaLabel:u,selectedEntity:d,className:m,colors:g}){let x=(0,t.useRef)(null),S=(0,t.useRef)(new Map),C=(0,t.useRef)(0),w=(0,t.useRef)([]),E=g?.nodes??a,O=g?.links??i.bd,k=g?.activeLinks??i.blue,A=g?.activeNodes??i.blue,j=(0,t.useMemo)(()=>Ke(e,o,s,c),[e,o,s,c]),{hoveredRef:M,tooltip:N,hitZonesRef:P}=v(x,{width:s,height:c});return(0,t.useEffect)(()=>{let t=x.current;if(!t)return;let n=f(t,s,c);C.current=0,w.current=[];let r=o.length>0?Math.max(...o.map(e=>e.value)):1,a,u=()=>{C.current++;let t=C.current;n.clearRect(0,0,s,c);let f=1-(1-Math.min(t/56,1))**3;D(S.current,M.current),P.current=[],o.forEach((e,a)=>{let o=j.get(e.source),s=j.get(e.target);if(!o||!s)return;let c=!!d&&(e.source===d||e.target===d),u=c?k:O,p=c?.5:.2,m=Math.max(3,e.value/r*36*f),h=m/2,g=o.x+o.w,_=o.y+o.h/2,v=s.x,b=s.y+s.h/2,x=(g+v)/2;for(let e=0;e<30;e++){let r=e/30,i=(e+1)/30,o=1-r,s=1-i,c=o*o*g+2*o*r*x+r*r*v,d=o*o*_+2*o*r*_+r*r*b,f=s*s*g+2*s*i*x+i*i*v,m=s*s*_+2*s*i*_+i*i*b,y=T(t+r*120+a*40,.025,3e-4)*1.2;n.beginPath(),n.moveTo(c,d-h+y),n.lineTo(f,m-h+y),n.lineTo(f,m+h+y),n.lineTo(c,d+h+y),n.closePath(),n.fillStyle=l(u,p*(.5+r*.5)),n.fill()}y(P.current,`link-${a}`,x,(_+b)/2,m+6,{label:`${e.source} → ${e.target}`,value:String(e.value),color:c?k:i.blue}),Math.random()<.08&&w.current.push({linkIdx:a,prog:0,speed:.006+Math.random()*.006,off:(Math.random()-.5)*m*.5,sz:1+Math.random()})}),e.forEach((e,r)=>{let a=j.get(e.id);if(!a)return;let o=d===e.id,s=M.current===`node-${r}`,c=S.current.get(`node-${r}`)??0,u=o?A:E[r%E.length];b(P.current,`node-${r}`,a.x,a.y,a.w,a.h,{label:e.name,value:e.valueLabel??e.id,color:u}),(c>0||o)&&p(n,a.x+a.w/2,a.y+a.h/2,a.w*2,u,.2*Math.max(c,o?.6:0));let f=o?T(t,.03,3e-4)*.15:0;n.fillStyle=l(u,.6+c*.25+f),n.beginPath(),n.roundRect(a.x,a.y,a.w,a.h,4),n.fill(),(o||c>0)&&(n.strokeStyle=l(u,.5*Math.max(c,o?1:0)),n.lineWidth=1,n.beginPath(),n.roundRect(a.x,a.y,a.w,a.h,4),n.stroke());let m=a.x+a.w+8;n.font=`${o||s?`bold `:``}10px 'JetBrains Mono', monospace`,n.fillStyle=l(o?u:i.t2,.7+c*.2),n.textAlign=`left`,n.fillText(e.name,m,a.y+a.h/2+4),e.valueLabel&&(n.font=`9px 'JetBrains Mono', monospace`,n.fillStyle=l(u,.5+c*.2),n.fillText(e.valueLabel,m,a.y+a.h/2+17))}),w.current=w.current.filter(e=>{if(e.prog+=e.speed,e.prog>1)return!1;let t=o[e.linkIdx];if(!t)return!1;let r=j.get(t.source),a=j.get(t.target);if(!r||!a)return!1;let s=r.x+r.w,c=r.y+r.h/2,u=a.x,d=a.y+a.h/2,f=(s+u)/2,p=1-e.prog,m=p*p*s+2*p*e.prog*f+e.prog*e.prog*u,h=p*p*c+2*p*e.prog*c+e.prog*e.prog*d+e.off,_=Math.sin(e.prog*Math.PI)*.5,v=g?.links??i.blue;return n.beginPath(),n.arc(m,h,e.sz,0,Math.PI*2),n.fillStyle=l(v,_),n.fill(),!0}),w.current.length>150&&(w.current=w.current.slice(-150)),h(n,s,c,t,.01),a=requestAnimationFrame(u)};return u(),()=>{cancelAnimationFrame(a),w.current=[]}},[e,o,s,c,d,g,j]),(0,n.jsx)(r,{className:[`canvas-sankey-frame`,m].filter(Boolean).join(` `),children:(0,n.jsxs)(`div`,{role:`img`,"aria-label":u,style:{position:`relative`,width:s,height:c},children:[(0,n.jsx)(`canvas`,{ref:x,style:{width:s,height:c,display:`block`,borderRadius:8}}),(0,n.jsx)(_,{...N,parentW:s,parentH:c})]})})}var Je=[{x:.13,y:.48},{x:.37,y:.28},{x:.63,y:.62},{x:.87,y:.38},{x:.25,y:.72},{x:.5,y:.18},{x:.75,y:.7},{x:.92,y:.22}],Ye=[i.blue,i.orange,i.red,i.purple,i.green,i.amber,i.t2],Xe=[26,24,24,26,22,22,22,22];function Ze(e,t){let n=1-t;return{x:n*n*n*e.p0.x+3*n*n*t*e.p1.x+3*n*t*t*e.p2.x+t*t*t*e.p3.x,y:n*n*n*e.p0.y+3*n*n*t*e.p1.y+3*n*t*t*e.p2.y+t*t*t*e.p3.y}}function Qe(e,t){let n=1-t,r=3*n*n*(e.p1.x-e.p0.x)+6*n*t*(e.p2.x-e.p1.x)+3*t*t*(e.p3.x-e.p2.x),i=3*n*n*(e.p1.y-e.p0.y)+6*n*t*(e.p2.y-e.p1.y)+3*t*t*(e.p3.y-e.p2.y),a=Math.sqrt(r*r+i*i)||1;return{x:-i/a,y:r/a}}function $e(e,t){let n=t.x-e.x,r=t.y-e.y;return{p0:{x:e.x,y:e.y},p1:{x:e.x+n*.3+r*.15,y:e.y+r*.3-n*.15},p2:{x:t.x-n*.3+r*.08,y:t.y-r*.3-n*.08},p3:{x:t.x,y:t.y}}}function et({nodes:e,links:r,width:a=960,height:o=280,selectedEntity:s}){let c=(0,t.useRef)(null),u=(0,t.useRef)(0),g=(0,t.useRef)([]),{hoveredRef:b,tooltip:S,hitZonesRef:C}=v(c,{width:a,height:o}),w=(0,t.useMemo)(()=>{let t=new Map;return e.forEach((e,n)=>t.set(e.id,n)),t},[e]),E=(0,t.useMemo)(()=>r.length>0?Math.max(...r.map(e=>e.value)):100,[r]),D=e=>E>1?e/100:e,O=(0,t.useMemo)(()=>e.map((e,t)=>{let n=Je[t%Je.length];return{id:e.id,label:e.name,sub:e.valueLabel??``,x:n.x*a,y:n.y*o,r:Xe[t%Xe.length],color:Ye[t%Ye.length]}}),[e,a,o]),k=(0,t.useMemo)(()=>r.map(e=>({fromIdx:w.get(e.source)??-1,toIdx:w.get(e.target)??-1,conf:D(e.value)})).filter(e=>e.fromIdx>=0&&e.toIdx>=0),[r,w]);return(0,t.useEffect)(()=>{let e=c.current;if(!e)return;let t=f(e,a,o);u.current=0,g.current=[];let n,r=()=>{u.current++;let e=u.current;if(t.clearRect(0,0,a,o),C.current=[],m(t,a,o,e,50,l(i.blue,.05)),k.forEach((e,n)=>{let r=O[e.fromIdx],a=O[e.toIdx];if(!r||!a)return;let o=!!s&&(r.id===s||a.id===s),c=d(r.color,a.color,.5),u=o?.18:.05,f=o?.25:.1,p=$e(r,a);t.beginPath(),t.moveTo(p.p0.x,p.p0.y),t.bezierCurveTo(p.p1.x,p.p1.y,p.p2.x,p.p2.y,p.p3.x,p.p3.y),t.strokeStyle=l(c,u),t.lineWidth=16,t.lineCap=`round`,t.stroke(),t.strokeStyle=l(c,f),t.lineWidth=1.5,t.stroke();for(let t=0;t<e.conf*2.5;t++)Math.random()<.45&&g.current.push({edgeIdx:n,t:0,speed:.003+Math.random()*.004,off:(Math.random()-.5)*13,sz:.7+Math.random()*2});let m=Ze(p,.5),h=`${Math.round(e.conf*100)}%`;t.font=`bold 12px 'JetBrains Mono', monospace`,t.textBaseline=`middle`;let _=t.measureText(h).width+14;t.fillStyle=`rgba(10,16,24,0.88)`,t.beginPath(),t.roundRect(m.x-_/2,m.y-11,_,22,6),t.fill(),t.strokeStyle=l(i.blue,.25),t.lineWidth=1,t.stroke(),t.fillStyle=l(i.blue,.9),t.textAlign=`center`,t.fillText(h,m.x,m.y)}),g.current=g.current.filter(e=>{if(e.t+=e.speed,e.t>1)return!1;let n=k[e.edgeIdx];if(!n)return!1;let r=O[n.fromIdx],i=O[n.toIdx];if(!r||!i)return!1;let a=$e(r,i),o=Ze(a,e.t),s=Qe(a,e.t),c=o.x+s.x*e.off,u=o.y+s.y*e.off,f=Math.sin(e.t*Math.PI)*.7,m=d(r.color,i.color,e.t);return p(t,c,u,e.sz*3,m,f*.1),t.beginPath(),t.arc(c,u,e.sz,0,Math.PI*2),t.fillStyle=l(m,f),t.fill(),!0}),g.current.length>350&&(g.current=g.current.slice(-350)),O.forEach((n,r)=>{let a=s===n.id,o=b.current===`node-${r}`,c=T(e,.03,3e-4)*.1+1,u=n.r*c*(a?1.15:1);t.beginPath(),t.arc(n.x,n.y,u+6,0,Math.PI*2),t.strokeStyle=l(n.color,a?.3:.1),t.lineWidth=a?1.5:.7,t.stroke(),p(t,n.x,n.y,u*3,n.color,a?.22:.12);let d=t.createRadialGradient(n.x,n.y-u*.2,0,n.x,n.y,u);if(d.addColorStop(0,l(n.color,a?1:.85)),d.addColorStop(1,l(n.color,a?.65:.45)),t.fillStyle=d,t.beginPath(),t.arc(n.x,n.y,u,0,Math.PI*2),t.fill(),a||r===O.length-1){let r=u+16,i=e*.04,a=n.x+Math.cos(i)*r,o=n.y+Math.sin(i)*r;p(t,a,o,6,n.color,.3),t.beginPath(),t.arc(a,o,2,0,Math.PI*2),t.fillStyle=l(n.color,.75),t.fill()}y(C.current,`node-${r}`,n.x,n.y,u+8,{label:n.label,value:n.sub||n.id,color:n.color}),t.font=`${a||o?`bold `:``}12px 'DM Sans', sans-serif`,t.textAlign=`center`,t.textBaseline=`alphabetic`,t.fillStyle=l(n.color,a?1:.9),t.fillText(n.label,n.x,n.y+u+18),n.sub&&(t.font=`10px 'JetBrains Mono', monospace`,t.fillStyle=l(i.t3,.65),t.fillText(n.sub,n.x,n.y+u+32))}),k.length>=2){let n=k.reduce((e,t)=>e*t.conf,1),r=o*.92,s=a*.12,c=a*.76,u=x(Math.min(e*.008,1));t.fillStyle=l(i.bd,.35),t.beginPath(),t.roundRect(s,r,c,5,3),t.fill(),t.fillStyle=l(i.orange,.6),t.beginPath(),t.roundRect(s,r,c*n*u,5,3),t.fill(),t.font=`bold 12px 'JetBrains Mono', monospace`,t.textAlign=`left`,t.textBaseline=`middle`,t.fillStyle=l(i.orange,.85),t.fillText(`${Math.round(n*100)}% compound confidence`,s+c*n*u+10,r+2);let d=k.map(e=>e.conf.toFixed(2)).join(` × `);t.textAlign=`right`,t.font=`9px 'JetBrains Mono', monospace`,t.fillStyle=l(i.t4,.6),t.fillText(d,s-6,r+2)}h(t,a,o,e,.012),n=requestAnimationFrame(r)};return r(),()=>{cancelAnimationFrame(n),g.current=[]}},[O,k,a,o,s]),(0,n.jsxs)(`div`,{style:{position:`relative`,width:a,height:o},children:[(0,n.jsx)(`canvas`,{ref:c,style:{width:a,height:o,display:`block`,borderRadius:8},role:`img`,"aria-label":`causal flow diagram`}),(0,n.jsx)(_,{...S,parentW:a,parentH:o})]})}function tt({selectedEntity:e,colors:t}){return(0,n.jsx)(et,{nodes:Fe.nodes,links:Fe.links,width:960,height:280,selectedEntity:e})}function nt({rows:e=[],className:r,colors:i}){let{nodes:a,links:o}=(0,t.useMemo)(()=>{let t=e.slice(0,5);return{nodes:[{id:`score`,name:`Portfolio Score`},...t.map(e=>({id:e.id??e.vendor,name:e.vendor}))],links:t.map(e=>({source:e.id??e.vendor,target:`score`,value:Math.max(8,e.pricing??0)}))}},[e]);return(0,n.jsx)(qe,{nodes:a,links:o,width:760,height:280,ariaLabel:`sankey chart`,className:r,colors:i})}var rt=500,it=210;function at({left:e,right:r,"data-testid":a}){let c=(0,t.useRef)(null),u=(0,t.useRef)(0);return(0,t.useEffect)(()=>{let t=c.current;if(!t)return;let n=f(t,rt,it);u.current=0;let a=rt/2,d=Math.max(e.value??0,r.value??0,1),m=(e.value-r.value)/d*14,h,g=()=>{u.current++;let t=u.current;n.clearRect(0,0,rt,it),n.letterSpacing=o.letterSpacing;let c=x(Math.min(t/80,1)),f=m*w(Math.min(t/80,1))*Math.PI/180;n.strokeStyle=l(i.bd,.5*c),n.lineWidth=2,n.beginPath(),n.moveTo(a,20),n.lineTo(a,150),n.stroke(),n.beginPath(),n.arc(a,20,5*c,0,Math.PI*2),n.fillStyle=i.t2,n.fill();let _={x:a-Math.cos(f)*160,y:20+Math.sin(-f)*160},v={x:a+Math.cos(f)*160,y:20+Math.sin(f)*160};n.strokeStyle=l(i.t2,.5*c),n.lineWidth=2,n.beginPath(),n.moveTo(_.x,_.y),n.lineTo(v.x,v.y),n.stroke();let y=Math.max(20,e.value/d*100*c),b=_.y+18;p(n,_.x,b+y/2,90*.5,i.green,.18*c),n.fillStyle=l(i.green,.5*c),n.beginPath(),n.roundRect(_.x-90/2,b,90,y,[0,0,6,6]),n.fill(),n.strokeStyle=l(i.green,.7*c),n.lineWidth=1.5,n.stroke(),n.strokeStyle=l(i.t2,.35*c),n.lineWidth=1,[-90/3,90/3].forEach(e=>{n.beginPath(),n.moveTo(_.x+e,_.y+4),n.lineTo(_.x+e,b),n.stroke()}),c>.5&&(n.globalAlpha=Math.min(1,(c-.5)/.5),n.font=s.font,n.fillStyle=i.green,n.textAlign=`center`,n.fillText(e.label,_.x,b+y+18),n.font=o.font,n.fillStyle=o.color,n.fillText(`Accepted`,_.x,b+y+38),n.fillText(`${e.count} quotations`,_.x,b+y+58),n.globalAlpha=1);let S=Math.max(20,r.value/d*100*c),C=v.y+18;n.fillStyle=l(i.amber,.3*c),n.strokeStyle=l(i.amber,.5*c),n.lineWidth=1.5,n.beginPath(),n.roundRect(v.x-90/2,C,90,S,[0,0,6,6]),n.fill(),n.stroke(),n.strokeStyle=l(i.t2,.35*c),n.lineWidth=1,[-90/3,90/3].forEach(e=>{n.beginPath(),n.moveTo(v.x+e,v.y+4),n.lineTo(v.x+e,C),n.stroke()}),c>.5&&(n.globalAlpha=Math.min(1,(c-.5)/.5),n.font=s.font,n.fillStyle=i.amber,n.textAlign=`center`,n.fillText(r.label,v.x,C+S+18),n.font=o.font,n.fillStyle=o.color,n.fillText(`Submitted`,v.x,C+S+38),n.fillText(`${r.count} quotations`,v.x,C+S+58),n.globalAlpha=1),h=requestAnimationFrame(g)};return g(),()=>cancelAnimationFrame(h)},[e,r]),(0,n.jsx)(`div`,{"data-testid":a,style:{position:`relative`,width:rt,height:it},children:(0,n.jsx)(`canvas`,{ref:c,role:`img`,"aria-label":`Quotation balance — accepted vs submitted quotation value`,style:{width:rt,height:it,display:`block`}})})}var ot=680,q=280;function st({points:e=[],"data-testid":r}){let a=(0,t.useRef)(null),s=(0,t.useRef)(new Map),c=(0,t.useRef)(0),{hoveredRef:u,tooltip:d,hitZonesRef:m}=v(a,{width:ot,height:q}),h=(0,t.useMemo)(()=>e.filter(e=>typeof e==`object`&&!!e),[e]);return(0,t.useEffect)(()=>{let e=a.current;if(!e)return;let t=f(e,ot,q);c.current=0;let n=ot-54-28,r=q-30-54,d=Math.max(...h.map(e=>e.count),1),_=h.length,v=_>1?n/(_-1):n,b=h.map((e,t)=>({x:54+t*v,y:30+r-e.count/d*r,point:e})),S,C=()=>{c.current++;let e=c.current;t.clearRect(0,0,ot,q),t.letterSpacing=o.letterSpacing;let a=x(Math.min(e/72,1));D(s.current,u.current),m.current=[],[.25,.5,.75,1].forEach(e=>{let a=30+r-e*r;t.strokeStyle=l(i.bd,.18),t.lineWidth=1,t.setLineDash([3,5]),t.beginPath(),t.moveTo(54,a),t.lineTo(54+n,a),t.stroke(),t.setLineDash([]),t.font=o.font,t.fillStyle=o.color,t.textAlign=`right`,t.fillText(String(Math.round(d*e)),48,a+3)}),t.save(),t.translate(12,30+r/2),t.rotate(-Math.PI/2),t.font=o.font,t.fillStyle=o.color,t.textAlign=`center`,t.fillText(`Submissions`,0,0),t.restore(),t.font=o.font,t.fillStyle=o.color,t.textAlign=`center`,t.fillText(`Week`,54+n/2,q-6),t.strokeStyle=l(i.bd,.3),t.lineWidth=1,t.setLineDash([]),t.beginPath(),t.moveTo(54,30+r),t.lineTo(54+n,30+r),t.stroke();let f=a*(_-1),h=Math.floor(f)+1;if(h>=2){t.beginPath(),t.moveTo(b[0].x,30+r),t.lineTo(b[0].x,b[0].y);for(let e=1;e<h;e++){let n=f-Math.floor(f),r=e<h-1?b[e].x:b[e-1].x+(b[e].x-b[e-1].x)*(e===Math.ceil(f)?n:1),i=e<h-1?b[e].y:b[e-1].y+(b[e].y-b[e-1].y)*(e===Math.ceil(f)?n:1);t.lineTo(r,i)}let e=b[Math.min(h-1,_-1)];t.lineTo(e.x,30+r),t.closePath();let n=t.createLinearGradient(0,30,0,30+r);n.addColorStop(0,l(i.blue,.22)),n.addColorStop(1,l(i.blue,.02)),t.fillStyle=n,t.fill()}t.beginPath();for(let e=0;e<h;e++){let n=f-Math.floor(f),r=e===h-1&&e>0&&e===Math.ceil(f),i=e===0||e<h-1?b[e].x:b[e-1].x+(b[e].x-b[e-1].x)*(r?n:1),a=e===0||e<h-1?b[e].y:b[e-1].y+(b[e].y-b[e-1].y)*(r?n:1);e===0?t.moveTo(i,a):t.lineTo(i,a)}t.strokeStyle=l(i.blue,.85),t.lineWidth=2,t.stroke(),b.forEach((e,n)=>{if(n>=h)return;let a=`pt-${n}`,c=s.current.get(a)??0;y(m.current,a,e.x,e.y,10,{label:e.point.week,value:String(e.point.count),color:i.blue}),c>0&&g(t,e.x,30,30+r,l(i.blue,.15*c));let u=e.point.count===d;(c>0||u)&&p(t,e.x,e.y,14,i.blue,(u?.3:0)+c*.25),t.beginPath(),t.arc(e.x,e.y,c>0?5:3.5,0,Math.PI*2),t.fillStyle=l(i.blue,c>0?1:.8),t.fill(),(c>0||u)&&(t.font=o.font,t.fillStyle=i.blue,t.textAlign=`center`,t.fillText(String(e.point.count),e.x,e.y-10)),t.font=o.font,t.fillStyle=c>0?i.blue:o.color,t.textAlign=`center`,t.fillText(e.point.week,e.x,q-54+14)}),S=requestAnimationFrame(C)};return C(),()=>cancelAnimationFrame(S)},[h]),h.length<2?(0,n.jsx)(F,{width:ot,height:q,"data-testid":r}):(0,n.jsx)(`div`,{"data-testid":r,className:`trend-scroll`,style:{width:`100%`,overflowX:`auto`},children:(0,n.jsxs)(`div`,{style:{position:`relative`,width:ot,height:q},children:[(0,n.jsx)(`canvas`,{ref:a,role:`img`,"aria-label":`Trend chart — count over time`,style:{width:ot,height:q,display:`block`}}),(0,n.jsx)(_,{...d,parentW:ot,parentH:q})]})})}var ct=680,J=280,lt=54,ut=48,dt=64,ft=o.font,pt=12,mt=Math.PI*2,ht=72,gt=20,_t=5e3;function vt({points:e=[],"data-testid":r}){let a=(0,t.useRef)(null),s=(0,t.useRef)(null),c=(0,t.useRef)(0),u=(0,t.useMemo)(()=>e.filter(e=>typeof e==`object`&&!!e),[e]),d=(0,t.useMemo)(()=>{if(u.length<=1)return dt;let e=document.createElement(`canvas`).getContext(`2d`);if(!e)return dt;e.font=ft;let t=Math.max(1,Math.ceil(u.length/gt)),n=Math.max(...u.filter((e,n)=>n%t===0).map(t=>e.measureText(t.week).width));return Math.max(dt,n+pt)},[u]),p=Math.round(d/2),m=ut+p+Math.max(0,u.length-1)*d,h=Math.max(ct-lt,Math.min(m,_t)),{tooltip:g,hitZonesRef:b}=v(a,{width:h,height:J});return(0,t.useEffect)(()=>{let e=a.current;if(!e)return;let t=f(e,h,J),n=s.current?f(s.current,lt,J):null;c.current=0;let r=u.length<=ht?ht:Math.max(24,Math.round(ht*(ht/u.length))),m=h-ut,g=J-42-54,_=u.length>0?u.map(e=>e.count):[0],v=Math.min(..._),S=Math.max(..._),C=S-v||1,w=u.length,T=w>1?(m-p)/(w-1):m-p,E=Math.max(1,Math.ceil(d/T)),D=v<0,O=D?42+g- -v/C*g:42+g,k=u.map((e,t)=>({x:p+t*T,y:42+g-(D?(e.count-v)/C:e.count/(S||1))*g,point:e}));if(n){n.clearRect(0,0,lt,J),n.letterSpacing=o.letterSpacing;let e=D?[v,v+C*.25,v+C*.5,v+C*.75,S]:[0,S*.25,S*.5,S*.75,S];e.forEach((t,r)=>{let i=r/(e.length-1),a=42+g-i*g;n.font=o.font,n.fillStyle=o.color,n.textAlign=`right`,n.fillText(U(t),lt-6,a+3)}),n.save(),n.translate(12,42+g/2),n.rotate(-Math.PI/2),n.font=o.font,n.fillStyle=o.color,n.textAlign=`center`,n.fillText(`Count`,0,0),n.restore()}let A=t.createLinearGradient(0,42,0,42+g);A.addColorStop(0,l(i.blue,.22)),A.addColorStop(1,l(i.blue,.02));let j=0,M,N=e=>{t.font=ft,t.fillStyle=o.color,t.textAlign=`center`;for(let n=0;n<e;n++)n%E===0&&t.fillText(k[n].point.week,k[n].x,J-54+14)},P=()=>{c.current++;let e=Math.min(c.current/r,1),n=x(e),a=e>=1;t.clearRect(0,0,h,J),t.letterSpacing=o.letterSpacing,(D?[0,.25,.5,.75,1]:[.25,.5,.75,1]).forEach(e=>{let n=42+g-e*g;t.strokeStyle=l(i.bd,.18),t.lineWidth=1,t.setLineDash([3,5]),t.beginPath(),t.moveTo(0,n),t.lineTo(m,n),t.stroke(),t.setLineDash([])}),t.font=o.font,t.fillStyle=o.color,t.textAlign=`center`,t.fillText(`Period`,p+(m-p)/2,J-6),t.strokeStyle=l(i.bd,D?.5:.3),t.lineWidth=D?2:1,t.beginPath(),t.moveTo(p,D?O:42+g),t.lineTo(m,D?O:42+g),t.stroke();let s=n*(w-1),u=Math.floor(s)+1;if(u>=2){let e=D?O:42+g;t.beginPath(),t.moveTo(k[0].x,e),t.lineTo(k[0].x,k[0].y);for(let e=1;e<u;e++){let n=s-Math.floor(s),r=e===u-1&&e===Math.ceil(s)&&n>0,i=r?k[e-1].x+(k[e].x-k[e-1].x)*n:k[e].x,a=r?k[e-1].y+(k[e].y-k[e-1].y)*n:k[e].y;t.lineTo(i,a)}t.lineTo(k[u-1].x,e),t.closePath(),t.fillStyle=A,t.fill()}t.beginPath();for(let e=0;e<u;e++){let n=s-Math.floor(s),r=e===u-1&&e>0&&e===Math.ceil(s)&&n>0,i=r?k[e-1].x+(k[e].x-k[e-1].x)*n:k[e].x,a=r?k[e-1].y+(k[e].y-k[e-1].y)*n:k[e].y;e===0?t.moveTo(i,a):t.lineTo(i,a)}t.strokeStyle=l(i.blue,.85),t.lineWidth=2,t.stroke(),t.fillStyle=l(i.blue,.8),t.beginPath();for(let e=0;e<u;e++)t.moveTo(k[e].x+3.5,k[e].y),t.arc(k[e].x,k[e].y,3.5,0,mt);if(t.fill(),u>j){b.current=[];for(let e=0;e<u;e++)y(b.current,`pt-${e}`,k[e].x,k[e].y,10,{label:k[e].point.week,value:String(k[e].point.count),color:i.blue});j=u}a&&N(w),a||(M=requestAnimationFrame(P))};return P(),()=>cancelAnimationFrame(M)},[u,h,d,b]),u.length<2?(0,n.jsx)(F,{width:ct,height:J,"data-testid":r}):(0,n.jsxs)(`div`,{"data-testid":r,style:{position:`relative`,width:`100%`,display:`flex`},children:[(0,n.jsx)(`canvas`,{ref:s,"aria-hidden":`true`,style:{width:lt,height:J,display:`block`,flexShrink:0}}),(0,n.jsx)(`div`,{className:`trend-scroll`,style:{flex:1,minWidth:0,overflowX:`auto`},children:(0,n.jsxs)(`div`,{style:{position:`relative`,width:h,height:J},children:[(0,n.jsx)(`canvas`,{ref:a,role:`img`,"aria-label":`Trend chart — count over time`,style:{width:h,height:J,display:`block`}}),(0,n.jsx)(_,{...g,parentW:h,parentH:J})]})})]})}var yt=680,bt=240,xt=28,St=156;function Ct(e,t,n){if(e.measureText(t).width<=n)return t;let r=t;for(;r.length>0&&e.measureText(`${r}…`).width>n;)r=r.slice(0,-1);return`${r}…`}var wt={Critical:i.red,High:i.orange,Medium:i.amber,Low:i.green};function Tt({severities:e=[],"data-testid":r}){let a=(0,t.useRef)(null),c=(0,t.useRef)(new Map),u=(0,t.useRef)(0),d=(0,t.useMemo)(()=>e.filter(e=>typeof e==`object`&&!!e),[e]),m=d.length>0?Math.min(yt,2*xt+d.length*St):yt,{hoveredRef:h,tooltip:g,hitZonesRef:y}=v(a,{width:m,height:bt});return(0,t.useEffect)(()=>{let e=a.current;if(!e)return;let t=f(e,m,bt);u.current=0;let n=d.reduce((e,t)=>e+(t.count??0),0),r=xt,g=xt,_=m-r-g,v=bt-50-52,x=d.map(e=>(e.count??0)/(n||1)*_),C,w=()=>{u.current++;let e=u.current;t.clearRect(0,0,m,bt),t.letterSpacing=o.letterSpacing;let a=S(Math.min(e/60,1));D(c.current,h.current),y.current=[],t.strokeStyle=l(i.bd,.2),t.lineWidth=1,t.beginPath(),t.rect(r,50,_,v),t.stroke(),t.strokeStyle=l(i.t2,.15),t.lineWidth=1,t.setLineDash([4,4]),t.beginPath(),t.moveTo(m/2,50),t.lineTo(m/2,50+v),t.stroke(),t.setLineDash([]);let f=r;d.forEach((e,r)=>{let u=wt[e.severity]??i.blue,d=x[r],m=c.current.get(e.severity)??0,h=f+d/2,g=d*.85,_=d*a,S=g*a,C=h-S/2;if(_>0&&(m>0&&p(t,f+_/2,50+v/2,_*.4,u,.15*m),t.beginPath(),t.moveTo(C,50),t.lineTo(C+S,50),t.lineTo(f+_,50+v),t.lineTo(f,50+v),t.closePath(),t.fillStyle=l(u,.45+m*.25),t.fill(),t.strokeStyle=l(u,(.5+m*.3)*a),t.lineWidth=m>0?2:1,t.beginPath(),t.moveTo(C,50),t.lineTo(C+S,50),t.stroke(),t.strokeStyle=l(u,(.3+m*.3)*a),t.lineWidth=m>0?2:1,t.beginPath(),t.moveTo(f,50+v),t.lineTo(f+_,50+v),t.stroke()),b(y.current,e.severity,f,50,d,v,{label:e.severity,value:U(e.count??0),sublabel:`${Math.round((e.count??0)/(n||1)*100)}%`,color:u}),a>.5){let r=Math.min(1,(a-.5)/.5),c=f+d/2;t.globalAlpha=r,t.font=o.font,t.fillStyle=m>0?u:l(u,.9),t.textAlign=`center`,t.fillText(Ct(t,e.severity,d-12),c,38),t.font=s.font,t.fillStyle=m>0?i.t1:l(i.t1,.85),t.fillText(U(e.count??0),c,50+v/2+6),t.font=o.font,t.fillStyle=m>0?u:o.color,t.fillText(`${Math.round((e.count??0)/(n||1)*100)}%`,c,50+v+18),t.globalAlpha=1}f+=d});let g=t.createLinearGradient(r,0,r+_,0);g.addColorStop(0,l(i.red,.03)),g.addColorStop(.33,l(i.orange,.03)),g.addColorStop(.66,l(i.amber,.03)),g.addColorStop(1,l(i.green,.03)),t.fillStyle=g,t.fillRect(r,50,_*a,v),C=requestAnimationFrame(w)};return w(),()=>cancelAnimationFrame(C)},[d,m]),d.length===0?(0,n.jsx)(F,{width:m,height:bt,"data-testid":r}):(0,n.jsxs)(`div`,{"data-testid":r,style:{position:`relative`,width:m,height:bt},children:[(0,n.jsx)(`canvas`,{ref:a,role:`img`,"aria-label":`Early Warning severity distribution — prism spectrum bands`,style:{width:m,height:bt,display:`block`}}),(0,n.jsx)(_,{...g,parentW:m,parentH:bt})]})}var Y=300,X=280,Et=100,Dt={Open:i.red,Submitted:i.amber,Closed:i.green};function Ot({segments:e=[],title:r,unitLabel:a=``,"data-testid":c}){let u=(0,t.useRef)(null),d=(0,t.useRef)(0),g=(0,t.useRef)(new Map),{hoveredRef:b,tooltip:x,hitZonesRef:S}=v(u,{width:Y,height:X}),C=(0,t.useMemo)(()=>e.filter(e=>typeof e==`object`&&!!e),[e]);return(0,t.useEffect)(()=>{let e=u.current;if(!e)return;let t=f(e,Y,X);d.current=0;let n=Y*.5,c=X*.56,_=Et,v=C.reduce((e,t)=>e+(t.count??0),0),x=Math.max(...C.map(e=>e.count??0),1),w,T=()=>{d.current++;let e=d.current;t.clearRect(0,0,Y,X),t.letterSpacing=o.letterSpacing,S.current=[],g.current.forEach((e,t)=>{let n=t===b.current?1:0,r=e+(n-e)*.12;Math.abs(r-n)<.005?n===0?g.current.delete(t):g.current.set(t,1):g.current.set(t,r)}),b.current&&!g.current.has(b.current)&&g.current.set(b.current,0),m(t,Y,X,e,40,l(i.blue,.04)),C.forEach((r,a)=>{let o=a/3*Math.PI*2-Math.PI/2,u=n+Math.cos(o)*_,d=c+Math.sin(o)*_,f=Dt[r.status]??i.blue,m=2+r.count/x*8;t.beginPath(),t.moveTo(n,c),t.lineTo(u,d),t.strokeStyle=l(f,.08),t.lineWidth=m*2,t.stroke(),t.beginPath(),t.moveTo(n,c),t.lineTo(u,d),t.strokeStyle=l(f,.25),t.lineWidth=1,t.stroke();let h=(e*.005+a*.33)%1,g=n+(u-n)*h,v=c+(d-c)*h;p(t,g,v,6,f,.4),t.beginPath(),t.arc(g,v,2,0,Math.PI*2),t.fillStyle=l(f,.8),t.fill();let y=(n+u)/2,b=(c+d)/2;t.font=s.font,t.textAlign=`center`,t.textBaseline=`middle`,t.fillStyle=l(f,.85),t.fillText(String(r.count),y,b)}),C.forEach((e,r)=>{let s=r/3*Math.PI*2-Math.PI/2,u=n+Math.cos(s)*_,d=c+Math.sin(s)*_,f=Dt[e.status]??i.blue,m=10+e.count/x*18,h=g.current.get(e.status)??0;p(t,u,d,m*2.5,f,.2+h*.15);let b=t.createRadialGradient(u,d-m*.2,0,u,d,m);b.addColorStop(0,l(f,.8+h*.2)),b.addColorStop(1,l(f,.4+h*.1)),t.beginPath(),t.arc(u,d,m,0,Math.PI*2),t.fillStyle=b,t.fill(),t.font=`bold `+o.font,t.textAlign=`center`,t.textBaseline=`middle`,t.fillStyle=l(i.t1,.9),t.fillText(e.status,u,d),y(S.current,e.status,u,d,m+6,{label:e.status,value:a?`${e.count} ${a}`:String(e.count),sublabel:`${Math.round((e.count??0)/(v||1)*100)}%`,color:f})});let u=g.current.get(`center`)??0;p(t,n,c,36,i.t2,.2+u*.15);let f=t.createRadialGradient(n,c-4,0,n,c,22);f.addColorStop(0,l(i.t2,.9)),f.addColorStop(1,l(i.t2,.5)),t.beginPath(),t.arc(n,c,22,0,Math.PI*2),t.fillStyle=f,t.fill(),t.font=s.font,t.textAlign=`center`,t.textBaseline=`middle`,t.fillStyle=l(i.t1,.9),t.fillText(r??``,n,c-4),t.font=`bold `+o.font,t.fillStyle=i.t1,t.fillText(String(v),n,c+8),y(S.current,`center`,n,c,28,{label:r??`Total`,value:a?`${v} ${a}`:String(v),color:i.t2}),h(t,Y,X,e,.015),w=requestAnimationFrame(T)};return T(),()=>cancelAnimationFrame(w)},[C,r,a]),C.length===0?(0,n.jsx)(F,{width:Y,height:X,"data-testid":c}):(0,n.jsxs)(`div`,{"data-testid":c,style:{position:`relative`,width:Y,height:X},children:[(0,n.jsx)(`canvas`,{ref:u,role:`img`,"aria-label":r??`EW status arc visualization`,style:{width:Y,height:X,display:`block`,borderRadius:8}}),(0,n.jsx)(_,{...x,parentW:Y,parentH:X})]})}var kt=280,Z=96;function At({points:e=[],className:a,colors:o}){let s=(0,t.useRef)(null),c=(0,t.useRef)(new Map),u=(0,t.useRef)(0),d=(0,t.useMemo)(()=>e.filter(Array.isArray).map(([e,t])=>{let n=String(t).match(/-?\d+(\.\d+)?/);return{label:e,value:n?Number(n[0]):0}}),[e]),{mouseRef:m,hoveredRef:h,tooltip:b,hitZonesRef:x}=v(s,{width:kt,height:Z});return(0,t.useEffect)(()=>{let e=s.current;if(!e)return;let t=f(e,kt,Z);u.current=0;let n=o?.line??i.blue,r=o?.point??i.blue,a=o?.axisLine??i.bd,_,v=()=>{u.current++;let e=u.current;if(t.clearRect(0,0,kt,Z),d.length<2){_=requestAnimationFrame(v);return}let o={left:12,right:12,top:16,bottom:20},s=kt-o.left-o.right,f=Z-o.top-o.bottom,b=d.map(e=>e.value),S=Math.min(...b),C=Math.max(...b)-S||1,w=e=>o.left+e/(d.length-1)*s,E=e=>o.top+(1-(e-S)/C)*f,O=1-(1-Math.min(e/48,1))**3,k=Math.max(2,Math.floor(O*d.length));if(D(c.current,h.current),x.current=[],t.strokeStyle=l(a,.3),t.lineWidth=.5,t.setLineDash([]),t.beginPath(),t.moveTo(o.left,Z-o.bottom),t.lineTo(kt-o.right,Z-o.bottom),t.stroke(),t.font=`9px 'JetBrains Mono', monospace`,t.fillStyle=l(i.t4,.9),t.textAlign=`center`,d.forEach((e,n)=>{t.fillText(e.label.replace(`Day `,`D`),w(n),Z-4)}),m.current.over&&h.current){let e=parseInt(h.current.split(`-`)[1]);isNaN(e)||g(t,w(e),o.top,o.top+f)}if(k>1){let e=t.createLinearGradient(0,o.top,0,o.top+f);e.addColorStop(0,l(n,.15)),e.addColorStop(1,l(n,0)),t.fillStyle=e,t.beginPath(),t.moveTo(w(0),o.top+f);for(let e=0;e<k;e++)t.lineTo(w(e),E(d[e].value));t.lineTo(w(k-1),o.top+f),t.closePath(),t.fill(),t.strokeStyle=l(n,.8),t.lineWidth=1.5,t.setLineDash([]),t.beginPath();for(let e=0;e<k;e++){let n=w(e),r=E(d[e].value);e===0?t.moveTo(n,r):t.lineTo(n,r)}t.stroke()}for(let e=0;e<k;e++){let n=w(e),a=E(d[e].value),o=`tp-${e}`,s=c.current.get(o)??0,u=e===d.length-1;y(x.current,o,n,a,10,{label:d[e].label,value:String(d[e].value),color:u?i.red:r}),s>0&&!u&&(p(t,n,a,12*s,r,.2*s),t.fillStyle=l(r,.8),t.beginPath(),t.arc(n,a,3+s*2,0,Math.PI*2),t.fill())}if(k>=d.length){let n=d.length-1,r=w(n),a=E(d[n].value),o=c.current.get(`tp-${n}`)??0,s=T(e,.05,5e-4),u=1+o*.5;t.shadowColor=l(i.red,.5),t.shadowBlur=(8+s*4)*u,t.fillStyle=i.red,t.beginPath(),t.arc(r,a,(3.5+s*1.5)*u,0,Math.PI*2),t.fill(),t.shadowBlur=0}_=requestAnimationFrame(v)};return v(),()=>cancelAnimationFrame(_)},[d,o]),(0,n.jsx)(r,{className:[`canvas-trend-frame`,a].filter(Boolean).join(` `),children:(0,n.jsxs)(`div`,{style:{position:`relative`,width:kt,height:Z},children:[(0,n.jsx)(`canvas`,{ref:s,role:`img`,"aria-label":`trend chart`,style:{width:kt,height:Z,display:`block`,borderRadius:8}}),(0,n.jsx)(_,{...b,parentW:kt,parentH:Z})]})})}function jt(e,t,n){if(e.measureText(t).width<=n)return t;let r=t;for(;r.length>0&&e.measureText(r+`…`).width>n;)r=r.slice(0,-1);return r+`…`}var Mt=680,Nt=8,Pt=26,Ft=14,It=16,Lt=32;function Rt({items:e=[],"data-testid":r}){let a=(0,t.useRef)(null),u=(0,t.useRef)(new Map),d=(0,t.useRef)(0),[m,h]=(0,t.useState)(!1),g=(0,t.useMemo)(()=>e.filter(e=>typeof e==`object`&&!!e),[e]),y=(0,t.useMemo)(()=>m?g:g.slice(0,Nt),[g,m]),x=It+Lt+y.length*(Pt+Ft)-Ft,{hoveredRef:C,tooltip:w,hitZonesRef:T}=v(a,{width:Mt,height:x});return(0,t.useEffect)(()=>{let e=a.current;if(!e)return;let t=f(e,Mt,x);d.current=0;let n=It,r=Lt,m=Pt,h=Ft,g=Mt-150-28,_=Math.max(...y.map(e=>(e.implemented??0)+(e.unimplemented??0)),1),v=y.length*(m+h)-h,w=n+(x-n-r-v)/2,O,k=()=>{d.current++;let e=d.current;t.clearRect(0,0,Mt,x);let n=S(Math.min(e/60,1));D(u.current,C.current),T.current=[],y.forEach((e,r)=>{let a=E(n,r,y.length,S),c=w+r*(m+h),d=(e.implemented??0)+(e.unimplemented??0),f=(e.implemented??0)/_*g*a,v=(e.unimplemented??0)/_*g*a,x=`${e.id}-impl`,C=`${e.id}-un`,D=u.current.get(x)??0,O=u.current.get(C)??0;b(T.current,x,150,c,f||1,m,{label:e.name,value:U(e.implemented??0),sublabel:`${Math.round((e.implemented??0)/(d||1)*100)}%`,color:i.green}),b(T.current,C,150+f,c,v||1,m,{label:e.name,value:U(e.unimplemented??0),sublabel:`${Math.round((e.unimplemented??0)/(d||1)*100)}%`,color:i.amber}),t.font=o.font,t.fillStyle=i.t2,t.textAlign=`right`,t.fillText(jt(t,e.abbreviation??e.name??``,134),142,c+m/2+4),b(T.current,x,0,c,150,m,{label:e.name??e.abbreviation??``,value:`${U((e.implemented??0)+(e.unimplemented??0))} total variations`,sublabel:`Implemented: ${U(e.implemented??0)} · Pending: ${U(e.unimplemented??0)}`,color:i.green}),t.fillStyle=l(i.bd,.15),t.beginPath(),t.roundRect(150,c,d/_*g,m,4),t.fill(),f>0&&(D>0&&p(t,150+f/2,c+m/2,f*.3,i.green,.12*D),t.fillStyle=l(i.green,.6+D*.2),t.beginPath(),t.roundRect(150,c,f,m,[4,0,0,4]),t.fill(),f>28&&a>.5&&(t.font=s.font,t.fillStyle=D>0?i.green:i.t2,t.textAlign=`center`,t.fillText(U(e.implemented??0),150+f/2,c+m/2+4))),v>0&&(O>0&&p(t,150+f+v/2,c+m/2,v*.3,i.amber,.12*O),t.fillStyle=l(i.amber,.18+O*.18),t.strokeStyle=l(i.amber,.3+O*.3),t.lineWidth=1,t.beginPath(),t.roundRect(150+f,c,v,m,[0,4,4,0]),t.fill(),t.stroke(),v>28&&a>.5&&(t.font=s.font,t.fillStyle=O>0?i.amber:i.t2,t.textAlign=`center`,t.fillText(U(e.unimplemented??0),150+f+v/2,c+m/2+4))),f>0&&v>0&&(t.strokeStyle=l(i.bg,.7),t.lineWidth=2,t.beginPath(),t.moveTo(150+f,c),t.lineTo(150+f,c+m),t.stroke())});let r=w+v+24,a=150+g/2;t.font=c.font,t.textAlign=`right`,t.fillStyle=i.green,t.fillText(`■ Implemented`,a-10,r),t.textAlign=`left`,t.fillStyle=c.color,t.fillText(`■ Unimplemented`,a+10,r),O=requestAnimationFrame(k)};return k(),()=>cancelAnimationFrame(O)},[y,x]),g.length===0?(0,n.jsx)(F,{width:Mt,height:160,"data-testid":r}):(0,n.jsxs)(`div`,{"data-testid":r,style:{width:Mt},children:[(0,n.jsxs)(`div`,{style:{position:`relative`,width:Mt,height:x},children:[(0,n.jsx)(`canvas`,{ref:a,role:`img`,"aria-label":`Implemented vs unimplemented variations per contractor — split bar`,style:{width:Mt,height:x,display:`block`}}),(0,n.jsx)(_,{...w,parentW:Mt,parentH:x})]}),g.length>Nt&&(0,n.jsx)(`div`,{style:{marginTop:8},children:(0,n.jsx)(ee,{expanded:m,onToggle:()=>h(e=>!e)})})]})}var zt=800,Bt=360;function Vt({items:e=[],"data-testid":r}){let c=(0,t.useRef)(null),u=(0,t.useRef)(new Map),d=(0,t.useRef)(0),{hoveredRef:m,tooltip:h,hitZonesRef:g}=v(c,{width:zt,height:Bt});return(0,t.useEffect)(()=>{let t=c.current;if(!t)return;let n=f(t,zt,Bt);d.current=0;let r=e.reduce((e,t)=>e+(t.base??0),0),h=e.reduce((e,t)=>e+(t.variation??0),0),_=e.reduce((e,t)=>e+(t.total??0),0),v=Bt-20-26,y=v-6*(e.length-1),S=20,C=e.map((e,t)=>{let n=Math.max(24,(e.total??0)/(_||1)*y),r={x:100-110/2,y:S,h:n,cy:S+n/2,c:e,color:a[t%a.length]};return S+=n+6,r}),w=y-14,T=Math.max(28,r/(_||1)*w),O=Math.max(18,h/(_||1)*w),k=20+(v-(T+O+14))/2,A={x:420-110/2,y:k,h:T,cy:k+T/2},j={x:420-110/2,y:k+T+14,h:O,cy:k+T+14+O/2},M={x:720-110/2,y:20,h:v,cy:20+v/2},N,P=()=>{d.current++;let t=d.current;n.clearRect(0,0,zt,Bt),n.letterSpacing=o.letterSpacing;let a=x(Math.min(t/80,1));if(D(u.current,m.current),g.current=[],e.forEach((t,i)=>{let o=C[i],s=E(a,i,e.length,x),c=u.current.get(t.id)??0;if(s<.01)return;let l=(t.base??0)/(t.total||1),d=(t.variation??0)/(t.total||1),f=o.h*l,p=o.h*d,m=o.y+f/2,g=o.y+f+p/2,_=Math.max(2,(t.base??0)/r*T),v=Math.max(2,(t.variation??0)/h*O),y=A.y+e.slice(0,i).reduce((e,t)=>e+(t.base??0)/r*T,0)+_/2,b=j.y+e.slice(0,i).reduce((e,t)=>e+(t.variation??0)/h*O,0)+v/2,S=c*.2+.18;Ht(n,o.x+110,m,420-110/2,y,_*s,o.color,S),Ht(n,o.x+110,g,420-110/2,b,v*s,o.color,S*.75)}),a>.3){let e=Math.min(1,(a-.3)/.7),t=M.y+r/_*v/2,o=M.y+v-h/_*v/2;Ht(n,475,A.cy,720-110/2,t,T*e,i.blue,.25*e),Ht(n,475,j.cy,720-110/2,o,O*e,i.amber,.22*e)}if([`Contractors`,`Components`,`Total`].forEach((e,t)=>{let r=[100,420,720][t];n.font=o.font,n.fillStyle=o.color,n.textAlign=`center`,n.fillText(e,r,Bt-8)}),e.forEach((t,r)=>{let s=C[r],c=E(a,r,e.length,x),d=u.current.get(t.id)??0;b(g.current,t.id,s.x,s.y,110,s.h,{label:t.name,value:t.totalLabel??String(t.total??0),sublabel:`${t.baseLabel??String(t.base??0)} + ${t.variationLabel??String(t.variation??0)}`,color:s.color}),d>0&&p(n,s.x+110/2,s.cy,110*.6,s.color,.12*d),n.fillStyle=l(s.color,(.3+d*.15)*c),n.strokeStyle=l(s.color,(.55+d*.25)*c),n.lineWidth=1,n.beginPath(),n.roundRect(s.x,s.y,110*c,s.h,4),n.fill(),n.stroke(),c>.6&&s.h>=24&&(n.globalAlpha=Math.min(1,(c-.6)/.4),n.font=o.font,n.fillStyle=d>0?s.color:l(i.t2,.9),n.textAlign=`center`,n.textBaseline=`middle`,n.fillText(t.abbreviation??t.name?.slice(0,6)??``,s.x+110/2,s.h>=36?s.cy-5:s.cy),s.h>=36&&(n.font=`400 12px 'Satoshi Variable', 'DM Sans', sans-serif`,n.fillStyle=l(i.t3,.8),n.fillText(t.totalLabel??String(t.total??0),s.x+110/2,s.cy+7)),n.globalAlpha=1,n.textBaseline=`alphabetic`)}),a>.2){let e=Math.min(1,(a-.2)/.4);p(n,420,A.cy,30,i.blue,.1*e),n.fillStyle=l(i.blue,.3*e),n.strokeStyle=l(i.blue,.5*e),n.lineWidth=1,n.beginPath(),n.roundRect(A.x,A.y,110,A.h*e,4),n.fill(),n.stroke(),n.globalAlpha=e,n.textBaseline=`middle`,n.font=o.font,n.fillStyle=i.blue,n.textAlign=`center`,n.fillText(`Base Value`,420,A.cy-6),n.font=s.font,n.fillStyle=s.color,n.fillText(U(r),420,A.cy+8),n.globalAlpha=1,n.textBaseline=`alphabetic`,p(n,420,j.cy,24,i.amber,.1*e),n.fillStyle=l(i.amber,.22*e),n.strokeStyle=l(i.amber,.4*e),n.beginPath(),n.roundRect(j.x,j.y,110,j.h*e,4),n.fill(),n.stroke(),n.globalAlpha=e,n.textBaseline=`middle`,n.font=o.font,n.fillStyle=i.amber,n.textAlign=`center`,n.fillText(`Variations`,420,j.cy-4),n.font=s.font,n.fillStyle=s.color,n.fillText(U(h),420,j.cy+8),n.globalAlpha=1,n.textBaseline=`alphabetic`}if(a>.5){let e=Math.min(1,(a-.5)/.5);p(n,720,M.cy,44,i.blue,.2*e),n.fillStyle=l(i.blue,.25*e),n.strokeStyle=l(i.blue,.6*e),n.lineWidth=1.5,n.beginPath(),n.roundRect(M.x,M.y,110,M.h*e,6),n.fill(),n.stroke(),n.globalAlpha=e,n.textBaseline=`middle`,n.font=o.font,n.fillStyle=i.t2,n.textAlign=`center`,n.fillText(`Total Commitment`,720,M.cy-12),n.font=s.font,n.fillStyle=i.blue,n.fillText(U(_),720,M.cy+6),n.globalAlpha=1,n.textBaseline=`alphabetic`}N=requestAnimationFrame(P)};return P(),()=>cancelAnimationFrame(N)},[e]),(0,n.jsxs)(`div`,{"data-testid":r,style:{position:`relative`,width:zt,height:Bt},children:[(0,n.jsx)(`canvas`,{ref:c,role:`img`,"aria-label":`Weekly report flow — base value and variations per contractor flowing to total commitment`,style:{width:zt,height:Bt,display:`block`}}),(0,n.jsx)(_,{...h,parentW:zt,parentH:Bt})]})}function Ht(e,t,n,r,i,a,o,s){let c=(t+r)/2;e.beginPath(),e.moveTo(t,n-a/2),e.bezierCurveTo(c,n-a/2,c,i-a/2,r,i-a/2),e.lineTo(r,i+a/2),e.bezierCurveTo(c,i+a/2,c,n+a/2,t,n+a/2),e.closePath(),e.fillStyle=l(o,s),e.fill()}function Ut({config:e,className:t}){return e.type===`line`?(0,n.jsx)(Ne,{rows:e.rows,className:t}):e.type===`area`?(0,n.jsx)(j,{rows:e.rows,className:t}):e.type===`bar`?(0,n.jsx)(P,{rows:e.rows,className:t}):e.type===`pie`?(0,n.jsx)(Ge,{rows:e.rows,variant:`pie`,className:t}):e.type===`donut`?(0,n.jsx)(Ge,{rows:e.rows,variant:`donut`,className:t}):e.type===`sankey`?(0,n.jsx)(nt,{rows:e.rows,className:t}):e.type===`flow`?(0,n.jsx)(tt,{selectedEntity:e.selectedEntity,className:t}):e.type===`trend`?(0,n.jsx)(At,{points:e.points,className:t}):e.type===`mini-bars`?(0,n.jsx)(Ie,{rows:e.rows,className:t}):e.type===`stacked-horizontal-bar-chart`?(0,n.jsx)(we,{data:e.data??{items:e.items??[]}}):e.type===`multi-metric-constellation-chart`?(0,n.jsx)(_e,{items:e.items}):e.type===`progress-race-chart`?(0,n.jsx)(se,{items:e.items}):e.type===`hub-and-spoke-radial-chart`?(0,n.jsx)(Ot,{segments:e.segments,title:e.title,unitLabel:e.unitLabel}):e.type===`dot-matrix-chart`?(0,n.jsx)(Me,{items:e.items}):e.type===`ranked-card-leaderboard`?(0,n.jsx)(je,{items:e.items}):e.type===`proportional-band-chart`?(0,n.jsx)(Tt,{severities:e.severities}):e.type===`radial-fan-tree-chart`?(0,n.jsx)(Ve,{total:e.total,totalLabel:e.totalLabel,items:e.items}):e.type===`semi-circular-gauge-chart`?(0,n.jsx)(ue,{confirmed:e.confirmed,total:e.total,label:e.label}):e.type===`segmented-split-bar-chart`?(0,n.jsx)(Rt,{items:e.items}):e.type===`balance-scale-chart`?(0,n.jsx)(at,{left:e.left,right:e.right}):e.type===`area-line-chart`?(0,n.jsx)(st,{points:e.points}):e.type===`trend-view`?(0,n.jsx)(vt,{points:e.points}):e.type===`weekly-flow`?(0,n.jsx)(Vt,{items:e.items}):(0,n.jsx)(`div`,{className:`viz-empty`,children:`Visualization unavailable`})}var Wt=[];function Gt(e){try{return JSON.parse(decodeURIComponent(e))}catch{return null}}function Kt(){for(;Wt.length;){let e=Wt.pop();e&&e.unmount()}}function qt(){Kt(),document.querySelectorAll(`[data-d3-viz]`).forEach(t=>{let r=t.dataset.d3Viz;if(!r)return;let i=Gt(r);if(!i)return;let a=(0,e.createRoot)(t);Wt.push(a),a.render((0,n.jsx)(Ut,{config:i}))})}function Jt(e){return encodeURIComponent(JSON.stringify(e))}function Yt({rows:e=[],className:t,colors:r}){return(0,n.jsx)(Ge,{rows:e,variant:`donut`,className:t,colors:r})}var Q={bg:`transparent`,border:`transparent`,t1:i.t1,t2:i.t2,t3:i.t3,t4:i.t4,red:i.red,amber:i.amber,green:i.green},$=`'Satoshi Variable', 'DM Sans', sans-serif`,Xt={color:`#F7F7F7`,fontFamily:$,fontSize:24,fontWeight:500,lineHeight:`32px`},Zt={color:`#C2C2C2`,fontFamily:$,fontSize:18,fontWeight:400,lineHeight:`20px`};function Qt({items:e=[]}){let t=e.filter(e=>e.value);return t.length===0?null:(0,n.jsx)(`div`,{style:{display:`flex`,gap:8},children:t.map((e,t)=>(0,n.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`flex-start`,width:260,height:120,padding:`10px 0`,gap:8,flexShrink:0,rowGap:16,border:`1px solid ${Q.border}`,background:Q.bg,boxSizing:`border-box`},children:[(0,n.jsx)(`div`,{style:{...Xt,color:Q.t1},children:e.value}),(0,n.jsx)(`div`,{style:{...Zt},children:e.label})]},t))})}function $t({items:e=[]}){let t=e.filter(e=>e.name??e.value);return t.length===0?null:(0,n.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:5},children:t.map((e,t)=>(0,n.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,padding:`10px 0px`,background:Q.bg,border:`1px solid ${Q.border}`},children:[(0,n.jsx)(`span`,{style:{fontSize:18,fontWeight:500,color:Q.t2,background:`transparent`,padding:`2px 8px`,borderRadius:4,fontFamily:$,flexShrink:0},children:e.name}),(0,n.jsx)(`span`,{style:{...Xt,fontSize:18,color:Q.t1,minWidth:70,flexShrink:0},children:e.value}),(0,n.jsx)(`span`,{style:{...Zt,flex:1},children:e.kpiLabel})]},t))})}function en({items:e=[]}){let t=e.filter(e=>e.value);return t.length===0?null:(0,n.jsx)(`div`,{style:{display:`flex`,gap:8},children:t.map((e,t)=>(0,n.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`flex-start`,width:260,height:120,padding:`10px 0`,gap:8,flexShrink:0,background:Q.bg,boxSizing:`border-box`},children:[(0,n.jsx)(`div`,{style:{...Xt,color:Q.t1},children:e.value}),(0,n.jsx)(`div`,{style:{...Zt},children:e.label})]},t))})}var tn={red:Q.red,amber:Q.amber,green:Q.green};function nn({items:e=[]}){let t=e.filter(e=>e.text);return t.length===0?null:(0,n.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:5},children:t.map((e,t)=>(tn[e.severity],(0,n.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-start`,gap:10,padding:`10px 0px`,background:Q.bg,border:`1px solid ${Q.border}`},children:[(0,n.jsx)(`span`,{style:{width:7,height:7,borderRadius:`50%`,background:i.t2,flexShrink:0,marginTop:5}}),(0,n.jsx)(`span`,{style:{...Zt},children:e.text})]},t)))})}function rn({min:e,max:t,unit:r,dots:a=[],chips:o=[]}){let s=a.filter(e=>e.name);if(s.length===0)return null;let c=t-e;return(0,n.jsxs)(`div`,{children:[(0,n.jsxs)(`div`,{style:{position:`relative`,height:90,padding:`10px 0px`},children:[(0,n.jsx)(`div`,{style:{position:`absolute`,top:38,left:8,right:8,height:2,background:`rgba(255,255,255,0.08)`,borderRadius:1}}),(0,n.jsxs)(`div`,{style:{position:`absolute`,top:43,left:0,fontSize:16,color:Q.t4,fontFamily:$},children:[e,r]}),(0,n.jsxs)(`div`,{style:{position:`absolute`,top:43,right:0,fontSize:16,color:Q.t4,fontFamily:$},children:[t,r]}),s.map((t,a)=>{let o=(t.val-e)/c*100,s=t.color??i.blue,l=a%2==0;return(0,n.jsxs)(`div`,{style:{position:`absolute`,left:`${o}%`,top:0,transform:`translateX(-50%)`},children:[l&&(0,n.jsxs)(`div`,{style:{textAlign:`center`,marginBottom:2},children:[(0,n.jsx)(`div`,{style:{fontSize:18,color:s,fontFamily:$,whiteSpace:`nowrap`},children:t.name}),(0,n.jsxs)(`div`,{style:{fontSize:18,fontWeight:500,color:s,fontFamily:$,whiteSpace:`nowrap`},children:[t.val,r]})]}),(0,n.jsx)(`div`,{style:{width:10,height:10,borderRadius:`50%`,background:s,boxShadow:`0 0 8px ${s}70`,margin:l?`0 auto`:`26px auto 0`}}),!l&&(0,n.jsxs)(`div`,{style:{textAlign:`center`,marginTop:4},children:[(0,n.jsx)(`div`,{style:{fontSize:18,color:s,fontFamily:$,whiteSpace:`nowrap`},children:t.name}),(0,n.jsxs)(`div`,{style:{fontSize:18,fontWeight:500,color:s,fontFamily:$,whiteSpace:`nowrap`},children:[t.val,r]})]})]},a)})]}),o&&o.length>0&&(0,n.jsx)(en,{items:o})]})}function an({leftPct:e,leftLabel:t,leftValue:r,leftColor:a,rightPct:o,rightLabel:s,rightValue:c,rightColor:l,chips:u}){if(!t&&!s)return null;let d=a??i.blue,f=l??i.blue;return(0,n.jsxs)(`div`,{children:[(0,n.jsxs)(`div`,{style:{display:`flex`,borderRadius:6,overflow:`hidden`,height:36,margin:`10px 0`},children:[(0,n.jsx)(`div`,{style:{width:`${e}%`,background:d+`38`,display:`flex`,alignItems:`center`,justifyContent:`flex-end`,paddingRight:12},children:(0,n.jsx)(`span`,{style:{fontSize:18,fontWeight:500,color:Q.t2,fontFamily:$},children:r})}),(0,n.jsx)(`div`,{style:{width:1,background:`rgba(255,255,255,0.12)`,flexShrink:0}}),(0,n.jsx)(`div`,{style:{width:`${o}%`,background:f+`2A`,display:`flex`,alignItems:`center`,paddingLeft:12},children:(0,n.jsx)(`span`,{style:{fontSize:18,fontWeight:500,color:Q.t2,fontFamily:$},children:c})})]}),(0,n.jsxs)(`div`,{style:{display:`flex`,marginBottom:u?4:0},children:[(0,n.jsx)(`div`,{style:{width:`${e}%`},children:(0,n.jsxs)(`span`,{style:{fontSize:18,color:d,fontFamily:$},children:[e,`% `,t]})}),(0,n.jsx)(`div`,{style:{width:`${o}%`,paddingLeft:10},children:(0,n.jsxs)(`span`,{style:{fontSize:18,color:f,fontFamily:$},children:[o,`% `,s]})})]}),u&&u.length>0&&(0,n.jsx)(en,{items:u})]})}function on({pct:e,label:t,color:r,chips:a}){if(e==null&&!t)return null;let o=r??i.blue,s=2*Math.PI*30,c=s*(1-e/100);return(0,n.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:20},children:[(0,n.jsxs)(`div`,{style:{position:`relative`,flexShrink:0,width:80,height:80},children:[(0,n.jsxs)(`svg`,{width:80,height:80,style:{transform:`rotate(-90deg)`},children:[(0,n.jsx)(`circle`,{cx:40,cy:40,r:30,fill:`none`,stroke:`rgba(255,255,255,0.07)`,strokeWidth:8}),(0,n.jsx)(`circle`,{cx:40,cy:40,r:30,fill:`none`,stroke:o,strokeWidth:8,strokeDasharray:s,strokeDashoffset:c,strokeLinecap:`round`})]}),(0,n.jsx)(`div`,{style:{position:`absolute`,top:`50%`,left:`50%`,transform:`translate(-50%, -50%)`,textAlign:`center`},children:(0,n.jsxs)(`div`,{style:{fontSize:18,fontWeight:500,color:o,fontFamily:$},children:[e,`%`]})})]}),(0,n.jsxs)(`div`,{style:{flex:1},children:[(0,n.jsx)(`div`,{style:{...Zt,padding:`10px 0px`},children:t}),a&&(0,n.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:5},children:a.map((e,t)=>(0,n.jsxs)(`div`,{style:{display:`flex`,alignItems:`baseline`,gap:8,padding:`10px 10px`,background:Q.bg,border:`1px solid ${Q.border}`,borderRadius:5},children:[(0,n.jsx)(`span`,{style:{...Xt,color:Q.t2},children:e.value}),(0,n.jsx)(`span`,{style:{...Xt,color:Q.t2,fontWeight:400,userSelect:`none`},children:`|`}),(0,n.jsx)(`span`,{style:{...Zt},children:e.label})]},t))})]})]})}function sn({items:e=[]}){let t=e.filter(e=>e.name??e.value);return t.length===0?null:(0,n.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:5},children:t.map((e,t)=>(0,n.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,padding:`10px 0px`,background:Q.bg,border:`1px solid ${Q.border}`},children:[(0,n.jsx)(`span`,{style:{fontSize:18,fontWeight:500,color:Q.t2,background:`transparent`,padding:`2px 7px`,borderRadius:4,fontFamily:$,flexShrink:0,minWidth:62,textAlign:`center`},children:e.name}),(0,n.jsx)(`div`,{style:{flex:1,height:4,background:`rgba(255,255,255,0.07)`,borderRadius:2,overflow:`hidden`},children:(0,n.jsx)(`div`,{style:{height:`100%`,width:`${e.pct}%`,background:e.color??Q.t2,borderRadius:2,opacity:.75}})}),(0,n.jsx)(`span`,{style:{fontSize:18,fontWeight:400,color:Q.t2,fontFamily:$,flexShrink:0,minWidth:52,textAlign:`right`},children:e.value}),e.badge&&(0,n.jsx)(`span`,{style:{fontSize:18,fontWeight:500,color:Q.t1,background:`transparent`,padding:`2px 7px`,borderRadius:4,fontFamily:$,flexShrink:0,minWidth:72,textAlign:`center`},children:e.badge}),e.sublabel&&(0,n.jsx)(`span`,{style:{...Zt,flexShrink:0,minWidth:80,textAlign:`right`},children:e.sublabel})]},t))})}var cn={red:Q.red,amber:Q.amber,green:Q.green};function ln({items:e=[]}){let t=e.filter(e=>e.text);return t.length===0?null:(0,n.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:5},children:t.map((e,t)=>{let r=cn[e.severity];return(0,n.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-start`,gap:10,padding:`9px 12px`,background:`transparent`},children:[(0,n.jsx)(`span`,{style:{fontSize:18,fontWeight:500,color:r,background:r+`20`,padding:`2px 7px`,borderRadius:4,fontFamily:$,flexShrink:0},children:e.tag}),(0,n.jsx)(`span`,{style:{flex:1,...Zt},children:e.text}),(0,n.jsx)(`span`,{style:{...Zt,flexShrink:0,marginTop:1},children:e.date})]},t)})})}function un({columns:e=[],rows:t=[]}){return t.length===0?null:(0,n.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:5},children:[(0,n.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,padding:`0 0px 6px`,borderBottom:`1px solid ${Q.border}`},children:[(0,n.jsx)(`div`,{style:{minWidth:64}}),e.map((e,t)=>(0,n.jsx)(`div`,{style:{flex:1,fontSize:18,fontWeight:500,color:Q.t2,fontFamily:$,textTransform:`uppercase`,letterSpacing:.6},children:e},t))]}),t.map((e,t)=>(0,n.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,padding:`8px 0px`,background:Q.bg,border:`1px solid ${Q.border}`},children:[(0,n.jsx)(`span`,{style:{fontSize:18,fontWeight:500,color:Q.t1,background:`transparent`,padding:`2px 8px`,borderRadius:4,fontFamily:$,flexShrink:0,minWidth:64,textAlign:`center`},children:e.label}),e.cells.map((e,t)=>(0,n.jsx)(`span`,{style:{flex:1,fontSize:18,fontWeight:500,color:Q.t2,fontFamily:$},children:e},t))]},t))]})}function dn({block:e}){if(!e)return null;switch(e.type){case`stats`:return(0,n.jsx)(Qt,{items:e.items});case`ranked`:return(0,n.jsx)($t,{items:e.items});case`chips`:return(0,n.jsx)(en,{items:e.items});case`badges`:return(0,n.jsx)(nn,{items:e.items});case`dot-strip`:return(0,n.jsx)(rn,{min:e.min,max:e.max,unit:e.unit,dots:e.dots,chips:e.chips});case`proportion`:return(0,n.jsx)(an,{leftPct:e.leftPct,leftLabel:e.leftLabel,leftValue:e.leftValue,leftColor:e.leftColor,rightPct:e.rightPct,rightLabel:e.rightLabel,rightValue:e.rightValue,rightColor:e.rightColor,chips:e.chips});case`ring`:return(0,n.jsx)(on,{pct:e.pct,label:e.label,color:e.color,chips:e.chips});case`scorecard-rows`:return(0,n.jsx)(sn,{items:e.items});case`flags-list`:return(0,n.jsx)(ln,{items:e.items});case`comparison-rows`:return(0,n.jsx)(un,{columns:e.columns,rows:e.rows});default:return null}}var fn=`'Satoshi Variable', 'DM Sans', sans-serif`,pn={color:`#C2C2C2`,fontFamily:fn,fontSize:18,fontWeight:400,lineHeight:1.65};function mn({text:e}){return(0,n.jsxs)(`div`,{style:{padding:`8px 0px`,border:`transparent`,borderRadius:5,background:`transparent`},children:[(0,n.jsx)(`span`,{style:{fontSize:18,fontWeight:500,color:i.t1,fontFamily:fn,lineHeight:1.65,marginRight:8},children:`Takeaway`}),(0,n.jsx)(`span`,{style:{...pn},children:e})]})}exports.AreaChart=j,exports.BarChart=P,exports.ChartFrame=r,exports.DonutChart=Yt,exports.KeyHighlights=dn,exports.LineChart=Ne,exports.MiniBars=Ie,exports.PieChart=Ge,exports.ProcessSankey=tt,exports.RankingSankey=nt,exports.SankeySvg=qe,exports.SeriesChart=A,exports.Takeaway=mn,exports.Trend=vt,exports.TrendChart=At,exports.VisualizationRenderer=Ut,exports.cleanupVisualizationMounts=Kt,exports.hydrateVisualizationMounts=qt,exports.serializeVisualizationConfig=Jt;
|
package/dist/index.js
CHANGED
|
@@ -263,7 +263,7 @@ function N(e, t, n = .12) {
|
|
|
263
263
|
//#endregion
|
|
264
264
|
//#region src/components/common/SeriesChart.tsx
|
|
265
265
|
var P = 760, F = 250;
|
|
266
|
-
function
|
|
266
|
+
function ee({ rows: e = [], variant: t, className: r, colors: i }) {
|
|
267
267
|
let o = a(null), d = a(/* @__PURE__ */ new Map()), f = a(0), { mouseRef: p, hoveredRef: m, tooltip: g, hitZonesRef: _ } = w(o, {
|
|
268
268
|
width: P,
|
|
269
269
|
height: F
|
|
@@ -354,8 +354,8 @@ function I({ rows: e = [], variant: t, className: r, colors: i }) {
|
|
|
354
354
|
}
|
|
355
355
|
//#endregion
|
|
356
356
|
//#region src/components/areaChart/AreaChart.tsx
|
|
357
|
-
function
|
|
358
|
-
return /* @__PURE__ */ s(
|
|
357
|
+
function te({ rows: e = [], className: t, colors: n }) {
|
|
358
|
+
return /* @__PURE__ */ s(ee, {
|
|
359
359
|
rows: e,
|
|
360
360
|
variant: "area",
|
|
361
361
|
className: t,
|
|
@@ -364,28 +364,28 @@ function ee({ rows: e = [], className: t, colors: n }) {
|
|
|
364
364
|
}
|
|
365
365
|
//#endregion
|
|
366
366
|
//#region src/components/barChart/BarChart.tsx
|
|
367
|
-
var
|
|
368
|
-
function
|
|
367
|
+
var ne = 760, re = 280;
|
|
368
|
+
function ie({ rows: e = [], className: t, colors: r }) {
|
|
369
369
|
let i = a(null), o = a(/* @__PURE__ */ new Map()), f = a(0), { hoveredRef: p, tooltip: m, hitZonesRef: g } = w(i, {
|
|
370
|
-
width:
|
|
371
|
-
height:
|
|
370
|
+
width: ne,
|
|
371
|
+
height: re
|
|
372
372
|
});
|
|
373
373
|
return n(() => {
|
|
374
374
|
let t = i.current;
|
|
375
375
|
if (!t) return;
|
|
376
|
-
let n = v(t,
|
|
376
|
+
let n = v(t, ne, re);
|
|
377
377
|
f.current = 0;
|
|
378
378
|
let a = r?.bars ?? d, s = r?.axisLine ?? u.bd, c = r?.valueLabel ?? u.t2, l = {
|
|
379
379
|
top: 24,
|
|
380
380
|
right: 24,
|
|
381
381
|
bottom: 56,
|
|
382
382
|
left: 24
|
|
383
|
-
}, m =
|
|
383
|
+
}, m = re - l.top - l.bottom, _ = (ne - l.left - l.right) / Math.max(e.length, 1), b = Math.max(100, ...e.map((e) => e.pricing ?? 0)), x = l.top + m, S, C = () => {
|
|
384
384
|
f.current++;
|
|
385
385
|
let t = f.current;
|
|
386
|
-
n.clearRect(0, 0,
|
|
386
|
+
n.clearRect(0, 0, ne, re);
|
|
387
387
|
let r = O(Math.min(t / 48, 1));
|
|
388
|
-
N(o.current, p.current), g.current = [], n.strokeStyle = h(s, .4), n.lineWidth = 1, n.setLineDash([]), n.beginPath(), n.moveTo(l.left, x), n.lineTo(
|
|
388
|
+
N(o.current, p.current), g.current = [], n.strokeStyle = h(s, .4), n.lineWidth = 1, n.setLineDash([]), n.beginPath(), n.moveTo(l.left, x), n.lineTo(ne - l.right, x), n.stroke(), e.forEach((t, i) => {
|
|
389
389
|
let s = l.left + i * _, d = M(r, i, e.length, O), f = b > 0 ? (t.pricing ?? 0) / b * m : 0, p = Math.max(f > 0 ? 4 : 0, f * d), v = a[i % a.length], S = o.current.get(t.id ?? `bar-${i}`) ?? 0;
|
|
390
390
|
E(g.current, t.id ?? `bar-${i}`, s + 4, x - p, _ - 8, p, {
|
|
391
391
|
label: t.vendor,
|
|
@@ -401,7 +401,7 @@ function re({ rows: e = [], className: t, colors: r }) {
|
|
|
401
401
|
4,
|
|
402
402
|
0,
|
|
403
403
|
0
|
|
404
|
-
]), n.stroke())), d > .5 && p > 0 && (n.globalAlpha = Math.min(1, (d - .5) * 2), n.font = "bold 10px 'JetBrains Mono', monospace", n.fillStyle = S > 0 ? v : h(c, .7), n.textAlign = "center", n.fillText(String(t.pricing ?? ""), s + _ / 2, x - p - 6), n.globalAlpha = 1), n.font = `${S > 0 ? "bold " : ""}9px 'JetBrains Mono', monospace`, n.fillStyle = S > 0 ? v : h(u.t3, .6), n.textAlign = "center", n.fillText(t.vendor, s + _ / 2,
|
|
404
|
+
]), n.stroke())), d > .5 && p > 0 && (n.globalAlpha = Math.min(1, (d - .5) * 2), n.font = "bold 10px 'JetBrains Mono', monospace", n.fillStyle = S > 0 ? v : h(c, .7), n.textAlign = "center", n.fillText(String(t.pricing ?? ""), s + _ / 2, x - p - 6), n.globalAlpha = 1), n.font = `${S > 0 ? "bold " : ""}9px 'JetBrains Mono', monospace`, n.fillStyle = S > 0 ? v : h(u.t3, .6), n.textAlign = "center", n.fillText(t.vendor, s + _ / 2, re - 14);
|
|
405
405
|
}), S = requestAnimationFrame(C);
|
|
406
406
|
};
|
|
407
407
|
return C(), () => cancelAnimationFrame(S);
|
|
@@ -410,30 +410,30 @@ function re({ rows: e = [], className: t, colors: r }) {
|
|
|
410
410
|
children: /* @__PURE__ */ c("div", {
|
|
411
411
|
style: {
|
|
412
412
|
position: "relative",
|
|
413
|
-
width:
|
|
414
|
-
height:
|
|
413
|
+
width: ne,
|
|
414
|
+
height: re
|
|
415
415
|
},
|
|
416
416
|
children: [/* @__PURE__ */ s("canvas", {
|
|
417
417
|
ref: i,
|
|
418
418
|
role: "img",
|
|
419
419
|
"aria-label": "bar chart",
|
|
420
420
|
style: {
|
|
421
|
-
width:
|
|
422
|
-
height:
|
|
421
|
+
width: ne,
|
|
422
|
+
height: re,
|
|
423
423
|
display: "block",
|
|
424
424
|
borderRadius: 8
|
|
425
425
|
}
|
|
426
426
|
}), /* @__PURE__ */ s(C, {
|
|
427
427
|
...m,
|
|
428
|
-
parentW:
|
|
429
|
-
parentH:
|
|
428
|
+
parentW: ne,
|
|
429
|
+
parentH: re
|
|
430
430
|
})]
|
|
431
431
|
})
|
|
432
432
|
});
|
|
433
433
|
}
|
|
434
434
|
//#endregion
|
|
435
435
|
//#region src/components/common/ChartEmptyState.tsx
|
|
436
|
-
function
|
|
436
|
+
function I({ width: e, height: t, message: n = "No data available", "data-testid": r }) {
|
|
437
437
|
return /* @__PURE__ */ s("div", {
|
|
438
438
|
"data-testid": r,
|
|
439
439
|
style: {
|
|
@@ -453,7 +453,7 @@ function L({ width: e, height: t, message: n = "No data available", "data-testid
|
|
|
453
453
|
}
|
|
454
454
|
//#endregion
|
|
455
455
|
//#region src/components/common/ToggleButton.tsx
|
|
456
|
-
function
|
|
456
|
+
function ae({ expanded: e, onToggle: t, labelExpanded: n = "View Less", labelCollapsed: r = "View More", "data-testid": i }) {
|
|
457
457
|
return /* @__PURE__ */ c("button", {
|
|
458
458
|
type: "button",
|
|
459
459
|
"data-testid": i,
|
|
@@ -496,60 +496,60 @@ function ie({ expanded: e, onToggle: t, labelExpanded: n = "View Less", labelCol
|
|
|
496
496
|
}
|
|
497
497
|
//#endregion
|
|
498
498
|
//#region src/components/progressRaceChart/ProgressRaceChart.tsx
|
|
499
|
-
var
|
|
499
|
+
var L = 660, R = 42, oe = 10, se = 24, ce = 24, le = 8, ue = [
|
|
500
500
|
u.green,
|
|
501
501
|
u.blue,
|
|
502
502
|
u.amber,
|
|
503
503
|
u.red
|
|
504
504
|
];
|
|
505
|
-
function
|
|
505
|
+
function de(e, t, n) {
|
|
506
506
|
if (e.measureText(t).width <= n) return t;
|
|
507
507
|
let r = t;
|
|
508
508
|
for (; r.length > 0 && e.measureText(r + "…").width > n;) r = r.slice(0, -1);
|
|
509
509
|
return r + "…";
|
|
510
510
|
}
|
|
511
|
-
function
|
|
512
|
-
let r = a(null), l = a(0), d = a(/* @__PURE__ */ new Map()), [m, g] = o(!1), _ = i(() => e.filter((e) => typeof e == "object" && !!e), [e]), S = i(() => [..._].sort((e, t) => (t.percentage ?? 0) - (e.percentage ?? 0)), [_]), O = i(() => m ? S : S.slice(0,
|
|
513
|
-
width:
|
|
511
|
+
function fe({ items: e = [], "data-testid": t }) {
|
|
512
|
+
let r = a(null), l = a(0), d = a(/* @__PURE__ */ new Map()), [m, g] = o(!1), _ = i(() => e.filter((e) => typeof e == "object" && !!e), [e]), S = i(() => [..._].sort((e, t) => (t.percentage ?? 0) - (e.percentage ?? 0)), [_]), O = i(() => m ? S : S.slice(0, le), [S, m]), k = O.length, A = se + ce + k * R + Math.max(0, k - 1) * oe, { hoveredRef: j, tooltip: M, hitZonesRef: N } = w(r, {
|
|
513
|
+
width: L,
|
|
514
514
|
height: A
|
|
515
515
|
});
|
|
516
516
|
return n(() => {
|
|
517
517
|
let e = r.current;
|
|
518
518
|
if (!e) return;
|
|
519
|
-
let t = v(e,
|
|
519
|
+
let t = v(e, L, A);
|
|
520
520
|
l.current = 0;
|
|
521
|
-
let n =
|
|
521
|
+
let n = L * .08, i = L - 150 - n, a, o = () => {
|
|
522
522
|
l.current++;
|
|
523
523
|
let e = l.current;
|
|
524
|
-
t.clearRect(0, 0,
|
|
524
|
+
t.clearRect(0, 0, L, A), t.letterSpacing = f.letterSpacing, N.current = [], d.current.forEach((e, t) => {
|
|
525
525
|
let n = t === j.current ? 1 : 0, r = e + (n - e) * .12;
|
|
526
526
|
Math.abs(r - n) < .005 ? n === 0 ? d.current.delete(t) : d.current.set(t, 1) : d.current.set(t, r);
|
|
527
|
-
}), j.current && !d.current.has(j.current) && d.current.set(j.current, 0), b(t,
|
|
528
|
-
let a =
|
|
529
|
-
t.fillStyle = h(a, .04 + o * .04), t.beginPath(), t.roundRect(150, s, i,
|
|
527
|
+
}), j.current && !d.current.has(j.current) && d.current.set(j.current, 0), b(t, L, A, e, 40, h(u.blue, .04)), O.forEach((n, r) => {
|
|
528
|
+
let a = ue[r % ue.length], o = d.current.get(n.id) ?? 0, s = se + r * (R + oe);
|
|
529
|
+
t.fillStyle = h(a, .04 + o * .04), t.beginPath(), t.roundRect(150, s, i, R, 3), t.fill(), t.strokeStyle = h(a, .08), t.lineWidth = 1, t.setLineDash([4, 4]), t.beginPath(), t.moveTo(150, s + R / 2), t.lineTo(150 + i, s + R / 2), t.stroke(), t.setLineDash([]);
|
|
530
530
|
let c = (n.percentage ?? 0) / 100, l = 150 + i * Math.min(c, c * D(Math.min(1, e * .005)));
|
|
531
531
|
if (l > 154) {
|
|
532
532
|
let e = t.createLinearGradient(150, 0, l, 0);
|
|
533
|
-
e.addColorStop(0, h(a, .02)), e.addColorStop(1, h(a, .25 + o * .15)), t.fillStyle = e, t.beginPath(), t.roundRect(150, s + 2, l - 150,
|
|
533
|
+
e.addColorStop(0, h(a, .02)), e.addColorStop(1, h(a, .25 + o * .15)), t.fillStyle = e, t.beginPath(), t.roundRect(150, s + 2, l - 150, R - 4, 2), t.fill();
|
|
534
534
|
}
|
|
535
|
-
y(t, l, s +
|
|
535
|
+
y(t, l, s + R / 2, 18 + o * 8, a, .3 + o * .2), t.beginPath(), t.arc(l, s + R / 2, 5 + o * 2, 0, Math.PI * 2), t.fillStyle = h(a, .9), t.fill();
|
|
536
536
|
let u = {
|
|
537
537
|
label: n.name,
|
|
538
538
|
value: `${n.percentage ?? 0}%`,
|
|
539
539
|
sublabel: n.totalLabel,
|
|
540
540
|
color: a
|
|
541
541
|
};
|
|
542
|
-
E(N.current, n.id, 0, s, 150 + i,
|
|
543
|
-
}), t.strokeStyle = h(u.t3, .3), t.lineWidth = 1, t.setLineDash([]), t.beginPath(), t.moveTo(150 + i,
|
|
542
|
+
E(N.current, n.id, 0, s, 150 + i, R, u), T(N.current, n.id, l, s + R / 2, 14, u), t.font = p.font, t.fillStyle = h(a, .9 + o * .1), t.textAlign = "left", t.textBaseline = "middle", t.fillText(`${n.percentage ?? 0}%`, l + 10, s + R / 2), t.font = `${o > 0 ? "bold " : ""}` + f.font, t.fillStyle = o > 0 ? a : f.color, t.textAlign = "right", t.fillText(de(t, n.abbreviation ?? n.name ?? "", 134), 142, s + R / 2);
|
|
543
|
+
}), t.strokeStyle = h(u.t3, .3), t.lineWidth = 1, t.setLineDash([]), t.beginPath(), t.moveTo(150 + i, se), t.lineTo(150 + i, se + (k - 1) * (R + oe) + R), t.stroke(), x(t, L, A, e, .015), a = requestAnimationFrame(o);
|
|
544
544
|
};
|
|
545
545
|
return o(), () => cancelAnimationFrame(a);
|
|
546
|
-
}, [O, A]), S.length === 0 ? /* @__PURE__ */ s(
|
|
547
|
-
width:
|
|
546
|
+
}, [O, A]), S.length === 0 ? /* @__PURE__ */ s(I, {
|
|
547
|
+
width: L,
|
|
548
548
|
height: 160,
|
|
549
549
|
"data-testid": t
|
|
550
550
|
}) : /* @__PURE__ */ c("div", {
|
|
551
551
|
"data-testid": t,
|
|
552
|
-
style: { width:
|
|
552
|
+
style: { width: L },
|
|
553
553
|
children: [/* @__PURE__ */ c("div", {
|
|
554
554
|
style: { position: "relative" },
|
|
555
555
|
children: [/* @__PURE__ */ s("canvas", {
|
|
@@ -557,19 +557,19 @@ function de({ items: e = [], "data-testid": t }) {
|
|
|
557
557
|
role: "img",
|
|
558
558
|
"aria-label": "Commitment race — contractors ranked by commitment percentage",
|
|
559
559
|
style: {
|
|
560
|
-
width:
|
|
560
|
+
width: L,
|
|
561
561
|
height: A,
|
|
562
562
|
display: "block",
|
|
563
563
|
borderRadius: 8
|
|
564
564
|
}
|
|
565
565
|
}), /* @__PURE__ */ s(C, {
|
|
566
566
|
...M,
|
|
567
|
-
parentW:
|
|
567
|
+
parentW: L,
|
|
568
568
|
parentH: A
|
|
569
569
|
})]
|
|
570
|
-
}), _.length >
|
|
570
|
+
}), _.length > le && /* @__PURE__ */ s("div", {
|
|
571
571
|
style: { marginTop: 8 },
|
|
572
|
-
children: /* @__PURE__ */ s(
|
|
572
|
+
children: /* @__PURE__ */ s(ae, {
|
|
573
573
|
expanded: m,
|
|
574
574
|
onToggle: () => g((e) => !e)
|
|
575
575
|
})
|
|
@@ -578,18 +578,18 @@ function de({ items: e = [], "data-testid": t }) {
|
|
|
578
578
|
}
|
|
579
579
|
//#endregion
|
|
580
580
|
//#region src/components/semiCircularGaugeChart/SemiCircularGaugeChart.tsx
|
|
581
|
-
var
|
|
582
|
-
function
|
|
581
|
+
var pe = 480, me = 222;
|
|
582
|
+
function he({ confirmed: e, total: t, label: r, "data-testid": i }) {
|
|
583
583
|
let o = a(null), c = a(0);
|
|
584
584
|
return n(() => {
|
|
585
585
|
let n = o.current;
|
|
586
586
|
if (!n) return;
|
|
587
|
-
let i = v(n,
|
|
587
|
+
let i = v(n, pe, me);
|
|
588
588
|
c.current = 0;
|
|
589
|
-
let a =
|
|
589
|
+
let a = pe / 2, s = Math.PI, l = 2 * Math.PI, d = Math.PI, p, g = () => {
|
|
590
590
|
c.current++;
|
|
591
591
|
let n = c.current;
|
|
592
|
-
i.clearRect(0, 0,
|
|
592
|
+
i.clearRect(0, 0, pe, me), i.letterSpacing = f.letterSpacing;
|
|
593
593
|
let o = D(Math.min(n / 80, 1)), _ = A(Math.min(n / 72, 1));
|
|
594
594
|
i.beginPath(), i.arc(a, 155, 120, s, l), i.strokeStyle = h(u.bd, .35), i.lineWidth = 46, i.stroke(), [
|
|
595
595
|
{
|
|
@@ -633,16 +633,16 @@ function me({ confirmed: e, total: t, label: r, "data-testid": i }) {
|
|
|
633
633
|
"data-testid": i,
|
|
634
634
|
style: {
|
|
635
635
|
position: "relative",
|
|
636
|
-
width:
|
|
637
|
-
height:
|
|
636
|
+
width: pe,
|
|
637
|
+
height: me
|
|
638
638
|
},
|
|
639
639
|
children: /* @__PURE__ */ s("canvas", {
|
|
640
640
|
ref: o,
|
|
641
641
|
role: "img",
|
|
642
642
|
"aria-label": `Compensation event gauge — ${Math.round((e ?? 0) / (t || 1) * 100)}% of NCEs confirmed as compensation events`,
|
|
643
643
|
style: {
|
|
644
|
-
width:
|
|
645
|
-
height:
|
|
644
|
+
width: pe,
|
|
645
|
+
height: me,
|
|
646
646
|
display: "block"
|
|
647
647
|
}
|
|
648
648
|
})
|
|
@@ -650,7 +650,7 @@ function me({ confirmed: e, total: t, label: r, "data-testid": i }) {
|
|
|
650
650
|
}
|
|
651
651
|
//#endregion
|
|
652
652
|
//#region src/canvas/useCanvasLoop.ts
|
|
653
|
-
function
|
|
653
|
+
function ge(e, t, r, i, o = !0, s = {}) {
|
|
654
654
|
let c = a(0), { easing: l = D, durationFrames: u = 48 } = s;
|
|
655
655
|
n(() => {
|
|
656
656
|
let n = e.current;
|
|
@@ -682,7 +682,7 @@ function he(e, t, r, i, o = !0, s = {}) {
|
|
|
682
682
|
}
|
|
683
683
|
//#endregion
|
|
684
684
|
//#region src/components/multiMetricConstellationChart/MultiMetricConstellationChart.tsx
|
|
685
|
-
var
|
|
685
|
+
var z = 780, B = 234, _e = 130, ve = 52, ye = [
|
|
686
686
|
u.blue,
|
|
687
687
|
u.amber,
|
|
688
688
|
u.purple,
|
|
@@ -698,12 +698,12 @@ var B = 780, ge = 234, _e = 130, ve = 52, ye = [
|
|
|
698
698
|
];
|
|
699
699
|
function Se({ items: e = [], "data-testid": t }) {
|
|
700
700
|
let n = a(null), r = a(/* @__PURE__ */ new Map()), { hoveredRef: o, tooltip: l, hitZonesRef: d } = w(n, {
|
|
701
|
-
width:
|
|
702
|
-
height:
|
|
701
|
+
width: z,
|
|
702
|
+
height: B
|
|
703
703
|
}), p = i(() => e.filter((e) => typeof e == "object" && !!e), [e]), g = i(() => {
|
|
704
704
|
let e = Math.max(...p.map((e) => e.base ?? 0)), t = Math.max(...p.map((e) => e.variation ?? 0));
|
|
705
705
|
return p.map((n, r) => {
|
|
706
|
-
let i =
|
|
706
|
+
let i = z * (.12 + r * .19), a = _e, o = Math.min(z * .075, ve), s = ye[r % ye.length], c = [
|
|
707
707
|
(n.base ?? 0) / (e || 1) * 100,
|
|
708
708
|
(n.variation ?? 0) / (t || 1) * 100,
|
|
709
709
|
n.percentage ?? 0
|
|
@@ -735,8 +735,8 @@ function Se({ items: e = [], "data-testid": t }) {
|
|
|
735
735
|
};
|
|
736
736
|
});
|
|
737
737
|
}, [p]);
|
|
738
|
-
return
|
|
739
|
-
N(r.current, o.current), d.current = [], b(e,
|
|
738
|
+
return ge(n, z, B, (e, t, n) => {
|
|
739
|
+
N(r.current, o.current), d.current = [], b(e, z, B, n, 30), g.forEach((t, i) => {
|
|
740
740
|
let a = t.color, o = `constellation-${i}`, s = r.current.get(o) ?? 0;
|
|
741
741
|
e.beginPath(), e.arc(t.cx, t.cy, t.baseR + 5, 0, Math.PI * 2), e.strokeStyle = h(u.bd, .08 + .08 * s), e.lineWidth = .5, e.stroke(), e.beginPath(), t.stars.forEach((t, n) => {
|
|
742
742
|
n === 0 ? e.moveTo(t.x, t.y) : e.lineTo(t.x, t.y);
|
|
@@ -756,31 +756,31 @@ function Se({ items: e = [], "data-testid": t }) {
|
|
|
756
756
|
sublabel: `${t.percentage ?? 0}% committed · scatter ${t.scatter.toFixed(1)}`,
|
|
757
757
|
color: a
|
|
758
758
|
});
|
|
759
|
-
}), e.font = m.font, e.textAlign = "center", e.textBaseline = "middle", e.fillStyle = m.color, e.fillText("▲ top = Base value · ▼▸ lower-right = Variations · ◂▼ lower-left = Commitment % · hover stars for details",
|
|
760
|
-
}, !0), g.length === 0 ? /* @__PURE__ */ s(
|
|
761
|
-
width:
|
|
762
|
-
height:
|
|
759
|
+
}), e.font = m.font, e.textAlign = "center", e.textBaseline = "middle", e.fillStyle = m.color, e.fillText("▲ top = Base value · ▼▸ lower-right = Variations · ◂▼ lower-left = Commitment % · hover stars for details", z / 2, B - 14), x(e, z, B, n, .012);
|
|
760
|
+
}, !0), g.length === 0 ? /* @__PURE__ */ s(I, {
|
|
761
|
+
width: z,
|
|
762
|
+
height: B,
|
|
763
763
|
"data-testid": t
|
|
764
764
|
}) : /* @__PURE__ */ c("div", {
|
|
765
765
|
"data-testid": t,
|
|
766
766
|
style: {
|
|
767
767
|
position: "relative",
|
|
768
|
-
width:
|
|
769
|
-
height:
|
|
768
|
+
width: z,
|
|
769
|
+
height: B
|
|
770
770
|
},
|
|
771
771
|
children: [/* @__PURE__ */ s("canvas", {
|
|
772
772
|
ref: n,
|
|
773
773
|
role: "img",
|
|
774
774
|
"aria-label": "Contract value breakdown per contractor — multi-KPI constellation chart",
|
|
775
775
|
style: {
|
|
776
|
-
width:
|
|
777
|
-
height:
|
|
776
|
+
width: z,
|
|
777
|
+
height: B,
|
|
778
778
|
display: "block"
|
|
779
779
|
}
|
|
780
780
|
}), /* @__PURE__ */ s(C, {
|
|
781
781
|
...l,
|
|
782
|
-
parentW:
|
|
783
|
-
parentH:
|
|
782
|
+
parentW: z,
|
|
783
|
+
parentH: B
|
|
784
784
|
})]
|
|
785
785
|
});
|
|
786
786
|
}
|
|
@@ -812,7 +812,7 @@ function Ae({ data: e, "data-testid": t }) {
|
|
|
812
812
|
width: Ce,
|
|
813
813
|
height: D
|
|
814
814
|
});
|
|
815
|
-
return
|
|
815
|
+
return ge(n, Ce, D, (e, t) => {
|
|
816
816
|
N(r.current, j.current), F.current = [], b.forEach((n, i) => {
|
|
817
817
|
let a = Ee[i % Ee.length], o = M(t, i, x, O), s = V.top + i * (H + 8), c = V.left + De, l = r.current.get(n.id) ?? 0, d = Math.max(n.base ?? 0, 0), m = Math.max(n.total ?? 0, 0), g = d / S * k * o, _ = m / S * k * o, v = _ - g;
|
|
818
818
|
e.font = f.font, e.fillStyle = l > 0 ? a : f.color, e.textAlign = "right", e.textBaseline = "middle", e.fillText(Oe(e, n.name ?? "", De - 16), c - 8, s + H / 2), E(F.current, n.id, 0, s, c, H, {
|
|
@@ -834,7 +834,7 @@ function Ae({ data: e, "data-testid": t }) {
|
|
|
834
834
|
});
|
|
835
835
|
let n = D - 14;
|
|
836
836
|
e.textBaseline = "middle", e.font = m.font, e.textAlign = "left", e.fillStyle = h(u.blue, .5), e.beginPath(), e.roundRect(V.left + De, n - 3, 14, 6, 2), e.fill(), e.fillStyle = m.color, e.fillText("base value", V.left + De + 18, n), e.fillStyle = h(u.blue, .22), e.beginPath(), e.roundRect(V.left + De + 94, n - 3, 14, 6, 2), e.fill(), e.setLineDash([2, 3]), e.strokeStyle = h(u.blue, .5), e.lineWidth = .5, e.beginPath(), e.moveTo(V.left + De + 101, n - 3), e.lineTo(V.left + De + 101, n + 3), e.stroke(), e.setLineDash([]), e.fillStyle = m.color, e.fillText("approved variations", V.left + De + 112, n), e.font = m.font, e.textAlign = "right", e.fillStyle = m.color, e.fillText(`Portfolio: ${ke(g?.total ?? 0)}`, Ce - 8, n);
|
|
837
|
-
}, !0, { easing: O }), A ? /* @__PURE__ */ s(
|
|
837
|
+
}, !0, { easing: O }), A ? /* @__PURE__ */ s(I, {
|
|
838
838
|
width: Ce,
|
|
839
839
|
height: we,
|
|
840
840
|
message: "No contract data available",
|
|
@@ -864,7 +864,7 @@ function Ae({ data: e, "data-testid": t }) {
|
|
|
864
864
|
})]
|
|
865
865
|
}), _.length > Te && /* @__PURE__ */ s("div", {
|
|
866
866
|
style: { marginTop: 8 },
|
|
867
|
-
children: /* @__PURE__ */ s(
|
|
867
|
+
children: /* @__PURE__ */ s(ae, {
|
|
868
868
|
expanded: i,
|
|
869
869
|
onToggle: () => l((e) => !e)
|
|
870
870
|
})
|
|
@@ -927,15 +927,17 @@ function Le({ items: e = [], "data-testid": t }) {
|
|
|
927
927
|
let k = r.abbreviation ?? r.name ?? "", A = C * 1.7, M = k;
|
|
928
928
|
for (; t.measureText(M).width > A && M.length > 1;) M = M.slice(0, -1);
|
|
929
929
|
M !== k && (M = M.slice(0, -1) + "…"), t.fillText(M, w, T);
|
|
930
|
-
let N =
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
930
|
+
let N = r.count == null ? null : U(r.count), P = r.label ?? N;
|
|
931
|
+
if (P) {
|
|
932
|
+
t.font = p.font, t.textBaseline = "alphabetic", t.fillStyle = h(f, .9 + _ * .1);
|
|
933
|
+
let e = x - 16, n = P;
|
|
934
|
+
for (; t.measureText(n).width > e && n.length > 1;) n = n.slice(0, -1);
|
|
935
|
+
n !== P && (n = n.slice(0, -1) + "…"), t.fillText(n, w, a + i * .74);
|
|
936
|
+
}
|
|
937
|
+
let F = Math.round((r.count ?? 0) / (g || 1) * 100);
|
|
936
938
|
E(D.current, r.id, m, a, n, i, {
|
|
937
939
|
label: r.name,
|
|
938
|
-
value: `${P} · ${
|
|
940
|
+
value: `${P} · ${F}% of total`,
|
|
939
941
|
sublabel: `Rank #${o + 1}`,
|
|
940
942
|
color: f
|
|
941
943
|
});
|
|
@@ -946,7 +948,7 @@ function Le({ items: e = [], "data-testid": t }) {
|
|
|
946
948
|
m,
|
|
947
949
|
g,
|
|
948
950
|
b
|
|
949
|
-
]), m.length === 0 ? /* @__PURE__ */ s(
|
|
951
|
+
]), m.length === 0 ? /* @__PURE__ */ s(I, {
|
|
950
952
|
width: b,
|
|
951
953
|
height: W,
|
|
952
954
|
"data-testid": t
|
|
@@ -1014,7 +1016,7 @@ function Re({ items: e = [], "data-testid": t }) {
|
|
|
1014
1016
|
}), x(t, G, K, e, .015), C = requestAnimationFrame(w);
|
|
1015
1017
|
};
|
|
1016
1018
|
return w(), () => cancelAnimationFrame(C);
|
|
1017
|
-
}, [g]), g.length === 0 ? /* @__PURE__ */ s(
|
|
1019
|
+
}, [g]), g.length === 0 ? /* @__PURE__ */ s(I, {
|
|
1018
1020
|
width: G,
|
|
1019
1021
|
height: K,
|
|
1020
1022
|
"data-testid": t
|
|
@@ -1045,7 +1047,7 @@ function Re({ items: e = [], "data-testid": t }) {
|
|
|
1045
1047
|
//#endregion
|
|
1046
1048
|
//#region src/components/lineChart/LineChart.tsx
|
|
1047
1049
|
function ze({ rows: e = [], className: t, colors: n }) {
|
|
1048
|
-
return /* @__PURE__ */ s(
|
|
1050
|
+
return /* @__PURE__ */ s(ee, {
|
|
1049
1051
|
rows: e,
|
|
1050
1052
|
variant: "line",
|
|
1051
1053
|
className: t,
|
|
@@ -1209,7 +1211,7 @@ function qe({ total: e = 0, totalLabel: t, items: r = [], width: o = Ue, "data-t
|
|
|
1209
1211
|
b,
|
|
1210
1212
|
x,
|
|
1211
1213
|
o
|
|
1212
|
-
]), b.length === 0 ? /* @__PURE__ */ s(
|
|
1214
|
+
]), b.length === 0 ? /* @__PURE__ */ s(I, {
|
|
1213
1215
|
width: o,
|
|
1214
1216
|
height: We,
|
|
1215
1217
|
"data-testid": l
|
|
@@ -1357,7 +1359,7 @@ function $e({ nodes: e, links: t, width: r = 960, height: o = 280, ariaLabel: f,
|
|
|
1357
1359
|
t,
|
|
1358
1360
|
r,
|
|
1359
1361
|
o
|
|
1360
|
-
]), { hoveredRef: F, tooltip:
|
|
1362
|
+
]), { hoveredRef: F, tooltip: ee, hitZonesRef: te } = w(_, {
|
|
1361
1363
|
width: r,
|
|
1362
1364
|
height: o
|
|
1363
1365
|
});
|
|
@@ -1371,7 +1373,7 @@ function $e({ nodes: e, links: t, width: r = 960, height: o = 280, ariaLabel: f,
|
|
|
1371
1373
|
let n = S.current;
|
|
1372
1374
|
i.clearRect(0, 0, r, o);
|
|
1373
1375
|
let l = 1 - (1 - Math.min(n / 56, 1)) ** 3;
|
|
1374
|
-
N(b.current, F.current),
|
|
1376
|
+
N(b.current, F.current), te.current = [], t.forEach((e, t) => {
|
|
1375
1377
|
let r = P.get(e.source), o = P.get(e.target);
|
|
1376
1378
|
if (!r || !o) return;
|
|
1377
1379
|
let s = !!p && (e.source === p || e.target === p), c = s ? A : k, d = s ? .5 : .2, f = Math.max(3, e.value / a * 36 * l), m = f / 2, g = r.x + r.w, _ = r.y + r.h / 2, v = o.x, y = o.y + o.h / 2, b = (g + v) / 2;
|
|
@@ -1379,7 +1381,7 @@ function $e({ nodes: e, links: t, width: r = 960, height: o = 280, ariaLabel: f,
|
|
|
1379
1381
|
let r = e / 30, a = (e + 1) / 30, o = 1 - r, s = 1 - a, l = o * o * g + 2 * o * r * b + r * r * v, u = o * o * _ + 2 * o * r * _ + r * r * y, f = s * s * g + 2 * s * a * b + a * a * v, p = s * s * _ + 2 * s * a * _ + a * a * y, x = j(n + r * 120 + t * 40, .025, 3e-4) * 1.2;
|
|
1380
1382
|
i.beginPath(), i.moveTo(l, u - m + x), i.lineTo(f, p - m + x), i.lineTo(f, p + m + x), i.lineTo(l, u + m + x), i.closePath(), i.fillStyle = h(c, d * (.5 + r * .5)), i.fill();
|
|
1381
1383
|
}
|
|
1382
|
-
T(
|
|
1384
|
+
T(te.current, `link-${t}`, b, (_ + y) / 2, f + 6, {
|
|
1383
1385
|
label: `${e.source} → ${e.target}`,
|
|
1384
1386
|
value: String(e.value),
|
|
1385
1387
|
color: s ? A : u.blue
|
|
@@ -1394,7 +1396,7 @@ function $e({ nodes: e, links: t, width: r = 960, height: o = 280, ariaLabel: f,
|
|
|
1394
1396
|
let r = P.get(e.id);
|
|
1395
1397
|
if (!r) return;
|
|
1396
1398
|
let a = p === e.id, o = F.current === `node-${t}`, s = b.current.get(`node-${t}`) ?? 0, c = a ? M : O[t % O.length];
|
|
1397
|
-
E(
|
|
1399
|
+
E(te.current, `node-${t}`, r.x, r.y, r.w, r.h, {
|
|
1398
1400
|
label: e.name,
|
|
1399
1401
|
value: e.valueLabel ?? e.id,
|
|
1400
1402
|
color: c
|
|
@@ -1443,7 +1445,7 @@ function $e({ nodes: e, links: t, width: r = 960, height: o = 280, ariaLabel: f,
|
|
|
1443
1445
|
borderRadius: 8
|
|
1444
1446
|
}
|
|
1445
1447
|
}), /* @__PURE__ */ s(C, {
|
|
1446
|
-
...
|
|
1448
|
+
...ee,
|
|
1447
1449
|
parentW: r,
|
|
1448
1450
|
parentH: o
|
|
1449
1451
|
})]
|
|
@@ -1815,7 +1817,7 @@ function pt({ points: e = [], "data-testid": t }) {
|
|
|
1815
1817
|
}), _ = requestAnimationFrame(b);
|
|
1816
1818
|
};
|
|
1817
1819
|
return b(), () => cancelAnimationFrame(_);
|
|
1818
|
-
}, [g]), g.length < 2 ? /* @__PURE__ */ s(
|
|
1820
|
+
}, [g]), g.length < 2 ? /* @__PURE__ */ s(I, {
|
|
1819
1821
|
width: ft,
|
|
1820
1822
|
height: q,
|
|
1821
1823
|
"data-testid": t
|
|
@@ -1951,7 +1953,7 @@ function wt({ points: e = [], "data-testid": t }) {
|
|
|
1951
1953
|
_,
|
|
1952
1954
|
p,
|
|
1953
1955
|
b
|
|
1954
|
-
]), d.length < 2 ? /* @__PURE__ */ s(
|
|
1956
|
+
]), d.length < 2 ? /* @__PURE__ */ s(I, {
|
|
1955
1957
|
width: mt,
|
|
1956
1958
|
height: J,
|
|
1957
1959
|
"data-testid": t
|
|
@@ -2051,7 +2053,7 @@ function jt({ severities: e = [], "data-testid": t }) {
|
|
|
2051
2053
|
v.addColorStop(0, h(u.red, .03)), v.addColorStop(.33, h(u.orange, .03)), v.addColorStop(.66, h(u.amber, .03)), v.addColorStop(1, h(u.green, .03)), t.fillStyle = v, t.fillRect(i, 50, s * r, c), x = requestAnimationFrame(S);
|
|
2052
2054
|
};
|
|
2053
2055
|
return S(), () => cancelAnimationFrame(x);
|
|
2054
|
-
}, [d, m]), d.length === 0 ? /* @__PURE__ */ s(
|
|
2056
|
+
}, [d, m]), d.length === 0 ? /* @__PURE__ */ s(I, {
|
|
2055
2057
|
width: m,
|
|
2056
2058
|
height: Et,
|
|
2057
2059
|
"data-testid": t
|
|
@@ -2133,7 +2135,7 @@ function Pt({ segments: e = [], title: t, unitLabel: r = "", "data-testid": o })
|
|
|
2133
2135
|
E,
|
|
2134
2136
|
t,
|
|
2135
2137
|
r
|
|
2136
|
-
]), E.length === 0 ? /* @__PURE__ */ s(
|
|
2138
|
+
]), E.length === 0 ? /* @__PURE__ */ s(I, {
|
|
2137
2139
|
width: Y,
|
|
2138
2140
|
height: X,
|
|
2139
2141
|
"data-testid": o
|
|
@@ -2308,7 +2310,7 @@ function Wt({ items: e = [], "data-testid": t }) {
|
|
|
2308
2310
|
t.font = m.font, t.textAlign = "right", t.fillStyle = u.green, t.fillText("■ Implemented", i - 10, r), t.textAlign = "left", t.fillStyle = m.color, t.fillText("■ Unimplemented", i + 10, r), b = requestAnimationFrame(C);
|
|
2309
2311
|
};
|
|
2310
2312
|
return C(), () => cancelAnimationFrame(b);
|
|
2311
|
-
}, [x, S]), b.length === 0 ? /* @__PURE__ */ s(
|
|
2313
|
+
}, [x, S]), b.length === 0 ? /* @__PURE__ */ s(I, {
|
|
2312
2314
|
width: Rt,
|
|
2313
2315
|
height: 160,
|
|
2314
2316
|
"data-testid": t
|
|
@@ -2337,7 +2339,7 @@ function Wt({ items: e = [], "data-testid": t }) {
|
|
|
2337
2339
|
})]
|
|
2338
2340
|
}), b.length > zt && /* @__PURE__ */ s("div", {
|
|
2339
2341
|
style: { marginTop: 8 },
|
|
2340
|
-
children: /* @__PURE__ */ s(
|
|
2342
|
+
children: /* @__PURE__ */ s(ae, {
|
|
2341
2343
|
expanded: g,
|
|
2342
2344
|
onToggle: () => _((e) => !e)
|
|
2343
2345
|
})
|
|
@@ -2459,10 +2461,10 @@ function Yt({ config: e, className: t }) {
|
|
|
2459
2461
|
return e.type === "line" ? /* @__PURE__ */ s(ze, {
|
|
2460
2462
|
rows: e.rows,
|
|
2461
2463
|
className: t
|
|
2462
|
-
}) : e.type === "area" ? /* @__PURE__ */ s(
|
|
2464
|
+
}) : e.type === "area" ? /* @__PURE__ */ s(te, {
|
|
2463
2465
|
rows: e.rows,
|
|
2464
2466
|
className: t
|
|
2465
|
-
}) : e.type === "bar" ? /* @__PURE__ */ s(
|
|
2467
|
+
}) : e.type === "bar" ? /* @__PURE__ */ s(ie, {
|
|
2466
2468
|
rows: e.rows,
|
|
2467
2469
|
className: t
|
|
2468
2470
|
}) : e.type === "pie" ? /* @__PURE__ */ s(Ze, {
|
|
@@ -2485,7 +2487,7 @@ function Yt({ config: e, className: t }) {
|
|
|
2485
2487
|
}) : e.type === "mini-bars" ? /* @__PURE__ */ s(He, {
|
|
2486
2488
|
rows: e.rows,
|
|
2487
2489
|
className: t
|
|
2488
|
-
}) : e.type === "stacked-horizontal-bar-chart" ? /* @__PURE__ */ s(Ae, { data: e.data }) : e.type === "multi-metric-constellation-chart" ? /* @__PURE__ */ s(Se, { items: e.items }) : e.type === "progress-race-chart" ? /* @__PURE__ */ s(
|
|
2490
|
+
}) : e.type === "stacked-horizontal-bar-chart" ? /* @__PURE__ */ s(Ae, { data: e.data ?? { items: e.items ?? [] } }) : e.type === "multi-metric-constellation-chart" ? /* @__PURE__ */ s(Se, { items: e.items }) : e.type === "progress-race-chart" ? /* @__PURE__ */ s(fe, { items: e.items }) : e.type === "hub-and-spoke-radial-chart" ? /* @__PURE__ */ s(Pt, {
|
|
2489
2491
|
segments: e.segments,
|
|
2490
2492
|
title: e.title,
|
|
2491
2493
|
unitLabel: e.unitLabel
|
|
@@ -2493,7 +2495,7 @@ function Yt({ config: e, className: t }) {
|
|
|
2493
2495
|
total: e.total,
|
|
2494
2496
|
totalLabel: e.totalLabel,
|
|
2495
2497
|
items: e.items
|
|
2496
|
-
}) : e.type === "semi-circular-gauge-chart" ? /* @__PURE__ */ s(
|
|
2498
|
+
}) : e.type === "semi-circular-gauge-chart" ? /* @__PURE__ */ s(he, {
|
|
2497
2499
|
confirmed: e.confirmed,
|
|
2498
2500
|
total: e.total,
|
|
2499
2501
|
label: e.label
|
|
@@ -3329,4 +3331,4 @@ function bn({ text: e }) {
|
|
|
3329
3331
|
});
|
|
3330
3332
|
}
|
|
3331
3333
|
//#endregion
|
|
3332
|
-
export {
|
|
3334
|
+
export { te as AreaChart, ie as BarChart, l as ChartFrame, tn as DonutChart, _n as KeyHighlights, ze as LineChart, He as MiniBars, Ze as PieChart, st as ProcessSankey, ct as RankingSankey, $e as SankeySvg, ee as SeriesChart, bn as Takeaway, wt as Trend, It as TrendChart, Yt as VisualizationRenderer, Qt as cleanupVisualizationMounts, $t as hydrateVisualizationMounts, en as serializeVisualizationConfig };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -114,6 +114,11 @@ export type BaseVisualizationConfig = {
|
|
|
114
114
|
} | {
|
|
115
115
|
type: 'stacked-horizontal-bar-chart';
|
|
116
116
|
data: ContractData;
|
|
117
|
+
items?: never;
|
|
118
|
+
} | {
|
|
119
|
+
type: 'stacked-horizontal-bar-chart';
|
|
120
|
+
items: ContractorRow[];
|
|
121
|
+
data?: never;
|
|
117
122
|
} | {
|
|
118
123
|
type: 'multi-metric-constellation-chart';
|
|
119
124
|
items: ContractorRow[];
|