var e=`HE_APP_NOTIFICATION_EVENT`,t=`he_app_notification_queue_v1`,n=e=>{let t=String(e||``).trim();try{window.focus()}catch{}if(t)try{window.history.pushState({},``,t),window.dispatchEvent(new PopStateEvent(`popstate`))}catch{}},r=e=>{if(e.browser)try{if(typeof window>`u`||typeof Notification>`u`)return;let t=()=>{let t=new Notification(e.title,{body:e.description||``,tag:e.key||e.title});t.onclick=()=>n(e.path)};if(Notification.permission===`granted`){t();return}if(Notification.permission!==`default`)return;Notification.requestPermission().then(e=>{e===`granted`&&t()}).catch(()=>{})}catch{}},i=t=>{try{window.dispatchEvent(new CustomEvent(e,{detail:t}))}catch{}r(t)},a=e=>{try{let n=window.sessionStorage.getItem(t),r=n?JSON.parse(n):[],i=[...Array.isArray(r)?r:[],e].slice(-5);window.sessionStorage.setItem(t,JSON.stringify(i))}catch{}},o=()=>{let e=[];try{let n=window.sessionStorage.getItem(t);window.sessionStorage.removeItem(t),e=n?JSON.parse(n):[]}catch{e=[]}!Array.isArray(e)||!e.length||e.forEach((e,t)=>{window.setTimeout(()=>i(e),t*80)})};export{a as i,o as n,i as r,e as t};