1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5480],{50477:()=>{},55932:(e,t,n)=>{"use strict";n.d(t,{Nq:()=>r,U9:()=>o,UU:()=>a,h6:()=>c,jA:()=>l,pF:()=>i});let a="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOnsiaWQiOjAsInJvbGUiOiJpbnRlcm5hbCJ9LCJpYXQiOjE2NjczODA4ODEsImV4cCI6MzMxOTI3NTM2ODEsInR5cGUiOiJpbnRlcm5hbCJ9.DnvmqbpVR4B0_8J3sh0I2GoAcLsesgxQuqCrfSqpDZI",o="e3b48d171db26f950ba73e5d4506f79fa51f79cd61a91efbd144fd7e6506f26f",r="x-server-api",l="HKD9dsy3kK-3DS0kljsfKS-KJS232LS9LS-dsf934lMSIS3",c="x-next-cache",i="8lds9slf-fd8sk3ls-lk3lsfsjdls-3lj3lfds"},63676:(e,t,n)=>{"use strict";n.r(t),n.d(t,{gameScript:()=>i});var a=n(55932),o=n(60316),r=n.n(o);let l=n(21001);function c(e){e.touches.length>1&&e.preventDefault()}async function i(){document.title="Beer Memory Game | The Beer Store";let e=document.createElement("meta");e.name="description",e.content="Test your memory skills with a fun interactive memory game designed to entertain beer fans while offering a light, engaging experience.",document.head.appendChild(e);let t=document.querySelector("link[rel='canonical']");t||((t=document.createElement("link")).setAttribute("rel","canonical"),document.head.appendChild(t)),t.setAttribute("href",window.location.href.split("?")[0]),document.addEventListener("touchmove",c,{passive:!1});var n,o="https://ecommapi.thebeerstore.ca/game/",i="Bearer ".concat(a.UU),s=1,d=60,m=window.innerWidth<992,u=window.location.origin,y=window.location.href,p=!1,h=new URLSearchParams(null==(n=y.split("?")[1])?void 0:n.toLowerCase()).get("gametype"),v=await x("checkGameStatus?gameId=2");!1===v&&document.querySelectorAll("#game_button, #howPlay").forEach(e=>{e.style.pointerEvents="none",e.style.opacity=.6,e.textContent="Not Available"}),h="event"==h?h:"archive",document.querySelectorAll(".close, .playAgain").forEach(e=>{e.href=y});var g=0;if("event"===h){let e=document.querySelector(".rule_regulation");document.querySelector("#back").style.display="none",e.style.display="block",e.addEventListener("click",()=>{window.open(u+"/giveaway-contest/","_blank")})}function f(e){e.preventDefault()}document.getElementById("howtoplay").onclick=function(){document.querySelector(".memory_logo_box").style.display="none",document.querySelector(".how_to_play_intro").style.display="block",document.removeEventListener("touchmove",f,{passive:!1})},document.addEventListener("touchmove",f,{passive:!1});let b=0;function S(){var e=document.documentElement;e.style.setProperty("--doc-height","".concat(window.innerHeight,"px")),e.style.setProperty("--doc-width","".concat(window.innerWidth,"px")),w()}function f(e){e.preventDefault()}function E(){document.querySelectorAll(".container_main")[0].style.display="none",document.querySelectorAll(".container_main")[1].style.display="block",document.querySelectorAll(".container_main")[2].style.display="none",p=!0,v&&_()}function w(){let e=document.querySelectorAll(".cloud_img"),t=document.querySelectorAll(".bgImg"),n=document.querySelectorAll(".mainsection");for(let a=0;a<t.length;a++){let t=0;e[a].style.height="",n[a].style.height="",setTimeout(()=>{let e=document.querySelectorAll(".cloud_img"),n=document.querySelectorAll(".bgImg"),o=document.querySelectorAll(".mainsection"),r=n[a].offsetHeight,l=e[a].offsetHeight;t=r-l,e[a].style.height=(l-120)/r*100+"%",o[a].style.height=(t+120)/r*100+"%",o[a].style.marginTop="-10%";var c=document.querySelector(".loaderOne");c&&(c.style.display="none")},100)}}async function _(){var e,t=await x("memorygame/getcards"),n=0,a=[{id:t[0].id,beerMatches:0},{id:t[1].id,beerMatches:0},{id:t[2].id,beerMatches:0},{id:t[3].id,beerMatches:0},{id:t[4].id,beerMatches:0},{id:t[5].id,beerMatches:0}],o=[{className:"coloured-glass",bin:t[0].id,img:t[0].imageUrl},{className:"alumunium-cans",bin:t[1].id,img:t[1].imageUrl},{className:"alumunium-cans",bin:t[2].id,img:t[2].imageUrl},{className:"clear-glass",bin:t[3].id,img:t[3].imageUrl},{className:"others-material",bin:t[4].id,img:t[4].imageUrl},{className:"others-material",bin:t[5].id,img:t[5].imageUrl}],r=0;r=+!!m;var c=document.querySelectorAll("#gameLevel")[r],i=document.querySelectorAll("#score-value")[r],u=document.querySelectorAll("#timer-value")[r];u.textContent="1:00";let y=[];function p(e){for(var t,n,a=e.length;0!==a;){n=Math.floor(Math.random()*a),a-=1,t=e[a],e[a]=e[n],e[n]=t;var o=Math.floor(Math.random()*a);e.splice(o,0,e.splice(a,1)[0])}return e}function v(){let e=document.querySelectorAll(".card_container");e.forEach(function(e){e.style.pointerEvents="none"}),setTimeout(function(){e.forEach(function(e){e.style.pointerEvents="auto"})},1e3)}function b(e,t){var n,a;(n=document.createElement("h1")).textContent="+"+t,n.classList.add("popupScore"),document.body.appendChild(n),n.style.position="absolute",n.style.left=e.left+"px",n.style.top=e.top+"px",n.style.transform="scale(3)",n.style.backgroundColor="black",n.style.borderColor="#ffff",(a=document.getElementById("myAudioTwo")).volume=.1,a.play();let o=document.createElement("style");o.textContent="\n @keyframes popup {\n 0% {\n transform: scale(4);\n }\n 25% {\n transform: translate(-50%, -100%) scale(3);\n }\n 50% {\n transform: translate(-50%, -100%) scale(2);\n }\n 75% {\n transform: translate(-50%, -100%) scale(1);\n }\n 100% {\n transform: translate(-50%, -150%) scale(0);\n }\n }\n ",o.backgroundColor="green",document.head.appendChild(o),n.style.animation="popup 1s ease-out",setTimeout(()=>
1{n.remove(),document.querySelectorAll(".popupScore").forEach(e=>{e.remove()})},500)}function E(e){document.getElementById(e).style.display="none";let t=document.querySelectorAll(".tabs-nav li");if("tab-1"==e){var n=document.getElementById("tab-2");n.style.display="block",n.style.display="block",t[0].classList.add("Show"),t[1].classList.remove("Show")}else if("tab-2"==e){var n=document.getElementById("tab-1");n.style.display="block",n.style.display="block",t[1].classList.add("Show"),t[0].classList.remove("Show")}}function w(){var e=document.getElementById("fname").value.trim(),t=document.getElementById("lname").value.trim(),n=document.getElementById("email").value.trim(),o=document.getElementById("memory_subscribe_newsletter").checked;q({firstName:e,lastName:t,email:n,score:g,expireTime:l().utc(0).unix()+60,gameId:2,Issubscribe:o,tags:"event"===h?"MemoryGame-Event":"MemoryGame-Archive",source:"website",gameType:h,beerMatches:a}),document.querySelectorAll(".container_main")[0].style.display="none",document.querySelectorAll(".container_main")[1].style.display="none",document.querySelectorAll("#memoryForm")[0].style.display="none",document.querySelectorAll(".container_main")[2].style.display="block"}!function t(){var l,m=document.querySelector(".game_board_wrapper");m.innerHTML="";var S=p([...p(o),...p(o)]);for(let e=0;e<12;e++){var E=S[e],w=document.createElement("div");w.setAttribute("data-box",E.bin),w.className="card_container";var _=document.createElement("div");_.className="card";var x=document.createElement("div");x.className="card_back";var q=document.createElement("div");if(q.className="card_front kort2",q.style.backgroundImage="url(".concat(E.img,")"),_.appendChild(x),_.appendChild(q),w.appendChild(_),w){var C=document.querySelector(".loader");C&&(C.style.display="none")}m.appendChild(w)}(e=document.querySelectorAll(".card_container")).forEach((e,t)=>{"card_container"==e.className&&e.classList.add("active")}),setTimeout(()=>{document.querySelectorAll(".active").forEach(e=>{e.classList.remove("active")})},3e3),setTimeout(()=>{var e=setInterval(()=>{if("00:01"==u.textContent&&("event"===h&&(document.querySelector(".thankYou").textContent="Thank y
1ou for playing our Memory Game. Please complete the below details to be entered in our contest for a chance to win a $100 gift card to The Beer Store. Plus for Ice cold deals, exciting contests, beer infused recipes and the latest on all-things beer, straight to your inbox. Sign up for our weekly newsletter today!"),document.querySelector("#memoryForm").style.display="block",document.querySelector(".game_board_wrapper").style.zIndex=-1,document.removeEventListener("touchmove",f,{passive:!1})),0==d?(v(),clearInterval(e),u.classList.remove("scale-animation")):(--d<10?u.textContent="00:0"+d:u.textContent="00:"+d,d<11&&u.classList.add("scale-animation"),1==r&&(document.querySelectorAll("#gameLevel")[0].textContent=document.querySelectorAll("#gameLevel")[r].textContent,document.querySelectorAll("#score-value")[0].textContent=document.querySelectorAll("#score-value")[r].textContent,document.querySelectorAll("#timer-value")[0].textContent=document.querySelectorAll("#timer-value")[r].textContent)),6==n){clearInterval(e),document.querySelectorAll(".card_container").forEach(e=>{e.remove()}),n=0,i.textContent=g+=10;let a={left:window.innerWidth/2,top:window.innerHeight/2};setTimeout(()=>{b(a,parseInt(10))},500),setTimeout(()=>{c.classList.add("scale-animation"),setTimeout(function(){c.classList.remove("scale-animation")},500),t(),s+=1,u.classList.add("scale-animation"),i.classList.add("scale-animation"),setTimeout(()=>{u.classList.remove("scale-animation"),i.classList.remove("scale-animation")},500),c.textContent=s},1e3)}},1e3)},3e3),l=[],(e=document.querySelectorAll(".card_container")).forEach((t,o)=>{t.addEventListener("click",()=>{var o;let r;"card_container"==t.className&&(y.push(t.dataset.box),l.push(t),t.classList.add("active"),t.onclick=function(){return!1},2==y.length&&(v(),y[0]==y[1]?(r={left:(o=l)[0].getBoundingClientRect().x,top:o[0].getBoundingClientRect().y},i.innerText=g+=s,n+=1,e.forEach((e,t)=>{o.forEach((t,n)=>{e==t&&(setTimeout(()=>{b(r,s)},500),setTimeout(()=>{e.style.opacity="0"},1e3))})}),a.forEach((e,t)=>{l[0].dataset.box==e.id&&(a[t].beerMatches+=1)})):setTimeout(()=>{document.querySelectorAll(".active").forEach(e=>{e.classList.remove("active")})},1e3),y=[],l=[]))})})}(),S(),document.querySelectorAll(".tabs-nav li").forEach((e,t)=>{0==t?e.addEventListener("click",()=>E("tab-2")):e.addEventListener("click",()=>E("tab-1"))}),document.querySelector(".submit").addEventListener("click",function(){var e,t=document.getElementById("fname").value.trim();document.getElementById("lname").value.trim();var n=document.getElementById("email").value.trim(),a=document.getElementById("above_19").checked,o=document.getElementById("fnameError"),r=document.getElementById("lnameError"),l=document.getElementById("emailError"),c=document.getElementById("memory_subscribe_newsletter").checked;o.textContent="",r.textContent="",l.textContent="",document.getElementById("above_19_error").textContent="",""===t?o.textContent="Please enter your first name.":t.length>=18?o.textContent="First name should be less than 18 characters.":/^[^\s]+$/.test(t)?/^[a-zA-Z\-]+$/.test(t)||(o.textContent="First name should not contain special characters."):o.textContent="First name should not contain spaces.",a||(document.getElementById("above_19_error").textContent="Please select the checkbox."),(c||n.length)&&(""===n?l.textContent="Please enter your email address.":(e=n,/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i.test(e)||(l.textContent="Please enter a valid email address."))),c?""===o.textContent&&c&&""===l.textContent&&""===document.getElementById("above_19_error").textContent&&w():c||""!==o.textContent||""!==document.getElementById("above_19_error").textContent||w()})}async function x(e){var t=new Headers,n=[];return t.append("Authorization",i),await fetch(o+e,{method:"GET",headers:t,redirect:"follow"}).then(e=>e.text()).then(e=>n=e),JSON.parse(n)}async function q(e){var t=new Headers;t.append("Authorization",i),t.append("Content-Type","application/json");var n={method:"POST",headers:t,body:JSON.stringify({encryptString:r().AES.encrypt
1(JSON.stringify(e),a.U9).toString()}),redirect:"follow"};await fetch(o+"saveData",n).then(e=>e.text()).then(async e=>{let{id:t}=JSON.parse(e);x("leaderboard?userId=".concat(t,"&gameId=2&gameType=").concat(h,"&source=website")).then(e=>{let t=document.querySelectorAll("#screBoard"),n="",a="";if(e.firstFiveRecords.forEach((e,t)=>{let a=e.rank,o=e.firstName;n+='<div class="leaderboard_main_list '.concat(e.currentUser&&a<6?"leaderboard_current_rank":""," ").concat(a>5&&"leaderboard_current_rank"," ").concat(0===t?" leaderboard_active border_none":"",'">\n <div class="leaderboard_box">\n <p class="leaderboard_name"><span class="intro_num">').concat(a>99?"99+":a,"</span> ").concat(o,"</p>\n <p> Score: ").concat(e.score," Pts</p>\n </div>\n </div>")}),t[0].innerHTML='\n \n <div class="game_box_table_content">\n '.concat(n,"\n \n </div>\n "),e.gameBeerType.forEach((e,t)=>{var n=window.location.origin;document.querySelectorAll(".shop").forEach(e=>{e.href=n+"/beers",e.setAttribute("target","_blank")});var o=e.beerTypeId,r=e.type,l="".concat(n,"/beers/?").concat(r,"[]=").concat(o);a+='\n <div class="leaderboard_main_list '.concat(0==t&&"leaderboard_active",' border_none">\n <div class="leaderboard_box">\n <p class="leaderboard_name"><span class="intro_num">').concat(t+1,"</span>").concat(e.name,"</p>\n <p>").concat(e.gameBeerMatch,' matches<a target="_blank" class="newTabeBtnLink" href="').concat(l,'"><img src="/images/memory/images/link-expand.svg"></a></p>\n </div>\n </div>\n ')}),a){var o=document.querySelector(".loaderTwo");o&&(o.style.display="none")}t[1].innerHTML='\n \n <div class="game_box_table_content">\n '.concat(a,"\n \n ")})})}document.addEventListener("touchend",e=>{let t=new Date().getTime();t-b<=300&&e.preventDefault(),b=t}),document.querySelector("#back a").addEventListener("click",e=>{e.preventDefault();var t=window.location.origin;window.location.href=t+"/games-and-quizzes/"}),S(),window.addEventListener("resize",S),window.addEventListener("orientationchange",()=>!1==p&&S()),!0==/iPhone|iPad|iPod/.test(navigator.userAgent)&&(!/Safari/.test(navigator.userAgent)||/Chrome|CriOS/.test(navigator.userAgent))&&setTimeout(()=>{window.addEventListener("orientationchange",S)}),document.querySelectorAll(".container_main")[0].style.display="block",document.querySelectorAll(".container_main")[1].style.display="none",document.querySelectorAll(".container_main")[2].style.display="none",document.querySelector("#game_button").addEventListener("click",()=>{E()}),document.querySelector("#howPlay").addEventListener("click",()=>{E(),document.addEventListener("touchmove",f,{passive:!1})}),w()}}}]);
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.