1"use strict";(globalThis.webpackChunkswrc_plugin=globalThis.webpackChunkswrc_plugin||[]).push([[740],{740:(e,t,a)=>{a.r(t),a.d(t,{MatchupPicks:()=>d});var s=a(695),l=a(715),i=a(490),o=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=(e,t,a,s)=>{for(var l,i=s>1?void 0:s?n(t,a):t,r=e.length-1;r>=0;r--)(l=e[r])&&(i=(s?l(t,a,i):l(i))||i);return s&&i&&o(t,a,i),i};let d=class extends i.O{constructor(){super(...arguments),this.identifier="",this._fetchMatchupTask=new l.h(this,{task:async([e,t],{signal:a})=>{this.validateProps();const s=(0,l.m)(e,t,{books:"draftkings"});if(s){const e=await(await fetch(s,{signal:a})).json();if(e instanceof Error||"error"in e)throw e;return e}return null},args:()=>[this.league,this.identifier]}),this._getWinProbabilityFromSportsbooks=e=>{var t,a,s,l,i,o,n,r;const d={home:"50.0",away:"50.0"};return e&&(d.away=null==(l=null==(s=null==(a=null==(t=e[0])?void 0:t.odds)?void 0:a.moneyline)?void 0:s.away)?void 0:l.win_probability,d.home=null==(r=null==(n=null==(o=null==(i=e[0])?void 0:i.odds)?void 0:o.moneyline)?void 0:n.home)?void 0:r.win_probability,d.home&&d.away&&(d.home=Number(d.home).toFixed(1),d.away=Number(d.away).toFixed(1)),d.home===d.away&&(d.home="50.0",d.away="50.0")),d},this._getPredictedScoreHtml=e=>{const{league:t,awayIdentifier:a,homeIdentifier:i,home:o,away:n,score_prediction:r}=e;let d=null;null!=r&&r.home&&null!=r&&r.away&&(d="away",r.home>r.away&&(d="home"));const c="away"===d?"home":"away";return e[d]&&e[c]?s.x` 2 <div class="flex-1 p-6 border border-base-200 rounded-lg flex flex-col"> 3 <h2 class="text-xl">Predicted Score</h2> 4 <div class="flex my-4"> 5 <div class="flex-1 text-left"> 6 <img 7 loading="lazy" 8 src=${(0,l.c)(t,a)} 9 width="32" 10 height="32" 11 alt=${`${n.team} team logo`} 12 class="mb-2" /> 13 <span class="text-xl text-base-300">${null==r?void 0:r.away}</span> 14 </div> 15 <div class="flex-1 text-right"> 16 <img 17 class="ml-auto mb-2" 18 loading="lazy" 19 src=${(0,l.c)(t,i)} 20 width="32" 21 height="32" 22 alt=${`${o.team} team logo`} /> 23 <span class="text-xl text-base-300">${null==r?void 0:r.home}</span> 24 </div> 25 </div> 26 <hr class="border-base-200 mt-auto mb-0" /> 27 <p class="mt-4 text-xs text-center font-normal font-sans"> 28 Our formula predicts the ${e[d].city} ${e[d].team} will beat the 29 ${e[c].city} ${e[c].team} by a score of ${r[d]} 30 - ${r[c]} 31 </p> 32 </div> 33 `:s.x``},this._getWinProbabilityHtml=e=>{const{league:t,awayIdentifier:a,homeIdentifier:i,home:o,away:n}=e,r=this._getWinProbabilityFromSportsbooks(null==e?void 0:e.sportsbooks),d=r.home,c=r.away,h=d>c?"home":"away",m="away"===h?"home":"away";return s.x` 34 <div class="flex-1 flex flex-col p-6 border border-base-200 rounded-lg"> 35 <h2 class="text-xl">Win Probability</h2> 36 <div class="flex my-4"> 37 <div class="basis-1/2 text-left"> 38 <img 39 loading="lazy" 40 src=${(0,l.c)(t,a)} 41 width="32" 42 height="32" 43 alt=${`${n.team} team logo`} 44 class="rounded mb-2" /> 45 <span class="text-xl text-base-300">${c}%</span> 46 </div> 47 <div class="basis-1/2 text-right"> 48 <img 49 class="ml-auto mb-2" 50 loading="lazy" 51 src=${(0,l.c)(t,i)} 52 width="32" 53 height="32" 54 alt=${`${o.team} team logo`} /> 55 <span class="text-xl text-base-300">${d}%</span> 56 </div> 57 </div> 58 <hr class="border-base-200 mt-auto mb-0" /> 59 <p class="mt-4 text-xs text-center font-normal font-sans"> 60 ${d===c?"Both teams have an equal chance of winning.":`The ${e[h].team} have a ${r[h]}% chance of beating\n the ${e[m].team} based off the odds.`} 61 </p> 62 </div> 63 `},this._getPickHtml=e=>{const{league:t,awayIdentifier:a,homeIdentifier:i,home:o,away:n,score_prediction:r,sportsbooks:d}=e;let c=0,h=0;if(null!=r&&r.pick&&(null==d?void 0:d.length)>0){const m={away:"No Pick Available",home:"No Pick Available"};let b=null;for(let e=0;e<d.length;e++)if(d[e].odds.spread.away.points){h=e;break}for(let e=0;e<d.length;e++)if(d[e].odds.total.over.points){c=e;break}m.away=`${n.city} ${n.team}`,m.home=`${o.city} ${o.team}`;let u=null,p=null,g=!1,x=!1;const v=Number(d[h].odds.spread.home.points),f=Number(d[h].odds.spread.away.points),w=Number(d[
63c].odds.total.over.points),y=r.home,$=r.away,k=r.home+v,P=r.away,_=y+$;y>$&&(b="home"),y<$&&(b="away"),y===$&&(b=null),k>P&&(u=o.team,p=v),P>k&&(u=n.team,p=f),k===P&&(g=!0);const H=Number(d[c].odds.total.over.points);let N="";_>w&&(N="OVER"),_<w&&(N="UNDER"),_===w&&(x=!0),p=p>0?`+${p}`:p;let O=s.x`${u} <span class="text-success">COVER</span> the ${p} spread`,T=s.x`the total is 64 <span class="text-${"OVER"===N?"success":"error"}">${N}</span> ${H}`;return g&&(O=s.x`The spread will <span class="text-warning">PUSH</span>`),x&&(T=s.x`The total will <span class="text-warning">PUSH</span>`),s.x` 65 <div class="flex-1 flex flex-col p-6 border border-base-200 rounded-lg"> 66 <h2 class="text-xl mb-4">Pick: ${b?m[b]+" To Win":"Too Close to Call"}</h2> 67 <img 68 class="mx-auto mb-2" 69 loading="lazy" 70 src=${(0,l.c)(t,"away"==b?a:i)} 71 width="32" 72 height="32" 73 alt=${`${e[b].team} team logo`} /> 74 <p class="text-center text-xs max-w-56 mb-4 font-normal font-sans">${O} and ${T}</p> 75 <hr class="border-base-200 mt-auto mb-0" /> 76 <p class="mt-4 text-xs text-center font-normal font-sans"> 77 ${s.x`Our formula is picking the ${u} (${p}) to cover the spread, and has the total going 78 <span class="capitalize">${N.toLowerCase()}</span> ${H}.`} 79 </p> 80 </div> 81 `}return s.x``}}render(){return s.x` 82 <div class="min-w-[20rem] text-base-content h-full bg-base-100 font-bold font-sans-bold"> 83 ${this._fetchMatchupTask.render({pending:()=>this._renderPendingHtml(),initial:()=>this._renderPendingHtml(),error:e=>(console.log(e),s.x`<slot name="no-data"></slot>`),complete:e=>s.x` 84 <div class="flex flex-col gap-y-6 justify-center lg:flex-row lg:gap-x-6"> 85 ${this._getPredictedScoreHtml(e)} ${this._getWinProbabilityHtml(e)} 86 ${this._getPickHtml(e)} 87 </div> 88 `})} 89 </div> 90 `}_renderPendingHtml(){return s.x`<div class="mt-4 border rounded gap-8 py-12 flex flex-col p-3 m-1 border-base-200 animate-pulse"> 91 <div class="flex gap-8 flex-col"> 92 <div class="flex gap-6 justify-between"> 93 <div class="flex gap-2"> 94 <div class="w-8 h-8 flex-shrink-0 rounded-full bg-base-200"></div> 95 <div class="h-8 w-12 bg-base-200 rounded"></div> 96 </div> 97 <div class="w-40 h-8 bg-base-200 rounded"></div> 98 <div class="w-20 h-8 bg-base-200 rounded"></div> 99 <div class="w-20 h-8 bg-base-200 rounded"></div> 100 </div> 101 <div class="flex gap-6 justify-between"> 102 <div class="flex gap-2"> 103 <div class="w-8 h-8 flex-shrink-0 rounded-full bg-base-200"></div> 104 <div class="h-8 w-12 bg-base-200 rounded"></div> 105 </div> 106 <div class="w-40 h-8 bg-base-200 rounded"></div> 107 <div class="w-20 h-8 bg-base-200 rounded"></div> 108 <div class="w-20 h-8 bg-base-200 rounded"></div> 109 </div> 110 </div> 111 </div>`}validateProps(){if(!this.league)throw new Error("Missing property: league");if(!this.identifier)throw new Error("Missing property: identifier")}};r([(0,s.n)({type:String,reflect:!0})],d.prototype,"identifier",2),d=r([(0,s.e)("xlmwc-matchup-picks"),(0,s.a)(s.c)],d)}}]);
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.