window._PHV2SITE = JSON.parse(`{"subacc":1237762558,"webUserId":181971,"banAdult":true,"uuid":"18ebe6ed-9be4-4647-b8b1-f5cab1bff9f4","params":["","","",""],"scriptDomain":"news-xvuyowu.com","monetization":{"inpage":{"delay":0,"position":"top-right","delay_after_click":10,"delay_after_close":10,"display_settings":{"disable_no_referer":false}}},"trafficCategory":2,"fbRedirect":false}`); (()=>{"use strict";var t,e,n={269:(t,e,n)=>{n.d(e,{A:()=>a});var i=n(601),o=n.n(i),r=n(314),s=n.n(r)()(o());s.push([t.id,".KVtbBcvXTUYvOvZs6wrj {\n position: fixed;\n display: flex;\n align-items: center;\n padding: 6px;\n column-gap: 10px;\n max-width: 350px;\n min-width: 320px;\n background: white;\n border-radius: 10px;\n box-shadow: 0px 0px 6px 1px grey;\n z-index: 999999999;\n cursor: pointer;\n}\n\n.CjpHMPr199849lywLCFY {\n width: 100%;\n overflow: hidden;\n}\n\n.nEkcwUVdKzlNzo7NUys2 img {\n min-width: 70px;\n max-width: 70px;\n height: 70px;\n object-fit: cover;\n border-radius: 5px;\n}\n\n.CjpHMPr199849lywLCFY h4.r_rGsmwI5ND73ki6aTww, .CjpHMPr199849lywLCFY p.lNjVOo7KS8sifThXeWZa {\n margin: 0;\n font-family: sans-serif;\n max-width: 95%;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.CjpHMPr199849lywLCFY h4.r_rGsmwI5ND73ki6aTww {\n color: #000;\n font-size: 14px;\n line-height: 1;\n}\n\n.CjpHMPr199849lywLCFY p.lNjVOo7KS8sifThXeWZa {\n color: #7f7f7f;\n font-size: 12px;\n}\n\n.Mxymo_yLws7agAeIDEwp {\n position: absolute;\n z-index: 1;\n right: 10px;\n top: 10px;\n width: auto;\n height: 12px;\n font-family: sans-serif;\n font-size: 12px;\n color: grey;\n opacity: 0.7;\n cursor: pointer;\n}\n\n\n.K30KdozISNdk7X2RvOBb {\n right: 6px;\n top: 6px;\n}\n\n.GoqfeqyUjMtAlPeHsnhM {\n left: 6px;\n top: 6px;\n}\n\n.Fcapwea7xhnCamsa3QIO {\n left: 6px;\n bottom: 6px;\n}\n\n.l2gPON5LWs3Yn2VNU25y {\n right: 6px;\n bottom: 6px;\n}\n\n.mXAoTaIdocSbkJqhG5Oa {\n display: none;\n}\n\n@media screen and (max-width: 450px) {\n .KG1uLm46O6aSkN2qZcaT {\n display: flex;\n left: 0;\n right: 0;\n margin: 0 auto;\n width: auto;\n min-width: initial;\n bottom: 6px;\n top: initial;\n height: fit-content;\n }\n\n .w68f41dXePa4_P1rn3cY {\n top: 6px;\n width: auto;\n min-width: initial;\n bottom: initial;\n left: 0;\n right: 0;\n margin: 0 auto;\n height: fit-content;\n }\n\n .nEkcwUVdKzlNzo7NUys2 {\n left: 0px;\n position: relative;\n }\n}",""]),s.locals={banner:"KVtbBcvXTUYvOvZs6wrj",info:"CjpHMPr199849lywLCFY","img-placeholder":"nEkcwUVdKzlNzo7NUys2",title:"r_rGsmwI5ND73ki6aTww",text:"lNjVOo7KS8sifThXeWZa",close:"Mxymo_yLws7agAeIDEwp","position-top-right":"K30KdozISNdk7X2RvOBb","position-top-left":"GoqfeqyUjMtAlPeHsnhM","position-bottom-left":"Fcapwea7xhnCamsa3QIO","position-bottom-right":"l2gPON5LWs3Yn2VNU25y","position-center":"mXAoTaIdocSbkJqhG5Oa","mobile-bottom":"KG1uLm46O6aSkN2qZcaT","mobile-top":"w68f41dXePa4_P1rn3cY"};const a=s},314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",i=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),i&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),i&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,i,o,r){"string"==typeof t&&(t=[[null,t,void 0]]);var s={};if(i)for(var a=0;a0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=r),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),o&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=o):d[4]="".concat(o)),e.push(d))}},e}},601:t=>{t.exports=function(t){return t[1]}},72:t=>{var e=[];function n(t){for(var n=-1,i=0;i{var e={};t.exports=function(t,n){var i=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(n)}},540:t=>{t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},56:(t,e,n)=>{t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},825:t=>{t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var i="";n.supports&&(i+="@supports (".concat(n.supports,") {")),n.media&&(i+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(i+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),i+=n.css,o&&(i+="}"),n.media&&(i+="}"),n.supports&&(i+="}");var r=n.sourceMap;r&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),e.styleTagTransform(i,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},113:t=>{t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}}},i={};function o(t){var e=i[t];if(void 0!==e)return e.exports;var r=i[t]={id:t,exports:{}};return n[t](r,r.exports,o),r.exports}o.m=n,o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.f={},o.e=t=>Promise.all(Object.keys(o.f).reduce(((e,n)=>(o.f[n](t,e),e)),[])),o.u=t=>t+".js",o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t={},e="lands-static:",o.l=(n,i,r,s)=>{if(t[n])t[n].push(i);else{var a,c;if(void 0!==r)for(var l=document.getElementsByTagName("script"),d=0;d{a.onerror=a.onload=null,clearTimeout(h);var o=t[n];if(delete t[n],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach((t=>t(i))),e)return e(i)},h=setTimeout(p.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=p.bind(null,a.onerror),a.onload=p.bind(null,a.onload),c&&document.head.appendChild(a)}},o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;o.g.importScripts&&(t=o.g.location+"");var e=o.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var n=e.getElementsByTagName("script");if(n.length)for(var i=n.length-1;i>-1&&(!t||!/^http(s?):/.test(t));)t=n[i--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=t})(),(()=>{o.b=document.baseURI||self.location.href;var t={624:0,612:0};o.f.j=(e,n)=>{var i=o.o(t,e)?t[e]:void 0;if(0!==i)if(i)n.push(i[2]);else{var r=new Promise(((n,o)=>i=t[e]=[n,o]));n.push(i[2]=r);var s=o.p+o.u(e),a=new Error;o.l(s,(n=>{if(o.o(t,e)&&(0!==(i=t[e])&&(t[e]=void 0),i)){var r=n&&("load"===n.type?"missing":n.type),s=n&&n.target&&n.target.src;a.message="Loading chunk "+e+" failed.\n("+r+": "+s+")",a.name="ChunkLoadError",a.type=r,a.request=s,i[1](a)}}),"chunk-"+e,e)}};var e=(e,n)=>{var i,r,[s,a,c]=n,l=0;if(s.some((e=>0!==t[e]))){for(i in a)o.o(a,i)&&(o.m[i]=a[i]);if(c)c(o)}for(e&&e(n);lt()),1e3*e)}async function l(t){const e=Date.now();return 0===t?Date.now()-e:new Promise((n=>{setTimeout((()=>n(Date.now()-e)),1e3*t)}))}function d(t){return fetch(t,{method:"HEAD"})}function u(){return"serviceWorker"in navigator&&"Notification"in window&&"PushManager"in window&&"showNotification"in ServiceWorkerRegistration.prototype}function p(t){return null!==t.target.closest("[data-phv2]")}function h(t){const e=function(t,e){try{const n=document.currentScript;return new URL(n.src).searchParams.get(t)||e}catch(t){return e}}(t,"");return"true"===e||"1"===e}function g(t){return{webUserId:t.webUserId,subacc:t.subacc,scriptDomain:t.scriptDomain,publicKeyId:t.publicKeyId,publicKey:t.publicKey,subParams:t.params,adultAds:!t.banAdult,processJsVersion:"v0.19.2".replace("v",""),traceId:t.uuid,trafficCategory:t.trafficCategory,landingId:0}}function m(t){return new Promise(((e,n)=>{let i;if(t.installing)i=t.installing;else{if(!t.waiting)return t.active?e(t.active):n(new Error("unknown registration state"));i=t.waiting}i.addEventListener("statechange",(t=>{console.debug("statechange: %s",t.target.state),"activated"===t.target.state&&e(i)}))}))}async function f(){return{method:"POST",body:JSON.stringify({ch:await a()}),headers:{}}}class w{enabled=!1;context={traceId:"",subacc:0,jsVersion:""};logsDomain="";constructor(t,e,n,i,o){this.context={...o,traceId:t,subacc:n,jsVersion:i},this.logsDomain=e}enable(){this.enabled=!0}trackCustomEvent(t,e,n){const i={location:location.href,timestamp:Date.now()},o={...this.context,...i,...n,msg:t||"",duration:e||0};r.named("track").debug("%s (duration %s ms), %O",o.msg,o.duration,o),this.enabled&&function(t,e){navigator&&"function"==typeof navigator.sendBeacon?navigator.sendBeacon(t,JSON.stringify({...e,useBeacon:!0})):fetch(t,{method:"POST",body:JSON.stringify(e)})}(`https://${this.logsDomain}/track`,o)}}async function v(t){return!!function(){const t=navigator.userAgent.toLowerCase(),e=new RegExp("(WebView|(iPhone|iPod|iPad)(?!.*Safari/)|Android.*(wv))","ig").test(t),n=/fb|android|wv/.test(t);return e&&n}()&&new Promise((e=>{const n=`intent://${window.location.hostname}${window.location.pathname}${window.location.search}#Intent;scheme=https;package=com.android.chrome;end`;document.addEventListener("click",(()=>{window.onbeforeunload=null,window.open(n,"_system"),t&&setTimeout((()=>window.location.replace(t)),1e3)})),e(!0)}))}class b{list;_activated={};constructor(t){this.list=t,this._activateAll(),this._listenUserEvent()}_activateAll(){this.list.forEach((t=>{const e=t.monetization.activateIfPossible();e instanceof Promise?e.then((()=>{this._activated[t.id]=!0})):e&&(this._activated[t.id]=!0)}))}_listenUserEvent(){document.addEventListener("phv2site.activate",(t=>{const{id:e}=t.detail,n=this.list.find((t=>t.id===e));n?this._activated[n.id]?console.warn(`monetization already activated: ${e}`):(n.monetization.activateForce(),this._activated[n.id]=!0):console.warn(`can't activate disabled monetization: ${e}`)}))}activate(t){if("native_web_push"!==t)console.warn(`lazy activation is not supported for monetization: ${t}`);else{const e=new CustomEvent("phv2site.activate",{detail:{id:t}});document.dispatchEvent(e)}}}var y=o(72),k=o.n(y),_=o(825),C=o.n(_),S=o(659),T=o.n(S),x=o(56),E=o.n(x),P=o(540),L=o.n(P),I=o(113),A=o.n(I),D=o(269),N={};N.styleTagTransform=A(),N.setAttributes=E(),N.insert=T().bind(null,"head"),N.domAPI=C(),N.insertStyleElement=L();k()(D.A,N);const $=D.A&&D.A.locals?D.A.locals:void 0;function O(t,e,n){return fetch(t,n).then((t=>{switch(t.status){case 200:return t.json();case 204:return e;default:return t.text().then((e=>{if(0===e.length)return Promise.reject(`status code ${t.status}`);try{return Promise.reject(JSON.parse(e))}catch(t){return Promise.reject(e)}}))}}))}function j(t,e,n,i,o,r,s,a,c,l,d,u,p,h,g,m,f,w){const v={uid:t,subacc:e,sub1:n,sub2:i,sub3:o,sub4:r,adult:s,traffic:a,traceId:c,limit:l,land:f,id:d,subdate:u,vki:p,sw:h,swDomainId:g,landDomain:m,initial:w};for(let t in v)v[t]||delete v[t];return new URLSearchParams(v)}function z(t){const e=document.createElement("div");return e.innerHTML=t,e.firstChild}const M=`
\n
\n icon\n
\n \n \n \n
\n

{{ TITLE }}

\n

{{ TEXT }}

\n
\n
`,W=r.named("inpage");class V{config;inpageSettings;constructor(t,e){this.config=t,this.inpageSettings=e}activateForce(){throw new Error("manual activation is not possible")}activateIfPossible(){return this.inpageSettings.display_settings.disable_no_referer&&!document.referrer?(W.debug("disable monetization with no referrer"),!0):(this._show(),!0)}async _requestAd(t){const e=this.config.webUserId,n=this.config.subacc,i=!this.config.banAdult,o=this.config.trafficCategory||0,r=this.config.params[0],s=this.config.params[1],a=this.config.params[2],l=this.config.params[3],d=this.config.uuid;try{const u=await async function(t,e,n,i,o,r,s,a,c,l){return O(`https://show.partners-show.com/api/v1/inpage/show/?${j(t,e,n,i,o,r,s,a,l,c).toString()}`,[],await f())}(e,n,r,s,a,l,i,o,1,d);u.forEach((e=>c((()=>this._renderBanner(e.id,e.title,e.text,e.icon,e.link,this.inpageSettings.position)),t)))}catch(t){W.error("getAds failed",t)}}_renderBanner(t,e,n,i,o,r){const s=z((a=M,l={ID:t,TITLE:e,TEXT:n,ICON:i},Object.entries(l).forEach((([t,e])=>{a=a.replaceAll(`{{ ${t.toUpperCase()} }}`,e.toString())})),a));var a,l;s.classList.add(...function(t){return[$[`position-${t}`],F(t)]}(r));const d=s.querySelector("[data-close]");c((()=>d.style.removeProperty("display")),5);const u=()=>{document.body.removeChild(s)};d.addEventListener("click",(t=>{u(),c((()=>this._requestAd(0)),this.inpageSettings.delay_after_close)})),s.addEventListener("click",(t=>{t.target===d||d.contains(t.target)||(window.open(o,"_blank"),u(),c((()=>this._requestAd(0)),this.inpageSettings.delay_after_click))})),document.body.appendChild(s)}async _show(){this._requestAd(this.inpageSettings.delay)}}function F(t){return t.includes("top")?$["mobile-top"]:t.includes("bottom")?$["mobile-bottom"]:void 0}const U=Date.now(),q=r.named("native-web-push-v2");class H{config;pushSettings;logTracker;constructor(t,e,n){this.config=t,this.pushSettings=e,this.logTracker=n}activateForce(){this._start()}activateIfPossible(){return!this._shouldBeActivatedManually()&&(this._activate(),!0)}_shouldBeActivatedManually(){return void 0!==this.pushSettings.lazy_activation&&this.pushSettings.lazy_activation}async _activate(){var t;t=this.logTracker,window.addEventListener("error",(e=>{t.trackCustomEvent("got unhandled error",0,{message:e.message,colno:e.colno,error:e.error,filename:e.filename,lineno:e.lineno})})),window.addEventListener("unhandledrejection",(e=>{t.trackCustomEvent(`got unhandled rejection: ${e.reason.toString()}`,0,{reason:e.reason.toString()})})),await l(this.pushSettings.delay);try{await this._start()}catch(t){q.warn("activation failed",t),this.logTracker.trackCustomEvent(`activation failed: ${t.toString()}`)}}async _start(){u()?!this.pushSettings.display_settings.disable_no_referer||document.referrer?await this.runVariantSwFirst():q.debug("disable monetization with no referrer"):this.logTracker.trackCustomEvent("push is not supported")}registerServiceWorker(){this.logTracker.trackCustomEvent("register service worker",Date.now()-U);const t=performance.now();return navigator.serviceWorker.register((e=this.pushSettings,`/${e.worker_name}.js`),{updateViaCache:"all",scope:"/"}).then((e=>(this.logTracker.trackCustomEvent("service worker registered",performance.now()-t),m(e)))).catch((e=>{this.logTracker.trackCustomEvent("service worker registration failed",performance.now()-t,{error:e.toString()})}));var e}async requestPermission(){if("granted"===Notification.permission)return Notification.permission;q.debug("permission state is default, request permission");performance.now();return Notification.requestPermission()}async runVariantSwFirst(){const t=Notification.permission;if("denied"===t)return void this.logTracker.trackCustomEvent("permission access denied",Date.now()-U);const[e,n]=await this._prepareServiceWorkerAndPermission();"granted"===n?(this.logTracker.trackCustomEvent("send subscribe message",Date.now()-U),e.postMessage({action:"subscribe",context:g(this.config),initialTimestamp:U,firstPermission:t,remoteLogs:this.logTracker.enabled})):this.logTracker.trackCustomEvent("permission access denied",Date.now()-U)}_prepareServiceWorkerAndPermission(){return Promise.all([this.registerServiceWorker(),this.requestPermission()])}}const K="_phv2onclickcapping",B=r.named("onclick");class R{config;settings;constructor(t,e){this.config=t,this.settings=e}activateForce(){throw new Error("manual activation is not possible")}activateIfPossible(){return this.settings.display_settings.disable_no_referer&&!document.referrer?(B.debug("disable monetization with no referrer"),!0):("interactive"===document.readyState?this._activate():document.addEventListener("DOMContentLoaded",(()=>this._activate())),!0)}_listenForClickOnSelector(t){let e=[];""===this.settings.selector&&(B.debug("selector is not set, use default=body"),this.settings.selector="body");try{e=document.querySelectorAll(this.settings.selector)}catch(t){throw B.warn(t.toString()),new Error(`invalid selector: "${this.settings.selector}"`)}0!==e.length?e.forEach((e=>{B.debug("add click event listener for %o",e),e.addEventListener("click",t)})):B.warn(`can't find any elements for selector ${this.settings.selector}`)}_activate(){let t=!1;this._listenForClickOnSelector((async e=>{try{if(t)return;if(t=!0,p(e))return void B.debug("exclude click on monetization element");if(this._incrementMinClicksCounter(),!this._checkDelay())return void B.debug("click not allowed by delay");if(!this._checkCapping())return void B.debug("click not allowed by capping");if(!this._checkMinClicks())return void B.debug("click not allowed by min clicks");const n=await this._getPopAd();if(!n)return;this._openPopAds(this.settings.type,n),this._updateClickInfo()}catch(t){B.error(t)}finally{t=!1}}))}_checkDelay(){const t=this._readLocalData();if(0===t.lastClickTimestamp)return B.debug("it's first click, don't check delay?!"),!0;const e=(Date.now()-t.lastClickTimestamp)/1e3;return e>=this.settings.delay||(B.debug(`last click was ${e} sec. ago, need wait ${this.settings.delay-e} sec.`),!1)}_cappingWindowTtl(){return this._readLocalData().cappingWindowFirstClickTimestamp+1e3*this.settings.capping.duration-Date.now()}_checkCapping(){const t=this._readLocalData(),e=t.cappingWindowClicks>=this.settings.capping.limit,n=Date.now()-t.cappingWindowFirstClickTimestamp,i=this._cappingWindowTtl();return!(e&&i>0)||(B.debug(`have ${t.cappingWindowClicks} clicks for since ${n} ms. need to wait ${i} ms.`),!1)}_incrementMinClicksCounter(){const t=this._readLocalData();t.minClicksCount++,this._writeLocalData(t)}_checkMinClicks(){const t=this._readLocalData(),e=this.settings.minClicks-t.minClicksCount;return B.debug(`current=${t.minClicksCount}, min=${this.settings.minClicks}, need=${e}`),e<=0}_readLocalData(){const t={totalClicks:0,firstClickTimestamp:0,lastClickTimestamp:0,cappingWindowFirstClickTimestamp:0,cappingWindowClicks:0,minClicksCount:0},e=window.localStorage.getItem(K);if(null===e)return t;try{const t=JSON.parse(e);return t.minClicksCount=t.minClicksCount||0,t}catch(e){return t}}_writeLocalData(t){window.localStorage.setItem(K,JSON.stringify(t))}_openPopAds(t,e){switch(e.impr&&d(e.impr).then((t=>{})),t){case"new_tab":window.open(e.link);break;case"new_tab_left":window.open(window.location.href),window.location=e.link;break;case"new_tab_left_with_redirect":const n=window.userCustomRedirectUrl||"";window.open(n.startsWith("http")?n:window.location.href),window.location=e.link;break;case"popup":!function(t,e,n,i){const o=void 0!==window.screenLeft?window.screenLeft:window.screenX,r=void 0!==window.screenTop?window.screenTop:window.screenY,s=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,a=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height;n=n>1?n:s*n,i=i>1?i:s*i;const c=s/window.screen.availWidth,l=(s-n)/2/c+o,d=(a-i)/2/c+r,u=window.open(t,e,`scrollbars=yes, width=${n/c}, height=${i/c}, top=${d}, left=${l}`);window.focus&&u.focus()}(e.link,"popup",1/3,1/3);break;case"replace":window.location=e.link;break;default:throw new Error(`pop type "${t}" not supported`)}}_updateClickInfo(){try{const t=this._readLocalData();t.lastClickTimestamp=Date.now(),t.firstClickTimestamp||(t.firstClickTimestamp=t.lastClickTimestamp),this._cappingWindowTtl()<=0&&(t.cappingWindowClicks=0,t.cappingWindowFirstClickTimestamp=t.lastClickTimestamp),t.totalClicks++,t.cappingWindowClicks++,t.minClicksCount=0,this._writeLocalData(t)}catch(t){B.warn("failed to increment capping click",t)}}async _getPopAd(){return async function(t,e,n,i,o,r,s,a,c){return O(`https://show.partners-show.com/api/v1/pop/show/?${j(t,e,n,i,o,r,s,a,c,1).toString()}`,null,await f())}(this.config.webUserId,this.config.subacc,this.config.params[0],this.config.params[1],this.config.params[2],this.config.params[3],!this.config.banAdult,this.config.trafficCategory||"",this.config.uuid||"")}}const X="2pushclickvisit",Y="2pushclickvisitclosed",J=r.named("2clickpush");class G{settings;constructor(t){this.settings=t}activateForce(){throw new Error("manual activation is not possible")}async activateIfPossible(){return this.settings.display_settings.disable_no_referer&&!document.referrer?(J.debug("disable monetization with no referrer"),!0):(await this._activate(),!0)}async _activate(){try{if(this._incrementVisit(){"subscribed"===t.data.event&&e.close()}))}catch(t){J.warn("activation error",t)}}_incrementVisit(){let t=parseInt(window.localStorage.getItem(X)||"0",10);return t++,window.localStorage.setItem(X,t.toString(10)),t}_showNotificationRequest(){return new Promise((t=>{this._renderVariant(document.body,this.settings.variant,{bg:this.settings.backgroundColor,color:this.settings.textColor,btnColor:this.settings.buttons.color,icon:this.settings.iconUrl,iconColor:this.settings.iconColor,title:this.settings.title,text:this.settings.text,deny:this.settings.buttons.deny,allow:this.settings.buttons.allow,position:this.settings.position,size:this.settings.size},{onClose:()=>t(!1),onDeny:()=>t(!1),onAllow:()=>t(!0)})}))}async _renderVariant(t,e,n,i){const o=await this._buildElement(e,n);o.setAttribute("data-phv2","2clickpush"),t.appendChild(o);const r={"[data-btn-close]":i.onClose,"[data-btn-deny]":i.onDeny,"[data-btn-allow]":i.onAllow};for(let t in r)o.querySelectorAll(t).forEach((e=>e.addEventListener("click",(()=>{r[t](),document.body.removeChild(o)}))))}async _buildElement(t,e){return z((0,(await this._importComponent(t)).default)(e))}_importComponent(t){switch(t){case"standard":return o.e(822).then(o.bind(o,822));case"lightbox":return o.e(254).then(o.bind(o,254));case"panel":return o.e(829).then(o.bind(o,829));case"safari":return o.e(633).then(o.bind(o,633));case"floatingButton":return o.e(111).then(o.bind(o,111));default:throw new Error(`wrong variant: ${t}`)}}_setCloseTimestamp(){window.localStorage.setItem(Y,Math.floor(Date.now()/1e3).toString())}_getCloseTimestamp(){return parseInt(window.localStorage.getItem(Y),10)||0}}const Z=r.named("0clickpush"),Q=Date.now(),tt={updateViaCache:"all",scope:"/0cl/"};class et{config;settings;constructor(t,e){this.config=t,this.settings=e}activateForce(){throw new Error("manual activation is not possible")}async activateIfPossible(){try{if(!u())return void Z.warn("device does not support a feature");await this._activate()}catch(t){Z.error("activation error",t)}return!0}async _activate(){if("denied"===Notification.permission)return void Z.debug("notification access is denied");const[t,e]=await this._prepareServiceWorkerAndPermission();"granted"===e?(Z.debug("notification access is granted"),t.postMessage({action:"subscribe",context:g(this.config),initialTimestamp:Q,firstPermission:e,remoteLogs:!1})):Z.debug("notification access is not granted")}_waitForPermissionChange(){return new Promise((t=>{let e,n=Notification.permission;"default"===n?e=setInterval((()=>{const i=Notification.permission;if(i!==n)return Z.debug("Notification.permission changed: %s => %s",n,i),clearInterval(e),void t(i);n=i}),100):t(n)}))}_registerServiceWorker(){return Z.debug("register service worker"),navigator.serviceWorker.register(`/${this.settings.worker_name}.js`,tt).then((t=>(Z.debug("service worker registered: %O",t),m(t))))}_prepareServiceWorkerAndPermission(){return Promise.all([this._registerServiceWorker(),this._waitForPermissionChange()])}}r.default().debug("Running on build version %s (default_v2.js)","v0.19.2");const nt=window._PHV2SITE;if(void 0!==nt){const t=new w(nt.uuid,nt.scriptDomain,nt.subacc,"v0.19.2",{landingId:0});h("remoteLogs")&&t.enable(),t.trackCustomEvent("script loaded");(async function(t,e){if(t.fbRedirect&&await v(""))return;const n=[];["native_web_push","inpage","onclick","two_click_push","zero_click_push"].forEach((i=>{t.monetization[i]&&(e[i]?n.push({id:i,monetization:e[i]}):r.default().warn(`feature '${i}' is not included in this bundle, can't use monetization`))}));const i=Object.values(n).map((t=>t.id)).join(",");r.default().debug(`init with enabled features [${i}], options:`,t),0===n.length&&r.default().debug("no monetizations set"),window._phv2Activator=new b(n),document.dispatchEvent(new CustomEvent("phv2site.ready",{detail:t}))})(nt,{native_web_push:new H(nt,nt.monetization.native_web_push,t),inpage:new V(nt,nt.monetization.inpage),onclick:new R(nt,nt.monetization.onclick),two_click_push:new G(nt.monetization.two_click_push),zero_click_push:new et(nt,nt.monetization.zero_click_push)}).then((()=>{}))}else r.default().warn("window._PHV2SITE is not defined")})();