@graphysdk/react-renderer 1.9.0-beta.1794847602792 → 1.9.0-beta.1794915904679
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/editable.cjs +1 -1
- package/dist/editable.mjs +1 -1
- package/dist/{history-chords-BTq1oiCN.cjs → history-chords-BMqElwI_.cjs} +1 -1
- package/dist/{history-chords-COTl-Pod.js → history-chords-Bm3peRDi.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require('./history-chords.css');var Fl=Object.create,Yt=Object.defineProperty,Hl=Object.getOwnPropertyDescriptor,Dl=Object.getOwnPropertyNames,Wl=Object.getPrototypeOf,zl=Object.prototype.hasOwnProperty,Vl=(e,t)=>{let r={};for(var n in e)Yt(r,n,{get:e[n],enumerable:!0});return t||Yt(r,Symbol.toStringTag,{value:"Module"}),r},Ul=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=Dl(t),a=0,i=o.length,l;a<i;a++)l=o[a],!zl.call(e,l)&&l!==r&&Yt(e,l,{get:(c=>t[c]).bind(null,l),enumerable:!(n=Hl(t,l))||n.enumerable});return e},ta=(e,t,r)=>(r=e!=null?Fl(Wl(e)):{},Ul(t||!e||!e.__esModule?Yt(r,"default",{value:e,enumerable:!0}):r,e));let d=require("@graphysdk/viz-engine"),g=require("react"),s=require("react/jsx-runtime"),Ye=require("zustand"),R=require("motion/react"),ee=require("zustand/react/shallow"),qr=require("lodash-es"),Yl=require("d3-interpolate-path"),tr=require("@vanilla-extract/dynamic"),_r=require("zustand/vanilla"),Q=require("clsx");Q=ta(Q,1);let Kl=require("react-intl"),ie=require("@floating-ui/react-dom"),Xl=require("react-dom"),Ql=require("color2k");typeof window<"u"&&(window.__GRAPHY_SDK__??={},window.__GRAPHY_SDK__.reactRenderer="1.9.0-beta.1794847602792");function ra(e){for(const t of e)(t.severity==="error"?console.error:console.warn)(`[graphy] ${t.code}: ${t.message}`,t)}var na=(0,g.createContext)(null),ql=na.Provider,_l=null,rr=()=>(0,g.useContext)(na)??(_l??=(0,d.createDataLabelPlacementResolver)()),ce=d.polarToInscribedSquare,Jl={centerX:0,centerY:0,radius:1},Ke=e=>{const t=Math.min(e.width,e.height);return{centerX:(e.width-t)/2+t/2,centerY:(e.height-t)/2+t/2,radius:t/2}},xt=e=>{const{radius:t}=Ke(e),r=t>0?1/t:1;return{x:r,y:r}},de=(e,t,r=Jl)=>{const n=(0,d.polarToUnit)(e,t);return{x:r.centerX+n.x*r.radius,y:r.centerY-n.y*r.radius}},me=(e,t)=>({x:e,y:t});var Jr=(0,g.createContext)(null),W=()=>{const e=(0,g.useContext)(Jr);if(!e)throw new Error("useGraph* hooks must be used inside a <GraphProvider>");return e},he=()=>{const{mode:e}=W();return e},L=e=>{const{store:t}=W();return(0,Ye.useStore)(t,r=>e(r.scene))},yt=(e,t,r)=>e.get("alpha",t,r)*e.get("fillAlpha",t,r),Zr=(e,t)=>{const r=(0,d.paintKey)(e);let n=t.get(r);return n===void 0&&(n=(0,d.isOpaquePaint)(e),t.set(r,n)),n},Xe=e=>e==="none"?"none":`${e.offsetX}px ${e.offsetY}px ${e.blur}px ${e.color}`,Zl=e=>e==="none"?"none":`${e.offsetX}px ${e.offsetY}px ${e.blur}px ${e.color}`,Ge=e=>{if(e!=="none")return`drop-shadow(${e.offsetX}px ${e.offsetY}px ${e.blur}px ${e.color})`},bt=(0,g.createContext)(null),Zn=["shadow","blendMode","alpha","fillAlpha","fill"],oa=(e,t)=>(0,g.useMemo)(()=>{if(Object.keys(e.styles.parts).length>0)return;const r=e.data.getFirst();if(r===null)return;const n=t.get("shadow",r),o=Ge(n);if(o===void 0)return;const a=new Map,i=(u,h)=>{switch(h){case"shadow":return rc(t.get("shadow",u),n);case"blendMode":return t.get("blendMode",u)==="normal";case"alpha":return t.get("alpha",u)>=1;case"fillAlpha":return(t.get("fillAlpha",u)??1)>=1;case"fill":{const v=t.get("fill",u);return v===void 0||Zr(v,a)}}},l=ec(e.styles),c=Zn.filter(u=>l.has(u)||tc(e,u));if(!Zn.filter(u=>!c.includes(u)).some(u=>!i(r,u)))return c.length===0||e.data.findFirst(u=>c.some(h=>!i(u,h)))===null?o:void 0},[e,t]),$l=(e,t)=>{const r=(0,g.useContext)(bt),n=r?.layerId===e.id&&r.paintsShadow;return(0,g.useMemo)(()=>n?nc(t):t,[n,t])},ec=e=>{const t=new Set;for(const r of[...e.defaults,...e.overrides])if(!(r.matches===void 0||r.state!==void 0||r.part!==void 0))for(const n of Object.keys(r.declarations))t.add(n);return t},tc=(e,t)=>{const r=e.styles.observation.aesthetics[t];return r===void 0||!Object.hasOwn(d.VISUAL_VARIABLES,r)?!1:e.data.hasVariable(d.VISUAL_VARIABLES[r])},rc=(e,t)=>e==="none"||t==="none"?e===t:e.offsetX===t.offsetX&&e.offsetY===t.offsetY&&e.blur===t.blur&&e.color===t.color,nc=e=>{const{get:t,resolve:r}=e;return{...e,get:(a,i,l)=>a==="shadow"&&l===void 0?"none":t(a,i,l),resolve:(a,i)=>{const l=r(a,i);return i===void 0&&(l.shadow="none"),l}}},$r=()=>W().styleResolver,B=e=>$l(e,Te()(e)),O=()=>{const e=$r(),t=L(r=>r.styles);return e.readers({styles:t})},aa=e=>{const t=Te(),r=L(n=>n.layers).find(n=>n.id===e);return r===void 0?null:t(r)},ia=e=>{const t=Te(),r=L(n=>n.layers).find(n=>n.id===e.layerId);return r===void 0?void 0:(0,d.readGeomColor)({geom:t},r,e.observation)},oc=()=>{const e=Te(),t=L(r=>r.layers);return(0,g.useMemo)(()=>r=>{const n=(0,d.readAnchoredObservation)(t,r);if(n!==null)return(0,d.readGeomColor)({geom:e},n.layer,n.observation)},[t,e])},ac=e=>{const t=Te(),r=L(n=>n.layers);return(0,g.useMemo)(()=>n=>{const o=(0,d.readAnchoredObservation)(r,n);if(o===null)return{};const a=(0,d.resolveSwatchGeomPaint)(t,o.layer,o.observation,{width:e,height:e});return{color:(0,d.readGeomColor)({geom:t},o.layer,o.observation),fill:a.fill,alpha:a.alpha,cornerRadius:a.cornerRadiusPx,symbol:a.symbol}},[r,t,e])},Te=()=>{const e=$r();return L(t=>e.readers(t).geom)},sa=process.env.NODE_ENV!=="production";var la=(0,g.createContext)(new Map),it=new Map,ut=[],ic=(e,t)=>(sa&&(0,d.isGeometricSymbol)(e)&&console.warn(`[graphy] "${e}" is a built-in point shape. The chart draws that shape, and the shape menu hides this glyph.`),{name:e,definition:t}),sc=(e,t)=>[...e??[],...t??[]],lc=({glyphs:e,children:t})=>{const r=(0,g.useMemo)(()=>xc(e),[e]);return(0,s.jsx)(la.Provider,{value:r,children:t})},At=()=>(0,g.useContext)(la),cc=(e,t)=>{const r=fc(e,t);return r!==void 0?r:pc(e,t,gc(e,t))},dc=e=>ca(e)!==void 0,nr=({symbol:e,glyphs:t,size:r,fill:n,fillOpacity:o,stroke:a,strokeOpacity:i,strokeWidth:l})=>{if((0,d.isImageSymbol)(e))return(0,s.jsx)($n,{image:e.image,size:r,fill:n,fillOpacity:o});const c=t.get(e);return c===void 0?(0,s.jsx)("circle",{r:r/2,fill:n,fillOpacity:o,stroke:a,strokeOpacity:i,strokeWidth:l}):typeof c=="function"?(0,s.jsx)("g",{color:n,children:(0,s.jsx)(yc,{glyph:c,paint:{size:r,fill:n,fillOpacity:o,stroke:a,strokeOpacity:i,strokeWidth:l}})}):"d"in c?(0,s.jsx)(bc,{glyph:c,size:r,fill:n,fillOpacity:o,stroke:a,strokeOpacity:i,strokeWidth:l}):(0,s.jsx)($n,{image:c.image,size:r,fill:n,fillOpacity:o})},uc=e=>{const t=atob(e),r=Uint8Array.from(t,n=>n.charCodeAt(0));return new TextDecoder().decode(r)},hc=e=>{try{return uc(e)}catch{return}},vc=e=>{try{return decodeURIComponent(e)}catch{return e}},ca=e=>{if(!e.startsWith("data:image/svg+xml"))return;const t=e.indexOf(",");if(t<0)return;const r=e.slice(0,t),n=e.slice(t+1),o=r.includes(";base64")?hc(n):vc(n);return o?.includes("currentColor")?o:void 0},gc=(e,t)=>{const r=ca(e);return r===void 0?e:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(r.replaceAll("currentColor",mc(t)))}`},fc=(e,t)=>{const r=it.get(e)?.get(t);if(r!==void 0)return da(e,t),r},pc=(e,t,r)=>{let n=it.get(e);for(n===void 0&&(n=new Map,it.set(e,n)),n.set(t,r),da(e,t);ut.length>32;){const o=ut.shift();if(o===void 0)break;const a=it.get(o.image);a?.delete(o.fill),a!==void 0&&a.size===0&&it.delete(o.image)}return r},da=(e,t)=>{const r=ut.findIndex(o=>o.image===e&&o.fill===t),n=r===-1?{image:e,fill:t}:ut.splice(r,1)[0];n!==void 0&&ut.push(n)},mc=e=>{const t=e.trim();return t.length===0||t==="currentColor"||t==="inherit"||t.startsWith("var(")||t.startsWith("url(")?"#000000":t},xc=e=>{const t=new Map;for(const r of e)t.set(r.name,r.definition);return t},yc=({glyph:e,paint:t})=>(0,s.jsx)(e,{...t}),$n=({image:e,size:t,fill:r,fillOpacity:n})=>(0,s.jsx)("image",{href:cc(e,r),x:-t/2,y:-t/2,width:t,height:t,opacity:n}),bc=({glyph:e,size:t,fill:r,fillOpacity:n,stroke:o,strokeOpacity:a,strokeWidth:i})=>{const[l,c,u,h]=e.viewBox,v=Math.max(u,h),f=v===0?0:t/v;return(0,s.jsx)("g",{transform:`translate(${-(l+u/2)*f} ${-(c+h/2)*f}) scale(${f})`,children:(0,s.jsx)("path",{d:e.d,fill:r,fillOpacity:n,stroke:o,strokeOpacity:a,strokeWidth:i===void 0?void 0:i/f})})},St=({symbol:e,cx:t,cy:r,size:n,fill:o,fillOpacity:a,opacity:i,stroke:l,strokeOpacity:c,strokeWidth:u,style:h,motion:v,"data-testid":f})=>{const m=At(),p={fill:o,fillOpacity:a,stroke:l,strokeOpacity:c,strokeWidth:u,style:h},x=v?.fadesIn?{opacity:0}:{};if(!(0,d.isGeometricSymbol)(e)){const S={transformBox:"view-box",...h},P=(0,s.jsx)(nr,{symbol:e,glyphs:m,size:n,fill:o,fillOpacity:a,stroke:l,strokeOpacity:c,strokeWidth:u});return v?(0,s.jsx)(R.motion.g,{initial:v.intro?{x:t,y:r,scale:0,...x}:!1,transition:v.transition,animate:{x:t,y:r,scale:1,opacity:i},"data-testid":f,style:{...S,originX:0,originY:0},children:P}):(0,s.jsx)("g",{opacity:i,"data-testid":f,style:{...S,transform:`translate(${t}, ${r})`},children:P})}if(e==="circle"){const S=n/2;return v?(0,s.jsx)(R.motion.circle,{initial:v.intro?{cx:t,cy:r,r:0,...x}:!1,transition:v.transition,animate:{cx:t,cy:r,r:S,opacity:i},"data-testid":f,...p}):(0,s.jsx)("circle",{cx:t,cy:r,r:S,opacity:i,"data-testid":f,...p})}const y=(0,d.buildPointSymbolPath)(e,n),b={...p,strokeLinejoin:"round",style:{transformBox:"view-box",...h}};return v?(0,s.jsx)(R.motion.path,{initial:v.intro?{x:t,y:r,d:y,scale:0,...x}:!1,transition:v.transition,animate:{x:t,y:r,d:y,scale:1,opacity:i},"data-testid":f,...b,style:{...b.style,originX:0,originY:0}},e):(0,s.jsx)("path",{d:y,opacity:i,"data-testid":f,...b,style:{...b.style,transform:`translate(${t}, ${r})`}})},Ac=2,Sc=.7,Le=({hit:e,project:t})=>{const r=aa(e.layerId),n=ia(e)??d.DEFAULT_GEOM_COLOR;if(!e.anchored)return null;const o=((0,d.getAlpha)(e.observation)??1)*Sc,a=r?.get("size",e.observation)??d.DEFAULT_POINT_SIZE_PX,i=r?.get("stroke",e.observation,"hovered")??d.DEFAULT_HOVER_STROKE_COLOR,l=t(e.x,e.y);return(0,s.jsx)(St,{symbol:r?.get("symbol",e.observation)??"circle",cx:(0,d.toPercent)(l.x),cy:(0,d.toPercent)(l.y),size:a,fill:n,opacity:o,stroke:i,strokeWidth:Ac,"data-testid":"companion-point"})};var eo=10**2,F=e=>Math.round(e*eo)/eo,Pc=32,wc=(e,t)=>{const r=F(t),n=F(2*t),o=`a${r},${r} 0 1,0 ${n},0a${r},${r} 0 1,0 ${-n},0Z`;return e.map(({x:a,y:i})=>`M${F(a-t)},${F(i)}${o}`).join("")},jc=(e,t,r)=>{const n=r.axis==="x",o=n?e.y:e.x,a=n?e.x:e.y,i=n?e.height:e.width,l=n?e.width:e.height,[c,u,h,v]=n?[t[0],t[3],t[2],t[1]]:t,f=Math.max(Math.min(r.from,r.to),a),m=Math.min(Math.max(r.from,r.to),a+l);if(m-f<=0||i<=0)return"";const p=o+i,x=a+l,y=n?0:1,b=(k,E)=>{const[I,G]=n?[E,k]:[k,E];return`${F(I)},${F(G)}`},S=(k,E,I)=>`A${F(k)},${F(k)} 0 0 ${y} ${b(E,I)}`,P=(k,E)=>{const I=a+k,G=x-E,z=(N,K)=>K>0?N-Math.sqrt(Math.max(0,N*N-K*K)):0,D=()=>{let[N,K]=[G,I];for(let V=0;V<Pc;V++){const ye=(N+K)/2;z(k,I-ye)>z(E,ye-G)?N=ye:K=ye}return(N+K)/2},Y=I<=G?I:D(),H=I<=G?G:Y;return{breaks:[Y,H].filter(N=>N>f&&N<m),readInsetAt:N=>Math.max(z(k,I-N),z(E,N-G)),readCornerRadius:(N,K)=>k>0&&Math.max(N,K)<=Y?k:E>0&&Math.min(N,K)>=H?E:null}},w=P(u,h),j=P(c,v),C=(k,E,I,G,z)=>{let D=G;return z.map(Y=>{const H=k.readCornerRadius(D,Y);return D=Y,H===null?`L${b(E,Y)}`:S(H,E+I*k.readInsetAt(Y),Y)})};return`${[`M${b(o+j.readInsetAt(f),f)}`,`L${b(p-w.readInsetAt(f),f)}`,...C(w,p,-1,f,[...new Set([...w.breaks,m])].sort((k,E)=>k-E)),`L${b(o+j.readInsetAt(m),m)}`,...C(j,o,1,m,[...new Set([f,...j.breaks])].sort((k,E)=>E-k))].join("")}Z`},ua=(e,t,r)=>{const n=e.digits?.()??null,o=n===null?null:10**n,a=c=>o===null?c:Math.round(c*o)/o,i=(c,u)=>va(a(c),a(u),r);let l="";return e.context({moveTo:(c,u)=>{l+=`M${i(c,u)}`},lineTo:(c,u)=>{l+=`L${i(c,u)}`},bezierCurveTo:(c,u,h,v,f,m)=>{l+=`C${i(c,u)},${i(h,v)},${i(f,m)}`},closePath:()=>{l+="Z"}}),e(t),e.context(null),l},Br=(e,t)=>{let r="";for(let n=0;n<e.length;n++){const o=e[n];o!==void 0&&(r+=`${n===0?"M":"L"}${va(o.x,o.y,t)}`)}return r===""?"":`${r}Z`},gt=(e,t)=>({x:e.x*t.width,y:e.y*t.height}),ha=e=>{const t=new Map;for(const{center:r,size:n}of e){const o=t.get(n)??[];o.push(r),t.set(n,o)}return[...t].map(([r,n])=>({kind:"dots",centers:n,size:r}))},va=(e,t,{origin:r,scaleX:n,scaleY:o})=>`${F(r.x+e*n)},${F(r.y+t*o)}`,Ec=({layer:e,coordSystem:t,panelRect:r,animateTransitions:n})=>{const{areaGenerator:o}=(0,d.createAreaPathGenerators)(t,e.params),a={origin:{x:0,y:0},scaleX:r.width,scaleY:r.height};let i="";const l=[];e.data.groupBy(d.GROUP_VARIABLES.group).forEach(u=>{const h=(0,d.prepareAreaObservations)([...u],e.params.missingValues),[v]=h;if(v!==void 0){if(h.length===1){const f=kc(v,t,r);f!==null&&l.push(f);return}i+=ua(o,h,a)}});const c=i===""?[]:[{kind:"region",pathData:i,animateTransitions:n}];return l.length>0&&c.push({kind:"dots",centers:l,size:d.DEFAULT_POINT_SIZE_PX}),c},kc=(e,t,r)=>{if(t.mainAxis==="y"){const a=(0,d.getY)(e),i=(0,d.getXTip)(e);return a===null||i===null?null:gt({x:i,y:a},r)}const n=(0,d.getX)(e),o=(0,d.getYTip)(e);return n===null||o===null?null:gt({x:n,y:o},r)},Cc=1.5,ga=(e,t)=>fa(e,t)?Math.max(t,Cc):t,we=(e,t,r)=>{const n=ga(e,t);return{strokeWidth:n,strokeDasharray:(0,d.toStrokeDasharray)(e,n),strokeLinecap:fa(e,t)?"round":r}},fa=(e,t)=>t>0&&e?.[0]===0,pa=e=>{const t=[...e.brightness===void 0?[]:[`brightness(${e.brightness})`],...e.contrast===void 0?[]:[`contrast(${e.contrast})`],...e.saturation===void 0?[]:[`saturate(${e.saturation})`],...e.blur===void 0?[]:[`blur(${e.blur}px)`],...e.shadow===void 0?[]:[Ge(e.shadow)??""]].filter(r=>r!=="");return t.length===0?void 0:t.join(" ")},U=e=>{if(e===void 0)return;const t=pa(e),r=e.blendMode==="normal"?void 0:e.blendMode;if(!(t===void 0&&r===void 0))return{...t===void 0?{}:{filter:t},...r===void 0?{}:{mixBlendMode:r}}},ve="_1d8mpa11",ma="_1d8mpa12",or=(e,t)=>{const r=(t!==void 0?e.delayByKey[t]:void 0)??0;return{duration:e.durationSeconds,ease:e.growAxis==="angle"?"circOut":"backOut",delay:r}},Rc=e=>({duration:e.durationSeconds,ease:"easeOut"}),xa=e=>({duration:e.durationSeconds,ease:"easeOut"}),Tc=e=>Lc(e)+e.durationSeconds,Lc=e=>{switch(e.type){case"grow":return Object.values(e.delayByKey).reduce((t,r)=>Math.max(t,r),0);case"wipe":case"fade":return 0}};var Kt={enabled:!0,trigger:"mount",durationScale:1,stagger:!0,staggerOrder:"mainAxis"},to=1500,Ic=(e,t)=>t?{intro:{...Kt,enabled:!1},transitions:!1,maxAnimatedGeoms:to}:typeof e=="boolean"?{intro:{...Kt,enabled:e},transitions:e,maxAnimatedGeoms:to}:{intro:Oc(e?.intro),transitions:e?.transitions??!0,maxAnimatedGeoms:e?.maxAnimatedGeoms??1500},Oc=e=>typeof e=="boolean"?{...Kt,enabled:e}:(0,qr.merge)({},Kt,e),Mc=(e,t,r)=>{const n=(0,R.useReducedMotion)(),o=(0,g.useMemo)(()=>Ic(r?e:!1,n??!1),[e,r,n]),a=(0,g.useMemo)(()=>t.reduce((i,l)=>i+(0,d.countLayerGeoms)(l),0),[t]);return(0,g.useMemo)(()=>a<=o.maxAnimatedGeoms?o:{...o,intro:{...o.intro,enabled:!1},transitions:!1},[o,a])},Xt={plansByLayerId:null,coordKey:null,introEndsAtMs:0,waitingForView:!1},Bc={...Xt,waitingForView:!0},ze=(0,g.createContext)({...Xt,animateTransitions:!1}),ya=.4,Gc=({animation:e,animate:t,panelRect:r,children:n})=>{const{layers:o,coordSystem:a}=L((0,ee.useShallow)(p=>({layers:p.layers,coordSystem:p.coordSystem}))),{intro:i,transitions:l}=Mc(e,o,t),[c,u]=(0,g.useState)(()=>ro(i)?Bc:no({layers:o,coordSystem:a,intro:i})),[h,v]=(0,g.useState)(null),f=Fc(h)||!ro(i);c.waitingForView&&f&&u(no({layers:o,coordSystem:a,intro:i}));const m=(0,g.useMemo)(()=>({...c,animateTransitions:l}),[c,l]);return(0,s.jsxs)(ze.Provider,{value:m,children:[c.waitingForView&&(0,s.jsx)("div",{ref:v,className:"w2i4n00",style:{left:r.x,top:r.y,width:r.width,height:r.height}},`${r.width}x${r.height}`),n]})},Gr=({children:e})=>{const t=(0,g.useContext)(ze),r=(0,g.useMemo)(()=>({...t,animateTransitions:!1}),[t]);return(0,s.jsx)(ze.Provider,{value:r,children:e})},q=()=>(0,g.useContext)(ze),Nc=()=>{const{introEndsAtMs:e}=(0,g.useContext)(ze),[t]=(0,g.useState)(()=>Dc(e)/1e3);return t},ba=e=>{const{plansByLayerId:t,coordKey:r}=(0,g.useContext)(ze),n=L(o=>Aa(o.coordSystem));return t===null||r!==n?null:t.get(e)??null},ro=e=>e.enabled&&e.trigger==="inView"&&typeof IntersectionObserver<"u",no=({layers:e,coordSystem:t,intro:r})=>{if(!r.enabled)return Xt;const n={durationScale:r.durationScale,stagger:r.stagger,staggerOrder:r.staggerOrder},o=new Map;for(const i of e){const l=(0,d.buildLayerIntroPlan)({layer:i,coordSystem:t,options:n});l!==null&&o.set(i.id,l)}if(o.size===0)return Xt;const a=[...o.values()].reduce((i,l)=>Math.max(i,Tc(l)),0);return{plansByLayerId:o,coordKey:Aa(t),introEndsAtMs:performance.now()+a*1e3,waitingForView:!1}},Fc=e=>{const[t,r]=(0,g.useState)(!1);return(0,g.useEffect)(()=>{if(e===null)return;const n=new IntersectionObserver(o=>{o.some(Hc)&&r(!0)},{threshold:ya});return n.observe(e),()=>n.disconnect()},[e]),t},Hc=({intersectionRatio:e,intersectionRect:t})=>t.width>0&&t.height>0&&e>=ya,Dc=e=>Math.max(0,e-performance.now()),Aa=e=>e.type==="cartesian"?`cartesian-${e.mainAxis}`:e.type,ue={type:"spring",stiffness:500,damping:60,mass:1},Wc={duration:0},ar=e=>e?ue:Wc,Qt=(e,t,r)=>{const n=(0,R.useMotionValue)(e),o=(0,g.useRef)(r);return(0,g.useEffect)(()=>{const a=r!==void 0&&r===o.current;if(o.current=r,n.get()===e)return;if(a){n.set(e);return}const i=(0,Yl.interpolatePath)(n.get(),e),l=(0,R.animate)(0,1,{...t,onUpdate:c=>n.set(i(c))});return()=>l.stop()},[t,e,r,n]),n},Sa=e=>{const{animateTransitions:t}=q();return t?(0,s.jsx)(Vc,{...e}):(0,s.jsx)(zc,{...e})},zc=({fillPath:e,linePath:t,fill:r,fillOpacity:n,stroke:o,strokeWidth:a,strokeOpacity:i,strokeDasharray:l,lineCap:c,lineJoin:u,opacity:h})=>(0,s.jsxs)("g",{opacity:h,children:[(0,s.jsx)("path",{d:e,fill:r,fillOpacity:n,stroke:"none"}),(0,s.jsx)("path",{d:t,fill:"none",stroke:o,strokeWidth:a,strokeOpacity:i,strokeDasharray:l,strokeLinecap:c,strokeLinejoin:u,vectorEffect:"non-scaling-stroke"})]}),Vc=({fillPath:e,linePath:t,fill:r,fillOpacity:n,stroke:o,strokeWidth:a,strokeOpacity:i,strokeDasharray:l,lineCap:c,lineJoin:u,opacity:h})=>{const v=Qt(e,ue),f=Qt(t,ue);return(0,s.jsxs)("g",{opacity:h,children:[(0,s.jsx)(R.motion.path,{d:v,fill:r,fillOpacity:n,stroke:"none"}),(0,s.jsx)(R.motion.path,{d:f,fill:"none",stroke:o,strokeWidth:a,strokeOpacity:i,strokeDasharray:l,strokeLinecap:c,strokeLinejoin:u,vectorEffect:"non-scaling-stroke"})]})},oo=110,ao=150,en=({intro:e,children:t})=>{const r=(0,g.useId)();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("clipPath",{id:r,children:(0,s.jsx)(R.motion.rect,{...Uc(e.axis),transition:Rc(e)})}),(0,s.jsx)("g",{clipPath:`url(#${r})`,children:t})]})},Uc=e=>e==="x"?{x:"-5%",y:"-25%",height:`${ao}%`,initial:{width:"0%"},animate:{width:`${oo}%`}}:{x:"-25%",y:"-5%",width:`${ao}%`,initial:{height:"0%"},animate:{height:`${oo}%`}},Pa={},wa=(0,g.createContext)(Pa),Yc={x:1,y:1},ft=(0,g.createContext)(null),Kc=({shapes:e=Pa,children:t})=>(0,s.jsx)(wa.Provider,{value:e,children:t}),Xc=()=>(0,g.useContext)(wa),tn=({size:e,children:t})=>{const r=(0,g.useMemo)(()=>({panel:{size:e},viewport:{size:e,space:"pixels"}}),[e]);return(0,s.jsx)(ft.Provider,{value:r,children:t})},ja=({size:e,space:t="pixels",children:r})=>{const n=(0,g.useContext)(ft)?.panel,o=(0,g.useMemo)(()=>n===void 0?null:{panel:n,viewport:e===null?null:{size:e,space:t}},[n,e,t]);return(0,s.jsx)(ft.Provider,{value:o,children:r})},ir=()=>(0,g.useContext)(ft)?.viewport??null,sr=()=>{const e=ir();return e?.space==="pixels"?e.size:null},ae=()=>{const e=(0,g.useContext)(ft);if(e===null)throw new Error("useGeomPanelSize ran outside a geom layer.");return e.panel.size},Qc=()=>{const e=ir();return e?.space!=="unit"?Yc:{x:e.size.width,y:e.size.height}},xe=({effects:e,children:t,...r})=>{const n=ir()?.size??null,o=r.viewBox==="0 0 1 1"&&r.preserveAspectRatio==="none";return(0,s.jsx)("g",{style:e,children:(0,s.jsx)("svg",{...r,children:(0,s.jsx)(ja,{size:o?n:null,space:"unit",children:t})})})},qc=(0,g.memo)(function({layer:t,coordSystem:r,intro:n}){const o=n?.type==="wipe"?n:null,{lineGenerator:a,areaGenerator:i}=(0,g.useMemo)(()=>(0,d.createAreaPathGenerators)(r,t.params),[t.params,r]),l=B(t),c=(0,g.useMemo)(()=>{const u=(0,d.createStableKeyGenerator)(t.data,t.mapping,t.id),h=[];return t.data.groupBy(d.GROUP_VARIABLES.group).forEach(v=>{const f=(0,d.prepareAreaObservations)([...v],t.params.missingValues),m=i(f),p=a(f);if(!m||!p)return;const x=f[0];if(!x)return;const y=(0,d.toPaintColor)(l.get("fill",x)),b=l.get("stroke",x)??y,{strokeWidth:S,strokeDasharray:P,strokeLinecap:w}=we(l.get("dashArray",x),l.get("strokeWidth",x),l.get("lineCap",x)),j=l.get("lineJoin",x);h.push({key:u(x),areaPath:m,linePath:p,fill:y,stroke:b,fillOpacity:l.get("fillAlpha",x)*l.get("alpha",x),strokeWidth:S,strokeOpacity:l.get("strokeAlpha",x)*l.get("alpha",x),strokeDasharray:P,lineCap:w,lineJoin:j})}),h},[i,a,t.data,t.id,t.mapping,t.params,l]).map(u=>(0,s.jsx)(_c,{areaPath:u.areaPath,linePath:u.linePath,fill:u.fill,stroke:u.stroke,fillOpacity:u.fillOpacity,strokeWidth:u.strokeWidth,strokeOpacity:u.strokeOpacity,strokeDasharray:u.strokeDasharray,lineCap:u.lineCap,lineJoin:u.lineJoin},u.key));return(0,s.jsx)(xe,{viewBox:"0 0 1 1",preserveAspectRatio:"none",width:"100%",height:"100%","data-geom":"area",effects:U((0,d.readGeomEffects)(l,t.data.getFirst()??void 0)),className:ve,children:o?(0,s.jsx)(en,{intro:o,children:c}):c})}),_c=({areaPath:e,linePath:t,fill:r,stroke:n,fillOpacity:o,strokeWidth:a,strokeOpacity:i,strokeDasharray:l,lineCap:c,lineJoin:u})=>(0,s.jsx)(Sa,{fillPath:e,linePath:t,fill:r,fillOpacity:o,stroke:n,strokeWidth:a,strokeOpacity:i,strokeDasharray:l,lineCap:c,lineJoin:u}),Ea=1,Jc=.4,Zc=.2,$c=1,ed=.5,td=2.25,Qe=({hit:e,project:t,...r})=>{const n=aa(e.layerId),o=ia(e)??d.DEFAULT_GEOM_COLOR;if(!e.anchored)return null;const a=(0,d.getAlpha)(e.observation)??1,i=n?.get("stroke",e.observation,"hovered")??d.DEFAULT_HOVER_STROKE_COLOR,l=n?.get("symbol",e.observation)??"circle",c=t(e.x,e.y),u=(0,d.toPercent)(c.x),h=(0,d.toPercent)(c.y),v=rd(e.observation,n),f=(0,d.isGeometricSymbol)(l)?(0,d.getPointSymbolOuterRadius)(l,v*2):v*Math.SQRT2,{strokeRadius:m,strokeWidth:p}=nd(v,f),x=n?U((0,d.readGeomEffects)(n,e.observation,"hovered")):void 0;return(0,s.jsxs)("g",{...r,style:x,children:[(0,s.jsx)("circle",{cx:u,cy:h,r:m,fill:"none",stroke:i,strokeWidth:p}),(0,s.jsx)(St,{symbol:l,cx:u,cy:h,size:v*2,fill:o,opacity:a,stroke:i,strokeWidth:Ea})]})},rd=(e,t)=>{const r=t?.get("size",e),n=(0,d.getSize)(e)??null;return n!==null?(r??n)/td:(r??12)/2},nd=(e,t)=>{const r=Math.max($c,e*Jc),n=Math.max(ed,e*Zc);return{strokeRadius:t+Ea/2+n+r/2,strokeWidth:r}},od=({layer:e,coordSystem:t,primary:r,companions:n})=>{const o=B(e),a=(0,d.getGroup)(r.observation),i=(0,g.useMemo)(()=>(0,d.prepareAreaObservations)([...e.data.filter(d.GROUP_VARIABLES.group,"eq",a)],e.params.missingValues),[e.data,e.params.missingValues,a]),{areaPath:l,linePath:c}=(0,g.useMemo)(()=>{const{lineGenerator:S,areaGenerator:P}=(0,d.createAreaPathGenerators)(t,e.params);return{areaPath:P(i)??"",linePath:S(i)??""}},[t,e.params,i]);if(!l||!c)return null;const u=(0,d.toPaintColor)(o.get("fill",r.observation,"hovered")),h=o.get("stroke",r.observation,"hovered")??u,v=o.get("alpha",r.observation,"hovered"),f=o.get("fillAlpha",r.observation,"hovered")*v,m=o.get("strokeAlpha",r.observation,"hovered")*v,{strokeWidth:p,strokeDasharray:x,strokeLinecap:y}=we(o.get("dashArray",r.observation,"hovered"),o.get("strokeWidth",r.observation,"hovered"),o.get("lineCap",r.observation,"hovered")),b=o.get("lineJoin",r.observation,"hovered");return(0,s.jsxs)("g",{"data-testid":"hovered-area",children:[(0,s.jsxs)(xe,{viewBox:"0 0 1 1",preserveAspectRatio:"none",width:"100%",height:"100%","data-geom":"area",effects:U((0,d.readGeomEffects)(o,r.observation,"hovered")),className:ve,children:[(0,s.jsx)("path",{d:l,fill:u,fillOpacity:f,stroke:"none",className:ma,"data-testid":"hovered-area-fill"}),(0,s.jsx)("path",{d:c,fill:"none",stroke:h,strokeWidth:p,strokeOpacity:m,strokeDasharray:x,strokeLinecap:y,strokeLinejoin:b,vectorEffect:"non-scaling-stroke","data-testid":"hovered-area-edge"})]}),n.map(S=>(0,s.jsx)(Le,{hit:S,project:me},`companion-${S.layerId}-${S.pointIndex}`)),(0,s.jsx)(Qe,{hit:r,project:me,"data-testid":"hovered-area-point"})]})},ad={geom:"area",coord:"cartesian",swatchShape:"area",guideMode:"crosshair",render:({layer:e,coordSystem:t,intro:r})=>(0,s.jsx)(qc,{layer:e,coordSystem:t,intro:r}),renderHover:({layer:e,coordSystem:t,primary:r,group:n,related:o})=>(0,s.jsx)(od,{layer:e,coordSystem:t,primary:r,companions:[...n,...o]}),renderHoverCompanions:({related:e})=>(0,s.jsx)(s.Fragment,{children:e.map(t=>(0,s.jsx)(Le,{hit:t,project:me},`companion-${t.layerId}-${t.pointIndex}`))}),getEditOutlineShapes:Ec,getOverlayAnchor:({observation:e,coordSystem:t})=>{if(t.mainAxis==="x"){const o=(0,d.getX)(e),a=(0,d.getYTip)(e);return o===null||a===null?null:{x:o,y:a}}const r=(0,d.getY)(e),n=(0,d.getXTip)(e);return r===null||n===null?null:{x:n,y:r}}},lr=e=>{const t=new WeakMap;return(r,...n)=>{const o=t.get(r);if(o!==void 0&&id(o.args,n))return o.result;const a=e(r,...n);return t.set(r,{args:n,result:a}),a}},id=(e,t)=>e.length===t.length&&e.every((r,n)=>r===t[n]),ka={strokeWidth:0,cornerRadius:{baseStart:0,baseEnd:0,tipStart:0,tipEnd:0},strokeAlpha:1},cr=(e,t)=>({stroke:e.get("stroke",t),strokeWidth:e.get("strokeWidth",t),cornerRadius:e.get("cornerRadius",t),strokeAlpha:e.get("strokeAlpha",t)});var io="\0",Ca=(e,t)=>{const r=e.size??32;return e.aspectRatio!==void 0?{width:r,height:r/e.aspectRatio}:{width:r,height:t==null?r:r*t.height/t.width}},sd=e=>new Promise(t=>{if(typeof Image>"u"){t(null);return}const r=new Image;r.onload=()=>{const{naturalWidth:n,naturalHeight:o}=r;t(n>0&&o>0?{width:n,height:o}:null)},r.onerror=()=>t(null),r.src=e}),qe=e=>{const t=[...new Set(e.map(so).filter(i=>i!==void 0))].join(io),[r,n]=(0,g.useState)(()=>new Map),o=(0,g.useRef)(new Set),a=(0,g.useRef)(new Set);return(0,g.useEffect)(()=>()=>{o.current=new Set},[]),(0,g.useEffect)(()=>{const i=new Set(t===""?[]:t.split(io));o.current=i;for(const l of a.current)i.has(l)||a.current.delete(l);n(l=>{const c=new Map([...l].filter(([u])=>i.has(u)));return c.size===l.size?l:c});for(const l of i)r.has(l)||a.current.has(l)||(a.current.add(l),sd(l).then(c=>{o.current.has(l)&&(a.current.delete(l),n(u=>new Map(u).set(l,c)))}))},[t,r]),(0,g.useCallback)(i=>{const l=so(i);return l===void 0?void 0:r.get(l)},[r])},so=e=>{if(e===void 0||!(0,d.isImagePaint)(e))return;const{fit:t="tile",aspectRatio:r,image:n}=e;if(t==="tile"&&r===void 0)return n};var ld=1/3,cd={x:1,y:1},dd={x:0,y:0},te=({paints:e,unitsPerPixel:t=cd,origin:r=dd})=>{const n=(0,g.useId)(),o=(0,g.useMemo)(()=>{const a=new Map,i=new Set;for(const l of e){if(typeof l=="string")continue;const c=(0,d.paintKey)(l);if(a.has(c))continue;const u=`${n}paint-${ud(c)}`;let h=u,v=1;for(;i.has(h);)h=`${u}-${v++}`;i.add(h),a.set(c,{id:h,paint:l})}return a},[e,n]);return{fillFor:(0,g.useCallback)(a=>{if(typeof a=="string")return a;const i=o.get((0,d.paintKey)(a));if(i===void 0)throw new Error("fillFor requires a paint supplied to usePaintDefs.");return`url(#${i.id})`},[o]),defs:(0,s.jsx)(hd,{entries:[...o.values()],unitsPerPixel:t,origin:r})}},ud=e=>{let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=Math.imul(t,16777619);return(t>>>0).toString(36)},hd=({entries:e,unitsPerPixel:t,origin:r})=>{const n=qe(e.map(({paint:o})=>o));return e.length===0?null:(0,s.jsx)("defs",{children:e.map(({id:o,paint:a})=>(0,s.jsx)(vd,{id:o,paint:a,unitsPerPixel:t,origin:r,imageSize:n(a)},o))})},vd=({id:e,paint:t,unitsPerPixel:r,origin:n,imageSize:o})=>(0,d.isGradientPaint)(t)?(0,s.jsx)(fd,{id:e,paint:t}):(0,d.isPatternPaint)(t)?(0,s.jsx)(pd,{id:e,paint:t,unitsPerPixel:r,origin:n}):(0,s.jsx)(md,{id:e,paint:t,unitsPerPixel:r,origin:n,imageSize:o}),Ra=e=>({x:(0,d.toPercent)(e.x),y:(0,d.toPercent)(e.y)}),gd=e=>{const t=(e-90)*Math.PI/180,r=Math.cos(t)/2,n=Math.sin(t)/2;return{x1:.5-r,y1:.5-n,x2:.5+r,y2:.5+n}},fd=({id:e,paint:t})=>{const r=t.stops.map((n,o)=>(0,s.jsx)("stop",{offset:n.offset,stopColor:n.color},o));return t.gradient==="radial"?(0,s.jsx)("radialGradient",{id:e,gradientUnits:"objectBoundingBox",children:r}):(0,s.jsx)("linearGradient",{id:e,gradientUnits:"objectBoundingBox",...gd(t.angle??180),children:r})},pd=({id:e,paint:t,unitsPerPixel:r,origin:n})=>{const o=t.size??8,a=o/2;return(0,s.jsxs)("pattern",{id:e,...Ra(n),patternUnits:"userSpaceOnUse",width:o*r.x,height:o*r.y,viewBox:`0 0 ${o} ${o}`,preserveAspectRatio:"none",children:[t.background!==void 0&&(0,s.jsx)("rect",{width:o,height:o,fill:t.background}),t.pattern==="dots"&&(0,s.jsx)("circle",{cx:a,cy:a,r:o/6,fill:t.color}),t.pattern==="lines"&&(0,s.jsx)("rect",{width:o,height:o*.3333333333333333,fill:t.color}),(t.pattern==="diagonal"||t.pattern==="crosshatch")&&(0,s.jsx)("path",{d:`M0 ${o} L${o} 0`,stroke:t.color,strokeWidth:o/6,fill:"none"}),t.pattern==="crosshatch"&&(0,s.jsx)("path",{d:`M0 0 L${o} ${o}`,stroke:t.color,strokeWidth:o/6,fill:"none"})]})},md=({id:e,paint:t,unitsPerPixel:r,origin:n,imageSize:o})=>{if((t.fit??"tile")==="stretch")return(0,s.jsxs)("pattern",{id:e,patternUnits:"objectBoundingBox",patternContentUnits:"objectBoundingBox",width:1,height:1,children:[(0,s.jsx)("rect",{width:1,height:1,fill:t.fallback}),(0,s.jsx)("image",{href:t.image,width:1,height:1,opacity:t.alpha,preserveAspectRatio:"none"})]});const a=Ca(t,o);return(0,s.jsxs)("pattern",{id:e,...Ra(n),patternUnits:"userSpaceOnUse",width:a.width*r.x,height:a.height*r.y,viewBox:`0 0 ${a.width} ${a.height}`,preserveAspectRatio:"none",children:[(0,s.jsx)("rect",{width:a.width,height:a.height,fill:t.fallback}),(0,s.jsx)("image",{href:t.image,width:a.width,height:a.height,opacity:t.alpha,preserveAspectRatio:"none"})]})},rn=e=>({x:(0,d.toPercent)(e.x),y:(0,d.toPercent)(e.y),width:(0,d.toPercent)(e.width),height:(0,d.toPercent)(e.height)}),xd="var(--_8zqcis0)",yd="var(--_8zqcis1)",bd="var(--_8zqcis2)",Ad="var(--_8zqcis3)",Sd="var(--_8zqcis4)",nn={x:"_8zqcis5",y:"_8zqcis6"},Ta={x:"_8zqcis7",y:"_8zqcis8"},Ce={start:ht(xd),size:ht(yd),cap:ht(bd)},lo="bar-border-separator",La=ht(Ad),Ia=ht(Sd),Oa=(e,t)=>t===void 0?void 0:{mainAxis:e,maxWidth:t},Me=(e,t,r)=>{const n=rn(e);return t===void 0?r===void 0?n:{...n,style:r}:{...Ba(n,t.mainAxis),className:nn[t.mainAxis],style:{...dr(on(n,t.mainAxis),t),...r}}},co=(e,t,r)=>t===void 0?{...e,style:r}:{...Ba(e,t.mainAxis),className:nn[t.mainAxis],style:{...dr(on(e,t.mainAxis),t),...r}},uo=(e,t)=>{const{x:r,y:n,width:o,height:a}=rn(e);return t===void 0?{attrX:r,attrY:n,width:o,height:a}:t.mainAxis==="x"?{attrY:n,height:a,[Ce.start]:r,[Ce.size]:o}:{attrX:r,width:o,[Ce.start]:n,[Ce.size]:a}},Pd=(e,t)=>e===void 0?{style:t}:{className:nn[e.mainAxis],style:{[Ce.cap]:`${e.maxWidth}px`,...t}},Ma=(e,t,r,n)=>({className:Ta[r.mainAxis],style:{...dr(on(rn(t),r.mainAxis),r),[La]:(0,d.toPercent)(e),[Ia]:`${n}px`}}),ho=e=>({[La]:(0,d.toPercent)(e)}),wd=(e,t,r,n)=>({className:Ta[t.mainAxis],style:{...dr(e,t),[Ia]:`${r}px`,...n}}),dr=(e,t)=>({[Ce.start]:e.start,[Ce.size]:e.size,[Ce.cap]:`${t.maxWidth}px`}),on=(e,t)=>t==="x"?{start:e.x,size:e.width}:{start:e.y,size:e.height},Ba=(e,t)=>t==="x"?{y:e.y,height:e.height}:{x:e.x,width:e.width};function ht(e){return e.replace(/^var\((--[^),]+).*\)$/,"$1")}var jd=9999,Ed=lr(d.resolveBarBandThickness),Ga=e=>e==="full",Na=(e,t,r)=>{const[n,o]=r==="x"?[t.y,t.height]:[t.x,t.width];return e>n+1e-9&&e<n+o-1e-9},Fa=(e,t,r)=>r==="x"?{x1:(0,d.toPercent)(t.x),y1:(0,d.toPercent)(e),x2:(0,d.toPercent)(t.x+t.width),y2:(0,d.toPercent)(e)}:{x1:(0,d.toPercent)(e),y1:(0,d.toPercent)(t.y),x2:(0,d.toPercent)(e),y2:(0,d.toPercent)(t.y+t.height)},Ha=(e,t,r)=>e==="x"?{...t,x:r.x,width:r.width}:{...t,y:r.y,height:r.height},Da=({layer:e,mainAxis:t,styleReaders:r,dense:n=!1,buildSegment:o})=>{const a=(0,d.resolveBarBaseline)(e,t),i=Oa(t,r.get("maxWidth")),l=new Map;let c=-1;for(const h of e.data){c+=1;const v=(0,d.getBarRectBounds)(h);if(!v)continue;const f=(0,d.buildColumnKey)(t,v),m=o(h,v,c),p=l.get(f);p===void 0?l.set(f,{firstObservation:h,segments:[m]}):p.segments.push(m)}const u=new Map;for(const[h,{firstObservation:v,segments:f}]of l){const m=n?ka:cr(r,v);u.set(h,{...Ya(m,(0,d.getBoundingRect)(f),t,a,i),segments:f})}return u},kd=(e,t,r,n=!1)=>{const o=new Map,a=Da({layer:e,mainAxis:t,styleReaders:r,dense:n,buildSegment:(i,l)=>l});for(const[i,{style:l,bounds:c,baseEdge:u,corners:h,cap:v}]of a)o.set(i,{style:l,bounds:c,baseEdge:u,corners:h,cap:v});return{columns:o,baseline:(0,d.resolveBarBaseline)(e,t),dense:n}},an=lr(kd),Wa=({columns:e,baseline:t,dense:r},n,o,a)=>{const i=(0,d.getBarRectBounds)(a);if(!i)return null;const l=e.get((0,d.buildColumnKey)(n,i))??Ya(r?ka:cr(o,a),i,n,t,Oa(n,o.get("maxWidth")));return{column:l,bounds:Ha(n,i,l.bounds)}},za=(e,t,r,n)=>{const o=t==="x"?r.width:r.height,a=Math.max(d.DENSE_BAR_THICKNESS_PX,4*Cd(e,n)),i=Ed(e,t)*o;return Math.min(i,n.get("maxWidth")??1/0)<a},sn=(e,t)=>({x:e.x-t,y:e.y-t,width:Math.max(0,e.width+t*2),height:Math.max(0,e.height+t*2)}),Va=([e,t,r,n])=>{const o=a=>Ga(a)?jd:a;return[o(e),o(t),o(r),o(n)]},ur=(e,t)=>{const[r,n,o,a]=e,i=l=>l>0?Math.max(0,l+t):0;return[i(r),i(n),i(o),i(a)]},st=(e,t)=>{const[r,n,o,a]=(0,d.fitBarCornersToRect)(t,Math.max(0,e.width),Math.max(0,e.height)),i=e.x,l=e.y,c=e.x+e.width,u=e.y+e.height,h=(f,m)=>`${F(f)},${F(m)}`,v=(f,m,p)=>f>0?`A${F(f)},${F(f)} 0 0 1 ${h(m,p)}`:"";return`M${h(i+r,l)}L${h(c-n,l)}${v(n,c,l+n)}L${h(c,u-o)}${v(o,c-o,u)}L${h(i+a,u)}${v(a,i,u-a)}L${h(i,l+r)}${v(r,i+r,l)}Z`},Ua=(e,t)=>{const r=F(e.x),n=F(e.y),o=F(e.x+e.width),a=F(e.y+e.height),i=F(Math.max(0,Math.min(t,e.width/2))),l=F(Math.max(0,Math.min(t,e.height/2)));if(i<=0||l<=0)return`M${r},${n}H${o}V${a}H${r}Z`;const c=`A${i},${l} 0 0 1 `,[u,h,v,f]=[`${r}`,`${n}`,`${o}`,`${a}`],m=`${F(r+i)}`,p=`${F(o-i)}`,x=`${F(n+l)}`,y=`${F(a-l)}`;return`M${m},${h}H${p}${c}${v},${x}V${y}${c}${p},${f}H${m}${c}${u},${y}V${x}${c}${m},${h}Z`},ln=(e,t)=>(0,g.useMemo)(()=>(0,d.resolveBarPaintOrigin)(e,t.mainAxis),[e,t.mainAxis]),Cd=(e,t)=>{const r=e.data.getFirst();if(r===null||t.get("stroke",r)===void 0)return 0;const n=t.get("strokeWidth",r);return typeof n=="number"?n:0},Ya=(e,t,r,n,o)=>{const a=(0,d.findBarBaseEdge)(r,t,n);return{style:e,bounds:t,baseEdge:a,corners:(0,d.resolveBarCorners)(e.cornerRadius,r,a),cap:o}},Ka=(0,g.createContext)(!1),Rd=({layer:e,coordSystem:t,panelSize:r,styleReaders:n,children:o})=>(0,s.jsx)(Ka.Provider,{value:za(e,t.mainAxis,r,n),children:o}),cn=()=>(0,g.useContext)(Ka),Ht=1e-6,Td=({layer:e,sourceLayer:t,coordSystem:r,panelRect:n,styleReaders:o,animateTransitions:a})=>{const{mainAxis:i}=r,{columns:l}=an(t,i,o,za(t,i,n,o)),c=Ld(e.data);let u="";for(let h=0;h<e.data.size();h++){const v=(0,d.buildBarRectBounds)({xMin:c.xMin[h]??null,xMax:c.xMax[h]??null,yMin:c.yMin?.[h]??null,yMax:c.yMax[h]??null,y:c.y?.[h]??null});if(v===null)continue;const f=l.get((0,d.buildColumnKey)(i,v));if(f===void 0)continue;const m=(0,d.clampBarThickness)(i,f.bounds,f.cap?.maxWidth,n),p=Ha(i,v,m),x=(0,d.scaleRectToPanel)(m,n),y=(0,d.scaleRectToPanel)(p,n),b=(0,d.fitBarCorners)(f.corners,x);u+=Od(y,x)&&!Id(b,x)?st(x,b):jc(x,b,i==="x"?{axis:"y",from:y.y,to:y.y+y.height}:{axis:"x",from:y.x,to:y.x+y.width})}return u===""?[]:[{kind:"region",pathData:u,animateTransitions:a}]},Ld=e=>{const t=r=>e.hasVariable(r)?e.getValues(r,{type:"numeric"}):null;return{xMin:e.getValues(d.POSITION_VARIABLES.xMin,{type:"numeric"}),xMax:e.getValues(d.POSITION_VARIABLES.xMax,{type:"numeric"}),yMin:t(d.POSITION_VARIABLES.yMin),yMax:e.getValues(d.POSITION_VARIABLES.yMax,{type:"numeric"}),y:t(d.POSITION_VARIABLES.y)}},Id=([e,t,r,n],o)=>e+n>o.height+Ht||t+r>o.height+Ht||e+t>o.width+Ht||n+r>o.width+Ht,Od=(e,t)=>Math.abs(e.x-t.x)<.5&&Math.abs(e.y-t.y)<.5&&Math.abs(e.width-t.width)<.5&&Math.abs(e.height-t.height)<.5,Nr=(e,t,r)=>{const n=r===void 0?e.activeIntro:r,o=(0,g.useRef)(n?or(n,t):null),a=(0,g.useRef)(e.animateTransitions);return a.current=e.animateTransitions,(0,g.useCallback)(()=>{const i=o.current;return o.current=null,i??ar(a.current)},[])},hr=e=>{const{animateTransitions:t}=q(),r=(0,g.useRef)(!0);(0,g.useEffect)(()=>{r.current=!1},[]);const n=r.current;return(0,g.useMemo)(()=>({animated:t||e!==null,mounting:n,activeIntro:n?e:null,animateTransitions:t}),[e,t,n])},Pt=(e,t)=>(0,g.useMemo)(()=>{const r=Array.from(e.data,o=>t.get("fill",o));return{paints:r,paintAt:o=>{const a=r[o];if(a===void 0)throw new Error(`No resolved fill for observation ${o}.`);return a}}},[e.data,t]),Md="bar-border-ring",Bd=({bounds:e,cap:t,mainAxis:r,ring:n})=>{const o=sr(),a=o&&Fr(e,t,r,n.width,o);if(!a)return null;const i=Xa(a,n);return _a(i,n,(0,s.jsx)("path",{d:Qa(a,n,i),...qa(i,n)}))},Gd=({bounds:e,cap:t,mainAxis:r,ring:n,target:o})=>{const a=sr(),i=a&&Fr(o,t,r,n.width,a),l=i?Xa(i,n):"clipped",c=(0,R.useTransform)([e.x,e.y,e.width,e.height],([h=0,v=0,f=0,m=0])=>{const p=a&&Fr({x:h,y:v,width:f,height:m},t,r,n.width,a);return p?Qa(p,n,l):""}),u=`${l}:${n.clip.style.clipPath??""}`;return _a(l,n,(0,s.jsx)(R.motion.path,{d:c,...qa(l,n)},u))},Fr=(e,t,r,n,o)=>{const a=(0,d.scaleRectToPanel)((0,d.clampBarThickness)(r,e,t?.maxWidth,o),o);return(r==="x"?a.width:a.height)<4*n||a.width<=0||a.height<=0?null:a},Xa=(e,{corners:t,width:r})=>{if((0,d.splitFullEnd)(t)!==void 0)return"split";const n=r/2,o=sn(e,-n);if(o.width<=0||o.height<=0)return"clipped";const a=(0,d.fitBarCorners)(t,e);if(a.some(l=>l>0&&l<=n))return"clipped";const i=ur(a,-n);return(0,d.fitBarCornersToRect)(i,o.width,o.height).every((l,c)=>l===i[c])?"inset":"clipped"},Qa=(e,{corners:t,width:r},n)=>{if(n==="inset"){const a=r/2;return st(sn(e,-a),ur((0,d.fitBarCorners)(t,e),-a))}const o=(0,d.splitFullEnd)(t);return n==="clipped"||o===void 0?st(e,(0,d.fitBarCorners)(t,e)):st(e,(0,d.fitBarCorners)(o.fullEnd,e))+st(e,(0,d.fitBarCorners)(o.otherEnd,e))},qa=(e,t)=>({fill:"none",stroke:t.stroke,strokeWidth:e==="inset"?t.width:t.width*2,opacity:t.opacity,style:e==="inset"?void 0:t.clip.style,"data-testid":Md}),_a=(e,t,r)=>e==="split"?(0,s.jsx)("g",{style:t.clip.endStyle,children:r}):r,Ja=e=>{const[t,...r]=e,n=t?.effects;return r.every(o=>Nd(o.effects,n))?{scope:"column",style:n}:{scope:"bar"}},Nd=(e,t)=>e===t||e!==void 0&&t!==void 0&&e.filter===t.filter&&e.mixBlendMode===t.mixBlendMode,dn={fillClip:void 0,border:void 0},Fd="bar-border-plate",vo={},Dt="-1000px",Za=(e,t,r)=>(0,s.jsxs)(s.Fragment,{children:[e?.kind==="plate"&&Vd(e,t),r,e?.kind==="ring"&&t.ring(e)]}),$a=(e,t,r)=>({rect:({style:n,...o})=>(0,s.jsx)("rect",{...Me(e,t,n),...o}),ring:n=>(0,s.jsx)(Bd,{bounds:e,cap:t,mainAxis:r,ring:n})}),lt=(e,t)=>{const r=o=>{const a=Va(o);return t===void 0?Hr(a):Hr(ur(a,-t),`${t}px`)},n=(0,d.splitFullEnd)(e);return n===void 0?{style:r(e)}:{style:r(n.otherEnd),endStyle:r(n.fullEnd)}},go=e=>e&&{style:vo,endStyle:e.endStyle&&vo},Se=(e,t,r)=>e?.endStyle===void 0?t(e?.style):(0,s.jsx)("g",{style:e.endStyle,children:t(e.style)},r),ei=(e,t,r=0)=>{const n=(o,a)=>{const i=a>0?(0,d.toPercent)(Math.max(0,o)/a):"0%";return r===0?i:`calc(${i} - ${r}px)`};return{clipPath:`inset(${n(e.y-t.y,t.height)} ${n(t.x+t.width-(e.x+e.width),t.width)} ${n(t.y+t.height-(e.y+e.height),t.height)} ${n(e.x-t.x,t.width)}) fill-box`}},un=e=>{const t=new Map;return({style:r,corners:n},o)=>{const a=ti(r)&&o(),i=`${a}|${n.join(" ")}|${r.stroke}|${r.strokeWidth}|${r.strokeAlpha}`;let l=t.get(i);return l===void 0&&(l=Hd(r,n,e,a),t.set(i,l)),l}},Hd=(e,t,r,n)=>{const o=t.some(l=>Ga(l)||l>0);if(!ti(e))return{fillClip:o?lt(t,0):void 0,border:void 0};const a=e.strokeWidth,i={stroke:e.stroke,opacity:e.strokeAlpha,separatorWidth:(0,d.resolveBarBorderTreatment)(a).separatorWidth,separatorStyle:zd(a,r)};return n?{fillClip:Dd(t,a,r),border:{kind:"plate",...i,clip:lt(t)}}:{fillClip:o?lt(t,0):void 0,border:{kind:"ring",...i,corners:t,width:a,clip:lt(t)}}},ti=e=>e.stroke!==void 0&&e.strokeWidth>0,Dd=(e,t,r)=>{const n=`${t}px`,o=`clamp(0px, calc((100% - ${4*t}px) * 1000), ${t}px)`,a=([x,y])=>x===y?r==="x"?`${x} ${o}`:`${o} ${x}`:r==="x"?`${x} ${o} ${y} ${o}`:`${o} ${y} ${o} ${x}`,i=(x,y)=>Hr(ur(Va(x),-t),a(y)),l=Wd(e,r);if(l===void 0)return{style:i(e,[n,n])};const[c,u,h,v]=e,f=x=>{const y=b=>b==="full"===x?b:0;return[y(c),y(u),y(h),y(v)]},m=l==="start"?[n,"0px"]:["0px",n],p=l==="start"?["0px",n]:[n,"0px"];return{style:i(f(!1),p),endStyle:i(f(!0),m)}},Wd=(e,t)=>{const[r,n,o,a]=e.map(c=>c==="full"),[i,l]=t==="x"?[r||n,o||a]:[r||a,n||o];if(i!==l)return i?"start":"end"},zd=(e,t)=>{const r=`clamp(0px, calc((${4*e}px - 100%) * 1000), 50%)`;return{clipPath:t==="x"?`inset(${Dt} ${r} ${Dt} ${r}) fill-box`:`inset(${r} ${Dt} ${r} ${Dt}) fill-box`}},Hr=(e,t="0")=>({clipPath:e.some(r=>r>0)?`inset(${t} round ${e.map(r=>`${r}px`).join(" ")}) fill-box`:`inset(${t}) fill-box`}),Vd=({stroke:e,opacity:t,clip:r},{rect:n})=>Se(r,o=>n({fill:e,opacity:t,style:o,"data-testid":Fd})),hn=(e,t)=>t.growAxis==="x"?{x:t.baseline,y:e.y,width:0,height:e.height}:{x:e.x,y:t.baseline,width:e.width,height:0},Ud=(0,g.memo)(function({layer:t,coordSystem:r,intro:n}){const o=B(t),a=cn(),i=hr(n?.type==="grow"&&(n.growAxis==="x"||n.growAxis==="y")?n:null),{paints:l,paintAt:c}=Pt(t,o),{fillFor:u,defs:h}=te({paints:l,origin:ln(t,r)}),{mainAxis:v}=r,f=(0,g.useMemo)(()=>{const p=(0,d.createStableKeyGenerator)(t.data,t.mapping,t.id);return[...Da({layer:t,mainAxis:v,styleReaders:o,buildSegment:(x,y,b)=>{const S=c(b),P=yt(o,x);return{key:p(x),...y,fill:u(S),opacity:P,paint:S,effects:U((0,d.readGeomEffects)(o,x))}}}).values()].map(x=>({...x,effects:Ja(x.segments)}))},[u,t,v,c,o]),m=(0,g.useMemo)(()=>{const p=new Map,x=un(v);return f.map((y,b)=>({key:y.segments[0]?.key??String(b),bars:y.segments,effects:y.effects,...y.bounds,cap:y.cap,...a?dn:x(y,()=>y.segments.every(S=>S.opacity>=1&&Zr(S.paint,p)))}))},[a,f,v]);return(0,s.jsxs)(s.Fragment,{children:[h,(0,s.jsx)("g",{children:(0,g.useMemo)(()=>m.map(p=>{const x=p.effects.scope==="column"?p.effects.style:void 0;if(p.bars.length===1&&p.border===void 0){const[y]=p.bars;if(!y)return null;const{key:b,effects:S,paint:P,...w}=y,j=Se(p.fillClip,C=>(0,s.jsx)(Dr,{...w,style:C,cap:p.cap,animation:i,introKey:b},b),b);return x===void 0?j:(0,s.jsx)("g",{style:x,children:j},b)}return(0,s.jsx)("g",{style:x,children:i.animated?(0,s.jsx)(Kd,{column:p,mainAxis:v,animation:i}):(0,s.jsx)(Yd,{column:p,mainAxis:v,animation:i})},p.key)}),[i,m,v])})]})}),Yd=({column:e,mainAxis:t,animation:r})=>{const{cap:n}=e;return ri(e,t,r,{columnBox:(0,s.jsx)("rect",{...Me(e,n),fill:"none"}),boxElements:$a(e,n,t)})},Kd=({column:e,mainAxis:t,animation:r})=>{const{bars:n,cap:o}=e,a=Zd(e,t,r,n[0]?.key),i=String(o?.maxWidth);return ri(e,t,r,{bounds:a,columnBox:(0,s.jsx)(R.motion.rect,{...co(a.percent,o),fill:"none"},i),boxElements:{rect:({style:l,...c})=>{const{clipPath:u,style:h}=vn(l);return(0,s.jsx)(R.motion.rect,{...co(a.percent,o,h),...c,clipPath:u},`${i}|${qt(h)}`)},ring:l=>(0,s.jsx)(Gd,{bounds:a.normalized,target:e,cap:o,mainAxis:t,ring:l})}})},vn=e=>{const{clipPath:t,...r}=e??{};return{clipPath:t,style:r}},ri=(e,t,r,{columnBox:n,boxElements:o,bounds:a})=>{const{border:i}=e;return Za(i,o,Xd(e,t,r,n,a&&{target:e,bounds:a}))},Xd=(e,t,r,n,o)=>{const{bars:a,effects:i,fillClip:l,border:c,cap:u}=e,[h]=a;if(a.length===1&&h!==void 0){const{key:p,effects:x,paint:y,...b}=h;return Se(l,S=>(0,s.jsx)(Dr,{...b,style:S,cap:u,animation:r,introKey:p}))}const v=i.scope==="column",f=v?l:go(l),m=v?go(l):l;return(0,s.jsxs)(s.Fragment,{children:[Se(f,p=>(0,s.jsx)("g",{style:p,children:a.map(({key:x,effects:y,paint:b,...S})=>(0,s.jsx)("g",{style:v?void 0:y,children:Se(m,P=>(0,s.jsxs)("g",{style:P,children:[(0,s.jsx)(Dr,{...S,cap:u,animation:r,introKey:x}),!v&&n]}))},x))})),c&&Se(l,p=>(0,s.jsxs)("g",{style:p,children:[a.map(({key:x,...y})=>Qd(y,e,t)&&(0,s.jsx)(qd,{bar:y,mainAxis:t,stroke:c.stroke,strokeWidth:c.separatorWidth,opacity:c.opacity,animation:r,introKey:x,cap:u,style:c.separatorStyle,springingColumn:o},x)),n]}))]})},Qd=(e,t,r)=>{const[n,o]=r==="x"?[e.y,e.height]:[e.x,e.width];return o>1e-9&&Na(n,t,r)},Dr=({animation:e,introKey:t,style:r,cap:n,...o})=>{const{animated:a,activeIntro:i,animateTransitions:l}=e;if(!a)return(0,s.jsx)("rect",{...Me(o,n,r),fill:o.fill,opacity:o.opacity});const c=i?hn(o,i):null,{clipPath:u,style:h}=vn(r),v=Pd(n,h);return(0,s.jsx)(R.motion.rect,{initial:c?{...uo(c,n),opacity:o.opacity}:!1,transition:i?or(i,t):ar(l),fill:o.fill,opacity:o.opacity,...v,clipPath:u,animate:{...uo(o,n),opacity:o.opacity}},qt(v.style))},qd=({bar:e,mainAxis:t,stroke:r,strokeWidth:n,opacity:o,animation:a,introKey:i,cap:l,style:c,springingColumn:u})=>{const{animated:h,activeIntro:v,animateTransitions:f}=a,m=fo(e,t);if(!h||u===void 0)return l===void 0?(0,s.jsx)("line",{...Fa(m,e,t),stroke:r,strokeWidth:n,opacity:o,style:c}):(0,s.jsx)("rect",{...Jd(Ma(m,e,l,n),c),fill:r,opacity:o,"data-testid":lo});const{band:p}=u.bounds,x=v?fo(hn(e,v),t):_d(m,u,t),y=v?or(v,i):ar(f),{clipPath:b,style:S}=vn(c);if(l!==void 0){const j=wd(p,l,n,S);return(0,s.jsx)(R.motion.rect,{initial:ho(x),transition:y,animate:ho(m),...j,clipPath:b,fill:r,opacity:o,"data-testid":lo},`${l.maxWidth}|${n}|${qt(S)}`)}const P=t==="x"?{edge:["y1","y2"],band:{x1:p.start,x2:p.end}}:{edge:["x1","x2"],band:{y1:p.start,y2:p.end}},w=j=>({[P.edge[0]]:(0,d.toPercent)(j),[P.edge[1]]:(0,d.toPercent)(j)});return(0,s.jsx)(R.motion.line,{initial:w(x),transition:y,animate:w(m),...P.band,stroke:r,strokeWidth:n,opacity:o,style:S,clipPath:b},qt(S))},_d=(e,{target:t,bounds:r},n)=>{const[o,a,i]=n==="x"?[t.y,t.height,{start:r.percent.y,length:r.percent.height}]:[t.x,t.width,{start:r.percent.x,length:r.percent.width}];return a<=0?e:ke(i.start.get())+(e-o)/a*ke(i.length.get())},qt=e=>e===void 0?"":Object.entries(e).map(([t,r])=>`${t}:${String(r)}`).join(";"),Jd=(e,t)=>({...e,style:{...e.style,...t}}),fo=(e,t)=>t==="x"?e.y:e.x,Zd=(e,t,r,n)=>{const o=r.activeIntro?hn(e,r.activeIntro):e,a=(0,R.useMotionValue)((0,d.toPercent)(o.x)),i=(0,R.useMotionValue)((0,d.toPercent)(o.y)),l=(0,R.useMotionValue)((0,d.toPercent)(o.width)),c=(0,R.useMotionValue)((0,d.toPercent)(o.height)),u=Nr(r,n);(0,g.useEffect)(()=>{const f=u(),m=[(0,R.animate)(a,(0,d.toPercent)(e.x),f),(0,R.animate)(i,(0,d.toPercent)(e.y),f),(0,R.animate)(l,(0,d.toPercent)(e.width),f),(0,R.animate)(c,(0,d.toPercent)(e.height),f)];return()=>{for(const p of m)p.stop()}},[a,i,l,c,e.x,e.y,e.width,e.height,u]);const[h,v]=t==="x"?[a,l]:[i,c];return{normalized:{x:(0,R.useTransform)(a,ke),y:(0,R.useTransform)(i,ke),width:(0,R.useTransform)(l,ke),height:(0,R.useTransform)(c,ke)},percent:{x:a,y:i,width:l,height:c},band:{start:h,size:v,end:(0,R.useTransform)([h,v],([f="0%",m="0%"])=>(0,d.toPercent)(ke(f)+ke(m)))}}},ke=e=>Number.parseFloat(e)/100,ni=({testIdPrefix:e,mainAxis:t,column:r,bounds:n,fill:o,opacity:a,silhouette:i})=>{const{fillClip:l,border:c}=i,{cap:u}=r;if(c===void 0&&tu(n,r.bounds))return Se(l,v=>(0,s.jsx)("rect",{...Me(n,u,v),fill:o,opacity:a,"data-testid":`${e}-segment`}));const h=Se(l,v=>(0,s.jsxs)("g",{style:v,children:[(0,s.jsx)("rect",{...Me(n,u),fill:o,opacity:a,"data-testid":`${e}-segment`}),c&&eu(n,r.bounds,t).map(f=>u===void 0?(0,s.jsx)("line",{...Fa(f,r.bounds,t),stroke:c.stroke,strokeWidth:c.separatorWidth,opacity:c.opacity,style:c.separatorStyle,"data-testid":`${e}-separator`},f):(0,s.jsx)("rect",{...$d(Ma(f,r.bounds,u,c.separatorWidth),c.separatorStyle),fill:c.stroke,opacity:c.opacity,"data-testid":`${e}-separator`},f)),(0,s.jsx)("rect",{...Me(r.bounds,u),fill:"none"})]}));return(0,s.jsx)("g",{style:ei(n,r.bounds),"data-testid":e,children:c?Za(c,$a(r.bounds,u,t),h):h})},$d=(e,t)=>({...e,style:{...e.style,...t}}),eu=(e,t,r)=>{const[n,o]=r==="x"?[e.y,e.height]:[e.x,e.width];return[n,n+o].filter(a=>Na(a,t,r))},tu=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,ru=({layer:e,sourceLayer:t,coordSystem:r})=>{const{defs:n,columns:o}=nu(e,t,r);return(0,s.jsxs)(s.Fragment,{children:[n,(0,s.jsx)("g",{children:o.flatMap(a=>{const[i]=a,l=Ja(a);return i!==void 0&&l.scope==="column"?[(0,s.jsx)("g",{style:l.style,children:a.map(({node:c})=>c)},i.key)]:a.map(({key:c,effects:u,node:h})=>(0,s.jsx)("g",{style:u,children:h},c))})})]})},nu=(e,t,r)=>{const{mainAxis:n}=r,o=cn(),a=B(t),i=an(t,n,a,o),{paints:l,paintAt:c}=Pt(e,a),{fillFor:u,defs:h}=te({paints:l,origin:ln(t,r)}),v=(0,d.createStableKeyGenerator)(e.data,e.mapping,e.id),f=new Map,m=new Map,p=un(n);let x=-1;for(const y of e.data){x+=1;const b=Wa(i,n,a,y);if(b===null)continue;const S=v(y),P=c(x),w=yt(a,y),j=o?dn:p(b.column,()=>w>=1&&Zr(P,m)),C={key:S,effects:U((0,d.readGeomEffects)(a,y)),node:(0,s.jsx)(ni,{testIdPrefix:"highlight-bar",mainAxis:n,column:b.column,bounds:b.bounds,fill:u(P),opacity:w,silhouette:j},S)},k=f.get(b.column);k===void 0?f.set(b.column,[C]):k.push(C)}return{defs:h,columns:[...f.values()]}},po=3,ou=({layer:e,coordSystem:t,primary:r})=>{const{mainAxis:n}=t,o=cn(),a=B(e),i=an(e,n,a,o),l=a.get("fill",r.observation,"hovered"),{fillFor:c,defs:u}=te({paints:[l],origin:ln(e,t)}),h=Wa(i,n,a,r.observation),v=yt(a,r.observation,"hovered"),f=h&&(o?dn:un(n)(h.column,()=>v>=1&&(0,d.isOpaquePaint)(l)));if(h===null||f===null)return null;const{column:m,bounds:p}=h,x=a.get("stroke",r.observation,"hovered");return(0,s.jsxs)("g",{"data-testid":"hovered-bar",style:U((0,d.readGeomEffects)(a,r.observation,"hovered")),children:[u,(0,s.jsx)("g",{style:ei(p,m.bounds,po),children:Se(lt(m.corners,-3),y=>(0,s.jsx)("rect",{...Me(m.bounds,m.cap,y),fill:x,stroke:x,strokeWidth:po*2,"data-testid":"hovered-bar-border"}))}),(0,s.jsx)(ni,{testIdPrefix:"hovered-bar-repaint",mainAxis:n,column:m,bounds:p,fill:c(l),opacity:v,silhouette:f})]})},au=lr(d.createBarBoundsReader),iu={geom:"bar",coord:"cartesian",swatchShape:"square",guideMode:"band",LayerProvider:Rd,render:({layer:e,coordSystem:t,intro:r})=>(0,s.jsx)(Ud,{layer:e,coordSystem:t,intro:r}),renderHighlight:({layer:e,sourceLayer:t,coordSystem:r})=>(0,s.jsx)(ru,{layer:e,sourceLayer:t,coordSystem:r}),renderHover:({layer:e,coordSystem:t,primary:r})=>(0,s.jsx)(ou,{layer:e,coordSystem:t,primary:r}),getEditOutlineShapes:Td,getObservationRect:({layer:e,coordSystem:t,observation:r,panelRect:n,styleReaders:o})=>au(e,t.mainAxis,o,n)(r)},su=({layer:e,panelRect:t,styleReaders:r,animateTransitions:n})=>{const o=(0,d.createLinePathGenerator)(e.params),a={origin:{x:0,y:0},scaleX:t.width,scaleY:t.height},i=[],l=[];return e.data.groupBy(d.GROUP_VARIABLES.group).forEach(c=>{const u=(0,d.prepareLineObservations)([...c],e.params.missingValues),[h]=u;if(h===void 0)return;if(u.length===1){const f=lu(h,t);f!==null&&l.push(f);return}const v=ua(o,u,a);v!==""&&i.push({kind:"stroke",key:String((0,d.getGroup)(h)),pathData:v,width:r.get("strokeWidth",h),animateTransitions:n})}),l.length>0&&i.push({kind:"dots",centers:l,size:d.DEFAULT_POINT_SIZE_PX}),i},lu=(e,t)=>{const r=(0,d.getX)(e),n=(0,d.getY)(e);return r===null||n===null?null:gt({x:r,y:n},t)},cu=(0,g.memo)(function({layer:t,intro:r}){const n=r?.type==="wipe"?r:null,o=(0,g.useMemo)(()=>(0,d.createLinePathGenerator)(t.params),[t.params]),a=(0,g.useMemo)(()=>(0,d.createLineFillAreaGenerator)(t.params),[t.params]),i=B(t),l=(0,g.useMemo)(()=>{const c=(0,d.createStableKeyGenerator)(t.data,t.mapping,t.id),u=[];return t.data.groupBy(d.GROUP_VARIABLES.group).forEach(h=>{const v=(0,d.prepareLineObservations)([...h],t.params.missingValues),f=o(v);if(!f)return;const m=v[0];if(!m)return;const p=i.get("fillAlpha",m),x=p===void 0?void 0:a(v)??void 0,y=i.get("stroke",m),b=i.get("fill",m),S=b===void 0?y:(0,d.toPaintColor)(b),{strokeWidth:P,strokeDasharray:w,strokeLinecap:j}=we(i.get("dashArray",m),i.get("strokeWidth",m),i.get("lineCap",m)),C=i.get("lineJoin",m);u.push({key:c(m),pathData:f,fillPath:x,fillAlpha:p,stroke:y,fill:S,opacity:i.get("alpha",m),strokeAlpha:i.get("strokeAlpha",m),strokeWidth:P,strokeDasharray:w,lineCap:j,lineJoin:C})}),u},[o,a,t.data,t.id,t.mapping,t.params,i]).map(c=>(0,s.jsx)(du,{pathData:c.pathData,fillPath:c.fillPath,fillAlpha:c.fillAlpha,stroke:c.stroke,fill:c.fill,strokeWidth:c.strokeWidth,opacity:c.opacity,strokeAlpha:c.strokeAlpha,strokeDasharray:c.strokeDasharray,lineCap:c.lineCap,lineJoin:c.lineJoin},c.key));return(0,s.jsx)(xe,{viewBox:"0 0 1 1",preserveAspectRatio:"none",width:"100%",height:"100%","data-geom":"line",effects:U((0,d.readGeomEffects)(i,t.data.getFirst()??void 0)),className:ve,children:n?(0,s.jsx)(en,{intro:n,children:l}):l})}),du=({pathData:e,fillPath:t,fillAlpha:r,stroke:n,fill:o,strokeWidth:a,opacity:i,strokeAlpha:l,strokeDasharray:c,lineCap:u,lineJoin:h})=>{const{animateTransitions:v}=q();return t!==void 0&&r!==void 0?(0,s.jsx)(uu,{fillPath:t,fillAlpha:r,fill:o,linePath:e,stroke:n,strokeWidth:a,opacity:i,strokeAlpha:l,strokeDasharray:c,lineCap:u,lineJoin:h}):v?(0,s.jsx)(hu,{pathData:e,stroke:n,strokeWidth:a,opacity:i,strokeAlpha:l,strokeDasharray:c,lineCap:u,lineJoin:h}):(0,s.jsx)("path",{d:e,fill:"none",stroke:n,strokeWidth:a,opacity:i,strokeOpacity:l,strokeDasharray:c,strokeLinecap:u,strokeLinejoin:h,vectorEffect:"non-scaling-stroke"})},uu=({fillPath:e,fillAlpha:t,linePath:r,stroke:n,fill:o,strokeWidth:a,opacity:i,strokeAlpha:l,strokeDasharray:c,lineCap:u,lineJoin:h})=>{const v=`line_fill_gradient_${(0,g.useId)()}`;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("defs",{children:(0,s.jsxs)("linearGradient",{id:v,gradientTransform:"rotate(90 0.5 0.5)",children:[(0,s.jsx)("stop",{offset:"0%",stopColor:o}),(0,s.jsx)("stop",{offset:"70%",stopColor:o,stopOpacity:0}),(0,s.jsx)("stop",{offset:"100%",stopColor:o,stopOpacity:0})]})}),(0,s.jsx)(Sa,{fillPath:e,linePath:r,fill:`url(#${v})`,fillOpacity:t,stroke:n,strokeWidth:a,strokeOpacity:l,opacity:i,strokeDasharray:c,lineCap:u,lineJoin:h})]})},hu=({pathData:e,stroke:t,strokeWidth:r,opacity:n,strokeAlpha:o,strokeDasharray:a,lineCap:i,lineJoin:l})=>{const c=Qt(e,ue);return(0,s.jsx)(R.motion.path,{d:c,fill:"none",stroke:t,strokeWidth:r,opacity:n,strokeOpacity:o,strokeDasharray:a,strokeLinecap:i,strokeLinejoin:l,vectorEffect:"non-scaling-stroke"})},vu=({layer:e,primary:t,companions:r})=>{const n=B(e),o=(0,d.getGroup)(t.observation),a=(0,g.useMemo)(()=>(0,d.prepareLineObservations)([...e.data.filter(d.GROUP_VARIABLES.group,"eq",o)],e.params.missingValues),[e.data,e.params.missingValues,o]),i=(0,g.useMemo)(()=>(0,d.createLinePathGenerator)(e.params)(a),[e.params,a]);if(!i)return null;const l=n.get("stroke",t.observation,"hovered"),c=n.get("alpha",t.observation,"hovered"),u=n.get("strokeAlpha",t.observation,"hovered"),{strokeWidth:h,strokeDasharray:v,strokeLinecap:f}=we(n.get("dashArray",t.observation,"hovered"),n.get("strokeWidth",t.observation,"hovered"),n.get("lineCap",t.observation,"hovered")),m=n.get("lineJoin",t.observation,"hovered");return(0,s.jsxs)("g",{"data-testid":"hovered-line",children:[(0,s.jsx)(xe,{viewBox:"0 0 1 1",preserveAspectRatio:"none",width:"100%",height:"100%","data-geom":"line",effects:U((0,d.readGeomEffects)(n,t.observation,"hovered")),className:ve,children:(0,s.jsx)("path",{d:i,fill:"none",stroke:l,strokeWidth:h,opacity:c,strokeOpacity:u,strokeDasharray:v,strokeLinecap:f,strokeLinejoin:m,vectorEffect:"non-scaling-stroke","data-testid":"hovered-line-path"})}),r.map(p=>(0,s.jsx)(Le,{hit:p,project:me},`companion-${p.layerId}-${p.pointIndex}`)),(0,s.jsx)(Qe,{hit:t,project:me,"data-testid":"hovered-line-point"})]})},gu={geom:"line",coord:"cartesian",swatchShape:"line",guideMode:"crosshair",render:({layer:e,intro:t})=>(0,s.jsx)(cu,{layer:e,intro:t}),renderHover:({layer:e,primary:t,group:r,related:n})=>(0,s.jsx)(vu,{layer:e,primary:t,companions:[...r,...n]}),renderHoverCompanions:({related:e})=>(0,s.jsx)(s.Fragment,{children:e.map(t=>(0,s.jsx)(Le,{hit:t,project:me},`companion-${t.layerId}-${t.pointIndex}`))}),getEditOutlineShapes:su,getOverlayAnchor:({observation:e})=>{const t=(0,d.getX)(e),r=(0,d.getY)(e);return t===null||r===null?null:{x:t,y:r}}},oi=({observation:e,project:t,styleReaders:r,animation:n,introKey:o})=>{const a=(0,g.useContext)(bt)?.paintsShadow===!0,i=ai(e,t);if(i===null)return null;const{animated:l,activeIntro:c,animateTransitions:u}=n,h=l?{intro:c!==null,fadesIn:!a,transition:c?or(c,o):ar(u)}:null;return(0,s.jsx)(St,{symbol:r.get("symbol",e),cx:(0,d.toPercent)(i.x),cy:(0,d.toPercent)(i.y),size:r.get("size",e),fill:(0,d.toPaintColor)(r.get("fill",e)),fillOpacity:r.get("fillAlpha",e),opacity:r.get("alpha",e),stroke:r.get("stroke",e),strokeOpacity:r.get("strokeAlpha",e),strokeWidth:r.get("strokeWidth",e),style:U((0,d.readGeomEffects)(r,e)),motion:h})},ai=(e,t)=>{const r=(0,d.getX)(e),n=(0,d.getY)(e);return r===null||n===null?null:t(r,n)},ii=({layer:e,panelRect:t,styleReaders:r,project:n,symbols:o=[]})=>{const a=[],i=new Map,l=!r.varies("size")&&!r.varies("strokeWidth")?r.get("size")+r.get("strokeWidth"):void 0,c=r.varies("symbol")?void 0:r.get("symbol");for(const u of e.data){const h=ai(u,n);if(h===null)continue;const v=gt(h,t),f=l??r.get("size",u)+r.get("strokeWidth",u),m=c??r.get("symbol",u);if(m==="circle"||!(0,d.isGeometricSymbol)(m)||!o.includes(m)){a.push({center:v,size:f});continue}const p=`${m}:${f}`;i.set(p,(i.get(p)??"")+(0,d.buildPointSymbolPathAt)(m,f,v))}return[...[...i.values()].map(u=>({kind:"region",pathData:u})),...ha(a)]},fu=(0,g.memo)(function({layer:t,intro:r}){const n=B(t),o=hr(r?.type==="grow"&&r.growAxis==="size"?r:null);return(0,g.useMemo)(()=>{const a=o.activeIntro?(0,d.createStableKeyGenerator)(t.data,t.mapping,t.id):null,i=[];let l=0;for(const c of t.data)i.push((0,s.jsx)(oi,{project:me,observation:c,styleReaders:n,animation:o,introKey:a?.(c)},String(l++)));return i},[t.data,t.mapping,t.id,n,o])}),mo=({primary:e,companions:t})=>{const r=(0,s.jsxs)(s.Fragment,{children:[t.map(n=>(0,s.jsx)(Le,{hit:n,project:me},`companion-${n.layerId}-${n.pointIndex}`)),e?(0,s.jsx)(Qe,{hit:e,project:me}):null]});return e?(0,s.jsx)("g",{"data-testid":"hovered-point",children:r}):r},pu={geom:"point",coord:"cartesian",swatchShape:"circle",symbols:d.STYLE_POINT_SYMBOLS,render:({layer:e,intro:t})=>(0,s.jsx)(fu,{layer:e,intro:t}),renderHover:({primary:e,group:t,related:r})=>(0,s.jsx)(mo,{primary:e,companions:[...t,...r]}),renderHoverCompanions:({related:e})=>(0,s.jsx)(mo,{companions:e}),getEditOutlineShapes:e=>ii({...e,project:me}),getOverlayAnchor:({observation:e})=>{const t=(0,d.getX)(e),r=(0,d.getY)(e);return t===null||r===null?null:{x:t,y:r}}},nt="var(--graphy-editor-font-family, var(--graphy-font-family))",si=["canvasDefault","canvasBlue","canvasCyan","canvasGreen","canvasYellow","canvasOrange","canvasRed","canvasPink","canvasPurple","canvasGray","canvasInverse"],A={white:"var(--graphy-white)",black:"var(--graphy-black)",transparent:"var(--graphy-transparent)",gray100:"var(--graphy-gray-100)",gray95:"var(--graphy-gray-95)",gray90:"var(--graphy-gray-90)",gray85:"var(--graphy-gray-85)",gray80:"var(--graphy-gray-80)",gray75:"var(--graphy-gray-75)",gray70:"var(--graphy-gray-70)",gray60:"var(--graphy-gray-60)",gray50:"var(--graphy-gray-50)",gray0:"var(--graphy-gray-0)",grayGradient80:"var(--graphy-gray-gradient-80)",green60:"var(--graphy-green-60)",green50:"var(--graphy-green-50)",red60:"var(--graphy-red-60)",red50:"var(--graphy-red-50)",amber70:"var(--graphy-amber-70)",amber50:"var(--graphy-amber-50)",amber40:"var(--graphy-amber-40)",amber30:"var(--graphy-amber-30)",blue80:"var(--graphy-blue-80)",blue60:"var(--graphy-blue-60)",purple50:"var(--graphy-purple-50)",purple30:"var(--graphy-purple-30)",brand:"var(--graphy-brand)",success:"var(--graphy-success)",warning:"var(--graphy-warning)",alert:"var(--graphy-alert)",textPrimary:"var(--graphy-text-primary)",textSecondary:"var(--graphy-text-secondary)",textDisabled:"var(--graphy-text-disabled)",iconPrimary:"var(--graphy-icon-primary)",iconSecondary:"var(--graphy-icon-secondary)",iconStickerBackground:"var(--graphy-icon-sticker-background)",border100:"var(--graphy-border-100)",border50:"var(--graphy-border-50)",border10:"var(--graphy-border-10)",sunkenBackground:"var(--graphy-sunken-background)",defaultBackground:"var(--graphy-default-background)",raisedBackground:"var(--graphy-raised-background)",overlayBackground:"var(--graphy-overlay-background)",overlayBorderGradient:"var(--graphy-overlay-border-gradient)",graphBackground:"var(--graphy-graph-background)",editorDefaultAccent:"var(--graphy-editor-default-accent)",editorDefaultSurface:"var(--graphy-editor-default-surface)",editorDefaultText:"var(--graphy-editor-default-text)",editorDefaultShadow:"var(--graphy-editor-default-shadow)",editorControlHeight:"var(--graphy-editor-control-height)",canvasDefault:"var(--graphy-canvas-default)",canvasBlue:"var(--graphy-canvas-blue)",canvasCyan:"var(--graphy-canvas-cyan)",canvasGreen:"var(--graphy-canvas-green)",canvasYellow:"var(--graphy-canvas-yellow)",canvasOrange:"var(--graphy-canvas-orange)",canvasRed:"var(--graphy-canvas-red)",canvasPink:"var(--graphy-canvas-pink)",canvasPurple:"var(--graphy-canvas-purple)",canvasGray:"var(--graphy-canvas-gray)",canvasInverse:"var(--graphy-canvas-inverse)",elevationXs:"var(--graphy-elevation-xs)",elevationSm:"var(--graphy-elevation-sm)",elevationMd:"var(--graphy-elevation-md)",elevationLg:"var(--graphy-elevation-lg)",radiiXs:"var(--graphy-radii-xs)",radiiSm:"var(--graphy-radii-sm)",radiiMd:"var(--graphy-radii-md)",radiiLg:"var(--graphy-radii-lg)",spaceXxs:"var(--graphy-space-xxs)",spaceXs:"var(--graphy-space-xs)",spaceSm:"var(--graphy-space-sm)",spaceMd:"var(--graphy-space-md)",spaceLg:"var(--graphy-space-lg)",spaceXl:"var(--graphy-space-xl)",zIndexToolbar:"var(--graphy-z-index-toolbar)",zIndexToolbarTooltip:"var(--graphy-z-index-toolbar-tooltip)",zIndexToolbarPopover:"var(--graphy-z-index-toolbar-popover)",zIndexEditorPopover:"var(--graphy-z-index-editor-popover)",toolbarBackgroundColor:"var(--graphy-toolbar-background-color)",toolbarButtonBackgroundColor:"var(--graphy-toolbar-button-background-color)",toolbarButtonBackgroundColorHovered:"var(--graphy-toolbar-button-background-color-hovered)",toolbarButtonBackgroundColorSelected:"var(--graphy-toolbar-button-background-color-selected)",toolbarSeparatorColor:"var(--graphy-toolbar-separator-color)",fontFamily:"var(--graphy-font-family)",fontFamilyHeading:"var(--graphy-font-family-heading)",fontWeightRegular:"var(--graphy-font-weight-regular)",fontWeightMedium:"var(--graphy-font-weight-medium)",fontWeightSemibold:"var(--graphy-font-weight-semibold)",fontWeightBold:"var(--graphy-font-weight-bold)",fontWeightExtraBold:"var(--graphy-font-weight-extra-bold)",textScale:"var(--graphy-text-scale)",fontSizeXxs:"var(--graphy-font-size-xxs)",fontSizeXs:"var(--graphy-font-size-xs)",fontSizeSm:"var(--graphy-font-size-sm)",fontSizeMd:"var(--graphy-font-size-md)",fontSizeLg:"var(--graphy-font-size-lg)",fontSizeXl:"var(--graphy-font-size-xl)",fontLineHeightXxs:"var(--graphy-font-line-height-xxs)",fontLineHeightXs:"var(--graphy-font-line-height-xs)",fontLineHeightSm:"var(--graphy-font-line-height-sm)",fontLineHeightMd:"var(--graphy-font-line-height-md)",fontLineHeightLg:"var(--graphy-font-line-height-lg)",fontLineHeightXl:"var(--graphy-font-line-height-xl)",fontSizeEditorBody:"var(--graphy-font-size-editor-body)",fontSizeHeadingSm:"var(--graphy-font-size-heading-sm)",fontSizeHeadingMd:"var(--graphy-font-size-heading-md)",fontSizeHeadingLg:"var(--graphy-font-size-heading-lg)",fontLineHeightEditorBody:"var(--graphy-font-line-height-editor-body)",fontLineHeightHeadingSm:"var(--graphy-font-line-height-heading-sm)",fontLineHeightHeadingMd:"var(--graphy-font-line-height-heading-md)",fontLineHeightHeadingLg:"var(--graphy-font-line-height-heading-lg)",fontButton:"var(--graphy-font-button)",fontInput:"var(--graphy-font-input)",fontInputLabel:"var(--graphy-font-input-label)",fontSelectLabel:"var(--graphy-font-select-label)",fontSelectDescription:"var(--graphy-font-select-description)",fontColorSelectLabel:"var(--graphy-font-color-select-label)",fontMenuTitle:"var(--graphy-font-menu-title)",fontMenuGroupTitle:"var(--graphy-font-menu-group-title)",fontMenuItemLabel:"var(--graphy-font-menu-item-label)",fontMenuItemLabelSecondary:"var(--graphy-font-menu-item-label-secondary)",fontUITooltip:"var(--graphy-font-uitooltip)",fontUITooltipSecondary:"var(--graphy-font-uitooltip-secondary)",fontErrorBoundaryTitle:"var(--graphy-font-error-boundary-title)",fontErrorBoundaryMessage:"var(--graphy-font-error-boundary-message)",fontTableCell:"var(--graphy-font-table-cell)",fontTableHeaderCell:"var(--graphy-font-table-header-cell)",fontSourceLabel:"var(--graphy-font-source-label)",fontSourceLink:"var(--graphy-font-source-link)",fontTextEditorH1:"var(--graphy-font-text-editor-h1)",fontTextEditorH2:"var(--graphy-font-text-editor-h2)",fontTextEditorH3:"var(--graphy-font-text-editor-h3)",fontTextEditorH6:"var(--graphy-font-text-editor-h6)",fontTextEditorBody:"var(--graphy-font-text-editor-body)",fontTextEditorLink:"var(--graphy-font-text-editor-link)",fontHighlightModeTitle:"var(--graphy-font-highlight-mode-title)",fontHighlightModeSubtitle:"var(--graphy-font-highlight-mode-subtitle)",fontEditorControlLabel:"var(--graphy-font-editor-control-label)",fontEditorControlValue:"var(--graphy-font-editor-control-value)",fontEditorSectionTitle:"var(--graphy-font-editor-section-title)",fontEditorCaption:"var(--graphy-font-editor-caption)"},wt=`"Stack Sans Text", 'Inter', -apple-system, BlinkMacSystemFont, 'Open Sans', 'Segoe UI', 'Roboto', 'Oxygen-Sans', 'Ubuntu',
|
|
1
|
+
require('./history-chords.css');var Fl=Object.create,Yt=Object.defineProperty,Hl=Object.getOwnPropertyDescriptor,Dl=Object.getOwnPropertyNames,Wl=Object.getPrototypeOf,zl=Object.prototype.hasOwnProperty,Vl=(e,t)=>{let r={};for(var n in e)Yt(r,n,{get:e[n],enumerable:!0});return t||Yt(r,Symbol.toStringTag,{value:"Module"}),r},Ul=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=Dl(t),a=0,i=o.length,l;a<i;a++)l=o[a],!zl.call(e,l)&&l!==r&&Yt(e,l,{get:(c=>t[c]).bind(null,l),enumerable:!(n=Hl(t,l))||n.enumerable});return e},ta=(e,t,r)=>(r=e!=null?Fl(Wl(e)):{},Ul(t||!e||!e.__esModule?Yt(r,"default",{value:e,enumerable:!0}):r,e));let d=require("@graphysdk/viz-engine"),g=require("react"),s=require("react/jsx-runtime"),Ye=require("zustand"),R=require("motion/react"),ee=require("zustand/react/shallow"),qr=require("lodash-es"),Yl=require("d3-interpolate-path"),tr=require("@vanilla-extract/dynamic"),_r=require("zustand/vanilla"),Q=require("clsx");Q=ta(Q,1);let Kl=require("react-intl"),ie=require("@floating-ui/react-dom"),Xl=require("react-dom"),Ql=require("color2k");typeof window<"u"&&(window.__GRAPHY_SDK__??={},window.__GRAPHY_SDK__.reactRenderer="1.9.0-beta.1794915904679");function ra(e){for(const t of e)(t.severity==="error"?console.error:console.warn)(`[graphy] ${t.code}: ${t.message}`,t)}var na=(0,g.createContext)(null),ql=na.Provider,_l=null,rr=()=>(0,g.useContext)(na)??(_l??=(0,d.createDataLabelPlacementResolver)()),ce=d.polarToInscribedSquare,Jl={centerX:0,centerY:0,radius:1},Ke=e=>{const t=Math.min(e.width,e.height);return{centerX:(e.width-t)/2+t/2,centerY:(e.height-t)/2+t/2,radius:t/2}},xt=e=>{const{radius:t}=Ke(e),r=t>0?1/t:1;return{x:r,y:r}},de=(e,t,r=Jl)=>{const n=(0,d.polarToUnit)(e,t);return{x:r.centerX+n.x*r.radius,y:r.centerY-n.y*r.radius}},me=(e,t)=>({x:e,y:t});var Jr=(0,g.createContext)(null),W=()=>{const e=(0,g.useContext)(Jr);if(!e)throw new Error("useGraph* hooks must be used inside a <GraphProvider>");return e},he=()=>{const{mode:e}=W();return e},L=e=>{const{store:t}=W();return(0,Ye.useStore)(t,r=>e(r.scene))},yt=(e,t,r)=>e.get("alpha",t,r)*e.get("fillAlpha",t,r),Zr=(e,t)=>{const r=(0,d.paintKey)(e);let n=t.get(r);return n===void 0&&(n=(0,d.isOpaquePaint)(e),t.set(r,n)),n},Xe=e=>e==="none"?"none":`${e.offsetX}px ${e.offsetY}px ${e.blur}px ${e.color}`,Zl=e=>e==="none"?"none":`${e.offsetX}px ${e.offsetY}px ${e.blur}px ${e.color}`,Ge=e=>{if(e!=="none")return`drop-shadow(${e.offsetX}px ${e.offsetY}px ${e.blur}px ${e.color})`},bt=(0,g.createContext)(null),Zn=["shadow","blendMode","alpha","fillAlpha","fill"],oa=(e,t)=>(0,g.useMemo)(()=>{if(Object.keys(e.styles.parts).length>0)return;const r=e.data.getFirst();if(r===null)return;const n=t.get("shadow",r),o=Ge(n);if(o===void 0)return;const a=new Map,i=(u,h)=>{switch(h){case"shadow":return rc(t.get("shadow",u),n);case"blendMode":return t.get("blendMode",u)==="normal";case"alpha":return t.get("alpha",u)>=1;case"fillAlpha":return(t.get("fillAlpha",u)??1)>=1;case"fill":{const v=t.get("fill",u);return v===void 0||Zr(v,a)}}},l=ec(e.styles),c=Zn.filter(u=>l.has(u)||tc(e,u));if(!Zn.filter(u=>!c.includes(u)).some(u=>!i(r,u)))return c.length===0||e.data.findFirst(u=>c.some(h=>!i(u,h)))===null?o:void 0},[e,t]),$l=(e,t)=>{const r=(0,g.useContext)(bt),n=r?.layerId===e.id&&r.paintsShadow;return(0,g.useMemo)(()=>n?nc(t):t,[n,t])},ec=e=>{const t=new Set;for(const r of[...e.defaults,...e.overrides])if(!(r.matches===void 0||r.state!==void 0||r.part!==void 0))for(const n of Object.keys(r.declarations))t.add(n);return t},tc=(e,t)=>{const r=e.styles.observation.aesthetics[t];return r===void 0||!Object.hasOwn(d.VISUAL_VARIABLES,r)?!1:e.data.hasVariable(d.VISUAL_VARIABLES[r])},rc=(e,t)=>e==="none"||t==="none"?e===t:e.offsetX===t.offsetX&&e.offsetY===t.offsetY&&e.blur===t.blur&&e.color===t.color,nc=e=>{const{get:t,resolve:r}=e;return{...e,get:(a,i,l)=>a==="shadow"&&l===void 0?"none":t(a,i,l),resolve:(a,i)=>{const l=r(a,i);return i===void 0&&(l.shadow="none"),l}}},$r=()=>W().styleResolver,B=e=>$l(e,Te()(e)),O=()=>{const e=$r(),t=L(r=>r.styles);return e.readers({styles:t})},aa=e=>{const t=Te(),r=L(n=>n.layers).find(n=>n.id===e);return r===void 0?null:t(r)},ia=e=>{const t=Te(),r=L(n=>n.layers).find(n=>n.id===e.layerId);return r===void 0?void 0:(0,d.readGeomColor)({geom:t},r,e.observation)},oc=()=>{const e=Te(),t=L(r=>r.layers);return(0,g.useMemo)(()=>r=>{const n=(0,d.readAnchoredObservation)(t,r);if(n!==null)return(0,d.readGeomColor)({geom:e},n.layer,n.observation)},[t,e])},ac=e=>{const t=Te(),r=L(n=>n.layers);return(0,g.useMemo)(()=>n=>{const o=(0,d.readAnchoredObservation)(r,n);if(o===null)return{};const a=(0,d.resolveSwatchGeomPaint)(t,o.layer,o.observation,{width:e,height:e});return{color:(0,d.readGeomColor)({geom:t},o.layer,o.observation),fill:a.fill,alpha:a.alpha,cornerRadius:a.cornerRadiusPx,symbol:a.symbol}},[r,t,e])},Te=()=>{const e=$r();return L(t=>e.readers(t).geom)},sa=process.env.NODE_ENV!=="production";var la=(0,g.createContext)(new Map),it=new Map,ut=[],ic=(e,t)=>(sa&&(0,d.isGeometricSymbol)(e)&&console.warn(`[graphy] "${e}" is a built-in point shape. The chart draws that shape, and the shape menu hides this glyph.`),{name:e,definition:t}),sc=(e,t)=>[...e??[],...t??[]],lc=({glyphs:e,children:t})=>{const r=(0,g.useMemo)(()=>xc(e),[e]);return(0,s.jsx)(la.Provider,{value:r,children:t})},At=()=>(0,g.useContext)(la),cc=(e,t)=>{const r=fc(e,t);return r!==void 0?r:pc(e,t,gc(e,t))},dc=e=>ca(e)!==void 0,nr=({symbol:e,glyphs:t,size:r,fill:n,fillOpacity:o,stroke:a,strokeOpacity:i,strokeWidth:l})=>{if((0,d.isImageSymbol)(e))return(0,s.jsx)($n,{image:e.image,size:r,fill:n,fillOpacity:o});const c=t.get(e);return c===void 0?(0,s.jsx)("circle",{r:r/2,fill:n,fillOpacity:o,stroke:a,strokeOpacity:i,strokeWidth:l}):typeof c=="function"?(0,s.jsx)("g",{color:n,children:(0,s.jsx)(yc,{glyph:c,paint:{size:r,fill:n,fillOpacity:o,stroke:a,strokeOpacity:i,strokeWidth:l}})}):"d"in c?(0,s.jsx)(bc,{glyph:c,size:r,fill:n,fillOpacity:o,stroke:a,strokeOpacity:i,strokeWidth:l}):(0,s.jsx)($n,{image:c.image,size:r,fill:n,fillOpacity:o})},uc=e=>{const t=atob(e),r=Uint8Array.from(t,n=>n.charCodeAt(0));return new TextDecoder().decode(r)},hc=e=>{try{return uc(e)}catch{return}},vc=e=>{try{return decodeURIComponent(e)}catch{return e}},ca=e=>{if(!e.startsWith("data:image/svg+xml"))return;const t=e.indexOf(",");if(t<0)return;const r=e.slice(0,t),n=e.slice(t+1),o=r.includes(";base64")?hc(n):vc(n);return o?.includes("currentColor")?o:void 0},gc=(e,t)=>{const r=ca(e);return r===void 0?e:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(r.replaceAll("currentColor",mc(t)))}`},fc=(e,t)=>{const r=it.get(e)?.get(t);if(r!==void 0)return da(e,t),r},pc=(e,t,r)=>{let n=it.get(e);for(n===void 0&&(n=new Map,it.set(e,n)),n.set(t,r),da(e,t);ut.length>32;){const o=ut.shift();if(o===void 0)break;const a=it.get(o.image);a?.delete(o.fill),a!==void 0&&a.size===0&&it.delete(o.image)}return r},da=(e,t)=>{const r=ut.findIndex(o=>o.image===e&&o.fill===t),n=r===-1?{image:e,fill:t}:ut.splice(r,1)[0];n!==void 0&&ut.push(n)},mc=e=>{const t=e.trim();return t.length===0||t==="currentColor"||t==="inherit"||t.startsWith("var(")||t.startsWith("url(")?"#000000":t},xc=e=>{const t=new Map;for(const r of e)t.set(r.name,r.definition);return t},yc=({glyph:e,paint:t})=>(0,s.jsx)(e,{...t}),$n=({image:e,size:t,fill:r,fillOpacity:n})=>(0,s.jsx)("image",{href:cc(e,r),x:-t/2,y:-t/2,width:t,height:t,opacity:n}),bc=({glyph:e,size:t,fill:r,fillOpacity:n,stroke:o,strokeOpacity:a,strokeWidth:i})=>{const[l,c,u,h]=e.viewBox,v=Math.max(u,h),f=v===0?0:t/v;return(0,s.jsx)("g",{transform:`translate(${-(l+u/2)*f} ${-(c+h/2)*f}) scale(${f})`,children:(0,s.jsx)("path",{d:e.d,fill:r,fillOpacity:n,stroke:o,strokeOpacity:a,strokeWidth:i===void 0?void 0:i/f})})},St=({symbol:e,cx:t,cy:r,size:n,fill:o,fillOpacity:a,opacity:i,stroke:l,strokeOpacity:c,strokeWidth:u,style:h,motion:v,"data-testid":f})=>{const m=At(),p={fill:o,fillOpacity:a,stroke:l,strokeOpacity:c,strokeWidth:u,style:h},x=v?.fadesIn?{opacity:0}:{};if(!(0,d.isGeometricSymbol)(e)){const S={transformBox:"view-box",...h},P=(0,s.jsx)(nr,{symbol:e,glyphs:m,size:n,fill:o,fillOpacity:a,stroke:l,strokeOpacity:c,strokeWidth:u});return v?(0,s.jsx)(R.motion.g,{initial:v.intro?{x:t,y:r,scale:0,...x}:!1,transition:v.transition,animate:{x:t,y:r,scale:1,opacity:i},"data-testid":f,style:{...S,originX:0,originY:0},children:P}):(0,s.jsx)("g",{opacity:i,"data-testid":f,style:{...S,transform:`translate(${t}, ${r})`},children:P})}if(e==="circle"){const S=n/2;return v?(0,s.jsx)(R.motion.circle,{initial:v.intro?{cx:t,cy:r,r:0,...x}:!1,transition:v.transition,animate:{cx:t,cy:r,r:S,opacity:i},"data-testid":f,...p}):(0,s.jsx)("circle",{cx:t,cy:r,r:S,opacity:i,"data-testid":f,...p})}const y=(0,d.buildPointSymbolPath)(e,n),b={...p,strokeLinejoin:"round",style:{transformBox:"view-box",...h}};return v?(0,s.jsx)(R.motion.path,{initial:v.intro?{x:t,y:r,d:y,scale:0,...x}:!1,transition:v.transition,animate:{x:t,y:r,d:y,scale:1,opacity:i},"data-testid":f,...b,style:{...b.style,originX:0,originY:0}},e):(0,s.jsx)("path",{d:y,opacity:i,"data-testid":f,...b,style:{...b.style,transform:`translate(${t}, ${r})`}})},Ac=2,Sc=.7,Le=({hit:e,project:t})=>{const r=aa(e.layerId),n=ia(e)??d.DEFAULT_GEOM_COLOR;if(!e.anchored)return null;const o=((0,d.getAlpha)(e.observation)??1)*Sc,a=r?.get("size",e.observation)??d.DEFAULT_POINT_SIZE_PX,i=r?.get("stroke",e.observation,"hovered")??d.DEFAULT_HOVER_STROKE_COLOR,l=t(e.x,e.y);return(0,s.jsx)(St,{symbol:r?.get("symbol",e.observation)??"circle",cx:(0,d.toPercent)(l.x),cy:(0,d.toPercent)(l.y),size:a,fill:n,opacity:o,stroke:i,strokeWidth:Ac,"data-testid":"companion-point"})};var eo=10**2,F=e=>Math.round(e*eo)/eo,Pc=32,wc=(e,t)=>{const r=F(t),n=F(2*t),o=`a${r},${r} 0 1,0 ${n},0a${r},${r} 0 1,0 ${-n},0Z`;return e.map(({x:a,y:i})=>`M${F(a-t)},${F(i)}${o}`).join("")},jc=(e,t,r)=>{const n=r.axis==="x",o=n?e.y:e.x,a=n?e.x:e.y,i=n?e.height:e.width,l=n?e.width:e.height,[c,u,h,v]=n?[t[0],t[3],t[2],t[1]]:t,f=Math.max(Math.min(r.from,r.to),a),m=Math.min(Math.max(r.from,r.to),a+l);if(m-f<=0||i<=0)return"";const p=o+i,x=a+l,y=n?0:1,b=(k,E)=>{const[I,G]=n?[E,k]:[k,E];return`${F(I)},${F(G)}`},S=(k,E,I)=>`A${F(k)},${F(k)} 0 0 ${y} ${b(E,I)}`,P=(k,E)=>{const I=a+k,G=x-E,z=(N,K)=>K>0?N-Math.sqrt(Math.max(0,N*N-K*K)):0,D=()=>{let[N,K]=[G,I];for(let V=0;V<Pc;V++){const ye=(N+K)/2;z(k,I-ye)>z(E,ye-G)?N=ye:K=ye}return(N+K)/2},Y=I<=G?I:D(),H=I<=G?G:Y;return{breaks:[Y,H].filter(N=>N>f&&N<m),readInsetAt:N=>Math.max(z(k,I-N),z(E,N-G)),readCornerRadius:(N,K)=>k>0&&Math.max(N,K)<=Y?k:E>0&&Math.min(N,K)>=H?E:null}},w=P(u,h),j=P(c,v),C=(k,E,I,G,z)=>{let D=G;return z.map(Y=>{const H=k.readCornerRadius(D,Y);return D=Y,H===null?`L${b(E,Y)}`:S(H,E+I*k.readInsetAt(Y),Y)})};return`${[`M${b(o+j.readInsetAt(f),f)}`,`L${b(p-w.readInsetAt(f),f)}`,...C(w,p,-1,f,[...new Set([...w.breaks,m])].sort((k,E)=>k-E)),`L${b(o+j.readInsetAt(m),m)}`,...C(j,o,1,m,[...new Set([f,...j.breaks])].sort((k,E)=>E-k))].join("")}Z`},ua=(e,t,r)=>{const n=e.digits?.()??null,o=n===null?null:10**n,a=c=>o===null?c:Math.round(c*o)/o,i=(c,u)=>va(a(c),a(u),r);let l="";return e.context({moveTo:(c,u)=>{l+=`M${i(c,u)}`},lineTo:(c,u)=>{l+=`L${i(c,u)}`},bezierCurveTo:(c,u,h,v,f,m)=>{l+=`C${i(c,u)},${i(h,v)},${i(f,m)}`},closePath:()=>{l+="Z"}}),e(t),e.context(null),l},Br=(e,t)=>{let r="";for(let n=0;n<e.length;n++){const o=e[n];o!==void 0&&(r+=`${n===0?"M":"L"}${va(o.x,o.y,t)}`)}return r===""?"":`${r}Z`},gt=(e,t)=>({x:e.x*t.width,y:e.y*t.height}),ha=e=>{const t=new Map;for(const{center:r,size:n}of e){const o=t.get(n)??[];o.push(r),t.set(n,o)}return[...t].map(([r,n])=>({kind:"dots",centers:n,size:r}))},va=(e,t,{origin:r,scaleX:n,scaleY:o})=>`${F(r.x+e*n)},${F(r.y+t*o)}`,Ec=({layer:e,coordSystem:t,panelRect:r,animateTransitions:n})=>{const{areaGenerator:o}=(0,d.createAreaPathGenerators)(t,e.params),a={origin:{x:0,y:0},scaleX:r.width,scaleY:r.height};let i="";const l=[];e.data.groupBy(d.GROUP_VARIABLES.group).forEach(u=>{const h=(0,d.prepareAreaObservations)([...u],e.params.missingValues),[v]=h;if(v!==void 0){if(h.length===1){const f=kc(v,t,r);f!==null&&l.push(f);return}i+=ua(o,h,a)}});const c=i===""?[]:[{kind:"region",pathData:i,animateTransitions:n}];return l.length>0&&c.push({kind:"dots",centers:l,size:d.DEFAULT_POINT_SIZE_PX}),c},kc=(e,t,r)=>{if(t.mainAxis==="y"){const a=(0,d.getY)(e),i=(0,d.getXTip)(e);return a===null||i===null?null:gt({x:i,y:a},r)}const n=(0,d.getX)(e),o=(0,d.getYTip)(e);return n===null||o===null?null:gt({x:n,y:o},r)},Cc=1.5,ga=(e,t)=>fa(e,t)?Math.max(t,Cc):t,we=(e,t,r)=>{const n=ga(e,t);return{strokeWidth:n,strokeDasharray:(0,d.toStrokeDasharray)(e,n),strokeLinecap:fa(e,t)?"round":r}},fa=(e,t)=>t>0&&e?.[0]===0,pa=e=>{const t=[...e.brightness===void 0?[]:[`brightness(${e.brightness})`],...e.contrast===void 0?[]:[`contrast(${e.contrast})`],...e.saturation===void 0?[]:[`saturate(${e.saturation})`],...e.blur===void 0?[]:[`blur(${e.blur}px)`],...e.shadow===void 0?[]:[Ge(e.shadow)??""]].filter(r=>r!=="");return t.length===0?void 0:t.join(" ")},U=e=>{if(e===void 0)return;const t=pa(e),r=e.blendMode==="normal"?void 0:e.blendMode;if(!(t===void 0&&r===void 0))return{...t===void 0?{}:{filter:t},...r===void 0?{}:{mixBlendMode:r}}},ve="_1d8mpa11",ma="_1d8mpa12",or=(e,t)=>{const r=(t!==void 0?e.delayByKey[t]:void 0)??0;return{duration:e.durationSeconds,ease:e.growAxis==="angle"?"circOut":"backOut",delay:r}},Rc=e=>({duration:e.durationSeconds,ease:"easeOut"}),xa=e=>({duration:e.durationSeconds,ease:"easeOut"}),Tc=e=>Lc(e)+e.durationSeconds,Lc=e=>{switch(e.type){case"grow":return Object.values(e.delayByKey).reduce((t,r)=>Math.max(t,r),0);case"wipe":case"fade":return 0}};var Kt={enabled:!0,trigger:"mount",durationScale:1,stagger:!0,staggerOrder:"mainAxis"},to=1500,Ic=(e,t)=>t?{intro:{...Kt,enabled:!1},transitions:!1,maxAnimatedGeoms:to}:typeof e=="boolean"?{intro:{...Kt,enabled:e},transitions:e,maxAnimatedGeoms:to}:{intro:Oc(e?.intro),transitions:e?.transitions??!0,maxAnimatedGeoms:e?.maxAnimatedGeoms??1500},Oc=e=>typeof e=="boolean"?{...Kt,enabled:e}:(0,qr.merge)({},Kt,e),Mc=(e,t,r)=>{const n=(0,R.useReducedMotion)(),o=(0,g.useMemo)(()=>Ic(r?e:!1,n??!1),[e,r,n]),a=(0,g.useMemo)(()=>t.reduce((i,l)=>i+(0,d.countLayerGeoms)(l),0),[t]);return(0,g.useMemo)(()=>a<=o.maxAnimatedGeoms?o:{...o,intro:{...o.intro,enabled:!1},transitions:!1},[o,a])},Xt={plansByLayerId:null,coordKey:null,introEndsAtMs:0,waitingForView:!1},Bc={...Xt,waitingForView:!0},ze=(0,g.createContext)({...Xt,animateTransitions:!1}),ya=.4,Gc=({animation:e,animate:t,panelRect:r,children:n})=>{const{layers:o,coordSystem:a}=L((0,ee.useShallow)(p=>({layers:p.layers,coordSystem:p.coordSystem}))),{intro:i,transitions:l}=Mc(e,o,t),[c,u]=(0,g.useState)(()=>ro(i)?Bc:no({layers:o,coordSystem:a,intro:i})),[h,v]=(0,g.useState)(null),f=Fc(h)||!ro(i);c.waitingForView&&f&&u(no({layers:o,coordSystem:a,intro:i}));const m=(0,g.useMemo)(()=>({...c,animateTransitions:l}),[c,l]);return(0,s.jsxs)(ze.Provider,{value:m,children:[c.waitingForView&&(0,s.jsx)("div",{ref:v,className:"w2i4n00",style:{left:r.x,top:r.y,width:r.width,height:r.height}},`${r.width}x${r.height}`),n]})},Gr=({children:e})=>{const t=(0,g.useContext)(ze),r=(0,g.useMemo)(()=>({...t,animateTransitions:!1}),[t]);return(0,s.jsx)(ze.Provider,{value:r,children:e})},q=()=>(0,g.useContext)(ze),Nc=()=>{const{introEndsAtMs:e}=(0,g.useContext)(ze),[t]=(0,g.useState)(()=>Dc(e)/1e3);return t},ba=e=>{const{plansByLayerId:t,coordKey:r}=(0,g.useContext)(ze),n=L(o=>Aa(o.coordSystem));return t===null||r!==n?null:t.get(e)??null},ro=e=>e.enabled&&e.trigger==="inView"&&typeof IntersectionObserver<"u",no=({layers:e,coordSystem:t,intro:r})=>{if(!r.enabled)return Xt;const n={durationScale:r.durationScale,stagger:r.stagger,staggerOrder:r.staggerOrder},o=new Map;for(const i of e){const l=(0,d.buildLayerIntroPlan)({layer:i,coordSystem:t,options:n});l!==null&&o.set(i.id,l)}if(o.size===0)return Xt;const a=[...o.values()].reduce((i,l)=>Math.max(i,Tc(l)),0);return{plansByLayerId:o,coordKey:Aa(t),introEndsAtMs:performance.now()+a*1e3,waitingForView:!1}},Fc=e=>{const[t,r]=(0,g.useState)(!1);return(0,g.useEffect)(()=>{if(e===null)return;const n=new IntersectionObserver(o=>{o.some(Hc)&&r(!0)},{threshold:ya});return n.observe(e),()=>n.disconnect()},[e]),t},Hc=({intersectionRatio:e,intersectionRect:t})=>t.width>0&&t.height>0&&e>=ya,Dc=e=>Math.max(0,e-performance.now()),Aa=e=>e.type==="cartesian"?`cartesian-${e.mainAxis}`:e.type,ue={type:"spring",stiffness:500,damping:60,mass:1},Wc={duration:0},ar=e=>e?ue:Wc,Qt=(e,t,r)=>{const n=(0,R.useMotionValue)(e),o=(0,g.useRef)(r);return(0,g.useEffect)(()=>{const a=r!==void 0&&r===o.current;if(o.current=r,n.get()===e)return;if(a){n.set(e);return}const i=(0,Yl.interpolatePath)(n.get(),e),l=(0,R.animate)(0,1,{...t,onUpdate:c=>n.set(i(c))});return()=>l.stop()},[t,e,r,n]),n},Sa=e=>{const{animateTransitions:t}=q();return t?(0,s.jsx)(Vc,{...e}):(0,s.jsx)(zc,{...e})},zc=({fillPath:e,linePath:t,fill:r,fillOpacity:n,stroke:o,strokeWidth:a,strokeOpacity:i,strokeDasharray:l,lineCap:c,lineJoin:u,opacity:h})=>(0,s.jsxs)("g",{opacity:h,children:[(0,s.jsx)("path",{d:e,fill:r,fillOpacity:n,stroke:"none"}),(0,s.jsx)("path",{d:t,fill:"none",stroke:o,strokeWidth:a,strokeOpacity:i,strokeDasharray:l,strokeLinecap:c,strokeLinejoin:u,vectorEffect:"non-scaling-stroke"})]}),Vc=({fillPath:e,linePath:t,fill:r,fillOpacity:n,stroke:o,strokeWidth:a,strokeOpacity:i,strokeDasharray:l,lineCap:c,lineJoin:u,opacity:h})=>{const v=Qt(e,ue),f=Qt(t,ue);return(0,s.jsxs)("g",{opacity:h,children:[(0,s.jsx)(R.motion.path,{d:v,fill:r,fillOpacity:n,stroke:"none"}),(0,s.jsx)(R.motion.path,{d:f,fill:"none",stroke:o,strokeWidth:a,strokeOpacity:i,strokeDasharray:l,strokeLinecap:c,strokeLinejoin:u,vectorEffect:"non-scaling-stroke"})]})},oo=110,ao=150,en=({intro:e,children:t})=>{const r=(0,g.useId)();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("clipPath",{id:r,children:(0,s.jsx)(R.motion.rect,{...Uc(e.axis),transition:Rc(e)})}),(0,s.jsx)("g",{clipPath:`url(#${r})`,children:t})]})},Uc=e=>e==="x"?{x:"-5%",y:"-25%",height:`${ao}%`,initial:{width:"0%"},animate:{width:`${oo}%`}}:{x:"-25%",y:"-5%",width:`${ao}%`,initial:{height:"0%"},animate:{height:`${oo}%`}},Pa={},wa=(0,g.createContext)(Pa),Yc={x:1,y:1},ft=(0,g.createContext)(null),Kc=({shapes:e=Pa,children:t})=>(0,s.jsx)(wa.Provider,{value:e,children:t}),Xc=()=>(0,g.useContext)(wa),tn=({size:e,children:t})=>{const r=(0,g.useMemo)(()=>({panel:{size:e},viewport:{size:e,space:"pixels"}}),[e]);return(0,s.jsx)(ft.Provider,{value:r,children:t})},ja=({size:e,space:t="pixels",children:r})=>{const n=(0,g.useContext)(ft)?.panel,o=(0,g.useMemo)(()=>n===void 0?null:{panel:n,viewport:e===null?null:{size:e,space:t}},[n,e,t]);return(0,s.jsx)(ft.Provider,{value:o,children:r})},ir=()=>(0,g.useContext)(ft)?.viewport??null,sr=()=>{const e=ir();return e?.space==="pixels"?e.size:null},ae=()=>{const e=(0,g.useContext)(ft);if(e===null)throw new Error("useGeomPanelSize ran outside a geom layer.");return e.panel.size},Qc=()=>{const e=ir();return e?.space!=="unit"?Yc:{x:e.size.width,y:e.size.height}},xe=({effects:e,children:t,...r})=>{const n=ir()?.size??null,o=r.viewBox==="0 0 1 1"&&r.preserveAspectRatio==="none";return(0,s.jsx)("g",{style:e,children:(0,s.jsx)("svg",{...r,children:(0,s.jsx)(ja,{size:o?n:null,space:"unit",children:t})})})},qc=(0,g.memo)(function({layer:t,coordSystem:r,intro:n}){const o=n?.type==="wipe"?n:null,{lineGenerator:a,areaGenerator:i}=(0,g.useMemo)(()=>(0,d.createAreaPathGenerators)(r,t.params),[t.params,r]),l=B(t),c=(0,g.useMemo)(()=>{const u=(0,d.createStableKeyGenerator)(t.data,t.mapping,t.id),h=[];return t.data.groupBy(d.GROUP_VARIABLES.group).forEach(v=>{const f=(0,d.prepareAreaObservations)([...v],t.params.missingValues),m=i(f),p=a(f);if(!m||!p)return;const x=f[0];if(!x)return;const y=(0,d.toPaintColor)(l.get("fill",x)),b=l.get("stroke",x)??y,{strokeWidth:S,strokeDasharray:P,strokeLinecap:w}=we(l.get("dashArray",x),l.get("strokeWidth",x),l.get("lineCap",x)),j=l.get("lineJoin",x);h.push({key:u(x),areaPath:m,linePath:p,fill:y,stroke:b,fillOpacity:l.get("fillAlpha",x)*l.get("alpha",x),strokeWidth:S,strokeOpacity:l.get("strokeAlpha",x)*l.get("alpha",x),strokeDasharray:P,lineCap:w,lineJoin:j})}),h},[i,a,t.data,t.id,t.mapping,t.params,l]).map(u=>(0,s.jsx)(_c,{areaPath:u.areaPath,linePath:u.linePath,fill:u.fill,stroke:u.stroke,fillOpacity:u.fillOpacity,strokeWidth:u.strokeWidth,strokeOpacity:u.strokeOpacity,strokeDasharray:u.strokeDasharray,lineCap:u.lineCap,lineJoin:u.lineJoin},u.key));return(0,s.jsx)(xe,{viewBox:"0 0 1 1",preserveAspectRatio:"none",width:"100%",height:"100%","data-geom":"area",effects:U((0,d.readGeomEffects)(l,t.data.getFirst()??void 0)),className:ve,children:o?(0,s.jsx)(en,{intro:o,children:c}):c})}),_c=({areaPath:e,linePath:t,fill:r,stroke:n,fillOpacity:o,strokeWidth:a,strokeOpacity:i,strokeDasharray:l,lineCap:c,lineJoin:u})=>(0,s.jsx)(Sa,{fillPath:e,linePath:t,fill:r,fillOpacity:o,stroke:n,strokeWidth:a,strokeOpacity:i,strokeDasharray:l,lineCap:c,lineJoin:u}),Ea=1,Jc=.4,Zc=.2,$c=1,ed=.5,td=2.25,Qe=({hit:e,project:t,...r})=>{const n=aa(e.layerId),o=ia(e)??d.DEFAULT_GEOM_COLOR;if(!e.anchored)return null;const a=(0,d.getAlpha)(e.observation)??1,i=n?.get("stroke",e.observation,"hovered")??d.DEFAULT_HOVER_STROKE_COLOR,l=n?.get("symbol",e.observation)??"circle",c=t(e.x,e.y),u=(0,d.toPercent)(c.x),h=(0,d.toPercent)(c.y),v=rd(e.observation,n),f=(0,d.isGeometricSymbol)(l)?(0,d.getPointSymbolOuterRadius)(l,v*2):v*Math.SQRT2,{strokeRadius:m,strokeWidth:p}=nd(v,f),x=n?U((0,d.readGeomEffects)(n,e.observation,"hovered")):void 0;return(0,s.jsxs)("g",{...r,style:x,children:[(0,s.jsx)("circle",{cx:u,cy:h,r:m,fill:"none",stroke:i,strokeWidth:p}),(0,s.jsx)(St,{symbol:l,cx:u,cy:h,size:v*2,fill:o,opacity:a,stroke:i,strokeWidth:Ea})]})},rd=(e,t)=>{const r=t?.get("size",e),n=(0,d.getSize)(e)??null;return n!==null?(r??n)/td:(r??12)/2},nd=(e,t)=>{const r=Math.max($c,e*Jc),n=Math.max(ed,e*Zc);return{strokeRadius:t+Ea/2+n+r/2,strokeWidth:r}},od=({layer:e,coordSystem:t,primary:r,companions:n})=>{const o=B(e),a=(0,d.getGroup)(r.observation),i=(0,g.useMemo)(()=>(0,d.prepareAreaObservations)([...e.data.filter(d.GROUP_VARIABLES.group,"eq",a)],e.params.missingValues),[e.data,e.params.missingValues,a]),{areaPath:l,linePath:c}=(0,g.useMemo)(()=>{const{lineGenerator:S,areaGenerator:P}=(0,d.createAreaPathGenerators)(t,e.params);return{areaPath:P(i)??"",linePath:S(i)??""}},[t,e.params,i]);if(!l||!c)return null;const u=(0,d.toPaintColor)(o.get("fill",r.observation,"hovered")),h=o.get("stroke",r.observation,"hovered")??u,v=o.get("alpha",r.observation,"hovered"),f=o.get("fillAlpha",r.observation,"hovered")*v,m=o.get("strokeAlpha",r.observation,"hovered")*v,{strokeWidth:p,strokeDasharray:x,strokeLinecap:y}=we(o.get("dashArray",r.observation,"hovered"),o.get("strokeWidth",r.observation,"hovered"),o.get("lineCap",r.observation,"hovered")),b=o.get("lineJoin",r.observation,"hovered");return(0,s.jsxs)("g",{"data-testid":"hovered-area",children:[(0,s.jsxs)(xe,{viewBox:"0 0 1 1",preserveAspectRatio:"none",width:"100%",height:"100%","data-geom":"area",effects:U((0,d.readGeomEffects)(o,r.observation,"hovered")),className:ve,children:[(0,s.jsx)("path",{d:l,fill:u,fillOpacity:f,stroke:"none",className:ma,"data-testid":"hovered-area-fill"}),(0,s.jsx)("path",{d:c,fill:"none",stroke:h,strokeWidth:p,strokeOpacity:m,strokeDasharray:x,strokeLinecap:y,strokeLinejoin:b,vectorEffect:"non-scaling-stroke","data-testid":"hovered-area-edge"})]}),n.map(S=>(0,s.jsx)(Le,{hit:S,project:me},`companion-${S.layerId}-${S.pointIndex}`)),(0,s.jsx)(Qe,{hit:r,project:me,"data-testid":"hovered-area-point"})]})},ad={geom:"area",coord:"cartesian",swatchShape:"area",guideMode:"crosshair",render:({layer:e,coordSystem:t,intro:r})=>(0,s.jsx)(qc,{layer:e,coordSystem:t,intro:r}),renderHover:({layer:e,coordSystem:t,primary:r,group:n,related:o})=>(0,s.jsx)(od,{layer:e,coordSystem:t,primary:r,companions:[...n,...o]}),renderHoverCompanions:({related:e})=>(0,s.jsx)(s.Fragment,{children:e.map(t=>(0,s.jsx)(Le,{hit:t,project:me},`companion-${t.layerId}-${t.pointIndex}`))}),getEditOutlineShapes:Ec,getOverlayAnchor:({observation:e,coordSystem:t})=>{if(t.mainAxis==="x"){const o=(0,d.getX)(e),a=(0,d.getYTip)(e);return o===null||a===null?null:{x:o,y:a}}const r=(0,d.getY)(e),n=(0,d.getXTip)(e);return r===null||n===null?null:{x:n,y:r}}},lr=e=>{const t=new WeakMap;return(r,...n)=>{const o=t.get(r);if(o!==void 0&&id(o.args,n))return o.result;const a=e(r,...n);return t.set(r,{args:n,result:a}),a}},id=(e,t)=>e.length===t.length&&e.every((r,n)=>r===t[n]),ka={strokeWidth:0,cornerRadius:{baseStart:0,baseEnd:0,tipStart:0,tipEnd:0},strokeAlpha:1},cr=(e,t)=>({stroke:e.get("stroke",t),strokeWidth:e.get("strokeWidth",t),cornerRadius:e.get("cornerRadius",t),strokeAlpha:e.get("strokeAlpha",t)});var io="\0",Ca=(e,t)=>{const r=e.size??32;return e.aspectRatio!==void 0?{width:r,height:r/e.aspectRatio}:{width:r,height:t==null?r:r*t.height/t.width}},sd=e=>new Promise(t=>{if(typeof Image>"u"){t(null);return}const r=new Image;r.onload=()=>{const{naturalWidth:n,naturalHeight:o}=r;t(n>0&&o>0?{width:n,height:o}:null)},r.onerror=()=>t(null),r.src=e}),qe=e=>{const t=[...new Set(e.map(so).filter(i=>i!==void 0))].join(io),[r,n]=(0,g.useState)(()=>new Map),o=(0,g.useRef)(new Set),a=(0,g.useRef)(new Set);return(0,g.useEffect)(()=>()=>{o.current=new Set},[]),(0,g.useEffect)(()=>{const i=new Set(t===""?[]:t.split(io));o.current=i;for(const l of a.current)i.has(l)||a.current.delete(l);n(l=>{const c=new Map([...l].filter(([u])=>i.has(u)));return c.size===l.size?l:c});for(const l of i)r.has(l)||a.current.has(l)||(a.current.add(l),sd(l).then(c=>{o.current.has(l)&&(a.current.delete(l),n(u=>new Map(u).set(l,c)))}))},[t,r]),(0,g.useCallback)(i=>{const l=so(i);return l===void 0?void 0:r.get(l)},[r])},so=e=>{if(e===void 0||!(0,d.isImagePaint)(e))return;const{fit:t="tile",aspectRatio:r,image:n}=e;if(t==="tile"&&r===void 0)return n};var ld=1/3,cd={x:1,y:1},dd={x:0,y:0},te=({paints:e,unitsPerPixel:t=cd,origin:r=dd})=>{const n=(0,g.useId)(),o=(0,g.useMemo)(()=>{const a=new Map,i=new Set;for(const l of e){if(typeof l=="string")continue;const c=(0,d.paintKey)(l);if(a.has(c))continue;const u=`${n}paint-${ud(c)}`;let h=u,v=1;for(;i.has(h);)h=`${u}-${v++}`;i.add(h),a.set(c,{id:h,paint:l})}return a},[e,n]);return{fillFor:(0,g.useCallback)(a=>{if(typeof a=="string")return a;const i=o.get((0,d.paintKey)(a));if(i===void 0)throw new Error("fillFor requires a paint supplied to usePaintDefs.");return`url(#${i.id})`},[o]),defs:(0,s.jsx)(hd,{entries:[...o.values()],unitsPerPixel:t,origin:r})}},ud=e=>{let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=Math.imul(t,16777619);return(t>>>0).toString(36)},hd=({entries:e,unitsPerPixel:t,origin:r})=>{const n=qe(e.map(({paint:o})=>o));return e.length===0?null:(0,s.jsx)("defs",{children:e.map(({id:o,paint:a})=>(0,s.jsx)(vd,{id:o,paint:a,unitsPerPixel:t,origin:r,imageSize:n(a)},o))})},vd=({id:e,paint:t,unitsPerPixel:r,origin:n,imageSize:o})=>(0,d.isGradientPaint)(t)?(0,s.jsx)(fd,{id:e,paint:t}):(0,d.isPatternPaint)(t)?(0,s.jsx)(pd,{id:e,paint:t,unitsPerPixel:r,origin:n}):(0,s.jsx)(md,{id:e,paint:t,unitsPerPixel:r,origin:n,imageSize:o}),Ra=e=>({x:(0,d.toPercent)(e.x),y:(0,d.toPercent)(e.y)}),gd=e=>{const t=(e-90)*Math.PI/180,r=Math.cos(t)/2,n=Math.sin(t)/2;return{x1:.5-r,y1:.5-n,x2:.5+r,y2:.5+n}},fd=({id:e,paint:t})=>{const r=t.stops.map((n,o)=>(0,s.jsx)("stop",{offset:n.offset,stopColor:n.color},o));return t.gradient==="radial"?(0,s.jsx)("radialGradient",{id:e,gradientUnits:"objectBoundingBox",children:r}):(0,s.jsx)("linearGradient",{id:e,gradientUnits:"objectBoundingBox",...gd(t.angle??180),children:r})},pd=({id:e,paint:t,unitsPerPixel:r,origin:n})=>{const o=t.size??8,a=o/2;return(0,s.jsxs)("pattern",{id:e,...Ra(n),patternUnits:"userSpaceOnUse",width:o*r.x,height:o*r.y,viewBox:`0 0 ${o} ${o}`,preserveAspectRatio:"none",children:[t.background!==void 0&&(0,s.jsx)("rect",{width:o,height:o,fill:t.background}),t.pattern==="dots"&&(0,s.jsx)("circle",{cx:a,cy:a,r:o/6,fill:t.color}),t.pattern==="lines"&&(0,s.jsx)("rect",{width:o,height:o*.3333333333333333,fill:t.color}),(t.pattern==="diagonal"||t.pattern==="crosshatch")&&(0,s.jsx)("path",{d:`M0 ${o} L${o} 0`,stroke:t.color,strokeWidth:o/6,fill:"none"}),t.pattern==="crosshatch"&&(0,s.jsx)("path",{d:`M0 0 L${o} ${o}`,stroke:t.color,strokeWidth:o/6,fill:"none"})]})},md=({id:e,paint:t,unitsPerPixel:r,origin:n,imageSize:o})=>{if((t.fit??"tile")==="stretch")return(0,s.jsxs)("pattern",{id:e,patternUnits:"objectBoundingBox",patternContentUnits:"objectBoundingBox",width:1,height:1,children:[(0,s.jsx)("rect",{width:1,height:1,fill:t.fallback}),(0,s.jsx)("image",{href:t.image,width:1,height:1,opacity:t.alpha,preserveAspectRatio:"none"})]});const a=Ca(t,o);return(0,s.jsxs)("pattern",{id:e,...Ra(n),patternUnits:"userSpaceOnUse",width:a.width*r.x,height:a.height*r.y,viewBox:`0 0 ${a.width} ${a.height}`,preserveAspectRatio:"none",children:[(0,s.jsx)("rect",{width:a.width,height:a.height,fill:t.fallback}),(0,s.jsx)("image",{href:t.image,width:a.width,height:a.height,opacity:t.alpha,preserveAspectRatio:"none"})]})},rn=e=>({x:(0,d.toPercent)(e.x),y:(0,d.toPercent)(e.y),width:(0,d.toPercent)(e.width),height:(0,d.toPercent)(e.height)}),xd="var(--_8zqcis0)",yd="var(--_8zqcis1)",bd="var(--_8zqcis2)",Ad="var(--_8zqcis3)",Sd="var(--_8zqcis4)",nn={x:"_8zqcis5",y:"_8zqcis6"},Ta={x:"_8zqcis7",y:"_8zqcis8"},Ce={start:ht(xd),size:ht(yd),cap:ht(bd)},lo="bar-border-separator",La=ht(Ad),Ia=ht(Sd),Oa=(e,t)=>t===void 0?void 0:{mainAxis:e,maxWidth:t},Me=(e,t,r)=>{const n=rn(e);return t===void 0?r===void 0?n:{...n,style:r}:{...Ba(n,t.mainAxis),className:nn[t.mainAxis],style:{...dr(on(n,t.mainAxis),t),...r}}},co=(e,t,r)=>t===void 0?{...e,style:r}:{...Ba(e,t.mainAxis),className:nn[t.mainAxis],style:{...dr(on(e,t.mainAxis),t),...r}},uo=(e,t)=>{const{x:r,y:n,width:o,height:a}=rn(e);return t===void 0?{attrX:r,attrY:n,width:o,height:a}:t.mainAxis==="x"?{attrY:n,height:a,[Ce.start]:r,[Ce.size]:o}:{attrX:r,width:o,[Ce.start]:n,[Ce.size]:a}},Pd=(e,t)=>e===void 0?{style:t}:{className:nn[e.mainAxis],style:{[Ce.cap]:`${e.maxWidth}px`,...t}},Ma=(e,t,r,n)=>({className:Ta[r.mainAxis],style:{...dr(on(rn(t),r.mainAxis),r),[La]:(0,d.toPercent)(e),[Ia]:`${n}px`}}),ho=e=>({[La]:(0,d.toPercent)(e)}),wd=(e,t,r,n)=>({className:Ta[t.mainAxis],style:{...dr(e,t),[Ia]:`${r}px`,...n}}),dr=(e,t)=>({[Ce.start]:e.start,[Ce.size]:e.size,[Ce.cap]:`${t.maxWidth}px`}),on=(e,t)=>t==="x"?{start:e.x,size:e.width}:{start:e.y,size:e.height},Ba=(e,t)=>t==="x"?{y:e.y,height:e.height}:{x:e.x,width:e.width};function ht(e){return e.replace(/^var\((--[^),]+).*\)$/,"$1")}var jd=9999,Ed=lr(d.resolveBarBandThickness),Ga=e=>e==="full",Na=(e,t,r)=>{const[n,o]=r==="x"?[t.y,t.height]:[t.x,t.width];return e>n+1e-9&&e<n+o-1e-9},Fa=(e,t,r)=>r==="x"?{x1:(0,d.toPercent)(t.x),y1:(0,d.toPercent)(e),x2:(0,d.toPercent)(t.x+t.width),y2:(0,d.toPercent)(e)}:{x1:(0,d.toPercent)(e),y1:(0,d.toPercent)(t.y),x2:(0,d.toPercent)(e),y2:(0,d.toPercent)(t.y+t.height)},Ha=(e,t,r)=>e==="x"?{...t,x:r.x,width:r.width}:{...t,y:r.y,height:r.height},Da=({layer:e,mainAxis:t,styleReaders:r,dense:n=!1,buildSegment:o})=>{const a=(0,d.resolveBarBaseline)(e,t),i=Oa(t,r.get("maxWidth")),l=new Map;let c=-1;for(const h of e.data){c+=1;const v=(0,d.getBarRectBounds)(h);if(!v)continue;const f=(0,d.buildColumnKey)(t,v),m=o(h,v,c),p=l.get(f);p===void 0?l.set(f,{firstObservation:h,segments:[m]}):p.segments.push(m)}const u=new Map;for(const[h,{firstObservation:v,segments:f}]of l){const m=n?ka:cr(r,v);u.set(h,{...Ya(m,(0,d.getBoundingRect)(f),t,a,i),segments:f})}return u},kd=(e,t,r,n=!1)=>{const o=new Map,a=Da({layer:e,mainAxis:t,styleReaders:r,dense:n,buildSegment:(i,l)=>l});for(const[i,{style:l,bounds:c,baseEdge:u,corners:h,cap:v}]of a)o.set(i,{style:l,bounds:c,baseEdge:u,corners:h,cap:v});return{columns:o,baseline:(0,d.resolveBarBaseline)(e,t),dense:n}},an=lr(kd),Wa=({columns:e,baseline:t,dense:r},n,o,a)=>{const i=(0,d.getBarRectBounds)(a);if(!i)return null;const l=e.get((0,d.buildColumnKey)(n,i))??Ya(r?ka:cr(o,a),i,n,t,Oa(n,o.get("maxWidth")));return{column:l,bounds:Ha(n,i,l.bounds)}},za=(e,t,r,n)=>{const o=t==="x"?r.width:r.height,a=Math.max(d.DENSE_BAR_THICKNESS_PX,4*Cd(e,n)),i=Ed(e,t)*o;return Math.min(i,n.get("maxWidth")??1/0)<a},sn=(e,t)=>({x:e.x-t,y:e.y-t,width:Math.max(0,e.width+t*2),height:Math.max(0,e.height+t*2)}),Va=([e,t,r,n])=>{const o=a=>Ga(a)?jd:a;return[o(e),o(t),o(r),o(n)]},ur=(e,t)=>{const[r,n,o,a]=e,i=l=>l>0?Math.max(0,l+t):0;return[i(r),i(n),i(o),i(a)]},st=(e,t)=>{const[r,n,o,a]=(0,d.fitBarCornersToRect)(t,Math.max(0,e.width),Math.max(0,e.height)),i=e.x,l=e.y,c=e.x+e.width,u=e.y+e.height,h=(f,m)=>`${F(f)},${F(m)}`,v=(f,m,p)=>f>0?`A${F(f)},${F(f)} 0 0 1 ${h(m,p)}`:"";return`M${h(i+r,l)}L${h(c-n,l)}${v(n,c,l+n)}L${h(c,u-o)}${v(o,c-o,u)}L${h(i+a,u)}${v(a,i,u-a)}L${h(i,l+r)}${v(r,i+r,l)}Z`},Ua=(e,t)=>{const r=F(e.x),n=F(e.y),o=F(e.x+e.width),a=F(e.y+e.height),i=F(Math.max(0,Math.min(t,e.width/2))),l=F(Math.max(0,Math.min(t,e.height/2)));if(i<=0||l<=0)return`M${r},${n}H${o}V${a}H${r}Z`;const c=`A${i},${l} 0 0 1 `,[u,h,v,f]=[`${r}`,`${n}`,`${o}`,`${a}`],m=`${F(r+i)}`,p=`${F(o-i)}`,x=`${F(n+l)}`,y=`${F(a-l)}`;return`M${m},${h}H${p}${c}${v},${x}V${y}${c}${p},${f}H${m}${c}${u},${y}V${x}${c}${m},${h}Z`},ln=(e,t)=>(0,g.useMemo)(()=>(0,d.resolveBarPaintOrigin)(e,t.mainAxis),[e,t.mainAxis]),Cd=(e,t)=>{const r=e.data.getFirst();if(r===null||t.get("stroke",r)===void 0)return 0;const n=t.get("strokeWidth",r);return typeof n=="number"?n:0},Ya=(e,t,r,n,o)=>{const a=(0,d.findBarBaseEdge)(r,t,n);return{style:e,bounds:t,baseEdge:a,corners:(0,d.resolveBarCorners)(e.cornerRadius,r,a),cap:o}},Ka=(0,g.createContext)(!1),Rd=({layer:e,coordSystem:t,panelSize:r,styleReaders:n,children:o})=>(0,s.jsx)(Ka.Provider,{value:za(e,t.mainAxis,r,n),children:o}),cn=()=>(0,g.useContext)(Ka),Ht=1e-6,Td=({layer:e,sourceLayer:t,coordSystem:r,panelRect:n,styleReaders:o,animateTransitions:a})=>{const{mainAxis:i}=r,{columns:l}=an(t,i,o,za(t,i,n,o)),c=Ld(e.data);let u="";for(let h=0;h<e.data.size();h++){const v=(0,d.buildBarRectBounds)({xMin:c.xMin[h]??null,xMax:c.xMax[h]??null,yMin:c.yMin?.[h]??null,yMax:c.yMax[h]??null,y:c.y?.[h]??null});if(v===null)continue;const f=l.get((0,d.buildColumnKey)(i,v));if(f===void 0)continue;const m=(0,d.clampBarThickness)(i,f.bounds,f.cap?.maxWidth,n),p=Ha(i,v,m),x=(0,d.scaleRectToPanel)(m,n),y=(0,d.scaleRectToPanel)(p,n),b=(0,d.fitBarCorners)(f.corners,x);u+=Od(y,x)&&!Id(b,x)?st(x,b):jc(x,b,i==="x"?{axis:"y",from:y.y,to:y.y+y.height}:{axis:"x",from:y.x,to:y.x+y.width})}return u===""?[]:[{kind:"region",pathData:u,animateTransitions:a}]},Ld=e=>{const t=r=>e.hasVariable(r)?e.getValues(r,{type:"numeric"}):null;return{xMin:e.getValues(d.POSITION_VARIABLES.xMin,{type:"numeric"}),xMax:e.getValues(d.POSITION_VARIABLES.xMax,{type:"numeric"}),yMin:t(d.POSITION_VARIABLES.yMin),yMax:e.getValues(d.POSITION_VARIABLES.yMax,{type:"numeric"}),y:t(d.POSITION_VARIABLES.y)}},Id=([e,t,r,n],o)=>e+n>o.height+Ht||t+r>o.height+Ht||e+t>o.width+Ht||n+r>o.width+Ht,Od=(e,t)=>Math.abs(e.x-t.x)<.5&&Math.abs(e.y-t.y)<.5&&Math.abs(e.width-t.width)<.5&&Math.abs(e.height-t.height)<.5,Nr=(e,t,r)=>{const n=r===void 0?e.activeIntro:r,o=(0,g.useRef)(n?or(n,t):null),a=(0,g.useRef)(e.animateTransitions);return a.current=e.animateTransitions,(0,g.useCallback)(()=>{const i=o.current;return o.current=null,i??ar(a.current)},[])},hr=e=>{const{animateTransitions:t}=q(),r=(0,g.useRef)(!0);(0,g.useEffect)(()=>{r.current=!1},[]);const n=r.current;return(0,g.useMemo)(()=>({animated:t||e!==null,mounting:n,activeIntro:n?e:null,animateTransitions:t}),[e,t,n])},Pt=(e,t)=>(0,g.useMemo)(()=>{const r=Array.from(e.data,o=>t.get("fill",o));return{paints:r,paintAt:o=>{const a=r[o];if(a===void 0)throw new Error(`No resolved fill for observation ${o}.`);return a}}},[e.data,t]),Md="bar-border-ring",Bd=({bounds:e,cap:t,mainAxis:r,ring:n})=>{const o=sr(),a=o&&Fr(e,t,r,n.width,o);if(!a)return null;const i=Xa(a,n);return _a(i,n,(0,s.jsx)("path",{d:Qa(a,n,i),...qa(i,n)}))},Gd=({bounds:e,cap:t,mainAxis:r,ring:n,target:o})=>{const a=sr(),i=a&&Fr(o,t,r,n.width,a),l=i?Xa(i,n):"clipped",c=(0,R.useTransform)([e.x,e.y,e.width,e.height],([h=0,v=0,f=0,m=0])=>{const p=a&&Fr({x:h,y:v,width:f,height:m},t,r,n.width,a);return p?Qa(p,n,l):""}),u=`${l}:${n.clip.style.clipPath??""}`;return _a(l,n,(0,s.jsx)(R.motion.path,{d:c,...qa(l,n)},u))},Fr=(e,t,r,n,o)=>{const a=(0,d.scaleRectToPanel)((0,d.clampBarThickness)(r,e,t?.maxWidth,o),o);return(r==="x"?a.width:a.height)<4*n||a.width<=0||a.height<=0?null:a},Xa=(e,{corners:t,width:r})=>{if((0,d.splitFullEnd)(t)!==void 0)return"split";const n=r/2,o=sn(e,-n);if(o.width<=0||o.height<=0)return"clipped";const a=(0,d.fitBarCorners)(t,e);if(a.some(l=>l>0&&l<=n))return"clipped";const i=ur(a,-n);return(0,d.fitBarCornersToRect)(i,o.width,o.height).every((l,c)=>l===i[c])?"inset":"clipped"},Qa=(e,{corners:t,width:r},n)=>{if(n==="inset"){const a=r/2;return st(sn(e,-a),ur((0,d.fitBarCorners)(t,e),-a))}const o=(0,d.splitFullEnd)(t);return n==="clipped"||o===void 0?st(e,(0,d.fitBarCorners)(t,e)):st(e,(0,d.fitBarCorners)(o.fullEnd,e))+st(e,(0,d.fitBarCorners)(o.otherEnd,e))},qa=(e,t)=>({fill:"none",stroke:t.stroke,strokeWidth:e==="inset"?t.width:t.width*2,opacity:t.opacity,style:e==="inset"?void 0:t.clip.style,"data-testid":Md}),_a=(e,t,r)=>e==="split"?(0,s.jsx)("g",{style:t.clip.endStyle,children:r}):r,Ja=e=>{const[t,...r]=e,n=t?.effects;return r.every(o=>Nd(o.effects,n))?{scope:"column",style:n}:{scope:"bar"}},Nd=(e,t)=>e===t||e!==void 0&&t!==void 0&&e.filter===t.filter&&e.mixBlendMode===t.mixBlendMode,dn={fillClip:void 0,border:void 0},Fd="bar-border-plate",vo={},Dt="-1000px",Za=(e,t,r)=>(0,s.jsxs)(s.Fragment,{children:[e?.kind==="plate"&&Vd(e,t),r,e?.kind==="ring"&&t.ring(e)]}),$a=(e,t,r)=>({rect:({style:n,...o})=>(0,s.jsx)("rect",{...Me(e,t,n),...o}),ring:n=>(0,s.jsx)(Bd,{bounds:e,cap:t,mainAxis:r,ring:n})}),lt=(e,t)=>{const r=o=>{const a=Va(o);return t===void 0?Hr(a):Hr(ur(a,-t),`${t}px`)},n=(0,d.splitFullEnd)(e);return n===void 0?{style:r(e)}:{style:r(n.otherEnd),endStyle:r(n.fullEnd)}},go=e=>e&&{style:vo,endStyle:e.endStyle&&vo},Se=(e,t,r)=>e?.endStyle===void 0?t(e?.style):(0,s.jsx)("g",{style:e.endStyle,children:t(e.style)},r),ei=(e,t,r=0)=>{const n=(o,a)=>{const i=a>0?(0,d.toPercent)(Math.max(0,o)/a):"0%";return r===0?i:`calc(${i} - ${r}px)`};return{clipPath:`inset(${n(e.y-t.y,t.height)} ${n(t.x+t.width-(e.x+e.width),t.width)} ${n(t.y+t.height-(e.y+e.height),t.height)} ${n(e.x-t.x,t.width)}) fill-box`}},un=e=>{const t=new Map;return({style:r,corners:n},o)=>{const a=ti(r)&&o(),i=`${a}|${n.join(" ")}|${r.stroke}|${r.strokeWidth}|${r.strokeAlpha}`;let l=t.get(i);return l===void 0&&(l=Hd(r,n,e,a),t.set(i,l)),l}},Hd=(e,t,r,n)=>{const o=t.some(l=>Ga(l)||l>0);if(!ti(e))return{fillClip:o?lt(t,0):void 0,border:void 0};const a=e.strokeWidth,i={stroke:e.stroke,opacity:e.strokeAlpha,separatorWidth:(0,d.resolveBarBorderTreatment)(a).separatorWidth,separatorStyle:zd(a,r)};return n?{fillClip:Dd(t,a,r),border:{kind:"plate",...i,clip:lt(t)}}:{fillClip:o?lt(t,0):void 0,border:{kind:"ring",...i,corners:t,width:a,clip:lt(t)}}},ti=e=>e.stroke!==void 0&&e.strokeWidth>0,Dd=(e,t,r)=>{const n=`${t}px`,o=`clamp(0px, calc((100% - ${4*t}px) * 1000), ${t}px)`,a=([x,y])=>x===y?r==="x"?`${x} ${o}`:`${o} ${x}`:r==="x"?`${x} ${o} ${y} ${o}`:`${o} ${y} ${o} ${x}`,i=(x,y)=>Hr(ur(Va(x),-t),a(y)),l=Wd(e,r);if(l===void 0)return{style:i(e,[n,n])};const[c,u,h,v]=e,f=x=>{const y=b=>b==="full"===x?b:0;return[y(c),y(u),y(h),y(v)]},m=l==="start"?[n,"0px"]:["0px",n],p=l==="start"?["0px",n]:[n,"0px"];return{style:i(f(!1),p),endStyle:i(f(!0),m)}},Wd=(e,t)=>{const[r,n,o,a]=e.map(c=>c==="full"),[i,l]=t==="x"?[r||n,o||a]:[r||a,n||o];if(i!==l)return i?"start":"end"},zd=(e,t)=>{const r=`clamp(0px, calc((${4*e}px - 100%) * 1000), 50%)`;return{clipPath:t==="x"?`inset(${Dt} ${r} ${Dt} ${r}) fill-box`:`inset(${r} ${Dt} ${r} ${Dt}) fill-box`}},Hr=(e,t="0")=>({clipPath:e.some(r=>r>0)?`inset(${t} round ${e.map(r=>`${r}px`).join(" ")}) fill-box`:`inset(${t}) fill-box`}),Vd=({stroke:e,opacity:t,clip:r},{rect:n})=>Se(r,o=>n({fill:e,opacity:t,style:o,"data-testid":Fd})),hn=(e,t)=>t.growAxis==="x"?{x:t.baseline,y:e.y,width:0,height:e.height}:{x:e.x,y:t.baseline,width:e.width,height:0},Ud=(0,g.memo)(function({layer:t,coordSystem:r,intro:n}){const o=B(t),a=cn(),i=hr(n?.type==="grow"&&(n.growAxis==="x"||n.growAxis==="y")?n:null),{paints:l,paintAt:c}=Pt(t,o),{fillFor:u,defs:h}=te({paints:l,origin:ln(t,r)}),{mainAxis:v}=r,f=(0,g.useMemo)(()=>{const p=(0,d.createStableKeyGenerator)(t.data,t.mapping,t.id);return[...Da({layer:t,mainAxis:v,styleReaders:o,buildSegment:(x,y,b)=>{const S=c(b),P=yt(o,x);return{key:p(x),...y,fill:u(S),opacity:P,paint:S,effects:U((0,d.readGeomEffects)(o,x))}}}).values()].map(x=>({...x,effects:Ja(x.segments)}))},[u,t,v,c,o]),m=(0,g.useMemo)(()=>{const p=new Map,x=un(v);return f.map((y,b)=>({key:y.segments[0]?.key??String(b),bars:y.segments,effects:y.effects,...y.bounds,cap:y.cap,...a?dn:x(y,()=>y.segments.every(S=>S.opacity>=1&&Zr(S.paint,p)))}))},[a,f,v]);return(0,s.jsxs)(s.Fragment,{children:[h,(0,s.jsx)("g",{children:(0,g.useMemo)(()=>m.map(p=>{const x=p.effects.scope==="column"?p.effects.style:void 0;if(p.bars.length===1&&p.border===void 0){const[y]=p.bars;if(!y)return null;const{key:b,effects:S,paint:P,...w}=y,j=Se(p.fillClip,C=>(0,s.jsx)(Dr,{...w,style:C,cap:p.cap,animation:i,introKey:b},b),b);return x===void 0?j:(0,s.jsx)("g",{style:x,children:j},b)}return(0,s.jsx)("g",{style:x,children:i.animated?(0,s.jsx)(Kd,{column:p,mainAxis:v,animation:i}):(0,s.jsx)(Yd,{column:p,mainAxis:v,animation:i})},p.key)}),[i,m,v])})]})}),Yd=({column:e,mainAxis:t,animation:r})=>{const{cap:n}=e;return ri(e,t,r,{columnBox:(0,s.jsx)("rect",{...Me(e,n),fill:"none"}),boxElements:$a(e,n,t)})},Kd=({column:e,mainAxis:t,animation:r})=>{const{bars:n,cap:o}=e,a=Zd(e,t,r,n[0]?.key),i=String(o?.maxWidth);return ri(e,t,r,{bounds:a,columnBox:(0,s.jsx)(R.motion.rect,{...co(a.percent,o),fill:"none"},i),boxElements:{rect:({style:l,...c})=>{const{clipPath:u,style:h}=vn(l);return(0,s.jsx)(R.motion.rect,{...co(a.percent,o,h),...c,clipPath:u},`${i}|${qt(h)}`)},ring:l=>(0,s.jsx)(Gd,{bounds:a.normalized,target:e,cap:o,mainAxis:t,ring:l})}})},vn=e=>{const{clipPath:t,...r}=e??{};return{clipPath:t,style:r}},ri=(e,t,r,{columnBox:n,boxElements:o,bounds:a})=>{const{border:i}=e;return Za(i,o,Xd(e,t,r,n,a&&{target:e,bounds:a}))},Xd=(e,t,r,n,o)=>{const{bars:a,effects:i,fillClip:l,border:c,cap:u}=e,[h]=a;if(a.length===1&&h!==void 0){const{key:p,effects:x,paint:y,...b}=h;return Se(l,S=>(0,s.jsx)(Dr,{...b,style:S,cap:u,animation:r,introKey:p}))}const v=i.scope==="column",f=v?l:go(l),m=v?go(l):l;return(0,s.jsxs)(s.Fragment,{children:[Se(f,p=>(0,s.jsx)("g",{style:p,children:a.map(({key:x,effects:y,paint:b,...S})=>(0,s.jsx)("g",{style:v?void 0:y,children:Se(m,P=>(0,s.jsxs)("g",{style:P,children:[(0,s.jsx)(Dr,{...S,cap:u,animation:r,introKey:x}),!v&&n]}))},x))})),c&&Se(l,p=>(0,s.jsxs)("g",{style:p,children:[a.map(({key:x,...y})=>Qd(y,e,t)&&(0,s.jsx)(qd,{bar:y,mainAxis:t,stroke:c.stroke,strokeWidth:c.separatorWidth,opacity:c.opacity,animation:r,introKey:x,cap:u,style:c.separatorStyle,springingColumn:o},x)),n]}))]})},Qd=(e,t,r)=>{const[n,o]=r==="x"?[e.y,e.height]:[e.x,e.width];return o>1e-9&&Na(n,t,r)},Dr=({animation:e,introKey:t,style:r,cap:n,...o})=>{const{animated:a,activeIntro:i,animateTransitions:l}=e;if(!a)return(0,s.jsx)("rect",{...Me(o,n,r),fill:o.fill,opacity:o.opacity});const c=i?hn(o,i):null,{clipPath:u,style:h}=vn(r),v=Pd(n,h);return(0,s.jsx)(R.motion.rect,{initial:c?{...uo(c,n),opacity:o.opacity}:!1,transition:i?or(i,t):ar(l),fill:o.fill,opacity:o.opacity,...v,clipPath:u,animate:{...uo(o,n),opacity:o.opacity}},qt(v.style))},qd=({bar:e,mainAxis:t,stroke:r,strokeWidth:n,opacity:o,animation:a,introKey:i,cap:l,style:c,springingColumn:u})=>{const{animated:h,activeIntro:v,animateTransitions:f}=a,m=fo(e,t);if(!h||u===void 0)return l===void 0?(0,s.jsx)("line",{...Fa(m,e,t),stroke:r,strokeWidth:n,opacity:o,style:c}):(0,s.jsx)("rect",{...Jd(Ma(m,e,l,n),c),fill:r,opacity:o,"data-testid":lo});const{band:p}=u.bounds,x=v?fo(hn(e,v),t):_d(m,u,t),y=v?or(v,i):ar(f),{clipPath:b,style:S}=vn(c);if(l!==void 0){const j=wd(p,l,n,S);return(0,s.jsx)(R.motion.rect,{initial:ho(x),transition:y,animate:ho(m),...j,clipPath:b,fill:r,opacity:o,"data-testid":lo},`${l.maxWidth}|${n}|${qt(S)}`)}const P=t==="x"?{edge:["y1","y2"],band:{x1:p.start,x2:p.end}}:{edge:["x1","x2"],band:{y1:p.start,y2:p.end}},w=j=>({[P.edge[0]]:(0,d.toPercent)(j),[P.edge[1]]:(0,d.toPercent)(j)});return(0,s.jsx)(R.motion.line,{initial:w(x),transition:y,animate:w(m),...P.band,stroke:r,strokeWidth:n,opacity:o,style:S,clipPath:b},qt(S))},_d=(e,{target:t,bounds:r},n)=>{const[o,a,i]=n==="x"?[t.y,t.height,{start:r.percent.y,length:r.percent.height}]:[t.x,t.width,{start:r.percent.x,length:r.percent.width}];return a<=0?e:ke(i.start.get())+(e-o)/a*ke(i.length.get())},qt=e=>e===void 0?"":Object.entries(e).map(([t,r])=>`${t}:${String(r)}`).join(";"),Jd=(e,t)=>({...e,style:{...e.style,...t}}),fo=(e,t)=>t==="x"?e.y:e.x,Zd=(e,t,r,n)=>{const o=r.activeIntro?hn(e,r.activeIntro):e,a=(0,R.useMotionValue)((0,d.toPercent)(o.x)),i=(0,R.useMotionValue)((0,d.toPercent)(o.y)),l=(0,R.useMotionValue)((0,d.toPercent)(o.width)),c=(0,R.useMotionValue)((0,d.toPercent)(o.height)),u=Nr(r,n);(0,g.useEffect)(()=>{const f=u(),m=[(0,R.animate)(a,(0,d.toPercent)(e.x),f),(0,R.animate)(i,(0,d.toPercent)(e.y),f),(0,R.animate)(l,(0,d.toPercent)(e.width),f),(0,R.animate)(c,(0,d.toPercent)(e.height),f)];return()=>{for(const p of m)p.stop()}},[a,i,l,c,e.x,e.y,e.width,e.height,u]);const[h,v]=t==="x"?[a,l]:[i,c];return{normalized:{x:(0,R.useTransform)(a,ke),y:(0,R.useTransform)(i,ke),width:(0,R.useTransform)(l,ke),height:(0,R.useTransform)(c,ke)},percent:{x:a,y:i,width:l,height:c},band:{start:h,size:v,end:(0,R.useTransform)([h,v],([f="0%",m="0%"])=>(0,d.toPercent)(ke(f)+ke(m)))}}},ke=e=>Number.parseFloat(e)/100,ni=({testIdPrefix:e,mainAxis:t,column:r,bounds:n,fill:o,opacity:a,silhouette:i})=>{const{fillClip:l,border:c}=i,{cap:u}=r;if(c===void 0&&tu(n,r.bounds))return Se(l,v=>(0,s.jsx)("rect",{...Me(n,u,v),fill:o,opacity:a,"data-testid":`${e}-segment`}));const h=Se(l,v=>(0,s.jsxs)("g",{style:v,children:[(0,s.jsx)("rect",{...Me(n,u),fill:o,opacity:a,"data-testid":`${e}-segment`}),c&&eu(n,r.bounds,t).map(f=>u===void 0?(0,s.jsx)("line",{...Fa(f,r.bounds,t),stroke:c.stroke,strokeWidth:c.separatorWidth,opacity:c.opacity,style:c.separatorStyle,"data-testid":`${e}-separator`},f):(0,s.jsx)("rect",{...$d(Ma(f,r.bounds,u,c.separatorWidth),c.separatorStyle),fill:c.stroke,opacity:c.opacity,"data-testid":`${e}-separator`},f)),(0,s.jsx)("rect",{...Me(r.bounds,u),fill:"none"})]}));return(0,s.jsx)("g",{style:ei(n,r.bounds),"data-testid":e,children:c?Za(c,$a(r.bounds,u,t),h):h})},$d=(e,t)=>({...e,style:{...e.style,...t}}),eu=(e,t,r)=>{const[n,o]=r==="x"?[e.y,e.height]:[e.x,e.width];return[n,n+o].filter(a=>Na(a,t,r))},tu=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,ru=({layer:e,sourceLayer:t,coordSystem:r})=>{const{defs:n,columns:o}=nu(e,t,r);return(0,s.jsxs)(s.Fragment,{children:[n,(0,s.jsx)("g",{children:o.flatMap(a=>{const[i]=a,l=Ja(a);return i!==void 0&&l.scope==="column"?[(0,s.jsx)("g",{style:l.style,children:a.map(({node:c})=>c)},i.key)]:a.map(({key:c,effects:u,node:h})=>(0,s.jsx)("g",{style:u,children:h},c))})})]})},nu=(e,t,r)=>{const{mainAxis:n}=r,o=cn(),a=B(t),i=an(t,n,a,o),{paints:l,paintAt:c}=Pt(e,a),{fillFor:u,defs:h}=te({paints:l,origin:ln(t,r)}),v=(0,d.createStableKeyGenerator)(e.data,e.mapping,e.id),f=new Map,m=new Map,p=un(n);let x=-1;for(const y of e.data){x+=1;const b=Wa(i,n,a,y);if(b===null)continue;const S=v(y),P=c(x),w=yt(a,y),j=o?dn:p(b.column,()=>w>=1&&Zr(P,m)),C={key:S,effects:U((0,d.readGeomEffects)(a,y)),node:(0,s.jsx)(ni,{testIdPrefix:"highlight-bar",mainAxis:n,column:b.column,bounds:b.bounds,fill:u(P),opacity:w,silhouette:j},S)},k=f.get(b.column);k===void 0?f.set(b.column,[C]):k.push(C)}return{defs:h,columns:[...f.values()]}},po=3,ou=({layer:e,coordSystem:t,primary:r})=>{const{mainAxis:n}=t,o=cn(),a=B(e),i=an(e,n,a,o),l=a.get("fill",r.observation,"hovered"),{fillFor:c,defs:u}=te({paints:[l],origin:ln(e,t)}),h=Wa(i,n,a,r.observation),v=yt(a,r.observation,"hovered"),f=h&&(o?dn:un(n)(h.column,()=>v>=1&&(0,d.isOpaquePaint)(l)));if(h===null||f===null)return null;const{column:m,bounds:p}=h,x=a.get("stroke",r.observation,"hovered");return(0,s.jsxs)("g",{"data-testid":"hovered-bar",style:U((0,d.readGeomEffects)(a,r.observation,"hovered")),children:[u,(0,s.jsx)("g",{style:ei(p,m.bounds,po),children:Se(lt(m.corners,-3),y=>(0,s.jsx)("rect",{...Me(m.bounds,m.cap,y),fill:x,stroke:x,strokeWidth:po*2,"data-testid":"hovered-bar-border"}))}),(0,s.jsx)(ni,{testIdPrefix:"hovered-bar-repaint",mainAxis:n,column:m,bounds:p,fill:c(l),opacity:v,silhouette:f})]})},au=lr(d.createBarBoundsReader),iu={geom:"bar",coord:"cartesian",swatchShape:"square",guideMode:"band",LayerProvider:Rd,render:({layer:e,coordSystem:t,intro:r})=>(0,s.jsx)(Ud,{layer:e,coordSystem:t,intro:r}),renderHighlight:({layer:e,sourceLayer:t,coordSystem:r})=>(0,s.jsx)(ru,{layer:e,sourceLayer:t,coordSystem:r}),renderHover:({layer:e,coordSystem:t,primary:r})=>(0,s.jsx)(ou,{layer:e,coordSystem:t,primary:r}),getEditOutlineShapes:Td,getObservationRect:({layer:e,coordSystem:t,observation:r,panelRect:n,styleReaders:o})=>au(e,t.mainAxis,o,n)(r)},su=({layer:e,panelRect:t,styleReaders:r,animateTransitions:n})=>{const o=(0,d.createLinePathGenerator)(e.params),a={origin:{x:0,y:0},scaleX:t.width,scaleY:t.height},i=[],l=[];return e.data.groupBy(d.GROUP_VARIABLES.group).forEach(c=>{const u=(0,d.prepareLineObservations)([...c],e.params.missingValues),[h]=u;if(h===void 0)return;if(u.length===1){const f=lu(h,t);f!==null&&l.push(f);return}const v=ua(o,u,a);v!==""&&i.push({kind:"stroke",key:String((0,d.getGroup)(h)),pathData:v,width:r.get("strokeWidth",h),animateTransitions:n})}),l.length>0&&i.push({kind:"dots",centers:l,size:d.DEFAULT_POINT_SIZE_PX}),i},lu=(e,t)=>{const r=(0,d.getX)(e),n=(0,d.getY)(e);return r===null||n===null?null:gt({x:r,y:n},t)},cu=(0,g.memo)(function({layer:t,intro:r}){const n=r?.type==="wipe"?r:null,o=(0,g.useMemo)(()=>(0,d.createLinePathGenerator)(t.params),[t.params]),a=(0,g.useMemo)(()=>(0,d.createLineFillAreaGenerator)(t.params),[t.params]),i=B(t),l=(0,g.useMemo)(()=>{const c=(0,d.createStableKeyGenerator)(t.data,t.mapping,t.id),u=[];return t.data.groupBy(d.GROUP_VARIABLES.group).forEach(h=>{const v=(0,d.prepareLineObservations)([...h],t.params.missingValues),f=o(v);if(!f)return;const m=v[0];if(!m)return;const p=i.get("fillAlpha",m),x=p===void 0?void 0:a(v)??void 0,y=i.get("stroke",m),b=i.get("fill",m),S=b===void 0?y:(0,d.toPaintColor)(b),{strokeWidth:P,strokeDasharray:w,strokeLinecap:j}=we(i.get("dashArray",m),i.get("strokeWidth",m),i.get("lineCap",m)),C=i.get("lineJoin",m);u.push({key:c(m),pathData:f,fillPath:x,fillAlpha:p,stroke:y,fill:S,opacity:i.get("alpha",m),strokeAlpha:i.get("strokeAlpha",m),strokeWidth:P,strokeDasharray:w,lineCap:j,lineJoin:C})}),u},[o,a,t.data,t.id,t.mapping,t.params,i]).map(c=>(0,s.jsx)(du,{pathData:c.pathData,fillPath:c.fillPath,fillAlpha:c.fillAlpha,stroke:c.stroke,fill:c.fill,strokeWidth:c.strokeWidth,opacity:c.opacity,strokeAlpha:c.strokeAlpha,strokeDasharray:c.strokeDasharray,lineCap:c.lineCap,lineJoin:c.lineJoin},c.key));return(0,s.jsx)(xe,{viewBox:"0 0 1 1",preserveAspectRatio:"none",width:"100%",height:"100%","data-geom":"line",effects:U((0,d.readGeomEffects)(i,t.data.getFirst()??void 0)),className:ve,children:n?(0,s.jsx)(en,{intro:n,children:l}):l})}),du=({pathData:e,fillPath:t,fillAlpha:r,stroke:n,fill:o,strokeWidth:a,opacity:i,strokeAlpha:l,strokeDasharray:c,lineCap:u,lineJoin:h})=>{const{animateTransitions:v}=q();return t!==void 0&&r!==void 0?(0,s.jsx)(uu,{fillPath:t,fillAlpha:r,fill:o,linePath:e,stroke:n,strokeWidth:a,opacity:i,strokeAlpha:l,strokeDasharray:c,lineCap:u,lineJoin:h}):v?(0,s.jsx)(hu,{pathData:e,stroke:n,strokeWidth:a,opacity:i,strokeAlpha:l,strokeDasharray:c,lineCap:u,lineJoin:h}):(0,s.jsx)("path",{d:e,fill:"none",stroke:n,strokeWidth:a,opacity:i,strokeOpacity:l,strokeDasharray:c,strokeLinecap:u,strokeLinejoin:h,vectorEffect:"non-scaling-stroke"})},uu=({fillPath:e,fillAlpha:t,linePath:r,stroke:n,fill:o,strokeWidth:a,opacity:i,strokeAlpha:l,strokeDasharray:c,lineCap:u,lineJoin:h})=>{const v=`line_fill_gradient_${(0,g.useId)()}`;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("defs",{children:(0,s.jsxs)("linearGradient",{id:v,gradientTransform:"rotate(90 0.5 0.5)",children:[(0,s.jsx)("stop",{offset:"0%",stopColor:o}),(0,s.jsx)("stop",{offset:"70%",stopColor:o,stopOpacity:0}),(0,s.jsx)("stop",{offset:"100%",stopColor:o,stopOpacity:0})]})}),(0,s.jsx)(Sa,{fillPath:e,linePath:r,fill:`url(#${v})`,fillOpacity:t,stroke:n,strokeWidth:a,strokeOpacity:l,opacity:i,strokeDasharray:c,lineCap:u,lineJoin:h})]})},hu=({pathData:e,stroke:t,strokeWidth:r,opacity:n,strokeAlpha:o,strokeDasharray:a,lineCap:i,lineJoin:l})=>{const c=Qt(e,ue);return(0,s.jsx)(R.motion.path,{d:c,fill:"none",stroke:t,strokeWidth:r,opacity:n,strokeOpacity:o,strokeDasharray:a,strokeLinecap:i,strokeLinejoin:l,vectorEffect:"non-scaling-stroke"})},vu=({layer:e,primary:t,companions:r})=>{const n=B(e),o=(0,d.getGroup)(t.observation),a=(0,g.useMemo)(()=>(0,d.prepareLineObservations)([...e.data.filter(d.GROUP_VARIABLES.group,"eq",o)],e.params.missingValues),[e.data,e.params.missingValues,o]),i=(0,g.useMemo)(()=>(0,d.createLinePathGenerator)(e.params)(a),[e.params,a]);if(!i)return null;const l=n.get("stroke",t.observation,"hovered"),c=n.get("alpha",t.observation,"hovered"),u=n.get("strokeAlpha",t.observation,"hovered"),{strokeWidth:h,strokeDasharray:v,strokeLinecap:f}=we(n.get("dashArray",t.observation,"hovered"),n.get("strokeWidth",t.observation,"hovered"),n.get("lineCap",t.observation,"hovered")),m=n.get("lineJoin",t.observation,"hovered");return(0,s.jsxs)("g",{"data-testid":"hovered-line",children:[(0,s.jsx)(xe,{viewBox:"0 0 1 1",preserveAspectRatio:"none",width:"100%",height:"100%","data-geom":"line",effects:U((0,d.readGeomEffects)(n,t.observation,"hovered")),className:ve,children:(0,s.jsx)("path",{d:i,fill:"none",stroke:l,strokeWidth:h,opacity:c,strokeOpacity:u,strokeDasharray:v,strokeLinecap:f,strokeLinejoin:m,vectorEffect:"non-scaling-stroke","data-testid":"hovered-line-path"})}),r.map(p=>(0,s.jsx)(Le,{hit:p,project:me},`companion-${p.layerId}-${p.pointIndex}`)),(0,s.jsx)(Qe,{hit:t,project:me,"data-testid":"hovered-line-point"})]})},gu={geom:"line",coord:"cartesian",swatchShape:"line",guideMode:"crosshair",render:({layer:e,intro:t})=>(0,s.jsx)(cu,{layer:e,intro:t}),renderHover:({layer:e,primary:t,group:r,related:n})=>(0,s.jsx)(vu,{layer:e,primary:t,companions:[...r,...n]}),renderHoverCompanions:({related:e})=>(0,s.jsx)(s.Fragment,{children:e.map(t=>(0,s.jsx)(Le,{hit:t,project:me},`companion-${t.layerId}-${t.pointIndex}`))}),getEditOutlineShapes:su,getOverlayAnchor:({observation:e})=>{const t=(0,d.getX)(e),r=(0,d.getY)(e);return t===null||r===null?null:{x:t,y:r}}},oi=({observation:e,project:t,styleReaders:r,animation:n,introKey:o})=>{const a=(0,g.useContext)(bt)?.paintsShadow===!0,i=ai(e,t);if(i===null)return null;const{animated:l,activeIntro:c,animateTransitions:u}=n,h=l?{intro:c!==null,fadesIn:!a,transition:c?or(c,o):ar(u)}:null;return(0,s.jsx)(St,{symbol:r.get("symbol",e),cx:(0,d.toPercent)(i.x),cy:(0,d.toPercent)(i.y),size:r.get("size",e),fill:(0,d.toPaintColor)(r.get("fill",e)),fillOpacity:r.get("fillAlpha",e),opacity:r.get("alpha",e),stroke:r.get("stroke",e),strokeOpacity:r.get("strokeAlpha",e),strokeWidth:r.get("strokeWidth",e),style:U((0,d.readGeomEffects)(r,e)),motion:h})},ai=(e,t)=>{const r=(0,d.getX)(e),n=(0,d.getY)(e);return r===null||n===null?null:t(r,n)},ii=({layer:e,panelRect:t,styleReaders:r,project:n,symbols:o=[]})=>{const a=[],i=new Map,l=!r.varies("size")&&!r.varies("strokeWidth")?r.get("size")+r.get("strokeWidth"):void 0,c=r.varies("symbol")?void 0:r.get("symbol");for(const u of e.data){const h=ai(u,n);if(h===null)continue;const v=gt(h,t),f=l??r.get("size",u)+r.get("strokeWidth",u),m=c??r.get("symbol",u);if(m==="circle"||!(0,d.isGeometricSymbol)(m)||!o.includes(m)){a.push({center:v,size:f});continue}const p=`${m}:${f}`;i.set(p,(i.get(p)??"")+(0,d.buildPointSymbolPathAt)(m,f,v))}return[...[...i.values()].map(u=>({kind:"region",pathData:u})),...ha(a)]},fu=(0,g.memo)(function({layer:t,intro:r}){const n=B(t),o=hr(r?.type==="grow"&&r.growAxis==="size"?r:null);return(0,g.useMemo)(()=>{const a=o.activeIntro?(0,d.createStableKeyGenerator)(t.data,t.mapping,t.id):null,i=[];let l=0;for(const c of t.data)i.push((0,s.jsx)(oi,{project:me,observation:c,styleReaders:n,animation:o,introKey:a?.(c)},String(l++)));return i},[t.data,t.mapping,t.id,n,o])}),mo=({primary:e,companions:t})=>{const r=(0,s.jsxs)(s.Fragment,{children:[t.map(n=>(0,s.jsx)(Le,{hit:n,project:me},`companion-${n.layerId}-${n.pointIndex}`)),e?(0,s.jsx)(Qe,{hit:e,project:me}):null]});return e?(0,s.jsx)("g",{"data-testid":"hovered-point",children:r}):r},pu={geom:"point",coord:"cartesian",swatchShape:"circle",symbols:d.STYLE_POINT_SYMBOLS,render:({layer:e,intro:t})=>(0,s.jsx)(fu,{layer:e,intro:t}),renderHover:({primary:e,group:t,related:r})=>(0,s.jsx)(mo,{primary:e,companions:[...t,...r]}),renderHoverCompanions:({related:e})=>(0,s.jsx)(mo,{companions:e}),getEditOutlineShapes:e=>ii({...e,project:me}),getOverlayAnchor:({observation:e})=>{const t=(0,d.getX)(e),r=(0,d.getY)(e);return t===null||r===null?null:{x:t,y:r}}},nt="var(--graphy-editor-font-family, var(--graphy-font-family))",si=["canvasDefault","canvasBlue","canvasCyan","canvasGreen","canvasYellow","canvasOrange","canvasRed","canvasPink","canvasPurple","canvasGray","canvasInverse"],A={white:"var(--graphy-white)",black:"var(--graphy-black)",transparent:"var(--graphy-transparent)",gray100:"var(--graphy-gray-100)",gray95:"var(--graphy-gray-95)",gray90:"var(--graphy-gray-90)",gray85:"var(--graphy-gray-85)",gray80:"var(--graphy-gray-80)",gray75:"var(--graphy-gray-75)",gray70:"var(--graphy-gray-70)",gray60:"var(--graphy-gray-60)",gray50:"var(--graphy-gray-50)",gray0:"var(--graphy-gray-0)",grayGradient80:"var(--graphy-gray-gradient-80)",green60:"var(--graphy-green-60)",green50:"var(--graphy-green-50)",red60:"var(--graphy-red-60)",red50:"var(--graphy-red-50)",amber70:"var(--graphy-amber-70)",amber50:"var(--graphy-amber-50)",amber40:"var(--graphy-amber-40)",amber30:"var(--graphy-amber-30)",blue80:"var(--graphy-blue-80)",blue60:"var(--graphy-blue-60)",purple50:"var(--graphy-purple-50)",purple30:"var(--graphy-purple-30)",brand:"var(--graphy-brand)",success:"var(--graphy-success)",warning:"var(--graphy-warning)",alert:"var(--graphy-alert)",textPrimary:"var(--graphy-text-primary)",textSecondary:"var(--graphy-text-secondary)",textDisabled:"var(--graphy-text-disabled)",iconPrimary:"var(--graphy-icon-primary)",iconSecondary:"var(--graphy-icon-secondary)",iconStickerBackground:"var(--graphy-icon-sticker-background)",border100:"var(--graphy-border-100)",border50:"var(--graphy-border-50)",border10:"var(--graphy-border-10)",sunkenBackground:"var(--graphy-sunken-background)",defaultBackground:"var(--graphy-default-background)",raisedBackground:"var(--graphy-raised-background)",overlayBackground:"var(--graphy-overlay-background)",overlayBorderGradient:"var(--graphy-overlay-border-gradient)",graphBackground:"var(--graphy-graph-background)",editorDefaultAccent:"var(--graphy-editor-default-accent)",editorDefaultSurface:"var(--graphy-editor-default-surface)",editorDefaultText:"var(--graphy-editor-default-text)",editorDefaultShadow:"var(--graphy-editor-default-shadow)",editorControlHeight:"var(--graphy-editor-control-height)",canvasDefault:"var(--graphy-canvas-default)",canvasBlue:"var(--graphy-canvas-blue)",canvasCyan:"var(--graphy-canvas-cyan)",canvasGreen:"var(--graphy-canvas-green)",canvasYellow:"var(--graphy-canvas-yellow)",canvasOrange:"var(--graphy-canvas-orange)",canvasRed:"var(--graphy-canvas-red)",canvasPink:"var(--graphy-canvas-pink)",canvasPurple:"var(--graphy-canvas-purple)",canvasGray:"var(--graphy-canvas-gray)",canvasInverse:"var(--graphy-canvas-inverse)",elevationXs:"var(--graphy-elevation-xs)",elevationSm:"var(--graphy-elevation-sm)",elevationMd:"var(--graphy-elevation-md)",elevationLg:"var(--graphy-elevation-lg)",radiiXs:"var(--graphy-radii-xs)",radiiSm:"var(--graphy-radii-sm)",radiiMd:"var(--graphy-radii-md)",radiiLg:"var(--graphy-radii-lg)",spaceXxs:"var(--graphy-space-xxs)",spaceXs:"var(--graphy-space-xs)",spaceSm:"var(--graphy-space-sm)",spaceMd:"var(--graphy-space-md)",spaceLg:"var(--graphy-space-lg)",spaceXl:"var(--graphy-space-xl)",zIndexToolbar:"var(--graphy-z-index-toolbar)",zIndexToolbarTooltip:"var(--graphy-z-index-toolbar-tooltip)",zIndexToolbarPopover:"var(--graphy-z-index-toolbar-popover)",zIndexEditorPopover:"var(--graphy-z-index-editor-popover)",toolbarBackgroundColor:"var(--graphy-toolbar-background-color)",toolbarButtonBackgroundColor:"var(--graphy-toolbar-button-background-color)",toolbarButtonBackgroundColorHovered:"var(--graphy-toolbar-button-background-color-hovered)",toolbarButtonBackgroundColorSelected:"var(--graphy-toolbar-button-background-color-selected)",toolbarSeparatorColor:"var(--graphy-toolbar-separator-color)",fontFamily:"var(--graphy-font-family)",fontFamilyHeading:"var(--graphy-font-family-heading)",fontWeightRegular:"var(--graphy-font-weight-regular)",fontWeightMedium:"var(--graphy-font-weight-medium)",fontWeightSemibold:"var(--graphy-font-weight-semibold)",fontWeightBold:"var(--graphy-font-weight-bold)",fontWeightExtraBold:"var(--graphy-font-weight-extra-bold)",textScale:"var(--graphy-text-scale)",fontSizeXxs:"var(--graphy-font-size-xxs)",fontSizeXs:"var(--graphy-font-size-xs)",fontSizeSm:"var(--graphy-font-size-sm)",fontSizeMd:"var(--graphy-font-size-md)",fontSizeLg:"var(--graphy-font-size-lg)",fontSizeXl:"var(--graphy-font-size-xl)",fontLineHeightXxs:"var(--graphy-font-line-height-xxs)",fontLineHeightXs:"var(--graphy-font-line-height-xs)",fontLineHeightSm:"var(--graphy-font-line-height-sm)",fontLineHeightMd:"var(--graphy-font-line-height-md)",fontLineHeightLg:"var(--graphy-font-line-height-lg)",fontLineHeightXl:"var(--graphy-font-line-height-xl)",fontSizeEditorBody:"var(--graphy-font-size-editor-body)",fontSizeHeadingSm:"var(--graphy-font-size-heading-sm)",fontSizeHeadingMd:"var(--graphy-font-size-heading-md)",fontSizeHeadingLg:"var(--graphy-font-size-heading-lg)",fontLineHeightEditorBody:"var(--graphy-font-line-height-editor-body)",fontLineHeightHeadingSm:"var(--graphy-font-line-height-heading-sm)",fontLineHeightHeadingMd:"var(--graphy-font-line-height-heading-md)",fontLineHeightHeadingLg:"var(--graphy-font-line-height-heading-lg)",fontButton:"var(--graphy-font-button)",fontInput:"var(--graphy-font-input)",fontInputLabel:"var(--graphy-font-input-label)",fontSelectLabel:"var(--graphy-font-select-label)",fontSelectDescription:"var(--graphy-font-select-description)",fontColorSelectLabel:"var(--graphy-font-color-select-label)",fontMenuTitle:"var(--graphy-font-menu-title)",fontMenuGroupTitle:"var(--graphy-font-menu-group-title)",fontMenuItemLabel:"var(--graphy-font-menu-item-label)",fontMenuItemLabelSecondary:"var(--graphy-font-menu-item-label-secondary)",fontUITooltip:"var(--graphy-font-uitooltip)",fontUITooltipSecondary:"var(--graphy-font-uitooltip-secondary)",fontErrorBoundaryTitle:"var(--graphy-font-error-boundary-title)",fontErrorBoundaryMessage:"var(--graphy-font-error-boundary-message)",fontTableCell:"var(--graphy-font-table-cell)",fontTableHeaderCell:"var(--graphy-font-table-header-cell)",fontSourceLabel:"var(--graphy-font-source-label)",fontSourceLink:"var(--graphy-font-source-link)",fontTextEditorH1:"var(--graphy-font-text-editor-h1)",fontTextEditorH2:"var(--graphy-font-text-editor-h2)",fontTextEditorH3:"var(--graphy-font-text-editor-h3)",fontTextEditorH6:"var(--graphy-font-text-editor-h6)",fontTextEditorBody:"var(--graphy-font-text-editor-body)",fontTextEditorLink:"var(--graphy-font-text-editor-link)",fontHighlightModeTitle:"var(--graphy-font-highlight-mode-title)",fontHighlightModeSubtitle:"var(--graphy-font-highlight-mode-subtitle)",fontEditorControlLabel:"var(--graphy-font-editor-control-label)",fontEditorControlValue:"var(--graphy-font-editor-control-value)",fontEditorSectionTitle:"var(--graphy-font-editor-section-title)",fontEditorCaption:"var(--graphy-font-editor-caption)"},wt=`"Stack Sans Text", 'Inter', -apple-system, BlinkMacSystemFont, 'Open Sans', 'Segoe UI', 'Roboto', 'Oxygen-Sans', 'Ubuntu',
|
|
2
2
|
'Cantarell', 'Helvetica Neue', 'NotoSansArabic', 'NotoSansJP', 'NotoSansSC', 'NotoSansKR', 'NotoSerifKR', sans-serif, 'Apple Color Emoji', 'NotoColorEmoji'`,mu=wt,ot={regular:d.NAMED_WEIGHTS.regular,medium:d.NAMED_WEIGHTS.medium,semibold:d.NAMED_WEIGHTS.semiBold,bold:d.NAMED_WEIGHTS.bold,extraBold:d.NAMED_WEIGHTS.extraBold},ge={xxs:1,xs:1.1,sm:1.2,md:1.4,lg:1.6,xl:2,editorBody:1.5,headingSm:1.8,headingMd:2.2,headingLg:2.8},se={xxs:1,xs:1,sm:1.3,md:1.43,lg:1,xl:1,editorBody:1.47,headingSm:1.25,headingMd:1.41,headingLg:1.29},fe=e=>`${e}em`,li={textScale:"1",fontFamily:wt,fontFamilyHeading:mu,fontWeightRegular:ot.regular.toString(),fontWeightMedium:ot.medium.toString(),fontWeightSemibold:ot.semibold.toString(),fontWeightBold:ot.bold.toString(),fontWeightExtraBold:ot.extraBold.toString(),fontSizeXxs:fe(ge.xxs),fontSizeXs:fe(ge.xs),fontSizeSm:fe(ge.sm),fontSizeMd:fe(ge.md),fontSizeLg:fe(ge.lg),fontSizeXl:fe(ge.xl),fontLineHeightXxs:se.xxs.toString(),fontLineHeightXs:se.xs.toString(),fontLineHeightSm:se.sm.toString(),fontLineHeightMd:se.md.toString(),fontLineHeightLg:se.lg.toString(),fontLineHeightXl:se.xl.toString()},ci={fontSizeEditorBody:fe(ge.editorBody),fontSizeHeadingSm:fe(ge.headingSm),fontSizeHeadingMd:fe(ge.headingMd),fontSizeHeadingLg:fe(ge.headingLg),fontLineHeightEditorBody:se.editorBody.toString(),fontLineHeightHeadingSm:se.headingSm.toString(),fontLineHeightHeadingMd:se.headingMd.toString(),fontLineHeightHeadingLg:se.headingLg.toString()},M=(e,t,r,n=A.fontFamily)=>`${e} ${t}/${r} ${n}`,di={fontUITooltip:M(A.fontWeightMedium,A.fontSizeMd,A.fontLineHeightMd),fontUITooltipSecondary:M(A.fontWeightMedium,A.fontSizeSm,A.fontLineHeightSm,nt),fontButton:M(A.fontWeightMedium,A.fontSizeMd,A.fontLineHeightMd),fontInput:M(A.fontWeightMedium,A.fontSizeMd,A.fontLineHeightMd),fontInputLabel:M(A.fontWeightMedium,A.fontSizeXxs,A.fontLineHeightXxs),fontSelectLabel:M(A.fontWeightMedium,A.fontSizeMd,A.fontLineHeightMd),fontSelectDescription:M(A.fontWeightMedium,A.fontSizeSm,A.fontLineHeightSm),fontColorSelectLabel:M(A.fontWeightMedium,A.fontSizeSm,A.fontLineHeightSm),fontMenuTitle:M(A.fontWeightSemibold,A.fontSizeMd,A.fontLineHeightMd),fontMenuGroupTitle:M(A.fontWeightMedium,A.fontSizeSm,A.fontLineHeightSm),fontMenuItemLabel:M(A.fontWeightMedium,A.fontSizeMd,A.fontLineHeightMd),fontMenuItemLabelSecondary:M(A.fontWeightMedium,A.fontSizeSm,A.fontLineHeightSm),fontErrorBoundaryTitle:M(A.fontWeightSemibold,A.fontSizeHeadingSm,A.fontLineHeightHeadingSm),fontErrorBoundaryMessage:M(A.fontWeightMedium,A.fontSizeMd,A.fontLineHeightMd),fontTableCell:M(A.fontWeightMedium,A.fontSizeMd,A.fontLineHeightMd),fontTableHeaderCell:M(A.fontWeightSemibold,A.fontSizeSm,A.fontLineHeightSm),fontSourceLabel:M(A.fontWeightMedium,A.fontSizeSm,A.fontLineHeightSm),fontSourceLink:M(A.fontWeightRegular,A.fontSizeSm,A.fontLineHeightSm),fontTextEditorH1:M(A.fontWeightBold,A.fontSizeHeadingLg,A.fontLineHeightHeadingLg,A.fontFamilyHeading),fontTextEditorH2:M(A.fontWeightBold,A.fontSizeHeadingMd,A.fontLineHeightHeadingMd,A.fontFamilyHeading),fontTextEditorH3:M(A.fontWeightSemibold,A.fontSizeHeadingSm,A.fontLineHeightHeadingSm,A.fontFamilyHeading),fontTextEditorH6:M(A.fontWeightMedium,A.fontSizeSm,A.fontLineHeightSm),fontTextEditorBody:M(A.fontWeightMedium,A.fontSizeEditorBody,A.fontLineHeightEditorBody),fontTextEditorLink:M(A.fontWeightRegular,A.fontSizeMd,A.fontLineHeightMd),fontHighlightModeTitle:M(A.fontWeightBold,A.fontSizeMd,A.fontLineHeightMd),fontHighlightModeSubtitle:M(A.fontWeightMedium,A.fontSizeSm,A.fontLineHeightSm),fontEditorControlLabel:M(A.fontWeightMedium,A.fontSizeSm,A.fontLineHeightSm,nt),fontEditorControlValue:M(A.fontWeightMedium,A.fontSizeSm,A.fontLineHeightSm,nt),fontEditorSectionTitle:M(A.fontWeightSemibold,A.fontSizeSm,A.fontLineHeightSm,nt),fontEditorCaption:M(A.fontWeightMedium,A.fontSizeXxs,A.fontLineHeightXxs,nt)},xu=(e,t)=>({familyDefault:Cr(t)??Cr(e.fontFamily)??Cr(wt)??""}),Cr=e=>e===void 0||e.includes("var(")?null:e.replace(/\s+/g," ").trim(),Z=(e,t)=>`color-mix(in srgb, transparent, ${e} ${t*100}%)`,yu=(e,t)=>`hsl(from ${e} h s calc(l * ${1-t}))`,bu=(e,t)=>`hsl(from ${e} h s calc(l * ${1+t}))`,Au=(e,t,r)=>`color-mix(in srgb, ${e}, ${t} ${Math.round(r*1e4)/100}%)`,Su=e=>/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(e),Pu=e=>e.length===0?!1:typeof CSS<"u"&&typeof CSS.supports=="function"?CSS.supports("color",e):/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e),wu=e=>`${e}px`,ui={editorControlHeight:wu(32)},ct={editOutline:1,textToolbar:10,textToolbarTooltip:20,textToolbarPopover:30,legendPopover:40,editorOverlay:900,editorOverlayPopover:950,tooltip:1e3},hi={elevationXs:"0 0 2px rgba(15, 15, 24, 0.12), 0 2px 2px rgba(14, 14, 52, 0.08)",elevationSm:"0 0 4px rgba(15, 15, 24, 0.12), 0 4px 4px rgba(14, 14, 52, 0.08)",elevationMd:"0 0 8px rgba(15, 15, 24, 0.12), 0 8px 8px rgba(14, 14, 52, 0.08)",elevationLg:"0 0 16px rgba(15, 15, 24, 0.12), 0 16px 16px rgba(14, 14, 52, 0.08)"},vi={radiiXs:"4px",radiiSm:"6px",radiiMd:"8px",radiiLg:"12px"},gi={zIndexToolbar:`${ct.textToolbar}`,zIndexToolbarTooltip:`${ct.textToolbarTooltip}`,zIndexToolbarPopover:`${ct.textToolbarPopover}`,zIndexEditorPopover:`${ct.editorOverlayPopover}`},ju=8,De=e=>`${ju*e}px`,fi={spaceXxs:De(.25),spaceXs:De(.5),spaceSm:De(.75),spaceMd:De(1),spaceLg:De(1.5),spaceXl:De(2)},Eu={transparent:"transparent",white:"#FFFFFF",black:"#000000",gray100:"#000000",gray95:"#0D0D0D",gray90:"#1A1A1A",gray85:"#1F1F1F",gray80:"#2A2A2A",gray75:"#2e2e2e",gray70:"#353535",gray60:"#494949",gray50:"#6F6F6F",gray0:"#FFFFFF",red60:"#CB3333",red50:"#F93939",amber70:"#F48135",amber50:"#FEAE47",amber40:"#FFC849",amber30:"#ffd061",green60:"#0AC600",green50:"#42CD69",blue80:"#2E62FF",blue60:"#3D70FF",purple50:"#7B56EA",purple30:"#E093FE",grayGradient80:"linear-gradient(to top, #222429, #31353f)"},ku={textPrimary:A.gray0,textSecondary:Z(A.textPrimary,.8),textDisabled:Z(A.textPrimary,.5),iconPrimary:"currentColor",iconSecondary:Z(A.textPrimary,.6),iconStickerBackground:A.gray70,border100:A.gray0,border50:Z(A.gray0,.5),border10:Z(A.gray0,.1),brand:A.purple50,success:A.green50,warning:A.amber50,alert:A.red50,sunkenBackground:A.gray100,defaultBackground:A.gray90,raisedBackground:A.gray80,overlayBackground:A.gray90,overlayBorderGradient:A.grayGradient80},Cu={graphBackground:A.gray90,toolbarBackgroundColor:A.overlayBackground,toolbarButtonBackgroundColor:"transparent",toolbarButtonBackgroundColorHovered:A.gray80,toolbarButtonBackgroundColorSelected:A.gray60,toolbarSeparatorColor:A.gray60,editorDefaultAccent:"#ECE7DF",editorDefaultSurface:"#26241F",editorDefaultText:"#ECE7DF",editorDefaultShadow:`${A.elevationMd}, 0 16px 40px rgba(0, 0, 0, 0.45)`},Ru={canvasDefault:"#FFFFFF",canvasBlue:"#60a5fa",canvasCyan:"#22d3ee",canvasGreen:"#34d399",canvasYellow:"#FFC800",canvasOrange:"#fb923c",canvasRed:"#f87171",canvasPink:"#F979D9",canvasPurple:"#a78bfa",canvasGray:"#a8a29e",canvasInverse:"#000000"},Tu={...Eu,...ku,...hi,...vi,...fi,...gi,...Cu,...Ru,...ui,...li,...ci,...di},Lu={transparent:"transparent",white:"#FFFFFF",black:"#000000",gray100:"#FFFFFF",gray95:"#FCFCFC",gray90:"#FAFAFA",gray85:"#F5F5F5",gray80:"#F0F0F0",gray75:"#E8E8E8",gray70:"#E5E5E5",gray60:"#CCCCCC",gray50:"#C4C4C4",gray0:"#1D2129",red60:"#E14B49",red50:"#F93939",amber70:"#FFBA8C",amber50:"#FFC849",amber40:"#FEAE47",amber30:"#E7A816",green60:"#06B299",green50:"#42CD69",blue80:"#2E62FF",blue60:"#3D70FF",purple50:"#7B56EA",purple30:"#E093FE",grayGradient80:"linear-gradient(to top, #F0F0F1, #F9F9FF)"},Iu={textPrimary:A.black,textSecondary:Z(A.textPrimary,.6),textDisabled:Z(A.textPrimary,.5),iconPrimary:"currentColor",iconSecondary:Z(A.textPrimary,.6),iconStickerBackground:A.gray100,brand:A.purple50,success:A.green50,warning:A.amber50,alert:A.red50,border100:A.gray0,border50:Z(A.gray0,.5),border10:Z(A.gray0,.1),sunkenBackground:A.gray90,defaultBackground:A.gray100,raisedBackground:A.gray85,overlayBackground:A.gray100,overlayBorderGradient:A.border10},Ou={graphBackground:A.gray100,toolbarBackgroundColor:A.overlayBackground,toolbarButtonBackgroundColor:"transparent",toolbarButtonBackgroundColorHovered:A.gray80,toolbarButtonBackgroundColorSelected:A.gray60,toolbarSeparatorColor:A.gray60,editorDefaultAccent:"#3B372F",editorDefaultSurface:"#FFFFFF",editorDefaultText:"#3B372F",editorDefaultShadow:`${A.elevationMd}, 0 16px 40px rgba(20, 18, 15, 0.14)`},Mu={canvasDefault:"#000000",canvasBlue:"#3b82f6",canvasCyan:"#06b6d4",canvasGreen:"#10b981",canvasYellow:"#E5B400",canvasOrange:"#f97316",canvasRed:"#ef4444",canvasPink:"#E845BF",canvasPurple:"#8b5cf6",canvasGray:"#78716c",canvasInverse:"#ffffff"},Bu={...Lu,...Iu,...hi,...vi,...fi,...gi,...Ou,...Mu,...ui,...li,...ci,...di},gn=(e,t={})=>{const r={};for(const[n,o]of Object.entries(t))o!=null&&(r[n]=o);return{...e==="dark"?Tu:Bu,...r}},pi=(e,t={},r)=>({fonts:xu(gn(e,t),r)}),Gu=Object.freeze(pi("light")),mi=(0,g.createContext)(Gu),Nu=({metrics:e,children:t})=>(0,s.jsx)(mi.Provider,{value:e,children:t}),Ne=()=>(0,g.useContext)(mi),vr=({layerId:e,groupValue:t,fallback:r})=>{const{colorScheme:n}=W(),o=L(a=>e===void 0?void 0:(0,d.findLayerById)(a.layers,e));return(0,g.useMemo)(()=>o===void 0?r:(0,d.readGroupRuleColor)(o,t,n)??r,[n,r,t,o])},T=(e,...t)=>(0,g.useMemo)(()=>e(...t),[e,...t]),gr=({layerId:e,groupValue:t,size:r,groupAesthetic:n="color"})=>{const o=Te(),a=L(i=>e===void 0?void 0:(0,d.findLayerById)(i.layers,e));return(0,g.useMemo)(()=>{if(a===void 0)return{};const i=(0,d.readGroupObservation)(a,t,n),l=(0,d.resolveSwatchGeomPaint)(o,a,i,{width:r,height:r});return{alpha:l.alpha,fill:l.fill,cornerRadius:l.cornerRadiusPx,symbol:l.symbol}},[a,o,t,r,n])},Fu=/\p{Emoji_Presentation}|\p{Emoji}\uFE0F/gu,xi="😀",yi=class bi{constructor(){this.emojiCorrections=new Map,this.currentFont="";const t=new OffscreenCanvas(1,1).getContext("2d");if(!t)throw new Error("Failed to create OffscreenCanvas 2D context");this.ctx=t}static async create(){return typeof document<"u"&&"fonts"in document&&await document.fonts.ready,new bi}measureText(t,r){const n=(0,d.applyTextTransform)(t,r.textTransform),o=(0,d.buildFontString)(r);this.setFont(o);const{width:a,fontBoundingBoxAscent:i,fontBoundingBoxDescent:l}=this.ctx.measureText(n);let c=a+(0,d.computeLetterSpacingWidth)(n,r.letterSpacing);const u=Hu(n);if(u>0){const h=this.getEmojiCorrection(o);c-=h*u}return{width:c,height:i+l,ascent:i,descent:l}}setFont(t){this.currentFont!==t&&(this.ctx.font=t,this.currentFont=t)}getEmojiCorrection(t){const r=this.emojiCorrections.get(t);if(r!==void 0)return r;this.setFont(t);const n=this.ctx.measureText(xi).width,o=Du(t);let a=0;if(o!==null){const i=n-o;a=i>.5?i:0}return this.emojiCorrections.set(t,a),a}},be=null,Hu=e=>{const t=e.match(Fu);return t?t.length:0},Du=e=>{const t=Wu();return t?(t.style.font=e,t.getBoundingClientRect().width):null},Wu=()=>typeof document>"u"?null:(be||(be=document.createElement("span"),be.style.position="absolute",be.style.visibility="hidden",be.style.whiteSpace="nowrap",be.style.left="-9999px",be.textContent=xi,document.body.appendChild(be)),be),Ai=(0,g.createContext)(null),xo=3e3,Si=({children:e,measurer:t})=>{const[r,n]=(0,g.useState)(null);(0,g.useEffect)(()=>{if(t!==void 0)return;let a=!1;const i=()=>{a||n(zu())};if(!(typeof document<"u"&&"fonts"in document)){i();return}const l=setTimeout(()=>{a||(console.warn(`[graphy] FONT_READY_TIMEOUT: document.fonts.ready has not settled in ${xo}ms; painting with the fonts available so far.`),i())},xo),c=()=>{clearTimeout(l),i()};return document.fonts.ready.then(c,c),document.fonts.addEventListener("loadingdone",c),()=>{a=!0,clearTimeout(l),document.fonts.removeEventListener("loadingdone",c)}},[t]);const o=t??r;return o===null?null:(0,s.jsx)(Ai.Provider,{value:o,children:e})},je=()=>{const e=(0,g.useContext)(Ai);if(e===null)throw new Error("useTextMeasurer must be used inside a <TextMeasurerProvider>.");return e},zu=()=>{try{return new d.CachedTextMeasurer(new yi)}catch{return new d.CachedTextMeasurer(new d.HeuristicTextMeasurer)}},Pi=(0,g.createContext)(null),Vu=Pi.Provider,Uu=null,_=()=>(0,g.useContext)(Pi)??(Uu??=Sn()),Yu=11.7,Ku=.75,yo=21.6,Xu="0 0 10 18",Qu="M2.48935 16.9323L9.07098 9.82964C9.51595 9.34944 9.51504 8.60728 9.0689 8.12818L2.48866 1.06172C1.85811 0.384586 0.974477 0 0.049217 0H0V18H0.0443689C0.972463 18 1.85854 17.6131 2.48935 16.9323Z",qu="_16vokpr0",_u=(e,t)=>e.mapping.y!==void 0!=(t.mainAxis==="y"),Ju=(e,t)=>{const r=(0,d.toPercent)(t);return e?{x1:"0%",y1:r,x2:"100%",y2:r}:{x1:r,y1:"0%",x2:r,y2:"100%"}},Zu=(e,t,r,n)=>{const o=(0,d.toStrokeDasharray)(e,t),a={...r===void 0?{}:{strokeLinecap:r},...n===void 0?{}:{strokeLinejoin:n}};return o===void 0?a:{strokeDasharray:o,strokeLinecap:"round",...a,...(e[0]??0)>1?{strokeMiterlimit:16}:{}}},$u=(e,t)=>Wt(e)&&Wt(t)?`${e}: ${t}`:Wt(e)?e:Wt(t)?t:null,eh=e=>e?14:0,th=(e,t)=>e*Ku-eh(t)-10,rh=(e,t,r)=>{const n=e*r,o=-13-n,a=r+13-n-t;return a<o?o:Math.min(Math.max(-t/2,o),a)},Wt=e=>e!=null&&e.trim()!=="",wi=Object.freeze({}),fn=(0,g.createContext)(wi),nh=({slots:e,children:t})=>(0,s.jsx)(fn.Provider,{value:e??wi,children:t});function pe(e,t){const r=(0,g.useContext)(fn)[e];return r===void 0?t:typeof r=="object"&&ah(r)?r.render:r}function oh(){const e=(0,g.useContext)(fn);return{measureAxis:e.AxisTicks?.measure,measureAxisLabel:e.AxisLabel?.measure,measureLegend:e.Legend?.measure,measureHeadline:e.Headline?.measure.measureHeadline,measureHeadlineItemWidths:e.Headline?.measure.measureHeadlineItemWidths}}function ah(e){return"render"in e&&"measure"in e}var ih="_2qyyu60",sh=2,lh=12,ch=12,bo=1,Ao=2,dh=4,uh=3,hh=2,vh=new Set(["square","slice"]),So=.375,ji=1,jt=e=>(0,s.jsx)(pe("Swatch",Ei),{...e}),Ei=({shape:e,color:t,paint:r,lineType:n="solid",width:o=lh,height:a=ch,strokeWidth:i=sh,alpha:l,cornerRadius:c,symbol:u,mainAxis:h="x"})=>{const v=At(),f=ph(e,t,r,Math.min(o,a)),m=te({paints:[f]}),p=m.fillFor(f);return(0,s.jsxs)("svg",{className:ih,width:o,height:a,viewBox:`0 0 ${o} ${a}`,"aria-hidden":!0,"data-testid":"chart-swatch","data-shape":e,children:[m.defs,gh({shape:e,color:t,fill:p,lineType:n,width:o,height:a,strokeWidth:i,alpha:l,cornerRadius:c,symbol:u,glyphs:v,mainAxis:h})]})},gh=({shape:e,color:t,fill:r,lineType:n,width:o,height:a,strokeWidth:i,alpha:l,cornerRadius:c,symbol:u,glyphs:h,mainAxis:v})=>{const f=xh(n,o);switch(e){case"square":return(0,s.jsx)("rect",{x:1,y:1,width:o-2,height:a-2,rx:c??2,fill:r,opacity:l});case"line":return(0,s.jsx)("line",{x1:f.x1,y1:a/2,x2:f.x2,y2:a/2,stroke:t,strokeWidth:i,strokeLinecap:f.linecap,strokeDasharray:f.dashArray,opacity:l});case"circle":{const m=Math.max(0,(Math.min(o,a)-2)/2);if(u!==void 0&&u!=="circle"&&!(0,d.isGeometricSymbol)(u)){const p=Math.max(0,Math.min(o,a)-2);return(0,s.jsx)("g",{transform:`translate(${o/2} ${a/2})`,opacity:l,children:(0,s.jsx)(nr,{symbol:u,glyphs:h,size:p,fill:r})})}if((0,d.isGeometricSymbol)(u)&&u!=="circle"){const p=(0,d.buildPointSymbolInBox)(u,o-2,a-2);return(0,s.jsx)("path",{transform:`translate(${o/2+p.offsetX} ${a/2+p.offsetY})`,d:p.path,fill:r,opacity:l})}return(0,s.jsx)("circle",{cx:o/2,cy:a/2,r:m,fill:r,opacity:l})}case"area":{const m=a/2-1;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("rect",{x:1,y:m,width:o-2,height:a-m-1,fill:r,opacity:l??.45}),(0,s.jsx)("line",{x1:f.x1,y1:m,x2:f.x2,y2:m,stroke:t,strokeWidth:i,strokeLinecap:f.linecap,strokeDasharray:f.dashArray})]})}case"slice":return(0,s.jsx)("path",{d:`M 0 ${a} L ${o} ${a} A ${o} ${a} 0 0 0 0 0 Z`,fill:r,opacity:l});case"interval":return(0,s.jsx)("path",{d:fh(o,a,v),fill:"none",stroke:t,strokeWidth:ji,opacity:l});default:return e}},fh=(e,t,r)=>{const n=ji/2;if(r==="x"){const l=e/2,c=e*So,u=h=>`M ${l-c} ${h} H ${l+c}`;return`${u(n)} M ${l} ${n} V ${t-n} ${u(t-n)}`}const o=t/2,a=t*So,i=l=>`M ${l} ${o-a} V ${o+a}`;return`${i(n)} M ${n} ${o} H ${e-n} ${i(e-n)}`},ph=(e,t,r,n)=>r===void 0?t:vh.has(e)?mh(r,n):(0,d.toPaintColor)(r),mh=(e,t)=>{if(typeof e=="string"||!(0,d.isPatternPaint)(e))return e;const r=Math.max(hh,Math.floor(t/uh));return{...e,size:Math.min(e.size??8,r)}},xh=(e,t)=>e==="solid"?{x1:0,x2:t,dashArray:void 0,linecap:"round"}:e==="dashed"?{x1:0,x2:t,dashArray:`${(t-bo*(Ao-1))/Ao} ${bo}`,linecap:"butt"}:{x1:0,x2:t,dashArray:`1 ${t/(dh-1)}`,linecap:"round"},_e=(e,t=A.fontFamily)=>({fontFamily:e.fontFamily??t,fontSize:e.fontSize,fontWeight:e.fontWeight,...e.fontStyle===void 0?{}:{fontStyle:e.fontStyle},...e.letterSpacing===void 0?{}:{letterSpacing:`${e.letterSpacing}px`},...e.textDecoration===void 0?{}:{textDecoration:e.textDecoration}}),fr=e=>ki(e)?{stroke:e.textOutlineColor,strokeWidth:e.textOutlineWidth*2,strokeLinejoin:"round",paintOrder:"stroke"}:{},pn=e=>e.textShadow===void 0?{}:{textShadow:Zl(e.textShadow)},pr=e=>{const t=e.textShadow===void 0?void 0:Ge(e.textShadow);return t===void 0?{}:{filter:t}},mn=e=>ki(e)?{WebkitTextStroke:`${e.textOutlineWidth*2}px ${e.textOutlineColor}`,paintOrder:"stroke"}:{},We=e=>({..._e(e),lineHeight:e.lineHeight,color:e.textColor,...e.textTransform===void 0?{}:{textTransform:e.textTransform},...mn(e),...pn(e)}),X=e=>({..._e(e),lineHeight:e.lineHeight,color:e.textColor,...e.textTransform===void 0?{}:{textTransform:e.textTransform},...mn(e),...pn(e)}),yh=(e,t)=>(0,tr.assignInlineVars)({[e.fontFamily]:t.fontFamily??A.fontFamily,[e.fontSize]:`${t.fontSize}px`,[e.fontWeight]:String(t.fontWeight),[e.fontStyle]:t.fontStyle??"normal",[e.textTransform]:t.textTransform??"none",[e.textDecoration]:t.textDecoration??"none",[e.textShadow]:String(pn(t).textShadow??"none"),[e.textOutline]:String(mn(t).WebkitTextStroke??"0px transparent"),[e.letterSpacing]:t.letterSpacing===void 0?"normal":`${t.letterSpacing}px`,[e.lineHeight]:String(t.lineHeight),[e.textColor]:t.textColor}),ki=e=>e.textOutlineColor!==void 0&&e.textOutlineWidth!==void 0&&e.textOutlineWidth>0,bh=({labelPosition:e,linePosition:t,color:r,pillWidth:n,pillHeight:o,text:a})=>{const{animateTransitions:i}=q(),l=e==="start",c=l?-13:-(n-13),u=l?c+n-5:c+5-12,h=l?void 0:`rotate(180 ${u+12/2} ${o/2})`,v=l?"0%":"100%",f=(0,d.toPercent)(t),m=(0,s.jsxs)("g",{transform:`translate(0, ${-o/2})`,pointerEvents:"none",children:[(0,s.jsx)("rect",{x:c,y:0,width:n,height:o,rx:6,fill:r}),(0,s.jsx)("g",{transform:h,children:(0,s.jsx)("svg",{x:u,y:(o-yo)/2,width:12,height:yo,viewBox:Xu,overflow:"visible",children:(0,s.jsx)("path",{d:Qu,fill:r})})}),(0,s.jsx)("g",{transform:`translate(${c+5}, ${o/2})`,children:a})]});return i?(0,s.jsx)(R.motion.svg,{initial:!1,transition:ue,x:v,animate:{y:f},overflow:"visible",children:m}):(0,s.jsx)("svg",{x:v,y:f,overflow:"visible",children:m})},Ah=({labelPosition:e,linePosition:t,color:r,pillWidth:n,pillHeight:o,panelWidth:a,text:i})=>{const{animateTransitions:l}=q(),c=e==="start",u=c?-13:-(o-13),h=(0,d.toPercent)(t),v=c?"100%":"0%",f=(0,s.jsxs)("g",{transform:`translate(${rh(t,n,a)}, 0)`,pointerEvents:"none",children:[(0,s.jsx)("rect",{x:0,y:u,width:n,height:o,rx:6,fill:r}),(0,s.jsx)("g",{transform:`translate(5, ${u+o/2})`,children:i})]});return l?(0,s.jsx)(R.motion.svg,{initial:!1,transition:ue,y:v,animate:{x:h},overflow:"visible",children:f}):(0,s.jsx)("svg",{x:h,y:v,overflow:"visible",children:f})},Sh=({label:e,textStyle:t,textWidth:r,labelPosition:n,horizontal:o,position:a,color:i,textColor:l,symbolShape:c,symbolColor:u,symbolPaint:h,symbolAlpha:v,symbolCornerRadius:f,symbolGlyph:m,symbolMainAxis:p,panelWidth:x})=>{const y=c===null?0:14,b=r+y+10,S=Math.max(Yu,(0,d.computeLineBoxHeight)(t))+10,P=(0,s.jsxs)(s.Fragment,{children:[c!==null&&u!==null&&(0,s.jsx)("g",{transform:`translate(0, ${-10/2})`,children:(0,s.jsx)(jt,{shape:c,color:u,paint:h,surface:"ruleLabel",width:10,height:10,alpha:v,cornerRadius:f,symbol:m,mainAxis:p})}),(0,s.jsx)("text",{x:y,textAnchor:"start",dominantBaseline:"central",fill:l,style:{..._e(t),...pr(t)},...fr(t),children:(0,d.applyTextTransform)(e,t.textTransform)})]});return o?(0,s.jsx)(bh,{labelPosition:n,linePosition:a,color:i,pillWidth:b,pillHeight:S,text:P}):(0,s.jsx)(Ah,{labelPosition:n,linePosition:a,color:i,pillWidth:b,pillHeight:S,panelWidth:x,text:P})},Ph=({strokeWidth:e,dashArray:t,lineCap:r,lineJoin:n,horizontal:o,position:a,lineColor:i,effects:l})=>{const{animateTransitions:c}=q(),u=Ju(o,a),h=Zu(t,e,r,n);return c?(0,s.jsx)(R.motion.line,{initial:!1,transition:ue,animate:{x1:u.x1,y1:u.y1,x2:u.x2,y2:u.y2},...h,style:l,stroke:i,strokeWidth:e,vectorEffect:"non-scaling-stroke"}):(0,s.jsx)("line",{...u,...h,style:l,stroke:i,strokeWidth:e,vectorEffect:"non-scaling-stroke"})},wh=(0,g.memo)(function({layer:t,coordSystem:r,formattingLocale:n}){const{width:o}=ae(),a=je(),i=_(),{guides:l,numberFormat:c,specLayers:u,colorScale:h}=L((0,ee.useShallow)(D=>({guides:D.guides,numberFormat:D.config.numberFormat,specLayers:D.spec.layers,colorScale:D.scales.color}))),v=(0,g.useMemo)(()=>(0,d.buildAverageLineSymbols)(u,h).get(t.id)??null,[u,h,t.id]),f=v?i(v.geom,r.type)?.swatchShape??"square":null,m=gr({layerId:v?.layerId,groupValue:v?.groupValue,size:10}),p=vr({layerId:v?.layerId,groupValue:v?.groupValue,fallback:v?.color})??null,x=(0,g.useMemo)(()=>$u(t.params.label,(0,d.formatRuleValue)({guides:l,numberFormat:c,layer:t,locale:n})),[l,c,n,t]),{fonts:y}=Ne(),b=O(),S=T(d.resolveRuleLabelStyle,b.geom.rule.label(t),b.graph()),P=(0,g.useMemo)(()=>(0,d.toFontSpec)(S,y.familyDefault),[S,y.familyDefault]),w=(0,g.useMemo)(()=>x===null?null:(0,d.truncateToWidth)(x,th(o,f!==null),D=>a.measureText(D,P).width),[x,o,f,P,a]),j=(0,g.useMemo)(()=>w===null?0:a.measureText(w,P).width,[w,P,a]),C=B(t),k=t.data.getFirst();if(!k)return null;const E=C.get("stroke",k),I=jh(S,E),G=_u(t,r),z=G?(0,d.getY)(k):(0,d.getX)(k);return z===null?null:(0,s.jsxs)("g",{"data-geom":"rule",className:qu,children:[(0,s.jsx)(Ph,{strokeWidth:C.get("strokeWidth",k),dashArray:C.get("dashArray",k),lineCap:C.get("lineCap",k),lineJoin:C.get("lineJoin",k),horizontal:G,position:z,lineColor:E,effects:U((0,d.readGeomEffects)(C,k))}),w!==null&&w!==""&&(0,s.jsx)(Sh,{label:w,textStyle:S,textWidth:j,labelPosition:t.params.labelPosition,horizontal:G,position:z,color:E,textColor:I,symbolShape:f,symbolColor:p,symbolPaint:m.fill,symbolAlpha:m.alpha,symbolCornerRadius:m.cornerRadius,symbolGlyph:m.symbol,symbolMainAxis:(0,d.readMainAxis)(r),panelWidth:o})]})}),jh=(e,t)=>e.textColor===void 0?(0,d.pickReadableTextColor)(t):e.hasThemedTextColor?(0,d.ensureReadableTextColor)(e.textColor,t):e.textColor,Eh={geom:"rule",coord:"cartesian",render:({layer:e,coordSystem:t,formattingLocale:r})=>(0,s.jsx)(wh,{layer:e,coordSystem:t,formattingLocale:r})},xn=(e,t,r)=>(0,d.resolveGeomCornerRadiusPx)({cornerRadius:(0,d.foldGeomCornerRadii)(e)??d.DEFAULT_TILE_CORNER_RADIUS_PX,box:(0,d.scaleRectToPanel)(t,r)}),kh=({layer:e,panelRect:t,styleReaders:r,animateTransitions:n})=>{let o="";for(const a of e.data){const i=(0,d.getPaintedTileRect)(a);i!==null&&(o+=Ua((0,d.scaleRectToPanel)(i,t),xn(r.get("cornerRadius",a),i,t)))}return o===""?[]:[{kind:"region",pathData:o,animateTransitions:n}]},Ci=({intro:e,children:t})=>(0,g.useContext)(bt)?.fading?t:(0,s.jsx)(R.motion.g,{initial:{opacity:0},animate:{opacity:1},transition:xa(e),children:t}),Ch=(0,g.memo)(function({layer:t,intro:r}){const n=ae(),{animateTransitions:o}=q(),a=r?.type==="fade"?r:null,i=B(t),{paints:l,paintAt:c}=Pt(t,i),{fillFor:u,defs:h}=te({paints:l}),v=(0,g.useMemo)(()=>{const f=(0,d.createStableCellKeyGenerator)(t.data,t.mapping,t.id),m=[];let p=-1;for(const x of t.data){p+=1;const y=(0,d.getPaintedTileRect)(x);y&&m.push({key:f(x),...y,fill:u(c(p)),opacity:i.get("alpha",x)*i.get("fillAlpha",x),rx:xn(i.get("cornerRadius",x),y,n),stroke:i.get("stroke",x),strokeWidth:i.get("strokeWidth",x),effects:U((0,d.readGeomEffects)(i,x))})}return m.map(({key:x,...y})=>(0,s.jsx)(Rh,{...y,animated:o},x))},[t,n,i,o,u,c]);return a?(0,s.jsxs)(Ci,{intro:a,children:[h,v]}):(0,s.jsxs)(s.Fragment,{children:[h,v]})}),Rh=({animated:e,...t})=>e?(0,s.jsx)(R.motion.rect,{initial:!1,style:t.effects,transition:ue,fill:t.fill,opacity:t.opacity,rx:t.rx,stroke:t.stroke,strokeWidth:t.strokeWidth,animate:{attrX:(0,d.toPercent)(t.x),attrY:(0,d.toPercent)(t.y),width:(0,d.toPercent)(t.width),height:(0,d.toPercent)(t.height)}}):(0,s.jsx)("rect",{style:t.effects,x:(0,d.toPercent)(t.x),y:(0,d.toPercent)(t.y),width:(0,d.toPercent)(t.width),height:(0,d.toPercent)(t.height),fill:t.fill,opacity:t.opacity,rx:t.rx,stroke:t.stroke,strokeWidth:t.strokeWidth}),Th=({layer:e,primary:t})=>{const r=ae(),n=B(e),o=n.get("fill",t.observation),{fillFor:a,defs:i}=te({paints:[o]}),l=(0,d.getPaintedTileRect)(t.observation);if(!l)return null;const c=a(o),u=n.get("alpha",t.observation)*n.get("fillAlpha",t.observation),h=n.get("stroke",t.observation,"hovered")??d.DEFAULT_HOVER_STROKE_COLOR,v=n.get("strokeWidth",t.observation,"hovered"),f=xn(n.get("cornerRadius",t.observation,"hovered"),l,r),m=l.x*r.width,p=l.y*r.height,x=l.width*r.width,y=l.height*r.height;return(0,s.jsxs)("g",{"data-testid":"hovered-tile",children:[i,(0,s.jsx)("rect",{x:m-v,y:p-v,width:x+v*2,height:y+v*2,rx:f+v,fill:h,"data-testid":"hovered-tile-border"}),(0,s.jsx)("rect",{x:(0,d.toPercent)(l.x),y:(0,d.toPercent)(l.y),width:(0,d.toPercent)(l.width),height:(0,d.toPercent)(l.height),rx:f,fill:c,opacity:u,"data-testid":"hovered-tile-fill"})]})},Lh={geom:"tile",coord:"cartesian",swatchShape:"square",guideMode:null,render:({layer:e,intro:t})=>(0,s.jsx)(Ch,{layer:e,intro:t}),renderHover:({layer:e,primary:t})=>(0,s.jsx)(Th,{layer:e,primary:t}),getEditOutlineShapes:kh},_t=({primary:e,companions:t})=>{const r=(0,s.jsxs)(s.Fragment,{children:[t.map(n=>(0,s.jsx)(Le,{hit:n,project:ce},`companion-${n.layerId}-${n.pointIndex}`)),e?(0,s.jsx)(Qe,{hit:e,project:ce}):null]});return e?(0,s.jsx)("g",{"data-testid":"hovered-point",children:r}):r},Ri=e=>{const t=Ke(e);return{origin:{x:t.centerX,y:t.centerY},scaleX:t.radius,scaleY:t.radius}},Ih=e=>({...Ke(e),digits:2}),Ti=(e,t,r)=>de(e,t,Ke(r)),Wr=e=>{const[t,...r]=e;if(!t)return"";const n=r.map(o=>`L ${o.x} ${o.y}`).join(" ");return`M ${t.x} ${t.y} ${n} Z`},Oh=(0,g.memo)(function({layer:t}){const r=ae(),n=B(t),o=(0,g.useMemo)(()=>{const l=(0,d.createStableKeyGenerator)(t.data,t.mapping,t.id),c=[];return t.data.groupBy(d.GROUP_VARIABLES.group).forEach(u=>{const h=[...u],v=Li(h);if(!v)return;const f=h[0];if(!f)return;const m=n.get("fill",f);c.push({key:l(f),fillPath:v.fillPath,outlinePath:v.outlinePath,paint:m,stroke:n.get("stroke",f)??(0,d.toPaintColor)(m),fillOpacity:n.get("fillAlpha",f)*n.get("alpha",f),strokeOpacity:n.get("strokeAlpha",f)*n.get("alpha",f),...we(n.get("dashArray",f),n.get("strokeWidth",f))})}),c},[t.data,t.id,t.mapping,n]),{fillFor:a,defs:i}=te({paints:(0,g.useMemo)(()=>o.map(l=>l.paint),[o]),unitsPerPixel:xt(r)});return(0,s.jsxs)(xe,{viewBox:"-1 -1 2 2",preserveAspectRatio:"xMidYMid meet",width:"100%",height:"100%","data-geom":"area",effects:U((0,d.readGeomEffects)(n,t.data.getFirst()??void 0)),className:ve,children:[i,o.map(l=>(0,s.jsxs)("g",{children:[(0,s.jsx)("path",{d:l.fillPath,fill:a(l.paint),fillOpacity:l.fillOpacity,fillRule:"evenodd"}),(0,s.jsx)("path",{d:l.outlinePath,fill:"none",stroke:l.stroke,strokeWidth:l.strokeWidth,strokeDasharray:l.strokeDasharray,strokeLinecap:l.strokeLinecap,opacity:l.strokeOpacity,vectorEffect:"non-scaling-stroke"})]},l.key))]})}),Li=e=>{const t=Ii(e);if(t===null)return null;const r=Wr(t.outer);return{fillPath:t.hole===null?r:`${r} ${Wr(t.hole)}`,outlinePath:r}},Ii=e=>{const t=[];for(const o of e){const a=(0,d.getX)(o),i=(0,d.getYTip)(o),l=(0,d.getBase)(o,"y");a===null||l===null||i===null||t.push({angle:a,outer:de(a,i),inner:de(a,l)})}if(t.length===0)return null;t.sort((o,a)=>o.angle-a.angle);const r=t.map(o=>o.outer),n=t.map(o=>o.inner);return{outer:r,hole:n.some(o=>o.x!==0||o.y!==0)?[...n].reverse():null}},Mh=({layer:e,panelRect:t})=>{const r=Ri(t),n=[],o=[];return e.data.groupBy(d.GROUP_VARIABLES.group).forEach(a=>{const i=[...a],[l]=i;if(l===void 0)return;if(i.length===1){const h=(0,d.getX)(l),v=(0,d.getYTip)(l);h!==null&&v!==null&&o.push(Ti(h,v,t));return}const c=Ii(i);if(c===null)return;const u=c.hole===null?"":Br(c.hole,r);n.push({kind:"region",key:String((0,d.getGroup)(l)),pathData:Br(c.outer,r)+u,fillRule:"evenodd"})}),o.length>0&&n.push({kind:"dots",centers:o,size:d.DEFAULT_POINT_SIZE_PX}),n},Bh=({layer:e,primary:t,companions:r})=>{const n=ae(),o=B(e),a=(0,d.getGroup)(t.observation),i=o.get("fill",t.observation,"hovered"),{fillFor:l,defs:c}=te({paints:[i],unitsPerPixel:xt(n)}),u=(0,g.useMemo)(()=>Li([...e.data.filter(d.GROUP_VARIABLES.group,"eq",a)]),[e.data,a]);if(!u)return null;const h=o.get("stroke",t.observation,"hovered")??(0,d.toPaintColor)(i),v=o.get("alpha",t.observation,"hovered"),f=o.get("fillAlpha",t.observation,"hovered")*v,m=o.get("strokeAlpha",t.observation,"hovered")*v,{strokeWidth:p,strokeDasharray:x,strokeLinecap:y}=we(o.get("dashArray",t.observation,"hovered"),o.get("strokeWidth",t.observation,"hovered"));return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(xe,{viewBox:"-1 -1 2 2",preserveAspectRatio:"xMidYMid meet",width:"100%",height:"100%","data-geom":"area","data-testid":"hovered-area",effects:U((0,d.readGeomEffects)(o,t.observation,"hovered")),className:ve,children:[c,(0,s.jsx)("path",{d:u.fillPath,fill:l(i),fillOpacity:f,fillRule:"evenodd",className:ma,"data-testid":"hovered-area-fill"}),(0,s.jsx)("path",{d:u.outlinePath,fill:"none",stroke:h,strokeWidth:p,strokeDasharray:x,strokeLinecap:y,opacity:m,vectorEffect:"non-scaling-stroke","data-testid":"hovered-area-edge"})]}),r.map(b=>(0,s.jsx)(Le,{hit:b,project:ce},`companion-${b.layerId}-${b.pointIndex}`)),(0,s.jsx)(Qe,{hit:t,project:ce,"data-testid":"hovered-area-point"})]})},Gh={geom:"area",coord:"polar",swatchShape:"area",guideMode:"crosshair",render:({layer:e})=>(0,s.jsx)(Oh,{layer:e}),renderHover:({layer:e,primary:t,group:r,related:n})=>(0,s.jsx)(Bh,{layer:e,primary:t,companions:[...r,...n]}),renderHoverCompanions:({related:e})=>(0,s.jsx)(_t,{companions:e}),getEditOutlineShapes:Mh,getOverlayAnchor:({observation:e})=>{const t=(0,d.getX)(e),r=(0,d.getYTip)(e);return t===null||r===null?null:ce(t,r)}},yn=e=>{const{startAngle:t,endAngle:r}=(0,d.getAngleExtent)(e),{innerRadius:n,outerRadius:o}=(0,d.getRadiusExtent)(e);return t===null||r===null||n===null||o===null?null:{startAngle:t,endAngle:r,innerRadius:n,outerRadius:o}},Oi=(e,t,r,n)=>{const{bandAxis:o}=t,a=(0,d.resolvePolarBarBaseline)(e,t),i=new Map;let l=-1;for(const u of e.data){l+=1;const h=yn(u);if(h===null)continue;const v=(0,d.buildSliceGroupKey)(o,h),f=n(u,h,l),m=i.get(v);m===void 0?i.set(v,{firstObservation:u,members:[f]}):m.members.push(f)}const c=new Map;for(const[u,{firstObservation:h,members:v}]of i){const f=(0,d.getUnionExtent)(v),m=cr(r,h);c.set(u,{style:m,union:f,corners:(0,d.resolvePolarStackCorners)(m.cornerRadius,f,(0,d.findPolarBarBaseEdge)(f,a)),members:v})}return c},bn=(e,t,r)=>{const n=Oi(e,t,r,(a,i)=>i),o=new Map;for(const[a,{style:i,union:l,corners:c}]of n)o.set(a,{style:i,union:l,corners:c});return{groups:o,baseline:(0,d.resolvePolarBarBaseline)(e,t)}},Nh=({groups:e,baseline:t},r,n,o,a)=>{const i=e.get((0,d.buildSliceGroupKey)(r,a));if(i!==void 0)return i;const l=(0,d.getUnionExtent)([a]),c=cr(n,o);return{style:c,union:l,corners:(0,d.resolvePolarStackCorners)(c.cornerRadius,l,(0,d.findPolarBarBaseEdge)(l,t))}},Mi=(e,t,r,n)=>(0,d.buildPolarBarArcPath)({...t.union,cornerRadius:t.corners,slice:r==="x"?{axis:"radius",from:e.innerRadius,to:e.outerRadius}:{axis:"angle",from:e.startAngle,to:e.endAngle}},n),Fh=lr(bn),Hh=({layer:e,sourceLayer:t,coordSystem:r,panelRect:n,styleReaders:o,animateTransitions:a})=>{const{bandAxis:i}=r,{groups:l}=Fh(t,r,o),c=Ih(n);let u="";for(const h of e.data){const v=yn(h);if(v===null)continue;const f=l.get((0,d.buildSliceGroupKey)(i,v));f!==void 0&&(u+=Mi(v,f,i,c)??"")}return u===""?[]:[{kind:"region",pathData:u,animateTransitions:a}]},Po=Math.PI*2,Jt=(e,t)=>({stroke:e,strokeWidth:t,vectorEffect:"non-scaling-stroke"}),Dh=(0,g.memo)(function({layer:t,coordSystem:r,intro:n}){const o=ae(),a=(0,g.useId)(),i=hr(n?.type==="grow"&&(n.growAxis==="angle"||n.growAxis==="radius")?n:null),l=r.bandAxis!=="x",c=B(t),{paints:u,paintAt:h}=Pt(t,c),{fillFor:v,defs:f}=te({paints:u,unitsPerPixel:xt(o)}),m=(0,g.useMemo)(()=>{const x=(0,d.createStableKeyGenerator)(t.data,t.mapping,t.id);return[...Oi(t,r,c,(y,b,S)=>({key:x(y),...b,fill:v(h(S)),opacity:yt(c,y)})).values()].map((y,b)=>({...y,key:y.members[0]?.key??String(b)}))},[t,r,c,v,h]),p=(0,g.useMemo)(()=>m.map((x,y)=>{const{stroke:b,strokeWidth:S,strokeAlpha:P}=x.style,w=b!==void 0,j=(0,d.resolveBarBorderTreatment)(S),C=b===void 0?{}:Jt(b,j.separatorWidth),k=b===void 0?void 0:Jt(b,j.outlineWidth),E=x.members.map(D=>{const{key:Y,...H}=D;return i.animated?(0,s.jsx)(Wh,{...H,animation:i,sweepsInOnLateMount:l,introKey:Y,pathProps:{fill:H.fill,opacity:H.opacity,...C}},Y):(0,s.jsx)("path",{d:(0,d.buildPolarBarArcPath)(H)??void 0,fill:H.fill,opacity:H.opacity,...C},Y)}),I=Object.values(x.corners).some(D=>D>0);if(!w&&!I)return(0,s.jsx)(g.Fragment,{children:E},x.key);const G=`${a}${y}`;if(i.animated)return(0,s.jsx)("g",{clipPath:`url(#${G})`,children:(0,s.jsx)(zh,{...x.union,corners:x.corners,animation:i,sweepsInOnLateMount:l,introKey:x.members[0]?.key,clipId:G,outlineProps:k,outlineOpacity:P,children:E})},x.key);const z=(0,d.buildPolarBarArcPath)({...x.union,cornerRadius:x.corners});return(0,s.jsxs)("g",{clipPath:`url(#${G})`,children:[(0,s.jsx)("clipPath",{id:G,children:(0,s.jsx)("path",{d:z})}),E,k!==void 0&&(0,s.jsx)("path",{d:z,fill:"none",opacity:P,...k})]},x.key)}),[i,a,m,l]);return(0,s.jsxs)(xe,{viewBox:"-1 -1 2 2",preserveAspectRatio:"xMidYMid meet",width:"100%",height:"100%","data-geom":"bar",effects:U((0,d.readGeomEffects)(c,t.data.getFirst()??void 0)),className:ve,children:[f,p]})}),Bi=({startAngle:e,endAngle:t,innerRadius:r,outerRadius:n,corners:o,animation:a,sweepsInOnLateMount:i,introKey:l})=>{const c=a.activeIntro?.growAxis==="angle"?a.activeIntro:null,u=a.activeIntro?.growAxis==="radius"?a.activeIntro:null,h=i&&!a.mounting,v=c?.baseline??(h?Po:e),f=c?.baseline??(h?Po:t),m=u?u.baseline:r,p=u?u.baseline:n,x=(0,R.useMotionValue)(v),y=(0,R.useMotionValue)(f),b=(0,R.useMotionValue)(m),S=(0,R.useMotionValue)(p),P=(0,R.useMotionValue)((0,d.buildPolarBarArcPath)({startAngle:v,endAngle:f,innerRadius:m,outerRadius:p,cornerRadius:o})??""),w=Nr(a,l,c);(0,g.useEffect)(()=>{const C=w(),k=[(0,R.animate)(x,e,C),(0,R.animate)(y,t,C)];return()=>{for(const E of k)E.stop()}},[x,y,e,t,w]);const j=Nr(a,l,u);return(0,g.useEffect)(()=>{const C=j(),k=[(0,R.animate)(b,r,C),(0,R.animate)(S,n,C)];return()=>{for(const E of k)E.stop()}},[b,S,r,n,j]),(0,g.useEffect)(()=>{const C=()=>{P.set((0,d.buildPolarBarArcPath)({startAngle:x.get(),endAngle:y.get(),innerRadius:b.get(),outerRadius:S.get(),cornerRadius:o})??"")};C();const k=[x,y,b,S].map(E=>E.on("change",C));return()=>{for(const E of k)E()}},[x,y,b,S,o,P]),P},Wh=({pathProps:e,...t})=>{const r=Bi(t);return(0,s.jsx)(R.motion.path,{d:r,transition:ue,...e})},zh=({clipId:e,outlineProps:t,outlineOpacity:r,children:n,...o})=>{const a=Bi(o);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("clipPath",{id:e,children:(0,s.jsx)(R.motion.path,{d:a})}),n,t!==void 0&&(0,s.jsx)(R.motion.path,{d:a,fill:"none",opacity:r,transition:ue,...t})]})},Vh=(e,t,r,n)=>{const o=e==="solo"||e==="base",a=e==="solo"||e==="tip",[i,l]=n?[o,a]:[a,o],c=!(0,d.isFullTurnSweep)(r.startAngle,r.endAngle);return t==="x"?{innerArc:i,outerArc:l,startSpoke:c,endSpoke:c}:{innerArc:!0,outerArc:!0,startSpoke:i&&c,endSpoke:l&&c}},Gi=({observation:e,bandAxis:t,styleReaders:r,groupPaints:n,state:o,fill:a})=>{const i=(0,g.useId)(),l=yn(e);if(l===null)return null;const c=Nh(n,t,r,e,l),u=Mi(l,c,t);if(u===void 0)return null;const h=yt(r,e,o),{stroke:v,strokeWidth:f,strokeAlpha:m}=c.style;if(v===void 0)return(0,s.jsx)("path",{d:u,fill:a,opacity:h,"data-testid":"arc-segment"});const p=(0,d.resolveBarBorderTreatment)(f),x=(0,d.readTipEdge)(e,t==="x"?"x":"y"),y=x==="top"||x==="right",b=Vh((0,d.getStackRole)(e),t,c.union,y),S=Yh(l,Kh(b)),P=(0,d.buildPolarBarArcPath)({...c.union,cornerRadius:c.corners});return(0,s.jsxs)("g",{clipPath:`url(#${i})`,"data-testid":"arc-segment",children:[(0,s.jsx)("clipPath",{id:i,children:(0,s.jsx)("path",{d:u})}),(0,s.jsx)("path",{d:u,fill:a,opacity:h}),S!==""&&(0,s.jsx)("path",{d:S,fill:"none",opacity:h,...Jt(v,p.separatorWidth)}),(0,s.jsx)("path",{d:P,fill:"none",opacity:m,...Jt(v,p.outlineWidth)})]})},Uh=({layer:e,sourceLayer:t,coordSystem:r})=>{const n=ae(),o=B(t),a=(0,g.useMemo)(()=>bn(t,r,o),[t,r,o]),{paints:i,paintAt:l}=Pt(e,o),{fillFor:c,defs:u}=te({paints:i,unitsPerPixel:xt(n)}),{bandAxis:h}=r,v=(0,g.useMemo)(()=>{const f=(0,d.createStableKeyGenerator)(e.data,e.mapping,e.id),m=[];let p=-1;for(const x of e.data)p+=1,m.push((0,s.jsx)(Gi,{observation:x,bandAxis:h,styleReaders:o,groupPaints:a,fill:c(l(p))},f(x)));return m},[h,c,a,e,l,o]);return(0,s.jsxs)("svg",{viewBox:"-1 -1 2 2",preserveAspectRatio:"xMidYMid meet",width:"100%",height:"100%","data-geom":"bar",className:ve,children:[u,v]})},vt=(e,t)=>{const r=de(t,e);return`${r.x},${r.y}`},wo=(e,t,r)=>{if(e<=0)return"";const n=vt(e,t);if((0,d.isFullTurnSweep)(t,r))return`M${n}A${e},${e} 0 1 1 ${vt(e,t+Math.PI)}A${e},${e} 0 1 1 ${n}`;const o=r-t;return`M${n}A${e},${e} 0 ${Math.abs(o)>Math.PI?1:0} ${o>=0?1:0} ${vt(e,r)}`},jo=(e,t,r)=>`M${vt(t,e)}L${vt(r,e)}`,Yh=(e,t)=>{const{startAngle:r,endAngle:n,innerRadius:o,outerRadius:a}=e,i=(0,d.isFullTurnSweep)(r,n);return[t.innerArc?wo(o,r,n):"",t.outerArc?wo(a,r,n):"",t.startSpoke&&!i?jo(r,o,a):"",t.endSpoke&&!i?jo(n,o,a):""].filter(Boolean).join("")},Kh=e=>({innerArc:!e.innerArc,outerArc:!e.outerArc,startSpoke:!e.startSpoke,endSpoke:!e.endSpoke}),Xh=({layer:e,coordSystem:t,primary:r})=>{const n=ae(),o=B(e),a=(0,g.useMemo)(()=>bn(e,t,o),[e,t,o]),i=o.get("fill",r.observation,"hovered"),{fillFor:l,defs:c}=te({paints:[i],unitsPerPixel:xt(n)});return(0,s.jsxs)(xe,{viewBox:"-1 -1 2 2",preserveAspectRatio:"xMidYMid meet",width:"100%",height:"100%","data-geom":"arc","data-testid":"hovered-arc",effects:U((0,d.readGeomEffects)(o,r.observation,"hovered")),className:ve,children:[c,(0,s.jsx)(Gi,{observation:r.observation,bandAxis:t.bandAxis,styleReaders:o,groupPaints:a,state:"hovered",fill:l(i)})]})},Qh={geom:"bar",coord:"polar",swatchShape:"slice",guideMode:"band",render:({layer:e,coordSystem:t,intro:r})=>(0,s.jsx)(Dh,{layer:e,coordSystem:t,intro:r}),renderHighlight:({layer:e,sourceLayer:t,coordSystem:r})=>(0,s.jsx)(Uh,{layer:e,sourceLayer:t,coordSystem:r}),renderHover:({layer:e,coordSystem:t,primary:r})=>(0,s.jsx)(Xh,{layer:e,coordSystem:t,primary:r}),getEditOutlineShapes:Hh},qh=(0,g.memo)(function({layer:t}){const r=B(t),n=(0,g.useMemo)(()=>{const o=(0,d.createStableKeyGenerator)(t.data,t.mapping,t.id),a=[];return t.data.groupBy(d.GROUP_VARIABLES.group).forEach(i=>{const l=[...i],c=Ni(l);if(!c)return;const u=l[0];u&&a.push({key:o(u),pathData:c,color:r.get("stroke",u),opacity:r.get("alpha",u),strokeOpacity:r.get("strokeAlpha",u),lineJoin:r.get("lineJoin",u),...we(r.get("dashArray",u),r.get("strokeWidth",u),r.get("lineCap",u))})}),a},[t.data,t.id,t.mapping,r]);return(0,s.jsx)(xe,{viewBox:"-1 -1 2 2",preserveAspectRatio:"xMidYMid meet",width:"100%",height:"100%","data-geom":"line",effects:U((0,d.readGeomEffects)(r,t.data.getFirst()??void 0)),className:ve,children:n.map(o=>(0,s.jsx)("path",{d:o.pathData,fill:"none",stroke:o.color,strokeWidth:o.strokeWidth,opacity:o.opacity,strokeOpacity:o.strokeOpacity,strokeDasharray:o.strokeDasharray,strokeLinecap:o.strokeLinecap,strokeLinejoin:o.lineJoin,vectorEffect:"non-scaling-stroke"},o.key))})}),Ni=e=>{const t=Fi(e);return t.length===0?null:Wr(t)},Fi=e=>{const t=[];for(const r of e){const n=(0,d.getX)(r),o=(0,d.getY)(r);n===null||o===null||t.push({angle:n,point:de(n,o)})}return t.sort((r,n)=>r.angle-n.angle),t.map(r=>r.point)},_h=({layer:e,panelRect:t,styleReaders:r})=>{const n=Ri(t),o=[],a=[];return e.data.groupBy(d.GROUP_VARIABLES.group).forEach(i=>{const l=[...i],[c]=l;if(c===void 0)return;if(l.length===1){const h=(0,d.getX)(c),v=(0,d.getY)(c);h!==null&&v!==null&&a.push(Ti(h,v,t));return}const u=Br(Fi(l),n);u!==""&&o.push({kind:"stroke",key:String((0,d.getGroup)(c)),pathData:u,width:r.get("strokeWidth",c)})}),a.length>0&&o.push({kind:"dots",centers:a,size:d.DEFAULT_POINT_SIZE_PX}),o},Jh=({layer:e,primary:t,companions:r})=>{const n=B(e),o=(0,d.getGroup)(t.observation),a=(0,g.useMemo)(()=>Ni([...e.data.filter(d.GROUP_VARIABLES.group,"eq",o)]),[e.data,o]);if(!a)return null;const i=n.get("stroke",t.observation,"hovered"),l=n.get("alpha",t.observation,"hovered"),c=n.get("strokeAlpha",t.observation,"hovered"),{strokeWidth:u,strokeDasharray:h,strokeLinecap:v}=we(n.get("dashArray",t.observation,"hovered"),n.get("strokeWidth",t.observation,"hovered"),n.get("lineCap",t.observation,"hovered")),f=n.get("lineJoin",t.observation,"hovered");return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(xe,{viewBox:"-1 -1 2 2",preserveAspectRatio:"xMidYMid meet",width:"100%",height:"100%","data-geom":"line","data-testid":"hovered-line",effects:U((0,d.readGeomEffects)(n,t.observation,"hovered")),className:ve,children:(0,s.jsx)("path",{d:a,fill:"none",stroke:i,strokeWidth:u,opacity:l,strokeOpacity:c,strokeDasharray:h,strokeLinecap:v,strokeLinejoin:f,vectorEffect:"non-scaling-stroke","data-testid":"hovered-line-path"})}),r.map(m=>(0,s.jsx)(Le,{hit:m,project:ce},`companion-${m.layerId}-${m.pointIndex}`)),(0,s.jsx)(Qe,{hit:t,project:ce,"data-testid":"hovered-line-point"})]})},Zh={geom:"line",coord:"polar",swatchShape:"line",guideMode:"crosshair",render:({layer:e})=>(0,s.jsx)(qh,{layer:e}),renderHover:({layer:e,primary:t,group:r,related:n})=>(0,s.jsx)(Jh,{layer:e,primary:t,companions:[...r,...n]}),renderHoverCompanions:({related:e})=>(0,s.jsx)(_t,{companions:e}),getEditOutlineShapes:_h,getOverlayAnchor:({observation:e})=>{const t=(0,d.getX)(e),r=(0,d.getY)(e);return t===null||r===null?null:ce(t,r)}},$h=(0,g.memo)(function({layer:t,intro:r}){const n=B(t),o=hr(r?.type==="grow"&&r.growAxis==="size"?r:null);return(0,g.useMemo)(()=>{const a=o.activeIntro?(0,d.createStableKeyGenerator)(t.data,t.mapping,t.id):null,i=[];let l=0;for(const c of t.data)i.push((0,s.jsx)(oi,{observation:c,project:ce,styleReaders:n,animation:o,introKey:a?.(c)},String(l++)));return i},[t.data,t.mapping,t.id,n,o])}),e0={geom:"point",coord:"polar",swatchShape:"circle",symbols:d.STYLE_POINT_SYMBOLS,render:({layer:e,intro:t})=>(0,s.jsx)($h,{layer:e,intro:t}),renderHover:({primary:e,group:t,related:r})=>(0,s.jsx)(_t,{primary:e,companions:[...t,...r]}),renderHoverCompanions:({related:e})=>(0,s.jsx)(_t,{companions:e}),getEditOutlineShapes:e=>ii({...e,project:ce}),getOverlayAnchor:({observation:e})=>{const t=(0,d.getX)(e),r=(0,d.getY)(e);return t===null||r===null?null:ce(t,r)}},Hi={bar:{cartesian:iu,polar:Qh},line:{cartesian:gu,polar:Zh},area:{cartesian:ad,polar:Gh},point:{cartesian:pu,polar:e0},rule:{cartesian:Eh},tile:{cartesian:Lh}};function mr(e){return typeof e=="function"?{live:!1,fn:e}:{live:!0,fn:e.fn}}function An(e){return e?mr(e.render).live:!1}function t0(e,t){return typeof e=="string"?{...t,geom:e}:{...t,definition:e,geom:e.type}}var r0=(e,t,r)=>Sn()(e,t)?.getEditOutlineShapes?.(r)??[];function Sn(e=[]){const t={};for(const[r,n]of Object.entries(Hi))t[r]={...n};for(const r of e)(t[r.geom]??={})[r.coord]=r;return(r,n)=>t[r]?.[n]??null}var Di={on:{edge:0,stroke:6,point:14},near:{main:0,cross:0}},Pe={readonly:"readonly",annotate:"annotate",edit:"edit",static:"static"},re={[Pe.readonly]:{showTooltip:!0,showAnnotations:!0,showMenuTriggerOnHover:!1,paintHover:!0,selectObservationsOnPress:!1,selectGraphOnPress:!1,selectGuidesOnPress:!1,labelsTakePointer:!1,freezeHoverWhileSelected:!0,hoverTolerance:null,mountEditor:!1,editTextInline:!1,trackHover:!0,openLegendOverflow:!0,animate:!0},[Pe.annotate]:{showTooltip:!1,showAnnotations:!0,showMenuTriggerOnHover:!0,paintHover:!1,selectObservationsOnPress:!1,selectGraphOnPress:!1,selectGuidesOnPress:!1,labelsTakePointer:!0,freezeHoverWhileSelected:!0,hoverTolerance:{on:Di.on,near:{main:Number.POSITIVE_INFINITY,cross:Number.POSITIVE_INFINITY}},mountEditor:!0,editTextInline:!1,trackHover:!0,openLegendOverflow:!0,animate:!0},[Pe.edit]:{showTooltip:!1,showAnnotations:!1,showMenuTriggerOnHover:!1,paintHover:!1,selectObservationsOnPress:!0,selectGraphOnPress:!0,selectGuidesOnPress:!0,labelsTakePointer:!1,freezeHoverWhileSelected:!1,hoverTolerance:{on:{edge:2,stroke:5,point:14},near:{main:8,cross:20}},mountEditor:!0,editTextInline:!0,trackHover:!0,openLegendOverflow:!0,animate:!0},[Pe.static]:{showTooltip:!1,showAnnotations:!0,showMenuTriggerOnHover:!1,paintHover:!1,selectObservationsOnPress:!1,selectGraphOnPress:!1,selectGuidesOnPress:!1,labelsTakePointer:!1,freezeHoverWhileSelected:!1,hoverTolerance:null,mountEditor:!1,editTextInline:!1,trackHover:!1,openLegendOverflow:!1,animate:!1}},n0=new Set(Object.values(Pe)),o0=e=>n0.has(e),Pn=e=>o0(e)?e:Pe.readonly,Wi=["top","right","bottom","left"],a0=()=>(0,_r.createStore)(e=>({boundary:null,setBoundary:t=>e(r=>i0(r.boundary,t)?r:{boundary:t})})),Zt=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,zr=(e,t)=>Wi.every(r=>e[r].from===t[r].from&&e[r].to===t[r].to),i0=(e,t)=>e===t?!0:e===null||t===null?!1:Zt(e.frame,t.frame)&&Zt(e.client,t.client)&&zr(e.frameSpans,t.frameSpans)&&zr(e.clientSpans,t.clientSpans),$t=e=>{const t=(0,g.useRef)(e);return t.current=e,t},s0=()=>{const e=new Map;return(0,_r.createStore)(t=>({hover:d.RESTING_HOVER_STATE,tooltipAnchor:null,pointerRegions:[],suspendsHover:!1,editorOwnsQuery:!1,setHoverState:r=>t(n=>n.hover===r?n:{hover:r}),setTooltipAnchor:r=>t(n=>l0(n.tooltipAnchor,r)?n:{tooltipAnchor:r}),publishPointerRegions:(r,n)=>{n.length===0?e.delete(r):e.set(r,n);const o=(0,d.orderPointerRegions)(e);t(a=>(0,d.arePointerRegionListsEqual)(a.pointerRegions,o)?a:{pointerRegions:o})},setSuspendsHover:r=>t(n=>n.suspendsHover===r?n:{suspendsHover:r}),setEditorOwnsQuery:r=>t(n=>n.editorOwnsQuery===r?n:{editorOwnsQuery:r})}))},l0=(e,t)=>e===t?!0:e===null||t===null?!1:e.x===t.x&&e.y===t.y&&e.placement===t.placement&&e.annotationId===t.annotationId,c0=(e,t)=>{const r=(0,g.useMemo)(()=>({layers:e,coordSystem:t}),[e,t]),n=(0,g.useRef)(null);n.current===null&&(n.current=new d.HoverEngine(r));const o=n.current,a=(0,g.useRef)(!1);return(0,g.useEffect)(()=>{if(!a.current){a.current=!0;return}o.update(r)},[o,r]),o},zi=(0,g.createContext)(null),Vi=({children:e})=>{const{layers:t,coordSystem:r}=L((0,ee.useShallow)(l=>({layers:l.layers,coordSystem:l.coordSystem}))),n=c0(t,r),[o]=(0,g.useState)(()=>s0()),a=(0,g.useRef)(null),i=(0,g.useRef)(null);return i.current===null&&(i.current={engine:n,store:o,overlayRef:a}),(0,s.jsx)(zi.Provider,{value:i.current,children:e})},Ie=()=>{const e=(0,g.useContext)(zi);if(e===null)throw new Error("useHoverContext must be used inside a <HoverProvider>.");return e};function Ui(e,t){const{engine:r}=Ie(),n=(0,g.useRef)(t);(0,g.useEffect)(()=>{n.current=t},[t]),(0,g.useEffect)(()=>(r.registerHitTester(e,o=>n.current(o)),()=>r.unregisterHitTester(e)),[r,e])}var d0=({hitTest:e,input:t})=>{const r=ae(),n=(0,g.useMemo)(()=>e({...t,panelSize:r}),[e,t.layer.data,r]);return Ui(t.layer.id,n),null},u0=[],Eo=64,h0={x:"-25%",y:"-25%",width:"150%",height:"150%"},Yi=({styleReaders:e,state:t,children:r})=>{const n=(0,g.useId)(),o=(0,g.useId)(),a=sr(),i=e.get("overpaint",void 0,t)??u0,{fillFor:l,defs:c}=te({paints:i}),u=(0,s.jsx)("g",{id:n,children:r});if(i.length===0)return u;const h=a===null?h0:{x:-64,y:-64,width:a.width+2*Eo,height:a.height+2*Eo};return(0,s.jsxs)(s.Fragment,{children:[u,c,(0,s.jsx)("mask",{id:o,maskUnits:"userSpaceOnUse",style:{maskType:"alpha"},...h,children:(0,s.jsx)("use",{href:`#${n}`})}),(0,s.jsx)("g",{mask:`url(#${o})`,pointerEvents:"none","data-testid":"geom-overpaint",children:[...i].reverse().map((v,f)=>(0,s.jsx)("rect",{...h,fill:l(v)},f))})]})};function Ki(e){const{engine:t,store:r}=Ie(),{trackHover:n}=re[he()];return(0,g.useCallback)((o,a)=>{if(!n)return;const{hover:i,setHoverState:l,setTooltipAnchor:c}=r.getState(),u=o===null?d.RESTING_HOVER_STATE:t.resolveHoverByKey(e,o);if(u.primary===null){i.primary?.layerId===e&&(l(d.RESTING_HOVER_STATE),c(null));return}l(u),c(a?{x:a.clientX,y:a.clientY,placement:"top"}:null)},[t,r,e,n])}var Xi=(e,t)=>{const r=$t(e),n=$t(t),o=(0,g.useRef)(null),a=(0,g.useRef)(null),i=(0,g.useMemo)(()=>{const l=()=>{a.current!==null&&(clearTimeout(a.current),a.current=null),o.current=null},c=()=>{a.current!==null&&(clearTimeout(a.current),a.current=null);const h=o.current;h!==null&&(o.current=null,r.current(...h))};return{run:(...h)=>{if(n.current<=0){r.current(...h);return}o.current=h,a.current!==null&&clearTimeout(a.current),a.current=setTimeout(c,n.current)},flush:c,cancel:l}},[r,n]);return(0,g.useEffect)(()=>()=>{a.current!==null&&clearTimeout(a.current)},[]),i},v0={width:0,height:0,unmeasured:!0},wn=({debounce:e=0,onResize:t}={})=>{const[r,n]=(0,g.useState)(v0),o=(0,g.useRef)(null),a=Xi(u=>{const h=o.current;h&&h.width===u.width&&h.height===u.height||(o.current={width:u.width,height:u.height},t?.(u),n(u))},e),i=(0,g.useRef)(null),l=(0,g.useRef)(null),c=(0,g.useCallback)(u=>{i.current!==u&&(i.current&&l.current?.unobserve(i.current),i.current=u,u&&(l.current??=new ResizeObserver(([h])=>{if(!h)return;const v=Math.round(h.contentBoxSize[0]?.inlineSize??h.contentRect.width),f=Math.round(h.contentBoxSize[0]?.blockSize??h.contentRect.height);a.run({width:v,height:f,unmeasured:!1})}),l.current.observe(u)))},[a]);return{...r,setElement:c}};function g0(){const[e,t]=(0,g.useState)(null),r=(0,g.useRef)(null),n=(0,g.useRef)(null),o=(0,g.useRef)(null),a=(0,g.useCallback)(()=>{o.current=null;const u=n.current;if(!u)return;const h=u.getBoundingClientRect();if(h.width===0||h.height===0){r.current!==null&&(r.current=null,t(null));return}const v={left:h.left,top:h.top,width:h.width,height:h.height},f=r.current;f&&f.left===v.left&&f.top===v.top&&f.width===v.width&&f.height===v.height||(r.current=v,t(v))},[]),i=(0,g.useCallback)(()=>{o.current===null&&(o.current=requestAnimationFrame(a))},[a]),{setElement:l}=wn({onResize:i}),c=(0,g.useCallback)(u=>{n.current=u,l(u),u&&a()},[l,a]);return(0,g.useEffect)(()=>(window.addEventListener("scroll",i,!0),window.addEventListener("resize",i),()=>{window.removeEventListener("scroll",i,!0),window.removeEventListener("resize",i),o.current!==null&&cancelAnimationFrame(o.current)}),[i]),{measureRef:c,screenRect:e}}var f0={loading:"جاري التحميل",error:"حدث خطأ ما",axisLabels:{placeholder:"إضافة تسمية"},defaultPropertyLabels:{date:"التاريخ",year:"السنة",quarter:"الربع",month:"الشهر",week:"الأسبوع",series:"السلسلة",category:"الفئة",columnNumber:({number:e})=>`العمود ${e}`,rowNumber:({number:e})=>`الصف ${e}`,seriesNumber:({number:e})=>`السلسلة ${e}`},trendComparison:{fromPrevious:{long:({value:e})=>`${e} مقابل السابق`,short:({value:e})=>`${e} مقابل السابق`},fromPreviousYear:{long:({value:e})=>`${e} مقابل السنة السابقة`,short:({value:e})=>`${e} مقابل السنة السابقة`},fromPreviousMonth:{long:({value:e})=>`${e} مقابل الشهر السابق`,short:({value:e})=>`${e} مقابل الشهر السابق`},fromPreviousWeek:{long:({value:e})=>`${e} مقابل الأسبوع السابق`,short:({value:e})=>`${e} مقابل الأسبوع السابق`},fromPreviousDay:{long:({value:e})=>`${e} مقابل اليوم السابق`,short:({value:e})=>`${e} مقابل اليوم السابق`},fromPreviousHour:{long:({value:e})=>`${e} مقابل الساعة السابقة`,short:({value:e})=>`${e} مقابل الساعة السابقة`}},headlineMetrics:{averageLong:({value:e})=>`المتوسط ${e}`,averageShort:({value:e})=>`المتوسط ${e}`,total:({value:e})=>`المجموع ${e}`,totalConversionRate:({value:e})=>`معدل التحويل الإجمالي ${e}`,current:({value:e})=>e,comparisonReference:({value:e})=>`من ${e}`},legend:{hiddenItems:"عناصر وسيلة الإيضاح المخفية"}},p0={graph:f0,dir:"rtl"},m0={loading:"Loading",error:"Something went wrong",axisLabels:{placeholder:"Add label"},defaultPropertyLabels:{date:"Date",year:"Year",quarter:"Quarter",month:"Month",week:"Week",series:"Series",category:"Category",columnNumber:({number:e})=>`Column ${e}`,rowNumber:({number:e})=>`Row ${e}`,seriesNumber:({number:e})=>`Series ${e}`},trendComparison:{fromPrevious:{long:({value:e})=>`${e} vs previous`,short:({value:e})=>`${e} vs prev`},fromPreviousYear:{long:({value:e})=>`${e} vs previous year`,short:({value:e})=>`${e} vs prev year`},fromPreviousMonth:{long:({value:e})=>`${e} vs previous month`,short:({value:e})=>`${e} vs prev month`},fromPreviousWeek:{long:({value:e})=>`${e} vs previous week`,short:({value:e})=>`${e} vs prev week`},fromPreviousDay:{long:({value:e})=>`${e} vs previous day`,short:({value:e})=>`${e} vs prev day`},fromPreviousHour:{long:({value:e})=>`${e} vs previous hour`,short:({value:e})=>`${e} vs prev hour`}},headlineMetrics:{averageLong:({value:e})=>`Average ${e}`,averageShort:({value:e})=>`Avg. ${e}`,total:({value:e})=>`Total ${e}`,totalConversionRate:({value:e})=>`Total conversion rate ${e}`,current:({value:e})=>e,comparisonReference:({value:e})=>`from ${e}`},legend:{hiddenItems:"Hidden legend items"}},x0={graph:m0,dir:"ltr"},y0={},b0={loading:"A carregar",error:"Algo correu mal",axisLabels:{placeholder:"Adicionar etiqueta"},defaultPropertyLabels:{date:"Data",year:"Ano",quarter:"Trimestre",month:"Mês",week:"Semana",series:"Série",category:"Categoria",columnNumber:({number:e})=>`Coluna ${e}`,rowNumber:({number:e})=>`Linha ${e}`,seriesNumber:({number:e})=>`Série ${e}`},trendComparison:{fromPrevious:{long:({value:e})=>`${e} vs anterior`,short:({value:e})=>`${e} vs ant`},fromPreviousYear:{long:({value:e})=>`${e} vs ano anterior`,short:({value:e})=>`${e} vs ano ant`},fromPreviousMonth:{long:({value:e})=>`${e} vs mês anterior`,short:({value:e})=>`${e} vs mês ant`},fromPreviousWeek:{long:({value:e})=>`${e} vs semana anterior`,short:({value:e})=>`${e} vs sem ant`},fromPreviousDay:{long:({value:e})=>`${e} vs dia anterior`,short:({value:e})=>`${e} vs dia ant`},fromPreviousHour:{long:({value:e})=>`${e} vs hora anterior`,short:({value:e})=>`${e} vs hora ant`}},headlineMetrics:{averageLong:({value:e})=>`Média ${e}`,averageShort:({value:e})=>`Méd. ${e}`,total:({value:e})=>`Total ${e}`,totalConversionRate:({value:e})=>`Taxa de conversão total ${e}`,current:({value:e})=>e,comparisonReference:({value:e})=>`de ${e}`},legend:{hiddenItems:"Itens de legenda ocultos"}},A0={graph:b0,dir:"ltr"},xr={"en-GB":x0,"en-US":y0,ar:p0,"pt-PT":A0},S0=({locale:e,overrides:t,fallbackLocale:r="en-GB",dictionaries:n})=>{const o=t??{},a=e??r,i=[...n.map(c=>c[a]),...n.map(c=>c[r])];return(c,u)=>{const h=u??{},v=c.split("."),f=o[c];if(f)return typeof f=="function"?f(h):f;for(const m of i){if(m===void 0)continue;const p=w0(m,v);if(p)return typeof p=="function"?p(h):p}return c}},P0=({locale:e,overrides:t})=>t?.dir??xr[e].dir??"ltr",w0=(e,t)=>{let r=e;for(const n of t){if(typeof r!="object"||r===null)return;r=r[n]}if(typeof r=="string"||typeof r=="function")return r},Qi=(e=d.DEFAULT_LOCALE)=>{const{language:t,region:r}=new Intl.Locale((0,d.canonicalizeLocale)(e));return[`${t}-${r}`,t].find(j0)??d.DEFAULT_LOCALE},j0=e=>e in xr,jn=(0,g.createContext)(null),E0=[xr],En=()=>_i().translator,k0=()=>_i().dir,qi=e=>{const t=(0,g.useContext)(jn)?.requested;return{locale:t?.locale??e,i18nOverrides:t?.i18nOverrides}},kn=({locale:e,children:t,i18nOverrides:r,dictionaries:n=E0})=>{const o=Qi(e),a=(0,g.useMemo)(()=>({translator:S0({locale:o,overrides:r,fallbackLocale:"en-GB",dictionaries:n}),dir:P0({locale:o,overrides:r}),requested:{locale:e,i18nOverrides:r}}),[r,o,n,e]);return(0,s.jsx)(Kl.IntlProvider,{locale:o,timeZone:"UTC",children:(0,s.jsx)(jn.Provider,{value:a,children:t})})},C0=kn,_i=()=>{const e=(0,g.useContext)(jn);if(!e)throw new Error("useI18n must be used within IntlProvider");return e},Ji=e=>typeof e=="number"?{topLeft:e,topRight:e,bottomRight:e,bottomLeft:e}:e,yr=e=>{if(typeof e=="number")return e;const{topLeft:t,topRight:r,bottomRight:n,bottomLeft:o}=e;return t===r&&r===n&&n===o?t:null},R0=e=>{const{topLeft:t,topRight:r,bottomRight:n,bottomLeft:o}=Ji(e);return t>0||r>0||n>0||o>0},Je=(e,t=0)=>{const r=yr(e);if(r!==null)return`${ko(r,t)}px`;const{topLeft:n,topRight:o,bottomRight:a,bottomLeft:i}=e;return[n,o,a,i].map(l=>`${ko(l,t)}px`).join(" ")},Cn=(e,t)=>{const{x:r,y:n,width:o,height:a}=e,{topLeft:i,topRight:l,bottomRight:c,bottomLeft:u}=T0(Ji(t),o,a),h=r+o,v=n+a,f=(m,p,x)=>m>0?`A${m},${m},0,0,1,${p},${x}`:"";return[`M${r+i},${n}`,`H${h-l}`,f(l,h,n+l),`V${v-c}`,f(c,h-c,v),`H${r+u}`,f(u,r,v-u),`V${n+i}`,f(i,r+i,n),"Z"].filter(m=>m!=="").join("")},ko=(e,t)=>e===0?0:e+t,T0=(e,t,r)=>{const{topLeft:n,topRight:o,bottomRight:a,bottomLeft:i}=e,l=Math.min(1,...[[t,n+o],[t,i+a],[r,n+i],[r,o+a]].map(([u=0,h=0])=>h>0?u/h:1)),c=u=>Math.max(0,u*l);return{topLeft:c(n),topRight:c(o),bottomRight:c(a),bottomLeft:c(i)}},Ve=(e,t)=>{if(typeof e=="string")return{background:e};if((0,d.isGradientPaint)(e)){const n=e.stops.map(o=>`${o.color} ${o.offset*100}%`).join(", ");return{background:e.gradient==="radial"?`radial-gradient(circle, ${n})`:`linear-gradient(${e.angle??180}deg, ${n})`}}if((0,d.isPatternPaint)(e)){const n=e.size??8,o=n/6;return{background:[...L0(e,n,o),...e.background===void 0?[]:[e.background]].join(", "),backgroundSize:`${n}px ${n}px`}}if((e.fit??"tile")==="stretch")return{background:`${To(Ro(e,{width:1,height:1}))} no-repeat center, ${e.fallback}`,backgroundSize:"100% 100%"};const r=Ca(e,t);return{background:`${To(Ro(e,r))} repeat, ${e.fallback}`,backgroundSize:`${r.width}px ${r.height}px`}},L0=(e,t,r)=>{if(e.pattern==="dots")return[`radial-gradient(circle, ${e.color} ${r}px, transparent ${r}px)`];if(e.pattern==="lines"){const n=`${t*ld}px`;return[`linear-gradient(to bottom, ${e.color} ${n}, transparent ${n})`]}return[Co(-45,e.color,t,r),...e.pattern==="crosshatch"?[Co(45,e.color,t,r)]:[]]},Co=(e,t,r,n)=>{const o=`${r/Math.SQRT2}px`,a=`${n/2}px`,i=`${r/Math.SQRT2-n/2}px`;return`repeating-linear-gradient(${e}deg, ${t} 0 ${a}, transparent ${a} ${i}, ${t} ${i} ${o})`},Ro=(e,t)=>{if(e.alpha===void 0||e.alpha>=1)return e.image;const r=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${t.width} ${t.height}" preserveAspectRatio="none"><image href="${I0(e.image)}" width="${t.width}" height="${t.height}" opacity="${e.alpha}" preserveAspectRatio="none"/></svg>`;return`data:image/svg+xml,${encodeURIComponent(r)}`},I0=e=>e.replace(/&/gu,"&").replace(/</gu,"<").replace(/>/gu,">").replace(/"/gu,"""),To=e=>`url("${e.replace(/[\\"]/gu,"\\$&").replace(/[\n\r\f]/gu,t=>`\\${t.charCodeAt(0).toString(16)} `)}")`,O0="bow4tg0",M0="bow4tg1",B0="bow4tg2",G0="bow4tg3",N0="bow4tg4",Rn="_1ii3bsb0",Zi="_1ii3bsb1",F0={colorScheme:"light",themeClass:Rn,inlineVarsStyle:{},themeValues:gn("light",{})},Tn=(0,g.createContext)(null),Et=()=>(0,g.useContext)(Tn)??F0,H0=()=>(0,g.useContext)(Tn)!==null,$i=({colorScheme:e,textScale:t=1,graphBackground:r,graphFontFamily:n,headingFontFamily:o,children:a})=>{const i=(0,g.useMemo)(()=>gn(e),[e]),l=(0,g.useMemo)(()=>{const u={[A.textScale]:String(t)};return r!==void 0&&(u[A.graphBackground]=r),n!==void 0&&(u[A.fontFamily]=n),o!==void 0&&(u[A.fontFamilyHeading]=o),(0,tr.assignInlineVars)(u)},[t,r,n,o]),c=(0,g.useMemo)(()=>({colorScheme:e,themeClass:e==="dark"?Zi:Rn,inlineVarsStyle:l,themeValues:i,graphBackground:r}),[e,l,i,r]);return(0,s.jsx)(Tn.Provider,{value:c,children:a})},es=({children:e,className:t,style:r})=>{const{colorScheme:n,themeClass:o,inlineVarsStyle:a}=Et();return(0,s.jsx)("div",{className:(0,Q.default)(o,M0,t),style:{...a,...r},"data-graphy-color-scheme":n,children:e})},D0="graphy_root",ts=()=>typeof document>"u"?null:document.getElementById(D0)??document.body,rs={modern:"'Inter', -apple-system, BlinkMacSystemFont, 'Open Sans', 'Segoe UI', 'Roboto', 'Oxygen-Sans', 'Ubuntu', 'Cantarell', 'Helvetica Neue', sans-serif",timeless:"'Noto Serif', Georgia, 'Times New Roman', serif",fresh:"'Aeonik', 'Aeonik Fallback', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif",technical:"'PT Mono', 'Courier New', monospace",handwritten:"'Permanent Marker', cursive",fineliner:"'Intruding Cat', cursive"},ns=e=>{const t=e!==null&&typeof e=="object"?e.fontFamily:e;return typeof t=="string"&&t.length>0?t:void 0},Vr=e=>{const t=ns(e);if(t!==void 0)return rs[t]??t},W0="_1cocly40",Ue=({content:e})=>(0,s.jsx)(s.Fragment,{children:os(e.content??[e])}),os=e=>e.map((t,r)=>z0(t,r)),z0=(e,t)=>{if(e.type==="text")return V0(e,t);if(e.type==="hardBreak"||e.type==="hard_break")return(0,s.jsx)("br",{},t);const r=e.content?os(e.content):null;switch(e.type){case"doc":return(0,s.jsx)(g.Fragment,{children:r},t);case"heading":{const n=X0(e.attrs?.level);return Q0(n,t,r,Lo(e.attrs))}case"paragraph":return(0,s.jsx)("p",{"data-variant":Ln(e.attrs?.variant)??void 0,style:as(Lo(e.attrs)),children:r},t);case"blockquote":return(0,s.jsx)("blockquote",{children:r},t);case"bulletList":case"bullet_list":return(0,s.jsx)("ul",{children:r},t);case"orderedList":case"ordered_list":return(0,s.jsx)("ol",{children:r},t);case"listItem":case"list_item":return(0,s.jsx)("li",{children:r},t);default:return(0,s.jsx)("span",{children:r},t)}},V0=(e,t)=>{const r=e.text??"";return!e.marks||e.marks.length===0?(0,s.jsx)("span",{children:r},t):e.marks.reduceRight((n,o,a)=>U0(o,n,`${t}-${a}`),r)},U0=(e,t,r)=>{switch(e.type){case"bold":case"strong":return(0,s.jsx)("strong",{children:t},r);case"italic":case"em":return(0,s.jsx)("em",{children:t},r);case"underline":return(0,s.jsx)("u",{children:t},r);case"strike":case"strikethrough":case"s":return(0,s.jsx)("s",{children:t},r);case"code":return(0,s.jsx)("code",{children:t},r);case"link":{const n=Ln(e.attrs?.href);return(0,d.isSafeUrl)(n)?(0,s.jsx)("a",{className:W0,href:n,rel:"noopener noreferrer",target:"_blank",children:t},r):(0,s.jsx)("span",{children:t},r)}case"textStyle":{const n=Y0(e.attrs);return n?(0,s.jsx)("span",{style:n,children:t},r):(0,s.jsx)("span",{children:t},r)}default:return(0,s.jsx)("span",{children:t},r)}},Y0=e=>{if(!e)return null;const t={},r=Ln(e.color);r&&(t.color=r);const n=Vr(e.font)??Vr(e.fontFamily);n&&(t.fontFamily=n);const o=K0(e.fontSize);return o&&(t.fontSize=o),Object.keys(t).length>0?t:null},K0=e=>{if(typeof e=="number"&&Number.isFinite(e))return`calc(${e}px * ${A.textScale})`},Ln=e=>typeof e=="string"&&e.length>0?e:void 0,X0=e=>typeof e!="number"?3:e<1?1:e>3?3:Math.round(e),Q0=(e,t,r,n)=>{const o=as(n);switch(e){case 1:return(0,s.jsx)("h1",{style:o,children:r},t);case 2:return(0,s.jsx)("h2",{style:o,children:r},t);case 3:return(0,s.jsx)("h3",{style:o,children:r},t)}},Lo=e=>{const t=e?.textAlign;if(t==="left"||t==="right"||t==="center"||t==="justify")return t},as=e=>e?{textAlign:e}:void 0;function Be(e){const{store:t}=Ie();return(0,Ye.useStore)(t,e)}var q0="_19519k80";var _0="_19519k82",J0="_19519k83";var Z0="_19519k86",$0="_19519k87",ev="_19519k88",tv=e=>{const{overlayRef:t}=Ie(),r=(0,g.useRef)(null),[n,o]=(0,g.useState)(!1),a=$t(e),{waitingForView:i}=q();return(0,g.useEffect)(()=>{const l=t.current;if(!l)return;const c=h=>{r.current={clientX:h.clientX,clientY:h.clientY},o(!0),a.current?.()},u=()=>{r.current=null,o(!1)};return l.addEventListener("pointermove",c),l.addEventListener("pointerleave",u),()=>{l.removeEventListener("pointermove",c),l.removeEventListener("pointerleave",u)}},[t,a,i]),{cursorRef:r,inside:n}},rv=24,nv=8,ov={x:0,y:0,top:0,left:0,right:0,bottom:0,width:0,height:0,toJSON:()=>({})},zt={boundary:[],padding:nv},av=()=>{const e=L((0,ee.useShallow)(S=>({layers:S.layers,coordSystem:S.coordSystem,scales:S.scales,guides:S.guides,numberFormat:S.config.numberFormat,parsingLocale:S.config.parsingLocale,mode:S.config.tooltip.mode,comments:S.annotations.comments}))),{formattingLocale:t}=W(),r=O(),n=Be(S=>S.hover),o=Be(S=>S.tooltipAnchor),a=Be(S=>S.suspendsHover),i=pe("Tooltip",is),l=(0,g.useRef)(()=>{}),{cursorRef:c,inside:u}=tv(()=>l.current()),h=(0,g.useMemo)(()=>(0,d.buildTooltipContent)({...e,hover:n,readers:r,formattingLocale:t,activeCalloutId:o?.annotationId??null}),[e,n,r,t,o]),v=!a&&h!==null&&(u||o!==null),f=(0,g.useMemo)(()=>({getBoundingClientRect:()=>{if(o!==null)return lv(o);const S=c.current;return S===null?ov:sv(S)}}),[c,o]),{refs:m,floatingStyles:p,update:x}=(0,ie.useFloating)(cv({open:v,tooltipAnchor:o,virtualReference:f}));if(l.current=x,!v)return null;const y=(0,s.jsx)("div",{ref:m.setFloating,role:"tooltip",className:ev,style:p,"data-testid":"chart-tooltip",children:(0,s.jsx)(i,{content:h})}),b=ts();return b?(0,Xl.createPortal)((0,s.jsx)(es,{children:y}),b):y},is=({content:e})=>{const t=_(),r=L(v=>v.coordSystem),n=T(d.resolveTooltipStyle,O()),o=qe([n.box.fill]),a=X(n.heading),i=X(n.label),l=X(n.value),c={paddingInline:n.box.paddingInline},u=e.rows.some(v=>v.swatchColor!==null),h=e.rows.some(v=>!v.primary);return(0,s.jsxs)("div",{className:q0,style:iv(n.box,o(n.box.fill)),"data-testid":"chart-tooltip-body",children:[e.comment!==null&&(0,s.jsx)("div",{style:{...i,color:n.value.textColor,...c},"data-testid":"chart-tooltip-comment",children:(0,s.jsx)(Ue,{content:e.comment})}),e.heading!==null&&(0,s.jsx)("div",{className:"_19519k81",style:{...a,...c},"data-testid":"chart-tooltip-heading",children:e.heading}),(0,s.jsx)("div",{className:_0,children:e.rows.map(v=>{const f=t(v.geom,r.type);return(0,s.jsx)(dv,{row:v,swatchShape:f?.swatchShape??"square",mainAxis:(0,d.readMainAxis)(r),hasSwatches:u,highlight:v.primary&&h,labelStyle:i,valueStyle:l,paddingInline:n.box.paddingInline,paddingBlock:n.box.gap,highlightBackground:(0,d.toPaintColor)(n.primaryRow.fill)},v.key)})})]})},iv=(e,t)=>({...Ve(e.fill,t),borderRadius:Je(e.cornerRadius),paddingBlock:e.paddingBlock,boxShadow:Xe(e.shadow),...e.alpha===void 0?{}:{opacity:e.alpha},...e.strokeWidth>0?{border:`${e.strokeWidth}px solid ${e.stroke}`}:{}}),sv=e=>({x:e.clientX,y:e.clientY,top:e.clientY,left:e.clientX,right:e.clientX,bottom:e.clientY,width:0,height:0,toJSON:()=>({})}),lv=e=>({x:e.x,y:e.y,top:e.y,left:e.x,right:e.x,bottom:e.y,width:0,height:0,toJSON:()=>({})}),cv=({open:e,tooltipAnchor:t,virtualReference:r})=>({open:e,placement:t!==null?t.placement:"right",middleware:t!==null?[(0,ie.offset)(d.ANNOTATION_TOOLTIP_MARKER_GAP_PX),(0,ie.shift)(zt),(0,ie.flip)(zt)]:[(0,ie.offset)(rv),(0,ie.flip)(zt),(0,ie.shift)(zt)],elements:{reference:r}}),dv=({row:e,swatchShape:t,mainAxis:r,hasSwatches:n,highlight:o,labelStyle:a,valueStyle:i,paddingInline:l,paddingBlock:c,highlightBackground:u})=>(0,s.jsxs)("div",{className:J0,style:{paddingInline:l,paddingBlock:c,...o?{backgroundColor:u}:{}},"data-testid":"chart-tooltip-row",children:[e.swatchColor===null?n&&(0,s.jsx)("span",{className:"_19519k85","aria-hidden":!0}):(0,s.jsx)(jt,{shape:t,color:e.swatchColor,paint:e.swatchFill,surface:"tooltip",label:e.label,lineType:e.swatchLineType,alpha:e.swatchAlpha,cornerRadius:e.swatchCornerRadius,symbol:e.swatchSymbol,mainAxis:r}),(0,s.jsx)("span",{className:Z0,style:a,"data-testid":"chart-tooltip-label",children:e.label}),(0,s.jsx)("span",{className:$0,style:i,"data-testid":"chart-tooltip-value",children:e.value})]}),ss=e=>({x:e.axisLabel.x().resolve(),y:e.axisLabel.y().resolve()}),uv=e=>({x:e.axisLine.x().resolve(),y:e.axisLine.y().resolve(),cornerRadius:e.axisLine().get("cornerRadius")}),ls=e=>({x:e.tickLine.x().resolve(),y:e.tickLine.y().resolve()}),cs=e=>{const t=e.graph();return(0,d.withAlpha)((0,d.toPaintColor)(t.get("fill")),t.get("alpha")??1)},In=e=>{const t=(0,d.compositeColor)(void 0,hv(e))??"transparent",r=new WeakMap,n=o=>{if(o.textOutlineColor!==d.AUTO_COLOR)return o;const a=r.get(o)??{...o,textOutlineColor:t};return r.set(o,a),a};return(o,a)=>n(a===void 0?e.tickLabel[o]().resolve():e.tickLabel[a](o).resolve())},On=e=>{const t=e.legend().resolve(),r=e.legend.popover().resolve();return{gap:t.gap,stackGap:t.stackGap,focusStroke:t.focusStroke,popover:r}},Mn=e=>e.headline().resolve(),hv=e=>{const t=e.graph(),r=t.get("fill");return(0,d.withAlpha)((0,d.isPatternPaint)(r)?r.background??"transparent":(0,d.toPaintColor)(r),t.get("alpha")??1)},br=e=>{const t={};for(const r of d.DATA_LABEL_ROLES){const n={};for(const o of d.RESOLVED_DATA_LABEL_POSITIONS)n[o]=(0,d.resolveDataLabelStyle)(e,r,o);t[r]=n}return t},vv=({textMeasurer:e,tickLabelStyles:t,tickLineStyles:r,familyDefault:n})=>o=>{const a=o.position==="top"||o.position==="bottom",i=(0,d.getAestheticFromScaledAesthetic)(o.scaledAesthetic),{offset:l,...c}=t(i,o.position),u=o.showTicks?Math.max(l,r[i].length):l,h=(0,d.toFontSpec)(c,n),v=o.ticks.map(m=>e.measureText(m.formattedLabel,h)),f=o.labelMaxWidthPx??Number.POSITIVE_INFINITY;if(a){if(o.labelRotation!==0){const m=v.map(p=>p.width);return Io(m,f)+2*u}return Math.max(...v.map(m=>m.height))+u}return Io(v.map(m=>m.width),f)+u},Io=(e,t)=>Math.min(Math.max(...e),t),gv=({axisLabelStyles:e})=>t=>(0,d.computeLineBoxHeight)(e[(0,d.getAestheticFromScaledAesthetic)(t.scaledAesthetic)]),ds=({textMeasurer:e,dataLabelStyles:t,familyDefault:r})=>(n,o,a)=>{const i=t[n][o],l=e.measureText(a,(0,d.toFontSpec)(i,r));return{...l,width:l.width+i.paddingInline*2,height:l.height+i.paddingBlock*2}},fv=({textMeasurer:e,familyDefault:t})=>(r,n)=>e.measureText(r,(0,d.toFontSpec)(n,t)),pv=se.sm,mv=({textMeasurer:e,familyDefault:t,itemGap:r,headlineItemStyles:n})=>(o,a)=>{const i=us(o,n[a],e,t);return{width:hs(i.map(l=>l.width))+Math.max(0,i.length-1)*r,height:Math.max(0,...i.map(l=>l.height))}},xv=({textMeasurer:e,familyDefault:t,headlineItemStyles:r})=>(n,o)=>us(n,r[o],e,t).map(a=>a.width),yv=({textMeasurer:e,familyDefault:t,headlineItemStyles:r})=>(n,o,a=!1)=>{const i=(0,d.resolveHeadlineNumberStyle)(r[o],a);return{width:e.measureText(n,(0,d.toFontSpec)(i,t)).width,height:(0,d.computeLineBoxHeight)(i)}},bv=e=>{const t=mv(e),r=yv(e);return(n,o,a=!1)=>n.kind==="perGroup"?t(n,o):r(n.value,o,a)},us=(e,t,r,n)=>{const o=a=>Av(a,t,r,n);return e.items.map(a=>{const i=(0,d.buildHeadlineItemRows)(a,t).map(o),l=Math.max(0,i.length-1)*t.gap;return{width:Math.max(0,...i.map(c=>c.width)),height:hs(i.map(c=>c.height))+l}})},Av=(e,t,r,n)=>{let o=0,a=0;for(const i of e.segments)if(i.kind==="text"){const l=Sv(t,i.textRole);o+=r.measureText(i.text,(0,d.toFontSpec)(l,n)).width,a=Math.max(a,Pv(l))}else o+=i.size,a=Math.max(a,i.size);return{width:o+Math.max(0,e.segments.length-1)*e.gap,height:a}},Sv=(e,t)=>{switch(t){case"value":return e.number;case"caption":return e.caption;case"label":return e.label;case"trendPercentage":case"trendReference":return e.trend;default:return t}},Pv=e=>e.fontSize*(e.lineHeight??pv),hs=e=>e.reduce((t,r)=>t+r,0),wv=(e,t)=>e?t:0,Ur=(e,t,r)=>{if(r){const n=Number(e.size);return Number.isFinite(n)&&n>0?n:0}return wv(e.color,t)},kt=e=>({inlineChrome:2*(e.paddingInline+e.strokeWidth),blockChrome:2*(e.paddingBlock+e.strokeWidth)});var Ct=(e,t)=>{const r=Oo(e.items),n=t===void 0?r:(0,d.pickLegendBubbles)({candidates:r,maxSize:t,fallbacks:Oo(e.fallbackItems??[]),sizeOf:({size:i})=>i}),o=n[0],a=n.at(-1);return o===void 0||a===void 0?null:{title:e.title,bubbles:n,minLabel:n.length>1?o.item.formattedLabel:null,maxLabel:a.item.formattedLabel}},Bn=({parts:e,vertical:t,textMeasurer:r,font:n,itemStyle:o})=>{const a=x=>r.measureText(x,n).width,i=(0,d.computeLineBoxHeight)(o),{inlineChrome:l,blockChrome:c}=kt(o),u=e.bubbles.map(({size:x})=>x),h=Ut(u,4),v=[e.minLabel===null?null:a(e.minLabel),h,a(e.maxLabel)].filter(x=>x!==null),f=Ut(v,o.gap),m=Math.max(i,...u),p=e.title===null?null:Math.min(a(e.title),160);if(t){const x=p===null?0:i+o.gap;return{inlineSize:Math.max(p??0,f)+l,blockSize:x+m+c}}return{inlineSize:Ut(p===null?[f]:[p,f],o.gap)+l,blockSize:m+c}},vs=(e,t)=>e-kt(t).blockChrome,gs=(e,t)=>{const r=(0,d.computeLineBoxHeight)(t),n=Ct(e,r)?.bubbles.map(({size:o})=>o)??[];return Math.max(r,...n)+kt(t).blockChrome},jv=({legends:e,rowHeight:t,textMeasurer:r,font:n,itemStyle:o,headlineGap:a,legendGap:i})=>{const l=e.filter(v=>v.inHeadlineRow),c=Math.max(0,...l.map(v=>gs(v,o))),u=vs(Math.max(t,c),o),h=l.map(v=>Ct(v,u)).filter(v=>v!==null).map(v=>Bn({parts:v,vertical:!1,textMeasurer:r,font:n,itemStyle:o}).inlineSize);return h.length===0?0:Ut(h,i)+a},Oo=e=>e.flatMap(t=>{const r=Number(t.visual.size);return Number.isFinite(r)&&r>=0?[{item:t,size:Math.max(r,4)}]:[]}),Ut=(e,t)=>e.reduce((r,n)=>r+n,0)+t*Math.max(0,e.length-1),Ev=({textMeasurer:e,familyDefault:t,legendItemStyle:r,directLabelStyle:n})=>o=>{const a=o.position==="top"||o.position==="bottom";if(o.display==="direct"){const p=(0,d.computeLineBoxHeight)(n);if(a)return p;const x=(0,d.toFontSpec)(n,t),y=o.items.map(b=>e.measureText(b.formattedLabel,x).width);return Math.max(...y)}const{item:i,swatch:l}=r,c=(0,d.computeLineBoxHeight)(i),u=(0,d.toFontSpec)(i,t),{inlineChrome:h,blockChrome:v}=kt(i),f=o.aesthetics.includes("size");if(o.inHeadlineRow)return gs(o,i);if((0,d.isBubbleSizeLegend)(o)){const p=Ct(o);if(p===null)return 0;const x=Bn({parts:p,vertical:!a,textMeasurer:e,font:u,itemStyle:i});return a?x.blockSize:x.inlineSize}if(a){const p=f?Math.max(0,...o.items.map(x=>Ur(x.visual,l.size,!0))):l.size;return Math.max(c,p)+v}const m=o.items.map(p=>{const x=e.measureText(p.formattedLabel,u).width,y=Ur(p.visual,l.size,f);return y+(y>0?i.gap:0)+x});return Math.max(...m)+h},kv=({textMeasurer:e,tickLabelStyles:t,familyDefault:r})=>(n,o)=>e.measureText(n,(0,d.toFontSpec)(t(o),r)),Cv=Object.freeze({}),Rv=({textMeasurer:e,metrics:t,overrides:r=Cv})=>{const n=O(),o=T(ss,n),a=T(br,n),i=T(d.resolveDirectLabelStyle,n),l=T(d.resolveLegendItemStyle,n),c=T(In,n),u=T(ls,n),h=(0,g.useRef)(r);return h.current=r,(0,g.useMemo)(()=>{if(!e)return null;const v=t.fonts.familyDefault,f=n.graph().get("textScale"),m={textMeasurer:e,familyDefault:v,itemGap:Mn(n).gap,headlineItemStyles:{small:(0,d.resolveHeadlineItemStyle)(n,"small"),medium:(0,d.resolveHeadlineItemStyle)(n,"medium"),large:(0,d.resolveHeadlineItemStyle)(n,"large")}},p=vv({textMeasurer:e,tickLabelStyles:c,tickLineStyles:u,familyDefault:v}),x=gv({axisLabelStyles:o}),y=Ev({textMeasurer:e,familyDefault:v,legendItemStyle:l,directLabelStyle:i}),b=bv(m),S=xv(m),P={measureText:(w,j)=>e.measureText(w,j),textScale:f};return{measureAxis:w=>{if(Lv(w))return 0;const j=h.current.measureAxis;return j?j(w,P):p(w)},measureAxisLabel:w=>{const j=h.current.measureAxisLabel;return j?j(w,P):x(w)},measureLegend:w=>{if(Iv(w))return 0;const j=h.current.measureLegend;return j?j(w,P):y(w)},measureHeadline:(w,j,C)=>(h.current.measureHeadline??b)(w,j,C),measureHeadlineItemWidths:(w,j)=>(h.current.measureHeadlineItemWidths??S)(w,j),measureTickLabel:kv({textMeasurer:e,tickLabelStyles:c,familyDefault:v}),measureDifferenceArrowLabel:fv({textMeasurer:e,familyDefault:v}),measureDataLabel:ds({textMeasurer:e,dataLabelStyles:a,familyDefault:v})}},[e,t,o,a,i,l,c,u,n])},Tv=({measurer:e,axes:t,numberFormat:r,parsingLocale:n,formattedLegends:o,containerSize:a,externalMeasurements:i,headline:l,formattingLocale:c,annotations:u,layers:h,coordSystem:v,overflowStrategy:f,panelEdges:m,padding:p,margins:x})=>{const y=O(),b=rr(),S=(0,g.useMemo)(()=>P=>(0,d.resolveDifferenceArrowAnnotationStyle)(y,P),[y]);return(0,g.useMemo)(()=>e?new d.LayoutCompiler(e).compile({axes:t,numberFormat:r,parsingLocale:n,formattedLegends:o,containerSize:a,externalMeasurements:i,headline:l,formattingLocale:c,annotations:u,resolveDifferenceArrowStyle:S,layers:h,readers:y,resolvePlacement:b,coordSystem:v,overflowStrategy:f,panelEdges:m,padding:p,margins:x}):null,[t,r,n,o,a,i,f,l,c,u,S,h,y,b,v,m,p,x,e])},Lv=e=>!e.visible||e.ticks.length===0,Iv=e=>e.items.length===0&&(e.fallbackItems?.length??0)===0,Gn=()=>{const{formattingLocale:e}=W(),t=L(r=>r.config.parsingLocale);return e??t},Ov=()=>Qi(Gn()),Mo=.5,fs=(0,g.createContext)(new Map),ps=(0,g.createContext)(()=>{}),ms=(0,g.createContext)(new Set),Mv=({children:e})=>{const[t,r]=(0,g.useState)(()=>new Map),[n]=(0,g.useState)(()=>new Set),o=(0,g.useRef)(new Map),a=(0,g.useCallback)((i,l,c)=>{const u=o.current.get(i)??new Set;if(c!==null){u.add(l),o.current.set(i,u),r(h=>Nv(h,i,c));return}u.delete(l),!(u.size>0)&&(o.current.delete(i),r(h=>Fv(h,i)))},[]);return(0,s.jsx)(ps.Provider,{value:a,children:(0,s.jsx)(ms.Provider,{value:n,children:(0,s.jsx)(fs.Provider,{value:t,children:e})})})},xs=()=>(0,g.useContext)(fs),Bv=()=>(0,g.useContext)(ps),ys=e=>{const t=Bv(),r=(0,g.useId)(),n=(0,g.useRef)(null);return(0,g.useEffect)(()=>{if(typeof ResizeObserver>"u")return;const o=n.current;if(o===null)return;const a=()=>t(e,r,{width:o.offsetWidth,height:o.offsetHeight});a();const i=new ResizeObserver(a);return i.observe(o),()=>{i.disconnect(),t(e,r,null)}},[e,r,t]),n},Gv=()=>(0,g.useContext)(ms),Nv=(e,t,r)=>{const n=e.get(t);if(n!==void 0&&Math.abs(n.width-r.width)<Mo&&Math.abs(n.height-r.height)<Mo)return e;const o=new Map(e);return o.set(t,r),o},Fv=(e,t)=>{if(!e.has(t))return e;const r=new Map(e);return r.delete(t),r},Hv=(e,t)=>e?.annotationId===t?e:null,Dv=(e,t)=>e.annotationId===t.annotationId&&e.translation.x===t.translation.x&&e.translation.y===t.translation.y&&(0,qr.isEqual)(e.placement,t.placement),Wv=(e,t,r)=>e!==null&&e.annotationId===t&&e.endpoint===r?e:null,zv=(e,t)=>e.annotationId===t.annotationId&&e.endpoint===t.endpoint&&(0,qr.isEqual)(e.placement,t.placement),Vv=(e,t,r)=>e!==null&&e.annotationId===t&&e.endpoint===r?e:null,Uv=(e,t)=>e.annotationId===t.annotationId&&e.endpoint===t.endpoint&&(0,d.areAnchorsEqual)(e.point.anchor,t.point.anchor),Yv=3,Kv={on:{edge:8,stroke:8,point:14},near:{main:0,cross:0}},Xv=(e,t)=>e.heads===t.heads&&e.start.x===t.start.x&&e.start.y===t.start.y&&Ss(e.pointer,t.pointer),Qv=(e,t)=>e.start.x===t.start.x&&e.start.y===t.start.y&&Ss(e.pointer,t.pointer),qv=e=>e==="both"?{startArrowheadStyle:"lineArrow",endArrowheadStyle:"lineArrow"}:e==="none"?{startArrowheadStyle:"none",endArrowheadStyle:"none"}:{startArrowheadStyle:"none",endArrowheadStyle:"lineArrow"},bs=(e,t,r)=>{if(t===null||t.width<=0||t.height<=0)return null;const n=(e.x-t.left)/t.width,o=(e.y-t.top)/t.height;return!Number.isFinite(n)||!Number.isFinite(o)?null:{x:Bo(n,r.minX,r.maxX),y:Bo(o,r.minY,r.maxY)}},As=(e,t,r)=>{const n=(t.x-e.x)*r.width,o=(t.y-e.y)*r.height;return Math.hypot(n,o)<Yv},_v=({client:e,capture:t,bounds:r,engine:n,layers:o,start:a})=>{const i=bs(e,t,r);if(i===null||t===null||As(a,i,t))return null;if(Zv(e,t)!==null){const l={x:e.x-t.left,y:e.y-t.top},{primary:c,intersection:u}=n.query((0,d.toPanelCursor)(l,t),{tolerance:Kv,viewport:{width:t.width,height:t.height}});if(c!==null&&u?.intersects!==!1){const h=o.find(f=>f.id===c.layerId),v=h===void 0?null:(0,d.createObservationAnchorBuilder)(h)(c.observation);if(v!==null)return{anchorType:"observation",...v}}}return{anchorType:"panel",x:i.x,y:i.y}},Jv=(e,t)=>({anchorType:"panel",x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),width:Math.abs(t.x-e.x),height:Math.abs(t.y-e.y)}),Ss=(e,t)=>e?.x===t?.x&&e?.y===t?.y,Zv=(e,t)=>t===null||t.width===0||t.height===0||e.x<t.left||e.x>t.right||e.y<t.top||e.y>t.bottom?null:{x:(e.x-t.left)/t.width,y:(e.y-t.top)/t.height},Bo=(e,t,r)=>Math.min(Math.max(e,t),r),$v=(e,t)=>e!==null&&e.annotationId===t?e:null,eg=(e,t)=>e.annotationId===t.annotationId&&e.region.x===t.region.x&&e.region.y===t.region.y&&e.region.width===t.region.width&&e.region.height===t.region.height,tg=(e,t)=>e!==null&&e.annotationId===t?e:null,rg=(e,t)=>e.annotationId===t.annotationId&&e.at.x===t.at.x&&e.width===t.width&&e.shift===t.shift,Re=({standingInteraction:e},t)=>e!==null&&Ae(e,t)?e:null,ng=(e,t)=>{if(e===null)return!1;switch(t.kind){case"arrow-draw":return Ae(e,t.kind)&&Xv(e,t);case"box-draw":return Ae(e,t.kind)&&Qv(e,t);case"difference-arrow-endpoint-drag":return Ae(e,t.kind)&&Uv(e,t);case"arrow-endpoint-drag":return Ae(e,t.kind)&&zv(e,t);case"move-drag":return Ae(e,t.kind)&&Dv(e,t);case"shape-resize-drag":return Ae(e,t.kind)&&eg(e,t);case"text-resize-drag":return Ae(e,t.kind)&&rg(e,t);case"chrome-popup":return Ae(e,t.kind)}},Ae=(e,t)=>e.kind===t,og=(e,t,r,n)=>{const o=Ps(r.layerId,e,t,n);return o===null?null:{observationIndex:e,predicate:o.predicate,selectedFor:r}},ag=({observationIndex:e,predicate:t,selectedFor:r},n,o)=>{const a=Ps(r.layerId,e,n,o);return a!==null&&(0,d.arePredicatesEqual)(a.predicate,t)?a.standing:null},ig=(e,t)=>e===t?!0:e===null||t===null?!1:e.observationIndex===t.observationIndex&&(0,d.arePredicatesEqual)(e.predicate,t.predicate)&&(0,d.areEditTargetsEqual)(e.selectedFor,t.selectedFor),Ps=(e,t,r,n)=>{const o=(0,d.findLayerById)(r,e),a=o?.data.getAt(t)??null;if(o===void 0||a===null)return null;const i=(0,d.buildObservationsTarget)({layer:o,observationIndex:t,scope:"observation",parsingLocale:n});return i===null?null:{standing:{layer:o,observation:a},predicate:i.predicate}},sg=({stamped:e,observations:t})=>e!==null&&e.kind!=="grid"?e:t!==null?{kind:"observations",observations:t}:e,lg=(e,t)=>{if(e===t)return!0;if(e===null||t===null)return!1;if(e.kind==="annotation"&&t.kind==="annotation")return(0,d.areEditTargetsEqual)(e.target,t.target);if(e.kind==="legend"&&t.kind==="legend")return e.part.legendIndex===t.part.legendIndex&&e.part.itemIndex===t.part.itemIndex;if(e.kind==="axis"&&t.kind==="axis")return(0,d.areEditTargetsEqual)(e.target,t.target)&&e.part?.tickIndex===t.part?.tickIndex;if(e.kind==="grid"&&t.kind==="grid")return(0,d.areEditTargetsEqual)(e.target,t.target);if(e.kind==="observations"&&t.kind==="observations"){const r=e.observations,n=t.observations;return r.layerId===n.layerId&&r.observationIndex===n.observationIndex&&r.target.scope===n.target.scope&&r.onObservation===n.onObservation}return!1},Nn=e=>{const t=e.editTargetUnderPointer;return t?.kind==="annotation"?t.target.id:null},cg=e=>e.editTargetUnderPointer!==null,ws=()=>(0,_r.createStore)(e=>({editTargetUnderPointer:null,standingInteraction:null,selectedOutline:null,caret:null,pressedObservation:null,plotMenu:null,annotatePress:null,setEditTargetUnderPointer:t=>e(r=>lg(r.editTargetUnderPointer,t)?r:{editTargetUnderPointer:t}),claimInteraction:t=>e(r=>ng(r.standingInteraction,t)?r:{standingInteraction:t}),releaseInteraction:t=>e(r=>r.standingInteraction?.kind===t?{standingInteraction:null}:r),setSelectedOutline:t=>e(r=>hg(r.selectedOutline,t)?r:{selectedOutline:t}),setCaret:(t,r=null)=>e(n=>(n.caret?.annotationId??null)===t?n:{caret:t===null?null:{annotationId:t,editor:null,placementCommandId:r}}),setCaretEditor:t=>e(r=>r.caret===null?r:{caret:{...r.caret,editor:t}}),setPressedObservation:t=>e(r=>ig(r.pressedObservation,t)?r:{pressedObservation:t}),setPlotMenu:t=>e(r=>ug(r.plotMenu,t)?r:{plotMenu:t}),setAnnotatePress:t=>e(r=>dg(r.annotatePress,t)?r:{annotatePress:t})})),dg=(e,t)=>e===t||e!==null&&t!==null&&e.key===t.key&&e.x===t.x&&e.y===t.y,ug=(e,t)=>e===t||e!==null&&t!==null&&e.x===t.x&&e.y===t.y,hg=(e,t)=>e===t?!0:e===null||t===null?!1:(0,d.areEditTargetsEqual)(e.target,t.target)&&e.frameScale===t.frameScale&&Zt(e.frame,t.frame)&&zr(e.frameSpans,t.frameSpans),Fn=(0,g.createContext)(null),vg=ws(),gg=({children:e})=>{const[t]=(0,g.useState)(()=>ws());return(0,s.jsx)(Fn.Provider,{value:t,children:e})},fg=()=>{const e=(0,g.useContext)(Fn);if(e===null)throw new Error("useEditorStore must be used inside an <EditorProvider>.");return e};function le(e){return(0,Ye.useStore)((0,g.useContext)(Fn)??vg,e)}var js=(0,g.createContext)(null),pg=({panelRect:e,children:t})=>{const r=mg(e);return(0,s.jsx)(js.Provider,{value:r,children:t})},Es=()=>{const e=(0,g.useContext)(js);if(e===null)throw new Error("Difference arrows read outside a <DifferenceArrowsProvider>.");return e},Go=(e,t,r,n)=>t.hasAuthoredStroke?t.stroke:(0,d.resolveArrowColor)(e.start,e.end,{start:r(e.start),end:r(e.end)})??n??t.stroke,mg=e=>{const{formattingLocale:t}=W(),r=je(),{fonts:n}=Ne(),o=le(y=>Re(y,"difference-arrow-endpoint-drag")),a=oc(),i=O(),{differenceArrows:l,mainAxis:c,parsingLocale:u}=L((0,ee.useShallow)(y=>({differenceArrows:y.annotations.differenceArrows,mainAxis:(0,d.readMainAxis)(y.coordSystem),parsingLocale:y.config.parsingLocale}))),h=t??u,{width:v,height:f}=e,m=(0,g.useMemo)(()=>({mainAxis:c,panelWidth:v,panelHeight:f,locale:h}),[c,v,f,h]),p=(0,g.useMemo)(()=>xg(r,n.familyDefault),[r,n.familyDefault]),x=(0,g.useMemo)(()=>l.map(y=>{const b=(0,d.resolveDifferenceArrowAnnotationStyle)(i,y.id),S=No(y,b,m,p);return{...S,arrow:y,style:b,color:Go(y,b,a),committedArrow:y,committedLabelBox:S.labelBox,committedLabelText:S.labelText,dragging:!1,hasComparableEndpoints:(0,d.areEndpointsComparable)(y.start,y.end)}}),[l,m,p,a,i]);return(0,g.useMemo)(()=>o===null?x:x.map(y=>{if(y.id!==o.annotationId)return y;const b=yg(y.committedArrow,o);return{...No(b,y.style,m,p),style:y.style,color:Go(b,y.style,a,y.color),arrow:b,committedArrow:y.committedArrow,committedLabelBox:y.committedLabelBox,committedLabelText:y.committedLabelText,committedLinePath:y.linePath,committedArrowheadPath:y.arrowheadPath,committedLabelPosition:y.labelPosition,committedColor:y.color,dragging:!0,hasComparableEndpoints:(0,d.areEndpointsComparable)(b.start,b.end)}}),[x,o,m,p,a])},No=(e,t,r,n)=>{const o=(0,d.computeDifferenceArrow)({arrow:e,style:t,...r});return{...o,labelBox:(0,d.getDifferenceArrowLabelBox)({labelPosition:o.labelPosition,measuredTextWidth:n(o.labelText,t.label),label:t.label})}},xg=(e,t)=>{const r=new Map;return(n,o)=>{const a=(0,d.toFontSpec)(o,t),i=[a.family,a.size,a.weight,a.style,a.letterSpacing,a.textTransform,n].join("|"),l=r.get(i);if(l!==void 0)return l;const{width:c}=e.measureText(n,a);return r.set(i,c),c}},yg=(e,t)=>({...e,start:t.endpoint==="start"?t.point:e.start,end:t.endpoint==="end"?t.point:e.end}),ks=(0,g.createContext)({Title:null,Caption:null,TextAnnotation:null}),bg=({editors:e,children:t})=>(0,s.jsx)(ks.Provider,{value:e,children:t}),Hn=()=>(0,g.useContext)(ks),Fo="_4dlrid0",Ag="xfz7dq0";var Sg="xfz7dq2",Pg="xfz7dq3",wg="xfz7dq4",jg="xfz7dq5",Eg="https://graphy.dev/?utm_source=chart-mark&utm_medium=embed",kg="Made with Graphy — open graphy.dev";var Cg="_15xngrw0";var Rg="_15xngrw2",Tg="_15xngrw3",Lg="_15xngrw4",Ig="_15xngrw5",Og=e=>{const t=Mg(e.trim());if(t===null)return"light";const r=Bg(t);return r<=.22?"dark":r<=.65?"mid":"light"},Mg=e=>{if(!e.startsWith("#"))return null;const t=e.slice(1);if(t.length===3){const r=t[0],n=t[1],o=t[2];return r===void 0||n===void 0||o===void 0?null:{red:Number.parseInt(r+r,16),green:Number.parseInt(n+n,16),blue:Number.parseInt(o+o,16)}}return t.length===6||t.length===8?{red:Number.parseInt(t.slice(0,2),16),green:Number.parseInt(t.slice(2,4),16),blue:Number.parseInt(t.slice(4,6),16)}:null},Bg=({red:e,green:t,blue:r})=>{const n=o=>{const a=o/255;return a<=.03928?a/12.92:((a+.055)/1.055)**2.4};return .2126*n(e)+.7152*n(t)+.0722*n(r)},Gg="24 16.68 51.61 67.15",Ng=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M57.2309 65.7612V45.0502V37.5111L47.9581 32.1578L57.2309 26.8044L66.5037 32.1578V36.2585V60.4072L57.2309 65.7612ZM33.2284 56.8836L42.5012 51.5303L51.774 56.8836V68.9113L42.5019 74.2646V62.237L33.2284 56.8836Z",fill:"white"}),(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M71.9257 61.4889V31.007C71.9257 29.7132 71.2842 28.602 70.1635 27.9551L58.9581 21.4852C57.8375 20.8383 56.5545 20.8383 55.4338 21.4852L29.4987 36.4592C28.3781 37.1061 27.7366 38.2172 27.7366 39.5111V69.993C27.7366 71.2868 28.3781 72.398 29.4987 73.0449L40.7041 79.5148C41.8248 80.1617 43.1078 80.1617 44.2277 79.5148L57.1953 72.0278L70.1629 64.5408C71.2835 63.8939 71.925 62.7828 71.925 61.4889H71.9257ZM57.196 65.7264V45.016V37.4769L47.9232 32.1236L57.196 26.7695L66.4688 32.1236V36.2244V60.373L57.196 65.7264ZM33.1935 56.8488L42.4663 51.4954L51.7391 56.8488V68.8764L42.4669 74.2298V62.2021L33.1941 56.8488H33.1935Z",fill:"black"})]}),Fg=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M72.046 67.4784L45.9638 82.5379C43.727 83.8291 41.0707 83.8291 38.8339 82.5379L27.5645 76.0311C25.3277 74.7399 24 72.4387 24 69.8573V39.2016C24 36.6192 25.3287 34.3181 27.5645 33.0279L53.6467 17.9684C55.8825 16.6772 58.5398 16.6772 60.7757 17.9684L72.0451 24.4753C74.2809 25.7665 75.6096 28.0676 75.6096 30.649V61.3047C75.6096 63.8871 74.2809 66.1882 72.0451 67.4784H72.046ZM57.2121 71.9031L44.1706 79.4323C43.0435 80.0832 41.7533 80.0832 40.6272 79.4323L29.3578 72.9254C28.2307 72.2746 27.5856 71.1581 27.5856 69.8564V39.2007C27.5856 37.8989 28.2307 36.7824 29.3578 36.1316L55.44 21.0721C56.567 20.4212 57.8573 20.4212 58.9843 21.0721L70.2537 27.5789C71.3808 28.2298 72.0259 29.3463 72.0259 30.6481V61.3037C72.0259 62.6054 71.3808 63.7219 70.2537 64.3728L57.2121 71.9021V71.9031ZM66.5376 60.1824V35.8964V31.7722L57.2121 26.3876L47.8867 31.7722L57.2121 37.1559V44.7379V65.5661L66.5376 60.1815V60.1824ZM51.7238 68.7351V56.6391L42.3984 51.2554L33.073 56.6391L42.3984 62.0237V74.1197L51.7238 68.7351Z",fill:"white"}),(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M57.2236 65.5896V44.7279V37.1334L47.8828 31.741L57.2236 26.3487L66.5635 31.741V35.8719V60.1964L57.2227 65.5896H57.2236ZM72.0604 61.3215V30.6178C72.0604 29.3151 71.4143 28.1958 70.2854 27.5439L58.9977 21.0275C57.8687 20.3756 56.5766 20.3756 55.4486 21.0275L29.3241 36.11C28.1952 36.7618 27.5491 37.8802 27.5491 39.1839V69.8876C27.5491 71.1912 28.1952 72.3097 29.3241 72.9615L40.6118 79.4789C41.7407 80.1307 43.0329 80.1307 44.1609 79.4789L57.2236 71.9371L70.2854 64.3954C71.4143 63.7436 72.0604 62.6252 72.0604 61.3215ZM33.046 56.6473L42.3868 51.2549L51.7276 56.6473V68.7634L42.3868 74.1557V62.0405L33.046 56.6473Z",fill:"black"})]}),Hg=({backgroundTone:e,className:t})=>(0,s.jsx)("svg",{viewBox:Gg,fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",className:t,children:e==="dark"?Fg:Ng}),Cs=(e,t,r="full")=>!e||t.width<120||t.height<80?null:t.width<200||r==="mini"?"mini":"full",Dn=({variant:e,position:t})=>{const r=Og((0,d.toPaintColor)(O().graph().get("fill")));return(0,s.jsxs)("a",{className:(0,Q.default)(Cg,e==="mini"&&"_15xngrw1",t==="footer"?Lg:Ig),href:Eg,target:"_blank",rel:"noopener noreferrer","aria-label":kg,"data-variant":e,"data-background-tone":r,children:[(0,s.jsx)(Hg,{backgroundTone:r,className:Rg}),(0,s.jsx)("span",{className:Tg,children:"Made with Graphy"})]})},Rs=({ref:e,footerRect:t,mode:r=Pe.readonly,caption:n,showCaption:o,source:a,showSource:i,captionStyle:l,sourceStyle:c,graphyBadge:u})=>{const{Caption:h}=Hn(),v=re[Pn(r)].editTextInline?h:null,f=o&&(v!==null||n!==null),m=i&&a!==null&&Vg(a),p=u!==null;return!f&&!m&&!p?null:(0,s.jsxs)("div",{ref:e,className:Ag,style:{left:t.x,top:t.y,width:t.width},children:[f?v?(0,s.jsx)(v,{caption:n,captionStyle:l}):(0,s.jsx)(Dg,{caption:n,captionStyle:l}):null,(m||p)&&(0,s.jsxs)("div",{className:"xfz7dq1",children:[m&&(0,s.jsx)(Wg,{source:a,sourceStyle:c}),u!==null?(0,s.jsx)(Dn,{variant:u,position:"footer"}):null]})]})},Dg=({caption:e,captionStyle:t})=>e===null?null:typeof e=="string"?(0,s.jsx)("p",{className:Fo,style:X(t),children:e}):(0,s.jsx)("div",{className:Fo,style:X(t),children:(0,s.jsx)(Ue,{content:e})}),Wg=({source:e,sourceStyle:t})=>{const r=(0,d.isSafeUrl)(e.url)?e.url:void 0,n=e.label??(r!==void 0?zg(r):"");return n===""&&r===void 0?null:(0,s.jsxs)("span",{className:Sg,style:X(t.label),children:[(0,s.jsx)("span",{className:wg,children:"Source:"}),r!==void 0?(0,s.jsx)("a",{className:Pg,href:r,target:"_blank",rel:"noopener noreferrer",style:X(t.link),children:n}):(0,s.jsx)("span",{className:jg,children:n})]})},zg=e=>{try{return new URL(e).hostname}catch{return e}},Vg=e=>e.label!==void 0&&e.label!==""||e.url!==void 0&&e.url!==""&&(0,d.isSafeUrl)(e.url),Ug="_1k4qtbg0";var Yg=22,Ts=({ref:e,headerRect:t,mode:r=Pe.readonly,title:n,showTitle:o,subtitle:a,showSubtitle:i,headingStyle:l,subtitleStyle:c,graphyBadge:u})=>{const{Title:h}=Hn(),v=re[Pn(r)].editTextInline?h:null,f=v!==null,m=o&&(f||n!==null),p=i&&(f||a!==null),x=u!==null;return!m&&!p&&!x?null:(0,s.jsxs)("div",{ref:e,className:(0,Q.default)(Ug,x&&"_1k4qtbg1"),style:{left:t.x,top:t.y,width:t.width,...x&&!m&&!p?{minHeight:Yg}:{}},children:[v?(0,s.jsx)(v,{title:n,showTitle:o,showSubtitle:i,subtitle:a,headingStyle:l,subtitleStyle:c},[o?"title":"",i?"subtitle":""].join("-")):(0,s.jsx)(Kg,{title:n,showTitle:o,showSubtitle:i,subtitle:a,headingStyle:l,subtitleStyle:c}),u!==null?(0,s.jsx)(Dn,{variant:u,position:"header"}):null]})},Kg=({title:e,showTitle:t,showSubtitle:r,subtitle:n,headingStyle:o,subtitleStyle:a})=>{const i=t&&e!==null,l=r&&n!==null;return(0,s.jsxs)(s.Fragment,{children:[i&&(typeof e=="string"?(0,s.jsx)("h1",{className:"_4dlrid0",style:X(o),children:e}):(0,s.jsx)("div",{className:"_4dlrid0",style:X(o),children:(0,s.jsx)(Ue,{content:e})})),l&&(typeof n=="string"?(0,s.jsx)("p",{className:"_4dlrid0",style:X(a),children:n}):(0,s.jsx)("div",{className:"_4dlrid0",style:X(a),children:(0,s.jsx)(Ue,{content:n})}))]})},Xg="_1u9qprb0",Qg="_1u9qprb1",qg=Vl({group:()=>Zg,item:()=>Ls,trend:()=>Jg,value:()=>_g}),_g="_9aen060",Jg="_9aen061",Zg="_9aen062",Ls="_9aen063",$g={xxs:8,xs:12,sm:16,md:20,lg:24,xl:36},ef={primary:"asohov1 asohov0",secondary:"asohov2 asohov0"},Wn=({children:e,title:t,variant:r="primary",size:n="sm",...o})=>{const a=(0,g.useId)(),i=$g[n];return(0,s.jsxs)("svg",{className:ef[r],"aria-labelledby":t?a:void 0,height:i,width:i,fill:"none",viewBox:"0 0 24 24",role:"img",...o,children:[t&&(0,s.jsx)("title",{id:a,children:t}),e]})},Is=e=>(0,s.jsx)(Wn,{...e,children:(0,s.jsxs)("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,s.jsx)("path",{d:"m5 12 7-7 7 7"}),(0,s.jsx)("path",{d:"M12 19V5"})]})}),Os=e=>(0,s.jsx)(Wn,{...e,children:(0,s.jsx)("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:(0,s.jsx)("path",{d:"M5 12h14"})})}),tf="n7clvo0",rf="n7clvo1",nf="n7clvo2";var of=({segment:e,itemStyle:t})=>{if(e.kind==="swatch")return(0,s.jsx)(af,{swatch:e.swatch,size:e.size});if(e.kind==="trendArrow"){const o=Ms(t,e.direction);return(0,s.jsx)("div",{className:(0,Q.clsx)(nf,e.direction==="down"&&"n7clvo3"),style:{color:o,backgroundColor:e.direction==="flat"?Z(A.textPrimary,.1):Z(o,.2)},children:e.direction==="flat"?(0,s.jsx)(Os,{size:"xs",title:""}):(0,s.jsx)(Is,{size:"xs",title:""})})}const{className:r,style:n}=sf(e,t);return(0,s.jsx)("span",{className:r,style:n,children:e.text})},af=({swatch:e,size:t})=>{const r=_(),n=gr({layerId:e.layerId,groupValue:e.value,size:t}),o=vr({layerId:e.layerId,groupValue:e.value,fallback:e.color})??e.color;return(0,s.jsx)(jt,{shape:r(e.geom,"cartesian")?.swatchShape??"square",color:o,paint:n.fill,surface:"headline",width:t,height:t,alpha:n.alpha,cornerRadius:n.cornerRadius,symbol:n.symbol})},sf=(e,t)=>{switch(e.textRole){case"value":return{style:We(t.number)};case"caption":return{className:tf,style:We(t.caption)};case"label":return{className:rf,style:We(t.label)};case"trendPercentage":return{style:We({...t.trend,textColor:Ms(t,e.trendDirection??"up")})};case"trendReference":return{style:We(t.trend)};default:return e.textRole}},Ms=(e,t)=>{switch(t){case"up":return e.trendUp.textColor;case"down":return e.trendDown.textColor;case"flat":return e.trendFlat.textColor;default:return t}},lf=({item:e,itemStyle:t})=>(0,s.jsx)("div",{className:Ls,style:{gap:t.gap},children:(0,d.buildHeadlineItemRows)(e,t).map(r=>(0,s.jsx)(cf,{row:r,itemStyle:t},r.role))}),cf=({row:e,itemStyle:t})=>{const r=e.role==="trend";return(0,s.jsx)("div",{className:qg[e.role],style:{gap:e.gap},"data-testid":r?"headline-trend":void 0,"data-direction":r?df(e):void 0,role:r?"img":void 0,"aria-label":r?e.ariaLabel:void 0,children:e.segments.map((n,o)=>(0,s.jsx)(of,{segment:n,itemStyle:t},o))})},df=e=>{const t=e.segments.find(r=>r.kind==="trendArrow");return t?.kind==="trendArrow"?t.direction:void 0},uf=({headline:e,rect:t,resolvedSize:r,visibleItemCount:n,inDonutHole:o=!1})=>{const a=O(),i=T(Mn,a),l=T(d.resolveHeadlineItemStyle,a,r),c={left:t.x,top:t.y,width:t.width,height:t.height};if(e.kind==="grandTotal"){const u=(0,d.resolveHeadlineNumberStyle)(l,o);return(0,s.jsx)("div",{className:Qg,style:c,children:(0,s.jsx)("span",{style:We(u),children:e.value})})}return(0,s.jsx)("div",{className:Xg,style:{...c,gap:i.gap},children:e.items.slice(0,n).map((u,h)=>(0,s.jsx)(lf,{item:u,itemStyle:l},`${u.label}-${h}`))})},Bs="data-legend-index",Gs="data-legend-item-index",Ns=({legendIndex:e,itemIndex:t})=>({[Bs]:String(e),[Gs]:String(t)}),Fs=e=>{const t=Yr(e,Bs),r=Yr(e,Gs);return t===null||r===null?null:{legendIndex:t,itemIndex:r}},Yr=(e,t)=>{const r=e.getAttribute(t);if(r===null||!/^(0|[1-9]\d*)$/.test(r))return null;const n=Number(r);return Number.isSafeInteger(n)?n:null},Oe="data-edit-kind",Hs="data-chart-label",zn="data-edit-id",pt="data-edit-axis",Ds="data-edit-tick-index",Ws="data-legend-overflow-control",hf=`[${Ws}]`,vf="observations",zs="data-live-geom",gf=`[${Oe}]`,Ar=e=>({[Hs]:e}),Ze=e=>({[Oe]:e.kind,[zn]:e.id}),Sr=(e,t)=>({[Oe]:"axis",[pt]:e,...t===void 0?{}:{[Ds]:String(t)}}),Rt=e=>({[Oe]:"legend",...Ns(e)}),Vn=e=>({[Oe]:"grid",[pt]:e}),ff=(e,t)=>{for(const r of e){const n=r.closest(gf);if(n===null||!t.contains(n))continue;const o=mf(n);if(o!==null)return o;if(n!==r)return null}return null},Vs=({live:e=!1}={})=>({[Oe]:vf,...e?{[zs]:""}:{}}),pf=(e,t)=>{if(!(e instanceof Element))return!1;const r=e.closest(`[${zs}]`);return r!==null&&r!==e&&t.contains(r)},mf=e=>{const t=e.getAttribute(Oe);switch(t){case"annotation":{const r=e.getAttribute(zn);return r===null||r===""?null:{kind:t,target:{kind:t,id:r}}}case"axis":{const r=e.getAttribute(pt);if(!(0,d.isPositionScale)(r))return null;if(!e.hasAttribute("data-edit-tick-index"))return{kind:t,target:{kind:t,axis:r},part:null};const n=Yr(e,Ds);return n===null?null:{kind:t,target:{kind:t,axis:r},part:{tickIndex:n}}}case"legend":{const r=Fs(e);return r===null?null:{kind:t,target:{kind:t},part:r}}case"grid":{const r=e.getAttribute(pt);return(0,d.isPositionScale)(r)?{kind:t,target:{kind:t,axis:(0,d.getAestheticFromScaledAesthetic)(r)}}:null}default:return null}},Ee=()=>re[he()].selectGuidesOnPress,Un=()=>re[he()].labelsTakePointer,xf=.25,Yn=e=>{const{waitingForView:t}=q();return t?null:(0,s.jsx)(yf,{...e})},yf=({children:e,as:t="g",...r})=>{const n=Nc(),o=t;if(n<=0)return(0,s.jsx)(o,{...r,children:e});const a=R.motion[t];return(0,s.jsx)(a,{...r,initial:{opacity:0},animate:{opacity:1},transition:{duration:xf,delay:n},children:e})},bf=(e,t)=>e.hasAuthoredTextColor?e.textColor:t??e.textColor,Af="_1oj6yix0";var Sf="_1oj6yix2";var Pf=8,wf=16,jf=2,Ef=({indexedLegends:e,containerRect:t})=>{const r=O(),n=T(cs,r),o=T(d.resolveDirectLabelStyle,r),a=(0,d.computeLineBoxHeight)(o),{placements:i,hasOverlap:l}=kf(e,t,a),c=Ee(),u=Un(),h=c||u;if(i.length===0)return null;const v=l?wf:Pf,f=v-jf,m=(0,d.toStrokeDasharray)(o.dashArray,o.strokeWidth);return(0,s.jsxs)(Yn,{as:"div",className:Af,"data-testid":"direct-labels",children:[l&&(0,s.jsx)("svg",{className:"_1oj6yix1",width:t.width,height:t.height,children:i.map(p=>(0,s.jsx)(Lf,{anchorY:p.anchorY,labelY:p.y,endX:f,color:p.payload.color,strokeWidth:o.strokeWidth,dashArray:m},p.payload.key))}),i.map(p=>{const x=Cf(o,p.payload.color,n);return(0,s.jsx)("span",{className:(0,Q.clsx)(Sf,h&&"_1oj6yix3"),style:{...X(x.style),left:v,top:p.y,color:x.textColor},...c?Rt(p.payload.address):Ns(p.payload.address),children:p.payload.label},p.payload.key)})]})},kf=(e,t,r)=>{const{colorScheme:n}=W(),o=L(a=>a.layers);return(0,g.useMemo)(()=>{const a=[];for(const{legend:i,legendIndex:l}of e)i.items.forEach((c,u)=>{if(c.normalizedY===null)return;const h=typeof c.visual.color=="string"?c.visual.color:void 0,v=c.layerId===void 0?void 0:(0,d.findLayerById)(o,c.layerId),f=v===void 0?h:(0,d.readGroupRuleColor)(v,c.value,n)??h;a.push({normalizedY:c.normalizedY,payload:{key:String(a.length),label:c.formattedLabel,color:f,address:{legendIndex:l,itemIndex:u}}})});return a.length===0||t.height<=0?{placements:[],hasOverlap:!1}:(0,d.computeDirectLabelsLayout)({items:a,containerHeight:t.height,labelHeight:r})},[n,e,t.height,r,o])},Cf=(e,t,r)=>{if(e.textOutlineColor!==d.AUTO_COLOR)return{style:e,textColor:bf(e,t)};const n=Rf(t,r);return{style:{...e,textOutlineColor:n},textColor:Tf(e,n)}},Rf=(e,t)=>e===void 0?(0,d.compositeColor)(void 0,t):(0,d.compositeColor)(e,t)??(0,d.removeAlpha)(e),Tf=(e,t)=>t===void 0?e.textColor:e.hasAuthoredTextColor?(0,d.ensureReadableTextColor)(e.textColor,t):(0,d.pickReadableTextColor)(t),Lf=({anchorY:e,labelY:t,endX:r,color:n,strokeWidth:o,dashArray:a})=>{const i=r/2;return(0,s.jsx)("path",{d:`M0,${e} C${i},${e} ${i},${t} ${r},${t}`,fill:"none",stroke:n??"currentColor",strokeWidth:o,strokeDasharray:a})},If="_6a636s0";var Of=.6;var Mf="_1isxsac0",Ho={horizontal:"_1isxsac1",vertical:"_1isxsac2"},Bf="_1isxsac3",Gf="_1isxsac4",Nf="_1isxsac5";var Ff="_1or78v80",Hf="_1or78v81",Df=.64,Wf=.5,Kr=1,zf=.6,Us=({layerId:e,value:t,size:r,itemColor:n,groupAesthetic:o})=>{const{item:a}=T(d.resolveLegendItemStyle,O()),i=gr({layerId:e,groupValue:t,size:r,groupAesthetic:o}),l=vr({layerId:e,groupValue:t,fallback:n??a.textColor}),c=(i.fill===void 0?l:(0,d.toPaintColor)(i.fill))??a.textColor;return{color:c,stroke:Au(A.gray0,c,zf),opacity:i.alpha===void 0?Wf:i.alpha*Df,symbol:i.symbol}},Ys=({size:e,paint:t,showSymbol:r=!1})=>r&&t.symbol!==void 0&&t.symbol!=="circle"?(0,s.jsx)(Uf,{size:e,paint:t,symbol:t.symbol}):(0,s.jsx)(Vf,{size:e,paint:t}),Vf=({size:e,paint:t})=>(0,s.jsx)("span",{className:Ff,"data-testid":"legend-bubble",style:{inlineSize:e,blockSize:e,backgroundColor:t.color,borderColor:t.stroke,opacity:t.opacity}}),Uf=({size:e,paint:t,symbol:r})=>{const n=At(),o=Math.max(0,e-Kr*2);return(0,s.jsx)("svg",{className:Hf,"data-testid":"legend-bubble","data-symbol":typeof r=="string"?r:"image",width:e,height:e,viewBox:`0 0 ${e} ${e}`,opacity:t.opacity,"aria-hidden":!0,children:(0,d.isGeometricSymbol)(r)?(0,s.jsx)(Yf,{size:e,innerSize:o,paint:t,symbol:r}):(0,s.jsx)("g",{transform:`translate(${e/2} ${e/2})`,children:(0,s.jsx)(nr,{symbol:r,glyphs:n,size:o,fill:t.color,stroke:t.stroke,strokeWidth:Kr})})})},Yf=({size:e,innerSize:t,paint:r,symbol:n})=>{const o=(0,d.buildPointSymbolInBox)(n,t,t);return(0,s.jsx)("path",{transform:`translate(${e/2+o.offsetX} ${e/2+o.offsetY})`,d:o.path,fill:r.color,stroke:r.stroke,strokeWidth:Kr})},Kf="_1cecisi0",Xf="_1cecisi1",Qf="_1cecisi2",qf={start:"_1cecisi3",center:"_1cecisi4",end:"_1cecisi5"},_f="_1cecisi6",Jf={right:"_1cecisi7",left:"_1cecisi8"},Zf="_1cecisi9",$f="_1cecisia",ep=({indexedLegend:e,vertical:t,trailing:r,stackOffset:n,maxBubbleSize:o,itemCss:a,hitTestable:i})=>{const{legend:l,legendIndex:c}=e,{item:u}=T(d.resolveLegendItemStyle,O()),h=Ct(l,o),v=h?.bubbles.at(-1),f=Us({layerId:v?.item.layerId,value:v?.item.value,size:v?.size??0});return h===null||v===void 0?null:(0,s.jsxs)("div",{className:(0,Q.clsx)(Mf,{[Bf]:r,[$f]:i,[Ho.vertical]:t,[Ho.horizontal]:!t}),style:{...a,gap:u.gap,marginBlockStart:n},...i?Rt({legendIndex:c,itemIndex:tp(l.items,v.item)}):void 0,children:[h.title!==null&&(0,s.jsx)("span",{className:"_1isxsac6",style:{maxInlineSize:160},children:h.title}),(0,s.jsxs)("div",{className:Gf,style:{gap:u.gap},children:[h.minLabel!==null&&(0,s.jsx)("span",{children:h.minLabel}),(0,s.jsx)("div",{className:Nf,style:{gap:4},children:h.bubbles.map(({size:m},p)=>(0,s.jsx)(Ys,{size:m,paint:f},p))}),(0,s.jsx)("span",{children:h.maxLabel})]})]})},tp=(e,t)=>{const r=e.indexOf(t);return r>=0?r:Math.max(0,e.length-1)},Ks=(e,t)=>({...e.fill===void 0?{}:Ve(e.fill,t),...e.cornerRadius===void 0?{}:{borderRadius:Je(e.cornerRadius)},...e.shadow===void 0?{}:{boxShadow:Xe(e.shadow)},...qs(e.strokeWidth,e.stroke)}),Xs=(e,t)=>({...X(e),...Ks(e,t),...e.alpha===void 0?{}:{opacity:e.alpha},paddingInline:e.paddingInline,paddingBlock:e.paddingBlock}),Qs=e=>e.fill!==void 0||e.strokeWidth>0,rp=(e,t,r)=>({...Ve(e.fill,r),borderRadius:Je(e.cornerRadius),paddingInline:e.paddingInline,paddingBlock:e.paddingBlock,boxShadow:Xe(e.shadow),...e.alpha===void 0?{}:{opacity:e.alpha},...qs(e.strokeWidth,e.stroke),...X(t)}),qs=(e,t)=>e>0&&t!==void 0?{border:`${e}px solid ${t}`}:{},np="var(--_1kjk02r0)",op="_1kjk02r1";var ap={1:"_1kjk02r3",2:"_1kjk02r4"},ip={1:"_1kjk02r5",2:"_1kjk02r6"};var sp={1:"_1kjk02r8",2:"_1kjk02r9"},lp={1:"_1kjk02ra",2:"_1kjk02rb"},Do="_1kjk02rc",cp="_1kjk02rd",Wo="_1kjk02re";var Rr="\0",dp=(e,t)=>{const r=[];for(const{legend:n,legendIndex:o}of e){if((0,d.isBubbleSizeLegend)(n))continue;const a=n.aesthetics.includes("size");n.items.forEach((i,l)=>{if(a){const v=Number(i.visual.size);if(!Number.isFinite(v)||v<=0)return}const c=i.visual.color??"",u=a?`${Rr}${Number(i.visual.size)}`:"",h=i.visual.lineType;r.push({key:`${o}${Rr}${String(i.value)}${Rr}${c}${u}`,address:{legendIndex:o,itemIndex:l},formattedLabel:i.formattedLabel,visual:i.visual,swatchShape:t(i.geom),hasBubbleSwatch:a,primaryLineType:h,layerId:i.layerId,groupValue:i.value})})}return r},_s=({pill:e})=>e.hasBubbleSwatch?(0,s.jsx)(vp,{pill:e}):(0,s.jsx)(hp,{pill:e}),up=({color:e,lineType:t,shape:r,label:n,layerId:o,groupValue:a})=>{const{swatch:i}=T(d.resolveLegendItemStyle,O()),l=gr({layerId:o,groupValue:a,size:i.size}),c=vr({layerId:o,groupValue:a,fallback:e}),u=L(v=>(0,d.readMainAxis)(v.coordSystem)),h=gp(e,c);return h?(0,s.jsx)(jt,{shape:r,color:h,paint:l.fill,surface:"legend",label:n,lineType:t,width:i.size,height:i.size,strokeWidth:i.strokeWidth,alpha:l.alpha,cornerRadius:l.cornerRadius,symbol:l.symbol,mainAxis:u}):null},hp=({pill:e})=>(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(up,{color:e.visual.color,lineType:e.primaryLineType,shape:e.swatchShape,label:e.formattedLabel,layerId:e.layerId,groupValue:e.groupValue}),(0,s.jsx)("span",{children:e.formattedLabel})]}),vp=({pill:e})=>{const t=Number(e.visual.size);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Ys,{size:t,paint:Us({layerId:e.layerId,value:e.groupValue,size:t,itemColor:e.visual.color,groupAesthetic:"size"}),showSymbol:!0}),(0,s.jsx)("span",{children:e.formattedLabel})]})},gp=(e,t)=>e===void 0?void 0:t,zo={[Ws]:""},fp=({hiddenPills:e,placement:t})=>{const r=En(),[n,o]=(0,g.useState)(!1),a=O(),i=T(d.resolveLegendItemStyle,a),l=T(On,a),c=Ee(),{openLegendOverflow:u}=re[he()],h=qe([i.item.fill,l.popover.fill]),v=h(i.item.fill),f=Xs(i.item,v),m=pp(e.length,i.item),p=m===null?void 0:{...Ks(i.item,v),opacity:Of*(i.item.alpha??1)},{refs:x,floatingStyles:y}=(0,ie.useFloating)({open:n,placement:t,middleware:[(0,ie.offset)(4),(0,ie.flip)(),(0,ie.shift)({padding:8})]});(0,g.useEffect)(()=>{u||o(!1)},[u]),(0,g.useEffect)(()=>{if(!n)return;const P=j=>{const C=j.target;if(!C)return;const k=x.reference.current,E=x.floating.current;k instanceof Element&&k.contains(C)||E instanceof Element&&E.contains(C)||o(!1)},w=j=>{j.key==="Escape"&&o(!1)};return document.addEventListener("pointerdown",P),document.addEventListener("keydown",w),()=>{document.removeEventListener("pointerdown",P),document.removeEventListener("keydown",w)}},[n,x.floating,x.reference]);const b=t==="left"||t==="right",S=m===null?[]:Array.from({length:m},(P,w)=>m-w);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{ref:x.setReference,className:(0,Q.clsx)(op,!u&&"_1kjk02r2",m!==null&&b&&ip[m],m!==null&&!b&&ap[m]),...zo,children:[m!==null&&S.map(P=>(0,s.jsx)("span",{className:(0,Q.clsx)("_1kjk02r7",b?lp[m]:sp[m]),style:{...p,...mp(P,b)},"aria-hidden":!0},P)),u?(0,s.jsx)("button",{type:"button",className:Do,style:{...f,...(0,tr.assignInlineVars)({[np]:l.focusStroke})},onClick:()=>o(P=>!P),"aria-haspopup":"dialog","aria-expanded":n,"aria-label":`Show ${e.length} hidden legend ${e.length===1?"item":"items"}`,children:(0,s.jsxs)("span",{className:Wo,children:["+",e.length]})}):(0,s.jsx)("span",{className:(0,Q.clsx)(Do,cp),style:f,children:(0,s.jsxs)("span",{className:Wo,children:["+",e.length]})})]}),n&&(0,s.jsx)("div",{ref:x.setFloating,role:"dialog","aria-label":r("graph.legend.hiddenItems"),className:"_1kjk02rf",style:{...y,...rp(l.popover,i.item,h(l.popover.fill))},...zo,children:(0,s.jsx)("ul",{className:"_1kjk02rg",children:e.map(P=>(0,s.jsx)("li",{className:(0,Q.clsx)("_1kjk02rh",c&&"_1kjk02ri"),style:{gap:i.item.gap},...c?Rt(P.address):void 0,children:(0,s.jsx)(_s,{pill:P})},P.key))})})]})},pp=(e,t)=>{if(!Qs(t))return null;const r=Math.min(e-1,2);return r===1?1:r===2?2:null},mp=(e,t)=>{const r=-e*4;return{transform:t?`translateY(${r}px)`:`translateX(${r}px)`}},xp={top:"bottom",bottom:"top",left:"right",right:"left"},yp=({edge:e,indexedLegends:t,containerWidth:r,containerHeight:n})=>{const o=je(),a=Ne(),i=O(),l=T(On,i),c=T(d.resolveLegendItemStyle,i),u=_(),h=L(E=>E.coordSystem.type),v=Ee(),f=Un(),m=v||f,p=(0,g.useMemo)(()=>dp(t,E=>u(E,h)?.swatchShape??"square"),[t,u,h]),x=(0,g.useMemo)(()=>t.filter(({legend:E})=>(0,d.isBubbleSizeLegend)(E)),[t]),y=e==="left"||e==="right",b=t[0]?.legend.align??"start",S=t.some(({legend:E})=>E.inHeadlineRow),P=(0,g.useMemo)(()=>{const E=y?n:r;if(p.length===0||E<=0)return p.length;const{item:I,swatch:G}=c,z=(0,d.toFontSpec)(I,a.fonts.familyDefault),D=(0,d.computeLineBoxHeight)(I),{inlineChrome:Y,blockChrome:H}=kt(I),N=x.reduce((J,{legend:ne},Ot)=>{const Mt=Ct(ne,Uo(ne,n,I));if(Mt===null)return J;const Bt=Bn({parts:Mt,vertical:y,textMeasurer:o,font:z,itemStyle:I}),Pr=Vo(y,p.length,Ot)?l.stackGap:l.gap;return J+(y?Bt.blockSize:Bt.inlineSize)+Pr},0),K=(J,ne)=>ne+(ne>0?I.gap:0)+o.measureText(J,z).width+Y,V=J=>Math.max(D,J)+H,ye=p.map(J=>{const ne=Ur(J.visual,G.size,J.hasBubbleSwatch);return y?V(J.hasBubbleSwatch?ne:G.size):K(J.formattedLabel,ne)}),It=Qs(I)?8:0,et=(y?V(0):K(`+${p.length}`,0))+It,Fe=Math.max(0,E-N);return bp(ye,et,Fe,l.gap)},[p,x,y,r,n,o,a,l,c]),w=qe([c.item.fill]);if(p.length===0&&x.length===0)return null;const j=p.slice(0,P),C=p.slice(P),k=Xs(c.item,w(c.item.fill));return(0,s.jsxs)("div",{className:(0,Q.clsx)(S?_f:qf[b],Kf,{[Qf]:y,[Xf]:!y,[Jf[e==="left"?"left":"right"]]:y}),style:{gap:l.gap},children:[j.map(E=>(0,s.jsx)("div",{className:(0,Q.clsx)(Zf,m&&"_1cecisia"),style:{...k,gap:c.item.gap},...v?Rt(E.address):void 0,children:(0,s.jsx)(_s,{pill:E})},E.key)),C.length>0&&(0,s.jsx)(fp,{hiddenPills:C,placement:xp[e]}),x.map((E,I)=>(0,s.jsx)(ep,{indexedLegend:E,vertical:y,trailing:!y&&p.length>0,stackOffset:Vo(y,p.length,I)?l.stackGap-l.gap:void 0,maxBubbleSize:Uo(E.legend,n,c.item),itemCss:k,hitTestable:m},E.legendIndex))]})},Vo=(e,t,r)=>e&&(t>0||r>0),Uo=(e,t,r)=>e.inHeadlineRow?vs(t,r):void 0,bp=(e,t,r,n)=>{if(e.reduce((i,l)=>i+l,0)+n*(e.length-1)<=r)return e.length;let o=0,a=0;for(const i of e){const l=o+(a>0?n:0)+i;if(l+n+t>r)break;o=l,a+=1}return a},Ap=(0,g.memo)(function({formattedLegends:t,rects:r}){const n=(0,g.useMemo)(()=>{const a=new Map;return t.forEach((i,l)=>{let c=a.get(i.position);c||(c={pill:[],direct:[]},a.set(i.position,c));const u={legend:i,legendIndex:l};i.display==="pill"?c.pill.push(u):c.direct.push(u)}),a},[t]),{waitingForView:o}=q();return(0,s.jsx)(s.Fragment,{children:Array.from(n,([a,i])=>{const l=r[a];return l===void 0?null:(0,s.jsxs)("div",{className:If,...Ar("legend"),style:{left:l.x,top:l.y,width:l.width,height:l.height},children:[(0,s.jsx)(yp,{edge:a,indexedLegends:i.pill,containerWidth:l.width,containerHeight:l.height}),!o&&(0,s.jsx)(Ef,{indexedLegends:i.direct,containerRect:l})]},a)})})}),Js=(e,t,r)=>{if(e.type==="cartesian")return(0,d.getHoverGuideLineProps)(e,t);const n=Ke(r),o=de(t.x,e.innerRadius,n),a=de(t.x,1,n);return{x1:o.x,y1:o.y,x2:a.x,y2:a.y}},Sp=({layers:e,primaryLayerId:t,coordSystem:r,resolveRenderer:n})=>{const o=e.find(i=>i.id===t);if(!o)return null;const a=n(o.geom,r.type);return a?a.guideMode??null:null},Pp=({panelRect:e})=>{const{coordSystem:t,layers:r,scales:n}=L((0,ee.useShallow)(u=>({coordSystem:u.coordSystem,layers:u.layers,scales:u.scales}))),o=Be(u=>u.hover.primary),a=_(),i=T(kp,O()),{paintHover:l}=re[he()];if(!l||r.length===0||o===null||!o.anchored)return null;const c=Sp({layers:r,primaryLayerId:o.layerId,coordSystem:t,resolveRenderer:a});return c===null?null:c==="crosshair"?(0,s.jsx)(wp,{coordSystem:t,primary:o,panelRect:e,guide:i}):t.type==="polar"?(0,s.jsx)(Ep,{coordSystem:t,primary:o,panelRect:e,guide:i}):(0,s.jsx)(jp,{coordSystem:t,scales:n,primary:o,panelRect:e,guide:i})},wp=({coordSystem:e,primary:t,panelRect:r,guide:n})=>{const o=Js(e,t,r);return(0,s.jsx)(Kn,{panelRect:r,children:(0,s.jsx)("line",{...o,stroke:n.stroke,strokeWidth:1,strokeDasharray:"4 3",strokeLinecap:"round","data-testid":"hover-guide-line"})})},jp=({coordSystem:e,scales:t,primary:r,panelRect:n,guide:o})=>{const a=(0,d.getHoverGuideRectProps)(e,t,r);return a===null?null:(0,s.jsx)(Kn,{panelRect:n,children:(0,s.jsx)("rect",{...a,fill:(0,d.toPaintColor)(o.fill),"data-testid":"hover-guide-rect"})})},Ep=({coordSystem:e,primary:t,panelRect:r,guide:n})=>{const o=(0,d.getPolarHoverGuideArcProps)(e,t);if(o===null)return null;const a=(0,d.buildPolarBarArcPath)(o);return a?(0,s.jsx)(Kn,{panelRect:r,children:(0,s.jsx)("svg",{viewBox:"-1 -1 2 2",preserveAspectRatio:"xMidYMid meet",width:"100%",height:"100%",style:{overflow:"visible"},children:(0,s.jsx)("path",{d:a,fill:(0,d.toPaintColor)(n.fill),"data-testid":"hover-guide-arc"})})}):null},Kn=({panelRect:e,children:t})=>(0,s.jsx)("svg",{x:e.x,y:e.y,width:e.width,height:e.height,style:{overflow:"visible",pointerEvents:"none"},"data-testid":"hover-guide",children:t}),kp=e=>e.hoverGuide().resolve(),Cp=(e,t)=>e*10*t,Xn={"clapping-hands":{aspectRatio:1.059,src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEQAAABICAYAAABP0VPJAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABipSURBVHgB7VwJfFTVuf/uMvtMlplJJiEhBEhYwiIYNgExUBSQ6qMqblWrz5/WtfBa67NiH1iftbW1VqWghWqt+opFfajFBRcSUMImEBISspCFSTIh++zbXfqdO3cmswWSSPVHf/1+ub977znfPfec//m28507Afg3/ZvORsxwmEVRpJDo0tISCqA0XEzJBx06bwjXUXAB0lA7TZWUlDCtra3Mtm3vjCUF1113dbNWqxXItcfjod966718igpSubm5ow8fPnx8zZo1fQ0NMzlR/JuAIIrwL0LU6tWrmfz8fLXD4XgYJaRPlEkQhH6v1/s6lj9FrsU44nm+BevuAihWbNiwgYZ/ASLSw5aXfzU5EAjuFUdICNr/ElDgAlWhCBHJ2L//SFGy2R8uWa3ty9G2XNBSQhUVFSmJ2IvngdDGvEHaS/YeUZQkhykuLlaEeIoV5JpMCEiGWgKSHTg2yMb7GyTSmZqamksGG6DP1ZdQhqpha6jcd7Tp6MdOjuMc0XUEWDS2mriBEEPNfvrppxa32/2k3+9/H/kqgsHgHp/Pt7Gzs+cGi8Wis1qty8k9sVfk3N5+ZllBQYFKBugbAUaSjra2tgfiB+040yS+u75E/PDpVVGz77VJdZ1N4ubVIP5uFf2VyTR9bmVl7ZYwTyDAWdPT01Mh5JojYDQ1Nc07mxRinT1ZObFp9fVN8wCKlHh7XkGJ0Wu5cbasrOw/s7KynkzgxlpnVzO0V5eC390vFdXUnPqInJXaNOm+x6Mq3bz5l1Nxxh0cx7tIGc9zrq1bt45Hb0XUhkEJpJ9//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/vnDHtGmTl/t8nlnwMVIgEGxobj61ff365956/fX3+miajUajqUh+floMlwLZVpOlwI213Y8KhEQ0zoS1rw/ssViaE88TnTYbje55yrp27RdLli+/eW5FRWmt2+2qdDod+WNpmChADCg3XLjQe6Su7mfb3377wIDFkha3WKzxZDIVc7myo70k3g9j/4mjmj4uIKS2iEjSlZULneFw0j40xNgx/mh3u22OWCxisdnsttra2d677769sqhofGF2dlYhAuOx24kDQnGxWDyM56/BgYHB7nA4GnzrrYMnNm16uSuZTCRp2pqiaWcSj/HjiUQqjoo6XlWVSjY3T2XMfn9xNYP/uIn/DwHCT5RrrTk5SVt/P2tLT0/ZHQ7ayrIYeuEslliMoR38V0AszXFWjOEk+dlMJGjW4aC4eNzKoIvNxuPRpNttZzCfsNsHk/39JJJBIpYN/B4NPib6JICQiYDR1NREbd16FkHxEF1CJ5NOSyo1YmEY8vEhQ7lwNzUyEiaAUB5PJktRFi6MB0IWC5OyWtMZmy3GdHcHyPcyyHQDf4QMH2EJ/C0Q7rb5ACcxa+QfZljJD+vJD2SEf4VALpImF3/wZBFNoBQv/0Tp/wB4VebDeUtu1AAAAABJRU5ErkJggg=="},rocket:{aspectRatio:1.046,src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEEAAABECAYAAADeOlj2AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABf2SURBVHgB7VsJeFTluX7PnFmTzEz2ENZookLYCYggF4N1gSs8tloorqVFWqsWNyxorzZcWmpdwF1xt9figrQVxWrRCopFLAgkmBBAzB6ykNm3M3Pm3Pc/ExWYJITFFvv05zmcyTlnzvn/9/++9/u+9z8D/Kf9p4km49+rSZqmSWyG9evXG0pLS+WsrCy5b99m+YwzSg01NTVdfwn/Hk2MQy4uLjYEg0HD+++/P9LpzBhlNhsHmUymgaqqemKxWK3f798xefLk9Xv3jo4Bq+L8joZveysrKzNwZwQKrE1NTReGQpEX4/G4W+uhEZDaTZ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YII="},"thumbs-up":{aspectRatio:1.063,src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABECAYAAAAx+DPIAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABSHSURBVHgB7VwLcFzVef7PfezefWklZEl+BQQSGGQsMMa0vFXStCRAaQsaEpoyZTINTMkwHaAloWlRTcNQZkImSTNTmoG4YEoTOhkTkjF1gYgE6leEjQ0yorIs23pYLySttK/7Ov3/c+5Ku3uv1qJIUGfyjw93d+8595z/P//zO1cA/IZ+Qx8nMc45A+hQ8LMG0KZt2rRJpyvd89rHuyD4+IjmUpqbP6v94hdPtcXj8YvC4XCr4zjTuVzuYF/fwOuXXtrah30cbC42Dr8u1NHRobS0tISGhoauR4aP8QUom81u6+rqugBgk05j4BPQiCUnqfKb9HQ6/Q2+SKK+zc3NYRyuwOlMyAtdtEOHDl/BPyRls/ltjY2NBpzOQpC732hUUvvKQshuI9OB09UUyI7J7gO5Sx3kfPBJzoeeQU6HFxRCKpV6UEaK05Bo96amph7zcZUb4fytGzh/53PY8PrW73N+fGugAFzXndq+fftqL3QuOS2rfeHuqbquX+S7MfqinJmpwBUdeDgCMPFDgMPf8HVljCWvueaaO9rbO5bFDJZVAPl8lcqYkvTdyPQJq+aKhi0KoBrAdTT1yVcBhn7m6445w427dq0NSZ+ytLScAsCsb5TYrLBoFf9FgKtxXAkKIIaacOyHvl6oRVdu2bJlBWrD6SWAine4vHImtYCuoKBAzKMAM+/7hlx33WeubW9vP30EQA6surqamaZ1wnczVE8dMOF1gbl5VBUTWKES0FAQ0z2+IYYRPquvr2/J16vBMpHU1jo32G6Z0ADGLcz8sygLG4VhS61QUQsyQ0HPq8lmu04rEwBScKQFihoSgiM1wMngFYXBsQZSgnnEcMhSqbUq50tbIy2bBhC1tqquqqr+KEBMCEbIDEj9cR/cwnf3VI8teJAloWUTAPFXW5tA/pUq301zdJ4NIQxnPlhYqAmRVb4hqdT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j5IydO5/940su2fCxaASV8fv2vfP49dff8ZyqZiY+/emNaaxwnVONY6d+NLC2tjYVsTStv38V9h9GlboA26hLKFJnZ6enYgSkvKs2NGh6JmOiEBLRdDodjkY148knH/2tyy7beF1tbdXmeDx+Liwhob3/z+Dg6GsPPPD4v/7yl10jnOtTqZSJzq/LWsz4xQigvH9FmyK0bP16ekWtPnTixIxh23YYj6YM153VNC2sY0qrPvroX62rr1+RoJMPjv/QpOglcPHcX/2qexi1ZtUFFzSuQ81JGEYoiS1Gf1xCfoc6ou8Z3rfv0Huvv757sLNz95SqGmY6zTKhkJ6uq0tkent3VHwzrJyh5SDvuZsoylCBrJMJIRN6OKxorququZzL8HAHMLJhve4q+TxBwfJgW353WSiEJ6SQxRPrqGJZGdeDlKmmcNEfoflpDsIBFh54mOHwmvz4+E9y9LYotkW/VL1cAph7PiU/TPxFRAv6k6RqWWnFNHWNi+Se/iQuoszMzHqMUZ5cjVo0wVwXqyHMkriotYkcFo8nEbbLoMZkUYQRR9OyzthYEu18Gtt6bC/8//6z+/m3S0H1XnrW0L+QlhSaWtS8/7kCaVBLSP4NMTXxmxi/FH9i/7+rT2twf4PgbQAAAABJRU5ErkJggg=="}},Rp=3.2,Zs=(e,t,r)=>{const n=Xn[e.sticker];if(n===void 0)return null;const o=Cp(Rp,r),{width:a,height:i}=n.aspectRatio>=1?{width:o,height:o/n.aspectRatio}:{width:o*n.aspectRatio,height:o},l=(0,d.projectAnchorToPanel)(e.at,t);return{x:l.x-a/2,y:l.y-i/2,width:a,height:i}},Tp=(e,t,r)=>{for(const n of Object.values(nl)){const o=n(e,t,r);if(o!==null)return o}return null},Lp=e=>nl[e]!==void 0,$s=(e,t,r)=>rl(e,r,t/2),el=(e,t)=>{const r=(0,d.projectAnchorToPanel)(e.start,t),n=(0,d.projectAnchorToPanel)(e.end,t);return r.x===n.x&&r.y===n.y?null:{shape:"segment",start:r,end:n}},tl=(e,{panel:t,measuredBoxes:r})=>{const n=r.get(e.id);if(n===void 0)return null;const o=(0,d.alignUnitFractions)(e.align),a=(0,d.projectAnchorToPanel)(e.at,t);return{shape:"rect",rect:{x:a.x-o.x*n.width,y:a.y-o.y*n.height,width:n.width,height:n.height}}},at=(e,t)=>(r,n,o)=>{const a=e(r).find(i=>i.id===n);return a===void 0?null:t(a,o)},rl=(e,t,r=0)=>{const n=(0,d.projectRegionToPanel)(e,t);return{shape:"rect",rect:{x:n.x-r,y:n.y-r,width:n.width+r*2,height:n.height+r*2}}},nl={text:at(e=>e.textAnnotations,tl),shape:at(e=>e.shapes,(e,t)=>$s(e.region,t.readers.annotation.shape(e.id).get("strokeWidth"),t.panel)),image:at(e=>e.images,(e,t)=>rl(e.region,t.panel)),arrow:at(e=>e.arrows,(e,t)=>el(e,t.panel)),sticker:at(e=>e.stickers,(e,t)=>{const r=Zs(e,t.panel,t.readers.graph().get("textScale"));return r===null?null:{shape:"rect",rect:r}})},ol=(e,t)=>{const r=(0,d.findAnnotation)(e,t);return r!==null&&Lp(r.kind)&&(0,d.canDragAnnotation)(r)},Tt=()=>{const e=le(t=>t.caret===null?Nn(t):null);return L(t=>e!==null&&ol(t.spec.annotations,e)?e:null)},Ip=200,Op=({engine:e,store:t,overlayRef:r})=>{const{hoverTolerance:n,trackHover:o}=re[he()],a=(0,Ye.useStore)(t,c=>c.editorOwnsQuery),{waitingForView:i}=q(),{store:l}=W();(0,g.useEffect)(()=>{const c=r.current;if(!c)return;const u=Mp(c,e),h=o&&!a&&!i?Gp(c,e,t,l,n??void 0):void 0;return()=>{h?.(),u()}},[e,t,l,r,n,o,a,i])},Mp=(e,t)=>{const r=()=>{const i=e.getBoundingClientRect();i.width===0||i.height===0||t.setViewport({width:i.width,height:i.height})};let n=null;const o=()=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{n=null,r()},Ip)},a=new ResizeObserver(o);return a.observe(e),r(),()=>{a.disconnect(),n!==null&&clearTimeout(n)}},Bp=(e,t)=>e.kind==="cursor"?null:{x:t.left+e.point.x,y:t.top+e.point.y,placement:e.placement,annotationId:e.annotationId},Gp=(e,t,r,n,o)=>{let a=null,i=null;const l=()=>{const y=e.getBoundingClientRect();return y.width>0&&y.height>0?y:null},c=(y,b)=>({x:y.clientX-b.left,y:y.clientY-b.top}),u=()=>{i=null;const y=a;if(!y)return;const b=l();if(b===null)return;const S=c(y,b),P=r.getState();if(P.suspendsHover)return;const w=(0,d.findPointerRegion)(S,P.pointerRegions),j={width:b.width,height:b.height};if(w!==null){P.setHoverState(t.query(w.cursor,{tolerance:o,viewport:j})),P.setTooltipAnchor(Bp(w.tooltip,b));return}const C=(0,d.toPanelCursor)(S,b);P.setHoverState(t.query(C,{tolerance:o,viewport:j})),P.setTooltipAnchor(null)},h=()=>{const y=r.getState();y.hover.primary===null&&y.tooltipAnchor===null||(y.setHoverState(d.RESTING_HOVER_STATE),y.setTooltipAnchor(null))},v=y=>{const b=r.getState();if(b.pointerRegions.length===0)return!1;const S=l();return S===null?!1:(0,d.findPointerRegion)(c(y,S),b.pointerRegions)!==null},f=y=>{r.getState().suspendsHover||v(y)||(document.removeEventListener("pointermove",f),h())},m=y=>{document.removeEventListener("pointermove",f),a=y,i===null&&(i=requestAnimationFrame(u))},p=y=>{if(a=null,i!==null&&(cancelAnimationFrame(i),i=null),!r.getState().suspendsHover){if(v(y)){document.addEventListener("pointermove",f);return}h()}};e.addEventListener("pointermove",m),e.addEventListener("pointerleave",p);const x=n.subscribe((y,b)=>{y.scene===b.scene||a===null||i!==null||(i=requestAnimationFrame(u))});return()=>{e.removeEventListener("pointermove",m),e.removeEventListener("pointerleave",p),document.removeEventListener("pointermove",f),x(),i!==null&&cancelAnimationFrame(i),a=null}},Np=({panelRect:e})=>{const{engine:t,store:r,overlayRef:n}=Ie(),o=le(v=>v.caret!==null),{trackHover:a,showMenuTriggerOnHover:i}=re[he()],l=le(v=>v.standingInteraction?.kind==="box-draw"),c=Tt()!==null,u=le(cg),h=i?"copy":void 0;return Op({engine:t,store:r,overlayRef:n}),(0,s.jsx)("rect",{ref:n,x:e.x,y:e.y,width:e.width,height:e.height,fill:"transparent",pointerEvents:a&&!o?"all":"none",cursor:Hp({drawingBox:l,isOverMovableAnnotation:c,isOverSelectable:u,plotCursor:h}),"data-testid":"pointer-capture-layer"})},Fp=(e,t)=>e?"move":t?"pointer":void 0,Hp=({drawingBox:e,isOverMovableAnnotation:t,isOverSelectable:r,plotCursor:n})=>{if(!e)return Fp(t,r)??n},Tr="data-hover-active",Dp=e=>{const{store:t}=Ie(),{paintHover:r}=re[he()],n=(0,Ye.useStore)(t,a=>a.hover.primary!==null),o=r&&n;(0,g.useEffect)(()=>{const a=e.current;if(a)return o?a.setAttribute(Tr,"true"):a.removeAttribute(Tr),()=>{a.removeAttribute(Tr)}},[e,o])},Lt=()=>le(e=>Re(e,"move-drag")?.annotationId??Re(e,"shape-resize-drag")?.annotationId??Re(e,"arrow-endpoint-drag")?.annotationId??null),Wp=()=>{const e=L(n=>n.spec.annotations),t=(0,g.useMemo)(()=>Xp(e),[e]),r=le(n=>{const o=Re(n,"move-drag")??Re(n,"arrow-endpoint-drag");return o!==null&&t(o).size>0?o:null});return(0,g.useMemo)(()=>r===null?null:{drag:r,dependentIds:t(r)},[r,t])},zp=(e,t,r,n)=>{if(r.kind==="arrow-endpoint-drag")return Yp(e,r,n);const o=(0,d.indexSceneAnnotations)(t).get(r.annotationId);if(o===void 0)return e;const a=(c,u)=>c.map(h=>h.id===u.id?u:h),i=c=>al(c,r.translation,n),l=c=>qp(c,r.translation,n);switch(o.kind){case"text":return{...e,textAnnotations:a(e.textAnnotations,{...o.annotation,at:i(o.annotation.at)})};case"sticker":return{...e,stickers:a(e.stickers,{...o.annotation,at:i(o.annotation.at)})};case"arrow":return{...e,arrows:a(e.arrows,{...o.annotation,start:i(o.annotation.start),end:i(o.annotation.end)})};case"shape":return{...e,shapes:a(e.shapes,{...o.annotation,region:l(o.annotation.region)})};case"image":return{...e,images:a(e.images,{...o.annotation,region:l(o.annotation.region)})};case"differenceArrow":case"pinnedNumber":case"comment":return e}},Vp=(e,t,r)=>{const n=(o,a)=>o.map(i=>r.has(i.id)?a.find(l=>l.id===i.id)??i:i);return{...e,textAnnotations:n(e.textAnnotations,t.textAnnotations),stickers:n(e.stickers,t.stickers),arrows:n(e.arrows,t.arrows),shapes:n(e.shapes,t.shapes),images:n(e.images,t.images)}},Up=(e,t,r)=>{if(r.kind!=="arrow-endpoint-drag")return t;const n=e.arrows.find(o=>o.id===r.annotationId);return n===void 0?t:{...t,arrows:t.arrows.map(o=>o.id===r.annotationId?{...o,[r.endpoint]:n[r.endpoint]}:o)}},Yp=(e,t,r)=>{const n=e.arrows.find(a=>a.id===t.annotationId);if(n===void 0)return e;const o={...n,[t.endpoint]:Kp(t.placement,r)};return{...e,arrows:e.arrows.map(a=>a.id===n.id?o:a)}},Kp=(e,t)=>{const r=(0,d.toPanelCursor)(e.point,t);if(e.type!=="snapped"||e.anchor.align!=="auto")return r;const{target:n}=e;if(n.type==="annotation")return{...r,defer:{type:"annotationRef",ref:n.id,align:"auto"}};const{layerId:o}=n.point.anchor;if(o===void 0)return r;const a=[{layerId:o,observationIndex:n.point.observationIndex}];return{...r,defer:{type:"observationBox",observations:a,align:"auto"}}},Xp=e=>{const t=new Map,r=n=>{const o=t.get(n);if(o!==void 0)return o;const a=(0,d.collectDependentAnnotationIds)(e,n);return t.set(n,a),a};return n=>{const o=r(n.annotationId);return n.kind!=="arrow-endpoint-drag"||!Qp(e,n)?o:new Set([...o,n.annotationId])}},Qp=(e,t)=>{const r=e.arrows.find(n=>n.id===t.annotationId)?.[t.endpoint==="start"?"end":"start"];return(r?.anchorType==="observation"||r?.anchorType==="annotation")&&r.align==="auto"},al=(e,t,r)=>{const{defer:n,space:o,...a}=e,{x:i,y:l}=(0,d.projectAnchorToPanelFraction)(e,r);return{...a,x:i+t.x,y:l+t.y}},qp=(e,t,r)=>{const{width:n,height:o}=(0,d.toPanelRegion)(e,r);return{...al(e,t,r),width:n,height:o}},$e=e=>{const t=L(u=>u.annotations),r=xs(),n=Gv(),o=il(e),a=(0,g.useCallback)(u=>Yo(n,"cycle",u,`Annotation reference cycle detected; dropping annotation(s): ${u.join(", ")}`),[n]),i=(0,g.useCallback)(u=>Yo(n,"missing-ref",u,`Annotation reference target(s) no longer exist (dropped during compilation); dropping annotations referencing: ${u.join(", ")}`),[n]),l=(0,g.useMemo)(()=>(0,d.resolveDeferredAnchors)({annotations:t,panelRect:e,measuredBoxes:r,observationBoxes:o,onCycle:a,onMissingRef:i}),[t,e,r,o,a,i]),c=Wp();return(0,g.useMemo)(()=>{if(c===null)return l;const u=zp(t,l,c.drag,e);if(u===t)return l;const h=(0,d.resolveDeferredAnchors)({annotations:u,panelRect:e,measuredBoxes:r,observationBoxes:o,onCycle:a,onMissingRef:i}),v=Vp(l,h,c.dependentIds);return Up(l,v,c.drag)},[l,c,t,e,r,o,a,i])},il=e=>{const t=L(a=>a.layers),r=L(a=>a.coordSystem),n=_(),o=Te();return(0,g.useMemo)(()=>(0,d.createObservationBoxReader)({layers:t,coordSystem:r,readPaintedRect:(a,i)=>n(a.geom,r.type)?.getObservationRect?.({layer:a,coordSystem:r,observation:i,panelRect:e,styleReaders:o(a)})??null}),[t,r,n,o,e])},Yo=(e,t,r,n)=>{const o=[t,...[...r].sort()].join("\0");e.has(o)||(e.add(o),console.warn(n))},_p=16,sl=({linePath:e,strokeWidth:t})=>(0,s.jsx)("path",{d:e,stroke:"transparent",strokeWidth:Math.max(t,_p),fill:"none",pointerEvents:"stroke"}),Jp=1.4,Zp={light:{primary:"#1D2129",inverse:"#FFFFFF"},dark:{primary:"#FFFFFF",inverse:"#1D2129"}},ll=({computed:e,style:t,addressable:r})=>{const n=(0,g.useId)(),{colorScheme:o}=Et(),a=e.dashArray?{strokeDasharray:e.dashArray,strokeDashoffset:e.dashOffset}:{},i=t.outline.shadow==="none"?null:t.outline.shadow,l=t.outline.strokeWidth>0,c=Zp[o],u=t.outline.stroke??tm(t.stroke,c.primary,c.inverse),h=i===null?null:em(e,t.outline.strokeWidth,i.blur);return(0,s.jsxs)("g",{pointerEvents:r?void 0:"none",children:[r&&(0,s.jsx)(sl,{linePath:e.linePath,strokeWidth:e.strokeWidth}),i!==null&&h!==null&&(0,s.jsx)("defs",{children:(0,s.jsx)("filter",{id:n,filterUnits:"userSpaceOnUse",...h,children:(0,s.jsx)("feDropShadow",{dx:i.offsetX,dy:i.offsetY,stdDeviation:i.blur,floodColor:i.color})})}),(0,s.jsxs)("g",{filter:i===null?void 0:`url(#${n})`,children:[l&&(0,s.jsx)("path",{d:$p(e),stroke:u,strokeWidth:e.strokeWidth+2*t.outline.strokeWidth,strokeLinecap:"round",fill:"none"}),(0,s.jsx)("path",{d:e.linePath,stroke:t.stroke,strokeWidth:e.strokeWidth,strokeLinecap:"round",fill:"none",...a}),e.startArrowheadPath.length>0&&(0,s.jsx)("path",{d:e.startArrowheadPath,stroke:t.stroke,strokeWidth:e.strokeWidth,strokeLinecap:"round",fill:"none"}),e.endArrowheadPath.length>0&&(0,s.jsx)("path",{d:e.endArrowheadPath,stroke:t.stroke,strokeWidth:e.strokeWidth,strokeLinecap:"round",fill:"none"})]})]})},$p=e=>[e.linePath,e.startArrowheadPath,e.endArrowheadPath].filter(t=>t.length>0).join(" "),em=(e,t,r)=>{const n=e.arrowheadExtent+e.strokeWidth+t+r;return{x:Math.min(e.startX,e.endX)-n,y:Math.min(e.startY,e.endY)-n,width:Math.abs(e.endX-e.startX)+2*n,height:Math.abs(e.endY-e.startY)+2*n}},tm=(e,t,r)=>{try{return(0,Ql.getContrast)(e,t)<Jp?r:t}catch{return r}},rm=({panelRect:e,editable:t})=>{const{arrows:r}=$e(e),n=Lt(),o=Tt(),a=O(),i=(0,g.useMemo)(()=>r.filter(l=>l.id!==n).flatMap(l=>{const c=(0,d.resolveArrowAnnotationStyle)(a,l.id),u=(0,d.computeArrow)({arrow:l,style:c,panelWidth:e.width,panelHeight:e.height});return u===null?[]:[{computed:u,style:c}]}),[r,n,e.width,e.height,a]);return i.length===0?null:(0,s.jsx)("g",{transform:`translate(${e.x}, ${e.y})`,"data-testid":"arrows",children:i.map(({computed:l,style:c})=>(0,s.jsx)("g",{...Ze({kind:"annotation",id:l.id}),cursor:o===l.id?"move":void 0,children:(0,s.jsx)(ll,{computed:l,style:c,addressable:t})},l.id))})},cl=()=>{const{selectionStore:e}=W();return(0,Ye.useStore)(e,t=>t.selection)},Lr=({linePath:e,arrowheadPath:t,stroke:r,strokeWidth:n,addressable:o,dashed:a=!1})=>{const i={stroke:r,strokeWidth:n,strokeLinecap:"round",fill:"none"};return(0,s.jsxs)("g",{pointerEvents:o?void 0:"none","data-preview":a||void 0,children:[o&&(0,s.jsx)(sl,{linePath:e,strokeWidth:n}),(0,s.jsx)("path",{d:e,...i,strokeDasharray:a?`${n*1.5} ${n*3}`:void 0}),(0,s.jsx)("path",{d:t,...i,strokeLinejoin:"round"})]})},Ir=({x:e,y:t,text:r,box:n,label:o,arrowColor:a,addressable:i})=>{const{fonts:l}=Ne(),c=yr(o.cornerRadius),u=o.shadow===void 0?void 0:Ge(o.shadow),h={fill:(0,d.toPaintColor)(o.fill),stroke:o.stroke??a,strokeWidth:o.strokeWidth,style:u===void 0?void 0:{filter:u}};return(0,s.jsxs)("g",{pointerEvents:i?void 0:"none",opacity:o.alpha,children:[c===null?(0,s.jsx)("path",{d:Cn(n,o.cornerRadius),...h}):(0,s.jsx)("rect",{x:n.x,y:n.y,width:n.width,height:n.height,rx:c,...h}),(0,s.jsx)("text",{x:e,y:t,dominantBaseline:"central",textAnchor:"middle",fill:o.textColor,style:{..._e(o,l.familyDefault),...pr(o)},...fr(o),children:(0,d.applyTextTransform)(r,o.textTransform)})]})},nm="_1i8rg6j0",om="75%",am=({panelRect:e,editable:t})=>{const r=Es(),n=le(Nn),o=cl(),a=(0,g.useMemo)(()=>new Set(o.filter(i=>i.kind==="annotation").map(i=>i.id)),[o]);return r.length===0?null:(0,s.jsx)("g",{transform:`translate(${e.x}, ${e.y})`,"data-testid":"difference-arrows",children:r.map(({color:i,style:l,id:c,linePath:u,arrowheadPath:h,labelPosition:v,labelBox:f,labelText:m,dragging:p,hasComparableEndpoints:x,committedLinePath:y,committedArrowheadPath:b,committedLabelPosition:S,committedLabelBox:P,committedLabelText:w,committedColor:j})=>{const C=n===c&&!a.has(c),k=p&&!x,E=k?A.alert:i,I=C&&!k?im(E):E,G=p&&y!==void 0&&b!==void 0&&S!==void 0&&j!==void 0;return(0,s.jsxs)("g",{className:n===c?nm:void 0,"data-warning":k||void 0,...Ze({kind:"annotation",id:c}),children:[G&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Lr,{linePath:y,arrowheadPath:b,stroke:j,strokeWidth:l.strokeWidth,addressable:!1}),(0,s.jsx)(Ir,{x:S.x,y:S.y,text:w,box:P,label:l.label,arrowColor:j,addressable:!1})]}),p?(0,s.jsxs)("g",{"data-preview":"true",children:[(0,s.jsx)(Lr,{linePath:u,arrowheadPath:h,stroke:I,strokeWidth:l.strokeWidth,addressable:t,dashed:!0}),(0,s.jsx)(Ir,{x:v.x,y:v.y,text:m,box:f,label:l.label,arrowColor:I,addressable:t})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Lr,{linePath:u,arrowheadPath:h,stroke:I,strokeWidth:l.strokeWidth,addressable:t}),(0,s.jsx)(Ir,{x:v.x,y:v.y,text:m,box:f,label:l.label,arrowColor:I,addressable:t})]})]},c)})})},im=e=>`color-mix(in srgb, ${e} ${om}, ${A.textPrimary})`,sm={fill:"none",contain:"xMidYMid meet",cover:"xMidYMid slice"},dl=({image:e,panel:t,style:r})=>{const n=(0,g.useId)(),{src:o,region:a,fit:i}=e,l=(0,d.projectRegionToPanel)(a,t),c=R0(r.cornerRadius),u=yr(r.cornerRadius),h=r.shadow===void 0?void 0:Ge(r.shadow);return(0,s.jsxs)("g",{opacity:r.alpha,style:h===void 0?void 0:{filter:h},children:[c&&(0,s.jsx)("clipPath",{id:n,children:u===null?(0,s.jsx)("path",{d:Cn(l,r.cornerRadius)}):(0,s.jsx)("rect",{...l,rx:u})}),(0,s.jsx)("image",{href:o,...l,preserveAspectRatio:sm[i],clipPath:c?`url(#${n})`:void 0})]})},Ko=({panelRect:e,zOrder:t})=>{const r=$e(e).images,n=O(),o=Lt(),a=Tt(),i=r.filter(l=>l.zOrder===t&&l.id!==o);return i.length===0?null:(0,s.jsx)("svg",{x:e.x,y:e.y,width:e.width,height:e.height,overflow:"visible","data-testid":`image-annotations-${t}`,children:i.map(l=>(0,s.jsx)("g",{...Ze({kind:"annotation",id:l.id}),cursor:a===l.id?"move":void 0,children:(0,s.jsx)(dl,{image:l,panel:e,style:n.annotation.image(l.id).resolve()})},l.id))})},ul=({shape:e,style:t,panel:r})=>{const n=(0,d.projectRegionToPanel)(e.region,r);return(0,s.jsx)("rect",{x:n.x,y:n.y,width:n.width,height:n.height,fill:(0,d.toPaintColor)(t.fill),fillOpacity:t.fillAlpha,opacity:t.alpha,stroke:(0,d.getShapeAnnotationStroke)(t)??"none",strokeWidth:t.strokeWidth})},Xo=({panelRect:e,zOrder:t})=>{const r=$e(e).shapes,n=O(),o=Lt(),a=Tt(),i=r.filter(l=>l.zOrder===t&&l.id!==o);return i.length===0?null:(0,s.jsx)("svg",{x:e.x,y:e.y,width:e.width,height:e.height,overflow:"visible","data-testid":`shapes-${t}`,children:i.map(l=>(0,s.jsx)("g",{...Ze({kind:"annotation",id:l.id}),cursor:a===l.id?"move":void 0,children:(0,s.jsx)(ul,{shape:l,style:n.annotation.shape(l.id).resolve(),panel:e})},l.id))})},lm="_1aj6s5s0",cm="_1aj6s5s1",dm=Object.fromEntries(si.map(e=>[A[e],e])),Xr=(e,t)=>{const r=dm[e];return r===void 0?e:t[r]},hl=e=>{const{themeValues:t,graphBackground:r}=Et();return um(e,t,r)},um=(e,t,r)=>{if(e.hasAuthoredTextColor||e.fill==="transparent")return e.textColor;const n=(0,d.withAlpha)(Xr((0,d.toPaintColor)(e.fill),t),e.fillAlpha),o=r===void 0?void 0:Xr(r,t),a=(o===void 0?void 0:(0,d.compositeColor)(n,o))??(0,d.removeAlpha)(n);return a===void 0?e.textColor:(0,d.ensureReadableTextColor)(e.textColor,a)},hm=.1,vm=({annotation:e,panel:t,style:r,blockRef:n})=>(0,s.jsx)(vl,{annotation:e,panel:t,style:r,blockRef:n,children:(0,s.jsx)(Ue,{content:e.content})}),vl=({annotation:e,panel:t,style:r,blockRef:n,children:o})=>{const a=hl(r),i=(0,d.projectAnchorToPanel)(e.at,t);return(0,s.jsx)("foreignObject",{x:i.x,y:i.y,width:(0,d.toPercent)(e.width),height:t.height,overflow:"visible",pointerEvents:"none",children:(0,s.jsx)("div",{ref:n,className:lm,style:{...fm(r,a),transform:gm(e.align)},children:o})})},gm=e=>{const t=(0,d.alignUnitFractions)(e);return`translate(${-t.x*100}%, ${-t.y*100}%)`},fm=(e,t)=>{const{backgroundColor:r,borderShadow:n}=pm(e),o=[n,e.shadow===void 0||e.shadow==="none"?void 0:Xe(e.shadow)].filter(a=>a!==void 0);return{...X(e),color:t,padding:`${e.paddingBlock}px ${e.paddingInline}px`,borderRadius:Je(e.cornerRadius),opacity:e.alpha,...r===void 0?{}:{backgroundColor:r},...o.length===0?{}:{boxShadow:o.join(", ")}}},pm=e=>{if(e.fill==="transparent")return{};const t=(0,d.toPaintColor)(e.fill),r=e.fillAlpha<1?Z(t,e.fillAlpha):t;if(e.strokeWidth<=0)return{backgroundColor:r};const n=e.stroke??yu(t,hm);return{backgroundColor:r,borderShadow:`0 0 0 ${e.strokeWidth}px ${n}`}},mm=e=>{const t=$e(e).textAnnotations,r=le(n=>Re(n,"text-resize-drag"));return(0,g.useMemo)(()=>t.map(n=>gl(n,r)),[t,r])},gl=(e,t)=>t===null||t.annotationId!==e.id?e:{...e,at:{...e.at,x:e.at.x+t.shift},width:t.width},xm=({panelRect:e})=>{const t=mm(e),r=O(),n=Lt(),o=Tt(),a=t.filter(i=>i.id!==n);return a.length===0?null:(0,s.jsx)("svg",{x:e.x,y:e.y,width:e.width,height:e.height,overflow:"visible","data-testid":"text-annotations",children:a.map(i=>(0,s.jsx)(ym,{annotation:i,panel:e,style:(0,d.resolveTextAnnotationStyle)(r,i.id),movable:o===i.id},i.id))})},ym=({annotation:e,panel:t,style:r,movable:n})=>{const o=ys(e.id),a=le(l=>l.caret?.annotationId===e.id),{TextAnnotation:i}=Hn();return(0,s.jsx)("g",{...Ze({kind:"annotation",id:e.id}),cursor:n?"move":void 0,children:(0,s.jsx)(vl,{annotation:e,panel:t,style:r,blockRef:o,children:a&&i?(0,s.jsx)(i,{annotation:e}):(0,s.jsx)(Ue,{content:e.content})})})},bm="ph8bdc0";var Am="ph8bdc2",Qo={hittable:"ph8bdc4 ph8bdc3",inert:"ph8bdc5 ph8bdc3"},Sm=({cx:e,cy:t,color:r,style:n})=>{const o=Ge(n.shadow);return(0,s.jsx)("circle",{cx:e,cy:t,r:n.size/2,style:{fill:r,stroke:n.stroke,strokeWidth:n.strokeWidth,...o===void 0?{}:{filter:o}}})};function Pm(e){const t=je(),{formattingLocale:r}=W(),n=O(),o=L((0,ee.useShallow)(c=>({pinnedNumbers:c.annotations.pinnedNumbers,comments:c.annotations.comments,coordSystem:c.coordSystem,numberFormat:c.config.numberFormat,parsingLocale:c.config.parsingLocale}))),a=r??o.parsingLocale,i=(0,g.useMemo)(()=>(0,d.createPinnedNumberValueFormatter)({numberFormat:o.numberFormat,locale:a}),[o.numberFormat,a]),l=(0,g.useMemo)(()=>(c,u,h)=>{const v=(0,d.resolveCalloutAnnotationStyle)(n,c==="pinnedNumber"?"pinnedNumber":"comment",u).label,f=(0,d.toFontSpec)(v,wt),m=wm(t,c,h,f),p=t.measureText(m,f),x=c==="pinnedNumber"?15:0;return{width:p.width+x+(v.paddingInline+v.strokeWidth)*2,height:Math.max(p.height,10)+(v.paddingBlock+v.strokeWidth)*2,text:m}},[t,n]);return(0,g.useMemo)(()=>(0,d.placeCallouts)({pinnedNumbers:o.pinnedNumbers,comments:o.comments,panelRect:e,coordSystem:o.coordSystem,measurer:l,formatPinnedNumber:c=>i(c.at)}),[o.pinnedNumbers,o.comments,e,o.coordSystem,l,i])}var wm=(e,t,r,n)=>t!=="comment"?r:(0,d.truncateToWidth)(r,140,o=>e.measureText(o,n).width),qo="callouts",jm=({panelRect:e})=>{const{pinnedNumbers:t,comments:r}=L((0,ee.useShallow)(p=>({pinnedNumbers:p.annotations.pinnedNumbers,comments:p.annotations.comments}))),n=L(p=>p.coordSystem),o=_(),a=ac(10),i=O(),l=Pm(e),{store:c}=Ie(),u=(0,g.useMemo)(()=>{const p=new Map;for(const x of t)p.set(x.id,x.at);for(const x of r)p.set(x.id,x.at);return p},[t,r]),h=(0,g.useMemo)(()=>{const p=new Map;for(const[x,y]of u)p.set(x,a(y));return p},[u,a]),v=(0,g.useMemo)(()=>{const p=new Map;for(const x of t)p.set(x.id,(0,d.resolveCalloutAnnotationStyle)(i,"pinnedNumber",x.id));for(const x of r)p.set(x.id,(0,d.resolveCalloutAnnotationStyle)(i,"comment",x.id));return p},[t,r,i]),f=(0,g.useMemo)(()=>(0,d.buildCalloutHitRegions)(l,e),[l,e]),m=qe([...v.values()].map(p=>p.label.fill));return(0,g.useEffect)(()=>{const p=c.getState();return p.publishPointerRegions(qo,f),()=>{p.publishPointerRegions(qo,[])}},[c,f]),t.length===0&&r.length===0?null:(0,s.jsx)("svg",{x:e.x,y:e.y,width:e.width,height:e.height,overflow:"visible",className:bm,"data-testid":"callouts",children:l.map(p=>{if(!p.inView)return null;const x=u.get(p.id),y=v.get(p.id);if(x===void 0||y===void 0)return null;const b=h.get(p.id),S=b?.color,P=p.miniRect.width<=e.width&&p.miniRect.height<=e.height;return(0,s.jsxs)("g",{"data-testid":p.kind,"data-annotation-id":p.id,children:[(0,s.jsx)("foreignObject",{x:p.miniRect.x,y:p.miniRect.y,width:p.miniRect.width,height:p.miniRect.height,overflow:"visible",children:(0,s.jsxs)("div",{className:P?Qo.hittable:Qo.inert,style:Cm(y.label,m(y.label.fill)),children:[p.kind==="pinnedNumber"&&(0,s.jsx)("span",{className:"ph8bdc1",children:(0,s.jsx)(jt,{shape:o(x.geom,n.type)?.swatchShape??"square",surface:"callout",color:S??"currentColor",paint:b?.fill,width:10,height:10,alpha:b?.alpha,cornerRadius:b?.cornerRadius,symbol:b?.symbol,mainAxis:(0,d.readMainAxis)(n)})}),(0,s.jsx)("span",{className:Am,style:Rm(y.label),children:p.text})]})}),(0,s.jsx)(Sm,{cx:p.anchorPx.x,cy:p.anchorPx.y,color:Em(y.marker,S),style:y.marker})]},p.id)})})},Em=(e,t)=>e.hasAuthoredFill?(0,d.toPaintColor)(e.fill):t??(0,d.toPaintColor)(e.fill),km=e=>e.hasAuthoredTextColor?e.textColor:(0,d.ensureReadableTextColor)(e.textColor,(0,d.toPaintColor)(e.fill)),Cm=(e,t)=>({...Ve(e.fill,t),borderRadius:Je(e.cornerRadius),padding:`${e.paddingBlock}px ${e.paddingInline}px`,boxShadow:Xe(e.shadow),...e.alpha===void 0?{}:{opacity:e.alpha},...e.strokeWidth>0?{border:`${e.strokeWidth}px solid ${e.stroke}`}:{}}),Rm=e=>({...X(e),color:km(e)}),Tm=({panelRect:e})=>{const t=$e(e).stickers,r=O().graph().get("textScale"),n=Lt(),o=t.filter(a=>a.id!==n);return o.length===0?null:(0,s.jsx)("svg",{x:e.x,y:e.y,width:e.width,height:e.height,overflow:"visible","data-testid":"stickers",children:o.map(a=>(0,s.jsx)("g",{...Ze({kind:"annotation",id:a.id}),children:(0,s.jsx)(fl,{sticker:a,panel:e,textScale:r})},a.id))})},fl=({sticker:e,panel:t,textScale:r})=>{const n=Xn[e.sticker],o=Zs(e,t,r);return n===void 0||o===null?null:(0,s.jsx)("image",{href:n.src,x:o.x,y:o.y,width:o.width,height:o.height})},Lm="_1agclyl0",Im="_1agclyl1",Om="_1agclyl2",pl=({x:e,y:t,width:r,height:n,text:o,rotated:a,labelRole:i,position:l,coordType:c,backdropColor:u})=>{const h=O(),v=T(br,h),f=T(cs,h),m=a?`rotate(-90 ${e} ${t})`:void 0,p=v[i][l],x=Fm(i,l,c,p),y=Nm(p,x,u,f),b=y.stroke!==void 0&&(y.strokeWidth??0)>0,S=Gm(y,x,u,f),P={x:e-r/2,y:t-n/2,width:r,height:n},w=yr(y.cornerRadius),j=y.shadow===void 0?void 0:Ge(y.shadow),C={className:Im,fill:y.fill===void 0?void 0:(0,d.toPaintColor)(y.fill),style:j===void 0?void 0:{filter:j},...b?{stroke:y.stroke,strokeWidth:y.strokeWidth}:{}};return(0,s.jsxs)("g",{transform:m,opacity:y.alpha,children:[x&&(w===null?(0,s.jsx)("path",{d:Cn(P,y.cornerRadius),...C}):(0,s.jsx)("rect",{...P,rx:w,ry:w,...C})),(0,s.jsx)("text",{className:Om,style:{..._e(y),...pr(y),fill:u===void 0?Bm(y):Mm(y,S)},...fr(y),x:e,y:t,textAnchor:"middle",dominantBaseline:"central",children:(0,d.applyTextTransform)(o,y.textTransform)})]})},Mm=(e,t)=>e.hasAuthoredTextColor||t===void 0?e.textColor:e.hasThemedTextColor?(0,d.ensureReadableTextColor)(e.textColor,t):(0,d.pickReadableTextColor)(t),Bm=e=>{const t=xl(e);return e.hasAuthoredTextColor||t===void 0?e.textColor:(0,d.ensureReadableTextColor)(e.textColor,t)},Gm=(e,t,r,n)=>{if(r!==void 0)return xl(e)??ml(e,t,r,n)},Nm=(e,t,r,n)=>{if(e.textOutlineColor!==d.AUTO_COLOR)return e;const o=ml(e,t,r,n);return{...e,textOutlineColor:o}},ml=(e,t,r,n)=>{const o=t&&e.fill!==void 0?(0,d.toPaintColor)(e.fill):void 0,a=o===void 0?void 0:(0,d.compositeColor)(void 0,o);if(a!==void 0)return a;const i=r===void 0?n:(0,d.compositeColor)(r,n)??(0,d.removeAlpha)(r);if(i!==void 0)return(0,d.compositeColor)(o,i)},xl=e=>{if(!(e.textOutlineColor===void 0||(e.textOutlineWidth??0)<=0))return(0,d.compositeColor)(void 0,e.textOutlineColor)},Fm=(e,t,r,n)=>n.fill===void 0?!1:e==="aggregate"||r==="cartesian"||t==="inside",Hm=({panelRect:e,formattingLocale:t,plotBottomY:r,hasReservedFooterSpace:n,hidePinnedCellLabels:o})=>{const a=je(),i=Ne(),l=L((0,ee.useShallow)(x=>({layers:x.layers,coordSystem:x.coordSystem,axes:x.guides.axes,numberFormat:x.config.numberFormat,parsingLocale:x.config.parsingLocale,pinnedNumbers:x.annotations.pinnedNumbers}))),c=O(),u=rr(),h=T(br,c),v=(0,g.useMemo)(()=>ds({textMeasurer:a,dataLabelStyles:h,familyDefault:i.fonts.familyDefault}),[a,h,i.fonts.familyDefault]),f=(0,g.useMemo)(()=>(0,d.buildDataLabelsContent)({...l,pinnedNumbers:o?l.pinnedNumbers:[],panelRect:e,measureDataLabel:v,readers:c,formattingLocale:t,plotBottomY:r,hasReservedFooterSpace:n,resolvePlacement:u}),[l,o,e,v,c,t,r,n,u]),m=(0,g.useRef)("");(0,g.useEffect)(()=>{if(f.warnings.length===0){m.current="";return}const x=JSON.stringify(f.warnings);x!==m.current&&(m.current=x,ra(f.warnings))},[f.warnings]);const p=f.labels.map((x,y)=>(0,s.jsx)(pl,{x:x.x,y:x.y,width:x.width,height:x.height,text:x.text,rotated:x.rotated,labelRole:x.role,position:x.position,coordType:l.coordSystem.type,backdropColor:x.backdropColor},`${x.layerId}:${y}`));return(0,s.jsx)(Yn,{className:Lm,transform:`translate(${e.x}, ${e.y})`,"data-testid":"data-labels",children:p})},Dm=({edge:e,position:t,labelRotation:r,offset:n,axisSize:o})=>{if(r!==0&&(e==="top"||e==="bottom")){const a=e==="top",i=a?-n:n;return{x:0,y:i,textAnchor:a?"start":"end",dominantBaseline:"central",transform:`rotate(${r}, 0, ${i})`}}switch(e){case"bottom":return{x:t*o.width,y:n,textAnchor:"middle",dominantBaseline:"hanging",transform:void 0};case"top":return{x:t*o.width,y:o.height-n,textAnchor:"middle",dominantBaseline:"auto",transform:void 0};case"left":return{x:o.width-n,y:t*o.height,textAnchor:"end",dominantBaseline:"central",transform:void 0};case"right":return{x:n,y:t*o.height,textAnchor:"start",dominantBaseline:"central",transform:void 0}}},Wm=(e,t)=>{const r=t.height/2;switch(e){case"left":return{x:0,y:r,textAnchor:"start",dominantBaseline:"middle",transform:void 0};case"right":return{x:t.width,y:r,textAnchor:"end",dominantBaseline:"middle",transform:void 0};case"top":case"bottom":return{x:t.width/2,y:r,textAnchor:"middle",dominantBaseline:"middle",transform:void 0}}},zm=(e,t,r,n)=>{const{width:o,ascent:a,descent:i}=t,l=a+i,c=Xm(e,o),u=Qm(e,a,l),h=Um(r,e,n,{x:c,y:u,width:o,height:l});return{x:c-h.left,y:u-h.top,width:o+h.left+h.right,height:l+h.top+h.bottom,transform:e.transform}},Vm=(e,t)=>{const r=e.map((o,a)=>({position:o,index:a})).sort((o,a)=>o.position-a.position),n=e.map(()=>1/0);return r.forEach((o,a)=>{const i=r[a-1],l=r[a+1],c=i===void 0?1/0:o.position-i.position,u=l===void 0?1/0:l.position-o.position,h=Math.min(c,u);n[o.index]=Number.isFinite(h)?h*t:1/0}),n},Um=(e,t,r,n)=>r===void 0?{left:e,right:e,top:e,bottom:e}:t.transform!==void 0?Ym(e,t):Km(e,r,n),Ym=(e,{y:t,textAnchor:r})=>{const n=dt(e,Math.abs(t));return r==="end"?{left:e,right:n,top:e,bottom:e}:{left:n,right:e,top:e,bottom:e}},Km=(e,{edge:t,stepPx:r,axisSize:n},o)=>{const a=_o(e,r,o.width),i=_o(e,r,o.height);switch(t){case"bottom":return{left:a,right:a,top:dt(e,o.y),bottom:e};case"top":return{left:a,right:a,top:e,bottom:dt(e,n.height-o.y-o.height)};case"left":return{left:e,right:dt(e,n.width-o.x-o.width),top:i,bottom:i};case"right":return{left:dt(e,o.x),right:e,top:i,bottom:i}}},dt=(e,t)=>Math.max(0,Math.min(e,t)),_o=(e,t,r)=>Math.min(e,Math.max(0,(t-r)/2)),Xm=({x:e,textAnchor:t},r)=>{switch(t){case"start":return e;case"middle":return e-r/2;case"end":return e-r}},Qm=({y:e,dominantBaseline:t},r,n)=>{switch(t){case"hanging":return e;case"central":case"middle":return e-n/2;case"auto":return e-r}},qm={fill:"transparent",pointerEvents:"all"},Qn=({placement:e,text:t,style:r,hitTestable:n,bounds:o})=>(0,s.jsxs)(s.Fragment,{children:[n&&(0,s.jsx)(_m,{placement:e,text:t,style:r,bounds:o}),(0,s.jsx)("text",{...e,style:{..._e(r),...pr(r)},...fr(r),fill:r.textColor,children:(0,d.applyTextTransform)(t,r.textTransform)})]}),_m=({placement:e,text:t,style:r,bounds:n})=>{const o=je(),{fonts:a}=Ne();return(0,s.jsx)("rect",{...(0,g.useMemo)(()=>zm(e,o.measureText(t,(0,d.toFontSpec)(r,a.familyDefault)),3,n),[e,o,t,r,a.familyDefault,n]),...qm})},Jm=({edge:e,position:t,labelRotation:r,label:n,tickLabelStyle:o,axisSize:a,stepPx:i=1/0,hitTestable:l=!1})=>{const{offset:c}=o,u=(0,g.useMemo)(()=>Dm({edge:e,position:t,labelRotation:r,offset:c,axisSize:a}),[e,t,r,c,a]),h=(0,s.jsx)(Qn,{placement:u,text:n,style:o,hitTestable:l,bounds:(0,g.useMemo)(()=>({edge:e,stepPx:i,axisSize:a}),[e,i,a])});return u.transform===void 0?h:(0,s.jsx)("svg",{x:(0,d.toPercent)(t),y:e==="top"?"100%":0,style:{overflow:"visible"},children:h})},Zm=({formattedAxis:e,rect:t})=>{const r=e.position==="bottom"||e.position==="top",n=(0,d.getAestheticFromScaledAesthetic)(e.scaledAesthetic),o=O(),a=T(In,o)(n,e.position),i=T(ls,o)[n],l=Ee(),c=(0,g.useMemo)(()=>({width:t.width,height:t.height}),[t.width,t.height]),u=r?t.width:t.height,h=(0,g.useMemo)(()=>l?Vm(e.ticks.map(v=>v.position),u):void 0,[l,e.ticks,u]);return(0,s.jsxs)("svg",{x:t.x,y:t.y,width:t.width,height:t.height,style:{overflow:"visible"},...Ar("axis"),children:[!1,e.ticks.map((v,f)=>{const m=v.formattedLabel,p=$m(e.position,v.position,t,i.length),x=l&&m!=="";return(0,s.jsxs)("g",{...x?Sr(e.scaledAesthetic,f):void 0,cursor:x?"pointer":void 0,children:[e.showTicks&&(0,s.jsx)("line",{...p,stroke:i.stroke,strokeWidth:i.strokeWidth,strokeDasharray:(0,d.toStrokeDasharray)(i.dashArray,i.strokeWidth),pointerEvents:l?"none":void 0}),(0,s.jsx)(Jm,{edge:e.position,position:v.position,labelRotation:e.labelRotation,label:m,tickLabelStyle:a,axisSize:c,stepPx:h?.[f],hitTestable:x})]},f)})]})},$m=(e,t,r,n)=>{const o=(0,d.toPercent)(t);switch(e){case"bottom":return{x1:o,y1:0,x2:o,y2:n};case"top":return{x1:o,y1:r.height,x2:o,y2:r.height-n};case"left":return{x1:r.width,y1:o,x2:r.width-n,y2:o};case"right":return{x1:0,y1:o,x2:n,y2:o}}},ex=({axes:e,rects:t})=>{const r=T(ss,O()),n=Ee();return(0,s.jsx)(s.Fragment,{children:e.map(o=>{const a=t[o.position];return!a||!o.visible?null:(0,s.jsx)(tx,{axis:o,rect:a,labelStyle:r[(0,d.getAestheticFromScaledAesthetic)(o.scaledAesthetic)],hitTestable:n},`axis-label-${o.position}`)})})},tx=({axis:e,rect:t,labelStyle:r,hitTestable:n})=>{const o=(0,g.useMemo)(()=>Wm(e.position,t),[e.position,t]),a=n&&e.label!==null&&e.label!=="",i=a?Sr(e.scaledAesthetic):void 0;return(0,s.jsxs)("g",{transform:`translate(${t.x}, ${t.y})`,...i,...Ar("axis"),cursor:a?"pointer":void 0,children:[!1,(0,s.jsx)(Qn,{placement:o,text:e.label??"",style:r,hitTestable:a})]})},rx=({formattedAxes:e,tickRects:t})=>(0,s.jsx)(s.Fragment,{children:e.map(r=>{if(r.geometry!=="linear")return null;const n=t[r.position];return!n||!r.visible?null:(0,s.jsx)(Zm,{formattedAxis:r,rect:n},r.scaledAesthetic)})}),nx=({formattedAxes:e,labelRects:t})=>(0,s.jsx)(ex,{axes:e.filter(r=>r.geometry==="linear"),rects:t}),yl={strokeDashoffset:"0",strokeLinecap:"round"},mt=(e,t)=>e.gridLine[t]().resolve(),ox=({sizes:e,panelFrameRect:t})=>{const r=L(a=>a.coordSystem.type==="polar"),n=T(d.resolvePanelBorderStyle,O());if(r)return null;const o=(0,d.computePanelBorderPaths)((0,d.toPanelEdgeStrokes)(n),{x:e.left/2,y:e.top/2,width:t.width-(e.left+e.right)/2,height:t.height-(e.top+e.bottom)/2});return o.length===0?null:(0,s.jsx)("svg",{"data-testid":"panel-border",x:t.x,y:t.y,width:t.width,height:t.height,style:{overflow:"visible"},children:o.map((a,i)=>(0,s.jsx)("path",{d:bl(a.segments),fill:"none",stroke:a.stroke,strokeDasharray:(0,d.toStrokeDasharray)(a.dashArray,a.strokeWidth),strokeWidth:a.strokeWidth,...yl},i))})},bl=e=>e.map(t=>{switch(t.type){case"move":return`M ${t.x} ${t.y}`;case"line":return`L ${t.x} ${t.y}`;case"arc":{const r=t.cx+t.radius*Math.cos(t.endAngle),n=t.cy+t.radius*Math.sin(t.endAngle);return`A ${t.radius} ${t.radius} 0 0 1 ${r} ${n}`}case"close":return"Z"}}).join(" "),Vt={stroke:"none",strokeWidth:0,dashArray:[]},ax=({axisLines:e,cornerRadius:t,panelFrameRect:r})=>{const n=(0,g.useMemo)(()=>{if(e.length===0)return[];const o={top:Vt,right:Vt,bottom:Vt,left:Vt};for(const{edge:i,style:l}of e)l.strokeWidth>=o[i].strokeWidth&&(o[i]=l);const a=(0,d.computePanelEdgeSizes)(e);return(0,d.computePanelBorderPaths)({edges:o,cornerRadius:t},{x:a.left/2,y:a.top/2,width:r.width-(a.left+a.right)/2,height:r.height-(a.top+a.bottom)/2})},[e,t,r.width,r.height]);return n.length===0?null:(0,s.jsx)("svg",{"data-testid":"axis-lines",x:r.x,y:r.y,width:r.width,height:r.height,style:{overflow:"visible"},children:n.map(o=>(0,s.jsx)("path",{"data-edges":o.edges.join(" "),d:bl(o.segments),fill:"none",stroke:o.stroke,strokeWidth:o.strokeWidth,strokeDasharray:(0,d.toStrokeDasharray)(o.dashArray,o.strokeWidth),strokeLinecap:o.lineCap},o.edges.join(" ")))})},Al=({axes:e,panelEdgeSizes:t,panelFrameRect:r,panelRect:n})=>{const o=O(),a=Ee(),i=T(mt,o,"x"),l=T(mt,o,"y"),c=n.x-r.x,u=n.y-r.y;return(0,s.jsx)("svg",{"data-testid":"grid",x:r.x,y:r.y,width:r.width,height:r.height,style:{overflow:"visible"},children:e.map(h=>{if(h.geometry!=="linear"||!h.showGrid)return null;const v=(0,d.getAestheticFromScaledAesthetic)(h.scaledAesthetic)==="x"?i:l;if(v.strokeWidth<=0)return null;const f=h.position==="bottom"||h.position==="top",m=ga(v.dashArray,v.strokeWidth),p=(0,d.toStrokeDasharray)(v.dashArray,m);return(0,s.jsx)("g",{children:h.ticks.map((x,y)=>{const b=ix(f,x.position);if(b!==null&&t[b]>0)return null;const{position:S}=x;let P;if(f){const j=S*n.width+c;P={x1:j,y1:0,x2:j,y2:"100%"}}else{const j=S*n.height+u;P={x1:0,y1:j,x2:"100%",y2:j}}const w=(0,s.jsx)("line",{...P,...yl,strokeDasharray:p,strokeWidth:m,stroke:v.stroke});return a?(0,s.jsxs)("g",{...Vn(h.scaledAesthetic),children:[w,(0,s.jsx)("line",{...P,stroke:"transparent",strokeWidth:7,pointerEvents:"stroke","data-testid":"grid-line-hit-area"})]},y):(0,s.jsx)(g.Fragment,{children:w},y)})},h.scaledAesthetic)})})},ix=(e,t)=>t<=0?e?"left":"top":t>=1?e?"right":"bottom":null;var Sl=(e,t)=>{const r=L(c=>c.coordSystem);if(r.type!=="polar")return null;const n=t.find(c=>c.geometry==="circular");if(!n)return null;const{innerRadius:o,startAngle:a,spokeRotation:i}=r,l=Ke(e);return l.radius<=0?null:{circle:l,circularAxis:n,radialAxis:t.find(c=>c.geometry==="radial"),innerRadius:o,startAngle:a,angleFor:c=>(0,d.positionToAngle)(c,a,i),radiusNormFor:c=>o+c*(1-o)}},sx=16,lx=({formattedAxes:e,panelRect:t})=>{const r=T(In,O()),n=Ee(),o=Un(),a=Sl(t,e);if(!a)return null;const{circle:i,circularAxis:l,radialAxis:c,startAngle:u,angleFor:h,radiusNormFor:v}=a,f=cx(c,v,i.radius),m=p=>r((0,d.getAestheticFromScaledAesthetic)(p.scaledAesthetic));return(0,s.jsxs)("svg",{x:t.x,y:t.y,width:t.width,height:t.height,overflow:"visible","data-testid":"polar-axis-ticks",children:[c?.visible&&f.map(({tick:p,tickIndex:x,radiusNorm:y})=>(0,s.jsx)(Jo,{scaledAesthetic:c.scaledAesthetic,tickIndex:x,placement:Zo(de(u,y,i),"middle"),label:p.formattedLabel,labelStyle:m(c),guidesTakePress:n,labelsTakePointer:o},`radial-label-${x}`)),l.visible&&l.ticks.map((p,x)=>{if(p.position>=1-1e-9)return null;const y=h(p.position),b=de(y,(i.radius+d.POLAR_TICK_LABEL_OFFSET_PX)/i.radius,i);return(0,s.jsx)(Jo,{scaledAesthetic:l.scaledAesthetic,tickIndex:x,placement:Zo(b,dx(y)),label:p.formattedLabel,labelStyle:m(l),guidesTakePress:n,labelsTakePointer:o},`tick-label-${x}`)})]})},Jo=({scaledAesthetic:e,tickIndex:t,placement:r,label:n,labelStyle:o,guidesTakePress:a,labelsTakePointer:i})=>{const l=(0,s.jsx)(Qn,{placement:r,text:n,style:o,hitTestable:a||i});return!a&&!i?l:(0,s.jsx)("g",{...Ar("axis"),...a?Sr(e,t):{},cursor:a?"pointer":void 0,children:l})},cx=(e,t,r)=>{if(!e)return[];const n=[];let o=Number.NEGATIVE_INFINITY;for(const[a,i]of e.ticks.entries()){const l=t(i.position);if(l<=0)continue;const c=l*r;c-o<sx||(n.push({tick:i,tickIndex:a,radiusNorm:l}),o=c)}return n},Zo=(e,t)=>({x:e.x,y:e.y,textAnchor:t,dominantBaseline:"central",transform:void 0}),dx=e=>{const t=Math.sin(e);return Math.abs(t)<.01?"middle":t>0?"start":"end"},ux=({formattedAxes:e,panelRect:t})=>{const r=O(),n=Ee(),o=T(mt,r,"y"),a=T(mt,r,"x"),i=Sl(t,e);if(!i)return null;const{circle:l,circularAxis:c,radialAxis:u,innerRadius:h,angleFor:v,radiusNormFor:f}=i;return(0,s.jsxs)("svg",{x:t.x,y:t.y,width:t.width,height:t.height,overflow:"visible","data-testid":"polar-grid",children:[u?.showGrid&&u.ticks.map((m,p)=>{const x=f(m.position)*l.radius;return x<=0||m.position>=1?null:(0,s.jsx)(Or,{axis:(0,d.getAestheticFromScaledAesthetic)(u.scaledAesthetic),lineStyle:o,hitTestable:n,draw:y=>(0,s.jsx)("circle",{cx:l.centerX,cy:l.centerY,r:x,fill:"none",...y})},`ring-${p}`)}),u?.showGrid&&(0,s.jsx)(Or,{axis:(0,d.getAestheticFromScaledAesthetic)(u.scaledAesthetic),lineStyle:o,hitTestable:n,draw:m=>(0,s.jsx)("circle",{cx:l.centerX,cy:l.centerY,r:l.radius,fill:"none",...m})}),c.showGrid&&c.ticks.map((m,p)=>{if(m.position>=1-1e-9)return null;const x=v(m.position),y=de(x,h,l),b=de(x,1,l);return(0,s.jsx)(Or,{axis:(0,d.getAestheticFromScaledAesthetic)(c.scaledAesthetic),lineStyle:a,hitTestable:n,draw:S=>(0,s.jsx)("line",{x1:y.x,y1:y.y,x2:b.x,y2:b.y,...S})},`spoke-${p}`)})]})},Or=({axis:e,lineStyle:t,hitTestable:r,draw:n})=>{if(t.strokeWidth<=0)return null;const o=n({stroke:t.stroke,strokeWidth:t.strokeWidth});return r?(0,s.jsxs)("g",{...Vn(e),children:[o,n({stroke:"transparent",strokeWidth:7,pointerEvents:"stroke","data-testid":"grid-line-hit-area"})]}):o},er=({renderer:e,children:t,...r})=>e.overpaintPlacement==="manual"?t:(0,s.jsx)(Yi,{...r,children:t}),hx=({layer:e,dimmed:t,dimStyle:r,...n})=>{const o=ba(e.id),a=oa(e,B(e)),i=t?r.filter:void 0,l=a&&i?`${a} ${i}`:a||i,c=o?.type==="fade",u=(0,g.useMemo)(()=>({layerId:e.id,paintsShadow:a!==void 0,fading:c}),[e.id,a,c]),h=(0,s.jsx)("g",{style:{opacity:t?r.opacity:void 0,filter:l},children:(0,s.jsx)(bt.Provider,{value:u,children:(0,s.jsx)(vx,{layer:e,...n})})});return c?(0,s.jsx)(R.motion.g,{initial:{opacity:0},animate:{opacity:1},transition:xa(o),children:h}):h},vx=({layer:e,coordSystem:t,formattingLocale:r,live:n})=>{const o=_(),a=ba(e.id),{colorScheme:i}=W(),l=B(e),c=o(e.geom,t.type);if(c===null)return null;const u=mr(c.render),h={layer:e,coordSystem:t,formattingLocale:r,intro:a,colorScheme:i,styleReaders:l};let v;if(!u.live)v=u.fn(h);else{if(n===void 0)return null;v=u.fn({...h,live:n})}return(0,s.jsx)(er,{renderer:c,styleReaders:l,children:v})},Pl=({layer:e,coordSystem:t,children:r})=>{const n=_(),{colorScheme:o}=W(),a=B(e),i=ae(),l=n(e.geom,t.type)?.LayerProvider;return l===void 0?r:(0,s.jsx)(l,{layer:e,coordSystem:t,panelSize:i,colorScheme:o,styleReaders:a,children:r})};function gx({renderer:e,layer:t,coordSystem:r,candidates:n}){if(e?.getOverlayAnchor===void 0||n.length===0)return[];const o=[];for(const{observation:a,observationIndex:i}of n){const l=e.getOverlayAnchor({layer:t,coordSystem:r,observation:a});l!==null&&o.push({observation:a,observationIndex:i,anchor:l})}return o}var fx=4,px=({renderer:e,layer:t,matchedLayer:r,overlayCandidates:n,coordSystem:o,formattingLocale:a})=>{const i=L(b=>b.config.numberFormat),l=(0,g.useMemo)(()=>gx({renderer:e,layer:t,coordSystem:o,candidates:n}),[e,t,o,n]),{colorScheme:c}=W(),u=B(t),h=O(),v=(0,g.useMemo)(()=>(0,d.createSegmentYReader)(t),[t]),f=(0,g.useMemo)(()=>(0,d.createLayerYValueFormatter)({layer:t,numberFormat:i,locale:a}),[i,t,a]),{fonts:m}=Ne(),p=T(br,O());if(e===null||r===null&&l.length===0)return null;const x=mr(e.render);let y=null;if(r&&!x.live){const b=(0,s.jsx)(mx,{renderer:e,paint:e.renderHighlight??x.fn,layer:t,matchedLayer:r,coordSystem:o,formattingLocale:a,colorScheme:c});y=e.renderHighlight===void 0?b:(0,s.jsx)(Gr,{children:b})}return(0,s.jsxs)(Yn,{children:[y,l.map(({observation:b,observationIndex:S,anchor:P})=>(0,s.jsx)(yx,{observation:b,anchor:P,fill:(0,d.readGeomColor)(h,t,b)??d.DEFAULT_GEOM_COLOR,symbol:u.get("symbol",b)??"circle",dotRadius:(u.get("size",b)??d.DEFAULT_POINT_SIZE_PX)/2,readSegmentY:v,formatYValue:f,labelStyle:p.observation.outside,familyDefault:m.familyDefault},bx(b,S)))]})},mx=({layer:e,...t})=>{const r=oa(e,B(e)),n=(0,g.useMemo)(()=>({layerId:e.id,paintsShadow:r!==void 0,fading:!1}),[e.id,r]);return(0,s.jsx)("g",{style:{filter:r},children:(0,s.jsx)(bt.Provider,{value:n,children:(0,s.jsx)(xx,{layer:e,...t})})})},xx=({renderer:e,paint:t,layer:r,matchedLayer:n,...o})=>{const a=B(r);return(0,s.jsx)(er,{renderer:e,styleReaders:a,children:t({...o,layer:n,sourceLayer:r,styleReaders:a})})},yx=({observation:e,anchor:t,fill:r,symbol:n,dotRadius:o,readSegmentY:a,formatYValue:i,labelStyle:l,familyDefault:c})=>{const u=je(),h=ae(),v=a(e)??null,f=v!==null?i(v,e):null,m=(0,g.useMemo)(()=>{if(f===null)return null;const p=u.measureText(f,(0,d.toFontSpec)(l,c));return{width:p.width+l.paddingInline*2,height:p.height+l.paddingBlock*2}},[f,u,l,c]);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(St,{symbol:n,cx:(0,d.toPercent)(t.x),cy:(0,d.toPercent)(t.y),size:o*2,fill:r,"data-testid":"highlight-overlay-dot"}),f!==null&&m!==null&&(0,s.jsx)(pl,{x:t.x*h.width,y:t.y*h.height-o-fx-m.height/2,width:m.width,height:m.height,text:f,rotated:!1,labelRole:"observation",position:"outside",coordType:"cartesian"})]})},bx=(e,t)=>{const r=e[d.GROUP_VARIABLES.group];return`${String(r??"")}\0${t}`},Ax=(0,g.memo)(function({layer:t,coordSystem:r}){const{primary:n,group:o,related:a}=Be((0,ee.useShallow)(m=>({primary:m.hover.primary,group:m.hover.group,related:m.hover.related}))),i=_(),{colorScheme:l}=W(),c=B(t),{paintHover:u}=re[he()],h=n?.layerId===t.id,v=a.get(t.id)??[];if(!u||n===null)return null;const f=i(t.geom,r.type);return f===null?null:h?f.renderHover===void 0?null:(0,s.jsx)(Gr,{children:(0,s.jsx)(er,{renderer:f,styleReaders:c,state:"hovered",children:f.renderHover({layer:t,coordSystem:r,primary:n,group:o,related:v,colorScheme:l,styleReaders:c})})}):v.length===0||f.renderHoverCompanions===void 0?null:(0,s.jsx)(Gr,{children:(0,s.jsx)(er,{renderer:f,styleReaders:c,children:f.renderHoverCompanions({layer:t,coordSystem:r,primary:n,related:v,colorScheme:l,styleReaders:c})})})}),Sx=e=>{const t=B(e);return(0,g.useMemo)(()=>{const[r]=e.data;if(r===void 0)return{opacity:void 0,filter:void 0};const n=t.resolveState("dimmed",r);return{opacity:n.alpha,filter:pa((0,d.pickFilters)(n))}},[e,t])},Px="var(--to1jkx0)",wx="var(--to1jkx1)",wl="to1jkx2",jx="to1jkx3",jl=({layer:e,coordSystem:t,panelSize:r,children:n})=>{const o=(0,g.useId)(),a=(0,d.findOverflowedPanelEdges)(e,t),i=a.length>0;return(0,s.jsxs)("g",{clipPath:i?`url(#${o})`:void 0,children:[n,i&&(0,s.jsx)("clipPath",{id:o,children:(0,s.jsx)("rect",{...El(a,r)})})]})},El=(e,{width:t,height:r})=>{const n=e.includes("left")?0:t,o=e.includes("right")?0:t,a=e.includes("top")?0:r,i=e.includes("bottom")?0:r;return{x:-n,y:-a,width:t+n+o,height:r+a+i}},Ex=({panelRect:e,formattingLocale:t})=>{const{layers:r,coordSystem:n}=L((0,ee.useShallow)(i=>({layers:i.layers,coordSystem:i.coordSystem}))),o=kx(r,n),a=(0,g.useMemo)(()=>({width:e.width,height:e.height}),[e.width,e.height]);return(0,s.jsx)("svg",{x:e.x,y:e.y,width:e.width,height:e.height,className:wl,"data-testid":"geom-layers",...Vs(),children:(0,s.jsx)(tn,{size:a,children:o.map(i=>(0,s.jsx)(Pl,{layer:i,coordSystem:n,children:(0,s.jsxs)(jl,{layer:i,coordSystem:n,panelSize:a,children:[(0,s.jsx)(Cl,{layer:i,coordSystem:n,formattingLocale:t}),(0,s.jsx)(Ax,{layer:i,coordSystem:n})]})},`${i.id}-${kl(n)}`))})})},kl=e=>e.type==="cartesian"?`cartesian-${e.mainAxis}`:e.type,Cl=(0,g.memo)(function({layer:t,coordSystem:r,formattingLocale:n,live:o,dimOnHover:a=!0}){const i=_(),l=(0,g.useMemo)(()=>i(t.geom,r.type),[i,t,r]),c=t.highlight,u=Sx(t),{colorScheme:h}=W(),v={layer:t,coordSystem:r,formattingLocale:n,colorScheme:h,styleReaders:B(t)},f=l?mr(l.render):null,m=t.spatialKind==="renderHitTest",p=a&&(u.opacity!==void 0||u.filter!==void 0);return(0,s.jsxs)("g",{className:p?jx:void 0,style:p?Cx(u):void 0,children:[(0,s.jsx)(hx,{layer:t,coordSystem:r,dimmed:c?.composition.dimmed??!1,dimStyle:u,formattingLocale:n,live:o}),m&&!f?.live&&l?.hitTest&&(0,s.jsx)(d0,{hitTest:l.hitTest,input:v}),c!==null&&(0,s.jsx)(px,{renderer:l,layer:t,matchedLayer:c.composition.matchedLayer,overlayCandidates:c.composition.overlayCandidates,coordSystem:r,formattingLocale:n})]})}),kx=(e,t)=>{const r=_(),{waitingForView:n}=q();return n?[]:e.filter(o=>!An(r(o.geom,t.type)))},Cx=e=>(0,tr.assignInlineVars)({...e.opacity===void 0?{}:{[Px]:String(e.opacity)},...e.filter===void 0?{}:{[wx]:e.filter}}),Rx=({panelRect:e,formattingLocale:t})=>{const{layers:r,coordSystem:n}=L((0,ee.useShallow)(c=>({layers:c.layers,coordSystem:c.coordSystem}))),o=(0,g.useRef)(null),a=(0,g.useCallback)(({clientX:c,clientY:u})=>{const h=o.current?.getScreenCTM();if(!h)return null;const v=h.inverse();return{x:v.a*c+v.c*u+v.e,y:v.b*c+v.d*u+v.f}},[]),i=(0,g.useMemo)(()=>({width:e.width,height:e.height}),[e.width,e.height]),l=Lx(r,n);return l.length===0?null:(0,s.jsx)("svg",{ref:o,x:e.x,y:e.y,width:e.width,height:e.height,className:wl,"data-testid":"live-geom-layers",...Vs({live:!0}),children:(0,s.jsx)(tn,{size:i,children:l.map(c=>(0,s.jsx)(Tx,{layer:c,coordSystem:n,readPixelPoint:a,formattingLocale:t},`${c.id}-${kl(n)}`))})})},Tx=({layer:e,coordSystem:t,readPixelPoint:r,formattingLocale:n})=>{const o=Ki(e.id),a=(0,g.useMemo)(()=>({pushHover:o,readPixelPoint:r}),[o,r]),i=Be(l=>l.hover.primary?.layerId===e.id);return(0,g.useEffect)(()=>()=>o(null),[o]),(0,s.jsx)(Pl,{layer:e,coordSystem:t,children:(0,s.jsx)(Cl,{layer:e,coordSystem:t,formattingLocale:n,live:a,dimOnHover:!i})})},Lx=(e,t)=>{const r=_(),{waitingForView:n}=q();return n?[]:e.filter(o=>An(r(o.geom,t.type)))},Ix="_17uhij30",Ox=({formattedAxes:e,plotRect:t,panelBorder:r,axisLines:n,axisLineCornerRadius:o,panelEdges:a,panelFrameRect:i,panelRect:l,axisRects:c,axisLabelRects:u,formattingLocale:h,plotBottomY:v,hasReservedFooterSpace:f,editable:m,showAnnotations:p})=>{const x=(0,g.useRef)(null);Dp(x);const y=pe("Grid",Al),b=pe("AxisTicks",rx),S=pe("AxisLabel",nx),P=(0,g.useMemo)(()=>Qr(i,t),[i,t]),w=(0,g.useMemo)(()=>Qr(l,t),[l,t]),j=(0,g.useMemo)(()=>$o(c,t),[c,t]),C=(0,g.useMemo)(()=>$o(u,t),[u,t]),{waitingForView:k}=q(),E=p&&!k;return(0,s.jsxs)("svg",{ref:x,className:Ix,width:t.width,height:t.height,style:{transform:`translate(${t.x}px, ${t.y}px)`},"data-testid":"plot",children:[(0,s.jsx)(y,{axes:e,panelEdgeSizes:a,panelFrameRect:P,panelRect:w}),(0,s.jsx)(b,{formattedAxes:e,tickRects:j}),(0,s.jsx)(S,{formattedAxes:e,labelRects:C}),(0,s.jsx)(ux,{formattedAxes:e,panelRect:w}),(0,s.jsx)(Pp,{panelRect:w}),E&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Xo,{panelRect:w,zOrder:"background"}),(0,s.jsx)(Ko,{panelRect:w,zOrder:"background"})]}),(0,s.jsx)(ox,{sizes:r,panelFrameRect:P}),(0,s.jsx)(ax,{axisLines:n,cornerRadius:o,panelFrameRect:P}),(0,s.jsx)(Ex,{panelRect:w,formattingLocale:h}),(0,s.jsx)(lx,{formattedAxes:e,panelRect:w}),(0,s.jsx)(Hm,{panelRect:w,formattingLocale:h,plotBottomY:v,hasReservedFooterSpace:f,hidePinnedCellLabels:E}),E&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(am,{panelRect:w,editable:m}),(0,s.jsx)(Xo,{panelRect:w,zOrder:"foreground"}),(0,s.jsx)(Ko,{panelRect:w,zOrder:"foreground"}),(0,s.jsx)(rm,{panelRect:w,editable:m}),(0,s.jsx)(xm,{panelRect:w}),(0,s.jsx)(Tm,{panelRect:w}),(0,s.jsx)(jm,{panelRect:w})]}),(0,s.jsx)(Np,{panelRect:w}),(0,s.jsx)(Rx,{panelRect:w,formattingLocale:h})]})},Qr=(e,t)=>({x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height}),$o=(e,t)=>{const r={};for(const[n,o]of Object.entries(e))r[n]=Qr(o,t);return r},Mx=e=>{let t,r;return"aspectRatio"in e?"intrinsicWidth"in e?(t=e.intrinsicWidth,r=t/e.aspectRatio):(r=e.intrinsicHeight,t=r*e.aspectRatio):(t=e.intrinsicWidth,r=e.intrinsicHeight),{width:ea(t,"width"),height:ea(r,"height")}},ea=(e,t)=>{if(e<=0||Number.isNaN(e)||!Number.isFinite(e))throw new d.InternalError({message:`Expected ${t} to be a positive, finite number, but got ${e}.`});return e},Bx=({sizing:e,onResize:t,children:r})=>{const n=wn({onResize:t}),o=(0,g.useRef)(!1);if((0,g.useEffect)(()=>{e.mode==="responsive"&&(n.unmeasured||n.width>0&&n.height>0||o.current||(o.current=!0,console.warn(`[graphy] ZERO_SIZE_CONTAINER: GraphRenderer measured ${n.width}×${n.height}; the chart will not paint until the host has a positive width and height.`)))},[e.mode,n.unmeasured,n.width,n.height]),e.mode==="keepAspectRatio"){const{intrinsicSize:i,canRender:l,outerStyles:c,innerStyles:u}=Gx(e,n.width,!n.unmeasured);return(0,s.jsx)("div",{ref:n.setElement,style:c,"data-testid":"graph-sizer",children:l&&(0,s.jsx)("div",{style:u,children:r(i)})})}if(e.mode==="fixed")return(0,s.jsx)("div",{ref:n.setElement,style:{width:e.width,height:e.height},"data-testid":"graph-sizer",children:r({width:e.width,height:e.height})});const a=!n.unmeasured&&n.width>0&&n.height>0;return(0,s.jsx)("div",{ref:n.setElement,style:{width:"100%",height:"100%"},"data-testid":"graph-sizer",children:a&&r({width:n.width,height:n.height})})},Gx=(e,t,r)=>{const n=Mx(e),o=t>0&&n.width>0?t/n.width:1;return{intrinsicSize:n,canRender:r,outerStyles:{width:"100%",...r?{height:n.height*o}:{aspectRatio:`${n.width} / ${n.height}`}},innerStyles:{transformOrigin:"top left",transform:`scale(${o})`,width:n.width,height:n.height}}},Nx={mode:"responsive"},Mr={headerSize:{width:0,height:0},footerSize:{width:0,height:0}},Fx=()=>{const[e,t]=(0,g.useState)(null),[r,n]=(0,g.useState)(null),[o,a]=(0,g.useState)(Mr);return(0,g.useLayoutEffect)(()=>{const i=()=>{const c=e?{width:e.offsetWidth,height:e.offsetHeight}:Mr.headerSize,u=r?{width:r.offsetWidth,height:r.offsetHeight}:Mr.footerSize;a(h=>Hx(h,{headerSize:c,footerSize:u})?{headerSize:c,footerSize:u}:h)};i();const l=new ResizeObserver(i);return e&&l.observe(e),r&&l.observe(r),()=>l.disconnect()},[e,r]),{headerRef:t,footerRef:n,measurements:o}},Hx=(e,t)=>e.headerSize.width!==t.headerSize.width||e.headerSize.height!==t.headerSize.height||e.footerSize.width!==t.footerSize.width||e.footerSize.height!==t.footerSize.height,Dx=()=>null,Wx="_1vl0pke0",zx="_1vl0pke1";var Vx=[],Ux=({graphChrome:e,editable:t,mode:r,style:n,contentRef:o,children:a})=>{const{themeClass:i,inlineVarsStyle:l}=Et(),c=e.strokeWidth,u=c>0?e.stroke:void 0,h=Math.max(0,e.cornerRadius),v=h===0?0:h+c,{shadow:f,alpha:m,blendMode:p,fill:x,overpaint:y=Vx}=e,b=qe([x,...y]),S=b(x),P=typeof x!="string",w=(0,g.useMemo)(()=>({...n,borderRadius:`${v}px`,...l,...u===void 0?{}:{borderWidth:`${c}px`,borderStyle:"solid",borderColor:u},...f===void 0?{}:{boxShadow:Xe(f)}}),[n,v,l,c,u,f]),j=(0,g.useMemo)(()=>({borderRadius:`${h}px`,...p==="normal"?{}:{mixBlendMode:p},...Yx(P,m)}),[h,p,P,m]),C=(0,g.useMemo)(()=>typeof x=="string"?void 0:{...Ve(x,S),opacity:m},[x,S,m]),k=t&&x==="transparent";return(0,s.jsx)("div",{"data-testid":"graph-wrapper",className:(0,Q.default)(O0,i),style:w,children:(0,s.jsxs)("div",{ref:o,"data-testid":"graph-inner","data-graph-mode":r,tabIndex:t?0:void 0,className:(0,Q.default)(B0,{[G0]:t,[N0]:k,[zx]:P}),style:j,children:[C&&(0,s.jsx)("div",{"aria-hidden":!0,"data-testid":"graph-fill",className:"_1vl0pke2",style:C}),a,[...y].reverse().map((E,I)=>(0,s.jsx)("div",{"aria-hidden":!0,"data-testid":"graph-overpaint",className:Wx,style:Ve(E,b(E))},I))]})})},Yx=(e,t)=>e?{backgroundColor:"transparent"}:t===void 0||t>=1?{}:{backgroundColor:`color-mix(in srgb, ${A.graphBackground} ${t*100}%, transparent)`},Kx=e=>(0,s.jsx)(kn,{...qi(Gn()),children:(0,s.jsx)(Rl,{...e})}),Rl=({slots:e,sizing:t=Nx,onResize:r,...n})=>(0,s.jsx)(Vi,{children:(0,s.jsx)(Si,{children:(0,s.jsx)(nh,{slots:e,children:(0,s.jsx)(Bx,{sizing:t,onResize:r,children:({width:o,height:a})=>(0,s.jsx)(Xx,{width:o,height:a,...n})})})})}),Xx=({width:e,height:t,animation:r})=>{const n=En(),o=he(),{axes:a,legends:i,layers:l,numberFormat:c,parsingLocale:u,annotations:h,coordSystem:v,headline:f,headlineConfig:m,content:p,overflowStrategy:x}=L((0,ee.useShallow)($=>({axes:$.guides.axes,legends:$.guides.legends.drawn,layers:$.layers,numberFormat:$.config.numberFormat,parsingLocale:$.config.parsingLocale,annotations:$.annotations,coordSystem:$.coordSystem,headline:$.guides.headline,headlineConfig:$.config.headline,content:$.config.content,overflowStrategy:$.config.panel.overflow}))),y=re[o],b=y.mountEditor,{headerRef:S,footerRef:P,measurements:w}=Fx(),{formattingLocale:j,colorScheme:C}=W(),[k,E]=(0,g.useState)(null),I=pe("Header",Ts),G=pe("Footer",Rs),z=pe("Legend",Ap),D=pe("Headline",uf),Y=pe("EditorSurface",Dx),H=(0,g.useMemo)(()=>(0,d.formatLegends)({legends:i,numberFormat:c,parsingLocale:u,formattingLocale:j}),[i,c,u,j]),N=(0,g.useMemo)(()=>(0,d.formatHeadline)({headline:f,show:m.show,numberFormat:c,parsingLocale:u,formattingLocale:j,t:n}),[f,m.show,c,u,j,n]),K=je(),V=O(),ye=T(Qx,V),It=T(d.resolvePanelBorderStyle,V),et=T(uv,V),Fe=T(Mn,V),J=T(On,V),ne=T(d.resolveLegendItemStyle,V),Ot=T(qx,V),Mt=T(_x,V),Bt=T(Jx,V),Pr=T(Zx,V),{fontFamily:wr,textScale:Tl,strokeWidth:jr,fill:Ll}=ye,Gt=(0,g.useMemo)(()=>pi(C,{},wr),[C,wr]),tt=(0,g.useMemo)(()=>({width:Math.max(0,e-2*jr),height:Math.max(0,t-2*jr)}),[e,t,jr]),qn=(0,g.useMemo)(()=>Cs(p.graphyBadge.visible,tt,p.graphyBadge.variant),[p.graphyBadge.visible,p.graphyBadge.variant,tt]),Il=p.graphyBadge.position==="footer"?qn:null,Ol=p.graphyBadge.position==="header"?qn:null,He=(0,g.useMemo)(()=>{if(!N)return;const $=(0,d.toFontSpec)(ne.item,Gt.fonts.familyDefault),Gl=(0,d.sharesHeadlineRow)(H)?Nl=>jv({legends:H,rowHeight:Nl,textMeasurer:K,font:$,itemStyle:ne.item,headlineGap:Fe.gap,legendGap:J.gap}):void 0;return{formatted:N,size:m.size,position:m.position,innerRadius:v.type==="polar"?v.innerRadius:0,trailingWidthAt:Gl}},[N,m.size,m.position,v,H,K,ne,Gt,Fe.gap,J.gap]),Nt=Rv({textMeasurer:K,metrics:Gt,overrides:oh()}),Er=(0,g.useMemo)(()=>(0,d.computePanelBorderSizes)(It),[It]),kr=(0,g.useMemo)(()=>(0,d.collectAxisLines)(a,et),[a,et]),_n=(0,g.useMemo)(()=>(0,d.computePanelEdgeSizes)(kr,Er),[kr,Er]),rt=Tv({measurer:Nt,axes:a,numberFormat:c,parsingLocale:u,formattedLegends:H,containerSize:tt,externalMeasurements:w,headline:He,formattingLocale:j,annotations:h,layers:l,coordSystem:v,overflowStrategy:x,panelEdges:_n,padding:T(d.resolveGraphPadding,V),margins:T(d.resolveChromeMargins,V)}),Ft=(0,g.useMemo)(()=>!rt||!He||!Nt?null:(0,d.resolveHeadlinePlacement)({headline:He,layout:rt.layout,containerSize:tt,measurer:Nt,itemGap:Fe.gap}),[rt,He,Nt,tt,Fe.gap]);if(!rt)return null;const{layout:oe,formattedAxes:Jn,plotBottomY:Ml}=rt,Bl=oe.footer.height>0;return(0,s.jsx)($i,{colorScheme:C,textScale:Tl,graphBackground:(0,d.toPaintColor)(Ll),graphFontFamily:wr,headingFontFamily:Ot.fontFamily,children:(0,s.jsx)(Nu,{metrics:Gt,children:(0,s.jsx)(Mv,{children:(0,s.jsx)(pg,{panelRect:oe.panel,children:(0,s.jsx)(Ux,{graphChrome:ye,editable:b,mode:o,contentRef:b?E:void 0,style:{width:"100%",height:"100%"},children:(0,s.jsxs)(Gc,{animation:r,animate:y.animate,panelRect:oe.panel,children:[(0,s.jsx)(I,{ref:S,headerRect:oe.header,mode:o,title:p.title,showTitle:p.showTitle,subtitle:p.subtitle,showSubtitle:p.showSubtitle,headingStyle:Ot,subtitleStyle:Mt,graphyBadge:Ol}),(0,s.jsx)(Ox,{formattedAxes:Jn,plotRect:oe.plot,panelBorder:Er,axisLines:kr,axisLineCornerRadius:et.cornerRadius,panelEdges:_n,panelFrameRect:oe.panelFrame,panelRect:oe.panel,axisRects:oe.axes,axisLabelRects:oe.axisLabels,formattingLocale:j??u,plotBottomY:Ml,hasReservedFooterSpace:Bl,editable:b,showAnnotations:y.showAnnotations}),(0,s.jsx)(G,{ref:P,footerRect:oe.footer,mode:o,caption:p.caption,showCaption:p.showCaption,source:p.source,showSource:p.showSource,captionStyle:Bt,sourceStyle:Pr,graphyBadge:Il}),(0,s.jsx)(z,{formattedLegends:H,rects:oe.legends}),N&&Ft&&(0,s.jsx)(D,{headline:N,rect:Ft.rect,resolvedSize:Ft.resolvedSize,visibleItemCount:Ft.visibleItemCount,inDonutHole:He!==void 0&&(0,d.paintsInDonutHole)(He)}),b&&k!==null&&(0,s.jsx)(Y,{frameElement:k,panelRect:oe.panel,formattedAxes:Jn}),y.showTooltip&&(0,s.jsx)(av,{})]})})})})})})},Qx=e=>e.graph().resolve(),qx=e=>e.heading.h1().resolve(),_x=e=>e.heading.h2().resolve(),Jx=e=>e.caption().resolve(),Zx=e=>({label:e.source().resolve(),link:e.source.link().resolve()}),$x=e=>{const t=(0,g.useContext)(Jr),r=rr(),n=At(),o=_();return(0,g.useMemo)(()=>e||(t?{commands:t.commands,undo:t.history.undo,redo:t.history.redo,subscribe:t.store.subscribe,getScene:()=>t.store.getState().scene,formattingLocale:t.formattingLocale,getSelection:()=>t.selectionStore.getState().selection,setSelection:a=>t.selectionStore.getState().setSelection(a),subscribeSelection:t.selectionStore.subscribe,canPlaceDataLabels:r.hasCapability,canFormatDataLabelsAsPercentages:r.hasPercentageFormat,getGlyphs:()=>[...n.entries()].map(([a,i])=>({name:a,definition:i})),getPointSymbols:a=>o("point",a)?.symbols}:null),[e,t,r,n,o])},ey=e=>(0,g.useSyncExternalStore)(e.subscribe,e.getScene,e.getScene),ty=()=>{const{commands:e}=W();return e},ry=e=>{if(e.altKey||!e.metaKey&&!e.ctrlKey)return null;const t=e.key.toLowerCase();return t==="z"?e.shiftKey?"redo":"undo":t==="y"&&e.ctrlKey&&!e.shiftKey?"redo":null};Object.defineProperty(exports,"ANNOTATE_ON_THE_MARK",{enumerable:!0,get:function(){return Di}});Object.defineProperty(exports,"ArrowAnnotation",{enumerable:!0,get:function(){return ll}});Object.defineProperty(exports,"ArrowIcon",{enumerable:!0,get:function(){return Is}});Object.defineProperty(exports,"BUILT_IN_GEOM_RENDERERS",{enumerable:!0,get:function(){return Hi}});Object.defineProperty(exports,"CANVAS_COLOR_KEYS",{enumerable:!0,get:function(){return si}});Object.defineProperty(exports,"CHART_LABEL_ATTRIBUTE",{enumerable:!0,get:function(){return Hs}});Object.defineProperty(exports,"CanvasTextMeasurer",{enumerable:!0,get:function(){return yi}});Object.defineProperty(exports,"ChartIntlProvider",{enumerable:!0,get:function(){return C0}});Object.defineProperty(exports,"DEFAULT_FONT_FAMILY",{enumerable:!0,get:function(){return wt}});Object.defineProperty(exports,"DEFAULT_SPRING_TRANSITION",{enumerable:!0,get:function(){return ue}});Object.defineProperty(exports,"DataLabelPlacementResolverProvider",{enumerable:!0,get:function(){return ql}});Object.defineProperty(exports,"DefaultFooter",{enumerable:!0,get:function(){return Rs}});Object.defineProperty(exports,"DefaultGrid",{enumerable:!0,get:function(){return Al}});Object.defineProperty(exports,"DefaultHeader",{enumerable:!0,get:function(){return Ts}});Object.defineProperty(exports,"DefaultSwatch",{enumerable:!0,get:function(){return Ei}});Object.defineProperty(exports,"DefaultTooltip",{enumerable:!0,get:function(){return is}});Object.defineProperty(exports,"EDIT_TARGET_AXIS_ATTRIBUTE",{enumerable:!0,get:function(){return pt}});Object.defineProperty(exports,"EDIT_TARGET_ID_ATTRIBUTE",{enumerable:!0,get:function(){return zn}});Object.defineProperty(exports,"EDIT_TARGET_KIND_ATTRIBUTE",{enumerable:!0,get:function(){return Oe}});Object.defineProperty(exports,"EditorProvider",{enumerable:!0,get:function(){return gg}});Object.defineProperty(exports,"GRAPH_MODES",{enumerable:!0,get:function(){return Pe}});Object.defineProperty(exports,"GeomOverpaint",{enumerable:!0,get:function(){return Yi}});Object.defineProperty(exports,"GeomPanelSizeProvider",{enumerable:!0,get:function(){return tn}});Object.defineProperty(exports,"GeomRendererResolverProvider",{enumerable:!0,get:function(){return Vu}});Object.defineProperty(exports,"GeomShapesProvider",{enumerable:!0,get:function(){return Kc}});Object.defineProperty(exports,"GeomViewportProvider",{enumerable:!0,get:function(){return ja}});Object.defineProperty(exports,"GlyphMark",{enumerable:!0,get:function(){return nr}});Object.defineProperty(exports,"GlyphRegistryProvider",{enumerable:!0,get:function(){return lc}});Object.defineProperty(exports,"GraphContext",{enumerable:!0,get:function(){return Jr}});Object.defineProperty(exports,"GraphRenderer",{enumerable:!0,get:function(){return Kx}});Object.defineProperty(exports,"GraphRendererBody",{enumerable:!0,get:function(){return Rl}});Object.defineProperty(exports,"GraphyBadge",{enumerable:!0,get:function(){return Dn}});Object.defineProperty(exports,"HoverProvider",{enumerable:!0,get:function(){return Vi}});Object.defineProperty(exports,"IS_DEV",{enumerable:!0,get:function(){return sa}});Object.defineProperty(exports,"Icon",{enumerable:!0,get:function(){return Wn}});Object.defineProperty(exports,"ImageAnnotation",{enumerable:!0,get:function(){return dl}});Object.defineProperty(exports,"InlineEditorsProvider",{enumerable:!0,get:function(){return bg}});Object.defineProperty(exports,"IntlProvider",{enumerable:!0,get:function(){return kn}});Object.defineProperty(exports,"IntroFade",{enumerable:!0,get:function(){return Ci}});Object.defineProperty(exports,"IntroWipeClip",{enumerable:!0,get:function(){return en}});Object.defineProperty(exports,"LEGEND_OVERFLOW_CONTROL_SELECTOR",{enumerable:!0,get:function(){return hf}});Object.defineProperty(exports,"MODE_RULES",{enumerable:!0,get:function(){return re}});Object.defineProperty(exports,"MinusIcon",{enumerable:!0,get:function(){return Os}});Object.defineProperty(exports,"PanelOverflowClip",{enumerable:!0,get:function(){return jl}});Object.defineProperty(exports,"PointSymbol",{enumerable:!0,get:function(){return St}});Object.defineProperty(exports,"PortalThemeProvider",{enumerable:!0,get:function(){return es}});Object.defineProperty(exports,"RICH_TEXT_FONT_FAMILIES",{enumerable:!0,get:function(){return rs}});Object.defineProperty(exports,"SIDE_KEYS",{enumerable:!0,get:function(){return Wi}});Object.defineProperty(exports,"STICKER_ASSETS",{enumerable:!0,get:function(){return Xn}});Object.defineProperty(exports,"ShapeAnnotation",{enumerable:!0,get:function(){return ul}});Object.defineProperty(exports,"StickerAnnotation",{enumerable:!0,get:function(){return fl}});Object.defineProperty(exports,"TextAnnotation",{enumerable:!0,get:function(){return vm}});Object.defineProperty(exports,"TextMeasurerProvider",{enumerable:!0,get:function(){return Si}});Object.defineProperty(exports,"ThemeProvider",{enumerable:!0,get:function(){return $i}});Object.defineProperty(exports,"Z_INDEX",{enumerable:!0,get:function(){return ct}});Object.defineProperty(exports,"__toESM",{enumerable:!0,get:function(){return ta}});Object.defineProperty(exports,"areRectsEqual",{enumerable:!0,get:function(){return Zt}});Object.defineProperty(exports,"arrowHeads",{enumerable:!0,get:function(){return qv}});Object.defineProperty(exports,"assignTextStyleVars",{enumerable:!0,get:function(){return yh}});Object.defineProperty(exports,"buildCirclesPath",{enumerable:!0,get:function(){return wc}});Object.defineProperty(exports,"buildDotsEditOutlineShapes",{enumerable:!0,get:function(){return ha}});Object.defineProperty(exports,"buildOverflowClipRect",{enumerable:!0,get:function(){return El}});Object.defineProperty(exports,"buildRoundedRectPath",{enumerable:!0,get:function(){return Ua}});Object.defineProperty(exports,"canMoveAnnotationOnCanvas",{enumerable:!0,get:function(){return ol}});Object.defineProperty(exports,"createGeomRendererResolver",{enumerable:!0,get:function(){return Sn}});Object.defineProperty(exports,"createTargetBoundaryStore",{enumerable:!0,get:function(){return a0}});Object.defineProperty(exports,"darkTheme",{enumerable:!0,get:function(){return Zi}});Object.defineProperty(exports,"defineGeomRenderer",{enumerable:!0,get:function(){return t0}});Object.defineProperty(exports,"defineGlyph",{enumerable:!0,get:function(){return ic}});Object.defineProperty(exports,"dictionaries",{enumerable:!0,get:function(){return xr}});Object.defineProperty(exports,"editor",{enumerable:!0,get:function(){return cm}});Object.defineProperty(exports,"findPressedObservation",{enumerable:!0,get:function(){return ag}});Object.defineProperty(exports,"getBuiltInEditOutlineShapes",{enumerable:!0,get:function(){return r0}});Object.defineProperty(exports,"growRect",{enumerable:!0,get:function(){return sn}});Object.defineProperty(exports,"isHex",{enumerable:!0,get:function(){return Su}});Object.defineProperty(exports,"isLiveRender",{enumerable:!0,get:function(){return An}});Object.defineProperty(exports,"isOnLiveGeomMark",{enumerable:!0,get:function(){return pf}});Object.defineProperty(exports,"isTinySpan",{enumerable:!0,get:function(){return As}});Object.defineProperty(exports,"isValidCssColor",{enumerable:!0,get:function(){return Pu}});Object.defineProperty(exports,"lightTheme",{enumerable:!0,get:function(){return Rn}});Object.defineProperty(exports,"lightenCss",{enumerable:!0,get:function(){return bu}});Object.defineProperty(exports,"logDiagnostics",{enumerable:!0,get:function(){return ra}});Object.defineProperty(exports,"measureArrowEnds",{enumerable:!0,get:function(){return el}});Object.defineProperty(exports,"measureShapeRegion",{enumerable:!0,get:function(){return $s}});Object.defineProperty(exports,"measureTextAnnotationBox",{enumerable:!0,get:function(){return tl}});Object.defineProperty(exports,"mergeGlyphs",{enumerable:!0,get:function(){return sc}});Object.defineProperty(exports,"panelBox",{enumerable:!0,get:function(){return Jv}});Object.defineProperty(exports,"previewResizedText",{enumerable:!0,get:function(){return gl}});Object.defineProperty(exports,"readAnnotationUnderPointer",{enumerable:!0,get:function(){return Nn}});Object.defineProperty(exports,"readArrowEnd",{enumerable:!0,get:function(){return _v}});Object.defineProperty(exports,"readCrosshairLine",{enumerable:!0,get:function(){return Js}});Object.defineProperty(exports,"readDraggedArrowEndpointFor",{enumerable:!0,get:function(){return Wv}});Object.defineProperty(exports,"readDraggedDifferenceArrowEndpointFor",{enumerable:!0,get:function(){return Vv}});Object.defineProperty(exports,"readDrawnPanelPoint",{enumerable:!0,get:function(){return bs}});Object.defineProperty(exports,"readGridLineStyle",{enumerable:!0,get:function(){return mt}});Object.defineProperty(exports,"readLegendItemAddress",{enumerable:!0,get:function(){return Fs}});Object.defineProperty(exports,"readMovedAnnotationFor",{enumerable:!0,get:function(){return Hv}});Object.defineProperty(exports,"readPressedObservation",{enumerable:!0,get:function(){return og}});Object.defineProperty(exports,"readResizedShapeFor",{enumerable:!0,get:function(){return $v}});Object.defineProperty(exports,"readResizedTextFor",{enumerable:!0,get:function(){return tg}});Object.defineProperty(exports,"readRichTextFontId",{enumerable:!0,get:function(){return ns}});Object.defineProperty(exports,"readStampedEditTargetInStack",{enumerable:!0,get:function(){return ff}});Object.defineProperty(exports,"readStanding",{enumerable:!0,get:function(){return Re}});Object.defineProperty(exports,"resolveAnnotationChromeGeometry",{enumerable:!0,get:function(){return Tp}});Object.defineProperty(exports,"resolveCanvasColor",{enumerable:!0,get:function(){return Xr}});Object.defineProperty(exports,"resolveEditTargetAtPoint",{enumerable:!0,get:function(){return sg}});Object.defineProperty(exports,"resolveGraphMode",{enumerable:!0,get:function(){return Pn}});Object.defineProperty(exports,"resolveGraphyBadgeVariant",{enumerable:!0,get:function(){return Cs}});Object.defineProperty(exports,"resolveHistoryStep",{enumerable:!0,get:function(){return ry}});Object.defineProperty(exports,"resolvePathStroke",{enumerable:!0,get:function(){return we}});Object.defineProperty(exports,"resolvePortalContainer",{enumerable:!0,get:function(){return ts}});Object.defineProperty(exports,"resolveRichTextFontFamily",{enumerable:!0,get:function(){return Vr}});Object.defineProperty(exports,"scalePointToPanel",{enumerable:!0,get:function(){return gt}});Object.defineProperty(exports,"stampAxisEditTarget",{enumerable:!0,get:function(){return Sr}});Object.defineProperty(exports,"stampGridEditTarget",{enumerable:!0,get:function(){return Vn}});Object.defineProperty(exports,"stampLegendEditTarget",{enumerable:!0,get:function(){return Rt}});Object.defineProperty(exports,"tintsGlyphImage",{enumerable:!0,get:function(){return dc}});Object.defineProperty(exports,"toBorderRadiusCss",{enumerable:!0,get:function(){return Je}});Object.defineProperty(exports,"toGeomEffectsStyle",{enumerable:!0,get:function(){return U}});Object.defineProperty(exports,"toHtmlTextCss",{enumerable:!0,get:function(){return X}});Object.defineProperty(exports,"transparentizeCss",{enumerable:!0,get:function(){return Z}});Object.defineProperty(exports,"useChartI18nProps",{enumerable:!0,get:function(){return qi}});Object.defineProperty(exports,"useDataLabelPlacementResolver",{enumerable:!0,get:function(){return rr}});Object.defineProperty(exports,"useDebouncedCallback",{enumerable:!0,get:function(){return Xi}});Object.defineProperty(exports,"useDifferenceArrowGeometries",{enumerable:!0,get:function(){return Es}});Object.defineProperty(exports,"useEditorState",{enumerable:!0,get:function(){return le}});Object.defineProperty(exports,"useEditorStore",{enumerable:!0,get:function(){return fg}});Object.defineProperty(exports,"useElementScreenRect",{enumerable:!0,get:function(){return g0}});Object.defineProperty(exports,"useFormattingLocale",{enumerable:!0,get:function(){return Gn}});Object.defineProperty(exports,"useGeomHitTest",{enumerable:!0,get:function(){return Ui}});Object.defineProperty(exports,"useGeomHover",{enumerable:!0,get:function(){return Ki}});Object.defineProperty(exports,"useGeomPanelSize",{enumerable:!0,get:function(){return ae}});Object.defineProperty(exports,"useGeomPixelsPerUnit",{enumerable:!0,get:function(){return Qc}});Object.defineProperty(exports,"useGeomReaderTree",{enumerable:!0,get:function(){return Te}});Object.defineProperty(exports,"useGeomRendererResolver",{enumerable:!0,get:function(){return _}});Object.defineProperty(exports,"useGeomShapes",{enumerable:!0,get:function(){return Xc}});Object.defineProperty(exports,"useGeomStyleReader",{enumerable:!0,get:function(){return B}});Object.defineProperty(exports,"useGeomViewport",{enumerable:!0,get:function(){return ir}});Object.defineProperty(exports,"useGeomViewportSize",{enumerable:!0,get:function(){return sr}});Object.defineProperty(exports,"useGlyphRegistry",{enumerable:!0,get:function(){return At}});Object.defineProperty(exports,"useGraphAnimation",{enumerable:!0,get:function(){return q}});Object.defineProperty(exports,"useGraphCommands",{enumerable:!0,get:function(){return ty}});Object.defineProperty(exports,"useGraphContext",{enumerable:!0,get:function(){return W}});Object.defineProperty(exports,"useGraphHandle",{enumerable:!0,get:function(){return $x}});Object.defineProperty(exports,"useGraphLocale",{enumerable:!0,get:function(){return Ov}});Object.defineProperty(exports,"useGraphMode",{enumerable:!0,get:function(){return he}});Object.defineProperty(exports,"useGraphSelection",{enumerable:!0,get:function(){return cl}});Object.defineProperty(exports,"useGuidesTakePress",{enumerable:!0,get:function(){return Ee}});Object.defineProperty(exports,"useHandleScene",{enumerable:!0,get:function(){return ey}});Object.defineProperty(exports,"useHasThemeContext",{enumerable:!0,get:function(){return H0}});Object.defineProperty(exports,"useHoverContext",{enumerable:!0,get:function(){return Ie}});Object.defineProperty(exports,"useHoverState",{enumerable:!0,get:function(){return Be}});Object.defineProperty(exports,"useI18n",{enumerable:!0,get:function(){return En}});Object.defineProperty(exports,"useLatestRef",{enumerable:!0,get:function(){return $t}});Object.defineProperty(exports,"useMeasuredBoxRef",{enumerable:!0,get:function(){return ys}});Object.defineProperty(exports,"useMeasuredBoxes",{enumerable:!0,get:function(){return xs}});Object.defineProperty(exports,"usePaintDefs",{enumerable:!0,get:function(){return te}});Object.defineProperty(exports,"usePaintedObservationBoxes",{enumerable:!0,get:function(){return il}});Object.defineProperty(exports,"useResizeObserver",{enumerable:!0,get:function(){return wn}});Object.defineProperty(exports,"useResolvedAnnotations",{enumerable:!0,get:function(){return $e}});Object.defineProperty(exports,"useResolvedStyle",{enumerable:!0,get:function(){return T}});Object.defineProperty(exports,"useSceneSelector",{enumerable:!0,get:function(){return L}});Object.defineProperty(exports,"useStyleReaderTree",{enumerable:!0,get:function(){return O}});Object.defineProperty(exports,"useStyleResolver",{enumerable:!0,get:function(){return $r}});Object.defineProperty(exports,"useSvgPathMorph",{enumerable:!0,get:function(){return Qt}});Object.defineProperty(exports,"useTextAnnotationTextColor",{enumerable:!0,get:function(){return hl}});Object.defineProperty(exports,"useTextDirection",{enumerable:!0,get:function(){return k0}});Object.defineProperty(exports,"useTextMeasurer",{enumerable:!0,get:function(){return je}});Object.defineProperty(exports,"useThemeContext",{enumerable:!0,get:function(){return Et}});Object.defineProperty(exports,"vars",{enumerable:!0,get:function(){return A}});
|