text: define(["exports", "../../lit/index.js", "../simple-colors/simple-colors.js", "./lib/simple-toast-el.js"], function (_exports, _index, _simpleColors, _simpleToastEl) {
    "use strict";
  
    Object.defineProperty(_exports, "__esModule", {
      value: true
    });
    _exports.SimpleToast = _exports.SimpleToastStore = void 0;
  
    var _templateObject_369ff380012611ec9676957c409166bc, _templateObject2_369ff380012611ec9676957c409166bc;
  
    function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
  
    function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { babelHelpers.defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  
    function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = babelHelpers.getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = babelHelpers.getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return babelHelpers.possibleConstructorReturn(this, result); }; }
  
    function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  
    // register globally so we can make sure there is only one
    window.SimpleToast = window.SimpleToast || {}; // request if this exists. This helps invoke the element existing in the dom
    // as well as that there is only one of them. That way we can ensure everything
    // is rendered through the same simple-toast element, making it a singleton.
  
    window.SimpleToast.requestAvailability = function () {
      // if there is no single instance, generate one and append it to end of the document
      if (!window.SimpleToast.instance) {
        window.SimpleToast.instance = document.createElement("simple-toast");
        document.body.appendChild(window.SimpleToast.instance);
      }
  
      return window.SimpleToast.instance;
    };
  
    var SimpleToastStore = window.SimpleToast.requestAvailability();
    /**
     * `simple-toast`
     * `A singular toast / message for conistency`
     * @demo demo/index.html
     * @element simple-toast
     */
  
    _exports.SimpleToastStore = SimpleToastStore;
  
    var SimpleToast = /*#__PURE__*/function (_SimpleColors) {
      babelHelpers.inherits(SimpleToast, _SimpleColors);
  
      var _super = _createSuper(SimpleToast);
  
      /**
       * life cycle, element is afixed to the DOM
       */
      function SimpleToast() {
        var _this;
  
        babelHelpers.classCallCheck(this, SimpleToast);
        _this = _super.call(this);
  
        _this.setDefaultToast();
  
        return _this;
      }
  
      babelHelpers.createClass(SimpleToast, [{
        key: "render",
        value: // render function
        function render() {
          return (0, _index.html)(_templateObject_369ff380012611ec9676957c409166bc || (_templateObject_369ff380012611ec9676957c409166bc = babelHelpers.taggedTemplateLiteral([" <simple-toast-el\n      id=\"toast\"\n      accent-color=\"", "\"\n      ?dark=\"", "\"\n      text=\"", "\"\n      duration=\"", "\"\n      ?opened=\"", "\"\n      @opened-changed=\"", "\"\n      .class=\"", "\"\n    >\n      <slot></slot>\n      <button .hidden=\"", "\" @click=\"", "\">\n        ", "\n      </button>\n    </simple-toast-el>"])), this.accentColor, this.dark, this.text, this.duration, this.opened, this.openedChanged, this.classStyle, !this.closeButton, this.hide, this.closeText);
        } // properties available to the custom element for data binding
  
      }, {
        key: "connectedCallback",
        value: function connectedCallback() {
          babelHelpers.get(babelHelpers.getPrototypeOf(SimpleToast.prototype), "connectedCallback", this).call(this);
          window.addEventListener("simple-toast-hide", this.hideSimpleToast.bind(this));
          window.addEventListener("simple-toast-show", this.showSimpleToast.bind(this));
        }
        /**
         * life cycle, element is removed from the DOM
         */
  
      }, {
        key: "disconnectedCallback",
        value: function disconnectedCallback() {
          window.removeEventListener("simple-toast-hide", this.hideSimpleToast.bind(this));
          window.removeEventListener("simple-toast-show", this.showSimpleToast.bind(this));
          babelHelpers.get(babelHelpers.getPrototypeOf(SimpleToast.prototype), "disconnectedCallback", this).call(this);
        }
        /**
         * Hide callback
         */
  
      }, {
        key: "hideSimpleToast",
        value: function hideSimpleToast(e) {
          this.hide();
        }
      }, {
        key: "openedChanged",
        value: function openedChanged(e) {
          this.opened = e.detail.value;
        }
      }, {
        key: "setDefaultToast",
        value: function setDefaultToast() {
          this.opened = false;
          this.text = "Saved";
          this.classStyle = "";
          this.closeText = "Close";
          this.duration = 3000;
          this.accentColor = "grey";
          this.dark = false;
          this.eventCallback = null;
          this.closeButton = true;
  
          while (this.firstChild !== null) {
            this.removeChild(this.firstChild);
          }
        }
        /**
         * Show / available callback
         */
  
      }, {
        key: "showSimpleToast",
        value: function showSimpleToast(e) {
          // establish defaults and then let event change settings
          this.setDefaultToast(); // add your code to run when the singleton is called for
  
          if (e.detail.duration) {
            this.duration = e.detail.duration;
          }
  
          if (e.detail.text) {
            this.text = e.detail.text;
          }
  
          if (e.detail.classStyle) {
            this.classStyle = e.detail.classStyle;
          }
  
          if (e.detail.closeText) {
            this.closeText = e.detail.closeText;
          }
  
          if (e.detail.closeButton) {
            this.closeButton = e.detail.closeButton;
          }
  
          if (e.detail.eventCallback) {
            this.eventCallback = e.detail.eventCallback;
          }
  
          if (e.detail.slot) {
            this.appendChild(e.detail.slot);
          }
  
          if (e.detail.accentColor) {
            this.accentColor = e.detail.accentColor;
          }
  
          if (e.detail.dark) {
            this.dark = e.detail.dark;
          }
  
          this.show();
        }
      }, {
        key: "show",
        value: function show(e) {
          this.opened = true;
        }
      }, {
        key: "hide",
        value: function hide(e) {
          if (this.eventCallback) {
            var evt = new CustomEvent(this.eventCallback, {
              bubbles: true,
              cancelable: true,
              detail: true,
              composed: true
            });
            this.dispatchEvent(evt);
          }
  
          this.opened = false;
        }
      }], [{
        key: "styles",
        get: //styles function
        function get() {
          return [].concat(babelHelpers.toConsumableArray(babelHelpers.get(babelHelpers.getPrototypeOf(SimpleToast), "styles", this)), [(0, _index.css)(_templateObject2_369ff380012611ec9676957c409166bc || (_templateObject2_369ff380012611ec9676957c409166bc = babelHelpers.taggedTemplateLiteral(["\n        :host {\n          display: block;\n        }\n\n        :host([hidden]) {\n          display: none;\n        }\n\n        simple-toast-el {\n          box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);\n          width: var(--simple-toast-width, auto);\n          color: var(\n            --simple-toast-color,\n            var(--simple-colors-default-theme-accent-1, white)\n          );\n          background-color: var(\n            --simple-toast-bg,\n            var(--simple-colors-default-theme-accent-12, black)\n          );\n          top: var(--simple-toast-top);\n          margin: var(--simple-toast-margin, 8px);\n          padding: var(--simple-toast-padding, 16px);\n          left: var(--simple-toast-left, 36px);\n          bottom: var(--simple-toast-bottom, 36px);\n          right: var(--simple-toast-right);\n          border: var(--simple-toast-border);\n          z-index: var(--simple-toast-z-index, 1000);\n          font-size: var(--simple-toast-font-size);\n        }\n\n        button {\n          margin-left: 8px;\n        }\n      "])))]);
        }
      }, {
        key: "properties",
        get: function get() {
          return _objectSpread(_objectSpread({}, babelHelpers.get(babelHelpers.getPrototypeOf(SimpleToast), "properties", this)), {}, {
            /**
             * Opened state of the toast, use event to change
             */
            opened: {
              type: Boolean,
              reflect: true
            },
  
            /**
             * Plain text based message to display
             */
            text: {
              type: String
            },
  
            /**
             * Class name, fit-bottom being a useful one
             */
            classStyle: {
              type: String,
              attribute: "class-style"
            },
  
            /**
             * Text for the close button
             */
            closeText: {
              type: String,
              attribute: "close-text"
            },
  
            /**
             * How long the toast message should be displayed
             */
            duration: {
              type: Number
            },
  
            /**
             * Event callback when hide is called
             */
            eventCallback: {
              type: String,
              attribute: "event-callback"
            },
  
            /**
             * If there should be a close button shown
             */
            closeButton: {
              type: Boolean,
              reflect: true,
              attribute: "close-button"
            }
          });
        }
        /**
         * Store the tag name to make it easier to obtain directly.
         * @notice function name must be here for tooling to operate correctly
         */
  
      }, {
        key: "tag",
        get: function get() {
          return "simple-toast";
        }
      }]);
      return SimpleToast;
    }(_simpleColors.SimpleColors);
  
    _exports.SimpleToast = SimpleToast;
    window.customElements.define(SimpleToast.tag, SimpleToast);
  });