"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../loadPlugins.js"),t=require("../mixins/mixins.js"),r=require("../../utils/amap-helpers.js"),i=require("../mixins/props.js"),a=require("../mixins/geometry.js"),s=require("../mixins/editable.js"),n=t.default(a.plane,s.default).extend({name:"AmapEllipse",amapMeta:{initComponent:async(e,t)=>new e.Ellipse(t),editable:{events:["move","end","adjust"],async loadEditor(){await e.default("AMap.EllipseEditor")},async initEditor(e,t,r){return new e.EllipseEditor(t,r,this.draggable)},onEdit(e){const t=r.lngLat2Array(e.target.getCenter());r.nearPair(this.center,t)||this.$emit("update:center",t);const i=e.target.getRadius();r.nearPair(this.radius,i)||this.$emit("update:radius",i.slice(0))}}},props:{center:i.defineProp({type:Array,setter(e,t){if(this.$props.editable||this.$props.draggable){const i=r.lngLat2Array(e.getCenter());if(r.nearPair(t,i))return}e.setCenter(t)},getter:e=>r.lngLat2Array(e.getCenter()),clone:!0,deep:!0,equals:r.nearPair,events:["dragging","dragend"]}),radius:i.defineProp({type:Array,setter(e,t){const i=e;if(this.$props.editable){const e=i.getRadius();if(r.nearPair(t,e))return}i.setRadius(t)},clone:!0,deep:!0,equals:r.nearPair})},methods:{getBounds(){return r.bounds2Array(this.context.component.getBounds())}}});exports.default=n;
