"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DEFAULT_STYLE = void 0;
const namespaceURI_1 = require("../../../../../client/component/namespaceURI");
const element_1 = require("../../../../../client/element");
const style_1 = require("../../../../../client/style");
exports.DEFAULT_STYLE = {
    fill: 'currentColor',
    stroke: 'currentColor',
    strokeWidth: '1px',
};
class SVGCircle extends element_1.Element {
    constructor($props, $system) {
        super($props, $system);
        const { className, style = {}, x = 50, y = 50, r = 50 } = $props;
        const circle_el = this.$system.api.document.createElementNS(namespaceURI_1.namespaceURI, 'circle');
        if (className !== undefined) {
            circle_el.classList.value = className;
        }
        (0, style_1.applyStyle)(circle_el, Object.assign(Object.assign({}, exports.DEFAULT_STYLE), style));
        circle_el.setAttribute('cx', `${x}`);
        circle_el.setAttribute('cy', `${y}`);
        circle_el.setAttribute('r', `${r}`);
        this._circle_el = circle_el;
        this.$element = circle_el;
    }
    onPropChanged(prop, current) {
        if (prop === 'className') {
            this._circle_el.className.value = current;
        }
        else if (prop === 'style') {
            (0, style_1.applyStyle)(this._circle_el, current);
        }
        else if (prop === 'x') {
            this._circle_el.setAttribute('cx', `${current}`);
        }
        else if (prop === 'y') {
            this._circle_el.setAttribute('cy', `${current}`);
        }
        else if (prop === 'r') {
            this._circle_el.setAttribute('r', `${current}`);
        }
    }
}
exports.default = SVGCircle;
//# sourceMappingURL=Component.js.map