@zerodevx/svelte-toast
Advanced tools
Comparing version 0.6.1 to 0.6.2
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).window=t.window||{})}(this,(function(t){"use strict";function e(){}const n=t=>t;function o(t,e){for(const n in e)t[n]=e[n];return t}function r(t){return t()}function s(){return Object.create(null)}function i(t){t.forEach(r)}function a(t){return"function"==typeof t}function c(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function u(t,n,o){t.$$.on_destroy.push(function(t,...n){if(null==t)return e;const o=t.subscribe(...n);return o.unsubscribe?()=>o.unsubscribe():o}(n,o))}const l="undefined"!=typeof window;let f=l?()=>window.performance.now():()=>Date.now(),d=l?t=>requestAnimationFrame(t):e;const p=new Set;function h(t){p.forEach((e=>{e.c(t)||(p.delete(e),e.f())})),0!==p.size&&d(h)}function g(t){let e;return 0===p.size&&d(h),{promise:new Promise((n=>{p.add(e={c:t,f:n})})),abort(){p.delete(e)}}}function m(t,e){t.appendChild(e)}function $(t,e,n){const o=b(t);if(!o.getElementById(e)){const t=_("style");t.id=e,t.textContent=n,y(o,t)}}function b(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function y(t,e){m(t.head||t,e)}function v(t,e,n){t.insertBefore(e,n||null)}function w(t){t.parentNode.removeChild(t)}function _(t){return document.createElement(t)}function x(t){return document.createTextNode(t)}function j(){return x(" ")}function k(){return x("")}function B(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function C(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function E(t,e,n){t.classList[n?"add":"remove"](e)}class M{constructor(){this.e=this.n=null}c(t){this.h(t)}m(t,e,n=null){this.e||(this.e=_(e.nodeName),this.t=e,this.c(t)),this.i(n)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.childNodes)}i(t){for(let e=0;e<this.n.length;e+=1)v(this.t,this.n[e],t)}p(t){this.d(),this.h(t),this.i(this.a)}d(){this.n.forEach(w)}}const S=new Set;let A,R=0;function O(t,e,n,o,r,s,i,a=0){const c=16.666/o;let u="{\n";for(let t=0;t<=1;t+=c){const o=e+(n-e)*s(t);u+=100*t+`%{${i(o,1-o)}}\n`}const l=u+`100% {${i(n,1-n)}}\n}`,f=`__svelte_${function(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}(l)}_${a}`,d=b(t);S.add(d);const p=d.__svelte_stylesheet||(d.__svelte_stylesheet=function(t){const e=_("style");return y(b(t),e),e}(t).sheet),h=d.__svelte_rules||(d.__svelte_rules={});h[f]||(h[f]=!0,p.insertRule(`@keyframes ${f} ${l}`,p.cssRules.length));const g=t.style.animation||"";return t.style.animation=`${g?`${g}, `:""}${f} ${o}ms linear ${r}ms 1 both`,R+=1,f}function P(t,e){const n=(t.style.animation||"").split(", "),o=n.filter(e?t=>t.indexOf(e)<0:t=>-1===t.indexOf("__svelte")),r=n.length-o.length;r&&(t.style.animation=o.join(", "),R-=r,R||d((()=>{R||(S.forEach((t=>{const e=t.__svelte_stylesheet;let n=e.cssRules.length;for(;n--;)e.deleteRule(n);t.__svelte_rules={}})),S.clear())})))}function T(t,e){const n=t.getBoundingClientRect();if(e.left!==n.left||e.top!==n.top){const o=getComputedStyle(t),r="none"===o.transform?"":o.transform;t.style.transform=`${r} translate(${e.left-n.left}px, ${e.top-n.top}px)`}}function z(t){A=t}function N(t){(function(){if(!A)throw new Error("Function called outside component initialization");return A})().$$.on_destroy.push(t)}const L=[],D=[],I=[],q=[],H=Promise.resolve();let F=!1;function W(t){I.push(t)}let G=!1;const J=new Set;function K(){if(!G){G=!0;do{for(let t=0;t<L.length;t+=1){const e=L[t];z(e),Q(e.$$)}for(z(null),L.length=0;D.length;)D.pop()();for(let t=0;t<I.length;t+=1){const e=I[t];J.has(e)||(J.add(e),e())}I.length=0}while(L.length);for(;q.length;)q.pop()();F=!1,G=!1,J.clear()}}function Q(t){if(null!==t.fragment){t.update(),i(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(W)}}let U;function V(){return U||(U=Promise.resolve(),U.then((()=>{U=null}))),U}function X(t,e,n){t.dispatchEvent(function(t,e,n=!1){const o=document.createEvent("CustomEvent");return o.initCustomEvent(t,n,!1,e),o}(`${e?"intro":"outro"}${n}`))}const Y=new Set;let Z;function tt(){Z={r:0,c:[],p:Z}}function et(){Z.r||i(Z.c),Z=Z.p}function nt(t,e){t&&t.i&&(Y.delete(t),t.i(e))}function ot(t,e,n,o){if(t&&t.o){if(Y.has(t))return;Y.add(t),Z.c.push((()=>{Y.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}}const rt={duration:0};function st(t,e){t.f(),function(t,e){ot(t,1,1,(()=>{e.delete(t.key)}))}(t,e)}function it(t){t&&t.c()}function at(t,e,n,o){const{fragment:s,on_mount:c,on_destroy:u,after_update:l}=t.$$;s&&s.m(e,n),o||W((()=>{const e=c.map(r).filter(a);u?u.push(...e):i(e),t.$$.on_mount=[]})),l.forEach(W)}function ct(t,e){const n=t.$$;null!==n.fragment&&(i(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function ut(t,e){-1===t.$$.dirty[0]&&(L.push(t),F||(F=!0,H.then(K)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function lt(t,n,o,r,a,c,u,l=[-1]){const f=A;z(t);const d=t.$$={fragment:null,ctx:null,props:c,update:e,not_equal:a,bound:s(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(f?f.$$.context:n.context||[]),callbacks:s(),dirty:l,skip_bound:!1,root:n.target||f.$$.root};u&&u(d.root);let p=!1;if(d.ctx=o?o(t,n.props||{},((e,n,...o)=>{const r=o.length?o[0]:n;return d.ctx&&a(d.ctx[e],d.ctx[e]=r)&&(!d.skip_bound&&d.bound[e]&&d.bound[e](r),p&&ut(t,e)),n})):[],d.update(),p=!0,i(d.before_update),d.fragment=!!r&&r(d.ctx),n.target){if(n.hydrate){const t=function(t){return Array.from(t.childNodes)}(n.target);d.fragment&&d.fragment.l(t),t.forEach(w)}else d.fragment&&d.fragment.c();n.intro&&nt(t.$$.fragment),at(t,n.target,n.anchor,n.customElement),K()}z(f)}class ft{$destroy(){ct(this,1),this.$destroy=e}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function dt(t){const e=t-1;return e*e*e+1}function pt(t,{delay:e=0,duration:o=400,easing:r=n}={}){const s=+getComputedStyle(t).opacity;return{delay:e,duration:o,easing:r,css:t=>"opacity: "+t*s}}function ht(t,{delay:e=0,duration:n=400,easing:o=dt,x:r=0,y:s=0,opacity:i=0}={}){const a=getComputedStyle(t),c=+a.opacity,u="none"===a.transform?"":a.transform,l=c*(1-i);return{delay:e,duration:n,easing:o,css:(t,e)=>`\n\t\t\ttransform: ${u} translate(${(1-t)*r}px, ${(1-t)*s}px);\n\t\t\topacity: ${c-l*e}`}}function gt(t,{from:e,to:n},o={}){const r=getComputedStyle(t),s="none"===r.transform?"":r.transform,[i,c]=r.transformOrigin.split(" ").map(parseFloat),u=e.left+e.width*i/n.width-(n.left+i),l=e.top+e.height*c/n.height-(n.top+c),{delay:f=0,duration:d=(t=>120*Math.sqrt(t)),easing:p=dt}=o;return{delay:f,duration:a(d)?d(Math.sqrt(u*u+l*l)):d,easing:p,css:(t,o)=>{const r=o*u,i=o*l,a=t+o*e.width/n.width,c=t+o*e.height/n.height;return`transform: ${s} translate(${r}px, ${i}px) scale(${a}, ${c});`}}}const mt=[];function $t(t,n=e){let o;const r=new Set;function s(e){if(c(t,e)&&(t=e,o)){const e=!mt.length;for(const e of r)e[1](),mt.push(e,t);if(e){for(let t=0;t<mt.length;t+=2)mt[t][0](mt[t+1]);mt.length=0}}}return{set:s,update:function(e){s(e(t))},subscribe:function(i,a=e){const c=[i,a];return r.add(c),1===r.size&&(o=n(s)||e),i(t),()=>{r.delete(c),0===r.size&&(o(),o=null)}}}}const bt={duration:4e3,initial:1,next:0,pausable:!1,dismissable:!0,reversed:!1,intro:{x:256},theme:{}},yt=(()=>{const{subscribe:t,update:e}=$t([]);let n=0;const o={},r=t=>t instanceof Object;return{subscribe:t,push:(t,s={})=>{const i={target:"default",...r(t)?t:{...s,msg:t}},a=o[i.target]||{},c={...bt,...a,...i,theme:{...a.theme,...i.theme},id:++n};return e((t=>c.reversed?[...t,c]:[c,...t])),n},pop:t=>{e((e=>{if(!e.length||0===t)return[];if(r(t))return e.filter((e=>t(e)));const n=t||Math.max(...e.map((t=>t.id)));return e.filter((t=>t.id!==n))}))},set:(t,n={})=>{const o=r(t)?{...t}:{...n,id:t};e((t=>{const e=t.findIndex((t=>t.id===o.id));return e>-1&&(t[e]={...t[e],...o}),t}))},_init:(t="default",e={})=>(o[t]=e,o)}})();function vt(t){return"[object Date]"===Object.prototype.toString.call(t)}function wt(t,e){if(t===e||t!=t)return()=>t;const n=typeof t;if(n!==typeof e||Array.isArray(t)!==Array.isArray(e))throw new Error("Cannot interpolate values of different type");if(Array.isArray(t)){const n=e.map(((e,n)=>wt(t[n],e)));return t=>n.map((e=>e(t)))}if("object"===n){if(!t||!e)throw new Error("Object cannot be null");if(vt(t)&&vt(e)){t=t.getTime();const n=(e=e.getTime())-t;return e=>new Date(t+e*n)}const n=Object.keys(e),o={};return n.forEach((n=>{o[n]=wt(t[n],e[n])})),t=>{const e={};return n.forEach((n=>{e[n]=o[n](t)})),e}}if("number"===n){const n=e-t;return e=>t+e*n}throw new Error(`Cannot interpolate ${n} values`)}function _t(t){$(t,"svelte-j9nwjb","._toastItem.svelte-j9nwjb{width:var(--toastWidth, 16rem);height:var(--toastHeight, auto);min-height:var(--toastMinHeight, 3.5rem);margin:var(--toastMargin, 0 0 0.5rem 0);padding:var(--toastPadding, 0);background:var(--toastBackground, rgba(66, 66, 66, 0.9));color:var(--toastColor, #fff);box-shadow:var(--toastBoxShadow, 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06));border:var(--toastBorder, none);border-radius:var(--toastBorderRadius, 0.125rem);position:relative;display:flex;flex-direction:row;align-items:center;overflow:hidden;will-change:transform, opacity;-webkit-tap-highlight-color:transparent}._toastMsg.svelte-j9nwjb{padding:var(--toastMsgPadding, 0.75rem 0.5rem);flex:1 1 0%}.pe.svelte-j9nwjb,._toastMsg.svelte-j9nwjb a{pointer-events:auto}._toastBtn.svelte-j9nwjb{width:2rem;height:100%;font:1rem sans-serif;display:flex;align-items:center;justify-content:center;cursor:pointer;outline:none}._toastBar.svelte-j9nwjb{top:var(--toastBarTop, auto);right:var(--toastBarRight, auto);bottom:var(--toastBarBottom, 0);left:var(--toastBarLeft, 0);height:var(--toastBarHeight, 6px);width:var(--toastBarWidth, 100%);position:absolute;display:block;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;background:transparent;pointer-events:none}._toastBar.svelte-j9nwjb::-webkit-progress-bar{background:transparent}._toastBar.svelte-j9nwjb::-webkit-progress-value{background:var(--toastProgressBackground, var(--toastBarBackground, rgba(33, 150, 243, 0.75)))}._toastBar.svelte-j9nwjb::-moz-progress-bar{background:var(--toastProgressBackground, var(--toastBarBackground, rgba(33, 150, 243, 0.75)))}")}function xt(t){let n,o,r=t[0].msg+"";return{c(){n=new M,o=k(),n.a=o},m(t,e){n.m(r,t,e),v(t,o,e)},p(t,e){1&e&&r!==(r=t[0].msg+"")&&n.p(r)},i:e,o:e,d(t){t&&w(o),t&&n.d()}}}function jt(t){let e,n,r;const s=[t[6]()];var i=t[0].component.src;function a(t){let e={};for(let t=0;t<s.length;t+=1)e=o(e,s[t]);return{props:e}}return i&&(e=new i(a())),{c(){e&&it(e.$$.fragment),n=k()},m(t,o){e&&at(e,t,o),v(t,n,o),r=!0},p(t,o){const r=64&o?function(t,e){const n={},o={},r={$$scope:1};let s=t.length;for(;s--;){const i=t[s],a=e[s];if(a){for(const t in i)t in a||(o[t]=1);for(const t in a)r[t]||(n[t]=a[t],r[t]=1);t[s]=a}else for(const t in i)r[t]=1}for(const t in o)t in n||(n[t]=void 0);return n}(s,[(c=t[6](),"object"==typeof c&&null!==c?c:{})]):{};var c;if(i!==(i=t[0].component.src)){if(e){tt();const t=e;ot(t.$$.fragment,1,0,(()=>{ct(t,1)})),et()}i?(e=new i(a()),it(e.$$.fragment),nt(e.$$.fragment,1),at(e,n.parentNode,n)):e=null}else i&&e.$set(r)},i(t){r||(e&&nt(e.$$.fragment,t),r=!0)},o(t){e&&ot(e.$$.fragment,t),r=!1},d(t){t&&w(n),e&&ct(e,t)}}}function kt(t){let n,o,r;return{c(){n=_("div"),n.textContent="✕",C(n,"class","_toastBtn pe svelte-j9nwjb"),C(n,"role","button"),C(n,"tabindex","-1")},m(e,s){v(e,n,s),o||(r=B(n,"click",t[3]),o=!0)},p:e,d(t){t&&w(n),o=!1,r()}}}function Bt(t){let e,n,o,r,s,a,c,u,l,f;const d=[jt,xt],p=[];function h(t,e){return t[0].component?0:1}o=h(t),r=p[o]=d[o](t);let g=t[0].dismissable&&kt(t);return{c(){e=_("div"),n=_("div"),r.c(),s=j(),g&&g.c(),a=j(),c=_("progress"),C(n,"class","_toastMsg svelte-j9nwjb"),E(n,"pe",t[0].component),C(c,"class","_toastBar svelte-j9nwjb"),c.value=t[1],C(e,"class","_toastItem svelte-j9nwjb"),E(e,"pe",t[0].pausable)},m(r,i){v(r,e,i),m(e,n),p[o].m(n,null),m(e,s),g&&g.m(e,null),m(e,a),m(e,c),u=!0,l||(f=[B(e,"mouseenter",t[4]),B(e,"mouseleave",t[5])],l=!0)},p(t,[s]){let i=o;o=h(t),o===i?p[o].p(t,s):(tt(),ot(p[i],1,1,(()=>{p[i]=null})),et(),r=p[o],r?r.p(t,s):(r=p[o]=d[o](t),r.c()),nt(r,1),r.m(n,null)),1&s&&E(n,"pe",t[0].component),t[0].dismissable?g?g.p(t,s):(g=kt(t),g.c(),g.m(e,a)):g&&(g.d(1),g=null),(!u||2&s)&&(c.value=t[1]),1&s&&E(e,"pe",t[0].pausable)},i(t){u||(nt(r),u=!0)},o(t){ot(r),u=!1},d(t){t&&w(e),p[o].d(),g&&g.d(),l=!1,i(f)}}}function Ct(t,e,r){let s,{item:i}=e;const a=function(t,e={}){const r=$t(t);let s,i=t;function a(a,c){if(null==t)return r.set(t=a),Promise.resolve();i=a;let u=s,l=!1,{delay:d=0,duration:p=400,easing:h=n,interpolate:m=wt}=o(o({},e),c);if(0===p)return u&&(u.abort(),u=null),r.set(t=i),Promise.resolve();const $=f()+d;let b;return s=g((e=>{if(e<$)return!0;l||(b=m(t,a),"function"==typeof p&&(p=p(t,a)),l=!0),u&&(u.abort(),u=null);const n=e-$;return n>p?(r.set(t=a),!1):(r.set(t=b(h(n/p))),!0)})),s.promise}return{set:a,update:(e,n)=>a(e(i,t),n),subscribe:r.subscribe}}(i.initial,{duration:i.duration,easing:n});u(t,a,(t=>r(1,s=t)));const c=()=>yt.pop(i.id),l=()=>{1!==s&&0!==s||c()};let d=i.initial,p=d,h=!1;return N((()=>{"function"==typeof i.onpop&&i.onpop(i.id)})),t.$$set=t=>{"item"in t&&r(0,i=t.item)},t.$$.update=()=>{1&t.$$.dirty&&void 0!==i.progress&&r(0,i.next=i.progress,i),131&t.$$.dirty&&d!==i.next&&(r(7,d=i.next),p=s,h=!1,a.set(d).then(l))},[i,s,a,c,()=>{i.pausable&&!h&&s!==d&&(a.set(s,{duration:0}),h=!0)},()=>{if(h){const t=i.duration,e=t-t*((s-p)/(d-p));a.set(d,{duration:e}).then(l),h=!1}},()=>{const{props:t={},sendIdTo:e}=i.component;return e&&(t[e]=i.id),t},d]}class Et extends ft{constructor(t){super(),lt(this,t,Ct,Bt,c,{item:0},_t)}}function Mt(t){$(t,"svelte-7xr3c1","._toastContainer.svelte-7xr3c1{top:var(--toastContainerTop, 1.5rem);right:var(--toastContainerRight, 2rem);bottom:var(--toastContainerBottom, auto);left:var(--toastContainerLeft, auto);position:fixed;margin:0;padding:0;list-style-type:none;pointer-events:none;z-index:9999}")}function St(t,e,n){const o=t.slice();return o[5]=e[n],o}function At(t,o){let r,s,c,u,l,d,p,h,$=e;return s=new Et({props:{item:o[5]}}),{key:t,first:null,c(){r=_("li"),it(s.$$.fragment),c=j(),C(r,"style",u=o[1](o[5].theme)),this.first=r},m(t,e){v(t,r,e),at(s,r,null),m(r,c),h=!0},p(t,e){o=t;const n={};1&e&&(n.item=o[5]),s.$set(n),(!h||1&e&&u!==(u=o[1](o[5].theme)))&&C(r,"style",u)},r(){p=r.getBoundingClientRect()},f(){!function(t){const e=getComputedStyle(t);if("absolute"!==e.position&&"fixed"!==e.position){const{width:n,height:o}=e,r=t.getBoundingClientRect();t.style.position="absolute",t.style.width=n,t.style.height=o,T(t,r)}}(r),$(),T(r,p)},a(){$(),$=function(t,o,r,s){if(!o)return e;const i=t.getBoundingClientRect();if(o.left===i.left&&o.right===i.right&&o.top===i.top&&o.bottom===i.bottom)return e;const{delay:a=0,duration:c=300,easing:u=n,start:l=f()+a,end:d=l+c,tick:p=e,css:h}=r(t,{from:o,to:i},s);let m,$=!0,b=!1;function y(){h&&P(t,m),$=!1}return g((t=>{if(!b&&t>=l&&(b=!0),b&&t>=d&&(p(1,0),y()),!$)return!1;if(b){const e=0+1*u((t-l)/c);p(e,1-e)}return!0})),h&&(m=O(t,0,1,c,a,u,h)),a||(b=!0),p(0,1),y}(r,p,gt,{duration:200})},i(t){h||(nt(s.$$.fragment,t),W((()=>{d&&d.end(1),l=function(t,o,r){let s,i,c=o(t,r),u=!1,l=0;function d(){s&&P(t,s)}function p(){const{delay:o=0,duration:r=300,easing:a=n,tick:p=e,css:h}=c||rt;h&&(s=O(t,0,1,r,o,a,h,l++)),p(0,1);const m=f()+o,$=m+r;i&&i.abort(),u=!0,W((()=>X(t,!0,"start"))),i=g((e=>{if(u){if(e>=$)return p(1,0),X(t,!0,"end"),d(),u=!1;if(e>=m){const t=a((e-m)/r);p(t,1-t)}}return u}))}let h=!1;return{start(){h||(h=!0,P(t),a(c)?(c=c(),V().then(p)):p())},invalidate(){h=!1},end(){u&&(d(),u=!1)}}}(r,ht,o[5].intro),l.start()})),h=!0)},o(t){ot(s.$$.fragment,t),l&&l.invalidate(),d=function(t,o,r){let s,c=o(t,r),u=!0;const l=Z;function d(){const{delay:o=0,duration:r=300,easing:a=n,tick:d=e,css:p}=c||rt;p&&(s=O(t,1,0,r,o,a,p));const h=f()+o,m=h+r;W((()=>X(t,!1,"start"))),g((e=>{if(u){if(e>=m)return d(0,1),X(t,!1,"end"),--l.r||i(l.c),!1;if(e>=h){const t=a((e-h)/r);d(1-t,t)}}return u}))}return l.r+=1,a(c)?V().then((()=>{c=c(),d()})):d(),{end(e){e&&c.tick&&c.tick(1,0),u&&(s&&P(t,s),u=!1)}}}(r,pt,{}),h=!1},d(t){t&&w(r),ct(s),t&&d&&d.end()}}}function Rt(t){let e,n,o=[],r=new Map,s=t[0];const i=t=>t[5].id;for(let e=0;e<s.length;e+=1){let n=St(t,s,e),a=i(n);r.set(a,o[e]=At(a,n))}return{c(){e=_("ul");for(let t=0;t<o.length;t+=1)o[t].c();C(e,"class","_toastContainer svelte-7xr3c1")},m(t,r){v(t,e,r);for(let t=0;t<o.length;t+=1)o[t].m(e,null);n=!0},p(t,[n]){if(3&n){s=t[0],tt();for(let t=0;t<o.length;t+=1)o[t].r();o=function(t,e,n,o,r,s,i,a,c,u,l,f){let d=t.length,p=s.length,h=d;const g={};for(;h--;)g[t[h].key]=h;const m=[],$=new Map,b=new Map;for(h=p;h--;){const t=f(r,s,h),a=n(t);let c=i.get(a);c?o&&c.p(t,e):(c=u(a,t),c.c()),$.set(a,m[h]=c),a in g&&b.set(a,Math.abs(h-g[a]))}const y=new Set,v=new Set;function w(t){nt(t,1),t.m(a,l),i.set(t.key,t),l=t.first,p--}for(;d&&p;){const e=m[p-1],n=t[d-1],o=e.key,r=n.key;e===n?(l=e.first,d--,p--):$.has(r)?!i.has(o)||y.has(o)?w(e):v.has(r)?d--:b.get(o)>b.get(r)?(v.add(o),w(e)):(y.add(r),d--):(c(n,i),d--)}for(;d--;){const e=t[d];$.has(e.key)||c(e,i)}for(;p;)w(m[p-1]);return m}(o,n,i,1,t,s,r,e,st,At,null,St);for(let t=0;t<o.length;t+=1)o[t].a();et()}},i(t){if(!n){for(let t=0;t<s.length;t+=1)nt(o[t]);n=!0}},o(t){for(let t=0;t<o.length;t+=1)ot(o[t]);n=!1},d(t){t&&w(e);for(let t=0;t<o.length;t+=1)o[t].d()}}}function Ot(t,e,n){let o;u(t,yt,(t=>n(4,o=t)));let r,{options:s={}}=e,{target:i="default"}=e;return t.$$set=t=>{"options"in t&&n(2,s=t.options),"target"in t&&n(3,i=t.target)},t.$$.update=()=>{12&t.$$.dirty&&yt._init(i,s),24&t.$$.dirty&&n(0,r=o.filter((t=>t.target===i)))},[r,t=>Object.keys(t).reduce(((e,n)=>`${e}${n}:${t[n]};`),""),s,i,o]}t.SvelteToast=class extends ft{constructor(t){super(),lt(this,t,Ot,Rt,c,{options:2,target:3},Mt)}},t.toast=yt,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).window=t.window||{})}(this,(function(t){"use strict";function e(){}const n=t=>t;function o(t,e){for(const n in e)t[n]=e[n];return t}function r(t){return t()}function s(){return Object.create(null)}function i(t){t.forEach(r)}function a(t){return"function"==typeof t}function c(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function u(t,n,o){t.$$.on_destroy.push(function(t,...n){if(null==t)return e;const o=t.subscribe(...n);return o.unsubscribe?()=>o.unsubscribe():o}(n,o))}const l="undefined"!=typeof window;let f=l?()=>window.performance.now():()=>Date.now(),d=l?t=>requestAnimationFrame(t):e;const p=new Set;function h(t){p.forEach((e=>{e.c(t)||(p.delete(e),e.f())})),0!==p.size&&d(h)}function g(t){let e;return 0===p.size&&d(h),{promise:new Promise((n=>{p.add(e={c:t,f:n})})),abort(){p.delete(e)}}}function m(t,e){t.appendChild(e)}function $(t,e,n){const o=b(t);if(!o.getElementById(e)){const t=_("style");t.id=e,t.textContent=n,y(o,t)}}function b(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function y(t,e){m(t.head||t,e)}function v(t,e,n){t.insertBefore(e,n||null)}function w(t){t.parentNode.removeChild(t)}function _(t){return document.createElement(t)}function x(t){return document.createTextNode(t)}function j(){return x(" ")}function k(){return x("")}function B(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function C(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function E(t,e,n){t.classList[n?"add":"remove"](e)}class M{constructor(){this.e=this.n=null}c(t){this.h(t)}m(t,e,n=null){this.e||(this.e=_(e.nodeName),this.t=e,this.c(t)),this.i(n)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.childNodes)}i(t){for(let e=0;e<this.n.length;e+=1)v(this.t,this.n[e],t)}p(t){this.d(),this.h(t),this.i(this.a)}d(){this.n.forEach(w)}}const S=new Set;let A,R=0;function O(t,e,n,o,r,s,i,a=0){const c=16.666/o;let u="{\n";for(let t=0;t<=1;t+=c){const o=e+(n-e)*s(t);u+=100*t+`%{${i(o,1-o)}}\n`}const l=u+`100% {${i(n,1-n)}}\n}`,f=`__svelte_${function(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}(l)}_${a}`,d=b(t);S.add(d);const p=d.__svelte_stylesheet||(d.__svelte_stylesheet=function(t){const e=_("style");return y(b(t),e),e}(t).sheet),h=d.__svelte_rules||(d.__svelte_rules={});h[f]||(h[f]=!0,p.insertRule(`@keyframes ${f} ${l}`,p.cssRules.length));const g=t.style.animation||"";return t.style.animation=`${g?`${g}, `:""}${f} ${o}ms linear ${r}ms 1 both`,R+=1,f}function P(t,e){const n=(t.style.animation||"").split(", "),o=n.filter(e?t=>t.indexOf(e)<0:t=>-1===t.indexOf("__svelte")),r=n.length-o.length;r&&(t.style.animation=o.join(", "),R-=r,R||d((()=>{R||(S.forEach((t=>{const e=t.__svelte_stylesheet;let n=e.cssRules.length;for(;n--;)e.deleteRule(n);t.__svelte_rules={}})),S.clear())})))}function T(t,e){const n=t.getBoundingClientRect();if(e.left!==n.left||e.top!==n.top){const o=getComputedStyle(t),r="none"===o.transform?"":o.transform;t.style.transform=`${r} translate(${e.left-n.left}px, ${e.top-n.top}px)`}}function z(t){A=t}function N(t){(function(){if(!A)throw new Error("Function called outside component initialization");return A})().$$.on_destroy.push(t)}const L=[],D=[],I=[],q=[],H=Promise.resolve();let F=!1;function W(t){I.push(t)}let G=!1;const J=new Set;function K(){if(!G){G=!0;do{for(let t=0;t<L.length;t+=1){const e=L[t];z(e),Q(e.$$)}for(z(null),L.length=0;D.length;)D.pop()();for(let t=0;t<I.length;t+=1){const e=I[t];J.has(e)||(J.add(e),e())}I.length=0}while(L.length);for(;q.length;)q.pop()();F=!1,G=!1,J.clear()}}function Q(t){if(null!==t.fragment){t.update(),i(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(W)}}let U;function V(){return U||(U=Promise.resolve(),U.then((()=>{U=null}))),U}function X(t,e,n){t.dispatchEvent(function(t,e,n=!1){const o=document.createEvent("CustomEvent");return o.initCustomEvent(t,n,!1,e),o}(`${e?"intro":"outro"}${n}`))}const Y=new Set;let Z;function tt(){Z={r:0,c:[],p:Z}}function et(){Z.r||i(Z.c),Z=Z.p}function nt(t,e){t&&t.i&&(Y.delete(t),t.i(e))}function ot(t,e,n,o){if(t&&t.o){if(Y.has(t))return;Y.add(t),Z.c.push((()=>{Y.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}}const rt={duration:0};function st(t,e){t.f(),function(t,e){ot(t,1,1,(()=>{e.delete(t.key)}))}(t,e)}function it(t){t&&t.c()}function at(t,e,n,o){const{fragment:s,on_mount:c,on_destroy:u,after_update:l}=t.$$;s&&s.m(e,n),o||W((()=>{const e=c.map(r).filter(a);u?u.push(...e):i(e),t.$$.on_mount=[]})),l.forEach(W)}function ct(t,e){const n=t.$$;null!==n.fragment&&(i(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function ut(t,e){-1===t.$$.dirty[0]&&(L.push(t),F||(F=!0,H.then(K)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function lt(t,n,o,r,a,c,u,l=[-1]){const f=A;z(t);const d=t.$$={fragment:null,ctx:null,props:c,update:e,not_equal:a,bound:s(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(n.context||(f?f.$$.context:[])),callbacks:s(),dirty:l,skip_bound:!1,root:n.target||f.$$.root};u&&u(d.root);let p=!1;if(d.ctx=o?o(t,n.props||{},((e,n,...o)=>{const r=o.length?o[0]:n;return d.ctx&&a(d.ctx[e],d.ctx[e]=r)&&(!d.skip_bound&&d.bound[e]&&d.bound[e](r),p&&ut(t,e)),n})):[],d.update(),p=!0,i(d.before_update),d.fragment=!!r&&r(d.ctx),n.target){if(n.hydrate){const t=function(t){return Array.from(t.childNodes)}(n.target);d.fragment&&d.fragment.l(t),t.forEach(w)}else d.fragment&&d.fragment.c();n.intro&&nt(t.$$.fragment),at(t,n.target,n.anchor,n.customElement),K()}z(f)}class ft{$destroy(){ct(this,1),this.$destroy=e}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function dt(t){const e=t-1;return e*e*e+1}function pt(t,{delay:e=0,duration:o=400,easing:r=n}={}){const s=+getComputedStyle(t).opacity;return{delay:e,duration:o,easing:r,css:t=>"opacity: "+t*s}}function ht(t,{delay:e=0,duration:n=400,easing:o=dt,x:r=0,y:s=0,opacity:i=0}={}){const a=getComputedStyle(t),c=+a.opacity,u="none"===a.transform?"":a.transform,l=c*(1-i);return{delay:e,duration:n,easing:o,css:(t,e)=>`\n\t\t\ttransform: ${u} translate(${(1-t)*r}px, ${(1-t)*s}px);\n\t\t\topacity: ${c-l*e}`}}function gt(t,{from:e,to:n},o={}){const r=getComputedStyle(t),s="none"===r.transform?"":r.transform,[i,c]=r.transformOrigin.split(" ").map(parseFloat),u=e.left+e.width*i/n.width-(n.left+i),l=e.top+e.height*c/n.height-(n.top+c),{delay:f=0,duration:d=(t=>120*Math.sqrt(t)),easing:p=dt}=o;return{delay:f,duration:a(d)?d(Math.sqrt(u*u+l*l)):d,easing:p,css:(t,o)=>{const r=o*u,i=o*l,a=t+o*e.width/n.width,c=t+o*e.height/n.height;return`transform: ${s} translate(${r}px, ${i}px) scale(${a}, ${c});`}}}const mt=[];function $t(t,n=e){let o;const r=new Set;function s(e){if(c(t,e)&&(t=e,o)){const e=!mt.length;for(const e of r)e[1](),mt.push(e,t);if(e){for(let t=0;t<mt.length;t+=2)mt[t][0](mt[t+1]);mt.length=0}}}return{set:s,update:function(e){s(e(t))},subscribe:function(i,a=e){const c=[i,a];return r.add(c),1===r.size&&(o=n(s)||e),i(t),()=>{r.delete(c),0===r.size&&(o(),o=null)}}}}const bt={duration:4e3,initial:1,next:0,pausable:!1,dismissable:!0,reversed:!1,intro:{x:256},theme:{}},yt=(()=>{const{subscribe:t,update:e}=$t([]);let n=0;const o={},r=t=>t instanceof Object;return{subscribe:t,push:(t,s={})=>{const i={target:"default",...r(t)?t:{...s,msg:t}},a=o[i.target]||{},c={...bt,...a,...i,theme:{...a.theme,...i.theme},id:++n};return e((t=>c.reversed?[...t,c]:[c,...t])),n},pop:t=>{e((e=>{if(!e.length||0===t)return[];if(r(t))return e.filter((e=>t(e)));const n=t||Math.max(...e.map((t=>t.id)));return e.filter((t=>t.id!==n))}))},set:(t,n={})=>{const o=r(t)?{...t}:{...n,id:t};e((t=>{const e=t.findIndex((t=>t.id===o.id));return e>-1&&(t[e]={...t[e],...o}),t}))},_init:(t="default",e={})=>(o[t]=e,o)}})();function vt(t){return"[object Date]"===Object.prototype.toString.call(t)}function wt(t,e){if(t===e||t!=t)return()=>t;const n=typeof t;if(n!==typeof e||Array.isArray(t)!==Array.isArray(e))throw new Error("Cannot interpolate values of different type");if(Array.isArray(t)){const n=e.map(((e,n)=>wt(t[n],e)));return t=>n.map((e=>e(t)))}if("object"===n){if(!t||!e)throw new Error("Object cannot be null");if(vt(t)&&vt(e)){t=t.getTime();const n=(e=e.getTime())-t;return e=>new Date(t+e*n)}const n=Object.keys(e),o={};return n.forEach((n=>{o[n]=wt(t[n],e[n])})),t=>{const e={};return n.forEach((n=>{e[n]=o[n](t)})),e}}if("number"===n){const n=e-t;return e=>t+e*n}throw new Error(`Cannot interpolate ${n} values`)}function _t(t){$(t,"svelte-j9nwjb","._toastItem.svelte-j9nwjb{width:var(--toastWidth, 16rem);height:var(--toastHeight, auto);min-height:var(--toastMinHeight, 3.5rem);margin:var(--toastMargin, 0 0 0.5rem 0);padding:var(--toastPadding, 0);background:var(--toastBackground, rgba(66, 66, 66, 0.9));color:var(--toastColor, #fff);box-shadow:var(--toastBoxShadow, 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06));border:var(--toastBorder, none);border-radius:var(--toastBorderRadius, 0.125rem);position:relative;display:flex;flex-direction:row;align-items:center;overflow:hidden;will-change:transform, opacity;-webkit-tap-highlight-color:transparent}._toastMsg.svelte-j9nwjb{padding:var(--toastMsgPadding, 0.75rem 0.5rem);flex:1 1 0%}.pe.svelte-j9nwjb,._toastMsg.svelte-j9nwjb a{pointer-events:auto}._toastBtn.svelte-j9nwjb{width:2rem;height:100%;font:1rem sans-serif;display:flex;align-items:center;justify-content:center;cursor:pointer;outline:none}._toastBar.svelte-j9nwjb{top:var(--toastBarTop, auto);right:var(--toastBarRight, auto);bottom:var(--toastBarBottom, 0);left:var(--toastBarLeft, 0);height:var(--toastBarHeight, 6px);width:var(--toastBarWidth, 100%);position:absolute;display:block;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;background:transparent;pointer-events:none}._toastBar.svelte-j9nwjb::-webkit-progress-bar{background:transparent}._toastBar.svelte-j9nwjb::-webkit-progress-value{background:var(--toastProgressBackground, var(--toastBarBackground, rgba(33, 150, 243, 0.75)))}._toastBar.svelte-j9nwjb::-moz-progress-bar{background:var(--toastProgressBackground, var(--toastBarBackground, rgba(33, 150, 243, 0.75)))}")}function xt(t){let n,o,r=t[0].msg+"";return{c(){n=new M,o=k(),n.a=o},m(t,e){n.m(r,t,e),v(t,o,e)},p(t,e){1&e&&r!==(r=t[0].msg+"")&&n.p(r)},i:e,o:e,d(t){t&&w(o),t&&n.d()}}}function jt(t){let e,n,r;const s=[t[6]()];var i=t[0].component.src;function a(t){let e={};for(let t=0;t<s.length;t+=1)e=o(e,s[t]);return{props:e}}return i&&(e=new i(a())),{c(){e&&it(e.$$.fragment),n=k()},m(t,o){e&&at(e,t,o),v(t,n,o),r=!0},p(t,o){const r=64&o?function(t,e){const n={},o={},r={$$scope:1};let s=t.length;for(;s--;){const i=t[s],a=e[s];if(a){for(const t in i)t in a||(o[t]=1);for(const t in a)r[t]||(n[t]=a[t],r[t]=1);t[s]=a}else for(const t in i)r[t]=1}for(const t in o)t in n||(n[t]=void 0);return n}(s,[(c=t[6](),"object"==typeof c&&null!==c?c:{})]):{};var c;if(i!==(i=t[0].component.src)){if(e){tt();const t=e;ot(t.$$.fragment,1,0,(()=>{ct(t,1)})),et()}i?(e=new i(a()),it(e.$$.fragment),nt(e.$$.fragment,1),at(e,n.parentNode,n)):e=null}else i&&e.$set(r)},i(t){r||(e&&nt(e.$$.fragment,t),r=!0)},o(t){e&&ot(e.$$.fragment,t),r=!1},d(t){t&&w(n),e&&ct(e,t)}}}function kt(t){let n,o,r;return{c(){n=_("div"),n.textContent="✕",C(n,"class","_toastBtn pe svelte-j9nwjb"),C(n,"role","button"),C(n,"tabindex","-1")},m(e,s){v(e,n,s),o||(r=B(n,"click",t[3]),o=!0)},p:e,d(t){t&&w(n),o=!1,r()}}}function Bt(t){let e,n,o,r,s,a,c,u,l,f;const d=[jt,xt],p=[];function h(t,e){return t[0].component?0:1}o=h(t),r=p[o]=d[o](t);let g=t[0].dismissable&&kt(t);return{c(){e=_("div"),n=_("div"),r.c(),s=j(),g&&g.c(),a=j(),c=_("progress"),C(n,"class","_toastMsg svelte-j9nwjb"),E(n,"pe",t[0].component),C(c,"class","_toastBar svelte-j9nwjb"),c.value=t[1],C(e,"class","_toastItem svelte-j9nwjb"),E(e,"pe",t[0].pausable)},m(r,i){v(r,e,i),m(e,n),p[o].m(n,null),m(e,s),g&&g.m(e,null),m(e,a),m(e,c),u=!0,l||(f=[B(e,"mouseenter",t[4]),B(e,"mouseleave",t[5])],l=!0)},p(t,[s]){let i=o;o=h(t),o===i?p[o].p(t,s):(tt(),ot(p[i],1,1,(()=>{p[i]=null})),et(),r=p[o],r?r.p(t,s):(r=p[o]=d[o](t),r.c()),nt(r,1),r.m(n,null)),1&s&&E(n,"pe",t[0].component),t[0].dismissable?g?g.p(t,s):(g=kt(t),g.c(),g.m(e,a)):g&&(g.d(1),g=null),(!u||2&s)&&(c.value=t[1]),1&s&&E(e,"pe",t[0].pausable)},i(t){u||(nt(r),u=!0)},o(t){ot(r),u=!1},d(t){t&&w(e),p[o].d(),g&&g.d(),l=!1,i(f)}}}function Ct(t,e,r){let s,{item:i}=e;const a=function(t,e={}){const r=$t(t);let s,i=t;function a(a,c){if(null==t)return r.set(t=a),Promise.resolve();i=a;let u=s,l=!1,{delay:d=0,duration:p=400,easing:h=n,interpolate:m=wt}=o(o({},e),c);if(0===p)return u&&(u.abort(),u=null),r.set(t=i),Promise.resolve();const $=f()+d;let b;return s=g((e=>{if(e<$)return!0;l||(b=m(t,a),"function"==typeof p&&(p=p(t,a)),l=!0),u&&(u.abort(),u=null);const n=e-$;return n>p?(r.set(t=a),!1):(r.set(t=b(h(n/p))),!0)})),s.promise}return{set:a,update:(e,n)=>a(e(i,t),n),subscribe:r.subscribe}}(i.initial,{duration:i.duration,easing:n});u(t,a,(t=>r(1,s=t)));const c=()=>yt.pop(i.id),l=()=>{1!==s&&0!==s||c()};let d=i.initial,p=d,h=!1;return N((()=>{"function"==typeof i.onpop&&i.onpop(i.id)})),t.$$set=t=>{"item"in t&&r(0,i=t.item)},t.$$.update=()=>{1&t.$$.dirty&&void 0!==i.progress&&r(0,i.next=i.progress,i),131&t.$$.dirty&&d!==i.next&&(r(7,d=i.next),p=s,h=!1,a.set(d).then(l))},[i,s,a,c,()=>{i.pausable&&!h&&s!==d&&(a.set(s,{duration:0}),h=!0)},()=>{if(h){const t=i.duration,e=t-t*((s-p)/(d-p));a.set(d,{duration:e}).then(l),h=!1}},()=>{const{props:t={},sendIdTo:e}=i.component;return e&&(t[e]=i.id),t},d]}class Et extends ft{constructor(t){super(),lt(this,t,Ct,Bt,c,{item:0},_t)}}function Mt(t){$(t,"svelte-7xr3c1","._toastContainer.svelte-7xr3c1{top:var(--toastContainerTop, 1.5rem);right:var(--toastContainerRight, 2rem);bottom:var(--toastContainerBottom, auto);left:var(--toastContainerLeft, auto);position:fixed;margin:0;padding:0;list-style-type:none;pointer-events:none;z-index:9999}")}function St(t,e,n){const o=t.slice();return o[5]=e[n],o}function At(t,o){let r,s,c,u,l,d,p,h,$=e;return s=new Et({props:{item:o[5]}}),{key:t,first:null,c(){r=_("li"),it(s.$$.fragment),c=j(),C(r,"style",u=o[1](o[5].theme)),this.first=r},m(t,e){v(t,r,e),at(s,r,null),m(r,c),h=!0},p(t,e){o=t;const n={};1&e&&(n.item=o[5]),s.$set(n),(!h||1&e&&u!==(u=o[1](o[5].theme)))&&C(r,"style",u)},r(){p=r.getBoundingClientRect()},f(){!function(t){const e=getComputedStyle(t);if("absolute"!==e.position&&"fixed"!==e.position){const{width:n,height:o}=e,r=t.getBoundingClientRect();t.style.position="absolute",t.style.width=n,t.style.height=o,T(t,r)}}(r),$(),T(r,p)},a(){$(),$=function(t,o,r,s){if(!o)return e;const i=t.getBoundingClientRect();if(o.left===i.left&&o.right===i.right&&o.top===i.top&&o.bottom===i.bottom)return e;const{delay:a=0,duration:c=300,easing:u=n,start:l=f()+a,end:d=l+c,tick:p=e,css:h}=r(t,{from:o,to:i},s);let m,$=!0,b=!1;function y(){h&&P(t,m),$=!1}return g((t=>{if(!b&&t>=l&&(b=!0),b&&t>=d&&(p(1,0),y()),!$)return!1;if(b){const e=0+1*u((t-l)/c);p(e,1-e)}return!0})),h&&(m=O(t,0,1,c,a,u,h)),a||(b=!0),p(0,1),y}(r,p,gt,{duration:200})},i(t){h||(nt(s.$$.fragment,t),W((()=>{d&&d.end(1),l=function(t,o,r){let s,i,c=o(t,r),u=!1,l=0;function d(){s&&P(t,s)}function p(){const{delay:o=0,duration:r=300,easing:a=n,tick:p=e,css:h}=c||rt;h&&(s=O(t,0,1,r,o,a,h,l++)),p(0,1);const m=f()+o,$=m+r;i&&i.abort(),u=!0,W((()=>X(t,!0,"start"))),i=g((e=>{if(u){if(e>=$)return p(1,0),X(t,!0,"end"),d(),u=!1;if(e>=m){const t=a((e-m)/r);p(t,1-t)}}return u}))}let h=!1;return{start(){h||(h=!0,P(t),a(c)?(c=c(),V().then(p)):p())},invalidate(){h=!1},end(){u&&(d(),u=!1)}}}(r,ht,o[5].intro),l.start()})),h=!0)},o(t){ot(s.$$.fragment,t),l&&l.invalidate(),d=function(t,o,r){let s,c=o(t,r),u=!0;const l=Z;function d(){const{delay:o=0,duration:r=300,easing:a=n,tick:d=e,css:p}=c||rt;p&&(s=O(t,1,0,r,o,a,p));const h=f()+o,m=h+r;W((()=>X(t,!1,"start"))),g((e=>{if(u){if(e>=m)return d(0,1),X(t,!1,"end"),--l.r||i(l.c),!1;if(e>=h){const t=a((e-h)/r);d(1-t,t)}}return u}))}return l.r+=1,a(c)?V().then((()=>{c=c(),d()})):d(),{end(e){e&&c.tick&&c.tick(1,0),u&&(s&&P(t,s),u=!1)}}}(r,pt,{}),h=!1},d(t){t&&w(r),ct(s),t&&d&&d.end()}}}function Rt(t){let e,n,o=[],r=new Map,s=t[0];const i=t=>t[5].id;for(let e=0;e<s.length;e+=1){let n=St(t,s,e),a=i(n);r.set(a,o[e]=At(a,n))}return{c(){e=_("ul");for(let t=0;t<o.length;t+=1)o[t].c();C(e,"class","_toastContainer svelte-7xr3c1")},m(t,r){v(t,e,r);for(let t=0;t<o.length;t+=1)o[t].m(e,null);n=!0},p(t,[n]){if(3&n){s=t[0],tt();for(let t=0;t<o.length;t+=1)o[t].r();o=function(t,e,n,o,r,s,i,a,c,u,l,f){let d=t.length,p=s.length,h=d;const g={};for(;h--;)g[t[h].key]=h;const m=[],$=new Map,b=new Map;for(h=p;h--;){const t=f(r,s,h),a=n(t);let c=i.get(a);c?o&&c.p(t,e):(c=u(a,t),c.c()),$.set(a,m[h]=c),a in g&&b.set(a,Math.abs(h-g[a]))}const y=new Set,v=new Set;function w(t){nt(t,1),t.m(a,l),i.set(t.key,t),l=t.first,p--}for(;d&&p;){const e=m[p-1],n=t[d-1],o=e.key,r=n.key;e===n?(l=e.first,d--,p--):$.has(r)?!i.has(o)||y.has(o)?w(e):v.has(r)?d--:b.get(o)>b.get(r)?(v.add(o),w(e)):(y.add(r),d--):(c(n,i),d--)}for(;d--;){const e=t[d];$.has(e.key)||c(e,i)}for(;p;)w(m[p-1]);return m}(o,n,i,1,t,s,r,e,st,At,null,St);for(let t=0;t<o.length;t+=1)o[t].a();et()}},i(t){if(!n){for(let t=0;t<s.length;t+=1)nt(o[t]);n=!0}},o(t){for(let t=0;t<o.length;t+=1)ot(o[t]);n=!1},d(t){t&&w(e);for(let t=0;t<o.length;t+=1)o[t].d()}}}function Ot(t,e,n){let o;u(t,yt,(t=>n(4,o=t)));let r,{options:s={}}=e,{target:i="default"}=e;return t.$$set=t=>{"options"in t&&n(2,s=t.options),"target"in t&&n(3,i=t.target)},t.$$.update=()=>{12&t.$$.dirty&&yt._init(i,s),24&t.$$.dirty&&n(0,r=o.filter((t=>t.target===i)))},[r,t=>Object.keys(t).reduce(((e,n)=>`${e}${n}:${t[n]};`),""),s,i,o]}t.SvelteToast=class extends ft{constructor(t){super(),lt(this,t,Ot,Rt,c,{options:2,target:3},Mt)}},t.toast=yt,Object.defineProperty(t,"__esModule",{value:!0})})); |
{ | ||
"name": "@zerodevx/svelte-toast", | ||
"version": "0.6.1", | ||
"version": "0.6.2", | ||
"description": "Simple elegant toast notifications", | ||
@@ -27,19 +27,19 @@ "author": "Jason Lee <jason@zerodevx.com>", | ||
"devDependencies": { | ||
"@rollup/plugin-commonjs": "^20.0.0", | ||
"@rollup/plugin-node-resolve": "^13.0.4", | ||
"@typescript-eslint/eslint-plugin": "^4.31.1", | ||
"@typescript-eslint/parser": "^4.31.1", | ||
"autoprefixer": "^10.3.4", | ||
"@rollup/plugin-commonjs": "^21.0.0", | ||
"@rollup/plugin-node-resolve": "^13.0.5", | ||
"@typescript-eslint/eslint-plugin": "^5.1.0", | ||
"@typescript-eslint/parser": "^5.1.0", | ||
"autoprefixer": "^10.3.7", | ||
"camelcase": "^6.2.0", | ||
"cypress": "^8.4.0", | ||
"eslint": "^7.32.0", | ||
"cypress": "^8.6.0", | ||
"eslint": "^8.0.1", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-plugin-html": "^6.1.2", | ||
"eslint-plugin-html": "^6.2.0", | ||
"eslint-plugin-svelte3": "^3.2.1", | ||
"npm-run-all": "^4.1.5", | ||
"postcss": "^8.3.6", | ||
"postcss": "^8.3.9", | ||
"prettier": "^2.4.1", | ||
"prettier-plugin-svelte": "^2.4.0", | ||
"prismjs": "^1.24.1", | ||
"rollup": "^2.56.3", | ||
"prismjs": "^1.25.0", | ||
"rollup": "^2.58.0", | ||
"rollup-plugin-livereload": "^2.0.5", | ||
@@ -49,5 +49,5 @@ "rollup-plugin-svelte": "^7.1.0", | ||
"sirv-cli": "^1.0.14", | ||
"svelte": "^3.42.6", | ||
"tailwindcss": "^2.2.15", | ||
"typescript": "^4.4.3" | ||
"svelte": "^3.44.0", | ||
"tailwindcss": "^2.2.17", | ||
"typescript": "^4.4.4" | ||
}, | ||
@@ -54,0 +54,0 @@ "files": [ |
@@ -36,3 +36,3 @@ // index.d.ts | ||
component?: { | ||
src: SvelteComponent | ||
src: typeof SvelteComponent | ||
props?: { [key: string]: any } | ||
@@ -39,0 +39,0 @@ sendIdTo?: string |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
58288