PageSourceSearch

https://tetherland.com/wp-content/themes/tetherland/dist/js/banner.js?ver=1789656976

js tetherland.com collected 2026-10-07 19:56:50 UTC 3,011 bytes, 1 lines download raw bytes

1import{f as k}from"./apiService-DH6cwg5Q.js";import{g as h,b as m,s as w}from"./cookie-C_CmYs9T.js";const S="api/v5/banners",A=document.querySelector(".top-sticky-banner"),D=document.querySelector(".bottom-sticky-banner"),_=document.getElementById("top-sticky-banner-url"),B=document.getElementById("bottom-sticky-banner-url"),r=document.getElementById("popup"),g=r==null?void 0:r.querySelector("#popupUrl"),I=r==null?void 0:r.querySelector("#popupImg"),v=r==null?void 0:r.querySelector("#my-popup-close"),E=async()=>{try{const t=await k(S);return(t==null?void 0:t.data)||[]}catch(t){return console.error("Error fetching banner data:",t),[]}},U=(t,s,a)=>{const o=s?t.images.mobile:t.images.desktop,n=a?t.links.logged_in_user:t.links.not_logged_in_user,c=t.position==="top"?A:t.position==="bottom"?D:"",e=t.position==="top"?_:t.position==="bottom"?B:"";if(c){c==null||c.setAttribute("src",`${MYCONFIG.baseUrlAPIImg}${o}`),e.setAttribute("href",n),e.setAttribute("target",t.target);const i=t.position==="top"?"body-top-sticky-banner":t.position==="bottom"?"body-bottom-sticky-banner":"";document.body.classList.add(i)}},L=(t,s,a)=>{const o=s?t.images.mobile:t.images.desktop,n=a?t.links.logged_in_user:t.links.not_logged_in_user;let c=m("banner-setting"),e,i=Date.now(),p=1,u=0;if(c)try{e=JSON.parse(c),Array.isArray(e)||(e=[])}catch(l){console.error("Error parsing cookie, resetting:",l),e=[]}else e=[];if(Array.isArray(e)&&e.length>0){let l=e[e.length-1];p=l.count||0,u=l.lastShowData||0,l.nextShowData}if(!(p>=t.number_of_shows)&&t.position==="middle"){const l=V(t.finish_at),y=t.intervals.find(d=>d.n===p+1),b=y?y.interval:null;if(u!==0&&u+b*1e3>=Date.now())return;if(u===0&&(u=i),e.length>0){let d=e[e.length-1];d.lastShowData=i,d.nextShowData=i+60*1e3,d.count+=1}else e.push({id:t.id,isShow:!0,count:1,lastShowData:i,nextShowData:i+b*1e3});w("banner-setting",JSON.stringify(e),l),I.setAttribute("src",`${MYCONFIG.baseUrlAPIImg}${o}`),g.setAttribute("href",n),g.setAttribute("target",t.target),document.body.classList.add("body-middle-popup"),r.style.display="block",P(r,"body-middle-popup",t.close_style)}},P=(t,s,a)=>{v.addEventListener("click",()=>f(t,s)),["mousedown","dblclick"].forEach(o=>{r.addEventListener(o,n=>n.preventDefault())}),a==="outside"&&setTimeout(()=>{["mousedown","dblclick"].forEach(o=>{r.removeEventListener(o,n=>n.preventDefault())}),f(t,s)},5e3)},f=(t,s)=>{t.style.display="none",document.body.classList.remove(s),document.body.style.overflow="auto"},q=()=>document.body.classList.contains("home"),N=t=>{const s=window.innerWidth<768,a=h("access-token");t.forEach(o=>{const{pages:n,type:c,position:e}=o;if(n.includes("Home")||n.includes("All"))switch(c){case"sticky":U(o,s,a);break;case"pop-up":e==="middle"&&(q()||n.includes("All"))&&L(o,s,a);break;default:console.warn("Unknown banner type or position:",o)}})},T=async()=>{const t=await E();t.length>0&&N(t)};function V(t){const s=new Date(t),a=new Date,o=s.getTime()-a.getTime(),n=Math.ceil(o/(1e3*60*60*24));return n>0?n:0}T();

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.