"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const index_esm = require("../../../min-dash/dist/index.esm.js");
function Styles() {
  var defaultTraits = {
    "no-fill": {
      fill: "none"
    },
    "no-border": {
      strokeOpacity: 0
    },
    "no-events": {
      pointerEvents: "none"
    }
  };
  var self = this;
  this.cls = function(className, traits, additionalAttrs) {
    var attrs = this.style(traits, additionalAttrs);
    return index_esm.assign(attrs, { "class": className });
  };
  this.style = function(traits, additionalAttrs) {
    if (!index_esm.isArray(traits) && !additionalAttrs) {
      additionalAttrs = traits;
      traits = [];
    }
    var attrs = index_esm.reduce(traits, function(attrs2, t) {
      return index_esm.assign(attrs2, defaultTraits[t] || {});
    }, {});
    return additionalAttrs ? index_esm.assign(attrs, additionalAttrs) : attrs;
  };
  this.computeStyle = function(custom, traits, defaultStyles) {
    if (!index_esm.isArray(traits)) {
      defaultStyles = traits;
      traits = [];
    }
    return self.style(traits || [], index_esm.assign({}, defaultStyles, custom || {}));
  };
}
exports.default = Styles;
