"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const namespaceURI_1 = require("../../../../../client/component/namespaceURI");
const element_1 = require("../../../../../client/element");
const style_1 = require("../../../../../client/style");
class SVGMarker extends element_1.Element {
    constructor($props, $system) {
        super($props, $system);
        const { id, style = {}, className, markerHeight, markerWidth, refX, refY, orient, } = this.$props;
        const marker_el = this.$system.api.document.createElementNS(namespaceURI_1.namespaceURI, 'marker');
        (0, style_1.applyStyle)(marker_el, style);
        if (id !== undefined) {
            marker_el.id = id;
        }
        if (className) {
            marker_el.classList.add(className);
        }
        if (markerHeight !== undefined) {
            marker_el.setAttribute('markerHeight', `${markerHeight}`);
        }
        if (markerWidth !== undefined) {
            marker_el.setAttribute('markerWidth', `${markerWidth}`);
        }
        if (refX !== undefined) {
            marker_el.setAttribute('refX', `${refX}`);
        }
        if (refY !== undefined) {
            marker_el.setAttribute('refY', `${refY}`);
        }
        if (orient !== undefined) {
            marker_el.setAttribute('orient', orient);
        }
        this._marker_el = marker_el;
        this.$element = marker_el;
    }
    // TODO
    onPropChanged(prop, current) {
        if (prop === 'style') {
            (0, style_1.applyStyle)(this._marker_el, current);
        }
    }
}
exports.default = SVGMarker;
//# sourceMappingURL=Component.js.map