import{p as t,H as e,j as s,t as a}from"./index2.js";const n=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow()}get el(){return this}type="bar";option;chartInstance=null;async componentDidLoad(){await this.initChart()}async onTypeChange(){this.chartInstance?.dispose(),await this.initChart()}async initChart(){const t=this.el.shadowRoot?.querySelector(".chart");if(!t)return;const e=await import("./core.js"),{CanvasRenderer:s}=await import("./renderers.js"),{GridComponent:a,TooltipComponent:n,LegendComponent:i}=await import("./components.js"),r=await this.loadChartModule();e.use([s,a,n,i,r]),this.chartInstance=e.init(t),this.chartInstance.setOption(this.option)}async loadChartModule(){switch(this.type){case"bar":return(await import("./charts.js")).BarChart;case"line":return(await import("./charts.js")).LineChart;case"pie":return(await import("./charts.js")).PieChart;default:throw Error("Unknown chart type: "+this.type)}}disconnectedCallback(){this.chartInstance?.dispose()}render(){return s("div",{class:"chart",style:{width:"100%",height:"100%"}},"8463ec1ac51060691875a0372a9562984cc2c5c7")}static get watchers(){return{type:[{onTypeChange:0}]}}static get style(){return"@layer reset, base, variants, states, sizes;  @layer reset {   :host {     display: contents;     -moz-text-size-adjust: none;     -webkit-text-size-adjust: none;     text-size-adjust: none;     font-family: var(--dds-font-family-sans);     font-feature-settings: var(--dds-font-features-sans);     text-rendering: optimizeLegibility;     -webkit-font-smoothing: antialiased;      *,     *::after,     *::before,     *::backdrop,     *::file-selector-button {       box-sizing: border-box;       margin: 0;       padding: 0;       min-inline-size: 0;       min-block-size: 0;     }      * {       scrollbar-width: thin;       scrollbar-color: color-mix(gray 50%, transparent);     }      *:focus-visible {       z-index: 1;     }      > * {       interpolate-size: allow-keywords;       -webkit-tap-highlight-color: transparent;     }   } } "}},[513,"dds-chart",{type:[1],option:[16]},void 0,{type:[{onTypeChange:0}]}]),i=n,r=function(){"undefined"!=typeof customElements&&["dds-chart"].forEach((t=>{"dds-chart"===t&&(customElements.get(a(t))||customElements.define(a(t),n))}))};export{i as DdsChart,r as defineCustomElement}