var e=document.querySelector(`[data-pay-status-url]`);if(e){let t=e.getAttribute(`data-pay-status-url`),n=!1,r=async()=>{if(!n)try{let e=await fetch(t,{headers:{Accept:`application/json`},cache:`no-store`});if(!e.ok)return;let r=await e.json();r&&r.terminal&&(n=!0,clearInterval(i),window.location.reload())}catch{}},i=setInterval(r,4e3);document.addEventListener(`visibilitychange`,()=>{document.hidden||r()})}