'use strict';

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

const index = require('./index-0b1e2673.js');

const styleCss = ".sc-smoothly-trigger-h{display:block;border-style:solid;border-width:1px;border-radius:3px}[hidden].sc-smoothly-trigger-h{display:none}[disabled].sc-smoothly-trigger-h{opacity:.5}button.sc-smoothly-trigger{border-color:transparent;padding:.2em .3em;font-size:110%;font-weight:400}.sc-smoothly-trigger-h:not([processing]):not([disabled]):hover,.sc-smoothly-trigger-h:not([processing]):not([disabled]):focus,.sc-smoothly-trigger-h:not([processing]):not([disabled]):active{border-color:var(--smoothly-trigger-border)}[expand=fill].sc-smoothly-trigger-h>button.sc-smoothly-trigger,[expand=block].sc-smoothly-trigger-h>button.sc-smoothly-trigger{width:100%}[expand=fill].sc-smoothly-trigger-h{border-left:none;border-right:none}";

const SmoothlyTrigger = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    this.trigger = index.createEvent(this, "trigger", 7);
    this.disabled = false;
    this.type = "button";
  }
  onClick(e) {
    this.trigger.emit({ name: this.name, value: this.value });
    e.stopPropagation();
    e.preventDefault();
  }
  render() {
    let result;
    switch (this.type) {
      case "link":
        result = this.disabled ? (index.h("slot", null)) : (index.h("a", { onClick: e => this.onClick(e) }, index.h("slot", null)));
        break;
      case "button":
        result = (index.h("button", { disabled: this.disabled, name: this.name }, index.h("slot", null)));
        break;
    }
    return result;
  }
};
SmoothlyTrigger.style = styleCss;

exports.smoothly_trigger = SmoothlyTrigger;
