Socket
Socket
Sign inDemoInstall

vue-snotify

Package Overview
Dependencies
10
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.3 to 3.0.0

components/Snotify/index.d.ts

17

package.json
{
"name": "vue-snotify",
"version": "2.0.3",
"version": "3.0.0",
"description": "A Vue.js toast notifications",

@@ -8,12 +8,3 @@ "main": "vue-snotify.common.js",

"unpkg": "vue-snotify.js",
"typings": "types/index.d.ts",
"files": [
"styles",
"types",
"vue-snotify.common.js",
"vue-snotify.esm.js",
"vue-snotify.js",
"vue-snotify.min.js",
"README.md"
],
"typings": "index.d.ts",
"keywords": [

@@ -61,5 +52,5 @@ "vue",

"engines": {
"node": ">= 8.0.0",
"npm": ">= 5.0.0"
"node": ">= 6.0.0",
"npm": ">= 4.0.0"
}
}

@@ -48,10 +48,5 @@ # vue-snotify

- dark [unpkg.com](https://unpkg.com/vue-snotify@latest/styles/dark.css) | [jsDelivr.com](https://cdn.jsdelivr.net/npm/vue-snotify@latest/styles/dark.css)
- SCSS
- material [unpkg.com](https://unpkg.com/vue-snotify@latest/styles/material.css) | [jsDelivr.com](https://cdn.jsdelivr.net/npm/vue-snotify@latest/styles/material.css)
- simple [unpkg.com](https://unpkg.com/vue-snotify@latest/styles/simple.css) | [jsDelivr.com](https://cdn.jsdelivr.net/npm/vue-snotify@latest/styles/simple.css)
- dark [unpkg.com](https://unpkg.com/vue-snotify@latest/styles/dark.css) | [jsDelivr.com](https://cdn.jsdelivr.net/npm/vue-snotify@latest/styles/dark.css)
## License
MIT © [artemsky](mailto:mr.artemsky@gmail.com)

@@ -1,2 +0,2 @@

export * from "./vue";
export * from "./vue-snotify";
export { SnotifyEvent } from './event.type';
export { SnotifyType } from './snotify.type';
/**
* vue-snotify v2.0.3
* vue-snotify v3.0.0
* (c) 2017 artemsky <mr.artemsky@gmail.com>
* @license MIT
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],e):e(t["vue-snotify"]={},t.Vue)}(this,function(t,e){"use strict";function n(t){return t&&"object"===(void 0===t?"undefined":p(t))&&!Array.isArray(t)&&null!==t}function o(){for(var t={},e=arguments.length,i=Array(e),s=0;s<e;s++)i[s]=arguments[s];if(!i.length)return t;for(;i.length>0;){var a=i.shift();if(n(a))for(var r in a)n(a[r])?t[r]=o(t[r],a[r]):Object.assign(t,m({},r,a[r]))}return t}function i(){return Math.floor(Math.random()*(Date.now()-1))+1}function s(t){var e={};for(var n in u)u.hasOwnProperty(n)&&(e[u[n]]=[]);return t.forEach(function(t){e[t.config.position].push(t)}),e}function a(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.filter("truncate",function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:40,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...";return t.length>e?t.substring(0,e)+n:t}),t.component("vue-snotify",b),v.setConfig(e.config||null,e.options||null),t.prototype.$snotify=v}e=e&&e.hasOwnProperty("default")?e.default:e;var r={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("svg",{staticStyle:{"enable-background":"new 0 0 48 48"},attrs:{xmlns:"http://www.w3.org/2000/svg",version:"1.1",x:"0px",y:"0px",viewBox:"0 0 512 512","xml:space":"preserve",width:"48px",height:"48px"}},["warning"===t.type?n("g",{staticClass:"snotify-icon__warning"},[n("path",{attrs:{d:"M256,512c141.15,0,256-114.84,256-256S397.15,0,256,0,0,114.84,0,256,114.85,512,256,512Zm0-480.49c123.79,0,224.49,100.71,224.49,224.49S379.79,480.49,256,480.49,31.51,379.79,31.51,256,132.21,31.51,256,31.51Z"}}),n("circle",{attrs:{cx:"260.08",cy:"343.87",r:"26.35"}}),n("path",{attrs:{d:"M254.68,278.39a15.76,15.76,0,0,0,15.75-15.75V128.72a15.75,15.75,0,1,0-31.51,0V262.63A15.76,15.76,0,0,0,254.68,278.39Z"}})]):"success"===t.type?n("g",{staticClass:"snotify-icon__success"},[n("path",{attrs:{d:"M256,0C114.85,0,0,114.84,0,256S114.85,512,256,512,512,397.16,512,256,397.15,0,256,0Zm0,492.31c-130.29,0-236.31-106-236.31-236.31S125.71,19.69,256,19.69,492.31,125.71,492.31,256,386.29,492.31,256,492.31Z"}}),n("path",{staticClass:"cls-1",attrs:{d:"M376.64,151,225.31,321.24l-91.17-72.93a9.85,9.85,0,0,0-12.3,15.38l98.46,78.77a9.86,9.86,0,0,0,13.52-1.15L391.36,164.08A9.85,9.85,0,0,0,376.64,151Z"}})]):"info"===t.type?n("g",{staticClass:"snotify-icon__info"},[n("path",{attrs:{d:"M256,0C114.84,0,0,114.84,0,256S114.84,512,256,512,512,397.16,512,256,397.15,0,256,0Zm0,478.43C133.35,478.43,33.57,378.64,33.57,256S133.35,33.58,256,33.58,478.42,133.36,478.42,256,378.64,478.43,256,478.43Z"}}),n("path",{attrs:{d:"M251.26,161.24a22.39,22.39,0,1,0-22.38-22.39A22.39,22.39,0,0,0,251.26,161.24Z"}}),n("path",{attrs:{d:"M286.84,357.87h-14v-160A16.79,16.79,0,0,0,256,181.05H225.17a16.79,16.79,0,0,0,0,33.58h14.05V357.87H225.17a16.79,16.79,0,0,0,0,33.57h61.67a16.79,16.79,0,1,0,0-33.57Z"}})]):"error"===t.type?n("g",{staticClass:"snotify-icon__error"},[n("path",{attrs:{d:"M437,75A256,256,0,1,0,75,437,256,256,0,1,0,437,75ZM416.43,416.43a226.82,226.82,0,0,1-320.86,0C7.11,328,7.11,184,95.57,95.57a226.82,226.82,0,0,1,320.86,0C504.89,184,504.89,328,416.43,416.43Z"}}),n("path",{attrs:{d:"M368.81,143.19a14.5,14.5,0,0,0-20.58,0L256,235.42l-92.23-92.23a14.55,14.55,0,0,0-20.58,20.58L235.42,256l-92.23,92.23a14.6,14.6,0,0,0,10.24,24.89,14.19,14.19,0,0,0,10.24-4.31l92.23-92.23,92.23,92.23a14.64,14.64,0,0,0,10.24,4.31,14,14,0,0,0,10.24-4.31,14.5,14.5,0,0,0,0-20.58l-92-92.23,92.23-92.23A14.5,14.5,0,0,0,368.81,143.19Z"}})]):"async"===t.type?n("g",{staticClass:"snotify-icon__async"},[n("path",{attrs:{d:"M256,0a32,32,0,0,0-32,32V96a32,32,0,0,0,64,0V32A32,32,0,0,0,256,0Zm0,384a32,32,0,0,0-32,32v64a32,32,0,0,0,64,0V416A32,32,0,0,0,256,384ZM391.74,165.5,437,120.22A32,32,0,0,0,391.74,75L346.5,120.22a32,32,0,0,0,45.25,45.28Zm-271.52,181L75,391.74A32,32,0,0,0,120.22,437l45.25-45.25a32,32,0,0,0-45.25-45.25Zm0-271.52A32,32,0,1,0,75,120.22l45.25,45.28a32,32,0,1,0,45.25-45.28ZM391.74,346.5a32,32,0,0,0-45.25,45.25L391.74,437A32,32,0,0,0,437,391.74ZM480,224H416a32,32,0,0,0,0,64h64a32,32,0,0,0,0-64ZM128,256a32,32,0,0,0-32-32H32a32,32,0,0,0,0,64H96A32,32,0,0,0,128,256Z"}})]):t._e()])},staticRenderFns:[],props:["type"]},c={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("span",{staticClass:"snotifyToast__input",class:{"snotifyToast__input--filled":t.isPromptFocused}},[n("input",{staticClass:"snotifyToast__input__field",attrs:{type:"text",id:t.id},on:{input:t.valueChanged,focus:function(e){t.isPromptFocused=!0},blur:function(e){t.isPromptFocused=!!t.length}}}),n("label",{staticClass:"snotifyToast__input__label",attrs:{for:t.id}},[n("span",{staticClass:"snotifyToast__input__labelContent"},[t._v(t._s(t._f("truncate")(t.placeholder)))])])])},staticRenderFns:[],props:["placeholder"],data:function(){return{id:545,isPromptFocused:!1,length:0}},methods:{valueChanged:function(t){var e=t.target.value.trim();this.length=e.length,this.$emit("valueChanged",e)}}},f={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"snotifyToast__buttons"},t._l(t.buttons,function(e){return n("button",{class:{"snotifyToast__buttons--bold":e.bold},attrs:{type:"button"},on:{click:function(n){e.action&&e.action(t.id,t.value)}}},[t._v(t._s(e.text))])}))},staticRenderFns:[],props:["buttons","value","id"]},u={leftTop:"leftTop",leftCenter:"leftCenter",leftBottom:"leftBottom",rightTop:"rightTop",rightCenter:"rightCenter",rightBottom:"rightBottom",centerTop:"centerTop",centerCenter:"centerCenter",centerBottom:"centerBottom"},l={mounted:"mounted",destroyed:"destroyed",beforeDestroy:"beforeDestroy",onInput:"onInput",onClick:"onClick",onHoverEnter:"onHoverEnter",onHoverLeave:"onHoverLeave",beforeShow:"beforeShow",shown:"shown",beforeHide:"beforeHide",hidden:"hidden"},h={SIMPLE:"simple",SUCCESS:"success",ERROR:"error",WARNING:"warning",INFO:"info",ASYNC:"async",CONFIRM:"confirm",PROMPT:"prompt"},p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},d=(function(){function t(t){this.value=t}function e(e){function n(i,s){try{var a=e[i](s),r=a.value;r instanceof t?Promise.resolve(r.value).then(function(t){n("next",t)},function(t){n("throw",t)}):o(a.done?"return":"normal",a.value)}catch(t){o("throw",t)}}function o(t,e){switch(t){case"return":i.resolve({value:e,done:!0});break;case"throw":i.reject(e);break;default:i.resolve({value:e,done:!1})}(i=i.next)?n(i.key,i.arg):s=null}var i,s;this._invoke=function(t,e){return new Promise(function(o,a){var r={key:t,arg:e,resolve:o,reject:a,next:null};s?s=s.next=r:(i=s=r,n(t,e))})},"function"!=typeof e.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(e.prototype[Symbol.asyncIterator]=function(){return this}),e.prototype.next=function(t){return this._invoke("next",t)},e.prototype.throw=function(t){return this._invoke("throw",t)},e.prototype.return=function(t){return this._invoke("return",t)}}(),function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}),m=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},g=function t(e,n,o,i){d(this,t),this.id=e,this.title=n,this.body=o,this.config=i},y=function(t){var e;return e={},m(e,u.leftTop,{enter:"fadeInLeft",exit:"fadeOutLeft",time:t}),m(e,u.leftCenter,{enter:"fadeInLeft",exit:"fadeOutLeft",time:t}),m(e,u.leftBottom,{enter:"fadeInLeft",exit:"fadeOutLeft",time:t}),m(e,u.rightTop,{enter:"fadeInRight",exit:"fadeOutRight",time:t}),m(e,u.rightCenter,{enter:"fadeInRight",exit:"fadeOutRight",time:t}),m(e,u.rightBottom,{enter:"fadeInRight",exit:"fadeOutRight",time:t}),m(e,u.centerTop,{enter:"fadeInDown",exit:"fadeOutUp",time:t}),m(e,u.centerCenter,{enter:"fadeIn",exit:"fadeOut",time:t}),m(e,u.centerBottom,{enter:"fadeInUp",exit:"fadeOutDown",time:t}),e}(400),v=new e({data:function(){return{notifications:[],config:{showProgressBar:!0,timeout:2e3,closeOnClick:!0,pauseOnHover:!0,bodyMaxLength:150,titleMaxLength:16,backdrop:-1,animation:y[u.rightBottom]},options:{newOnTop:!0,position:u.rightBottom,maxOnScreen:8,maxAtPosition:8,maxHeight:300}}},methods:{get:function(t){return this.notifications.find(function(e){return e.id===t})},getAll:function(){return this.notifications.slice()},emit:function(){this.$emit("notificationsChanged",this.getAll())},setConfig:function(t,e){this.options=o(this.options,e),this.config=o(this.config,{animation:y[this.options.position]},t),this.$emit("optionsChanged",this.options)},add:function(t){t.config.position=t.config.position||this.options.position,this.options.newOnTop?this.notifications.unshift(t):this.notifications.push(t),this.emit()},remove:function(t){return t?(this.notifications=this.notifications.filter(function(e){return e.id!==t}),this.emit()):this.clear()},clear:function(){this.notifications=[],this.emit()},create:function(t){var e=i();return this.add(new g(e,t.title,t.body,t.config||null)),e},success:function(t,e,n){return this.create({title:e,body:t,config:o(this.config,{type:h.SUCCESS},n)})},error:function(t,e,n){return this.create({title:e,body:t,config:o(this.config,{type:h.ERROR},n)})},info:function(t,e,n){return this.create({title:e,body:t,config:o(this.config,{type:h.INFO},n)})},warning:function(t,e,n){return this.create({title:e,body:t,config:o(this.config,{type:h.WARNING},n)})},simple:function(t,e,n){return this.create({title:e,body:t,config:o(this.config,{type:h.SIMPLE},n)})},confirm:function(t,e,n){var i=this,s=this.create({title:e,body:t,config:o(this.config,{buttons:[{text:"Ok",action:null,bold:!0},{text:"Cancel",action:function(){return i.remove(s)},bold:!1}]},n,{type:h.CONFIRM,closeOnClick:!1})});return s},prompt:function(t,e,n){var i=this,s=this.create({title:e,body:t,config:o(this.config,{buttons:[{text:"Ok",action:null,bold:!0},{text:"Cancel",action:function(){return i.remove(s)},bold:!1}],placeholder:"Enter answer here..."},n,{timeout:0,closeOnClick:!1,type:h.PROMPT})});return s},html:function(t,e){return this.create({title:null,body:null,config:o(this.config,{type:h.SIMPLE,html:t},e)})},async:function(t,e,n){var i=this,s=this.simple(t,e,{pauseOnHover:!1,closeOnClick:!1,timeout:0,showProgressBar:!1,type:h.ASYNC}),a=this.get(s),r=Object.assign({},a),c=function(t,e){r=e?o(a,e,{config:{type:t}}):o(a,r,{config:{type:t}}),i.$emit("toastChanged",r)};return this.$on(l.mounted,function(t){t.id===s&&n&&n().then(function(t){c(h.SUCCESS,t)}).catch(function(t){c(h.ERROR,t)})}),s}}}),b={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t.backdrop>=0?n("div",{staticClass:"snotify-backdrop",style:{opacity:t.backdrop}}):t._e(),t._l(t.notifications,function(e,o){return n("div",{staticClass:"snotify",class:"snotify-"+o},t._l(e.slice(t.blockSize_a,t.blockSize_b),function(t){return n("toast",{key:t.id,attrs:{toastData:t}})}))})],2)},staticRenderFns:[],data:function(){return{backdrop:-1,positions:u,notifications:{}}},methods:{setOptions:function(t){t.newOnTop?(this.dockSize_a=-t.maxOnScreen,this.dockSize_b=void 0,this.blockSize_a=-t.maxAtPosition,this.blockSize_b=void 0):(this.dockSize_a=0,this.dockSize_b=t.maxOnScreen,this.blockSize_a=0,this.blockSize_b=t.maxAtPosition)}},components:{Toast:{render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{"enter-active-class":"animated "+t.toast.config.animation.enter,"leave-active-class":"animated "+t.toast.config.animation.exit},on:{"before-enter":t.beforeEnter,enter:t.enter,"after-enter":t.afterEnter,"before-leave":t.beforeLeave,leave:t.leave}},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.opacity,expression:"opacity"}],staticClass:"snotifyToast",class:["snotify-"+t.toast.config.type],style:{opacity:t.opacity,"max-height":t.maxHeight+"px","-webkit-animation-duration":t.toast.config.animation.time+"ms","animation-duration":t.toast.config.animation.time+"ms","-webkit-transition":t.toast.config.animation.time+"ms",transition:t.toast.config.animation.time+"ms"},on:{click:t.onClick,mouseenter:t.onMouseEnter,mouseleave:t.onMouseLeave}},[t.toast.config.showProgressBar?n("div",{staticClass:"snotifyToast__progressBar"},[n("span",{staticClass:"snotifyToast__progressBar__percentage",style:{width:t.progress+"%"}})]):t._e(),t.toast.config.html?n("div",{staticClass:"snotifyToast__inner",domProps:{innerHTML:t._s(t.toast.config.html)}}):n("div",{staticClass:"snotifyToast__inner"},[t.toast.title?n("div",{staticClass:"snotifyToast__title"},[t._v(t._s(t._f("truncate")(t.toast.title,t.toast.config.titleMaxLength)))]):t._e(),n("div",{staticClass:"snotifyToast__body"},[t._v(t._s(t._f("truncate")(t.toast.body,t.toast.config.bodyMaxLength)))]),t.toast.config.type===t.promptType?n("snotify-prompt",{attrs:{placeholder:t.toast.config.placeholder},on:{valueChanged:t.promptValueChanged}}):t._e(),t.toast.config.icon?n("div",[n("img",{staticClass:"snotify-icon",attrs:{src:t.toast.config.icon}})]):n("snotify-icon",{staticClass:"snotify-icon",attrs:{type:t.toast.config.type}})],1),t.toast.config.buttons?n("snotify-button",{attrs:{buttons:t.toast.config.buttons,value:t.toast.config.type===t.promptType?t.value:null,id:t.toast.id}}):t._e()],1)])},staticRenderFns:[],props:["toastData"],data:function(){return{toast:this.toastData,opacity:0,interval:null,progress:0,value:0,promptType:h.PROMPT,maxHeight:v.options.maxHeight}},methods:{promptValueChanged:function(t){this.value=t,v.$emit(l.onInput,this.toast,this.value)},initToast:function(t){t&&(this.toast.config.type!==t.config.type&&clearInterval(this.interval),this.toast=t),this.toast.config.timeout>0?this.startTimeout(0):(this.toast.config.showProgressBar=!1,this.toast.config.pauseOnHover=!1),this.opacity=1},startTimeout:function(t){var e=this;this.progress=t;var n=10/this.toast.config.timeout*100;this.interval=setInterval(function(){e.progress+=n,e.progress>=100&&(e.opacity=0)},10)},beforeEnter:function(){v.$emit(l.beforeShow,this.toast,this.value)},enter:function(t,e){setTimeout(function(){return e()},this.toast.config.animation.time)},afterEnter:function(){v.$emit(l.shown,this.toast,this.value)},beforeLeave:function(){clearInterval(this.interval),v.$emit(l.beforeHide,this.toast,this.value)},leave:function(t,e){var n=this;setTimeout(function(){v.$emit(l.hidden,n.toast,n.value),n.maxHeight=0,setTimeout(function(){v.remove(n.toast.id),e()},n.toast.config.animation.time)},this.toast.config.animation.time)},onClick:function(){v.$emit(l.onClick,this.toast,this.value),this.toast.config.closeOnClick&&(this.opacity=0)},onMouseEnter:function(){v.$emit(l.onHoverEnter,this.toast,this.value),this.toast.config.pauseOnHover&&clearInterval(this.interval)},onMouseLeave:function(){this.toast.config.pauseOnHover&&this.type!==h.PROMPT&&this.startTimeout(this.progress),v.$emit(l.onHoverLeave,this.toast,this.value)}},created:function(){var t=this;v.$on("toastChanged",function(e){t.toast.id===e.id&&t.initToast(e)}),v.$on("remove",function(e){t.toast.id===e&&(t.opacity=0)}),this.initToast()},mounted:function(){this.$nextTick(function(){v.$emit(l.mounted,this.toast,this.value)})},beforeDestroy:function(){v.$emit(l.beforeDestroy,this.toast,this.value)},destroyed:function(){v.$emit(l.destroyed,this.toast,this.value)},components:{SnotifyIcon:r,SnotifyPrompt:c,SnotifyButton:f}}},created:function(){var t=this;this.setOptions(v.options),v.$on("optionsChanged",function(e){t.setOptions(e)}),v.$on("notificationsChanged",function(e){t.notifications=s(e.slice(t.dockSize_a,t.dockSize_b));var n=e.filter(function(t){return t.config.backdrop>=0});n.length?t.backdrop<0&&(t.backdrop=0,setTimeout(function(){t.backdrop=n[n.length-1].config.backdrop},10)):t.backdrop>0&&(t.backdrop=0,setTimeout(function(){t.backdrop=-1},200))})}};"undefined"!=typeof window&&window.Vue&&window.Vue.use(a),t.default=a,t.SnotifyType=h,t.SnotifyAction=l,t.SnotifyPosition=u,Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],e):e(t["vue-snotify"]={},t.Vue)}(this,function(t,e){"use strict";function n(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function o(t,e){return e={exports:{}},t(e,e.exports),e.exports}function i(t,e,n){return e===c.async?{value:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var o;return o=2===t.length?{title:null,body:t[0],config:null,action:t[1]}:3===t.length?"string"==typeof t[1]?{title:t[1],body:t[0],config:null,action:t[2]}:{title:null,body:t[0],config:t[2],action:t[1]}:{title:t[1],body:t[0],config:t[3],action:t[2]},n.value.apply(this,[o])}}:{value:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var o;return 1===t.length?o={title:null,body:t[0],config:null}:3===t.length?o={title:t[1],body:t[0],config:t[2]}:((i={title:null,config:null,body:t[0]})["string"==typeof t[1]?"title":"config"]=t[1],o=i),n.value.apply(this,[o]);var i}}}function r(t){return t&&"object"==typeof t&&!Array.isArray(t)&&null!==t}function a(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n={};if(!t.length)return n;for(;t.length>0;){var o=t.shift();if(r(o))for(var i in o)r(o[i])?n[i]=a(n[i],o[i]):Object.assign(n,(s={},s[i]=o[i],s))}return n;var s}function s(t,e,n){return{value:function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];return t[0].config=S({},t[0].config,{type:e}),n.value.apply(this,t)}}}e=e&&e.hasOwnProperty("default")?e.default:e,function(t){t.leftTop="leftTop",t.leftCenter="leftCenter",t.leftBottom="leftBottom",t.rightTop="rightTop",t.rightCenter="rightCenter",t.rightBottom="rightBottom",t.centerTop="centerTop",t.centerCenter="centerCenter",t.centerBottom="centerBottom"}(t.SnotifyPosition||(t.SnotifyPosition={}));var c={simple:"simple",success:"success",error:"error",warning:"warning",info:"info",async:"async",confirm:"confirm",prompt:"prompt"},u="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},f=o(function(t,n){function o(t,e){void 0===e&&(e={}),e.name=e.name||t._componentTag||t.name;var n=t.prototype;Object.getOwnPropertyNames(n).forEach(function(t){if("constructor"!==t)if(a.indexOf(t)>-1)e[t]=n[t];else{var o=Object.getOwnPropertyDescriptor(n,t);"function"==typeof o.value?(e.methods||(e.methods={}))[t]=o.value:(o.get||o.set)&&((e.computed||(e.computed={}))[t]={get:o.get,set:o.set})}}),(e.mixins||(e.mixins=[])).push({data:function(){return function(t,e){e.prototype._init=function(){var e=this,n=Object.getOwnPropertyNames(t);if(t.$options.props)for(var o in t.$options.props)t.hasOwnProperty(o)||n.push(o);n.forEach(function(n){"_"!==n.charAt(0)&&Object.defineProperty(e,n,{get:function(){return t[n]},set:function(e){return t[n]=e},configurable:!0})})};var n=new e,o={};return Object.keys(n).forEach(function(t){void 0!==n[t]&&(o[t]=n[t])}),o}(this,t)}});var o=t.__decorators__;o&&o.forEach(function(t){return t(e)});var i=Object.getPrototypeOf(t.prototype),s=(i instanceof r?i.constructor:r).extend(e);for(var c in t)t.hasOwnProperty(c)&&(s[c]=t[c]);return s}function i(t){return"function"==typeof t?o(t):function(e){return o(e,t)}}Object.defineProperty(n,"__esModule",{value:!0});var r=function(t){return t&&"object"==typeof t&&"default"in t?t.default:t}(e),a=["data","beforeCreate","created","beforeMount","mounted","beforeDestroy","destroyed","beforeUpdate","updated","activated","deactivated","render","errorCaptured"];!function(t){t.registerHooks=function(t){a.push.apply(a,t)}}(i||(i={}));var s=i;n.default=s,n.createDecorator=function(t){return function(e,n,o){var i="function"==typeof e?e:e.constructor;i.__decorators__||(i.__decorators__=[]),"number"!=typeof o&&(o=void 0),i.__decorators__.push(function(e){return t(e,n,o)})}}});n(f);var p;!function(t){function e(t,e,n,o){if(y(n)){if(!g(t))throw new TypeError;if(!b(e))throw new TypeError;return function(t,e){for(var n=t.length-1;n>=0;--n){var o=(0,t[n])(e);if(!y(o)&&!h(o)){if(!b(o))throw new TypeError;e=o}}return e}(t,e)}if(!g(t))throw new TypeError;if(!d(e))throw new TypeError;if(!d(o)&&!y(o)&&!h(o))throw new TypeError;return h(o)&&(o=void 0),n=m(n),function(t,e,n,o){for(var i=t.length-1;i>=0;--i){var r=(0,t[i])(e,n,o);if(!y(r)&&!h(r)){if(!d(r))throw new TypeError;o=r}}return o}(t,e,n,o)}function n(t,e){function n(n,o){if(!d(n))throw new TypeError;if(!y(o)&&!function(t){switch(l(t)){case 3:case 4:return!0;default:return!1}}(o))throw new TypeError;c(t,e,n,o)}return n}function o(t,e,n){var o=R.get(t);if(y(o)){if(!n)return;o=new M,R.set(t,o)}var i=o.get(e);if(y(i)){if(!n)return;i=new M,o.set(e,i)}return i}function i(t,e,n){if(r(t,e,n))return!0;var o=O(e);return!h(o)&&i(t,o,n)}function r(t,e,n){var i=o(e,n,!1);return!y(i)&&function(t){return!!t}(i.has(t))}function a(t,e,n){if(r(t,e,n))return s(t,e,n);var o=O(e);return h(o)?void 0:a(t,o,n)}function s(t,e,n){var i=o(e,n,!1);if(!y(i))return i.get(t)}function c(t,e,n,i){o(n,i,!0).set(t,e)}function f(t,e){var n=p(t,e),o=O(t);if(null===o)return n;var i=f(o,e);if(i.length<=0)return n;if(n.length<=0)return i;for(var r=new C,a=[],s=0,c=n;s<c.length;s++){y=c[s];(h=r.has(y))||(r.add(y),a.push(y))}for(var u=0,l=i;u<l.length;u++){var y=l[u],h=r.has(y);h||(r.add(y),a.push(y))}return a}function p(t,e){var n=[],i=o(t,e,!1);if(y(i))return n;for(var r=function(t){var e=w(t,S);if(!_(e))throw new TypeError;var n=e.call(t);if(!d(n))throw new TypeError;return n}(i.keys()),a=0;;){var s=function(t){var e=t.next();return!e.done&&e}(r);if(!s)return n.length=a,n;var c=function(t){return t.value}(s);try{n[a]=c}catch(t){try{!function(t){var e=t.return;e&&e.call(t)}(r)}finally{throw t}}a++}}function l(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}function y(t){return void 0===t}function h(t){return null===t}function d(t){return"object"==typeof t?null!==t:"function"==typeof t}function v(t,e){switch(l(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}var n=3===e?"string":5===e?"number":"default",o=w(t,E);if(void 0!==o){var i=o.call(t,n);if(d(i))throw new TypeError;return i}return function(t,e){if("string"===e){var n=t.toString;if(_(n)){if(!d(r=n.call(t)))return r}if(_(o=t.valueOf)){if(!d(r=o.call(t)))return r}}else{var o=t.valueOf;if(_(o)){if(!d(r=o.call(t)))return r}var i=t.toString;if(_(i)){var r=i.call(t);if(!d(r))return r}}throw new TypeError}(t,"default"===n?"number":n)}function m(t){var e=v(t,3);return function(t){return"symbol"==typeof t}(e)?e:function(t){return""+t}(e)}function g(t){return Array.isArray?Array.isArray(t):t instanceof Object?t instanceof Array:"[object Array]"===Object.prototype.toString.call(t)}function _(t){return"function"==typeof t}function b(t){return"function"==typeof t}function w(t,e){var n=t[e];if(void 0!==n&&null!==n){if(!_(n))throw new TypeError;return n}}function O(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===$)return e;if(e!==$)return e;var n=t.prototype,o=n&&Object.getPrototypeOf(n);if(null==o||o===Object.prototype)return e;var i=o.constructor;return"function"!=typeof i?e:i===t?e:i}function k(){function t(){var t;do{t="@@WeakMap@@"+function(){var t=function(t){if("function"==typeof Uint8Array)return"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(t)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(t)):n(new Uint8Array(t),t);return n(new Array(t),t)}(o);t[6]=79&t[6]|64,t[8]=191&t[8]|128;for(var e="",i=0;i<o;++i){var r=t[i];4!==i&&6!==i&&8!==i||(e+="-"),r<16&&(e+="0"),e+=r.toString(16).toLowerCase()}return e}()}while(j.has(i,t));return i[t]=!0,t}function e(t,e){if(!P.call(t,r)){if(!e)return;Object.defineProperty(t,r,{value:j.create()})}return t[r]}function n(t,e){for(var n=0;n<e;++n)t[n]=255*Math.random()|0;return t}var o=16,i=j.create(),r=t();return function(){function n(){this._key=t()}return n.prototype.has=function(t){var n=e(t,!1);return void 0!==n&&j.has(n,this._key)},n.prototype.get=function(t){var n=e(t,!1);return void 0!==n?j.get(n,this._key):void 0},n.prototype.set=function(t,n){return e(t,!0)[this._key]=n,this},n.prototype.delete=function(t){var n=e(t,!1);return void 0!==n&&delete n[this._key]},n.prototype.clear=function(){this._key=t()},n}()}function T(t){return t.__=void 0,delete t.__,t}var j,P=Object.prototype.hasOwnProperty,x="function"==typeof Symbol,E=x&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",S=x&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator";!function(t){var e="function"==typeof Object.create,n={__proto__:[]}instanceof Array,o=!e&&!n;t.create=e?function(){return T(Object.create(null))}:n?function(){return T({__proto__:null})}:function(){return T({})},t.has=o?function(t,e){return P.call(t,e)}:function(t,e){return e in t},t.get=o?function(t,e){return P.call(t,e)?t[e]:void 0}:function(t,e){return t[e]}}(j||(j={}));var $=Object.getPrototypeOf(Function),A="object"==typeof process&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,M=A||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?function(){function t(t,e){return t}function e(t,e){return e}function n(t,e){return[t,e]}var o={},i=[],r=function(){function t(t,e,n){this._index=0,this._keys=t,this._values=e,this._selector=n}return t.prototype["@@iterator"]=function(){return this},t.prototype[S]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&t<this._keys.length){var e=this._selector(this._keys[t],this._values[t]);return t+1>=this._keys.length?(this._index=-1,this._keys=i,this._values=i):this._index++,{value:e,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=i,this._values=i),t},t.prototype.return=function(t){return this._index>=0&&(this._index=-1,this._keys=i,this._values=i),{value:t,done:!0}},t}();return function(){function i(){this._keys=[],this._values=[],this._cacheKey=o,this._cacheIndex=-2}return Object.defineProperty(i.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),i.prototype.has=function(t){return this._find(t,!1)>=0},i.prototype.get=function(t){var e=this._find(t,!1);return e>=0?this._values[e]:void 0},i.prototype.set=function(t,e){var n=this._find(t,!0);return this._values[n]=e,this},i.prototype.delete=function(t){var e=this._find(t,!1);if(e>=0){for(var n=this._keys.length,i=e+1;i<n;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,t===this._cacheKey&&(this._cacheKey=o,this._cacheIndex=-2),!0}return!1},i.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=o,this._cacheIndex=-2},i.prototype.keys=function(){return new r(this._keys,this._values,t)},i.prototype.values=function(){return new r(this._keys,this._values,e)},i.prototype.entries=function(){return new r(this._keys,this._values,n)},i.prototype["@@iterator"]=function(){return this.entries()},i.prototype[S]=function(){return this.entries()},i.prototype._find=function(t,e){return this._cacheKey!==t&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=t)),this._cacheIndex<0&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},i}()}():Map,C=A||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?function(){function t(){this._map=new M}return Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.values()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[S]=function(){return this.keys()},t}():Set,R=new(A||"function"!=typeof WeakMap?k():WeakMap);t.decorate=e,t.metadata=n,t.defineMetadata=function(t,e,n,o){if(!d(n))throw new TypeError;return y(o)||(o=m(o)),c(t,e,n,o)},t.hasMetadata=function(t,e,n){if(!d(e))throw new TypeError;return y(n)||(n=m(n)),i(t,e,n)},t.hasOwnMetadata=function(t,e,n){if(!d(e))throw new TypeError;return y(n)||(n=m(n)),r(t,e,n)},t.getMetadata=function(t,e,n){if(!d(e))throw new TypeError;return y(n)||(n=m(n)),a(t,e,n)},t.getOwnMetadata=function(t,e,n){if(!d(e))throw new TypeError;return y(n)||(n=m(n)),s(t,e,n)},t.getMetadataKeys=function(t,e){if(!d(t))throw new TypeError;return y(e)||(e=m(e)),f(t,e)},t.getOwnMetadataKeys=function(t,e){if(!d(t))throw new TypeError;return y(e)||(e=m(e)),p(t,e)},t.deleteMetadata=function(t,e,n){if(!d(e))throw new TypeError;y(n)||(n=m(n));var i=o(e,n,!1);if(y(i))return!1;if(!i.delete(t))return!1;if(i.size>0)return!0;var r=R.get(e);return r.delete(n),r.size>0||(R.delete(e),!0)},function(e){if(void 0!==e.Reflect){if(e.Reflect!==t)for(var n in t)P.call(t,n)&&(e.Reflect[n]=t[n])}else e.Reflect=t}(void 0!==u?u:"undefined"!=typeof self?self:Function("return this;")())}(p||(p={}));var l=o(function(t,n){!function(t,e,n){e=e&&e.hasOwnProperty("default")?e.default:e;var o="default"in n?n.default:n;var i=/\B([A-Z])/g,r=function(t){return t.replace(i,"-$1").toLowerCase()};t.Component=o,t.Vue=e,t.Inject=function(t){return n.createDecorator(function(e,n){void 0===e.inject&&(e.inject={}),Array.isArray(e.inject)||(e.inject[n]=t||n)})},t.Provide=function(t){return n.createDecorator(function(e,n){var o=e.provide;if("function"!=typeof o||!o.managed){var i=e.provide;(o=e.provide=function(){var t=Object.create(("function"==typeof i?i.call(this):i)||null);for(var e in o.managed)t[o.managed[e]]=this[e];return t}).managed={}}o.managed[n]=t||n})},t.Model=function(t,e){void 0===e&&(e={});return function(o,i){Array.isArray(e)||void 0!==e.type||(e.type=Reflect.getMetadata("design:type",o,i)),n.createDecorator(function(n,o){(n.props||(n.props={}))[o]=e,n.model={prop:o,event:t||o}})(o,i)}},t.Prop=function(t){void 0===t&&(t={});return function(e,o){Array.isArray(t)||void 0!==t.type||(t.type=Reflect.getMetadata("design:type",e,o)),n.createDecorator(function(e,n){(e.props||(e.props={}))[n]=t})(e,o)}},t.Watch=function(t,e){void 0===e&&(e={});var o=e.deep,i=void 0!==o&&o,r=e.immediate,a=void 0!==r&&r;return n.createDecorator(function(e,n){"object"!=typeof e.watch&&(e.watch=Object.create(null)),e.watch[t]={handler:n,deep:i,immediate:a}})},t.Emit=function(t){return function(e,n,o){n=r(n);var i=o.value;o.value=function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];!1!==i.apply(this,e)&&this.$emit.apply(this,[t||n].concat(e))}}},Object.defineProperty(t,"__esModule",{value:!0})}(n,e,f)});n(l);var y,h=l.Component,d=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),v=function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a},m=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.isPromptFocused=!1,e}return d(e,t),e.prototype.valueChanged=function(t){this.toast.value=t.target.value,this.toast.eventEmitter.$emit("input")},e=v([h({template:'<span class="snotifyToast__input" :class="{\'snotifyToast__input--filled\': isPromptFocused}"> <input @input="valueChanged" class="snotifyToast__input__field" type="text" :id="toast.id" @focus="isPromptFocused = true" @blur="isPromptFocused = !!toast.value.length"/> <label class="snotifyToast__input__label" :for="toast.id"> <span class="snotifyToast__input__labelContent">{{toast.config.placeholder | truncate}}</span> </label> </span> ',props:["toast"]})],e)}(e),g=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),_=function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a},b=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return g(e,t),e.prototype.remove=function(){this.$snotify.remove(this.toast.id)},e=_([h({template:'<div class="snotifyToast__buttons"> <button type="button" v-for="button in toast.config.buttons" :class="{\'snotifyToast__buttons--bold\': button.bold}" @click="button.action ? button.action(toast) : remove()"> {{button.text}} </button> </div> ',props:["toast"]})],e)}(e),w=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),O=function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a},k=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.toast=e.toastData,e.animationFrame=null,e.state={paused:!1,progress:0,animation:"",isDestroying:!1,promptType:c.prompt},e}return w(e,t),e.prototype.initToast=function(){this.toast.config.timeout>0&&this.startTimeout(0)},e.prototype.onClick=function(){this.toast.eventEmitter.$emit("click"),this.toast.config.closeOnClick&&this.$snotify.remove(this.toast.id)},e.prototype.onMouseEnter=function(){this.toast.eventEmitter.$emit("mouseenter"),this.toast.config.pauseOnHover&&(this.state.paused=!0)},e.prototype.onMouseLeave=function(){this.toast.config.pauseOnHover&&this.toast.config.timeout&&(this.state.paused=!1,this.startTimeout(this.toast.config.timeout*this.state.progress)),this.toast.eventEmitter.$emit("mouseleave")},e.prototype.onExitTransitionEnd=function(){this.state.isDestroying||(this.initToast(),this.toast.eventEmitter.$emit("shown"))},e.prototype.startTimeout=function(t){var e=this;void 0===t&&(t=0);var n=performance.now(),o=function(){e.animationFrame=requestAnimationFrame(function(i){var r=i+t-n,a=Math.min(r/e.toast.config.timeout,1);e.state.paused?cancelAnimationFrame(e.animationFrame):r<e.toast.config.timeout?(e.state.progress=a,o()):(e.state.progress=1,cancelAnimationFrame(e.animationFrame),e.$snotify.emitter.$emit("remove",e.toast.id))})};o()},e.prototype.onRemove=function(){var t=this;this.state.isDestroying=!0,this.$emit("beforeHide"),this.toast.eventEmitter.$emit("beforeHide"),this.state.animation=this.toast.config.animation.exit,setTimeout(function(){t.$emit("hidden"),t.state.animation="snotifyToast--out",t.toast.eventEmitter.$emit("hidden"),setTimeout(function(){return t.$snotify.remove(t.toast.id,!0)},t.toast.config.animation.time/2)},this.toast.config.animation.time/2)},e.prototype.created=function(){var t=this;this.$snotify.emitter.$on("toastChanged",function(e){t.toast.id===e.id&&t.initToast()}),this.$snotify.emitter.$on("remove",function(e){t.toast.id===e&&t.onRemove()})},e.prototype.mounted=function(){var t=this;this.$nextTick(function(){t.toast.eventEmitter.$emit("mounted"),t.state.animation="snotifyToast--in",t.$nextTick(function(){setTimeout(function(){t.$emit("beforeShow"),t.toast.eventEmitter.$emit("beforeShow"),t.state.animation=t.toast.config.animation.enter},t.toast.config.animation.time/5)})})},e.prototype.destroyed=function(){cancelAnimationFrame(this.animationFrame),this.toast.eventEmitter.$emit("destroyed")},e=O([h({template:'<div class="snotifyToast animated" :class="[\'snotify-\' + toast.config.type, state.animation, toast.valid === undefined ? \'\' : (toast.valid ? \'snotifyToast--valid\' : \'snotifyToast--invalid\') ]" :style="{ \'-webkit-animation-duration\': toast.config.animation.time + \'ms\', \'animation-duration\': toast.config.animation.time + \'ms\', \'-webkit-transition\': toast.config.animation.time + \'ms\', transition: toast.config.animation.time + \'ms\' }" @click="onClick" @mouseenter="onMouseEnter" @mouseleave="onMouseLeave" @animationend="onExitTransitionEnd"> <div class="snotifyToast__progressBar" v-if="toast.config.showProgressBar && toast.config.timeout > 0"> <span class="snotifyToast__progressBar__percentage" :style="{\'width\': (state.progress * 100) + \'%\'}"></span> </div> <div class="snotifyToast__inner" v-if="!toast.config.html"> <div class="snotifyToast__title" v-if="toast.title">{{toast.title | truncate(toast.config.titleMaxLength)}}</div> <div class="snotifyToast__body" v-if="toast.body">{{toast.body | truncate(toast.config.bodyMaxLength)}}</div> <snotify-prompt v-if="toast.config.type === state.promptType" :toast="toast"> </snotify-prompt> <div v-if="!toast.config.icon" :class="[\'snotify-icon\', \'snotify-icon--\' + toast.config.type]"></div> <div v-else> <img class="snotify-icon" :src=\'toast.config.icon\'/> </div> </div> <div class="snotifyToast__inner" v-html="toast.config.html" v-else></div> <snotify-button v-if="toast.config.buttons" :toast="toast"></snotify-button> </div> ',props:["toastData"],components:{SnotifyPrompt:m,SnotifyButton:b}})],e)}(e),T=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),j=function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a},P=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.notifications={left_top:[],left_center:[],left_bottom:[],right_top:[],right_center:[],right_bottom:[],center_top:[],center_center:[],center_bottom:[]},t.dockSize_a=0,t.dockSize_b=0,t.blockSize_a=0,t.blockSize_b=0,t.backdrop=-1,t.withBackdrop=[],t}return T(n,e),n.prototype.setOptions=function(t){this.$snotify.config.global.newOnTop?(this.dockSize_a=-this.$snotify.config.global.maxOnScreen,this.dockSize_b=void 0,this.blockSize_a=-this.$snotify.config.global.maxAtPosition,this.blockSize_b=void 0,this.withBackdrop=t.filter(function(t){return t.config.backdrop>=0})):(this.dockSize_a=0,this.dockSize_b=this.$snotify.config.global.maxOnScreen,this.blockSize_a=0,this.blockSize_b=this.$snotify.config.global.maxAtPosition,this.withBackdrop=t.filter(function(t){return t.config.backdrop>=0}).reverse()),this.notifications=this.splitToasts(t.slice(this.dockSize_a,this.dockSize_b)),this.stateChanged("mounted")},n.prototype.stateChanged=function(t){if(this.withBackdrop.length)switch(t){case"mounted":this.backdrop<0&&(this.backdrop=0);break;case"beforeShow":this.backdrop=this.withBackdrop[this.withBackdrop.length-1].config.backdrop;break;case"beforeHide":1===this.withBackdrop.length&&(this.backdrop=0);break;case"hidden":1===this.withBackdrop.length&&(this.backdrop=-1)}},n.prototype.splitToasts=function(e){var n={};for(var o in t.SnotifyPosition)t.SnotifyPosition.hasOwnProperty(o)&&(n[t.SnotifyPosition[o]]=[]);return e.forEach(function(t){n[t.config.position].push(t)}),n},n.prototype.created=function(){var t=this;this.$snotify.emitter.$on("snotify",function(e){t.setOptions(e)})},n=j([h({template:'<div> <div class="snotify-backdrop" v-if="backdrop >= 0" :style="{opacity: backdrop}"></div> <div v-for="(position, index) in notifications" class="snotify" :class="\'snotify-\' + index"> <toast v-for="toast in notifications[index].slice(blockSize_a, blockSize_b)" :toastData="toast" :key="toast.id" @stateChanged="stateChanged"> </toast> </div> </div> ',components:{Toast:k}})],n)}(e),x=function(){function t(t,n,o,i){var r=this;this.id=t,this.title=n,this.body=o,this.config=i,this.eventEmitter=new e,this._eventsHolder=[],this.valid=void 0,this.config.type===c.prompt&&(this.value=""),this.on("hidden",function(){r._eventsHolder.forEach(function(t){r.eventEmitter.$off(t.event,t.action)})})}return t.prototype.on=function(t,e){var n=this;return this._eventsHolder.push({event:t,action:e}),this.eventEmitter.$on(t,function(){return e(n)}),this},t}(),E={global:{newOnTop:!0,maxOnScreen:8,maxAtPosition:8},toast:{type:c.simple,showProgressBar:!0,timeout:2e3,closeOnClick:!0,pauseOnHover:!0,bodyMaxLength:150,titleMaxLength:16,backdrop:-1,icon:null,html:null,position:t.SnotifyPosition.rightBottom,animation:{enter:"fadeIn",exit:"fadeOut",time:400}},type:(y={},y[c.prompt]={timeout:0,closeOnClick:!1,buttons:[{text:"Ok",action:null,bold:!0},{text:"Cancel",action:null,bold:!1}],placeholder:"Enter answer here...",type:c.prompt},y[c.confirm]={timeout:0,closeOnClick:!1,buttons:[{text:"Ok",action:null,bold:!0},{text:"Cancel",action:null,bold:!1}],type:c.confirm},y[c.simple]={type:c.simple},y[c.success]={type:c.success},y[c.error]={type:c.error},y[c.warning]={type:c.warning},y[c.info]={type:c.info},y[c.async]={pauseOnHover:!1,closeOnClick:!1,timeout:0,showProgressBar:!1,type:c.async},y)},S=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},$=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},A=function(t,e,n,o){var i,r=arguments.length,a=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(r<3?i(a):r>3?i(e,n,a):i(e,n))||a);return r>3&&a&&Object.defineProperty(e,n,a),a},M=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},C=function(){function t(){this.emitter=new e,this.notifications=[],this.config=E}return t.prototype.emit=function(){this.emitter.$emit("snotify",this.notifications.slice())},t.prototype.get=function(t){return this.notifications.find(function(e){return e.id===t})},t.prototype.add=function(t){this.config.global.newOnTop?this.notifications.unshift(t):this.notifications.push(t),this.emit()},t.prototype.remove=function(t,e){return t?e?(this.notifications=this.notifications.filter(function(e){return e.id!==t}),this.emit()):void this.emitter.$emit("remove",t):this.clear()},t.prototype.clear=function(){this.notifications=[],this.emit()},t.prototype.button=function(t,e,n,o){var i=this;return void 0===e&&(e=!0),void 0===n&&(n=null),void 0===o&&(o=!1),{text:t,action:e?function(t){n(t),i.remove(t.id)}:n,bold:o}},t.prototype.create=function(t){var e=a(this.config.toast,this.config.type[t.config.type],t.config),n=new x(e.id?e.id:Math.floor(Math.random()*(Date.now()-1))+1,t.title,t.body,e);return this.add(n),n},t.prototype.setDefaults=function(t){return this.config=a(this.config,t)},t.prototype.simple=function(t){return this.create(t)},t.prototype.success=function(t){return this.create(t)},t.prototype.error=function(t){return this.create(t)},t.prototype.info=function(t){return this.create(t)},t.prototype.warning=function(t){return this.create(t)},t.prototype.confirm=function(t){return this.create(t)},t.prototype.prompt=function(t){return this.create(t)},t.prototype.async=function(t){var e=this,n=t.action,o=this.create(t);return o.on("mounted",function(){n().then(function(t){return e.mergeToast(o,t,c.success)}).catch(function(t){return e.mergeToast(o,t,c.error)})}),o},t.prototype.mergeToast=function(t,e,n){e.body&&(t.body=e.body),e.title&&(t.title=e.title),t.config=n?a(t.config,this.config.global,this.config.toast[n],{type:n},e.config):a(t.config,e.config),e.html&&(t.config.html=e.html),this.emit()},t.prototype.html=function(t,e){return this.create({title:null,body:null,config:$({},e,{html:t})})},A([i,s,M("design:type",Function),M("design:paramtypes",[Object]),M("design:returntype",x)],t.prototype,"simple",null),A([i,s,M("design:type",Function),M("design:paramtypes",[Object]),M("design:returntype",x)],t.prototype,"success",null),A([i,s,M("design:type",Function),M("design:paramtypes",[Object]),M("design:returntype",x)],t.prototype,"error",null),A([i,s,M("design:type",Function),M("design:paramtypes",[Object]),M("design:returntype",x)],t.prototype,"info",null),A([i,s,M("design:type",Function),M("design:paramtypes",[Object]),M("design:returntype",x)],t.prototype,"warning",null),A([i,s,M("design:type",Function),M("design:paramtypes",[Object]),M("design:returntype",x)],t.prototype,"confirm",null),A([i,s,M("design:type",Function),M("design:paramtypes",[Object]),M("design:returntype",x)],t.prototype,"prompt",null),A([i,s,M("design:type",Function),M("design:paramtypes",[Object]),M("design:returntype",x)],t.prototype,"async",null),t}(),R={install:function(t,e){void 0===e&&(e={}),t.filter("truncate",function(t,e,n){return void 0===e&&(e=40),void 0===n&&(n="..."),t.length>e?t.substring(0,e)+n:t});var n=new C;n.setDefaults(e),t.prototype.$snotify=n,t.component("vue-snotify",P)}};"undefined"!=typeof window&&window.hasOwnProperty("Vue")&&window.Vue.use(R.install),t.default=R,t.SnotifyStyle=c,t.SnotifyToast=x,Object.defineProperty(t,"__esModule",{value:!0})});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc