PageSourceSearch

https://avasklad.parts/assets/controllers/toast_controller-zEN4Ke8.js

js avasklad.parts collected 2026-10-06 16:49:56 UTC 1,880 bytes, 1 lines download raw bytes

1import{Controller as a}from"@hotwired/stimulus";import{useTransition as n}from"stimulus-use";const r="fixed z-[100] flex flex-col-reverse gap-3 pointer-events-none",s={tl:"top-5 left-5 items-start",tc:"top-5 left-1/2 -translate-x-1/2 items-center",tr:"top-5 right-5 items-end",bl:"bottom-5 left-5 items-start",bc:"bottom-5 left-1/2 -translate-x-1/2 items-center",br:"bottom-5 right-5 items-end"};export default class extends a{static values={autoClose:Number,position:String};static targets=["timerbar"];connect(){n(this,{leaveActive:"transition ease-in duration-500",leaveFrom:"opacity-100",leaveTo:"opacity-0",transitioned:!0}),this._attachToContainer(),this.autoCloseValue&&(this.remaining=this.autoCloseValue,this._startTimer())}disconnect(){this._clearTimer()}pause(){if(!this.autoCloseValue||!this.timeoutId)return;this._clearTimer();const t=Date.now()-this.startedAt;if(this.remaining=Math.max(0,this.remaining-t),this.hasTimerbarTarget){const i=this.timerbarTarget,e=getComputedStyle(i).width;i.style.transition="none",i.style.width=e}}resume(){!this.autoCloseValue||this.timeoutId||this.remaining<=0||this._startTimer()}close(){this._clearTimer(),this.leave()}_attachToContainer(){const t=this.positionValue;if(!t||t==="inline"||!s[t]){this.element.style.display="";return}const i=`toast-container-${t}`;let e=document.getElementById(i);e||(e=document.createElement("div"),e.id=i,e.className=`${r} ${s[t]}`,document.body.appendChild(e)),this.element.parentElement!==e&&e.appendChild(this.element),this.element.style.display=""}_startTimer(){if(this.startedAt=Date.now(),this.timeoutId=setTimeout(()=>this.close(),this.remaining),this.hasTimerbarTarget){const t=this.timerbarTarget,i=this.remaining;requestAnimationFrame(()=>{t.style.transition=`width ${i}ms linear`,t.style.width="0%"})}}_clearTimer(){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}}

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.