'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-305226cb.js');

const bsToastActionsCss = "bs-toast-actions{display:block}";

const BsToastActions = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    this.defaultDismiss = index.createEvent(this, "defaultDismiss", 7);
    this.isStacked = false;
    this.showDefault = false;
  }
  componentDidLoad() {
    if (this.actionsEl.childElementCount == 0) {
      this.showDefault = true;
    }
  }
  /** Stacks the actions when there are more than two (mobile only) */
  componentDidRender() {
    // Note: the default <slot> is counted as a child, so we're actually looking for 3 or more children
    if (this.actionsEl.childElementCount > 2) {
      this.isStacked = true;
    }
  }
  render() {
    return (index.h(index.Host, null, index.h("div", { ref: (el) => this.actionsEl = el, class: "bs-toast-actions", "data-stacked": this.isStacked }, this.showDefault && (index.h("bs-button", { size: "sm", "text-btn": true, onClick: () => this.defaultDismiss.emit() }, "Dismiss")), index.h("slot", null))));
  }
};
BsToastActions.style = bsToastActionsCss;

exports.bs_toast_actions = BsToastActions;

//# sourceMappingURL=bs-toast-actions.cjs.entry.js.map