(function(e){function t(t){for(var a,i,s=t[0],l=t[1],c=t[2],u=0,f=[];u0})):[]},firstDayFirst:function(e){return e.firstDayFirst},boardName:function(e){return e.isLoaded?e.data.Name||"highscores":"No such board"},boardYear:function(e){return e.isLoaded?e.data.Year:"No data"},year:function(e){return e.year},guid:function(e){return e.guid}},actions:{setData:function(e,t){return Object(i["a"])(regeneratorRuntime.mark((function r(){var a;return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:a=e.commit,console.log("Setting",t),a(L,t);case 3:case"end":return r.stop()}}),r)})))()},setParams:function(e,t){return Object(i["a"])(regeneratorRuntime.mark((function r(){var a,n;return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:a=e.commit,n=e.state,t||(t={year:null,guid:null}),n.year&&n.year!=t.year&&n.guid&&n.guid!=t.year&&ne.sendMessage({command:"unregister",guid:n.guid,year:n.year}),a(F,t.year),a(H,t.guid),ne.sendMessage(Object(A["a"])({command:"register"},t));case 6:case"end":return r.stop()}}),r)})))()},setIncludeZeroes:function(e,t){return Object(i["a"])(regeneratorRuntime.mark((function r(){var a;return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:a=e.commit,a(V,t);case 2:case"end":return r.stop()}}),r)})))()},setIncludeMedals:function(e,t){return Object(i["a"])(regeneratorRuntime.mark((function r(){var a;return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:a=e.commit,a(B,t);case 2:case"end":return r.stop()}}),r)})))()},setFirstDayFirst:function(e,t){return Object(i["a"])(regeneratorRuntime.mark((function r(){var a;return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:a=e.commit,a(Y,t);case 2:case"end":return r.stop()}}),r)})))()},setAutoRefresh:function(e,t){return Object(i["a"])(regeneratorRuntime.mark((function r(){var a;return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:a=e.commit,a(G,t);case 2:case"end":return r.stop()}}),r)})))()},requestRefresh:function(){var e=this;return Object(i["a"])(regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:r={command:"register",guid:e.getters.guid,year:e.getters.year},console.log("requesting data for ",r.year,r.guid),ne.ensureConnectionAndRegistration(r),Q.get("/refresh/".concat(r.year,"/").concat(r.guid)).then((function(e){return console.log(e)}));case 4:case"end":return t.stop()}}),t)})))()},loadData:function(e){return Object(i["a"])(regeneratorRuntime.mark((function t(){var r,a,n,o;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:r=e.commit,a=e.state,r(Z,!0),n=a.year,o=a.guid,console.log("* loading data for ",n,o),fetch(ee(n,o)).then((function(e){console.log("status:",e.status);var t=200===e.status;return t?e.json():null})).then((function(e){if(e){r(L,e);var t=JSON.parse(localStorage.getItem("knownBoards")||"[]");t=t.filter((function(e){return e.guid!=a.guid})),t.push({name:e.Name,guid:o}),localStorage.setItem("knownBoards",JSON.stringify(t))}else r(L,{})})).then((function(){return r(Z,!1)}));case 6:case"end":return t.stop()}}),t)})))()}},mutations:{SET_DATA:function(e,t){e.data=t,e.isLoaded=!!t},SET_LOADINGINPROGRESS:function(e,t){e.loadingInProgress=t},SET_GUID:function(e,t){e.guid=t,t?localStorage.setItem("aocguid",t):localStorage.removeItem("aocguid")},SET_YEAR:function(e,t){e.year=t,t?localStorage.setItem("year",t):localStorage.removeItem("year")},SET_INCLUDEMEDALS:function(e,t){e.includeMedals=t,localStorage.setItem("includeMedals",t)},SET_INCLUDEZEROES:function(e,t){e.includeZeroes=t,localStorage.setItem("includeZeroes",t)},SET_FIRSTDAYFIRST:function(e,t){e.firstDayFirst=t,localStorage.setItem("firstDayFirst",t)},SET_AUTOREFRESH:function(e,t){e.autoRefresh=t,localStorage.setItem("autoRefresh",t)},initialiseStore:function(e){localStorage.getItem("includeZeroes")&&(e.includeZeroes="true"==localStorage.getItem("includeZeroes")),localStorage.getItem("includeMedals")&&(e.includeMedals="true"==localStorage.getItem("includeMedals")),localStorage.getItem("firstDayFirst")&&(e.firstDayFirst="true"==localStorage.getItem("firstDayFirst")),localStorage.getItem("autoRefresh")&&(e.autoRefresh="true"==localStorage.getItem("autoRefresh")),localStorage.getItem("year")&&(e.year=localStorage.getItem("year"));var t=localStorage.getItem("aocguid");t&&(e.guid=t,console.log("read aocgrid:",t)),console.log("initializing store",e)}}});function le(){var e=[{text:"Pos",value:"identity",width:50},{text:"Name",value:"name",width:250},{text:"L",value:"score",align:"end",width:35,hint:"Local Score"},{text:"G",value:"globalScore",align:"end",width:35,hint:"Global Score"},{text:"S",value:"stars",align:"end",width:35,hint:"Stars collected"},{text:"T",value:"tobiiScore",align:"end",width:35,hint:"Tobii Score"},{text:"R",value:"raffleTickets",align:"end",width:35,hint:"Raffle Tickets"}];return se.getters.includeMedals&&(e.push({text:"#1",value:"goldMedals",align:"end",width:25,hint:"Gold Medals"}),e.push({text:"#2",value:"silverMedals",align:"end",width:25,hint:"Silver Medals"}),e.push({text:"#3",value:"bronzeMedals",align:"end",width:25,hint:"Bronze Medals"})),e}function ce(e){var t={position:e.LocalScoreAll.Position,score:e.LocalScoreAll.Score,globalScore:e.GlobalScore,stars:e.Stars,tobiiScore:e.TobiiScore.Score,tobiiScorePos:e.TobiiScore.Position,raffleTickets:e.RaffleTickets,id:e.Id,supporter:e.Supporter,accumulatedTime:e.AccumulatedTimeToComplete,goldMedals:e.Medals[0],silverMedals:e.Medals[1],bronzeMedals:e.Medals[2]};return t["name"]="".concat(e.Name),t["identity"]=t.position,t}function ue(){for(var e=[],t=1;tD".concat(t,"
*"),value:"d_".concat(t,"_0"),align:"end",width:15}),e.push({text:"
D".concat(t,"
**
"),value:"d_".concat(t,"_1"),align:"end",width:15});return se.getters.firstDayFirst?e:e.reverse()}var de={0:"goldMedal",1:"silverMedal",2:"bronzeMedal"};function fe(e,t){var r="s"+t.slice(1),a=parseInt(t.slice(2,-2))-1,n="";se.getters.data.ExcludedDays&&(n=se.getters.data.ExcludedDays.includes(a)?" excludedday":"");var o=de[e[r]]||"";return o+n}function he(e,t,r){var a="t_"+t.slice(2,-2)+"_"+r,n=ge(e[a]);return n}function pe(e,t,r){e["s_".concat(r,"_0")]=t.PositionForStar[r-1][0],e["s_".concat(r,"_1")]=t.PositionForStar[r-1][1],e["t_".concat(r,"_0")]=t.TimeToComplete[r-1][0],e["t_".concat(r,"_1")]=t.TimeToComplete[r-1][1]}var ve=3600,me=24*ve;function ge(e){if(void 0===e)return"";if(0===e)return"WINNER";if(-1===e||e===Number.MAX_SAFE_INTEGER)return"";if(e>me){var t=Math.floor(e/me);return t>=730?">".concat(Math.floor(t/365)," years"):t>=365?">".concat(Math.floor(t/365)," year"):">".concat(t,1===t?" day":" days")}var r=new Date(1e3*e).toISOString().substr(11,8);return r}function ye(e){if(void 0===e)return"";if(0===e)return"WINNER";if(-1===e||e===Number.MAX_SAFE_INTEGER)return"";var t=Math.floor(e/me);if(t>10)return t>=730?">".concat(Math.floor(t/365)," years"):t>=365?">".concat(Math.floor(t/365)," year"):">".concat(t,1===t?" day":" days");var r=new Date(1e3*e).toISOString().substr(11,8);return t>0&&(r=t+"d "+r),r}var be={props:["item","header","getValue"],methods:{medalColor:function(e){var t="s"+this.header.slice(1);return-1!==e[t]?fe(e,this.header):"incompleteStar"},solveTime:function(e,t){return he(e,this.header,t)}}},_e=be,ke=(r("0030"),Object(h["a"])(_e,$,N,!1,null,null,null)),Se=ke.exports,we=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("span",{key:e.header.value},[e.header.hint?e._e():r("span",{domProps:{innerHTML:e._s(e.header.text)}}),e.header.hint?r("span",[r("v-tooltip",{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function(t){var a=t.on;return[r("span",e._g({domProps:{innerHTML:e._s(e.header.text)}},a))]}}],null,!1,1097859868)},[r("span",[e._v(e._s(e.header.hint))])])],1):e._e()])},xe=[],Te={props:["header"]},Ce=Te,Oe=Object(h["a"])(Ce,we,xe,!1,null,null,null),Ee=Oe.exports,Me=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-tooltip",{attrs:{bottom:""},scopedSlots:e._u([{key:"activator",fn:function(t){var a=t.on,n=t.attrs;return[r("span",e._g(e._b({},"span",n,!1),a),[e._v(e._s(e.item.name))]),e.item.supporter?r("span",[e._v(" (AoC++)")]):e._e()]}}])},[r("span",[e._v("AoC id "+e._s(e.item.id))])])},Pe=[],je={props:["item"]},Re=je,Ie=Object(h["a"])(Re,Me,Pe,!1,null,null,null),$e=Ie.exports,Ne=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[e.allStarsDone?r("span",[r("b",[e._v(" "+e._s(e.item.stars)+" ")])]):r("span",[e._v(" "+e._s(e.item.stars)+" ")])])},Ae=[],De={props:["item"],computed:{allStarsDone:function(){return this.item.stars==this.$store.getters.maxStars}}},Le=De,Fe=Object(h["a"])(Le,Ne,Ae,!1,null,null,null),He=Fe.exports,Ve={components:{InfoBlock:O["a"],PositionCol:I,ValueCol:Se,TooltipHeader:Ee,NameCol:$e,StarCol:He},data:function(){return{infoTitle:"Leaderboard",infotext:"This board shows the accummulated position of each player.
The ordering is based on the official AoC 'local score' where the winner each day receives the same number of points as players on the list, but only results up to that day/star is considered.
The 'medal color' shows the top three players for each day/star"}},methods:{getValue:function(e,t){return e[t]}},computed:{dayheaders:function(){return ue()},fixedColumns2:function(){return le()},allheaders:function(){return[].concat(Object(C["a"])(this.fixedColumns2),Object(C["a"])(this.dayheaders))},players:function(){return this.$store.getters.filteredPlayers},data:function(){return this.$store.getters.data},playerList:function(){var e,t=[],r=Object(T["a"])(this.players);try{for(r.s();!(e=r.n()).done;){for(var a=e.value,n=ce(a),o=1;o-1?i[0]:"",n["d_".concat(o,"_1")]=i[1]>-1?i[1]:""}t.push(n)}}catch(s){r.e(s)}finally{r.f()}return t}}},Be=Ve,Ge=(r("61e7"),Object(h["a"])(Be,w,x,!1,null,null,null)),Ye=Ge.exports,Ze=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[r("info-block",{attrs:{infotext:e.infotext,title:e.infoTitle}}),r("div",{staticClass:"scrollable"},[r("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.allheaders,items:e.playerList,"items-per-page":50,"fixed-header":"",height:"700",dense:"","mobile-breakpoint":"1","single-select":""},scopedSlots:e._u([{key:"header.score",fn:function(e){var t=e.header;return[r("tooltip-header",{attrs:{header:t}})]}},{key:"header.globalScore",fn:function(e){var t=e.header;return[r("tooltip-header",{attrs:{header:t}})]}},{key:"header.stars",fn:function(e){var t=e.header;return[r("tooltip-header",{attrs:{header:t}})]}},{key:"header.tobiiScore",fn:function(e){var t=e.header;return[r("tooltip-header",{attrs:{header:t}})]}},{key:"header.raffleTickets",fn:function(e){var t=e.header;return[r("tooltip-header",{attrs:{header:t}})]}},{key:"header.goldMedals",fn:function(e){var t=e.header;return[r("tooltip-header",{attrs:{header:t}})]}},{key:"header.silverMedals",fn:function(e){var t=e.header;return[r("tooltip-header",{attrs:{header:t}})]}},{key:"header.bronzeMedals",fn:function(e){var t=e.header;return[r("tooltip-header",{attrs:{header:t}})]}},e._l(e.dayheaders,(function(t){return{key:"header."+t.value,fn:function(a){var n=a.header;return[r("span",{key:t.value,domProps:{innerHTML:e._s(n.text)}})]}}})),{key:"item.identity",fn:function(e){var t=e.item;return[r("position-col",{attrs:{item:t}})]}},{key:"item.name",fn:function(e){var t=e.item;return[r("name-col",{attrs:{item:t}})]}},{key:"item.stars",fn:function(e){var t=e.item;return[r("star-col",{attrs:{item:t}})]}},e._l(e.dayheaders,(function(t){return{key:"item."+t.value,fn:function(a){var n=a.item;return[r("value-col",{key:t.value,attrs:{item:n,header:t.value,getValue:e.getValue}})]}}})),{key:"no-data",fn:function(){return[e._v(" No data available ")]},proxy:!0}],null,!0)})],1)],1)},Je=[],ze={components:{InfoBlock:O["a"],PositionCol:I,ValueCol:Se,TooltipHeader:Ee,NameCol:$e,StarCol:He},data:function(){return{infoTitle:"Completion Time",infotext:"This board shows the time to complete the tasks from their release (which is the same time for both tasks)."}},methods:{getValue:function(e,t){return ge(e[t])}},computed:{dayheaders:function(){return ue()},allheaders:function(){return[].concat(Object(C["a"])(le()),Object(C["a"])(this.dayheaders))},players:function(){return this.$store.getters.filteredPlayers},data:function(){return this.$store.getters.data},playerList:function(){var e,t=[],r=Object(T["a"])(this.players);try{for(r.s();!(e=r.n()).done;){for(var a=e.value,n=ce(a),o=1;o*->**"),value:"d_".concat(t,"_0"),align:"end",width:15});return this.$store.getters.firstDayFirst?e:e.reverse()},allheaders:function(){return[].concat(Object(C["a"])(le()),Object(C["a"])(this.dayheaders))},players:function(){return this.$store.getters.filteredPlayers},data:function(){return this.$store.getters.data},playerList:function(){var e,t=[],r=Object(T["a"])(this.players);try{for(r.s();!(e=r.n()).done;){for(var a=e.value,n=ce(a),o=1;o0&&(l=0),pe(n,a,o),n["d_".concat(o,"_0")]=0==i[0]?"":i[0],n["d_".concat(o,"_1")]=0==i[1]?"":i[1],n["s_".concat(o,"_0")]=s[0]+l,n["s_".concat(o,"_1")]=s[1]+l}t.push(n)}}catch(c){r.e(c)}finally{r.f()}return yt.orderBy(t,["globalScore","stars","position"],["desc","desc","asc"])}}},_t=bt,kt=Object(h["a"])(_t,mt,gt,!1,null,null,null),St=kt.exports,wt=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[r("info-block",{attrs:{infotext:e.infotext,title:e.infoTitle}}),r("div",{staticClass:"scrollable"},[r("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.allheaders,items:e.playerList,"items-per-page":50,dense:"","mobile-breakpoint":"1","single-select":""},scopedSlots:e._u([{key:"header.score",fn:function(e){var t=e.header;return[r("tooltip-header",{attrs:{header:t}})]}},{key:"header.globalScore",fn:function(e){var t=e.header;return[r("tooltip-header",{attrs:{header:t}})]}},{key:"header.stars",fn:function(e){var t=e.header;return[r("tooltip-header",{attrs:{header:t}})]}},{key:"header.tobiiScore",fn:function(e){var t=e.header;return[r("tooltip-header",{attrs:{header:t}})]}},{key:"header.raffleTickets",fn:function(e){var t=e.header;return[r("tooltip-header",{attrs:{header:t}})]}},{key:"header.goldMedals",fn:function(e){var t=e.header;return[r("tooltip-header",{attrs:{header:t}})]}},{key:"header.silverMedals",fn:function(e){var t=e.header;return[r("tooltip-header",{attrs:{header:t}})]}},{key:"header.bronzeMedals",fn:function(e){var t=e.header;return[r("tooltip-header",{attrs:{header:t}})]}},e._l(e.dayheaders,(function(t){return{key:"header."+t.value,fn:function(a){var n=a.header;return[r("span",{key:t.value,domProps:{innerHTML:e._s(n.text)}})]}}})),{key:"item.identity",fn:function(e){var t=e.item;return[r("position-col",{attrs:{item:t}})]}},{key:"item.name",fn:function(e){var t=e.item;return[r("name-col",{attrs:{item:t}})]}},{key:"item.stars",fn:function(e){var t=e.item;return[r("star-col",{attrs:{item:t}})]}},e._l(e.dayheaders,(function(t){return{key:"item."+t.value,fn:function(a){var n=a.item;return[r("value-col",{key:t.value,attrs:{item:n,header:t.value,getValue:e.getValue}})]}}})),{key:"no-data",fn:function(){return[e._v(" No data available ")]},proxy:!0}],null,!0)})],1)],1)},xt=[],Tt=r("2ef0"),Ct={components:{InfoBlock:O["a"],PositionCol:I,ValueCol:Se,TooltipHeader:Ee,NameCol:$e,StarCol:He},data:function(){return{infoTitle:"Scoring based on TobiiScore",infotext:"TobiiScore leaderboard is ordered by\n
    \n
  • Completed stars\n
  • TobiiScore\n
  • Time for last star\n
\n

TobiiScore calculated as the number of players on the list with a better result for each star.\n That means that a gold medal gives 0 points, silver gives 1 point etc.

\n

The advantage of this is that the score does not change if new players enters the list,\n and the ordering method encourages participants to solve all puzzles.

"}},methods:{getValue:function(e,t){return e[t]}},computed:{dayheaders:function(){return ue()},allheaders:function(){return[].concat(Object(C["a"])(le()),Object(C["a"])(this.dayheaders))},players:function(){return this.$store.getters.filteredPlayers},data:function(){return this.$store.getters.data},playerList:function(){var e,t=[],r=Object(T["a"])(this.players);try{for(r.s();!(e=r.n()).done;){for(var a=e.value,n=ce(a),o=1;o-1?i[0]:"",n["d_".concat(o,"_1")]=i[1]>-1?i[1]:""}t.push(n)}}catch(s){r.e(s)}finally{r.f()}return Tt.sortBy(t,["tobiiScorePos"])}}},Ot=Ct,Et=Object(h["a"])(Ot,wt,xt,!1,null,null,null),Mt=Et.exports,Pt=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[r("info-block",{attrs:{infotext:e.infotext,title:e.infoTitle}}),r("div",{staticClass:"scrollable"},[r("v-data-table",{staticClass:"elevation-1",attrs:{headers:e.allheaders,items:e.playerList,"items-per-page":50,"fixed-header":"",height:"700",dense:"","mobile-breakpoint":"1","single-select":""},scopedSlots:e._u([{key:"header.score",fn:function(e){var t=e.header;return[r("tooltip-header",{attrs:{header:t}})]}},{key:"header.globalScore",fn:function(e){var t=e.header;return[r("tooltip-header",{attrs:{header:t}})]}},{key:"header.stars",fn:function(e){var t=e.header;return[r("tooltip-header",{attrs:{header:t}})]}},{key:"header.tobiiScore",fn:function(e){var t=e.header;return[r("tooltip-header",{attrs:{header:t}})]}},{key:"header.raffleTickets",fn:function(e){var t=e.header;return[r("tooltip-header",{attrs:{header:t}})]}},{key:"header.goldMedals",fn:function(e){var t=e.header;return[r("tooltip-header",{attrs:{header:t}})]}},{key:"header.silverMedals",fn:function(e){var t=e.header;return[r("tooltip-header",{attrs:{header:t}})]}},{key:"header.bronzeMedals",fn:function(e){var t=e.header;return[r("tooltip-header",{attrs:{header:t}})]}},e._l(e.dayheaders,(function(t){return{key:"header."+t.value,fn:function(a){var n=a.header;return[r("span",{key:t.value,domProps:{innerHTML:e._s(n.text)}})]}}})),{key:"item.identity",fn:function(e){var t=e.item;return[r("position-col",{attrs:{item:t}})]}},{key:"item.name",fn:function(e){var t=e.item;return[r("name-col",{attrs:{item:t}})]}},{key:"item.stars",fn:function(e){var t=e.item;return[r("star-col",{attrs:{item:t}})]}},e._l(e.dayheaders,(function(t){return{key:"item."+t.value,fn:function(a){var n=a.item;return[r("value-col-medal",{key:t.value,attrs:{item:n,header:t.value,getValue:e.getValue}})]}}})),{key:"no-data",fn:function(){return[e._v(" No data available ")]},proxy:!0}],null,!0)})],1)],1)},jt=[],Rt=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-tooltip",{attrs:{bottom:""},scopedSlots:e._u([{key:"activator",fn:function(t){var a=t.on,n=t.attrs;return[e.isMedal(e.item)?r("v-icon",e._g(e._b({attrs:{color:e.iconColor(e.item)}},"v-icon",n,!1),a),[e._v(e._s(e.getIcon(e.item)))]):r("span",e._g(e._b({class:e.medalColor(e.item)},"span",n,!1),a),[e._v(e._s(e.getValue(e.item,e.header)))])]}}])},[r("span",[e._v(e._s(e.item.name)),r("br"),e._v("*1: "+e._s(e.solveTime(e.item,0))),r("br"),e._v("*2: "+e._s(e.solveTime(e.item,1)))])])},It=[],$t={0:{value:"gold",color:"#ffd700"},1:{value:"silver",color:"#C0C0C0"},2:{value:"bronze",color:"#DAA520"}},Nt={props:["item","header","getValue"],methods:{medalColor:function(e){return fe(e,this.header)},getPosition:function(e){var t="s"+this.header.slice(1);return e[t]},iconColor:function(e){return $t[this.getPosition(e)].color},isMedal:function(e){var t=this.getPosition(e);return t>=0&&t<3},getIcon:function(e){var t=$t[this.getPosition(e)].value;return"mdi-podium-".concat(t)},solveTime:function(e,t){return he(e,this.header,t)}}},At=Nt,Dt=Object(h["a"])(At,Rt,It,!1,null,null,null),Lt=Dt.exports,Ft={components:{InfoBlock:O["a"],PositionCol:I,ValueColMedal:Lt,TooltipHeader:Ee,NameCol:$e,StarCol:He},data:function(){return{infoTitle:"Position for star",infotext:"This board shows the position for each star."}},methods:{getValue:function(e,t){var r=e[t];return-1===r?"":0===r?"#1":e[t]+1}},computed:{dayheaders:function(){return ue()},allheaders:function(){return[].concat(Object(C["a"])(le()),Object(C["a"])(this.dayheaders))},players:function(){return this.$store.getters.filteredPlayers},data:function(){return this.$store.getters.data},playerList:function(){var e,t=[],r=Object(T["a"])(this.players);try{for(r.s();!(e=r.n()).done;){for(var a=e.value,n=ce(a),o=1;o-1&&-1==this.times[1]?"silver":"gold"},urlForDay:function(){return"https://adventofcode.com/".concat(this.$store.getters.data.Year,"/day/").concat(this.day)}}},ar=rr,nr=(r("b7e5"),Object(h["a"])(ar,er,tr,!1,null,null,null)),or=nr.exports,ir={components:{Star:or},props:["days"]},sr=ir,lr=Object(h["a"])(sr,Qt,Kt,!1,null,null,null),cr=lr.exports,ur={components:{StarLine:cr,InfoBlock:O["a"]},data:function(){return{infoTitle:"Classic Aoc style board",infotext:"",headers:[{text:"Pos.",value:"Position",width:20},{text:"Points",value:"Score",width:20},{text:"Stars",value:"Stars",width:100},{text:"Name",value:"Name",width:250},{text:"",value:"Filler",width:200}]}},computed:{players:function(){return this.$store.getters.filteredPlayers}},filters:{rightAdjust:function(e,t){var r=String(e).padStart(t,"*");return r=r.replaceAll("*"," "),r}},methods:{key:function(e,t){return e*t},isSupporter:function(e){return e.Supporter?"(AoC++)":""}}},dr=ur,fr=(r("300b"),Object(h["a"])(dr,Wt,Xt,!1,null,"1cead81a",null)),hr=fr.exports,pr=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[e._l(e.sortedBoards,(function(t,a){return r("div",{key:t.guid,on:{mouseover:function(t){e.show=a},mouseleave:function(t){e.show=null}}},[r("div",{staticClass:"boardentry",on:{click:function(r){return e.navigate(t)}}},[r("v-container",[r("v-row",[r("v-col"),e._v(" "),r("v-col",[r("span",{staticClass:"fakelink"},[e._v(e._s(t.name))])]),r("v-col",[e.show==a?r("span",[r("v-tooltip",{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function(a){var n=a.on;return[r("v-icon",e._g({staticClass:"iconstyle",on:{click:function(r){return r.stopPropagation(),e.navigate(t)}}},n),[e._v("mdi-open-in-app")])]}}],null,!0)},[r("span",[e._v("Open board")])]),r("v-tooltip",{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function(a){var n=a.on;return[r("v-icon",e._g({staticClass:"iconstyle",on:{click:function(r){return r.stopPropagation(),e.copylink(t)}}},n),[e._v("mdi-content-copy")])]}}],null,!0)},[r("span",[e._v("Copy link")])]),r("v-tooltip",{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function(a){var n=a.on;return[r("v-icon",e._g({staticClass:"iconstyle",on:{click:function(r){return r.stopPropagation(),e.remove(t)}}},n),[e._v("mdi-delete-alert")])]}}],null,!0)},[r("span",[e._v("Remove board from your boards list")])])],1):e._e()])],1)],1)],1)])})),r("v-btn",{on:{click:e.refresh}},[e._v("Refresh")])],2)},vr=[],mr=r("2ef0"),gr={data:function(){return{show:null,boards:[{name:"tobii",guid:"jlkjllk"},{name:"leica",guid:"foobar"}]}},computed:{sortedBoards:function(){return mr.sortBy(this.boards,(function(e){return e.name.toUpperCase()}))}},methods:{navigate:function(e){var t=this;return Object(i["a"])(regeneratorRuntime.mark((function r(){var a;return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:return a=(new Date).getFullYear(),(new Date).getMonth<11&&a--,r.next=4,t.$store.dispatch("setParams",{year:a,guid:e.guid});case 4:return r.next=6,t.$store.dispatch("loadData");case 6:t.$store.dispatch("requestRefresh",{year:a,guid:e.guid}),t.$router.push("/");case 8:case"end":return r.stop()}}),r)})))()},remove:function(e){this.boards=this.boards.filter((function(t){return t.guid!=e.guid})),localStorage.setItem("knownBoards",JSON.stringify(this.boards)),console.log("remove",e.name),this.refresh()},copylink:function(e){var t="".concat(window.location.origin,"?guid=").concat(e.guid);navigator.clipboard.writeText(t).then((function(){return console.log("copied",t)}))},refresh:function(){var e="00000000-0000-0000-0000-000000000000",t={name:"Global Board",guid:e},r=localStorage.getItem("knownBoards")||JSON.stringify([t]);this.boards=JSON.parse(r),0==this.boards.filter((function(t){return t.guid==e})).length&&this.boards.push(t)}},mounted:function(){var e=this;return Object(i["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.refresh();case 1:case"end":return t.stop()}}),t)})))()}},yr=gr,br=(r("bfbd"),Object(h["a"])(yr,pr,vr,!1,null,null,null)),_r=br.exports,kr=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[r("h1",[e._v("Additional info")]),r("p",[e._v(" First of all - you ain't gonna get any help solving the AoC problems here! If you were looking for that, look elsewhere! ")]),r("p",[e._v(" However, we will give you some help on how to use this highscore app. ")]),r("p"),r("h2",[e._v("Columns")]),r("ul",[r("li",{on:{click:function(t){return e.$router.push("/")}}},[e._v("L - Local score. The amount of points achieved in the local list (your leaderboard).")]),r("li",{on:{click:function(t){return e.$router.push("/globalscoreperday")}}},[e._v(" G - Global score. How many points acheieved on the global list.")]),r("li",{on:{click:function(t){return e.$router.push("/positionforstar")}}},[e._v("S - Stars. How many stars have been collected (problems solved).")]),r("li",{on:{click:function(t){return e.$router.push("/tobiiscore")}}},[e._v("T - Tobii Score. Scoring based on fisrt come gets lowest score.")]),r("li",{on:{click:function(t){return e.$router.push("")}}},[e._v("R - Raffle tickets. Can be used for fair-chance a lottery between all participants in the group")])])])},Sr=[],wr={},xr=wr,Tr=Object(h["a"])(xr,kr,Sr,!1,null,null,null),Cr=Tr.exports,Or=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"narrowbody"},[e.boardSaved?r("v-card",{staticClass:"narrowbody"},[r("v-card-title",[e._v(" Board created ")]),e._v(" The board '"+e._s(e.boardName)+"' has been created! "),r("br"),e._v(" The guid for the board is "),r("b",[e._v(e._s(e.guid))]),e._v(". You can find the url in "),r("span",{staticClass:"fakelink",on:{click:function(t){return e.navigate("/boards")}}},[e._v("Your Other Boards")]),e._v(", but the board itself will not be available to view for another few seconds. "),r("v-card-actions",{staticClass:"text-right"},[r("div",[r("v-btn",{on:{click:function(t){return e.navigate("/")}}},[e._v(" OK ")])],1)])],1):r("v-card",[r("v-card-title",[e._v(" Add your leader board ")]),r("v-card-text",[r("v-text-field",{staticClass:"textfield",attrs:{label:"Board ID (from AOC)",placeholder:"Board ID",clearable:"",outlined:"",dense:""},model:{value:e.boardId,callback:function(t){e.boardId=t},expression:"boardId"}}),r("v-text-field",{staticClass:"textfield",attrs:{label:"Name of your board",placeholder:"Board name",clearable:"",outlined:"",dense:""},model:{value:e.boardName,callback:function(t){e.boardName=t},expression:"boardName"}}),r("v-text-field",{staticClass:"textfield",attrs:{label:"Session Cookie from adventofcode.com",placeholder:"Session cookie",clearable:"",outlined:"",dense:""},model:{value:e.sessionCookie,callback:function(t){e.sessionCookie=t},expression:"sessionCookie"}}),r("v-text-field",{staticClass:"textfield",attrs:{label:"Email",placeholder:"Email",clearable:"",outlined:"",dense:""},model:{value:e.email,callback:function(t){e.email=t},expression:"email"}}),r("p",[e._v(" In the future we might add more configuration options for your board. To ensure only you can manipulate it, add your email. The current plan is to send one time passwords or something along those lines once the configuration options are implemented. ")])],1),r("v-card-actions",{staticClass:"text-right"},[r("div",[r("v-btn",{attrs:{disabled:!e.validData},on:{click:e.requestList}},[e._v(" Submit ")])],1)])],1)],1)},Er=[],Mr=(r("00b4"),{data:function(){return{boardId:"",boardName:"",sessionCookie:"",email:"",boardSaved:!1,guid:""}},computed:{validData:function(){return this.boardId&&this.boardName.length>5&&this.sessionCookie.length>10&&(!this.email||this.email.includes("@"))&&/^\d+$/.test(this.boardId)}},methods:{saveBoard:function(e,t){var r=JSON.parse(localStorage.getItem("knownBoards")||"[]");r.push({name:e,guid:t}),localStorage.setItem("knownBoards",JSON.stringify(r))},navigate:function(e){this.$router.push(e)},requestList:function(){var e=this;return Object(i["a"])(regeneratorRuntime.mark((function t(){var r,a,n,o,i,s;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return r={boardid:e.boardId,boardname:e.boardName,session_cookie:e.sessionCookie},e.email&&(r.email=e.email),console.log(r),t.next=5,Q.post("/createboard",r);case 5:if(a=t.sent,console.log(a.status),a.guid)e.boardSaved=!0,e.saveBoard(e.boardName,a.guid),e.guid=a.guid;else if(console.log(a),a.detail){n="",o=Object(T["a"])(a.detail);try{for(o.s();!(i=o.n()).done;)s=i.value,n+="".concat(s.msg,"\n")}catch(l){o.e(l)}finally{o.f()}alert(n)}else alert(a.message);case 8:case"end":return t.stop()}}),t)})))()}}}),Pr=Mr,jr=(r("4495"),Object(h["a"])(Pr,Or,Er,!1,null,"0f3f5997",null)),Rr=jr.exports;a["default"].use(S["a"]);var Ir=[{path:"/",title:"Leaderboard",component:Ye},{path:"/timeoffset",title:"Time offset",component:rt},{path:"/accumulatedtime",title:"Accumulated Time",component:ct},{path:"/completiontimestar2",title:"Time*2",component:vt},{path:"/globalscoreperday",title:"Global",component:St},{path:"/tobiiscore",title:"TobiiScore",component:Mt},{path:"/positionforstar",title:"Position for Star",component:Bt},{path:"/completiontime",name:"completiontime",title:"Completion time",component:We}],$r=[{path:"/positionchart",title:"PositionChart",component:function(){return r.e("charts").then(r.bind(null,"144e"))}},{path:"/scorechart",title:"ScoreChart",component:function(){return r.e("charts").then(r.bind(null,"0790"))}}],Nr=[{path:"/aoc",title:"Aoc Style",component:hr},{path:"/boards",title:"Your other boards",component:_r},{path:"/newlist",title:"Add a leader board",component:Rr},{path:"/help",title:"Help",component:Cr},{path:"/raw",title:"Raw data",component:Ut}],Ar=[].concat(Ir,$r,Nr),Dr=new S["a"]({mode:"history",base:"/",routes:Ar}),Lr=Dr,Fr=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[r("v-btn",{staticClass:"menubutton",attrs:{color:"cyan darken-2",dark:""},on:{click:function(t){e.dialog=!0}}},[r("v-icon",{staticClass:"iconpadding"},[e._v("mdi-information")]),e._v(" About ")],1),r("v-dialog",{staticClass:"aoc-color",attrs:{width:"500"},model:{value:e.dialog,callback:function(t){e.dialog=t},expression:"dialog"}},[r("v-card",{staticClass:"mx-auto aoc-color"},[r("v-card-title",{staticClass:"aoc-color"},[r("p",{staticClass:"aoc-color"},[e._v("AoC Highscores")])]),r("v-card-text",{staticClass:"aoc-color"},[r("p",{staticClass:"aoc-color"},[e._v(" This page is created/maintained by Jesper Högström ("),r("a",{attrs:{href:"http://wwww.aditrologistics.se"}},[e._v("AditroLogistics")]),e._v(") and Jonas Högström ("),r("a",{attrs:{href:"http://www.tobii.com"}},[e._v("Tobii")]),e._v("). During the month of "),r("a",{attrs:{href:"http://www.adventofcode.com"}},[e._v("AdventofCode")]),e._v(" we try to keep it as up to date as possible without putting too much stress on the AoC servers."),r("br"),e._v(" If you find any bugs, have any questions or if you are interested in having these stats for your own private leaderboard, please reach out... aoc at lillfiluren.se. ")]),r("p",{staticClass:"aoc-color"},[e._v(" ©"+e._s(e.copyrightYear)+" — "),r("strong",[e._v("JHSoftService")]),r("a",{attrs:{target:"_blank",href:"https://github.com/jhogstrom/aoc-highscores2"}},[r("v-icon",{staticClass:"iconpadding",attrs:{color:"white"}},[e._v("mdi-github")])],1)])]),r("v-card-actions",{staticClass:"aoc-color"},[r("v-spacer"),r("v-btn",{on:{click:function(t){e.dialog=!1}}},[e._v(" ok ")])],1)],1)],1)],1)},Hr=[],Vr={data:function(){return{dialog:!1}},computed:{copyrightYear:function(){var e=2021,t=(new Date).getFullYear();return e===t?e:"".concat(e,"-").concat(t)}}},Br=Vr,Gr=(r("1fb9"),Object(h["a"])(Br,Fr,Hr,!1,null,"913120b6",null)),Yr=Gr.exports,Zr={components:{MenuButton:v,YearMenu:k,AboutButton:Yr},props:["guid","year"],data:function(){return{infoTitle:"AOC FTW",drawer:!1,tab:null,loadedOk:!1,boardmap:Ir,chartmap:$r,otherPages:Nr,displayHint:!1,hint:""}},computed:{boardTitle:function(){return"AOC -> ".concat(this.$store.getters.boardName," - ").concat(this.$store.getters.boardYear)},loadingInProgress:function(){return this.$store.getters.loadingInProgress},updateTime:function(){return this.$store.getters.updateTime},includeZeroes:{get:function(){return this.$store.getters.includeZeroes},set:function(){this.$store.dispatch("setIncludeZeroes",!this.includeZeroes)}},includeMedals:{get:function(){return this.$store.getters.includeMedals},set:function(){this.$store.dispatch("setIncludeMedals",!this.includeMedals)}},firstDayFirst:{get:function(){return this.$store.getters.firstDayFirst},set:function(){this.$store.dispatch("setFirstDayFirst",!this.firstDayFirst)}},autoRefresh:{get:function(){return this.$store.getters.autoRefresh},set:function(){this.$store.dispatch("setAutoRefresh",!this.autoRefresh)}}},methods:{showHint:function(e){var t=this;this.hint=e,this.displayHint=!0;var r=5e3;setTimeout((function(){return t.displayHint=!1}),r)},copylink:function(){var e="".concat(window.location.origin,"?guid=").concat(this.$store.getters.guid);navigator.clipboard.writeText(e),this.showHint("Link copied")},shouldReload:function(){return this.autoRefresh&&!document.hidden},refreshData:function(){this.showHint("Request sent"),this.$store.dispatch("requestRefresh")}}},Jr=Zr,zr=(r("ea24"),Object(h["a"])(Jr,s,l,!1,null,"1b4e7ca6",null)),qr=zr.exports,Ur="00000000-0000-0000-0000-000000000000",Wr={name:"App",components:{MainTable:qr},data:function(){return{guid:"",year:0,socket:ne}},created:function(){ne.emitter.on("Payload",this.onPayload),this.handleParams(),this.fetchData(),this.$store.dispatch("requestRefresh")},mounted:function(){},methods:{onPayload:function(e){var t=this;return Object(i["a"])(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(console.log("Websocket incoming",e.event||e),"update"!=e.event){r.next=10;break}if(console.log("WS-Request: ",JSON.stringify(e)),t.$store.getters.year!=e.year||t.$store.getters.guid!=e.boardguid){r.next=9;break}return console.log("Reloading..."),r.next=7,t.$store.dispatch("loadData");case 7:r.next=10;break;case 9:console.log("Received unexpected request for",JSON.stringify(e));case 10:case"end":return r.stop()}}),r)})))()},handleParams:function(){var e=new URLSearchParams(window.location.search),t=new Date,r=t.getFullYear().toString();11!=t.getMonth()&&(r=(t.getFullYear()-1).toString()),this.year=e.get("year")||r,this.guid=e.get("guid")||e.get("uuid")||this.$store.getters.guid||Ur,this.$store.dispatch("setParams",{year:this.year,guid:this.guid})},fetchData:function(){var e=this;return Object(i["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.$store.dispatch("loadData");case 1:case"end":return t.stop()}}),t)})))()}}},Xr=Wr,Qr=(r("5c0b"),Object(h["a"])(Xr,n,o,!1,null,null,null)),Kr=Qr.exports,ea=r("ce5b"),ta=r.n(ea);r("bf40");a["default"].use(ta.a);var ra={},aa=new ta.a(ra),na=r("a584");a["default"].config.productionTip=!1,a["default"].use(na["a"],{config:{id:"G-ZWGPG7GN8G"}}),new a["default"]({vuetify:aa,render:function(e){return e(Kr)},store:se,router:Lr,beforeCreate:function(){this.$store.commit("initialiseStore")}}).$mount("#app")},5809:function(e,t,r){},"5c0b":function(e,t,r){"use strict";r("9c0c")},"5f57":function(e,t,r){},"61e7":function(e,t,r){"use strict";r("2551")},"89de":function(e,t,r){},"9c0c":function(e,t,r){},b427:function(e,t,r){},b7e5:function(e,t,r){"use strict";r("b427")},bfbd:function(e,t,r){"use strict";r("5809")},cb4d:function(e,t,r){},ea24:function(e,t,r){"use strict";r("f139")},f139:function(e,t,r){},fb55:function(e,t,r){"use strict";var a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("v-expansion-panels",[r("v-expansion-panel",[r("v-expansion-panel-header",[r("div",[r("v-icon",[e._v("mdi-information")])],1),e._v(" "+e._s(e.title)+" ")]),r("v-expansion-panel-content",[r("div",{domProps:{innerHTML:e._s(e.infotext)}})])],1)],1)},n=[],o={props:["infotext","title"]},i=o,s=r("2877"),l=Object(s["a"])(i,a,n,!1,null,null,null);t["a"]=l.exports}}); //# sourceMappingURL=app.a77c5bbb.js.map