define(["exports","../dom.js","../layoutmanager.js"],function(_exports,_dom,_layoutmanager){Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,_dom=babelHelpers.interopRequireDefault(_dom),_layoutmanager=babelHelpers.interopRequireDefault(_layoutmanager);var enableAnimation=self.Modernizr.cssanimations&&_dom.default.supportsEventListenerOnce();function remove(elem){elem.parentNode.removeChild(elem)}function onAnimationComplete(e){var target=e.target;target===e.currentTarget&&(_dom.default.removeEventListener(target,_dom.default.whichAnimationEvent(),onAnimationComplete,{once:!0}),_dom.default.removeEventListener(target,_dom.default.whichAnimationCancelEvent(),onAnimationComplete,{once:!0}),remove(target))}function setCenterToastInnerHtml(elem,options,tv){var html="";tv||(html+='<div class="toast-text-container">',html+='<div class="toast-large-text toast-large-text-spacer">&nbsp;</div>',html+="</div>"),html+='<i class="md-icon toast-large-icon">'+options.icon+"</i>",html+=tv?'<div class="toast-text-container toast-text-container-tv">':'<div class="toast-text-container">',html+='<h2 class="toast-large-text">'+options.text+"</h2>",options.secondaryText&&(html+=tv?'<div class="toast-large-sub-text toast-large-sub-text-tv">':'<div class="toast-large-sub-text">',html+=options.secondaryText+"</div>"),html+="</div>",elem.innerHTML=html}function _default(options){require(["css!modules/toast/toast"]).then(function(){"string"==typeof options&&(options={text:options});var elem=document.createElement("div");options.icon?(_layoutmanager.default.tv?(elem.classList.add("toast","toast-large","toast-large-tv"),setCenterToastInnerHtml(elem,options,!0)):(elem.classList.add("toast","toast-large"),setCenterToastInnerHtml(elem,options)),options.secondaryText&&elem.classList.add("toast-large-withsecondarytext")):(elem.classList.add("toast","toast-corner"),elem.innerHTML=options.text),enableAnimation?(_dom.default.addEventListener(elem,_dom.default.whichAnimationEvent(),onAnimationComplete,{once:!0}),_dom.default.addEventListener(elem,_dom.default.whichAnimationCancelEvent(),onAnimationComplete,{once:!0})):function(elem,timeoutMs){setTimeout(function(){remove(elem)},timeoutMs+300)}(elem,3e3),document.body.appendChild(elem)})}_exports.default=_default});