"use strict";
class BvEvent {
  cancelable = true;
  componentId = null;
  _defaultPrevented = false;
  eventType = "";
  nativeEvent = null;
  _preventDefault;
  relatedTarget = null;
  target = null;
  // Readable by everyone,
  // But only overwritten by inherrited constructors
  get defaultPrevented() {
    return this._defaultPrevented;
  }
  set defaultPrevented(prop) {
    this._defaultPrevented = prop;
  }
  // I think this is right
  // We want to be able to have it callable to everyone,
  // But only overwritten by inherrited constructors
  get preventDefault() {
    return this._preventDefault;
  }
  // This may not be correct, because it doesn't get correct type inferences in children
  // Ex overwrite this.preventDefault = () => true is valid. Could be a TS issue
  set preventDefault(setter) {
    this._preventDefault = setter;
  }
  constructor(eventType, eventInit = {}) {
    if (!eventType) {
      throw new TypeError(
        `Failed to construct '${this.constructor.name}'. 1 argument required, ${arguments.length} given.`
      );
    }
    Object.assign(this, BvEvent.Defaults, eventInit, { eventType });
    this._preventDefault = function _preventDefault() {
      if (this.cancelable) {
        this.defaultPrevented = true;
      }
    };
  }
  static get Defaults() {
    return {
      cancelable: true,
      componentId: null,
      eventType: "",
      nativeEvent: null,
      relatedTarget: null,
      target: null
    };
  }
}
class BvTriggerableEvent extends BvEvent {
  trigger = null;
  ok = void 0;
  constructor(eventType, eventInit = {}) {
    super(eventType, eventInit);
    Object.assign(this, BvEvent.Defaults, eventInit, { eventType });
  }
  static get Defaults() {
    return {
      ...super.Defaults,
      trigger: null,
      ok: void 0
    };
  }
}
class BvCarouselEvent extends BvEvent {
  from;
  to;
  direction;
  constructor(eventType, eventInit) {
    super(eventType, eventInit);
    Object.assign(this, BvEvent.Defaults, eventInit, { eventType });
    const { from, direction, to } = eventInit;
    this.from = from;
    this.to = to;
    this.direction = direction;
  }
  static get Defaults() {
    return {
      ...super.Defaults
    };
  }
}
exports.BvCarouselEvent = BvCarouselEvent;
exports.BvEvent = BvEvent;
exports.BvTriggerableEvent = BvTriggerableEvent;
//# sourceMappingURL=classes-DA6TfAZg.js.map
