@graphysdk/viz-engine 2.0.0-beta.1788523247843 → 2.0.0-beta.1788529798467

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.
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./config.types-EgbTT8QQ.cjs");var q=10,Z=["normal","italic","oblique"],J=/^(\d*\.?\d+)(px|em)$/,M=/^\d*\.?\d+$/,Q=1,ee=1e3,re={normal:400,bold:700},W=e=>Z.includes(e),N=e=>{const r=J.exec(e.trim());return r===null||r[1]===void 0||r[2]===void 0?null:{value:Number.parseFloat(r[1]),unit:r[2]==="px"?"px":"em"}},G=e=>{const r=e.trim(),t=re[r];if(t!==void 0)return t;if(!M.test(r))return null;const i=Number.parseFloat(r);return i>=Q&&i<=ee?i:null},Y=e=>{const r=e.trim();return M.test(r)?Number.parseFloat(r):null},V=e=>e.unit==="em"?e.value*10:e.value,z=e=>{const r=e.trim().replace(/\s*\/\s*/g,"/").split(/\s+/);let t="normal",i=400,n=0;for(;n<r.length;){const f=r[n];if(f===void 0)return null;if(f==="normal")n++;else if(W(f))t=f,n++;else{const y=G(f);if(y===null)break;i=y,n++}}const s=r[n];if(s===void 0)return null;const[a="",c]=s.split("/"),l=N(a);if(l===null)return null;const u=c===void 0?null:Y(c),p=r.slice(n+1).join(" ").trim();return p===""?null:{style:t,weight:i,size:l,family:p,...u!==null?{lineHeight:u}:{}}};function te(e){const r=[];for(const t of e??[]){if(t.type==="shape"&&r.push(o.style.annotation.shape({color:t.fillColor,alpha:t.fillOpacity,borderWidth:t.strokeWidth},{annotation:t.id})),t.type==="arrow"&&r.push(o.style.annotation.arrow({...t.color===void 0?{}:{color:t.color},strokeWidth:o.ARROW_STROKE_WIDTHS[t.thickness],lineType:t.lineStyle,...t.hasStickerStyle?o.ARROW_STICKER_DECLARATIONS:{}},{annotation:t.id})),t.type==="difference-arrow"){const i=o.DIFFERENCE_ARROW_SIZE_DECLARATIONS[t.size];r.push(o.style.annotation.differenceArrow({...t.color===void 0?{}:{color:t.color},...i.arrow},{annotation:t.id}),o.style.annotation.differenceArrow.label(i.label,{annotation:t.id}))}t.type==="text"&&t.backgroundColor!==void 0&&r.push(o.style.annotation.text({background:t.backgroundColor,...t.backgroundColorStyle==="fade"?{alpha:o.TEXT_ANNOTATION_FADE_ALPHA}:{}},{annotation:t.id})),t.type==="image"&&t.opacity!==void 0&&r.push(o.style.annotation.image({alpha:t.opacity},{annotation:t.id}))}return r}function oe(e){const r=[],t=e?.defaultAnnotationShapeFill;return typeof t=="string"&&r.push(o.style.annotation.shape({color:t})),r}function ie(e){const r=e?.defaultAnnotationArrowStroke;return typeof r=="string"?{annotationArrowColor:r}:void 0}var ne="#%_ENCODED_%#",K=e=>{if(!e.startsWith(ne))return e;try{const{value:r}=JSON.parse(e.slice(13));return typeof r=="string"?r:e}catch{return e}},se=({annotations:e,dataset:r,mapping:t,seriesVariables:i})=>{const n=[],s=[],a=[],c=[],l=[],u=[],p=[],f=[],y={dataset:r,...ae(t,i)};for(const m of e??[])switch(m.type){case"difference-arrow":{const d=le(m,y);d!==null&&n.push(d);break}case"shape":s.push(ce(m));break;case"arrow":a.push(ve(m));break;case"highlight":break;case"text":c.push(de(m));break;case"image":l.push(ue(m));break;case"sticker":{const d=fe(m,y);d!==null&&u.push(d);break}case"tooltip":{const d=pe(m,y);if(d===null)break;d.kind==="pinnedNumber"?p.push(d.value):f.push(d.value);break}default:throw new o.InternalError({message:`Unsupported annotation type: ${m.type}`})}return{differenceArrows:n,shapes:s,arrows:a,textAnnotations:c,images:l,stickers:u,pinnedNumbers:p,comments:f}},ae=(e,r)=>{const t=o.extractVariableName(e.x),i=o.extractVariableName(e.group)??o.extractVariableName(e.color),n=t!==null&&t!=="",s=i==="key"||r.length>=2;return{anchorVariable:n?t:i,groupIsSeriesKey:s}},le=(e,r)=>{const t=k(r,e.start),i=k(r,e.end);return t===null||i===null?null:{id:e.id,start:t,end:i,label:e.show,labelCrossPosition:e.labelPosition}},ce=e=>({id:e.id,kind:e.shape,zOrder:e.layer==="abovePlot"?"foreground":"background",region:{anchorType:"panel",x:e.x,y:e.y,width:e.width,height:e.height}}),ue=e=>({id:e.id,src:e.src,zOrder:e.layer==="abovePlot"?"foreground":"background",region:{anchorType:"panel",x:e.x,y:e.y,width:e.width,height:e.height},fit:e.fit}),de=e=>({id:e.id,content:e.content,at:{anchorType:"panel",x:e.x,y:e.y},width:e.width,align:"top-left"}),fe=(e,r)=>{const t=k(r,e);return t===null?null:{id:e.id,at:{anchorType:"observation",...t},sticker:e.sticker}},pe=(e,r)=>{const t=k(r,e);return t===null?null:e.caption===null||e.caption===void 0?{kind:"pinnedNumber",value:{id:e.id,at:t}}:{kind:"comment",value:{id:e.id,at:t,content:e.caption}}},ve=e=>({id:e.id,start:{anchorType:"panel",x:e.startX,y:e.startY},end:{anchorType:"panel",x:e.endX,y:e.endY},startArrowheadStyle:e.startArrowheadStyle,endArrowheadStyle:e.endArrowheadStyle}),k=(e,r)=>{if(!o.isDefined(r))return null;const{dataset:t,anchorVariable:i,groupIsSeriesKey:n}=e;if(i===null)return null;const s=ye(r,i,t);return s===null?null:n?o.isDefined(r.columnKey)?{anchorValue:s,groupValue:K(r.columnKey)}:null:{anchorValue:s,groupValue:void 0}},ye=(e,r,t)=>!o.isDefined(e.rowIndex)||!t.hasVariable(r)?null:t.getValues(r)[e.rowIndex]??null;function me({palette:e,overrides:r,ctx:t}){const i=X(e,r,t);if(i!==void 0)return{type:"styles",defaults:[o.style.geom.bar({color:i}),o.style.geom.line({color:i}),o.style.geom.area({color:i}),o.style.geom.point({color:i})]}}function be(e,r,t=void 0){const i=[...e?.defaults??[],...r??[]],n=[...e?.overrides??[],...t??[]];if(!(e===void 0&&i.length===0&&n.length===0))return{...e,type:"styles",defaults:i,...n.length===0?{}:{overrides:n}}}function he(e,r){return r===void 0?e:{...e,type:"styles",tokens:{...e?.tokens,...r}}}function ge(e){return e?.highlightStyle===void 0?[]:e.highlightStyle==="grey"?[o.style.geom({saturation:0,alpha:.6},{state:"dimmed"})]:[o.style.geom({alpha:o.DEFAULT_DIMMED_ALPHA},{state:"dimmed"})]}function X(e,r,t){const i=e.type==="custom"?t.customPalettes?.[e.id]:void 0,n=r?.[1];if(n?.hex!==void 0)return n.hex;if(n?.id!==void 0){const s=i?.find(a=>a.id===n.id)?.hex;if(s!==void 0)return s}if(e.type!=="default")return e.type==="custom"?i?.[0]?.hex:o.resolvePaletteRange(e)[0]}var Se=["lilac","neon_pink","blackberry","sun","iceland","sunset","ultraviolet","purple","ice_cream","mint","cool","fresh"],Ee="#E5E5E5",P=.1,F={light:.05,dark:.1},Ae={lilac:"#C9C0F7",neon_pink:"#E04A95",blackberry:"#9F9FED",sun:"#FCDB61",iceland:"#29CDA8",sunset:"#FCDB62",ultraviolet:"#D167D8",purple:"#BBADFD",ice_cream:"#FC7E91",mint:"#25CDA5",cool:"#3F8EEB",fresh:"#A4A4EE"};function ke({appearance:e,themeOverrides:r,palette:t,overrides:i,ctx:n}){const s=X(t,i,n)??o.DEFAULT_GEOM_COLOR,a=[],c=Le(e?.border,s),l=Te(e,r,s),u={...l===void 0?{}:{background:l},...c,...e?.hasRoundedCorners===!1?{borderRadius:0}:{}};Object.keys(u).length>0&&a.push(o.style.graph(u));const p=r?.gridLineColor;return typeof p=="string"&&a.push(o.style.gridLine({color:p}),o.style.tickLine({color:p}),o.style.panelBorder({color:p})),a}function Te(e,r,t){if(e?.backgroundModifier==="tint")return{light:C(o.DEFAULT_GRAPH_BACKGROUND.light,t,F.light),dark:C(o.DEFAULT_GRAPH_BACKGROUND.dark,t,F.dark)};const i=r?.graphBackground;return typeof i=="string"?i:void 0}function Le(e,r){if(!e?.style)return{};if(e.style==="none")return{borderWidth:0};const t=e.width??0;if(e.style==="grey")return{borderColor:Ee,borderWidth:t};if(e.style==="preset")return e.color===void 0||!_e(e.color)?{}:{borderColor:Ae[e.color],borderWidth:t};if(e.style==="custom")return e.color===void 0?{}:{borderColor:e.color,borderWidth:t};const i=e.color??r;return e.style==="tinted"?{borderColor:{light:Ne(i,P),dark:Ve(i,P)},borderWidth:t}:{borderColor:i,borderWidth:t}}var _e=e=>Se.includes(e),C=(e,r,t)=>`color-mix(in srgb, ${e}, ${r} ${t*100}%)`,Ne=(e,r)=>`hsl(from ${e} h s calc(l * ${1+r}))`,Ve=(e,r)=>`hsl(from ${e} h s calc(l * ${1-r}))`,De={x:"top",y:"left"},xe=new Set(["pie","donut"]);function Re(e,r=!1,t){return o.config({legend:Pe(e.legend,t?.legend),axes:Ce(e.axes,r,t?.axes),headline:Be(e),numberFormat:Ie(e.appearance),content:He(e.content),appearance:we(e.appearance)}).config}function we(e){if(e?.textScale!==void 0)return{textScale:e.textScale}}function Pe(e,r){if(!(!e&&!r))return{...e?{position:e.position}:void 0,...r}}function B(e,r,t){return!r&&t===void 0?{}:{...r?.isHidden!==void 0?{isVisible:!r.isHidden}:void 0,...r?.label!==void 0?{label:r.label}:void 0,...r?.isReversed?{position:De[e]}:void 0,...r?.tickDisplayMode?{ticks:{mode:r.tickDisplayMode}}:void 0,...t!==void 0?{grid:{isVisible:t}}:void 0}}function Fe(e){return{...e.label!==void 0?{label:e.label}:void 0}}function Ce(e,r=!1,t){if(!e&&!t)return;const i=B("x",e?.x,e?.showGridLines),n=B("y",e?.y,e?.showGridLines);return{x:{...r?n:i,...t?.x},y:{...r?i:n,...t?.y},...e?.y2?{ySecondary:Fe(e.y2)}:void 0}}function Be(e){const{headlineNumbers:r,options:t,type:i}=e,n=i!==void 0&&xe.has(i)?t?.pieTotalPosition:void 0;if(r===void 0&&n===void 0)return;const s={};return r?.show!==void 0&&(s.show=r.show),r?.compareWith!==void 0&&(s.compareWith=r.compareWith),r?.size!==void 0&&(s.size=r.size),n!==void 0&&(s.show="total",s.position=n==="center"?"center":"above"),s}function Ie(e){if(e?.numberFormat)return{decimals:e.numberFormat.decimalPlaces,abbreviation:e.numberFormat.abbreviation}}function He(e){if(!e)return;const r={};e.title!==void 0&&(r.title=e.title),e.isTitleHidden!==void 0&&(r.isTitleVisible=!e.isTitleHidden),e.subtitle!==void 0&&(r.subtitle=e.subtitle),e.isSubtitleHidden!==void 0&&(r.isSubtitleVisible=!e.isSubtitleHidden),e.caption!==void 0&&(r.caption=e.caption),e.isCaptionHidden!==void 0&&(r.isCaptionVisible=!e.isCaptionHidden);const t=Oe(e.source);return t!==void 0&&(r.source=t),e.isSourceHidden!==void 0&&(r.isSourceVisible=!e.isSourceHidden),e.brandMark!==void 0&&(r.brandMark={...e.brandMark},e.brandMark.enabled!==void 0&&(r.isBrandMarkVisible=e.brandMark.enabled)),e.isBrandMarkHidden!==void 0&&e.brandMark?.enabled===void 0&&(r.isBrandMarkVisible=!e.isBrandMarkHidden),r}function Oe(e){if(!e)return;const r={};return e.label!==void 0&&(r.label=e.label),e.url!==void 0&&(r.url=e.url),Object.keys(r).length===0?void 0:r}var D=o.prefixInternalVariable("constantY"),Ue=.15,Me=(e,r,t,i)=>je[r](e,t,i),x=e=>{const r=o.inferXVariable(e),{numeric:t}=e.groupVariableNamesByType(),i=t.filter(n=>n!==r);return i.length<=1?{transforms:[],mapping:{x:r,y:i[0]??""},seriesVariables:i}:{transforms:[o.transform.reshape({keep:[r],keyName:"key",valueName:o.DEFAULT_RESHAPE_VALUE_NAME})],mapping:{x:r,y:o.DEFAULT_RESHAPE_VALUE_NAME,color:"key"},seriesVariables:i}},R=e=>{const r=e.appearance?.seriesStyles;if(!r||e.seriesVariables.length===0)return{mapping:{},scales:[]};if(!e.seriesVariables.some(i=>o.isDefined(r[i]?.lineStyle)))return{mapping:{},scales:[]};if(e.seriesVariables.length===1){const i=e.seriesVariables[0];if(!i)return{mapping:{},scales:[]};const n=r[i]?.lineStyle;return n?{mapping:{lineType:{value:n}},scales:[]}:{mapping:{},scales:[]}}const t=e.seriesVariables.map(i=>r[i]?.lineStyle??"solid");return{mapping:{lineType:"key"},scales:[o.scale.lineType.discrete({domain:e.seriesVariables,range:t})]}},We=e=>{const{categorical:r,temporal:t,numeric:i}=e.groupVariableNamesByType(),n=i[0];if(!o.isDefined(n))throw new o.UserInputError({code:"INVALID_DATA_SHAPE",message:"No first numeric variable found",suggestion:"Provide at least one numeric column for this chart type."});const s=i.slice(1);return s.length===0?{...$(),mapping:{x:n,y:D,label:r[0]}}:s.length===1?{transforms:[],scales:[],mapping:{x:n,y:s[0]??"",label:r[0]}}:{transforms:[o.transform.reshape({keep:[n,...r,...t],keyName:"key",valueName:o.DEFAULT_RESHAPE_VALUE_NAME})],scales:[],mapping:{x:n,y:o.DEFAULT_RESHAPE_VALUE_NAME,label:r[0],color:"key"}}},$=()=>({transforms:[o.transform.constant({variableName:D,type:"categorical",value:""})],scales:[o.scale.y.discrete()]}),Ge=e=>{const{categorical:r,temporal:t,numeric:i}=e.groupVariableNamesByType();let n,s;if(o.isDefined(r[0])&&o.isDefined(i[0]))n=r[0],s=i[0];else if(o.isDefined(t[0])&&o.isDefined(i[0]))n=t[0],s=i[0];else if(o.isDefined(i[0])&&o.isDefined(i[1]))n=i[0],s=i[1];else throw new o.UserInputError({code:"INVALID_DATA_SHAPE",message:"No label or value variable found",suggestion:"Provide a label column and a numeric value column for this chart type."});return{x:"",y:s,color:n}},j=(e,r,t)=>{const{transforms:i,mapping:n,seriesVariables:s}=x(e.dataset),a=R({appearance:t,seriesVariables:s}),c=s.length<=1,l=[o.geom.line({params:{interpolate:r?.isSmoothLine?"catmull-rom":"linear",missingValues:r?.missingValues}})],u=[];return c&&(r?.showFill??!0)&&u.push(o.style.geom.line({fillAlpha:Ue})),typeof r?.lineThickness=="number"&&u.push(o.style.geom.line({strokeWidth:r.lineThickness})),r?.showPoints&&(l.push(o.geom.point({interactive:!1})),typeof r.pointSize=="number"&&u.push(o.style.geom.point({size:r.pointSize}))),{layers:l,coords:o.coord.cartesian(),mapping:{...n,...a.mapping},scales:a.scales,transforms:i,seriesVariables:s,styleDefaults:u}},Ye=(e,r,t)=>{const{transforms:i,mapping:n,seriesVariables:s}=x(e.dataset),a=R({appearance:t,seriesVariables:s}),c=[o.geom.area({position:"stack",params:{interpolate:r?.isSmoothLine?"catmull-rom":"linear",missingValues:r?.missingValues}})],l=[];return typeof r?.lineThickness=="number"&&l.push(o.style.geom.area({strokeWidth:r.lineThickness})),r?.showPoints&&(c.push(o.geom.point({position:"stack",interactive:!1})),typeof r.pointSize=="number"&&l.push(o.style.geom.point({size:r.pointSize}))),{layers:c,coords:o.coord.cartesian(),mapping:{...n,...a.mapping},scales:a.scales,transforms:i,seriesVariables:s,styleDefaults:l}},h=(e,r,t,i,n)=>{const{transforms:s,mapping:a,seriesVariables:c}=x(e.dataset),l=[...s];if(i?.sortBars){const u=o.extractVariableName(a.y);u!==null&&u!==""&&l.push(o.transform.sort({variableName:u,direction:"desc"}))}if(!n?.useSingleColorForBars){const u=o.inferXVariable(e.dataset),{numeric:p}=e.dataset.groupVariableNamesByType();p.filter(f=>f!==u).length===1&&e.dataset.getType(u)==="categorical"&&(a.color=u)}return{layers:[o.geom.bar({position:r})],coords:t,mapping:a,scales:[],transforms:l,seriesVariables:c}},I=(e,r)=>({layers:[o.geom.bar({position:"fill"})],coords:o.coord.polar({theta:"y",innerRadius:r==="donut"?.55:0}),mapping:Ge(e.dataset),scales:[],seriesVariables:[]}),ze=e=>{const{transforms:r,scales:t,mapping:i}=We(e.dataset);return{layers:[o.geom.point()],coords:o.coord.cartesian(),mapping:i,scales:t,transforms:r,seriesVariables:[]}},Ke=e=>{const{numeric:r,categorical:t}=e.dataset.groupVariableNamesByType(),i=r[0];if(!o.isDefined(i))throw new o.UserInputError({code:"INVALID_DATA_SHAPE",message:"No first numeric variable found",suggestion:"Provide at least one numeric column for this chart type."});const n=o.isDefined(r[1])?{transforms:[],scales:[]}:$(),s={x:i,y:r[1]??D,size:r[2],label:t[0]},a=[...n.scales];return o.isDefined(s.size)&&a.push(o.scale.size.continuous()),{layers:[o.geom.point()],coords:o.coord.cartesian(),mapping:s,scales:a,transforms:n.transforms,seriesVariables:[]}},Xe=e=>{const r=o.inferXVariable(e.dataset),{numeric:t}=e.dataset.groupVariableNamesByType(),i=t.filter(n=>n!==r);return{transforms:[o.transform.reshape({keep:[r],keyName:"key",valueName:o.DEFAULT_RESHAPE_VALUE_NAME}),o.transform.filter({variableName:o.DEFAULT_RESHAPE_VALUE_NAME,operator:"neq",value:null})],layers:[o.geom.tile()],coords:o.coord.cartesian(),mapping:{x:r,y:"key",color:o.DEFAULT_RESHAPE_VALUE_NAME},scales:[o.scale.color.continuous()],seriesVariables:i,config:{legend:{position:"none"},axes:{x:{position:"top"},y:{position:"left"}}}}},T=(e,r,t)=>{const i=t?.seriesStyles?.[e]?.lineStyle;return o.geom.line({transforms:[o.transform.constant({variableName:o.LAYER_LABEL_VARIABLES.line,type:"categorical",value:e})],aes:{y:e,color:o.LAYER_LABEL_VARIABLES.line,...i?{lineType:{value:i}}:{}},...r?{yScaleType:"secondary"}:void 0})},$e=(e,r,t)=>{const{numeric:i}=e.dataset.groupVariableNamesByType(),n=o.inferXVariable(e.dataset),s=o.readFoldKeepVariables(e.dataset,n),a=i.filter(d=>d!==n),c=o.COMBO_BAR_POSITIONS[r?.comboType??"grouped-bars"],l=c===null;if(a.length===1)return l?j(e,r,t):h(e,"dodge",o.coord.cartesian(),r,t);const u=e.axes?.hasDualYAxis===!0,p=l?[]:a.slice(0,-1),f=l?a:a.slice(-1),y=[],m=[];if(c!==null&&p.length>0){const d=p.length===1?p[0]:null;o.isDefined(d)?y.push(o.geom.bar({transforms:[o.transform.constant({variableName:o.LAYER_LABEL_VARIABLES.bar,type:"categorical",value:d})],aes:{y:d,color:o.LAYER_LABEL_VARIABLES.bar},position:c})):y.push(o.geom.bar({transforms:[o.transform.reshape({keep:s,reshape:p,keyName:"key",valueName:o.DEFAULT_RESHAPE_VALUE_NAME})],aes:{y:o.DEFAULT_RESHAPE_VALUE_NAME,color:"key"},position:c}))}if(l&&f.length>=2){const d=u?f.slice(0,-1):f,w=d.length===1?d[0]:null;if(o.isDefined(w))y.push(T(w,!1,t));else{const g=R({appearance:t,seriesVariables:d});y.push(o.geom.line({transforms:[o.transform.reshape({keep:s,reshape:d,keyName:"key",valueName:o.DEFAULT_RESHAPE_VALUE_NAME})],aes:{y:o.DEFAULT_RESHAPE_VALUE_NAME,color:"key",...g.mapping}})),m.push(...g.scales)}if(u){const g=f[f.length-1];o.isDefined(g)&&y.push(T(g,!0,t))}}else for(const d of f)y.push(T(d,u,t));return{layers:y,coords:o.coord.cartesian(),mapping:{x:n},scales:m,seriesVariables:a}},E=e=>()=>{throw new o.UserInputError({code:"UNSUPPORTED_GRAPH_TYPE",message:`Unsupported graph type: ${e}`,context:{requested:e}})},je={line:(e,r,t)=>j(e,r,t),areaStacked:(e,r,t)=>Ye(e,r,t),bar:(e,r,t)=>h(e,"dodge",o.coord.flip(),r,t),barStacked:(e,r,t)=>h(e,"stack",o.coord.flip(),r,t),barStackedFill:(e,r,t)=>h(e,"fill",o.coord.flip(),r,t),column:(e,r,t)=>h(e,"dodge",o.coord.cartesian(),r,t),columnStacked:(e,r,t)=>h(e,"stack",o.coord.cartesian(),r,t),columnStackedFill:(e,r,t)=>h(e,"fill",o.coord.cartesian(),r,t),pie:e=>I(e,"pie"),donut:e=>I(e,"donut"),scatter:e=>ze(e),bubble:e=>Ke(e),combo:(e,r,t)=>$e(e,r,t),funnel:E("funnel"),heatmap:e=>Xe(e),waterfall:E("waterfall"),mekko:E("mekko"),table:E("table")},qe=new o.TransformRegistry,Ze=["key",o.prefixInternalVariable("lineSeriesLabel"),o.prefixInternalVariable("barSeriesLabel")];function Je(e){const r=e.annotations??[],t=er(e.mapping),i=tr(e.dataset,e.transforms,e.layers),n=[];for(const s of r){if(s.type!=="highlight")continue;const a=rr({annotation:s,rowIdentityVariable:t,dataset:e.dataset,compiledVariableNames:i});a!==null&&n.push({type:"highlight",id:s.id,predicate:a,scope:Qe(s.highlight,e.mapping)})}return n}function Qe(e,r){const t=o.extractVariableName(r.x);return!(t!==null&&t!=="")&&e==="x-value"?"series":e}function er(e){const r=o.extractVariableName(e.x);return r!==null&&r!==""?r:o.extractVariableName(e.color)}function rr({annotation:e,rowIdentityVariable:r,dataset:t,compiledVariableNames:i}){switch(e.highlight){case"x-value":return H(e,r,t);case"series":return O(e,i);case"data-point":{const n=H(e,r,t),s=O(e,i);return n===null&&s===null?null:n===null?s:s===null?n:{and:[n,s]}}}}function H(e,r,t){if(r===null)return null;const i=or(e,r,t);return i===null?null:{variable:r,eq:i}}function O(e,r){const t=e.columnKey;if(!o.isDefined(t))return null;const i=Ze.filter(n=>r.includes(n));return i.length===0?null:{or:i.map(n=>({variable:n,eq:t}))}}function tr(e,r,t){const i=[...e.getVariableNames()],n=s=>{for(const a of s){const{getIntroducedVariables:c}=qe.get(a.transformType),l=c?.(a);l&&i.push(...l)}};n(r);for(const s of t)n(s.transforms??[]);return i}function or(e,r,t){return e.rowValue!==void 0?e.rowValue:!o.isDefined(e.rowIndex)||!t.getVariableNames().includes(r)?null:t.getValues(r)[e.rowIndex]??null}function ir(e,r,t){const{colorScheme:i,customPalettes:n}=t;if(n&&e&&n[e])return{type:"custom",id:e};if(e?.startsWith("preset:pastel"))return{type:"pastel",variant:L(r)};if(e?.startsWith("preset:graphy"))return{type:"graphy",variant:L(r)};if(e?.startsWith("preset:mono:")){const s=e.slice(12);if(nr(s))return{type:"mono",base:s,variant:i}}if(e?.startsWith("preset:neon:")){const s=e.slice(12);if(sr(s))return{type:"neon",base:s,variant:L(r)}}return{type:"default"}}function L(e){if(e==="waterfall")return"waterfall"}function nr(e){return o.MONO_BASES.includes(e)}function sr(e){return o.NEON_BASES.includes(e)}function ar({axes:e,palette:r,overrides:t,isFlipped:i}){const n=[];return n.push(U("x",i?e?.y:e?.x)),n.push(U("y",i?e?.x:e?.y)),n.push(o.scale.color.palette({palette:r,overrides:t})),n}function U(e,r){return r?.scaleType==="logarithmic"||r?.min!==void 0||r?.max!==void 0?r.scaleType==="logarithmic"?o.scale[e].log({domainMin:r.min??void 0,domainMax:r.max??void 0}):o.scale[e]({domainMin:r.min??void 0,domainMax:r.max??void 0}):o.scale[e]()}function lr(e){if(!e)return;const r={};for(const[t,i]of Object.entries(e)){if(!t.startsWith("series"))continue;const n=Number.parseInt(t.slice(6));if(Number.isNaN(n))continue;const s={hex:i.customColor,id:i.paletteColorId};(s.hex!==void 0||s.id!==void 0)&&(r[n]=s)}return Object.keys(r).length>0?r:void 0}function cr(e){const r=[],t=b(e?.fontAxisLabel);t!==void 0&&r.push(o.style.axisLabel(t));const i=mr(e);i!==void 0&&r.push(o.style.tickLabel(i));const n=b(e?.fontGoalLineLabel);return n!==void 0&&r.push(o.style.geom.rule.label(n)),r.push(...pr(e)),r.push(...ur(e)),r.push(...vr(e)),r}function ur(e){const r=[],t=fr(e);t!==void 0&&r.push(o.style.tooltip(t));const i=A(b(e?.fontTooltipHeading),v(e?.tooltipHeadingTextColor));i!==void 0&&r.push(o.style.tooltip.heading(i));const n=b(e?.fontTooltipLabel),s=A(n,v(e?.tooltipLabelTextColor));s!==void 0&&r.push(o.style.tooltip.label(s));const a=A(n,v(e?.tooltipValueTextColor));a!==void 0&&r.push(o.style.tooltip.value(a));const c=v(e?.tooltipPrimaryRowColor);c!==void 0&&r.push(o.style.tooltip.primaryRow({background:c}));const l=dr(e);return l!==void 0&&r.push(o.style.annotation.pinnedNumber.label(l),o.style.annotation.comment.label(l)),r}var dr=e=>{const r=v(e?.tooltipBackground),t=v(e?.tooltipBorderColor),i={...A(b(e?.fontMiniTooltipLabel),v(e?.tooltipValueTextColor)),...r===void 0?{}:{background:r},...t===void 0?{}:{borderColor:t}};return Object.keys(i).length===0?void 0:i},fr=e=>{const r=v(e?.tooltipBackground),t=v(e?.tooltipBorderColor),i=S(e?.tooltipBorderWidth),n=S(e?.tooltipBorderRadius),s=S(e?.tooltipPaddingBlock),a=S(e?.tooltipPaddingInline),c=typeof e?.tooltipShadow=="string"?yr(e.tooltipShadow)??void 0:void 0,l={...r===void 0?{}:{background:r},...t===void 0?{}:{borderColor:t},...i===void 0?{}:{borderWidth:i},...n===void 0?{}:{borderRadius:n},...s===void 0?{}:{paddingBlock:s},...a===void 0?{}:{paddingInline:a},...c===void 0?{}:{shadow:c}};return Object.keys(l).length===0?void 0:l},A=(e,r)=>{if(!(e===void 0&&r===void 0))return{...e,...r===void 0?{}:{textColor:r}}};function pr(e){const r=v(e?.dataLabelTextColor),t=v(e?.stackTotalTextColor),i=[["observation",b(e?.fontDataLabel),r],["category",b(e?.fontCategoryLabel),r],["aggregate",b(e?.fontStackTotal),t]],n=[];for(const[u,p,f]of i)p===void 0&&f===void 0||n.push(o.style.dataLabel[u]({...p,...f===void 0?{}:{textColor:f}}));const s=v(e?.dataLabelInsideTextColor);s!==void 0&&(n.push(o.style.dataLabel.observation.inside({textColor:s})),n.push(o.style.dataLabel.category.inside({textColor:s})));const a=v(e?.dataLabelOutsideBackground);a!==void 0&&(n.push(o.style.dataLabel.observation.outside({background:a})),n.push(o.style.dataLabel.category.outside({background:a})));const c=v(e?.stackTotalBackground),l=v(e?.stackTotalStroke);return(c!==void 0||l!==void 0)&&n.push(o.style.dataLabel.aggregate({...c===void 0?{}:{background:c},...l===void 0?{}:{borderColor:l}})),n}function vr(e){const r=[],t=v(e?.trendPositiveColor),i=v(e?.trendNegativeColor),n=v(e?.trendNeutralColor);return t!==void 0&&r.push(o.style.headlineItem.trend.up({textColor:t})),i!==void 0&&r.push(o.style.headlineItem.trend.down({textColor:i})),n!==void 0&&r.push(o.style.headlineItem.trend.flat({textColor:n})),r}function v(e){if(!(typeof e!="string"||e.trim().length===0))return e}function yr(e){const r=e.trim();if(r==="none")return"none";const t=r.split(/\s+/),i=_(t[0]),n=_(t[1]),s=_(t[2]),a=t.slice(3).join(" ");return i===null||n===null||s===null||a.length===0?null:{offsetX:i,offsetY:n,blur:s,color:a}}var _=e=>{if(e===void 0)return null;const r=/^(-?\d*\.?\d+)(px)?$/.exec(e);if(r?.[1]===void 0)return null;const t=Number.parseFloat(r[1]);return Number.isFinite(t)?t:null};function b(e){if(typeof e!="string")return;const r=z(e);if(r!==null)return{fontFamily:r.family,fontSize:V(r.size),fontWeight:r.weight,...r.lineHeight===void 0?{}:{lineHeight:r.lineHeight}}}function mr(e){const r=b(e?.fontTickLabel),t=S(e?.tickLabelOffset);if(!(r===void 0&&t===void 0))return{...r,...t===void 0?{}:{offset:t}}}function S(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(typeof e!="string")return;const r=N(e);return r===null?void 0:V(r)}var br=new Set(["column","columnStacked","columnStackedFill","bar","barStacked","barStackedFill","line","areaStacked","scatter","bubble","funnel","combo"]),hr=new Set(["column","columnStacked","columnStackedFill","bar","barStacked","barStackedFill","line","areaStacked","combo"]);function gr(e,r,t={}){return Sr(o.parseDataset(r),e,t)}function Sr(e,r,t={}){const i=r.type??"column",n=Me({dataset:e,axes:r.axes},i,r.options??void 0,r.appearance??void 0),s=n.coords.coordType==="flip",a=n.transforms??[],c=ir(r.appearance?.paletteId,i,t),l=lr(r.appearance?.seriesStyles);return{mapping:n.mapping,layers:Er(i,r,n.layers,n.coords,n.mapping,n.seriesVariables),scales:[...ar({axes:r.axes,palette:c,overrides:l,isFlipped:s}),...n.scales],styles:he(be(me({palette:c,overrides:l,ctx:t}),[...n.styleDefaults??[],...ge(r.appearance??void 0),...ke({appearance:r.appearance??void 0,themeOverrides:r.themeOverrides,palette:c,overrides:l,ctx:t}),...cr(r.themeOverrides),...oe(r.themeOverrides)],te(r.annotations)),ie(r.themeOverrides)),transforms:a,highlights:Je({annotations:r.annotations,dataset:e,mapping:n.mapping,transforms:a,layers:n.layers}),annotations:se({annotations:r.annotations,dataset:e,mapping:n.mapping,seriesVariables:n.seriesVariables}),coords:n.coords,config:Re(r,s,n.config)}}function Er(e,r,t,i,n,s){const a=_r(r.dataLabels),c=a===void 0?t:t.filter(u=>u.interactive!==!1).map(u=>({...u,dataLabels:{...a,...u.dataLabels}})),l=r.axes?.hasDualYAxis??!1;return[...c,...Ar({type:e,trendline:r.referenceLines?.trendline,coords:i}),...kr({type:e,hasDualYAxis:l,goalLine:r.referenceLines?.goalLine,coords:i}),...Lr({type:e,hasDualYAxis:l,averageLine:r.referenceLines?.averageLine,coords:i,mapping:n,seriesVariables:s})]}function Ar({type:e,trendline:r,coords:t}){return r===void 0?[]:br.has(e)?t.coordType==="polar"?[]:[o.geom.line({aes:{lineType:{value:"dashed"}},stat:o.stat.smooth({method:r}),interactive:!1})]:[]}function kr({type:e,hasDualYAxis:r,goalLine:t,coords:i}){if(!Tr(t))return[];if(i.coordType==="polar")return[];const n=i.coordType==="flip"?"end":"start";return[o.geom.rule({aes:{y:{value:t.target}},params:{labelPosition:n,label:t.label??"Goal"},yScaleType:e==="combo"&&r?"secondary":"primary",interactive:!1})]}function Tr(e){return e!==void 0&&Number.isFinite(e.target)}function Lr({type:e,hasDualYAxis:r,averageLine:t,coords:i,mapping:n,seriesVariables:s}){if(t===void 0)return[];if(!hr.has(e))return[];if(i.coordType==="polar")return[];const a=K(t.columnKey);if(!s.includes(a))return[];const c=n.color==="key",l=c?o.DEFAULT_RESHAPE_VALUE_NAME:a,u=c?[o.transform.filter({variableName:"key",operator:"eq",value:a})]:[];return[o.geom.rule({aes:{y:l,color:void 0,group:void 0,lineType:void 0},stat:o.stat.mean(),transforms:u,params:{label:"Average",labelPosition:i.coordType==="flip"?"end":"start"},yScaleType:e==="combo"&&r?"secondary":"primary",interactive:!1})]}function _r(e){if(!e)return;const r={};return e.showDataLabels!==void 0&&(r.showDataLabels=e.showDataLabels),e.dataLabelFormat!==void 0&&(r.format=e.dataLabelFormat),e.showStackTotals!==void 0&&(r.showStackTotals=e.showStackTotals),e.showCategoryLabels!==void 0&&(r.showCategoryLabels=e.showCategoryLabels),Object.keys(r).length===0?void 0:r}var Nr=[.8,1,1.2,1.4,1.6,1.8,2,2.5,3,4];exports.CHART_TEXT_SCALES=Nr;exports.ROOT_FONT_SIZE_PX=q;exports.convertGraphConfig=gr;exports.isFontStyle=W;exports.parseFontLength=N;exports.parseFontShorthand=z;exports.parseFontWeight=G;exports.parseUnitlessLineHeight=Y;exports.toPixels=V;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./config.types-EgbTT8QQ.cjs");var q=10,Z=["normal","italic","oblique"],J=/^(\d*\.?\d+)(px|em)$/,W=/^\d*\.?\d+$/,Q=1,ee=1e3,re={normal:400,bold:700},O=e=>Z.includes(e),N=e=>{const r=J.exec(e.trim());return r===null||r[1]===void 0||r[2]===void 0?null:{value:Number.parseFloat(r[1]),unit:r[2]==="px"?"px":"em"}},G=e=>{const r=e.trim(),t=re[r];if(t!==void 0)return t;if(!W.test(r))return null;const i=Number.parseFloat(r);return i>=Q&&i<=ee?i:null},z=e=>{const r=e.trim();return W.test(r)?Number.parseFloat(r):null},V=e=>e.unit==="em"?e.value*10:e.value,Y=e=>{const r=e.trim().replace(/\s*\/\s*/g,"/").split(/\s+/);let t="normal",i=400,n=0;for(;n<r.length;){const f=r[n];if(f===void 0)return null;if(f==="normal")n++;else if(O(f))t=f,n++;else{const y=G(f);if(y===null)break;i=y,n++}}const s=r[n];if(s===void 0)return null;const[a="",l]=s.split("/"),c=N(a);if(c===null)return null;const u=l===void 0?null:z(l),v=r.slice(n+1).join(" ").trim();return v===""?null:{style:t,weight:i,size:c,family:v,...u!==null?{lineHeight:u}:{}}};function te(e){const r=[];for(const t of e??[]){if(t.type==="shape"&&r.push(o.style.annotation.shape({color:t.fillColor,alpha:t.fillOpacity,borderWidth:t.strokeWidth},{annotation:t.id})),t.type==="arrow"&&r.push(o.style.annotation.arrow({...t.color===void 0?{}:{color:t.color},strokeWidth:o.ARROW_STROKE_WIDTHS[t.thickness],lineType:t.lineStyle,...t.hasStickerStyle?o.ARROW_STICKER_DECLARATIONS:{}},{annotation:t.id})),t.type==="difference-arrow"){const i=o.DIFFERENCE_ARROW_SIZE_DECLARATIONS[t.size];r.push(o.style.annotation.differenceArrow({...t.color===void 0?{}:{color:t.color},...i.arrow},{annotation:t.id}),o.style.annotation.differenceArrow.label(i.label,{annotation:t.id}))}t.type==="text"&&t.backgroundColor!==void 0&&r.push(o.style.annotation.text({background:t.backgroundColor,...t.backgroundColorStyle==="fade"?{alpha:o.TEXT_ANNOTATION_FADE_ALPHA}:{}},{annotation:t.id})),t.type==="image"&&t.opacity!==void 0&&r.push(o.style.annotation.image({alpha:t.opacity},{annotation:t.id}))}return r}function oe(e){const r=[],t=e?.defaultAnnotationShapeFill;return typeof t=="string"&&r.push(o.style.annotation.shape({color:t})),r}function ie(e){const r=e?.defaultAnnotationArrowStroke;return typeof r=="string"?{annotationArrowColor:r}:void 0}var ne="#%_ENCODED_%#",K=e=>{if(!e.startsWith(ne))return e;try{const{value:r}=JSON.parse(e.slice(13));return typeof r=="string"?r:e}catch{return e}},se=({annotations:e,dataset:r,mapping:t,seriesVariables:i})=>{const n=[],s=[],a=[],l=[],c=[],u=[],v=[],f=[],y={dataset:r,...ae(t,i)};for(const b of e??[])switch(b.type){case"difference-arrow":{const d=le(b,y);d!==null&&n.push(d);break}case"shape":s.push(ce(b));break;case"arrow":a.push(ve(b));break;case"highlight":break;case"text":l.push(de(b));break;case"image":c.push(ue(b));break;case"sticker":{const d=fe(b,y);d!==null&&u.push(d);break}case"tooltip":{const d=pe(b,y);if(d===null)break;d.kind==="pinnedNumber"?v.push(d.value):f.push(d.value);break}default:throw new o.InternalError({message:`Unsupported annotation type: ${b.type}`})}return{differenceArrows:n,shapes:s,arrows:a,textAnnotations:l,images:c,stickers:u,pinnedNumbers:v,comments:f}},ae=(e,r)=>{const t=o.extractVariableName(e.x),i=o.extractVariableName(e.group)??o.extractVariableName(e.color),n=t!==null&&t!=="",s=i==="key"||r.length>=2;return{anchorVariable:n?t:i,groupIsSeriesKey:s}},le=(e,r)=>{const t=k(r,e.start),i=k(r,e.end);return t===null||i===null?null:{id:e.id,start:t,end:i,label:e.show,labelCrossPosition:e.labelPosition}},ce=e=>({id:e.id,kind:e.shape,zOrder:e.layer==="abovePlot"?"foreground":"background",region:{anchorType:"panel",x:e.x,y:e.y,width:e.width,height:e.height}}),ue=e=>({id:e.id,src:e.src,zOrder:e.layer==="abovePlot"?"foreground":"background",region:{anchorType:"panel",x:e.x,y:e.y,width:e.width,height:e.height},fit:e.fit}),de=e=>({id:e.id,content:e.content,at:{anchorType:"panel",x:e.x,y:e.y},width:e.width,align:"top-left"}),fe=(e,r)=>{const t=k(r,e);return t===null?null:{id:e.id,at:{anchorType:"observation",...t},sticker:e.sticker}},pe=(e,r)=>{const t=k(r,e);return t===null?null:e.caption===null||e.caption===void 0?{kind:"pinnedNumber",value:{id:e.id,at:t}}:{kind:"comment",value:{id:e.id,at:t,content:e.caption}}},ve=e=>({id:e.id,start:{anchorType:"panel",x:e.startX,y:e.startY},end:{anchorType:"panel",x:e.endX,y:e.endY},startArrowheadStyle:e.startArrowheadStyle,endArrowheadStyle:e.endArrowheadStyle}),k=(e,r)=>{if(!o.isDefined(r))return null;const{dataset:t,anchorVariable:i,groupIsSeriesKey:n}=e;if(i===null)return null;const s=ye(r,i,t);return s===null?null:n?o.isDefined(r.columnKey)?{anchorValue:s,groupValue:K(r.columnKey)}:null:{anchorValue:s,groupValue:void 0}},ye=(e,r,t)=>!o.isDefined(e.rowIndex)||!t.hasVariable(r)?null:t.getValues(r)[e.rowIndex]??null;function be({palette:e,overrides:r,ctx:t}){const i=X(e,r,t);if(i!==void 0)return{type:"styles",defaults:[o.style.geom.bar({color:i}),o.style.geom.line({color:i}),o.style.geom.area({color:i}),o.style.geom.point({color:i})]}}function me(e,r,t=void 0){const i=[...e?.defaults??[],...r??[]],n=[...e?.overrides??[],...t??[]];if(!(e===void 0&&i.length===0&&n.length===0))return{...e,type:"styles",defaults:i,...n.length===0?{}:{overrides:n}}}function he(e,r){return r===void 0?e:{...e,type:"styles",tokens:{...e?.tokens,...r}}}function ge(e){return e?.highlightStyle===void 0?[]:e.highlightStyle==="grey"?[o.style.geom({saturation:0,alpha:.6},{state:"dimmed"})]:[o.style.geom({alpha:o.DEFAULT_DIMMED_ALPHA},{state:"dimmed"})]}function X(e,r,t){const i=e.type==="custom"?t.customPalettes?.[e.id]:void 0,n=r?.[1];if(n?.hex!==void 0)return n.hex;if(n?.id!==void 0){const s=i?.find(a=>a.id===n.id)?.hex;if(s!==void 0)return s}if(e.type!=="default")return e.type==="custom"?i?.[0]?.hex:o.resolvePaletteRange(e)[0]}var Se=["lilac","neon_pink","blackberry","sun","iceland","sunset","ultraviolet","purple","ice_cream","mint","cool","fresh"],Ee="#E5E5E5",P=.1,C={light:.05,dark:.1},Ae={lilac:"#C9C0F7",neon_pink:"#E04A95",blackberry:"#9F9FED",sun:"#FCDB61",iceland:"#29CDA8",sunset:"#FCDB62",ultraviolet:"#D167D8",purple:"#BBADFD",ice_cream:"#FC7E91",mint:"#25CDA5",cool:"#3F8EEB",fresh:"#A4A4EE"};function ke({appearance:e,themeOverrides:r,palette:t,overrides:i,ctx:n}){const s=X(t,i,n)??o.DEFAULT_GEOM_COLOR,a=[],l=Le(e?.border,s),c=Te(e,r,s),u={...c===void 0?{}:{background:c},...l,...e?.hasRoundedCorners===!1?{borderRadius:0}:{}};Object.keys(u).length>0&&a.push(o.style.graph(u));const v=r?.gridLineColor;return typeof v=="string"&&a.push(o.style.gridLine({color:v}),o.style.tickLine({color:v}),o.style.panelBorder({color:v})),a}function Te(e,r,t){if(e?.backgroundModifier==="tint")return{light:F(o.DEFAULT_GRAPH_BACKGROUND.light,t,C.light),dark:F(o.DEFAULT_GRAPH_BACKGROUND.dark,t,C.dark)};const i=r?.graphBackground;return typeof i=="string"?i:void 0}function Le(e,r){if(!e?.style)return{};if(e.style==="none")return{borderWidth:0};const t=e.width??0;if(e.style==="grey")return{borderColor:Ee,borderWidth:t};if(e.style==="preset")return e.color===void 0||!_e(e.color)?{}:{borderColor:Ae[e.color],borderWidth:t};if(e.style==="custom")return e.color===void 0?{}:{borderColor:e.color,borderWidth:t};const i=e.color??r;return e.style==="tinted"?{borderColor:{light:Ne(i,P),dark:Ve(i,P)},borderWidth:t}:{borderColor:i,borderWidth:t}}var _e=e=>Se.includes(e),F=(e,r,t)=>`color-mix(in srgb, ${e}, ${r} ${t*100}%)`,Ne=(e,r)=>`hsl(from ${e} h s calc(l * ${1+r}))`,Ve=(e,r)=>`hsl(from ${e} h s calc(l * ${1-r}))`,xe={x:"top",y:"left"},De=new Set(["pie","donut"]);function Re(e,r=!1,t){return o.config({legend:Pe(e.legend,t?.legend),axes:Fe(e.axes,r,t?.axes),headline:Be(e),numberFormat:Ie(e.appearance),content:He(e.content),appearance:we(e.appearance)}).config}function we(e){if(e?.textScale!==void 0)return{textScale:e.textScale}}function Pe(e,r){if(!(!e&&!r))return{...e?{position:e.position}:void 0,...r}}function B(e,r,t){return!r&&t===void 0?{}:{...r?.isHidden!==void 0?{isVisible:!r.isHidden}:void 0,...r?.label!==void 0?{label:r.label}:void 0,...r?.isReversed?{position:xe[e]}:void 0,...r?.tickDisplayMode?{ticks:{mode:r.tickDisplayMode}}:void 0,...t!==void 0?{grid:{isVisible:t}}:void 0}}function Ce(e){return{...e.label!==void 0?{label:e.label}:void 0}}function Fe(e,r=!1,t){if(!e&&!t)return;const i=B("x",e?.x,e?.showGridLines),n=B("y",e?.y,e?.showGridLines);return{x:{...r?n:i,...t?.x},y:{...r?i:n,...t?.y},...e?.y2?{ySecondary:Ce(e.y2)}:void 0}}function Be(e){const{headlineNumbers:r,options:t,type:i}=e,n=i!==void 0&&De.has(i)?t?.pieTotalPosition:void 0;if(r===void 0&&n===void 0)return;const s={};return r?.show!==void 0&&(s.show=r.show),r?.compareWith!==void 0&&(s.compareWith=r.compareWith),r?.size!==void 0&&(s.size=r.size),n!==void 0&&(s.show="total",s.position=n==="center"?"center":"above"),s}function Ie(e){if(e?.numberFormat)return{decimals:e.numberFormat.decimalPlaces,abbreviation:e.numberFormat.abbreviation}}function He(e){if(!e)return;const r={};e.title!==void 0&&(r.title=e.title),e.isTitleHidden!==void 0&&(r.isTitleVisible=!e.isTitleHidden),e.subtitle!==void 0&&(r.subtitle=e.subtitle),e.isSubtitleHidden!==void 0&&(r.isSubtitleVisible=!e.isSubtitleHidden),e.caption!==void 0&&(r.caption=e.caption),e.isCaptionHidden!==void 0&&(r.isCaptionVisible=!e.isCaptionHidden);const t=Ue(e.source);return t!==void 0&&(r.source=t),e.isSourceHidden!==void 0&&(r.isSourceVisible=!e.isSourceHidden),e.brandMark!==void 0&&(r.brandMark={...e.brandMark},e.brandMark.enabled!==void 0&&(r.isBrandMarkVisible=e.brandMark.enabled)),e.isBrandMarkHidden!==void 0&&e.brandMark?.enabled===void 0&&(r.isBrandMarkVisible=!e.isBrandMarkHidden),r}function Ue(e){if(!e)return;const r={};return e.label!==void 0&&(r.label=e.label),e.url!==void 0&&(r.url=e.url),Object.keys(r).length===0?void 0:r}var x=o.prefixInternalVariable("constantY"),Me=.15,We=(e,r,t,i)=>je[r](e,t,i),D=e=>{const r=o.inferXVariable(e),{numeric:t}=e.groupVariableNamesByType(),i=t.filter(n=>n!==r);return i.length<=1?{transforms:[],mapping:{x:r,y:i[0]??""},seriesVariables:i}:{transforms:[o.transform.reshape({keep:[r],keyName:"key",valueName:o.DEFAULT_RESHAPE_VALUE_NAME})],mapping:{x:r,y:o.DEFAULT_RESHAPE_VALUE_NAME,color:"key"},seriesVariables:i}},R=e=>{const r=e.appearance?.seriesStyles;if(!r||e.seriesVariables.length===0)return{mapping:{},scales:[]};if(!e.seriesVariables.some(i=>o.isDefined(r[i]?.lineStyle)))return{mapping:{},scales:[]};if(e.seriesVariables.length===1){const i=e.seriesVariables[0];if(!i)return{mapping:{},scales:[]};const n=r[i]?.lineStyle;return n?{mapping:{lineType:{value:n}},scales:[]}:{mapping:{},scales:[]}}const t=e.seriesVariables.map(i=>r[i]?.lineStyle??"solid");return{mapping:{lineType:"key"},scales:[o.scale.lineType.discrete({domain:e.seriesVariables,range:t})]}},Oe=e=>{const{categorical:r,temporal:t,numeric:i}=e.groupVariableNamesByType(),n=i[0];if(!o.isDefined(n))throw new o.UserInputError({code:"INVALID_DATA_SHAPE",message:"No first numeric variable found",suggestion:"Provide at least one numeric column for this chart type."});const s=i.slice(1);return s.length===0?{...$(),mapping:{x:n,y:x,label:r[0]}}:s.length===1?{transforms:[],scales:[],mapping:{x:n,y:s[0]??"",label:r[0]}}:{transforms:[o.transform.reshape({keep:[n,...r,...t],keyName:"key",valueName:o.DEFAULT_RESHAPE_VALUE_NAME})],scales:[],mapping:{x:n,y:o.DEFAULT_RESHAPE_VALUE_NAME,label:r[0],color:"key"}}},$=()=>({transforms:[o.transform.constant({variableName:x,type:"categorical",value:""})],scales:[o.scale.y.discrete()]}),Ge=e=>{const{categorical:r,temporal:t,numeric:i}=e.groupVariableNamesByType();let n,s;if(o.isDefined(r[0])&&o.isDefined(i[0]))n=r[0],s=i[0];else if(o.isDefined(t[0])&&o.isDefined(i[0]))n=t[0],s=i[0];else if(o.isDefined(i[0])&&o.isDefined(i[1]))n=i[0],s=i[1];else throw new o.UserInputError({code:"INVALID_DATA_SHAPE",message:"No label or value variable found",suggestion:"Provide a label column and a numeric value column for this chart type."});return{x:"",y:s,color:n}},j=(e,r,t)=>{const{transforms:i,mapping:n,seriesVariables:s}=D(e.dataset),a=R({appearance:t,seriesVariables:s}),l=s.length<=1,c=[o.geom.line({params:{interpolate:r?.isSmoothLine?"catmull-rom":"linear",missingValues:r?.missingValues}})],u=[];return l&&(r?.showFill??!0)&&u.push(o.style.geom.line({fillAlpha:Me})),typeof r?.lineThickness=="number"&&u.push(o.style.geom.line({strokeWidth:r.lineThickness})),r?.showPoints&&(c.push(o.geom.point({interactive:!1})),typeof r.pointSize=="number"&&u.push(o.style.geom.point({size:r.pointSize}))),{layers:c,coords:o.coord.cartesian(),mapping:{...n,...a.mapping},scales:a.scales,transforms:i,seriesVariables:s,styleDefaults:u}},ze=(e,r,t)=>{const{transforms:i,mapping:n,seriesVariables:s}=D(e.dataset),a=R({appearance:t,seriesVariables:s}),l=[o.geom.area({position:"stack",params:{interpolate:r?.isSmoothLine?"catmull-rom":"linear",missingValues:r?.missingValues}})],c=[];return typeof r?.lineThickness=="number"&&c.push(o.style.geom.area({strokeWidth:r.lineThickness})),r?.showPoints&&(l.push(o.geom.point({position:"stack",interactive:!1})),typeof r.pointSize=="number"&&c.push(o.style.geom.point({size:r.pointSize}))),{layers:l,coords:o.coord.cartesian(),mapping:{...n,...a.mapping},scales:a.scales,transforms:i,seriesVariables:s,styleDefaults:c}},g=(e,r,t,i,n)=>{const{transforms:s,mapping:a,seriesVariables:l}=D(e.dataset),c=[...s];if(i?.sortBars){const u=o.extractVariableName(a.y);u!==null&&u!==""&&c.push(o.transform.sort({variableName:u,direction:"desc"}))}if(!n?.useSingleColorForBars){const u=o.inferXVariable(e.dataset),{numeric:v}=e.dataset.groupVariableNamesByType();v.filter(f=>f!==u).length===1&&e.dataset.getType(u)==="categorical"&&(a.color=u)}return{layers:[o.geom.bar({position:r})],coords:t,mapping:a,scales:[],transforms:c,seriesVariables:l}},I=(e,r)=>({layers:[o.geom.bar({position:"fill"})],coords:o.coord.polar({theta:"y",innerRadius:r==="donut"?.55:0}),mapping:Ge(e.dataset),scales:[],seriesVariables:[]}),Ye=e=>{const{transforms:r,scales:t,mapping:i}=Oe(e.dataset);return{layers:[o.geom.point()],coords:o.coord.cartesian(),mapping:i,scales:t,transforms:r,seriesVariables:[]}},Ke=e=>{const{numeric:r,categorical:t}=e.dataset.groupVariableNamesByType(),i=r[0];if(!o.isDefined(i))throw new o.UserInputError({code:"INVALID_DATA_SHAPE",message:"No first numeric variable found",suggestion:"Provide at least one numeric column for this chart type."});const n=o.isDefined(r[1])?{transforms:[],scales:[]}:$(),s={x:i,y:r[1]??x,size:r[2],label:t[0]},a=[...n.scales];return o.isDefined(s.size)&&a.push(o.scale.size.continuous()),{layers:[o.geom.point()],coords:o.coord.cartesian(),mapping:s,scales:a,transforms:n.transforms,seriesVariables:[]}},Xe=e=>{const r=o.inferXVariable(e.dataset),{numeric:t}=e.dataset.groupVariableNamesByType(),i=t.filter(n=>n!==r);return{transforms:[o.transform.reshape({keep:[r],keyName:"key",valueName:o.DEFAULT_RESHAPE_VALUE_NAME}),o.transform.filter({variableName:o.DEFAULT_RESHAPE_VALUE_NAME,operator:"neq",value:null})],layers:[o.geom.tile()],coords:o.coord.cartesian(),mapping:{x:r,y:"key",color:o.DEFAULT_RESHAPE_VALUE_NAME},scales:[o.scale.color.continuous()],seriesVariables:i,config:{legend:{position:"none"},axes:{x:{position:"top"},y:{position:"left"}}}}},T=(e,r,t)=>{const i=t?.seriesStyles?.[e]?.lineStyle;return o.geom.line({transforms:[o.transform.constant({variableName:o.LAYER_LABEL_VARIABLES.line,type:"categorical",value:e})],aes:{y:e,color:o.LAYER_LABEL_VARIABLES.line,...i?{lineType:{value:i}}:{}},...r?{yScaleType:"secondary"}:void 0})},$e=(e,r,t)=>{const{numeric:i}=e.dataset.groupVariableNamesByType(),n=o.inferXVariable(e.dataset),s=o.readFoldKeepVariables(e.dataset,n),a=i.filter(d=>d!==n),l=o.COMBO_BAR_POSITIONS[r?.comboType??"grouped-bars"],c=l===null;if(a.length===1)return c?j(e,r,t):g(e,"dodge",o.coord.cartesian(),r,t);const u=e.axes?.hasDualYAxis===!0,v=c?[]:a.slice(0,-1),f=c?a:a.slice(-1),y=[],b=[];if(l!==null&&v.length>0){const d=v.length===1?v[0]:null;o.isDefined(d)?y.push(o.geom.bar({transforms:[o.transform.constant({variableName:o.LAYER_LABEL_VARIABLES.bar,type:"categorical",value:d})],aes:{y:d,color:o.LAYER_LABEL_VARIABLES.bar},position:l})):y.push(o.geom.bar({transforms:[o.transform.reshape({keep:s,reshape:v,keyName:"key",valueName:o.DEFAULT_RESHAPE_VALUE_NAME})],aes:{y:o.DEFAULT_RESHAPE_VALUE_NAME,color:"key"},position:l}))}if(c&&f.length>=2){const d=u?f.slice(0,-1):f,w=d.length===1?d[0]:null;if(o.isDefined(w))y.push(T(w,!1,t));else{const S=R({appearance:t,seriesVariables:d});y.push(o.geom.line({transforms:[o.transform.reshape({keep:s,reshape:d,keyName:"key",valueName:o.DEFAULT_RESHAPE_VALUE_NAME})],aes:{y:o.DEFAULT_RESHAPE_VALUE_NAME,color:"key",...S.mapping}})),b.push(...S.scales)}if(u){const S=f[f.length-1];o.isDefined(S)&&y.push(T(S,!0,t))}}else for(const d of f)y.push(T(d,u,t));return{layers:y,coords:o.coord.cartesian(),mapping:{x:n},scales:b,seriesVariables:a}},A=e=>()=>{throw new o.UserInputError({code:"UNSUPPORTED_GRAPH_TYPE",message:`Unsupported graph type: ${e}`,context:{requested:e}})},je={line:(e,r,t)=>j(e,r,t),areaStacked:(e,r,t)=>ze(e,r,t),bar:(e,r,t)=>g(e,"dodge",o.coord.flip(),r,t),barStacked:(e,r,t)=>g(e,"stack",o.coord.flip(),r,t),barStackedFill:(e,r,t)=>g(e,"fill",o.coord.flip(),r,t),column:(e,r,t)=>g(e,"dodge",o.coord.cartesian(),r,t),columnStacked:(e,r,t)=>g(e,"stack",o.coord.cartesian(),r,t),columnStackedFill:(e,r,t)=>g(e,"fill",o.coord.cartesian(),r,t),pie:e=>I(e,"pie"),donut:e=>I(e,"donut"),scatter:e=>Ye(e),bubble:e=>Ke(e),combo:(e,r,t)=>$e(e,r,t),funnel:A("funnel"),heatmap:e=>Xe(e),waterfall:A("waterfall"),mekko:A("mekko"),table:A("table")},qe=new o.TransformRegistry,Ze=["key",o.prefixInternalVariable("lineSeriesLabel"),o.prefixInternalVariable("barSeriesLabel")];function Je(e){const r=e.annotations??[],t=er(e.mapping),i=tr(e.dataset,e.transforms,e.layers),n=[];for(const s of r){if(s.type!=="highlight")continue;const a=rr({annotation:s,rowIdentityVariable:t,dataset:e.dataset,compiledVariableNames:i});a!==null&&n.push({type:"highlight",id:s.id,predicate:a,scope:Qe(s.highlight,e.mapping)})}return n}function Qe(e,r){const t=o.extractVariableName(r.x);return!(t!==null&&t!=="")&&e==="x-value"?"series":e}function er(e){const r=o.extractVariableName(e.x);return r!==null&&r!==""?r:o.extractVariableName(e.color)}function rr({annotation:e,rowIdentityVariable:r,dataset:t,compiledVariableNames:i}){switch(e.highlight){case"x-value":return H(e,r,t);case"series":return U(e,i);case"data-point":{const n=H(e,r,t),s=U(e,i);return n===null&&s===null?null:n===null?s:s===null?n:{and:[n,s]}}}}function H(e,r,t){if(r===null)return null;const i=or(e,r,t);return i===null?null:{variable:r,eq:i}}function U(e,r){const t=e.columnKey;if(!o.isDefined(t))return null;const i=Ze.filter(n=>r.includes(n));return i.length===0?null:{or:i.map(n=>({variable:n,eq:t}))}}function tr(e,r,t){const i=[...e.getVariableNames()],n=s=>{for(const a of s){const{getIntroducedVariables:l}=qe.get(a.transformType),c=l?.(a);c&&i.push(...c)}};n(r);for(const s of t)n(s.transforms??[]);return i}function or(e,r,t){return e.rowValue!==void 0?e.rowValue:!o.isDefined(e.rowIndex)||!t.getVariableNames().includes(r)?null:t.getValues(r)[e.rowIndex]??null}function ir(e,r,t){const{colorScheme:i,customPalettes:n}=t;if(n&&e&&n[e])return{type:"custom",id:e};if(e?.startsWith("preset:pastel"))return{type:"pastel",variant:L(r)};if(e?.startsWith("preset:graphy"))return{type:"graphy",variant:L(r)};if(e?.startsWith("preset:mono:")){const s=e.slice(12);if(nr(s))return{type:"mono",base:s,variant:i}}if(e?.startsWith("preset:neon:")){const s=e.slice(12);if(sr(s))return{type:"neon",base:s,variant:L(r)}}return{type:"default"}}function L(e){if(e==="waterfall")return"waterfall"}function nr(e){return o.MONO_BASES.includes(e)}function sr(e){return o.NEON_BASES.includes(e)}function ar({axes:e,palette:r,overrides:t,isFlipped:i}){const n=[];return n.push(M("x",i?e?.y:e?.x)),n.push(M("y",i?e?.x:e?.y)),n.push(o.scale.color.palette({palette:r,overrides:t})),n}function M(e,r){return r?.scaleType==="logarithmic"||r?.min!==void 0||r?.max!==void 0?r.scaleType==="logarithmic"?o.scale[e].log({domainMin:r.min??void 0,domainMax:r.max??void 0}):o.scale[e]({domainMin:r.min??void 0,domainMax:r.max??void 0}):o.scale[e]()}function lr(e){if(!e)return;const r={};for(const[t,i]of Object.entries(e)){if(!t.startsWith("series"))continue;const n=Number.parseInt(t.slice(6));if(Number.isNaN(n))continue;const s={hex:i.customColor,id:i.paletteColorId};(s.hex!==void 0||s.id!==void 0)&&(r[n]=s)}return Object.keys(r).length>0?r:void 0}function cr(e){const r=[],t=h(e?.fontAxisLabel);t!==void 0&&r.push(o.style.axisLabel(t));const i=gr(e);i!==void 0&&r.push(o.style.tickLabel(i));const n=h(e?.fontGoalLineLabel);return n!==void 0&&r.push(o.style.geom.rule.label(n)),r.push(...br(e)),r.push(...ur(e)),r.push(...pr(e)),r.push(...mr(e)),r}function ur(e){const r=[],t=fr(e);t!==void 0&&r.push(o.style.tooltip(t));const i=E(h(e?.fontTooltipHeading),p(e?.tooltipHeadingTextColor));i!==void 0&&r.push(o.style.tooltip.heading(i));const n=h(e?.fontTooltipLabel),s=E(n,p(e?.tooltipLabelTextColor));s!==void 0&&r.push(o.style.tooltip.label(s));const a=E(n,p(e?.tooltipValueTextColor));a!==void 0&&r.push(o.style.tooltip.value(a));const l=p(e?.tooltipPrimaryRowColor);l!==void 0&&r.push(o.style.tooltip.primaryRow({background:l}));const c=dr(e);return c!==void 0&&r.push(o.style.annotation.pinnedNumber.label(c),o.style.annotation.comment.label(c)),r}var dr=e=>{const r=p(e?.tooltipBackground),t=p(e?.tooltipBorderColor),i={...E(h(e?.fontMiniTooltipLabel),p(e?.tooltipValueTextColor)),...r===void 0?{}:{background:r},...t===void 0?{}:{borderColor:t}};return Object.keys(i).length===0?void 0:i},fr=e=>{const r=p(e?.tooltipBackground),t=p(e?.tooltipBorderColor),i=m(e?.tooltipBorderWidth),n=m(e?.tooltipBorderRadius),s=m(e?.tooltipPaddingBlock),a=m(e?.tooltipPaddingInline),l=typeof e?.tooltipShadow=="string"?hr(e.tooltipShadow)??void 0:void 0,c={...r===void 0?{}:{background:r},...t===void 0?{}:{borderColor:t},...i===void 0?{}:{borderWidth:i},...n===void 0?{}:{borderRadius:n},...s===void 0?{}:{paddingBlock:s},...a===void 0?{}:{paddingInline:a},...l===void 0?{}:{shadow:l}};return Object.keys(c).length===0?void 0:c};function pr(e){const r=[],t=m(e?.legendItemGap);t!==void 0&&r.push(o.style.legend({gap:t}));const i=h(e?.fontLegendLabel),n=p(e?.legendTextColor),s=E(i,n),a=vr(e,s);a!==void 0&&r.push(o.style.legendItem(a));const l=yr(e);return l!==void 0&&r.push(o.style.legendItem.swatch({size:l})),s!==void 0&&r.push(o.style.directLabel(s)),r}var vr=(e,r)=>{const t=p(e?.legendBackground),i=p(e?.legendBorderColor),n=m(e?.legendPillBorderWidth),s=m(e?.legendPillPaddingInline),a=m(e?.legendPillPaddingBlock),l={...r,...t===void 0?{}:{background:t},...i===void 0?{}:{borderColor:i},...n===void 0?{}:{borderWidth:n},...s===void 0?{}:{paddingInline:s},...a===void 0?{}:{paddingBlock:a}};return Object.keys(l).length===0?void 0:l},yr=e=>{const r=m(e?.legendSwatchWidth);return m(e?.legendSwatchHeight)??r},E=(e,r)=>{if(!(e===void 0&&r===void 0))return{...e,...r===void 0?{}:{textColor:r}}};function br(e){const r=p(e?.dataLabelTextColor),t=p(e?.stackTotalTextColor),i=[["observation",h(e?.fontDataLabel),r],["category",h(e?.fontCategoryLabel),r],["aggregate",h(e?.fontStackTotal),t]],n=[];for(const[u,v,f]of i)v===void 0&&f===void 0||n.push(o.style.dataLabel[u]({...v,...f===void 0?{}:{textColor:f}}));const s=p(e?.dataLabelInsideTextColor);s!==void 0&&(n.push(o.style.dataLabel.observation.inside({textColor:s})),n.push(o.style.dataLabel.category.inside({textColor:s})));const a=p(e?.dataLabelOutsideBackground);a!==void 0&&(n.push(o.style.dataLabel.observation.outside({background:a})),n.push(o.style.dataLabel.category.outside({background:a})));const l=p(e?.stackTotalBackground),c=p(e?.stackTotalStroke);return(l!==void 0||c!==void 0)&&n.push(o.style.dataLabel.aggregate({...l===void 0?{}:{background:l},...c===void 0?{}:{borderColor:c}})),n}function mr(e){const r=[],t=p(e?.trendPositiveColor),i=p(e?.trendNegativeColor),n=p(e?.trendNeutralColor);return t!==void 0&&r.push(o.style.headlineItem.trend.up({textColor:t})),i!==void 0&&r.push(o.style.headlineItem.trend.down({textColor:i})),n!==void 0&&r.push(o.style.headlineItem.trend.flat({textColor:n})),r}function p(e){if(!(typeof e!="string"||e.trim().length===0))return e}function hr(e){const r=e.trim();if(r==="none")return"none";const t=r.split(/\s+/),i=_(t[0]),n=_(t[1]),s=_(t[2]),a=t.slice(3).join(" ");return i===null||n===null||s===null||a.length===0?null:{offsetX:i,offsetY:n,blur:s,color:a}}var _=e=>{if(e===void 0)return null;const r=/^(-?\d*\.?\d+)(px)?$/.exec(e);if(r?.[1]===void 0)return null;const t=Number.parseFloat(r[1]);return Number.isFinite(t)?t:null};function h(e){if(typeof e!="string")return;const r=Y(e);if(r!==null)return{fontFamily:r.family,fontSize:V(r.size),fontWeight:r.weight,...r.lineHeight===void 0?{}:{lineHeight:r.lineHeight}}}function gr(e){const r=h(e?.fontTickLabel),t=m(e?.tickLabelOffset);if(!(r===void 0&&t===void 0))return{...r,...t===void 0?{}:{offset:t}}}function m(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(typeof e!="string")return;const r=N(e);return r===null?void 0:V(r)}var Sr=new Set(["column","columnStacked","columnStackedFill","bar","barStacked","barStackedFill","line","areaStacked","scatter","bubble","funnel","combo"]),Er=new Set(["column","columnStacked","columnStackedFill","bar","barStacked","barStackedFill","line","areaStacked","combo"]);function Ar(e,r,t={}){return kr(o.parseDataset(r),e,t)}function kr(e,r,t={}){const i=r.type??"column",n=We({dataset:e,axes:r.axes},i,r.options??void 0,r.appearance??void 0),s=n.coords.coordType==="flip",a=n.transforms??[],l=ir(r.appearance?.paletteId,i,t),c=lr(r.appearance?.seriesStyles);return{mapping:n.mapping,layers:Tr(i,r,n.layers,n.coords,n.mapping,n.seriesVariables),scales:[...ar({axes:r.axes,palette:l,overrides:c,isFlipped:s}),...n.scales],styles:he(me(be({palette:l,overrides:c,ctx:t}),[...n.styleDefaults??[],...ge(r.appearance??void 0),...ke({appearance:r.appearance??void 0,themeOverrides:r.themeOverrides,palette:l,overrides:c,ctx:t}),...cr(r.themeOverrides),...oe(r.themeOverrides)],te(r.annotations)),ie(r.themeOverrides)),transforms:a,highlights:Je({annotations:r.annotations,dataset:e,mapping:n.mapping,transforms:a,layers:n.layers}),annotations:se({annotations:r.annotations,dataset:e,mapping:n.mapping,seriesVariables:n.seriesVariables}),coords:n.coords,config:Re(r,s,n.config)}}function Tr(e,r,t,i,n,s){const a=xr(r.dataLabels),l=a===void 0?t:t.filter(u=>u.interactive!==!1).map(u=>({...u,dataLabels:{...a,...u.dataLabels}})),c=r.axes?.hasDualYAxis??!1;return[...l,...Lr({type:e,trendline:r.referenceLines?.trendline,coords:i}),..._r({type:e,hasDualYAxis:c,goalLine:r.referenceLines?.goalLine,coords:i}),...Vr({type:e,hasDualYAxis:c,averageLine:r.referenceLines?.averageLine,coords:i,mapping:n,seriesVariables:s})]}function Lr({type:e,trendline:r,coords:t}){return r===void 0?[]:Sr.has(e)?t.coordType==="polar"?[]:[o.geom.line({aes:{lineType:{value:"dashed"}},stat:o.stat.smooth({method:r}),interactive:!1})]:[]}function _r({type:e,hasDualYAxis:r,goalLine:t,coords:i}){if(!Nr(t))return[];if(i.coordType==="polar")return[];const n=i.coordType==="flip"?"end":"start";return[o.geom.rule({aes:{y:{value:t.target}},params:{labelPosition:n,label:t.label??"Goal"},yScaleType:e==="combo"&&r?"secondary":"primary",interactive:!1})]}function Nr(e){return e!==void 0&&Number.isFinite(e.target)}function Vr({type:e,hasDualYAxis:r,averageLine:t,coords:i,mapping:n,seriesVariables:s}){if(t===void 0)return[];if(!Er.has(e))return[];if(i.coordType==="polar")return[];const a=K(t.columnKey);if(!s.includes(a))return[];const l=n.color==="key",c=l?o.DEFAULT_RESHAPE_VALUE_NAME:a,u=l?[o.transform.filter({variableName:"key",operator:"eq",value:a})]:[];return[o.geom.rule({aes:{y:c,color:void 0,group:void 0,lineType:void 0},stat:o.stat.mean(),transforms:u,params:{label:"Average",labelPosition:i.coordType==="flip"?"end":"start"},yScaleType:e==="combo"&&r?"secondary":"primary",interactive:!1})]}function xr(e){if(!e)return;const r={};return e.showDataLabels!==void 0&&(r.showDataLabels=e.showDataLabels),e.dataLabelFormat!==void 0&&(r.format=e.dataLabelFormat),e.showStackTotals!==void 0&&(r.showStackTotals=e.showStackTotals),e.showCategoryLabels!==void 0&&(r.showCategoryLabels=e.showCategoryLabels),Object.keys(r).length===0?void 0:r}var Dr=[.8,1,1.2,1.4,1.6,1.8,2,2.5,3,4];exports.CHART_TEXT_SCALES=Dr;exports.ROOT_FONT_SIZE_PX=q;exports.convertGraphConfig=Ar;exports.isFontStyle=O;exports.parseFontLength=N;exports.parseFontShorthand=Y;exports.parseFontWeight=G;exports.parseUnitlessLineHeight=z;exports.toPixels=V;