'use strict';

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

const index = require('./index-140bcbcd.js');
require('./Token-8c5ba5d9.js');
const Message = require('./Message-f462d297.js');
const Trigger = require('./Trigger-a1c9ba71.js');

const styleCss = ".sc-smoothly-trigger-sink-h{display:block}[hidden].sc-smoothly-trigger-sink-h{display:none}";

const SmoothlyTriggerSink = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
  }
  get filters() {
    if (!this.filtersValue)
      this.filtersValue = this.filter ? this.filter.split(" ") : [];
    return this.filtersValue;
  }
  TriggerListener(event) {
    if (Trigger.Trigger.is(event.detail) && this.filters.some(f => f == event.detail.name)) {
      Message.Message.send(this.destination, event.detail, this.context || window);
      event.preventDefault();
      event.stopPropagation();
    }
  }
  render() {
    return index.h("slot", null);
  }
};
SmoothlyTriggerSink.style = styleCss;

exports.smoothly_trigger_sink = SmoothlyTriggerSink;
