import PNotify from"./PNotify.js";function data(){return Object.assign({_notice:null,_options:{}},PNotify.modules.History.defaults)}var methods={initModule(t){if(this.set(t),this.get().history){const{_notice:t}=this.get();t.get().destroy&&t.set({destroy:!1})}},beforeOpen(){const{maxInStack:t,_options:e}=this.get();if(t===1/0)return;const i=e.stack;if(!1!==i&&PNotify.notices&&PNotify.notices.length>t){const e="top"===i.push,o=[];let s=0;for(let n=e?0:PNotify.notices.length-1;e?n=0;e?n++:n--)-1!==["opening","open"].indexOf(PNotify.notices[n].get()._state)&&PNotify.notices[n].get().stack===i&&(s>=t?o.push(PNotify.notices[n]):s++);for(let t=0;tnew t({target:document.body})),t.showLast=(t=>{if(void 0===t&&(t=PNotify.defaultStack),!1===t)return;const e="top"===t.push;let i,o=e?0:PNotify.notices.length-1;do{if(!(i=PNotify.notices[o]))return;o+=e?1:-1}while(i.get().stack!==t||!i.get()._modules.History.get().history||"opening"===i.get()._state||"open"===i.get()._state);i.open()}),t.showAll=(t=>{if(void 0===t&&(t=PNotify.defaultStack),!1!==t)for(let e=0;e