1import{fetchQuests}from"gamificationApi";import{centrifugeManager as questPopupCentrifugeManager}from"CentrifugeManager";import{authGamificationPopup}from"authGamificationPopup";import{getLocaleCountry as __quest_localeCountry,utmParams as utmParamsGamification}from"globals";import{getProfilePath}from"getProfilePath";import{updateCoinsBalance as updateCoinsBalancePopup}from"gamificationEvents";import{__translate as __quest_translate}from"translate";import{hotBonuses as questPopupHotBonuses}from"hotBonusesPopup";class QuestPopup{headerQuest=document.querySelector("#headerQuest");bodyQuest=document.querySelector("#bodyQuest");popup=document.querySelector("#questPopup");quests=[];questEventHandlers=this.createQuestEventHandlers();bodyQuestData=this.renderSkeleton;bodyQuestTitle=()=>{};bodyQuestCompletedBtn=()=>{};_bodyQuestHandlerAttached=!1;_bodyQuestClickAnalytics=null;initPromise=null;isInitialized=!1;translate(t,e=!1){return __quest_translate(t,__quest_localeCountry()||"en",e)||t}get hasIncompleteQuests(){return this.quests.some(({isCompleted:t})=>!t)}getCompletedQuestInsertIndex(t){return this.quests.findIndex(({isCompleted:e,displayOrder:s})=>e&&s>t.displayOrder)}moveQuestToCompletedSection(t,e){this.quests.splice(e,1);const s=this.getCompletedQuestInsertIndex(t);-1===s?this.quests.push(t):this.quests.splice(s,0,t)}isProfileUrl(){return document.location.pathname.includes("profile")}
1async init(){document.body.dataset.gamificationEnabled&&(this.initPromise=(async()=>{this.setInitialCoins(),this.handleOnHeaderCoinButtonClick(),this.handleOnExtraCoinsButtonClick(),this.renderBodyCoin(),await this.fetchQuests(),this.fetchQuestsBody(),this.handleOngoingQuest(),this.isInitialized=!0})(),await this.initPromise)}setInitialCoins(){const t=this.headerQuest.querySelector('[data-element="coins-balance"]');if(!storage.getRegisterCoinsEvent()&&!document.body.dataset.userId){t.innerHTML="20";const e=()=>{t.innerHTML="20",setTimeout(()=>{storage.setRegisterCoinsEvent(!0),updateCoinsBalancePopup({balanceChange:20})},3e3)},s=()=>{document.removeEventListener("click",i),document.removeEventListener("keydown",i),document.removeEventListener("pointerdown",i),document.removeEventListener("touchstart",i)},i=()=>{s(),e()};document.addEventListener("click",i,{once:!0,passive:!0}),document.addEventListener("keydown",i,{once:!0}),document.addEventListener("pointerdown",i,{once:!0,passive:!0}),document.addEventListener("touchstart",i,{once:!0,passive:!0})}}handleOnHeaderCoinButtonClick(){this.headerQuest.addEventListener("click",t=>{t.stopPropagation(),this.trackGamificationEvent("click","w_website_gamification_header_icon","open"),this.redirectToRewards()||this.showPopup()})}handleOnExtraCoinsButtonClick(){document.querySelector("#rewardsBtnDrawer")?.addEventListener("click",t=>{t.stopPropagation(),this.trackGamificationEvent("click","w_website_gamification_rewards","earnExtraCoins"),this.redirectToRewards()||this.showPopup()})}redirectToRewards(){const t=document.body.dataset.userId,e=document.location.pathname,s=`${getProfilePath()}/rewards`,i=t&&e!==s;return i&&(document.location.href=s),i}initBodyQuestClickHandler(){this._bodyQuestHandlerAttached||(this._bodyQuestHandlerAttached=!0,this.bodyQuest.addEventListener("click",t=>{t.stopPropagation(),this._bodyQuestClickAnalytics&&this._bodyQuestClickAnalytics(),this.showPopup()}))}renderBodyCoin(){this.isProfileUrl()||(this.bodyQuest.innerHTML='<img src="/build/midori/assets/icons/icons_264.svg#coin" alt="coin">',this.bodyQuest.classList.add("bodyQuest--show"),this._bodyQuestClickAnalytics=()=>this.trackGamificationEvent("click","w_website_gamification_coin_manager","open"),this.initBodyQuestClickHandler())}renderBodyTimer(t,e){this.bodyQuest.innerHTML=`\n\t\t\t<div class="bodyQuest--timer">\n\t\t\t\t<div class="countdown-timer">\n\t <svg class="timer-svg" viewBox="0 0 100 100">\n\t <defs>\n\t <linearGradient id="progressGradient" x1="0%" y1="0%" x2="0%" y2="100%">\n\t <stop offset="0%" stop-color="#FBF100" />\n\t <stop offset="100%" stop-color="#F6B600" />\n\t </linearGradient>\n\t </defs>\n\t <circle class="timer-bg" cx="50" cy="50" r="45"></circle>\n\t <circle class="timer-progress" cx="50" cy="50" r="45" stroke="url(#progressGradient)"></circle>\n\t </svg>\n\t <div class="timer-number" id="timer-number">${t}</div>\n\t </div>\n\t\t\t</div>\n\t\t`;const s=t;let i=s;const n=document.getElementById("timer-number"),o=document.querySelector(".timer-progress"),a=2*Math.PI*o.r.baseVal.value,r=()=>{n.textContent=i,o.style.strokeDashoffset=a*(1-i/s),i--,i<0&&(clearInterval(c),n.textContent="0",o.style.strokeDashoffset=a,e(),this.renderBodySuccess())};n.textContent=s,o.style.strokeDasharray=a,o.style.strokeDashoffset=0;const c=setInterval(r,1e3);r(),this.bodyQuest.classList.add("bodyQuest--show"),this._bodyQuestClickAnalytics=null,this.initBodyQuestClickHandler()}renderBodySuccess(){this.bodyQuest.innerHTML='<div class="bodyQuest--success">\n\t\t\t<svg width="44" height="44" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t\t <rect class="green-circle" x="2" y="2" width="40" height="40" rx="20" fill="#E4FFF1"/>\n\t\t <rect class="green-circle" x="2" y="2" width="40" height="40" rx="20" fill="url(#paint0_linear_2555_2174)"/>\n\t\t <rect class="green-circle" x="2" y="2" width="40" height="40" rx="20" stroke="url(#paint1_linear_2555_2174)" stroke-width="4"/>\n\t\t <path class="checkmark" d="M19.3748 26.4321L30.7491 14.8335L32.5 16.6175L19.3748 30.0002L11.5 21.9708L13.2497 20.1868L19.3748 26.4321Z" fill="white"/>\n\t\t <defs>\n\t\t <linearGradient id="paint0_linear_2555_2174" x1="-7.31511e-08" y1="29" x2="44" y2="16" gradientUnits="userSpaceOnUse">\n\t\t <stop stop-color="#04C478"/>\n\t\t <stop offset="1" stop-color="#5CF17C"/>\n\t\t </linearGradient>\n\t\t <linearGradient id="paint1_linear_2555_2174" x1="-7.31511e-08" y1="29" x2="44" y2="16" gradientUnits="userSpaceOnUse">\n\t\t <stop stop-color="#04C478"/>\n\t\t <stop offset="1" stop-color="#5CF17C"/>\n\t\t </linearGradient>
1\n\t\t </defs>\n\t\t</svg>\n\t\t</div>',this.bodyQuest.classList.add("bodyQuest--show"),this._bodyQuestClickAnalytics=null,this.initBodyQuestClickHandler()}async fetchQuests(){try{this.quests=await fetchQuests()}catch(t){this.quests=[]}}lockScroll(){let t=document.querySelector(".questPopup__scroll");t.addEventListener("touchstart",function(){let e=t.scrollTop,s=t.scrollHeight,i=t.clientHeight;0===e&&(t.scrollTop=1),e+i===s&&(t.scrollTop-=1)}),t.addEventListener("touchmove",function(e){t.scrollHeight<=t.clientHeight&&e.preventDefault()},{passive:!1})}async showPopup(){if(this.popup.innerHTML||this.renderPopup(),this.popup.classList.add("questPopup--show"),document.body.classList.add("popupShown"),document.body.addEventListener("click",this.hidePopup.bind(this),{once:!0}),this.renderQuestBody(),this.trackGamificationEvent("showBlock","w_website_gamification_drawer","open"),!this.isInitialized){if(await(this.initPromise||this.init()),!this.popup.classList.contains("questPopup--show"))return;this.renderQuestBody()}}renderQuestBody(){this.bodyQuestData(),this.bodyQuestTitle(),this.bodyQuestDescription(),this.bodyQuestCompletedBtn()}renderPopup(){const t=document.createElement("div");t.className="questPopup__block",t.append(this.renderClose(),this.renderCoin(),this.renderHeader(),this.renderScrollBlock()),t.addEventListener("click",t=>t.stopPropagation()),this.popup.append(t),this.lockScroll()}renderClose(){const t=document.createElement("div");t.className="questPopup__close";const e=document.createElement("button");return e.className="questPopup__close--btn",e.innerHTML="<span></span><span></span>",e.addEventListener("click",t=>{t.stopPropagation(),this.hidePopup()}),t.append(e),t}renderCoin(){const t=document.createElement("div");return t.className="questPopup__coin",t.innerHTML='<img src="/build/midori/assets/icons/icons_264.svg#coin" alt="" aria-hidden="true">',t}renderScrollBlock(){const t=document.createElement("div");return t.className="questPopup__scroll",t.append(this.renderBody()),t}renderHeader(){const t=document.createElement("div");return t.className="questPopup__header",t.innerHTML=`<p class="questPopup__title" data-element="questPopup__title">${this.translate("Daily Quests")}</p><p class="questPopup__descript"></p>`,t}renderBody(){const t=document.createElement("div");return t.className="questPopup__body",t}renderBodyQuests(){const t=document.querySelector(".questPopup__body");t&&(t.innerHTML="",0===this.quests.length&&(t.textContent=this.translate("No quests have been found :(")),this.renderQuestTabs(),this.quests.forEach(e=>{const s=this.renderQuest(e);s&&t.append(s)}),this.detectSpecialQuestInView())}renderTitleQuests(){const t=document.querySelector(".questPopup__title");t&&this.quests.length&&!this.hasIncompleteQuests&&t.classList.add("questPopup__title--done")}renderRewardsBtn(){const t=document.querySelector(".questPopup__body");if(!t)return;if(!this.quests.length||this.hasIncompleteQuests)return;if(t.querySelector('[data-element="questPopup-btn-rewards"]'))return;const e=document.createElement("a");e.href=`${getProfilePath()}/rewards`,e.innerHTML=this.translate("See rewards"),e.className="questPopup__btn--rewards",e.dataset.element="questPopup-btn-rewards",e.addEventListener("click",()=>{this.trackGamificationEvent("click","w_website_gamification_drawer","seeRewards")}),t.append(e)}renderQuest(t={}){let{id:e,type:s,event:i,isDispatchable:n,isClickable:o,completionPaths:a,redirectUrl:r,name:c,isCompleted:u}=t;const d=document.createElement("div");return d.className="questPopup__quest "+("special"===s?"questPopup__quest--special":""),d.dataset.id=e,d.dataset.type=s,d.dataset.isCompleted=u?"true":"false","sharedLinkVisited"===i?this.renderShareLinkQuest(d,t):this.renderDefaultQuest(d,t),o&&(d.classList.add("questPopup__quest--pointer"),this.handleQuestClick(d,{id:e,redirectUrl:r,completionPaths:a,event:i,isDispatchable:n,redirectBlank:true})),d}renderDefaultQuest(t,e){let{name:s,description:i,reward:n,isCompleted:o,isClickable:a,isProgressShown:r,progress:c,id:u}=e;const d=r?this.getProgressRender(c):"",l=r?this.getProgressStyle(c):"";let p=`<div class="questPopup__content">\n\t\t\t\t\t<p class="questPopup__content--title">${s}${d}</p>\n\t\t\t\t\t<p class="questPopup__content--descript">${i}</p>
1\n\t\t\t\t\t<p class="questPopup__content--reward--details">+ ${n} ${this.translate("coins")}</p>\n\t\t\t\t</div>`;t.innerHTML=`\n\t\t\t${p}\n\t\t\t${this.getQuestButton(a,o,l)}\n\t\t`}renderShareLinkQuest(t,e){const{name:s,description:i,reward:n,isCompleted:o,progress:{current:a,goal:r},redirectUrl:c}=e,u=o?this.translate("Daily limit hit. Earn more tomorrow!"):`<span>${a}</span> / ${r} ${this.translate("Visits today")}`;t.innerHTML=`\n\t\t\t<div class="questPopup__content" data-type="share">\n\t\t\t\t<p class="questPopup__label" data-text-before="${this.translate("Special quest")}"></p>\n\t\t\t\t<p class="questPopup__content--title questPopup__content--title--share">\n\t\t\t\t\t<img src="/build/midori/assets/icons/link.svg" alt="" aria-hidden="true">${s}\n\t\t\t\t</p>\n\t\t\t\t<p class="questPopup__content--descript questPopup__content--descript--share">${i}</p>\n\t\t\t\t<div class="questPopup__content--reward">\n\t\t\t\t\t${this.getCoinsIcon()}\n\t\t\t\t\t<p class="questPopup__content--reward--details">+ ${n/r} ${this.translate("coins for every click")}</p>\n\t\t\t\t</div>\n\t\t\t\t<div class="questPopup__content--link--wrapper">\n\t\t\t\t\t<input class="questPopup__content--link" type="text" disabled id="link-share" value="${c}" />\n\t\t\t\t\t<button class="questPopup__content--copy-btn" ${o?"disabled":""} title="${this.translate("Copy link")}">${this.translate("Copy link")}</button>\n\t\t\t\t</div>\n\t\t\t\t<p class="questPopup__content--progress-info">${u}</p>\n\t\t\t\t<progress value="${a}" max="${r}"></progress>\n\t\t\t</div>\n\t\t`,this.attachCopyButtonEvent(t)}getProgressRender(t){return`<span class="questPopup__content--progress">${t.current}/${t.goal}</span>`}getProgressStyle(t){const e=t.current/t.goal*100;return`linear-gradient(90deg, rgba(5,233,143,1) ${e}%, rgba(85,84,222,1) ${e}%, rgba(85,84,222,1) 100%)`}getQuestButton(t,e,s=""){if(!t&&!e)return"";return`\n <div class="questPopup__btn ${e?"questPopup__btn--done":"questPopup__btn--active"}" ${s?`style="background: ${s}"`:""}>\n <div class="questPopup__btn--bg">\n <svg>\n <use href="/build/midori/assets/icons/gamification.svg#${e?"check":"arrow"}"></use>\n </svg>\n </div>\n </div>\n `}createQuestEventHandlers(){return{wisepopsPollSubmitted:({event:t})=>{"function"==typeof wisepops&&wisepops("event",t),this.hidePopupWithAnimation()},hotOffersClicked:({event:t,isDispatchable:e})=>{e&&questPopupCentrifugeManager.publishCustomEvent(t),questPopupHotBonuses.show({elevated:!0})}}}handleQuestClick(t,e){t.addEventListener("click",t=>{if(t.stopPropagation(),this.handleRegistrationQuestClick(e.id))return;const s=this.questEventHandlers[e.event];if(s)return s(e);this.handleRedirectQuestClick(e)})}handleRegistrationQuestClick(t){return"register"===t&&(this.trackGamificationEvent("click","w_website_gamification_quest_registration","open"),storage.setRegistrationViaAmplitude("reg"),storage.setRegPlacement("gamification"),authGamificationPopup.generateHTMLAdapter("mainHTML"),this.hidePopupWithAnimation(),this.trackGamificationEvent("showBlock","w_website_gamification_registration_popup","open"),!0)}handleRedirectQuestClick({event:t,redirectUrl:e,completionPaths:s,isDispatchable:i,redirectBlank:n}){const o=e??this.getNextCompletionPath(s);i&&questPopupCentrifugeManager.publishCustomEvent(t),o&&(n?window.open(o,"_blank"):document.location.href=o)}attachCopyButtonEvent(t){const e=t.querySelector(".questPopup__content--copy-btn"),s=t.querySelector(".questPopup__content--link");let i=null;e.addEventListener("click",t=>{t.stopPropagation(),navigator.clipboard.writeText(s.value).then(()=>{clearTimeout(i),t.target.classList.add("questPopup__content--copy-btn--copied"),t.target.innerHTML=`${this.translate("Copied!")} <img src="/build/midori/assets/icons/gamification/check.svg" alt="" aria-hidden="true">`,i=setTimeout(()=>{t.target.classList.remove("questPopup__content--copy-btn--copied"),t.target.innerHTML=this.translate("Copy link")},3e3)}),this.trackGamificationEvent("click","w_website_gamification_drawer","share")})}getNextCompletionPath(t){const e=storage.getVisitedPathsExpiring();e&&Date.now()>e&&(storage.removeVisitedPaths(),storage.removeVisitedPathsExpiring());const s=new Set(JSON.parse(storage.getVisitedPaths()||"[]"));return t.find(t=>!s.has(t))}hidePopup(){this.popup.classList.remove("questPopup--show"),document.body.classList.remove("popupS
1hown")}hidePopupWithAnimation(){this.popup.classList.add("questPopup--hide"),setTimeout(()=>{this.popup.classList.remove("questPopup--show"),this.popup.classList.remove("questPopup--hide")},500)}updateQuest(t){const e=this.quests.findIndex(e=>e.id===t.id);if(-1===e)return;const s=this.quests[e],i=!s.isCompleted&&t.isCompleted,n={...s,...t,progress:{...s.progress,current:s.progress.current+1}};if(i)return this.moveQuestToCompletedSection(n,e),void this.renderBodyQuests();this.quests[e]=n;const o=this.popup.querySelector(`.questPopup__quest[data-id="${t.id}"]`);if(!o)return;const a=this.renderQuest(n);a?o.replaceWith(a):o.remove()}handleOngoingQuest(){const t=window.location.pathname,e=document.body.dataset.geo,s=document.body.dataset.siteDomain,i=new Set(JSON.parse(storage.getVisitedPaths()||"[]")),n=()=>{questPopupCentrifugeManager.publishCustomEvent("pageVisited",{path:t,geo:e,site:s}),i.add(t);const n=new Date,o=new Date(Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()+1,0,0,0)).getTime();storage.setVisitedPaths(JSON.stringify([...i])),storage.setVisitedPathsExpiring(o)},o=this.quests.find(({completionPaths:e})=>e.some(e=>!i.has(e)&&e===t));if(o){const{isTimerDisplayed:t,timerDuration:e}=o;t?this.renderBodyTimer(e,n):n()}}getSkeleton(){return'<div class="questPopup__skeleton">\n\t\t\t<div class="questPopup__skeleton--content">\n\t\t\t\t<div class="skeleton skeleton__line"></div>\n\t\t\t\t<div class="skeleton skeleton__line questPopup__skeleton--description"></div>\n\t\t\t</div>\n\t\t\t<div class="skeleton skeleton__circle"></div>\n\t\t</div>'}renderSkeleton(){const t=document.querySelector(".questPopup__body");t&&(t.innerHTML=Array.from({length:3},()=>this.getSkeleton()).join(""))}bodyQuestDescription(){const t=document.querySelector(".questPopup__descript");t&&(this.quests.length&&!this.hasIncompleteQuests?t.innerHTML=this.translate("Great job! Come back tomorrow for more coins"):t.innerHTML=this.translate("Earn coins - spend them on exclusive bonuses"))}renderQuestTabs(){if(document.querySelector(".questPopup__tabs"))return;if(!this.quests.some(({type:t})=>"special"===t))return;const t=document.createElement("div");t.className="questPopup__tabs",t.innerHTML=`\n\t\t\t<input class="questPopup__tab--input" type="radio" value="daily" id="tab_daily" name="quest_popup_tab" checked />\n\t\t\t<label class="questPopup__tab--label" for="tab_daily">${this.translate("Daily Quests")}</label>\n\t\t\t<input class="questPopup__tab--input" type="radio" value="special" id="tab_special" name="quest_popup_tab" />\n\t\t\t<label class="questPopup__tab--label ${this.getAdditionalTabLabelClassName()}" for="tab_special" data-new-label="${this.translate("New")}">${this.getCoinsIcon()} ${this.translate("Special Quests")}</label>\n\t\t`,t.querySelectorAll('input[name="quest_popup_tab"]').forEach(t=>{t.addEventListener("change",this.onTabChange.bind(this))}),document.querySelector(".questPopup__header").append(t)}onTabChange(t){const e=t.target.value,s=this.quests.find(({type:t,isCompleted:s})=>t===e&&!s),i=s?document.querySelector(`.questPopup__quest[data-id="${s.id}"]`):null;i?.scrollIntoView({block:"end",inline:"nearest"}),this.trackGamificationEvent("click","w_website_gamification_drawer",`${e}QuestToggle`)}getCoinsIcon(){return'\n\t\t\t<div class="questPopup__icon--coins">\n <img src="/build/midori/assets/icons/icons_264.svg#coin" alt="" aria-hidden="true">\n <img src="/build/midori/assets/icons/icons_264.svg#coin" alt="" aria-hidden="true">\n </div>\n\t\t'}getAdditionalTabLabelClassName(){return storage.getTabLabelHidden()?"":(storage.setTabLabelHidden(!0),"questPopup__tab--new-label")}coinAnimation(){const t=document.createElement("div");t.id="coinsAnimationBlock",t.className="coinsAnimationBlock";for(let e=1;e<=3;e++){let s=document.createElement("img");s.id=`coin_${e}`,s.src="/build/midori/assets/icons/icons_264.svg#coin",t.append(s)}this.bodyQuest.append(t);const e=(e,s)=>{let i=t.querySelector(`#${e}`),n=document.getElementById("headerQuest").querySelector("img"),o=n.getBoundingClientRect(),a=i.getBoundingClientRect();i.style.position="fixed",i.style.top=`${a.top}px`,i.style.right=`${a.right}px`,i.style.left=`${a.left}px`,setTimeout(()=>{i.style.top=o.top+(n.offsetHeight/2-i.offsetHeight/2)+12+"px",i.style.left=o.left+(n.offsetWidth/2-i.offsetWidth/2)+12+"px",i.style.width="20px",i.style.height="20px",i.style.minHeight="20px",i.style.minWidth="20px",i.style.opacity="0",i.style.transition="top 1s ease-in-out, left 1s ease-in-out, opacity 1.5s ease-in-out"},s)};e("coin_1",100),e("coin_2",200),e("coin_3",300),setTimeout(()=>{t.remove()},2e3)}questBadge(t=`ð¥ +10 ${this.translate("coins on your balance")}`){const e=document.createElement("div");let s;e.className="questBadge__wrapper";const i=document.querySelectorAll(".questBadge__wrapper");i.length&&(s=i[i.length-1].offsetTop+45,e.style.top=`${s}px`);const n=document.createElement("div");n.className="questBadge__block",n.innerHTML=t,e.append(n),document.body.append(e),setTimeout(()=>{n.classList.add("hide"),setTimeout(()=>{e.remove()},600)},2e3)}fetchQuestsBody(){this.bodyQuestData=this.renderBodyQuests,this.bodyQuestTitle=this.renderTitleQuests,this.bodyQuestCompletedBtn=this.renderRewardsBtn,this.renderBodyQuests(),this.renderTitleQuests(),this.renderRewardsBtn(),this.bodyQuestDescription()}trackGamificationEvent(t,e,s,i){setTimeout(()=>{this.setAmplitudeGamificationParams(t,e,s,i)},0)}setAmplitudeGamificationParams=(t,e,s,i)=>{const n=["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"],o=document.body.dataset.routeBonus,a=n.findIndex(t=>t===o),r=a>-1?n[a]:n[n.length-1],c={page_url:JSON.stringify(document.location.origin+document.location.pathname),page_current_path:JSON.stringify(document.location.pathname),page_group:JSON.stringify(r),website_domain:JSON.stringify(document.location.hostname),website_country:JSON.stringify(document.body.dataset.geo),user_id:JSON.stringify(storage.getAuthId()??null),reg_placement:JSON.stringify(storage.getRegPlacement()??"gamification")};let u={};i&&(u=i),dataLayer?.push(Object.assign({event:`addEvents_${t}`,event_id:"d-v1-e1",event_cat:e,event_name:s}
1,c,utmParamsGamification(),u))};detectSpecialQuestInView(){const t=document.querySelector(".questPopup__quest--special");if(!t)return;const e=new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&(this.trackGamificationEvent("showBlock","w_website_gamification_drawer","specialQuestView"),e.disconnect())})},{root:null,rootMargin:"0px",threshold:0});e.observe(t)}handleAllQuestsCompleted(){this.hasIncompleteQuests||(this.renderTitleQuests(),this.renderRewardsBtn(),this.bodyQuestDescription())}getSuccessMessage(t,e){return e?.casinoName?`<img src="/build/midori/assets/icons/icons_264.svg#star" alt="" aria-hidden="true" width="24" height="24">+${t} ${this.translate("coins for joining")} ${e.casinoName}`:`<span>ð¥</span> +${t} ${this.translate("coins added")}!`}}const questPopup=new QuestPopup;window.questPopup=questPopup,document.addEventListener("questUpdated",({detail:t})=>{questPopup.updateQuest(t.quest),questPopup.handleAllQuestsCompleted()}),document.addEventListener("balanceChanged",({detail:{newBalance:t,balanceChange:e,questDetails:s}})=>{if(e>0){questPopup.coinAnimation();const t=questPopup.getSuccessMessage(e,s);questPopup.questBadge(t)}}),document.addEventListener("questsPopupReturnElement",()=>{questPopup.showPopup()}),document.addEventListener("rewardsBtnDrawerShopPopup",()=>{questPopup.trackGamificationEvent("click","w_website_gamification_rewards","earnExtraCoins"),questPopup.showPopup()});export{questPopup};
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.