toasters.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. (function webpackUniversalModuleDefinition(root, factory) {
  2. if(typeof exports === 'object' && typeof module === 'object')
  3. module.exports = factory();
  4. else if(typeof define === 'function' && define.amd)
  5. define([], factory);
  6. else if(typeof exports === 'object')
  7. exports["Toast"] = factory();
  8. else
  9. root["Toast"] = factory();
  10. })(window, function() {
  11. return /******/ (function(modules) { // webpackBootstrap
  12. /******/ // The module cache
  13. /******/ var installedModules = {};
  14. /******/
  15. /******/ // The require function
  16. /******/ function __webpack_require__(moduleId) {
  17. /******/
  18. /******/ // Check if module is in cache
  19. /******/ if(installedModules[moduleId]) {
  20. /******/ return installedModules[moduleId].exports;
  21. /******/ }
  22. /******/ // Create a new module (and put it into the cache)
  23. /******/ var module = installedModules[moduleId] = {
  24. /******/ i: moduleId,
  25. /******/ l: false,
  26. /******/ exports: {}
  27. /******/ };
  28. /******/
  29. /******/ // Execute the module function
  30. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  31. /******/
  32. /******/ // Flag the module as loaded
  33. /******/ module.l = true;
  34. /******/
  35. /******/ // Return the exports of the module
  36. /******/ return module.exports;
  37. /******/ }
  38. /******/
  39. /******/
  40. /******/ // expose the modules object (__webpack_modules__)
  41. /******/ __webpack_require__.m = modules;
  42. /******/
  43. /******/ // expose the module cache
  44. /******/ __webpack_require__.c = installedModules;
  45. /******/
  46. /******/ // define getter function for harmony exports
  47. /******/ __webpack_require__.d = function(exports, name, getter) {
  48. /******/ if(!__webpack_require__.o(exports, name)) {
  49. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  50. /******/ }
  51. /******/ };
  52. /******/
  53. /******/ // define __esModule on exports
  54. /******/ __webpack_require__.r = function(exports) {
  55. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  56. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  57. /******/ }
  58. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  59. /******/ };
  60. /******/
  61. /******/ // create a fake namespace object
  62. /******/ // mode & 1: value is a module id, require it
  63. /******/ // mode & 2: merge all properties of value into the ns
  64. /******/ // mode & 4: return value when already ns object
  65. /******/ // mode & 8|1: behave like require
  66. /******/ __webpack_require__.t = function(value, mode) {
  67. /******/ if(mode & 1) value = __webpack_require__(value);
  68. /******/ if(mode & 8) return value;
  69. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  70. /******/ var ns = Object.create(null);
  71. /******/ __webpack_require__.r(ns);
  72. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  73. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  74. /******/ return ns;
  75. /******/ };
  76. /******/
  77. /******/ // getDefaultExport function for compatibility with non-harmony modules
  78. /******/ __webpack_require__.n = function(module) {
  79. /******/ var getter = module && module.__esModule ?
  80. /******/ function getDefault() { return module['default']; } :
  81. /******/ function getModuleExports() { return module; };
  82. /******/ __webpack_require__.d(getter, 'a', getter);
  83. /******/ return getter;
  84. /******/ };
  85. /******/
  86. /******/ // Object.prototype.hasOwnProperty.call
  87. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  88. /******/
  89. /******/ // __webpack_public_path__
  90. /******/ __webpack_require__.p = "";
  91. /******/
  92. /******/
  93. /******/ // Load entry module and return exports
  94. /******/ return __webpack_require__(__webpack_require__.s = "./src/index.js");
  95. /******/ })
  96. /************************************************************************/
  97. /******/ ({
  98. /***/ "./node_modules/css-loader/dist/cjs.js!./src/index.css":
  99. /*!*************************************************************!*\
  100. !*** ./node_modules/css-loader/dist/cjs.js!./src/index.css ***!
  101. \*************************************************************/
  102. /*! no static exports found */
  103. /***/ (function(module, exports, __webpack_require__) {
  104. eval("// Imports\nvar ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.i, \":root {\\n\\t--max-width: 250px;\\n}\\n\\nbody {\\n\\tpadding: 0;\\n\\tmargin: 0;\\n}\\n\\n#toasts-container {\\n\\tposition: fixed;\\n\\ttop: 20px;\\n\\tright: 20px;\\n}\\n\\n#toasts-content {\\n\\tdisplay: flex;\\n\\tflex-direction: column;\\n}\\n\\n#toasts-container.position-left {\\n\\tright: unset;\\n\\tleft: 20px;\\n\\talign-items: flex-start;\\n}\\n\\n#toasts-container.position-right {\\n\\tleft: unset;\\n\\tright: 20px;\\n\\talign-items: flex-end;\\n}\\n\\n#toasts-container.position-top {\\n\\tbottom: unset;\\n\\ttop: 20px;\\n\\tjustify-content: flex-start;\\n}\\n\\n#toasts-container.position-bottom {\\n\\ttop: unset;\\n\\tbottom: 20px;\\n\\tjustify-content: flex-end;\\n}\\n\\n.night-mode .toast {\\n\\tbackground-color: rgb(51, 51, 51) !important;\\n\\tcolor: #fff !important;\\n\\tborder: 0 !important;\\n}\\n\\n.toast {\\n\\tuser-select: none;\\n\\tz-index: 10000 !important;\\n\\tcursor: pointer;\\n\\ttop: 0;\\n\\theight: auto;\\n\\tpadding: 10px 25px;\\n\\tfont-size: 1rem;\\n\\tfont-weight: 300;\\n\\twidth: var(--max-width);\\n\\tposition: relative;\\n border: 1px solid rgb(195, 193, 195);\\n box-shadow: 0 14px 28px rgb(0 0 0 / 25%), 0 10px 10px rgb(0 0 0 / 22%);\\n background-color: #fff;\\n\\tborder-radius: .25rem;\\n line-height: 1.4;\\n\\tfont-family: sans-serif;\\n}\\n\\n.toast:not(:first-of-type) {\\n\\tmargin-top: 5px;\\n}\\n\", \"\"]);\n// Exports\nmodule.exports = exports;\n\n\n//# sourceURL=webpack://Toast/./src/index.css?./node_modules/css-loader/dist/cjs.js");
  105. /***/ }),
  106. /***/ "./node_modules/css-loader/dist/runtime/api.js":
  107. /*!*****************************************************!*\
  108. !*** ./node_modules/css-loader/dist/runtime/api.js ***!
  109. \*****************************************************/
  110. /*! no static exports found */
  111. /***/ (function(module, exports, __webpack_require__) {
  112. "use strict";
  113. eval("\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\n// eslint-disable-next-line func-names\nmodule.exports = function (useSourceMap) {\n var list = []; // return the list of modules as css string\n\n list.toString = function toString() {\n return this.map(function (item) {\n var content = cssWithMappingToString(item, useSourceMap);\n\n if (item[2]) {\n return \"@media \".concat(item[2], \" {\").concat(content, \"}\");\n }\n\n return content;\n }).join('');\n }; // import a list of modules into the list\n // eslint-disable-next-line func-names\n\n\n list.i = function (modules, mediaQuery, dedupe) {\n if (typeof modules === 'string') {\n // eslint-disable-next-line no-param-reassign\n modules = [[null, modules, '']];\n }\n\n var alreadyImportedModules = {};\n\n if (dedupe) {\n for (var i = 0; i < this.length; i++) {\n // eslint-disable-next-line prefer-destructuring\n var id = this[i][0];\n\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n\n for (var _i = 0; _i < modules.length; _i++) {\n var item = [].concat(modules[_i]);\n\n if (dedupe && alreadyImportedModules[item[0]]) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n if (mediaQuery) {\n if (!item[2]) {\n item[2] = mediaQuery;\n } else {\n item[2] = \"\".concat(mediaQuery, \" and \").concat(item[2]);\n }\n }\n\n list.push(item);\n }\n };\n\n return list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n var content = item[1] || ''; // eslint-disable-next-line prefer-destructuring\n\n var cssMapping = item[3];\n\n if (!cssMapping) {\n return content;\n }\n\n if (useSourceMap && typeof btoa === 'function') {\n var sourceMapping = toComment(cssMapping);\n var sourceURLs = cssMapping.sources.map(function (source) {\n return \"/*# sourceURL=\".concat(cssMapping.sourceRoot || '').concat(source, \" */\");\n });\n return [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n }\n\n return [content].join('\\n');\n} // Adapted from convert-source-map (MIT)\n\n\nfunction toComment(sourceMap) {\n // eslint-disable-next-line no-undef\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n return \"/*# \".concat(data, \" */\");\n}\n\n//# sourceURL=webpack://Toast/./node_modules/css-loader/dist/runtime/api.js?");
  114. /***/ }),
  115. /***/ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js":
  116. /*!****************************************************************************!*\
  117. !*** ./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js ***!
  118. \****************************************************************************/
  119. /*! no static exports found */
  120. /***/ (function(module, exports, __webpack_require__) {
  121. "use strict";
  122. eval("\n\nvar isOldIE = function isOldIE() {\n var memo;\n return function memorize() {\n if (typeof memo === 'undefined') {\n // Test for IE <= 9 as proposed by Browserhacks\n // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n // Tests for existence of standard globals is to allow style-loader\n // to operate correctly into non-standard environments\n // @see https://github.com/webpack-contrib/style-loader/issues/177\n memo = Boolean(window && document && document.all && !window.atob);\n }\n\n return memo;\n };\n}();\n\nvar getTarget = function getTarget() {\n var memo = {};\n return function memorize(target) {\n if (typeof memo[target] === 'undefined') {\n var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself\n\n if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n try {\n // This will throw an exception if access to iframe is blocked\n // due to cross-origin restrictions\n styleTarget = styleTarget.contentDocument.head;\n } catch (e) {\n // istanbul ignore next\n styleTarget = null;\n }\n }\n\n memo[target] = styleTarget;\n }\n\n return memo[target];\n };\n}();\n\nvar stylesInDom = [];\n\nfunction getIndexByIdentifier(identifier) {\n var result = -1;\n\n for (var i = 0; i < stylesInDom.length; i++) {\n if (stylesInDom[i].identifier === identifier) {\n result = i;\n break;\n }\n }\n\n return result;\n}\n\nfunction modulesToDom(list, options) {\n var idCountMap = {};\n var identifiers = [];\n\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = options.base ? item[0] + options.base : item[0];\n var count = idCountMap[id] || 0;\n var identifier = \"\".concat(id, \" \").concat(count);\n idCountMap[id] = count + 1;\n var index = getIndexByIdentifier(identifier);\n var obj = {\n css: item[1],\n media: item[2],\n sourceMap: item[3]\n };\n\n if (index !== -1) {\n stylesInDom[index].references++;\n stylesInDom[index].updater(obj);\n } else {\n stylesInDom.push({\n identifier: identifier,\n updater: addStyle(obj, options),\n references: 1\n });\n }\n\n identifiers.push(identifier);\n }\n\n return identifiers;\n}\n\nfunction insertStyleElement(options) {\n var style = document.createElement('style');\n var attributes = options.attributes || {};\n\n if (typeof attributes.nonce === 'undefined') {\n var nonce = true ? __webpack_require__.nc : undefined;\n\n if (nonce) {\n attributes.nonce = nonce;\n }\n }\n\n Object.keys(attributes).forEach(function (key) {\n style.setAttribute(key, attributes[key]);\n });\n\n if (typeof options.insert === 'function') {\n options.insert(style);\n } else {\n var target = getTarget(options.insert || 'head');\n\n if (!target) {\n throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");\n }\n\n target.appendChild(style);\n }\n\n return style;\n}\n\nfunction removeStyleElement(style) {\n // istanbul ignore if\n if (style.parentNode === null) {\n return false;\n }\n\n style.parentNode.removeChild(style);\n}\n/* istanbul ignore next */\n\n\nvar replaceText = function replaceText() {\n var textStore = [];\n return function replace(index, replacement) {\n textStore[index] = replacement;\n return textStore.filter(Boolean).join('\\n');\n };\n}();\n\nfunction applyToSingletonTag(style, index, remove, obj) {\n var css = remove ? '' : obj.media ? \"@media \".concat(obj.media, \" {\").concat(obj.css, \"}\") : obj.css; // For old IE\n\n /* istanbul ignore if */\n\n if (style.styleSheet) {\n style.styleSheet.cssText = replaceText(index, css);\n } else {\n var cssNode = document.createTextNode(css);\n var childNodes = style.childNodes;\n\n if (childNodes[index]) {\n style.removeChild(childNodes[index]);\n }\n\n if (childNodes.length) {\n style.insertBefore(cssNode, childNodes[index]);\n } else {\n style.appendChild(cssNode);\n }\n }\n}\n\nfunction applyToTag(style, options, obj) {\n var css = obj.css;\n var media = obj.media;\n var sourceMap = obj.sourceMap;\n\n if (media) {\n style.setAttribute('media', media);\n } else {\n style.removeAttribute('media');\n }\n\n if (sourceMap && typeof btoa !== 'undefined') {\n css += \"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), \" */\");\n } // For old IE\n\n /* istanbul ignore if */\n\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n while (style.firstChild) {\n style.removeChild(style.firstChild);\n }\n\n style.appendChild(document.createTextNode(css));\n }\n}\n\nvar singleton = null;\nvar singletonCounter = 0;\n\nfunction addStyle(obj, options) {\n var style;\n var update;\n var remove;\n\n if (options.singleton) {\n var styleIndex = singletonCounter++;\n style = singleton || (singleton = insertStyleElement(options));\n update = applyToSingletonTag.bind(null, style, styleIndex, false);\n remove = applyToSingletonTag.bind(null, style, styleIndex, true);\n } else {\n style = insertStyleElement(options);\n update = applyToTag.bind(null, style, options);\n\n remove = function remove() {\n removeStyleElement(style);\n };\n }\n\n update(obj);\n return function updateStyle(newObj) {\n if (newObj) {\n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {\n return;\n }\n\n update(obj = newObj);\n } else {\n remove();\n }\n };\n}\n\nmodule.exports = function (list, options) {\n options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>\n // tags it will allow on a page\n\n if (!options.singleton && typeof options.singleton !== 'boolean') {\n options.singleton = isOldIE();\n }\n\n list = list || [];\n var lastIdentifiers = modulesToDom(list, options);\n return function update(newList) {\n newList = newList || [];\n\n if (Object.prototype.toString.call(newList) !== '[object Array]') {\n return;\n }\n\n for (var i = 0; i < lastIdentifiers.length; i++) {\n var identifier = lastIdentifiers[i];\n var index = getIndexByIdentifier(identifier);\n stylesInDom[index].references--;\n }\n\n var newLastIdentifiers = modulesToDom(newList, options);\n\n for (var _i = 0; _i < lastIdentifiers.length; _i++) {\n var _identifier = lastIdentifiers[_i];\n\n var _index = getIndexByIdentifier(_identifier);\n\n if (stylesInDom[_index].references === 0) {\n stylesInDom[_index].updater();\n\n stylesInDom.splice(_index, 1);\n }\n }\n\n lastIdentifiers = newLastIdentifiers;\n };\n};\n\n//# sourceURL=webpack://Toast/./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js?");
  123. /***/ }),
  124. /***/ "./src/index.css":
  125. /*!***********************!*\
  126. !*** ./src/index.css ***!
  127. \***********************/
  128. /*! no static exports found */
  129. /***/ (function(module, exports, __webpack_require__) {
  130. eval("var api = __webpack_require__(/*! ../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ \"./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n var content = __webpack_require__(/*! !../node_modules/css-loader/dist/cjs.js!./index.css */ \"./node_modules/css-loader/dist/cjs.js!./src/index.css\");\n\n content = content.__esModule ? content.default : content;\n\n if (typeof content === 'string') {\n content = [[module.i, content, '']];\n }\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nmodule.exports = content.locals || {};\n\n//# sourceURL=webpack://Toast/./src/index.css?");
  131. /***/ }),
  132. /***/ "./src/index.js":
  133. /*!**********************!*\
  134. !*** ./src/index.js ***!
  135. \**********************/
  136. /*! exports provided: default */
  137. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  138. "use strict";
  139. eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _index_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index.css */ \"./src/index.css\");\n/* harmony import */ var _index_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_index_css__WEBPACK_IMPORTED_MODULE_0__);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (__webpack_require__(/*! ./toasters */ \"./src/toasters.js\")[\"default\"]);\n\n//# sourceURL=webpack://Toast/./src/index.js?");
  140. /***/ }),
  141. /***/ "./src/toasters.js":
  142. /*!*************************!*\
  143. !*** ./src/toasters.js ***!
  144. \*************************/
  145. /*! exports provided: default */
  146. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  147. "use strict";
  148. eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Toast; });\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar container = document.getElementById(\"toasts-content\");\nvar incrementer = 0;\n\nvar Toast = /*#__PURE__*/function () {\n // should add type checking\n function Toast(_ref) {\n var content = _ref.content,\n persistent = _ref.persistent,\n interactable = _ref.interactable,\n timeout = _ref.timeout;\n\n _classCallCheck(this, Toast);\n\n this.identifier = \"toast-\".concat(incrementer);\n incrementer++;\n this.visible = false;\n this.content = content;\n this.persistent = persistent !== undefined ? persistent : false;\n this.timeout = timeout ? timeout : 6000;\n this.interactable = interactable !== undefined ? interactable : true;\n if (!this.persistent) this.startTimer();\n if (this.interactable) this.dragListener();\n }\n\n _createClass(Toast, [{\n key: \"content\",\n get: function get() {\n return this._content;\n },\n set: function set(value) {\n this._content = value;\n\n if (!this.visible) {\n container.insertAdjacentHTML(\"beforeend\", \"<div class=\\\"toast \".concat(this.identifier, \"\\\">\").concat(this.content, \"</div>\"));\n this.find();\n } else this.element.innerHTML = this.content;\n\n this.visible = true;\n }\n }, {\n key: \"startTimer\",\n value: function startTimer() {\n setTimeout(this.destroy.bind(this), this.timeout);\n }\n }, {\n key: \"dragListener\",\n value: function dragListener() {\n var _this = this;\n\n /** handles mouse drag **/\n this.element.addEventListener(\"mousedown\", function (event) {\n var initialX = _this.element.getBoundingClientRect().x;\n\n var shiftX = event.clientX - initialX;\n\n var move = function move(_ref2) {\n var pageX = _ref2.pageX;\n var opacity = 1.2 - Math.abs(pageX - shiftX - initialX) / 100;\n _this.element.style.opacity = opacity;\n _this.element.style.left = \"\".concat(pageX - shiftX - initialX, \"px\");\n };\n\n window.addEventListener(\"mousemove\", move, false);\n window.addEventListener(\"mouseup\", function () {\n _this.handleInputLoss();\n\n window.removeEventListener(\"mousemove\", move, false);\n }, false);\n }, false);\n /** handles touch devices **/\n\n this.element.addEventListener(\"touchstart\", function (event) {\n var initialX = _this.element.getBoundingClientRect().x;\n\n var shiftX = event.touches[0].clientX - initialX;\n\n var move = function move(_ref3) {\n var touches = _ref3.touches;\n\n // if multiple touches on device, none are registered to the toast anymore\n if (touches.length === 1) {\n var pageX = touches[0].pageX;\n var opacity = 1.2 - Math.abs(pageX - shiftX - initialX) / 100;\n _this.element.style.opacity = opacity;\n _this.element.style.left = \"\".concat(pageX - shiftX - initialX, \"px\");\n }\n };\n\n window.addEventListener(\"touchmove\", move, false);\n window.addEventListener(\"touchend\", function () {\n _this.handleInputLoss();\n\n window.removeEventListener(\"touchmove\", move, false);\n }, false);\n }, false);\n }\n }, {\n key: \"handleInputLoss\",\n value: function handleInputLoss() {\n var _this2 = this;\n\n if (this.element.style.opacity < 0.15) return this.destroy();else {\n this.element.style.opacity = 1;\n this.element.style.left = 0;\n this.element.style.transition = \"opacity .2s linear, left .2s linear\";\n setTimeout(function () {\n _this2.element.style.transition = null;\n }, 200);\n }\n }\n }, {\n key: \"find\",\n value: function find() {\n for (var i = 0; i < container.childNodes.length; i++) {\n if (container.childNodes[i].classList.contains(this.identifier)) return this.element = container.childNodes[i];\n }\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.element.remove();\n }\n }, {\n key: \"show\",\n value: function show() {\n if (!this.visible) {\n this.element.style.display = \"block\";\n this.visible = true;\n }\n }\n }, {\n key: \"hide\",\n value: function hide() {\n if (this.visible) {\n this.element.style.display = \"none\";\n this.visible = false;\n }\n }\n }]);\n\n return Toast;\n}();\n\n\n\n//# sourceURL=webpack://Toast/./src/toasters.js?");
  149. /***/ })
  150. /******/ });
  151. });