@20minutes/tyr 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/articlePage-desktop-critical.css +1 -1
- package/dist/css/articlePage-desktop-no-critical.css +1 -1
- package/dist/css/articlePage-mobile-critical.css +1 -1
- package/dist/css/articlePage-mobile-no-critical.css +1 -1
- package/dist/css/global.css +1 -1
- package/dist/css/horoscopePage-desktop-critical.css +1 -1
- package/dist/css/horoscopePage-desktop-no-critical.css +1 -1
- package/dist/css/horoscopePage-mobile-critical.css +1 -1
- package/dist/css/horoscopePage-mobile-no-critical.css +1 -1
- package/dist/css/horoscopehomePage-desktop-critical.css +1 -1
- package/dist/css/horoscopehomePage-desktop-no-critical.css +1 -1
- package/dist/css/horoscopehomePage-mobile-critical.css +1 -1
- package/dist/css/horoscopehomePage-mobile-no-critical.css +1 -1
- package/dist/index.d.ts +34 -12
- package/dist/index.es.js +17407 -17343
- package/dist/index.umd.js +142 -136
- package/dist/js/dfp.min.js +1 -1
- package/dist/js/mainCritical.min.js +1 -1
- package/package.json +4 -4
- package/dist/js/gtm.min.js +0 -1
package/dist/js/dfp.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(r){"use strict";var p=(e=>(e.HEADER_AD='[[1,1], "fluid"]',e.BAN_ATF="[[1,1], [728,90], [970,250], [980,250], [1000,90], [1000,250], [1600,1200]]",e.PAVE_ATF="[[1,1], [300,250], [300,600], [600,250], [600,600], [770,250]]",e.BAN_BTF="[[1,1], [728,90], [970,90], [970,250], [980,250], [1000,90], [1000,250]]",e.ARTICLE_BTF="[[1,1], [300,168], [300,250], [320,50], [320,100], [320,480]]",e))(p||{}),d=(e=>(e.UNKNOWN="Non connu",e.SLIDESHOW_COVER="Slideshow cover",e.SLIDESHOW_COVER_LISTING_PAGE="Slideshow listing page",e.SLIDESHOW_PAGE="Slideshow page",e.ARTICLE="article",e.MISC="divers",e.HOME="home",e.LIVE="live",e.SECTION="section",e.TAG="tag",e))(d||{}),l=(e=>(e.MISC="divers",e.HOME="home",e.LOCAL="local",e.PLANET="plan\xE8te",e))(l||{}),
|
|
1
|
+
(function(r){"use strict";var p=(e=>(e.HEADER_AD='[[1,1], "fluid"]',e.BAN_ATF="[[1,1], [728,90], [970,250], [980,250], [1000,90], [1000,250], [1600,1200]]",e.PAVE_ATF="[[1,1], [300,250], [300,600], [600,250], [600,600], [770,250]]",e.BAN_BTF="[[1,1], [728,90], [970,90], [970,250], [980,250], [1000,90], [1000,250]]",e.ARTICLE_BTF="[[1,1], [300,168], [300,250], [320,50], [320,100], [320,480]]",e))(p||{}),d=(e=>(e.UNKNOWN="Non connu",e.SLIDESHOW_COVER="Slideshow cover",e.SLIDESHOW_COVER_LISTING_PAGE="Slideshow listing page",e.SLIDESHOW_PAGE="Slideshow page",e.ARTICLE="article",e.MISC="divers",e.HOME="home",e.LIVE="live",e.SECTION="section",e.TAG="tag",e))(d||{}),l=(e=>(e.MISC="divers",e.HOME="home",e.LOCAL="local",e.PLANET="plan\xE8te",e))(l||{}),u=(e=>(e.PAGETYPE="pageType",e.TAGS="tags",e))(u||{}),_=(e=>(e.COMMON_HEADER="common/header",e.COMMON_FOOTER="common/footer",e.COMMON_NEWSLETTER="common/newsletter",e.COMMON_LIVE_CARDS="common/live-cards",e.COMMON_OVERVIEW_BAR="common/overview-bar",e))(_||{}),S=(e=>(e.RUBRIC_CATEGORY_CARDS="rubric/category-cards",e.RUBRIC_NEWS_CARDS="rubric/news-cards",e.RUBRIC_MOST_READ_ARTICLES="rubric/most-read-articles",e.RUBRIC_PARTNER_CARDS="rubric/partner-cards",e.ARTICLE_SCROLL_PROGRESS_BAR="rubric/scroll-progress-bar",e))(S||{}),f=(e=>(e.ARTICLE_BREADCRUMB="article/breadcrumb",e.ARTICLE_HEADER="article/article-header",e.ARTICLE_IMAGE_COVER="article/article-image-cover",e.ARTICLE_SOCIAL_BAR="article/social-bar",e.ARTICLE_SUMMARY="article/article-summary",e.ARTICLE_CONTENT="article/article-content",e.ARTICLE_TAG_BAR="article/tag-bar",e.ARTICLE_SIGNATURE="article/signature",e))(f||{}),m=(e=>(e.HOROSCOPE_META="horoscope/meta",e.HOROSCOPE_BREADCRUMB="horoscope/breadcrumb",e.HOROSCOPE_HEADER_PAGE="horoscope/header-page",e.HOROSCOPE_HEADER_BANNER="horoscope/header-banner",e.HOROSCOPE_HOROSCOPE_CONTENT="horoscope/horoscope-content",e.HOROSCOPE_HOMEPAGE_CONTENT="horoscope/horoscope-homepage-content",e.HOROSCOPE_LINK="horoscope/link",e.HOROSCOPE_HOROSCOPE_TILES="horoscope/horoscope-tiles",e.HOROSCOPE_HOROSCOPE_LINK_NEXT_TYPE="horoscope/horoscope-link-next-type",e))(m||{});const E=e=>{var t,o,a,n;switch(e){case"pageType":return Object.values(d).includes((t=window.datalayer)==null?void 0:t.page_type)?(o=window.datalayer.page_type)==null?void 0:o.toLowerCase():d.MISC;case"tags":return Object.values(l).includes((a=window.datalayer)==null?void 0:a.tags)?(n=window.datalayer.tags)==null?void 0:n.toLowerCase():l.MISC}return window.datalayer[e]},h=()=>{window.dfp=window.dfp||{},window.dfp.targeting=window.dfp.targeting||{},Object.values(u).forEach(e=>{window.dfp.targeting[e]=E(e)})},w=e=>{var t;const o=e instanceof Array?e:[e];window.dfp.slots=((t=window.dfp)==null?void 0:t.slots)||[],window.dfp.slots=[...window.dfp.slots,...o]},T=e=>{window.dfp.slotsReady=!1;const t=document.querySelectorAll("div[data-dfp-path]"),o=[];googletag.cmd.push(()=>{t.forEach(a=>{const n=a.getAttribute("data-dfp-name"),c=a.getAttribute("data-dfp-path"),R=a.getAttribute("id"),g=n&&JSON.parse(p[n.toUpperCase()])||null;if(R&&n&&c&&g&&googletag){const s=googletag.defineSlot([c,n].join("/"),g,R);if(!s)return;s.addService(googletag.pubads()),o.push({slotElementId:s.getSlotElementId(),path:c,sizes:JSON.stringify(g)}),Object.entries(e).map(([D,H])=>s.setTargeting(D,H))}})}),window.dfp.slotsReady=!0,w(o)};let A=!1,O=0;const b=1500,i="renderAd",I=()=>A||googletag&&googletag.pubadsReady&&window.dfp.slotsReady&&window.dfp.hubvisorEnd,C=e=>{googletag&&googletag.cmd.push(()=>{const t={};googletag.pubads().getSlots().forEach(a=>{t[a.getSlotElementId()]=a});const o=[];e.forEach(a=>{t[a]&&o.push(t[a])}),o.length&&googletag.pubads().refresh(o)})},y=()=>{document.addEventListener(i,e=>{if(!e.target)return;const t=e;t&&t.target.closest("[data-dfp-name]")&&t.detail.length&&C([t.detail[0].id])},!0)},v=()=>{const e=document.body.querySelectorAll('div[data-dfp-name][data-delayed="true"]');Array.prototype.forEach.call(e,t=>{t.addEventListener(t.getAttribute("id"),function o(){t.dispatchEvent(new CustomEvent(i,{detail:[{id:t.getAttribute("id")}]})),t.removeEventListener(i,o)})})},N=()=>{const e=[],t=document.querySelectorAll('div[data-dfp-name][data-delayed="false"]');t.length>0&&Array.prototype.forEach.call(t,o=>{e.push(o.getAttribute("id"))}),C(e)},L=()=>{const e=setInterval(()=>{if(!I&&O<b){O+=100;return}clearInterval(e),A=!0,N(),y(),v()},100)},M=()=>{googletag.cmd.push(()=>{googletag.pubads().setTargeting("lang","fr"),googletag.pubads().setTargeting("dn",window.location.hostname);try{const t=window.location.href.split("?")[1];t&&t.split("&").forEach(o=>{const a=o.split("=");a[0]==="20minutest"&&googletag.pubads().setTargeting(a[0],a[1])})}catch{}googletag.pubads().enableSingleRequest(),googletag.pubads().disableInitialLoad(),googletag.enableServices();const e=Math.max(document.documentElement.clientWidth,window.innerWidth||0);e>=1400?googletag.pubads().setTargeting("screen",["1400","1000"]):e>=1e3&&googletag.pubads().setTargeting("screen","1000")})};return r.callDfp=L,r.dfpDatalayerAdapter=E,r.setAdSlotsKeyValues=h,r.setDfpConfig=M,r.setDfpSlots=T,Object.defineProperty(r,"__esModule",{value:!0}),r})({});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";var f=Object.defineProperty,p=Object.getOwnPropertySymbols,I=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable,m=(e,o,t)=>o in e?f(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,r=(e,o)=>{for(var t in o||(o={}))I.call(o,t)&&m(e,t,o[t]);if(p)for(var t of p(o))R.call(o,t)&&m(e,t,o[t]);return e};const b=()=>{var e;return{page_uri:"/",page_type:((e=window.datalayer)==null?void 0:e.pageType)||"divers"}},h=()=>({darkmode:"0"}),A=()=>{var e,o;return{signature:((e=window.datalayer)==null?void 0:e.signature)||void 0,nbParagraphs:((o=window.datalayer)==null?void 0:o.nbParagraphs)||void 0}},y=()=>{const e=b(),o=h(),t=A();window.datalayer=r(r(r({},e),o),t)};var _=(e=>(e.HEADER_AD='[[1,1], "fluid"]',e.BAN_ATF="[[1,1], [728,90], [970,250], [980,250], [1000,90], [1000,250], [1600,1200]]",e.PAVE_ATF="[[1,1], [300,250], [300,600], [600,250], [600,600], [770,250]]",e.BAN_BTF="[[1,1], [728,90], [970,90], [970,250], [980,250], [1000,90], [1000,250]]",e.ARTICLE_BTF="[[1,1], [300,168], [300,250], [320,50], [320,100], [320,480]]",e))(_||{}),d=(e=>(e.UNKNOWN="Non connu",e.SLIDESHOW_COVER="Slideshow cover",e.SLIDESHOW_COVER_LISTING_PAGE="Slideshow listing page",e.SLIDESHOW_PAGE="Slideshow page",e.ARTICLE="article",e.MISC="divers",e.HOME="home",e.LIVE="live",e.SECTION="section",e.TAG="tag",e))(d||{}),c=(e=>(e.MISC="divers",e.HOME="home",e.LOCAL="local",e.PLANET="plan\xE8te",e))(c||{}),u=(e=>(e.PAGETYPE="pageType",e.TAGS="tags",e))(u||{}),L=(e=>(e.COMMON_HEADER="common/header",e.COMMON_FOOTER="common/footer",e.COMMON_NEWSLETTER="common/newsletter",e))(L||{}),N=(e=>(e.RUBRIC_CATEGORY_CARDS="rubric/category-cards",e.RUBRIC_LIVE_CARDS="rubric/live-cards",e.RUBRIC_NEWS_CARDS="rubric/news-cards",e.RUBRIC_MOST_READ_ARTICLES="rubric/most-read-articles",e.RUBRIC_PARTNER_CARDS="rubric/partner-cards",e.ARTICLE_SCROLL_PROGRESS_BAR="rubric/scroll-progress-bar",e))(N||{}),D=(e=>(e.ARTICLE_BREADCRUMB="article/breadcrumb",e.ARTICLE_OVERVIEW_BAR="article/overview-bar",e.ARTICLE_HEADER="article/article-header",e.ARTICLE_IMAGE_COVER="article/article-image-cover",e.ARTICLE_SOCIAL_BAR="article/social-bar",e.ARTICLE_SUMMARY="article/article-summary",e.ARTICLE_CONTENT="article/article-content",e.ARTICLE_TAG_BAR="article/tag-bar",e.ARTICLE_SIGNATURE="article/signature",e))(D||{}),k=(e=>(e.HOROSCOPE_BREADCRUMB="horoscope/breadcrumb",e.HOROSCOPE_HEADER_PAGE="horoscope/header-page",e.HOROSCOPE_HEADER_BANNER="horoscope/header-banner",e.HOROSCOPE_HOROSCOPE_CONTENT="horoscope/horoscope-content",e.HOROSCOPE_HOMEPAGE_CONTENT="horoscope/horoscope-homepage-content",e.HOROSCOPE_LINK="horoscope/link",e.HOROSCOPE_HOROSCOPE_TILES="horoscope/horoscope-tiles",e.HOROSCOPE_HOROSCOPE_LINK_NEXT_TYPE="horoscope/horoscope-link-next-type",e))(k||{});const P=e=>{var o,t,n,i;switch(e){case"pageType":return Object.values(d).includes((o=window.datalayer)==null?void 0:o.page_type)?(t=window.datalayer.page_type)==null?void 0:t.toLowerCase():d.MISC;case"tags":return Object.values(c).includes((n=window.datalayer)==null?void 0:n.tags)?(i=window.datalayer.tags)==null?void 0:i.toLowerCase():c.MISC}return window.datalayer[e]},H=()=>{window.dfp=window.dfp||{},window.dfp.targeting=window.dfp.targeting||{},Object.values(u).forEach(e=>{window.dfp.targeting[e]=P(e)})},M=e=>{var o;const t=e instanceof Array?e:[e];window.dfp.slots=((o=window.dfp)==null?void 0:o.slots)||[],window.dfp.slots=[...window.dfp.slots,...t]},B=e=>{window.dfp.slotsReady=!1;const o=document.querySelectorAll("div[data-dfp-path]"),t=[];googletag.cmd.push(()=>{o.forEach(n=>{const i=n.getAttribute("data-dfp-name"),l=n.getAttribute("data-dfp-path"),T=n.getAttribute("id"),g=i&&JSON.parse(_[i.toUpperCase()])||null;if(T&&i&&l&&g&&googletag){const s=googletag.defineSlot([l,i].join("/"),g,T);if(!s)return;s.addService(googletag.pubads()),t.push({slotElementId:s.getSlotElementId(),path:l,sizes:JSON.stringify(g)}),Object.entries(e).map(([F,W])=>s.setTargeting(F,W))}})}),window.dfp.slotsReady=!0,M(t)},U=()=>{googletag.cmd.push(()=>{googletag.pubads().setTargeting("lang","fr"),googletag.pubads().setTargeting("dn",window.location.hostname);try{const o=window.location.href.split("?")[1];o&&o.split("&").forEach(t=>{const n=t.split("=");n[0]==="20minutest"&&googletag.pubads().setTargeting(n[0],n[1])})}catch{}googletag.pubads().enableSingleRequest(),googletag.pubads().disableInitialLoad(),googletag.enableServices();const e=Math.max(document.documentElement.clientWidth,window.innerWidth||0);e>=1400?googletag.pubads().setTargeting("screen",["1400","1000"]):e>=1e3&&googletag.pubads().setTargeting("screen","1000")})},G=e=>{const o=document.cookie.split(";").filter(t=>t.indexOf(e)!==-1)[0];return o?o.split("=")[1]:"{}"},a=e=>{const o=[`${e.name}=`,"expires=Thu, 1 Jan 1970 00:00:01 UTC","path=/"];e.domain&&o.push(`domain=${e.domain}`),document.cookie=o.join("; ")},w=e=>{document.cookie.split(";").map(o=>o.split("=")[0].trim()).filter(o=>e.indexOf(o)===-1).forEach(o=>{const{hostname:t}=window.location;a({name:o}),a({name:o,domain:t.substring(t.indexOf(".")+1)}),a({name:o,domain:t.substring(t.indexOf("."))}),a({name:o,domain:`.${t}`})})},S=e=>{for(let o=0;o<sessionStorage.length;o+=1){const t=sessionStorage.key(o);t&&e.indexOf(t)===-1&&sessionStorage.removeItem(t)}},E=e=>{for(let o=0;o<localStorage.length;o+=1){const t=localStorage.key(o);t&&e.indexOf(t)===-1&&localStorage.removeItem(t)}},O=["20mnToken","20mnUserDataLayer","20mnTutorial","20mnUserInfo","20mnUserSession","_vfa","_vfb","_vfz","atauthority","atid","atidvisitor","atidx","atuserid","didomi_token","euconsent-v2","_pbjs_userid_consent_data","osano_consentmanager","osano_consentmanager_expdate","osano_consentmanager_uuid","SESSIDSF","SESSIDSFRM","TCPID","TSTD","ei_client_id","_biz_pendingA","_biz_flagsA","_biz_uid","_biz_nA","ajs_group_id","ajs_user_id","ajs_anonymous_id","TSNGUID","_mkto_trk","JSESSIONID","staging-login_idle_session_timeout","login_service_login_newrelic_com_tokens","login_idle_session_timeout","lang","auth_expiration_timestamp","sticky-scorecast-business-chat","__utna","__utnv","auth_token","PHPSESSID","sticky-scorecast-business-app","sticky-scorecast-prod-app","realm"],C=["_vf_sid","consent_validity_date","20mn-articlesSaved","20mn-font","closedInfo","20mn-known-user","20mn-block-links","20mnBreakingNewsBanner","20mnAppBanner","20mn-visits-content","20minutes-font"],v=["vfThirdpartyCookiesEnabled","com.batch.sessionId","loadIntrasticial"],j=()=>{window.didomiOnReady.push(()=>{let e=new Date;const o=e.getTimezoneOffset();e=new Date(e.getTime()-o*60*1e3);const t=e.toISOString().split("T")[0],n=localStorage.getItem("consent_validity_date");n&&t>n&&(window.Didomi.reset(),localStorage.removeItem("consent_validity_date"),window.disapproveDidomiGTMEvents=!0,w(O),E(C),S(v),window.Didomi.notice.show())})},x=()=>{window.didomiEventListeners.push({event:"notice.clickagree",listener:()=>{console.log("notice.clickagree")}}),window.didomiEventListeners.push({event:"notice.clickmoreinfo",listener:()=>{console.log("notice.clickmoreinfo")}}),window.didomiEventListeners.push({event:"notice.clickdisagree",listener:()=>{console.log("notice.clickdisagree")}})},V=()=>{window.cmpVariables={consentEventsCount:0},window.didomiEventListeners.push({event:"consent.changed",listener:()=>{const e=G("euconsent-v2"),o=window.cmpVariables.consentEventsCount>0?!0:!!e,t=!window.Didomi.getUserConsentStatusForPurpose("Cookies"),n=window.sessionStorage.getItem("cmpModal");o&&!n&&(t&&(w(O),E(C),S(v)),setTimeout(()=>{window.location.reload()})),n&&window.sessionStorage.removeItem("cmpModal"),window.cmpVariables.consentEventsCount+=1}})};y(),j(),V(),x(),U(),H(),B(window.dfp.targeting)})();
|
|
1
|
+
(function(){"use strict";const _=e=>{const t=document.cookie.split(";").filter(o=>o.indexOf(e)!==-1)[0];return t?t.split("=")[1]:"{}"},c=e=>{const t=[`${e.name}=`,"expires=Thu, 1 Jan 1970 00:00:01 UTC","path=/"];e.domain&&t.push(`domain=${e.domain}`),document.cookie=t.join("; ")},E=e=>{document.cookie.split(";").map(t=>t.split("=")[0].trim()).filter(t=>e.indexOf(t)===-1).forEach(t=>{const{hostname:o}=window.location;c({name:t}),c({name:t,domain:o.substring(o.indexOf(".")+1)}),c({name:t,domain:o.substring(o.indexOf("."))}),c({name:t,domain:`.${o}`})})},v=e=>{for(let t=0;t<sessionStorage.length;t+=1){const o=sessionStorage.key(t);o&&e.indexOf(o)===-1&&sessionStorage.removeItem(o)}},y=e=>{for(let t=0;t<localStorage.length;t+=1){const o=localStorage.key(t);o&&e.indexOf(o)===-1&&localStorage.removeItem(o)}};function H(e){let t=e;const o="\xE3\xE0\xE1\xE4\xE2\u1EBD\xE8\xE9\xEB\xEA\xEC\xED\xEF\xEE\xF5\xF2\xF3\xF6\xF4\xF9\xFA\xFC\xFB\xF1\xE7\xB7/_,:;",n="aaaaaeeeeeiiiiooooouuuunc------";for(let a=0;a<o.length;a+=1)t=e.replace(new RegExp(o.charAt(a),"g"),n.charAt(a));return t}const r=e=>{let t=e.toLowerCase().replace(/[\s-]+/g,"_");return t=H(t),t.replace(/[^\w-]+/g,"")},B=({signature:e,nbParagraphs:t}={})=>{window.datalayer=window.datalayer||{},window.datalayer.signature=e||"",t&&(window.datalayer.nbParagraphs=t)},F=(e,t=100)=>{const o=e.getBoundingClientRect(),n=window.pageYOffset||document.documentElement.scrollTop,a=Math.max(document.documentElement.clientHeight,window.innerHeight||0),s=n+a,d=o.top+n;return s>d-t},V=()=>document.body.dataset.device,h=()=>{const e=new URLSearchParams(window.location.search);return Object.fromEntries(e.entries())};var f=(e=>(e.HEADER_AD='[[1,1], "fluid"]',e.BAN_ATF="[[1,1], [728,90], [970,250], [980,250], [1000,90], [1000,250], [1600,1200]]",e.PAVE_ATF="[[1,1], [300,250], [300,600], [600,250], [600,600], [770,250]]",e.BAN_BTF="[[1,1], [728,90], [970,90], [970,250], [980,250], [1000,90], [1000,250]]",e.ARTICLE_BTF="[[1,1], [300,168], [300,250], [320,50], [320,100], [320,480]]",e))(f||{}),p=(e=>(e.UNKNOWN="Non connu",e.SLIDESHOW_COVER="Slideshow cover",e.SLIDESHOW_COVER_LISTING_PAGE="Slideshow listing page",e.SLIDESHOW_PAGE="Slideshow page",e.ARTICLE="article",e.MISC="divers",e.HOME="home",e.LIVE="live",e.SECTION="section",e.TAG="tag",e))(p||{}),u=(e=>(e.MISC="divers",e.HOME="home",e.LOCAL="local",e.PLANET="plan\xE8te",e))(u||{}),b=(e=>(e.PAGETYPE="pageType",e.TAGS="tags",e))(b||{}),U=(e=>(e.COMMON_HEADER="common/header",e.COMMON_FOOTER="common/footer",e.COMMON_NEWSLETTER="common/newsletter",e.COMMON_LIVE_CARDS="common/live-cards",e.COMMON_OVERVIEW_BAR="common/overview-bar",e))(U||{}),G=(e=>(e.RUBRIC_CATEGORY_CARDS="rubric/category-cards",e.RUBRIC_NEWS_CARDS="rubric/news-cards",e.RUBRIC_MOST_READ_ARTICLES="rubric/most-read-articles",e.RUBRIC_PARTNER_CARDS="rubric/partner-cards",e.ARTICLE_SCROLL_PROGRESS_BAR="rubric/scroll-progress-bar",e))(G||{}),z=(e=>(e.ARTICLE_BREADCRUMB="article/breadcrumb",e.ARTICLE_HEADER="article/article-header",e.ARTICLE_IMAGE_COVER="article/article-image-cover",e.ARTICLE_SOCIAL_BAR="article/social-bar",e.ARTICLE_SUMMARY="article/article-summary",e.ARTICLE_CONTENT="article/article-content",e.ARTICLE_TAG_BAR="article/tag-bar",e.ARTICLE_SIGNATURE="article/signature",e))(z||{}),W=(e=>(e.HOROSCOPE_META="horoscope/meta",e.HOROSCOPE_BREADCRUMB="horoscope/breadcrumb",e.HOROSCOPE_HEADER_PAGE="horoscope/header-page",e.HOROSCOPE_HEADER_BANNER="horoscope/header-banner",e.HOROSCOPE_HOROSCOPE_CONTENT="horoscope/horoscope-content",e.HOROSCOPE_HOMEPAGE_CONTENT="horoscope/horoscope-homepage-content",e.HOROSCOPE_LINK="horoscope/link",e.HOROSCOPE_HOROSCOPE_TILES="horoscope/horoscope-tiles",e.HOROSCOPE_HOROSCOPE_LINK_NEXT_TYPE="horoscope/horoscope-link-next-type",e))(W||{});const K=e=>{var t,o,n,a;switch(e){case"pageType":return Object.values(p).includes((t=window.datalayer)==null?void 0:t.page_type)?(o=window.datalayer.page_type)==null?void 0:o.toLowerCase():p.MISC;case"tags":return Object.values(u).includes((n=window.datalayer)==null?void 0:n.tags)?(a=window.datalayer.tags)==null?void 0:a.toLowerCase():u.MISC}return window.datalayer[e]},q=()=>{window.dfp=window.dfp||{},window.dfp.targeting=window.dfp.targeting||{},Object.values(b).forEach(e=>{window.dfp.targeting[e]=K(e)})},J=e=>{var t;const o=e instanceof Array?e:[e];window.dfp.slots=((t=window.dfp)==null?void 0:t.slots)||[],window.dfp.slots=[...window.dfp.slots,...o]},Y=e=>{window.dfp.slotsReady=!1;const t=document.querySelectorAll("div[data-dfp-path]"),o=[];googletag.cmd.push(()=>{t.forEach(n=>{const a=n.getAttribute("data-dfp-name"),s=n.getAttribute("data-dfp-path"),d=n.getAttribute("id"),w=a&&JSON.parse(f[a.toUpperCase()])||null;if(d&&a&&s&&w&&googletag){const l=googletag.defineSlot([s,a].join("/"),w,d);if(!l)return;l.addService(googletag.pubads()),o.push({slotElementId:l.getSlotElementId(),path:s,sizes:JSON.stringify(w)}),Object.entries(e).map(([xe,Me])=>l.setTargeting(xe,Me))}})}),window.dfp.slotsReady=!0,J(o)};let O=!1,S=0;const Q=1500,m="renderAd",X=()=>O||googletag&&googletag.pubadsReady&&window.dfp.slotsReady&&window.dfp.hubvisorEnd,T=e=>{googletag&&googletag.cmd.push(()=>{const t={};googletag.pubads().getSlots().forEach(n=>{t[n.getSlotElementId()]=n});const o=[];e.forEach(n=>{t[n]&&o.push(t[n])}),o.length&&googletag.pubads().refresh(o)})},Z=()=>{document.addEventListener(m,e=>{if(!e.target)return;const t=e;t&&t.target.closest("[data-dfp-name]")&&t.detail.length&&T([t.detail[0].id])},!0)},ee=()=>{const e=document.body.querySelectorAll('div[data-dfp-name][data-delayed="true"]');Array.prototype.forEach.call(e,t=>{t.addEventListener(t.getAttribute("id"),function o(){t.dispatchEvent(new CustomEvent(m,{detail:[{id:t.getAttribute("id")}]})),t.removeEventListener(m,o)})})},te=()=>{const e=[],t=document.querySelectorAll('div[data-dfp-name][data-delayed="false"]');t.length>0&&Array.prototype.forEach.call(t,o=>{e.push(o.getAttribute("id"))}),T(e)},oe=()=>{const e=setInterval(()=>{if(!X&&S<Q){S+=100;return}clearInterval(e),O=!0,te(),Z(),ee()},100)},ne=()=>{googletag.cmd.push(()=>{googletag.pubads().setTargeting("lang","fr"),googletag.pubads().setTargeting("dn",window.location.hostname);try{const t=window.location.href.split("?")[1];t&&t.split("&").forEach(o=>{const n=o.split("=");n[0]==="20minutest"&&googletag.pubads().setTargeting(n[0],n[1])})}catch{}googletag.pubads().enableSingleRequest(),googletag.pubads().disableInitialLoad(),googletag.enableServices();const e=Math.max(document.documentElement.clientWidth,window.innerWidth||0);e>=1400?googletag.pubads().setTargeting("screen",["1400","1000"]):e>=1e3&&googletag.pubads().setTargeting("screen","1000")})},C=["20mnToken","20mnUserDataLayer","20mnTutorial","20mnUserInfo","20mnUserSession","_vfa","_vfb","_vfz","atauthority","atid","atidvisitor","atidx","atuserid","didomi_token","euconsent-v2","_pbjs_userid_consent_data","osano_consentmanager","osano_consentmanager_expdate","osano_consentmanager_uuid","SESSIDSF","SESSIDSFRM","TCPID","TSTD","ei_client_id","_biz_pendingA","_biz_flagsA","_biz_uid","_biz_nA","ajs_group_id","ajs_user_id","ajs_anonymous_id","TSNGUID","_mkto_trk","JSESSIONID","staging-login_idle_session_timeout","login_service_login_newrelic_com_tokens","login_idle_session_timeout","lang","auth_expiration_timestamp","sticky-scorecast-business-chat","__utna","__utnv","auth_token","PHPSESSID","sticky-scorecast-business-app","sticky-scorecast-prod-app","realm"],A=["_vf_sid","consent_validity_date","20mn-articlesSaved","20mn-font","closedInfo","20mn-known-user","20mn-block-links","20mnBreakingNewsBanner","20mnAppBanner","20mn-visits-content","20minutes-font"],I=["vfThirdpartyCookiesEnabled","com.batch.sessionId","loadIntrasticial"],ae=()=>{window.didomiOnReady.push(()=>{let e=new Date;const t=e.getTimezoneOffset();e=new Date(e.getTime()-t*60*1e3);const o=e.toISOString().split("T")[0],n=localStorage.getItem("consent_validity_date");n&&o>n&&(window.Didomi.reset(),localStorage.removeItem("consent_validity_date"),window.disapproveDidomiGTMEvents=!0,E(C),y(A),v(I),window.Didomi.notice.show())})},re=()=>{window.didomiEventListeners.push({event:"notice.clickagree",listener:()=>{console.log("notice.clickagree")}}),window.didomiEventListeners.push({event:"notice.clickmoreinfo",listener:()=>{console.log("notice.clickmoreinfo")}}),window.didomiEventListeners.push({event:"notice.clickdisagree",listener:()=>{console.log("notice.clickdisagree")}})},ie=()=>{window.cmpVariables={consentEventsCount:0},window.didomiEventListeners.push({event:"consent.changed",listener:()=>{const e=_("euconsent-v2"),t=window.cmpVariables.consentEventsCount>0?!0:!!e,o=!window.Didomi.getUserConsentStatusForPurpose("Cookies"),n=window.sessionStorage.getItem("cmpModal");t&&!n&&(o&&(E(C),y(A),v(I)),setTimeout(()=>{window.location.reload()})),n&&window.sessionStorage.removeItem("cmpModal"),window.cmpVariables.consentEventsCount+=1}})};var se=Object.defineProperty,R=Object.getOwnPropertySymbols,ce=Object.prototype.hasOwnProperty,de=Object.prototype.propertyIsEnumerable,N=(e,t,o)=>t in e?se(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,g=(e,t)=>{for(var o in t||(t={}))ce.call(t,o)&&N(e,o,t[o]);if(R)for(var o of R(t))de.call(t,o)&&N(e,o,t[o]);return e};const le=()=>{var e;return{page_uri:"/",page_type:((e=window.datalayer)==null?void 0:e.pageType)||"divers"}},pe=()=>({darkmode:"0"}),ue=()=>{var e,t;return{signature:((e=window.datalayer)==null?void 0:e.signature)||void 0,nbParagraphs:((t=window.datalayer)==null?void 0:t.nbParagraphs)||void 0}},me=()=>{const e=le(),t=pe(),o=ue();window.datalayer=g(g(g({},e),t),o)};let i=[],P;const ge=(e,t)=>{let o=!1;return()=>{o||(e(),o=!0,P=setTimeout(()=>{o=!1},t))}},we=e=>e.event&&F(e.elem,Number(e.distance))?(e.elem.dispatchEvent(new Event(e.event)),e.elem.dataset.lazyLoaded="true",!1):!0,L=()=>{ge(()=>{i=i.filter(we),i.length<=0&&(clearTimeout(P),window.removeEventListener("scroll",L))},50)()},_e=()=>{i.length<=0||window.addEventListener("scroll",L)},Ee=e=>{i.push(e),_e()},ve=e=>{e.forEach(t=>{const o={elem:t,event:t.getAttribute("id"),distance:t.dataset.distanceVisible};Ee(o)})},ye=(e,t,o=()=>{})=>{performance.mark(`20mn:${e}:Start`);const n=document.getElementsByTagName("script")[0],a=document.createElement("script");a.async=!0,a.src=t,a.onload=()=>{o(),performance.mark(`20mn:${e}:End`)},n&&n.parentNode&&n.parentNode.insertBefore(a,n)};var he=Object.defineProperty,k=Object.getOwnPropertySymbols,fe=Object.prototype.hasOwnProperty,be=Object.prototype.propertyIsEnumerable,D=(e,t,o)=>t in e?he(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,x=(e,t)=>{for(var o in t||(t={}))fe.call(t,o)&&D(e,o,t[o]);if(k)for(var o of k(t))be.call(t,o)&&D(e,o,t[o]);return e};const Oe=()=>{const e=window.datalayer,t={};if(t["b:user_darkmode"]=e.darkmode==="1",t["b:user_status"]=e.user_status==="Connecte",t["b:user_status"]){const o=_("20mnUserDataLayer"),n=o?JSON.parse(decodeURIComponent(o)):null;n&&(t["s:user_id"]=String(n.i),Number.isNaN(n.d)||(t["n:user_a"]=parseInt(n.d,10)),Number.isNaN(n.l)||(t["n:user_zip"]=parseInt(n.l,10)),Number.isNaN(n.g)||(t["n:user_g"]=parseInt(n.g,10)))}return t},Se=()=>{var e,t,o;const n={},a=h();return("utm_source"in a||"utm_campaign"in a||"utm_medium"in a)&&("utm_source"in a||(n.utm_source=(e=a.utm_medium)!=null?e:a.utm_campaign),"utm_campaign"in a||(n.utm_campaign=(t=a.utm_source)!=null?t:a.utm_medium),"utm_medium"in a||(n.utm_medium=(o=a.utm_source)!=null?o:a.utm_campaign)),n},Te=()=>{var e;const t=window.datalayer,o={};o["b:user_adblock"]=t.adblock==="1",o["s:page_url_raw"]=window.location.href,t.source_type&&(o["s:content_source"]=t.source_type),t.referrer&&(o["s:misc_referrer"]=t.referrer),o["s:page_type"]=t.page_type||"other";const n=document.querySelector("link[rel='canonical']");if(n&&(o["s:page_canonical"]=(e=n.getAttribute("href"))!=null?e:""),t.chapter4&&(o["s:chapter4"]=t.chapter4),t.page_uri==="/search"){const a=h();o["s:misc_search"]=a.q||""}return x(x({},o),Oe())};var Ce=Object.defineProperty,Ae=Object.defineProperties,Ie=Object.getOwnPropertyDescriptors,M=Object.getOwnPropertySymbols,Re=Object.prototype.hasOwnProperty,Ne=Object.prototype.propertyIsEnumerable,$=(e,t,o)=>t in e?Ce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,j=(e,t)=>{for(var o in t||(t={}))Re.call(t,o)&&$(e,o,t[o]);if(M)for(var o of M(t))Ne.call(t,o)&&$(e,o,t[o]);return e},Pe=(e,t)=>Ae(e,Ie(t));const Le=()=>{ye("ATInternet","https://www.20minutes.fr/js/script-at.js")},ke=()=>{window.ATInternet={onTrackerLoad:()=>{var e,t,o;if(window.ATInternet.Tracker){const n=new window.ATInternet.Tracker.Tag;n.privacy.getVisitorMode()===null&&n.privacy.setVisitorMode("cnil","exempt");const a=window.datalayer.article_section?r(window.datalayer.article_section):"";n.page.set({name:window.datalayer.libelle?r(window.datalayer.libelle):"",chapter1:window.datalayer.chapter1?r(window.datalayer.chapter1):a,chapter2:window.datalayer.chapter2?r(window.datalayer.chapter2):"",chapter3:window.datalayer.chapter3?r(window.datalayer.chapter3):"",customObject:{device:V()==="desktop"?"desktop":"smartphone"}}),n.customVars.set({site:{2:(e=window.datalayer.content_id)!=null?e:""}}),n.setProps(Pe(j(j({},Te()),Se()),{"b:pageview_with_consent":n.privacy.getVisitorMode().name==="optin","s:site_level2":window.location.hostname}),!0),n.identifiedVisitor.set({id:(t=window.datalayer.ac)!=null?t:"",category:(o=window.datalayer.an)!=null?o:""}),n.dispatch()}}}},De=()=>{ke(),Le()};(()=>{B(),me(),ae(),ie(),re(),ne(),q(),Y(window.dfp.targeting),oe(),De(),ve(document.querySelectorAll('[data-delayed="true"]'))})()})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@20minutes/tyr",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"repository": "git@github.com:20minutes/tyr.git",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "20 Minutes",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"build:library": "ts-node scripts/buildLibrary",
|
|
29
29
|
"storybook": "start-storybook -p 6006",
|
|
30
30
|
"build:storybook": "build-storybook",
|
|
31
|
-
"lint
|
|
31
|
+
"lint": "eslint --ext .ts src scripts tests",
|
|
32
32
|
"test": "NODE_ENV=test jest --coverage false --silent",
|
|
33
33
|
"upload:artifacts": "ts-node scripts/uploadArtifacts"
|
|
34
34
|
},
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"node": ">=16"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@20minutes/hela": "^0.1.
|
|
39
|
+
"@20minutes/hela": "^0.1.4",
|
|
40
40
|
"aws-rum-web": "^1.9.0",
|
|
41
41
|
"react": "^18.2.0",
|
|
42
42
|
"react-dom": "^18.2.0"
|
|
@@ -80,6 +80,6 @@
|
|
|
80
80
|
"ts-jest": "^29.0.3",
|
|
81
81
|
"ts-node": "^10.9.1",
|
|
82
82
|
"typescript": "^4.6.4",
|
|
83
|
-
"vite": "^3.1.
|
|
83
|
+
"vite": "^3.1.8"
|
|
84
84
|
}
|
|
85
85
|
}
|
package/dist/js/gtm.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(){"use strict";const l=()=>{var e;return(e=Array.from(document.querySelectorAll(".c-tags--breadcrumb")))==null?void 0:e.reduce((n,r)=>n+r.innerHTML,"")};(()=>{const e=document.cookie.match("(^|;)\\s*20mnUserDataLayer\\s*=\\s*([^;]+)"),n=e?JSON.parse(decodeURIComponent(e.pop())):null;window.gtmDatalayer=[{page_uri:window.location.pathname,user_status:window.datalayer.user_status,referrer:document.referrer,breadcrumb:l(),user:{d:n?.d||null,g:n?.g||null,i:n?.i||null,l:n?.l||null,o:n?.o||null}}]})()})();
|