"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../../utils/amap-helpers.js");function e(t,e,n){const o=t.$amapEvents||(t.$amapEvents={});(o[e]||(o[e]=[])).push(n)}exports.bindEvent=function(n,o,a){e(n,o,a),t.getBindTarget(n.$amapContext).on(o,a)},exports.bindEvents=function(n){const{events:o=[]}=n.$options.amapMeta,a=t.getBindTarget(n.$amapContext);o.forEach(t=>{n.$watch("$listeners."+t,(o,s)=>{s&&a.off(t,s),o&&(e(n,t,o),a.on(t,o))},{immediate:!0})})},exports.bindTwoWayEvent=function(n,o,a,s){s||(s=t.getBindTarget(n.$amapContext));const{events:i=[]}=a;i.forEach(t=>{const{getter:i}=a;if(!i)return;const r=t=>{const e="function"==typeof i?i.call(n,s,t):s[i](),r=n.$props[o];if("function"==typeof a.equals){if(a.equals(e,r))return}else if(e===r)return;n.$emit("update:"+o,e)};e(n,t,r),s.on(t,r)})},exports.unbindEvents=function(e){const n=t.getBindTarget(e.$amapContext),o=e.$amapEvents||{};for(const t in o){o[t].forEach(e=>{n.off(t,e)})}};
