2 lines
14 KiB
JavaScript
2 lines
14 KiB
JavaScript
|
"use strict";(("undefined"!=typeof self?self:global).webpackChunkopen=("undefined"!=typeof self?self:global).webpackChunkopen||[]).push([[9694],{60130:(e,a,s)=>{s.r(a),s.d(a,{HptoContainer:()=>Ne,default:()=>we});var t=s(59496),r=s(61740),n=s(36844),c=s(25097),i=s(84875),l=s.n(i),d=s(40576),o=s(68262),h=s(41836),u=s(24558);const m="WiPggcPDzbwGxoxwLWFf",g="tqFRRnWu7DgTNKYlCl6x",x="MnW5SczTcbdFHxLZ_Z8j",j="kYeGiolqG6dym3vP3Sux",f="YZtgNJaLuYjhGWHuN2zN";var v=s(4637);const p=({children:e,fetchingState:a,isHptoShown:s})=>{const i=(0,n.W6)(h.R2),p=(0,r.v9)(o.W3),k=(0,r.I0)(),b=(0,t.useRef)(null);(0,t.useEffect)((()=>(b.current&&k((0,c.az)(b.current)),()=>{k((0,c.MJ)(i))})),[k,i]),(0,t.useEffect)((()=>{a===u.Y.FETCHED&&k((0,c.Fw)())}),[a,k]);const M=(0,t.useCallback)((e=>{k((0,c.lT)(e.message))}),[k]);return(0,v.jsx)(d.L,{onError:M,children:(0,v.jsx)("div",{"data-testid":"hpto-parent-container",className:l()(m,"contentSpacing",{[j]:!s,[g]:(a===u.Y.FAILED||!p)&&i}),children:(0,v.jsx)("div",{"data-testid":"test-htpo-ref",ref:b,className:l()(x,{[f]:a===u.Y.FETCHING&&i}),children:e})})})};var k=s(79475),b=s(835),M=s(3802),y=s(2831);const N="JRpZEVSn5LfbA9fwwOqQ",w=({isPremium:e})=>{const a=(0,r.I0)();return(0,v.jsx)("div",{className:N,children:e?(0,v.jsx)(k.D,{buttonSize:"sm",colorSet:"overMedia",onClick:()=>a((0,y.xG)()),children:M.ag.get("ad-formats.hideAnnouncements")}):(0,v.jsx)(b.V,{colorSet:"overMedia",children:M.ag.get("ad-formats.sponsored")})})},S="iVAZDcTm1XGjxwKlQisz",I="_I_1HMbDnNlNAaViEnbp",C=({isPremium:e,backgroundColor:a,backgroundImage:s,backgroundUrl:n,loaderFrame:i})=>{const l=(0,t.useRef)(null),[d,o]=(0,t.useState)(!1),h=(0,r.I0)();return(0,t.useEffect)((()=>{const e=()=>{o(!0),i.contentWindow?.postMessage({name:"fireHptoViewEvent"},"*")};return l&&l.current&&(i.style.display="",i.className=I,i.setAttribute("aria-hidden","true"),i.addEventListener("load",e),l.current.innerHTML="",l.current.insertBefore(i,l.current.firstChild)),()=>{i.removeEventListener("load",e)}}),[l,i]),(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("a",{draggable:!1,href:n,ref:l,className:S,onClick:()=>{n&&h((0,c.kh)("event_clicked"))},style:{backgroundColor:a,opacity:d?1:0,backgroundImage:d?`url(${s})`:"none",backgroundSize:"cover"}}),(0,v.jsx)(w,{isPremium:e})]})},V=({isPremium:e,backgroundColor:a,backgroundImage:s,backgroundUrl:n,bannerMode:i,html:l})=>{const d=(0,r.I0)(),[h,u]=(0,t.useState)(!1),m=(0,r.v9)(o.t4)?.media,g=l||m;return(0,t.useEffect)((()=>{if("html"===i){u(!0);const e=document.querySelectorAll('[data-testid="html-hpto-iframe"]')[0];e instanceof HTMLIFrameElement&&e.contentWindow?.postMessage({name:"fireHptoViewEvent"},"*")}}),[i]),(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("a",{draggable:!1,href:n||"",className:S,onClick:()=>{n&&d((0,c.kh)("event_clicked"))},style:{backgroundColor:a,backgroundImage:h?`url(${s})`:"none",backgroundSize:"cover"},children:(0,v.jsx)("iframe",{"data-testid":"html-hpto-iframe",className:I,srcDoc:g,scrolling:"no",marginWidth:0,marginHeight:0,style:{display:h?"":"none"},"aria-hidden":!0})}),(0,v.jsx)(w,{isPremium:e})]})},E="xXj7eFQ8SoDKYXy6L3E1",T="F68SsPm8lZFktQ1lWsQz",z=({isPremium:e,backgroundColor:a,backgroundImage:s,clickThroughUrl:n})=>{(0,t.useEffect)((()=>{if(!s)throw Error("[Image HPTO] Missing background image")}),[s]);const i=(0,r.I0)();return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("a",{draggable:!1,onClick:()=>{i((0,c.kh)("event_clicked"))},className:E,style:{backgroundColor:a},href:n,children:(0,v.jsx)("img",{draggable:!1,className:T,alt:"",src:s})}),(0,v.jsx)(w,{isPremium:e})]})};var F=s(50346),A=s(63082),P=s(35394),L=s(88513),H=s(14280),_=s(73769),J=s(88741),D=s(8646),Y=s(73444),R=s(762),O=s(84229),W=s(69812),B=s(66632),U=s(48607),K=s(95663);const q="x8e0kqJPS0bM4dVK7ESH",X="gZ2Nla3mdRREDCwybK6X",G="SChMe0Tert7lmc5jqH01",Q="AwF4EfqLOIJ2xO7CjHoX",Z="UlkNeRDFoia4UDWtrOr4",$="k_RKSQxa2u5_6KmcOoSw",ee="_mWmycP_WIvMNQdKoAFb",ae="O3UuqEx6ibrxyOJIdpdg",se="akCwgJVf4B4ep6KYwrk5",te="qXuAn7YYM9WSo4IaRS_X",re="bIA4qeTh_LSwQJuVxDzl",ne="ajr9pah2nj_5cXrAofU_",ce="gvn0k6QI7Yl_A0u46hKn",ie="obTnu
|
||
|
//# sourceMappingURL=home-hpto.js.map
|