import{b1 as d,cq as p}from"./index-BTglIPU2.js?v=1773287522785";import"./interface-Bwv0y5cG.js?v=1773287522785";import{f as l}from"./naive-ui--dJnpVcV.js?v=1773287522785";import{k as h,r as g,w as v,o as w,b as y,$ as x,Z as b,H as z,S as c,n as B}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{e as n}from"./echarts-DiepRh70.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";const L=h({__name:"index",props:{width:{type:[Number,String],default:"100%"},height:{type:[Number,String],default:"200px"},dataZoom:{type:Boolean,default:!1},option:{type:Object,required:!0}},setup(a,{expose:f}){const i=a,t=g(null);let r=!0;async function m(){if(r){const{data:u}=await p.get("/static/vite/data/world.json");n.registerMap("world",u),r=!1}if(t.value===null)return;let e=n.getInstanceByDom(t.value);e==null&&(e=n.init(t.value)),e.setOption(i.option,!0)}function o(){var e;t.value!==null&&((e=n.getInstanceByDom(t.value))==null||e.resize())}v(()=>i.option,e=>{e&&B(()=>{m()})},{immediate:!0,deep:!0});const s=d(o,300,{maxWait:800});return w(async()=>{window.addEventListener("resize",s)}),y(()=>{var e;t.value&&((e=n.getInstanceByDom(t.value))==null||e.dispose(),window.removeEventListener("resize",s))}),f({resize:o}),(e,u)=>(x(),b("div",{ref_key:"chartRef",ref:t,style:z({width:c(l)(a.width),height:c(l)(a.height)})},null,4))}});export{L as default};
