setAttributes = (element, attributes) => {
  for (const key in attributes) {
    const value = attributes[key];

    if (typeof value === 'undefined') continue;

    if (!value && typeof value !== 'number') {
      // Need to remove falsy attribute
      element.removeAttribute(key);
      continue;
    }

    if (key.toLowerCase() === 'style') {
      Object(_setStyles__WEBPACK_IMPORTED_MODULE_0__["default"])(element, value);
      continue;
    }

    if (value instanceof _listen_Listener__WEBPACK_IMPORTED_MODULE_1__["default"]) {
      new _utils_AttributeListener__WEBPACK_IMPORTED_MODULE_3__["default"]({
        attributeKey: key,
        listener: value,
        element,
      }).attach();
      continue;
    }

    if (key.toLowerCase() === 'class' || key.toLowerCase() === 'classname') {
      element.setAttribute('class', Object(_utils_parseClass__WEBPACK_IMPORTED_MODULE_2__["default"])(value));
      continue;
    }

    // Handles events 'on<event>'
    if (key.substring(0, 2).toLowerCase() === 'on') {
      if (key.substring(0, 8).toLowerCase() === 'onsubmit') {
        element[key] = (e) => {
          const data = [];
          const inputs = e.target.elements || [];
          for (const input of inputs) {
            if (input.name !== '') {
              const item = {
                name: input.name,
                el: input,
                type: input.type,
                default: input.defaultValue,
                value: input.value,
                set(val) {
                  this.el.value = val;
                },
                reset(val) {
                  this.el.value = val;
                  this.el.defaultValue = val;
                },
              };
              data.push(item);
              Object.defineProperty(data, item.name, {
                value: item,
              });
            }
          }

          return value(e, data);
        };
      } else {
        element[key] = value;
      }
      continue;
    }

    element.setAttribute(key, value);
  }
}
@param {HTMLElement} element
@param {object} attributes