1"use strict";(self.webpackChunkbundle_default=self.webpackChunkbundle_default||[]).push([[623,857],{7857:function(t,e,s){s.r(e),s.d(e,{default:function(){return r},events:function(){return o}});var i=s(4572);class n extends HTMLElement{constructor(t,e,s){super(t,s),(0,i.Z)(this,"handleIntersect",((t,e)=>{t.forEach((t=>{t.isIntersecting&&(e.unobserve(t.target),this.remove())}))})),this.post=t,this.linkText=e,this.onDisconnectedCallback=s}updatePost(t){this.observer.unobserve(this.post),this.post=t,this.observer.observe(this.post)}connectedCallback(){this.classList.add("LiveBlogNewPostLink"),this.postLink=document.createElement("a"),this.postLink.insertAdjacentHTML("beforeend",'<svg class="icon-arrow-down"><use xlink:href="#icon-arrow-down"></use></svg>'),this.postLink.insertAdjacentText("beforeend",this.linkText),this.postLink.href=`#${this.post.id}`,this.postLink.classList.add("LiveBlogNewPostLink-link"),this.appendChild(this.postLink),this.dismissLink=document.createElement("a"),this.dismissLink.insertAdjacentHTML("beforeend",'<svg><use xlink:href="#close-x"></use></svg>'),this.dismissLink.href="#",this.dismissLink.classList.add("LiveBlogNewPostLink-dismissLink"),this.appendChild(this.dismissLink),this.postLink.addEventListener("click",(t=>{t.preventDefault(),window.history.pushState(null,null,`#${this.post.id}`),this.post.scrollIntoView()})),this.dismissLink.addEventListener("click",(t=>{t.preventDefault(),this.remove()})),this.observer=new window.IntersectionObserver(this.handleIntersect),this.observer.observe(this.post)}disconnectedCallback(){this.onDisconnectedCallback()}}window.customElements.define("bsp-liveblog-new-post-link",n);const o={fetched:"LiveBlog:fetched",newPosts:"LiveBlog:newPosts"};class r extends HTMLElement{connectedCallback(){this.postsEndpoint=this.getAttribute("data-posts-endpoint"),this.live=this.hasAttribute("data-live-event"),this.currentPostsEl=document.querySelector(".LiveBlogPage-currentPosts"),this.live&&setInterval((()=>{this.getNewPosts()}),15e3)}async getNewPosts(){let t;const e=new window.URLSearchParams,s=[...document.querySelectorAll(".LiveBlogPost")].reduce(((t,e)=>{const s=+e.getAttribute("data-posted-date-timestamp");return s>t?s:t}),null);s&&e.append("since",s),e.append("_",(()=>{const t=(new window.Date).getTime();return t-t%15e3})());const i=`${this.postsEndpoint}?${e}`;try{t=await window.fetch(i).then((t=>t.text()))}catch(t){return console.error("Error getting new posts",t)}const n=(new window.DOMParser).parseFromString(t,"text/html").querySelector(".LiveBlogPage-currentPosts").innerHTML.trim();if(n){this.currentPostsEl.insertAdjacentHTML("afterbegin",n),this.emit(o.newPosts),this.emit("Ajax:Rendered");const t=this.currentPostsEl.querySelector("bsp-liveblog-post");this.createOrUpdateNewPostLink(t)}}emit(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const s=new window.CustomEvent(t,{bubbles:!0,detail:e});this.dispatchEvent(s)}createOrUpdateNewPostLink(t){this.newPostLink?this.newPostLink.updatePost(t):(this.newPostLink=new n(t,this.getAttribute("data-latest-update-text"),(()=>{this.newPostLink=null})),document.body.appendChild(this.newPostLink))}}},3623:function(t,e,s){s.r(e),s.d(e,{default:function(){return o}});const i=window.navigator.language||window.navigator.userLanguage||"en-US";var n=s(7857);class o extends HTMLElement{get postedDateTimestamp(){return+this.getAttribute("data-posted-date-timestamp")}get postedDate(){return new Date(this.postedDateTimestamp)}get isCurrentDay(){return this.getAttribute("data-is-current-day")}set isCurrentDay(t){t?this.setAttribute("data-is-current-day",""):this.removeAttribute("data-is-current-day")}get headline(){return this.querySelector(".LiveBlogPost-headline").innerText}get id(){return this.getAttribute("data-post-id")}connectedCallback(){this.timeElement=this.querySelector(".LiveBlogPost-time"),this.dateElement=this.querySelector(".LiveBlogPost-date"),this.render(),document.addEventListener(n.events.fetched,(()=>this.render()))}getdPostedTimeFormatted(){const t=new Date-this.postedDate;return t<6e4?`${(t/1e3).toFixed(0)}${this.getAttribute("data-seconds-delta-text")}`:t<36e5?`${(t/6e4).toFixed(0)}${this.getAttribute("data-minutes-delta-text")}`:t<108e5?`${(t/36e5).toFixed(0)}${this.getAttribute("data-hours-delta-text")}
1`:this.postedDate.toLocaleString(i,{hour:"numeric",minute:"numeric",hour12:!0})}getdPostedDateFormatted(){return this.postedDate.toLocaleString(i,{year:"numeric",month:"long",day:"numeric"})}render(){this.timeElement.innerText=this.getdPostedTimeFormatted(),this.dateElement.innerText=this.getdPostedDateFormatted();const t=new Date;t.setHours(0,0,0),this.isCurrentDay=this.postedDate>t}scrollIntoView(){const t={behavior:"smooth",...arguments};this.querySelector(".LiveBlogPost-anchor").scrollIntoView(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.