"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const namespaceURI_1 = require("../../../../../client/component/namespaceURI");
const svg_1 = require("../../../../../client/svg");
class SVGPath extends svg_1.SVGElement_ {
    constructor($props, $system) {
        super($props, $system, $system.api.document.createElementNS(namespaceURI_1.namespaceURI, 'path'), $system.style['path'], {
            'stroke-linecap': 'round',
            'stroke-linejoin': 'round',
        }, {
            id: (id) => {
                this.$element.id = id;
            },
            d: (d) => {
                if (d === undefined) {
                    this.$element.removeAttribute('d');
                }
                else {
                    this.$element.setAttribute('d', d);
                }
            },
            markerStart: (markerStart) => {
                this.$element.setAttribute('marker-start', markerStart);
            },
            markerEnd: (markerEnd) => {
                this.$element.setAttribute('marker-end', markerEnd);
            },
            strokeWidth: (strokeWidth) => {
                if (strokeWidth === undefined) {
                    this.$element.removeAttribute('stroke-width');
                }
                else {
                    this.$element.setAttribute('stroke-width', `${strokeWidth}`);
                }
            },
            fillRule: (fillRule) => {
                if (fillRule === undefined) {
                    this.$element.removeAttribute('fill-rule');
                }
                else {
                    this.$element.setAttribute('fill-rule', fillRule);
                }
            },
        });
        const { id, className, d = '', markerStart, markerEnd, fillRule } = $props;
        if (id !== undefined) {
            this.$element.id = id;
        }
        if (className) {
            this.$element.classList.value = className;
        }
        if (markerStart !== undefined) {
            this.$element.setAttribute('marker-start', markerStart);
        }
        if (markerEnd !== undefined) {
            this.$element.setAttribute('marker-end', markerEnd);
        }
        if (fillRule !== undefined) {
            this.$element.setAttribute('fill-rule', fillRule);
        }
        this.$element.setAttribute('d', d);
    }
}
exports.default = SVGPath;
//# sourceMappingURL=Component.js.map