PageSourceSearch

https://www.lemonde.fr/bucket/resources/front/js/7669.d89607b6792518d1.js

js lemonde.fr collected 2026-09-24 06:03:48 UTC 11,551 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[7669],{7669:(e,t,i)=>{i.d(t,{default:()=>n}),i(8380),i(92893),i(23057),i(54789);var s=i(92604),a=i(35367),o=i(14835);const n=new class{constructor(){this.videoPlayer="dailymotion",this.players={default:"x1j5ve",vertical:"x1jasu",slideshow:"x1lili"},this.videoIds=[],this.loadOnce=!1,this.amznParams="",this.prebidParams="",this.dmAsyncInit=this.dmAsyncInit.bind(this),this.load=this.load.bind(this),this.runAsyncBid=this.runAsyncBid.bind(this),this.loadPlayer=this.loadPlayer.bind(this),this.onStart=this.onStart.bind(this),this.onPlay=this.onPlay.bind(this),this.onPause=this.onPause.bind(this),this.onStop=this.onStop.bind(this),this.instances={},this.play=this.play.bind(this),this.pause=this.pause.bind(this),this.pauseOthers=this.pauseOthers.bind(this),window.addEventListener("prebidAdsParamsReady",(e=>{(0,s.A)("prebidAdsParamsReady");let t=[];t=e.detail.params(),this.prebidParams=`${t[0]}%26`})),window.addEventListener("amazonAdsParamsReady",(e=>{(0,s.A)("amazonAdsParamsReady");let t=[];t=e.detail.params(),this.amznParams=`${t}%26`}))}selectedPlayer(e,t){return"slideshow"===t?this.players.slideshow:e?this.players.vertical:this.players.default}onStart(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(0,s.A)(`event onStart ${e} (isTeaser: ${i})`),i||(window?.lmd&&(window.lmd.video_playing=!0),(0,o.K7)(t,o.PH.start,o.Vi.start,e,this.videoPlayer))}onPlay(){(0,s.A)("event onPlay"),window?.lmd&&(window.lmd.video_playing=!0)}onPause(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(0,s.A)(`event onPause ${e} for element ${t?.id} (isTeaser: ${i})`),i||(window?.lmd&&(window.lmd.video_playing=!1),t&&t.id&&t.id.includes("player-popin")?window?.lmd&&(window.lmd.video_playing=!0):(0,o.K7)(t,o.PH.pause,o.Vi.pause,e,this.videoPlayer))}onStop(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(0,s.A)(`event onStop ${e} (isTeaser: ${i})`),i||(window?.lmd&&(window.lmd.video_playing=!1),(0,o.K7)(t,o.PH.end,o.Vi.end,e,this.videoPlayer))}runAsyncBid(){const e=new Promise((e=>setTimeout((()=>{(0,s.A)("runAsyncBid - failSafeTimeout - resolve"),e()}))),1650),t=new Promise((e=>{const t=setInterval((()=>{(0,s.A)("runAsyncBid - setInterval",Boolean(this.amznParams),Boolean(this.prebidParams)),this.amznParams&&this.prebidParams&&((0,s.A)("runAsyncBid - setInterval - inside",Boolean(this.amznParams),Boolean(this.prebidParams)),clearInterval(t),e())}),500)}));return Promise.race([t,e])}dmAsyncInit(){(0,s.A)("dailymotion - dmAsyncInit"),this.videoIds.forEach((e=>{(0,s.A)(`dailymotion.js - Checking video: ${e.targetEl} loaded: ${e.loaded}`),e.loaded||this.instances[e.targetEl]&&this.instances[e.targetEl].player||(this.loadPlayer(e),e.loaded=!0)}))}load(){(0,s.A)("dailymotion - load"),this.loadOnce?((0,s.A)("dailymotion - load - else"),this.videoIds.forEach((e=>{(0,s.A)(`dailymotion.js - Checking video (else): ${e.targetEl} loaded: ${e.loaded}`),e.loaded||this.instances[e.targetEl]&&this.instances[e.targetEl].player||(this.loadPlayer(e),e.loaded=!0)}))):((0,s.A)("dailymotion - load - loadOnce"),this.runAsyncBid().then((()=>{(0,a.A)(`https://geo.dailymotion.com/libs/player/${this.players.default}.js`,!1,!1,(()=>{(0,a.A)(`https://geo.dailymotion.com/libs/player/${this.players.vertical}.js`,!1,!1,(()=>{(0,a.A)(`https://geo.dailymotion.com/libs/player/${this.players.slideshow}.js`,!1,!1,(()=>{(0,s.A)("dailymotion - script loaded"),this.dmAsyncInit(),this.loadOnce=!0}))}))}))})))}loadPlayer(e){var t=this;(0,s.A)("loadPlayerDailymotion");const i=document.getElementById(e.targetEl);if(!i)return;if(this.instances[e.targetEl]&&(this.instances[e.targetEl].player||this.instances[e.targetEl].initializing))return void(0,s.A)(`Dailymotion player already exists or initializing for id: ${e.targetEl}`);const a=i.closest('.ds-card[data-thumbnail-before-player="true"]');this.instances[e.targetEl]={initializing:!0};const o=i.parentNode;o?.classList?.contains("article__video-container--ratio")&&o.classList.remove("article__video-container--ratio");const n="/128139881/LM_lemonde/a_la_une/a_la_une/hp",r=t=>e.isVertical?`${n}/${t}_home_vertical`:`${n}/${t}_home_horizontal`,l=t=>e.isVertical?`${n}/${t}_home_vertical`:`${n}/${t}_home_horizontal`,d=()=>{const e={},i=function(){let{includeMidroll:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i=e?`${t.amznParams}${t.prebidParams}`:"";if(!i&&!e)return"";(0,s.A)("loadPlayer - getAdParams - amznParams",t.amznParams,"prebidParams",t.prebidParams);const a=r("postroll");let o=i?`${i}postroll%3D${a}`:"";if(e){const e=r("midroll");o=o?`${o}%26midroll%3D${e}`:`${t.prebidParams}midroll%3D${e}`}return o}(),a=l("midroll");return i&&(e.keyvalues=i),a&&(e.dynamiciu=a),e},{dailymotion:c}=window;if(c){const t={mute:!0,customConfig:d()};"false"!==e.controls&&"slideshow"!==e.playerType||(t.controls=!1,e.isSlideshow=!0);const o=Number(e.teaserDuration);Number.isFinite(o)&&o>0&&(t.loop=!1,t.enable_automatic_recommendations=!1,t.enable_autonext=!1,t.controls=!1),("true"===e.autoplay||Number.isFinite(o)&&o>
10)&&(t.autoplay=!0,t.mute=!0),c.createPlayer(i.getAttribute("id"),{video:e.videoId,player:this.selectedPlayer(e.isVertical,e.playerType),params:t}).then((t=>{let o=!1;const n=()=>a?.removeAttribute("data-player-loading"),r=()=>{"true"===t.getRootNode?.()?.getAttribute("data-is-visible")&&n()};c.events.VIDEO_TIMECHANGE&&t.on(c.events.VIDEO_TIMECHANGE,(n=>{if(!e)return;const r=Number(e.teaserDuration),l=n?.videoTime;if(Number.isFinite(r)&&r>0){if(!0===n?.adIsPlaying)return;if(l>0&&(o||(o=!0,a?.removeAttribute("data-player-loading"),a?.setAttribute("data-player-ready","true"))),void 0!==l&&l>=r){const a=t.getRootNode?.()||i;if(a&&"undefined"!=typeof IntersectionObserver&&"true"!==a.getAttribute("data-is-visible")&&e.isSlideshow)return(0,s.A)(`Teaser loop blocked for ${e.targetEl} because it is not visible`),void t.pause()?.catch((()=>{}));const o="function"==typeof t.pause?t.pause():void 0;o&&"function"==typeof o.then?o.then((()=>{const i="function"==typeof t.setProp?t.setProp("currentTime",0):"function"==typeof t.seek?t.seek(0):void 0;i&&"function"==typeof i.then?i.then((()=>{t.play()?.then((()=>{e?.targetEl&&this.pauseOthers(e.targetEl)})).catch((()=>{}))})).catch((()=>{})):t.play()?.then((()=>{e?.targetEl&&this.pauseOthers(e.targetEl)})).catch((()=>{}))})).catch((()=>{})):("function"==typeof t.setProp?t.setProp("currentTime",0):"function"==typeof t.seek&&t.seek(0),t.play()?.then((()=>{e?.targetEl&&this.pauseOthers(e.targetEl)})).catch((()=>{})))}}}));const d=()=>{if(!e)return!1;const t=Number(e.teaserDuration),i=e.targetEl?Number(e.targetEl.dataset?.teaserDuration):0;return Number.isFinite(t)&&t>0||Number.isFinite(i)&&i>0};t.on(c.events.PLAYER_START,(()=>{(0,s.A)("Received PLAYER_START event");const i=d();this.onStart(e?.autoplay,t.getRootNode(),i),i&&"function"==typeof t.play&&t.play()?.then((()=>{e?.targetEl&&this.pauseOthers(e.targetEl)})).catch((()=>{r()}))})),t.on(c.events.VIDEO_PLAY,(()=>{(0,s.A)("Received VIDEO_PLAY event"),this.onPlay()})),t.on(c.events.VIDEO_PAUSE,(()=>{(0,s.A)("Received VIDEO_PAUSE event"),o||r();const i=d();this.onPause(e?.autoplay,t.getRootNode(),i)})),t.on(c.events.VIDEO_END,(()=>{(0,s.A)("Received VIDEO_END event");const i=d();this.onStop(e?.autoplay,t.getRootNode(),i)})),t.on(c.events.AD_READYTOFETCH,(e=>{console.log("Dailymotion AD_READYTOFETCH event fired",e);const i=e?.adPosition||"";if("preroll"===i)return void t.setCustomConfig({});const s=l(i);t.setCustomConfig({dynamiciu:s})}));try{"function"==typeof t.setScaleMode?t.setScaleMode("fillTop"):"function"==typeof t.setProp&&t.setProp("scaleMode","fillTop")}catch(e){console.error(`error scaleMode ${e.message}`)}this.instances[e.targetEl]=this.instances[e.targetEl]||{},this.instances[e.targetEl].player=t;const h=Number(e.teaserDuration);this.instances[e.targetEl].isTeaser=h>0,this.instances[e.targetEl].initializing=!1;const u=t.getRootNode?.()||i;if(u&&"undefined"!=typeof IntersectionObserver){const i=e.isSlideshow?.99:.5,l=new IntersectionObserver((l=>{l.forEach((l=>{const d=l.target;if(l.isIntersecting&&l.intersectionRatio>=i){if((0,s.A)(`VisibilityObserver: element intersecting: ${e.targetEl}`),d.setAttribute("data-is-visible","true"),o||a?.setAttribute("data-player-loading","true"),"true"===e.autoplay||e.isSlideshow){(0,s.A)(`VisibilityObserver: autoplay enabled or slideshow, playing: ${e.targetEl}`);try{t.play()?.then((()=>{this.pauseOthers(e.targetEl)})).catch((()=>{r()}))}catch(e){console.error(`error play ${e.message}`)}}}else{(0,s.A)(`VisibilityObserver: element NOT intersecting, pausing: ${e.targetEl}`),d.setAttribute("data-is-visible","false"),n();try{t.pause()?.catch((()=>{}))}catch(e){console.error(`error pause ${e.message}`)}}}))}),{threshold:i});l.observe(u),this.instances[e.targetEl].observer=l}if("true"===e.autoplay)try{t.play()?.then((()=>{this.pauseOthers(e.targetEl)})).catch((()=>{r()}))}catch(e){console.error(`error play ${e.message}`)}})).catch((e=>{a?.removeAttribute("data-player-loading"),console.error(`error ${e.message}`)}))}else a?.removeAttribute("data-player-loading")}pauseOthers(e){e&&e.id&&(e=e.id);const t=window.innerWidth<=768;
1Object.entries(this.instances).forEach((i=>{let[s,{player:a}]=i;if(s!==e&&a){if(t){try{a.pause()?.catch((()=>{}))}catch(e){console.error(e)}return}try{a.pause()?.catch((()=>{}))}catch(e){console.error(e)}}}))}play(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(0,s.A)(`DsDailymotionPlayer.play called with id: ${e} ignoreVisibility: ${t}`),e&&e.id&&(e=e.id);let i=this.instances[e];if(!i){(0,s.A)(`Instance not found for ${e}, searching in keys: ${Object.keys(this.instances).join(", ")}`);const t=Object.keys(this.instances).find((t=>t.includes(e)||e.includes(t)));t&&((0,s.A)(`Found similar instance: ${t} for id: ${e}`),i=this.instances[t],e=t)}if(i&&i.player)try{const a=i.player;if(t&&i.observer&&((0,s.A)(`Temporarily disconnecting observer for: ${e}`),i.observer.unobserve(i.player.getRootNode?.()||document.getElementById(e)),i.observerReconnectionTimeout&&clearTimeout(i.observerReconnectionTimeout),i.observerReconnectionTimeout=setTimeout((()=>{const t=document.getElementById(e)||("function"==typeof a.getRootNode?a.getRootNode():null);t&&i.observer&&((0,s.A)(`Reconnecting observer for: ${e}`),i.observer.observe(t)),delete i.observerReconnectionTimeout}),3e3)),"function"==typeof a.setMuted?a.setMuted(!0):"function"==typeof a.setProp&&a.setProp("muted",!0),"function"==typeof a.play){const t=a.play();t&&"function"==typeof t.then&&t.then((()=>{this.pauseOthers(e)})).catch((()=>{}))}setTimeout((()=>{const t="function"==typeof a.getState?a.getState():"function"==typeof a.getProp?a.getProp("state"):null;t&&"function"==typeof t.then&&t.then((t=>{(0,s.A)(`Player state after play attempt: ${t} for id: ${e}`),"playing"!==t&&((0,s.A)("Force playing again..."),a.play()?.then((()=>{this.pauseOthers(e)})).catch((()=>{})))}))}),500)}catch(e){console.error(`error play ${e.message}`)}else(0,s.A)(`No instance found for id: ${e}`)}async pause(e){(0,s.A)(`DsDailymotionPlayer.pause called with id: ${e}`),e&&e.id&&(e=e.id);let t=this.instances[e];if(!t){const i=Object.keys(this.instances).find((t=>t.includes(e)||e.includes(t)));i&&(t=this.instances[i])}if(t&&t.player)try{if("function"==typeof t.player.pause){const i=t.player.pause();i&&"function"==typeof i.then&&await i.catch((t=>{(0,s.A)(`Pause promise rejected for ${e}: ${t.message}`)}))}}catch(e){console.error(`error pause ${e.message}`)}}}}}]);

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.