(()=>{function h(v){return String(v??"").replace(/[&<>"']/g,c=>({"&":"&","<":"<",">":">",'"':""","'":"'"}[c]))}function m(arr){return arr.reduce((x,y)=>Math.max(x,Number(y)||0),0)||1}function line(el,o){const cats=o?.xAxis?.data||[];const a=o?.series?.[0]?.data||[];const b=o?.series?.[1]?.data||[];const max=m(a.concat(b));const pts=(vals)=>vals.map((v,i)=>{const x=cats.length>1?(i*100)/(cats.length-1):0;const y=90-((Number(v)||0)/max)*80;return `${x},${y}`}).join(" ");el.innerHTML=`
${cats.map(x=>`${h(x)}`).join("")}
`}function bar(el,o){const cats=o?.xAxis?.data||[];const vals=o?.series?.[0]?.data||[];const color=o?.series?.[0]?.itemStyle?.color||"#2563eb";const max=m(vals);el.innerHTML=`
${cats.map((cat,i)=>{const value=Number(vals[i]||0);const width=Math.max(6,Math.round((value/max)*100));return `
${h(cat)}${value}
`}).join("")}
`}window.echarts={init(el){return{setOption(o){if((o?.series||[])[0]?.type==="bar"){bar(el,o);return}line(el,o)},resize(){}}}}})();