{"version":3,"file":"index.mjs","sources":["../../../../packages/overlay/markerClusterer/index.ts"],"sourcesContent":["import { defineComponent, onBeforeMount, onUnmounted } from \"vue\";\r\nimport { useMapRoot } from \"~/use/mapRoot\";\r\nimport { useEvent } from \"~/use/event\";\r\nimport { EVENTS, NATIVE_EVENTS, PROPS, useInit, useWatch } from \"./use\";\r\n\r\nexport const TdtMarkerClusterer = defineComponent({\r\n  name: \"TdtMarkerClusterer\",\r\n  props: PROPS,\r\n  emits: EVENTS,\r\n  setup(props, { emit }) {\r\n    onBeforeMount(async () => {\r\n      onUnmounted(() => tdtComponent?.clearMarkers());\r\n\r\n      const tdtMap = await useMapRoot();\r\n      const tdtComponent = useInit(props, tdtMap);\r\n      useEvent({ events: NATIVE_EVENTS, emit, instance: tdtComponent });\r\n      useWatch({ props, instance: tdtComponent });\r\n      emit(\"init\", tdtComponent);\r\n    });\r\n\r\n    return () => {};\r\n  }\r\n});\r\n\r\nexport type TdtMarkerClustererInstance = InstanceType<typeof TdtMarkerClusterer>;\r\n"],"names":["TdtMarkerClusterer","defineComponent","PROPS","EVENTS","props","emit","onBeforeMount","onUnmounted","tdtComponent","tdtMap","useMapRoot","useInit","useEvent","NATIVE_EVENTS","useWatch"],"mappings":";;;;;;AAKO,MAAMA,IAAqBC,EAAgB;AAAA,EAChD,MAAM;AAAA,EACN,OAAOC;AAAA,EACP,OAAOC;AAAA,EACP,MAAMC,GAAO,EAAE,MAAAC,KAAQ;AACrB,WAAAC,EAAc,YAAY;AACZ,MAAAC,EAAA,MAAMC,KAAA,gBAAAA,EAAc,cAAc;AAExC,YAAAC,IAAS,MAAMC,EAAW,GAC1BF,IAAeG,EAAQP,GAAOK,CAAM;AAC1C,MAAAG,EAAS,EAAE,QAAQC,GAAe,MAAAR,GAAM,UAAUG,GAAc,GAChEM,EAAS,EAAE,OAAAV,GAAO,UAAUI,EAAA,CAAc,GAC1CH,EAAK,QAAQG,CAAY;AAAA,IAAA,CAC1B,GAEM,MAAM;AAAA,IAAC;AAAA,EAAA;AAElB,CAAC;"}