@graphysdk/viz-engine 1.9.0-beta.1791811201637 → 1.9.0-beta.1791817361884

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.
@@ -0,0 +1 @@
1
+ let I=require("color2k"),v=require("date-fns"),ot=require("lodash-es");var or=["diagonal","dots","crosshatch","lines"],sr=["tile","stretch"],je=e=>typeof e=="object"&&e!==null&&"gradient"in e,Be=e=>typeof e=="object"&&e!==null&&"pattern"in e,st=e=>typeof e=="object"&&e!==null&&"image"in e,lr=e=>typeof e!="object"?e:je(e)?e.stops[0]?.color??"transparent":Be(e)?e.color:e.fallback,qn=e=>typeof e=="string"?e:JSON.stringify(e),xt="#FFFFFF",He="#1A1A1A",Jn=4.5,ur=e=>{try{const t=ie(e);return(0,I.getContrast)(t,xt)>(0,I.getContrast)(t,He)?xt:He}catch{return He}},Zn=(e,t)=>{try{const r=cr(void 0,t);return r===void 0||(0,I.getContrast)(r,ie(e))>=Jn?e:ur(r)}catch{return e}},cr=(e,t)=>{try{const r=ie(t);if(e===void 0){const[,,,i]=(0,I.parseToRgba)(r);return i>=1?r:void 0}const n=ie(e),[,,,a]=(0,I.parseToRgba)(n);return a>=1?n:(0,I.parseToRgba)(r)[3]<1?void 0:(0,I.mix)(r,(0,I.opacify)(n,1),a)}catch{return}},Qn=e=>{try{return(0,I.opacify)(ie(e),1)}catch{return}},dr=(e,t)=>{if(t>=1)return e;try{const[r,n,a,i]=(0,I.parseToRgba)(ie(e));return`rgba(${r}, ${n}, ${a}, ${Math.max(0,i*t)})`}catch{return e}},ea=e=>je(e)?e.stops.every(t=>Te(t.color)):Be(e)?e.background!==void 0&&Te(e.color)&&Te(e.background):st(e)?Te(e.fallback):Te(e),Te=e=>{try{return(0,I.parseToRgba)(ie(e))[3]>=1}catch{return!1}},ie=e=>{const t=/^(rgb|hsl)a?\((.*)\)$/iu.exec(e.trim());if(t===null||t[1]===void 0||t[2]===void 0)return e;const r=t[2].split(/[\s,/]+/u).filter(u=>u!=="");if(r.length!==3&&r.length!==4)return e;const[n="",a,i,o]=r,s=[n.replace(/deg$/iu,""),a,i];if(o===void 0)return`${t[1]}(${s.join(", ")})`;const l=o.endsWith("%")?Number.parseFloat(o)/100:o;return`${t[1]}a(${[...s,l].join(", ")})`},Ce=e=>e instanceof Date&&(0,v.isValid)(e),ta=e=>Ce(e)||e===null,ra=e=>typeof e=="string",S=e=>typeof e=="number"&&!Number.isNaN(e)&&Number.isFinite(e),na=e=>S(e)||e===null,G=Math.PI*2,aa=8,ia=1e-9,oa=[0,Math.PI/2,Math.PI,G*3/4],fr=(e,t)=>Math.abs(t-e)>=G-ia,oe=e=>(e%G+G)%G,pr=(e,t,r)=>{if(fr(t,r))return!0;const n=oe(r-t);return oe(e-t)<=n},lt=(e,t)=>{const r=Math.abs(oe(e)-oe(t));return Math.min(r,G-r)},sa=(e,t)=>{const r=oe(t-e);return r>Math.PI?r-G:r},la=(e,t,r)=>e*G+t+r,hr=(e,t)=>({x:t*Math.sin(e),y:t*Math.cos(e)}),te=(e,t)=>{const r=hr(e,t);return{x:.5+r.x/2,y:.5+r.y/2}},gr=(e,t,r,n)=>{const a=[te(e,r),te(e,n),te(t,r),te(t,n)],i=Math.max(r,n),o=oa.filter(l=>pr(l,e,t)).map(l=>te(l,i)),s=[...a,...o];return{xMin:Math.min(...s.map(l=>l.x)),xMax:Math.max(...s.map(l=>l.x)),yMin:Math.min(...s.map(l=>l.y)),yMax:Math.max(...s.map(l=>l.y))}},yr=(e,t)=>({angle:oe(Math.atan2(e,t)),radius:Math.hypot(e,t)}),mr=(e,t)=>{const r=e.x-.5,n=e.y-.5;return{x:t>=1?r*2*t:r*2,y:t>=1?n*2:n*2/t}},ua=(e,t)=>{const{x:r,y:n}=mr(e,t);return yr(r,n)},br="\0graphy\0_",y=e=>`${br}${e}`,ut={x:y("constantX")},ca={bar:y("barSeriesLabel"),line:y("lineSeriesLabel")},ct={count:y("count"),mean:y("mean"),sum:y("sum"),summaryEstimate:y("summaryEstimate"),summaryLower:y("summaryLower"),summaryUpper:y("summaryUpper")},Ne={group:y("group")},g={x:y("x"),y:y("y"),xBand:y("xBand"),yBand:y("yBand"),xMin:y("xMin"),xMax:y("xMax"),yMin:y("yMin"),yMax:y("yMax"),yRaw:y("yRaw")},dt={role:y("stackRole")},ue={color:y("color"),size:y("size"),alpha:y("alpha"),strokeWidth:y("strokeWidth"),lineType:y("lineType")},Oe={y:y("ruleY"),x:y("ruleX")},al={...ut,...ct,...Ne,...g,...dt,...ue,...Oe},da=new Set(Object.values(ct)),vr=e=>y(`scaled_${e}`),fa=e=>e.startsWith(br),pa=e=>da.has(e);function q(e){return e[g.x]}function z(e){return e[g.y]}function ha(e){return e[g.xBand]??e[g.x]}function ga(e){return e[g.yBand]??e[g.y]}function J(e){return e[g.xMin]}function Z(e){return e[g.xMax]}function H(e){return e[g.yMin]}function K(e){return e[g.yMax]}function Ar(e){return e[g.yRaw]}function ya(e,t){return e[vr(t)]}var ma={xMin:0,xMax:1,yMin:0,yMax:1},Er=(e,t)=>{const r=J(e)??q(e),n=Z(e)??q(e),a=H(e)??z(e),i=K(e)??z(e);return!S(r)||!S(n)||!S(a)||!S(i)?null:t.type!=="polar"?{xMin:r,xMax:n,yMin:a,yMax:i}:{...gr(r,n,a,i),space:"disk"}},ft=(e,t)=>{const r=(e.xMin+e.xMax)/2,n=(e.yMin+e.yMax)/2;switch(t){case"top":return{x:r,y:e.yMax};case"bottom":return{x:r,y:e.yMin};case"left":return{x:e.xMin,y:n};case"right":return{x:e.xMax,y:n};case"top-left":return{x:e.xMin,y:e.yMax};case"top-right":return{x:e.xMax,y:e.yMax};case"bottom-left":return{x:e.xMin,y:e.yMin};case"bottom-right":return{x:e.xMax,y:e.yMin};default:return{x:r,y:n}}},ba=e=>ft(ma,e),Fe=e=>(Array.isArray(e)?e:[e]).map(t=>t instanceof Date?t.toISOString():String(t??"<null>")).join("\0"),va=(e,t)=>e===t?!0:Ce(e)&&Ce(t)?e.getTime()===t.getTime():!1,Tr=e=>e===null?"null":e instanceof Date?`date:${e.getTime()}`:`${typeof e}:${e}`,Aa=e=>e.length>0;function B(e){return e!=null}function Ea(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Ta(e){const{numeric:t,categorical:r,temporal:n}=e.groupVariableNamesByType();return n[0]??r[0]??t[0]??""}function Oa(e,t){const{categorical:r,temporal:n}=e.groupVariableNamesByType(),a=[...r,...n];return t===""||a.includes(t)?a:[t,...a]}function Pa(e){const t=L(e.x);return t===null||t===ut.x?"":t}function L(e){return B(e)?typeof e=="string"?e:"variable"in e?e.variable:null:null}function Se(e){if(!(!B(e)||typeof e=="string")&&"value"in e)return e.value}function Sa(e,t){return[...new Set([...Object.keys(e),...Object.keys(t)])].every(r=>Lt(e[r])===Lt(t[r]))}function Lt(e){const t=L(e);if(t!==null)return`variable:${t}`;const r=Se(e);return r===void 0?"":`value:${Tr(r)}`}var Or=["stack","dodge","identity","fill"],Pr=["solid","dashed","dotted"],j={line:{solid:[],dashed:[4,2],dotted:[1,1]},rule:{solid:[],dashed:[2,3],dotted:[0,2]},gridLine:{solid:[],dashed:[2,3],dotted:[1,3]},panelBorder:{solid:[],dashed:[2,3],dotted:[1,3]},directLabel:{solid:[],dashed:[2,3],dotted:[1,3]},arrow:{solid:[],dashed:[1.5,3],dotted:[0,2]}},_a=e=>Pr.includes(e);function he(e){return e==="stack"||e==="fill"}var xe="en-GB",pt=class extends Error{constructor(e){super(e.message,e.cause!==void 0?{cause:e.cause}:void 0),this.name=new.target.name,this.code=e.code,this.context=e.context,this.suggestion=e.suggestion}},se=class extends pt{constructor(e){super(e),this.kind="user-input"}},x=class extends pt{constructor(e){super({...e,code:e.code??"INTERNAL_INVARIANT"}),this.kind="internal"}},ht=e=>e.type==="lookup",Sr=e=>e.type==="text",ye=e=>e.type==="date"||e.type==="datetime"||e.type==="year"||e.type==="month_year"||e.type==="month"||e.type==="day_month"||e.type==="weekly_date_range"||e.type==="weekly_date_range_with_year"||e.type==="quarter"||e.type==="time",_r=e=>e.type==="decimal"||e.type==="integer"||e.type==="percentage"||e.type==="duration"||e.type==="currency",Ma=e=>e.type==="currency",xa=e=>e.type==="month"||e.type==="day_month"||e.type==="weekly_date_range",Mr=e=>{if(ht(e))return Mr(e.fallback);if(ye(e))return"temporal";if(_r(e))return"numeric";if(Sr(e))return"categorical";throw new x({message:`No data type found for value format: ${e.type}`})},La=e=>ht(e)?e.fallback:e,xr=class{constructor(){this.currentYear=new Date().getUTCFullYear(),this.previousDate=null,this.previousYear=null}incrementYearIfNeeded(e){this.previousYear===null?this.previousYear=e.getUTCFullYear():this.previousDate!==null&&(0,v.isBefore)(new Date(this.currentYear,e.getUTCMonth(),e.getUTCDate()),new Date(this.currentYear,this.previousDate.getUTCMonth(),this.previousDate.getUTCDate()))&&this.previousYear++;const t=new Date(e.getTime());return t.setUTCFullYear(this.previousYear),this.previousDate=t,t}},Lr={k:1e3,m:1e6,b:1e9,t:1e12},gt=["k","m","b","t"],Ra=new RegExp(`^-?(\\d{1,3}(,\\d{3})*|\\d+)\\.?\\d*(${gt.join("|")})?$`,"i"),wa=/^-?\d{1,3}(?:,\d{3})*(?:\.\d+)?%?$/,le=e=>e===null||e instanceof Date||Array.isArray(e)||typeof e=="boolean"?!1:typeof e=="string"?Ra.test(e)&&!Number.isNaN(Number(e.replace(new RegExp(`[,${gt.join("")}]`,"gi"),""))):Number.isFinite(Number(e)),Rr=e=>le(e)?!0:typeof e=="string"?wa.test(e):!1,ka=/^\d{4}-\d{2}-\d{2}(T|\s)\d{1,2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|\+00:00)?$/,Da=/^\s*(1[89]\d{2}|2[01]\d{2})\s*$/,Ia=[[/\bJan\b/i,"January"],[/\bFeb\b/i,"February"],[/\bMar\b/i,"March"],[/\bApr\b/i,"April"],[/\bJun\b/i,"June"],[/\bJul\b/i,"July"],[/\bAug\b/i,"August"],[/\bSept?\b/i,"September"],[/\bOct\b/i,"October"],[/\bNov\b/i,"November"],[/\bDec\b/i,"December"]],Ca={"en-US":"MDY","en-GB":"DMY","pt-PT":"DMY",ar:"DMY"},wr=["/","-","."," "],Rt=[["d","M","yy"],["d","MM","yy"],["d","MMMM","yy"],["dd","M","yy"],["dd","MM","yy"],["dd","MMMM","yy"],["do","MMMM","yy"],["d","M","yyyy"],["d","MM","yyyy"],["d","MMMM","yyyy"],["dd","M","yyyy"],["dd","MM","yyyy"],["dd","MMMM","yyyy"],["do","MMMM","yyyy"]],wt=[["M","d","yy"],["M","dd","yy"],["MM","d","yy"],["MM","dd","yy"],["MMMM","d","yy"],["MMMM","dd","yy"],["MMMM","do","yy"],["M","d","yyyy"],["M","dd","yyyy"],["MM","d","yyyy"],["MM","dd","yyyy"],["MMMM","d","yyyy"],["MMMM","dd","yyyy"],["MMMM","do","yyyy"]],kt=[["yyyy","M","d"],["yyyy","M","dd"],["yyyy","MM","d"],["yyyy","MM","dd"],["yyyy","MMMM","d"],["yyyy","MMMM","dd"],["yyyy","MMMM","do"]],kr=[["d","MMMM"],["dd","MMMM"],["do","MMMM"],["MMMM","d"],["MMMM","dd"],["MMMM","do"]],Na=[{dateFormat:"MMMM d, yyyy",type:"date"},{dateFormat:"MMMM dd, yyyy",type:"date"},{dateFormat:"MMMM do, yyyy",type:"date"},{dateFormat:"yyyy-MM",type:"month_year"}],Dr=1800,Ir=2199,Fa=3,ja=6,Ba=5,Va=1,Wa=28,Ua=/\s*[–—]\s*|\s-\s/,Ya=e=>typeof e=="number"?Number.isInteger(e)&&e>=Dr&&e<=Ir:typeof e=="string"?Da.test(e):!1,Cr=(e,t)=>{const r=_e(e);return!t&&le(r)?Ha(r):typeof r=="string"?t?(0,v.isValid)((0,v.parse)(r,t,new Date)):!!Nr(r)||Ve(r)&&(0,v.isValid)(new Date(r)):(0,v.isValid)(r)},_e=e=>{if(typeof e!="string")return e;let t=e;for(const[r,n]of Ia)t=t.replace(r,n);return t},Nr=(e,t=xe)=>{const r=_e(e);return Ve(r)?{type:"datetime"}:jr(t).find(n=>!ye(n)||n.type==="month"&&r.length<Fa?!1:n.dateFormat&&(0,v.isValid)((0,v.parse)(r,n.dateFormat,new Date)))},Ve=e=>ka.test(e.trim()),Fr=e=>{if(e instanceof Date)return(0,v.isValid)(e)?e:null;if(typeof e!="string"||!Ve(e))return null;const t=new Date(e.trim());return(0,v.isValid)(t)?t:null},Ga=(e,t=xe)=>{const[r,n]=e.split(Ua);if(!r||!n)return;const a=_e(r).trim(),i=_e(n).trim();return za(t).find(o=>{if(!ye(o)||!o.dateFormat)return!1;const s=(0,v.parse)(a,o.dateFormat,new Date),l=(0,v.parse)(i,o.dateFormat,new Date);if(!(0,v.isValid)(s)||!(0,v.isValid)(l))return!1;const u=new xr,c=u.incrementYearIfNeeded(s),p=u.incrementYearIfNeeded(l),d=(0,v.differenceInDays)(p,c);return(0,v.isWithinInterval)(new Date(c.getFullYear(),Va,Wa),{start:c,end:p})&&d===Ba?!0:d===ja})},jr=e=>{const t={date:Br(e),year:[["yyyy"]],day_month:kr,month_year:[["MMMM","yyyy"],["yyyy","MMMM"]],month:[["MMMM"]],quarter:[["QQQ","yyyy"],["yyyy","QQQ"]]};return[...Na,...Object.entries(t).flatMap(([r,n])=>n.flatMap(a=>wr.map(i=>({dateFormat:a.join(i),type:r}))))]},Br=e=>Ca[e]==="MDY"?[...wt,...Rt,...kt]:[...Rt,...wt,...kt],za=e=>{const t={weekly_date_range:kr,weekly_date_range_with_year:Br(e)};return Object.entries(t).flatMap(([r,n])=>n.flatMap(a=>wr.map(i=>({dateFormat:a.join(i),type:r}))))},Ha=e=>{const t=Number(e);if(!(0,ot.isInteger)(t))return!1;const r=new Date(t),n=new Date(t*1e3),a=i=>(0,v.isValid)(i)&&i.getFullYear()>=Dr&&i.getFullYear()<=Ir;return a(r)||a(n)},Vr={$:"usd","£":"gbp","€":"eur","¥":"jpy","₹":"inr","₱":"php",P:"php","₩":"krw","₪":"ils","₫":"vnd","₽":"rub","฿":"thb",R$:"brl",Rp:"idr",RM:"myr","₦":"ngn",zł:"pln","₺":"try",kr:"dkk",Fr:"chf",R:"zar","د.إ":"aed","﷼":"sar",Ch$:"clp",NT$:"twd",HK$:"hkd",S$:"sgd",A$:"aud",C$:"cad",NZ$:"nzd",MX$:"mxn"},Wr=e=>{if(typeof e=="string"){const t=Ur(e);return t.length?le(t):!1}return le(e)},Ka=e=>{const t=Yr(e),r=t?Vr[t]:void 0;if(!r)throw new x({message:"Could not get currency ISO"});return r},Ur=e=>{const t=Yr(e);let r=e;if(t){const n=e.indexOf(t);n===0?r=e.slice(t.length):n===e.length-t.length?r=e.slice(0,e.length-t.length):e[0]==="-"&&n===1&&(r=`-${e.slice(t.length+1)}`)}return le(r)?r.split(",").join(""):""},Yr=e=>Object.keys(Vr).sort((t,r)=>r.length-t.length).find(t=>e.includes(t)),Gr=e=>{const t=Object.entries(e);return!t.length||!t.some(([,r])=>!ge(r))},ge=e=>typeof e=="string"&&e.trim()===""||e===void 0||e===null||e==="-",$a=/\s*[–—]\s*|\s-\s/,zr=(e,t,r)=>{if(ge(e))return null;switch(t.type){case"decimal":case"integer":case"duration":return Kr(e);case"percentage":return Xa(e);case"currency":return qa(e);case"datetime":case"date":case"year":case"month_year":case"month":case"day_month":case"quarter":case"time":return Hr(e,t.dateFormat,r);case"weekly_date_range":case"weekly_date_range_with_year":return Ja(e,t.dateFormat,r);case"text":return Za(e);case"lookup":throw new x({message:"Cannot parse: lookup value formats are produced by transforms, not raw input"});default:throw new x({message:`Unhandled value format: ${t.type}`})}},Hr=(e,t,r)=>{if(e instanceof Date)return(0,v.isValid)(e)?e:null;const n=_e(String(e).trim());if(n.length===0)return null;const a=new Date;if(t){const o=(0,v.parse)(n,t,a);return(0,v.isValid)(o)?Ke(o):null}for(const o of jr(r)){if(!ye(o)||!o.dateFormat)continue;const s=(0,v.parse)(n,o.dateFormat,a);if((0,v.isValid)(s))return Ke(s)}const i=new Date(n);return Cr(i)?Ve(n)?i:Ke(i):null},Kr=e=>{if(typeof e=="number")return Number.isFinite(e)?e:null;if(typeof e!="string")return null;let t=e.trim();if(!le(t))return null;let r=1;for(const n of gt)if(new RegExp(`${n}$`,"i").test(t)){r=Lr[n],t=t.slice(0,-1);break}return Number(t.split(",").join(""))*r},Xa=e=>{if(typeof e=="number")return Number.isFinite(e)?e:null;if(typeof e!="string")return null;const t=e.trim();if(!Rr(t))return null;const r=Number(t.replace(/%/g,"").replace(/,/g,""))/100;return Number.isNaN(r)?null:r},qa=e=>{if(typeof e=="number")return Number.isFinite(e)?e:null;if(typeof e!="string")return null;const t=e.trim();return Wr(t)?Kr(Ur(t)):null},Ja=(e,t,r)=>{const n=String(e).trim().split($a),[a,i]=[n[0]?.trim(),n[1]?.trim()];return!a||!i?null:Hr(a,t,r)},Za=e=>String(e).trim(),Ke=e=>new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())),yt=(e,t,r)=>{if(t.type==="text"&&typeof e=="string")return e;const n=zr(e,t,r);return n!==null||!ye(t)?n:Fr(e)},ne=process.env.NODE_ENV!=="production",mt=["none","xs","sm","md","lg","xl","full"],Qa={point:ei,line:ti,area:ri,bar:ni,rule:ai,tile:ii},$r=e=>typeof e=="string"&&mt.includes(e);function ce(e,t){return{type:"layer",id:t.id,geom:e,mapping:t.aes,stat:t.stat,params:t.params,position:t.position,yScaleType:t.yScaleType,transforms:t.transforms,interactive:t.interactive,attachTo:t.attachTo,tooltip:t.tooltip,dataLabels:t.dataLabels}}function ei(e={}){return ce("point",e)}function ti(e={}){return ce("line",e)}function ri(e={}){return ce("area",e)}function ni(e={}){return ce("bar",e)}function ai(e={}){return ce("rule",e)}function ii(e={}){return ce("tile",e)}var oi=["topLeft","topRight","bottomRight","bottomLeft"],si=["dimmed","hovered"],Xr=["normal","italic","oblique"],qr=["none","uppercase","lowercase","capitalize"],Jr=["none","underline","line-through"],Zr=["butt","round","square"],Qr=["miter","round","bevel"],en=["normal","multiply","screen","overlay","darken","lighten"],tn=["circle","square","diamond","triangle","cross","star","wye"],li=["fill","overlay","stroke","alpha","saturation","blur","brightness","contrast","cornerRadius","strokeWidth","dashArray","lineCap","lineJoin","strokeAlpha","fillAlpha","haloColor","haloAlpha","size","symbol","fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","textTransform","textDecoration","textOutlineColor","textOutlineWidth","textShadow","lineHeight","textScale","textColor","offset","gap","length","paddingInline","paddingBlock","padding","margin","shadow","blendMode"],Dt=1,It=1e3,Ct="'none' or a shadow object { offsetX, offsetY, blur, color }",Nt="a non-negative number of pixels, or an object of those per edge",ui="a non-empty color string, a { light, dark } pair, or a token(...) reference",ci=["top","right","bottom","left"],we="a color, a { gradient, stops } object, a { pattern, color } object, or an { image, fallback } object",Ft="a number of pixels, or { topLeft, topRight, bottomRight, bottomLeft } in pixels",Le=e=>typeof e=="object"&&e!==null&&typeof e.light=="string"&&typeof e.dark=="string",bt=e=>typeof e=="object"&&e!==null&&typeof e.token=="string",rn=e=>typeof e=="string"?e.trim().length>0:Le(e)&&e.light.trim().length>0&&e.dark.trim().length>0;function f(e){return{token:e}}var et=(e,t)=>{if(typeof e!="object"||e===null)return e;if(Le(e))return e[t];if(Array.isArray(e)){if(e.every(a=>typeof a=="number"))return e;const n=e.map(a=>et(a,t));return n.every((a,i)=>a===e[i])?e:n}const r=Object.entries(e).map(([n,a])=>[n,et(a,t)]);return r.every(([n,a])=>a===e[n])?e:Object.fromEntries(r)},T=e=>typeof e=="number"&&Number.isFinite(e),b=(e,t)=>({status:"rejected",expected:e,actual:t}),ee=e=>{const t=`one of ${e.map(r=>`'${String(r)}'`).join(", ")}`;return r=>e.includes(r)?{status:"accepted",value:r}:b(t,r)},re=(e,t)=>{if(typeof e=="string")return e.trim().length>0?{status:"accepted",value:e}:b("a non-empty color string",e);if(bt(e)){const r=t[e.token];return r===void 0?{status:"unknownToken",token:e.token}:rn(r)?{status:"accepted",value:typeof r=="string"?r:{light:r.light,dark:r.dark}}:{status:"dropped"}}return Le(e)&&e.light.trim().length>0&&e.dark.trim().length>0?{status:"accepted",value:{light:e.light,dark:e.dark}}:b(ui,e)},nn=(e,t)=>{if(typeof e!="object"||e===null||Le(e)||bt(e))return re(e,t);const r=e;if(je(r)){const n=r.gradient;if(n!=="linear"&&n!=="radial")return b(we,e);if(!Array.isArray(r.stops)||r.stops.length<2)return b("a gradient with at least two stops",e);const a=[];for(const i of r.stops){if(!T(i.offset)||i.offset<0||i.offset>1)return b("a gradient stop offset in [0, 1]",e);const o=re(i.color,t);if(o.status!=="accepted")return o;a.push({offset:i.offset,color:o.value})}return r.gradient==="radial"?{status:"accepted",value:{gradient:"radial",stops:a}}:r.angle!==void 0&&!T(r.angle)?b("a gradient angle in degrees",e):{status:"accepted",value:{gradient:"linear",...r.angle===void 0?{}:{angle:r.angle},stops:a}}}if(Be(r)){if(!or.includes(r.pattern))return b(we,e);const n=re(r.color,t);if(n.status!=="accepted")return n;const a={pattern:r.pattern,color:n.value};if(r.background!==void 0){const i=re(r.background,t);if(i.status!=="accepted")return i;a.background=i.value}if(r.size!==void 0){if(!T(r.size)||r.size<=0)return b("a pattern size in pixels",e);a.size=r.size}return{status:"accepted",value:a}}if(st(r)){if(typeof r.image!="string"||!r.image.startsWith("data:image/"))return b("an image as a data:image URI",e);if(r.fit!==void 0&&!sr.includes(r.fit))return b(we,e);if(r.alpha!==void 0&&(!T(r.alpha)||r.alpha<0||r.alpha>1))return b("an image alpha in [0, 1]",e);if(r.size!==void 0&&(!T(r.size)||r.size<=0))return b("an image size in pixels",e);const n=re(r.fallback,t);return n.status!=="accepted"?n:{status:"accepted",value:{image:r.image,...r.fit===void 0?{}:{fit:r.fit},...r.alpha===void 0?{}:{alpha:r.alpha},...r.size===void 0?{}:{size:r.size},fallback:n.value}}}return b(we,e)},di=(e,t)=>{if(e==="none")return{status:"accepted",value:[]};const r=[];for(const n of Array.isArray(e)?e:[e]){const a=nn(n,t);if(a.status!=="accepted")return a;r.push(a.value)}return{status:"accepted",value:r}},jt=e=>{if(T(e)&&e>=0)return{status:"accepted",value:{top:e,right:e,bottom:e,left:e}};if(typeof e!="object"||e===null)return b(Nt,e);const t=e,r={};for(const n of ci){const a=t[n];if(a!==void 0){if(!T(a)||a<0)return b(Nt,e);r[n]=a}}return{status:"accepted",value:r}},fi=e=>{if(T(e)&&e>=0)return{status:"accepted",value:e};if(typeof e!="object"||e===null)return b(Ft,e);const t=e,r={};for(const n of oi){const a=t[n];if(!T(a)||a<0)return b(Ft,e);r[n]=a}return{status:"accepted",value:r}},pi={color:re,paint:nn,overlay:di,unitInterval:e=>T(e)&&e>=0&&e<=1?{status:"accepted",value:e}:b("a number in [0, 1]",e),pixels:e=>T(e)&&e>=0?{status:"accepted",value:e}:b("a non-negative number of pixels",e),barRadius:e=>$r(e)||T(e)&&e>=0?{status:"accepted",value:e}:b(`a number of pixels or one of ${mt.map(t=>`'${t}'`).join(", ")}`,e),dashArray:e=>Array.isArray(e)&&e.every(t=>T(t)&&t>=0)?{status:"accepted",value:[...e]}:b("an array of non-negative dash and gap lengths, in stroke widths",e),fontFamily:e=>typeof e=="string"&&e.trim().length>0?{status:"accepted",value:e}:b("a non-empty CSS font-family list",e),fontWeight:e=>T(e)&&e>=Dt&&e<=It?{status:"accepted",value:e}:b(`a number in [${Dt}, ${It}]`,e),multiplier:e=>T(e)&&e>=0?{status:"accepted",value:e}:b("a non-negative multiple, 1 being unchanged",e),shadow:(e,t)=>{if(e==="none")return{status:"accepted",value:e};if(typeof e!="object"||e===null)return b(Ct,e);const r=e;if(!T(r.offsetX)||!T(r.offsetY)||!T(r.blur)||r.blur<0)return b(Ct,e);const n=re(r.color,t);return n.status!=="accepted"?n:{status:"accepted",value:{offsetX:r.offsetX,offsetY:r.offsetY,blur:r.blur,color:n.value}}},padding:jt,margin:jt,blendMode:ee(en),signedPixels:e=>T(e)?{status:"accepted",value:e}:b("a number of pixels, negative allowed",e),fontStyle:ee(Xr),textTransform:ee(qr),textDecoration:ee(Jr),lineCap:ee(Zr),lineJoin:ee(Qr),pointSymbol:ee(tn),boxRadius:fi};var We=!0,hi=e=>{We=e},gi=()=>We,yi=()=>{let e=null;const t={hits:0,misses:0};return Object.assign((n,a)=>{if(!We)return ne&&(t.misses+=1),a();if(e&&on(e.args,n))return ne&&(t.hits+=1),e.out;ne&&(t.misses+=1);const i=a();return e={args:n,out:i},i},{stats:t,reset:()=>{e=null}})},an=()=>{const e=new WeakMap,t={hits:0,misses:0};return Object.assign((n,a,i)=>{if(!We)return ne&&(t.misses+=1),i();const o=e.get(n);if(o)for(let l=0;l<o.length;l+=1){const u=o[l];if(u&&on(u.args,a))return ne&&(t.hits+=1),l>0&&(o.splice(l,1),o.unshift(u)),u.out}ne&&(t.misses+=1);const s=i();return o?(o.unshift({args:a,out:s}),o.length>16&&(o.length=16)):e.set(n,[{args:a,out:s}]),s},{stats:t})},mi=(...e)=>e.reduce((t,r)=>({hits:t.hits+r.hits,misses:t.misses+r.misses}),{hits:0,misses:0}),on=(e,t)=>{if(e.length!==t.length)return!1;for(let r=0;r<e.length;r+=1)if(e[r]!==t[r])return!1;return!0},sn=class{constructor(){this.memo=an(),this.singletonKey={}}get stats(){return this.memo.stats}compile(e){return this.memo(this.key(e),this.dependencies(e),()=>this.run(e))}key(e){return this.singletonKey}},Ue=(e,t)=>e>=0&&e<=1&&t>=0&&t<=1,bi=["x","y"],ln=new Set(["x","y","ySecondary"]),vt=new Set(["color","size","alpha","strokeWidth","lineType"]),un=e=>ln.has(e),cn=e=>vt.has(e),vi=e=>un(e)||cn(e);function dn(e){return e==="secondary"?"ySecondary":"y"}function Ai(e,t){return e==="y"?dn(t):"x"}function Ei(e){return e==="ySecondary"?"y":e}var fn=(e,t)=>{if(B(t.group)){const a=L(t.group);if(a!==null)return[a]}const r=new Set([L(t.x),L(t.y)].filter(B)),n=new Set;for(const a of vt){const i=L(t[a]);B(i)&&(r.has(i)||e.hasVariable(i)&&e.getType(i)==="categorical"&&n.add(i))}return[...n]},At=(e,t)=>e.hasVariable(Ne.group)?e.getValues(Ne.group,{distinct:!0,skipNulls:!0}).length>1:fn(e,t).some(r=>e.getValues(r,{distinct:!0,skipNulls:!0}).length>1),Ti=new Set(["count","sum","mean","median"]);function pn(e,t){return Ti.has(e)?"numeric":t}function hn(e,t,r,n){if(n!==void 0&&n.type!=="numeric"&&(e==="sum"||e==="mean"||e==="median"))throw new se({code:"INCOMPATIBLE_TYPE",message:`'${e}' requires a numeric variable (got '${n.type}' for '${n.variableName}')`,context:{variableName:n.variableName,variableType:n.type}});const a=r?.length??t.length;if(e==="count")return a;if(e==="median"||e==="mode"){const s=[];for(let l=0;l<a;l++){const u=$e(t,r,l);Xe(u)&&s.push(u)}return s.length===0?null:e==="median"?Si(s):_i(s)}if(e==="sum"||e==="mean"){let s=0,l=0;for(let u=0;u<a;u++){const c=$e(t,r,u);Xe(c)&&(s++,l+=Number(c))}return s===0?null:e==="sum"?l:l/s}const i=e==="min"?-1:1;let o=null;for(let s=0;s<a;s++){const l=$e(t,r,s);Xe(l)&&(o===null||Oi(l,o)===i)&&(o=l)}return o}var $e=(e,t,r)=>e[t?.[r]??r]??null,Xe=e=>e!==null&&!(typeof e=="number"&&Number.isNaN(e)),Oi=(e,t)=>e===null||t===null?0:e<t?-1:e>t?1:0,Pi=e=>e instanceof Date?e.getTime():e??null;function Si(e){const t=e.map(Number).sort((i,o)=>i-o);if(t.length===1)return t[0]??0;const r=(t.length-1)/2,n=Math.floor(r),a=t[n]??0;return a+((t[n+1]??a)-a)*(r-n)}function _i(e){const t=new Map;for(const a of e){const i=Pi(a),o=t.get(i);o===void 0?t.set(i,{value:a,count:1}):o.count++}let r=null,n=0;for(const{value:a,count:i}of t.values())i>n&&(n=i,r=a);return r}var Mi=e=>e==null||typeof e=="number"&&Number.isNaN(e),xi=e=>e instanceof Date?e.getTime():e??null,tt=class X{constructor(t,r,n,a=null){this.rowShape=null,this.names=t,this.columns=r,this.rowCount=n,this.source=a}get columnCount(){return this.names.length}static from(t){const r=Object.entries(t);return new X(r.map(([n])=>n),new Map(r),r[0]?.[1].length??0)}columnNames(){return[...this.names]}hasColumn(t){return this.names.includes(t)}values(t){const r=this.columns.get(t);if(r!==void 0)return r;if(this.source===null||!this.names.includes(t))return;const n=this.source.table.values(t);if(n===void 0)return;const{indices:a}=this.source,i=new Array(a.length);for(let o=0;o<a.length;o++)i[o]=n[a[o]??0]??null;return this.columns.set(t,i),this.columns.size===this.names.length&&(this.source=null),i}assign(t,r){const n=this.gathered(),a=new Map(n.columns);a.set(t,r);const i=n.names.includes(t)?[...n.names]:[...n.names,t];return new X(i,a,n.names.length===0?r.length:n.rowCount)}select(t){const r=t.filter(a=>this.names.includes(a)),n=new Map;for(const a of r){const i=this.columns.get(a);i!==void 0&&n.set(a,i)}return new X(r,n,this.rowCount,this.source)}rename(t,r){const n=this.gathered(),a=new Map;for(const i of n.names){const o=n.columns.get(i);o!==void 0&&a.set(i===t?r:i,o)}return new X(n.names.map(i=>i===t?r:i),a,n.rowCount)}take(t){const r=this.source===null?{table:this,indices:t}:{table:this.source.table,indices:t.map(n=>this.source?.indices[n]??0)};return new X(this.names,new Map,t.length,r)}sortedIndices(t,r){const n=this.values(t);if(n===void 0)return Array.from({length:this.rowCount},(s,l)=>l);const a=[],i=[];for(let s=0;s<this.rowCount;s++)(Mi(n[s])?a:i).push(s);const o=r==="asc"?1:-1;return i.sort((s,l)=>{const u=n[s],c=n[l];return u<c?-o:u>c?o:0}),a.length===0?i:r==="asc"?[...a,...i]:[...i,...a]}partition(t){const r=t.map(i=>this.values(i)).filter(i=>i!==void 0),n=r.length===1?r[0]:void 0,a=new Map;if(n!==void 0){for(let i=0;i<this.rowCount;i++){const o=xi(n[i]),s=a.get(o);s===void 0?a.set(o,{key:Fe(n[i]??null),indices:[i]}):s.indices.push(i)}return[...a.values()]}for(let i=0;i<this.rowCount;i++){const o=Fe(r.map(l=>l[i])),s=a.get(o);s===void 0?a.set(o,{key:o,indices:[i]}):s.indices.push(i)}return[...a.values()]}fold(t,r,n){const a=this.names.filter(d=>!t.includes(d)),i=this.rowCount*t.length,o=a.map(d=>({name:d,source:this.values(d)??[],repeated:new Array(i)})),s=t.map(d=>this.values(d)??[]),l=new Array(i),u=new Array(i);let c=0;for(let d=0;d<this.rowCount;d++)for(let h=0;h<t.length;h++,c++){for(const m of o)m.repeated[c]=m.source[d]??null;l[c]=t[h]??"",u[c]=s[h]?.[d]??null}const p=new Map;for(const{name:d,repeated:h}of o)p.set(d,h);return p.set(r,l),p.set(n,u),new X([...a,r,n],p,i)}objectAt(t){const{names:r,arrays:n,template:a}=this.rowShape??this.resolveRowShape(),i={...a};for(let o=0;o<r.length;o++)i[r[o]??""]=n[o]?.[t]??null;return i}*[Symbol.iterator](){for(let t=0;t<this.rowCount;t++)yield this.objectAt(t)}resolveRowShape(){const t={};for(const r of this.names)t[r]=null;return this.rowShape={names:this.names,arrays:this.names.map(r=>this.values(r)??[]),template:t},this.rowShape}gathered(){if(this.source===null)return this;for(const t of this.names)this.values(t);return new X(this.names,new Map(this.columns),this.rowCount)}};var gn="value",Pe={numeric:{type:"decimal"},categorical:{type:"text"},temporal:{type:"datetime"}},Bt={eq:(e,t)=>e===t,neq:(e,t)=>e!==t,gt:(e,t)=>e!==null&&t!==null&&e>t,gte:(e,t)=>e!==null&&t!==null&&e>=t,lt:(e,t)=>e!==null&&t!==null&&e<t,lte:(e,t)=>e!==null&&t!==null&&e<=t},Vt=e=>e===null?null:e instanceof Date?e.getTime():new Date(e).getTime(),yn=(e,t)=>e==="count"?{type:"integer"}:t,mn=(e,t,r)=>{const n=e.values(t);if(n!==void 0)return n;if(r==="count")return new Array(e.rowCount);throw new x({message:`Variable '${t}' not defined`})},ae=class M{constructor(t={}){const{table:r,variableMetadata:n}=this.parseVariableMap(t);this.table=r,this.variableMetadata=n}static fromTrusted(t,r){const n=Object.create(M.prototype);return n.table=t,n.variableMetadata=r,n}size(){return this.table.rowCount}getVariableNames(){return this.table.columnNames()}hasVariable(t){return this.table.hasColumn(t)}addVariable(t,r,n,a){if(this.table.columnCount>0&&n.length!==this.size())throw new x({message:`Variable '${t}' has ${n.length} values, expected ${this.size()}`});const i={...this.variableMetadata,[t]:{type:r,valueFormat:this.resolveAddedVariableFormat(t,r,a)}},o=this.normalizeRawValues(r,n),s=this.table.assign(t,o);return M.fromTrusted(s,i)}addConstantVariable(t,r,n,a){const i={...this.variableMetadata,[t]:{type:r,valueFormat:this.resolveAddedVariableFormat(t,r,a),constant:{value:n}}},[o=null]=this.normalizeRawValues(r,[n]),s=this.table.assign(t,new Array(this.size()).fill(o));return M.fromTrusted(s,i)}getConstant(t){return this.variableMetadata[t]?.constant}deriveVariable(t,r,n,a){const i=Array.from({length:this.size()},(o,s)=>n(this.table.objectAt(s)));return this.addVariable(t,r,i,a)}deriveVariableFrom(t,r,n,a,i){const o=this.hasVariable(t)?this.getValues(t).map(a):Array.from({length:this.size()},()=>a(null));return this.addVariable(r,n,o,i)}renameVariable(t,r){const n=this.variableMetadata[t];if(!n)throw new x({message:`Variable ${t} not defined`});const a=this.table.rename(t,r),{[t]:i,...o}=this.variableMetadata,s={...o,[r]:n};return M.fromTrusted(a,s)}selectVariables(...t){const r=this.table.select(t),n=Object.fromEntries(Object.entries(this.variableMetadata).filter(([a])=>t.includes(a)));return M.fromTrusted(r,n)}getType(t){const r=this.variableMetadata[t];if(!r)throw new x({message:`Variable ${t} not defined`});return r.type}getValueFormat(t){const r=this.variableMetadata[t];if(!r)throw new x({message:`Variable ${t} not defined`});return r.valueFormat}groupVariableNamesByType(){const t={numeric:[],categorical:[],temporal:[]};for(const[r,{type:n}]of Object.entries(this.variableMetadata))t[n].push(r);return t}getValues(t,r){if(!this.hasVariable(t))throw new x({message:`Variable '${t}' not defined`});const n=this.getType(t);if(r?.type!==void 0&&n!==r.type){if(this.size()===0)return[];throw new x({message:`Variable '${t}' has type '${n}', expected '${r.type}'`})}let a=this.table.values(t)??[];return r?.distinct&&(a=this.getDistinctValues(n,a)),r?.skipNulls&&(a=this.skipNulls(a)),a}filter(t,r,n){if(this.hasVariable(t)&&this.getType(t)==="temporal")return this.filterByTimestamp(t,r,n);const a=Bt[r],i=this.table.values(t)??[],o=[];for(let s=0;s<i.length;s++)a(i[s]??null,n)&&o.push(s);return M.fromTrusted(this.table.take(o),this.variableMetadata)}filterByMask(t){if(t.length!==this.size())throw new x({message:`Row mask length ${t.length} does not match dataset size ${this.size()}`});const r=[];for(let n=0;n<t.length;n++)t[n]===1&&r.push(n);return M.fromTrusted(this.table.take(r),this.variableMetadata)}take(t){return M.fromTrusted(this.table.take(t),this.variableMetadata)}orderBy(t,r="asc"){const n=this.table.take(this.table.sortedIndices(t,r));return M.fromTrusted(n,this.variableMetadata)}getAt(t){return t<0||t>=this.size()?null:this.table.objectAt(t)}getFirst(){return this.getAt(0)}getLast(){return this.getAt(this.size()-1)}findFirst(t){const r=this.size();for(let n=0;n<r;n++){const a=this.table.objectAt(n);if(t(a))return a}return null}findLast(t){for(let r=this.size()-1;r>=0;r--){const n=this.table.objectAt(r);if(t(n))return n}return null}groupBy(...t){return new Li(t,this.table,this.variableMetadata)}rollup(t){const r=tt.from(Object.fromEntries(Object.entries(t).map(([a,{variableName:i,aggregation:o}])=>[a,[hn(o,mn(this.table,i,o),void 0,{type:this.variableMetadata[i]?.type??"numeric",variableName:i})]]))),n={};for(const[a,{variableName:i,aggregation:o}]of Object.entries(t)){const s=this.variableMetadata[i],l=s?.type??"numeric",u=s?.valueFormat??Pe[l];n[a]={type:pn(o,l),valueFormat:yn(o,u)}}return M.fromTrusted(r,n)}reshapeFromWideToLong({keep:t,reshape:r,keyName:n="key",valueName:a=gn}={}){const{numeric:i,categorical:o,temporal:s}=this.groupVariableNamesByType(),l=t??[...o,...s],u=r??i.filter(d=>!l.includes(d));if(l.includes(n)||l.includes(a))throw new se({code:"INVALID_DATA_SHAPE",message:`The variables to keep includes the variables '${n}' or '${a}' to create the key and value variables`});if(u.length===0){const d={};for(const h of l){const m=this.variableMetadata[h];m&&(d[h]={type:m.type,values:[],valueFormat:m.valueFormat})}return d[n]={type:"categorical",values:[],valueFormat:{type:"text"}},d[a]={type:"numeric",values:[],valueFormat:{type:"decimal"}},new M(d)}if(u.filter(d=>this.variableMetadata[d]?.type!=="numeric").length>0)throw new se({code:"INVALID_DATA_SHAPE",message:"Only numeric variables can be reshaped"});const c=this.table.select([...l,...u]).fold(u,n,a),p={};for(const d of l){const h=this.variableMetadata[d];h&&(p[d]=h)}return p[n]={type:"categorical",valueFormat:{type:"text"}},p[a]={type:"numeric",valueFormat:Ri(this.variableMetadata,u,n)},M.fromTrusted(c,p)}print(){console.table(this.variableMetadata),console.table([...this.table])}[Symbol.iterator](){return this.table[Symbol.iterator]()}filterByTimestamp(t,r,n){const a=Bt[r],i=yt(n,this.getValueFormat(t),xe),o=Vt(i??n),s=this.getValues(t,{type:"temporal"}),l=[];for(let u=0;u<s.length;u++)a(Vt(s[u]??null),o)&&l.push(u);return M.fromTrusted(this.table.take(l),this.variableMetadata)}resolveAddedVariableFormat(t,r,n){if(n!==void 0)return n;const a=this.variableMetadata[t];return a?a.valueFormat:Pe[r]}parseVariableMap(t){const r={},n={};for(const[a,{type:i,values:o,valueFormat:s}]of Object.entries(t))r[a]=o,n[a]={type:i,valueFormat:s??Pe[i]};return{table:tt.from(r),variableMetadata:n}}normalizeRawValues(t,r){switch(t){case"numeric":return r.map(n=>typeof n!="number"||!Number.isFinite(n)?null:n);case"categorical":return r.map(n=>typeof n!="string"?null:n);case"temporal":return r.map(n=>!(n instanceof Date)||!(0,v.isValid)(n)?null:n);default:throw new x({message:`Cannot normalize raw value of unknown type: ${t}`})}}skipNulls(t){return t.filter(r=>r!==null)}getDistinctValues(t,r){const n=t==="temporal",a=new Set,i=[];for(const o of r){const s=n&&o instanceof Date?o.getTime():o;a.has(s)||(a.add(s),i.push(o))}return i}},Li=class{constructor(e,t,r){this.groupedBy=e,this.table=t,this.variableMetadata=r}forEach(e){this.readPartitions().forEach(({key:t,indices:r},n)=>{e(ae.fromTrusted(this.table.take(r),this.variableMetadata),t,n)})}rollup(e){const t=this.readPartitions(),r={};for(const a of this.groupedBy){const i=this.table.values(a)??[];r[a]=t.map(({indices:o})=>i[o[0]??0]??null)}const n=Object.fromEntries(this.groupedBy.map(a=>{const i=this.variableMetadata[a],o=i?.type??"categorical";return[a,{type:o,valueFormat:i?.valueFormat??Pe[o]}]}));for(const[a,{variableName:i,aggregation:o}]of Object.entries(e)){const s=mn(this.table,i,o),l=this.variableMetadata[i],u=l?.type??"numeric";r[a]=t.map(({indices:p})=>hn(o,s,p,{type:u,variableName:i}));const c=l?.valueFormat??Pe[u];n[a]={type:pn(o,u),valueFormat:yn(o,c)}}return ae.fromTrusted(tt.from(r),n)}readPartitions(){return this.partitions??=this.table.partition(this.groupedBy),this.partitions}};function Ri(e,t,r){const n=t.map(s=>e[s]?.valueFormat??{type:"decimal"}),[a,...i]=n;if(!a)return{type:"decimal"};for(const s of n)if(s.type==="lookup")throw new se({code:"INVALID_DATA_SHAPE",message:"Cannot reshape: a source column has a lookup format and lookups cannot nest"});if(i.every(s=>(0,ot.isEqual)(s,a))||a.type==="lookup")return a;const o={};for(const[s,l]of t.entries()){const u=Fe([l]),c=n[s];c&&c.type!=="lookup"&&(o[u]=c)}return{type:"lookup",byVariable:r,cases:o,fallback:a}}var Et=class{constructor(e){this.label=e,this.items=new Map}register(e,t){return this.items.set(e,t),this}get(e){if(!this.items.has(e)){const t=[...this.items.keys()].map(r=>`'${r}'`).join(", ");throw new se({code:"UNKNOWN_REGISTERED_TYPE",message:`Unknown ${this.label}: '${e}' (available: ${t})`,context:{kind:this.label,requested:e,available:[...this.items.keys()]},suggestion:`Register a custom ${this.label} named '${e}' in the \`plugins\` array, or use one of: ${t}.`})}return this.items.get(e)}getAll(){return[...this.items.values()]}has(e){return this.items.has(e)}},wi=(e,t)=>{const r=typeof e=="string"?e.trim():e;if(le(r))return{type:"decimal"};const n=typeof r=="string"&&Nr(r,t);if(n)return n;const a=typeof r=="string"&&Ga(r,t);return a||(Cr(e)?{type:"date"}:Rr(e)?{type:"percentage"}:Wr(e)&&typeof e=="string"?{type:"currency",iso:Ka(e)}:{type:"text"})},ki={type:"year",dateFormat:"yyyy"},Di={type:"text"},bn=e=>{const t=e._metadata?.parsingLocale??"en-GB",r={},n=Fi(e),a=Ci(e),i=n.size>0;for(const[o,s]of e.columns.entries()){if(s._metadata?.isHidden)continue;const l=n.get(s.key);if(ge(l)&&i)continue;const u=s.valueFormat??(ge(l)?Di:o===a?ki:wi(l,t)),c=Mr(u);r[s.key]=Ni(s.key,e.rows,u,c,t)}return new ae(r)},Ii=class extends sn{dependencies(e){return[e]}run(e){return bn(e)}},Ci=e=>{if(e.columns.some(r=>r.valueFormat?.type==="year"))return-1;const t=ji(e.rows,5);return e.columns.findIndex(r=>{if(r.valueFormat)return!1;const n=t.map(a=>a[r.key]).filter(a=>!ge(a));return n.length>=2&&n.every(Ya)})},Ni=(e,t,r,n,a)=>({type:n,values:t.reduce((i,o)=>(Gr(o)||i.push(zr(o[e],r,a)),i),[]),valueFormat:r}),Fi=e=>{const t=new Map,r=new Set(e.columns.map(n=>n.key));for(const n of e.rows){for(const a of r){const i=n[a];ge(i)||(t.set(a,i),r.delete(a))}if(r.size===0)break}return t},ji=(e,t)=>{const r=[];for(const n of e)if(Gr(n)||r.push(n),r.length===t)return r;return r},Bi=new Set(["min","max","scalar"]),Vi={x:{min:g.xMin,max:g.xMax},y:{min:g.yMin,max:g.yMax}};function Wi(e){const t=new Set;for(const r of e)r.role==="point"?t.add(r.axis):(r.role==="min"||r.role==="max")&&B(r.aes)&&t.add(r.aes);return[...t]}function Ui(e){const t=new Set;for(const r of e)r.role==="point"&&t.add(r.axis),B(r.aes)&&t.add(r.aes);return[...t]}function Yi(e,t,r){let n=e;for(const a of t){if(a.role!=="min"&&a.role!=="max"||!B(a.aes))continue;const i=Vi[a.axis][a.role];if(n.hasVariable(i))continue;const o=L(r[a.aes]);!B(o)||!n.hasVariable(o)||(n=n.addVariable(i,"numeric",n.getValues(o,{type:"numeric"})))}return n}var Gi=["cartesian","polar"],vn=["kind","edge","axis","role","position","part"],zi="#B84737",An=.4,Hi="sm",Ki=2,$i=8,Xi=12,qi=Object.freeze({light:"#F5F1E9",dark:"#1F1E1C"}),Ji="#ffffff",Zi=1,Qi=24,eo={top:24,right:24,bottom:24,left:24},W={stroke:"color",strokeWidth:"pixels",dashArray:"dashArray"},E={fontFamily:"fontFamily",fontSize:"pixels",fontWeight:"fontWeight",fontStyle:"fontStyle",letterSpacing:"signedPixels",textTransform:"textTransform",textDecoration:"textDecoration",textOutlineColor:"color",textOutlineWidth:"pixels",textShadow:"shadow",lineHeight:"multiplier",textColor:"color"},U={...E,paddingInline:"pixels",paddingBlock:"pixels",fill:"paint",stroke:"color",strokeWidth:"pixels",cornerRadius:"boxRadius",shadow:"shadow",alpha:"unitInterval"},to={offsetX:0,offsetY:2,blur:4,color:"rgba(14, 14, 52, 0.12)"},ro={offsetX:0,offsetY:4,blur:6,color:"rgba(14, 14, 52, 0.16)"},rt=["where","state","layer"],En={fill:"paint",overlay:"overlay",stroke:"color",alpha:"unitInterval",fillAlpha:"unitInterval",strokeAlpha:"unitInterval",saturation:"multiplier",blur:"pixels",brightness:"multiplier",contrast:"multiplier",shadow:"shadow",blendMode:"blendMode"},no=.3,ao=10,io=1,oo=24,so=8,P={label:{fontSize:11.5,fontWeight:500,lineHeight:1},dataLabelOutside:{fontSize:12.5,fontWeight:600,lineHeight:1},tooltipHeading:{fontSize:12.5,fontWeight:700,lineHeight:1.3},tooltipRow:{fontSize:12.5,fontWeight:500,lineHeight:1.43},heading:{fontSize:18,fontWeight:600,lineHeight:1.25},subtitle:{fontSize:15,fontWeight:500,lineHeight:1.47},caption:{fontSize:12,fontWeight:500,lineHeight:1.3},source:{fontSize:12,fontWeight:500,lineHeight:1.3},sourceLink:{fontSize:12,fontWeight:400,lineHeight:1.3}},qe={stroke:f("gridLine"),strokeWidth:1},Wt={fill:f("tooltipBackground"),stroke:f("tooltipBorder"),strokeWidth:1,cornerRadius:6,paddingBlock:8,paddingInline:10,shadow:{offsetX:0,offsetY:4,blur:12,color:"rgba(0, 0, 0, 0.18)"}},Ut={fill:f("textPrimary"),size:8,stroke:f("tooltipBackground"),strokeWidth:2,shadow:{offsetX:0,offsetY:1,blur:1.5,color:"rgba(14, 14, 52, 0.18)"}},Yt={fontSize:12,fontWeight:500,lineHeight:1.3,textColor:f("textPrimary"),fill:f("tooltipBackground"),stroke:f("tooltipBorder"),strokeWidth:1,cornerRadius:6,paddingInline:7,paddingBlock:4,shadow:{offsetX:0,offsetY:2,blur:6,color:"rgba(0, 0, 0, 0.12)"}},Je={...W,length:"pixels"},de={...E,margin:"margin"},fe={...E,offset:"pixels",margin:"margin"},pe={gap:"pixels",margin:"margin"},Ze={stroke:"color",strokeAlpha:"unitInterval",strokeWidth:"pixels",dashArray:"dashArray",haloColor:"color",haloAlpha:"unitInterval",offset:"pixels",cornerRadius:"pixels"},Gt={fill:"paint",stroke:"color",strokeWidth:"pixels",cornerRadius:"boxRadius",paddingInline:"pixels",paddingBlock:"pixels",shadow:"shadow",alpha:"unitInterval"},Tn=new Map;var lo=(e=Object.values(Ye))=>{const t=[],r=[],n=[],a=i=>{if(i.rest!==void 0&&t.push({select:i.select,declarations:i.rest}),i.dimmed!==void 0&&r.push({select:i.select,declarations:i.dimmed,when:{state:"dimmed"}}),i.hovered!==void 0&&n.push({select:i.select,declarations:i.hovered,when:{state:"hovered"}}),i.children!==void 0)for(const o of Object.values(i.children))a(o)};for(const i of e)a(i);return[...t,...r,...n]},uo=e=>{for(const t of e){Object.freeze(t.select);for(const r of Object.values(t.declarations))typeof r=="object"&&Object.freeze(r);Object.freeze(t.declarations),t.when!==void 0&&Object.freeze(t.when),Object.freeze(t)}return e},co=e=>Tn.get(On(e)),zt=(e,t)=>({x:{select:{target:e,axis:"x"},vocabulary:t},y:{select:{target:e,axis:"y"},vocabulary:t}}),Ht=e=>({select:{target:"dataLabel",role:e},vocabulary:U,children:{inside:{select:{target:"dataLabel",role:e,position:"inside"},vocabulary:U,rest:{textColor:"#FFFFFF"}},outside:{select:{target:"dataLabel",role:e,position:"outside"},vocabulary:U,rest:{...P.dataLabelOutside}}}}),Ye={geom:{select:{target:"geom"},vocabulary:En,options:rt,aesthetics:{fill:"color",stroke:"color",alpha:"alpha"},rest:{alpha:1,strokeAlpha:1,shadow:"none",blendMode:"normal"},dimmed:{alpha:An},hovered:{shadow:to},acceptsUnknownKinds:!0},panelBorder:{select:{target:"panelBorder"},vocabulary:{...W,cornerRadius:"pixels"},rest:{...qe,dashArray:j.panelBorder.dashed,cornerRadius:6},children:{top:{select:{target:"panelBorder",edge:"top"},vocabulary:W},right:{select:{target:"panelBorder",edge:"right"},vocabulary:W},bottom:{select:{target:"panelBorder",edge:"bottom"},vocabulary:W},left:{select:{target:"panelBorder",edge:"left"},vocabulary:W}}},gridLine:{select:{target:"gridLine"},vocabulary:W,children:{x:{select:{target:"gridLine",axis:"x"},vocabulary:W,rest:{...qe,dashArray:j.gridLine.dashed,strokeWidth:0}},y:{select:{target:"gridLine",axis:"y"},vocabulary:W,rest:{...qe,dashArray:j.gridLine.dashed}}}},tickLine:{select:{target:"tickLine"},vocabulary:Je,rest:{strokeWidth:0,length:0},children:{x:{select:{target:"tickLine",axis:"x"},vocabulary:Je},y:{select:{target:"tickLine",axis:"y"},vocabulary:Je}}},axisLabel:{select:{target:"axisLabel"},vocabulary:de,rest:{...P.label,textColor:f("textPrimary")},children:{...zt("axisLabel",de),top:{select:{target:"axisLabel",edge:"top"},vocabulary:de,rest:{margin:{bottom:8}}},bottom:{select:{target:"axisLabel",edge:"bottom"},vocabulary:de,rest:{margin:{top:4,bottom:16}}},left:{select:{target:"axisLabel",edge:"left"},vocabulary:de},right:{select:{target:"axisLabel",edge:"right"},vocabulary:de}}},tickLabel:{select:{target:"tickLabel"},vocabulary:fe,rest:{...P.label,textColor:f("textSecondary"),offset:ao,textOutlineColor:f("graphBackground"),textOutlineWidth:io},children:{...zt("tickLabel",fe),top:{select:{target:"tickLabel",edge:"top"},vocabulary:fe},bottom:{select:{target:"tickLabel",edge:"bottom"},vocabulary:fe},left:{select:{target:"tickLabel",edge:"left"},vocabulary:fe,rest:{offset:14}},right:{select:{target:"tickLabel",edge:"right"},vocabulary:fe,rest:{offset:14}}}},dataLabel:{select:{target:"dataLabel"},vocabulary:U,rest:{...P.label,textColor:f("textPrimary"),paddingInline:6,paddingBlock:2,cornerRadius:4},children:{aggregate:{select:{target:"dataLabel",role:"aggregate"},vocabulary:U,rest:{...P.dataLabelOutside}},observation:Ht("observation"),category:Ht("category")}},graph:{select:{target:"graph"},vocabulary:{fill:"paint",overlay:"overlay",stroke:"color",strokeWidth:"pixels",cornerRadius:"pixels",fontFamily:"fontFamily",fontSize:"pixels",fontWeight:"fontWeight",lineHeight:"multiplier",textColor:"color",textScale:"multiplier",padding:"padding",blendMode:"blendMode",shadow:"shadow",alpha:"unitInterval"},rest:{fill:f("graphBackground"),strokeWidth:1,stroke:f("graphBorder"),cornerRadius:8,textScale:1,padding:24,blendMode:"normal"}},heading:{select:{target:"heading"},vocabulary:E,rest:{textColor:f("textPrimary")},partWildcard:!0,children:{h1:{select:{target:"heading",part:"h1"},vocabulary:E,rest:{...P.heading}},h2:{select:{target:"heading",part:"h2"},vocabulary:E,rest:{...P.subtitle}}}},caption:{select:{target:"caption"},vocabulary:E,rest:{...P.caption,textColor:f("textPrimary")}},source:{select:{target:"source"},vocabulary:E,rest:{...P.source,textColor:f("textSecondary")},children:{link:{select:{target:"source",part:"link"},vocabulary:E,rest:{...P.sourceLink,textColor:f("textSecondary")}}}},header:{select:{target:"header"},vocabulary:{margin:"margin"},rest:{margin:{bottom:10}}},footer:{select:{target:"footer"},vocabulary:{margin:"margin"},rest:{margin:{top:16}}},hoverGuide:{select:{target:"hoverGuide"},vocabulary:{stroke:"color",fill:"paint"},rest:{stroke:f("hoverGuideLine"),fill:f("hoverGuideFill")}},editOutline:{select:{target:"editOutline"},vocabulary:Ze,rest:{stroke:f("textPrimary"),strokeWidth:1.5,dashArray:[3.5,2.5],offset:3,cornerRadius:3},partWildcard:!0,children:{hover:{select:{target:"editOutline",part:"hover"},vocabulary:Ze,rest:{strokeAlpha:.4,haloAlpha:.5}},selected:{select:{target:"editOutline",part:"selected"},vocabulary:Ze,rest:{strokeAlpha:.85,haloAlpha:.9}}}},tooltip:{select:{target:"tooltip"},vocabulary:{...Gt,gap:"pixels"},rest:{...Wt,gap:4},children:{heading:{select:{target:"tooltip",part:"heading"},vocabulary:E,rest:{...P.tooltipHeading,textColor:f("textPrimary")}},label:{select:{target:"tooltip",part:"label"},vocabulary:E,rest:{...P.tooltipRow,textColor:f("textPrimary")}},value:{select:{target:"tooltip",part:"value"},vocabulary:E,rest:{...P.tooltipRow,textColor:f("textSecondary")}},primaryRow:{select:{target:"tooltip",part:"primaryRow"},vocabulary:{fill:"paint"},rest:{fill:f("tooltipPrimaryRow")}}}},headline:{select:{target:"headline"},vocabulary:pe,rest:{gap:oo,margin:{bottom:4}}},headlineItem:{select:{target:"headlineItem"},vocabulary:{gap:"pixels"},rest:{gap:2},children:{number:{select:{target:"headlineItem",part:"number"},vocabulary:E,rest:{fontSize:26,fontWeight:700,lineHeight:1.3,textColor:f("textPrimary")},children:{center:{select:{target:"headlineItem",part:"numberCenter"},vocabulary:E}}},caption:{select:{target:"headlineItem",part:"caption"},vocabulary:E,rest:{fontSize:12,textColor:f("textSecondary")}},label:{select:{target:"headlineItem",part:"label"},vocabulary:E,rest:{fontSize:12,textColor:f("textSecondary")}},swatch:{select:{target:"headlineItem",part:"swatch"},vocabulary:{size:"pixels"},rest:{size:12}},trend:{select:{target:"headlineItem",part:"trend"},vocabulary:E,rest:{fontSize:12,textColor:f("textSecondary")},children:{up:{select:{target:"headlineItem",part:"trendUp"},vocabulary:{textColor:"color"},rest:{textColor:f("trendPositive")}},down:{select:{target:"headlineItem",part:"trendDown"},vocabulary:{textColor:"color"},rest:{textColor:f("trendNegative")}},flat:{select:{target:"headlineItem",part:"trendFlat"},vocabulary:{textColor:"color"},rest:{textColor:f("trendNeutral")}}}}}},legend:{select:{target:"legend"},vocabulary:{...pe,focusStroke:"color"},rest:{gap:so,focusStroke:f("legendFocus")},children:{popover:{select:{target:"legend",part:"popover"},vocabulary:Gt,rest:Wt},top:{select:{target:"legend",edge:"top"},vocabulary:pe,rest:{margin:{bottom:8}}},bottom:{select:{target:"legend",edge:"bottom"},vocabulary:pe,rest:{margin:{top:16,bottom:10}}},left:{select:{target:"legend",edge:"left"},vocabulary:pe,rest:{margin:{right:10}}},right:{select:{target:"legend",edge:"right"},vocabulary:pe,rest:{margin:{left:10}}}}},legendItem:{select:{target:"legendItem"},vocabulary:{...E,paddingInline:"pixels",paddingBlock:"pixels",fill:"paint",stroke:"color",strokeWidth:"pixels",cornerRadius:"boxRadius",shadow:"shadow",alpha:"unitInterval",gap:"pixels"},rest:{...P.label,textColor:f("textSecondary"),strokeWidth:0,paddingInline:2,paddingBlock:4,gap:8},children:{swatch:{select:{target:"legendItem",part:"swatch"},vocabulary:{size:"pixels",strokeWidth:"pixels"},rest:{size:12,strokeWidth:2}}}},directLabel:{select:{target:"directLabel"},vocabulary:{...E,stroke:"color",strokeWidth:"pixels",dashArray:"dashArray"},rest:{fontSize:12,fontWeight:500,lineHeight:1.3,textColor:f("textPrimary"),strokeWidth:1,dashArray:j.directLabel.dashed}},annotation:{select:{target:"annotation"},vocabulary:{fill:"paint",stroke:"color",alpha:"unitInterval",fillAlpha:"unitInterval"},options:["annotation"],children:{shape:{select:{target:"annotation",kind:"shape"},vocabulary:{fill:"paint",alpha:"unitInterval",fillAlpha:"unitInterval",stroke:"color",strokeWidth:"pixels"},options:["annotation"],rest:{fill:f("annotationShape"),alpha:1,fillAlpha:.25,strokeWidth:1}},arrow:{select:{target:"annotation",kind:"arrow"},vocabulary:{stroke:"color",strokeWidth:"pixels",dashArray:"dashArray"},options:["annotation"],rest:{stroke:f("annotationArrow"),strokeWidth:4,dashArray:j.arrow.solid},children:{outline:{select:{target:"annotation",kind:"arrow",part:"outline"},vocabulary:{stroke:"color",strokeWidth:"pixels",shadow:"shadow"},options:["annotation"],rest:{strokeWidth:0,shadow:"none"}}}},differenceArrow:{select:{target:"annotation",kind:"differenceArrow"},vocabulary:{stroke:"color",strokeWidth:"pixels"},options:["annotation"],rest:{stroke:f("annotationArrow"),strokeWidth:2},children:{label:{select:{target:"annotation",kind:"differenceArrow",part:"label"},vocabulary:U,options:["annotation"],rest:{...P.label,textColor:f("textPrimary"),fill:f("differenceLabelBackground"),strokeWidth:1,cornerRadius:4,paddingInline:6,paddingBlock:3}}}},text:{select:{target:"annotation",kind:"text"},vocabulary:{...U,fillAlpha:"unitInterval"},options:["annotation"],rest:{fill:"transparent",alpha:1,fillAlpha:1,strokeWidth:1.5,cornerRadius:9,paddingInline:6,paddingBlock:3,fontSize:15,fontWeight:500,lineHeight:1.25,textColor:f("textPrimary")}},image:{select:{target:"annotation",kind:"image"},vocabulary:{alpha:"unitInterval",cornerRadius:"boxRadius",shadow:"shadow"},options:["annotation"],rest:{alpha:1,cornerRadius:0}},pinnedNumber:{select:{target:"annotation",kind:"pinnedNumber"},vocabulary:{fill:"paint",size:"pixels",stroke:"color",strokeWidth:"pixels",shadow:"shadow"},options:["annotation"],rest:Ut,children:{label:{select:{target:"annotation",kind:"pinnedNumber",part:"label"},vocabulary:U,options:["annotation"],rest:Yt}}},comment:{select:{target:"annotation",kind:"comment"},vocabulary:{fill:"paint",size:"pixels",stroke:"color",strokeWidth:"pixels",shadow:"shadow"},options:["annotation"],rest:Ut,children:{label:{select:{target:"annotation",kind:"comment",part:"label"},vocabulary:U,options:["annotation"],rest:Yt}}}}}},On=e=>{let t=e.target;for(const r of vn){const n=e[r];n!==void 0&&(t+=`\0${r}:${n}`)}return t},Pn=e=>{if(Tn.set(On(e.select),e),e.children!==void 0)for(const t of Object.values(e.children))Pn(t)};for(const e of Object.values(Ye))Pn(e);var Tt=(e,t)=>{const r=L(t.x);return!r||!["numeric","temporal"].includes(e.getType(r))?e:e.orderBy(r,"asc")},Ot=(e,{coordSystem:t})=>{const r=q(e),n=z(e);return!S(r)||!S(n)?null:t.type==="polar"?te(r,n):{x:r,y:n}},fo=({positionRoles:e,aesthetics:t})=>[...Wi(e),...t.filter(r=>r.required).map(r=>r.name)];function po(e){return e}var ho=e=>e.observation?.aesthetics??Ye.geom.aesthetics,Sn=e=>e.observation?.sharedPaint===!1?{...e.observation.vocabulary}:{...En,...e.observation?.vocabulary},go=(e,t)=>({select:{target:"geom",kind:e},vocabulary:Sn(t),aesthetics:ho(t),options:t.observation?.options??rt,...Kt(t.observation),children:Object.fromEntries(Object.entries(t.parts??{}).map(([r,n])=>[r,{select:{target:"geom",kind:e,part:r},vocabulary:n.vocabulary,options:n.options??rt,...n.aesthetics===void 0?{}:{aesthetics:n.aesthetics},...Kt(n)}]))}),Kt=e=>({...e?.rest===void 0?{}:{rest:e.rest},...e?.dimmed===void 0?{}:{dimmed:e.dimmed},...e?.hovered===void 0?{}:{hovered:e.hovered}}),Q=class{constructor(){this.positionRoles=[],this.identityKey="x-group",this.defaultPosition="identity",this.defaultStat=null,this.supportedPositions=Or,this.defaultInteractive=!0,this.defaultAttachTo="none",this.aesthetics=[],this.derivedVariables=[],this.highlightStrategy=null,this.supportedCoordTypes=["cartesian","flip"],this.spatialKind="points",this.grid={},this.legend={},this.dataLabelCoordTypes=[],this.isComposite=!1,this.tooltip=[],this.summaries={}}resolveParams(e){return(0,ot.merge)({},this.defaultParams,e.params)}},$t=.5,me=e=>({x:0,y:0,width:e.width,height:e.height}),Pt=e=>e==="panel-end"?"end":e==="panel-start"?"start":e,be=({box:e,panel:t,orientation:r,placement:n,justify:a,align:i,offset:o,alignOffset:s,labelWidth:l,labelHeight:u})=>{const c=a==="panel-start"||a==="panel-end",p=(r.valueAxis==="x"?e.height:e.width)===0,d={anchor:mo(a,r.valueDirectionSign),placement:c?"inside":n,offset:o},h={anchor:bo(i),placement:p?n:"inside",offset:p?s??o:0},m=c?t:e,A=r.valueAxis==="x"?m:e,R=r.valueAxis==="y"?m:e,C=r.valueAxis==="x"?d:h,V=r.valueAxis==="x"?h:d,O=qt(C,{min:A.x,max:A.x+A.width,halfExtent:l/2}),w=qt(V,{min:R.y,max:R.y+R.height,halfExtent:u/2});return{x:O,y:w,position:yo(e,O,w,l,u)}},Xt=(e,t,r,n)=>r-n>=e-$t&&r+n<=t+$t,yo=(e,t,r,n,a)=>{if(e.width===0&&e.height===0)return"outside";const i=e.width===0||Xt(e.x,e.x+e.width,t,n/2),o=e.height===0||Xt(e.y,e.y+e.height,r,a/2);return i&&o?"inside":"outside"},mo=(e,t)=>e==="center"?"center":(e==="end"||e==="panel-end")==(t===1)?"max":"min",bo=e=>e==="center"?"center":e==="start"?"min":"max",qt=({anchor:e,placement:t,offset:r},{min:n,max:a,halfExtent:i})=>{if(e==="center")return(n+a)/2;if(t==="inside"&&n===a)return n;const o=r+i;return e==="min"?t==="inside"?n+o:n-o:t==="inside"?a-o:a+o},vo=e=>{const t=[];if(!e.layer.dataLabels.showDataLabels)return{labels:t,droppedCount:0};const{offset:r}=e.layer.dataLabels,n=To(e.layer);for(const a of e.layer.data){const i=q(a),o=K(a)??z(a);if(i===null||o===null||!Ue(i,o))continue;const s=e.formatLabel(a);if(s==="")continue;const{width:l,height:u}=e.measureDataLabel("observation","outside",s),{box:c,orientation:p}=Eo(o,H(a),i,e.panelRect.width,e.panelRect.height),d=be({box:c,panel:me(e.panelRect),orientation:p,...n,offset:r,labelWidth:l,labelHeight:u});t.push({layerId:e.layer.id,x:d.x,y:d.y,text:s,width:l,height:u,isRotated:!1,role:"observation",position:"outside"})}return{labels:t,droppedCount:0}},Ao=e=>e.position==="fill"?"fill":he(e.position)?"stack":"none",Eo=(e,t,r,n,a)=>{const i=t??e,o=1-Math.max(e,i);return{box:{x:r*n,y:o*a,width:0,height:Math.abs(e-i)*a},orientation:{valueAxis:"y",valueDirectionSign:e>=i?-1:1}}},To=e=>{const{position:t,justify:r,align:n}=e.dataLabels;return t==="auto"?{placement:"outside",justify:"end",align:"center"}:{placement:t,justify:At(e.data,e.mapping)?Pt(r):r,align:n}},Oo=class extends Q{constructor(...e){super(...e),this.type="area",this.styleTarget={observation:{vocabulary:{strokeWidth:"pixels",dashArray:"dashArray",lineCap:"lineCap",lineJoin:"lineJoin"},aesthetics:{fill:"color",fillAlpha:"alpha",strokeWidth:"strokeWidth",dashArray:"lineType"},rest:{fill:f("geom"),fillAlpha:no,strokeWidth:2,dashArray:j.line.solid}}},this.supportedCoordTypes=["cartesian","polar","flip"],this.defaultParams={curve:"linear",missingValues:"zero"},this.defaultPosition="stack",this.scaleConstraints={zeroBaseline:!0},this.positionRoles=[{axis:"x",role:"point",valueKind:"value"},{axis:"y",role:"min",valueKind:"value"},{axis:"y",role:"max",valueKind:"value",aes:"y"}],this.aesthetics=[{kind:"visual",name:"color"},{kind:"visual",name:"strokeWidth"},{kind:"visual",name:"lineType"},{kind:"visual",name:"alpha"}],this.summaries={perGroupHeadline:!0},this.dataLabels={cartesian:{offset:8},flip:{offset:8}},this.dataLabelCoordTypes=["cartesian","flip"],this.resolvePercentageValueStrategy=Ao,this.isComposite=!0,this.legend={suppressWhenSingleItem:!0,sidePlacement:"whenCrowded",directLabelSupport:{stack:!0,dodge:!0,identity:!0,fill:!0}},this.highlightStrategy="overlay-anchor",this.spatialKind="filled-buckets",this.resolveAnchorPosition=Ot,this.getDataLabelPlacements=t=>vo(t)}resolveParams(e){const t=super.resolveParams(e);return t.missingValues==="gap"?{...t,missingValues:"zero"}:t}compile({data:e,mapping:t}){return e=Tt(e,t),e.hasVariable(g.yMin)||(e=e.addConstantVariable(g.yMin,"numeric",0)),{data:e,mapping:{}}}},_n=.7,Po=.1,So=.03,_o=.05,Mn=e=>{const t=e[dt.role];return t??"solo"},St=(e,t,r)=>{const n={},a=i=>{const o=n[i];if(o!==void 0)return o;const{width:s,height:l}=e(t,i,r),u={width:s,height:l};return n[i]=u,u};return{get inside(){return a("inside")},get outside(){return a("outside")}}},Ge=(e,t,r=e.get("fill",t))=>{if(r===void 0)return;const n=e.get("alpha",t)*(e.get("fillAlpha",t)??1);return dr(lr(r),n)},ke=6,Mo=.5,xo=e=>{const t=[];let r=0;const n=he(e.layer.position),a=e.coordSystem.mainAxis==="y";if(e.layer.dataLabels.showDataLabels){const{entries:i,shouldRotate:o}=Ro({layer:e.layer,mainAxis:e.coordSystem.mainAxis,panelRect:e.panelRect,measureDataLabel:e.measureDataLabel,formatLabel:e.formatLabel,isFlipped:a});for(const s of i){const l=e.layer.dataLabels.position==="auto"?Do({mainAxis:e.coordSystem.mainAxis,isStacked:n,isNegativeBar:s.isNegative,shouldRotate:o,bounds:s.bounds,boxes:s.boxes,panelWidth:e.panelRect.width,panelHeight:e.panelRect.height,offset:e.layer.dataLabels.offset}):Co(e.layer.dataLabels,e.coordSystem.mainAxis,n,s,me(e.panelRect));if(l===null){r+=1;continue}const u=s.boxes[l.position];t.push({layerId:e.layer.id,x:l.x,y:l.y,text:s.text,width:u.width,height:u.height,isRotated:l.isRotated,role:"observation",position:l.position,...l.position==="inside"?{backdropColor:Ge(e.styleReaders,s.observation)}:{}})}}if(e.layer.dataLabels.showCategoryLabels)for(const i of No(e,n))t.push(i);if(e.layer.dataLabels.showStackTotals){const i=Vo({layer:e.layer,mainAxis:e.coordSystem.mainAxis,panelRect:e.panelRect,measureDataLabel:e.measureDataLabel,formatAbsolute:e.formatAbsolute});for(const o of i)t.push(o)}return{labels:t,droppedCount:r}},Lo=e=>e.position==="fill"?"fill":he(e.position)?"stack":"absoluteGrandTotal",Ro=({layer:e,mainAxis:t,panelRect:r,measureDataLabel:n,formatLabel:a,isFlipped:i})=>{const o=[];let s=!1;const l=e.dataLabels.position==="auto",u=L(e.mapping.y);for(const c of e.data){const p=Ln(t,c);if(p===null)continue;const d=a(c);if(d==="")continue;const h=St(n,"observation",d),m=_t(p,r);l&&h.inside.width>m.width&&(s=!0);const A=u===null?null:c[u],R=S(A)&&A<0;o.push({isNegative:R,text:d,boxes:h,bounds:m,observation:c})}return{entries:o,shouldRotate:!i&&s}},_t=(e,t)=>({x:e.x*t.width,y:e.y*t.height,width:e.width*t.width,height:e.height*t.height}),xn=(e,t,r,n,a)=>{if(e==="x"){let s=1-a,l=a-n;return l<0&&(s+=l,l=-l),{x:t,y:s,width:r-t,height:l}}let i=t,o=r-t;return o<0&&(i+=o,o=-o),{x:i,y:1-a,width:o,height:a-n}},Ln=(e,t)=>{const r=J(t),n=Z(t),a=H(t),i=K(t)??z(t);return r===null||n===null||a===null||i===null?null:xn(e,r,n,a,i)},wo=(e,t)=>{const{xMin:r,xMax:n,yMin:a,yMax:i}=t.anchor;return xn(e,r,n,a,i)},ko=(e,t)=>e==="x"?t?"bottom":"top":t?"left":"right",nt=(e,t,r)=>r?{width:t,height:e}:{width:e,height:t},Do=e=>e.isStacked?Fo({bounds:e.bounds,box:e.boxes.inside,isRotated:e.shouldRotate}):Bo({edge:ko(e.mainAxis,e.isNegativeBar),bounds:e.bounds,boxes:e.boxes,isRotated:e.shouldRotate,panelWidth:e.panelWidth,panelHeight:e.panelHeight,offset:e.offset}),Rn=(e,t)=>e==="x"?{valueAxis:"y",valueDirectionSign:t?1:-1}:{valueAxis:"x",valueDirectionSign:t?-1:1},Io=e=>e==="panel-start"||e==="panel-end",Co=(e,t,r,n,a)=>{if(e.position==="auto")return null;const i=r&&e.position==="outside"?"inside":e.position,o=n.boxes[i],s=be({box:n.bounds,panel:a,orientation:Rn(t,n.isNegative),placement:i,justify:e.justify,align:e.align,offset:e.offset,labelWidth:o.width,labelHeight:o.height});if(i==="inside"&&!Io(e.justify)){const l=t==="y",u=l?n.bounds.width:n.bounds.height;return(l?o.width:o.height)>u+Mo?null:{x:s.x,y:s.y,isRotated:!1,position:"inside"}}return{x:s.x,y:s.y,isRotated:!1,position:s.position}},No=(e,t)=>{const r=[],{categoryPosition:n,categoryJustify:a,categoryAlign:i,categoryOffset:o}=e.layer.dataLabels,s=t&&n==="outside"?"inside":n,l=e.coordSystem.mainAxis,u=me(e.panelRect),c=L(e.layer.mapping.y);for(const p of e.layer.data){const d=Ln(l,p);if(d===null)continue;const h=e.formatCategory(p);if(h===null||h==="")continue;const m=St(e.measureDataLabel,"category",h),A=m[s],R=_t(d,e.panelRect),C=c===null?null:p[c],V=S(C)&&C<0,O=be({box:R,panel:u,orientation:Rn(l,V),placement:s,justify:a,align:i,offset:o,labelWidth:A.width,labelHeight:A.height}),w=m[O.position];r.push({layerId:e.layer.id,x:O.x,y:O.y,text:h,width:w.width,height:w.height,isRotated:!1,role:"category",position:O.position})}return r},Fo=({bounds:e,box:t,isRotated:r})=>{const n=nt(t.width,t.height,r);return n.width>e.width||n.height>e.height?null:{x:e.x+e.width/2,y:e.y+e.height/2,isRotated:r,position:"inside"}},jo=(e,t,r,n)=>{switch(e){case"top":return{edgeCoord:t.y,outwardSign:-1,panelExtent:n};case"bottom":return{edgeCoord:t.y+t.height,outwardSign:1,panelExtent:n};case"left":return{edgeCoord:t.x,outwardSign:-1,panelExtent:r};case"right":return{edgeCoord:t.x+t.width,outwardSign:1,panelExtent:r}}},Bo=({edge:e,bounds:t,boxes:r,isRotated:n,panelWidth:a,panelHeight:i,offset:o})=>{const s=e==="top"||e==="bottom",l=t.x+t.width/2,u=t.y+t.height/2,c=s?t.height:t.width,p=s?t.width:t.height,{edgeCoord:d,outwardSign:h,panelExtent:m}=jo(e,t,a,i),A=nt(r.inside.width,r.inside.height,n),R=s?A.height:A.width,C=s?A.width:A.height,V=R+o<c,O=C<=p;if(s?V:V&&O){if(s&&!O)return null;if(n)return{x:l,y:u,isRotated:!0,position:"inside"};const Re=d-h*(R/2+o);return{...s?{x:l,y:Re}:{x:Re,y:u},isRotated:!1,position:"inside"}}const w=nt(r.outside.width,r.outside.height,n),_=(s?w.height:w.width)/2,N=d+h*(_+o);return N-_<0||N+_>m?null:{...s?{x:l,y:N}:{x:N,y:u},isRotated:n,position:"outside"}},Vo=({layer:e,mainAxis:t,panelRect:r,measureDataLabel:n,formatAbsolute:a})=>{const i=[],o=e.summary.stackTotals;if(o===void 0||o.length===0)return i;const s=t==="y";for(const l of o){const u=_t(wo(t,l),r),c=a(l.total),{width:p,height:d}=n("aggregate","outside",c),h=l.anchor.direction==="positive";let m,A;s?(m=h?u.x+u.width+ke+p/2:u.x-ke-p/2,A=u.y+u.height/2):(m=u.x+u.width/2,A=h?u.y-ke-d/2:u.y+u.height+ke+d/2),i.push({layerId:e.id,x:m,y:A,text:c,width:p,height:d,isRotated:!1,role:"aggregate",position:"outside"})}return i};function wn(e){return{startAngle:e[g.xMin],endAngle:e[g.xMax]}}function kn(e){return{innerRadius:e[g.yMin],outerRadius:e[g.yMax]??e[g.y]}}var Wo=" · ",Y=2,Uo=e=>{const t=[];if(!e.layer.dataLabels.showDataLabels)return{labels:t,droppedCount:0};const{position:r,justify:n,align:a,offset:i,showCategoryLabels:o}=e.layer.dataLabels,s=e.coordSystem.bandAxis==="y",l=e.panelRect.width/2,u=e.panelRect.height/2,c=Math.min(e.panelRect.width,e.panelRect.height)/2,p=e.styleReaders;for(const d of e.layer.data){const{startAngle:h,endAngle:m}=wn(d),{innerRadius:A,outerRadius:R}=kn(d);if(h===null||m===null||R===null)continue;const C=e.formatLabel(d);if(C==="")continue;const V=o?e.formatCategory(d):null,O=V===null?C:`${V}${Wo}${C}`,w={startAngle:h,endAngle:m,midAngle:(h+m)/2,innerRadiusPx:(A??0)*c,outerRadiusPx:R*c};let _,N;if(r==="auto"){const ve=e.measureDataLabel("observation","inside",O),$={width:ve.width,height:ve.height},ze=Qt({wedge:w,position:"inside",offset:i,labelWidth:$.width,labelHeight:$.height}),Kn=s||Go({wedge:w,labelRadius:ze.labelRadius,labelAngle:ze.labelAngle,labelWidth:$.width,labelHeight:$.height});if(_=ze,N=$,!Kn){const Mt=e.measureDataLabel("observation","outside",O),Ae={width:Mt.width,height:Mt.height},Ee=Qt({wedge:w,position:"outside",offset:i,labelWidth:Ae.width,labelHeight:Ae.height}),$n=l+Math.sin(Ee.labelAngle)*Ee.labelRadius,Xn=u-Math.cos(Ee.labelAngle)*Ee.labelRadius;Ho({x:$n,y:Xn,labelWidth:Ae.width,labelHeight:Ae.height,panelRect:e.panelRect})&&(_=Ee,N=Ae)}}else{const ve=St(e.measureDataLabel,"observation",O),$=ve[r];_=Ko({wedge:w,placement:r,justify:Pt(n),align:a,offset:i,labelWidth:$.width,labelHeight:$.height}),N=ve[_.position]}const Re=l+Math.sin(_.labelAngle)*_.labelRadius,Hn=u-Math.cos(_.labelAngle)*_.labelRadius;t.push({layerId:e.layer.id,x:Re,y:Hn,text:O,width:N.width,height:N.height,isRotated:!1,role:"observation",position:_.position,..._.position==="inside"?{backdropColor:Ge(p,d)}:{}})}return{labels:t,droppedCount:0}},Yo=()=>"absoluteGrandTotal",at=(e,t,r,n)=>{const a=Math.abs(e==="radial"?Math.sin(t):Math.cos(t)),i=Math.abs(e==="radial"?Math.cos(t):Math.sin(t));return a*(r/2)+i*(n/2)},Go=({wedge:e,labelRadius:t,labelAngle:r,labelWidth:n,labelHeight:a})=>{if(t<=0)return!1;const i=Math.sin(r)*t,o=-Math.cos(r)*t,s={left:i-n/2,right:i+n/2,top:o-a/2,bottom:o+a/2},l=[[s.left,s.top],[s.right,s.top],[s.right,s.bottom],[s.left,s.bottom]],u=Math.hypot(Jt(0,s.left,s.right),Jt(0,s.top,s.bottom)),c=Math.max(...l.map(([d,h])=>Math.hypot(d,h)));if(u<e.innerRadiusPx-Y||c>e.outerRadiusPx+Y)return!1;const p=Math.abs(e.endAngle-e.startAngle)/2;return p>=Math.PI?!0:l.every(([d,h])=>{const m=Math.hypot(d,h);return m<=Y?!0:lt(Math.atan2(d,-h),e.midAngle)<=p+Y/m})?p<=Math.PI/2?!0:u<=Y?!1:!Zt(e.startAngle,s)&&!Zt(e.endAngle,s):!1},zo=(e,t,r)=>{if(t<=0||t<e.innerRadiusPx-Y||t>e.outerRadiusPx+Y)return!1;const n=Math.abs(e.endAngle-e.startAngle)/2;return lt(r,e.midAngle)<=n+Y/t},Jt=(e,t,r)=>Math.min(r,Math.max(t,e)),Zt=(e,t)=>{const r=Y,n=[[Math.sin(e),t.left+r,t.right-r],[-Math.cos(e),t.top+r,t.bottom-r]];let a=0,i=Number.POSITIVE_INFINITY;for(const[o,s,l]of n){if(s>l)return!1;if(Math.abs(o)<1e-9){if(s>0||l<0)return!1;continue}const u=s/o,c=l/o;a=Math.max(a,Math.min(u,c)),i=Math.min(i,Math.max(u,c))}return a<=i},Ho=({x:e,y:t,labelWidth:r,labelHeight:n,panelRect:a})=>e-r/2>=0&&e+r/2<=a.width&&t-n/2>=0&&t+n/2<=a.height,Qt=({wedge:e,position:t,offset:r,labelWidth:n,labelHeight:a})=>t==="inside"?{labelRadius:(e.innerRadiusPx+e.outerRadiusPx)/2,labelAngle:e.midAngle,position:"inside"}:{labelRadius:e.outerRadiusPx+r+at("radial",e.midAngle,n,a),labelAngle:e.midAngle,position:"outside"},Ko=({wedge:e,placement:t,justify:r,align:n,offset:a,labelWidth:i,labelHeight:o})=>{const s=n==="start"?e.startAngle:n==="end"?e.endAngle:e.midAngle,l=a+at("radial",s,i,o);let u;if(r==="center")u=(e.innerRadiusPx+e.outerRadiusPx)/2;else if(r==="end")u=t==="inside"?e.outerRadiusPx-l:e.outerRadiusPx+l;else if(t==="inside")u=e.innerRadiusPx+l;else{const p=e.innerRadiusPx-l;u=p>=0?p:e.innerRadiusPx+l}let c=s;if(n!=="center"&&u>0){const p=at("tangential",s,i,o),d=Math.asin(Math.min(1,p/u));c=s+(n==="start"?1:-1)*d}return{labelRadius:u,labelAngle:c,position:zo(e,u,c)?"inside":"outside"}},$o=class extends Q{constructor(...e){super(...e),this.type="bar",this.styleTarget={observation:{vocabulary:{cornerRadius:"barRadius",strokeWidth:"pixels"},aesthetics:{fill:"color",alpha:"alpha",strokeWidth:"strokeWidth"},rest:{fill:f("geom"),fillAlpha:1,cornerRadius:"sm",strokeWidth:1,stroke:f("geomBorder")},hovered:{stroke:f("hoverAffordance"),shadow:ro}}},this.defaultParams={},this.defaultPosition="dodge",this.positionRoles=[{axis:"x",role:"point",valueKind:"value"},{axis:"y",role:"min",valueKind:"value"},{axis:"y",role:"max",valueKind:"value",aes:"y"}],this.aesthetics=[{kind:"visual",name:"color"},{kind:"visual",name:"alpha"}],this.summaries={grandTotal:!0,stackTotals:!0,perGroupHeadline:!0},this.grid={cartesian:{hideGridX:!0},flip:{hideGridX:!0}},this.legend={suppressWhenSingleItem:!0,sidePlacement:"whenStackedVertical",directLabelSupport:{stack:!0,fill:!0}},this.scaleConstraints={discreteMainAxis:!0,zeroBaseline:!0},this.dataLabels={polar:{format:"percentage"}},this.dataLabelCoordTypes=["cartesian","flip","polar"],this.highlightStrategy="observation-rerender",this.supportedCoordTypes=["cartesian","polar","flip"],this.spatialKind="rects",this.resolveDataLabelDefaults=t=>he(t)?{justify:"center"}:{},this.resolveBandFraction=(t,r)=>it(t,r.type),this.resolveAnchorPosition=(t,{coordSystem:r,position:n,purpose:a,align:i})=>{if(i!==void 0){const p=Er(t,r);return p===null?null:ft(p,i)}if(r.type==="polar")return Xo(t);const o=he(n),s={isSolo:!o||Mn(t)==="solo",isNegative:o&&qo(t),purpose:a};if(r.mainAxis==="x"){const p=J(t),d=Z(t),h=er({lowerBound:H(t),upperBound:K(t)??z(t),options:s});return p===null||d===null||h===null?null:{x:(p+d)/2,y:h}}const l=H(t),u=K(t),c=er({lowerBound:J(t),upperBound:Z(t)??q(t),options:s});return l===null||u===null||c===null?null:{x:c,y:(l+u)/2}},this.getDataLabelPlacements=t=>t.coordSystem.type==="polar"?Uo(t):xo(t),this.resolvePercentageValueStrategy=(t,r)=>r==="polar"?Yo():Lo(t)}resolveParams(e){const{width:t,...r}=super.resolveParams(e),n=this.resolveWidthParam(t,e.diagnostics);return{...r,...n!==void 0&&{width:n}}}compile({data:e,mapping:t,params:r,coordType:n}){const a=it(r,n);e=Tt(e,t),e.hasVariable(g.yMin)||(e=e.addConstantVariable(g.yMin,"numeric",0));const i=a/2;return e=e.addConstantVariable(g.xMin,"numeric",-i).addConstantVariable(g.xMax,"numeric",i),{data:e,mapping:{}}}resolveWidthParam(e,t){if(e===void 0)return;const r=typeof e=="number"&&Number.isFinite(e)?e:null;if(r!==null&&r>0&&r<=1)return r;const n=r!==null&&r>1?1:void 0;return t?.addWarning({code:"INVALID_GEOM_PARAM",message:`Bar width must be a fraction in (0, 1], got ${String(e)}; falling back to ${n??"the default band"}.`,context:{geom:this.type,param:"width",expected:"0 < width <= 1",actual:r??String(e)},suggestion:"Set params.width to a fraction of the category band in (0, 1]."}),n}},it=({width:e},t)=>e!==void 0?e:t==="polar"?1:_n,Xo=e=>{const t=J(e),r=Z(e),n=H(e),a=K(e);return t===null||r===null||n===null||a===null?null:te((t+r)/2,(n+a)/2)},qo=e=>{const t=Ar(e);return S(t)&&t<0},er=e=>{const{lowerBound:t,upperBound:r,options:n}=e,a=n.isNegative?t:r;if(a===null)return null;if(n.purpose==="value"||n.isSolo)return a;const i=n.isNegative?r:t;return i===null?null:(i+a)/2},Jo=e=>{const t=[];if(!e.layer.dataLabels.showDataLabels)return{labels:t,droppedCount:0};const{offset:r}=e.layer.dataLabels,n=Zo(e.layer);for(const a of e.layer.data){const i=q(a),o=z(a);if(i===null||o===null||!Ue(i,o))continue;const s=e.formatLabel(a);if(s==="")continue;const{width:l,height:u}=e.measureDataLabel("observation","outside",s),c=be({box:{x:i*e.panelRect.width,y:(1-o)*e.panelRect.height,width:0,height:0},panel:me(e.panelRect),orientation:{valueAxis:"y",valueDirectionSign:-1},...n,offset:r,labelWidth:l,labelHeight:u});t.push({layerId:e.layer.id,x:c.x,y:c.y,text:s,width:l,height:u,isRotated:!1,role:"observation",position:c.position})}return{labels:t,droppedCount:0}},Zo=e=>{const{position:t,justify:r,align:n}=e.dataLabels;return t==="auto"?{placement:"outside",justify:"end",align:"center"}:{placement:t,justify:At(e.data,e.mapping)?Pt(r):r,align:n}},Qo=class extends Q{constructor(...e){super(...e),this.type="line",this.styleTarget={observation:{vocabulary:{strokeWidth:"pixels",dashArray:"dashArray",lineCap:"lineCap",lineJoin:"lineJoin"},aesthetics:{stroke:"color",strokeAlpha:"alpha",strokeWidth:"strokeWidth",dashArray:"lineType"},rest:{stroke:f("geom"),strokeWidth:2,dashArray:j.line.solid}}},this.supportedCoordTypes=["cartesian","polar","flip"],this.defaultParams={curve:"linear",missingValues:"gap"},this.positionRoles=[{axis:"x",role:"point",valueKind:"value"},{axis:"y",role:"point",valueKind:"value"}],this.aesthetics=[{kind:"visual",name:"color"},{kind:"visual",name:"strokeWidth"},{kind:"visual",name:"lineType"},{kind:"visual",name:"alpha"}],this.summaries={perGroupHeadline:!0},this.dataLabels={cartesian:{offset:8},flip:{offset:8}},this.dataLabelCoordTypes=["cartesian","flip"],this.isComposite=!0,this.legend={suppressWhenSingleItem:!0,sidePlacement:"whenCrowded",directLabelSupport:{stack:!0,dodge:!0,identity:!0,fill:!0}},this.highlightStrategy="overlay-anchor",this.spatialKind="buckets",this.resolveAnchorPosition=Ot,this.getDataLabelPlacements=t=>Jo(t)}compile(e){return{data:Tt(e.data,e.mapping),mapping:{}}}},es=e=>{const t=[];if(!e.layer.dataLabels.showDataLabels)return{labels:t,droppedCount:0};const{offset:r}=e.layer.dataLabels,n=ts(e.layer),a=n.justify==="panel-start"||n.justify==="panel-end",i=e.styleReaders;for(const o of e.layer.data){const s=q(o),l=z(o);if(s===null||l===null||!Ue(s,l))continue;const u=e.formatLabel(o);if(u==="")continue;const{width:c,height:p}=e.measureDataLabel("observation","outside",u),d=i.get("size",o)/2,h=be({box:{x:s*e.panelRect.width,y:(1-l)*e.panelRect.height,width:0,height:0},panel:me(e.panelRect),orientation:{valueAxis:"y",valueDirectionSign:-1},...n,offset:a?r:r+d,alignOffset:r+d,labelWidth:c,labelHeight:p});t.push({layerId:e.layer.id,x:h.x,y:h.y,text:u,width:c,height:p,isRotated:!1,role:"observation",position:h.position})}return{labels:t,droppedCount:0}},ts=e=>{const{position:t,justify:r,align:n}=e.dataLabels;return t==="auto"?{placement:"outside",justify:"end",align:"center"}:{placement:t,justify:r,align:n}},rs=class extends Q{constructor(...e){super(...e),this.type="point",this.styleTarget={observation:{vocabulary:{size:"pixels",symbol:"pointSymbol",strokeWidth:"pixels"},aesthetics:{fill:"color",alpha:"alpha",size:"size",strokeWidth:"strokeWidth"},rest:{fill:f("geom"),fillAlpha:1,size:8,symbol:"circle",stroke:f("hoverAffordance"),strokeWidth:1},hovered:{stroke:f("hoverAffordance")}}},this.supportedCoordTypes=["cartesian","polar","flip"],this.defaultParams={},this.positionRoles=[{axis:"x",role:"point",valueKind:"value"},{axis:"y",role:"point",valueKind:"value"}],this.aesthetics=[{kind:"visual",name:"color"},{kind:"visual",name:"size"},{kind:"visual",name:"alpha"}],this.summaries={perGroupHeadline:!0},this.highlightStrategy="overlay-anchor",this.dataLabelCoordTypes=["cartesian","flip"],this.resolveAnchorPosition=Ot,this.resolveValueSource=(t,r)=>{if(r!=="label")return null;const n=L(t.size);return n!==null?{variable:n}:null},this.getDataLabelPlacements=t=>es(t)}compile({data:e}){return{data:e,mapping:{}}}},ns=class extends Q{constructor(...e){super(...e),this.type="rule",this.styleTarget={observation:{vocabulary:{stroke:"color",strokeAlpha:"unitInterval",strokeWidth:"pixels",dashArray:"dashArray",lineCap:"lineCap",lineJoin:"lineJoin",shadow:"shadow",blendMode:"blendMode"},sharedPaint:!1,dashPresets:j.rule,aesthetics:{stroke:"color",strokeWidth:"strokeWidth",dashArray:"lineType"},rest:{stroke:f("ruleLine"),strokeWidth:1,dashArray:j.rule.dashed}},parts:{label:{vocabulary:E,options:["layer"],rest:{fontSize:11.5,fontWeight:500,lineHeight:1}}}},this.defaultParams={labelPosition:"start"},this.defaultInteractive=!1,this.positionRoles=[{axis:"y",role:"scalar",valueKind:"value",aes:"y"},{axis:"x",role:"scalar",valueKind:"value",aes:"x"}],this.highlightStrategy=null,this.spatialKind="noop",this.validateMapping=({mapping:t,computedVariables:r})=>{const n=r.has("x")||S(Se(t.x)),a=r.has("y")||S(Se(t.y));return n&&a?[{code:"INVALID_RULE_MAPPING",message:"rule geom requires exactly one of 'x' or 'y', both were provided"}]:!n&&!a?[{code:"INVALID_RULE_MAPPING",message:"rule geom requires a numeric value on 'x' or 'y'"}]:[]}}compile({data:e,mapping:t}){const r=tr(t.y,e);if(r!==null)return{data:new ae({[Oe.y]:{type:"numeric",values:[r.value],valueFormat:r.sourceFormat}}),mapping:{y:Oe.y,x:void 0}};const n=tr(t.x,e);return n!==null?{data:new ae({[Oe.x]:{type:"numeric",values:[n.value],valueFormat:n.sourceFormat}}),mapping:{x:Oe.x,y:void 0}}:{data:new ae,mapping:{x:void 0,y:void 0}}}},tr=(e,t)=>{const r=Se(e);if(S(r))return{value:r,sourceFormat:void 0};const n=L(e);if(n===null||!pa(n)||!t.hasVariable(n))return null;const[a]=t.getValues(n);return S(a)?{value:a,sourceFormat:t.getValueFormat(n)}:null};function Dn(e){return e[ue.color]}function as(e){return e[ue.alpha]}function is(e){return e[ue.size]}function os(e){return e[ue.strokeWidth]}function ss(e){return e[ue.lineType]}var In=e=>{const t=J(e),r=Z(e),n=H(e),a=K(e);if(t===null||r===null||n===null||a===null)return null;const i=Math.min(t,r),o=Math.abs(r-t),s=Math.max(n,a),l=Math.abs(a-n);return{x:i,y:1-s,width:o,height:l}},Cn=e=>{const t=In(e);if(!t)return null;const r=t.width*So,n=t.height*_o;return{x:t.x+r,y:t.y+n,width:t.width-r*2,height:t.height-n*2}},Nn=e=>!!Dn(e),Fn=e=>Nn(e)?Cn(e):null,rr=4,ls=e=>{const t=[];if(!e.layer.dataLabels.showDataLabels)return{labels:t,droppedCount:0};const r=e.styleReaders;for(const n of e.layer.data){const a=Fn(n);if(a===null)continue;const i=e.formatLabel(n);if(i==="")continue;const{width:o,height:s}=e.measureDataLabel("observation","inside",i),l=a.width*e.panelRect.width,u=a.height*e.panelRect.height;o+rr>l||s+rr>u||t.push({layerId:e.layer.id,x:(a.x+a.width/2)*e.panelRect.width,y:(a.y+a.height/2)*e.panelRect.height,text:i,width:o,height:s,isRotated:!1,role:"observation",position:"inside",backdropColor:Ge(r,n)})}return{labels:t,droppedCount:0}},us=e=>{const t=L(e.color);return t!==null?{variable:t}:null},cs=class extends Q{constructor(...e){super(...e),this.type="tile",this.styleTarget={observation:{vocabulary:{cornerRadius:"pixels",strokeWidth:"pixels"},aesthetics:{fill:"color",alpha:"alpha",strokeWidth:"strokeWidth"},rest:{fill:f("geom"),fillAlpha:1,cornerRadius:8,strokeWidth:0},hovered:{stroke:f("hoverAffordance"),strokeWidth:2}}},this.defaultParams={},this.positionRoles=[{axis:"x",role:"point",valueKind:"value"},{axis:"x",role:"min",valueKind:"value"},{axis:"x",role:"max",valueKind:"value"},{axis:"y",role:"point",valueKind:"value"},{axis:"y",role:"min",valueKind:"value"},{axis:"y",role:"max",valueKind:"value"}],this.supportedPositions=["identity"],this.supportedCoordTypes=["cartesian"],this.aesthetics=[{kind:"visual",name:"color",required:!0}],this.scaleConstraints={discreteMainAxis:!0,discreteCrossAxis:!0,bandPadding:0,inferredColor:!0},this.grid={cartesian:{hideGridX:!0,hideGridY:!0}},this.legend={suppressWhenSingleItem:!1},this.dataLabels={cartesian:{showDataLabels:!0}},this.dataLabelCoordTypes=["cartesian"],this.highlightStrategy="observation-rerender",this.spatialKind="cells",this.identityKey="x-y",this.tooltip=[{aes:"color"}],this.resolveValueSource=us,this.resolveAnchorPosition=t=>{const r=J(t),n=Z(t),a=H(t),i=K(t);return r===null||n===null||a===null||i===null?null:{x:(r+n)/2,y:(a+i)/2}},this.getDataLabelPlacements=t=>ls(t)}compile({data:e}){return{data:e.addConstantVariable(g.xMin,"numeric",-.5).addConstantVariable(g.xMax,"numeric",.5).addConstantVariable(g.yMin,"numeric",-.5).addConstantVariable(g.yMax,"numeric",.5),mapping:{}}}},jn=[new $o,new rs,new Qo,new Oo,new ns,new cs],ds=class extends Et{constructor(){super("geom");for(const e of jn)this.register(e.type,e)}},Bn=class{resolveComputedVariables(e,t){return this.computedVariables}compute(e){return this.computeStat(e)}},fs=class{constructor(){this.transformType="aggregate"}apply(e,t){const{options:r}=t,n={};for(const a of r.operations)n[a.as]={variableName:a.variableName,aggregation:a.op};return e.groupBy(...r.groupby).rollup(n)}},ps={numeric:{type:"decimal"},categorical:{type:"text"},temporal:{type:"datetime"}},hs=class{constructor(){this.transformType="constant"}apply(e,t){const{options:r}=t,n=yt(r.value,ps[r.type],xe);if(r.value!==null&&n===null)throw new se({code:"INCOMPATIBLE_TYPE",message:`Constant '${r.variableName}' cannot be read as ${r.type}`,context:{variableName:r.variableName,variableType:r.type}});return e.addConstantVariable(r.variableName,r.type,n)}getIntroducedVariables(e){const{options:t}=e;return[t.variableName]}},gs=class{constructor(){this.transformType="filter"}apply(e,t){const{options:r}=t;return e.filter(r.variableName,r.operator,r.value)}},ys=class{constructor(){this.transformType="reshape"}apply(e,t){const{options:r}=t;return e.reshapeFromWideToLong({keep:r.keep,reshape:r.reshape,keyName:r.keyName,valueName:r.valueName})}getIntroducedVariables(e){const{options:t}=e;return[t.keyName??"key"]}},ms=class{constructor(){this.transformType="sort"}apply(e,t){const{options:r}=t;return e.orderBy(r.variableName,r.direction??"asc")}},bs=[new fs,new hs,new gs,new ys,new ms],vs=class extends Et{constructor(){super("transform");for(const e of bs)this.register(e.transformType,e)}};function Vn(e){if("definition"in e)return e.definition;if(Wn(e)||Un(e)||Yn(e))return e}function As(e){const t=[],r=[],n=[];for(const a of e){const i=Vn(a);i&&(Wn(i)?(t.push(i),i.defaultStat!==null&&r.push(i.defaultStat)):Un(i)?r.push(i):Yn(i)&&n.push(i))}return{geoms:t,stats:r,transforms:n,warnings:[...Qe("geom",t,a=>a.type),...Qe("stat",r,a=>a.type),...Qe("transform",n,a=>a.transformType),...Es(t),...Ts(t)]}}function Es(e){const t=[];for(const r of e)r.spatialKind==="render-hit-test"&&(r.identityKey!=="x-group"&&r.identityKey!=="x-y"||t.push({code:"RENDER_HIT_TEST_IDENTITY",message:`The render-hit-test geom '${r.type}' uses the position-derived '${r.identityKey}' identity, which has no meaning for render-owned geometry; its hover lookup will be empty.`,context:{kind:"geom",requested:r.type},suggestion:"Declare 'identityKey' as a column the geom owns (`{ variable: '<column>' }`) or 'index', so a hit-test result resolves to an observation."}));return t}function Ts(e){const t=[];for(const r of e)r.spatialKind!=="cells"||!r.supportedCoordTypes.includes("polar")||t.push({code:"SPATIAL_KIND_COORD_UNSUPPORTED",message:`The geom '${r.type}' declares polar support, but its 'cells' hit-test shape has no polar projection; its observations will not respond to hover under polar coords.`,context:{kind:"geom",requested:r.type},suggestion:"Drop 'polar' from 'supportedCoordTypes', or declare 'rects' as the spatial kind so a bandless polar layer hit-tests as an enclosure."});return t}function Qe(e,t,r){const n=new Map;for(const i of t){const o=r(i),s=n.get(o);s?s.add(i):n.set(o,new Set([i]))}const a=[];for(const[i,o]of n)o.size<2||a.push({code:"DUPLICATE_REGISTERED_TYPE",message:`Multiple plugins register the ${e} '${i}' (${o.size} definitions); the last in the array wins.`,context:{kind:e,requested:i},suggestion:`Remove the duplicate ${e} plugin(s) named '${i}', or rename them so each registers a distinct ${e}.`});return a}var Wn=e=>e instanceof Q,Un=e=>e instanceof Bn,Yn=e=>"transformType"in e&&typeof e.apply=="function",Os=["brick","gray","red","orange","yellow","green","cyan","blue","purple","pink"],Ps=["cyan","pink","purple","red","orange","yellow","green","blue"],Gn=["#B84737","#BA7420","#0B8666","#3D63A8","#DD9583","#E2BF6B","#95CBA6","#AABCE5"],zn="brick",F={red:"#E83562",orange:"#F38650",yellow:"#FBBC30",green:"#31FCB4",cyan:"#40F8FF",blue:"#279EFF",purple:"#B399FD",dark_purple:"#6D48D2",plum:"#C82184",pink:"#FC8497"},Ss=[F.purple,F.pink,F.yellow,F.blue,F.red,F.cyan,F.orange,F.plum,F.green,F.dark_purple],D={green:"#B2DDC9",cyan:"#A2D5E2",blue:"#AAC4FF",purple:"#B2A4FF",plum:"#DCA8C7",pink:"#FFCCD3",red:"#FFADAD",orange:"#FFDEB4",yellow:"#FDF7C3"},_s=[D.green,D.purple,D.red,D.cyan,D.pink,D.blue,D.orange,D.plum,D.yellow],Me={brick900:"#6E0500",brick800:"#881D11",brick700:"#A03522",brick600:"#B0523B",brick500:"#C06D56",brick400:"#CE8772",brick300:"#DBA28E",brick200:"#E7BDAC",brick100:"#F2D8CB",brick50:"#FCF4EA",gray900:"#1c1917",gray800:"#292524",gray700:"#44403c",gray600:"#57534e",gray500:"#78716c",gray400:"#a8a29e",gray300:"#d6d3d1",gray200:"#e7e5e4",gray100:"#f5f5f4",gray50:"#fafaf9",red900:"#7f1d1d",red800:"#991b1b",red700:"#b91c1c",red600:"#dc2626",red500:"#ef4444",red400:"#f87171",red300:"#fca5a5",red200:"#fecaca",red100:"#fee2e2",red50:"#fef2f2",orange900:"#7c2d12",orange800:"#9a3412",orange700:"#c2410c",orange600:"#ea580c",orange500:"#f97316",orange400:"#fb923c",orange300:"#fdba74",orange200:"#fed7aa",orange100:"#ffedd5",orange50:"#fff7ed",yellow900:"#553B0C",yellow800:"#6F4B08",yellow700:"#8D6300",yellow600:"#BD8A00",yellow500:"#E5B400",yellow400:"#FFC800",yellow300:"#FBDA2B",yellow200:"#FEED72",yellow100:"#FEF8B4",yellow50:"#FEFCE2",green900:"#064e3b",green800:"#065f46",green700:"#047857",green600:"#059669",green500:"#10b981",green400:"#34d399",green300:"#6ee7b7",green200:"#a7f3d0",green100:"#d1fae5",green50:"#ecfdf5",cyan900:"#164e63",cyan800:"#155e75",cyan700:"#0e7490",cyan600:"#0891B2",cyan500:"#06b6d4",cyan400:"#22d3ee",cyan300:"#67e8f9",cyan200:"#a5f3fc",cyan100:"#cffafe",cyan50:"#ecfeff",blue900:"#1e3a8a",blue800:"#1e40af",blue700:"#1d4ed8",blue600:"#2563eb",blue500:"#3b82f6",blue400:"#60a5fa",blue300:"#93c5fd",blue200:"#bfdbfe",blue100:"#dbeafe",blue50:"#eff6ff",purple900:"#4c1d95",purple800:"#5b21b6",purple700:"#6d28d9",purple600:"#7c3aed",purple500:"#8b5cf6",purple400:"#a78bfa",purple300:"#c4b5fd",purple200:"#ddd6fe",purple100:"#ede9fe",purple50:"#f5f3ff",pink900:"#751A5E",pink800:"#8F1972",pink700:"#AF1C8A",pink600:"#D326A8",pink500:"#E845BF",pink400:"#F979D9",pink300:"#FCABE8",pink200:"#FED0F3",pink100:"#FFE8F9",pink50:"#FFF4FC"},Ms=[Me.brick100,Me.brick900],xs=[Me.gray200,D.green,D.red,Me.gray200],nr={dark:{1:[500],2:[600,400],3:[600,400,200],4:[600,500,300,100],5:[700,600,400,200,50],6:[600,500,400,300,200,100],7:[600,500,400,300,200,100,50],default:[700,600,500,400,300,200,100,50]},light:{1:[600],2:[700,500],3:[800,600,400],4:[800,600,400,300],5:[800,700,600,500,400],6:[800,700,600,500,400,300],7:[900,800,700,600,500,400,300],default:[900,800,700,600,500,400,300,200]}},k={cyan:"#22D3EE",pink:"#F377EF",purple:"#6528F7",red:"#FB2576",orange:"#FF9300",yellow:"#FBFF00",green:"#06FF00",blue:"#0079FF"},De=[k.cyan,k.pink,k.purple,k.red,k.orange,k.yellow,k.green,k.blue],Ls=[k.cyan,k.green,k.red,k.cyan],Ie={start:"#84D1FC",positive:"#84FC89",negative:"#FC8497",total:"#84D1FC"},Rs=[Ie.start,Ie.positive,Ie.negative,Ie.total],ws={transform:"linear",reverse:!1,nice:!0,domainMin:null,domainMax:null,range:null,scheme:null,interpolate:"lab",domainMid:null,symmetric:!1},ks={size:[4,20],alpha:[.1,1],strokeWidth:[1,4]},Ds={domainMin:null,domainMax:null,nice:!1,reverse:!1},Is={range:null,domain:null,padding:.1,reverse:!1},ar={palette:{type:"default"}};function ir(e,t="light",r){return((r!==void 0?nr[t][r]:void 0)??nr[t].default).map(n=>Me[`${e}${n}`])}function Cs(e){const t=De.indexOf(k[e]);return t<=0?De:[...De.slice(t),...De.slice(0,t)]}function Ns(e,t={}){switch(e.type){case"default":return t.defaultPalette!==void 0&&t.defaultPalette.length>0?[...t.defaultPalette]:t.hasTouchingGeoms?ir(zn,t.colorScheme??"light",t.groupCount):Gn;case"graphy":return e.variant==="waterfall"?Rs:Ss;case"pastel":return e.variant==="waterfall"?xs:_s;case"neon":return e.variant==="waterfall"?Ls:Cs(e.base);case"mono":return ir(e.base,e.variant??"light",t.groupCount);case"custom":return e.colors}}function Fs(e,t){if(!t)return e;const r=[...e];for(const[n,a]of Object.entries(t)){const i=Number(n);if(!Number.isInteger(i)||i<1)continue;const o=i-1;o<r.length&&(r[o]=a)}return r}function js(e,t,r,n){if(!t)return;const a=r?.type==="custom"?n[r.id]:void 0,i={};for(const[o,s]of Object.entries(t)){const l=Number(o);if(!(!Number.isInteger(l)||l<1)){if(s.hex!==void 0){i[l]=s.hex;continue}if(s.id!==void 0){const u=a?.find(c=>c.id===s.id)?.hex;u!==void 0?i[l]=u:e.diagnostics.addWarning({code:"PALETTE_NOT_FOUND",message:`Palette override at slot ${l} with id '${s.id}' did not resolve against the active palette — falling back to palette color.`,context:{requested:s.id,available:a?.map(c=>c.id)??[]},suggestion:"Define the override id in the active custom palette, or use a hex value instead."})}}}return Object.keys(i).length>0?i:void 0}function Bs(e,t,r){if(!t)return ar.palette;if(t.type==="custom"){const n=r[t.id];if(!n)return e.diagnostics.addWarning({code:"PALETTE_NOT_FOUND",message:`Custom palette with id "${t.id}" not found — falling back to the default palette.`,context:{requested:t.id,available:Object.keys(r)},suggestion:"Register the palette in customPalettes, or reference an existing palette id."}),ar.palette;const a=n.map(i=>i.hex);return{type:"custom",id:t.id,colors:a}}return t}function Vs(e,t={}){const r=t;return{type:"scale",scaledAesthetic:e,scaleType:"continuous",transform:t.transform,reverse:t.reverse,nice:t.nice,clamp:t.clamp,domainMin:t.domainMin??null,domainMax:t.domainMax??null,range:t.range,scheme:r.scheme??null,interpolate:r.interpolate,domainMid:r.domainMid??null,symmetric:r.symmetric}}function Ws(e,t={}){return{type:"scale",scaledAesthetic:e,scaleType:"datetime",domainMin:t.domainMin??null,domainMax:t.domainMax??null,nice:t.nice,reverse:t.reverse,clamp:t.clamp}}function Us(e,t={}){return{type:"scale",scaledAesthetic:e,scaleType:"discrete",range:t.range,domain:t.domain??null,padding:t.padding,reverse:t.reverse}}function Ys(e,t={}){return{type:"scale",scaledAesthetic:e,scaleType:"identity"}}function Gs(e,t){return{type:"scale",scaledAesthetic:e,scaleType:"inferred",options:t}}function zs(e,t={}){return{type:"scale",scaledAesthetic:e,scaleType:"palette",palette:t.palette,overrides:t.overrides}}var Hs={labelCrossPosition:.5},Ks={kind:"rectangle",zOrder:"foreground"},$s={zOrder:"foreground",fit:"contain"},Xs={x:8,y:8,unit:"px"},qs={align:"center"},Js={startArrowheadStyle:"none",endArrowheadStyle:"line-arrow"},Zs={thin:2,medium:4,thick:8},Qs=.5,el={strokeWidth:2,shadow:{offsetX:0,offsetY:1.15,blur:1.15,color:"rgba(0, 0, 0, 0.16)"}},tl={small:{arrow:{strokeWidth:2},label:{fontSize:12,fontWeight:500,paddingInline:6,paddingBlock:3,strokeWidth:1}},medium:{arrow:{strokeWidth:3},label:{fontSize:16,fontWeight:500,paddingInline:8,paddingBlock:4,strokeWidth:1.5}},large:{arrow:{strokeWidth:5},label:{fontSize:20,fontWeight:600,paddingInline:10,paddingBlock:5,strokeWidth:2}}},rl={differenceArrow:"differenceArrows",shape:"shapes",arrow:"arrows",text:"textAnnotations",image:"images",sticker:"stickers",pinnedNumber:"pinnedNumbers",comment:"comments"},nl={differenceArrow(e){return{type:"annotation",kind:"differenceArrow",annotation:e}},shape(e){return{type:"annotation",kind:"shape",annotation:e}},arrow(e){return{type:"annotation",kind:"arrow",annotation:e}},text(e){return{type:"annotation",kind:"text",annotation:e}},image(e){return{type:"annotation",kind:"image",annotation:e}},sticker(e){return{type:"annotation",kind:"sticker",annotation:e}},pinnedNumber(e){return{type:"annotation",kind:"pinnedNumber",annotation:e}},comment(e){return{type:"annotation",kind:"comment",annotation:e}}};Object.defineProperty(exports,"ANNOTATION_BUCKETS",{enumerable:!0,get:function(){return rl}});Object.defineProperty(exports,"ARROW_DEFAULTS",{enumerable:!0,get:function(){return Js}});Object.defineProperty(exports,"ARROW_STICKER_DECLARATIONS",{enumerable:!0,get:function(){return el}});Object.defineProperty(exports,"ARROW_STROKE_WIDTHS_PX",{enumerable:!0,get:function(){return Zs}});Object.defineProperty(exports,"AXIS_KEYS",{enumerable:!0,get:function(){return bi}});Object.defineProperty(exports,"BAR_GROUP_SCALE_PADDING_FRACTION",{enumerable:!0,get:function(){return Po}});Object.defineProperty(exports,"BAR_WIDTH_FRACTION",{enumerable:!0,get:function(){return _n}});Object.defineProperty(exports,"BORDER_RADIUS_TOKENS",{enumerable:!0,get:function(){return mt}});Object.defineProperty(exports,"BUILT_IN_GEOMS",{enumerable:!0,get:function(){return jn}});Object.defineProperty(exports,"CONSTANT_VARIABLES",{enumerable:!0,get:function(){return ut}});Object.defineProperty(exports,"CONTINUOUS_SCALE_DEFAULTS",{enumerable:!0,get:function(){return ws}});Object.defineProperty(exports,"ChronologicalDateManager",{enumerable:!0,get:function(){return xr}});Object.defineProperty(exports,"DASH_PRESETS",{enumerable:!0,get:function(){return j}});Object.defineProperty(exports,"DATETIME_SCALE_DEFAULTS",{enumerable:!0,get:function(){return Ds}});Object.defineProperty(exports,"DEFAULT_BAR_CORNER_RADIUS",{enumerable:!0,get:function(){return Hi}});Object.defineProperty(exports,"DEFAULT_COLOR_PALETTE",{enumerable:!0,get:function(){return Gn}});Object.defineProperty(exports,"DEFAULT_DIMMED_ALPHA",{enumerable:!0,get:function(){return An}});Object.defineProperty(exports,"DEFAULT_GEOM_COLOR",{enumerable:!0,get:function(){return zi}});Object.defineProperty(exports,"DEFAULT_GRAPH_BACKGROUND",{enumerable:!0,get:function(){return qi}});Object.defineProperty(exports,"DEFAULT_GRAPH_BORDER_WIDTH_PX",{enumerable:!0,get:function(){return Zi}});Object.defineProperty(exports,"DEFAULT_GRAPH_PADDING_EDGES_PX",{enumerable:!0,get:function(){return eo}});Object.defineProperty(exports,"DEFAULT_GRAPH_PADDING_PX",{enumerable:!0,get:function(){return Qi}});Object.defineProperty(exports,"DEFAULT_HEADLINE_SWATCH_SIZE_PX",{enumerable:!0,get:function(){return Xi}});Object.defineProperty(exports,"DEFAULT_HOVER_AFFORDANCE_COLOR",{enumerable:!0,get:function(){return Ji}});Object.defineProperty(exports,"DEFAULT_LOCALE",{enumerable:!0,get:function(){return xe}});Object.defineProperty(exports,"DEFAULT_MONO_BASE",{enumerable:!0,get:function(){return zn}});Object.defineProperty(exports,"DEFAULT_POINT_SIZE_PX",{enumerable:!0,get:function(){return $i}});Object.defineProperty(exports,"DEFAULT_RESHAPE_VALUE_NAME",{enumerable:!0,get:function(){return gn}});Object.defineProperty(exports,"DEFAULT_SEQUENTIAL_RAMP",{enumerable:!0,get:function(){return Ms}});Object.defineProperty(exports,"DEFAULT_STROKE_WIDTH_PX",{enumerable:!0,get:function(){return Ki}});Object.defineProperty(exports,"DIFFERENCE_ARROW_DEFAULTS",{enumerable:!0,get:function(){return Hs}});Object.defineProperty(exports,"DIFFERENCE_ARROW_SIZE_DECLARATIONS",{enumerable:!0,get:function(){return tl}});Object.defineProperty(exports,"DISCRETE_SCALE_DEFAULTS",{enumerable:!0,get:function(){return Is}});Object.defineProperty(exports,"DataCompiler",{enumerable:!0,get:function(){return Ii}});Object.defineProperty(exports,"Dataset",{enumerable:!0,get:function(){return ae}});Object.defineProperty(exports,"GROUP_VARIABLES",{enumerable:!0,get:function(){return Ne}});Object.defineProperty(exports,"Geom",{enumerable:!0,get:function(){return Q}});Object.defineProperty(exports,"GeomRegistry",{enumerable:!0,get:function(){return ds}});Object.defineProperty(exports,"IMAGE_ANNOTATION_DEFAULTS",{enumerable:!0,get:function(){return $s}});Object.defineProperty(exports,"IS_DEV",{enumerable:!0,get:function(){return ne}});Object.defineProperty(exports,"InternalError",{enumerable:!0,get:function(){return x}});Object.defineProperty(exports,"LAYER_LABEL_VARIABLES",{enumerable:!0,get:function(){return ca}});Object.defineProperty(exports,"LINE_TYPES",{enumerable:!0,get:function(){return Pr}});Object.defineProperty(exports,"MONO_BASES",{enumerable:!0,get:function(){return Os}});Object.defineProperty(exports,"NEON_BASES",{enumerable:!0,get:function(){return Ps}});Object.defineProperty(exports,"NON_POSITION_RANGE_DEFAULTS",{enumerable:!0,get:function(){return ks}});Object.defineProperty(exports,"POLAR_RIM_LABEL_GAP_PX",{enumerable:!0,get:function(){return aa}});Object.defineProperty(exports,"POSITION_ADJUSTMENTS",{enumerable:!0,get:function(){return Or}});Object.defineProperty(exports,"POSITION_NUMERIC_ROLES",{enumerable:!0,get:function(){return Bi}});Object.defineProperty(exports,"POSITION_VARIABLES",{enumerable:!0,get:function(){return g}});Object.defineProperty(exports,"Registry",{enumerable:!0,get:function(){return Et}});Object.defineProperty(exports,"SCALED_POSITION_AESTHETIC_KEYS",{enumerable:!0,get:function(){return ln}});Object.defineProperty(exports,"SCALED_VISUAL_AESTHETIC_KEYS",{enumerable:!0,get:function(){return vt}});Object.defineProperty(exports,"SELECTION_PADDING_DEFAULT",{enumerable:!0,get:function(){return Xs}});Object.defineProperty(exports,"SHAPE_DEFAULTS",{enumerable:!0,get:function(){return Ks}});Object.defineProperty(exports,"STACK_VARIABLES",{enumerable:!0,get:function(){return dt}});Object.defineProperty(exports,"STAT_VARIABLES",{enumerable:!0,get:function(){return ct}});Object.defineProperty(exports,"STYLE_BLEND_MODES",{enumerable:!0,get:function(){return en}});Object.defineProperty(exports,"STYLE_COORDS",{enumerable:!0,get:function(){return Gi}});Object.defineProperty(exports,"STYLE_DOMAINS",{enumerable:!0,get:function(){return pi}});Object.defineProperty(exports,"STYLE_FONT_STYLES",{enumerable:!0,get:function(){return Xr}});Object.defineProperty(exports,"STYLE_IMAGE_FITS",{enumerable:!0,get:function(){return sr}});Object.defineProperty(exports,"STYLE_LINE_CAPS",{enumerable:!0,get:function(){return Zr}});Object.defineProperty(exports,"STYLE_LINE_JOINS",{enumerable:!0,get:function(){return Qr}});Object.defineProperty(exports,"STYLE_PATTERN_PRESETS",{enumerable:!0,get:function(){return or}});Object.defineProperty(exports,"STYLE_POINT_SYMBOLS",{enumerable:!0,get:function(){return tn}});Object.defineProperty(exports,"STYLE_PROPERTY_NAMES",{enumerable:!0,get:function(){return li}});Object.defineProperty(exports,"STYLE_SELECT_KEYS",{enumerable:!0,get:function(){return vn}});Object.defineProperty(exports,"STYLE_STATES",{enumerable:!0,get:function(){return si}});Object.defineProperty(exports,"STYLE_TARGETS",{enumerable:!0,get:function(){return Ye}});Object.defineProperty(exports,"STYLE_TEXT_DECORATIONS",{enumerable:!0,get:function(){return Jr}});Object.defineProperty(exports,"STYLE_TEXT_TRANSFORMS",{enumerable:!0,get:function(){return qr}});Object.defineProperty(exports,"SUFFIX_MULTIPLIERS",{enumerable:!0,get:function(){return Lr}});Object.defineProperty(exports,"Stage",{enumerable:!0,get:function(){return sn}});Object.defineProperty(exports,"Stat",{enumerable:!0,get:function(){return Bn}});Object.defineProperty(exports,"TAU",{enumerable:!0,get:function(){return G}});Object.defineProperty(exports,"TEXT_ANNOTATION_DEFAULTS",{enumerable:!0,get:function(){return qs}});Object.defineProperty(exports,"TEXT_ANNOTATION_FADE_ALPHA",{enumerable:!0,get:function(){return Qs}});Object.defineProperty(exports,"TransformRegistry",{enumerable:!0,get:function(){return vs}});Object.defineProperty(exports,"UserInputError",{enumerable:!0,get:function(){return se}});Object.defineProperty(exports,"VISUAL_VARIABLES",{enumerable:!0,get:function(){return ue}});Object.defineProperty(exports,"VizError",{enumerable:!0,get:function(){return pt}});Object.defineProperty(exports,"alignToBoxPoint",{enumerable:!0,get:function(){return ft}});Object.defineProperty(exports,"alignUnitFractions",{enumerable:!0,get:function(){return ba}});Object.defineProperty(exports,"annotation",{enumerable:!0,get:function(){return nl}});Object.defineProperty(exports,"applyOverrides",{enumerable:!0,get:function(){return Fs}});Object.defineProperty(exports,"areDataValuesEqual",{enumerable:!0,get:function(){return va}});Object.defineProperty(exports,"areMappingsEquivalent",{enumerable:!0,get:function(){return Sa}});Object.defineProperty(exports,"buildLayerSpec",{enumerable:!0,get:function(){return ce}});Object.defineProperty(exports,"buildPanelAnchorBox",{enumerable:!0,get:function(){return me}});Object.defineProperty(exports,"compositeColor",{enumerable:!0,get:function(){return cr}});Object.defineProperty(exports,"continuous",{enumerable:!0,get:function(){return Vs}});Object.defineProperty(exports,"createGeomStyleNode",{enumerable:!0,get:function(){return go}});Object.defineProperty(exports,"createPerKeyMemo",{enumerable:!0,get:function(){return an}});Object.defineProperty(exports,"createSingleSlotMemo",{enumerable:!0,get:function(){return yi}});Object.defineProperty(exports,"cursorToPiePlane",{enumerable:!0,get:function(){return mr}});Object.defineProperty(exports,"cursorToPolar",{enumerable:!0,get:function(){return ua}});Object.defineProperty(exports,"datetime",{enumerable:!0,get:function(){return Ws}});Object.defineProperty(exports,"defineGeomStyleTarget",{enumerable:!0,get:function(){return po}});Object.defineProperty(exports,"deriveDeclaredAesthetics",{enumerable:!0,get:function(){return Ui}});Object.defineProperty(exports,"deriveGeomRequiredAesthetics",{enumerable:!0,get:function(){return fo}});Object.defineProperty(exports,"discrete",{enumerable:!0,get:function(){return Us}});Object.defineProperty(exports,"ensureReadableTextColor",{enumerable:!0,get:function(){return Zn}});Object.defineProperty(exports,"fillIntervalAesthetics",{enumerable:!0,get:function(){return Yi}});Object.defineProperty(exports,"findStyleTarget",{enumerable:!0,get:function(){return co}});Object.defineProperty(exports,"freezeWalkedEntries",{enumerable:!0,get:function(){return uo}});Object.defineProperty(exports,"geom",{enumerable:!0,get:function(){return Qa}});Object.defineProperty(exports,"getAestheticFromScaleAestheticKey",{enumerable:!0,get:function(){return Ei}});Object.defineProperty(exports,"getAlpha",{enumerable:!0,get:function(){return as}});Object.defineProperty(exports,"getAngleExtent",{enumerable:!0,get:function(){return wn}});Object.defineProperty(exports,"getColor",{enumerable:!0,get:function(){return Dn}});Object.defineProperty(exports,"getGroupVariables",{enumerable:!0,get:function(){return fn}});Object.defineProperty(exports,"getInsetTileRect",{enumerable:!0,get:function(){return Cn}});Object.defineProperty(exports,"getLineType",{enumerable:!0,get:function(){return ss}});Object.defineProperty(exports,"getPaintedTileRect",{enumerable:!0,get:function(){return Fn}});Object.defineProperty(exports,"getRadiusExtent",{enumerable:!0,get:function(){return kn}});Object.defineProperty(exports,"getScaledAesthetic",{enumerable:!0,get:function(){return ya}});Object.defineProperty(exports,"getSize",{enumerable:!0,get:function(){return is}});Object.defineProperty(exports,"getStableKey",{enumerable:!0,get:function(){return Fe}});Object.defineProperty(exports,"getStackRole",{enumerable:!0,get:function(){return Mn}});Object.defineProperty(exports,"getStrokeWidth",{enumerable:!0,get:function(){return os}});Object.defineProperty(exports,"getTileRectBounds",{enumerable:!0,get:function(){return In}});Object.defineProperty(exports,"getX",{enumerable:!0,get:function(){return q}});Object.defineProperty(exports,"getXBand",{enumerable:!0,get:function(){return ha}});Object.defineProperty(exports,"getXMax",{enumerable:!0,get:function(){return Z}});Object.defineProperty(exports,"getXMin",{enumerable:!0,get:function(){return J}});Object.defineProperty(exports,"getY",{enumerable:!0,get:function(){return z}});Object.defineProperty(exports,"getYBand",{enumerable:!0,get:function(){return ga}});Object.defineProperty(exports,"getYMax",{enumerable:!0,get:function(){return K}});Object.defineProperty(exports,"getYMin",{enumerable:!0,get:function(){return H}});Object.defineProperty(exports,"getYRaw",{enumerable:!0,get:function(){return Ar}});Object.defineProperty(exports,"hasMultipleGroups",{enumerable:!0,get:function(){return At}});Object.defineProperty(exports,"identity",{enumerable:!0,get:function(){return Ys}});Object.defineProperty(exports,"inferXVariable",{enumerable:!0,get:function(){return Ta}});Object.defineProperty(exports,"inferred",{enumerable:!0,get:function(){return Gs}});Object.defineProperty(exports,"isAngleWithinArc",{enumerable:!0,get:function(){return pr}});Object.defineProperty(exports,"isBorderRadiusToken",{enumerable:!0,get:function(){return $r}});Object.defineProperty(exports,"isCategoricalValueFormat",{enumerable:!0,get:function(){return Sr}});Object.defineProperty(exports,"isCompilerCachingEnabled",{enumerable:!0,get:function(){return gi}});Object.defineProperty(exports,"isCurrencyValueFormat",{enumerable:!0,get:function(){return Ma}});Object.defineProperty(exports,"isDateWithoutYearValueFormat",{enumerable:!0,get:function(){return xa}});Object.defineProperty(exports,"isDefined",{enumerable:!0,get:function(){return B}});Object.defineProperty(exports,"isFullTurnSweep",{enumerable:!0,get:function(){return fr}});Object.defineProperty(exports,"isGradientPaint",{enumerable:!0,get:function(){return je}});Object.defineProperty(exports,"isImagePaint",{enumerable:!0,get:function(){return st}});Object.defineProperty(exports,"isInternalVariable",{enumerable:!0,get:function(){return fa}});Object.defineProperty(exports,"isLightDarkColor",{enumerable:!0,get:function(){return Le}});Object.defineProperty(exports,"isLineType",{enumerable:!0,get:function(){return _a}});Object.defineProperty(exports,"isLookupValueFormat",{enumerable:!0,get:function(){return ht}});Object.defineProperty(exports,"isNonEmptyArray",{enumerable:!0,get:function(){return Aa}});Object.defineProperty(exports,"isNumericDataValue",{enumerable:!0,get:function(){return na}});Object.defineProperty(exports,"isNumericValueFormat",{enumerable:!0,get:function(){return _r}});Object.defineProperty(exports,"isOpaquePaint",{enumerable:!0,get:function(){return ea}});Object.defineProperty(exports,"isPatternPaint",{enumerable:!0,get:function(){return Be}});Object.defineProperty(exports,"isPlainObject",{enumerable:!0,get:function(){return Ea}});Object.defineProperty(exports,"isPointWithinPanel",{enumerable:!0,get:function(){return Ue}});Object.defineProperty(exports,"isPositionScale",{enumerable:!0,get:function(){return un}});Object.defineProperty(exports,"isScaledAestheticKey",{enumerable:!0,get:function(){return vi}});Object.defineProperty(exports,"isStackedPosition",{enumerable:!0,get:function(){return he}});Object.defineProperty(exports,"isStrictCategoricalDataValue",{enumerable:!0,get:function(){return ra}});Object.defineProperty(exports,"isStrictNumericDataValue",{enumerable:!0,get:function(){return S}});Object.defineProperty(exports,"isStrictTemporalDataValue",{enumerable:!0,get:function(){return Ce}});Object.defineProperty(exports,"isStyleTokenRef",{enumerable:!0,get:function(){return bt}});Object.defineProperty(exports,"isTemporalDataValue",{enumerable:!0,get:function(){return ta}});Object.defineProperty(exports,"isTemporalValueFormat",{enumerable:!0,get:function(){return ye}});Object.defineProperty(exports,"isTilePainted",{enumerable:!0,get:function(){return Nn}});Object.defineProperty(exports,"isUsableTokenValue",{enumerable:!0,get:function(){return rn}});Object.defineProperty(exports,"isVisualScale",{enumerable:!0,get:function(){return cn}});Object.defineProperty(exports,"measureSignedAngularDelta",{enumerable:!0,get:function(){return sa}});Object.defineProperty(exports,"normalizeAngle",{enumerable:!0,get:function(){return oe}});Object.defineProperty(exports,"paintKey",{enumerable:!0,get:function(){return qn}});Object.defineProperty(exports,"palette",{enumerable:!0,get:function(){return zs}});Object.defineProperty(exports,"parseAddressingValue",{enumerable:!0,get:function(){return yt}});Object.defineProperty(exports,"parseDataset",{enumerable:!0,get:function(){return bn}});Object.defineProperty(exports,"pickReadableTextColor",{enumerable:!0,get:function(){return ur}});Object.defineProperty(exports,"polarSectorToInscribedSquare",{enumerable:!0,get:function(){return gr}});Object.defineProperty(exports,"polarToUnit",{enumerable:!0,get:function(){return hr}});Object.defineProperty(exports,"positionToAngle",{enumerable:!0,get:function(){return la}});Object.defineProperty(exports,"prefixInternalVariable",{enumerable:!0,get:function(){return y}});Object.defineProperty(exports,"readBackdropColor",{enumerable:!0,get:function(){return Ge}});Object.defineProperty(exports,"readConstantValue",{enumerable:!0,get:function(){return Se}});Object.defineProperty(exports,"readDataValueKey",{enumerable:!0,get:function(){return Tr}});Object.defineProperty(exports,"readFoldKeepVariables",{enumerable:!0,get:function(){return Oa}});Object.defineProperty(exports,"readISOInstant",{enumerable:!0,get:function(){return Fr}});Object.defineProperty(exports,"readMainAxisVariable",{enumerable:!0,get:function(){return Pa}});Object.defineProperty(exports,"readObservationBox",{enumerable:!0,get:function(){return Er}});Object.defineProperty(exports,"readObservationVocabulary",{enumerable:!0,get:function(){return Sn}});Object.defineProperty(exports,"readPlugins",{enumerable:!0,get:function(){return As}});Object.defineProperty(exports,"readVariableName",{enumerable:!0,get:function(){return L}});Object.defineProperty(exports,"removeAlpha",{enumerable:!0,get:function(){return Qn}});Object.defineProperty(exports,"resolveAnchoredLabelCenter",{enumerable:!0,get:function(){return be}});Object.defineProperty(exports,"resolveBarBandFraction",{enumerable:!0,get:function(){return it}});Object.defineProperty(exports,"resolveColorScheme",{enumerable:!0,get:function(){return et}});Object.defineProperty(exports,"resolveDefinition",{enumerable:!0,get:function(){return Vn}});Object.defineProperty(exports,"resolvePaletteConfig",{enumerable:!0,get:function(){return Bs}});Object.defineProperty(exports,"resolvePaletteOverrides",{enumerable:!0,get:function(){return js}});Object.defineProperty(exports,"resolvePaletteRange",{enumerable:!0,get:function(){return Ns}});Object.defineProperty(exports,"resolvePositionScaleAesthetic",{enumerable:!0,get:function(){return Ai}});Object.defineProperty(exports,"resolveScaledAestheticVariable",{enumerable:!0,get:function(){return vr}});Object.defineProperty(exports,"resolveYScaleAesthetic",{enumerable:!0,get:function(){return dn}});Object.defineProperty(exports,"setCompilerCachingEnabled",{enumerable:!0,get:function(){return hi}});Object.defineProperty(exports,"sumMemoStats",{enumerable:!0,get:function(){return mi}});Object.defineProperty(exports,"toExplicitValueFormat",{enumerable:!0,get:function(){return La}});Object.defineProperty(exports,"toPaintColor",{enumerable:!0,get:function(){return lr}});Object.defineProperty(exports,"token",{enumerable:!0,get:function(){return f}});Object.defineProperty(exports,"unitToPolar",{enumerable:!0,get:function(){return yr}});Object.defineProperty(exports,"walkStyleTargets",{enumerable:!0,get:function(){return lo}});Object.defineProperty(exports,"withAlpha",{enumerable:!0,get:function(){return dr}});Object.defineProperty(exports,"wrappedAngularDistance",{enumerable:!0,get:function(){return lt}});