1(function(){"use strict";var VEDETTE=window.LNS_VEDETTE;if(!VEDETTE)return;var BLOC="[data-loven-vedette-bloc]",SEUIL_VISIBLE=.5,DUREE_MS=1e3,impressionsEmises=Object.create(null),cartesEmises=Object.create(null),nbCartesEmises=0,PLAFOND_CARTES=60,observees=new WeakSet,minuteurs=new WeakMap,observateur=null;function track(type,payload,options){var f=window.LNS_FUNNEL;if(f&&typeof f.track=="function"){f.track(type,payload,options);return}window.LNS_FUNNEL_QUEUE=window.LNS_FUNNEL_QUEUE||[],window.LNS_FUNNEL_QUEUE.push([type,payload,options])}function blocDe(carte){return!carte||!carte.closest?null:carte.closest(BLOC)}function estVedette(carte){return blocDe(carte)?!0:!!(carte.querySelector&&carte.querySelector("[data-loven-spons]"))}function surfaceDe(bloc){return bloc?VEDETTE.pageType==="index"?"accueil":"bloc":VEDETTE.pageType==="search"?"recherche":"collection"}function handleDe(bloc){return bloc?bloc.getAttribute("data-loven-vedette-bloc")||null:VEDETTE.collectionHandle||null}function contexteVedette(carte,bloc,position,total){return{source:"vedette",surface:surfaceDe(bloc),collection_handle:handleDe(bloc),collection_id:bloc?null:VEDETTE.collectionId||null,product_id:carte.getAttribute("data-product-id")||null,product_handle:carte.getAttribute("data-product-handle")||null,position:position,nb_vedettes:total}}function carteVisible(carte){return!carte||!carte.isConnected||carte.classList.contains("loven-geo-hidden")||carte.classList.contains("loven-map-hidden")?!1:carte.offsetParent!==null}function toutesLesCartes(){var toutes=[];if(typeof window.LovenGetProductGridCards=="function")try{toutes=Array.prototype.slice.call(window.LovenGetProductGridCards()||[])}catch(e){toutes=[]}return toutes.length||(toutes=Array.prototype.slice.call(document.querySelectorAll(".grid-product[data-product-id]"))),toutes}function vedettesDuGroupe(bloc){for(var toutes=toutesLesCartes(),res=[],i=0;i<toutes.length;i++){var carte=toutes[i];carteVisible(carte)&&blocDe(carte)===bloc&&(!bloc&&!carte.querySelector("[data-loven-spons]")||res.push(carte))}return res}function cleImpression(carte,bloc){return(carte.getAttribute("data-product-id")||"?")+"@"+(handleDe(bloc)||surfaceDe(bloc))}function creerObservateur(){observateur||typeof IntersectionObserver=="undefined"||(observateur=new IntersectionObserver(function(entrees){entrees.forEach(function(entree){var carte=entree.target;if(entree.isIntersecting&&entree.intersectionRatio>=SEUIL_VISIBLE){if(minuteurs.has(carte))return;minuteurs.set(carte,window.setTimeout(function(){minuteurs.delete(carte),emettreImpression(carte)},DUREE_MS))}else{var t=minuteurs.get(carte);t&&(window.clearTimeout(t),minuteurs.delete(carte))}})},{threshold:[SEUIL_VISIBLE]}))}function listeCourante(){return VEDETTE.pageType==="search"?"search":VEDETTE.collectionHandle||VEDETTE.pageType||null}function emettreCarte(carte){if(carteVisible(carte)){var handle=carte.getAttribute("data-product-handle");if(handle&&!cartesEmises[handle]&&!(nbCartesEmises>=PLAFOND_CARTES)){cartesEmises[handle]=!0,nbCartesEmises++;var toutes=toutesLesCartes().filter(carteVisible),rang=toutes.indexOf(carte);track("card_impression",{item_id:handle,item_list_id:listeCourante(),index:rang>=0?rang+1:null,position_type:estVedette(carte)?"boost":"organic",product_id:carte.getAttribute("data-product-id")||null,nb_cartes:toutes.length})}}}function emettreImpression(carte){if(carteVisible(carte)&&(emettreCarte(carte),!!estVedette(carte))){var bloc=blocDe(carte),cle=cleImpression(carte,bloc);if(!impressionsEmises[cle]){impressionsEmises[cle]=!0;var groupe=vedettesDuGroupe(bloc),position=groupe.indexOf(carte);track("vedette_impression",contexteVedette(carte,bloc,position>=0?position+1:null,groupe.length))}}}var listeEmise=!1;function emettreListeGA4(){if(!listeEmise){var cartes=toutesLesCartes().filter(carteVisible);if(cartes.length){listeEmise=!0;for(var items=[],i=0;i<cartes.length&&i<PLAFOND_CARTES;i++){var handle=cartes[i].getAttribute("data-product-handle");handle&&items.push({item_id:handle,item_list_id:listeCourante(),index:i+1})}if(items.length)try{window.dataLayer=window.dataLayer||[],window.dataLayer.push({ecommerce:null}),window.dataLayer.push({event:"view_item_list",ecommerce:{item_list_id:listeCourante(),items:items}})}catch(e){}}}}function brancher(){creerObservateur(),emettreListeGA4();for(var vedettes=toutesLesCartes().filter(carteVisible),i=0;i<vedettes.length;i++){var carte=vedettes[i];observees.has(carte)||(observees.add(carte),observateur?observateur.observe(carte):emettreImpression(carte))}}document.addEventListener("click",function(evenement){var lien=evenement.target&&evenement.target.closest?evenement.target.closest("a.grid-item__link"):null;if(lien){var carte=lien.closest(".grid-product[data-product-id]");if(!(!carte||!estVedette(carte))){var bloc=blocDe(carte),groupe=vedettesDuGroupe(bloc),position=groupe.indexOf(carte);track("vedette_clic",contexteVedette(carte,bloc,position>=0?position+1:null,groupe.length),{immediat:!0,beacon:!0})}}},!0),["loven:sponsored-ready","loven:dynamic-grid-rendered","collection:availability","collection:reloaded","collection:destFiltered","collection:mapViewportFiltered","collection:mapSync"].forEach(function(nom){document.addEventListener(nom,function(){window.setTimeout(brancher,0)})}),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",brancher):brancher()})(); 2//# sourceMappingURL=/cdn/shop/t/129/assets/loven-vedette-tracking.js.map?v=92571960319361428911790099332
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.