You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

9 lines
7.2 KiB

11 months ago
  1. var t="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof self?self:global;var o={};
  2. /*!
  3. * Toastify js 1.12.0
  4. * https://github.com/apvarun/toastify-js
  5. * @license MIT licensed
  6. *
  7. * Copyright (C) 2018 Varun A P
  8. */(function(t,i){o?o=i():t.Toastify=i()})(o,(function(o){var Toastify=function(t){return new Toastify.lib.init(t)},i="1.12.0";Toastify.defaults={oldestFirst:true,text:"Toastify is awesome!",node:void 0,duration:3e3,selector:void 0,callback:function(){},destination:void 0,newWindow:false,close:false,gravity:"toastify-top",positionLeft:false,position:"",backgroundColor:"",avatar:"",className:"",stopOnFocus:true,onClick:function(){},offset:{x:0,y:0},escapeMarkup:true,ariaLive:"polite",style:{background:""}};Toastify.lib=Toastify.prototype={toastify:i,constructor:Toastify,init:function(o){o||(o={});(this||t).options={};(this||t).toastElement=null;(this||t).options.text=o.text||Toastify.defaults.text;(this||t).options.node=o.node||Toastify.defaults.node;(this||t).options.duration=0===o.duration?0:o.duration||Toastify.defaults.duration;(this||t).options.selector=o.selector||Toastify.defaults.selector;(this||t).options.callback=o.callback||Toastify.defaults.callback;(this||t).options.destination=o.destination||Toastify.defaults.destination;(this||t).options.newWindow=o.newWindow||Toastify.defaults.newWindow;(this||t).options.close=o.close||Toastify.defaults.close;(this||t).options.gravity="bottom"===o.gravity?"toastify-bottom":Toastify.defaults.gravity;(this||t).options.positionLeft=o.positionLeft||Toastify.defaults.positionLeft;(this||t).options.position=o.position||Toastify.defaults.position;(this||t).options.backgroundColor=o.backgroundColor||Toastify.defaults.backgroundColor;(this||t).options.avatar=o.avatar||Toastify.defaults.avatar;(this||t).options.className=o.className||Toastify.defaults.className;(this||t).options.stopOnFocus=void 0===o.stopOnFocus?Toastify.defaults.stopOnFocus:o.stopOnFocus;(this||t).options.onClick=o.onClick||Toastify.defaults.onClick;(this||t).options.offset=o.offset||Toastify.defaults.offset;(this||t).options.escapeMarkup=void 0!==o.escapeMarkup?o.escapeMarkup:Toastify.defaults.escapeMarkup;(this||t).options.ariaLive=o.ariaLive||Toastify.defaults.ariaLive;(this||t).options.style=o.style||Toastify.defaults.style;o.backgroundColor&&((this||t).options.style.background=o.backgroundColor);return this||t},buildToast:function(){if(!(this||t).options)throw"Toastify is not initialized";var o=document.createElement("div");o.className="toastify on "+(this||t).options.className;if(!(this||t).options.position)if(true===(this||t).options.positionLeft){o.className+=" toastify-left";console.warn("Property `positionLeft` will be depreciated in further versions. Please use `position` instead.")}else o.className+=" toastify-right";else o.className+=" toastify-"+(this||t).options.position;o.className+=" "+(this||t).options.gravity;(this||t).options.backgroundColor&&console.warn('DEPRECATION NOTICE: "backgroundColor" is being deprecated. Please use the "style.background" property.');for(var i in(this||t).options.style)o.style[i]=(this||t).options.style[i];(this||t).options.ariaLive&&o.setAttribute("aria-live",(this||t).options.ariaLive);if((this||t).options.node&&(this||t).options.node.nodeType===Node.ELEMENT_NODE)o.appendChild((this||t).options.node);else{(this||t).options.escapeMarkup?o.innerText=(this||t).options.text:o.innerHTML=(this||t).options.text;if(""!==(this||t).options.avatar){var e=document.createElement("img");e.src=(this||t).options.avatar;e.className="toastify-avatar";"left"==(this||t).options.position||true===(this||t).options.positionLeft?o.appendChild(e):o.insertAdjacentElement("afterbegin",e)}}if(true===(this||t).options.close){var s=document.createElement("button");s.type="button";s.setAttribute("aria-label","Close");s.className="toast-close";s.innerHTML="✖";s.addEventListener("click",function(o){o.stopPropagation();this.removeElement((this||t).toastElement);window.clearTimeout((this||t).toastElement.timeOutValue)}.bind(this||t));var n=window.innerWidth>0?window.innerWidth:screen.width;("left"==(this||t).options.position||true===(this||t).options.positionLeft)&&n>360?o.insertAdjacentElement("afterbegin",s):o.appendChild(s)}if((this||t).options.stopOnFocus&&(this||t).options.duration>0){var