1function next_toast(){document.querySelectorAll('.next-toast').forEach(container=>{let toastContainer=container;let showDuration=parseFloat(toastContainer.getAttribute('data-show-duration'));let showEase=toastContainer.getAttribute('data-show-ease');let hideDuration=parseFloat(toastContainer.getAttribute('data-hide-duration'));let hideEase=toastContainer.getAttribute('data-hide-ease');let expandDuration=parseFloat(toastContainer.getAttribute('data-expand-duration'));let expandEase=toastContainer.getAttribute('data-expand-ease');let collapseDuration=parseFloat(toastContainer.getAttribute('data-collapse-duration'));let collapseEase=toastContainer.getAttribute('data-collapse-ease');container.querySelectorAll('.next-toast__toast-data').forEach(toast=>{let title=toast.getAttribute('data-title');let message=toast.getAttribute('data-message');let event=toast.getAttribute('data-event');let showTime=parseFloat(toast.getAttribute('data-show-time'))*1000;let trigger=toast.getAttribute('data-trigger');let expireTime=parseFloat(toast.getAttribute('data-expire-time'))*1000;addToast(title,message,event,expireTime,trigger,showTime)});let toasts=[];function createToastElement(toast,index){const el=document.createElement('div');el.className='next-toast__toast';el.id=toast.id;if(index===toasts.length-1){el.style.opacity=0;el.style.transform='translateY(20px) scale(1)'}else{const previousIndex=index;const previousY=(toasts.length-2-previousIndex)*-10;const previousScale=1-((toasts.length-2-previousIndex)*0.05);el.style.opacity=1;el.style.transform=`translateY(${previousY}px) scale(${previousScale})`} 2el.innerHTML=` 3 <div class="next-toast__toast-content"> 4 <div class="next-toast__toast-body"> 5 <span class="next-toast__toast-title">${toast.title}</span> 6 <span class="next-toast__toast-message">${toast.message}</span> 7 </div> 8 <div tabindex="0" class="next-toast__toast-close"> 9 <svg viewBox="0 0 24 24" fill="none"> 10 <path d="M18 6L6 18M6 6l12 12"/> 11 </svg> 12 </div> 13 </div> 14 `;el.querySelector('.next-toast__toast-close').addEventListener('click',()=>{removeToast(toast.id)});const finalY=(toasts.length-1-index)*-10;const finalScale=1-((toasts.length-1-index)*0.05);if(index===toasts.length-1){gsap.to(el,{duration:showDuration,opacity:1,y:finalY,ease:showEase})}else{gsap.to(el,{duration:showDuration,y:finalY,scale:finalScale,ease:showEase})} 15return el} 16function addToast(title,message,event='pageload',expireTime=5000,trigger=null,showTime=0){const showToast=()=>{const id=Math.random().toString(36).substr(2,9);const newToast={id,title:title||"Notification",message:message||"This is a sample notification message that appears in the toast.",type:'default'};toasts=[...toasts,newToast].slice(-3);renderToasts()};if(event==='click'&&trigger){const triggerElement=document.querySelector(trigger);if(triggerElement){triggerElement.addEventListener('click',showToast)}}else{setTimeout(showToast,showTime)}} 17function removeToast(id){const toast=document.getElementById(id);const isExpanded=toastContainer.matches(':hover');if(toast){const remainingToasts=toasts.filter(t=>t.id!==id);const toastPositions=new Map();remainingToasts.forEach(t=>{const el=document.getElementById(t.id);if(el){const rect=el.getBoundingClientRect();toastPositions.set(t.id,rect.top)}});const isLastToast=toasts[toasts.length-1].id===id;gsap.to(toast,{duration:hideDuration,opacity:0,y:isExpanded&&isLastToast?30:-30,ease:hideEase,onBeforeStart:()=>{toasts=remainingToasts;toast.style.pointerEvents="none";remainingToasts.forEach((t,index)=>{const el=document.getElementById(t.id);if(el){if(isExpanded){const expandedGap=10;const newY=(-el.offsetHeight*(remainingToasts.length-1-index))-(expandedGap*(remainingToasts.length-1-index));gsap.to(el,{duration:hideDuration,y:newY,ease:hideEase})}else{const newY=(-10)*(remainingToasts.length-1-index);gsap.to(el,{duration:hideDuration,y:newY,ease:hideEase})}}})}})}} 18function expandToasts(){var expandedGap=10;let totalHeight=0;
18toasts.forEach((toast,index)=>{const el=document.getElementById(toast.id);if(el){if(index===0){totalHeight+=el.offsetHeight}else{totalHeight+=el.offsetHeight+expandedGap} 19const expandedY=(-el.offsetHeight*(toasts.length-1-index))-(expandedGap*(toasts.length-1-index));gsap.to(el,{duration:expandDuration,y:expandedY,scale:1,ease:expandEase})}});gsap.to(toastContainer,{duration:expandDuration,height:totalHeight,ease:expandEase})} 20function collapseToasts(){toasts.forEach((toast,index)=>{const el=document.getElementById(toast.id);if(el){const collapsedY=(toasts.length-1-index)*-10;const collapsedScale=1-((toasts.length-1-index)*0.05);gsap.to(el,{duration:collapseDuration,y:collapsedY,scale:collapsedScale,ease:collapseEase})}});gsap.to(toastContainer,{duration:collapseDuration,height:"auto",ease:collapseEase})} 21function renderToasts(previousPositions=null){const isExpanded=toastContainer.matches(':hover');const oldElements=new Map();if(previousPositions){toasts.forEach(toast=>{const el=document.getElementById(toast.id);if(el)oldElements.set(toast.id,el);})} 22toastContainer.innerHTML='';toasts.forEach((toast,index)=>{const el=createToastElement(toast,index);toastContainer.appendChild(el);if(isExpanded){const expandedGap=10;const expandedY=(-el.offsetHeight*(toasts.length-1-index))-(expandedGap*(toasts.length-1-index));if(previousPositions&&previousPositions.has(toast.id)){const oldPos=previousPositions.get(toast.id);const newPos=el.getBoundingClientRect().top;const deltaY=oldPos-newPos;if(deltaY<0&&index!==toasts.length-1){el.style.transform=`translateY(${deltaY}px) scale(1)`;el.style.opacity=1;gsap.to(el,{duration:expandDuration,y:expandedY,scale:1,ease:expandEase})}else{el.style.transform=`translateY(${expandedY}px) scale(1)`;el.style.opacity=1}}else{el.style.transform=`translateY(${expandedY}px) scale(1)`;el.style.opacity=1}}});toastContainer.onmouseenter=expandToasts;toastContainer.onmouseleave=collapseToasts}})} 23document.addEventListener("DOMContentLoaded",function(t){bricksIsFrontend&&next_toast()}) 24;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.