Skip to content

Instantly share code, notes, and snippets.

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("vue");const t=Symbol();const o=new class{events;ymapReady;scriptIsNotAttached;pluginInstalledGlobal;constructor(){this.events={},this.ymapReady=!1,this.scriptIsNotAttached=!0,this.pluginInstalledGlobal=!1}$on(e,t){return this.events[e]||(this.events[e]=[]),this.events[e].push(t),()=>{this.events[e]=this.events[e].filter((e=>t!==e))}}$emit(e){const t=this.events[e];t&&t.forEach((e=>e()))}};function n(e){return new Promise(((t,n)=>{if(window.ymaps)return t(!0);if(document.getElementById("vue-yandex-maps-script"))return void o.$on("scriptIsLoaded",t);const a=document.createElement("SCRIPT"),{apiKey:s="",lang:r="ru_RU",version:d="2.1",coordorder:c="latlong",debug:l=!1,enterprise:p=!1}=e,i=`https://${p?"enterprise.":""}api-maps.yandex.ru/${d}/?${`lang=${r}${s&&`&apikey=${s}`}&mode=${l?"debug":"release"}&coordorder=${c}`}`;a.setAttribute("src",i),a.setAttribute("async",""),a.setAttribute("defer",""),a.setAttribute("id","vue-yandex-ma