"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../utils/clone.js"),t=require("../../utils/amap-helpers.js"),n=require("./events.js");const o={equals:t.theSame,clone:!1};function r(t,n,o,r){const{setter:s}=o;s&&("function"==typeof s?s.call(t,n,r):"string"==typeof s&&(o.clone&&(r=e.default(r)),n[s](r)))}exports.bindProps=function(e,o,s){o||(o=t.getBindTarget(e.$amapContext)),s||(s=e.$options.props);for(const t in s){const i=s[t],{setter:p}=i;if(!p)continue;const u={deep:!!i.deep};e.$amapLogger.debug("watch",t,u),e.$watch("$props."+t,(t,n)=>{if(!u.deep||u.deep&&t!==n)if("function"==typeof i.equals){if(i.equals(t,n))return}else if(t===n)return;r(e,o,i,t)},u),i.events&&n.bindTwoWayEvent(e,t,i,o)}},exports.defineProp=function(e,t,n){if("string"==typeof e){const r=e,s={...o,setter:r};return t&&(s.type=t),arguments.length>=3&&(s.default=n),s}return{...o,...e}},exports.setPropValue=r;
