PageSourceSearch

https://www.numerama.com/wp-content/themes/numerama-next/dist/java…/VideoOverlay-vBhnoEa87HsGnsDVJxbBv.js

js numerama.com collected 2026-09-24 08:38:15 UTC 5,756 bytes, 3 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="01a0cd7a-952e-7e30-82b8-552ca3e258c9")}catch(e){}}();import{_ as u}from"./preload-helper-vPPVm8DszH-2TKF0rVCx_.js";import{a as c,D as T,e as b,d as A}from"../main-vBSObIaFdnC_kcQ-kUybI.js";import{i as f,A as L}from"./humanoidfr-scripts-vCRRi8yZPwDqJmS_NWwu3.js";import"./wordpress-dom-ready-vDZjrS70i4iWGOkGfVJ4B.js";import"./toastify-js-vBLkRsxwB8yNRHxoJreol.js";import"./_commonjsHelpers-vCqkleIqsqnNkQ1fsnTA0.js";import"./ThemeManager-vDk94BjzeFOxe6xGNv7HB.js";import"./feedConstants-vDdETntvAgaR-fwAwz9bW.js";const h="js-youtube-iframe",r={isVendorLoaded:!1,players:[],queue:[],init:()=>r.isVendorLoaded?!1:(window.onYouTubeIframeAPIReady=()=>{r.queue.forEach(({$wrapper:t,params:e})=>{new window.YT.Player(t,e)})},r.loadVendor(),r.isVendorLoaded=!0,!0),loadVendor:()=>{const t=document.createElement("script");t.src="https://www.youtube.com/iframe_api";const e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(t,e)},onPlayerLoad(t){t.target.playVideo(),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"video_player_youtube_"+t.target.playerInfo.videoData.video_id})},create(t){const e=document.querySelectorAll(`.${h}`);for(let o=0;o<e.length;o+=1)e[o].classList.remove(h);t.classList.add(h);const i={height:"9",width:"16",videoId:t.getAttribute("video-id"),playerVars:{playsinline:1},events:{onReady:r.onPlayerLoad}};return window.YT&&window.YT.Player?r.players.push(new window.YT.Player(t,i)):r.queue.push({$wrapper:t,params:i}),null},destroy(){return r.players.forEach(t=>t.stopVideo()),null}},g="is-hidden",P="is-playing",y="dailymotion",m="youtube",_="getVideo",v=t=>({id:t.getAttribute("video-id"),provider:t.getAttribute("video-provider"),$el:t,$video:t.querySelector(".js-video-player-video"),$content:t.querySelector(".js-video-player-content"),$iframeWrapper:t.querySelector(".js-video-player-iframe")});class Y{constructor(){this.$overlay=document.querySelector(".js-video-overlay"),this.$container=this.$overlay.querySelector(".js-video-overlay-content"),this.$close=this.$overlay.querySelectorAll(".js-video-overlay-close"),this.$loader=this.$container.querySelector(".js-video-overlay-content-loader"),this.$content=this.$container.querySelector(".js-video-overlay-content-videos"),this.$nextPlayerLoader=null,this.currentPlayer=null,this.nextPlayer=null,this.doingFirstLoad=!1}init(){$("body").on("click",".js-video",e=>this.open({id:e.currentTarget.dataset.id,provider:e.currentTarget.dataset.provider})),this.$close.forEach(e=>{e.addEventListener("click",()=>this.close())})}open({id:e,provider:i}){if(this.show(),i===y?c.init(T):i===m&&r.init(),this.currentPlayer&&e===this.currentPlayer.id)return!1;const d={action:_,id:e,isFirstLoad:!0};return this.doingFirstLoad?!1:(this.doingFirstLoad=!0,this.$loader.classList.remove("is-disabled"),this.$content.innerHTML="",f.get(L,d).then(s=>{const{html:a}=s;if(!a)return;this.$content.innerHTML=a,this.$loader.classList.add("is-disabled");const E=this.$content.querySelector('.js-video-player[video-id="'+e+'"]:not(.is-close)'),w=this.$content.querySelector(".js-video-player.is-close");this.bindCurrentPlayer(v(E)),this.bindNextPlayer(v(w));const p=[...this.$content.querySelectorAll("[data-share-url]")];if(p.length&&u(async()=>{const{default:n}=await import("./Sharer-vDSbmGqpzAyohYKG6lHDe.js");return{default:n}},[],import.meta.url).then(({default:n})=>p.forEach(l=>n(l))),navigator.share){const n=[...this.$content.querySelectorAll("[data-share-api-url]")];n.length&&u(async()=>{const{default:l}=await import("./Sharer-vDSbmGqpzAyohYKG6lHDe.js");return{default:l}},[],import.meta.url).then(({default:l})=>n.forEach(V=>l(V,!0)))}this.doingFirstLoad=!1}),!0)}close(){try{c.destroy(),r.destroy()}catch(e){console.log(e),this.$content.innerHTML=""}this.hide()}loadNextVideo(){this.buildNextVideoLoader();const{id:e}=this.nextPlayer,i={action:_,id:e};f.get(L,i).then(o=>{const{html:d}=o;if(!d)return;const s=document.createElement("div");s.innerHTML=o.html;const a=s.firstChild;
1this.$nextPlayerLoader.remove(),this.$content.prepend(a),this.bindNextPlayer(v(a)),$(document).trigger("updateLazyload")})}bindCurrentPlayer(e){this.currentPlayer=e,$(document).trigger("updateLazyload"),this.playVideo(e)}playVideo(e){e.$video.classList.add(P),e.provider===y?c.createWithAds(e.$iframeWrapper):e.provider===m&&r.create(e.$iframeWrapper)}pauseVideo(e){e.$video.classList.remove(P),e.provider===y?c.destroy():e.provider===m&&r.destroy()}bindNextPlayer(e){this.nextPlayer=e,this.animePromise??=u(()=>import("./animejs-v_ltpkqJ9DYTZqW_qD-ql.js"),[],import.meta.url);const i=async()=>{const{currentPlayer:o}=this;this.pauseVideo(o),e.$el.removeEventListener("click",i),e.$el.classList.remove("is-close");const{createTimeline:d}=await this.animePromise,s=d({duration:A,ease:b,complete:()=>{const{$content:a}=e;a.style.height="auto",o.$el.remove()}});s.add(e.$el,{marginTop:["-50%","0"]},0),s.add(e.$content,{height:[0,e.$content.scrollHeight],opacity:{from:0,to:1,delay:500}},0),this.bindCurrentPlayer(e),this.loadNextVideo()};this.nextPlayer.$el.addEventListener("click",i)}buildNextVideoLoader(){const e=document.createElement("div");e.classList.add("is-loading","video-player","is-close");const i=document.createElement("div");i.classList.add("video-player__video"),e.appendChild(i),this.$nextPlayerLoader=e,this.$content.prepend(this.$nextPlayerLoader)}show(){this.$overlay.classList.remove(g)}hide(){this.$overlay.classList.add(g)}}export{Y as default};
2
3//# chunkId=01a0cd7a-952e-7e30-82b8-552ca3e258c9

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.