1"use strict";(self["webpackChunktjing"]=self["webpackChunktjing"]||[]).push([[5677],{71074:function(t,s,e){e.d(s,{A:function(){return f}});var i=function(){var t=this,s=t._self._c;return t.total>0?s("div",{staticClass:"pagination-container"},[s("p",{staticClass:"total"},[t._v(" "+t._s(0===t.currentPage?1:t.currentPage*t.perPage)+"-"+t._s(Math.min((t.currentPage+1)*t.perPage,t.total))+" of "+t._s(t.total)+" ")]),s("div",{staticClass:"start",class:{disabled:0===t.currentPage},on:{click:function(s){return t.$emit("start")}}},[s("StopChevron",{attrs:{direction:"left",color:0===t.currentPage?"sleet":"midnight"}})],1),s("div",{staticClass:"back",class:{disabled:0===t.currentPage},on:{click:function(s){return t.$emit("back")}}},[s("Chevron2",{attrs:{color:t.currentPage>0?"midnight":"sleet",direction:"left"}})],1),s("div",{staticClass:"forward",class:{disabled:t.currentPage>=Math.ceil(t.total/t.perPage)-1},on:{click:function(s){return t.$emit("forward")}}},[s("Chevron2",{attrs:{direction:"right",color:t.currentPage<Math.ceil(t.total/t.perPage)-1?"midnight":"sleet"}})],1),s("div",{staticClass:"end",class:{disabled:t.currentPage>=Math.ceil(t.total/t.perPage)-1},on:{click:function(s){return t.$emit("end")}}},[s("StopChevron",{attrs:{direction:"right",color:t.currentPage>=Math.ceil(t.total/t.perPage)-1?"sleet":"moidnight"}})],1)]):t._e()},a=[],o=e(39553),n=function(){var t=this,s=t._self._c;return s("svg",{class:[t.color,t.direction],attrs:{xmlns:"http://www.w3.org/2000/svg",width:"13.707",height:"13.414",viewBox:"0 0 13.707 13.414"}},[s("g",{attrs:{id:"Component_73_1","data-name":"Component 73 â 1",transform:"translate(0.707 0.707)"}},[s("path",{attrs:{id:"Path_2055","data-name":"Path 2055",d:"M-4363.537-8901.469l6,6-6,6",transform:"translate(4363.537 8901.469)",fill:"none",stroke:"#2d323c","stroke-width":"2"}}),s("line",{attrs:{id:"Line_440","data-name":"Line 440",y2:"12",transform:"translate(12)",fill:"none",stroke:"#2d323c","stroke-width":"2"}})])])},r=[],l={name:"StopChevron",props:{direction:{type:String,required:!0},color:{type:String,required:!1,default:"#2d323c"}}},d=l,u=e(81656),c=(0,u.A)(d,n,r,!1,null,"8db84258",null),p=c.exports,v={name:"Pagination",props:{total:{type:Number,required:!0},perPage:{type:Number,required:!0},currentPage:{type:Number,required:!0}},components:{Chevron2:o.A,StopChevron:p},data(){return{}},computed:{},methods:{},mounted(){},beforeCreate(){},destroyed(){}},h=v,m=(0,u.A)(h,i,a,!1,null,"64937184",null),f=m.exports},64776:function(t,s,e){e.d(s,{A:function(){return d}});var i=function(){var t=this,s=t._self._c;return s("div",{staticClass:"default-toggle",class:[t.size]},[s("label",{staticClass:"toggle",class:{disabled:t.disabled}},[s("input",{attrs:{type:"checkbox",disabled:t.disabled},domProps:{checked:t.value},on:{change:function(s){return t.updateValue(s.target.checked)}}}),s("span",{staticClass:"slider"})])])},a=[],o={name:"DefaultToggle",props:["value","disabled","size"],data(){return{}},computed:{},methods:{updateValue:function(t){this.$emit("input",t)}},mounted(){},beforeCreate(){},destroyed(){}},n=o,r=e(81656),l=(0,r.A)(n,i,a,!1,null,"33fdcb79",null),d=l.exports},53259:function(t,s,e){e.d(s,{A:function(){return d}});var i=function(){var t=this,s=t._self._c;return s("div",{staticClass:"text-toggle-container"},[s("div",{staticClass:"text-toggle",style:{width:t.width+"px"}},[s("div",{staticClass:"indicator",class:{toLeft:t.leftActive}}),s("div",{staticClass:"left",class:{active:t.leftActive},on:{click:function(s){return s.stopPropagation(),t.toggle(!0)}}},[t._v(" "+t._s(t.leftValue)+" ")]),s("div",{staticClass:"right",class:{active:!t.leftActive},on:{click:function(s){return s.stopPropagation(),t.toggle(!1)}}},[t._v(" "+t._s(t.rightValue)+" ")])])])},a=[],o={name:"TjingTextOptionToggle",props:["width","leftValue","rightValue","startToRight"],data(){return{leftActive:!0}},computed:{},methods:{toggle(t){1==t&&t!==this.leftActive?(this.leftActive=!0,this.$emit("left")):0==t&&(this.leftActive=!1,this.$emit("right"))}},beforeMount(){this.startToRight&&(this.leftActive=!1)},beforeCreate(){},destroyed(){}},n=o,r=e(81656),l=(0,r.A)(n,i,a,!1,null,"cc357b0a",null),d=l.exports},5677:function(t,s,e){e.r(s),e.d(s,{default:function(){return ct}});var i=function(){var t=this,s=t._self._c;
1return t.loaded?s("div",[s("SmartStickyHeader",[s("div",{staticClass:"mobile-nav"},[s("select",{directives:[{name:"model",rawName:"v-model",value:t.selectedPoolId,expression:"selectedPoolId"}],staticClass:"round-selector",on:{change:[function(s){var e=Array.prototype.filter.call(s.target.options,(function(t){return t.selected})).map((function(t){var s="_value"in t?t._value:t.value;return s}));t.selectedPoolId=s.target.multiple?e:e[0]},function(s){return t.updateRoute()}]}},[s("option",{domProps:{value:null}},[t._v("Standings")]),t._l(t.poolData.round.event.rounds,(function(e,i){return[1===e.pools.length?[s("option",{domProps:{value:e.pools[0].id}},[t._v("R"+t._s(i+1))])]:t._l(e.pools,(function(e,a){return s("option",{domProps:{value:e.id}},[t._v(" R"+t._s(i+1)),e.name?[t._v(" - "+t._s(e.name))]:[t._v("P"+t._s(t.$store.state.poolConversion[a]))]],2)}))]}))],2),s("select",{directives:[{name:"model",rawName:"v-model",value:t.selectedDivisionId,expression:"selectedDivisionId"}],staticClass:"division-selector",attrs:{disabled:null===t.selectedDivisionId},on:{change:[function(s){var e=Array.prototype.filter.call(s.target.options,(function(t){return t.selected})).map((function(t){var s="_value"in t?t._value:t.value;return s}));t.selectedDivisionId=s.target.multiple?e:e[0]},function(s){return t.updateRoute()}]}},[null===t.selectedDivisionId?s("option",{domProps:{value:null}},[t._v(" No divisions yet ")]):t._e(),t._l(t.availableDivisions,(function(e){return s("option",{domProps:{value:e.id}},[t._v(" "+t._s(e.name)+" ")])}))],2)])]),s("div",{staticClass:"desktop-nav"},[s("CustomDropDown",{staticClass:"round-select",attrs:{position:"left",items:t.roundsItems,disabled:1===t.roundsItems.length},on:{changeRound:function(s){t.selectedPoolId=s,t.updateRoute()}}},[s("div",{staticClass:"selector-wrapper"},[s("p",[s("b",[t._v(t._s(t.selectedPoolName))])]),t.roundsItems.length>1?s("ChevronFat",{attrs:{direction:"down"}}):t._e()],1)]),s("CustomDropDown",{attrs:{position:"left",items:t.divisionItems,disabled:1===t.divisionItems.length},on:{changeDivision:function(s){t.selectedDivisionId=s,t.updateRoute()}}},[s("div",{staticClass:"selector-wrapper",class:{inactive:0===this.availableDivisions.length}},[s("p",[s("b",[t._v(t._s(t.selectedDivisionName))])]),t.divisionItems.length>1?s("ChevronFat",{attrs:{direction:"down"}}):t._e()],1)])],1),"COMPLETED"==t.poolData.status&&"SINGLES"===t.poolData.round.event.scoringAs?s("PublicFinishedPoolResults",{on:{moveDivision:function(s){t.selectedDivisionId=s,t.updateRoute()},updateDivision:function(s){t.selectedDivisionId=s}}}):"COMPLETED"==t.poolData.status?s("PublicFinishedPoolTeamResults",{on:{moveDivision:function(s){t.selectedDivisionId=s,t.updateRoute()},updateDivision:function(s){t.selectedDivisionId=s}}}):"OPEN"!=t.poolData.status&&"PAUSE"!=t.poolData.status||"SINGLES"!==t.poolData.round.event.scoringAs?"OPEN"==t.poolData.status||"PAUSE"==t.poolData.status?s("PublicEventTeamLivePool",{on:{moveDivision:function(s){t.selectedDivisionId=s,t.updateRoute()},updateDivision:function(s){t.selectedDivisionId=s}}}):s("div",{staticClass:"placeholder-message"},[s("PublicPagesPlaceholder",{directives:[{name:"hammer",rawName:"v-hammer:swipe",value:s=>t.moveDivision(s),expression:"(event) => moveDivision(event)",arg:"swipe"}],staticClass:"no-rounds-finished",attrs:{title:t.poolData.round.pools.length>1?"Pool not played yet":"Round not played yet",text:"Once a round is started the results will automagically be available."}})],1):s("PublicEventLivePool",{on:{moveDivision:function(s){t.selectedDivisionId=s,t.updateRoute()},updateDivision:function(s){t.selectedDivisionId=s}}})],1):t._e()},a=[],o=(e(28743),e(65228)),n=function(){var t=this,s=t._self._c;return t.loading?t._e():s("div",{staticClass:"pool-results"},["CLOSED"==t.poolData.status?[s("div",{staticClass:"message"},[t._m(0),s("div",{staticClass:"body"},[t._v(t._s(t.poolDate(t.poolData.date)))])])]:t._e(),t.poolData.leaderboard?[t._l(t.poolLeaderboards,(function(e){return e.players.length>0?s("div",{directives:[{name:"hammer",rawName:"v-hammer:swipe",value:s=>t.moveDivision(s),expression:"(event) => moveDivision(event)",arg:"swipe"}],key:e.type,staticClass:"division-container",class:{watched:"WATCHED"==e.type}},[s("div",{staticClass:"player-info",class:t.resultsTableSize},[s("div",{staticClass:"banner-left"},[s("p",[s("b",[t._v(t._s(e.name))]),t._v(" ("+t._s(e.players.length)+") ")])]),s("div",{staticClass:"player-info-columns"},[s("div",{staticClass:"pos-column",on:{click:function(s){return t.setSorting("place")}}},[s("p",[s("b",[t._v("POS"),"place"==t.utility.sortingCriteria?s("span",{staticClass:"active-sort"}):t._e()])])]),s("div",{staticClass:"player-column",on:{click:function(s){return t.setSorting("firstName")}}},[s("p",[s("b",[t._v("PLAYER"),"firstName"==t.utility.sortingCriteria?s("span",{staticClass:"active-sort"}):t._e()])])]),t._m(1,!0),s("div",{staticClass:"round-column"},[t._m(2,!0),s("p",{staticClass:"pool-par"},[t._v(t._s(t.poolPar))])])]),s("div",{staticClass:"players"},t._l(e.players,(function(i){return s("div",{key:e.type+i.playerId,staticClass:"player",class:{"no-border":t.shownStatRows.includes(i.playerId)}},[s("div",{staticClass:"position"},[s("p",[t._v(t._s(t.formattedPlace(i.place,e.players)))])]),s("div",{staticClass:"name",on:{click:function(s){return t.toggleStatRows(i.playerId)}}},[s("UserProfileAvatar",{attrs:{size:"S",profileImageUrl:i.profileImageUrl,initials:i.firstName.charAt(0)+i.lastName.charAt(0)}}),s("p",[s("b",[t._v(t._s(i.firstName)+" "+t._s(i.lastName))])]),s("Chevron2",{attrs:{direction:t.shownStatRows.includes(i.playerId)?"up":"down"}}
1)],1),t.isPlayerDNF(i.playerResults)?[s("div",{staticClass:"dnf-dns"}),s("div",{staticClass:"dnf-dns"},[s("p",[s("b",[i.isDns?[t._v("DNS")]:[t._v("DNF")]],2)])])]:[s("div",{staticClass:"total"},[s("p",[t._v(" "+t._s(i.roundTotal)+" "),i.penalties.length>0?s("span",[t._v("*")]):t._e()])]),s("div",{staticClass:"round"},[s("p",[s("b",[t._v(" "+t._s(t.parFormatter(i.roundPar))+" ")])])])],t.shownStatRows.includes(i.playerId)?s("div",{staticClass:"player-stats-info-portrait"},[s("div",{staticClass:"main-stats"},[s("div",{staticClass:"circle-hits portrait-stat"},[s("p",[s("b",[t._v("Circle hits")]),t._v(" ("+t._s(i.stats.circleHits.count)+") ")]),s("p",[s("b",[t._v(t._s(t.toPercentage(i.stats.circleHits.part)))]),t._v("% ")]),s("div",{staticClass:"bar"},[s("span",{staticClass:"overlay",style:{width:t.toPercentage(i.stats.circleHits.part)+"%"}})])]),s("div",{staticClass:"conversions portrait-stat"},[s("p",[s("b",[t._v("Conversions")]),t._v(" ("+t._s(i.stats.circleHitConversions.count||0)+") ")]),s("p",[s("b",[t._v(t._s(t.toPercentage(i.stats.circleHitConversions.part)))]),t._v("% ")]),s("div",{staticClass:"bar"},[s("span",{staticClass:"overlay",style:{width:t.toPercentage(i.stats.circleHitConversions.part)+"%"}})])]),s("div",{staticClass:"inside-putts portrait-stat"},[s("p",[s("b",[t._v("Inside putts")]),t._v(" ("+t._s(i.stats.insidePutts.count)+") ")]),s("p",[s("b",[t._v(t._s(t.toPercentage(i.stats.insidePutts.part)))]),t._v("% ")]),s("div",{staticClass:"bar"},[s("span",{staticClass:"overlay",style:{width:t.toPercentage(i.stats.insidePutts.part)+"%"}})])]),s("div",{staticClass:"op-ob portrait-stat"},[t._m(3,!0),s("div",{staticClass:"outside-putts"},[s("p",[s("b",[t._v(t._s(i.stats.outsidePutts.count))])])]),t._m(4,!0),s("div",{staticClass:"out-of-bounds",class:{red:i.stats.penaltyStrokes.count>0}},[s("p",[s("b",[t._v(t._s(i.stats.penaltyStrokes.count))])])])])]),s("div",{staticClass:"user-public-profile"},[s("LeaderboardUserProfile",{attrs:{player:i}})],1)]):t._e(),t.shownStatRows.includes(i.playerId)?s("div",{staticClass:"player-stats-info"},[s("div",{staticClass:"left"},[s("div",{staticClass:"user-public-profile"},[s("LeaderboardUserProfile",{attrs:{player:i}})],1)]),t._m(5,!0),s("div",{staticClass:"total-percentage"},[s("div",[(t.roundNumber,s("p",[s("b",[t._v(t._s(t.toPercentage(i.stats.circleHits.part))+"%")])]))]),s("div",[(t.roundNumber,s("p",[s("b",[t._v(t._s(t.toPercentage(i.stats.circleHitConversions.part))+"%")])]))]),s("div",[(t.roundNumber,s("p",[s("b",[t._v(t._s(t.toPercentage(i.stats.insidePutts.part))+"%")])]))]),s("div",[(t.roundNumber,s("p",[s("b",[t._v(t._s(i.stats.outsidePutts.count))])]))]),s("div",[(t.roundNumber,s("p",[s("b",[t._v(t._s(i.stats.penaltyStrokes.count))])]))])])]):t._e()],2)})),0)]),s("div",{staticClass:"player-results",class:t.resultsTableSize},[s("div",{staticClass:"banner-right"}),s("div",{staticClass:"result-table-wrapper"},[s("div",{staticClass:"player-results-columns"},t._l(t.poolData.layoutVersion.holes,(function(e){return s("div",{staticClass:"hole-info"},[s("p",{staticClass:"hole-number"},[s("b",[t._v(t._s(e.name||e.number))])]),s("p",{staticClass:"hole-par"},[t._v(t._s(e.par))])])})),0),s("div",{staticClass:"players"},t._l(e.players,(function(i){return s("div",{key:e.type+i.playerId,staticClass:"player"},[s("div",{staticClass:"results"},t._l(i.playerResults,(function(e){return s("div",{staticClass:"result",class:[t.parCalc(e.playerPar,e.score)]},[s("p",[e.score?s("b",[t._v(t._s(e.score))]):t._e()])])})),0),t.shownStatRows.includes(i.playerId)?s("div",{staticClass:"player-stats"},[s("div",{staticClass:"circle-hits"},t._l(i.playerResults,(function(e){return s("div",{staticClass:"stat"},[e.isCircleHit?s("span"):t._e()])})),0),s("div",{staticClass:"conversions"},t._l(i.playerResults,(function(e){return s("div",{staticClass:"stat"},[e.isConversion?s("span"):t._e()])})),0),s("div",{staticClass:"inside-putts"},t._l(i.playerResults,(function(e){return s("div",{staticClass:"stat"},[e.isInsidePutt?s("span"):t._e()])})),0),s("div",{staticClass:"outside-putts"},t._l(i.playerResults,(function(e){return s("div",{staticClass:"stat"},[e.isOutsidePutt?s("span"):t._e()])})),0),s("div",{staticClass:"out-of-bounds"},t._l(i.playerResults,(function(e){return s("div",{staticClass:"stat"},[s("p",[e.penaltyStrokes?s("b",[t._v(t._s(e.penaltyStrokes))]):t._e()])])})),0)]):t._e()])})),0)])])]):t._e()})),s("div",{staticClass:"table-footer"},[s("div",{staticClass:"pagination-wrapper"},[t.leaderboardCount>t.pagination.perPage?s("Pagination",{attrs:{total:t.leaderboardCount,perPage:t.pagination.perPage,currentPage:t.pagination.page},on:{back:function(s){t.pagination.page--},forward:function(s){t.pagination.page++},start:function(s){t.pagination.page=0},end:function(s){t.pagination.page=Math.ceil(t.leaderboardCount/t.pagination.perPage)-1}}}):t._e()],1),s("div",{directives:[{name:"hammer",rawName:"v-hammer:swipe",value:s=>t.moveDivision(s),expression:"(event) => moveDivision(event)",arg:"swipe"}],staticClass:"quick-nav-info-container"},[s("SwipeNavigation"),s("p",[t._v(" Swiftly browse divisions by swiping left or right on the above table ")])],1),s("div",{staticClass:"rotate-info-container"},[s("RotateDevice"),s("p",[t._v("Rotate device to view hole-by-hole scores")])],1)])]:[t._m(6)]],2)},r=[function(){var t=this,s=t._self._c;return s("div",{staticClass:"header"},[s("span",[t._v("This round is due to start on")])])},function(){var t=this,s=t._self._c;return s("div",{staticClass:"total-column"},[s("p",[s("b",[t._v("THW")])])])},function(){var t=this,s=t._self._c;return s("p",[s("b",[t._v("PAR")])])},function(){var t=this,s=t._self._c;return s("p",[s("b",[t._v("Outside putts")])])},function(){var t=this,s=t._self._c;return s("p",{staticClass:"ob-text"},[s("b",[t._v("Penalties")])])},function(){var t=this,s=t._self._c;return s("div",{staticClass:"stat-titles"},[s("div",{staticClass:"circle-hits"},[s("p",[t._v("Circle hits:")])]),s("div",{staticClass:"conversions"},[s("p",[t._v("Conversions:")])]),s("div",{staticClass:"inside-putts"},[s("p",[t._v("Inside putts:")])]),s("div",{staticClass:"outside-putts"},[s("p",[t._v("Outside putts:")])]),s("div",{staticClass:"out-of-bounds"},[s("p",[t._v("Penalties:")])])])},function(){var t=this,s=t._self._c;return s("div",{staticClass:"message"},[s("h4",[t._v("This round has no results.")])])}],l=e(57391),d=e(95093),u=e.n(d),c=e(39553),p=e(73315),v=e(91932),h=function(){var t=this,s=t._self._c;return t.userProfile?s("section",{staticClass:"leaderboard-public-user-profile-container"},[s("div",{staticClass:"user-profile-info"},[s("p",{staticClass:"club"},[t._v(" Club: "),t.userProfile.profile.mainClubName?s("span",[t._v(t._s(t.userProfile.profile.mainClubName))]):t.userProfile.profile.club?s("span",[t._v(t._s(t.userProfile.profile.club))]):s("span",[t._v("-")])]),s("p",{staticClass:"pdga"},[t._v(" PDGA: "),t.userProfile.profile.pdgaNumber?s("span",[t._v(t._s(t.userProfile.profile.pdgaNumber))]):s("span",[t._v("-")]),s("span",{staticClass:"round-separator"}),t._v("Rating: "),t.userProfile.profile.pdgaNumber?s("span",[t._v(t._s(t.userProfile.profile.pdgaRating))]):s("span",[t._v(" - ")])]),s("div",{staticClass:"links"},[s("router-link",{attrs:{target:"_blank",to:{name:"public-user",params:{userId:t.player.userId}}}},[s("p",{staticClass:"view-full-profile"},[t._v("View full profile")])]),void 0!==t.watched?[s("p",{staticClass:"round-separator"}),t.watched?s("div",{staticClass:"watch-player unwatch",on:{click:function(s){return t.$emit("toggleWatchPlayer")}}},[s("p",[t._v("Stop watching")])]):s("div",{staticClass:"watch-player",on:{click:function(s){return t.$emit("toggleWatchPlayer")}}},[s("p",[t._v("Watch player")])])]:t._e()],2)])]):t._e()},m=[],f={name:"LeaderboardUserProfile",props:["player","watched"],data(){return{userProfile:null}},computed:{},methods:{async loadUserProfile(t){try{const s=await this.$axios({data:{query:`\n {\n user(userId:"${t}"){\n id\n firstName\n lastName\n profile{\n mainClubName\n club\n pdgaNumber\n pdgaNumber\n pdgaRating\n }\n }\n }\n `}});this.userProfile=s.data.data.user}catch(s){console.log(s),this.$store.dispatch("showMessage",{show:!0,message:"Error loading user data",type:"error"})}}},beforeMount(){this.player&&this.loadUserProfile(this.player.userId)},beforeCreate(){},destroyed(){}},g=f,_=e(81656),y=(0,_.A)(g,h,m,!1,null,"05318279",null),C=y.exports,b=e(36498),P=e(71074),D={name:"PublicFinishedPoolResults",mixins:[l.K],components:{RotateDevice:p.A,SwipeNavigation:v.A,Chevron2:c.A,LeaderboardUserProfile:C,UserProfileAvatar:b.A,Pagination:P.A}
1,data(){return{selectedDivisionId:null,selectedPoolId:null,testexpanded:!1,showByIndex:null,shownStatRows:[],animatedStatRows:[],poolData:{},loading:!0,utility:{showPars:!0,animationDelay:!0,useListAnimation:!1,sortingCriteria:"place",sortDirection:"asc"},pagination:{page:0,perPage:144}}},methods:{formattedPlace(t,s){const e=s.filter((s=>s.place===t)).length>1;return e?`T${t}`:t},moveDivision(t){if(this.availableDivisions.length>1&&this.$store.state.utility.deviceWidth<1200)if(2==t.direction){const t=this.availableDivisions.findIndex((t=>t.id===this.selectedDivisionId));t==this.availableDivisions.length-1?this.$emit("moveDivision",this.availableDivisions[0].id):this.$emit("moveDivision",this.availableDivisions[t+1].id)}else if(4==t.direction){const t=this.availableDivisions.findIndex((t=>t.id===this.selectedDivisionId));0==t?this.$emit("moveDivision",this.availableDivisions[this.availableDivisions.length-1].id):this.$emit("moveDivision",this.availableDivisions[t-1].id)}},setSorting(t){this.utility.sortingCriteria==t&&("asc"==this.utility.sortDirection?this.utility.sortDirection="desc":this.utility.sortDirection="asc"),this.utility.sortingCriteria=t},toggleStatRows(t){this.utility.useListAnimation=!1,this.shownStatRows.includes(t)?this.shownStatRows=this.shownStatRows.filter((s=>t!=s)):this.shownStatRows.push(t)},holeDisplayName(t){return null!=t.name?t.name:t.number},handler(){this.loading=!0,this.$nextTick((()=>{this.loading=!1}))},playerHoleStats(t){let s=0,e={circleHits:{count:0,part:0},circleHitConversions:{count:0,part:0,possibleAttempts:0},insidePutts:{count:0,part:0},outsidePutts:{count:0,part:0},outOfBounds:{count:0,part:0},penaltyStrokes:{count:0,part:0}};return t.forEach((t=>{1==t.score&&s++,t.isCircleHit&&(e.circleHits.count++,e.circleHitConversions.possibleAttempts++),t.isInsidePutt&&t.isCircleHit&&e.circleHitConversions.count++,t.isInsidePutt&&e.insidePutts.count++,t.isOutsidePutt&&e.outsidePutts.count++,t.isOutOfBounds&&e.outOfBounds.count++,t.penaltyStrokes&&(e.penaltyStrokes.count+=t.penaltyStrokes)})),e.insidePutts.count>0&&(e.insidePutts.part=e.insidePutts.count/(t.length-e.outsidePutts.count-s)),e.circleHits.count>0&&(e.circleHits.part=e.circleHits.count/t.length,e.circleHitConversions.part=e.circleHitConversions.count/(e.circleHitConversions.possibleAttempts-s)),e},toggleStatRow(t){this.shownStatRows.includes("stats"+t)?(this.animatedStatRows=this.animatedStatRows.filter((s=>s!=="stats"+t)),setTimeout((()=>{this.shownStatRows=this.shownStatRows.filter((s=>s!=="stats"+t))}),300)):(this.shownStatRows.push("stats"+t),this.$nextTick((()=>{this.animatedStatRows.push("stats"+t)})))},toPercentage(t){return(100*t).toFixed(0)},playerPoolPar(t){let s=0;for(var e=0;e<t.length;e++){let i=this.poolData.layoutVersion.holes.filter((s=>s.id==t[e].hole.id))[0].par,a=t[e].score,o=a-i;s+=o}return this.parFormatter(s)},parFormatter(t){return 0==t||null==t?"E":t>0?"+"+t:t},playerTotalFormatter(t){return null==t?0:t},resultWidth(){return this.poolData.layoutVersion.holes.length>27?"xs":this.poolData.layoutVersion.holes.length>18?"s":this.poolData.layoutVersion.holes.length>9?"m":this.poolData.layoutVersion.holes.length>3?"l":void 0},isPlayerDNF(t){if(t.length!=this.poolData.layoutVersion.holes.length)return!0},toggleShowStatRow(t){if(this.$store.state.utility.deviceWidth>470){let s=this.shownStatRows.indexOf("s"+t);s>-1?this.shownStatRows.splice(s,1):this.shownStatRows.push("s"+t)}},showThisStatRow(t){return this.shownStatRows.indexOf(t)>-1},poolDate(t){return this.$store.state.utility.deviceWidth>1200?u()(t).format("dddd, DD MMMM [at] HH:mm"):u()(t).format("ddd, DD MMM [at] HH:mm")},showPar(t){return 0==t?"E":t>0?"+"+t:t},parCalc(t,s){return 1==s?"ace":t<=-3?"albatross":-2==t?"eagle":-1==t?"birdie":0==t?"par":1==t?"bogey":2==t?"doublebogey":3==t?"tripplebogey":t>=4?"above":""},playersInDivision(t){return this.poolData[t]},loadData(){const t=this.selectedDivisionId?`divisionId: "${this.selectedDivisionId}",`:"";this.$axios({data:{query:`\n {\n pool(poolId:"${this.$router.currentRoute.params.poolId}"){\n leaderboard(${t} page: ${this.pagination.page}){\n ... on PoolLeaderboardDivision {\n id\n name\n type\n totalPlayers\n players{\n playerId\n userId\n place\n score\n par\n isDnf\n isDns\n firstName\n lastName\n profileImageUrl\n pdgaNumber\n pdgaRating\n tjingRating\n results{\n id\n score\n isCircleHit\n isOutsidePutt\n isInsidePutt\n isOutOfBounds\n penaltyStrokes\n hole{\n id\n number\n name\n par\n }\n }\n penalties{\n id\n penalty\n reason\n }\n }\n }\n }\n round{\n event{\n registrationMethod\n rounds{\n id\n pools{\n name\n id\n }\n }\n }\n }\n status\n areGroupsPublic\n startMethod\n date\n id\n layoutVersion{\n id\n layout{\n id \n name\n course{\n name\n }\n }\n holes{\n id\n number\n par\n name\n }\n }\n }\n }\n `}}).then((t=>{this.poolData=t.data.data.pool,this.selectedDivisionId=this.poolData.leaderboard?.id||null,this.$emit("updateDivision",this.selectedDivisionId),this.loading=!1}))}},watch:{pagination:{handler:function(t,s){this.loadData()},deep:!0},$route(){this.selectedDivisionId=this.$route.params.divisionId,this.selectedPoolId=this.$route.params.poolId,this.pagination.page=0,this.loadData()}},computed:{availableDivisions(){return this.eventDivisionPools.divisions.filter((t=>this.divisionsInPool.map((t=>t.divisionId)).includes(t.id)))},divisionsInPool(){return this.eventDivisionPools.pools.filter((t=>t.poolId==this.poolData.id))},eventDivisionPools(){return this.$store.state.eventDivisionPools},leaderboardCount(){return this.poolData.leaderboard.totalPlayers},resultsTableSize(){const t=this.poolData.layoutVersion.holes.length;return t<=9?"small":t<=18?"medium":"large"},poolLeaderboards(){const t=[this.poolData.leaderboard],s=this.poolData.layoutVersion.holes,e=t.map((t=>
1(t.players.forEach((t=>{t.roundPar=t.par,t.roundTotal=t.score,t.playerResults=[],s.forEach((s=>{let e=t.results.find((t=>t.hole.id==s.id)),i={result:null,score:null,isCircleHit:null,isConversion:null,isInsidePutt:null,isOutsidePutt:null,isOutOfBounds:null,penaltyStrokes:0,playerPar:null};if(e){let t=e.score-s.par;i.result=e,i.score=e.score,i.isCircleHit=e.isCircleHit,i.isConversion=e.isCircleHit&&e.isInsidePutt,i.isInsidePutt=e.isInsidePutt,i.isOutsidePutt=e.isOutsidePutt,i.isOutOfBounds=e.isOutOfBounds,i.penaltyStrokes=e.penaltyStrokes,i.playerPar=t}t.stats=this.playerHoleStats(t.results),t.playerResults.push(i)}))})),t.players.sort(((t,s)=>"asc"===this.utility.sortDirection?"firstName"==this.utility.sortingCriteria?t.firstName.toLowerCase()<s.firstName.toLowerCase()?-1:0:t.place-s.place:"firstName"==this.utility.sortingCriteria?t.firstName.toLowerCase()>s.firstName.toLowerCase()?-1:0:s.place-t.place)),t)));return e},colSpanCalc(){return this.$store.state.utility.deviceWidth>=1200?6:5},statRowColspanCalculator(){return this.$store.state.utility.deviceWidth>=1200?4:3},roundNumber(){for(var t=0;t<this.poolData.round.event.rounds.length;t++)for(var s=0;s<this.poolData.round.event.rounds[t].pools.length;s++)if(this.poolData.round.event.rounds[t].pools[s].id==this.poolData.id)return t+1;return 3},poolPar(){let t=0;for(var s=0;s<this.poolData.layoutVersion.holes.length;s++)t+=this.poolData.layoutVersion.holes[s].par;return t}},mounted(){this.selectedDivisionId=this.$route.params.divisionId,this.selectedPoolId=this.$route.params.poolId,this.loadData()},beforeDestroy(){}},w=D,I=(0,_.A)(w,n,r,!1,null,"777cdbf6",null),S=I.exports,R=function(){var t=this,s=t._self._c;return t.loaded?s("div",{staticClass:"live-pool"},[s("div",{staticClass:"live-controls"},["PUBLIC"==t.poolData.layoutVersion.layout.course.type?s("div",{staticClass:"course-info"},[s("router-link",{attrs:{to:{name:"course-overview",params:{courseId:t.poolData.layoutVersion.layout.course.id}}}},[s("p",[s("b",[t._v(t._s(t.poolData.layoutVersion.layout.course.name))])])]),s("router-link",{attrs:{to:{name:"course-layout",params:{courseId:t.poolData.layoutVersion.layout.course.id,layoutId:t.poolData.layoutVersion.layout.id}}}},[s("p",[t._v(" "+t._s(t.poolData.layoutVersion.layout.name)+" ")])])],1):s("div",{staticClass:"course-info"},[s("p",[s("b",[t._v(t._s(t.poolData.layoutVersion.layout.course.name))])]),s("p",[t._v(" "+t._s(t.poolData.layoutVersion.layout.name)+" ")])]),s("div",{staticClass:"control-spacer"}),s("div",{staticClass:"auto-refresh"},[s("div",{staticClass:"text"},[t._m(0),s("p",{staticClass:"super-small"},[t._v(" Updated: "+t._s(t.lastUpdated(t.scoresLastLoaded))+" ")])]),s("DefaultToggle",{model:{value:t.autoReFresh,callback:function(s){t.autoReFresh=s},expression:"autoReFresh"}})],1)]),t._l(t.poolLeaderboards,(function(e){return e.players.length>0?s("div",{directives:[{name:"hammer",rawName:"v-hammer:swipe",value:s=>t.moveDivision(s),expression:"(event) => moveDivision(event)",arg:"swipe"}],key:e.type,staticClass:"division-container",class:{watched:"WATCHED"==e.type}},[s("div",{staticClass:"player-info",class:t.resultsTableSize},[s("div",{staticClass:"banner-left"},[s("p",[s("b",[t._v(t._s(e.name))]),t._v(" ("+t._s(e.players.length)+") ")])]),s("div",{staticClass:"player-info-columns"},[t._m(1,!0),t._m(2,!0),t._m(3,!0),s("div",{staticClass:"total-column"},[t._m(4,!0),t.utility.showPars&&1==t.roundNumber?s("p",{staticClass:"pool-par"},[t._v(" "+t._s(t.poolPar())+" ")]):t._e()]),t.roundNumber>1?s("div",{staticClass:"round-column"},[t._m(5,!0),t.utility.showPars?s("p",{staticClass:"pool-par"},[t._v(t._s(t.poolPar()))]):t._e()]):t._e()]),s("div",{staticClass:"players"},[s("transition-group",{attrs:{name:t.utility.useListAnimation?"list-complete":""}},t._l(e.players,(function(i,a){return s("div",{key:e.type+i.playerId,staticClass:"player",class:{"no-border":t.shownStatRows.includes(e.type+i.playerId)},style:{"animation-delay":.05*a+"s"}},[null!==i.placeChange?s("div",{staticClass:"position place-changed"},[s("p",[s("b",[t._v(t._s(t.formattedPlace(i.place,e.players)))])]),i.placeChange?s("div",{staticClass:"place-change",class:{down:i.placeChange>0}},[s("PositionChange",{attrs:{up:i.placeChange<0}}
1),s("p",[t._v(t._s(Math.abs(i.placeChange)))])],1):t._e()]):s("div",{staticClass:"position"},[s("p",[s("b",[t._v(t._s(i.place))])])]),s("div",{staticClass:"name",on:{click:function(s){return t.toggleStatRows(e.type+i.playerId)}}},[s("UserProfileAvatar",{attrs:{size:"S",initials:i.firstName.charAt(0)+i.lastName.charAt(0),profileImageUrl:i.profileImageUrl}}),s("p",[s("b",[t._v(t._s(i.firstName)+" "+t._s(i.lastName))])]),s("Chevron2",{attrs:{direction:t.shownStatRows.includes(e.type+i.playerId)?"up":"down"}})],1),i.isDnf||i.isDns?[s("div",{staticClass:"thru"}),s("div",{staticClass:"dnf-dns"},[s("p",[s("b",[i.isDnf?[t._v("DNF")]:[t._v("DNS")]],2)])]),t.roundNumber>1?s("div",{staticClass:"round"},[t.utility.showPars?s("p",[t._v(" "+t._s(t.parFormatter(i.roundPar))+" ")]):s("p",[t._v(t._s(i.roundTotal))])]):t._e()]:[s("div",{staticClass:"thru"},[0!==t.thruCount(i.playerResults,t.poolData.layoutVersion)||null==i.startsAt?s("p",[t._v(" "+t._s(t.thruCount(i.playerResults,t.poolData.layoutVersion))+" ")]):s("p",[t._v(" "+t._s(t.formattedStartTime(i.startsAt))+" ")])]),s("div",{staticClass:"total"},[t.utility.showPars?s("p",[s("b",[t._v(t._s(t.parFormatter(i.totalPar)))])]):s("p",[s("b",[t._v(t._s(i.totalScore))])])]),t.roundNumber>1?s("div",{staticClass:"round"},[t.utility.showPars?s("p",[t._v(" "+t._s(t.parFormatter(i.roundPar))+" ")]):s("p",[t._v(t._s(i.roundTotal))])]):t._e()],t.shownStatRows.includes(e.type+i.playerId)?s("div",{staticClass:"player-stats-info-portrait"},[s("div",{staticClass:"main-stats"},[s("div",{staticClass:"circle-hits portrait-stat"},[s("p",[s("b",[t._v("Circle hits")]),t._v(" ("+t._s(i.stats.circleHits.count)+") ")]),s("p",[s("b",[t._v(t._s(t.toPercentage(i.stats.circleHits.part)))]),t._v("% ")]),s("div",{staticClass:"bar"},[s("span",{staticClass:"overlay",class:{full:1==i.stats.circleHits.part},style:{width:t.toPercentage(i.stats.circleHits.part)+"%"}})])]),s("div",{staticClass:"conversions portrait-stat"},[s("p",[s("b",[t._v("Conversions")]),t._v(" ("+t._s(i.stats.circleHitConversions.count||0)+") ")]),s("p",[s("b",[t._v(t._s(t.toPercentage(i.stats.circleHitConversions.part)))]),t._v("% ")]),s("div",{staticClass:"bar"},[s("span",{staticClass:"overlay",class:{full:1==i.stats.circleHitConversions.part},style:{width:t.toPercentage(i.stats.circleHitConversions.part)+"%"}})])]),s("div",{staticClass:"inside-putts portrait-stat"},[s("p",[s("b",[t._v("Inside putts")]),t._v(" ("+t._s(i.stats.insidePutts.count)+") ")]),s("p",[s("b",[t._v(t._s(t.toPercentage(i.stats.insidePutts.part)))]),t._v("% ")]),s("div",{staticClass:"bar"},[s("span",{staticClass:"overlay",class:{full:1==i.stats.insidePutts.part},style:{width:t.toPercentage(i.stats.insidePutts.part)+"%"}})])]),s("div",{staticClass:"op-ob portrait-stat"},[s("p",[s("b",[t._v("Outside putts")])]),s("div",{staticClass:"outside-putts",class:{empty:0==i.stats.outsidePutts.count}},[s("p",[s("b",[t._v(t._s(i.stats.outsidePutts.count))])])]),s("p",{staticClass:"ob-text"},[s("b",[t._v("Penalties")])]),s("div",{staticClass:"out-of-bounds",class:{red:i.stats.penaltyStrokes.count>0}},[s("p",[s("b",[t._v(t._s(i.stats.penaltyStrokes.count))])])])])]),s("div",{staticClass:"user-public-profile"},[s("LeaderboardUserProfile",{attrs:{player:i,watched:t.watchedPlayers.some((t=>t.userId==i.userId))},on:{toggleWatchPlayer:function(s){return t.togglePlayerWatcher(i,e.type)}}})],1)]):t._e(),t.shownStatRows.includes(e.type+i.playerId)?s("div",{staticClass:"player-stats-info"},[s("div",{staticClass:"left",style:{flex:1==t.roundNumber?4:5}},[s("div",{staticClass:"user-public-profile"},[s("LeaderboardUserProfile",{attrs:{player:i,watched:t.watchedPlayers.some((t=>t.userId==i.userId))},on:{toggleWatchPlayer:function(s){return t.togglePlayerWatcher(i,e.type)}}})],1)]),s("div",{staticClass:"stat-titles"},[s("div",{staticClass:"circle-hits"},[s("p",[t._v("Circle hits:")])]),s("div",{staticClass:"conversions"},[s("p",[t._v("Conversions:")])]),s("div",{staticClass:"inside-putts"},[s("p",[t._v("Inside putts:")])]),s("div",{staticClass:"outside-putts"},[s("p",[t._v("Outside putts:")])]),s("div",{staticClass:"out-of-bounds"},[s("p",[t._v("Penalties:")])])]),s("div",{staticClass:"total-percentage"},[s("div",[(t.roundNumber,s("p",[s("b",[t._v(t._s(t.toPercentage(i.stats.circleHits.part))+"%")])]))]),s("div",[(t.roundNumber,s("p",[s("b",[t._v(t._s(t.toPercentage(i.stats.circleHitConversions.part))+"%")])]))]),s("div",[(t.roundNumber,s("p",[s("b",[t._v(t._s(t.toPercentage(i.stats.insidePutts.part))+"%")])]))]),s("div",[(t.roundNumber,s("p",[s("b",[t._v(t._s(i.stats.outsidePutts.count))])]))]),s("div",[(t.roundNumber,s("p",[s("b",[t._v(t._s(i.stats.penaltyStrokes.count))])]))])])]):t._e()],2)})),0)],1)]),s("div",{staticClass:"player-results",class:t.resultsTableSize},[s("div",{staticClass:"banner-right"}),s("div",{staticClass:"result-table-wrapper"},[s("div",{staticClass:"player-results-columns"},t._l(t.poolData.layoutVersion.holes,(function(e){return s("div",{staticClass:"hole-info"},[s("p",{staticClass:"hole-number"},[s("b",[t._v(t._s(e.name||e.number))])]),s("p",{staticClass:"hole-par"},[t._v(t._s(e.par))])])})),0),s("div",{staticClass:"players"},[s("transition-group",{attrs:{name:t.utility.useListAnimation?"list-complete":""}},t._l(e.players,(function(i,a){return s("div",{key:e.type+i.playerId,staticClass:"player",style:{"animation-delay":.05*a+"s"}},[s("div",{staticClass:"results"},t._l(i.playerResults,(function(e){return s("div",{staticClass:"result",class:[t.parCalc(e.playerPar,e.score),{updated:e.updated}]},[s("p",[e.score?s("b",[t._v(t._s(e.score))]):t._e()])])})),0),t.shownStatRows.includes(e.type+i.playerId)?s("div",{staticClass:"player-stats"},[s("div",{staticClass:"circle-hits"},t._l(i.playerResults,(function(e){return s("div",{staticClass:"stat"},[e.isCircleHit?s("span"):t._e()])})),0),s("div",{staticClass:"conversions"},t._l(i.playerResults,(function(e){return s("div",{staticClass:"stat"},[e.isConversion?s("span"):t._e()])})),0),s("div",{staticClass:"inside-putts"},t._l(i.playerResults,(function(e){return s("div",{staticClass:"stat"},[e.isInsidePutt?s("span"):t._e()])})),0),s("div",{staticClass:"outside-putts"},t._l(i.playerResults,(function(e){return s("div",{staticClass:"stat"},[e.isOutsidePutt?s("span"):t._e()])})),0),s("div",{staticClass:"out-of-bounds"},t._l(i.playerResults,(function(e){return s("div",{staticClass:"stat"},[s("p",[e.penaltyStrokes?s("b",[t._v(t._s(e.penaltyStrokes))]):t._e()])])})),0)]):t._e()])})),0)],1)])])]):t._e()})),s("div",{staticClass:"table-footer"},[s("div",{staticClass:"pagination-wrapper"},[t.leaderboardCount>t.pagination.perPage?s("Pagination",{attrs:{total:t.leaderboardCount,perPage:t.pagination.perPage,currentPage:t.pagination.page},on:{back:function(s){t.pagination.page--},forward:function(s){t.pagination.page++},start:function(s){t.pagination.page=0},end:function(s){t.pagination.page=Math.ceil(t.leaderboardCount/t.pagination.perPage)-1}}}):t._e()],1),s("div",{directives:[{name:"hammer",rawName:"v-hammer:swipe",value:s=>t.moveDivision(s),expression:"(event) => moveDivision(event)",arg:"swipe"}],staticClass:"quick-nav-info-container"},[s("SwipeNavigation"),s("p",[t._v(" Swiftly browse divisions by swiping left or right on the above table ")])],1),s("div",{staticClass:"rotate-info-container"},[s("RotateDevice"),s("p",[t._v("Rotate device to view hole-by-hole scores")])],1)])],2):t._e()},N=[function(){var t=this,s=t._self._c;return s("p",[s("b",[t._v("Auto Update")])])},function(){var t=this,s=t._self._c;return s("div",{staticClass:"pos-column"},[s("p",[s("b",[t._v("POS")])])])},function(){var t=this,s=t._self._c;return s("div",{staticClass:"player-column"},[s("p",[s("b",[t._v("PLAYER")])])])},function(){var t=this,s=t._self._c;return s("div",{staticClass:"thru-column"},[s("p",[s("b",[t._v("THRU")])])])},function(){var t=this,s=t._self._c;return s("p",[s("b",[t._v("TOT")])])},function(){var t=this,s=t._self._c;return s("p",[s("b",[t._v("RD")])])}],O=function(){var t=this,s=t._self._c;return s("svg",{class:{up:t.up,down:!t.up},attrs:{xmlns:"http://www.w3.org/2000/svg",width:"5",height:"4",viewBox:"0 0 5 4"}},[s("g",{attrs:{id:"Group_2563","data-name":"Group 2563",transform:"translate(-0.5 0.467)"}},[s("path",{attrs:{id:"Polygon_21","data-name":"Polygon 21",d:"M2.5,0,5,4H0Z",transform:"translate(0.5 -0.467)",fill:"#0c9"}})])])},$=[],T={name:"PositionChange",props:["up"]},H=T,A=(0,_.A)(H,O,$,!1,null,"33ddd73f",null),L=A.exports,k=e(64776);const F="LivePlayersWatched",x="LiveTeamsWatched";function E(t){const s=localStorage.getItem(t);if(!s)return[];try{const t=JSON.parse(s);return Array.isArray(t)?t:[]}catch(e){return[]}}function B(t,s){const e=Array.isArray(s)?s:[];return localStorage.setItem(t,JSON.stringify(e)),V(t,e),e}function V(t,s){if("function"!==typeof window.ReactNativeWebView?.postMessage)return!1;try{return window.ReactNativeWebView.postMessage(JSON.stringify({type:"STORAGE_UPDATE",data:{key:t,value:s}})),!0}catch(e){return!1}}var W={name:"PublicEventLivePool",components:{RotateDevice:p.A,SwipeNavigation:v.A,Chevron2:c.A,PositionChange:L,DefaultToggle:k.A,LeaderboardUserProfile:C,UserProfileAvatar:b.A,Pagination:P.A},data(){return{selectedDivisionId:null,utility:{showPars:!0,animationDelay:!0,useListAnimation:!1},existingScores:[],leaderboard:[],loaded:!1,isLoading:!1,shownStatRows:[],poolData:null,wat
1chedPlayers:[],watchedUsers:[],autoReFresh:!1,autoReFreshInterval:null,windowFocused:!0,scoresLastLoaded:null,poolLeaderboards:null,userProfilesData:[],pagination:{page:0,perPage:144},loadDataTimeout:null}},watch:{pagination:{handler:function(t,s){const e=this.restoreFromCache();e||this.loadData()},deep:!0},$route(){this.selectedDivisionId=this.$route.params.divisionId,this.pagination.page=0;const t=this.restoreFromCache();t||this.loadData()},windowFocused:function(t,s){t&&this.scoresLastLoaded.isBefore(u()().subtract(30,"seconds"))&&this.loadData()},autoReFresh:function(t,s){t?(this.loadData(),localStorage.setItem("autoReFreshEnabled",JSON.stringify({enabled:!0,createdAt:u()().toISOString()})),this.autoReFreshInterval=setInterval((()=>{document.hidden||this.loadData()}),10100)):(clearInterval(this.autoReFreshInterval),localStorage.removeItem("autoReFreshEnabled"))}},computed:{cacheKey(){return`${this.$route.params.poolId}-${this.$route.params.divisionId}-${this.pagination.page}`},leaderboardCount(){return this.poolData.livescore?.totalPlayers},availableDivisions(){return this.eventDivisionPools?.divisions?.filter((t=>this.divisionsInPool.map((t=>t.divisionId)).includes(t.id)))},divisionsInPool(){return this.eventDivisionPools?.pools.filter((t=>t.poolId==this.poolData.id))},eventDivisionPools(){return this.$store.state.eventDivisionPools},roundNumber(){let t=1;return this.poolData.round.event.rounds.forEach(((s,e)=>{s.pools.forEach((s=>{s.id==this.poolData.id&&(t=e+1)}))})),t},resultsTableSize(){const t=this.poolData.layoutVersion.holes.length;return t<=9?"small":t<=18?"medium":"large"}},methods:{formattedPlace(t,s){const e=s.filter((s=>s.place===t)).length>1;return e?`T${t}`:t},moveDivision(t){if(this.availableDivisions.length>1&&this.$store.state.utility.deviceWidth<1200)if(2==t.direction){const t=this.availableDivisions.findIndex((t=>t.id===this.selectedDivisionId));t==this.availableDivisions.length-1?this.$emit("moveDivision",this.availableDivisions[0].id):this.$emit("moveDivision",this.availableDivisions[t+1].id)}else if(4==t.direction){const t=this.availableDivisions.findIndex((t=>t.id===this.selectedDivisionId));0==t?this.$emit("moveDivision",this.availableDivisions[this.availableDivisions.length-1].id):this.$emit("moveDivision",this.availableDivisions[t-1].id)}},cacheScores(){const t=JSON.parse(localStorage.getItem("live-scores")),s={...t,[this.cacheKey]:JSON.stringify({data:this.poolData,timestamp:u()().toISOString()})};localStorage.setItem("live-scores",JSON.stringify(s))},cleanupCache(){const t=JSON.parse(localStorage.getItem("live-scores")||"{}"),s=u()();let e=!1;Object.keys(t).forEach((i=>{const a=JSON.parse(t[i]);u()(a.timestamp).isBefore(s.subtract(1,"minute"))&&(delete t[i],e=!0)}));const i=this.$route.params.poolId;Object.keys(t).forEach((s=>{s.startsWith(`${i}-`)||(delete t[s],e=!0)})),e&&localStorage.setItem("live-scores",JSON.stringify(t))},restoreFromCache(){this.cleanupCache();const t=JSON.parse(localStorage.getItem("live-scores")||"{}");if(!t[this.cacheKey])return!1;try{const s=JSON.parse(t[this.cacheKey]);if(u()(s.timestamp).isBefore(u()().subtract(1,"minute")))return delete t[this.cacheKey],localStorage.setItem("live-scores",JSON.stringify(t)),!1;this.poolData=s.data,this.watchedUsers=s.data.livescore?.watchedUsers,this.selectedDivisionId=this.$route.params.divisionId||this.poolData.livescore?.id,this.$emit("updateDivision",this.selectedDivisionId),this.scoresLastLoaded=u()(s.timestamp),this.loaded=!0,this.poolLeaderboards=this.createLeaderboards();const e=E(F);return e&&(this.watchedPlayers=e),!0}catch(s){return console.error("Error restoring from cache:",s),delete t[this.cacheKey],localStorage.setItem("live-scores",JSON.stringify(t)),!1}},availableDivisionsInPool(t){return this.eventDivisionPools.pools.filter((s=>s.poolId==t))},formattedStartTime(t){return u()(t).format("HH:mm")},lastUpdated(t){return t.format("HH:mm")},focusFunction(t){"blur"==t.type?this.windowFocused=!1:"focus"==t.type&&(this.windowFocused=!0)},togglePlayerWatcher(t,s){let e=!1;localStorage.removeItem("live-scores"),e=this.watchedPlayers.some((s=>
1s.userId==t.userId)),0==e?this.watchedPlayers.push({userId:t.userId,createdAt:u()().toISOString()}):this.watchedPlayers=this.watchedPlayers.filter((s=>s.userId!=t.userId)),this.watchedPlayers.length>50&&this.watchedPlayers.shift(),this.toggleStatRows(s+t.playerId),this.$nextTick((()=>{this.saveWatchedPlayers(),this.loadData()}))},saveWatchedPlayers(){B(F,this.watchedPlayers)},poolPar(){let t=0;for(var s=0;s<this.poolData.layoutVersion.holes.length;s++)t+=this.poolData.layoutVersion.holes[s].par;return t},parCalc(t,s){return 1==s?"ace":t<=-3?"albatross":-2==t?"eagle":-1==t?"birdie":0==t?"par":1==t?"bogey":2==t?"doublebogey":3==t?"tripplebogey":t>=4?"above":""},toPercentage(t){return(100*t).toFixed(0)},parFormatter(t){return 0==t||null==t?"E":t>0?"+"+t:t},createLeaderboards(){this.utility.useListAnimation=!0;const t=this.poolData.livescore?[this.poolData.livescore]:null,s=this.poolData.layoutVersion.holes;if(t){const e=t.map((t=>(t.players.forEach((t=>{t.roundPar=0,t.roundTotal=0,t.playerResults=[],s.forEach((s=>{let e=t.results.find((t=>t.holeId==s.id)),i={result:null,score:null,isCircleHit:null,isConversion:null,isInsidePutt:null,isOutsidePutt
1:null,isOutOfBounds:null,penaltyStrokes:0,playerPar:null,updated:!1};if(e){this.existingScores.some((t=>t.id==e.id&&t.score==e.score))||(this.existingScores.push({id:e.id,score:e.score}),i.updated=!0);let a=e.score-s.par;t.roundPar+=a,t.roundTotal+=e.score,i.result=e,i.score=e.score,i.isCircleHit=e.isCircleHit,i.isConversion=e.isCircleHit&&e.isInsidePutt,i.isInsidePutt=e.isInsidePutt,i.isOutsidePutt=e.isOutsidePutt,i.isOutOfBounds=e.isOutOfBounds,i.penaltyStrokes=e.penaltyStrokes,i.playerPar=a}t.playerResults.push(i)}))})),t))),i=this.watchedUsers.map((t=>(t.roundPar=0,t.roundTotal=0,t.playerResults=[],s.forEach((s=>{let e=t.results.find((t=>t.holeId==s.id)),i={result:null,score:null,isCircleHit:null,isConversion:null,isInsidePutt:null,isOutsidePutt:null,isOutOfBounds:null,penaltyStrokes:0,playerPar:null,updated:!1};if(e){this.existingScores.some((t=>t.id==e.id&&t.score==e.score))||(this.existingScores.push({id:e.id,score:e.score}),i.updated=!0);let a=e.score-s.par;t.roundPar+=a,t.roundTotal+=e.score,i.result=e,i.score=e.score,i.isCircleHit=e.isCircleHit,i.isConversion=e.isCircleHit&&e.isInsidePutt,i.isInsidePutt=e.isInsidePutt,i.isOutsidePutt=e.isOutsidePutt,i.isOutOfBounds=e.isOutOfBounds,i.penaltyStrokes=e.penaltyStrokes,i.playerPar=a}t.playerResults.push(i)})),t))),a={id:"watchedDivision",name:"Watched players",type:"WATCHED",players:i};return[a,...e]}return null},toggleStatRows(t){this.utility.useListAnimation=!1,this.shownStatRows.includes(t)?this.shownStatRows=this.shownStatRows.filter((s=>t!=s)):this.shownStatRows.push(t)},thruCount(t,s){const e=t.filter((t=>null!=t?.score)).length,i=s.holes.length;return e==i?"F":t.filter((t=>null!=t?.score)).length},async loadData(){if(this.loadDataTimeout&&clearTimeout(this.loadDataTimeout),this.isLoading)this.loadDataTimeout=setTimeout((()=>this.loadData()),1e3);else{this.isLoading=!0,this.cleanupCache();try{const t=[],s=E(F);s.length>0&&(t.push(...s.map((t=>t.userId))),this.watchedPlayers=s);const e=this.selectedDivisionId?`divisionId: "${this.selectedDivisionId}", `:"",i=await this.$axios({data:{query:`\n {\n pool(poolId:"${this.$router.currentRoute.params.poolId}"){\n status\n id\n areGroupsPublic\n round{\n id\n pools{\n id\n }\n event{\n id\n endDate\n rounds{\n id\n pools{\n name\n id\n }\n }\n\n }\n }\n layoutVersion{\n id\n layout{\n id\n name\n course{\n id\n type\n name\n }\n }\n holes{\n id\n number\n name\n par\n }\n }\n livescore(${e} page: ${this.pagination.page}, watchedUserIds: [${t.map((t=>'"'+t+'"'))}]){\n ... on PoolLivescoreDivision {\n id\n name\n type\n totalPlayers\n watchedUsers{\n placeChange\n startsAt\n playerId\n userId\n place\n firstName\n lastName\n profileImageUrl\n isDnf\n isDns\n totalScore\n totalPar\n stats{\n circleHitConversions{\n part\n count\n }\n circleHits{\n part\n count\n }\n insidePutts{\n part\n count\n }\n outsidePutts{\n count\n }\n outOfBounds{\n count\n }\n penaltyStrokes{\n count\n }\n }\n results{\n id\n score\n holeId\n isCircleHit\n isInsidePutt\n isOutsidePutt\n isOutOfBounds\n penaltyStrokes\n }\n }\n players{\n placeChange\n startsAt\n playerId\n userId\n place\n firstName\n lastName\n profileImageUrl\n isDnf\n isDns\n totalScore\n totalPar\n stats{\n circleHitConversions{\n part\n count\n }\n circleHits{\n part\n count\n }\n insidePutts{\n part\n count\n }\n outsidePutts{\n count\n }\n outOfBounds{\n count\n }\n penaltyStrokes{\n count\n }\n }\n results{\n id\n score\n holeId\n isCircleHit\n isInsidePutt\n isOutsidePutt\n isOutOfBounds\n penaltyStrokes\n }\n }\n }\n }\n }\n }\n `}});if(!this.isLoading)return;this.poolData=i.data.data.pool,this.watchedUsers=this.poolData.livescore?.watchedUsers,this.selectedDivisionId=this.$route.params.divisionId||i.data.data.pool.livescore?.id,this.$emit("updateDivision",this.selectedDivisionId),this.loaded=!0,this.scoresLastLoaded=u()(),this.cacheScores();const a=E(F);if(a.length>0){let t=a;t=t.filter((t=>u()(t.createdAt).isAfter(u()().subtract(14,"days")))),this.watchedPlayers=t,B(F,this.watchedPlayers)}else B(F,[]);this.poolLeaderboards=this.createLeaderboards()}catch(t){console.error("Error loading live pool data:",t)}finally{this.isLoading=!1}}}},beforeDestroy(){window.removeEventListener("blur",this.focusFunction),window.removeEventListener("focus",this.focusFunction),clearInterval(this.autoReFreshInterval),this.loadDataTimeout&&clearTimeout(this.loadDataTimeout),this.isLoading=!1},mounted(){this.selectedDivisionId=this.$route.params.divisionId;const t=this.restoreFromCache();if(t||this.loadData(),localStorage.getItem("autoReFreshEnabled")){const t=JSON.parse(localStorage.getItem("autoReFreshEnabled"));u()(t.createdAt).isBefore(u()().subtract(1,"days"))||0==t.enabled?localStorage.removeItem("autoReFreshEnabled"):this.autoReFresh=!0}window.addEventListener("blur",this.focusFunction),window.addEventListener("focus",this.focusFunction)}},U=W,M=(0,_.A)(U,R,N,!1,null,"692bfc64",null),J=M.exports,q=function(){var t=this,s=t._self._c;return t.loaded?s("div",{staticClass:"live-pool"}
1,[s("div",{staticClass:"live-controls"},[s("div",{staticClass:"auto-refresh"},[s("div",{staticClass:"text"},[t._m(0),s("p",{staticClass:"super-small"},[t._v(" Updated: "+t._s(t.lastUpdated(t.scoresLastLoaded))+" ")])]),s("DefaultToggle",{model:{value:t.autoReFresh,callback:function(s){t.autoReFresh=s},expression:"autoReFresh"}})],1),s("div",{staticClass:"control-spacer"}),s("TjingTextOptionToggle",{staticClass:"par-throw-toggle",attrs:{width:120,leftValue:"Par",rightValue:"Throws"},on:{left:function(s){t.utility.showPars=!0},right:function(s){t.utility.showPars=!1}}})],1),t._l(t.poolLeaderboards,(function(e){return e.players.length>0?s("div",{directives:[{name:"hammer",rawName:"v-hammer:swipe",value:s=>t.moveDivision(s),expression:"(event) => moveDivision(event)",arg:"swipe"}],key:e.type,staticClass:"division-container",class:{watched:"WATCHED"==e.type}},[s("div",{staticClass:"player-info",class:t.resultsTableSize},[s("div",{staticClass:"banner-left"},[s("p",[s("b",[t._v(t._s(e.name))]),t._v(" ("+t._s(e.players.length)+") ")])]),s("div",{staticClass:"player-info-columns"},[t._m(1,!0),t._m(2,!0),t._m(3,!0),s("div",{staticClass:"total-column"},[t._m(4,!0),t.utility.showPars&&1==t.roundNumber?s("p",{staticClass:"pool-par"},[t._v(" "+t._s(t.poolPar())+" ")]):t._e()]),t.roundNumber>1?s("div",{staticClass:"round-column"},[t._m(5,!0),t.utility.showPars?s("p",{staticClass:"pool-par"},[t._v(t._s(t.poolPar()))]):t._e()]):t._e()]),s("div",{staticClass:"players"},[s("transition-group",{attrs:{name:t.utility.useListAnimation?"list-complete":""}},t._l(e.players,(function(i,a){return s("div",{key:e.type+i.team.id,staticClass:"player",class:{"no-border":t.shownStatRows.includes(i.team.id),"no-team-name":0==t.poolData.round.event.defaultToTeamName},style:{"animation-delay":.05*a+"s"}},[null!==i.placeChange?s("div",{staticClass:"position place-changed"},[s("p",[s("b",[t._v(t._s(t.formattedPlace(i.place,e.players)))])]),i.placeChange?s("div",{staticClass:"place-change",class:{down:i.placeChange>0}},[s("PositionChange",{attrs:{up:i.placeChange<0}}),s("p",[t._v(t._s(Math.abs(i.placeChange)))])],1):t._e()]):s("div",{staticClass:"position"},[s("p",[t._v(t._s(i.place))])]),t.poolData.round.event.defaultToTeamName?s("div",{staticClass:"name",on:{click:function(s){return t.toggleStatRows(e.type+i.team.id)}}},[s("p",[s("b",[t._v(t._s(i.team.name))])]),s("Chevron2",{attrs:{direction:t.shownStatRows.includes(i.team.id)?"up":"down"}})],1):s("div",{staticClass:"name",on:{click:function(s){return t.toggleStatRows(e.type+i.team.id)}}},[s("div",{staticClass:"name-wrapper"},t._l(i.team.teamPlayers,(function(e){return s("p",[s("b",[t._v(t._s(e.user.firstName)+" "+t._s(e.user.lastName))])])})),0),s("Chevron2",{attrs:{direction:t.shownStatRows.includes(e.type+i.team.id)?"up":"down"}})],1),null!==i.dnfDns?[s("div",{staticClass:"thru"}),s("div",{staticClass:"total"},[s("p",[s("b",[t._v(t._s(i.dnfDns))])])])]:[s("div",{staticClass:"thru"},[0!==t.thruCount(i.playerResults,t.poolData.layoutVersion)||null==i.startsAt?s("p",[t._v(" "+t._s(t.thruCount(i.playerResults,t.poolData.layoutVersion))+" ")]):s("p",[t._v(" "+t._s(t.formattedStartTime(i.startsAt))+" ")])]),s("div",{staticClass:"total"},[t.utility.showPars?s("p",[s("b",[t._v(t._s(t.parFormatter(i.totalPar)))])]):s("p",[s("b",[t._v(t._s(i.totalScore))])])])],t.roundNumber>1?s("div",{staticClass:"round"},[t.utility.showPars?s("p",[t._v(" "+t._s(t.parFormatter(i.roundPar))+" ")]):s("p",[t._v(t._s(i.roundTotal))])]):t._e(),t.shownStatRows.includes(e.type+i.team.id)?s("div",{staticClass:"player-stats-info-portrait"},[t.poolData.round.event.defaultToTeamName?s("div",{staticClass:"team-players"},t._l(i.team.teamPlayers,(function(e){return s("div",{staticClass:"team-player"},[s("div",{staticClass:"left-spacer"}),s("p",{staticClass:"team-player-name"},[t._v(" "+t._s(e.user.firstName)+" "+t._s(e.user.lastName)+" ")])])})),0):t._e(),s("div",{staticClass:"main-stats"},[s("div",{staticClass:"circle-hits portrait-stat"},[s("p",[s("b",[t._v("Circle hits")]),t._v(" ("+t._s(i.stats.circleHits.count)+") ")]),s("p",[s("b",[t._v(t._s(t.toPercentage(i.stats.circleHits.part)))]),t._v("% ")]),s("div",{staticClass:"bar"},[s("span",{staticClass:"overlay",class:{full:1==i.stats.circleHits.part},style:{width:t.toPercentage(i.stats.circleHits.part)+"%"}})])]),s("div",{staticClass:"conversions portrait-stat"},[s("p",[s("b",[t._v("Conversions")]),t._v(" ("+t._s(i.stats.circleHitConversions.count||0)+") ")]),s("p",[s("b",[t._v(t._s(t.toPercentage(i.stats.circleHitConversions.part)))]),t._v("% ")]),s("div",{staticClass:"bar"},[s("span",{staticClass:"overlay",class:{full:1==i.stats.circleHitConversions.part},style:{width:t.toPercentage(i.stats.circleHitConversions.part)+"%"}})])]),s("div",{staticClass:"inside-putts portrait-stat"},[s("p",[s("b",[t._v("Inside putts")]),t._v(" ("+t._s(i.stats.insidePutts.count)+") ")]),s("p",[s("b",[t._v(t._s(t.toPercentage(i.stats.insidePutts.part)))]),t._v("% ")]),s("div",{staticClass:"bar"},[s("span",{staticClass:"overlay",class:{full:1==i.stats.insidePutts.part},style:{width:t.toPercentage(i.stats.insidePutts.part)+"%"}})])]),s("div",{staticClass:"op-ob portrait-stat"},[s("p",[s("b",[t._v("Outside putts")])]),s("div",{staticClass:"outside-putts",class:{empty:0==i.stats.outsidePutts.count}},[s("p",[s("b",[t._v(t._s(i.stats.outsidePutts.count))])])]),s("p",{staticClass:"ob-text"},[s("b",[t._v("Penalties")])]),s("div",{staticClass:"out-of-bounds",class:{red:i.stats.outOfBounds.count>0}},[s("p",[s("b",[t._v(t._s(i.stats.outOfBounds.count))])])])])]),t.watchedTeams.some((t=>t.team.id===i.team.id))?s("div",{staticClass:"watch-player unwatch"},[s("p",{on:{click:function(s){return t.togglePlayerWatcher(e,i)}}},[s("b",[t._v("Stop watching")])])]):s("div",{staticClass:"watch-player"},[s("p",{on:{click:function(s){return t.togglePlayerWatcher(e,i)}}},[s("b",[t._v("Watch team")])])])]):t._e(),t.shownStatRows.includes(e.type+i.team.id)?s("div",{staticClass:"player-stats-info"},[s("div",{staticClass:"left",class:{"no-border":!t.poolData.round.event.defaultToTeamName},style:{flex:1==t.roundNumber?4:5}},[t.poolData.round.event.defaultToTeamName?s("div",{staticClass:"team-players"},t._l(i.team.teamPlayers,(function(e){return s("div",{staticClass:"team-player"},[s("div",{staticClass:"team-player-name"},[s("p",[t._v(" "+t._s(e.user.firstName)+" "+t._s(e.user.lastName)+" ")])])])})),0):t._e(),t.watchedTeams.some((t=>t.team.id===i.team.id))?s("div",{staticClass:"watch-player unwatch"},[s("p",{on:{click:function(s){return t.togglePlayerWatcher(e,i)}}},[s("b",[t._v("Stop watching")])])]):s("div",{staticClass:"watch-player"},[s("p",{on:{click:function(s){return t.togglePlayerWatcher(e,i)}}},[s("b",[t._v("Watch team")])])])]),s("div",{staticClass:"stat-titles"},[s("div",{staticClass:"circle-hits"},[s("p",[t._v("Circle hits:")])]),s("div",{staticClass:"conversions"},[s("p",[t._v("Conversions:")])]),s("div",{staticClass:"inside-putts"},[s("p",[t._v("Inside putts:")])]),s("div",{staticClass:"outside-putts"},[s("p",[t._v("Outside putts:")])]),s("div",{staticClass:"out-of-bounds"},[s("p",[t._v("Out of Bounds:")])])]),s("div",{staticClass:"total-percentage"},[s("div",[1==t.roundNumber?s("p",[s("b",[t._v(t._s(t.toPercentage(i.stats.circleHits.part))+"%")])]):s("p",[t._v(" "+t._s(t.toPercentage(i.stats.circleHits.part))+"% ")])]),s("div",[1==t.roundNumber?s("p",[s("b",[t._v(t._s(t.toPercentage(i.stats.circleHitConversions.part))+"%")])]):s("p",[t._v(" "+t._s(t.toPercentage(i.stats.circleHitConversions.part))+"% ")])]),s("div",[1==t.roundNumber?s("p",[s("b",[t._v(t._s(t.toPercentage(i.stats.insidePutts.part))+"%")])]):s("p",[t._v(" "+t._s(t.toPercentage(i.stats.insidePutts.part))+"% ")])]),s("div",[1==t.roundNumber?s("p",[s("b",[t._v(t._s(i.stats.outsidePutts.count))])]):s("p",[t._v(" "+t._s(i.stats.outsidePutts.count)+" ")])]),s("div",[1==t.roundNumber?s("p",[s("b",[t._v(t._s(i.stats.outOfBounds.count))])]):s("p",[t._v(" "+t._s(i.stats.outOfBounds.count)+" ")])])])]):t._e()],2)})),0)],1)]),s("div",{staticClass:"player-results",class:t.resultsTableSize},[s("div",{staticClass:"banner-right"}),s("div",{staticClass:"result-table-wrapper"},[s("div",{staticClass:"player-results-columns"},t._l(t.poolData.layoutVersion.holes,(function(e){return s("div",{staticClass:"hole-info"},[s("p",{staticClass:"hole-number"},[s("b",[t._v(t._s(e.name||e.number))])]),s("p",{staticClass:"hole-par"},[t._v(t._s(e.par))])])})),0),s("div",{staticClass:"players"},[s("transition-group",{attrs:{name:t.utility.useListAnimation?"list-complete":""}},t._l(e.players,(function(i,a){return s("div",{key:e.type+i.team.id,staticClass:"player",class:{"no-team-name":0==t.poolData.round.event.defaultToTeamName},style:{"animation-delay":.05*a+"s"}},[s("div",{staticClass:"results"},t._l(i.playerResults,(function(e){return e?s("div",{staticClass:"result",class:[t.parCalc(e.playerPar,e.score),{updated:e.updated}]},[s("p",[e.score?s("b",[t._v(t._s(e.score))]):t._e()])]):s("div",{staticClass:"result empty"})})),0),t.shownStatRows.includes(e.type+i.team.id)?s("div",{staticClass:"player-stats"},[s("div",{staticClass:"circle-hits"},t._l(i.playerResults,(function(e){return e?s("div",{staticClass:"stat"},[e.isCircleHit?s("span"):t._e()]):s("div",{staticClass:"stat"})})),0),s("div",{staticClass:"conversions"},t._l(i.playerResults,(function(e){return e?s("div",{staticClass:"stat"},[e.isConversion?s("span"):t._e()]):s("div",{staticClass:"stat"})})),0),s("div",{staticClass:"inside-putts"},t._l(i.playerResults,(function(e){return e?s("div",{staticClass:"stat"},[e.isInsidePutt?s("span"):t._e()]):s("div",{staticClass:"stat"})})),0),s("div",{staticClass:"outside-putts"},t._l(i.playerResults,(function(e){return e?s("div",{staticClass:"stat"},[e.isOutsidePutt?s("span"):t._e()]):s("div",{staticClass:"stat"})})),0),s("div",{staticClass:"out-of-bounds"},t._l(i.playerResults,(function(e){return e?s("div",{staticClass:"stat"},[e.isOutOfBounds?s("span"):t._e()]):s("div",{staticClass:"stat"})})),0)]):t._e()])})),0)],1)])])]):t._e()})),s("div",{staticClass:"table-footer"},[t.leaderboardCount>t.pagination.perPage?s("div",{staticClass:"pagination-wrapper"},[s("Pagination",{attrs:{total:t.leaderboardCount,perPage:t.pagination.perPage,currentPage:t.pagination.page},on:{back:function(s){t.pagination.page--},forward:function(s){t.pagination.page++},start:function(s){t.pagination.page=0},end:function(s){t.pagination.page=Math.ceil(t.leaderboardCount/t.pagination.perPage)-1}}})],1):t._e(),s("div",{directives:[{name:"hammer",rawName:"v-hammer:swipe",value:s=>t.moveDivision(s),expression:"(event) => moveDivision(event)",arg:"swipe"}],staticClass:"quick-nav-info-container"},[s("SwipeNavigation"),s("p",[t._v(" Swiftly browse divisions by swiping left or right on the above table ")])],1),s("div",{staticClass:"rotate-info-container"},[s("RotateDevice"),s("p",[t._v("Rotate device to view hole-by-hole scores")])],1)])],2):t._e()},z=[function(){var t=this,s=t._self._c;return s("p",[s("b",[t._v("Auto Update")])])},function(){var t=this,s=t._self._c;return s("div",{staticClass:"pos-column"},[s("p",[s("b",[t._v("POS")])])])},function(){var t=this,s=t._self._c;return s("div",{staticClass:"player-column"},[s("p",[s("b",[t._v("PLAYER")])])])},function(){var t=this,s=t._self._c;return s("div",{staticClass:"thru-column"},[s("p",[s("b",[t._v("THRU")])])])},function(){var t=this,s=t._self._c;return s("p",[s("b",[t._v("TOT")])])},function(){var t=this,s=t._self._c;return s("p",[s("b",[t._v("RD")])])}],K=e(53259),G={name:"PublicEventTeamLivePool",components:{SwipeNavigation:v.A,RotateDevice:p.A,Chevron2:c.A,DefaultToggle:k.A,TjingTextOptionToggle:K.A,PositionChange:L,Pagination:P.A},data(){return{selectedDivisionId:null,utility:{showPars:!0,animationDelay:!0,useListAnimation:!1},existingScores:[],leaderboard:[],loaded:!1,shownStatRows:[],poolData:null,wat
1chedPlayers:[],watchedTeams:[],autoReFresh:!1,autoReFreshInterval:null,windowFocused:!0,scoresLastLoaded:null,poolLeaderboards:null,pagination:{page:0,perPage:144}}},watch:{pagination:{handler:function(t,s){const e=this.restoreFromCache();e||this.loadData()},deep:!0},$route(){this.selectedDivisionId=this.$route.params.divisionId,this.pagination.page=0;const t=this.restoreFromCache();t||this.loadData()},windowFocused:function(t,s){t&&this.scoresLastLoaded.isBefore(u()().subtract(30,"seconds"))&&this.loadData()},autoReFresh:function(t,s){t?(this.loadData(),localStorage.setItem("autoReFreshEnabled",JSON.stringify({enabled:!0,createdAt:u()().toISOString()})),this.autoReFreshInterval=setInterval((()=>{document.hidden||this.loadData()}),1e4)):(clearInterval(this.autoReFreshInterval),localStorage.removeItem("autoReFreshEnabled"))}},computed:{availableDivisions(){return this.eventDivisionPools?.divisions?.filter((t=>this.divisionsInPool.map((t=>t.divisionId)).includes(t.id)))},divisionsInPool(){return this.eventDivisionPools?.pools.filter((t=>t.poolId==this.poolData.id))},eventDivisionPools(){return this.$store.state.eventDivisionPools},cacheKey(){return`${this.$route.params.poolId}-${this.$route.params.divisionId}-${this.pagination.page}`},leaderboardCount(){return this.poolData.livescore?.totalPlayers||0},roundNumber(){let t=1;return this.poolData.round.event.rounds.forEach(((s,e)=>{s.pools.forEach((s=>{s.id==this.poolData.id&&(t=e+1)}))})),t},resultsTableSize(){const t=this.poolData.layoutVersion.holes.length;return t<=9?"small":t<=18?"medium":"large"}},methods:{formattedPlace(t,s){const e=s.filter((s=>s.place===t)).length>1;return e?`T${t}`:t},moveDivision(t){if(this.availableDivisions.length>1&&this.$store.state.utility.deviceWidth<1200)if(2==t.direction){const t=this.availableDivisions.findIndex((t=>t.id===this.selectedDivisionId));t==this.availableDivisions.length-1?this.$emit("moveDivision",this.availableDivisions[0].id):this.$emit("moveDivision",this.availableDivisions[t+1].id)}else if(4==t.direction){const t=this.availableDivisions.findIndex((t=>t.id===this.selectedDivisionId));0==t?this.$emit("moveDivision",this.availableDivisions[this.availableDivisions.length-1].id):this.$emit("moveDivision",this.availableDivisions[t-1].id)}},cacheScores(){const t=JSON.parse(localStorage.getItem("live-scores")),s={...t,[this.cacheKey]:JSON.stringify({data:this.poolData,timestamp:u()().toISOString()})};localStorage.setItem("live-scores",JSON.stringify(s))},restoreFromCache(){const t=JSON.parse(localStorage.getItem("live-scores"));if(t){for(const e in t){const s=JSON.parse(t[e]);u()(s.timestamp).isBefore(u()().subtract(1,"minute"))&&delete t[e]}if(localStorage.setItem("live-scores",JSON.stringify(t)),!t[this.cacheKey])return!1;const s=JSON.parse(t[this.cacheKey]);return this.poolData=s.data,this.watchedTeams=s.data.livescore?.watchedTeams,this.selectedDivisionId=this.poolData.livescore?.id,this.$emit("updateDivision",this.poolData.livescore?.id),this.scoresLastLoaded=u()(s.timestamp),this.loaded=!0,this.poolLeaderboards=this.createLeaderboards(),!0}return!1},formattedStartTime(t){return u()(t).format("HH:mm")},lastUpdated(t){return t.format("HH:mm")},focusFunction(t){"blur"==t.type?this.windowFocused=!1:"focus"==t.type&&(this.windowFocused=!0)},togglePlayerWatcher(t,s){let e=!1;e=this.watchedTeams.some((t=>t.team.id===s.team.id)),0==e?this.watchedPlayers.push({teamId:s.team.id,createdAt:u()().toISOString()}):this.watchedPlayers=this.watchedPlayers.filter((t=>t.teamId!==s.team.id)),this.watchedPlayers.length>50&&this.watchedPlayers.shift(),this.toggleStatRows(t.type+s.team.id),this.$nextTick((()=>{this.saveWatchedPlayers(),this.loadData()}))},saveWatchedPlayers(){B(x,this.watchedPlayers)},poolPar(){let t=0;for(var s=0;s<this.poolData.layoutVersion.holes.length;s++)t+=this.poolData.layoutVersion.holes[s].par;return t},parCalc(t,s){return 1==s?"ace":t<=-3?"albatross":-2==t?"eagle":-1==t?"birdie":0==t?"par":1==t?"bogey":2==t?"doublebogey":3==t?"tripplebogey":t>=4?"above":""},toPercentage(t){return(100*t).toFixed(0)},parFormatter(t){return 0==t||null==t?"E":t>0?"+"+t:t},createLeaderboards(){this.utility.useListAnimation=!0;const t=this.poolData.livescore?[this.poolData.livescore]:null,s=this.poolData.layoutVersion.holes,e=t.map((t=>
1(t.players.forEach((t=>{t.roundPar=0,t.roundTotal=0,t.playerResults=[],s.forEach((s=>{let e=t.results.find((t=>t.holeId==s.id)),i={result:null,score:null,isCircleHit:null,isConversion:null,isInsidePutt:null,isOutsidePutt:null,isOutOfBounds:null,playerPar:null,updated:!1};if(e){this.existingScores.some((t=>t.id==e.id&&t.score==e.score))||(this.existingScores.push({id:e.id,score:e.score}),i.updated=!0);let a=e.score-s.par;t.roundPar+=a,t.roundTotal+=e.score,i.result=e,i.score=e.score,i.isCircleHit=e.isCircleHit,i.isConversion=e.isCircleHit&&e.isInsidePutt,i.isInsidePutt=e.isInsidePutt,i.isOutsidePutt=e.isOutsidePutt,i.isOutOfBounds=e.isOutOfBounds,i.playerPar=a}t.playerResults.push(i)}))})),t))),i=this.watchedTeams.map((t=>(t.roundPar=0,t.roundTotal=0,t.playerResults=[],s.forEach((s=>{let e=t.results.find((t=>t.holeId==s.id)),i={result:null,score:null,isCircleHit:null,isConversion:null,isInsidePutt:null,isOutsidePutt:null,isOutOfBounds:null,playerPar:null,updated:!1};if(e){this.existingScores.some((t=>t.id==e.id&&t.score==e.score))||(this.existingScores.push({id:e.id,score:e.score}),i.updated=!0);let a=e.score-s.par;t.roundPar+=a,t.roundTotal+=e.score,i.result=e,i.score=e.score,i.isCircleHit=e.isCircleHit,i.isConversion=e.isCircleHit&&e.isInsidePutt,i.isInsidePutt=e.isInsidePutt,i.isOutsidePutt=e.isOutsidePutt,i.isOutOfBounds=e.isOutOfBounds,i.playerPar=a}t.playerResults.push(i)})),t))),a={id:"watchedDivision",name:"Watched players",type:"WATCHED",players:i};return[a,...e]},toggleStatRows(t){this.utility.useListAnimation=!1,this.shownStatRows.includes(t)?this.shownStatRows=this.shownStatRows.filter((s=>t!=s)):this.shownStatRows.push(t)},setLayoutLength(t){this.utility.layoutLength=t,this.loadData()},thruCount(t,s){const e=t.filter((t=>null!=t?.score)).length,i=s.holes.length;return e==i?"F":t.filter((t=>null!=t?.score)).length},async loadData(){const t=[],s=E(x);s.length>0&&(t.push(...s.map((t=>t.teamId))),this.watchedPlayers=s);const e=this.selectedDivisionId?`divisionId: "${this.selectedDivisionId}", `:"",i=await this.$axios({data:{query:`\n {\n pool(poolId: "${this.$router.currentRoute.params.poolId}") {\n status\n id\n areGroupsPublic\n round {\n id\n pools {\n id\n }\n event {\n id\n endDate\n defaultToTeamName\n rounds {\n id\n pools {\n id\n }\n }\n }\n }\n layoutVersion {\n id\n layout {\n id\n name\n course {\n name\n }\n }\n holes {\n id\n number\n name\n par\n }\n }\n livescore(${e} page: ${this.pagination.page}, watchedTeamIds: [${t.map((t=>'"'+t+'"'))}]) {\n ... on PoolLivescoreDivisionTeam {\n id\n name\n type\n totalPlayers\n players {\n place\n placeChange\n startsAt\n team {\n id\n name\n teamPlayers {\n id\n user {\n id\n firstName\n lastName\n profile {\n club\n pdgaNumber\n pdgaRating\n }\n }\n }\n }\n dnfDns\n totalScore\n totalPar\n results {\n id\n score\n holeId\n isCircleHit\n isOutsidePutt\n isInsidePutt\n isOutOfBounds\n }\n stats {\n circleHitConversions {\n part\n count\n }\n circleHits {\n part\n count\n }\n insidePutts {\n part\n count\n }\n outsidePutts {\n count\n }\n outOfBounds {\n count\n }\n }\n }\n watchedTeams{\n place\n placeChange\n startsAt\n team {\n id\n name\n teamPlayers {\n id\n user {\n id\n firstName\n lastName\n profile {\n club\n pdgaNumber\n pdgaRating\n }\n }\n }\n }\n dnfDns\n totalScore\n totalPar\n results {\n id\n score\n holeId\n isCircleHit\n isOutsidePutt\n isInsidePutt\n isOutOfBounds\n }\n stats {\n circleHitConversions {\n part\n count\n }\n circleHits {\n part\n count\n }\n insidePutts {\n part\n count\n }\n outsidePutts {\n count\n }\n outOfBounds {\n count\n }\n }\n }\n }\n }\n }\n }\n `}});this.poolData=i.data.data.pool,this.watchedTeams=this.poolData.livescore?.watchedTeams,this.selectedDivisionId=i.data.data.pool.livescore?.id,this.$emit("updateDivision",i.data.data.pool.livescore?.id),this.loaded=!0,this.scoresLastLoaded=u()(),this.cacheScores(),this.poolLeaderboards=this.createLeaderboards()}},beforeDestroy(){window.removeEventListener("blur",this.focusFunction),window.removeEventListener("focus",this.focusFunction),clearInterval(this.autoReFreshInterval)}
1,mounted(){this.selectedDivisionId=this.$route.params.divisionId;const t=this.restoreFromCache();if(t||this.loadData(),localStorage.getItem("autoReFreshEnabled")){const t=JSON.parse(localStorage.getItem("autoReFreshEnabled"));u()(t.createdAt).isBefore(u()().subtract(1,"days"))||0==t.enabled?localStorage.removeItem("autoReFreshEnabled"):this.autoReFresh=!0}window.addEventListener("blur",this.focusFunction),window.addEventListener("focus",this.focusFunction)}},j=G,Y=(0,_.A)(j,q,z,!1,null,"003f9913",null),Z=Y.exports,Q=function(){var t=this,s=t._self._c;return t.loading?t._e():s("div",{staticClass:"pool-results"},["CLOSED"==t.poolData.status?[s("div",{staticClass:"message"},[t._m(0),s("div",{staticClass:"body"},[t._v(t._s(t.poolDate(t.poolData.date)))])])]:t._e(),"COMPLETED"==t.poolData.status&&t.poolData.leaderboard?[t._l(t.poolLeaderboards,(function(e){return e.players.length>0?s("div",{directives:[{name:"hammer",rawName:"v-hammer:swipe",value:s=>t.moveDivision(s),expression:"(event) => moveDivision(event)",arg:"swipe"}],key:e.type,staticClass:"division-container",class:{watched:"WATCHED"==e.type}},[s("div",{staticClass:"player-info",class:t.resultsTableSize},[s("div",{staticClass:"banner-left"},[s("p",[s("b",[t._v(t._s(e.name))]),t._v(" ("+t._s(e.players.length)+") ")])]),s("div",{staticClass:"player-info-columns"},[s("div",{staticClass:"pos-column",on:{click:function(s){return t.setSorting("place")}}},[s("p",[s("b",[t._v("POS"),"place"==t.utility.sortingCriteria?s("span",{staticClass:"active-sort"}):t._e()])])]),s("div",{staticClass:"player-column"},[s("p",[s("b",[t._v("PLAYER"),"firstName"==t.utility.sortingCriteria?s("span",{staticClass:"active-sort"}):t._e()])])]),t._m(1,!0),s("div",{staticClass:"round-column"},[t._m(2,!0),s("p",{staticClass:"pool-par"},[t._v(t._s(t.poolPar))])])]),s("div",{staticClass:"players"},t._l(e.players,(function(i){return s("div",{key:e.type+"s"+i.team.id,staticClass:"player",class:{"no-border":t.shownStatRows.includes(i.playerId),"no-team-name":0==t.poolData.round.event.defaultToTeamName}},[s("div",{staticClass:"position"},[s("p",[t._v(t._s(t.formattedPlace(i.place,e.players)))])]),t.poolData.round.event.defaultToTeamName?s("div",{staticClass:"name",on:{click:function(s){return t.toggleStatRows(i.team.id)}}},[s("p",[s("b",[t._v(t._s(i.team.name))])]),s("Chevron2",{attrs:{direction:t.shownStatRows.includes(i.team.id)?"up":"down"}})],1):s("div",{staticClass:"name",on:{click:function(s){return t.toggleStatRows(i.team.id)}}},[s("div",{staticClass:"name-wrapper"},t._l(i.team.teamPlayers,(function(e){return s("p",[s("b",[t._v(t._s(e.user.firstName)+" "+t._s(e.user.lastName))])])})),0),s("Chevron2",{attrs:{direction:t.shownStatRows.includes(i.team.id)?"up":"down"}})],1),s("div",{staticClass:"total"},[s("p",[t._v(t._s(i.score))])]),s("div",{staticClass:"round"},[s("p",[t.isPlayerDNF(i.playerResults)?s("b",[t._v(" "+t._s(i.dnfOrDns)+" ")]):s("b",[t._v(" "+t._s(t.parFormatter(i.roundPar)))])])]),t.shownStatRows.includes(i.team.id)?s("div",{staticClass:"player-stats-info-portrait"},[t.poolData.round.event.defaultToTeamName?s("div",{staticClass:"team-players"},t._l(i.team.teamPlayers,(function(e){return s("div",{staticClass:"team-player"},[s("div",{staticClass:"left-spacer"}),s("p",{staticClass:"team-player-name"},[t._v(" "+t._s(e.user.firstName)+" "+t._s(e.user.lastName)+" ")])])})),0):t._e(),s("div",{staticClass:"main-stats"},[s("div",{staticClass:"circle-hits portrait-stat"},[s("p",[s("b",[t._v("Circle hits")]),t._v(" ("+t._s(i.stats.circleHits.count)+") ")]),s("p",[s("b",[t._v(t._s(t.toPercentage(i.stats.circleHits.part)))]),t._v("% ")]),s("div",{staticClass:"bar"},[s("span",{staticClass:"overlay",style:{width:t.toPercentage(i.stats.circleHits.part)+"%"}})])]),s("div",{staticClass:"conversions portrait-stat"},[s("p",[s("b",[t._v("Conversions")]),t._v(" ("+t._s(i.stats.circleHitConversions.count||0)+") ")]),s("p",[s("b",[t._v(t._s(t.toPercentage(i.stats.circleHitConversions.part)))]),t._v("% ")]),s("div",{staticClass:"bar"},[s("span",{staticClass:"overlay",style:{width:t.toPercentage(i.stats.circleHitConversions.part)+"%"}})])]),s("div",{staticClass:"inside-putts portrait-stat"},[s("p",[s("b",[t._v("Inside putts")]),t._v(" ("+t._s(i.stats.insidePutts.count)+") ")]),s("p",[s("b",[t._v(t._s(t.toPercentage(i.stats.insidePutts.part)))]),t._v("% ")]),s("div",{staticClass:"bar"},[s("span",{staticClass:"overlay",style:{width:t.toPercentage(i.stats.insidePutts.part)+"%"}})])]),s("div",{staticClass:"op-ob portrait-stat"},[t._m(3,!0),s("div",{staticClass:"outside-putts"},[s("p",[s("b",[t._v(t._s(i.stats.outsidePutts.count))])])]),t._m(4,!0),s("div",{staticClass:"out-of-bounds",class:{red:i.stats.outOfBounds.count>0}},[s("p",[s("b",[t._v(t._s(i.stats.outOfBounds.count))])])])])])]):t._e(),t.shownStatRows.includes(i.team.id)?s("div",{staticClass:"player-stats-info"},[s("div",{staticClass:"left"},[t.poolData.round.event.defaultToTeamName?s("div",{staticClass:"team-players"},t._l(i.team.teamPlayers,(function(e){return s("div",{staticClass:"team-player"},[s("div",{staticClass:"team-player-name"},[s("p",[t._v(" "+t._s(e.user.firstName)+" "+t._s(e.user.lastName)+" ")])])])})),0):t._e()]),t._m(5,!0),s("div",{staticClass:"total-percentage"},[s("div",[1==t.roundNumber?s("p",[s("b",[t._v(t._s(t.toPercentage(i.stats.circleHits.part))+"%")])]):s("p",[t._v(" "+t._s(t.toPercentage(i.stats.circleHits.part))+"% ")])]),s("div",[1==t.roundNumber?s("p",[s("b",[t._v(t._s(t.toPercentage(i.stats.circleHitConversions.part))+"%")])]):s("p",[t._v(" "+t._s(t.toPercentage(i.stats.circleHitConversions.part))+"% ")])]),s("div",[1==t.roundNumber?s("p",[s("b",[t._v(t._s(t.toPercentage(i.stats.insidePutts.part))+"%")])]):s("p",[t._v(" "+t._s(t.toPercentage(i.stats.insidePutts.part))+"% ")])]),s("div",[1==t.roundNumber?s("p",[s("b",[t._v(t._s(i.stats.outsidePutts.count))])]):s("p",[t._v(" "+t._s(i.stats.outsidePutts.count)+" ")])]),s("div",[1==t.roundNumber?s("p",[s("b",[t._v(t._s(i.stats.outOfBounds.count))])]):s("p",[t._v(" "+t._s(i.stats.outOfBounds.count)+" ")])])])]):t._e()])})),0)]),s("div",{staticClass:"player-results",class:t.resultsTableSize},[s("div",{staticClass:"banner-right"}),s("div",{staticClass:"result-table-wrapper"},[s("div",{staticClass:"player-results-columns"},t._l(t.poolData.layoutVersion.holes,(function(e){return s("div",{staticClass:"hole-info"},[s("p",{staticClass:"hole-number"},[s("b",[t._v(t._s(e.number))])]),s("p",{staticClass:"hole-par"},[t._v(t._s(e.par))])])})),0),s("div",{staticClass:"players"},t._l(e.players,(function(i){return s("div",{key:e.type+i.team.id,staticClass:"player",class:{"no-team-name":0==t.poolData.round.event.defaultToTeamName}},[s("div",{staticClass:"results"},t._l(i.playerResults,(function(e){return e?s("div",{staticClass:"result",class:[t.parCalc(e.playerPar,e.score)]},[s("p",[e.score?s("b",[t._v(t._s(e.score))]):t._e()])]):s("div",{staticClass:"result empty"})})),0),t.shownStatRows.includes(i.team.id)?s("div",{staticClass:"player-stats"},[s("div",{staticClass:"circle-hits"},t._l(i.playerResults,(function(e){return e?s("div",{staticClass:"stat"},[e.isCircleHit?s("span"):t._e()]):s("div",{staticClass:"stat"})})),0),s("div",{staticClass:"conversions"},t._l(i.playerResults,(function(e){return e?s("div",{staticClass:"stat"},[e.isConversion?s("span"):t._e()]):s("div",{staticClass:"stat"})})),0),s("div",{staticClass:"inside-putts"},t._l(i.playerResults,(function(e){return e?s("div",{staticClass:"stat"},[e.isInsidePutt?s("span"):t._e()]):s("div",{staticClass:"stat"})})),0),s("div",{staticClass:"outside-putts"},t._l(i.playerResults,(function(e){return e?s("div",{staticClass:"stat"},[e.isOutsidePutt?s("span"):t._e()]):s("div",{staticClass:"stat"})})),0),s("div",{staticClass:"out-of-bounds"},t._l(i.playerResults,(function(e){return e?s("div",{staticClass:"stat"},[e.isOutOfBounds?s("span"):t._e()]):s("div",{staticClass:"stat"})})),0)]):t._e()])})),0)])])]):t._e()})),s("div",{staticClass:"table-footer"},[t.leaderboardCount>t.pagination.perPage?s("div",{staticClass:"pagination-wrapper"},[s("Pagination",{attrs:{total:t.leaderboardCount,perPage:t.pagination.perPage,currentPage:t.pagination.page},on:{back:function(s){t.pagination.page--},forward:function(s){t.pagination.page++},start:function(s){t.pagination.page=0},end:function(s){t.pagination.page=Math.ceil(t.leaderboardCount/t.pagination.perPage)-1}}})],1):t._e(),s("div",{directives:[{name:"hammer",rawName:"v-hammer:swipe",value:s=>t.moveDivision(s),expression:"(event) => moveDivision(event)",arg:"swipe"}],staticClass:"quick-nav-info-container"},[s("SwipeNavigation"),s("p",[t._v(" Swiftly browse divisions by swiping left or right on the above table ")])],1),s("div",{staticClass:"rotate-info-container"},[s("RotateDevice"),s("p",[t._v("Rotate device to view hole-by-hole scores")])],1)])]:t._e()],2)},X=[function(){var t=this,s=t._self._c;return s("div",{staticClass:"header"},[s("span",[t._v("This round is due to start on")])])},function(){var t=this,s=t._self._c;return s("div",{staticClass:"total-column"},[s("p",[s("b",[t._v("THW")])])])},function(){var t=this,s=t._self._c;return s("p",[s("b",[t._v("PAR")])])},function(){var t=this,s=t._self._c;return s("p",[s("b",[t._v("Outside putts")])])},function(){var t=this,s=t._self._c;return s("p",{staticClass:"ob-text"},[s("b",[t._v("OB")])])},function(){var t=this,s=t._self._c;return s("div",{staticClass:"stat-titles"},[s("div",{staticClass:"circle-hits"},[s("p",[t._v("Circle hits:")])]),s("div",{staticClass:"conversions"},[s("p",[t._v("Conversions:")])]),s("div",{staticClass:"inside-putts"},[s("p",[t._v("Inside putts:")])]),s("div",{staticClass:"outside-putts"},[s("p",[t._v("Outside putts:")])]),s("div",{staticClass:"out-of-bounds"},[s("p",[t._v("Out of Bounds:")])])])}
1],tt=e(2543),st={name:"PublicFinishedPoolTeamResults",mixins:[l.K],components:{Chevron2:c.A,Pagination:P.A,SwipeNavigation:v.A,RotateDevice:p.A},data(){return{selectedDivisionId:null,selectedPoolId:null,testexpanded:!1,showByIndex:null,shownStatRows:[],animatedStatRows:[],poolData:{},loading:!0,tableLoaderSequence:0,utility:{showPars:!0,animationDelay:!0,useListAnimation:!1,sortingCriteria:"place",sortDirection:"asc"},pagination:{page:0,perPage:144}}},methods:{formattedPlace(t,s){const e=s.filter((s=>s.place===t)).length>1;return e?`T${t}`:t},moveDivision(t){if(this.availableDivisions.length>1&&this.$store.state.utility.deviceWidth<1200)if(2==t.direction){const t=this.availableDivisions.findIndex((t=>t.id===this.selectedDivisionId));t==this.availableDivisions.length-1?this.$emit("moveDivision",this.availableDivisions[0].id):this.$emit("moveDivision",this.availableDivisions[t+1].id)}else if(4==t.direction){const t=this.availableDivisions.findIndex((t=>t.id===this.selectedDivisionId));0==t?this.$emit("moveDivision",this.availableDivisions[this.availableDivisions.length-1].id):this.$emit("moveDivision",this.availableDivisions[t-1].id)}},setSorting(t){this.utility.sortingCriteria==t&&("asc"==this.utility.sortDirection?this.utility.sortDirection="desc":this.utility.sortDirection="asc"),this.utility.sortingCriteria=t},toggleStatRows(t){this.utility.useListAnimation=!1,this.shownStatRows.includes(t)?this.shownStatRows=this.shownStatRows.filter((s=>t!=s)):this.shownStatRows.push(t)},holeDisplayName(t){return null!=t.name?t.name:t.number},handler(){this.loading=!0,this.$nextTick((()=>{this.loading=!1}))},playerHoleStats(t){let s=0,e={circleHits:{count:0,part:0},circleHitConversions:{count:0,part:0,possibleAttempts:0},insidePutts:{count:0,part:0},outsidePutts:{count:0,part:0},outOfBounds:{count:0,part:0}};return t.forEach((t=>{1==t.score&&s++,t.isCircleHit&&(e.circleHits.count++,e.circleHitConversions.possibleAttempts++),t.isInsidePutt&&t.isCircleHit&&e.circleHitConversions.count++,t.isInsidePutt&&e.insidePutts.count++,t.isOutsidePutt&&e.outsidePutts.count++,t.isOutOfBounds&&e.outOfBounds.count++})),e.insidePutts.count>0&&(e.insidePutts.part=e.insidePutts.count/(t.length-e.outsidePutts.count-s)),e.circleHits.count>0&&(e.circleHits.part=e.circleHits.count/t.length,e.circleHitConversions.part=e.circleHitConversions.count/(e.circleHitConversions.possibleAttempts-s)),e},toggleStatRow(t){this.shownStatRows.includes("stats"+t)?(this.animatedStatRows=this.animatedStatRows.filter((s=>s!=="stats"+t)),setTimeout((()=>{this.shownStatRows=this.shownStatRows.filter((s=>s!=="stats"+t))}),300)):(this.shownStatRows.push("stats"+t),this.$nextTick((()=>{this.animatedStatRows.push("stats"+t)})))},toPercentage(t){return(100*t).toFixed(0)},playerPoolPar(t){let s=0;for(var e=0;e<t.length;e++){let i=this.poolData.layoutVersion.holes.filter((s=>s.id==t[e].hole.id))[0].par,a=t[e].score,o=a-i;s+=o}return this.parFormatter(s)},parFormatter(t){return 0==t||null==t?"E":t>0?"+"+t:t},playerTotalFormatter(t){return null==t?0:t},resultWidth(){return this.poolData.layoutVersion.holes.length>27?"xs":this.poolData.layoutVersion.holes.length>18?"s":this.poolData.layoutVersion.holes.length>9?"m":this.poolData.layoutVersion.holes.length>3?"l":void 0},isPlayerDNF(t){if(t.length!=this.poolData.layoutVersion.holes.length)return!0},toggleShowStatRow(t){if(this.$store.state.utility.deviceWidth>470){let s=this.shownStatRows.indexOf("s"+t);s>-1?this.shownStatRows.splice(s,1):this.shownStatRows.push("s"+t)}},showThisStatRow(t){return this.shownStatRows.indexOf(t)>-1},poolDate(t){return this.$store.state.utility.deviceWidth>1200?u()(t).format("dddd, DD MMMM [at] HH:mm"):u()(t).format("ddd, DD MMM [at] HH:mm")},showPar(t){return 0==t?"E":t>0?"+"+t:t},parCalc(t,s){return 1==s?"ace":t<=-3?"albatross":-2==t?"eagle":-1==t?"birdie":0==t?"par":1==t?"bogey":2==t?"doublebogey":3==t?"tripplebogey":t>=4?"above":""},playersInDivision(t){return this.poolData[t]},loadData(){const t=this.selectedDivisionId?`divisionId: "${this.selectedDivisionId}",`:"";this.$axios({data:{query:`\n {\n pool(poolId: "${this.$router.currentRoute.params.poolId}") {\n leaderboard(${t} page: ${this.pagination.page}) {\n ... on PoolLeaderboardDivisionTeam {\n id\n name\n type\n totalPlayers\n players {\n place\n team{\n id\n name\n teamPlayers{\n id\n user{\n firstName\n lastName\n profile{\n id\n club\n pdgaNumber\n pdgaRating\n }\n }\n }\n }\n isDnfDns\n dnfOrDns\n score\n par\n points\n results {\n id\n score\n isCircleHit\n isOutsidePutt\n isInsidePutt\n isOutOfBounds\n hole {\n id\n number\n par\n }\n }\n }\n }\n }\n round {\n event {\n registrationMethod\n defaultToTeamName\n rounds {\n id\n pools {\n id\n }\n }\n }\n }\n status\n areGroupsPublic\n startMethod\n date\n id\n layoutVersion {\n id\n layout {\n id\n name\n course {\n name\n }\n }
1\n holes {\n id\n number\n par\n name\n }\n }\n }\n }\n `}}).then((t=>{this.poolData=t.data.data.pool,this.selectedDivisionId=this.poolData.leaderboard?.id||null,this.$emit("updateDivision",this.selectedDivisionId),this.loading=!1,setTimeout((()=>{null!=this.poolData.leaderboard&&(this.tableLoaderSequence=this.poolData.leaderboard.length)}),1e3)}))}},watch:{pagination:{handler:function(t,s){this.loadData()},deep:!0},$route(){this.selectedDivisionId=this.$route.params.divisionId,this.selectedPoolId=this.$route.params.poolId,this.pagination.page=0,this.loadData()}},computed:{leaderboardCount(){return this.poolData.leaderboard.totalPlayers},availableDivisions(){return this.eventDivisionPools?.divisions?.filter((t=>this.divisionsInPool.map((t=>t.divisionId)).includes(t.id)))},divisionsInPool(){return this.eventDivisionPools?.pools.filter((t=>t.poolId==this.poolData.id))},eventDivisionPools(){return this.$store.state.eventDivisionPools},resultsTableSize(){const t=this.poolData.layoutVersion.holes.length;return t<=9?"small":t<=18?"medium":"large"},poolLeaderboards(){const t=[this.poolData.leaderboard],s=this.poolData.layoutVersion.holes,e=t.map((t=>(t.players.forEach((t=>{t.roundPar=0,t.roundTotal=0,t.playerResults=[],s.forEach((s=>{let e=t.results.find((t=>t.hole.id==s.id)),i={result:null,score:null,isCircleHit:null,isConversion:null,isInsidePutt:null,isOutsidePutt
1:null,isOutOfBounds:null,playerPar:null};if(e){let a=e.score-s.par;t.roundPar+=a,t.roundTotal+=e.score,i.result=e,i.score=e.score,i.isCircleHit=e.isCircleHit,i.isConversion=e.isCircleHit&&e.isInsidePutt,i.isInsidePutt=e.isInsidePutt,i.isOutsidePutt=e.isOutsidePutt,i.isOutOfBounds=e.isOutOfBounds,i.playerPar=a}t.stats=this.playerHoleStats(t.results),t.playerResults.push(i)}))})),t.players=(0,tt.orderBy)(t.players,[this.utility.sortingCriteria],[this.utility.sortDirection]),t)));return e},colSpanCalc(){return this.$store.state.utility.deviceWidth>=1200?6:5},statRowColspanCalculator(){return this.$store.state.utility.deviceWidth>=1200?4:3},roundNumber(){for(var t=0;t<this.poolData.round.event.rounds.length;t++)for(var s=0;s<this.poolData.round.event.rounds[t].pools.length;s++)if(this.poolData.round.event.rounds[t].pools[s].id==this.poolData.id)return t+1;return 3},poolPar(){let t=0;for(var s=0;s<this.poolData.layoutVersion.holes.length;s++)t+=this.poolData.layoutVersion.holes[s].par;return t}},mounted(){this.selectedDivisionId=this.$route.params.divisionId,this.selectedPoolId=this.$route.params.poolId,this.loadData()},beforeDestroy(){}},et=st,it=(0,_.A)(et,Q,X,!1,null,"4a2d05ab",null),at=it.exports,ot=e(80865),nt=e(9626),rt=e(23748),lt={name:"PublicEventPoolResults",components:{SmartStickyHeader:o.A,PublicFinishedPoolResults:S,PublicEventLivePool:J,PublicEventTeamLivePool:Z,PublicFinishedPoolTeamResults:at,CustomDropDown:ot.A,ChevronFat:nt.A,PublicPagesPlaceholder:rt.A}
1,data(){return{selectedDivisionId:null,selectedPoolId:null,poolData:null,loaded:!1}},watch:{$route:function(t,s){t.params.poolId!==s.params.poolId&&(this.loaded=!1),this.loadData()}},computed:{selectedDivisionName(){if(0===this.availableDivisions.length)return"No divisions yet";const t=this.availableDivisions.find((t=>t.id===this.selectedDivisionId));return t?t.name:this.availableDivisions[0].name},selectedPoolName(){let t,s,e,i,a;return this.poolData.round.event.rounds.forEach(((e,i)=>{e.pools.find((t=>t.id===this.selectedPoolId))&&(t=e,s=i)})),t?(t.pools.forEach(((s,o)=>{s.id===this.selectedPoolId&&(e=s.name,i=o,a=t.pools.length>1)})),a?`R${s+1}${e?" - "+e:"P"+this.$store.state.poolConversion[i]}`:`Round ${s+1}`):"Standings"},roundsItems(){const t=[{title:"Standings",action:"changeRound",value:null,selected:!1}];return this.poolData.round.event.rounds.forEach(((s,e)=>{1===s.pools.length?t.push({title:`Round ${e+1}`,action:"changeRound",value:s.pools[0].id,selected:this.selectedPoolId===s.pools[0].id}):s.pools.forEach(((s,i)=>{t.push({title:`Round ${e+1}${s.name?` - ${s.name}`:` - Pool ${this.$store.state.poolConversion[i]}`}`,action:"changeRound",value:s.id,selected:this.selectedPoolId===s.id})}))})),t},divisionItems(){const t=[];return 0===this.availableDivisions.length?(t.push({title:"No divisions yet",action:"changeDivision",value:null,selected:!0}),t):(t.push(...this.availableDivisions.map((t=>({title:t.name,action:"changeDivision",value:t.id,selected:this.selectedDivisionId===t.id})))),t)},availableDivisions(){return this.eventDivisionPools.divisions.filter((t=>this.divisionsInPool.map((t=>t.divisionId)).includes(t.id)))},divisionsInPool(){return this.eventDivisionPools.pools.filter((t=>t.poolId==this.poolData.id))},eventDivisionPools(){return this.$store.state.eventDivisionPools}},methods:{moveDivision(t){if(this.availableDivisions.length>1){const s=this.availableDivisions.findIndex((t=>t.id===this.selectedDivisionId));2==t.direction?s===this.availableDivisions.length-1?this.selectedDivisionId=this.availableDivisions[0].id:this.selectedDivisionId=this.availableDivisions[s+1].id:4==t.direction&&(this.selectedDivisionId=0===s?this.availableDivisions[this.availableDivisions.length-1].id:this.availableDivisions[s-1].id),this.updateRoute()}},availableDivisionsInPool(t){return this.eventDivisionPools.pools.filter((s=>s.poolId==t))},updateRoute(){if(null===this.selectedPoolId)this.$router.push({name:"public-event-division-results",params:{eventId:this.$route.params.eventId,divisionId:this.selectedDivisionId}});else{const t=this.availableDivisionsInPool(this.selectedPoolId),s=t.find((t=>t.divisionId==this.selectedDivisionId));s||0!==t.length?this.$router.push({name:"public-event-division-pool-results",params:{eventId:this.$route.params.eventId,poolId:this.selectedPoolId,divisionId:this.$route.params.poolId==this.selectedPoolId?this.selectedDivisionId:s?s.divisionId:t[0]?.divisionId}}):this.$router.push({name:"public-event-division-pool-results",params:{eventId:this.$route.params.eventId,divisionId:"no-divisions",poolId:this.selectedPoolId}})}},async loadData(){let t=await this.$axios({data:{query:`\n {\n pool(poolId:"${this.$router.currentRoute.params.poolId}"){\n id\n status\n round{\n pools{\n id\n }\n event{\n divisions{\n id\n name\n }\n divisionInPool {\n poolId\n divisionId\n }\n singles\n scoringAs\n rounds{\n pools{\n id\n name\n }\n }\n }\n }\n }\n }\n `}});this.poolData=t.data.data.pool,this.selectedDivisionId="no-divisions"===this.$route.params.divisionId?null:this.$route.params.divisionId??null,this.selectedPoolId=this.$route.params.poolId;const s={divisions:t.data.data.pool.round.event.divisions,pools:t.data.data.pool.round.event.divisionInPool};this.$store.commit("updateEventDivisionPools",s),this.loaded=!0}},beforeMount(){const t="no-divisions"===this.$route.params.divisionId?null:this.$route.params.divisionId;this.selectedDivisionId=t,this.selectedPoolId=this.$route.params.poolId,this.loadData()},beforeCreate(){},destroyed(){}},dt=lt,ut=(0,_.A)(dt,i,a,!1,null,"b0edec52",null),ct=ut.exports},57391:function(t,s,e){e.d(s,{K:function(){return i}});const i={methods:{convertRGBA:function(t){for(var s="rgba(",e=0;e<t.length;e++)s+=t[e],e!=t.length-1&&(s+=",");return s+=")",s}}}}}]); 2//# sourceMappingURL=5677.4c2285e5.js.map
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.