customizable-toast-notification 3.10.0 → 3.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +61 -54
- package/LICENSE +201 -201
- package/README.md +384 -384
- package/dist/index.esm.mjs +4 -5
- package/dist/index.umd.js +5 -6
- package/package.json +160 -145
- package/postinstall.js +27 -27
- package/dist/index.esm.mjs.map +0 -1
- package/dist/index.umd.js.map +0 -1
package/dist/index.esm.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Customizable Toast Notifications 3.
|
|
3
|
-
* Build:
|
|
4
|
-
* Cache-Buster:
|
|
2
|
+
* Customizable Toast Notifications 3.11.0
|
|
3
|
+
* Build: 2026-08-12 20:37:24
|
|
4
|
+
* Cache-Buster: 1786567044727
|
|
5
5
|
* Author: Priyanshu Patel
|
|
6
6
|
* Email: [priyanshu.alt191@gmail.com](mailto:priyanshu.alt191@gmail.com)
|
|
7
7
|
* License: Apache-2.0
|
|
@@ -12,5 +12,4 @@
|
|
|
12
12
|
* Supports flexible positioning, theming, icons, animations, and timing options
|
|
13
13
|
* out of the box — with CTA support and zero dependencies.
|
|
14
14
|
*/
|
|
15
|
-
function t(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e);if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)}return n}function n(n){for(var o=1;o<arguments.length;o++){var i=null!=arguments[o]?arguments[o]:{};o%2?e(Object(i),!0).forEach(function(e){t(n,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach(function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(i,t))})}return n}async function o(t,e){const n=document.createElement(t);return n.id=function(t){const e=Date.now().toString(36),n=Math.floor(1048575*Math.random()).toString(36);return"".concat(t,"-").concat(e,"-").concat(n)}(e),n}const i=new class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:200;this.maxSize=t,this.map=new Map}get(t){if(!this.map.has(t))return;const e=this.map.get(t);return this.map.delete(t),this.map.set(t,e),e}set(t,e){if(this.map.has(t))this.map.delete(t);else if(this.map.size>=this.maxSize){const t=this.map.keys().next().value;this.map.delete(t)}this.map.set(t,e)}}(200),r={};function a(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!t)return"snow";const n="".concat(t,"|").concat(e),o=i.get(n);if(o)return o;if(r[null==t?void 0:t.toLowerCase()]){const e=r[t.toLowerCase()];return i.set(n,e),e}let a,s,l;try{const e=null==t?void 0:t.match(/^#([0-9a-f]{3,8})$/i);if(e){let t=e[1];3===t.length&&(t=t.split("").map(t=>t+t).join("")),a=parseInt(t.slice(0,2),16),s=parseInt(t.slice(2,4),16),l=parseInt(t.slice(4,6),16)}else{const e=null==t?void 0:t.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\)/i);if(!e)throw new Error("Unknown color");a=Number(e[1]),s=Number(e[2]),l=Number(e[3])}}catch(t){a=50+Math.floor(206*Math.random()),s=50+Math.floor(206*Math.random()),l=50+Math.floor(206*Math.random())}a=Math.round(a*e+255*(1-e)),s=Math.round(s*e+255*(1-e)),l=Math.round(l*e+255*(1-e));const c=(t,e,n)=>{const o=[t,e,n].map(t=>(t/=255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4));return.2126*o[0]+.7152*o[1]+.0722*o[2]},u=(t,e)=>{const n=c(...t),o=c(...e);return(Math.max(n,o)+.05)/(Math.min(n,o)+.05)};let[d,m,h]=((t,e,n)=>{t/=255,e/=255,n/=255;const o=Math.max(t,e,n),i=Math.min(t,e,n);let r,a,s=(o+i)/2;if(o===i)r=a=0;else{const l=o-i;switch(a=s>.5?l/(2-o-i):l/(o+i),o){case t:r=(e-n)/l+(e<n?6:0);break;case e:r=(n-t)/l+2;break;case n:r=(t-e)/l+4}r/=6}return[360*r,a,s]})(a,s,l);let p=h<.5?Math.min(h+.5,1):Math.max(h-.5,0),[f,y,g]=((t,e,n)=>{let o,i,r;if(t/=360,0===e)o=i=r=n;else{const a=(t,e,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t),s=n<.5?n*(1+e):n+e-n*e,l=2*n-s;o=a(l,s,t+1/3),i=a(l,s,t),r=a(l,s,t-1/3)}return[Math.round(255*o),Math.round(255*i),Math.round(255*r)]})(d,m,p);if(u([a,s,l],[f,y,g])<4.5){const t=u([a,s,l],[0,0,0]),e=u([a,s,l],[255,255,255]);[f,y,g]=t>=e?[0,0,0]:[255,255,255]}const b=((t,e,n)=>"#".concat(t.toString(16).padStart(2,"0")).concat(e.toString(16).padStart(2,"0")).concat(n.toString(16).padStart(2,"0")))(f,y,g);return i.set(n,b),b}async function s(t,e,n){var o;const i=await async function(t){if("number"==typeof t&&t>0)return t;if("string"==typeof t){if(t.endsWith("s")&&!t.endsWith("ms")){const e=1e3*parseFloat(t);return e>0?e:500}const e=parseFloat(t);return e>0?e:500}return 500}(null==e?void 0:e.animationDuration);t.className="toast toast-".concat(null!==(o=null==e?void 0:e.type)&&void 0!==o?o:"info"),Object.assign(t.style,{background:null==e?void 0:e.backgroundColor,padding:"12px 16px",marginBottom:"10px",borderRadius:null==e?void 0:e.borderRadius,overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"space-between",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)",minWidth:"250px",maxWidth:null==e?void 0:e.maxWidth,opacity:"0",position:"relative",cursor:"default",boxSizing:"border-box",userSelect:"text",transition:"opacity ".concat(null==e?void 0:e.animationDuration," ").concat(null==e?void 0:e.animationEasing,", transform ").concat(null==e?void 0:e.animationDuration," ").concat(null==e?void 0:e.animationEasing),transform:"translateY(20px)",zIndex:"9999"}),t.setAttribute("role","alert"),t.setAttribute("aria-live","polite"),t.tabIndex=0,t._animationDuration=i;const r=document.createElement("span");null!=e&&e.wrapText?Object.assign(r.style,{display:"block",whiteSpace:"normal"}):Object.assign(r.style,{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3",whiteSpace:"nowrap"}),Object.assign(r.style,{flex:"1",padding:null==e?void 0:e.fontPadding,fontFamily:null==e?void 0:e.fontFamily,fontSize:null==e?void 0:e.fontSize,fontWeight:null==e?void 0:e.fontWeight,lineHeight:null==e?void 0:e.fontLineHeight,color:null==e?void 0:e.textColor,userSelect:"text",wordBreak:"break-word",overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:"3",WebkitBoxOrient:"vertical"}),r.textContent=null==e?void 0:e.message,r.setAttribute("message",null==e?void 0:e.message),r.setAttribute("aria-label",null==e?void 0:e.message),t.appendChild(r),null!=e&&e.cta&&0!==Object.keys(e.cta).length&&function(t,e,n){const o=null==e?void 0:e.cta;if(!o)return;o.label||(o.label="CTA Label Missing!");const i=!!o.href&&"link"===o.variant,r=document.createElement(i?"a":"button");i?(r.href=o.href,o.target&&(r.target=o.target),r.rel=o.rel||("_blank"===o.target?"noopener noreferrer":"")):r.type="button",r.setAttribute("aria-label",o.ariaLabel||o.label),Object.assign(r.style,{marginLeft:"10px",padding:"6px 10px",borderRadius:"6px",fontSize:"12px",fontWeight:"600",lineHeight:"1",border:"1px solid rgba(255,255,255,0.35)",color:e.textColor||"#fff",background:"rgba(255,255,255,0.15)",cursor:"pointer",whiteSpace:"nowrap",flexShrink:"0"}),r.textContent=o.label;const a=async e=>{try{if("function"==typeof o.onClick){const t=o.onClick(e);null!=t&&t.then&&await t}}finally{!1!==o.autoClose&&n(t)}};r.addEventListener("click",a),r._cleanup=()=>r.removeEventListener("click",a),t.appendChild(r)}(t,e,n),null!=e&&e.showCloseButton&&function(t,e,n){const o=document.createElement("button");o.setAttribute("aria-label","Close notification"),o.setAttribute("title","Close"),o.textContent="×",Object.assign(o.style,{background:"none",border:"none",color:e.textColor||"white",fontSize:"18px",marginLeft:"10px",cursor:"pointer"});const i=()=>n(t);o.addEventListener("click",i),t._cleanupCloseButton=()=>{o.removeEventListener("click",i)},t.appendChild(o)}(t,e,n),null!=e&&e.showProgressBar&&function(t,e){const n=document.createElement("div"),o=e.borderRadius||0,i=parseInt(o,10),r=i?"calc(100% - ".concat(i-10+"px",")"):"100%",a=i?"12px":"0";Object.assign(n.style,{position:"absolute",left:"".concat(a),height:e.progressHeight||"4px",background:e.progressColor||"rgba(255, 255, 255, 0.3)",width:"".concat(r),transition:"width ".concat(e.duration||1800,"ms linear"),["top"===e.progressPosition?"top":"bottom"]:"0",borderRadius:e.borderRadius||"4px"}),t.appendChild(n),setTimeout(()=>{n.offsetWidth,n.style.width="0%"},50)}(t,e),function(t){setTimeout(()=>{requestAnimationFrame(()=>{t.style.opacity="1",t.style.transform="translateY(0)"})},50)}(t)}async function l(t,e){try{const n=document.createElement("div");Object.assign(n.style,{background:"#333",color:"white",padding:"10px 15px",position:"fixed",top:"20px",right:"20px",zIndex:"99999",borderRadius:"3px",maxWidth:"250px",wordWrap:"break-word",boxShadow:"0 2px 10px rgba(0,0,0,0.3)",cursor:"pointer"});const o=document.createElement("span");o.textContent=(null==t?void 0:t.message)||"Emergency Toast Creation Showing!",n.appendChild(o);const i=document.createElement("span");return i.textContent="×",Object.assign(i.style,{float:"right",marginLeft:"10px",fontWeight:"bold"}),i.onclick=()=>{n.remove(),e(n)},n.appendChild(i),document.body.appendChild(n),setTimeout(()=>{n.remove(),e(n)},null==t?void 0:t.duration),n}catch(n){return setTimeout(()=>{alert((null==t?void 0:t.message)||"Emergency Toast Creation Showing!"),e(null)},100),null}}Object.entries({aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}).forEach(t=>{let[e,[n,o,i]]=t;const a=t=>{const e=t/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)},s=.2126*a(n)+.7152*a(o)+.0722*a(i),l=(s+.05)/.05,c=1.05/(s+.05);r[e.toLowerCase()]=l>=c?"#000000":"#ffffff"});const c=new Map,u=new Map;function d(t){return"toast-container-".concat(function(t){return String(t).toLowerCase().trim().replace(/\bbelow\b/g,"bottom").replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"-").replace(/-{2,}/g,"-")}(t))}async function m(t,e){const n=d(t.position);if(u.has(n))return u.get(n);const o=(async()=>{const o=c.get(n);if(null!=o&&o.isConnected)return o;let i=document.getElementById(n);i&&!i.isConnected&&document.body.appendChild(i),i?(i.style.position=i.style.position||"fixed",i.style.zIndex=i.style.zIndex||"9999","function"==typeof e&&await e(i,t)):(i=document.createElement("div"),i.id=n,i.setAttribute("role","status"),i.setAttribute("aria-atomic","true"),i.style.position="fixed",i.style.zIndex="9999",i.style.inset="auto 10px 10px auto",i.style.display="flex",i.style.justifyContent="space-between",i.style.alignItems="center",i.style.flexDirection="column",i.style.overflow="hidden","function"==typeof e&&await e(i,t),document.body.appendChild(i));const r=document.querySelectorAll("#".concat(n));if(r.length>1)for(let t=1;t<r.length;t++)try{r[t].remove()}catch(t){}return c.set(n,i),i})();u.set(n,o);try{return await o}finally{u.delete(d(t.position))}}async function h(t,e){if(!t||!e.position)throw new Error("Invalid container or position!");!function(t){t.style.top="auto",t.style.bottom="auto",t.style.left="auto",t.style.right="auto",t.style.transform="none"}(t);const n=function(t){const e=t.toLowerCase().trim();return{hasTop:e.includes("top"),hasBottom:e.includes("bottom")||e.includes("below"),hasLeft:e.includes("left"),hasRight:e.includes("right"),hasCenter:e.includes("center"),hasFullWidth:e.includes("top-full-width")||e.includes("bottom-full-width")||e.includes("fullwidth")}}(e.position);(function(t,e,n){if(!n.hasFullWidth)return!1;if(e.maxWidth="100vw",n.hasTop)return t.style.top="10px",t.style.left="10px",t.style.right="10px",!0;if(n.hasBottom)return t.style.bottom="10px",t.style.left="10px",t.style.right="10px",!0;return!1})(t,e,n)||function(t,e){if(!e.hasCenter)return!1;if(e.hasTop&&!e.hasLeft&&!e.hasRight)return t.style.top="10px",t.style.left="50%",t.style.transform="translateX(-50%)",!0;if(e.hasBottom&&!e.hasLeft&&!e.hasRight)return t.style.bottom="10px",t.style.left="50%",t.style.transform="translateX(-50%)",!0;if(e.hasLeft&&!e.hasTop&&!e.hasBottom)return t.style.left="10px",t.style.top="50%",t.style.transform="translateY(-50%)",!0;if(e.hasRight&&!e.hasTop&&!e.hasBottom)return t.style.right="10px",t.style.top="50%",t.style.transform="translateY(-50%)",!0;if(!(e.hasLeft||e.hasRight||e.hasTop||e.hasBottom))return t.style.top="50%",t.style.left="50%",t.style.transform="translate(-50%, -50%)",!0;return!1}(t,n)||function(t,e){e.hasBottom?t.style.bottom="10px":e.hasTop&&(t.style.top="10px");e.hasRight?t.style.right="10px":e.hasLeft?t.style.left="10px":(t.style.bottom="10px",t.style.left="50%",t.style.transform="translateX(-50%)")}(t,n)}class p{constructor(t,e){this.callback=t,this.delay=e,this.remaining=e,this.startTime=null,this.timeoutId=null,this.isPaused=!1,this.isCompleted=!1}start(){return this.isCompleted||this.timeoutId||(this.startTime=Date.now(),this.timeoutId=setTimeout(()=>{this.isCompleted=!0,this.timeoutId=null,this.callback()},this.remaining)),this}pause(){return this.isPaused||!this.timeoutId||this.isCompleted||(clearTimeout(this.timeoutId),this.timeoutId=null,this.remaining-=Date.now()-this.startTime,this.remaining=Math.max(0,this.remaining),this.isPaused=!0),this}resume(){return!this.isPaused||this.isCompleted||(this.isPaused=!1,this.start()),this}clear(){return this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null),this.isCompleted=!0,this}getRemainingTime(){return this.isCompleted?0:this.isPaused?this.remaining:this.timeoutId?Math.max(0,this.remaining-(Date.now()-this.startTime)):this.delay}}const f=new Map,y=new Map,g=[];let b=0;async function w(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{const e=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=String(t.type).trim().toLowerCase(),n=function(t){let e=5381;for(let n=0;n<t.length;n++)e=(e<<5)+e+t.charCodeAt(n);return e>>>0}(String(t.message||"")).toString(16),o=String(t.position).trim().toLowerCase();return"".concat(e,"|").concat(n,"|").concat(o)}(t);if(f.has(e)){const n=f.get(e);if(!n)throw new Error("Active toast with key ".concat(e," not found"));return n.count++,n.timer.clear(),n.timer=C(n.toast,t),await E(n),void await O(n)}if(y.has(e)){const t=y.get(e);if(!t)throw new Error("Pending toast with key ".concat(e," not found"));return void t.count++}const n={options:t,count:1,rafId:0};y.set(e,n),n.rafId=requestAnimationFrame(async()=>{const t=y.get(e);if(t){if(y.delete(e),b>=3)return g.push({options:t.options,key:e,count:t.count}),void await L();try{await v(t.options,e,t.count)}catch(t){}}})}catch(t){}}async function v(t,e,n){try{if(!t||"object"!=typeof t)throw new TypeError("options must be an object");b++;const i=await m(t,h);if(!i)throw new Error("Failed to create toast container");const r=await async function(t,e){if(!document.querySelector('[id^="toast-container-"]'))return null;let n;try{return n=await o("div","toast"),await s(n,t,e),n}catch(o){return n=await l(t,e),n}}(t,S);if(!r)throw new Error("Toast element creation failed");const a=document.createElement("div");Object.assign(a.style,{position:"relative",display:"inline-block",overflow:"visible",marginBottom:"10px",zIndex:"0",width:"100%"});const c=document.createElement("div");Object.assign(c.style,{position:"relative",overflow:"hidden",zIndex:"1"}),c.appendChild(r),a.appendChild(c),i.id.includes("toast-container-")&&i.appendChild(a);const u=!1!==t.pauseOnHover&&(!0===t.pauseOnHover||!!t.cta),d={outer:a,toast:r,count:Math.max(1,Math.floor(null!=n?n:0)),timeout:null,pauseOnHover:u};f.set(e,d),r._key=e,d.count>1&&await O(d),d.timer=C(r,t),await E(d)}catch(e){b=Math.max(0,b-1);(document.querySelector('[id^="toast-container-"]')||document.body).appendChild(await l(t,S))}}const x=async function(){try{if(0===f.size)return;let t=null;if(document.querySelectorAll('[id^="toast-container-"]').forEach(e=>{const n=Array.from(e.children||[]);if(0===n.length)return;const o=n.at(0);o&&(t=o.querySelector('[id^="toast-"]')||o)}),!t){const e=Array.from(f.entries());if(e.length>0){const[,n]=e.at(0);t=n.toast||n.outer&&n.outer.querySelector('[id^="toast-"]')}}if(!t)return;const e=t._key?t:t.querySelector('[id^="toast-"]')||t;await S(e)}catch(t){}},k=async function(){try{const t=Array.from(f.values()).map(t=>t.toast).filter(Boolean);g.length=0,y.clear();for(let e=t.length-1;e>=0;e--){const n=t[e];try{await S(n)}catch(t){}}}catch(t){}};function C(t,e){var n;const o=Number(null!==(n=e.duration)&&void 0!==n?n:1800)+5,i=new p(async()=>await S(t),o);return i.start(),i}async function E(t){if(!t.pauseOnHover||!t.outer||!t.timer)return;const{outer:e,timer:n}=t,o=()=>n.pause(),i=()=>n.resume(),r=t=>{t.target.matches("[tabindex], div, span, button, a")&&n.pause()},a=t=>{e.contains(t.relatedTarget)||n.resume()};e.addEventListener("mouseenter",o),e.addEventListener("mouseleave",i),e.addEventListener("focusin",r),e.addEventListener("focusout",a),e._pauseCleanup=()=>{e.removeEventListener("mouseenter",o),e.removeEventListener("mouseleave",i),e.removeEventListener("focusin",r),e.removeEventListener("focusout",a)}}async function S(t){try{var e,n,o;if(null==t||!t._key)return;const i=f.get(t._key);if(!i)return;null===(e=i.timer)||void 0===e||e.clear(),null===(n=i.outer)||void 0===n||null===(o=n._pauseCleanup)||void 0===o||o.call(n),f.delete(t._key),b=Math.max(0,b-1);const r=i.outer.querySelector(".toast-count-badge");r&&r.remove(),await async function(t){return t?new Promise(e=>{let n=!1;const o=()=>{n||(n=!0,async function(t){if(!t)return!0;try{var e;if(null!=t&&null!==(e=t.parentNode)&&void 0!==e&&e.id.includes("toast-container-"))return t.parentNode.removeChild(t),!0}catch(t){}try{if(t.remove)return t.remove(),!0}catch(t){}try{return Object.assign(t.style,{display:"none",opacity:"0",pointerEvents:"none",position:"absolute",left:"-9999px"}),!0}catch(t){}}(t),e())},i=t.firstElementChild||t;if(!i)return e();const r=t=>{try{if(t.target!==i)return;i.removeEventListener("transitionend",r,!0),o()}catch(t){}};try{i.addEventListener("transitionend",r,!0)}catch(t){}setTimeout(()=>{try{i.removeEventListener("transitionend",r,!0),o()}catch(t){}},700)}):Promise.resolve()}(i.outer),await L()}catch(t){}}async function L(){for(;b<3&&g.length;){const t=g.shift();if(f.has(t.key)){const e=f.get(t.key);e.count+=t.count,await O(e);continue}v(t.options,t.key,t.count)}}async function O(t){let{outer:e,count:n}=t;if(!(e&&e instanceof HTMLElement))throw new Error("updateBadge: outer must be a valid HTMLElement");if(n<2){const t=e.querySelector(".toast-count-badge");return void(t&&t.remove())}let o=e.querySelector(".toast-count-badge");o||(o=document.createElement("span"),o.className="toast-count-badge",o.setAttribute("aria-label","".concat(n," identical notifications")),Object.assign(o.style,{position:"absolute",top:"6px",right:"6px",backgroundColor:"#f44336",color:"#fff",borderRadius:"50%",minWidth:"20px",height:"20px",fontSize:"12px",fontWeight:"600",display:"flex",alignItems:"center",justifyContent:"center",border:"2px solid #fff",boxShadow:"0 2px 6px rgba(0,0,0,0.3)",zIndex:"2",pointerEvents:"none",transition:"transform 150ms ease"}),e.appendChild(o)),o.textContent=n>99?"99+":String(n);try{o.style.transform="scale(1.2)",setTimeout(()=>o.style.transform="scale(1)",150)}catch(t){}}let M={success:"#28a745",error:"#dc3545",warning:"#ffc107",info:"#17a2b8"},j={success:"Operation completed successfully!",error:"Something went wrong!",warning:"Warning message!",info:"Information message!"};const T=[];let I=!1;async function P(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{const e=await async function(t){var e,o;const i=null==t||null===(e=t.position)||void 0===e||null===(e=e.toLowerCase())||void 0===e?void 0:e.trim(),r=null!=i&&i.includes("top-full-width")||null!=i&&i.includes("bottom-full-width")?"100vw":"400px",s=n(n({},{pauseOnHover:void 0,duration:2500,position:"bottom-right",type:"info",borderRadius:"50px",backgroundColor:void 0,textColor:void 0,showCloseButton:!0,animationDuration:"0.4s",animationType:"fade",animationEasing:"ease",showProgressBar:!0,progressColor:void 0,progressHeight:"4px",progressPosition:"bottom",fontPosition:"relative",fontPadding:void 0,fontBorderRadius:void 0,fontBackgroundColor:void 0,fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontSize:"14px",fontWeight:"400",fontLineHeight:"1.4",fontDirection:"auto",wrapText:"normal",maxWidth:r}),"object"!=typeof t||Array.isArray(t)?{}:t);s.message=null!==(o=null==t?void 0:t.message)&&void 0!==o?o:s.message;try{var l,c,u;if(!s.backgroundColor)s.backgroundColor=null!==(c=null===(u=M)||void 0===u?void 0:u[s.type])&&void 0!==c?c:window.matchMedia("(prefers-color-scheme: dark)").matches?"#f5f5f5":"#111111";if(s.message=s.message||(null===(l=j)||void 0===l?void 0:l[s.type])||"No Message Provided!",!s.textColor&&s.backgroundColor){const t=a(s.backgroundColor);s.textColor=t}if(!s.progressColor&&s.backgroundColor)if(s.textColor)s.progressColor=s.textColor;else{const t=a(s.backgroundColor);s.progressColor=t}}catch(t){}"string"!=typeof s.message&&(s.message="No Message Provided!");return s}(t);await async function(t){try{return await m(t,h)}catch(t){return document.body}}(e),await w(e)}catch(e){const n="string"==typeof(null==t?void 0:t.message)&&null!==(null==t?void 0:t.message)?"".concat(t.message.substring(0,200)," toast creation failed!"):"Toast creation failed!";alert(n)}}async function A(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"undefined"!=typeof window&&"undefined"!=typeof document&&(await async function(){I||"undefined"!=typeof window&&"undefined"!=typeof document&&("complete"===document.readyState||"interactive"===document.readyState?(I=!0,T.forEach(t=>setTimeout(()=>P(t),2500)),T.length=0):document.addEventListener("DOMContentLoaded",()=>{I=!0,T.forEach(t=>setTimeout(()=>P(t),2500)),T.length=0},{once:!0}))}(),I?await P(t):T.push(t))}function W(t){try{t&&"object"==typeof t&&!Array.isArray(t)&&(M=n(n({},M),t))}catch(t){}}function B(t){try{t&&"object"==typeof t&&!Array.isArray(t)&&(j=n(n({},j),t))}catch(t){}}let z=!1,q=null;const D=A;async function R(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return async function(t){if(z&&q)try{await q}catch(t){}return t()}(()=>D(t))}const H=async()=>{z=!0,q=(async()=>{try{await x()}finally{z=!1,q=null}})(),await q},F=async()=>{z=!0,q=(async()=>{try{await k()}finally{z=!1,q=null}})(),await q};if("undefined"!=typeof window&&"undefined"!=typeof document){let t=!1;if(!t){const e=t=>{"Escape"!==t.key&&"Esc"!==t.key||(async()=>{z=!0,q=(async()=>{try{await x()}finally{z=!1,q=null}})(),await q})()};window.addEventListener("keydown",e,{passive:!0}),t=!0}}const N=async function(){await k()};try{"undefined"!=typeof window&&(window.customizableToast={createToast:A,setDefaultColors:W,setDefaultMessages:B,noop:N,dismiss:x})}catch(t){}export{R as createToast,H as dismiss,H as dismissToast,F as noop,F as noopAll,W as setDefaultColors,B as setDefaultMessages};
|
|
16
|
-
//# sourceMappingURL=index.esm.mjs.map
|
|
15
|
+
function t(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);n<e;n++)o[n]=t[n];return o}function e(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e);if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function n(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)}return n}function o(t){for(var o=1;o<arguments.length;o++){var r=null!=arguments[o]?arguments[o]:{};o%2?n(Object(r),!0).forEach(function(n){e(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function r(e,n){return function(t){if(Array.isArray(t))return t}(e)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,r,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(o=i.call(n)).done)&&(s.push(o.value),s.length!==e);l=!0);}catch(t){c=!0,r=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return s}}(e,n)||function(e,n){if(e){if("string"==typeof e)return t(e,n);var o={}.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?t(e,n):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}async function i(t,e){const n=document.createElement(t);return n.id=function(t){const e=Date.now().toString(36),n=Math.floor(1048575*Math.random()).toString(36);return"".concat(t,"-").concat(e,"-").concat(n)}(e),n}const a=new class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:200;this.maxSize=t,this.map=new Map}get(t){if(!this.map.has(t))return;const e=this.map.get(t);return this.map.delete(t),this.map.set(t,e),e}set(t,e){if(this.map.has(t))this.map.delete(t);else if(this.map.size>=this.maxSize){const t=this.map.keys().next().value;this.map.delete(t)}this.map.set(t,e)}}(200),s={};function l(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!t)return"snow";const n="".concat(t,"|").concat(e),o=a.get(n);if(o)return o;if(s[null==t?void 0:t.toLowerCase()]){const e=s[t.toLowerCase()];return a.set(n,e),e}let i,l,c;try{const e=null==t?void 0:t.match(/^#([0-9a-f]{3,8})$/i);if(e){let t=e[1];3===t.length&&(t=t.split("").map(t=>t+t).join("")),i=parseInt(t.slice(0,2),16),l=parseInt(t.slice(2,4),16),c=parseInt(t.slice(4,6),16)}else{const e=null==t?void 0:t.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\)/i);if(!e)throw new Error("Unknown color");i=Number(e[1]),l=Number(e[2]),c=Number(e[3])}}catch(t){i=50+Math.floor(206*Math.random()),l=50+Math.floor(206*Math.random()),c=50+Math.floor(206*Math.random())}i=Math.round(i*e+255*(1-e)),l=Math.round(l*e+255*(1-e)),c=Math.round(c*e+255*(1-e));const u=(t,e,n)=>{const o=[t,e,n].map(t=>(t/=255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4));return.2126*o[0]+.7152*o[1]+.0722*o[2]},d=(t,e)=>{const n=u(...t),o=u(...e);return(Math.max(n,o)+.05)/(Math.min(n,o)+.05)};let f=((t,e,n)=>{t/=255,e/=255,n/=255;const o=Math.max(t,e,n),r=Math.min(t,e,n);let i,a,s=(o+r)/2;if(o===r)i=a=0;else{const l=o-r;switch(a=s>.5?l/(2-o-r):l/(o+r),o){case t:i=(e-n)/l+(e<n?6:0);break;case e:i=(n-t)/l+2;break;case n:i=(t-e)/l+4}i/=6}return[360*i,a,s]})(i,l,c),m=r(f,3),p=m[0],h=m[1],y=m[2];let g=((t,e,n)=>{let o,r,i;if(t/=360,0===e)o=r=i=n;else{const a=(t,e,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t),s=n<.5?n*(1+e):n+e-n*e,l=2*n-s;o=a(l,s,t+1/3),r=a(l,s,t),i=a(l,s,t-1/3)}return[Math.round(255*o),Math.round(255*r),Math.round(255*i)]})(p,h,y<.5?Math.min(y+.5,1):Math.max(y-.5,0)),b=r(g,3),w=b[0],v=b[1],x=b[2];if(d([i,l,c],[w,v,x])<4.5){var C=r(d([i,l,c],[0,0,0])>=d([i,l,c],[255,255,255])?[0,0,0]:[255,255,255],3);w=C[0],v=C[1],x=C[2]}const k=((t,e,n)=>"#".concat(t.toString(16).padStart(2,"0")).concat(e.toString(16).padStart(2,"0")).concat(n.toString(16).padStart(2,"0")))(w,v,x);return a.set(n,k),k}function c(t){if(!t||"string"!=typeof t)return"";let e=t.replace(/<\/?(script|iframe|object|embed|link|meta|style|form|input|button)[^>]*>/gi,"");e=e.replace(/\s(on\w+)\s*=\s*(['"])[\s\S]*?\2/gi,""),e=e.replace(/(href|src)\s*=\s*(['"])\s*javascript:[^'"]*\2/gi,"$1=$2#$2");const n=document.createElement("div");n.innerHTML=e;const o=new Set(["DIV","SPAN","P","BR","STRONG","B","EM","I","U","SMALL","UL","OL","LI","A","IMG","PRE","CODE","MARK"]),r=new Set(["href","src","alt","title","class","target","rel"]);function i(t){if(t.nodeType===Node.TEXT_NODE)return document.createTextNode(t.nodeValue);if(t.nodeType!==Node.ELEMENT_NODE)return null;const e=t.tagName.toUpperCase();if(!o.has(e)){const e=document.createDocumentFragment();return Array.from(t.childNodes).forEach(t=>{const n=i(t);n&&e.appendChild(n)}),e}const n=document.createElement(t.tagName);return Array.from(t.attributes||[]).forEach(e=>{const o=e.name.toLowerCase(),i=e.value;r.has(o)&&("href"!==o&&"src"!==o||!/^\s*javascript:/i.test(i))&&("src"!==o||/^\s*(https?:|data:image\/)/i.test(i))&&("target"===o&&"_blank"===i&&n.setAttribute("rel",(t.getAttribute("rel")||"")+" noopener noreferrer"),n.setAttribute(o,i))}),Array.from(t.childNodes).forEach(t=>{const e=i(t);e&&n.appendChild(e)}),n}const a=document.createDocumentFragment();Array.from(n.childNodes).forEach(t=>{const e=i(t);e&&a.appendChild(e)});const s=document.createElement("div");return s.appendChild(a),s.innerHTML}function u(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t)return"";try{if(!e.forceFallback&&function(){try{if("undefined"!=typeof window&&window.DOMPurify)return!0}catch(t){}return!1}())return window.DOMPurify.sanitize(t,{ADD_ATTR:["target"],ALLOWED_URI_REGEXP:/^(?:(?:https?|mailto|ftp|tel|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i})}catch(t){}return c(t)}async function d(t,e,n){var o,r;const i=await async function(t){if("number"==typeof t&&t>0)return t;if("string"==typeof t){if(t.endsWith("s")&&!t.endsWith("ms")){const e=1e3*parseFloat(t);return e>0?e:500}const e=parseFloat(t);return e>0?e:500}return 500}(null==e?void 0:e.animationDuration);t.className="toast toast-".concat(null!==(o=null==e?void 0:e.type)&&void 0!==o?o:"info"),Object.assign(t.style,{background:null==e?void 0:e.backgroundColor,padding:"12px 16px",marginBottom:"10px",borderRadius:null==e?void 0:e.borderRadius,overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"space-between",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)",minWidth:"250px",maxWidth:null==e?void 0:e.maxWidth,opacity:"0",position:"relative",cursor:"default",boxSizing:"border-box",userSelect:"text",transition:"opacity ".concat(null==e?void 0:e.animationDuration," ").concat(null==e?void 0:e.animationEasing,", transform ").concat(null==e?void 0:e.animationDuration," ").concat(null==e?void 0:e.animationEasing),transform:"translateY(20px)",zIndex:"9999"}),t.setAttribute("role","alert"),t.setAttribute("aria-live","polite"),t.tabIndex=0,t._animationDuration=i;const a=document.createElement("span");null!=e&&e.wrapText?Object.assign(a.style,{display:"block",whiteSpace:"normal"}):Object.assign(a.style,{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3",whiteSpace:"nowrap"}),Object.assign(a.style,{flex:"1",padding:null==e?void 0:e.fontPadding,fontFamily:null==e?void 0:e.fontFamily,fontSize:null==e?void 0:e.fontSize,fontWeight:null==e?void 0:e.fontWeight,lineHeight:null==e?void 0:e.fontLineHeight,color:null==e?void 0:e.textColor,userSelect:"text",wordBreak:"break-word",overflow:"hidden",textOverflow:"ellipsis"});const s=!!e.allowHtml,l=null!==(r=e.message)&&void 0!==r?r:"";if(e.loader||e.showLoader){const t=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=t.size||14,n=t.color||"currentColor",o=t.text||"",r=document.createElement("span");r.className="toast-loader",r.style.display="inline-flex",r.style.alignItems="center",r.style.gap="8px";const i="http://www.w3.org/2000/svg",a=document.createElementNS(i,"svg");a.setAttribute("width",String(e)),a.setAttribute("height",String(e)),a.setAttribute("viewBox","0 0 50 50"),a.setAttribute("aria-hidden","true");const s=document.createElementNS(i,"circle");if(s.setAttribute("cx","25"),s.setAttribute("cy","25"),s.setAttribute("r","20"),s.setAttribute("fill","none"),s.setAttribute("stroke",n),s.setAttribute("stroke-width","4"),s.setAttribute("stroke-linecap","round"),s.style.opacity="0.85",s.style.strokeDasharray="90",s.style.strokeDashoffset="60",s.style.transformOrigin="center",s.style.animation="toast-spinner 1s linear infinite",a.appendChild(s),r.appendChild(a),o){const t=document.createElement("span");t.style.fontSize="13px",t.textContent=o,r.appendChild(t)}if(!document.getElementById("toast-spinner-styles")){const t=document.createElement("style");t.id="toast-spinner-styles",t.innerHTML="@keyframes toast-spinner { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }",document.head.appendChild(t)}return r}(e.loader||{});a.appendChild(t);const n=document.createElement("span");n.style.display="inline-block",n.style.width="8px",a.appendChild(n)}if(s&&"string"==typeof l&&l.trim().length>0)try{const t=u(l),e=document.createElement("div");for(e.innerHTML=t;e.firstChild;)a.appendChild(e.firstChild)}catch(t){console.warn("HTML message sanitization failed, falling back to text:",t),a.textContent=l}else a.textContent=String(l);a.setAttribute("aria-label","Toast Notification Center"),a.setAttribute("title","string"==typeof l?l.replace(/<[^>]+>/g,""):String(l)),t.appendChild(a),null!=e&&e.cta&&0!==Object.keys(e.cta).length&&function(t,e,n){const o=null==e?void 0:e.cta;if(!o)return;o.label||(o.label="CTA Label Missing!");const r=!!o.href&&"link"===o.variant,i=document.createElement(r?"a":"button");r?(i.href=o.href,o.target&&(i.target=o.target),i.rel=o.rel||("_blank"===o.target?"noopener noreferrer":"")):i.type="button",i.setAttribute("aria-label",o.ariaLabel||o.label),Object.assign(i.style,{marginLeft:"10px",padding:"6px 10px",borderRadius:"6px",fontSize:"12px",fontWeight:"600",lineHeight:"1",border:"1px solid rgba(255,255,255,0.35)",color:e.textColor||"#fff",background:"rgba(255,255,255,0.15)",cursor:"pointer",whiteSpace:"nowrap",flexShrink:"0"}),i.textContent=o.label;const a=async e=>{try{if("function"==typeof o.onClick){const t=o.onClick(e);null!=t&&t.then&&await t}}finally{!1!==o.autoClose&&n(t)}};i.addEventListener("click",a),i._cleanup=()=>i.removeEventListener("click",a),t.appendChild(i)}(t,e,n),null!=e&&e.showCloseButton&&function(t,e,n){const o=document.createElement("button");o.setAttribute("aria-label","Close notification"),o.setAttribute("title","Close"),o.textContent="×",Object.assign(o.style,{background:"none",border:"none",color:e.textColor||"white",fontSize:"18px",marginLeft:"10px",cursor:"pointer"});const r=()=>n(t);o.addEventListener("click",r),t._cleanupCloseButton=()=>{o.removeEventListener("click",r)},t.appendChild(o)}(t,e,n),null!=e&&e.showProgressBar&&function(t,e){const n=document.createElement("div"),o=e.borderRadius||0,r=parseInt(o,10),i=r?"12px":"0",a=r?12:0,s=Math.max(r-10,a),l=r?"calc(100% - ".concat(s,"px)"):"100%";Object.assign(n.style,{position:"absolute",left:"".concat(i),height:e.progressHeight||"4px",background:e.progressColor||"rgba(255, 255, 255, 0.3)",width:"".concat(l),transition:"width ".concat(e.duration||1800,"ms linear"),["top"===e.progressPosition?"top":"bottom"]:"0",borderRadius:e.borderRadius||"4px"}),t.appendChild(n),"function"==typeof n.animate?t._progressAnimation=n.animate([{width:l},{width:"0%"}],{duration:Number(e.duration)||1800,easing:"linear",fill:"forwards",delay:50}):(n.style.transition="width ".concat(e.duration||1800,"ms linear"),setTimeout(()=>{n.offsetWidth,n.style.width="0%"},50))}(t,e),function(t){setTimeout(()=>{requestAnimationFrame(()=>{t.style.opacity="1",t.style.transform="translateY(0)"})},50)}(t)}async function f(t,e){try{const n=document.createElement("div");Object.assign(n.style,{background:"#333",color:"white",padding:"10px 15px",position:"fixed",top:"20px",right:"20px",zIndex:"99999",borderRadius:"3px",maxWidth:"250px",wordWrap:"break-word",boxShadow:"0 2px 10px rgba(0,0,0,0.3)",cursor:"pointer"});const o=document.createElement("div"),r=document.createElement("span");r.style.display="inline-block",t.allowHtml?r.innerHTML=u(String(t.message||"Emergency Toast Showing!")):r.textContent=String(t.message||"Emergency Toast Creation Showing!"),o.appendChild(r);const i=document.createElement("span");for(i.style.cssText="float: right; margin-left: 10px; font-weight: bold;",i.textContent="×",o.appendChild(i);n.firstChild;)n.removeChild(n.firstChild);return n.appendChild(o),i.onclick=()=>{n.remove(),e(n)},document.body.appendChild(n),setTimeout(()=>{n.remove(),e(n)},null==t?void 0:t.duration),n}catch(n){return console.error("Emergency toast creation failed:",n),setTimeout(()=>{alert((null==t?void 0:t.message)||"Emergency Toast Creation Showing!"),e(null)},100),null}}Object.entries({aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}).forEach(t=>{let e=r(t,2),n=e[0],o=r(e[1],3),i=o[0],a=o[1],l=o[2];const c=t=>{const e=t/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)},u=.2126*c(i)+.7152*c(a)+.0722*c(l),d=(u+.05)/.05,f=1.05/(u+.05);s[n.toLowerCase()]=d>=f?"#000000":"#ffffff"});const m=new Map,p=new Map;function h(t){return"toast-container-".concat(function(t){return String(t).toLowerCase().trim().replace(/\bbelow\b/g,"bottom").replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"-").replace(/-{2,}/g,"-")}(t))}async function y(t,e){const n=h(t.position);if(p.has(n))return p.get(n);const o=(async()=>{const o=m.get(n);if(null!=o&&o.isConnected)return o;let r=document.getElementById(n);r&&!r.isConnected&&document.body.appendChild(r),r?(r.style.position=r.style.position||"fixed",r.style.zIndex=r.style.zIndex||"9999","function"==typeof e&&await e(r,t)):(r=document.createElement("div"),r.id=n,r.setAttribute("role","status"),r.setAttribute("aria-atomic","true"),r.style.position="fixed",r.style.zIndex="9999",r.style.inset="auto 10px 10px auto",r.style.display="flex",r.style.justifyContent="space-between",r.style.alignItems="center",r.style.flexDirection="column",r.style.overflow="hidden","function"==typeof e&&await e(r,t),document.body.appendChild(r));const i=document.querySelectorAll("#".concat(n));if(i.length>1)for(let t=1;t<i.length;t++)try{i[t].remove()}catch(t){}return m.set(n,r),r})();p.set(n,o);try{return await o}finally{p.delete(h(t.position))}}async function g(t,e){if(!t||!e.position)throw new Error("Invalid container or position!");!function(t){t.style.top="auto",t.style.bottom="auto",t.style.left="auto",t.style.right="auto",t.style.transform="none"}(t);const n=function(t){const e=t.toLowerCase().trim();return{hasTop:e.includes("top"),hasBottom:e.includes("bottom")||e.includes("below"),hasLeft:e.includes("left"),hasRight:e.includes("right"),hasCenter:e.includes("center"),hasFullWidth:e.includes("top-full-width")||e.includes("bottom-full-width")||e.includes("fullwidth")}}(e.position);(function(t,e,n){if(!n.hasFullWidth)return!1;if(e.maxWidth="100vw",n.hasTop)return t.style.top="10px",t.style.left="10px",t.style.right="10px",!0;if(n.hasBottom)return t.style.bottom="10px",t.style.left="10px",t.style.right="10px",!0;return!1})(t,e,n)||function(t,e){if(!e.hasCenter)return!1;if(e.hasTop&&!e.hasLeft&&!e.hasRight)return t.style.top="10px",t.style.left="50%",t.style.transform="translateX(-50%)",!0;if(e.hasBottom&&!e.hasLeft&&!e.hasRight)return t.style.bottom="10px",t.style.left="50%",t.style.transform="translateX(-50%)",!0;if(e.hasLeft&&!e.hasTop&&!e.hasBottom)return t.style.left="10px",t.style.top="50%",t.style.transform="translateY(-50%)",!0;if(e.hasRight&&!e.hasTop&&!e.hasBottom)return t.style.right="10px",t.style.top="50%",t.style.transform="translateY(-50%)",!0;if(!(e.hasLeft||e.hasRight||e.hasTop||e.hasBottom))return t.style.top="50%",t.style.left="50%",t.style.transform="translate(-50%, -50%)",!0;return!1}(t,n)||function(t,e){e.hasBottom?t.style.bottom="10px":e.hasTop&&(t.style.top="10px");e.hasRight?t.style.right="10px":e.hasLeft?t.style.left="10px":(e.hasBottom||e.hasTop||(t.style.bottom="10px"),t.style.left="50%",t.style.transform="translateX(-50%)")}(t,n)}class b{constructor(t,e){this.callback=t,this.delay=e,this.remaining=e,this.startTime=null,this.timeoutId=null,this.isPaused=!1,this.isCompleted=!1}start(){return this.isCompleted||this.timeoutId||(this.startTime=Date.now(),this.timeoutId=setTimeout(()=>{this.isCompleted=!0,this.timeoutId=null,this.callback()},this.remaining)),this}pause(){return this.isPaused||!this.timeoutId||this.isCompleted||(clearTimeout(this.timeoutId),this.timeoutId=null,this.remaining-=Date.now()-this.startTime,this.remaining=Math.max(0,this.remaining),this.isPaused=!0),this}resume(){return!this.isPaused||this.isCompleted||(this.isPaused=!1,this.start()),this}clear(){return this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null),this.isCompleted=!0,this}getRemainingTime(){return this.isCompleted?0:this.isPaused?this.remaining:this.timeoutId?Math.max(0,this.remaining-(Date.now()-this.startTime)):this.delay}}const w=new Map,v=new Map,x=[];let C=0;async function k(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{const e=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=String(t.type).trim().toLowerCase(),n=function(t){let e=5381;for(let n=0;n<t.length;n++)e=(e<<5)+e+t.charCodeAt(n);return e>>>0}(String(t.message||"")).toString(16),o=String(t.position).trim().toLowerCase();return"".concat(e,"|").concat(n,"|").concat(o)}(t);if(w.has(e)){const n=w.get(e);if(!n)throw new Error("Active toast with key ".concat(e," not found"));return n.count++,n.timer.clear(),n.timer=A(n.toast,t),await M(n),void await j(n)}if(v.has(e)){const t=v.get(e);if(!t)throw new Error("Pending toast with key ".concat(e," not found"));return void t.count++}const n={options:t,count:1,rafId:0};v.set(e,n),n.rafId=requestAnimationFrame(async()=>{const t=v.get(e);if(t){if(v.delete(e),C>=3)return x.push({options:t.options,key:e,count:t.count}),void await O();try{await E(t.options,e,t.count)}catch(t){console.error("showToast failed:",t)}}})}catch(t){console.error("showToast failed:",t)}}async function E(t,e,n){try{if(!t||"object"!=typeof t)throw new TypeError("options must be an object");C++;const o=await y(t,g);if(!o)throw new Error("Failed to create toast container");const r=await async function(t,e){if(!document.querySelector('[id^="toast-container-"]'))return null;let n;try{return n=await i("div","toast"),await d(n,t,e),n}catch(o){return console.warn("toast creation failed with error showing fallback one: ",o),n=await f(t,e),n}}(t,L);if(!r)throw new Error("Toast element creation failed");const a=document.createElement("div");Object.assign(a.style,{position:"relative",display:"inline-block",overflow:"visible",marginBottom:"10px",zIndex:"0",width:"100%"});const s=document.createElement("div");Object.assign(s.style,{position:"relative",overflow:"hidden",zIndex:"1"}),s.appendChild(r),a.appendChild(s),o.id.includes("toast-container-")&&o.appendChild(a);const l=!1!==t.pauseOnHover&&(!0===t.pauseOnHover||!!t.cta),c={outer:a,toast:r,count:Math.max(1,Math.floor(null!=n?n:0)),timeout:null,pauseOnHover:l};w.set(e,c),r._key=e,c.count>1&&await j(c),c.timer=A(r,t),await M(c)}catch(e){console.error("Something went wrong: ",e),C=Math.max(0,C-1);(document.querySelector('[id^="toast-container-"]')||document.body).appendChild(await f(t,L))}}const S=async function(){try{if(0===w.size)return;let t=null;if(document.querySelectorAll('[id^="toast-container-"]').forEach(e=>{const n=Array.from(e.children||[]);if(0===n.length)return;const o=n.at(-1);o&&(t=o.querySelector('[id^="toast-"]')||o)}),!t){const e=Array.from(w.entries());if(e.length>0){const n=e.at(-1),o=r(n,2)[1];t=o.toast||o.outer&&o.outer.querySelector('[id^="toast-"]')}}if(!t)return;const e=t._key?t:t.querySelector('[id^="toast-"]')||t;await L(e)}catch(t){console.error("dismissMostRecent failed:",t)}},T=async function(){try{const t=Array.from(w.values()).map(t=>t.toast).filter(Boolean);x.length=0,v.clear();for(const e of t)try{await L(e)}catch(t){console.warn("closeAllToasts: failed to close one toast:",t)}}catch(t){console.error("closeAllToasts failed:",t)}};function A(t,e){var n;const o=Number(null!==(n=e.duration)&&void 0!==n?n:1800)+5,r=new b(async()=>await L(t),o);return r.start(),r}async function M(t){if(!t.pauseOnHover||!t.outer||!t.timer)return;const e=t.outer,n=t.timer,o=t.toast,r=()=>{var t;n.pause(),null==o||null===(t=o._progressAnimation)||void 0===t||t.pause()},i=()=>{var t;n.resume(),null==o||null===(t=o._progressAnimation)||void 0===t||t.play()},a=t=>{var e;t.target.matches("[tabindex], div, span, button, a")&&(n.pause(),null==o||null===(e=o._progressAnimation)||void 0===e||e.pause())},s=t=>{var r;e.contains(t.relatedTarget)||(n.resume(),null==o||null===(r=o._progressAnimation)||void 0===r||r.play())};e.addEventListener("mouseenter",r),e.addEventListener("mouseleave",i),e.addEventListener("focusin",a),e.addEventListener("focusout",s),e._pauseCleanup=()=>{e.removeEventListener("mouseenter",r),e.removeEventListener("mouseleave",i),e.removeEventListener("focusin",a),e.removeEventListener("focusout",s)}}async function L(t){try{var e,n,o;if(null==t||!t._key)return;const r=w.get(t._key);if(!r)return;null===(e=r.timer)||void 0===e||e.clear(),null===(n=r.outer)||void 0===n||null===(o=n._pauseCleanup)||void 0===o||o.call(n),w.delete(t._key),C=Math.max(0,C-1);const i=r.outer.querySelector(".toast-count-badge");i&&i.remove(),await async function(t){return t?new Promise(e=>{let n=!1;const o=()=>{n||(n=!0,async function(t){if(!t)return!0;try{var e;if(null!=t&&null!==(e=t.parentNode)&&void 0!==e&&e.id.includes("toast-container-"))return t.parentNode.removeChild(t),!0}catch(t){}try{if(t.remove)return t.remove(),!0}catch(t){}try{return Object.assign(t.style,{display:"none",opacity:"0",pointerEvents:"none",position:"absolute",left:"-9999px"}),!0}catch(t){}}(t),e())},r=t.firstElementChild||t;if(!r)return e();const i=t=>{try{if(t.target!==r)return;r.removeEventListener("transitionend",i,!0),o()}catch(t){console.error("removeWithTransition error:",t)}};try{r.addEventListener("transitionend",i,!0)}catch(t){console.error("removeWithTransition error:",t)}setTimeout(()=>{try{r.removeEventListener("transitionend",i,!0),o()}catch(t){console.error("removeWithTransition error:",t)}},700)}):Promise.resolve()}(r.outer),await O()}catch(t){console.error("Closing Toast failed!: ",t)}}async function O(){for(;C<3&&x.length;){const t=x.shift();if(w.has(t.key)){const e=w.get(t.key);e.count+=t.count,await j(e);continue}E(t.options,t.key,t.count)}}async function j(t){let e=t.outer,n=t.count;if(!(e&&e instanceof HTMLElement))throw new Error("updateBadge: outer must be a valid HTMLElement");if(n<2){const t=e.querySelector(".toast-count-badge");return void(t&&t.remove())}let o=e.querySelector(".toast-count-badge");o||(o=document.createElement("span"),o.className="toast-count-badge",o.setAttribute("aria-label","".concat(n," identical notifications")),Object.assign(o.style,{position:"absolute",top:"6px",right:"6px",backgroundColor:"#f44336",color:"#fff",borderRadius:"50%",minWidth:"20px",height:"20px",fontSize:"12px",fontWeight:"600",display:"flex",alignItems:"center",justifyContent:"center",border:"2px solid #fff",boxShadow:"0 2px 6px rgba(0,0,0,0.3)",zIndex:"2",pointerEvents:"none",transition:"transform 150ms ease"}),e.appendChild(o)),o.textContent=n>99?"99+":String(n);try{o.style.transform="scale(1.2)",setTimeout(()=>o.style.transform="scale(1)",150)}catch(t){console.error("updateBadge animation error:",t)}}let I={success:"#28a745",error:"#dc3545",warning:"#ffc107",info:"#17a2b8"},P={success:"Operation completed successfully!",error:"Something went wrong!",warning:"Warning message!",info:"Information message!"};const D=[];let z=!1;async function N(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{const e=await async function(t){var e,n;const r=null==t||null===(e=t.position)||void 0===e||null===(e=e.toLowerCase())||void 0===e?void 0:e.trim(),i=null!=r&&r.includes("top-full-width")||null!=r&&r.includes("bottom-full-width")?"100vw":"400px",a=o(o({},{allowHtml:!1,sanitizeHtml:!0,pauseOnHover:void 0,duration:2500,position:"bottom-right",type:"info",borderRadius:"50px",backgroundColor:void 0,textColor:void 0,showCloseButton:!0,animationDuration:"0.4s",animationType:"fade",animationEasing:"ease",showProgressBar:!0,progressColor:void 0,progressHeight:"4px",progressPosition:"bottom",fontPosition:"relative",fontPadding:void 0,fontBorderRadius:void 0,fontBackgroundColor:void 0,fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontSize:"14px",fontWeight:"400",fontLineHeight:"1.4",fontDirection:"auto",wrapText:"normal",maxWidth:i}),"object"!=typeof t||Array.isArray(t)?{}:t);a.message=null!==(n=null==t?void 0:t.message)&&void 0!==n?n:a.message;try{var s,c,u;if(!a.backgroundColor)a.backgroundColor=null!==(c=null===(u=I)||void 0===u?void 0:u[a.type])&&void 0!==c?c:window.matchMedia("(prefers-color-scheme: dark)").matches?"#f5f5f5":"#111111";if(a.message=a.message||(null===(s=P)||void 0===s?void 0:s[a.type])||"No Message Provided!",!a.textColor&&a.backgroundColor){const t=l(a.backgroundColor);a.textColor=t}if(!a.progressColor&&a.backgroundColor)if(a.textColor)a.progressColor=a.textColor;else{const t=l(a.backgroundColor);a.progressColor=t}}catch(t){console.warn("Option processing failed:",t)}"string"!=typeof a.message&&(a.message="No Message Provided!");return a}(t);await async function(t){try{return await y(t,g)}catch(t){return console.error("Failed to create toast container:",t),document.body}}(e),await k(e)}catch(e){console.error("CreateToast failed:",e);const n="string"==typeof(null==t?void 0:t.message)&&null!==(null==t?void 0:t.message)?"".concat(t.message.substring(0,200)," toast creation failed!"):"Toast creation failed!";alert(n)}}function B(t){try{t&&"object"==typeof t&&!Array.isArray(t)&&(I=o(o({},I),t))}catch(t){console.error("setDefaultColors failed:",t)}}function R(t){try{t&&"object"==typeof t&&!Array.isArray(t)&&(P=o(o({},P),t))}catch(t){console.error("setDefaultMessages failed:",t)}}let W=!1,H=null;const _=async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"undefined"!=typeof window&&"undefined"!=typeof document?(await async function(){z||"undefined"!=typeof window&&"undefined"!=typeof document&&("complete"===document.readyState||"interactive"===document.readyState?(z=!0,D.forEach(t=>setTimeout(()=>N(t),2500)),D.length=0):document.addEventListener("DOMContentLoaded",()=>{z=!0,D.forEach(t=>setTimeout(()=>N(t),2500)),D.length=0},{once:!0}))}(),z?await N(t):D.push(t)):console.warn("ToastNotification: running in non-browser environment, no DOM available.")};async function q(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return async function(t){if(W&&H)try{await H}catch(t){}return t()}(()=>_(t))}const F=async()=>{W=!0,H=(async()=>{try{await S()}finally{W=!1,H=null}})(),await H},U=async()=>{W=!0,H=(async()=>{try{await T()}finally{W=!1,H=null}})(),await H};if("undefined"!=typeof window&&"undefined"!=typeof document){let t=!1;if(!t){const e=t=>{"Escape"!==t.key&&"Esc"!==t.key||(async()=>{W=!0,H=(async()=>{try{await S()}finally{W=!1,H=null}})(),await H})()};window.addEventListener("keydown",e,{passive:!0}),t=!0}}try{"undefined"!=typeof window&&(window.customizableToast={createToast:q,setDefaultColors:B,setDefaultMessages:R,noop:U,dismiss:F})}catch(t){console.error("Global assignment failed:",t)}export{q as createToast,F as dismiss,F as dismissToast,U as noop,U as noopAll,B as setDefaultColors,R as setDefaultMessages};
|
package/dist/index.umd.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Customizable Toast Notifications 3.
|
|
3
|
-
* Build:
|
|
4
|
-
* Cache-Buster:
|
|
2
|
+
* Customizable Toast Notifications 3.11.0
|
|
3
|
+
* Build: 2026-08-12 20:37:24
|
|
4
|
+
* Cache-Buster: 1786567044727
|
|
5
5
|
* Author: Priyanshu Patel
|
|
6
6
|
* Email: [priyanshu.alt191@gmail.com](mailto:priyanshu.alt191@gmail.com)
|
|
7
7
|
* License: Apache-2.0
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
* Supports flexible positioning, theming, icons, animations, and timing options
|
|
13
13
|
* out of the box — with CTA support and zero dependencies.
|
|
14
14
|
*/
|
|
15
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).customizableToast={})}(this,function(e){"use strict";function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function n(e,t,n,r,o,a,i){try{var s=e[a](i),
|
|
15
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).customizableToast={})}(this,function(e){"use strict";function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function n(e,t,n,r,o,a,i){try{var s=e[a](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function r(e){return function(){var t=this,r=arguments;return new Promise(function(o,a){var i=e.apply(t,r);function s(e){n(i,o,a,s,l,"next",e)}function l(e){n(i,o,a,s,l,"throw",e)}s(void 0)})}}function o(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=f(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw a}}}}function a(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach(function(t){a(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function l(){
|
|
16
16
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
17
|
-
var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function a(n,r,o,a){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return u(c,"_invoke",function(n,r,o){var a,s,u,l=0,c=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return a=t,s=0,u=e,p.n=n,i}};function d(n,r){for(s=n,u=r,t=0;!f&&l&&!o&&t<c.length;t++){var o,a=c[t],d=p.p,h=a[2];n>3?(o=h===r)&&(u=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=d&&((o=n<2&&d<a[1])?(s=0,p.v=r,p.n=a[1]):d<h&&(o=n<3||a[0]>r||r>h)&&(a[4]=n,a[5]=r,p.n=h,s=0))}if(o||n>1)return i;throw f=!0,r}return function(o,c,h){if(l>1)throw TypeError("Generator is already running");for(f&&1===c&&d(c,h),s=c,u=h;(t=s<2?e:u)||!f;){a||(s?s<3?(s>1&&(p.n=-1),d(s,u)):p.n=u:p.v=u);try{if(l=2,a){if(s||(o="next"),t=a[o]){if(!(t=t.call(a,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),s=1);a=e}else if((t=(f=p.n<0)?u:n.call(r,p))!==i)break}catch(t){a=e,s=1,u=t}finally{l=1}}return{value:t,done:f}}}(n,o,a),!0),c}var i={};function l(){}function c(){}function f(){}t=Object.getPrototypeOf;var p=[][r]?t(t([][r]())):(u(t={},r,function(){return this}),t),d=f.prototype=l.prototype=Object.create(p);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,u(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=f,u(d,"constructor",f),u(f,"constructor",c),c.displayName="GeneratorFunction",u(f,o,"GeneratorFunction"),u(d),u(d,o,"Generator"),u(d,r,function(){return this}),u(d,"toString",function(){return"[object Generator]"}),(s=function(){return{w:a,m:h}})()}function u(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}u=function(e,t,n,r){function a(t,n){u(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a("next",0),a("throw",1),a("return",2))},u(e,t,n,r)}function l(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,s=[],u=!0,l=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(l)throw o}}return s}}(e,n)||function(e,n){if(e){if("string"==typeof e)return t(e,n);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e){var t=Date.now().toString(36),n=Math.floor(1048575*Math.random()).toString(36);return"".concat(e,"-").concat(t,"-").concat(n)}function f(e,t){return p.apply(this,arguments)}function p(){return(p=r(s().m(function e(t,n){var r;return s().w(function(e){for(;;)switch(e.n){case 0:if(t&&n){e.n=1;break}throw new Error("tagName and prefix are required");case 1:return(r=document.createElement(t)).id=c(n),e.a(2,r)}},e)}))).apply(this,arguments)}function d(e){return h.apply(this,arguments)}function h(){return(h=r(s().m(function e(t){var n;return s().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t){e.n=1;break}return e.a(2,!0);case 1:if(e.p=1,null==t||null===(n=t.parentNode)||void 0===n||!n.id.includes("toast-container-")){e.n=2;break}return t.parentNode.removeChild(t),e.a(2,!0);case 2:e.n=4;break;case 3:e.p=3,e.v;case 4:if(e.p=4,!t.remove){e.n=5;break}return t.remove(),e.a(2,!0);case 5:e.n=7;break;case 6:e.p=6,e.v;case 7:return e.p=7,Object.assign(t.style,{display:"none",opacity:"0",pointerEvents:"none",position:"absolute",left:"-9999px"}),e.a(2,!0);case 8:return e.p=8,e.v,e.a(2,!1)}},e,null,[[7,8],[4,6],[1,3]])}))).apply(this,arguments)}function m(e){return y.apply(this,arguments)}function y(){return(y=r(s().m(function e(t){var n,r;return s().w(function(e){for(;;)switch(e.n){case 0:if(!("number"==typeof t&&t>0)){e.n=1;break}return e.a(2,t);case 1:if("string"!=typeof t){e.n=3;break}if(!t.endsWith("s")||t.endsWith("ms")){e.n=2;break}return n=1e3*parseFloat(t),e.a(2,n>0?n:500);case 2:return r=parseFloat(t),e.a(2,r>0?r:500);case 3:return e.a(2,500)}},e)}))).apply(this,arguments)}var g=new class{constructor(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:200;this.maxSize=e,this.map=new Map}get(e){if(this.map.has(e)){var t=this.map.get(e);return this.map.delete(e),this.map.set(e,t),t}}set(e,t){if(this.map.has(e))this.map.delete(e);else if(this.map.size>=this.maxSize){var n=this.map.keys().next().value;this.map.delete(n)}this.map.set(e,t)}}(200),b={};function v(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!e)return"snow";var n,r,o,a="".concat(e,"|").concat(t),i=g.get(a);if(i)return i;if(b[null==e?void 0:e.toLowerCase()]){var s=b[e.toLowerCase()];return g.set(a,s),s}try{var u=null==e?void 0:e.match(/^#([0-9a-f]{3,8})$/i);if(u){var c=u[1];3===c.length&&(c=c.split("").map(e=>e+e).join("")),n=parseInt(c.slice(0,2),16),r=parseInt(c.slice(2,4),16),o=parseInt(c.slice(4,6),16)}else{var f=null==e?void 0:e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\)/i);if(!f)throw new Error("Unknown color");n=Number(f[1]),r=Number(f[2]),o=Number(f[3])}}catch(e){n=50+Math.floor(206*Math.random()),r=50+Math.floor(206*Math.random()),o=50+Math.floor(206*Math.random())}n=Math.round(n*t+255*(1-t)),r=Math.round(r*t+255*(1-t)),o=Math.round(o*t+255*(1-t));var p=(e,t,n)=>{var r=[e,t,n].map(e=>(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4));return.2126*r[0]+.7152*r[1]+.0722*r[2]},d=(e,t)=>{var n=p(...e),r=p(...t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)},h=((e,t,n)=>{e/=255,t/=255,n/=255;var r,o,a=Math.max(e,t,n),i=Math.min(e,t,n),s=(a+i)/2;if(a===i)r=o=0;else{var u=a-i;switch(o=s>.5?u/(2-a-i):u/(a+i),a){case e:r=(t-n)/u+(t<n?6:0);break;case t:r=(n-e)/u+2;break;case n:r=(e-t)/u+4}r/=6}return[360*r,o,s]})(n,r,o),m=l(h,3),y=m[0],v=m[1],w=m[2],k=((e,t,n)=>{var r,o,a;if(e/=360,0===t)r=o=a=n;else{var i=(e,t,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e),s=n<.5?n*(1+t):n+t-n*t,u=2*n-s;r=i(u,s,e+1/3),o=i(u,s,e),a=i(u,s,e-1/3)}return[Math.round(255*r),Math.round(255*o),Math.round(255*a)]})(y,v,w<.5?Math.min(w+.5,1):Math.max(w-.5,0)),x=l(k,3),C=x[0],S=x[1],E=x[2];if(d([n,r,o],[C,S,E])<4.5){var O=l(d([n,r,o],[0,0,0])>=d([n,r,o],[255,255,255])?[0,0,0]:[255,255,255],3);C=O[0],S=O[1],E=O[2]}var j=((e,t,n)=>"#".concat(e.toString(16).padStart(2,"0")).concat(t.toString(16).padStart(2,"0")).concat(n.toString(16).padStart(2,"0")))(C,S,E);return g.set(a,j),j}function w(e,t,n){var o=null==t?void 0:t.cta;if(o){o.label||(o.label="CTA Label Missing!");var a=!!o.href&&"link"===o.variant,i=document.createElement(a?"a":"button");a?(i.href=o.href,o.target&&(i.target=o.target),i.rel=o.rel||("_blank"===o.target?"noopener noreferrer":"")):i.type="button",i.setAttribute("aria-label",o.ariaLabel||o.label),Object.assign(i.style,{marginLeft:"10px",padding:"6px 10px",borderRadius:"6px",fontSize:"12px",fontWeight:"600",lineHeight:"1",border:"1px solid rgba(255,255,255,0.35)",color:t.textColor||"#fff",background:"rgba(255,255,255,0.15)",cursor:"pointer",whiteSpace:"nowrap",flexShrink:"0"}),i.textContent=o.label;var u=function(){var t=r(s().m(function t(r){var a;return s().w(function(t){for(;;)switch(t.p=t.n){case 0:if(t.p=0,"function"!=typeof o.onClick){t.n=1;break}if(null==(a=o.onClick(r))||!a.then){t.n=1;break}return t.n=1,a;case 1:return t.p=1,!1!==o.autoClose&&n(e),t.f(1);case 2:return t.a(2)}},t,null,[[0,,1,2]])}));return function(e){return t.apply(this,arguments)}}();i.addEventListener("click",u),i._cleanup=()=>i.removeEventListener("click",u),e.appendChild(i)}}function k(e,t,n){var r=document.createElement("button");r.setAttribute("aria-label","Close notification"),r.setAttribute("title","Close"),r.textContent="×",Object.assign(r.style,{background:"none",border:"none",color:t.textColor||"white",fontSize:"18px",marginLeft:"10px",cursor:"pointer"});var o=()=>n(e);r.addEventListener("click",o),e._cleanupCloseButton=()=>{r.removeEventListener("click",o)},e.appendChild(r)}function x(e,t){var n=document.createElement("div"),r=t.borderRadius||0,o=parseInt(r,10),a=o?"calc(100% - ".concat(o-10+"px",")"):"100%",i=o?"12px":"0";Object.assign(n.style,{position:"absolute",left:"".concat(i),height:t.progressHeight||"4px",background:t.progressColor||"rgba(255, 255, 255, 0.3)",width:"".concat(a),transition:"width ".concat(t.duration||1800,"ms linear"),["top"===t.progressPosition?"top":"bottom"]:"0",borderRadius:t.borderRadius||"4px"}),e.appendChild(n),setTimeout(()=>{n.offsetWidth,n.style.width="0%"},50)}function C(e){setTimeout(()=>{requestAnimationFrame(()=>{e.style.opacity="1",e.style.transform="translateY(0)"})},50)}function S(e,t,n){return E.apply(this,arguments)}function E(){return(E=r(s().m(function e(t,n,r){var o,a,i;return s().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,m(null==n?void 0:n.animationDuration);case 1:a=e.v,t.className="toast toast-".concat(null!==(o=null==n?void 0:n.type)&&void 0!==o?o:"info"),Object.assign(t.style,{background:null==n?void 0:n.backgroundColor,padding:"12px 16px",marginBottom:"10px",borderRadius:null==n?void 0:n.borderRadius,overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"space-between",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)",minWidth:"250px",maxWidth:null==n?void 0:n.maxWidth,opacity:"0",position:"relative",cursor:"default",boxSizing:"border-box",userSelect:"text",transition:"opacity ".concat(null==n?void 0:n.animationDuration," ").concat(null==n?void 0:n.animationEasing,", transform ").concat(null==n?void 0:n.animationDuration," ").concat(null==n?void 0:n.animationEasing),transform:"translateY(20px)",zIndex:"9999"}),t.setAttribute("role","alert"),t.setAttribute("aria-live","polite"),t.tabIndex=0,t._animationDuration=a,i=document.createElement("span"),null!=n&&n.wrapText?Object.assign(i.style,{display:"block",whiteSpace:"normal"}):Object.assign(i.style,{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3",whiteSpace:"nowrap"}),Object.assign(i.style,{flex:"1",padding:null==n?void 0:n.fontPadding,fontFamily:null==n?void 0:n.fontFamily,fontSize:null==n?void 0:n.fontSize,fontWeight:null==n?void 0:n.fontWeight,lineHeight:null==n?void 0:n.fontLineHeight,color:null==n?void 0:n.textColor,userSelect:"text",wordBreak:"break-word",overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:"3",WebkitBoxOrient:"vertical"}),i.textContent=null==n?void 0:n.message,i.setAttribute("message",null==n?void 0:n.message),i.setAttribute("aria-label",null==n?void 0:n.message),t.appendChild(i),null!=n&&n.cta&&0!==Object.keys(n.cta).length&&w(t,n,r),null!=n&&n.showCloseButton&&k(t,n,r),null!=n&&n.showProgressBar&&x(t,n),C(t);case 2:return e.a(2)}},e)}))).apply(this,arguments)}function O(e,t){return j.apply(this,arguments)}function j(){return(j=r(s().m(function e(t,n){var r,o,a;return s().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,r=document.createElement("div"),Object.assign(r.style,{background:"#333",color:"white",padding:"10px 15px",position:"fixed",top:"20px",right:"20px",zIndex:"99999",borderRadius:"3px",maxWidth:"250px",wordWrap:"break-word",boxShadow:"0 2px 10px rgba(0,0,0,0.3)",cursor:"pointer"}),(o=document.createElement("span")).textContent=(null==t?void 0:t.message)||"Emergency Toast Creation Showing!",r.appendChild(o),(a=document.createElement("span")).textContent="×",Object.assign(a.style,{float:"right",marginLeft:"10px",fontWeight:"bold"}),a.onclick=()=>{r.remove(),n(r)},r.appendChild(a),document.body.appendChild(r),setTimeout(()=>{r.remove(),n(r)},null==t?void 0:t.duration),e.a(2,r);case 1:return e.p=1,e.v,setTimeout(()=>{alert((null==t?void 0:t.message)||"Emergency Toast Creation Showing!"),n(null)},100),e.a(2,null)}},e,null,[[0,1]])}))).apply(this,arguments)}function T(e,t){return M.apply(this,arguments)}function M(){return(M=r(s().m(function e(t,n){var r;return s().w(function(e){for(;;)switch(e.p=e.n){case 0:if(document.querySelector('[id^="toast-container-"]')){e.n=1;break}return e.a(2,null);case 1:return e.p=2,e.n=3,f("div","toast");case 3:return r=e.v,e.n=4,S(r,t,n);case 4:return e.a(2,r);case 5:return e.p=5,e.v,e.n=6,O(t,n);case 6:return r=e.v,e.a(2,r)}},e,null,[[2,5]])}))).apply(this,arguments)}Object.entries({aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}).forEach(e=>{var t=l(e,2),n=t[0],r=l(t[1],3),o=r[0],a=r[1],i=r[2],s=e=>{var t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)},u=.2126*s(o)+.7152*s(a)+.0722*s(i),c=(u+.05)/.05,f=1.05/(u+.05);b[n.toLowerCase()]=c>=f?"#000000":"#ffffff"});var L=new Map,I=new Map;function A(e){return"toast-container-".concat(function(e){return String(e).toLowerCase().trim().replace(/\bbelow\b/g,"bottom").replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"-").replace(/-{2,}/g,"-")}(e))}function P(e,t){return W.apply(this,arguments)}function W(){return W=r(s().m(function e(t,n){var o,a,i;return s().w(function(e){for(;;)switch(e.p=e.n){case 0:if(o=A(t.position),!I.has(o)){e.n=1;break}return e.a(2,I.get(o));case 1:return a=r(s().m(function e(){var r,a,i,u;return s().w(function(e){for(;;)switch(e.n){case 0:if(null==(r=L.get(o))||!r.isConnected){e.n=1;break}return e.a(2,r);case 1:if((a=document.getElementById(o))&&!a.isConnected&&document.body.appendChild(a),a){e.n=3;break}if((a=document.createElement("div")).id=o,a.setAttribute("role","status"),a.setAttribute("aria-atomic","true"),a.style.position="fixed",a.style.zIndex="9999",a.style.inset="auto 10px 10px auto",a.style.display="flex",a.style.justifyContent="space-between",a.style.alignItems="center",a.style.flexDirection="column",a.style.overflow="hidden","function"!=typeof n){e.n=2;break}return e.n=2,n(a,t);case 2:document.body.appendChild(a),e.n=4;break;case 3:if(a.style.position=a.style.position||"fixed",a.style.zIndex=a.style.zIndex||"9999","function"!=typeof n){e.n=4;break}return e.n=4,n(a,t);case 4:if((i=document.querySelectorAll("#".concat(o))).length>1)for(u=1;u<i.length;u++)try{i[u].remove()}catch(e){}return L.set(o,a),e.a(2,a)}},e)}))(),I.set(o,a),e.p=2,e.n=3,a;case 3:return i=e.v,e.a(2,i);case 4:return e.p=4,I.delete(A(t.position)),e.f(4);case 5:return e.a(2)}},e,null,[[2,,4,5]])})),W.apply(this,arguments)}function z(e,t){return B.apply(this,arguments)}function B(){return(B=r(s().m(function e(t,n){var r;return s().w(function(e){for(;;)switch(e.n){case 0:if(t&&n.position){e.n=1;break}throw new Error("Invalid container or position!");case 1:if(q(t),r=D(n.position),!R(t,n,r)){e.n=2;break}return e.a(2);case 2:if(!_(t,r)){e.n=3;break}return e.a(2);case 3:F(t,r);case 4:return e.a(2)}},e)}))).apply(this,arguments)}function q(e){e.style.top="auto",e.style.bottom="auto",e.style.left="auto",e.style.right="auto",e.style.transform="none"}function D(e){var t=e.toLowerCase().trim();return{hasTop:t.includes("top"),hasBottom:t.includes("bottom")||t.includes("below"),hasLeft:t.includes("left"),hasRight:t.includes("right"),hasCenter:t.includes("center"),hasFullWidth:t.includes("top-full-width")||t.includes("bottom-full-width")||t.includes("fullwidth")}}function R(e,t,n){return!!n.hasFullWidth&&(t.maxWidth="100vw",n.hasTop?(e.style.top="10px",e.style.left="10px",e.style.right="10px",!0):!!n.hasBottom&&(e.style.bottom="10px",e.style.left="10px",e.style.right="10px",!0))}function _(e,t){return!!t.hasCenter&&(!t.hasTop||t.hasLeft||t.hasRight?!t.hasBottom||t.hasLeft||t.hasRight?!t.hasLeft||t.hasTop||t.hasBottom?!t.hasRight||t.hasTop||t.hasBottom?!(t.hasLeft||t.hasRight||t.hasTop||t.hasBottom)&&(e.style.top="50%",e.style.left="50%",e.style.transform="translate(-50%, -50%)",!0):(e.style.right="10px",e.style.top="50%",e.style.transform="translateY(-50%)",!0):(e.style.left="10px",e.style.top="50%",e.style.transform="translateY(-50%)",!0):(e.style.bottom="10px",e.style.left="50%",e.style.transform="translateX(-50%)",!0):(e.style.top="10px",e.style.left="50%",e.style.transform="translateX(-50%)",!0))}function F(e,t){t.hasBottom?e.style.bottom="10px":t.hasTop&&(e.style.top="10px"),t.hasRight?e.style.right="10px":t.hasLeft?e.style.left="10px":(e.style.bottom="10px",e.style.left="50%",e.style.transform="translateX(-50%)")}class H{constructor(e,t){this.callback=e,this.delay=t,this.remaining=t,this.startTime=null,this.timeoutId=null,this.isPaused=!1,this.isCompleted=!1}start(){return this.isCompleted||this.timeoutId||(this.startTime=Date.now(),this.timeoutId=setTimeout(()=>{this.isCompleted=!0,this.timeoutId=null,this.callback()},this.remaining)),this}pause(){return this.isPaused||!this.timeoutId||this.isCompleted||(clearTimeout(this.timeoutId),this.timeoutId=null,this.remaining-=Date.now()-this.startTime,this.remaining=Math.max(0,this.remaining),this.isPaused=!0),this}resume(){return!this.isPaused||this.isCompleted||(this.isPaused=!1,this.start()),this}clear(){return this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null),this.isCompleted=!0,this}getRemainingTime(){return this.isCompleted?0:this.isPaused?this.remaining:this.timeoutId?Math.max(0,this.remaining-(Date.now()-this.startTime)):this.delay}}var N=new Map,G=new Map,U=[],Y=0;function X(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=String(e.type).trim().toLowerCase(),n=function(e){for(var t=5381,n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n);return t>>>0}(String(e.message||"")).toString(16),r=String(e.position).trim().toLowerCase();return"".concat(t,"|").concat(n,"|").concat(r)}function $(){return J.apply(this,arguments)}function J(){return J=r(s().m(function e(){var t,n,o,a,i,u=arguments;return s().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t=u.length>0&&void 0!==u[0]?u[0]:{},e.p=1,n=X(t),!N.has(n)){e.n=5;break}if(o=N.get(n)){e.n=2;break}throw new Error("Active toast with key ".concat(n," not found"));case 2:return o.count++,o.timer.clear(),o.timer=ne(o.toast,t),e.n=3,re(o);case 3:return e.n=4,fe(o);case 4:return e.a(2);case 5:if(!G.has(n)){e.n=7;break}if(a=G.get(n)){e.n=6;break}throw new Error("Pending toast with key ".concat(n," not found"));case 6:return a.count++,e.a(2);case 7:i={options:t,count:1,rafId:0},G.set(n,i),i.rafId=requestAnimationFrame(r(s().m(function e(){var t;return s().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t=G.get(n)){e.n=1;break}return e.a(2);case 1:if(G.delete(n),!(Y>=3)){e.n=3;break}return U.push({options:t.options,key:n,count:t.count}),e.n=2,se();case 2:return e.a(2);case 3:return e.p=3,e.n=4,K(t.options,n,t.count);case 4:e.n=6;break;case 5:e.p=5,e.v;case 6:return e.a(2)}},e,null,[[3,5]])}))),e.n=9;break;case 8:e.p=8,e.v;case 9:return e.a(2)}},e,null,[[1,8]])})),J.apply(this,arguments)}function K(e,t,n){return Q.apply(this,arguments)}function Q(){return(Q=r(s().m(function e(t,n,r){var o,a,i,u,l,c,f,p;return s().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,t&&"object"==typeof t){e.n=1;break}throw new TypeError("options must be an object");case 1:return Y++,e.n=2,P(t,z);case 2:if(o=e.v){e.n=3;break}throw new Error("Failed to create toast container");case 3:return e.n=4,T(t,ae);case 4:if(a=e.v){e.n=5;break}throw new Error("Toast element creation failed");case 5:if(i=document.createElement("div"),Object.assign(i.style,{position:"relative",display:"inline-block",overflow:"visible",marginBottom:"10px",zIndex:"0",width:"100%"}),u=document.createElement("div"),Object.assign(u.style,{position:"relative",overflow:"hidden",zIndex:"1"}),u.appendChild(a),i.appendChild(u),o.id.includes("toast-container-")&&o.appendChild(i),l=!1!==t.pauseOnHover&&(!0===t.pauseOnHover||!!t.cta),c={outer:i,toast:a,count:Math.max(1,Math.floor(null!=r?r:0)),timeout:null,pauseOnHover:l},N.set(n,c),a._key=n,!(c.count>1)){e.n=6;break}return e.n=6,fe(c);case 6:return c.timer=ne(a,t),e.n=7,re(c);case 7:e.n=10;break;case 8:return e.p=8,e.v,Y=Math.max(0,Y-1),f=document.querySelector('[id^="toast-container-"]')||document.body,p=f,e.n=9,O(t,ae);case 9:p.appendChild.call(p,e.v);case 10:return e.a(2)}},e,null,[[0,8]])}))).apply(this,arguments)}function V(){return(V=r(s().m(function e(){var t,n,r,o,a,i;return s().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,0!==N.size){e.n=1;break}return e.a(2);case 1:if(t=null,document.querySelectorAll('[id^="toast-container-"]').forEach(e=>{var n=Array.from(e.children||[]);if(0!==n.length){var r=n.at(0);r&&(t=r.querySelector('[id^="toast-"]')||r)}}),t||(n=Array.from(N.entries())).length>0&&(r=n.at(0),o=l(r,2),a=o[1],t=a.toast||a.outer&&a.outer.querySelector('[id^="toast-"]')),t){e.n=2;break}return e.a(2);case 2:return i=t._key?t:t.querySelector('[id^="toast-"]')||t,e.n=3,ae(i);case 3:e.n=5;break;case 4:e.p=4,e.v;case 5:return e.a(2)}},e,null,[[0,4]])}))).apply(this,arguments)}function Z(){return(Z=r(s().m(function e(){var t,n,r;return s().w(function(e){for(;;)switch(e.p=e.n){case 0:e.p=0,t=Array.from(N.values()).map(e=>e.toast).filter(Boolean),U.length=0,G.clear(),n=t.length-1;case 1:if(!(n>=0)){e.n=6;break}return r=t[n],e.p=2,e.n=3,ae(r);case 3:e.n=5;break;case 4:e.p=4,e.v;case 5:n--,e.n=1;break;case 6:e.n=8;break;case 7:e.p=7,e.v;case 8:return e.a(2)}},e,null,[[2,4],[0,7]])}))).apply(this,arguments)}var ee=function(){return V.apply(this,arguments)},te=function(){return Z.apply(this,arguments)};function ne(e,t){var n,o=Number(null!==(n=t.duration)&&void 0!==n?n:1800)+5,a=new H(r(s().m(function t(){return s().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,ae(e);case 1:return t.a(2,t.v)}},t)})),o);return a.start(),a}function re(e){return oe.apply(this,arguments)}function oe(){return(oe=r(s().m(function e(t){var n,r,o,a,i,u;return s().w(function(e){for(;;)switch(e.n){case 0:if(t.pauseOnHover&&t.outer&&t.timer){e.n=1;break}return e.a(2);case 1:n=t.outer,r=t.timer,o=()=>r.pause(),a=()=>r.resume(),i=e=>{e.target.matches("[tabindex], div, span, button, a")&&r.pause()},u=e=>{n.contains(e.relatedTarget)||r.resume()},n.addEventListener("mouseenter",o),n.addEventListener("mouseleave",a),n.addEventListener("focusin",i),n.addEventListener("focusout",u),n._pauseCleanup=()=>{n.removeEventListener("mouseenter",o),n.removeEventListener("mouseleave",a),n.removeEventListener("focusin",i),n.removeEventListener("focusout",u)};case 2:return e.a(2)}},e)}))).apply(this,arguments)}function ae(e){return ie.apply(this,arguments)}function ie(){return(ie=r(s().m(function e(t){var n,r,o,a,i;return s().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,null!=t&&t._key){e.n=1;break}return e.a(2);case 1:if(a=N.get(t._key)){e.n=2;break}return e.a(2);case 2:return null===(n=a.timer)||void 0===n||n.clear(),null===(r=a.outer)||void 0===r||null===(o=r._pauseCleanup)||void 0===o||o.call(r),N.delete(t._key),Y=Math.max(0,Y-1),(i=a.outer.querySelector(".toast-count-badge"))&&i.remove(),e.n=3,le(a.outer);case 3:return e.n=4,se();case 4:e.n=6;break;case 5:e.p=5,e.v;case 6:return e.a(2)}},e,null,[[0,5]])}))).apply(this,arguments)}function se(){return ue.apply(this,arguments)}function ue(){return(ue=r(s().m(function e(){var t,n;return s().w(function(e){for(;;)switch(e.n){case 0:if(!(Y<3&&U.length)){e.n=3;break}if(t=U.shift(),!N.has(t.key)){e.n=2;break}return(n=N.get(t.key)).count+=t.count,e.n=1,fe(n);case 1:return e.a(3,0);case 2:K(t.options,t.key,t.count),e.n=0;break;case 3:return e.a(2)}},e)}))).apply(this,arguments)}function le(e){return ce.apply(this,arguments)}function ce(){return(ce=r(s().m(function e(t){return s().w(function(e){for(;;)switch(e.n){case 0:if(t){e.n=1;break}return e.a(2,Promise.resolve());case 1:return e.a(2,new Promise(e=>{var n=!1,r=()=>{n||(n=!0,d(t),e())},o=t.firstElementChild||t;if(!o)return e();var a=e=>{try{if(e.target!==o)return;o.removeEventListener("transitionend",a,!0),r()}catch(e){}};try{o.addEventListener("transitionend",a,!0)}catch(e){}setTimeout(()=>{try{o.removeEventListener("transitionend",a,!0),r()}catch(e){}},700)}))}},e)}))).apply(this,arguments)}function fe(e){return pe.apply(this,arguments)}function pe(){return(pe=r(s().m(function e(t){var n,r,o,a;return s().w(function(e){for(;;)switch(e.n){case 0:if(n=t.outer,r=t.count,n&&n instanceof HTMLElement){e.n=1;break}throw new Error("updateBadge: outer must be a valid HTMLElement");case 1:if(!(r<2)){e.n=2;break}return(o=n.querySelector(".toast-count-badge"))&&o.remove(),e.a(2);case 2:(a=n.querySelector(".toast-count-badge"))||((a=document.createElement("span")).className="toast-count-badge",a.setAttribute("aria-label","".concat(r," identical notifications")),Object.assign(a.style,{position:"absolute",top:"6px",right:"6px",backgroundColor:"#f44336",color:"#fff",borderRadius:"50%",minWidth:"20px",height:"20px",fontSize:"12px",fontWeight:"600",display:"flex",alignItems:"center",justifyContent:"center",border:"2px solid #fff",boxShadow:"0 2px 6px rgba(0,0,0,0.3)",zIndex:"2",pointerEvents:"none",transition:"transform 150ms ease"}),n.appendChild(a)),a.textContent=r>99?"99+":String(r);try{a.style.transform="scale(1.2)",setTimeout(()=>a.style.transform="scale(1)",150)}catch(e){}case 3:return e.a(2)}},e)}))).apply(this,arguments)}var de={success:"#28a745",error:"#dc3545",warning:"#ffc107",info:"#17a2b8"},he={success:"Operation completed successfully!",error:"Something went wrong!",warning:"Warning message!",info:"Information message!"},me=[],ye=!1;function ge(){return be.apply(this,arguments)}function be(){return(be=r(s().m(function e(){return s().w(function(e){for(;;)switch(e.n){case 0:if(!ye){e.n=1;break}return e.a(2);case 1:"undefined"!=typeof window&&"undefined"!=typeof document&&("complete"===document.readyState||"interactive"===document.readyState?(ye=!0,me.forEach(e=>setTimeout(()=>ve(e),2500)),me.length=0):document.addEventListener("DOMContentLoaded",()=>{ye=!0,me.forEach(e=>setTimeout(()=>ve(e),2500)),me.length=0},{once:!0}));case 2:return e.a(2)}},e)}))).apply(this,arguments)}function ve(){return we.apply(this,arguments)}function we(){return we=r(s().m(function e(){var t,n,r,o=arguments;return s().w(function(e){for(;;)switch(e.p=e.n){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:{},e.p=1,e.n=2,Ee(t);case 2:return n=e.v,e.n=3,Ce(n);case 3:return e.n=4,$(n);case 4:e.n=6;break;case 5:e.p=5,e.v,r="string"==typeof(null==t?void 0:t.message)&&null!==(null==t?void 0:t.message)?"".concat(t.message.substring(0,200)," toast creation failed!"):"Toast creation failed!",alert(r);case 6:return e.a(2)}},e,null,[[1,5]])})),we.apply(this,arguments)}function ke(){return xe.apply(this,arguments)}function xe(){return xe=r(s().m(function e(){var t,n=arguments;return s().w(function(e){for(;;)switch(e.n){case 0:if(t=n.length>0&&void 0!==n[0]?n[0]:{},"undefined"!=typeof window&&"undefined"!=typeof document){e.n=1;break}return e.a(2);case 1:return e.n=2,ge();case 2:if(ye){e.n=3;break}return me.push(t),e.a(2);case 3:return e.n=4,ve(t);case 4:return e.a(2)}},e)})),xe.apply(this,arguments)}function Ce(e){return Se.apply(this,arguments)}function Se(){return(Se=r(s().m(function e(t){return s().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,P(t,z);case 1:return e.a(2,e.v);case 2:return e.p=2,e.v,e.a(2,document.body)}},e,null,[[0,2]])}))).apply(this,arguments)}function Ee(e){return Oe.apply(this,arguments)}function Oe(){return(Oe=r(s().m(function e(t){var n,r,o,a,u,l,c,f,p,d;return s().w(function(e){for(;;)if(0===e.n){o=null==t||null===(n=t.position)||void 0===n||null===(n=n.toLowerCase())||void 0===n?void 0:n.trim(),a=null!=o&&o.includes("top-full-width")||null!=o&&o.includes("bottom-full-width")?"100vw":"400px",(u=i(i({},{pauseOnHover:void 0,duration:2500,position:"bottom-right",type:"info",borderRadius:"50px",backgroundColor:void 0,textColor:void 0,showCloseButton:!0,animationDuration:"0.4s",animationType:"fade",animationEasing:"ease",showProgressBar:!0,progressColor:void 0,progressHeight:"4px",progressPosition:"bottom",fontPosition:"relative",fontPadding:void 0,fontBorderRadius:void 0,fontBackgroundColor:void 0,fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontSize:"14px",fontWeight:"400",fontLineHeight:"1.4",fontDirection:"auto",wrapText:"normal",maxWidth:a}),"object"!=typeof t||Array.isArray(t)?{}:t)).message=null!==(r=null==t?void 0:t.message)&&void 0!==r?r:u.message;try{u.backgroundColor||(u.backgroundColor=null!==(c=null===(f=de)||void 0===f?void 0:f[u.type])&&void 0!==c?c:window.matchMedia("(prefers-color-scheme: dark)").matches?"#f5f5f5":"#111111"),u.message=u.message||(null===(l=he)||void 0===l?void 0:l[u.type])||"No Message Provided!",!u.textColor&&u.backgroundColor&&(p=v(u.backgroundColor),u.textColor=p),!u.progressColor&&u.backgroundColor&&(u.textColor?u.progressColor=u.textColor:(d=v(u.backgroundColor),u.progressColor=d))}catch(e){}return"string"!=typeof u.message&&(u.message="No Message Provided!"),e.a(2,u)}},e)}))).apply(this,arguments)}function je(e){try{e&&"object"==typeof e&&!Array.isArray(e)&&(de=i(i({},de),e))}catch(e){}}function Te(e){try{e&&"object"==typeof e&&!Array.isArray(e)&&(he=i(i({},he),e))}catch(e){}}var Me=!1,Le=null;function Ie(e){return Ae.apply(this,arguments)}function Ae(){return(Ae=r(s().m(function e(t){return s().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!Me||!Le){e.n=4;break}return e.p=1,e.n=2,Le;case 2:e.n=4;break;case 3:e.p=3,e.v;case 4:return e.a(2,t())}},e,null,[[1,3]])}))).apply(this,arguments)}var Pe=ke;function We(){return We=r(s().m(function e(){var t,n=arguments;return s().w(function(e){for(;;)if(0===e.n)return t=n.length>0&&void 0!==n[0]?n[0]:{},e.a(2,Ie(()=>Pe(t)))},e)})),We.apply(this,arguments)}var ze=function(){var e=r(s().m(function e(){return s().w(function(e){for(;;)switch(e.n){case 0:return Me=!0,Le=r(s().m(function e(){return s().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,ee();case 1:return e.p=1,Me=!1,Le=null,e.f(1);case 2:return e.a(2)}},e,null,[[0,,1,2]])}))(),e.n=1,Le;case 1:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),Be=function(){var e=r(s().m(function e(){return s().w(function(e){for(;;)switch(e.n){case 0:return Me=!0,Le=r(s().m(function e(){return s().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,te();case 1:return e.p=1,Me=!1,Le=null,e.f(1);case 2:return e.a(2)}},e,null,[[0,,1,2]])}))(),e.n=1,Le;case 1:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}();if("undefined"!=typeof window&&"undefined"!=typeof document){var qe=!1;if(!qe){window.addEventListener("keydown",e=>{"Escape"!==e.key&&"Esc"!==e.key||r(s().m(function e(){return s().w(function(e){for(;;)switch(e.n){case 0:return Me=!0,Le=r(s().m(function e(){return s().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,ee();case 1:return e.p=1,Me=!1,Le=null,e.f(1);case 2:return e.a(2)}},e,null,[[0,,1,2]])}))(),e.n=1,Le;case 1:return e.a(2)}},e)}))()},{passive:!0}),qe=!0}}var De=function(){var e=r(s().m(function e(){return s().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,te();case 1:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}();try{"undefined"!=typeof window&&(window.customizableToast={createToast:ke,setDefaultColors:je,setDefaultMessages:Te,noop:De,dismiss:ee})}catch(e){}e.createToast=function(){return We.apply(this,arguments)},e.dismiss=ze,e.dismissToast=ze,e.noop=Be,e.noopAll=Be,e.setDefaultColors=je,e.setDefaultMessages=Te});
|
|
18
|
-
//# sourceMappingURL=index.umd.js.map
|
|
17
|
+
var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function a(n,r,o,a){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return u(c,"_invoke",function(n,r,o){var a,s,l,u=0,c=o||[],f=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return a=t,s=0,l=e,d.n=n,i}};function p(n,r){for(s=n,l=r,t=0;!f&&u&&!o&&t<c.length;t++){var o,a=c[t],p=d.p,h=a[2];n>3?(o=h===r)&&(l=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=p&&((o=n<2&&p<a[1])?(s=0,d.v=r,d.n=a[1]):p<h&&(o=n<3||a[0]>r||r>h)&&(a[4]=n,a[5]=r,d.n=h,s=0))}if(o||n>1)return i;throw f=!0,r}return function(o,c,h){if(u>1)throw TypeError("Generator is already running");for(f&&1===c&&p(c,h),s=c,l=h;(t=s<2?e:l)||!f;){a||(s?s<3?(s>1&&(d.n=-1),p(s,l)):d.n=l:d.v=l);try{if(u=2,a){if(s||(o="next"),t=a[o]){if(!(t=t.call(a,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);a=e}else if((t=(f=d.n<0)?l:n.call(r,d))!==i)break}catch(t){a=e,s=1,l=t}finally{u=1}}return{value:t,done:f}}}(n,o,a),!0),c}var i={};function s(){}function c(){}function f(){}t=Object.getPrototypeOf;var d=[][r]?t(t([][r]())):(u(t={},r,function(){return this}),t),p=f.prototype=s.prototype=Object.create(d);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,u(e,o,"GeneratorFunction")),e.prototype=Object.create(p),e}return c.prototype=f,u(p,"constructor",f),u(f,"constructor",c),c.displayName="GeneratorFunction",u(f,o,"GeneratorFunction"),u(p),u(p,o,"Generator"),u(p,r,function(){return this}),u(p,"toString",function(){return"[object Generator]"}),(l=function(){return{w:a,m:h}})()}function u(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}u=function(e,t,n,r){function a(t,n){u(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a("next",0),a("throw",1),a("return",2))},u(e,t,n,r)}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,s=[],l=!0,u=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw o}}return s}}(e,t)||f(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,n){if(e){if("string"==typeof e)return t(e,n);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}function d(e){var t=Date.now().toString(36),n=Math.floor(1048575*Math.random()).toString(36);return"".concat(e,"-").concat(t,"-").concat(n)}function p(e,t){return h.apply(this,arguments)}function h(){return(h=r(l().m(function e(t,n){var r;return l().w(function(e){for(;;)switch(e.n){case 0:if(t&&n){e.n=1;break}throw new Error("tagName and prefix are required");case 1:return(r=document.createElement(t)).id=d(n),e.a(2,r)}},e)}))).apply(this,arguments)}function m(e){return y.apply(this,arguments)}function y(){return(y=r(l().m(function e(t){var n;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t){e.n=1;break}return e.a(2,!0);case 1:if(e.p=1,null==t||null===(n=t.parentNode)||void 0===n||!n.id.includes("toast-container-")){e.n=2;break}return t.parentNode.removeChild(t),e.a(2,!0);case 2:e.n=4;break;case 3:e.p=3,e.v;case 4:if(e.p=4,!t.remove){e.n=5;break}return t.remove(),e.a(2,!0);case 5:e.n=7;break;case 6:e.p=6,e.v;case 7:return e.p=7,Object.assign(t.style,{display:"none",opacity:"0",pointerEvents:"none",position:"absolute",left:"-9999px"}),e.a(2,!0);case 8:return e.p=8,e.v,e.a(2,!1)}},e,null,[[7,8],[4,6],[1,3]])}))).apply(this,arguments)}function g(e){return v.apply(this,arguments)}function v(){return(v=r(l().m(function e(t){var n,r;return l().w(function(e){for(;;)switch(e.n){case 0:if(!("number"==typeof t&&t>0)){e.n=1;break}return e.a(2,t);case 1:if("string"!=typeof t){e.n=3;break}if(!t.endsWith("s")||t.endsWith("ms")){e.n=2;break}return n=1e3*parseFloat(t),e.a(2,n>0?n:500);case 2:return r=parseFloat(t),e.a(2,r>0?r:500);case 3:return e.a(2,500)}},e)}))).apply(this,arguments)}var b=new class{constructor(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:200;this.maxSize=e,this.map=new Map}get(e){if(this.map.has(e)){var t=this.map.get(e);return this.map.delete(e),this.map.set(e,t),t}}set(e,t){if(this.map.has(e))this.map.delete(e);else if(this.map.size>=this.maxSize){var n=this.map.keys().next().value;this.map.delete(n)}this.map.set(e,t)}}(200),w={};function k(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!e)return"snow";var n,r,o,a="".concat(e,"|").concat(t),i=b.get(a);if(i)return i;if(w[null==e?void 0:e.toLowerCase()]){var s=w[e.toLowerCase()];return b.set(a,s),s}try{var l=null==e?void 0:e.match(/^#([0-9a-f]{3,8})$/i);if(l){var u=l[1];3===u.length&&(u=u.split("").map(e=>e+e).join("")),n=parseInt(u.slice(0,2),16),r=parseInt(u.slice(2,4),16),o=parseInt(u.slice(4,6),16)}else{var f=null==e?void 0:e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\)/i);if(!f)throw new Error("Unknown color");n=Number(f[1]),r=Number(f[2]),o=Number(f[3])}}catch(e){n=50+Math.floor(206*Math.random()),r=50+Math.floor(206*Math.random()),o=50+Math.floor(206*Math.random())}n=Math.round(n*t+255*(1-t)),r=Math.round(r*t+255*(1-t)),o=Math.round(o*t+255*(1-t));var d=(e,t,n)=>{var r=[e,t,n].map(e=>(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4));return.2126*r[0]+.7152*r[1]+.0722*r[2]},p=(e,t)=>{var n=d(...e),r=d(...t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)},h=((e,t,n)=>{e/=255,t/=255,n/=255;var r,o,a=Math.max(e,t,n),i=Math.min(e,t,n),s=(a+i)/2;if(a===i)r=o=0;else{var l=a-i;switch(o=s>.5?l/(2-a-i):l/(a+i),a){case e:r=(t-n)/l+(t<n?6:0);break;case t:r=(n-e)/l+2;break;case n:r=(e-t)/l+4}r/=6}return[360*r,o,s]})(n,r,o),m=c(h,3),y=m[0],g=m[1],v=m[2],k=((e,t,n)=>{var r,o,a;if(e/=360,0===t)r=o=a=n;else{var i=(e,t,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e),s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;r=i(l,s,e+1/3),o=i(l,s,e),a=i(l,s,e-1/3)}return[Math.round(255*r),Math.round(255*o),Math.round(255*a)]})(y,g,v<.5?Math.min(v+.5,1):Math.max(v-.5,0)),x=c(k,3),C=x[0],E=x[1],S=x[2];if(p([n,r,o],[C,E,S])<4.5){var T=c(p([n,r,o],[0,0,0])>=p([n,r,o],[255,255,255])?[0,0,0]:[255,255,255],3);C=T[0],E=T[1],S=T[2]}var A=((e,t,n)=>"#".concat(e.toString(16).padStart(2,"0")).concat(t.toString(16).padStart(2,"0")).concat(n.toString(16).padStart(2,"0")))(C,E,S);return b.set(a,A),A}function x(e){if(!e||"string"!=typeof e)return"";var t=e.replace(/<\/?(script|iframe|object|embed|link|meta|style|form|input|button)[^>]*>/gi,"");t=(t=t.replace(/\s(on\w+)\s*=\s*(['"])[\s\S]*?\2/gi,"")).replace(/(href|src)\s*=\s*(['"])\s*javascript:[^'"]*\2/gi,"$1=$2#$2");var n=document.createElement("div");n.innerHTML=t;var r=new Set(["DIV","SPAN","P","BR","STRONG","B","EM","I","U","SMALL","UL","OL","LI","A","IMG","PRE","CODE","MARK"]),o=new Set(["href","src","alt","title","class","target","rel"]);function a(e){if(e.nodeType===Node.TEXT_NODE)return document.createTextNode(e.nodeValue);if(e.nodeType!==Node.ELEMENT_NODE)return null;var t=e.tagName.toUpperCase();if(!r.has(t)){var n=document.createDocumentFragment();return Array.from(e.childNodes).forEach(e=>{var t=a(e);t&&n.appendChild(t)}),n}var i=document.createElement(e.tagName);return Array.from(e.attributes||[]).forEach(t=>{var n=t.name.toLowerCase(),r=t.value;o.has(n)&&("href"!==n&&"src"!==n||!/^\s*javascript:/i.test(r))&&("src"!==n||/^\s*(https?:|data:image\/)/i.test(r))&&("target"===n&&"_blank"===r&&i.setAttribute("rel",(e.getAttribute("rel")||"")+" noopener noreferrer"),i.setAttribute(n,r))}),Array.from(e.childNodes).forEach(e=>{var t=a(e);t&&i.appendChild(t)}),i}var i=document.createDocumentFragment();Array.from(n.childNodes).forEach(e=>{var t=a(e);t&&i.appendChild(t)});var s=document.createElement("div");return s.appendChild(i),s.innerHTML}function C(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return"";try{if(!t.forceFallback&&function(){try{if("undefined"!=typeof window&&window.DOMPurify)return!0}catch(e){}return!1}())return window.DOMPurify.sanitize(e,{ADD_ATTR:["target"],ALLOWED_URI_REGEXP:/^(?:(?:https?|mailto|ftp|tel|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i})}catch(e){}return x(e)}function E(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.size||14,n=e.color||"currentColor",r=e.text||"",o=document.createElement("span");o.className="toast-loader",o.style.display="inline-flex",o.style.alignItems="center",o.style.gap="8px";var a="http://www.w3.org/2000/svg",i=document.createElementNS(a,"svg");i.setAttribute("width",String(t)),i.setAttribute("height",String(t)),i.setAttribute("viewBox","0 0 50 50"),i.setAttribute("aria-hidden","true");var s=document.createElementNS(a,"circle");if(s.setAttribute("cx","25"),s.setAttribute("cy","25"),s.setAttribute("r","20"),s.setAttribute("fill","none"),s.setAttribute("stroke",n),s.setAttribute("stroke-width","4"),s.setAttribute("stroke-linecap","round"),s.style.opacity="0.85",s.style.strokeDasharray="90",s.style.strokeDashoffset="60",s.style.transformOrigin="center",s.style.animation="toast-spinner 1s linear infinite",i.appendChild(s),o.appendChild(i),r){var l=document.createElement("span");l.style.fontSize="13px",l.textContent=r,o.appendChild(l)}if(!document.getElementById("toast-spinner-styles")){var u=document.createElement("style");u.id="toast-spinner-styles",u.innerHTML="@keyframes toast-spinner { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }",document.head.appendChild(u)}return o}function S(e,t,n){var o=null==t?void 0:t.cta;if(o){o.label||(o.label="CTA Label Missing!");var a=!!o.href&&"link"===o.variant,i=document.createElement(a?"a":"button");a?(i.href=o.href,o.target&&(i.target=o.target),i.rel=o.rel||("_blank"===o.target?"noopener noreferrer":"")):i.type="button",i.setAttribute("aria-label",o.ariaLabel||o.label),Object.assign(i.style,{marginLeft:"10px",padding:"6px 10px",borderRadius:"6px",fontSize:"12px",fontWeight:"600",lineHeight:"1",border:"1px solid rgba(255,255,255,0.35)",color:t.textColor||"#fff",background:"rgba(255,255,255,0.15)",cursor:"pointer",whiteSpace:"nowrap",flexShrink:"0"}),i.textContent=o.label;var s=function(){var t=r(l().m(function t(r){var a;return l().w(function(t){for(;;)switch(t.p=t.n){case 0:if(t.p=0,"function"!=typeof o.onClick){t.n=1;break}if(null==(a=o.onClick(r))||!a.then){t.n=1;break}return t.n=1,a;case 1:return t.p=1,!1!==o.autoClose&&n(e),t.f(1);case 2:return t.a(2)}},t,null,[[0,,1,2]])}));return function(e){return t.apply(this,arguments)}}();i.addEventListener("click",s),i._cleanup=()=>i.removeEventListener("click",s),e.appendChild(i)}}function T(e,t,n){var r=document.createElement("button");r.setAttribute("aria-label","Close notification"),r.setAttribute("title","Close"),r.textContent="×",Object.assign(r.style,{background:"none",border:"none",color:t.textColor||"white",fontSize:"18px",marginLeft:"10px",cursor:"pointer"});var o=()=>n(e);r.addEventListener("click",o),e._cleanupCloseButton=()=>{r.removeEventListener("click",o)},e.appendChild(r)}function A(e,t){var n=document.createElement("div"),r=t.borderRadius||0,o=parseInt(r,10),a=o?"12px":"0",i=o?12:0,s=Math.max(o-10,i),l=o?"calc(100% - ".concat(s,"px)"):"100%";Object.assign(n.style,{position:"absolute",left:"".concat(a),height:t.progressHeight||"4px",background:t.progressColor||"rgba(255, 255, 255, 0.3)",width:"".concat(l),transition:"width ".concat(t.duration||1800,"ms linear"),["top"===t.progressPosition?"top":"bottom"]:"0",borderRadius:t.borderRadius||"4px"}),e.appendChild(n),"function"==typeof n.animate?e._progressAnimation=n.animate([{width:l},{width:"0%"}],{duration:Number(t.duration)||1800,easing:"linear",fill:"forwards",delay:50}):(n.style.transition="width ".concat(t.duration||1800,"ms linear"),setTimeout(()=>{n.offsetWidth,n.style.width="0%"},50))}function O(e){setTimeout(()=>{requestAnimationFrame(()=>{e.style.opacity="1",e.style.transform="translateY(0)"})},50)}function M(e,t,n){return j.apply(this,arguments)}function j(){return(j=r(l().m(function e(t,n,r){var o,a,i,s,u,c,f,d,p,h;return l().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,g(null==n?void 0:n.animationDuration);case 1:if(i=e.v,t.className="toast toast-".concat(null!==(o=null==n?void 0:n.type)&&void 0!==o?o:"info"),Object.assign(t.style,{background:null==n?void 0:n.backgroundColor,padding:"12px 16px",marginBottom:"10px",borderRadius:null==n?void 0:n.borderRadius,overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"space-between",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)",minWidth:"250px",maxWidth:null==n?void 0:n.maxWidth,opacity:"0",position:"relative",cursor:"default",boxSizing:"border-box",userSelect:"text",transition:"opacity ".concat(null==n?void 0:n.animationDuration," ").concat(null==n?void 0:n.animationEasing,", transform ").concat(null==n?void 0:n.animationDuration," ").concat(null==n?void 0:n.animationEasing),transform:"translateY(20px)",zIndex:"9999"}),t.setAttribute("role","alert"),t.setAttribute("aria-live","polite"),t.tabIndex=0,t._animationDuration=i,s=document.createElement("span"),null!=n&&n.wrapText?Object.assign(s.style,{display:"block",whiteSpace:"normal"}):Object.assign(s.style,{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3",whiteSpace:"nowrap"}),Object.assign(s.style,{flex:"1",padding:null==n?void 0:n.fontPadding,fontFamily:null==n?void 0:n.fontFamily,fontSize:null==n?void 0:n.fontSize,fontWeight:null==n?void 0:n.fontWeight,lineHeight:null==n?void 0:n.fontLineHeight,color:null==n?void 0:n.textColor,userSelect:"text",wordBreak:"break-word",overflow:"hidden",textOverflow:"ellipsis"}),u=!!n.allowHtml,c=null!==(a=n.message)&&void 0!==a?a:"",(n.loader||n.showLoader)&&(f=E(n.loader||{}),s.appendChild(f),(d=document.createElement("span")).style.display="inline-block",d.style.width="8px",s.appendChild(d)),u&&"string"==typeof c&&c.trim().length>0)try{for(p=C(c),(h=document.createElement("div")).innerHTML=p;h.firstChild;)s.appendChild(h.firstChild)}catch(e){console.warn("HTML message sanitization failed, falling back to text:",e),s.textContent=c}else s.textContent=String(c);s.setAttribute("aria-label","Toast Notification Center"),s.setAttribute("title","string"==typeof c?c.replace(/<[^>]+>/g,""):String(c)),t.appendChild(s),null!=n&&n.cta&&0!==Object.keys(n.cta).length&&S(t,n,r),null!=n&&n.showCloseButton&&T(t,n,r),null!=n&&n.showProgressBar&&A(t,n),O(t);case 2:return e.a(2)}},e)}))).apply(this,arguments)}function L(e,t){return I.apply(this,arguments)}function I(){return(I=r(l().m(function e(t,n){var r,o,a,i,s;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:for(e.p=0,r=document.createElement("div"),Object.assign(r.style,{background:"#333",color:"white",padding:"10px 15px",position:"fixed",top:"20px",right:"20px",zIndex:"99999",borderRadius:"3px",maxWidth:"250px",wordWrap:"break-word",boxShadow:"0 2px 10px rgba(0,0,0,0.3)",cursor:"pointer"}),o=document.createElement("div"),(a=document.createElement("span")).style.display="inline-block",t.allowHtml?a.innerHTML=C(String(t.message||"Emergency Toast Showing!")):a.textContent=String(t.message||"Emergency Toast Creation Showing!"),o.appendChild(a),(i=document.createElement("span")).style.cssText="float: right; margin-left: 10px; font-weight: bold;",i.textContent="×",o.appendChild(i);r.firstChild;)r.removeChild(r.firstChild);return r.appendChild(o),i.onclick=()=>{r.remove(),n(r)},document.body.appendChild(r),setTimeout(()=>{r.remove(),n(r)},null==t?void 0:t.duration),e.a(2,r);case 1:return e.p=1,s=e.v,console.error("Emergency toast creation failed:",s),setTimeout(()=>{alert((null==t?void 0:t.message)||"Emergency Toast Creation Showing!"),n(null)},100),e.a(2,null)}},e,null,[[0,1]])}))).apply(this,arguments)}function P(e,t){return D.apply(this,arguments)}function D(){return(D=r(l().m(function e(t,n){var r,o;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(document.querySelector('[id^="toast-container-"]')){e.n=1;break}return e.a(2,null);case 1:return e.p=2,e.n=3,p("div","toast");case 3:return r=e.v,e.n=4,M(r,t,n);case 4:return e.a(2,r);case 5:return e.p=5,o=e.v,console.warn("toast creation failed with error showing fallback one: ",o),e.n=6,L(t,n);case 6:return r=e.v,e.a(2,r)}},e,null,[[2,5]])}))).apply(this,arguments)}Object.entries({aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}).forEach(e=>{var t=c(e,2),n=t[0],r=c(t[1],3),o=r[0],a=r[1],i=r[2],s=e=>{var t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)},l=.2126*s(o)+.7152*s(a)+.0722*s(i),u=(l+.05)/.05,f=1.05/(l+.05);w[n.toLowerCase()]=u>=f?"#000000":"#ffffff"});var N=new Map,z=new Map;function B(e){return"toast-container-".concat(function(e){return String(e).toLowerCase().trim().replace(/\bbelow\b/g,"bottom").replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"-").replace(/-{2,}/g,"-")}(e))}function _(e,t){return R.apply(this,arguments)}function R(){return R=r(l().m(function e(t,n){var o,a,i;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(o=B(t.position),!z.has(o)){e.n=1;break}return e.a(2,z.get(o));case 1:return a=r(l().m(function e(){var r,a,i,s;return l().w(function(e){for(;;)switch(e.n){case 0:if(null==(r=N.get(o))||!r.isConnected){e.n=1;break}return e.a(2,r);case 1:if((a=document.getElementById(o))&&!a.isConnected&&document.body.appendChild(a),a){e.n=3;break}if((a=document.createElement("div")).id=o,a.setAttribute("role","status"),a.setAttribute("aria-atomic","true"),a.style.position="fixed",a.style.zIndex="9999",a.style.inset="auto 10px 10px auto",a.style.display="flex",a.style.justifyContent="space-between",a.style.alignItems="center",a.style.flexDirection="column",a.style.overflow="hidden","function"!=typeof n){e.n=2;break}return e.n=2,n(a,t);case 2:document.body.appendChild(a),e.n=4;break;case 3:if(a.style.position=a.style.position||"fixed",a.style.zIndex=a.style.zIndex||"9999","function"!=typeof n){e.n=4;break}return e.n=4,n(a,t);case 4:if((i=document.querySelectorAll("#".concat(o))).length>1)for(s=1;s<i.length;s++)try{i[s].remove()}catch(e){}return N.set(o,a),e.a(2,a)}},e)}))(),z.set(o,a),e.p=2,e.n=3,a;case 3:return i=e.v,e.a(2,i);case 4:return e.p=4,z.delete(B(t.position)),e.f(4);case 5:return e.a(2)}},e,null,[[2,,4,5]])})),R.apply(this,arguments)}function W(e,t){return H.apply(this,arguments)}function H(){return(H=r(l().m(function e(t,n){var r;return l().w(function(e){for(;;)switch(e.n){case 0:if(t&&n.position){e.n=1;break}throw new Error("Invalid container or position!");case 1:if(q(t),r=F(n.position),!G(t,n,r)){e.n=2;break}return e.a(2);case 2:if(!U(t,r)){e.n=3;break}return e.a(2);case 3:$(t,r);case 4:return e.a(2)}},e)}))).apply(this,arguments)}function q(e){e.style.top="auto",e.style.bottom="auto",e.style.left="auto",e.style.right="auto",e.style.transform="none"}function F(e){var t=e.toLowerCase().trim();return{hasTop:t.includes("top"),hasBottom:t.includes("bottom")||t.includes("below"),hasLeft:t.includes("left"),hasRight:t.includes("right"),hasCenter:t.includes("center"),hasFullWidth:t.includes("top-full-width")||t.includes("bottom-full-width")||t.includes("fullwidth")}}function G(e,t,n){return!!n.hasFullWidth&&(t.maxWidth="100vw",n.hasTop?(e.style.top="10px",e.style.left="10px",e.style.right="10px",!0):!!n.hasBottom&&(e.style.bottom="10px",e.style.left="10px",e.style.right="10px",!0))}function U(e,t){return!!t.hasCenter&&(!t.hasTop||t.hasLeft||t.hasRight?!t.hasBottom||t.hasLeft||t.hasRight?!t.hasLeft||t.hasTop||t.hasBottom?!t.hasRight||t.hasTop||t.hasBottom?!(t.hasLeft||t.hasRight||t.hasTop||t.hasBottom)&&(e.style.top="50%",e.style.left="50%",e.style.transform="translate(-50%, -50%)",!0):(e.style.right="10px",e.style.top="50%",e.style.transform="translateY(-50%)",!0):(e.style.left="10px",e.style.top="50%",e.style.transform="translateY(-50%)",!0):(e.style.bottom="10px",e.style.left="50%",e.style.transform="translateX(-50%)",!0):(e.style.top="10px",e.style.left="50%",e.style.transform="translateX(-50%)",!0))}function $(e,t){t.hasBottom?e.style.bottom="10px":t.hasTop&&(e.style.top="10px"),t.hasRight?e.style.right="10px":t.hasLeft?e.style.left="10px":(t.hasBottom||t.hasTop||(e.style.bottom="10px"),e.style.left="50%",e.style.transform="translateX(-50%)")}class X{constructor(e,t){this.callback=e,this.delay=t,this.remaining=t,this.startTime=null,this.timeoutId=null,this.isPaused=!1,this.isCompleted=!1}start(){return this.isCompleted||this.timeoutId||(this.startTime=Date.now(),this.timeoutId=setTimeout(()=>{this.isCompleted=!0,this.timeoutId=null,this.callback()},this.remaining)),this}pause(){return this.isPaused||!this.timeoutId||this.isCompleted||(clearTimeout(this.timeoutId),this.timeoutId=null,this.remaining-=Date.now()-this.startTime,this.remaining=Math.max(0,this.remaining),this.isPaused=!0),this}resume(){return!this.isPaused||this.isCompleted||(this.isPaused=!1,this.start()),this}clear(){return this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null),this.isCompleted=!0,this}getRemainingTime(){return this.isCompleted?0:this.isPaused?this.remaining:this.timeoutId?Math.max(0,this.remaining-(Date.now()-this.startTime)):this.delay}}var Y=new Map,V=new Map,K=[],J=0;function Q(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=String(e.type).trim().toLowerCase(),n=function(e){for(var t=5381,n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n);return t>>>0}(String(e.message||"")).toString(16),r=String(e.position).trim().toLowerCase();return"".concat(t,"|").concat(n,"|").concat(r)}function Z(){return ee.apply(this,arguments)}function ee(){return ee=r(l().m(function e(){var t,n,o,a,i,s,u=arguments;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t=u.length>0&&void 0!==u[0]?u[0]:{},e.p=1,n=Q(t),!Y.has(n)){e.n=5;break}if(o=Y.get(n)){e.n=2;break}throw new Error("Active toast with key ".concat(n," not found"));case 2:return o.count++,o.timer.clear(),o.timer=se(o.toast,t),e.n=3,le(o);case 3:return e.n=4,ye(o);case 4:return e.a(2);case 5:if(!V.has(n)){e.n=7;break}if(a=V.get(n)){e.n=6;break}throw new Error("Pending toast with key ".concat(n," not found"));case 6:return a.count++,e.a(2);case 7:i={options:t,count:1,rafId:0},V.set(n,i),i.rafId=requestAnimationFrame(r(l().m(function e(){var t,r;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t=V.get(n)){e.n=1;break}return e.a(2);case 1:if(V.delete(n),!(J>=3)){e.n=3;break}return K.push({options:t.options,key:n,count:t.count}),e.n=2,de();case 2:return e.a(2);case 3:return e.p=3,e.n=4,te(t.options,n,t.count);case 4:e.n=6;break;case 5:e.p=5,r=e.v,console.error("showToast failed:",r);case 6:return e.a(2)}},e,null,[[3,5]])}))),e.n=9;break;case 8:e.p=8,s=e.v,console.error("showToast failed:",s);case 9:return e.a(2)}},e,null,[[1,8]])})),ee.apply(this,arguments)}function te(e,t,n){return ne.apply(this,arguments)}function ne(){return(ne=r(l().m(function e(t,n,r){var o,a,i,s,u,c,f,d,p;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,t&&"object"==typeof t){e.n=1;break}throw new TypeError("options must be an object");case 1:return J++,e.n=2,_(t,W);case 2:if(o=e.v){e.n=3;break}throw new Error("Failed to create toast container");case 3:return e.n=4,P(t,ce);case 4:if(a=e.v){e.n=5;break}throw new Error("Toast element creation failed");case 5:if(i=document.createElement("div"),Object.assign(i.style,{position:"relative",display:"inline-block",overflow:"visible",marginBottom:"10px",zIndex:"0",width:"100%"}),s=document.createElement("div"),Object.assign(s.style,{position:"relative",overflow:"hidden",zIndex:"1"}),s.appendChild(a),i.appendChild(s),o.id.includes("toast-container-")&&o.appendChild(i),u=!1!==t.pauseOnHover&&(!0===t.pauseOnHover||!!t.cta),c={outer:i,toast:a,count:Math.max(1,Math.floor(null!=r?r:0)),timeout:null,pauseOnHover:u},Y.set(n,c),a._key=n,!(c.count>1)){e.n=6;break}return e.n=6,ye(c);case 6:return c.timer=se(a,t),e.n=7,le(c);case 7:e.n=10;break;case 8:return e.p=8,d=e.v,console.error("Something went wrong: ",d),J=Math.max(0,J-1),f=document.querySelector('[id^="toast-container-"]')||document.body,p=f,e.n=9,L(t,ce);case 9:p.appendChild.call(p,e.v);case 10:return e.a(2)}},e,null,[[0,8]])}))).apply(this,arguments)}function re(){return(re=r(l().m(function e(){var t,n,r,o,a,i,s;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,0!==Y.size){e.n=1;break}return e.a(2);case 1:if(t=null,document.querySelectorAll('[id^="toast-container-"]').forEach(e=>{var n=Array.from(e.children||[]);if(0!==n.length){var r=n.at(-1);r&&(t=r.querySelector('[id^="toast-"]')||r)}}),t||(n=Array.from(Y.entries())).length>0&&(r=n.at(-1),o=c(r,2),a=o[1],t=a.toast||a.outer&&a.outer.querySelector('[id^="toast-"]')),t){e.n=2;break}return e.a(2);case 2:return i=t._key?t:t.querySelector('[id^="toast-"]')||t,e.n=3,ce(i);case 3:e.n=5;break;case 4:e.p=4,s=e.v,console.error("dismissMostRecent failed:",s);case 5:return e.a(2)}},e,null,[[0,4]])}))).apply(this,arguments)}function oe(){return(oe=r(l().m(function e(){var t,n,r,a,i,s,u;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:e.p=0,t=Array.from(Y.values()).map(e=>e.toast).filter(Boolean),K.length=0,V.clear(),n=o(t),e.p=1,n.s();case 2:if((r=n.n()).done){e.n=7;break}return a=r.value,e.p=3,e.n=4,ce(a);case 4:e.n=6;break;case 5:e.p=5,i=e.v,console.warn("closeAllToasts: failed to close one toast:",i);case 6:e.n=2;break;case 7:e.n=9;break;case 8:e.p=8,s=e.v,n.e(s);case 9:return e.p=9,n.f(),e.f(9);case 10:e.n=12;break;case 11:e.p=11,u=e.v,console.error("closeAllToasts failed:",u);case 12:return e.a(2)}},e,null,[[3,5],[1,8,9,10],[0,11]])}))).apply(this,arguments)}var ae=function(){return re.apply(this,arguments)},ie=function(){return oe.apply(this,arguments)};function se(e,t){var n,o=Number(null!==(n=t.duration)&&void 0!==n?n:1800)+5,a=new X(r(l().m(function t(){return l().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,ce(e);case 1:return t.a(2,t.v)}},t)})),o);return a.start(),a}function le(e){return ue.apply(this,arguments)}function ue(){return(ue=r(l().m(function e(t){var n,r,o,a,i,s,u;return l().w(function(e){for(;;)switch(e.n){case 0:if(t.pauseOnHover&&t.outer&&t.timer){e.n=1;break}return e.a(2);case 1:n=t.outer,r=t.timer,o=t.toast,a=()=>{var e;r.pause(),null==o||null===(e=o._progressAnimation)||void 0===e||e.pause()},i=()=>{var e;r.resume(),null==o||null===(e=o._progressAnimation)||void 0===e||e.play()},s=e=>{var t;e.target.matches("[tabindex], div, span, button, a")&&(r.pause(),null==o||null===(t=o._progressAnimation)||void 0===t||t.pause())},u=e=>{var t;n.contains(e.relatedTarget)||(r.resume(),null==o||null===(t=o._progressAnimation)||void 0===t||t.play())},n.addEventListener("mouseenter",a),n.addEventListener("mouseleave",i),n.addEventListener("focusin",s),n.addEventListener("focusout",u),n._pauseCleanup=()=>{n.removeEventListener("mouseenter",a),n.removeEventListener("mouseleave",i),n.removeEventListener("focusin",s),n.removeEventListener("focusout",u)};case 2:return e.a(2)}},e)}))).apply(this,arguments)}function ce(e){return fe.apply(this,arguments)}function fe(){return(fe=r(l().m(function e(t){var n,r,o,a,i,s;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,null!=t&&t._key){e.n=1;break}return e.a(2);case 1:if(a=Y.get(t._key)){e.n=2;break}return e.a(2);case 2:return null===(n=a.timer)||void 0===n||n.clear(),null===(r=a.outer)||void 0===r||null===(o=r._pauseCleanup)||void 0===o||o.call(r),Y.delete(t._key),J=Math.max(0,J-1),(i=a.outer.querySelector(".toast-count-badge"))&&i.remove(),e.n=3,he(a.outer);case 3:return e.n=4,de();case 4:e.n=6;break;case 5:e.p=5,s=e.v,console.error("Closing Toast failed!: ",s);case 6:return e.a(2)}},e,null,[[0,5]])}))).apply(this,arguments)}function de(){return pe.apply(this,arguments)}function pe(){return(pe=r(l().m(function e(){var t,n;return l().w(function(e){for(;;)switch(e.n){case 0:if(!(J<3&&K.length)){e.n=3;break}if(t=K.shift(),!Y.has(t.key)){e.n=2;break}return(n=Y.get(t.key)).count+=t.count,e.n=1,ye(n);case 1:return e.a(3,0);case 2:te(t.options,t.key,t.count),e.n=0;break;case 3:return e.a(2)}},e)}))).apply(this,arguments)}function he(e){return me.apply(this,arguments)}function me(){return(me=r(l().m(function e(t){return l().w(function(e){for(;;)switch(e.n){case 0:if(t){e.n=1;break}return e.a(2,Promise.resolve());case 1:return e.a(2,new Promise(e=>{var n=!1,r=()=>{n||(n=!0,m(t),e())},o=t.firstElementChild||t;if(!o)return e();var a=e=>{try{if(e.target!==o)return;o.removeEventListener("transitionend",a,!0),r()}catch(e){console.error("removeWithTransition error:",e)}};try{o.addEventListener("transitionend",a,!0)}catch(e){console.error("removeWithTransition error:",e)}setTimeout(()=>{try{o.removeEventListener("transitionend",a,!0),r()}catch(e){console.error("removeWithTransition error:",e)}},700)}))}},e)}))).apply(this,arguments)}function ye(e){return ge.apply(this,arguments)}function ge(){return(ge=r(l().m(function e(t){var n,r,o,a;return l().w(function(e){for(;;)switch(e.n){case 0:if(n=t.outer,r=t.count,n&&n instanceof HTMLElement){e.n=1;break}throw new Error("updateBadge: outer must be a valid HTMLElement");case 1:if(!(r<2)){e.n=2;break}return(o=n.querySelector(".toast-count-badge"))&&o.remove(),e.a(2);case 2:(a=n.querySelector(".toast-count-badge"))||((a=document.createElement("span")).className="toast-count-badge",a.setAttribute("aria-label","".concat(r," identical notifications")),Object.assign(a.style,{position:"absolute",top:"6px",right:"6px",backgroundColor:"#f44336",color:"#fff",borderRadius:"50%",minWidth:"20px",height:"20px",fontSize:"12px",fontWeight:"600",display:"flex",alignItems:"center",justifyContent:"center",border:"2px solid #fff",boxShadow:"0 2px 6px rgba(0,0,0,0.3)",zIndex:"2",pointerEvents:"none",transition:"transform 150ms ease"}),n.appendChild(a)),a.textContent=r>99?"99+":String(r);try{a.style.transform="scale(1.2)",setTimeout(()=>a.style.transform="scale(1)",150)}catch(e){console.error("updateBadge animation error:",e)}case 3:return e.a(2)}},e)}))).apply(this,arguments)}var ve={success:"#28a745",error:"#dc3545",warning:"#ffc107",info:"#17a2b8"},be={success:"Operation completed successfully!",error:"Something went wrong!",warning:"Warning message!",info:"Information message!"},we=[],ke=!1;function xe(){return Ce.apply(this,arguments)}function Ce(){return(Ce=r(l().m(function e(){return l().w(function(e){for(;;)switch(e.n){case 0:if(!ke){e.n=1;break}return e.a(2);case 1:"undefined"!=typeof window&&"undefined"!=typeof document&&("complete"===document.readyState||"interactive"===document.readyState?(ke=!0,we.forEach(e=>setTimeout(()=>Ee(e),2500)),we.length=0):document.addEventListener("DOMContentLoaded",()=>{ke=!0,we.forEach(e=>setTimeout(()=>Ee(e),2500)),we.length=0},{once:!0}));case 2:return e.a(2)}},e)}))).apply(this,arguments)}function Ee(){return Se.apply(this,arguments)}function Se(){return Se=r(l().m(function e(){var t,n,r,o,a=arguments;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},e.p=1,e.n=2,Me(t);case 2:return n=e.v,e.n=3,Ae(n);case 3:return e.n=4,Z(n);case 4:e.n=6;break;case 5:e.p=5,o=e.v,console.error("CreateToast failed:",o),r="string"==typeof(null==t?void 0:t.message)&&null!==(null==t?void 0:t.message)?"".concat(t.message.substring(0,200)," toast creation failed!"):"Toast creation failed!",alert(r);case 6:return e.a(2)}},e,null,[[1,5]])})),Se.apply(this,arguments)}function Te(){return Te=r(l().m(function e(){var t,n=arguments;return l().w(function(e){for(;;)switch(e.n){case 0:if(t=n.length>0&&void 0!==n[0]?n[0]:{},"undefined"!=typeof window&&"undefined"!=typeof document){e.n=1;break}return console.warn("ToastNotification: running in non-browser environment, no DOM available."),e.a(2);case 1:return e.n=2,xe();case 2:if(ke){e.n=3;break}return we.push(t),e.a(2);case 3:return e.n=4,Ee(t);case 4:return e.a(2)}},e)})),Te.apply(this,arguments)}function Ae(e){return Oe.apply(this,arguments)}function Oe(){return(Oe=r(l().m(function e(t){var n;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,_(t,W);case 1:return e.a(2,e.v);case 2:return e.p=2,n=e.v,console.error("Failed to create toast container:",n),e.a(2,document.body)}},e,null,[[0,2]])}))).apply(this,arguments)}function Me(e){return je.apply(this,arguments)}function je(){return(je=r(l().m(function e(t){var n,r,o,a,i,u,c,f,d,p;return l().w(function(e){for(;;)if(0===e.n){o=null==t||null===(n=t.position)||void 0===n||null===(n=n.toLowerCase())||void 0===n?void 0:n.trim(),a=null!=o&&o.includes("top-full-width")||null!=o&&o.includes("bottom-full-width")?"100vw":"400px",(i=s(s({},{allowHtml:!1,sanitizeHtml:!0,pauseOnHover:void 0,duration:2500,position:"bottom-right",type:"info",borderRadius:"50px",backgroundColor:void 0,textColor:void 0,showCloseButton:!0,animationDuration:"0.4s",animationType:"fade",animationEasing:"ease",showProgressBar:!0,progressColor:void 0,progressHeight:"4px",progressPosition:"bottom",fontPosition:"relative",fontPadding:void 0,fontBorderRadius:void 0,fontBackgroundColor:void 0,fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontSize:"14px",fontWeight:"400",fontLineHeight:"1.4",fontDirection:"auto",wrapText:"normal",maxWidth:a}),"object"!=typeof t||Array.isArray(t)?{}:t)).message=null!==(r=null==t?void 0:t.message)&&void 0!==r?r:i.message;try{i.backgroundColor||(i.backgroundColor=null!==(c=null===(f=ve)||void 0===f?void 0:f[i.type])&&void 0!==c?c:window.matchMedia("(prefers-color-scheme: dark)").matches?"#f5f5f5":"#111111"),i.message=i.message||(null===(u=be)||void 0===u?void 0:u[i.type])||"No Message Provided!",!i.textColor&&i.backgroundColor&&(d=k(i.backgroundColor),i.textColor=d),!i.progressColor&&i.backgroundColor&&(i.textColor?i.progressColor=i.textColor:(p=k(i.backgroundColor),i.progressColor=p))}catch(e){console.warn("Option processing failed:",e)}return"string"!=typeof i.message&&(i.message="No Message Provided!"),e.a(2,i)}},e)}))).apply(this,arguments)}function Le(e){try{e&&"object"==typeof e&&!Array.isArray(e)&&(ve=s(s({},ve),e))}catch(e){console.error("setDefaultColors failed:",e)}}function Ie(e){try{e&&"object"==typeof e&&!Array.isArray(e)&&(be=s(s({},be),e))}catch(e){console.error("setDefaultMessages failed:",e)}}var Pe=!1,De=null;function Ne(e){return ze.apply(this,arguments)}function ze(){return(ze=r(l().m(function e(t){return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!Pe||!De){e.n=4;break}return e.p=1,e.n=2,De;case 2:e.n=4;break;case 3:e.p=3,e.v;case 4:return e.a(2,t())}},e,null,[[1,3]])}))).apply(this,arguments)}var Be=function(){return Te.apply(this,arguments)};function _e(){return Re.apply(this,arguments)}function Re(){return Re=r(l().m(function e(){var t,n=arguments;return l().w(function(e){for(;;)if(0===e.n)return t=n.length>0&&void 0!==n[0]?n[0]:{},e.a(2,Ne(()=>Be(t)))},e)})),Re.apply(this,arguments)}var We=function(){var e=r(l().m(function e(){return l().w(function(e){for(;;)switch(e.n){case 0:return Pe=!0,De=r(l().m(function e(){return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,ae();case 1:return e.p=1,Pe=!1,De=null,e.f(1);case 2:return e.a(2)}},e,null,[[0,,1,2]])}))(),e.n=1,De;case 1:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),He=function(){var e=r(l().m(function e(){return l().w(function(e){for(;;)switch(e.n){case 0:return Pe=!0,De=r(l().m(function e(){return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,ie();case 1:return e.p=1,Pe=!1,De=null,e.f(1);case 2:return e.a(2)}},e,null,[[0,,1,2]])}))(),e.n=1,De;case 1:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}();if("undefined"!=typeof window&&"undefined"!=typeof document){var qe=!1;if(!qe){window.addEventListener("keydown",e=>{"Escape"!==e.key&&"Esc"!==e.key||r(l().m(function e(){return l().w(function(e){for(;;)switch(e.n){case 0:return Pe=!0,De=r(l().m(function e(){return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,ae();case 1:return e.p=1,Pe=!1,De=null,e.f(1);case 2:return e.a(2)}},e,null,[[0,,1,2]])}))(),e.n=1,De;case 1:return e.a(2)}},e)}))()},{passive:!0}),qe=!0}}try{"undefined"!=typeof window&&(window.customizableToast={createToast:_e,setDefaultColors:Le,setDefaultMessages:Ie,noop:He,dismiss:We})}catch(e){console.error("Global assignment failed:",e)}e.createToast=_e,e.dismiss=We,e.dismissToast=We,e.noop=He,e.noopAll=He,e.setDefaultColors=Le,e.setDefaultMessages=Ie});
|