PageSourceSearch

https://www.melody.tv/wp-content/themes/melody/assets/dist/lazy.js?ver=1729518097

js melody.tv collected 2026-10-02 10:59:17 UTC 3,507 bytes, 1 lines download raw bytes

1var p=Object.defineProperty;var f=(o,t,r)=>t in o?p(o,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[t]=r;var c=(o,t,r)=>(f(o,typeof t!="symbol"?t+"":t,r),r);class d{constructor({filename:t,url:r,$el:n,prepare:e,refetch:s,mounted:a}){c(this,"template");c(this,"url");c(this,"data");c(this,"$el");c(this,"prepare");c(this,"refetch");c(this,"mounted");c(this,"progressInterval");c(this,"ts");this.url=new URL(r),this.$el=n,this.prepare=e,this.refetch=s,this.mounted=a,fetch("/"+t).then(i=>i.text()).then(i=>{this.template=Twig.twig({data:i}),this.fetch()})}async fetch(){fetch(this.url).then(t=>t.json()).then(t=>{if(t&&(this.ts=Math.round(Date.now()/1e3),this.data=this.prepare({data:t,ts:this.ts}),this.render(),this.mounted&&this.mounted({props:this.data,$el:this.$el}),this.refetch)){const r=typeof this.refetch=="number"?this.refetch:this.refetch({data:t,ts:this.ts});setTimeout(()=>this.fetch(),r<5e3?5e3:r)}})}async render(){if(this.template&&this.data){const t=this.template.render(this.data);this.$el.innerHTML=t}}}function g(o){if(o.includes("/radio/")){const t=o.split("/"),r=t.indexOf("radio");if(r!==-1&&r+1<t.length)return t[r+1]}return null}const y=()=>{let o;const t=document.querySelector("#radio-player");t&&new d({url:document.body.dataset.now,filename:"wp-content/themes/melody/views/card-radio-current.twig",$el:t,refetch:({data:r,ts:n})=>{const{next:e}=r;return(e.start-n)*1e3+1e4},prepare:({data:r,ts:n})=>{const{now:e}=r,s=n-e.start,a=e.stop-e.start;return e.progress=s/a*100,e.time=e.time.split(":").slice(0,-1).join(":"),e.slug=g(window.location.href)??"melody-radio",e.slug==="melody"&&(e.slug="melody-radio"),e},mounted:({props:r,$el:n})=>{clearInterval(o),o=setInterval(()=>{const e=r,s=Date.now()/1e3-e.start,a=e.stop-e.start,i=n.querySelector("[data-progress]");i&&(i.style.width=s/a*100+"%")},5e3)}})},w=()=>{const o=document.querySelector("#radio-history");o&&new d({url:document.body.dataset.history,filename:"wp-content/themes/melody/views/radio-history.twig",$el:o,refetch:({data:t,ts:r})=>Math.max((t.info.expire-r)*1e3,1e4),prepare:({data:t,ts:r})=>{const{history:n}=t;return{songs:n.map(e=>{const s=r-e.start,a=e.stop-e.start;return e.progress=s/a*100,e.time=e.time.split(":").slice(0,-1).join(":"),e})}},mounted:()=>{window.initRadioHistorySwiper()}})};function v(o){const t=new Date(o),r=("0"+t.getHours()).slice(-2),n=("0"+t.getMinutes()).slice(-2);return r+":"+n}const $=()=>{let o;const t=document.querySelector("#program-digest");t&&new d({url:t.dataset.digest,filename:"wp-content/themes/melody/views/sections/section-program-guid.twig",$el:t,prepare:({data:r,ts:n})=>{const{schedule:e}=r[0];return{schedules:e.map((s,a)=>
1{if(s.stop<n)s.type="before";else if(s.start>n)s.type="after";else{s.type="current";const i=n-s.start,l=s.stop-s.start;s.progress=Math.min(i/l*100,100)}return s.time=v(s.start*1e3),s})}},mounted:({props:r})=>{const n=t.querySelector("#load-previous");n.addEventListener("click",()=>{t.classList.remove("previous-hidden"),n.remove()});const e=Object.values(t.querySelectorAll("article"));clearInterval(o);let s;o=setInterval(()=>{let a=Date.now();s=r.schedules.findIndex(h=>h.start*1e3<=a&&h.stop*1e3>a),s!==0&&e[s-1].classList.contains("current")&&(e[s-1].classList.remove("current"),e[s-1].classList.add("before"),e[s].classList.add("current"));const i=r.schedules[s],l=Date.now()/1e3-i.start,m=i.stop-i.start,u=e[s].querySelector("[data-progress]");u&&(u.style.width=l/m*100+"%")},5e3)}})};window.onload=function(){y(),w(),$()};

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.