"use strict";var utils=this.utils||{};utils.status=function(){function clearHideTimeout(){null!==timeoutID&&(window.clearTimeout(timeoutID),timeoutID=null)}function show(message,duration){if(clearHideTimeout(),content.innerHTML="","string"==typeof message)content.textContent=message;else try{content.appendChild(message)}catch(ex){console.error("DOMException: "+ex.message)}section.classList.remove("hidden"),section.classList.add("onviewport"),timeoutID=window.setTimeout(hide,duration||DISPLAYED_TIME)}function animationEnd(evt){var eventName="status-showed";"hide"===evt.animationName&&(clearHideTimeout(),section.classList.add("hidden"),eventName="status-hidden"),window.dispatchEvent(new CustomEvent(eventName))}function hide(){section.classList.remove("onviewport")}function destroy(){section.removeEventListener("animationend",animationEnd),document.body.removeChild(section),clearHideTimeout(),section=content=null}function build(){section=document.createElement("section"),section.setAttribute("role","status"),section.classList.add("hidden"),content=document.createElement("p"),section.appendChild(content),document.body.appendChild(section),section.addEventListener("animationend",animationEnd)}function initialize(){section||build()}var section,content,timeoutID,DISPLAYED_TIME=2e3;return"complete"===document.readyState?initialize():document.addEventListener("DOMContentLoaded",function loaded(){document.removeEventListener("DOMContentLoaded",loaded),initialize()}),{init:initialize,show:show,hide:hide,destroy:destroy,setDuration:function(time){DISPLAYED_TIME=time||DISPLAYED_TIME}}}();