1import{i as _createClass,_ as __translate,E as getLocaleCountry,a as _asyncToGenerator,b as _regenerator,d as _objectSpread2,g as buildExternalId,j as _classCallCheck,k as _defineProperty,x as utmParams}from"../../scripts.bundle-Dfwqsvy1.min.js";var HotBonuses=function(){return _createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"hotBonusesHeader",document.querySelector('[data-element="hotBonusesHeader"]')),_defineProperty(this,"hotBonusesPopup",document.querySelector('[data-element="hotBonusesPopup"]')),_defineProperty(this,"hotBonusesPopupBody",document.querySelector('[data-element="hotBonusesPopupBody"]')),_defineProperty(this,"hotBonusesPopupPromo",document.querySelectorAll('[data-element="hotBonusesPopupPromo"]')),_defineProperty(this,"hotBonusesCards",document.querySelectorAll('[data-element="bonus_hot"]')),_defineProperty(this,"setAmplitudeParams",function(e,t,o){var n,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=["p_bonus_spin_n","p_bonus_amount","p_bonus_casino","p_bonus_category","p_bonus_country","p_bonus_percent","p_casino_category","p_casino_city","p_casino_country","p_casino_state_usa","p_casino_currency","p_casino_deposit_low","p_casino_payment","p_casino","p_casino_slot_soft","p_game_category","p_slot_category","p_slot","p_slot_payline","p_blog_category","p_blog_article","p_website_category","p_similar_casinos","p_software_bonuses","p_website_page","p_profile_rewards","p_profile_shop","p_home","p_promo_codes_category","p_other"],i=document.body.dataset.routeBonus,r=a.findIndex(function(e){return e===i}),u=r>-1?a[r]:a[a.length-1],c=document.location.href,d={page_url:JSON.stringify(document.location.origin+document.location.pathname),page_url_full:JSON.stringify(c),page_route_id:JSON.stringify(document.body.dataset.routeId),page_current_path:JSON.stringify(document.location.pathname),page_group:JSON.stringify(u),website_domain:JSON.stringify(document.location.hostname),website_country:JSON.stringify(document.body.dataset.geo)};null===(n=dataLayer)||void 0===n||n.push(Object.assign({event:"addEvents_".concat(e),event_id:"d-v1-e1",event_cat:t,event_name:o},d,utmParams(),s))})},[{key:"translate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return __translate(e,getLocaleCountry()||"en",t)||e}},{key:"init",value:function(){this.handleHeaderBtn(),this.handlePopupClose(),this.handlePopupBody(),this.handlePopupPromo(),this.handleAffClick(),this.handleExternalClose(),this.handleAdminPanel()}},{key:"show",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).elevated,t=void 0!==e&&e;this.hotBonusesPopup&&(this.hotBonusesPopup.classList.contains("show")||(t?this.hotBonusesPopup.classList.add("elevated"):document.body.classList.add("popupShown"),this.hotBonusesPopup.classList.add("show"),this.isAdminPanelShown()))}},{key:"hide",value:function(){if(this.hotBonusesPopup){var e=this.hotBonusesPopup.classList.contains("elevated");this.hotBonusesPopup.classList.remove("show"),this.hotBonusesPopup.classList.remove("elevated"),e||document.body.classList.remove("popupShown")}}},{key:"handleHeaderBtn",value:function(){var e=this;this.hotBonusesHeader&&this.hotBonusesHeader.addEventListener("click",function(t){t.stopPropagation(),e.hotBonusesPopup.classList.contains("show")?e.hide():(e.show(),setTimeout(function(){e.setAmplitudeParams("click","w_website_placement_hotOffer_header","view")},0))});var t=document.querySelector("#headerMobBtn");t&&t.addEventListener("click",function(){e.hotBonusesPopup.classList.contains("show")&&e.hide()})}},{key:"handlePopupClose",value:function(){var e=this;this.hotBonusesPopup&&this.hotBonusesPopup.addEventListener("click",function(t){t.stopPropagation(),e.hotBonusesPopup.classList.contains("show")&&e.hide()})}},{key:"handlePopupBody",value:function(){this.hotBonusesPopupBody&&this.hotBonusesPopupBody.addEventListener("click",function(e){e.stopPropagation()})}},{key:"copyText",value:function(e){return navigator.clipboard.writeText(e)}},{key:"handlePopupPromo",value:function(){var e=this;if(this.hotBonusesPopupPromo.length){var t=function(e){return new Promise(function(t){return setTimeout(t,e)})};this.hotBonusesPopupPromo.forEach(function(o){o.addEventListener("click",function(n){n.stopPropagation(),n.preventDefault();var s=o.dataset.code;if(s){var a=o.querySelector(".code");e.copyText(s).then(_asyncToGenerator(_regenerator().m(function o(){return _regenerator().w(function(o){for(;;)switch(o.n){case 0:if(!a){o.n=2;break}
1return a.innerHTML=e.translate("Copied!"),o.n=1,t(1500);case 1:a.innerHTML=s;case 2:return o.a(2)}},o)})))}})})}}},{key:"handleAffClick",value:function(){var e=this;this.hotBonusesCards.length&&this.hotBonusesCards.forEach(function(t,o){t.addEventListener("click",function(o){if(o.target.closest('a[href^="/redirect?"]')){o.stopPropagation();var n=storage.getPageAffLinkClickIndex();n++,storage.setPageAffLinkClickIndex(n);var s={casino_domain:JSON.stringify(t.dataset.domain),casino_bonus_id:JSON.stringify(t.dataset.id),casino_bonus_title_short:JSON.stringify(t.querySelector('[data-element="bonus_title"]').innerHTML),sponsored:JSON.stringify(!(!t.dataset.promo&&!t.dataset.hotOffer)),widget_id:JSON.stringify(56376),page_afflink_click_index:JSON.stringify(n)};setTimeout(_asyncToGenerator(_regenerator().m(function o(){var n;return _regenerator().w(function(o){for(;;)switch(o.n){case 0:return o.n=1,buildExternalId(t.dataset.id);case 1:n=o.v,e.setAmplitudeParams("clickAffLink","w_website_placement_hotOffer_header","casino_visit",_objectSpread2(_objectSpread2({},s),n?{external_id:JSON.stringify(n)}:{}));case 2:return o.a(2)}},o)})),0)}else;})})}},{key:"handleExternalClose",value:function(){var e=this;document.addEventListener("hotBonuses:hide",function(){return e.hide()})}},{key:"isAdminPanelShown",value:function(){var e=document.querySelector(".adminPanel");if(e&&!e.classList.contains("hidden")){var t=e.offsetHeight,o=document.querySelector(".header").offsetHeight;this.hotBonusesPopup.style.top="".concat(t+o,"px")}}},{key:"handleAdminPanel",value:function(){var e=this,t=document.querySelector(".adminPanel");t&&(t.querySelector(".hidePanel").addEventListener("click",function(){var t=document.querySelector(".header").offsetHeight;e.hotBonusesPopup.style.top="".concat(t,"px")}),t.querySelector(".panelShowBtn").addEventListener("click",function(){var o=t.offsetHeight,n=document.querySelector(".header").offsetHeight;e.hotBonusesPopup.style.top="".concat(o+n,"px")}))}}])}(),hotBonuses=new HotBonuses;export{hotBonuses};
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.