@simple-parlay/components 1.30.6-pre.3 → 1.30.6-pre.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +212 -215
- package/dist/react/components/MultiLegTable.d.ts +3 -1
- package/dist/react/components/PlaceEntryProvider.d.ts +1 -0
- package/dist/react/index.js +1 -1
- package/dist/react/index.mjs +212 -215
- package/dist/react-native/components/MultiLegTable.d.ts +3 -1
- package/dist/react-native/components/PlaceEntryProvider.d.ts +1 -0
- package/dist/react-native/components/SportSelector.d.ts +1 -1
- package/dist/react-native/index.js +1 -1
- package/dist/react-native/index.mjs +332 -332
- package/dist/shared/game-flow.d.ts +12 -1
- package/dist/shared/game-set-bet.d.ts +0 -1
- package/dist/shared/menu-placement.d.ts +26 -0
- package/dist/shared/mirror.d.ts +5 -3
- package/dist/shared/selection-actions.d.ts +8 -4
- package/dist/shared/selection-caps.d.ts +0 -1
- package/dist/shared/types.d.ts +6 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -47,114 +47,114 @@ return u("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:n?t:"none",stroke:t,st
|
|
|
47
47
|
return m("div",{className:`relative min-w-0 ${r}`,children:[p&&/* @__PURE__ */u("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 left-0 z-[2] w-10",style:{background:`linear-gradient(to right, ${C}, transparent)`}}),p&&!g&&/* @__PURE__ */u("button",{type:"button","aria-label":"Scroll left",onClick:()=>w(-1),className:"absolute top-1/2 z-[3] flex -translate-y-1/2 items-center justify-center active:scale-90",style:{...F,left:-11},children:/* @__PURE__ */u("span",{className:"flex items-center justify-center rounded-full",style:B,children:/* @__PURE__ */u(Je,{size:14,className:"rotate-180"})})}),f&&/* @__PURE__ */u("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 right-0 z-[2] w-10",style:{background:`linear-gradient(to left, ${C}, transparent)`}}),f&&!g&&/* @__PURE__ */u("button",{type:"button","aria-label":"Scroll right",onClick:()=>w(1),className:"absolute top-1/2 z-[3] flex -translate-y-1/2 items-center justify-center active:scale-90",style:{...F,right:-11},children:/* @__PURE__ */u("span",{className:"flex items-center justify-center rounded-full",style:B,children:/* @__PURE__ */u(Je,{size:14})})}),
|
|
48
48
|
/* @__PURE__ */u("div",{ref:d,onScroll:b,onPointerDown:e=>{"touch"!==e.pointerType&&(k.current={down:!0,lastX:e.clientX,travelled:0})},onPointerMove:e=>{const t=k.current;if(!t.down)return;const n=t.lastX-e.clientX;t.lastX=e.clientX,t.travelled+=Math.abs(n),d.current&&(d.current.scrollLeft+=n)},onPointerUp:v,onPointerCancel:v,onPointerLeave:v,className:`flex cursor-grab select-none items-stretch overflow-x-auto [-webkit-overflow-scrolling:touch] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden active:cursor-grabbing ${n}`,children:a(N)})]})}function nt({groups:t,theme:n,bodyFont:o,className:r=""}){const l=n.colors,a=l.background??"#fff";return 0===t.length?null:/* @__PURE__ */u(tt,{theme:n,itemCount:t.length,className:r,contentClassName:"items-center gap-2 px-0.5 py-0.5",children:n=>t.map((t,r)=>/* @__PURE__ */m(e.Fragment,{children:[r>0&&/* @__PURE__ */u("span",{"aria-hidden":!0,className:"h-5 w-px flex-none self-center",style:{backgroundColor:l.border}}),t.label&&/* @__PURE__ */u("span",{className:"flex-none self-center text-[10px] font-extrabold uppercase tracking-[0.14em]",style:{color:l.textMuted,fontFamily:o},children:t.label}),t.options.map(e=>{const r=e.value===t.value;/* @__PURE__ */
|
|
49
49
|
return u("button",{type:"button",onClick:()=>{n()||t.onChange(e.value)},className:"flex-none self-center whitespace-nowrap rounded-full px-3.5 py-1.5 text-[12px] font-bold tracking-[-0.01em] transition-colors active:translate-y-px",style:{fontFamily:o,border:`1px solid ${r?l.primary:l.border}`,backgroundColor:r?l.primary:a,color:r?l.primaryText:l.primary,cursor:"pointer"},children:e.label},e.value??"__all")})]},t.label??r))})}function ot({label:e,options:t,value:n,onChange:o,theme:r,bodyFont:l,className:a=""}){/* @__PURE__ */
|
|
50
|
-
return u(nt,{groups:[{label:e,options:t,value:n,onChange:o}],theme:r,bodyFont:l,className:a})}function rt(e){return(e.propositionType??e.proposition_type)?.trim()||void 0}function lt(e){return(e.description??e.proposition??"").trim()}var at={AND:/\s+AND\s+/,OR:/\s+OR\s+/};function it(e){return"composite_and"===(t=rt(e))||"composite_or"===t;var t}function st(e){const t=e.source_data;if(!t)return[];try{const e=JSON.parse(t)?.composite?.components;return Array.isArray(e)?e.filter(e=>"number"==typeof e&&Number.isFinite(e)):[]}catch{return[]}}function ct(e){const t=e.home_team?.trim(),n=e.away_team?.trim();if(t&&n)return`${t} vs ${n}`;if(t)return t;if(n)return n;const o=e.eventId??e.event_id;return o?.trim()?o.trim():null}function dt(e,t){if(!it(e))return null;const n=function(e){return it(e)?("composite_and"===(t=rt(e))?"AND":"composite_or"===t?"OR":null)||function(e){const t=e.source_data;if(!t)return null;try{const e=JSON.parse(t)?.composite?.operator;if("and"===e)return"AND";if("or"===e)return"OR"}catch{return null}return null}(e):null;var t}(e);if(!n)return null;const o=st(e);if(t&&o.length>=2){const e=[];for(const n of o){const o=t.get(n);o&&e.push({text:lt(o),eventLabel:ct(o),prop:o})}if(e.length>=2)return{operator:n,legs:e}}const r=function(e,t){const n=e.trim();if(!n)return null;const o=n.split(at[t]).map(e=>e.trim()).filter(Boolean);return o.length<2?null:o}(lt(e),n);return r?{operator:n,legs:r.map(e=>({text:e,eventLabel:null,prop:null}))}:null}var ut="#0F4C5C",mt={aussierules_afl:"AFL",rugbyleague_nrl:"NRL",basketball_nba:"NBA",basketball_ncaab:"CBB",americanfootball_nfl:"NFL",americanfootball_ncaaf:"CFB",soccer_epl:"EPL",soccer_italy_serie_a:"SEA",soccer_spain_la_liga:"LIG",soccer_germany_bundesliga:"BUN",soccer_usa_mls:"MLS",baseball_mlb:"MLB",icehockey_nhl:"NHL",horse_racing_aus:"RLT",roulette:"RLT",dice:"DCE",cointrio:"CT3"},pt={sports:"Pick the winners",casino:"Beat the house",racing:"Back a winner"};function ht(e,t,n){if(n)return n.slice(0,4).toUpperCase();const o=mt[e];if(o)return o;if(t&&e.startsWith(`${t}_`)){const n=e.slice(t.length+1).replace(/_/g," ").split(/\s+/).filter(Boolean).map(e=>e[0]).join("").slice(0,4).toUpperCase();if(n)return n}return e.startsWith("casino_")?e.slice(7,11).toUpperCase()||"CSN":e.slice(0,3).toUpperCase()||"·"}function ft(e,t){const n=t>0?Math.floor(t/68):e;return Math.max(2,Math.min(Math.ceil(e/2),n))}function xt(e){return!!e.is_composite_component||!!(t=rt(e))&&t.startsWith("co_");var t}function gt(e){return"object"==typeof e&&null!==e?Number(e.amount)||0:Number(e)||0}function yt(e){if(null==e)return 0;const t=Number(e);return Number.isFinite(t)?t:0}function bt(e){return"string"==typeof e?"true"===e.toLowerCase():!!e}function wt(e){const t=Number.isInteger(e);return new Intl.NumberFormat("en-AU",{style:"currency",currency:"AUD",minimumFractionDigits:t?0:2,maximumFractionDigits:2}).format(e)}function kt(e){const t="string"==typeof e?new Date(e.endsWith("Z")||/[+-]\d{2}:\d{2}$/.test(e)?e:e+"Z"):e;return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}).format(t)}function vt(e){return e.reduce((t,n)=>{const o=Nt(n,e);return t[o]||(t[o]=[]),t[o].push(n),t},{})}function Nt(e,t){if(e.sport)return e.sport;if(it(e)&&t)for(const n of st(e)){const e=t.find(e=>e.id===n);if(e?.sport)return e.sport}return"Other"}var Ct=["sports","casino","racing","prediction"];function Ft(e){const t=(e.category||"").toLowerCase(),n=e.sport||"",o=(rt(e)??"").toLowerCase();return"casino"===t||"casino"===o||n.startsWith("casino")?"casino":"racing"===t||n.startsWith("horse_racing")?"racing":"sports"}function Bt(e){return"racing"===Ft(e)}function At(e){const t={};for(const n of e){const e=Ft(n);t[e]||(t[e]=[]),t[e].push(n)}return t}function Mt(e){const t=At(e);return Ct.filter(e=>(t[e]?.length??0)>0)}function St(e){switch(e){case"casino":return"Choose a Game";case"racing":return"Choose a Meeting";default:return"Choose a Sport"}}function Lt(e,t,n,o){return o&&o.length>0?o.includes(e):!(void 0!==t&&e<t||void 0!==n&&e>n)}function zt(e,t,n){const o=n?.min_propositions??null,r=n?.max_propositions??null,l=(n?.allowed_propositions??e.allowed_propositions)?.filter(e=>(null==o||e>=o)&&(null==r||e<=r));if(l&&l.length>0)return null!=t&&l.includes(t)?{min:t,max:t}:{min:Math.min(...l),max:Math.max(...l)};const a=e.min_propositions??e.num_propositions??0,i=e.max_propositions??e.num_propositions??0;return{min:null!=o?Math.max(a,o):a,max:null!=r&&i>0?Math.min(i,r):r??i}}function Pt(e){const t=e.allocations?.find(e=>"jackpot"===e.allocation_type);return t&&(t.dollar_amount??0)>0?{enabled:!0,amount:t.dollar_amount,limit:e.jackpot_limit??0,progressive:!1}:!0===e.jackpot_enabled&&t&&t.percentage>0?{enabled:!0,amount:e.jackpot_amount??0,limit:e.jackpot_limit??0,progressive:!0}:!0===e.jackpot_enabled&&(e.jackpot_amount??0)>0?{enabled:!0,amount:e.jackpot_amount,limit:e.jackpot_limit??0,progressive:!1}:{enabled:!1,amount:0,limit:0,progressive:!1}}function Tt(e,t,n){return"racing"===e||!(!t?.length||!t.every(Bt))||!!n&&Boolean(t?.some(e=>e.sport===n||(e.sport||"").startsWith(`${n}_`)))}function Dt(e,t){const n={basketball_nba:"NBA",americanfootball_nfl:"NFL",icehockey_nhl:"NHL",baseball_mlb:"MLB",soccer_epl:"Premier League",soccer_usa_mls:"MLS",horse_racing_aus:"Horse Racing",casino_blackjack:"Blackjack",casino_roulette:"Roulette",casino_slots:"Slots",aussierules_afl:"AFL",rugbyleague_nrl:"NRL",aussierules_aflw:"AFLW",rugbyleague_nrlw:"NRLW","AUSTRALIAN-RULES":"AFL","RUGBY-LEAGUE":"NRL",cricket_international_t20:"T20 International",cricket_test_match:"Test Cricket"};return e.startsWith("casino_")?n[e]??e.replace(/^casino_/,"").replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()):t&&e.startsWith(`${t}_`)?e.slice(t.length+1).replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()):n[e]||e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function Ot(e,t,n){const o=t?.[e];return o||Dt(e,n)}function Et(e,t){const n=t?.[e];return n||function(e){return{sports:"Sports",casino:"Casino",racing:"Racing"}[e]??e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}(e)}function jt(e,t){if(e)return t&&e.startsWith(`${t}_`)?t:e}function Yt(e,t,n){return e===t||!!n&&(!(t!==n||!e.startsWith(`${n}_`))||!(e!==n||!t.startsWith(`${n}_`)))}function Ht(e,t,n){return!t||!!e&&(Yt(e,t,n)||Yt(t,e,n))}function Rt(e,t){return t.find(t=>t.id===e)}function Gt(e,t){let n=e;return t?.category&&(n=n.filter(e=>Ft(e)===t.category)),t?.sport&&(n=n.filter(n=>it(n)?function(e,t,n,o){if(Ht(e.sport,t,n))return!0;if(!o)return!1;for(const r of st(e)){const e=Rt(r,o);if(e&&Ht(e.sport,t,n))return!0}return!1}(n,t.sport,t.sportBaseKey,e):Ht(n.sport,t.sport,t.sportBaseKey))),n}function Wt(e,t){return!t||function(e){const t=(e.category||"sports").toLowerCase();return"casino"===t||"racing"===t?t:"sports"}(e)===t}function It(e,t,n){if(!t)return!0;const o=e.allowed_sports;return!o||0===o.length||o.some(e=>Yt(t,e,n))}function Ut(e,t,n){return!(n?.category&&!Wt(e,n.category))&&!(n?.sport&&!It(e,n.sport,n.sportBaseKey))&&Gt(Zt(t,e),n).length>0}function $t(e,t){return t?.category||t?.sport?e.filter(e=>!(t.category&&!Wt(e,t.category)||t.sport&&!It(e,t.sport,t.sportBaseKey))):e}function Kt(e,t){if(e.sport||!it(e))return e;const n=Nt(e,t);return"Other"===n?e:{...e,sport:n}}function Zt(e,t,n){const o=t.allowed_sports,r=o&&o.length>0,l=t.allowed_markets&&t.allowed_markets.length>0;return r||l?e.filter(a=>{if(xt(a))return!1;if(r)if(it(a)){if(!function(e,t,n,o){if(e.sport&&t.some(t=>Yt(e.sport,t,n)))return!0;if(!o)return!1;for(const r of st(e)){const e=Rt(r,o);if(e?.sport&&t.some(t=>Yt(e.sport,t,n)))return!0}return!1}(a,o,n,e))return!1}else if(!a.sport||!o.some(e=>Yt(a.sport,e,n)))return!1;return!(l&&!function(e,t){const n=t.allowed_markets;if(!n||0===n.length)return!0;const o=rt(e);return!!o&&n.includes(o)}(a,t))}).map(t=>Kt(t,e)):e.filter(e=>!xt(e)).map(t=>Kt(t,e))}function qt(e,t){const n=e.available_days;if(!n)return!0;if(0===n.length)return!0;const o=((t??/* @__PURE__ */new Date).getDay()+6)%7;return n.includes(o)}var Vt=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function Xt(e,t="#ffffff",n="#1a1a1a"){if(!e)return n;const o=function(e){const t=e.trim().toLowerCase(),n=t.match(/^#([0-9a-f]{3,8})$/);if(n){let e=n[1];return 3!==e.length&&4!==e.length||(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]}const o=t.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return o?[Number(o[1]),Number(o[2]),Number(o[3])]:null}(e);if(!o)return n;const[r,l,a]=o.map(e=>{const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)});return.2126*r+.7152*l+.0722*a>.4?n:t}function Qt(e,t,n){return Tt(t,e,n)?function(e){return e.reduce((e,t)=>{const n=t.away_team||t.eventId||"Race";return e[n]||(e[n]=[]),e[n].push(t),e},{})}(e):function(e){return e.reduce((e,t)=>{const n=`${t.home_team} vs ${t.away_team}`;return e[n]||(e[n]=[]),e[n].push(t),e},{})}(e)}function Jt(e){const t=[];for(const n of e){const e=n.home_team&&n.away_team&&!Bt(n)?`${n.home_team} vs ${n.away_team}`:n.away_team||n.home_team||n.eventId||null,o=t[t.length-1],r=null===e?null:t.find(t=>t.key===e);r?r.props.push(n):null===e&&null===o?.key?o.props.push(n):t.push({key:e,props:[n]})}return t}function _t(e,t){if(e===t)return[e];if(t<e)return[e];const n=[];for(let o=e;o<=t;o++)n.push(o);return n}function en(e,t){const n=[...e].sort(()=>Math.random()-.5).slice(0,t),o=[],r=[];for(const l of n)Math.random()<.5?o.push(l):r.push(l);return{yesPicks:o,noPicks:r}}var tn=/* @__PURE__ */new Map,nn=/* @__PURE__ */new Map;function on(e,t,n){return`data:image/svg+xml;utf8,${encodeURIComponent(function(e,t,n){let o=e.replace(/<\?xml[^?]*\?>/g,"").replace(/<!--[\s\S]*?-->/g,"");const r=["width:100%","height:100%","display:block"];t&&r.push(`color:${t}`),n&&r.push(`--icon-accent:${n}`);const l=`style="${r.join(";")}"`;return o=o.replace(/<svg\b([^>]*)>/,(e,t)=>`<svg${t.replace(/\s+style\s*=\s*"[^"]*"/i,"")} ${l}>`),o}(e,t,n))}`}function rn({iconUrl:t,width:n,height:o,iconColor:r,accentColor:l,ariaLabel:a,style:i}){const s=Me(t),[c,d]=e.useState(()=>s??tn.get(t)??null);e.useEffect(()=>{const e=Me(t);if(e)return void d(e);if(tn.has(t))return void d(tn.get(t));let n=!1;return function(e){const t=tn.get(e);if(void 0!==t)return Promise.resolve(t);const n=nn.get(e);if(n)return n;const o=fetch(e,{credentials:"omit"}).then(e=>{if(!e.ok)throw new Error(`SVG fetch failed: ${e.status}`);return e.text()}).then(t=>(tn.set(e,t),nn.delete(e),t)).catch(t=>{throw nn.delete(e),t});return nn.set(e,o),o}(t).then(e=>{n||d(e)}).catch(()=>{n||d(null)}),()=>{n=!0}},[t]);const m={display:"inline-block",width:n,height:o,lineHeight:0,...i};/* @__PURE__ */
|
|
51
|
-
return u("img",c?{src:
|
|
50
|
+
return u(nt,{groups:[{label:e,options:t,value:n,onChange:o}],theme:r,bodyFont:l,className:a})}function rt(e){return(e.propositionType??e.proposition_type)?.trim()||void 0}function lt(e){return(e.description??e.proposition??"").trim()}var at={AND:/\s+AND\s+/,OR:/\s+OR\s+/};function it(e){return"composite_and"===(t=rt(e))||"composite_or"===t;var t}function st(e){const t=e.source_data;if(!t)return[];try{const e=JSON.parse(t)?.composite?.components;return Array.isArray(e)?e.filter(e=>"number"==typeof e&&Number.isFinite(e)):[]}catch{return[]}}function ct(e){const t=e.home_team?.trim(),n=e.away_team?.trim();if(t&&n)return`${t} vs ${n}`;if(t)return t;if(n)return n;const o=e.eventId??e.event_id;return o?.trim()?o.trim():null}function dt(e,t){if(!it(e))return null;const n=function(e){return it(e)?("composite_and"===(t=rt(e))?"AND":"composite_or"===t?"OR":null)||function(e){const t=e.source_data;if(!t)return null;try{const e=JSON.parse(t)?.composite?.operator;if("and"===e)return"AND";if("or"===e)return"OR"}catch{return null}return null}(e):null;var t}(e);if(!n)return null;const o=st(e);if(t&&o.length>=2){const e=[];for(const n of o){const o=t.get(n);o&&e.push({text:lt(o),eventLabel:ct(o),prop:o})}if(e.length>=2)return{operator:n,legs:e}}const r=function(e,t){const n=e.trim();if(!n)return null;const o=n.split(at[t]).map(e=>e.trim()).filter(Boolean);return o.length<2?null:o}(lt(e),n);return r?{operator:n,legs:r.map(e=>({text:e,eventLabel:null,prop:null}))}:null}var ut="#0F4C5C",mt={aussierules_afl:"AFL",rugbyleague_nrl:"NRL",basketball_nba:"NBA",basketball_ncaab:"CBB",americanfootball_nfl:"NFL",americanfootball_ncaaf:"CFB",soccer_epl:"EPL",soccer_italy_serie_a:"SEA",soccer_spain_la_liga:"LIG",soccer_germany_bundesliga:"BUN",soccer_usa_mls:"MLS",baseball_mlb:"MLB",icehockey_nhl:"NHL",horse_racing_aus:"RLT",prediction:"PRD",roulette:"RLT",dice:"DCE",cointrio:"CT3"},pt={sports:"Pick the winners",casino:"Beat the house",racing:"Back a winner",prediction:"Call the outcome"};function ht(e,t,n){if(n)return n.slice(0,4).toUpperCase();const o=mt[e];if(o)return o;if(t&&e.startsWith(`${t}_`)){const n=e.slice(t.length+1).replace(/_/g," ").split(/\s+/).filter(Boolean).map(e=>e[0]).join("").slice(0,4).toUpperCase();if(n)return n}return e.startsWith("casino_")?e.slice(7,11).toUpperCase()||"CSN":e.slice(0,3).toUpperCase()||"·"}function ft(e,t){const n=t>0?Math.floor(t/68):e;return Math.max(2,Math.min(Math.ceil(e/2),n))}function xt(e){return!!e.is_composite_component||!!(t=rt(e))&&t.startsWith("co_");var t}function gt(e){return"object"==typeof e&&null!==e?Number(e.amount)||0:Number(e)||0}function yt(e){if(null==e)return 0;const t=Number(e);return Number.isFinite(t)?t:0}function bt(e){return"string"==typeof e?"true"===e.toLowerCase():!!e}function wt(e){const t=Number.isInteger(e);return new Intl.NumberFormat("en-AU",{style:"currency",currency:"AUD",minimumFractionDigits:t?0:2,maximumFractionDigits:2}).format(e)}function kt(e){const t="string"==typeof e?new Date(e.endsWith("Z")||/[+-]\d{2}:\d{2}$/.test(e)?e:e+"Z"):e;return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}).format(t)}function vt(e){return e.reduce((t,n)=>{const o=Nt(n,e);return t[o]||(t[o]=[]),t[o].push(n),t},{})}function Nt(e,t){if(e.sport)return e.sport;if(it(e)&&t)for(const n of st(e)){const e=t.find(e=>e.id===n);if(e?.sport)return e.sport}return"Other"}var Ct=["sports","casino","racing","prediction"];function Ft(e){const t=(e.category||"").toLowerCase(),n=e.sport||"",o=(rt(e)??"").toLowerCase();return"casino"===t||"casino"===o||n.startsWith("casino")?"casino":"racing"===t||n.startsWith("horse_racing")?"racing":"prediction"===t||n.startsWith("prediction")?"prediction":"sports"}function Bt(e){return"racing"===Ft(e)}function At(e){const t={};for(const n of e){const e=Ft(n);t[e]||(t[e]=[]),t[e].push(n)}return t}function Mt(e){const t=At(e);return Ct.filter(e=>(t[e]?.length??0)>0)}function St(e){switch(e){case"casino":return"Choose a Game";case"racing":return"Choose a Meeting";default:return"Choose a Sport"}}function Lt(e,t,n,o){return o&&o.length>0?o.includes(e):!(void 0!==t&&e<t||void 0!==n&&e>n)}function zt(e,t,n){const o=n?.min_propositions??null,r=n?.max_propositions??null,l=(n?.allowed_propositions??e.allowed_propositions)?.filter(e=>(null==o||e>=o)&&(null==r||e<=r));if(l&&l.length>0)return null!=t&&l.includes(t)?{min:t,max:t}:{min:Math.min(...l),max:Math.max(...l)};const a=e.min_propositions??e.num_propositions??0,i=e.max_propositions??e.num_propositions??0;return{min:null!=o?Math.max(a,o):a,max:null!=r&&i>0?Math.min(i,r):r??i}}function Pt(e){const t=e.allocations?.find(e=>"jackpot"===e.allocation_type);return t&&(t.dollar_amount??0)>0?{enabled:!0,amount:t.dollar_amount,limit:e.jackpot_limit??0,progressive:!1}:!0===e.jackpot_enabled&&t&&t.percentage>0?{enabled:!0,amount:e.jackpot_amount??0,limit:e.jackpot_limit??0,progressive:!0}:!0===e.jackpot_enabled&&(e.jackpot_amount??0)>0?{enabled:!0,amount:e.jackpot_amount,limit:e.jackpot_limit??0,progressive:!1}:{enabled:!1,amount:0,limit:0,progressive:!1}}function Tt(e,t,n){return"racing"===e||!(!t?.length||!t.every(Bt))||!!n&&Boolean(t?.some(e=>e.sport===n||(e.sport||"").startsWith(`${n}_`)))}function Dt(e,t){const n={basketball_nba:"NBA",americanfootball_nfl:"NFL",icehockey_nhl:"NHL",baseball_mlb:"MLB",soccer_epl:"Premier League",soccer_usa_mls:"MLS",horse_racing_aus:"Horse Racing",casino_blackjack:"Blackjack",casino_roulette:"Roulette",casino_slots:"Slots",aussierules_afl:"AFL",rugbyleague_nrl:"NRL",aussierules_aflw:"AFLW",rugbyleague_nrlw:"NRLW","AUSTRALIAN-RULES":"AFL","RUGBY-LEAGUE":"NRL",cricket_international_t20:"T20 International",cricket_test_match:"Test Cricket"};return e.startsWith("casino_")?n[e]??e.replace(/^casino_/,"").replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()):t&&e.startsWith(`${t}_`)?e.slice(t.length+1).replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()):n[e]||e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function Ot(e,t,n){const o=t?.[e];return o||Dt(e,n)}function Et(e,t){const n=t?.[e];return n||function(e){return{sports:"Sports",casino:"Casino",racing:"Racing"}[e]??e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}(e)}function jt(e,t){if(e)return t&&e.startsWith(`${t}_`)?t:e}function Yt(e,t,n){return e===t||!!n&&(!(t!==n||!e.startsWith(`${n}_`))||!(e!==n||!t.startsWith(`${n}_`)))}function Ht(e,t,n){return!t||!!e&&(Yt(e,t,n)||Yt(t,e,n))}function Rt(e,t){return t.find(t=>t.id===e)}function Gt(e,t){let n=e;return t?.category&&(n=n.filter(e=>Ft(e)===t.category)),t?.sport&&(n=n.filter(n=>it(n)?function(e,t,n,o){if(Ht(e.sport,t,n))return!0;if(!o)return!1;for(const r of st(e)){const e=Rt(r,o);if(e&&Ht(e.sport,t,n))return!0}return!1}(n,t.sport,t.sportBaseKey,e):Ht(n.sport,t.sport,t.sportBaseKey))),n}function Wt(e,t){return!t||function(e){const t=(e.category||"sports").toLowerCase();return"casino"===t||"racing"===t||"prediction"===t?t:"sports"}(e)===t}function It(e,t,n){if(!t)return!0;const o=e.allowed_sports;return!o||0===o.length||o.some(e=>Yt(t,e,n))}function Ut(e,t,n){return!(n?.category&&!Wt(e,n.category))&&!(n?.sport&&!It(e,n.sport,n.sportBaseKey))&&Gt(Zt(t,e),n).length>0}function $t(e,t){return t?.category||t?.sport?e.filter(e=>!(t.category&&!Wt(e,t.category)||t.sport&&!It(e,t.sport,t.sportBaseKey))):e}function Kt(e,t){if(e.sport||!it(e))return e;const n=Nt(e,t);return"Other"===n?e:{...e,sport:n}}function Zt(e,t,n){const o=t.allowed_sports,r=o&&o.length>0,l=t.allowed_markets&&t.allowed_markets.length>0;return r||l?e.filter(a=>{if(xt(a))return!1;if(r)if(it(a)){if(!function(e,t,n,o){if(e.sport&&t.some(t=>Yt(e.sport,t,n)))return!0;if(!o)return!1;for(const r of st(e)){const e=Rt(r,o);if(e?.sport&&t.some(t=>Yt(e.sport,t,n)))return!0}return!1}(a,o,n,e))return!1}else if(!a.sport||!o.some(e=>Yt(a.sport,e,n)))return!1;return!(l&&!function(e,t){const n=t.allowed_markets;if(!n||0===n.length)return!0;const o=rt(e);return!!o&&n.includes(o)}(a,t))}).map(t=>Kt(t,e)):e.filter(e=>!xt(e)).map(t=>Kt(t,e))}function qt(e,t){const n=e.available_days;if(!n)return!0;if(0===n.length)return!0;const o=((t??/* @__PURE__ */new Date).getDay()+6)%7;return n.includes(o)}var Vt=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function Xt(e,t="#ffffff",n="#1a1a1a"){if(!e)return n;const o=function(e){const t=e.trim().toLowerCase(),n=t.match(/^#([0-9a-f]{3,8})$/);if(n){let e=n[1];return 3!==e.length&&4!==e.length||(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]}const o=t.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return o?[Number(o[1]),Number(o[2]),Number(o[3])]:null}(e);if(!o)return n;const[r,l,a]=o.map(e=>{const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)});return.2126*r+.7152*l+.0722*a>.4?n:t}function Qt(e,t,n){return Tt(t,e,n)?function(e){return e.reduce((e,t)=>{const n=t.away_team||t.eventId||"Race";return e[n]||(e[n]=[]),e[n].push(t),e},{})}(e):function(e){return e.reduce((e,t)=>{const n=t.home_team&&!t.away_team?t.home_team:`${t.home_team} vs ${t.away_team}`;return e[n]||(e[n]=[]),e[n].push(t),e},{})}(e)}function Jt(e){const t=[];for(const n of e){const e=n.home_team&&n.away_team&&!Bt(n)?`${n.home_team} vs ${n.away_team}`:n.away_team||n.home_team||n.eventId||null,o=t[t.length-1],r=null===e?null:t.find(t=>t.key===e);r?r.props.push(n):null===e&&null===o?.key?o.props.push(n):t.push({key:e,props:[n]})}return t}function _t(e,t){if(e===t)return[e];if(t<e)return[e];const n=[];for(let o=e;o<=t;o++)n.push(o);return n}var en=/* @__PURE__ */new Map,tn=/* @__PURE__ */new Map;function nn(e,t,n){return`data:image/svg+xml;utf8,${encodeURIComponent(function(e,t,n){let o=e.replace(/<\?xml[^?]*\?>/g,"").replace(/<!--[\s\S]*?-->/g,"");const r=["width:100%","height:100%","display:block"];t&&r.push(`color:${t}`),n&&r.push(`--icon-accent:${n}`);const l=`style="${r.join(";")}"`;return o=o.replace(/<svg\b([^>]*)>/,(e,t)=>`<svg${t.replace(/\s+style\s*=\s*"[^"]*"/i,"")} ${l}>`),o}(e,t,n))}`}function on({iconUrl:t,width:n,height:o,iconColor:r,accentColor:l,ariaLabel:a,style:i}){const s=Me(t),[c,d]=e.useState(()=>s??en.get(t)??null);e.useEffect(()=>{const e=Me(t);if(e)return void d(e);if(en.has(t))return void d(en.get(t));let n=!1;return function(e){const t=en.get(e);if(void 0!==t)return Promise.resolve(t);const n=tn.get(e);if(n)return n;const o=fetch(e,{credentials:"omit"}).then(e=>{if(!e.ok)throw new Error(`SVG fetch failed: ${e.status}`);return e.text()}).then(t=>(en.set(e,t),tn.delete(e),t)).catch(t=>{throw tn.delete(e),t});return tn.set(e,o),o}(t).then(e=>{n||d(e)}).catch(()=>{n||d(null)}),()=>{n=!0}},[t]);const m={display:"inline-block",width:n,height:o,lineHeight:0,...i};/* @__PURE__ */
|
|
51
|
+
return u("img",c?{src:nn(c,r,l),alt:a??"","aria-hidden":!a||void 0,role:a?"img":"presentation","aria-label":a||void 0,style:{...m,objectFit:"contain"}}:{src:t,alt:a??"","aria-hidden":!a||void 0,style:{...m,objectFit:"contain"}})}function rn({iconUrl:e,gameName:t,onPress:n,size:o=120,brandColor:r="#0F4C5C",cardColor:l="#DDD9D2",iconColor:a,accentColor:i,captionColor:s="#14687C",className:c,ariaLabel:d}){const p=(t||"").toUpperCase(),h=o/360,f=a??l,x=K(r,i,f),g=n=>/* @__PURE__ */m("div",{style:{position:"relative",width:o,height:o},children:[/* @__PURE__ */m("svg",{viewBox:"0 0 360 360",preserveAspectRatio:"xMidYMid meet",width:"100%",height:"100%",role:"img","aria-label":d??`Press to play ${t}`,children:[
|
|
52
52
|
/* @__PURE__ */u("rect",{x:"2",y:"2",width:"356",height:"356",rx:"78",fill:l,stroke:r,strokeWidth:"4"}),
|
|
53
53
|
/* @__PURE__ */u("g",{style:{transform:n?"translate(0px, 0px)":"translate(50px, 50px)",transformOrigin:"145px 110px",transition:"transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1)"},children:/* @__PURE__ */u("rect",{x:"40",y:"5",width:"210",height:"210",rx:"42",fill:r,opacity:"0.30"})}),
|
|
54
54
|
/* @__PURE__ */u("g",{style:{transform:n?"translate(0px, 0px)":"translate(25px, 25px)",transformOrigin:"145px 110px",transition:"transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1)"},children:/* @__PURE__ */u("rect",{x:"40",y:"5",width:"210",height:"210",rx:"42",fill:r,opacity:"0.55"})}),
|
|
55
55
|
/* @__PURE__ */u("rect",{x:"40",y:"5",width:"210",height:"210",rx:"42",fill:r}),
|
|
56
56
|
/* @__PURE__ */u("text",{x:"180",y:"305",fontFamily:"Manrope, Poppins, sans-serif",fontSize:"32",letterSpacing:"1.5",textAnchor:"middle",fontWeight:800,fill:r,children:"PRESS TO PLAY"}),
|
|
57
|
-
/* @__PURE__ */u("text",{x:"180",y:"338",fontFamily:"Manrope, Poppins, sans-serif",fontSize:"18",letterSpacing:"2",textAnchor:"middle",fontWeight:500,fill:s,children:p})]}),/* @__PURE__ */u("div",{style:{position:"absolute",left:60*h,top:25*h,width:170*h,height:170*h,pointerEvents:"none"},children:/* @__PURE__ */u(
|
|
58
|
-
return u("button",{type:"button",onClick:t,"aria-label":o,className:n,onMouseEnter:()=>a(!0),onMouseLeave:()=>{a(!1),s(!1)},onMouseDown:()=>s(!0),onMouseUp:()=>s(!1),onTouchStart:()=>s(!0),onTouchEnd:()=>s(!1),onBlur:()=>{s(!1),a(!1)},style:{width:e,height:e,padding:0,background:"transparent",border:0,cursor:"pointer",borderRadius:e/360*78,transform:i?"scale(0.96)":"scale(1)",transition:"transform 140ms ease-out"},children:r(l||i)})}function
|
|
59
|
-
return u("div",{role:"status","aria-label":n,className:"inline-flex items-center justify-center",children:/* @__PURE__ */m("svg",{className:"animate-spin",style:{width:t,height:t,color:e},viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,children:[/* @__PURE__ */u("circle",{cx:"12",cy:"12",r:"10",strokeOpacity:"0.25"}),/* @__PURE__ */u("path",{d:"M12 2a10 10 0 0 1 10 10",strokeLinecap:"round"})]})})}function
|
|
60
|
-
return u(
|
|
61
|
-
return u("span",{className:`inline-block animate-pulse rounded-md ${t}`,style:{backgroundColor:e,opacity:.35,...n},"aria-hidden":!0})}function
|
|
62
|
-
return u("div",{className:`flex flex-col min-h-full w-full min-w-0 ${e}`,style:{fontFamily:t},children:/* @__PURE__ */u("div",{className:"flex-1 w-full min-w-0",children:n})})}function
|
|
63
|
-
return u("div",{className:"grid grid-cols-1 min-[400px]:grid-cols-2 gap-2.5 sm:gap-3 w-full","aria-hidden":!0,children:Array.from({length:t}).map((t,n)=>/* @__PURE__ */m("div",{className:"flex flex-col items-start justify-center gap-2 sm:gap-3 rounded-2xl border p-3.5 sm:p-5 w-full min-h-[112px] sm:min-h-[140px]",style:{backgroundColor:
|
|
64
|
-
return u("div",{className:"grid grid-cols-2 gap-3 w-full","aria-hidden":!0,children:Array.from({length:t}).map((t,n)=>/* @__PURE__ */m("div",{className:"flex flex-col items-center gap-2 rounded-2xl border px-3 py-3 sm:flex-row sm:gap-3.5 sm:px-4 sm:py-4 w-full min-w-0",style:{backgroundColor:
|
|
65
|
-
return u("div",{className:"grid grid-cols-1 gap-2.5 sm:gap-3 w-full","aria-hidden":!0,children:Array.from({length:t}).map((t,n)=>/* @__PURE__ */m("div",{className:"flex min-h-16 items-center justify-between gap-3 rounded-2xl border px-3.5 py-3.5 sm:px-5 sm:py-4 w-full",style:{backgroundColor:
|
|
66
|
-
return m("div",{className:"flex flex-col items-center rounded-3xl border px-5 pt-[22px] pb-5 w-[86%] max-w-[380px] mx-auto",style:{borderColor:e.border,backgroundColor:
|
|
67
|
-
/* @__PURE__ */u(
|
|
68
|
-
/* @__PURE__ */u(
|
|
69
|
-
/* @__PURE__ */u(
|
|
70
|
-
/* @__PURE__ */u(
|
|
71
|
-
/* @__PURE__ */u(
|
|
72
|
-
return u("div",{className:"grid grid-cols-3 gap-2 mb-3 w-full","aria-hidden":!0,children:[0,1,2].map(t=>/* @__PURE__ */u(
|
|
73
|
-
return m("div",{className:"flex flex-col w-full","aria-hidden":!0,children:[o&&/* @__PURE__ */u(
|
|
74
|
-
/* @__PURE__ */u(
|
|
75
|
-
return m("div",{className:"space-y-4 sm:space-y-6 pb-16 w-full","aria-hidden":!0,children:[/* @__PURE__ */u(
|
|
76
|
-
return u("div",{className:"flex border-b mb-4 w-full",style:{borderColor:e.border},"aria-hidden":!0,children:[0,1].map(t=>/* @__PURE__ */m("div",{className:"flex items-center gap-2 px-4 py-2.5 border-b-2 border-transparent",children:[/* @__PURE__ */u(
|
|
77
|
-
return m("div",{className:"rounded-lg border overflow-hidden w-full",style:{borderColor:e.border,backgroundColor:
|
|
78
|
-
return m("div",{className:"w-full flex flex-col","aria-hidden":!0,children:[/* @__PURE__ */u(
|
|
79
|
-
return u(mn,{className:o,bodyFont:t,children:/* @__PURE__ */m("div",{role:"status","aria-live":"polite","aria-label":d,className:"w-full min-w-0",children:[n?.trim()?/* @__PURE__ */u("p",{className:"text-sm text-center mb-4",style:{color:e.textMuted,fontFamily:t,margin:0},children:n}):null,c]})})}function Cn(e){return e.homeTeam&&e.awayTeam?`${e.homeTeam} vs ${e.awayTeam}`:e.homeTeam??e.awayTeam??e.id}function Fn(e){return(e??"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"")}function Bn(e){if(!e||e.quick_pick_only)return!1;const t=Fn(e.selection_scope);if("samegamemulti"===Fn(e.rule)||!0===e.require_same_event||"singleevent"===t||"sameevent"===t)return!0;const n=[e.game_name,e.game_name_template].map(Fn);return n.includes("samegame")||n.includes("samegamemulti")}function An(e){return(e.eventId??e.event_id)?.trim()||null}function Mn(e){const t=/* @__PURE__ */new Map;for(const n of e){if(!Pn(n))continue;const e=An(n);if(!e)continue;const o=t.get(e);o?(o.propositionCount+=1,o.homeTeam=Sn(o.homeTeam,n.home_team),o.awayTeam=Sn(o.awayTeam,n.away_team),o.sport=Sn(o.sport,n.sport),o.league=Sn(o.league,n.league),o.commenceTime=zn(o.commenceTime,n.commence_time)):t.set(e,{id:e,homeTeam:n.home_team?.trim()||void 0,awayTeam:n.away_team?.trim()||void 0,commenceTime:n.commence_time?.trim()||void 0,sport:n.sport?.trim()||void 0,league:n.league?.trim()||void 0,propositionCount:1})}return[...t.values()].sort((e,t)=>{const n=Ln(e.commenceTime),o=Ln(t.commenceTime);return n!==o?n-o:e.id.localeCompare(t.id)})}function Sn(e,t){const n=t?.trim();return n?e&&e.localeCompare(n)<=0?e:n:e}function Ln(e){if(!e)return Number.MAX_SAFE_INTEGER;const t=new Date(e).getTime();return Number.isFinite(t)?t:Number.MAX_SAFE_INTEGER}function zn(e,t){const n=t?.trim();if(!n)return e;if(!e)return n;const o=Ln(e),r=Ln(n);return r!==o?r<o?n:e:e.localeCompare(n)<=0?e:n}function Pn(e){return!1!==e.bettable&&!0!==e.is_suspended&&!0!==e.is_expired&&!0!==e.is_voided&&!0!==e.is_composite_component}function Tn(e,t){return t?e.filter(e=>Pn(e)&&An(e)===t):[]}function Dn(e,t){return!!t&&e.length>0&&e.every(e=>Pn(e)&&An(e)===t)}var On={signature:1,premier:2,exclusive:3},En=[{id:"signature",label:"Signature Games",shortLabel:"Signature",level:1},{id:"premier",label:"Premier Games",shortLabel:"Premier",level:2},{id:"exclusive",label:"Exclusive Games",shortLabel:"Exclusive",level:3}];function jn(e){return"number"==typeof e.tier&&Number.isFinite(e.tier)?e.tier:1}function Yn(e,t){return e.filter(e=>jn(e)===t)}function Hn(e){const t=new Set(e.map(jn));return En.filter(e=>t.has(e.level))}function Rn(e){return Hn(e)[0]?.id??"signature"}var Gn=.21875,Wn=[1,5,10,20,50],In=[4,12];function Un(e){return(e??"").trim().toLowerCase()}var $n={straight:"mirror",double:"double_mirror",triple:"triple_mirror"};function Kn(e){if(!e||e.quick_pick_only)return!1;const t=Un(e.rule);return Object.values($n).includes(t)}function Zn(e,t,n){const o=n?.operatorMargin??.21875,r=n?.perLegProbability??.5,l=Math.round(Math.pow(2,t)),a=Math.pow(r,t)+Math.pow(1-r,t),i=Math.round(1/a),s=(1-o)*Math.pow(2,t-1);return{legs:t,stake:e,prize:Math.round(e*s*100)/100,multiple:s,totalOutcomes:l,winningOutcomes:2,oddsOneIn:i}}function qn(e){if(!Kn(e)||!e)return null;const t=e.min_propositions??e.allowed_propositions?.[0]??In[0],n=e.max_propositions??e.allowed_propositions?.[e.allowed_propositions.length-1]??In[1],o=Xn(function(e){const t=Un(e?.rule);return Object.keys($n).find(e=>$n[e]===t)??"straight"}(e)),r=(e.allowed_propositions&&e.allowed_propositions.length>0?[...e.allowed_propositions].sort((e,t)=>e-t):Array.from({length:Math.max(0,n-t+1)},(e,n)=>t+n)).filter(e=>e>=o.minLegs);if(0===r.length)return null;const l=Math.max(e.min_bet??1,.01),a=e.max_bet??null,i=Wn.filter(e=>e>=l&&(null===a||e<=a));return{variant:o,legOptions:r,defaultLegs:r.includes(8)?8:r[Math.floor(r.length/2)],defaultStake:Math.min(Math.max(20,l),a??20),minStake:l,maxStake:a,quickStakes:i,tagline:o.tagline,operatorMargin:e.operator_margin??.21875,perLegProbability:e.payout_structure?.per_leg_probability??.5}}var Vn=[{id:"straight",name:"Straight Mirror",depth:1,minLegs:4,waysToWin:"2 ways to win",description:"All or nothing. Get every call right, or every call wrong. Both pay the same.",tagline:"Call every leg. Get them all right, you win — all wrong, you win the same.",tierNames:["Perfect"]},{id:"double",name:"Double Mirror",depth:2,minLegs:6,waysToWin:"4 ways to win",description:"Perfect, or one off, at either edge. All right or all wrong, plus the near miss on each side.",tagline:"Perfect, or one off, at either edge — four ways to land a win.",tierNames:["Perfect","Near"]},{id:"triple",name:"Triple Mirror",depth:3,minLegs:9,waysToWin:"6 ways to win",description:"Within two of a clean sweep, either way. Longer legs only, so you still miss the middle.",tagline:"Within two of a clean sweep, either way — six ways to land a win.",tierNames:["Perfect","Near","Third"]}];function Xn(e){return Vn.find(t=>t.id===e)??Vn[0]}function Qn(e,t){if(t<0||t>e)return 0;const n=Math.min(t,e-t);let o=1;for(let r=0;r<n;r++)o=o*(e-r)/(r+1);return Math.round(o)}var Jn=4,_n=6,eo=[4,12],to=[5,10,20,50];function no(e){return!!e&&!e.quick_pick_only&&"safety_net"===(e.rule??"").trim().toLowerCase()}function oo(e){const t=e.payout_structure;return{margin:e.operator_margin??0,perLegProbability:t?.per_leg_probability??.5,perfectMultiple:t?.perfect_prize?.stake_multiple??25,perfectBaseLegs:t?.perfect_prize?.base_legs??6,nearMissBudgetFraction:t?.near_miss?.budget_fraction??.5,roundTo:t?.round_to??5}}function ro(e,t){return t>0&&e>=t?Math.round(e/t)*t:Math.round(e)}function lo(e,t){if(t<0||t>e)return 0;let n=1;for(let o=0;o<t;o+=1)n=n*(e-o)/(o+1);return Math.round(n)}function ao(e,t,n,o){const r=Math.max(0,Math.min(n,t)),l=e*o.perfectMultiple*Math.pow(2,t-o.perfectBaseLegs),a=r>0?e*(1-o.margin)*o.nearMissBudgetFraction/r:0,i=Math.pow(1/o.perLegProbability,t),s=[];let c=lo(t,0);for(let d=1;d<=r;d+=1)c+=lo(t,d),s.push(ro(a*i/c,o.roundTo));return{legs:t,stake:e,allowedMisses:r,perfect:l,nearMiss:s,sweep:l+s.reduce((e,t)=>e+t,0)}}function io(e,t){if(t<0||t>e.allowedMisses)return 0;let n=0===t?e.perfect:0;for(let o=Math.max(1,t);o<=e.nearMiss.length;o+=1)n+=e.nearMiss[o-1];return n}function so(e){return e.includes(8)?8:e[Math.floor(e.length/2)]}function co(e){return e.toLowerCase().replace(/[^a-z]+/g," ").trim()}function uo(e,t){const n=co(t);return e.permitted_rules?.find(e=>co(e.name??"").includes(n))??null}function mo(e,t,n){const o=t?.min_propositions??n,r=t?.max_propositions??null;return e.filter(e=>e>=o&&(null==r||e<=r))}function po(e){if(!no(e)||!e)return null;const t=e.min_propositions??e.allowed_propositions?.[0]??eo[0],n=e.max_propositions??e.allowed_propositions?.[e.allowed_propositions.length-1]??eo[1],o=e.allowed_propositions&&e.allowed_propositions.length>0?[...e.allowed_propositions].sort((e,t)=>e-t):Array.from({length:Math.max(0,n-t+1)},(e,n)=>t+n),r=uo(e,"Extra Shot"),l=uo(e,"Double Shot"),a=mo(o,r,4).filter(e=>e>1),i=mo(o,l,6).filter(e=>e>2);if(0===a.length)return null;const s=[{id:"extra_shot",label:"Extra Shot",allowedMisses:1,stat:"Bigger payout",explain:"Miss one leg and you win the All but 1 prize. Get every leg right and you win both — the Perfect prize on top.",legOptions:a,defaultLegs:so(a),ruleId:r?.id??null}],c=!e.permitted_rules?.length||!!l;i.length>0&&c&&s.push({id:"double_shot",label:"Double Shot",allowedMisses:2,stat:"Safer play",explain:"Miss two legs and you win the All but 2 prize. Miss one and you win two prizes. Get every leg right and you win all three — the whole stack.",legOptions:i,defaultLegs:so(i),ruleId:l?.id??null});const d=Math.max(e.min_bet??5,.01),u=e.max_bet??null,m=to.filter(e=>null===u||e<=u);return{modes:s,defaultModeId:"extra_shot",defaultStake:Math.min(Math.max(20,d),u??20),minStake:d,maxStake:u,quickAdds:m,tagline:"The wider the safety net, the more misses it catches. The narrower it is, the bigger the top prize.",pricing:oo(e)}}function ho(e){return[{id:`target-${e}`,label:"Perfect pick",stat:"Top payout",detail:["Get every pick right","nothing else pays"],emphasis:!0,expectedCorrect:e}]}function fo(e,t,n){const o=Math.max(0,e-t),r=ao(20,e,o,n),l=[];for(let a=0;a<=o;a+=1){const t=Math.round(io(r,a));l.push({misses:a,label:`${e-a}/${e}`,multiplier:t/20,payout20:t})}return l}function xo(e,t){return[{id:"net-1",label:"Extra Shot",stat:"Bigger payout",detail:["One wrong wins a prize","Perfect wins both","Miss twice and the ticket does not pay"],dividends:fo(e,e-1,t),expectedCorrect:e-1},{id:"net-2",label:"Double Shot",stat:"Safer play",detail:["Two wrong wins a prize","One wrong wins two","Perfect wins all three"],dividends:fo(e,e-2,t),expectedCorrect:e-2}]}function go(e,t){if(!e||e.quick_pick_only)return null;const n=function(e){return(e??"").trim().toLowerCase()}(e.rule),o=t??e.num_propositions??e.min_propositions??e.allowed_propositions?.[0]??0;return"safety_net"===n&&o>0?function(e,t){return{mode:"selection",kind:"safety_net",title:"Choose your safety net",headline:"2 Ways to PLAY, more ways to PAY",heroTagline:"The wider the safety net, the more misses it catches. The narrower it is, the bigger the top prize.",legCount:t,options:xo(t,oo(e)),continueLabel:"Continue to picks"}}(e,o):"exact"===n&&o>0?function(e,t){return{mode:"selection",kind:"exact",title:"All or nothing",headline:"Get it PERFECT, take the top PAY",heroTagline:"Every pick has to land. Miss a single one and the ticket is gone — but a clean sweep pays the biggest prize.",legCount:t,options:ho(t),continueLabel:"Continue to picks"}}(0,o):"pick"===n&&o>0?function(e,t){return{mode:"description",kind:"pick",title:"How it plays",headline:"Every hit PLAYS, every hit PAYS",heroTagline:"No all-or-nothing — your multiplier climbs with every correct pick.",legCount:t,highlights:["Make your yes/no picks across the available markets","Each correct pick pushes your multiplier higher","Land fewer than the full card and you can still cash"],continueLabel:"Continue to picks"}}(0,o):null}function yo(e){return null!=go(e)}var bo=[500,1e3,2500,5e3,7500,1e4,12500,15e3],wo=[12,11,10,9,8,7,6];function ko(e){return!!e&&!e.quick_pick_only&&"pick_your_dividend"===(e.rule??"").trim().toLowerCase()}function vo(e){return Math.round(100*e)/100}function No(e,t,n=.21875){const o=Math.pow(2,t),r=e/(1-n)/o,l=Number.isInteger(r),a=vo(r),i=l?r:vo(.96*r);return{legs:t,exactStake:a,stake:i,margin:1-e/(i*o),multiple:e/i,oddsOneIn:o,discounted:!l}}function Co(e,t=wo){return{dividend:e,rungs:t.map(t=>No(e,t))}}function Fo(e,t){if(!ko(e)||!e)return null;const n=e.min_propositions??6,o=e.max_propositions??12,r=wo.filter(e=>e>=n&&e<=o);if(0===r.length)return null;const l=t?.dividends??bo;return{dividends:l.map(e=>Co(e,r)),defaultDividend:l.includes(1e4)?1e4:l[Math.floor(l.length/2)],defaultLegs:r.includes(9)?9:r[Math.floor(r.length/2)],tagline:"The dividend is set. The win is yours to build."}}function Bo(e,t){const n=e.allowed_propositions&&e.allowed_propositions.length>0?e.allowed_propositions.map(Number):[],o=e.min_propositions??e.num_propositions??null,r=e.max_propositions??e.num_propositions??null,l=0===n.length&&null!==o&&null!==r&&r>0,a=n.length>0?n:l?_t(o,r):[],i=/* @__PURE__ */new Map;for(const f of t?.top_payouts??[]){const e=Number(f.proposition_count),t=Number(f.net_payout),n=Number(f.bet_amount??20);!Number.isFinite(e)||e<=0||i.set(e,{count:e,payout:Number.isFinite(t)?t:0,betAmount:Number.isFinite(n)&&n>0?n:20})}for(const f of a){const e=Number(f);i.has(e)||i.set(e,{count:e,payout:0,betAmount:20})}const s=Array.from(i.values()).sort((e,t)=>e.count-t.count),c=a.length>0?Math.max(...a.map(Number)):0,d=ko(e)?Fo(e):null,u=d?d.dividends.map(e=>({dividend:e.dividend,stakeFrom:Math.min(...e.rungs.map(e=>e.stake))})):void 0,m=d?[]:s.map(e=>({count:e.count,payout20:e.payout>0&&e.betAmount>0?e.payout/e.betAmount*20:0})),p=go(e,c),h="safety_net"===p?.kind?(p.options??[]).flatMap(e=>e.dividends?.length?[{id:e.id,label:e.label,tiers:e.dividends.map(e=>({label:e.label,payout20:e.payout20}))}]:[]):[];return{legOptions:a.map(Number),maxLegCount:c,tiers:m,modes:h,pydDividends:u,hasGenericDividends:(n.length>0||l)&&m.some(e=>e.payout20>0),minBet:Math.max(e.min_bet??1,1),maxBet:e.max_bet??null}}function Ao({tiers:e,modes:t,pydDividends:n,onPlayCount:o,minBet:r=1,maxBet:l=null,colors:a,bodyFont:i,headingFont:s}){const p=e=>Math.min(Math.max(e,r),l??1/0),[h,f]=c(()=>String(p(20))),x=parseFloat(h),g=p(Number.isFinite(x)&&x>0?x:20),y=g/20,b=!!(t?.length||n?.length||e.some(e=>e.payout20>0)),w=!!t?.length;if(!b)return null;const k=/* @__PURE__ */m("p",{className:"mb-2 flex items-center gap-1 text-[10px] italic",style:{color:a.textMuted,margin:"0 0 8px"},children:["Example values for a",
|
|
57
|
+
/* @__PURE__ */u("text",{x:"180",y:"338",fontFamily:"Manrope, Poppins, sans-serif",fontSize:"18",letterSpacing:"2",textAnchor:"middle",fontWeight:500,fill:s,children:p})]}),/* @__PURE__ */u("div",{style:{position:"absolute",left:60*h,top:25*h,width:170*h,height:170*h,pointerEvents:"none"},children:/* @__PURE__ */u(on,{iconUrl:e,width:"100%",height:"100%",iconColor:f,accentColor:x})})]});return n?/* @__PURE__ */u(ln,{size:o,onPress:n,className:c,ariaLabel:d??`Press to play ${t}`,renderInner:g}):/* @__PURE__ */u("div",{className:c,style:{width:o,height:o},children:g(!1)})}function ln({size:e,onPress:t,className:n,ariaLabel:o,renderInner:r}){const[l,a]=c(!1),[i,s]=c(!1);/* @__PURE__ */
|
|
58
|
+
return u("button",{type:"button",onClick:t,"aria-label":o,className:n,onMouseEnter:()=>a(!0),onMouseLeave:()=>{a(!1),s(!1)},onMouseDown:()=>s(!0),onMouseUp:()=>s(!1),onTouchStart:()=>s(!0),onTouchEnd:()=>s(!1),onBlur:()=>{s(!1),a(!1)},style:{width:e,height:e,padding:0,background:"transparent",border:0,cursor:"pointer",borderRadius:e/360*78,transform:i?"scale(0.96)":"scale(1)",transition:"transform 140ms ease-out"},children:r(l||i)})}function an(e){return e.selectionCard??e.backgroundAlt}function sn({color:e,size:t=20,label:n="Loading"}){/* @__PURE__ */
|
|
59
|
+
return u("div",{role:"status","aria-label":n,className:"inline-flex items-center justify-center",children:/* @__PURE__ */m("svg",{className:"animate-spin",style:{width:t,height:t,color:e},viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,children:[/* @__PURE__ */u("circle",{cx:"12",cy:"12",r:"10",strokeOpacity:"0.25"}),/* @__PURE__ */u("path",{d:"M12 2a10 10 0 0 1 10 10",strokeLinecap:"round"})]})})}function cn({color:e="#ffffff",size:t=18}){/* @__PURE__ */
|
|
60
|
+
return u(sn,{color:e,size:t,label:"Loading"})}function dn({color:e,className:t="",style:n}){/* @__PURE__ */
|
|
61
|
+
return u("span",{className:`inline-block animate-pulse rounded-md ${t}`,style:{backgroundColor:e,opacity:.35,...n},"aria-hidden":!0})}function un({className:e="",bodyFont:t,children:n}){/* @__PURE__ */
|
|
62
|
+
return u("div",{className:`flex flex-col min-h-full w-full min-w-0 ${e}`,style:{fontFamily:t},children:/* @__PURE__ */u("div",{className:"flex-1 w-full min-w-0",children:n})})}function mn({colors:e,count:t=2}){/* @__PURE__ */
|
|
63
|
+
return u("div",{className:"grid grid-cols-1 min-[400px]:grid-cols-2 gap-2.5 sm:gap-3 w-full","aria-hidden":!0,children:Array.from({length:t}).map((t,n)=>/* @__PURE__ */m("div",{className:"flex flex-col items-start justify-center gap-2 sm:gap-3 rounded-2xl border p-3.5 sm:p-5 w-full min-h-[112px] sm:min-h-[140px]",style:{backgroundColor:an(e),borderColor:e.border},children:[/* @__PURE__ */u(dn,{color:e.textMuted,className:"h-5 w-[11rem] max-w-full"}),/* @__PURE__ */u(dn,{color:e.textMuted,className:"h-3 w-24 max-w-[70%]"})]},n))})}function pn({colors:e,count:t=4}){/* @__PURE__ */
|
|
64
|
+
return u("div",{className:"grid grid-cols-2 gap-3 w-full","aria-hidden":!0,children:Array.from({length:t}).map((t,n)=>/* @__PURE__ */m("div",{className:"flex flex-col items-center gap-2 rounded-2xl border px-3 py-3 sm:flex-row sm:gap-3.5 sm:px-4 sm:py-4 w-full min-w-0",style:{backgroundColor:an(e),borderColor:e.border},children:[/* @__PURE__ */u(dn,{color:e.textMuted,className:"h-10 w-10 sm:h-12 sm:w-12 rounded-xl shrink-0"}),/* @__PURE__ */m("div",{className:"flex w-full min-w-0 flex-col items-center gap-1.5 sm:w-auto sm:items-start",children:[/* @__PURE__ */u(dn,{color:e.textMuted,className:"h-3.5 w-20 max-w-full"}),/* @__PURE__ */u(dn,{color:e.textMuted,className:"h-2.5 w-12 max-w-[80%]"})]})]},n))})}function hn({colors:e,count:t=3}){/* @__PURE__ */
|
|
65
|
+
return u("div",{className:"grid grid-cols-1 gap-2.5 sm:gap-3 w-full","aria-hidden":!0,children:Array.from({length:t}).map((t,n)=>/* @__PURE__ */m("div",{className:"flex min-h-16 items-center justify-between gap-3 rounded-2xl border px-3.5 py-3.5 sm:px-5 sm:py-4 w-full",style:{backgroundColor:an(e),borderColor:e.border},children:[/* @__PURE__ */m("div",{className:"min-w-0 flex-1",children:[/* @__PURE__ */u("div",{className:"rounded-xl px-3 py-2.5",style:{backgroundColor:e.backgroundAlt},children:/* @__PURE__ */u(dn,{color:e.textMuted,className:"h-4 w-44 max-w-full"})}),/* @__PURE__ */u(dn,{color:e.textMuted,className:"h-3 w-40 max-w-[80%] mt-2"})]}),/* @__PURE__ */u(dn,{color:e.textMuted,className:"h-5 w-5 rounded shrink-0"})]},n))})}function fn({colors:e,tileSize:t=116}){/* @__PURE__ */
|
|
66
|
+
return m("div",{className:"flex flex-col items-center rounded-3xl border px-5 pt-[22px] pb-5 w-[86%] max-w-[380px] mx-auto",style:{borderColor:e.border,backgroundColor:an(e)},"aria-hidden":!0,children:[
|
|
67
|
+
/* @__PURE__ */u(dn,{color:e.textMuted,className:"rounded-2xl",style:{width:t,height:t}}),
|
|
68
|
+
/* @__PURE__ */u(dn,{color:e.textMuted,className:"h-3 w-11 mt-3"}),
|
|
69
|
+
/* @__PURE__ */u(dn,{color:e.textMuted,className:"h-5 w-36 max-w-[80%] mt-2"}),
|
|
70
|
+
/* @__PURE__ */u(dn,{color:e.textMuted,className:"h-3 w-48 max-w-[90%] mt-3"}),
|
|
71
|
+
/* @__PURE__ */u(dn,{color:e.textMuted,className:"h-3 w-40 max-w-[75%] mt-1.5"})]})}function xn({colors:e}){/* @__PURE__ */
|
|
72
|
+
return u("div",{className:"grid grid-cols-3 gap-2 mb-3 w-full","aria-hidden":!0,children:[0,1,2].map(t=>/* @__PURE__ */u(dn,{color:e.textMuted,className:"h-[38px] w-full rounded-full"},t))})}function gn({colors:e,count:t=3,tileSize:n=116,showTierTabs:o=!1}){/* @__PURE__ */
|
|
73
|
+
return m("div",{className:"flex flex-col w-full","aria-hidden":!0,children:[o&&/* @__PURE__ */u(xn,{colors:e}),
|
|
74
|
+
/* @__PURE__ */u(fn,{colors:e,tileSize:n}),t>1&&/* @__PURE__ */m(d,{children:[/* @__PURE__ */u("div",{className:"flex items-center justify-center gap-2.5 pt-4 pb-2",children:Array.from({length:t}).map((t,n)=>/* @__PURE__ */u(dn,{color:e.textMuted,className:"rounded-full",style:{width:0===n?22:7,height:7}},n))}),/* @__PURE__ */m("div",{className:"mt-1 pt-2.5",style:{borderTop:`1px solid ${e.border}`},children:[/* @__PURE__ */u(dn,{color:e.textMuted,className:"h-2.5 w-16 mb-2"}),/* @__PURE__ */u("div",{className:"grid gap-1",style:{gridTemplateColumns:"repeat(auto-fit, minmax(84px, 1fr))"},children:Array.from({length:t}).map((t,n)=>/* @__PURE__ */m("div",{className:"flex flex-col items-center gap-1.5 px-1 py-1.5",children:[/* @__PURE__ */u(dn,{color:e.textMuted,className:"h-[52px] w-[52px] rounded-2xl"}),/* @__PURE__ */u(dn,{color:e.textMuted,className:"h-2.5 w-12"})]},n))})]})]})]})}function yn({colors:e,groups:t=2,rowsPerGroup:n=2}){/* @__PURE__ */
|
|
75
|
+
return m("div",{className:"space-y-4 sm:space-y-6 pb-16 w-full","aria-hidden":!0,children:[/* @__PURE__ */u(dn,{color:e.textMuted,className:"h-7 w-[4.5rem] rounded-full"}),/* @__PURE__ */u("div",{className:"space-y-4",children:Array.from({length:t}).map((t,o)=>/* @__PURE__ */m("div",{className:"rounded-xl border overflow-hidden w-full",style:{borderColor:e.border,backgroundColor:an(e)},children:[/* @__PURE__ */m("div",{className:"px-4 py-3 flex flex-col gap-1.5",style:{backgroundColor:e.backgroundAlt},children:[/* @__PURE__ */u(dn,{color:e.textMuted,className:"h-4 w-44 max-w-[80%]"}),/* @__PURE__ */u(dn,{color:e.textMuted,className:"h-3 w-24"})]}),/* @__PURE__ */u("div",{className:"divide-y",style:{borderColor:e.border},children:Array.from({length:n}).map((t,n)=>/* @__PURE__ */m("div",{className:"flex items-center justify-between gap-3 px-4 py-3 sm:py-3.5",style:{borderColor:e.border},children:[/* @__PURE__ */u(dn,{color:e.textMuted,className:"h-4 flex-1 max-w-[58%]"}),/* @__PURE__ */m("div",{className:"flex gap-1.5 shrink-0",children:[/* @__PURE__ */u(dn,{color:e.textMuted,className:"h-7 w-11 sm:h-8 sm:w-12 rounded-lg"}),/* @__PURE__ */u(dn,{color:e.textMuted,className:"h-7 w-11 sm:h-8 sm:w-12 rounded-lg"})]})]},n))})]},o))})]})}function bn({colors:e}){/* @__PURE__ */
|
|
76
|
+
return u("div",{className:"flex border-b mb-4 w-full",style:{borderColor:e.border},"aria-hidden":!0,children:[0,1].map(t=>/* @__PURE__ */m("div",{className:"flex items-center gap-2 px-4 py-2.5 border-b-2 border-transparent",children:[/* @__PURE__ */u(dn,{color:e.textMuted,className:"h-3.5 w-[4.25rem]"}),/* @__PURE__ */u(dn,{color:e.textMuted,className:"h-5 min-w-[1.25rem] w-5 rounded-full"})]},t))})}function wn({colors:e}){/* @__PURE__ */
|
|
77
|
+
return m("div",{className:"rounded-lg border overflow-hidden w-full",style:{borderColor:e.border,backgroundColor:an(e)},"aria-hidden":!0,children:[/* @__PURE__ */m("div",{className:"w-full px-4 py-3 flex items-center justify-between gap-3",children:[/* @__PURE__ */m("div",{className:"min-w-0 flex-1 flex flex-col gap-1.5",children:[/* @__PURE__ */u(dn,{color:e.textMuted,className:"h-[18px] w-40 max-w-[75%]"}),/* @__PURE__ */u(dn,{color:e.textMuted,className:"h-3 w-32 max-w-[65%]"})]}),/* @__PURE__ */m("div",{className:"flex items-center gap-3 shrink-0",children:[/* @__PURE__ */u(dn,{color:e.textMuted,className:"h-3.5 w-10"}),/* @__PURE__ */u(dn,{color:e.textMuted,className:"h-6 w-[3.75rem] rounded-full"})]})]}),/* @__PURE__ */u("div",{className:"border-t divide-y w-full",style:{borderColor:e.border},children:[0,1,2].map(t=>/* @__PURE__ */m("div",{className:"px-4 py-2.5 flex items-center justify-between gap-3",children:[/* @__PURE__ */m("div",{className:"flex-1 min-w-0 flex flex-col gap-1",children:[/* @__PURE__ */u(dn,{color:e.textMuted,className:"h-3.5 w-[88%]"}),/* @__PURE__ */u(dn,{color:e.textMuted,className:"h-3 w-[70%]"})]}),/* @__PURE__ */u(dn,{color:e.textMuted,className:"h-5 w-10 rounded shrink-0"})]},t))})]})}function kn({colors:e,rows:t=2}){/* @__PURE__ */
|
|
78
|
+
return m("div",{className:"w-full flex flex-col","aria-hidden":!0,children:[/* @__PURE__ */u(bn,{colors:e}),/* @__PURE__ */u("div",{className:"space-y-3 w-full",children:Array.from({length:t}).map((t,n)=>/* @__PURE__ */u(wn,{colors:e},n))})]})}function vn({colors:e,bodyFont:t,message:n,className:o="",variant:r="category",showLogoArea:l=!1,gameCardCount:a=3,categoryCount:i=2,showTierTabs:s=!1}){const c=(()=>{switch(r){case"sport":/* @__PURE__ */return u(pn,{colors:e,count:Math.max(i,2)});case"event":/* @__PURE__ */return u(hn,{colors:e});case"games":/* @__PURE__ */return u(gn,{colors:e,count:a,showTierTabs:s});case"propositions":/* @__PURE__ */return u(yn,{colors:e});case"entries":/* @__PURE__ */return u(kn,{colors:e,rows:2});default:/* @__PURE__ */return u(mn,{colors:e,count:i})}})(),d=n?.trim()||"Loading";/* @__PURE__ */
|
|
79
|
+
return u(un,{className:o,bodyFont:t,children:/* @__PURE__ */m("div",{role:"status","aria-live":"polite","aria-label":d,className:"w-full min-w-0",children:[n?.trim()?/* @__PURE__ */u("p",{className:"text-sm text-center mb-4",style:{color:e.textMuted,fontFamily:t,margin:0},children:n}):null,c]})})}function Nn(e){return e.homeTeam&&e.awayTeam?`${e.homeTeam} vs ${e.awayTeam}`:e.homeTeam??e.awayTeam??e.id}function Cn(e){return(e??"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"")}function Fn(e){if(!e||e.quick_pick_only)return!1;const t=Cn(e.selection_scope);if("samegamemulti"===Cn(e.rule)||!0===e.require_same_event||"singleevent"===t||"sameevent"===t)return!0;const n=[e.game_name,e.game_name_template].map(Cn);return n.includes("samegame")||n.includes("samegamemulti")}function Bn(e){return(e.eventId??e.event_id)?.trim()||null}function An(e){const t=/* @__PURE__ */new Map;for(const n of e){if(!zn(n))continue;const e=Bn(n);if(!e)continue;const o=t.get(e);o?(o.propositionCount+=1,o.homeTeam=Mn(o.homeTeam,n.home_team),o.awayTeam=Mn(o.awayTeam,n.away_team),o.sport=Mn(o.sport,n.sport),o.league=Mn(o.league,n.league),o.commenceTime=Ln(o.commenceTime,n.commence_time)):t.set(e,{id:e,homeTeam:n.home_team?.trim()||void 0,awayTeam:n.away_team?.trim()||void 0,commenceTime:n.commence_time?.trim()||void 0,sport:n.sport?.trim()||void 0,league:n.league?.trim()||void 0,propositionCount:1})}return[...t.values()].sort((e,t)=>{const n=Sn(e.commenceTime),o=Sn(t.commenceTime);return n!==o?n-o:e.id.localeCompare(t.id)})}function Mn(e,t){const n=t?.trim();return n?e&&e.localeCompare(n)<=0?e:n:e}function Sn(e){if(!e)return Number.MAX_SAFE_INTEGER;const t=new Date(e).getTime();return Number.isFinite(t)?t:Number.MAX_SAFE_INTEGER}function Ln(e,t){const n=t?.trim();if(!n)return e;if(!e)return n;const o=Sn(e),r=Sn(n);return r!==o?r<o?n:e:e.localeCompare(n)<=0?e:n}function zn(e){return!1!==e.bettable&&!0!==e.is_suspended&&!0!==e.is_expired&&!0!==e.is_voided&&!0!==e.is_composite_component}function Pn(e,t){return t?e.filter(e=>zn(e)&&Bn(e)===t):[]}function Tn(e,t){return!!t&&e.length>0&&e.every(e=>zn(e)&&Bn(e)===t)}var Dn={signature:1,premier:2,exclusive:3},On=[{id:"signature",label:"Signature Games",shortLabel:"Signature",level:1},{id:"premier",label:"Premier Games",shortLabel:"Premier",level:2},{id:"exclusive",label:"Exclusive Games",shortLabel:"Exclusive",level:3}];function En(e){return"number"==typeof e.tier&&Number.isFinite(e.tier)?e.tier:1}function jn(e,t){return e.filter(e=>En(e)===t)}function Yn(e){const t=new Set(e.map(En));return On.filter(e=>t.has(e.level))}function Hn(e){return Yn(e)[0]?.id??"signature"}var Rn=.21875;function Gn(e){return null==e||Math.abs(e-.21875)<5e-5?Rn:e}var Wn=[1,5,10,20,50],In=[4,12];function Un(e){return(e??"").trim().toLowerCase()}var $n={straight:"mirror",double:"double_mirror",triple:"triple_mirror"};function Kn(e){if(!e||e.quick_pick_only)return!1;const t=Un(e.rule);return Object.values($n).includes(t)}function Zn(e){const t=Un(e?.rule);return Object.keys($n).find(e=>$n[e]===t)??"straight"}function qn(e,t,n){const o=Gn(n?.operatorMargin),r=n?.perLegProbability??.5,l=Math.round(Math.pow(2,t)),a=Math.pow(r,t)+Math.pow(1-r,t),i=Math.round(1/a),s=(1-o)*Math.pow(2,t-1);return{legs:t,stake:e,prize:Math.round(e*s),multiple:s,totalOutcomes:l,winningOutcomes:2,oddsOneIn:i}}function Vn(e){if(!Kn(e)||!e)return null;const t=e.min_propositions??e.allowed_propositions?.[0]??In[0],n=e.max_propositions??e.allowed_propositions?.[e.allowed_propositions.length-1]??In[1],o=Qn(Zn(e)),r=(e.allowed_propositions&&e.allowed_propositions.length>0?[...e.allowed_propositions].sort((e,t)=>e-t):Array.from({length:Math.max(0,n-t+1)},(e,n)=>t+n)).filter(e=>e>=o.minLegs);if(0===r.length)return null;const l=Math.max(e.min_bet??1,.01),a=e.max_bet??null,i=Wn.filter(e=>e>=l&&(null===a||e<=a));return{variant:o,legOptions:r,defaultLegs:r.includes(8)?8:r[Math.floor(r.length/2)],defaultStake:Math.min(Math.max(20,l),a??20),minStake:l,maxStake:a,quickStakes:i,tagline:o.tagline,operatorMargin:Gn(e.operator_margin),perLegProbability:e.payout_structure?.per_leg_probability??.5}}var Xn=[{id:"straight",name:"Straight Mirror",depth:1,minLegs:4,waysToWin:"2 ways to win",description:"All or nothing. Get every call right, or every call wrong. Both pay the same.",tagline:"Call every leg. Get them all right, you win — all wrong, you win the same.",tierNames:["Perfect"]},{id:"double",name:"Double Mirror",depth:2,minLegs:6,waysToWin:"4 ways to win",description:"Perfect, or one off, at either edge. All right or all wrong, plus the near miss on each side.",tagline:"Perfect, or one off, at either edge — four ways to land a win.",tierNames:["Perfect","Near"]},{id:"triple",name:"Triple Mirror",depth:3,minLegs:9,waysToWin:"6 ways to win",description:"Within two of a clean sweep, either way. Longer legs only, so you still miss the middle.",tagline:"Within two of a clean sweep, either way — six ways to land a win.",tierNames:["Perfect","Near","Third"]}];function Qn(e){return Xn.find(t=>t.id===e)??Xn[0]}function Jn(e,t){if(t<0||t>e)return 0;const n=Math.min(t,e-t);let o=1;for(let r=0;r<n;r++)o=o*(e-r)/(r+1);return Math.round(o)}function _n(e,t,n,o){const r=Qn(e),l=t*(1-Gn(o?.operatorMargin)),a=Math.round(Math.pow(2,n)),i=[];let s=0;for(let c=0;c<r.depth;c++){const e=Jn(n,c),t=n-c===c?e:2*e;s+=t,i.push({distance:c,label:r.tierNames[c]??`Tier ${c+1}`,correctCounts:n-c===c?[c]:[n-c,c],prize:Math.round(l/r.depth*a/(2*e)),outcomes:t})}return{variant:r.id,legs:n,stake:t,tiers:i,totalOutcomes:a,winningOutcomes:s,oddsOneIn:Math.round(a/s*1e4)/1e4}}var eo=4,to=6,no=[4,12],oo=[5,10,20,50];function ro(e){return!!e&&!e.quick_pick_only&&"safety_net"===(e.rule??"").trim().toLowerCase()}function lo(e){const t=e.payout_structure;return{margin:e.operator_margin??0,perLegProbability:t?.per_leg_probability??.5,perfectMultiple:t?.perfect_prize?.stake_multiple??25,perfectBaseLegs:t?.perfect_prize?.base_legs??6,nearMissBudgetFraction:t?.near_miss?.budget_fraction??.5,roundTo:t?.round_to??5}}function ao(e,t){return t>0&&e>=t?Math.round(e/t)*t:Math.round(e)}function io(e,t){if(t<0||t>e)return 0;let n=1;for(let o=0;o<t;o+=1)n=n*(e-o)/(o+1);return Math.round(n)}function so(e,t,n,o){const r=Math.max(0,Math.min(n,t)),l=e*o.perfectMultiple*Math.pow(2,t-o.perfectBaseLegs),a=r>0?e*(1-o.margin)*o.nearMissBudgetFraction/r:0,i=Math.pow(1/o.perLegProbability,t),s=[];let c=io(t,0);for(let d=1;d<=r;d+=1)c+=io(t,d),s.push(ao(a*i/c,o.roundTo));return{legs:t,stake:e,allowedMisses:r,perfect:l,nearMiss:s,sweep:l+s.reduce((e,t)=>e+t,0)}}function co(e,t){if(t<0||t>e.allowedMisses)return 0;let n=0===t?e.perfect:0;for(let o=Math.max(1,t);o<=e.nearMiss.length;o+=1)n+=e.nearMiss[o-1];return n}function uo(e){return e.includes(8)?8:e[Math.floor(e.length/2)]}function mo(e){return e.toLowerCase().replace(/[^a-z]+/g," ").trim()}function po(e,t){const n=mo(t);return e.permitted_rules?.find(e=>mo(e.name??"").includes(n))??null}function ho(e,t,n){const o=t?.min_propositions??n,r=t?.max_propositions??null;return e.filter(e=>e>=o&&(null==r||e<=r))}function fo(e){if(!ro(e)||!e)return null;const t=e.min_propositions??e.allowed_propositions?.[0]??no[0],n=e.max_propositions??e.allowed_propositions?.[e.allowed_propositions.length-1]??no[1],o=e.allowed_propositions&&e.allowed_propositions.length>0?[...e.allowed_propositions].sort((e,t)=>e-t):Array.from({length:Math.max(0,n-t+1)},(e,n)=>t+n),r=po(e,"Extra Shot"),l=po(e,"Double Shot"),a=ho(o,r,4).filter(e=>e>1),i=ho(o,l,6).filter(e=>e>2);if(0===a.length)return null;const s=[{id:"extra_shot",label:"Extra Shot",allowedMisses:1,stat:"Bigger payout",explain:"Miss one leg and you win the All but 1 prize. Get every leg right and you win both — the Perfect prize on top.",legOptions:a,defaultLegs:uo(a),ruleId:r?.id??null}],c=!e.permitted_rules?.length||!!l;i.length>0&&c&&s.push({id:"double_shot",label:"Double Shot",allowedMisses:2,stat:"Safer play",explain:"Miss two legs and you win the All but 2 prize. Miss one and you win two prizes. Get every leg right and you win all three — the whole stack.",legOptions:i,defaultLegs:uo(i),ruleId:l?.id??null});const d=Math.max(e.min_bet??5,.01),u=e.max_bet??null,m=oo.filter(e=>null===u||e<=u);return{modes:s,defaultModeId:"extra_shot",defaultStake:Math.min(Math.max(20,d),u??20),minStake:d,maxStake:u,quickAdds:m,tagline:"The wider the safety net, the more misses it catches. The narrower it is, the bigger the top prize.",pricing:lo(e)}}function xo(e){return[{id:`target-${e}`,label:"Perfect pick",stat:"Top payout",detail:["Get every pick right","nothing else pays"],emphasis:!0,expectedCorrect:e}]}function go(e,t,n){const o=Math.max(0,e-t),r=so(20,e,o,n),l=[];for(let a=0;a<=o;a+=1){const t=Math.round(co(r,a));l.push({misses:a,label:`${e-a}/${e}`,multiplier:t/20,payout20:t})}return l}function yo(e,t){return[{id:"net-1",label:"Extra Shot",stat:"Bigger payout",detail:["One wrong wins a prize","Perfect wins both","Miss twice and the ticket does not pay"],dividends:go(e,e-1,t),expectedCorrect:e-1},{id:"net-2",label:"Double Shot",stat:"Safer play",detail:["Two wrong wins a prize","One wrong wins two","Perfect wins all three"],dividends:go(e,e-2,t),expectedCorrect:e-2}]}function bo(e,t){if(!e||e.quick_pick_only)return null;const n=function(e){return(e??"").trim().toLowerCase()}(e.rule),o=t??e.num_propositions??e.min_propositions??e.allowed_propositions?.[0]??0;return"safety_net"===n&&o>0?function(e,t){return{mode:"selection",kind:"safety_net",title:"Choose your safety net",headline:"2 Ways to PLAY, more ways to PAY",heroTagline:"The wider the safety net, the more misses it catches. The narrower it is, the bigger the top prize.",legCount:t,options:yo(t,lo(e)),continueLabel:"Continue to picks"}}(e,o):"exact"===n&&o>0?function(e,t){return{mode:"selection",kind:"exact",title:"All or nothing",headline:"Get it PERFECT, take the top PAY",heroTagline:"Every pick has to land. Miss a single one and the ticket is gone — but a clean sweep pays the biggest prize.",legCount:t,options:xo(t),continueLabel:"Continue to picks"}}(0,o):"pick"===n&&o>0?function(e,t){return{mode:"description",kind:"pick",title:"How it plays",headline:"Every hit PLAYS, every hit PAYS",heroTagline:"No all-or-nothing — your multiplier climbs with every correct pick.",legCount:t,highlights:["Make your yes/no picks across the available markets","Each correct pick pushes your multiplier higher","Land fewer than the full card and you can still cash"],continueLabel:"Continue to picks"}}(0,o):null}function wo(e){return null!=bo(e)}var ko=[1,5,10,20,50,100],vo=[4,12];function No(e){return!!e&&!e.quick_pick_only&&"game_set"===(e.rule??"").trim().toLowerCase()}function Co(e,t,n){const o=n?.operatorMargin??.2,r=n?.perLegProbability??.5,l=Math.round(Math.pow(1/r,t)),a=(1-o)*Math.pow(1/r,t);return{legs:t,stake:e,prize:Math.round(e*a*100)/100,multiple:a,oddsOneIn:l}}function Fo(e){if(!No(e)||!e)return null;const t=e.min_propositions??e.allowed_propositions?.[0]??vo[0],n=e.max_propositions??e.allowed_propositions?.[e.allowed_propositions.length-1]??vo[1],o=e.allowed_propositions&&e.allowed_propositions.length>0?[...e.allowed_propositions].sort((e,t)=>e-t):Array.from({length:Math.max(0,n-t+1)},(e,n)=>t+n);if(0===o.length)return null;const r=Math.max(e.min_bet??1,.01),l=e.max_bet??null,a=ko.filter(e=>e>=r&&(null===l||e<=l));return{legOptions:o,defaultLegs:o.includes(8)?8:o[Math.floor(o.length/2)],defaultStake:Math.min(Math.max(20,r),l??20),minStake:r,maxStake:l,quickStakes:a,tagline:"Two steps to your multi. Tweak legs and stake — the prize updates as you go.",operatorMargin:e.operator_margin??.2,perLegProbability:e.payout_structure?.per_leg_probability??.5}}var Bo=[500,1e3,2500,5e3,7500,1e4,12500,15e3],Ao=[12,11,10,9,8,7,6];function Mo(e){return!!e&&!e.quick_pick_only&&"pick_your_dividend"===(e.rule??"").trim().toLowerCase()}function So(e){return Math.round(100*e)/100}function Lo(e,t,n=.21875){const o=Math.pow(2,t),r=e/(1-n)/o,l=Number.isInteger(r),a=So(r),i=l?r:So(.96*r);return{legs:t,exactStake:a,stake:i,margin:1-e/(i*o),multiple:e/i,oddsOneIn:o,discounted:!l}}function zo(e,t=Ao){return{dividend:e,rungs:t.map(t=>Lo(e,t))}}function Po(e,t){if(!Mo(e)||!e)return null;const n=e.min_propositions??6,o=e.max_propositions??12,r=Ao.filter(e=>e>=n&&e<=o);if(0===r.length)return null;const l=t?.dividends??Bo;return{dividends:l.map(e=>zo(e,r)),defaultDividend:l.includes(1e4)?1e4:l[Math.floor(l.length/2)],defaultLegs:r.includes(9)?9:r[Math.floor(r.length/2)],tagline:"The dividend is set. The win is yours to build."}}var To=50,Do=[25,50,75,100],Oo=[{legs:4,firstPayingTier:3,tiers50:[[3,60],[4,340]]},{legs:6,firstPayingTier:4,tiers50:[[4,40],[5,110],[6,850]]},{legs:8,firstPayingTier:5,tiers50:[[5,30],[6,70],[7,300],[8,2100]]},{legs:9,firstPayingTier:5,tiers50:[[5,10],[6,40],[7,100],[8,350],[9,4500]]},{legs:10,firstPayingTier:6,tiers50:[[6,15],[7,45],[8,140],[9,800],[10,1e4]]}];function Eo(e){return!!e&&!e.quick_pick_only&&"ladder"===(e.rule??"").trim().toLowerCase()}function jo(e,t){return Math.round(e*t/50)}function Yo(e,t){let n=0;return e.tiers50.map(([e,o])=>(n+=o,{atLeast:e,prize:jo(o,t),cumulative:jo(n,t)}))}function Ho(e,t){return jo(e.tiers50.reduce((e,[,t])=>e+t,0),t)}function Ro(e,t,n){return jo(e.tiers50.reduce((e,[n,o])=>n<=t?e+o:e,0),n)}function Go(e){if(!Eo(e)||!e)return null;const t=e.allowed_propositions,n=e.min_propositions??4,o=e.max_propositions??10,r=Oo.filter(e=>t&&t.length>0?t.includes(e.legs):e.legs>=n&&e.legs<=o);if(0===r.length)return null;const l=e.min_bet??Do[0],a=e.max_bet??Do[Do.length-1],i=Do.filter(e=>e>=l&&e<=a);return{ladders:r,defaultLegs:r.some(e=>8===e.legs)?8:r[Math.floor(r.length/2)].legs,defaultStake:i.includes(50)?50:i[0]??50,stakes:i.length>0?i:Do,tagline:"Climb the ladder. Every step pays its own prize, and every prize stacks on the one before."}}var Wo=.21875,Io=6,Uo=5,$o=1,Ko=2;function Zo(e){return!!e&&!e.quick_pick_only&&"six_again"===(e.rule??"").trim().toLowerCase()}var qo={golden_point:!1,captains_challenge:!1};function Vo(e,t,n){const o=1+(t.golden_point?1:0)+(t.captains_challenge?1:0),r=e*n.baseMultiple*(t.golden_point?n.goldenPointFactor:1),l=t.captains_challenge?e*n.challengeMultiple:0;return{legs:n.legs,unit:e,stake:e*o,base:r,challenge:l,perfect:r+l,lowestWinningCount:n.legs-(t.captains_challenge?n.challengeMisses:0),ruleId:Xo(t,n)}}function Xo(e,t){return e.captains_challenge?e.golden_point?t.ruleIds.goldenChallenge:t.ruleIds.challenge:t.ruleIds.base}function Qo(e,t){const n=Vo(1,e,t);return{perfect:n.perfect/n.stake,challenge:n.challenge/n.stake}}function Jo(e,t){return e.permitted_rules?.find(e=>t((e.name??"").toLowerCase().replace(/[^a-z]+/g," ").trim()))??null}function _o(e){if(!Zo(e)||!e)return null;const t=e.num_propositions??e.min_propositions??6;if(t<2)return null;const n=e.operator_margin??.21875,o=Math.max(e.min_bet??10,.01),r=null!=e.max_bet?Math.max(o,Math.floor(e.max_bet/3/o)*o):Math.max(o,100),l=Jo(e,e=>e.includes("challenge")&&!e.includes("golden")),a=Jo(e,e=>e.includes("challenge")&&e.includes("golden")),i=Jo(e,e=>!e.includes("challenge"))??null;return{legs:t,unitMin:o,unitStep:o,unitMax:r,defaultUnit:o,baseMultiple:Math.round(Math.pow(2,t)*(1-n)*100)/100,challengeMultiple:5,challengeMisses:1,goldenPointFactor:2,boosts:[{id:"golden_point",label:"Golden Point",costUnits:1},{id:"captains_challenge",label:"Captain's Challenge",costUnits:1}],tagline:"Set your play, then pick your six. Every call a yes or a no.",ruleIds:{base:i?.id??e.default_rule_id??null,challenge:l?.id??null,goldenChallenge:a?.id??null}}}function er(e){return e?.quick_pick_only?"quick_pick":No(e)?"game_set":Mo(e)?"pick_your_dividend":Eo(e)?"ladder":Kn(e)?"mirror":ro(e)?"safety_net":Zo(e)?"six_again":Fn(e)?"selections":wo(e)?"rule_setup":"selections"}function tr(e){if(!e||e.quick_pick_only)return!1;if("exact"!==(e.rule??"").trim().toLowerCase())return!1;if(Fn(e))return!1;const t=!!(e.allowed_markets&&e.allowed_markets.length>0),n=!!(e.allowed_sports&&e.allowed_sports.length>0);return t||n}function nr(e){return!(!e||e.quick_pick_only||"exact"!==(e.rule??"").trim().toLowerCase()||Fn(e)||tr(e))}function or(e){switch(er(e)){case"ladder":return{belowRequiredHint:(e,t)=>`Drop to Ladder ${e} or add another pick to stay on Ladder ${t}.`,belowRequiredAddOnlyHint:e=>`Add another pick to stay on Ladder ${e}.`,switchTierLabel:e=>`Switch to Ladder ${e}`,overloadTitle:"Add more picks to climb higher",tableColumnLabel:"Ladder",tierButtonLabel:e=>`Ladder ${e}`};case"game_set":case"pick_your_dividend":case"mirror":case"safety_net":case"six_again":return{belowRequiredHint:(e,t)=>`Drop to ${e} legs or add another pick to stay at ${t}.`,belowRequiredAddOnlyHint:e=>`Add another pick to stay at ${e} legs.`,switchTierLabel:e=>`Switch to ${e} legs`,overloadTitle:"Add more legs to win more",tableColumnLabel:"Legs",tierButtonLabel:e=>`${e} legs`};default:return{belowRequiredHint:(e,t)=>`Drop to a ${e}-leg multi or add another pick to stay at ${t}.`,belowRequiredAddOnlyHint:e=>`Add another pick to stay at ${e}.`,switchTierLabel:e=>`Switch to ${e}-leg`,overloadTitle:"Add more picks to win more",tableColumnLabel:"Legs",tierButtonLabel:e=>`Multi ${e}`}}}function rr(e,t){return lr(e)&&t&&t>0?t:null}function lr(e){switch(er(e)){case"game_set":case"pick_your_dividend":case"ladder":case"mirror":case"safety_net":case"six_again":return!0;default:return tr(e)}}function ar(e){const t=er(e);return"six_again"===t||"pick_your_dividend"===t}function ir(e){return"six_again"===er(e)?"Set by your ticket and boosts.":"Set by your dividend ladder rung."}function sr(e,t,n,o){if(!e||t<=0||n<=0)return 0;switch(er(e)){case"game_set":return cr(Co(n,t,{operatorMargin:e.operator_margin??void 0,perLegProbability:e.payout_structure?.per_leg_probability??void 0}).prize,e);case"mirror":return cr(_n(Zn(e),n,t,{operatorMargin:e.operator_margin??void 0}).tiers[0]?.prize??0,e);case"pick_your_dividend":return function(e,t,n=Bo){if(!(e>0&&t>0))return 0;for(const o of n)if(Math.abs(Lo(o,e).stake-t)<.005)return o;return 0}(t,n);case"ladder":{const o=Oo.find(e=>e.legs===t);return o?cr(Ho(o,n),e):0}case"safety_net":{const r=null!=o?.expectedCorrect&&o.expectedCorrect>0?Math.min(2,Math.max(0,t-o.expectedCorrect)):1;return cr(so(n,t,r,lo(e)).sweep,e)}default:{if("exact"!==(e.rule??"").trim().toLowerCase())return 0;const o=function(e,t,n){const o=e.payout_structure;if(!o)return 0;const r=o.results??o.values;if(!r)return 0;const l=r[String(t)];return void 0!==l?l*n:0}(e,t,n);if(o>0)return cr(o,e);const r=e.payout_structure?.expression??e.payout_structure?.formula??"";return/2\s*\^/.test(r)?cr(Co(n,t,{operatorMargin:e.operator_margin??void 0,perLegProbability:e.payout_structure?.per_leg_probability??void 0}).prize,e):0}}}function cr(e,t){return!1===t?.round_payouts?e:ao(e,t?.payout_structure?.round_to??1)}function dr(e,t){const n=e.allowed_propositions&&e.allowed_propositions.length>0?e.allowed_propositions.map(Number):[],o=e.min_propositions??e.num_propositions??null,r=e.max_propositions??e.num_propositions??null,l=0===n.length&&null!==o&&null!==r&&r>0,a=n.length>0?n:l?_t(o,r):[],i=/* @__PURE__ */new Map;for(const f of t?.top_payouts??[]){const e=Number(f.proposition_count),t=Number(f.net_payout),n=Number(f.bet_amount??20);!Number.isFinite(e)||e<=0||i.set(e,{count:e,payout:Number.isFinite(t)?t:0,betAmount:Number.isFinite(n)&&n>0?n:20})}for(const f of a){const e=Number(f);i.has(e)||i.set(e,{count:e,payout:0,betAmount:20})}const s=Array.from(i.values()).sort((e,t)=>e.count-t.count),c=a.length>0?Math.max(...a.map(Number)):0,d=Mo(e)?Po(e):null,u=d?d.dividends.map(e=>({dividend:e.dividend,stakeFrom:Math.min(...e.rungs.map(e=>e.stake))})):void 0,m=d?[]:s.map(t=>({count:t.count,payout20:t.payout>0&&t.betAmount>0?cr(t.payout/t.betAmount*20,e):sr(e,t.count,20)})),p=bo(e,c),h="safety_net"===p?.kind?(p.options??[]).flatMap(e=>e.dividends?.length?[{id:e.id,label:e.label,tiers:e.dividends.map(e=>({label:e.label,payout20:e.payout20}))}]:[]):[];return{legOptions:a.map(Number),maxLegCount:c,tiers:m,modes:h,pydDividends:u,hasGenericDividends:(n.length>0||l)&&m.some(e=>e.payout20>0),minBet:Math.max(e.min_bet??1,1),maxBet:e.max_bet??null}}function ur({tiers:e,modes:t,pydDividends:n,onPlayCount:o,minBet:r=1,maxBet:l=null,colors:a,bodyFont:i,headingFont:s}){const p=e=>Math.min(Math.max(e,r),l??1/0),[h,f]=c(()=>String(p(20))),x=parseFloat(h),g=p(Number.isFinite(x)&&x>0?x:20),y=g/20,b=!!(t?.length||n?.length||e.some(e=>e.payout20>0)),w=!!t?.length;if(!b)return null;const k=/* @__PURE__ */m("p",{className:"mb-2 flex items-center gap-1 text-[10px] italic",style:{color:a.textMuted,margin:"0 0 8px"},children:["Example values for a",
|
|
80
80
|
/* @__PURE__ */m("span",{className:"inline-flex items-center not-italic",style:{fontWeight:700,fontSize:11},children:["$",/* @__PURE__ */u("input",{type:"number",min:r,max:l??void 0,value:h,onChange:e=>f(e.target.value),onBlur:()=>f(String(g)),"aria-label":"Example bet amount",style:{width:74,marginLeft:2,padding:"2px 5px",borderRadius:6,border:`1px solid ${a.border}`,backgroundColor:a.background??"#fff",color:a.text,fontSize:11,fontWeight:600,fontStyle:"normal",fontFamily:i}})]}),"bet",null!=l?` (${wt(r)}–${wt(l)})`:` (min ${wt(r)})`,"."]}),v={marginTop:10,borderRadius:14,border:`1px solid ${a.border}`,backgroundColor:a.backgroundAlt??"#FCFBF9",padding:"12px 14px",textAlign:"left",fontFamily:i};/* @__PURE__ */
|
|
81
81
|
return m("div",{className:"w-full",children:[w&&/* @__PURE__ */u("div",{className:"text-[11px] font-bold uppercase",style:{color:a.textMuted,letterSpacing:"0.14em"},children:"Compare dividends"}),/* @__PURE__ */m("div",{style:v,children:[!n?.length&&k,t?.length?t.map((e,t)=>/* @__PURE__ */m("div",{style:{borderTop:0===t?"none":`1px solid ${a.border}`,paddingTop:0===t?0:8,marginTop:0===t?0:8},children:[/* @__PURE__ */u("div",{className:"text-[11px] font-bold mb-1",style:{color:a.text,fontFamily:s},children:e.label}),e.tiers.map(e=>/* @__PURE__ */m("div",{className:"flex items-center justify-between py-1",style:{gap:14},children:[/* @__PURE__ */m("span",{style:{color:a.textMuted,fontSize:11,flex:1},children:[e.label," correct"]}),/* @__PURE__ */u("span",{style:{fontWeight:700,color:a.heading??a.text,fontSize:12},children:wt(e.payout20*y)})]},e.label))]},e.id)):/* @__PURE__ */m(d,n?.length?{children:[
|
|
82
82
|
/* @__PURE__ */m("div",{className:"flex items-center justify-between pb-1 mb-1",style:{borderBottom:`1px solid ${a.border}`},children:[/* @__PURE__ */u("span",{className:"text-[10.5px] font-bold uppercase tracking-wide",style:{color:a.primary},children:"Dividend"}),/* @__PURE__ */u("span",{className:"text-[10.5px] font-bold uppercase tracking-wide",style:{color:a.primary},children:"Stake from"})]}),n.map(e=>/* @__PURE__ */m("div",{className:"flex items-center justify-between py-1",children:[/* @__PURE__ */u("span",{style:{fontWeight:700,color:a.heading??a.text,fontSize:12},children:wt(e.dividend)}),/* @__PURE__ */u("span",{style:{fontWeight:600,color:a.text,fontSize:12},children:wt(e.stakeFrom)})]},e.dividend)),
|
|
83
|
-
/* @__PURE__ */u("p",{className:"mt-2 text-[10px] italic",style:{color:a.textMuted},children:"You set the dividend before kick-off. Longer climbs start from a smaller stake."})]}:{children:[/* @__PURE__ */m("div",{className:"flex items-center justify-between pb-1 mb-1",style:{borderBottom:`1px solid ${a.border}`},children:[/* @__PURE__ */u("span",{className:"text-[10.5px] font-bold uppercase tracking-wide",style:{color:a.primary},children:"Legs played"}),/* @__PURE__ */u("span",{className:"text-[10.5px] font-bold uppercase tracking-wide",style:{color:a.primary},children:"Payout"})]}),e.map(e=>{const t=/* @__PURE__ */m(d,{children:[/* @__PURE__ */m("span",{style:{fontWeight:600,color:o?a.primary:a.text,fontSize:12},children:[e.count," legs"]}),/* @__PURE__ */u("span",{style:{fontWeight:600,color:e.payout20>0?a.text:a.textMuted,fontSize:12},children:e.payout20>0?wt(e.payout20*y):"—"})]});return o?/* @__PURE__ */u("button",{type:"button",onClick:()=>o(e.count),className:"flex w-full items-center justify-between py-1.5 text-left",style:{background:"transparent",border:"none",cursor:"pointer"},children:t},e.count):/* @__PURE__ */u("div",{className:"flex items-center justify-between py-1",children:t},e.count)})]})]})]})}function
|
|
84
|
-
return m("button",{type:"button",onClick:()=>n(e.id),className:"min-w-0 rounded-full px-1 py-2.5 text-[10px] font-bold whitespace-nowrap transition-transform active:translate-y-1",style:{fontFamily:r,letterSpacing:"-0.01em",border:`1px solid ${l?o.primary:o.border}`,backgroundColor:l?o.primary:o.background??"#fff",color:l?o.primaryText:o.primary,boxShadow:l?`0 4px 0 ${z(o.primary,.55)}, 0 7px 12px -4px ${z(o.primary,.35)}`:`0 4px 0 ${z(o.border,.9)}, 0 6px 10px -4px ${z(o.primary,.18)}`,cursor:"pointer"},children:[/* @__PURE__ */u("span",{className:"hidden min-[380px]:inline",children:e.label}),/* @__PURE__ */u("span",{className:"min-[380px]:hidden",children:e.shortLabel})]},e.id)})})}function
|
|
83
|
+
/* @__PURE__ */u("p",{className:"mt-2 text-[10px] italic",style:{color:a.textMuted},children:"You set the dividend before kick-off. Longer climbs start from a smaller stake."})]}:{children:[/* @__PURE__ */m("div",{className:"flex items-center justify-between pb-1 mb-1",style:{borderBottom:`1px solid ${a.border}`},children:[/* @__PURE__ */u("span",{className:"text-[10.5px] font-bold uppercase tracking-wide",style:{color:a.primary},children:"Legs played"}),/* @__PURE__ */u("span",{className:"text-[10.5px] font-bold uppercase tracking-wide",style:{color:a.primary},children:"Payout"})]}),e.map(e=>{const t=/* @__PURE__ */m(d,{children:[/* @__PURE__ */m("span",{style:{fontWeight:600,color:o?a.primary:a.text,fontSize:12},children:[e.count," legs"]}),/* @__PURE__ */u("span",{style:{fontWeight:600,color:e.payout20>0?a.text:a.textMuted,fontSize:12},children:e.payout20>0?wt(e.payout20*y):"—"})]});return o?/* @__PURE__ */u("button",{type:"button",onClick:()=>o(e.count),className:"flex w-full items-center justify-between py-1.5 text-left",style:{background:"transparent",border:"none",cursor:"pointer"},children:t},e.count):/* @__PURE__ */u("div",{className:"flex items-center justify-between py-1",children:t},e.count)})]})]})]})}function mr({tabs:e,active:t,onChange:n,colors:o,bodyFont:r}){return e.length<=1?null:/* @__PURE__ */u("div",{className:"grid gap-2 mb-3",style:{gridTemplateColumns:`repeat(${Math.min(e.length,3)}, minmax(0, 1fr))`},children:e.map(e=>{const l=e.id===t;/* @__PURE__ */
|
|
84
|
+
return m("button",{type:"button",onClick:()=>n(e.id),className:"min-w-0 rounded-full px-1 py-2.5 text-[10px] font-bold whitespace-nowrap transition-transform active:translate-y-1",style:{fontFamily:r,letterSpacing:"-0.01em",border:`1px solid ${l?o.primary:o.border}`,backgroundColor:l?o.primary:o.background??"#fff",color:l?o.primaryText:o.primary,boxShadow:l?`0 4px 0 ${z(o.primary,.55)}, 0 7px 12px -4px ${z(o.primary,.35)}`:`0 4px 0 ${z(o.border,.9)}, 0 6px 10px -4px ${z(o.primary,.18)}`,cursor:"pointer"},children:[/* @__PURE__ */u("span",{className:"hidden min-[380px]:inline",children:e.label}),/* @__PURE__ */u("span",{className:"min-[380px]:hidden",children:e.shortLabel})]},e.id)})})}function pr({iconUrl:e,size:t,brandColor:n,iconColor:o,accentColor:r}){/* @__PURE__ */
|
|
85
85
|
return m("div",{style:{position:"relative",width:t,height:t},children:[/* @__PURE__ */m("svg",{viewBox:"30 -5 280 280",width:"100%",height:"100%","aria-hidden":"true",style:{display:"block"},children:[
|
|
86
86
|
/* @__PURE__ */u("rect",{x:"90",y:"55",width:"210",height:"210",rx:"42",fill:n,opacity:"0.3"}),
|
|
87
87
|
/* @__PURE__ */u("rect",{x:"65",y:"30",width:"210",height:"210",rx:"42",fill:n,opacity:"0.55"}),
|
|
88
|
-
/* @__PURE__ */u("rect",{x:"40",y:"5",width:"210",height:"210",rx:"42",fill:n})]}),/* @__PURE__ */u("div",{style:{position:"absolute",left:"10.7%",top:"10.7%",width:"60.7%",height:"60.7%",pointerEvents:"none"},children:/* @__PURE__ */u(
|
|
89
|
-
return m("div",{ref:N,children:[/* @__PURE__ */u(
|
|
90
|
-
return m("div",{ref:H,className:"flex flex-col",style:{fontFamily:F},children:[g&&/* @__PURE__ */u(
|
|
91
|
-
/* @__PURE__ */m("div",{style:{position:"relative"},children:[/* @__PURE__ */u("div",{ref:_,className:"blade-game-track",style:{display:"flex",alignItems:"stretch",gap:14,overflowX:"auto",overflowY:"hidden",scrollSnapType:"x mandatory",scrollbarWidth:"none",paddingLeft:le,paddingRight:le,paddingBottom:8,position:"relative"},children:E.map(e=>{const n=qt(e),o=function(e){const t=e.available_days;if(!t||0===t.length)return null;const n=t.map(e=>Vt[e]??`Day ${e}`);return 1===n.length?n[0]:n.slice(0,-1).join(", ")+" & "+n[n.length-1]}(e),r=t?.id===e.id,l=String(e.id),a=Pt(e),i=e.description||e.rule,s=e.call_to_action?.trim()||null,{legOptions:c,maxLegCount:d,tiers:p,modes:h,pydDividends:g,hasGenericDividends:y,minBet:b,maxBet:S}=
|
|
92
|
-
return m("article",{className:"flex flex-col items-center text-center",style:{flex:re>0?`0 0 ${re}px`:"0 0 86%",scrollSnapAlign:"center",borderRadius:24,border:`1px solid ${r?N.primary:N.border}`,backgroundColor:r?N.infoBg:N.background??C,boxShadow:M,padding:"22px 20px 20px",opacity:n?1:.5,pointerEvents:n?"auto":"none"},children:[e.quick_pick_only&&w&&c.length>1?/* @__PURE__ */u(
|
|
88
|
+
/* @__PURE__ */u("rect",{x:"40",y:"5",width:"210",height:"210",rx:"42",fill:n})]}),/* @__PURE__ */u("div",{style:{position:"absolute",left:"10.7%",top:"10.7%",width:"60.7%",height:"60.7%",pointerEvents:"none"},children:/* @__PURE__ */u(on,{iconUrl:e,width:"100%",height:"100%",iconColor:o,accentColor:r})})]})}function hr({iconUrl:e,gameName:t,size:n,brandColor:o,cardColor:r,iconColor:a,accentColor:i,captionColor:d,bodyFont:h,legOptions:f,onPick:x,colors:g,menuShadow:y}){const[b,w]=c(!1),[k,v]=c(null),N=s(null),C=s(null);l(()=>{if(!b)return void v(null);const e=()=>{const e=N.current;if(!e||"undefined"==typeof window)return;const t=e.getBoundingClientRect(),n=40+40*f.length+12,o=window.innerHeight-t.bottom,r=o<n&&t.top>o;v({top:t.top,bottom:t.bottom,right:t.right,flipUp:r,avail:Math.max((r?t.top:o)-12,132)})};e(),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0);const t=e=>{const t=e.target;N.current?.contains(t)||C.current?.contains(t)||w(!1)};return document.addEventListener("mousedown",t),()=>{window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0),document.removeEventListener("mousedown",t)}},[b,f.length]);const F=b&&k&&"undefined"!=typeof document?p(/* @__PURE__ */m("div",{ref:C,role:"menu",className:"rounded-lg overflow-y-auto overscroll-contain",style:{position:"fixed",maxHeight:k.avail,top:k.flipUp?void 0:k.bottom+6,bottom:k.flipUp?window.innerHeight-k.top+6:void 0,left:k.right,transform:"translateX(-100%)",zIndex:20,backgroundColor:g.background,border:`1px solid ${g.border}`,boxShadow:y,minWidth:180,fontFamily:h},children:[/* @__PURE__ */u("div",{className:"px-3 py-1.5 text-[10px] font-bold tracking-wider uppercase",style:{color:g.text,opacity:.55,borderBottom:`1px solid ${g.border}`},children:"How many picks?"}),f.map((e,t)=>/* @__PURE__ */m("button",{type:"button",role:"menuitem",onClick:()=>{w(!1),x(e)},className:"w-full flex items-center justify-between px-3 py-2",style:{background:"transparent",border:"none",cursor:"pointer",borderTop:0===t?"none":`1px solid ${g.border}`},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=g.backgroundAlt},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent"},children:[/* @__PURE__ */m("span",{className:"text-sm font-semibold",style:{color:g.text},children:[e," picks"]}),/* @__PURE__ */u("span",{className:"text-[10px] font-bold tracking-wider",style:{background:z(g.primary,.14),color:g.primary,padding:"2px 6px",borderRadius:4},children:"QP"})]},e))]}),document.body):null;/* @__PURE__ */
|
|
89
|
+
return m("div",{ref:N,children:[/* @__PURE__ */u(rn,{iconUrl:e,gameName:t,onPress:()=>w(e=>!e),size:n,brandColor:o,cardColor:r,iconColor:a,accentColor:i,captionColor:d}),F]})}function fr({games:e,selectedGame:t,onSelectGame:n,loading:r,error:a,theme:p,colorScheme:h,showTier:f=!1,showCategory:x=!1,showTierFilter:g=!1,onPropositionCountChange:y,onPropositionCountSelected:b,onQuickPickGame:w,maxPayouts:k}){const v=ge(p,h),N=v.colors,C=V(v),F=ye(v),B=be(v),A=R(v),M=Y(v),S=j(v),L=$(v),P=i(()=>function(e){const t=new Set(e.filter(e=>Kn(e)&&Un(e.rule)===$n.straight).map(En));return e.filter(e=>!(Kn(e)&&Un(e.rule)!==$n.straight&&t.has(En(e))))}(e),[e]),T=i(()=>Yn(P),[P]),[D,O]=c(()=>Hn(P));l(()=>{0!==T.length&&(T.some(e=>e.id===D)||O(T[0].id))},[T,D]);const E=i(()=>!g||T.length<=1?P:jn(P,Dn[D]),[P,g,T.length,D]),H=s(null),W=s(null),[I,U]=c(0),[K,Z]=c(0),q=(e,t)=>{e.quick_pick_only&&w&&t>0?w(e,t):(t>0&&!Fn(e)&&y?.(t),n(e),b?.())},X=e=>{q(e,dr(e,k?.[e.id]).maxLegCount)};l(()=>{const e=H.current;if(!e)return;U(e.getBoundingClientRect().width);const t=new ResizeObserver(e=>{for(const t of e)U(t.contentRect.width)});return t.observe(e),()=>t.disconnect()},[]);const Q=s(()=>{}),_=o(e=>{W.current?.removeEventListener("scroll",Q.current),W.current=e,e&&(Q.current=()=>{const t=e.scrollLeft+e.clientWidth/2;let n=0,o=1/0;Array.from(e.children).forEach((e,r)=>{const l=e,a=Math.abs(l.offsetLeft+l.offsetWidth/2-t);a<o&&(o=a,n=r)}),Z(n)},e.addEventListener("scroll",Q.current,{passive:!0}),Q.current())},[]);l(()=>{Q.current()},[I,E.length]),l(()=>{W.current?.scrollTo({left:0}),Z(0)},[D]);const ee=e=>e.allowed_propositions&&e.allowed_propositions.length>0&&e.game_name.replace(/\s+\d+\s*$/,"").trim()||e.game_name,te=e=>{const t=W.current,n=t?.children[e];t&&n&&t.scrollTo({left:n.offsetLeft-(t.clientWidth-n.offsetWidth)/2,behavior:"smooth"})};if(r)/* @__PURE__ */return u(vn,{colors:J(v),bodyFont:F,variant:"games",gameCardCount:Math.min(Math.max(P.length,2),4),showTierTabs:g&&T.length>1});if(a)/* @__PURE__ */return u("div",{className:"flex items-center justify-center p-8",style:{fontFamily:F},children:/* @__PURE__ */u("div",{style:{color:N.error},children:a})});if(0===P.length)/* @__PURE__ */return u("div",{className:"flex items-center justify-center p-8",style:{fontFamily:F},children:/* @__PURE__ */u("div",{style:{color:N.textMuted},children:"No games available"})});const ne=I>0&&I<400,oe=ne?108:124,re=I>0?Math.min(.86*I,380):0,le=re>0?Math.max((I-re)/2,4):4,ae=E.length>1,ie=ae&&le>=48,se=e=>({position:"absolute",top:"38%",width:44,height:44,borderRadius:"50%",border:`1px solid ${N.border}`,backgroundColor:z(N.background??"#fff",.94),color:N.primary,fontSize:18,lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center",cursor:e?"pointer":"default",opacity:e?1:.3,pointerEvents:e?"auto":"none",boxShadow:S,zIndex:1});/* @__PURE__ */
|
|
90
|
+
return m("div",{ref:H,className:"flex flex-col",style:{fontFamily:F},children:[g&&/* @__PURE__ */u(mr,{tabs:T,active:D,onChange:O,colors:N,bodyFont:F}),0===E.length?/* @__PURE__ */u("div",{className:"flex items-center justify-center p-8",children:/* @__PURE__ */u("div",{style:{color:N.textMuted},children:"No games in this collection"})}):/* @__PURE__ */m(d,{children:[
|
|
91
|
+
/* @__PURE__ */m("div",{style:{position:"relative"},children:[/* @__PURE__ */u("div",{ref:_,className:"blade-game-track",style:{display:"flex",alignItems:"stretch",gap:14,overflowX:"auto",overflowY:"hidden",scrollSnapType:"x mandatory",scrollbarWidth:"none",paddingLeft:le,paddingRight:le,paddingBottom:8,position:"relative"},children:E.map(e=>{const n=qt(e),o=function(e){const t=e.available_days;if(!t||0===t.length)return null;const n=t.map(e=>Vt[e]??`Day ${e}`);return 1===n.length?n[0]:n.slice(0,-1).join(", ")+" & "+n[n.length-1]}(e),r=t?.id===e.id,l=String(e.id),a=Pt(e),i=e.description||e.rule,s=e.call_to_action?.trim()||null,{legOptions:c,maxLegCount:d,tiers:p,modes:h,pydDividends:g,hasGenericDividends:y,minBet:b,maxBet:S}=dr(e,k?.[e.id]),P=Ae(e),T=!n&&o?`Available ${o}`:null;/* @__PURE__ */
|
|
92
|
+
return m("article",{className:"flex flex-col items-center text-center",style:{flex:re>0?`0 0 ${re}px`:"0 0 86%",scrollSnapAlign:"center",borderRadius:24,border:`1px solid ${r?N.primary:N.border}`,backgroundColor:r?N.infoBg:N.background??C,boxShadow:M,padding:"22px 20px 20px",opacity:n?1:.5,pointerEvents:n?"auto":"none"},children:[e.quick_pick_only&&w&&c.length>1?/* @__PURE__ */u(hr,{iconUrl:P,gameName:ee(e),size:oe,brandColor:N.primary,cardColor:C,iconColor:N.primaryText,accentColor:L,captionColor:N.textMuted,bodyFont:F,legOptions:c.map(Number),onPick:t=>q(e,t),colors:N,menuShadow:M}):/* @__PURE__ */u(rn,{iconUrl:P,gameName:ee(e),onPress:()=>X(e),size:oe,brandColor:N.primary,cardColor:C,iconColor:N.primaryText,accentColor:L,captionColor:N.primary}),
|
|
93
93
|
/* @__PURE__ */m("div",{className:"mt-2",style:{fontFamily:B,fontSize:13,letterSpacing:"-0.04em",lineHeight:1},children:[/* @__PURE__ */u("span",{style:{fontWeight:800,color:N.primary},children:"YES"}),/* @__PURE__ */u("span",{style:{fontWeight:600,color:z(N.primary,.85)},children:"NO"})]}),
|
|
94
|
-
/* @__PURE__ */m("h3",{className:"flex items-center justify-center gap-1.5 font-semibold leading-tight px-1 mt-0.5",style:{fontFamily:B,fontSize:ne?19:21,color:A,letterSpacing:"-0.01em"},children:[ee(e),/* @__PURE__ */u(qe,{variant:"icon",panel:Ee(e),content:i||"Pick outcomes and land the payout for this game.",theme:v,title:ee(e),label:`How to play ${ee(e)}`,extra:/* @__PURE__ */u(
|
|
95
|
-
return m("button",{type:"button",onClick:()=>X(e),disabled:!n,"aria-current":t===K,className:"flex flex-col items-center gap-1 px-1 py-1.5 rounded-2xl",style:{border:`1px solid ${t===K?N.primary:"transparent"}`,cursor:n?"pointer":"not-allowed",opacity:n?1:.5,background:"transparent",transition:"border-color 150ms ease"},children:[/* @__PURE__ */u(
|
|
96
|
-
/* @__PURE__ */u("style",{children:".blade-game-track::-webkit-scrollbar{display:none}"})]})}var Po={today:"Today",weekend:"This weekend",next7:"Next 7 days"},To=["today","weekend","next7"];function Do(e,t){const n=new Date(e);return n.setDate(n.getDate()+t),n}function Oo(e,t,n){if(!e)return!1;const o=new Date(e);if(Number.isNaN(o.getTime()))return!1;const{start:r,end:l}=function(e,t){const n=function(e){const t=new Date(e);return t.setHours(0,0,0,0),t}(t);switch(e){case"today":return{start:n,end:Do(n,1)};case"weekend":{const e=n.getDay(),t=Do(n,0===e?-1:(6-e)%7);return{start:t<n?n:t,end:Do(t,2)}}case"next7":return{start:n,end:Do(n,7)}}}(t,n);return o>=r&&o<l}var Eo=["totals","spread","player"],jo={totals:"Total",spread:"Spread",player:"Player"},Yo={totals:"One total per match — the match total, a quarter or a half all count",spread:"One result per match — the line, the margin or the head-to-head all count",player:"One player prop per match"};function Ho(e,t){return t?`${Yo[e]} (taken)`:Yo[e]}var Ro=/racing|greyhound|harness|trots/,Go=["spread","handicap","margin","line","h2h","head_to_head","moneyline","winner","result"];function Wo(e,t,n=""){const o=e.toLowerCase(),r=t.toLowerCase();return Ro.test(o)||Ro.test(n.toLowerCase())?null:o.includes("player")?"player":o.includes("total")||o.includes("over_under")?"totals":Go.some(e=>o.includes(e))||/\bwin(s)?\b/.test(r)?"spread":/\btotal\b/.test(r)?"totals":null}function Io(e){return Wo(rt(e)??"",lt(e),e.sport??"")}function Uo(e,t){if(it(e)){const n=dt(e,t),o=/* @__PURE__ */new Set;for(const t of n?.legs??[]){const n=t.prop?Io(t.prop):Wo("",t.text,e.sport??"");n&&o.add(n)}return[...o]}const n=Io(e);return n?[n]:[]}function $o(e){return An(e)||[e.home_team,e.away_team].filter(Boolean).join(" vs ").trim()||null}var Ko=/* @__PURE__ */new Set;function Zo(e,t,n){const o=/* @__PURE__ */new Map;for(const l of e){if(!(l.id in t))continue;const e=$o(l);if(e)for(const t of Uo(l,n)){const n=o.get(e)??/* @__PURE__ */new Map;n.has(t)||n.set(t,l.id),o.set(e,n)}}const r=e=>{const t=e?o.get(e):void 0;return t?new Set(t.keys()):Ko};return{isCapped:e=>{const t=$o(e);if(!t)return!1;const r=o.get(t);return!!r&&Uo(e,n).some(t=>{const n=r.get(t);return void 0!==n&&n!==e.id})},filledFor:r,slotsFor:e=>{const t=r(e);return Eo.map(e=>({family:e,label:jo[e],filled:t.has(e)}))}}}var qo=class{constructor(e){this.inflight=/* @__PURE__ */new Map,this.cache=/* @__PURE__ */new Map,this.apiUrl=e.apiUrl,this.apiKey=e.apiKey,this.fetchImpl=e.fetchImpl??fetch.bind(globalThis),this.getAuthHeaders=e.getAuthHeaders}invalidateCache(){this.cache.clear()}invalidate(){this.invalidateCache()}async request(e,t,n){const o=`${this.apiUrl}${e}`,r=(t?.method??"GET").toUpperCase(),l="GET"===r,a=l,i=!l&&!n?.idempotent,s=`${r} ${o}`;if(a){const e=this.cache.get(s);if(e&&Date.now()-e.at<5e3)return e.value;const t=this.inflight.get(s);if(t)return t}const c=a?this.cache.get(s):void 0,d=(async()=>{let e;try{const n=this.getAuthHeaders?await this.getAuthHeaders():void 0;e=await this.fetchImpl(o,{...t,headers:{"Content-Type":"application/json",...this.apiKey?{"X-API-Key":this.apiKey}:{},...n??{},...c?.etag?{"If-None-Match":c.etag}:{},...t?.headers}})}catch(r){throw r}if(304===e.status&&c)return a&&this.cache.set(s,{at:Date.now(),value:c.value,etag:c.etag}),c.value;if(!e.ok){let t=`API request failed: ${e.status} ${e.statusText}`;try{const n=await e.json();422===e.status&&n.detail?Array.isArray(n.detail)?t=n.detail.map(e=>`${Array.isArray(e.loc)?e.loc.join("."):"field"}: ${e.msg}`).join("; "):"string"==typeof n.detail?t=n.detail:"object"==typeof n.detail&&(t=JSON.stringify(n.detail)):n.message?t=n.message:n.error&&(t=n.error)}catch{}throw new Error(t)}const n=await e.json();if(a){const t=e.headers.get("ETag")??void 0;this.cache.set(s,{at:Date.now(),value:n,etag:t})}return n})();return a?(this.inflight.set(s,d),d.catch(()=>{}).finally(()=>{this.inflight.delete(s)})):i&&d.finally(()=>this.invalidateCache()).catch(()=>{}),d}async getGames(e){const t=new URLSearchParams;e?.category&&t.append("category",e.category),e?.jurisdiction&&t.append("jurisdiction",e.jurisdiction),e?.sport&&t.append("sport",e.sport);const n=t.toString(),o=n?`/games?${n}`:"/games",r=await this.request(o);return{games:r.payload||[],howToPlayMarkdown:r.how_to_play_markdown??null}}async getGame(e){return(await this.request(`/games/${e}`)).payload}async getPropositions(e){const t=new URLSearchParams;e?.event_id&&t.append("event_id",e.event_id),e?.sport&&t.append("sport",e.sport),e?.category&&t.append("category",e.category);const n=t.toString(),o=n?`/propositions?${n}`:"/propositions";return(await this.request(o)).payload||[]}async getSports(){return(await this.request("/propositions/sports")).sports||[]}async getPropositionsByIds(e){if(0===e.length)return[];const t=new URLSearchParams({ids:e.join(","),include_expired:"true"});return(await this.request(`/propositions?${t.toString()}`)).payload||[]}async getProposition(e){const t=(await this.request(`/propositions/${e}?include_expired=true`)).payload;return Array.isArray(t)?t.find(t=>t.id===e)??t[0]:t}async getGameEntries(e){const t=new URLSearchParams;null!=e?.user_id&&t.append("user_id",String(e.user_id)),null!=e?.pending&&t.append("pending",String(e.pending));const n=t.toString(),o=n?`/game-entries?${n}`:"/game-entries";return((await this.request(o)).payload||[]).map(e=>{const t={...e};return!t.created_at&&t.entry_date&&(t.created_at=t.entry_date),null!=t.stake&&null==t.bet_amount&&(t.bet_amount=Number(t.stake)),(!t.proposition_ids||0===t.proposition_ids.length)&&t.propositions&&t.propositions.length>0&&(t.proposition_ids=t.propositions.map(e=>e.id)),t})}async createGameEntry(e){const t=e.proposition_ids.map(t=>({proposition_id:t,user_prediction:e.selections?.[t]??"yes"})),n={game_id:e.game_id,user_id:e.user_id,propositions:t};null!=e.stake&&(n.stake=e.stake),null!=e.rule_id&&(n.rule_id=e.rule_id);const o=(await this.request("/game-entries",{method:"POST",body:JSON.stringify(n)})).payload;return null!=o.stake&&null==o.bet_amount&&(o.bet_amount=Number(o.stake)),o}async getPayoutsDue(e){const t=new URLSearchParams;null!=e?.game_id&&t.set("game_id",String(e.game_id)),null!=e?.limit&&t.set("limit",String(e.limit)),null!=e?.offset&&t.set("offset",String(e.offset));const n=t.toString();return await this.request(n?`/game-entries/payouts/due?${n}`:"/game-entries/payouts/due")}async getEntryPayout(e){return(await this.request(`/game-entries/${e}/payout`)).payload}async markEntryPaidOut(e){const t=await this.request(`/game-entries/${e}/payout/mark-paid-out`,{method:"POST",body:JSON.stringify({})});return this.invalidate(),t.payload}async updateGameEntryResult(e,t){return(await this.request(`/game-entries/${e}/result`,{method:"POST",body:JSON.stringify(t)})).payload}async getGameMaxPayout(e,t){const n=null!=t?`?bet_amount=${encodeURIComponent(String(t))}`:"";return(await this.request(`/games/${e}/max-payout${n}`)).payload}async getGamesMaxPayouts(e,t){if(0===e.length)return{};const n=new URLSearchParams({ids:e.join(",")});null!=t&&n.set("bet_amount",String(t));const o=await this.request(`/games/max-payouts?${n.toString()}`),r={};for(const[l,a]of Object.entries(o.payload||{}))r[Number(l)]=a;return r}async getEntryPreview(e,t){return(await this.request(`/games/${e}/preview`,{method:"POST",body:JSON.stringify(t)},{idempotent:!0})).payload}async evaluateRule(e,t){return(await this.request(`/games/${e}/evaluate-rule`,{method:"POST",body:JSON.stringify(t)},{idempotent:!0})).payload}async calculatePayout(e,t){return(await this.request(`/games/${e}/calculate-payout`,{method:"POST",body:JSON.stringify(t)},{idempotent:!0})).payload}};function Vo(e,t,n){const[r,a]=c([]),[i,d]=c(null),[u,m]=c(!n?.skip),[p,h]=c(null),f=t?`${t.category||""}_${t.jurisdiction||""}_${t.sport||""}`:"",x=s(t);x.current=t;const g=n?.skip??!1,y=o(async()=>{if(!g)try{m(!0),h(null);const t=await e.getGames(x.current);a(t.games),d(t.howToPlayMarkdown)}catch(t){h(t instanceof Error?t.message:"Failed to fetch games")}finally{m(!1)}},[e,f,g]);return l(()=>{y()},[y]),{games:r,howToPlayMarkdown:i,loading:u,error:p,refetch:o(async()=>{e.invalidate(),await y()},[e,y])}}function Xo(e,t,n){const[r,a]=c([]),[i,d]=c(!n?.skip),[u,m]=c(null),p=n?.skip??!1,h=t?`${t.event_id||""}_${t.sport||""}_${t.category||""}`:"",f=s(t);f.current=t;const x=o(async()=>{if(!p)try{d(!0),m(null);const t=await e.getPropositions(f.current);a(t)}catch(t){m(t instanceof Error?t.message:"Failed to fetch propositions")}finally{d(!1)}},[e,h,p]);return l(()=>{x()},[x]),{propositions:r,loading:i,error:u,refetch:o(async()=>{e.invalidate(),await x()},[e,x])}}function Qo(e,t){const[n,r]=c([]),[a,i]=c(!t?.skip),[s,d]=c(null),u=t?.skip??!1,m=o(async()=>{if(!u)try{i(!0),d(null),r(await e.getSports())}catch(t){d(t instanceof Error?t.message:"Failed to fetch sports")}finally{i(!1)}},[e,u]);return l(()=>{m()},[m]),{sports:n,loading:a,error:s,refetch:o(async()=>{e.invalidate(),await m()},[e,m])}}function Jo(e,t,n){const[r,a]=c([]),[i,d]=c(!n?.skip),[u,m]=c(null),p=n?.skip??!1,h=t?`${t.user_id??""}_${t.pending??""}`:"",f=s(t);f.current=t;const x=o(async()=>{if(!p)try{d(!0),m(null);const t=await e.getGameEntries(f.current);a(t)}catch(t){m(t instanceof Error?t.message:"Failed to fetch entries")}finally{d(!1)}},[e,h,p]);return l(()=>{x()},[x]),{entries:r,loading:i,error:u,refetch:o(async()=>{e.invalidate(),await x()},[e,x])}}function _o(e,t,n){const[r,a]=c({}),[i,d]=c(!1),u=n?.skip??!1,m=n?.betAmount,p=s(/* @__PURE__ */new Set);return l(()=>{if(u||0===t.length)return;const n=t.filter(e=>!(e.id in r)&&!p.current.has(e.id));if(0===n.length)return;for(const e of n)p.current.add(e.id);let o=!1;return d(!0),(async()=>{try{const t=await e.getGamesMaxPayouts(n.map(e=>e.id),m);o||a(e=>({...e,...t}))}catch{}finally{o||d(!1)}})(),()=>{o=!0}},[e,t.map(e=>e.id).join(","),u,m]),{maxPayouts:r,loading:i,refetchGame:o(async(t,n)=>{if(!u)try{const o=await e.getGamesMaxPayouts([t],n??m);o[t]&&a(e=>({...e,[t]:o[t]}))}catch{}},[e,u,m])}}function er(e){const[t,n]=c(!1),[r,l]=c(null),[a,i]=c(null);return{createEntry:async t=>{try{n(!0),l(null),await function(e=15e3){return"undefined"==typeof navigator||!1!==navigator.onLine||"undefined"==typeof window||"function"!=typeof window.addEventListener?Promise.resolve():new Promise(t=>{const n=()=>{window.removeEventListener("online",n),clearTimeout(o),t()},o=setTimeout(n,e);window.addEventListener("online",n)})}();const o=await e.createGameEntry(t);return i(o),o}catch(o){const e=o instanceof Error?o.message:"Failed to create entry";throw l(e),new Error(e)}finally{n(!1)}},loading:t,error:r,entry:a,clearSubmitError:o(()=>l(null),[])}}function tr(e){const[t,n]=c(e?"sport":"game"),[o,r]=c(null),[l,a]=c({}),[i,s]=c(null);return{step:t,selectedGame:o,selections:l,placedEntry:i,setGameOnly:e=>{r(e)},clearSelectedGame:()=>{r(null),a({})},goToSportSelection:e=>{e&&r(e),n("sport")},goToConfirmation:()=>{n("confirm")},goToSuccess:e=>{s(e),n("success")},goBack:()=>{"confirm"===t?n("sport"):"sport"===t&&(n("game"),r(null),a({}))},reset:()=>{n("game"),r(null),a({}),s(null)},toggleSelection:(e,t)=>{a(n=>{const o={...n};return o[e]===t?delete o[e]:o[e]=t,o})}}}function nr(e){const[t,n]=c(!1),[r,l]=c(null),[a,i]=c(null);return{evaluate:o(async(t,o)=>{try{n(!0),l(null);const r=await e.evaluateRule(t,o);return i(r),r}catch(r){const e=r instanceof Error?r.message:"Failed to evaluate rule";throw l(e),new Error(e)}finally{n(!1)}},[e]),loading:t,error:r,result:a}}function or(e){const[t,n]=c(!1),[r,l]=c(null),[a,i]=c(null);return{calculate:o(async(t,o)=>{try{n(!0),l(null);const r=await e.calculatePayout(t,o);return i(r),r}catch(r){const e=r instanceof Error?r.message:"Failed to calculate payout";throw l(e),new Error(e)}finally{n(!1)}},[e]),loading:t,error:r,result:a}}function rr(e){const[t,n]=c(!1),[r,l]=c(null),[a,i]=c(null);return{preview:o(async(t,o)=>{try{n(!0),l(null);const r=await e.getEntryPreview(t,o);return i(r),r}catch(r){const e=r instanceof Error?r.message:"Failed to preview entry";throw l(e),new Error(e)}finally{n(!1)}},[e]),loading:t,error:r,result:a}}var lr=[1,5,10,20,50,100],ar=[4,12];function ir(e){return!!e&&!e.quick_pick_only&&"game_set"===(e.rule??"").trim().toLowerCase()}function sr(e,t,n){const o=n?.operatorMargin??.2,r=n?.perLegProbability??.5,l=Math.round(Math.pow(1/r,t)),a=(1-o)*Math.pow(1/r,t);return{legs:t,stake:e,prize:Math.round(e*a*100)/100,multiple:a,oddsOneIn:l}}function cr(e){if(!ir(e)||!e)return null;const t=e.min_propositions??e.allowed_propositions?.[0]??ar[0],n=e.max_propositions??e.allowed_propositions?.[e.allowed_propositions.length-1]??ar[1],o=e.allowed_propositions&&e.allowed_propositions.length>0?[...e.allowed_propositions].sort((e,t)=>e-t):Array.from({length:Math.max(0,n-t+1)},(e,n)=>t+n);if(0===o.length)return null;const r=Math.max(e.min_bet??1,.01),l=e.max_bet??null,a=lr.filter(e=>e>=r&&(null===l||e<=l));return{legOptions:o,defaultLegs:o.includes(8)?8:o[Math.floor(o.length/2)],defaultStake:Math.min(Math.max(20,r),l??20),minStake:r,maxStake:l,quickStakes:a,tagline:"Two steps to your multi. Tweak legs and stake — the prize updates as you go.",operatorMargin:e.operator_margin??.2,perLegProbability:e.payout_structure?.per_leg_probability??.5}}var dr=50,ur=[25,50,75,100],mr=[{legs:4,firstPayingTier:3,tiers50:[[3,60],[4,340]]},{legs:6,firstPayingTier:4,tiers50:[[4,40],[5,110],[6,850]]},{legs:8,firstPayingTier:5,tiers50:[[5,30],[6,70],[7,300],[8,2100]]},{legs:9,firstPayingTier:5,tiers50:[[5,10],[6,40],[7,100],[8,350],[9,4500]]},{legs:10,firstPayingTier:6,tiers50:[[6,15],[7,45],[8,140],[9,800],[10,1e4]]}];function pr(e){return!!e&&!e.quick_pick_only&&"ladder"===(e.rule??"").trim().toLowerCase()}function hr(e,t){return Math.round(e*t/50*100)/100}function fr(e,t){let n=0;return e.tiers50.map(([e,o])=>(n+=o,{atLeast:e,prize:hr(o,t),cumulative:hr(n,t)}))}function xr(e,t){return hr(e.tiers50.reduce((e,[,t])=>e+t,0),t)}function gr(e,t,n){return hr(e.tiers50.reduce((e,[n,o])=>n<=t?e+o:e,0),n)}function yr(e){if(!pr(e)||!e)return null;const t=e.allowed_propositions,n=e.min_propositions??4,o=e.max_propositions??10,r=mr.filter(e=>t&&t.length>0?t.includes(e.legs):e.legs>=n&&e.legs<=o);if(0===r.length)return null;const l=e.min_bet??ur[0],a=e.max_bet??ur[ur.length-1],i=ur.filter(e=>e>=l&&e<=a);return{ladders:r,defaultLegs:r.some(e=>8===e.legs)?8:r[Math.floor(r.length/2)].legs,defaultStake:i.includes(50)?50:i[0]??50,stakes:i.length>0?i:ur,tagline:"Climb the ladder. Every step pays its own prize, and every prize stacks on the one before."}}var br=.21875,wr=6,kr=5,vr=1,Nr=2;function Cr(e){return!!e&&!e.quick_pick_only&&"six_again"===(e.rule??"").trim().toLowerCase()}var Fr={golden_point:!1,captains_challenge:!1};function Br(e,t,n){const o=1+(t.golden_point?1:0)+(t.captains_challenge?1:0),r=e*n.baseMultiple*(t.golden_point?n.goldenPointFactor:1),l=t.captains_challenge?e*n.challengeMultiple:0;return{legs:n.legs,unit:e,stake:e*o,base:r,challenge:l,perfect:r+l,lowestWinningCount:n.legs-(t.captains_challenge?n.challengeMisses:0),ruleId:Ar(t,n)}}function Ar(e,t){return e.captains_challenge?e.golden_point?t.ruleIds.goldenChallenge:t.ruleIds.challenge:t.ruleIds.base}function Mr(e,t){const n=Br(1,e,t);return{perfect:n.perfect/n.stake,challenge:n.challenge/n.stake}}function Sr(e,t){return e.permitted_rules?.find(e=>t((e.name??"").toLowerCase().replace(/[^a-z]+/g," ").trim()))??null}function Lr(e){if(!Cr(e)||!e)return null;const t=e.num_propositions??e.min_propositions??6;if(t<2)return null;const n=e.operator_margin??.21875,o=Math.max(e.min_bet??10,.01),r=null!=e.max_bet?Math.max(o,Math.floor(e.max_bet/3/o)*o):Math.max(o,100),l=Sr(e,e=>e.includes("challenge")&&!e.includes("golden")),a=Sr(e,e=>e.includes("challenge")&&e.includes("golden")),i=Sr(e,e=>!e.includes("challenge"))??null;return{legs:t,unitMin:o,unitStep:o,unitMax:r,defaultUnit:o,baseMultiple:Math.round(Math.pow(2,t)*(1-n)*100)/100,challengeMultiple:5,challengeMisses:1,goldenPointFactor:2,boosts:[{id:"golden_point",label:"Golden Point",costUnits:1},{id:"captains_challenge",label:"Captain's Challenge",costUnits:1}],tagline:"Set your play, then pick your six. Every call a yes or a no.",ruleIds:{base:i?.id??e.default_rule_id??null,challenge:l?.id??null,goldenChallenge:a?.id??null}}}function zr(e){return e?.quick_pick_only?"quick_pick":ir(e)?"game_set":ko(e)?"pick_your_dividend":pr(e)?"ladder":Kn(e)?"mirror":no(e)?"safety_net":Cr(e)?"six_again":Bn(e)?"selections":yo(e)?"rule_setup":"selections"}function Pr(e){if(!e||e.quick_pick_only)return!1;if("exact"!==(e.rule??"").trim().toLowerCase())return!1;if(Bn(e))return!1;const t=!!(e.allowed_markets&&e.allowed_markets.length>0),n=!!(e.allowed_sports&&e.allowed_sports.length>0);return t||n}function Tr(e){return!(!e||e.quick_pick_only||"exact"!==(e.rule??"").trim().toLowerCase()||Bn(e)||Pr(e))}function Dr(e){switch(zr(e)){case"ladder":return{belowRequiredHint:(e,t)=>`Drop to Ladder ${e} or add another pick to stay on Ladder ${t}.`,belowRequiredAddOnlyHint:e=>`Add another pick to stay on Ladder ${e}.`,switchTierLabel:e=>`Switch to Ladder ${e}`,overloadTitle:"Add more picks to climb higher",tableColumnLabel:"Ladder",tierButtonLabel:e=>`Ladder ${e}`};case"game_set":case"pick_your_dividend":case"mirror":case"safety_net":case"six_again":return{belowRequiredHint:(e,t)=>`Drop to ${e} legs or add another pick to stay at ${t}.`,belowRequiredAddOnlyHint:e=>`Add another pick to stay at ${e} legs.`,switchTierLabel:e=>`Switch to ${e} legs`,overloadTitle:"Add more legs to win more",tableColumnLabel:"Legs",tierButtonLabel:e=>`${e} legs`};default:return{belowRequiredHint:(e,t)=>`Drop to a ${e}-leg multi or add another pick to stay at ${t}.`,belowRequiredAddOnlyHint:e=>`Add another pick to stay at ${e}.`,switchTierLabel:e=>`Switch to ${e}-leg`,overloadTitle:"Add more picks to win more",tableColumnLabel:"Legs",tierButtonLabel:e=>`Multi ${e}`}}}function Or(e){const t=zr(e);return"six_again"===t||"pick_your_dividend"===t}function Er(e){return"six_again"===zr(e)?"Set by your ticket and boosts.":"Set by your dividend ladder rung."}function jr(e,t,n){if(!e||t<=0||n<=0)return 0;switch(zr(e)){case"game_set":return sr(n,t,{operatorMargin:e.operator_margin??void 0,perLegProbability:e.payout_structure?.per_leg_probability??void 0}).prize;case"mirror":return Zn(n,t,{operatorMargin:e.operator_margin??void 0,perLegProbability:e.payout_structure?.per_leg_probability??void 0}).prize;case"pick_your_dividend":return function(e,t,n=bo){if(!(e>0&&t>0))return 0;for(const o of n)if(Math.abs(No(o,e).stake-t)<.005)return o;return 0}(t,n);default:return 0}}var Yr=t(null),Hr={};function Rr(){const e=r(Yr);if(!e)throw new Error("usePlaceEntry must be used within a <PlaceEntryProvider>");return e}function Gr({apiUrl:t,apiKey:n,fetchImpl:r,getAuthHeaders:a,userId:d,getUserBalance:m,children:p,theme:h,colorScheme:f,demoGames:x,demoPropositions:g,demoEntries:y,demoMaxPayouts:b,gameCategory:w,jurisdiction:k,initialGameId:v,filterSport:N,initialSport:C,initialEventId:F,initialEventLabel:B,sportBaseKey:A,disableQuickPick:M=!1,renderTeamLogo:S,renderPropositionSilk:L,selectionVariant:z,disableEventSwipe:P,enableSportFavourites:T,onEntryPlaced:D,onBeforeSubmit:O,onCancel:E,onShare:j,onRecharge:Y,onClearEventFilter:H,screenSize:R="desktop",howToPlayMarkdown:G,sportDisplayNames:W,categoryDisplayNames:I}){const U=ge(h,f),$=ye(U),K=be(U),Z=!(!x||!g),q=i(()=>new qo({apiUrl:t,apiKey:n,fetchImpl:r,getAuthHeaders:a}),[t,n,r,a]),[V,X]=c(0),Q=s(0),[J,_]=c(0),[ee,te]=c([]),[ne,oe]=c({}),[re,le]=c({}),[ae,ie]=c(void 0),[se,ce]=c(null),[de,ue]=c(void 0),me=e.useCallback(async()=>{if(m)try{const e=await m();"number"==typeof e&&Number.isFinite(e)&&ue(e)}catch(e){}},[m]);l(()=>{m?me():ue(void 0)},[m,me]);const pe=s(null),he=s(null),[fe,xe]=c(null),[we,ke]=c(C??null),[ve,Ne]=c(F??null);l(()=>{C&&ke(C)},[C]),l(()=>{Ne(F??null)},[F]);const[Ce,Fe]=c(F),Be=s(!1);l(()=>{if(!F)return Fe(void 0),void(Be.current=!1);Be.current||Fe(F)},[F]);const Ae=w??fe??void 0,Me=jt(we??N??C??void 0,A),Se=jt(N,A)??N,Le=we??void 0,{games:ze,howToPlayMarkdown:Pe,loading:Te,error:De}=Vo(q,{category:Ae,jurisdiction:k,sport:Me},{skip:Z}),{propositions:Oe,loading:Ee,error:je}=Xo(q,{category:Ae,sport:Se,event_id:Ce},{skip:Z}),{sports:Ye,loading:He}=Qo(q,{skip:Z}),{createEntry:Re,loading:Ge,error:We,clearSubmitError:Ie}=er(q),{preview:Ue}=rr(q),$e=i(()=>$t((Z?x:ze)??[],{category:Ae,sport:Me??Le,sportBaseKey:A}),[Z,x,ze,Ae,Me,Le,A]),Ke=G??Pe??null,{maxPayouts:Ze,refetchGame:qe}=_o(q,$e??[],{skip:Z,betAmount:20}),Ve=Z?b??Hr:Ze,Xe=Z?g:Oe,Qe=N?(Xe??[]).filter(e=>e.sport===N):Xe,Je=i(()=>Mt(Qe??[]),[Qe]),_e=i(()=>Ae||(1===Je.length?Je[0]:void 0),[Ae,Je]),et=i(()=>{const e=Qe??[];return _e?Gt(e,{category:_e,sportBaseKey:A}):e},[Qe,_e,A]),tt=i(()=>Le?Gt(et,{sport:Le,sportBaseKey:A}):et,[et,Le,A]),nt=i(()=>({category:_e,sport:Le,sportBaseKey:A}),[_e,Le,A]),ot=i(()=>{const e=($e??[]).filter(e=>e.active);if(!_e&&Je.length>1)return[];const t=_e?$t(e,nt):e;return _e||Le?function(e,t,n){return n?.category||n?.sport?e.filter(e=>Ut(e,t,n)):e}(t,tt,nt):t},[$e,tt,nt,_e,Le,Je.length]),{step:rt,selectedGame:lt,selections:at,placedEntry:ct,setGameOnly:dt,clearSelectedGame:ut,goToSportSelection:mt,goToConfirmation:pt,goToSuccess:ht,goBack:ft,reset:xt,toggleSelection:gt}=tr(v),yt=e.useCallback(()=>{Be.current=!0,Fe(void 0),xt(),H?.()},[xt,H]),bt=!!Ce,wt=bt?B:void 0,kt=!Z&&(Te||Ee||!!lt&&He),vt=Z?null:lt?De||je:De,Ct=i(()=>lt?Zt(tt,lt,A):tt,[lt,tt,A]),Bt=i(()=>{const e=lt?Zt(et,lt,A):et,t=lt?.allowed_sports,n=/* @__PURE__ */new Map;for(const o of e){const r=Nt(o,e);"Other"!==r&&(t?.length&&!t.includes(r)||n.set(r,(n.get(r)??0)+1))}return Array.from(n.entries()).sort((e,t)=>t[1]-e[1]).map(([e,t])=>({key:e,count:t}))},[lt,et,A]),At=i(()=>Bt.map(e=>e.key),[Bt]),St=i(()=>lt?Ct:et,[lt,Ct,et]),Pt=i(()=>Gt(lt?Ct:et,{category:_e}),[lt,Ct,et,_e]),Tt=i(()=>{const e=new Set(At);return Ye.filter(t=>e.has(t.key))},[Ye,At]),Dt=i(()=>Gt(Ct,{category:_e,sport:we}),[Ct,_e,we]),Ht=i(()=>{if(!lt||!Bn(lt))return[];const{min:e}=zt(lt,ae),t=ae??e;return Mn(Dt).filter(e=>e.propositionCount>=t)},[lt,ae,Dt]),Rt=i(()=>Bn(lt)?Tn(Dt,ve):Dt,[lt,Dt,ve]),It=function(e,t){const[n,o]=c([]),r=s(/* @__PURE__ */new Set),a=i(()=>{const e=/* @__PURE__ */new Map;for(const n of t)e.set(n.id,n);for(const t of n)e.set(t.id,t);return e},[t,n]),d=i(()=>e?function(e){const t=/* @__PURE__ */new Set;for(const n of e)if(it(n))for(const e of st(n))t.add(e);return[...t]}(t).filter(e=>!a.has(e)):[],[e,t,a]);return l(()=>{if(!e||0===d.length)return;const t=d.filter(e=>!r.current.has(e));if(0===t.length)return;for(const e of t)r.current.add(e);let n=!1;return e.getPropositionsByIds(t).then(e=>{!n&&e.length>0&&o(t=>[...t,...e])}).catch(()=>{}),()=>{n=!0}},[e,d]),a}(Z?null:q,i(()=>[...Qe??[],...Rt],[Qe,Rt])),Kt=i(()=>Zo(Ct,at,It),[Ct,at,It]),qt=o((e,t)=>{if(!(e in at)){const t=Ct.find(t=>t.id===e);if(t&&Kt.isCapped(t))return}gt(e,t)},[at,Ct,Kt,gt]),Vt=Object.keys(at).map(Number),Xt=Vt.length,Qt=i(()=>Dt.filter(e=>Vt.includes(e.id)),[Dt,Vt]);l(()=>{w||fe||1===Je.length&&xe(Je[0])},[w,fe,Je]),l(()=>{if(!lt)return;const e=Ct,t=new Set(e.map(Ft));let n=fe;n&&t.has(n)||(n=1===t.size?Array.from(t)[0]:null,n!==fe&&xe(n));const o=n?e.filter(e=>Ft(e)===n):e,r=new Set(function(e){const t=/* @__PURE__ */new Set;for(const n of e){const o=Nt(n,e);"Other"!==o&&t.add(o)}return[...t]}(o)),l=lt.allowed_sports;ke(e=>e&&r.has(e)&&(!l?.length||l.includes(e))?e:1===l?.length&&r.has(l[0])?l[0]:1===r.size?Array.from(r)[0]:(()=>{const e=/* @__PURE__ */new Map;for(const r of o){const t=Nt(r,o);"Other"!==t&&(l?.length&&!l.includes(t)||e.set(t,(e.get(t)??0)+1))}let t=null,n=0;for(const[o,r]of e)r>n&&(t=o,n=r);return t})())},[lt?.id,Ct,fe]),l(()=>{Ie()},[lt?.id,rt,Ie]),l(()=>{lt&&_e&&(Wt(lt,_e)||ut())},[lt,_e,ut]),l(()=>{lt&&(Ut(lt,tt,{category:_e,sport:we,sportBaseKey:A})||ut())},[lt,_e,we,A,tt,ut]),l(()=>{if(lt){const e=pe.current,t=he.current!==lt.id;if(he.current=lt.id,null!=e?.stake&&e.stake>0?_(e.stake):t&&_(Math.max(20,lt.min_bet??0)),e){const{count:t}=e;return pe.current=null,ie(t),void X(t)}if(lt.allowed_propositions&<.allowed_propositions.length>0){const e=ae;null!=e&<.allowed_propositions.includes(e)?X(e):(ie(void 0),X(0))}else ie(void 0),X(lt.num_propositions||lt.max_propositions||0)}},[lt]);const Jt=(e,t,n)=>{const o=(Ve[e]?.top_payouts??[]).find(e=>e.proposition_count===t),r=o&&o.bet_amount&&o.bet_amount>0?o.bet_amount:20,l=o&&r>0?o.net_payout/r*n:0;return l>0?l:jr(($e??[]).find(t=>t.id===e)??(lt?.id===e?lt:null),t,n)};l(()=>{if("sport"!==rt&&"confirm"!==rt||!lt||Z)return;const e=Bn(lt)&&ve?Rt.length:Number.MAX_SAFE_INTEGER;let t;if(lt.allowed_propositions&<.allowed_propositions.length>0){const n=lt.allowed_propositions?[...lt.allowed_propositions].filter(t=>t<=e).sort((e,t)=>e-t):[];if(0===n.length)return void le({});const o=ae??n[0],r=n.filter(e=>e>o);if(0===r.length)return void le({});t=[o,...r]}else{const{min:n,max:o}=zt(lt),r=Math.min(o,e);if(n<=0||r<=n)return void le({});t=Array.from({length:r-n+1},(e,t)=>n+t)}const n={};for(const o of t)n[o]=Jt(lt.id,o,20);le(n)},[rt,lt,ae,ve,Rt.length,Z,Ve]),l(()=>{if("confirm"!==rt||!lt)return;const e=Vt.length;if(0===e)return;let t=!1;const n={};for(let r=0;r<=e;r++)n[r]=Jt(lt.id,r,J);oe(n),e!==Q.current?(Q.current=e,X(e)):(V>e||V<=0&&e>0)&&X(e);const o=J>0?J:Math.max(lt.min_bet??20,.01);return(async()=>{try{const n=await Ue(lt.id,{actual:V,predicted:V,total:e,bet_amount:o,rule_id:se});if(t)return;if(te(n.winning_counts),J>0&&n.payouts){const e={};for(const[t,o]of Object.entries(n.payouts)){const n=Number(t);e[n]=o>0?o:Jt(lt.id,n,J)}oe(e)}}catch{t||te([])}})(),()=>{t=!0}},[rt,lt,Vt.length,V,J,Ue,Ve,se]);const _t=i(()=>{return t=se,(e=lt)&&null!=t?e.permitted_rules?.find(e=>e.id===t)??null:null;var e,t},[lt,se]),en=!Bn(lt)||Dn(Qt,ve),tn=lt?zt(lt,void 0,_t):null,nn=!(!lt||!en)&&(lt.allowed_propositions&<.allowed_propositions.length>0?null!=ae&&Xt===ae&&Lt(Xt,tn?.min,tn?.max):Lt(Xt,tn?.min,tn?.max)),on=lt?.min_bet??0,rn=Math.max(on,.01),ln=null==de||J<=de,an=!Ge&&J>=rn&&nn&&ln,sn=e=>{ie(e),X(e);for(const t of Object.keys(at))gt(Number(t),at[Number(t)])},cn=e=>{ie(e),X(e)},dn=e=>{Ne(Bn(e)?F??null:null),dt(e)},un=e=>{if(e!==ve){for(const e of Object.keys(at)){const t=Number(e);gt(t,at[t])}Ne(e)}},mn=(e,t,n)=>{pe.current={count:t,stake:n},dt(e),qe(e.id);const o=e.allowed_sports??[];let r=null;we&&o.some(e=>Yt(we,e,A))?r=we:1===o.length&&(r=o[0]),ke(r);for(const s of Object.keys(at)){const e=Number(s);gt(e,at[e])}let l=Gt(Zt(Qe??[],e,A),{category:_e,sport:r,sportBaseKey:A});const a=Math.max(0,Math.min(t,l.length)),i=function(e,t,n){const o=[],r=/* @__PURE__ */new Map;for(const l of e){if(o.length>=t)break;const e=$o(l),a=e?Uo(l,n):[];if(e&&a.length>0){const t=r.get(e)??/* @__PURE__ */new Set;if(a.some(e=>t.has(e)))continue;for(const e of a)t.add(e);r.set(e,t)}o.push(l)}return o}([...l].sort(()=>Math.random()-.5),a,It);for(const s of i)gt(s.id,Math.random()<.5?"yes":"no");pt()},pn=s(!1),hn=async()=>{if(lt&&nn&&!pn.current){if(Z){const e={id:Math.floor(1e4*Math.random()),game_id:lt.id,user_id:d,proposition_ids:Vt,selections:at,pending:!0,expected_correct:V,bet_amount:J};return D?.(e),ht(e),void me()}pn.current=!0;try{O&&await O(J);const e=await Re({game_id:lt.id,user_id:d,proposition_ids:Vt,selections:at,stake:J,rule_id:_t?.id??null});D?.(e),ht(e),me()}catch(e){}finally{pn.current=!1}}},fn=o(e=>W?.[e]??Tt.find(t=>t.key===e)?.label??Ot(e,void 0,A),[W,Tt,A]),xn=o(e=>Et(e,I),[I]),gn=i(()=>({theme:U,bodyFont:$,headingFont:K,games:ot,propositions:Rt,compositeComponentById:It,propositionsForCategoryPicker:St,sportsForSelectedGame:At,sportOptions:Bt,propositionsForSportPicker:Pt,sportSummaries:Tt,loading:kt,error:vt,step:rt,selectedGame:lt,selections:at,placedEntry:ct,selectedPropositionIds:Vt,selectedPropositions:Qt,selectionValid:nn,selectedRuleId:se,setSelectedRuleId:ce,selectedRule:_t,answeredCount:Xt,betAmount:J,setBetAmount:_,expectedCorrect:V,setExpectedCorrect:X,selectedPropositionCount:ae,handlePropositionCountChange:sn,upgradePropositionCount:cn,winningCounts:ee,payouts:ne,overloadPayouts:re,submitting:Ge,submitError:We,canSubmit:an,gamePrice:on,userBalance:de,hasSufficientBalance:ln,refreshUserBalance:me,handleSubmit:hn,selectGame:dn,goToSportSelection:()=>mt(),goToConfirmation:pt,goBack:ft,reset:xt,clearSelectedGame:ut,toggleSelection:qt,quickPickGame:mn,selectedCategory:fe,setSelectedCategory:xe,selectedSport:we,setSelectedSport:ke,selectedEventId:ve,sameGameMultiEvents:Ht,selectSameGameMultiEvent:un,apiUrl:t,apiKey:n,fetchImpl:r,getAuthHeaders:a,userId:d,disableQuickPick:M,renderTeamLogo:S,renderPropositionSilk:L,selectionVariant:z,disableEventSwipe:P,enableSportFavourites:T,filterSport:N,initialSport:C,initialEventId:F,sportBaseKey:A,gameCategory:w,eventFilterActive:bt,eventFilterLabel:wt,clearEventFilter:yt,screenSize:R,displaySportName:fn,displayCategoryName:xn,maxPayouts:Ve??{},howToPlayMarkdown:Ke,onEntryPlaced:D,onCancel:E,onShare:j,onRecharge:Y,demoEntries:y,demoGames:x,demoPropositions:g}),[U,$,K,ot,Rt,It,St,Pt,At,Bt,Tt,kt,vt,rt,lt,at,ct,Vt,Qt,nn,Xt,J,V,ae,se,_t,ee,ne,re,Ge,We,an,on,t,n,d,de,r,a,M,S,L,z,P,T,N,C,F,A,w,R,bt,wt,yt,fe,we,ve,Ht,Ve,Ke,D,E,j,Y,H,y,x,g,fn,xn]);/* @__PURE__ */
|
|
97
|
-
return u(
|
|
94
|
+
/* @__PURE__ */m("h3",{className:"flex items-center justify-center gap-1.5 font-semibold leading-tight px-1 mt-0.5",style:{fontFamily:B,fontSize:ne?19:21,color:A,letterSpacing:"-0.01em"},children:[ee(e),/* @__PURE__ */u(qe,{variant:"icon",panel:Ee(e),content:i||"Pick outcomes and land the payout for this game.",theme:v,title:ee(e),label:`How to play ${ee(e)}`,extra:/* @__PURE__ */u(ur,{tiers:y?p:[],modes:h,pydDividends:g,onPlayCount:c.length>1?t=>q(e,t):void 0,minBet:b,maxBet:S,colors:N,bodyFont:F,headingFont:B}),colors:N,bodyFont:F,headingFont:B})]}),s&&/* @__PURE__ */u("p",{className:"mt-1.5 font-bold leading-snug",style:{fontSize:13,color:N.primary,maxWidth:"30ch"},children:s}),i&&/* @__PURE__ */u("p",{className:"mt-2 leading-relaxed",style:{fontSize:12.5,color:N.textMuted,maxWidth:"34ch"},children:i}),a.enabled&&/* @__PURE__ */m("span",{className:"inline-flex w-fit items-center gap-0.5 px-2 py-0.5 rounded-full mt-2",style:{backgroundColor:`${N.warning}15`,color:N.warning,fontSize:10,fontWeight:700},children:["★ ",a.progressive?a.amount>0?wt(a.amount):a.limit>0?`Up to ${wt(a.limit)}`:"Jackpot":wt(a.amount)]}),(x||f)&&/* @__PURE__ */m("div",{className:"flex flex-wrap gap-1 justify-center mt-2",children:[x&&e.category&&/* @__PURE__ */u("span",{className:"px-1.5 py-0.5 rounded text-xs",style:{backgroundColor:N.backgroundAlt,color:G(v)},children:e.category}),x&&/* @__PURE__ */u("span",{className:"px-1.5 py-0.5 rounded text-xs",style:{backgroundColor:N.backgroundAlt,color:G(v)},children:e.rule}),x&&e.lotto_type&&/* @__PURE__ */u("span",{className:"px-1.5 py-0.5 rounded text-xs",style:{backgroundColor:N.backgroundAlt,color:G(v)},children:e.lotto_type}),f&&null!=e.tier&&/* @__PURE__ */m("span",{className:"px-1.5 py-0.5 rounded text-xs",style:{backgroundColor:N.backgroundAlt,color:G(v)},children:["Tier ",e.tier]})]}),T&&/* @__PURE__ */u("div",{style:{marginTop:"auto",width:"100%",paddingTop:12},children:/* @__PURE__ */u("span",{className:"text-[11px] font-semibold leading-snug",style:{color:N.text},children:T})})]},l)})}),ie&&/* @__PURE__ */m(d,{children:[/* @__PURE__ */u("button",{type:"button","aria-label":"Previous game",onClick:()=>te(K-1),style:{...se(K>0),left:2},children:"‹"}),/* @__PURE__ */u("button",{type:"button","aria-label":"Next game",onClick:()=>te(K+1),style:{...se(K<E.length-1),right:2},children:"›"})]})]}),ae&&/* @__PURE__ */u("div",{className:"flex justify-center flex-wrap pt-1 pb-2",children:E.map((e,t)=>/* @__PURE__ */u("button",{type:"button","aria-label":`Go to ${ee(e)}`,onClick:()=>te(t),style:{padding:"18.5px 5px",margin:"-18.5px 0",background:"none",border:"none",cursor:"pointer",display:"flex",alignItems:"center"},children:/* @__PURE__ */u("span",{style:{display:"block",width:t===K?22:7,height:7,borderRadius:999,backgroundColor:t===K?N.primary:z(N.primary,.25),transition:"width 200ms ease, background-color 200ms ease"}})},e.id))}),ae&&/* @__PURE__ */m("div",{style:{borderTop:`1px solid ${N.border}`,paddingTop:10,marginTop:2},children:[/* @__PURE__ */u("div",{className:"text-[10px] font-bold uppercase mb-2",style:{color:N.textMuted,letterSpacing:"0.16em",fontFamily:B},children:"All games"}),/* @__PURE__ */u("div",{className:"grid gap-1",style:{gridTemplateColumns:`repeat(${ft(E.length,I)}, minmax(0, 1fr))`},children:E.map((e,t)=>{const n=qt(e);/* @__PURE__ */
|
|
95
|
+
return m("button",{type:"button",onClick:()=>X(e),disabled:!n,"aria-current":t===K,className:"flex flex-col items-center gap-1 px-1 py-1.5 rounded-2xl",style:{border:`1px solid ${t===K?N.primary:"transparent"}`,cursor:n?"pointer":"not-allowed",opacity:n?1:.5,background:"transparent",transition:"border-color 150ms ease"},children:[/* @__PURE__ */u(pr,{iconUrl:Ae(e),size:ne?44:52,brandColor:N.primary,iconColor:N.primaryText,accentColor:L}),/* @__PURE__ */u("span",{className:"text-[11px] font-bold leading-tight",style:{color:t===K?N.primary:A,fontFamily:B,letterSpacing:"-0.01em",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:2,overflow:"hidden"},children:ee(e)})]},e.id)})})]})]}),
|
|
96
|
+
/* @__PURE__ */u("style",{children:".blade-game-track::-webkit-scrollbar{display:none}"})]})}var xr={today:"Today",weekend:"This weekend",next7:"Next 7 days"},gr=["today","weekend","next7"];function yr(e,t){const n=new Date(e);return n.setDate(n.getDate()+t),n}function br(e,t,n){if(!e)return!1;const o=new Date(e);if(Number.isNaN(o.getTime()))return!1;const{start:r,end:l}=function(e,t){const n=function(e){const t=new Date(e);return t.setHours(0,0,0,0),t}(t);switch(e){case"today":return{start:n,end:yr(n,1)};case"weekend":{const e=n.getDay(),t=yr(n,0===e?-1:(6-e)%7);return{start:t<n?n:t,end:yr(t,2)}}case"next7":return{start:n,end:yr(n,7)}}}(t,n);return o>=r&&o<l}var wr=["totals","spread","player"],kr={totals:"Total",spread:"Spread",player:"Player"},vr={totals:"One total per match — the match total, a quarter or a half all count",spread:"One result per match — the line, the margin or the head-to-head all count",player:"One player prop per match"};function Nr(e,t){return t?`${vr[e]} (taken)`:vr[e]}var Cr=/racing|greyhound|harness|trots/,Fr=["spread","handicap","margin","line","h2h","head_to_head","moneyline","winner","result"];function Br(e,t,n=""){const o=e.toLowerCase(),r=t.toLowerCase();return Cr.test(o)||Cr.test(n.toLowerCase())?null:o.includes("player")?"player":o.includes("total")||o.includes("over_under")?"totals":Fr.some(e=>o.includes(e))||/\bwin(s)?\b/.test(r)?"spread":/\btotal\b/.test(r)?"totals":null}function Ar(e){return Br(rt(e)??"",lt(e),e.sport??"")}function Mr(e,t){if(it(e)){const n=dt(e,t),o=/* @__PURE__ */new Set;for(const t of n?.legs??[]){const n=t.prop?Ar(t.prop):Br("",t.text,e.sport??"");n&&o.add(n)}return[...o]}const n=Ar(e);return n?[n]:[]}function Sr(e){return Bn(e)||[e.home_team,e.away_team].filter(Boolean).join(" vs ").trim()||null}var Lr=/* @__PURE__ */new Set;function zr(e,t,n){const o=/* @__PURE__ */new Map,r=/* @__PURE__ */new Map;for(const a of e){const e=Sr(a);if(!e)continue;const l=Mr(a,n);if(l.length>0){const t=r.get(e)??/* @__PURE__ */new Set;for(const e of l)t.add(e);r.set(e,t)}if(a.id in t)for(const t of l){const n=o.get(e)??/* @__PURE__ */new Map;n.has(t)||n.set(t,a.id),o.set(e,n)}}const l=e=>{const t=e?o.get(e):void 0;return t?new Set(t.keys()):Lr};return{isCapped:e=>{const t=Sr(e);if(!t)return!1;const r=o.get(t);return!!r&&Mr(e,n).some(t=>{const n=r.get(t);return void 0!==n&&n!==e.id})},filledFor:l,slotsFor:e=>{const t=e?r.get(e):void 0;if(!t)return[];const n=l(e);return wr.filter(e=>t.has(e)).map(e=>({family:e,label:kr[e],filled:n.has(e)}))}}}function Pr(e,t,n){const o=[],r=/* @__PURE__ */new Map;for(const l of e){if(o.length>=t)break;const e=Sr(l),a=e?Mr(l,n):[];if(e&&a.length>0){const t=r.get(e)??/* @__PURE__ */new Set;if(a.some(e=>t.has(e)))continue;for(const e of a)t.add(e);r.set(e,t)}o.push(l)}return o}var Tr=class{constructor(e){this.inflight=/* @__PURE__ */new Map,this.cache=/* @__PURE__ */new Map,this.apiUrl=e.apiUrl,this.apiKey=e.apiKey,this.fetchImpl=e.fetchImpl??fetch.bind(globalThis),this.getAuthHeaders=e.getAuthHeaders}invalidateCache(){this.cache.clear()}invalidate(){this.invalidateCache()}async request(e,t,n){const o=`${this.apiUrl}${e}`,r=(t?.method??"GET").toUpperCase(),l="GET"===r,a=l,i=!l&&!n?.idempotent,s=`${r} ${o}`;if(a){const e=this.cache.get(s);if(e&&Date.now()-e.at<5e3)return e.value;const t=this.inflight.get(s);if(t)return t}const c=a?this.cache.get(s):void 0,d=(async()=>{let e;try{const n=this.getAuthHeaders?await this.getAuthHeaders():void 0;e=await this.fetchImpl(o,{...t,headers:{"Content-Type":"application/json",...this.apiKey?{"X-API-Key":this.apiKey}:{},...n??{},...c?.etag?{"If-None-Match":c.etag}:{},...t?.headers}})}catch(r){throw r}if(304===e.status&&c)return a&&this.cache.set(s,{at:Date.now(),value:c.value,etag:c.etag}),c.value;if(!e.ok){let t=`API request failed: ${e.status} ${e.statusText}`;try{const n=await e.json();422===e.status&&n.detail?Array.isArray(n.detail)?t=n.detail.map(e=>`${Array.isArray(e.loc)?e.loc.join("."):"field"}: ${e.msg}`).join("; "):"string"==typeof n.detail?t=n.detail:"object"==typeof n.detail&&(t=JSON.stringify(n.detail)):n.message?t=n.message:n.error&&(t=n.error)}catch{}throw new Error(t)}const n=await e.json();if(a){const t=e.headers.get("ETag")??void 0;this.cache.set(s,{at:Date.now(),value:n,etag:t})}return n})();return a?(this.inflight.set(s,d),d.catch(()=>{}).finally(()=>{this.inflight.delete(s)})):i&&d.finally(()=>this.invalidateCache()).catch(()=>{}),d}async getGames(e){const t=new URLSearchParams;e?.category&&t.append("category",e.category),e?.jurisdiction&&t.append("jurisdiction",e.jurisdiction),e?.sport&&t.append("sport",e.sport);const n=t.toString(),o=n?`/games?${n}`:"/games",r=await this.request(o);return{games:r.payload||[],howToPlayMarkdown:r.how_to_play_markdown??null}}async getGame(e){return(await this.request(`/games/${e}`)).payload}async getPropositions(e){const t=new URLSearchParams;e?.event_id&&t.append("event_id",e.event_id),e?.sport&&t.append("sport",e.sport),e?.category&&t.append("category",e.category);const n=t.toString(),o=n?`/propositions?${n}`:"/propositions";return(await this.request(o)).payload||[]}async getSports(){return(await this.request("/propositions/sports")).sports||[]}async getPropositionsByIds(e){if(0===e.length)return[];const t=new URLSearchParams({ids:e.join(","),include_expired:"true"});return(await this.request(`/propositions?${t.toString()}`)).payload||[]}async getProposition(e){const t=(await this.request(`/propositions/${e}?include_expired=true`)).payload;return Array.isArray(t)?t.find(t=>t.id===e)??t[0]:t}async getGameEntries(e){const t=new URLSearchParams;null!=e?.user_id&&t.append("user_id",String(e.user_id)),null!=e?.pending&&t.append("pending",String(e.pending));const n=t.toString(),o=n?`/game-entries?${n}`:"/game-entries";return((await this.request(o)).payload||[]).map(e=>{const t={...e};return!t.created_at&&t.entry_date&&(t.created_at=t.entry_date),null!=t.stake&&null==t.bet_amount&&(t.bet_amount=Number(t.stake)),(!t.proposition_ids||0===t.proposition_ids.length)&&t.propositions&&t.propositions.length>0&&(t.proposition_ids=t.propositions.map(e=>e.id)),t})}async createGameEntry(e){const t=e.proposition_ids.map(t=>({proposition_id:t,user_prediction:e.selections?.[t]??"yes"})),n={game_id:e.game_id,user_id:e.user_id,propositions:t};null!=e.stake&&(n.stake=e.stake),null!=e.rule_id&&(n.rule_id=e.rule_id);const o=(await this.request("/game-entries",{method:"POST",body:JSON.stringify(n)})).payload;return null!=o.stake&&null==o.bet_amount&&(o.bet_amount=Number(o.stake)),o}async getPayoutsDue(e){const t=new URLSearchParams;null!=e?.game_id&&t.set("game_id",String(e.game_id)),null!=e?.limit&&t.set("limit",String(e.limit)),null!=e?.offset&&t.set("offset",String(e.offset));const n=t.toString();return await this.request(n?`/game-entries/payouts/due?${n}`:"/game-entries/payouts/due")}async getEntryPayout(e){return(await this.request(`/game-entries/${e}/payout`)).payload}async markEntryPaidOut(e){const t=await this.request(`/game-entries/${e}/payout/mark-paid-out`,{method:"POST",body:JSON.stringify({})});return this.invalidate(),t.payload}async updateGameEntryResult(e,t){return(await this.request(`/game-entries/${e}/result`,{method:"POST",body:JSON.stringify(t)})).payload}async getGameMaxPayout(e,t){const n=null!=t?`?bet_amount=${encodeURIComponent(String(t))}`:"";return(await this.request(`/games/${e}/max-payout${n}`)).payload}async getGamesMaxPayouts(e,t){if(0===e.length)return{};const n=new URLSearchParams({ids:e.join(",")});null!=t&&n.set("bet_amount",String(t));const o=await this.request(`/games/max-payouts?${n.toString()}`),r={};for(const[l,a]of Object.entries(o.payload||{}))r[Number(l)]=a;return r}async getEntryPreview(e,t){return(await this.request(`/games/${e}/preview`,{method:"POST",body:JSON.stringify(t)},{idempotent:!0})).payload}async evaluateRule(e,t){return(await this.request(`/games/${e}/evaluate-rule`,{method:"POST",body:JSON.stringify(t)},{idempotent:!0})).payload}async calculatePayout(e,t){return(await this.request(`/games/${e}/calculate-payout`,{method:"POST",body:JSON.stringify(t)},{idempotent:!0})).payload}};function Dr(e,t,n){const[r,a]=c([]),[i,d]=c(null),[u,m]=c(!n?.skip),[p,h]=c(null),f=t?`${t.category||""}_${t.jurisdiction||""}_${t.sport||""}`:"",x=s(t);x.current=t;const g=n?.skip??!1,y=o(async()=>{if(!g)try{m(!0),h(null);const t=await e.getGames(x.current);a(t.games),d(t.howToPlayMarkdown)}catch(t){h(t instanceof Error?t.message:"Failed to fetch games")}finally{m(!1)}},[e,f,g]);return l(()=>{y()},[y]),{games:r,howToPlayMarkdown:i,loading:u,error:p,refetch:o(async()=>{e.invalidate(),await y()},[e,y])}}function Or(e,t,n){const[r,a]=c([]),[i,d]=c(!n?.skip),[u,m]=c(null),p=n?.skip??!1,h=t?`${t.event_id||""}_${t.sport||""}_${t.category||""}`:"",f=s(t);f.current=t;const x=o(async()=>{if(!p)try{d(!0),m(null);const t=await e.getPropositions(f.current);a(t)}catch(t){m(t instanceof Error?t.message:"Failed to fetch propositions")}finally{d(!1)}},[e,h,p]);return l(()=>{x()},[x]),{propositions:r,loading:i,error:u,refetch:o(async()=>{e.invalidate(),await x()},[e,x])}}function Er(e,t){const[n,r]=c([]),[a,i]=c(!t?.skip),[s,d]=c(null),u=t?.skip??!1,m=o(async()=>{if(!u)try{i(!0),d(null),r(await e.getSports())}catch(t){d(t instanceof Error?t.message:"Failed to fetch sports")}finally{i(!1)}},[e,u]);return l(()=>{m()},[m]),{sports:n,loading:a,error:s,refetch:o(async()=>{e.invalidate(),await m()},[e,m])}}function jr(e,t,n){const[r,a]=c([]),[i,d]=c(!n?.skip),[u,m]=c(null),p=n?.skip??!1,h=t?`${t.user_id??""}_${t.pending??""}`:"",f=s(t);f.current=t;const x=o(async()=>{if(!p)try{d(!0),m(null);const t=await e.getGameEntries(f.current);a(t)}catch(t){m(t instanceof Error?t.message:"Failed to fetch entries")}finally{d(!1)}},[e,h,p]);return l(()=>{x()},[x]),{entries:r,loading:i,error:u,refetch:o(async()=>{e.invalidate(),await x()},[e,x])}}function Yr(e,t,n){const[r,a]=c({}),[i,d]=c(!1),u=n?.skip??!1,m=n?.betAmount,p=s(/* @__PURE__ */new Set);return l(()=>{if(u||0===t.length)return;const n=t.filter(e=>!(e.id in r)&&!p.current.has(e.id));if(0===n.length)return;for(const e of n)p.current.add(e.id);let o=!1;return d(!0),(async()=>{try{const t=await e.getGamesMaxPayouts(n.map(e=>e.id),m);o||a(e=>({...e,...t}))}catch{}finally{o||d(!1)}})(),()=>{o=!0}},[e,t.map(e=>e.id).join(","),u,m]),{maxPayouts:r,loading:i,refetchGame:o(async(t,n)=>{if(!u)try{const o=await e.getGamesMaxPayouts([t],n??m);o[t]&&a(e=>({...e,[t]:o[t]}))}catch{}},[e,u,m])}}function Hr(e){const[t,n]=c(!1),[r,l]=c(null),[a,i]=c(null);return{createEntry:async t=>{try{n(!0),l(null),await function(e=15e3){return"undefined"==typeof navigator||!1!==navigator.onLine||"undefined"==typeof window||"function"!=typeof window.addEventListener?Promise.resolve():new Promise(t=>{const n=()=>{window.removeEventListener("online",n),clearTimeout(o),t()},o=setTimeout(n,e);window.addEventListener("online",n)})}();const o=await e.createGameEntry(t);return i(o),o}catch(o){const e=o instanceof Error?o.message:"Failed to create entry";throw l(e),new Error(e)}finally{n(!1)}},loading:t,error:r,entry:a,clearSubmitError:o(()=>l(null),[])}}function Rr(e){const[t,n]=c(e?"sport":"game"),[o,r]=c(null),[l,a]=c({}),[i,s]=c(null);return{step:t,selectedGame:o,selections:l,placedEntry:i,setGameOnly:e=>{r(e)},clearSelectedGame:()=>{r(null),a({})},goToSportSelection:e=>{e&&r(e),n("sport")},goToConfirmation:()=>{n("confirm")},goToSuccess:e=>{s(e),n("success")},goBack:()=>{"confirm"===t?n("sport"):"sport"===t&&(n("game"),r(null),a({}))},reset:()=>{n("game"),r(null),a({}),s(null)},toggleSelection:(e,t)=>{a(n=>{const o={...n};return o[e]===t?delete o[e]:o[e]=t,o})}}}function Gr(e){const[t,n]=c(!1),[r,l]=c(null),[a,i]=c(null);return{evaluate:o(async(t,o)=>{try{n(!0),l(null);const r=await e.evaluateRule(t,o);return i(r),r}catch(r){const e=r instanceof Error?r.message:"Failed to evaluate rule";throw l(e),new Error(e)}finally{n(!1)}},[e]),loading:t,error:r,result:a}}function Wr(e){const[t,n]=c(!1),[r,l]=c(null),[a,i]=c(null);return{calculate:o(async(t,o)=>{try{n(!0),l(null);const r=await e.calculatePayout(t,o);return i(r),r}catch(r){const e=r instanceof Error?r.message:"Failed to calculate payout";throw l(e),new Error(e)}finally{n(!1)}},[e]),loading:t,error:r,result:a}}function Ir(e){const[t,n]=c(!1),[r,l]=c(null),[a,i]=c(null);return{preview:o(async(t,o)=>{try{n(!0),l(null);const r=await e.getEntryPreview(t,o);return i(r),r}catch(r){const e=r instanceof Error?r.message:"Failed to preview entry";throw l(e),new Error(e)}finally{n(!1)}},[e]),loading:t,error:r,result:a}}var Ur=t(null),$r={};function Kr(){const e=r(Ur);if(!e)throw new Error("usePlaceEntry must be used within a <PlaceEntryProvider>");return e}function Zr({apiUrl:t,apiKey:n,fetchImpl:r,getAuthHeaders:a,userId:d,getUserBalance:m,children:p,theme:h,colorScheme:f,demoGames:x,demoPropositions:g,demoEntries:y,demoMaxPayouts:b,gameCategory:w,jurisdiction:k,initialGameId:v,filterSport:N,initialSport:C,initialEventId:F,initialEventLabel:B,sportBaseKey:A,disableQuickPick:M=!1,renderTeamLogo:S,renderPropositionSilk:L,selectionVariant:z,disableEventSwipe:P,enableSportFavourites:T,onEntryPlaced:D,onBeforeSubmit:O,onCancel:E,onShare:j,onRecharge:Y,onClearEventFilter:H,screenSize:R="desktop",howToPlayMarkdown:G,sportDisplayNames:W,categoryDisplayNames:I}){const U=ge(h,f),$=ye(U),K=be(U),Z=!(!x||!g),q=i(()=>new Tr({apiUrl:t,apiKey:n,fetchImpl:r,getAuthHeaders:a}),[t,n,r,a]),[V,X]=c(0),Q=s(0),[J,_]=c(0),[ee,te]=c([]),[ne,oe]=c({}),[re,le]=c({}),[ae,ie]=c(void 0),[se,ce]=c(null),[de,ue]=c(void 0),me=e.useCallback(async()=>{if(m)try{const e=await m();"number"==typeof e&&Number.isFinite(e)&&ue(e)}catch(e){}},[m]);l(()=>{m?me():ue(void 0)},[m,me]);const pe=s(null),he=s(null),[fe,xe]=c(null),[we,ke]=c(C??null),[ve,Ne]=c(F??null);l(()=>{C&&ke(C)},[C]),l(()=>{Ne(F??null)},[F]);const[Ce,Fe]=c(F),Be=s(!1);l(()=>{if(!F)return Fe(void 0),void(Be.current=!1);Be.current||Fe(F)},[F]);const Ae=w??fe??void 0,Me=jt(we??N??C??void 0,A),Se=jt(N,A)??N,Le=we??void 0,{games:ze,howToPlayMarkdown:Pe,loading:Te,error:De}=Dr(q,{category:Ae,jurisdiction:k,sport:Me},{skip:Z}),{propositions:Oe,loading:Ee,error:je}=Or(q,{category:Ae,sport:Se,event_id:Ce},{skip:Z}),{sports:Ye,loading:He}=Er(q,{skip:Z}),{createEntry:Re,loading:Ge,error:We,clearSubmitError:Ie}=Hr(q),{preview:Ue}=Ir(q),$e=i(()=>$t((Z?x:ze)??[],{category:Ae,sport:Me??Le,sportBaseKey:A}),[Z,x,ze,Ae,Me,Le,A]),Ke=G??Pe??null,{maxPayouts:Ze,refetchGame:qe}=Yr(q,$e??[],{skip:Z,betAmount:20}),Ve=Z?b??$r:Ze,Xe=Z?g:Oe,Qe=N?(Xe??[]).filter(e=>e.sport===N):Xe,Je=i(()=>Mt(Qe??[]),[Qe]),_e=i(()=>Ae||(1===Je.length?Je[0]:void 0),[Ae,Je]),et=i(()=>{const e=Qe??[];return _e?Gt(e,{category:_e,sportBaseKey:A}):e},[Qe,_e,A]),tt=i(()=>Le?Gt(et,{sport:Le,sportBaseKey:A}):et,[et,Le,A]),nt=i(()=>({category:_e,sport:Le,sportBaseKey:A}),[_e,Le,A]),ot=i(()=>{const e=($e??[]).filter(e=>e.active);if(!_e&&Je.length>1)return[];const t=_e?$t(e,nt):e;return _e||Le?function(e,t,n){return n?.category||n?.sport?e.filter(e=>Ut(e,t,n)):e}(t,tt,nt):t},[$e,tt,nt,_e,Le,Je.length]),{step:rt,selectedGame:lt,selections:at,placedEntry:ct,setGameOnly:dt,clearSelectedGame:ut,goToSportSelection:mt,goToConfirmation:pt,goToSuccess:ht,goBack:ft,reset:xt,toggleSelection:gt}=Rr(v),yt=e.useCallback(()=>{Be.current=!0,Fe(void 0),xt(),H?.()},[xt,H]),bt=!!Ce,wt=bt?B:void 0,kt=!Z&&(Te||Ee||!!lt&&He),vt=Z?null:lt?De||je:De,Ct=i(()=>lt?Zt(tt,lt,A):tt,[lt,tt,A]),Bt=i(()=>{const e=lt?Zt(et,lt,A):et,t=lt?.allowed_sports,n=/* @__PURE__ */new Map;for(const o of e){const r=Nt(o,e);"Other"!==r&&(t?.length&&!t.includes(r)||n.set(r,(n.get(r)??0)+1))}return Array.from(n.entries()).sort((e,t)=>t[1]-e[1]).map(([e,t])=>({key:e,count:t}))},[lt,et,A]),At=i(()=>Bt.map(e=>e.key),[Bt]),St=i(()=>lt?Ct:et,[lt,Ct,et]),Pt=i(()=>Gt(lt?Ct:et,{category:_e}),[lt,Ct,et,_e]),Tt=i(()=>{const e=new Set(At);return Ye.filter(t=>e.has(t.key))},[Ye,At]),Dt=i(()=>Gt(Ct,{category:_e,sport:we}),[Ct,_e,we]),Ht=i(()=>{if(!lt||!Fn(lt))return[];const{min:e}=zt(lt,ae),t=ae??e;return An(Dt).filter(e=>e.propositionCount>=t)},[lt,ae,Dt]),Rt=i(()=>Fn(lt)?Pn(Dt,ve):Dt,[lt,Dt,ve]),It=function(e,t){const[n,o]=c([]),r=s(/* @__PURE__ */new Set),a=i(()=>{const e=/* @__PURE__ */new Map;for(const n of t)e.set(n.id,n);for(const t of n)e.set(t.id,t);return e},[t,n]),d=i(()=>e?function(e){const t=/* @__PURE__ */new Set;for(const n of e)if(it(n))for(const e of st(n))t.add(e);return[...t]}(t).filter(e=>!a.has(e)):[],[e,t,a]);return l(()=>{if(!e||0===d.length)return;const t=d.filter(e=>!r.current.has(e));if(0===t.length)return;for(const e of t)r.current.add(e);let n=!1;return e.getPropositionsByIds(t).then(e=>{!n&&e.length>0&&o(t=>[...t,...e])}).catch(()=>{}),()=>{n=!0}},[e,d]),a}(Z?null:q,i(()=>[...Qe??[],...Rt],[Qe,Rt])),Kt=i(()=>zr(Ct,at,It),[Ct,at,It]),qt=o((e,t)=>{if(!(e in at)){const t=Ct.find(t=>t.id===e);if(t&&Kt.isCapped(t))return}gt(e,t)},[at,Ct,Kt,gt]),Vt=Object.keys(at).map(Number),Xt=Vt.length,Qt=i(()=>Dt.filter(e=>Vt.includes(e.id)),[Dt,Vt]);l(()=>{w||fe||1===Je.length&&xe(Je[0])},[w,fe,Je]),l(()=>{if(!lt)return;const e=Ct,t=new Set(e.map(Ft));let n=fe;n&&t.has(n)||(n=1===t.size?Array.from(t)[0]:null,n!==fe&&xe(n));const o=n?e.filter(e=>Ft(e)===n):e,r=new Set(function(e){const t=/* @__PURE__ */new Set;for(const n of e){const o=Nt(n,e);"Other"!==o&&t.add(o)}return[...t]}(o)),l=lt.allowed_sports;ke(e=>e&&r.has(e)&&(!l?.length||l.includes(e))?e:1===l?.length&&r.has(l[0])?l[0]:1===r.size?Array.from(r)[0]:(()=>{const e=/* @__PURE__ */new Map;for(const r of o){const t=Nt(r,o);"Other"!==t&&(l?.length&&!l.includes(t)||e.set(t,(e.get(t)??0)+1))}let t=null,n=0;for(const[o,r]of e)r>n&&(t=o,n=r);return t})())},[lt?.id,Ct,fe]),l(()=>{Ie()},[lt?.id,rt,Ie]),l(()=>{lt&&_e&&(Wt(lt,_e)||ut())},[lt,_e,ut]),l(()=>{lt&&(Ut(lt,tt,{category:_e,sport:we,sportBaseKey:A})||ut())},[lt,_e,we,A,tt,ut]),l(()=>{if(lt){const e=pe.current,t=he.current!==lt.id;if(he.current=lt.id,null!=e?.stake&&e.stake>0?_(e.stake):t&&_(Math.max(20,lt.min_bet??0)),e){const{count:t}=e;return pe.current=null,ie(t),void X(t)}if(!t)return;if(lt.allowed_propositions&<.allowed_propositions.length>0){const e=ae;null!=e&<.allowed_propositions.includes(e)?X(e):(ie(void 0),X(0))}else ie(void 0),X(lt.num_propositions||lt.max_propositions||0)}},[lt]);const Jt=(e,t,n)=>{const o=($e??[]).find(t=>t.id===e)??(lt?.id===e?lt:null),r=(Ve[e]?.top_payouts??[]).find(e=>e.proposition_count===t),l=r&&r.bet_amount&&r.bet_amount>0?r.bet_amount:20,a=r&&l>0?cr(r.net_payout/l*n,o):0;return a>0?a:sr(o,t,n)};l(()=>{if("sport"!==rt&&"confirm"!==rt||!lt||Z)return;const e=Fn(lt)&&ve?Rt.length:Number.MAX_SAFE_INTEGER;let t;if(lt.allowed_propositions&<.allowed_propositions.length>0){const n=lt.allowed_propositions?[...lt.allowed_propositions].filter(t=>t<=e).sort((e,t)=>e-t):[];if(0===n.length)return void le({});const o=ae??n[0],r=n.filter(e=>e>o);if(0===r.length)return void le({});t=[o,...r]}else{const{min:n,max:o}=zt(lt),r=Math.min(o,e);if(n<=0||r<=n)return void le({});t=Array.from({length:r-n+1},(e,t)=>n+t)}const n={};for(const o of t)n[o]=Jt(lt.id,o,20);le(n)},[rt,lt,ae,ve,Rt.length,Z,Ve]),l(()=>{if("confirm"!==rt||!lt)return;const e=Vt.length;if(0===e)return;let t=!1;const n={};for(let r=0;r<=e;r++)n[r]=Jt(lt.id,r,J);oe(n),e!==Q.current?(Q.current=e,X(e)):(V>e||V<=0&&e>0)&&X(e);const o=J>0?J:Math.max(lt.min_bet??20,.01);return(async()=>{try{const n=await Ue(lt.id,{actual:V,predicted:V,total:e,bet_amount:o,rule_id:se});if(t)return;if(te(n.winning_counts),J>0&&n.payouts){const e={};for(const[t,o]of Object.entries(n.payouts)){const n=Number(t);e[n]=o>0?cr(o,lt):Jt(lt.id,n,J)}oe(e)}}catch{t||te([])}})(),()=>{t=!0}},[rt,lt,Vt.length,V,J,Ue,Ve,se]);const _t=i(()=>{return t=se,(e=lt)&&null!=t?e.permitted_rules?.find(e=>e.id===t)??null:null;var e,t},[lt,se]),en=!Fn(lt)||Tn(Qt,ve),tn=lt?zt(lt,void 0,_t):null,nn=!(!lt||!en)&&(lt.allowed_propositions&<.allowed_propositions.length>0?null!=ae&&Xt===ae&&Lt(Xt,tn?.min,tn?.max):Lt(Xt,tn?.min,tn?.max)),on=lt?.min_bet??0,rn=Math.max(on,.01),ln=null==de||J<=de,an=!Ge&&J>=rn&&nn&&ln,sn=e=>{ie(e),X(e);for(const t of Object.keys(at))gt(Number(t),at[Number(t)])},cn=e=>{ie(e),X(e)},dn=e=>{Ne(Fn(e)?F??null:null),dt(e)},un=e=>{if(e!==ve){for(const e of Object.keys(at)){const t=Number(e);gt(t,at[t])}Ne(e)}},mn=e=>{for(const n of Object.keys(at)){const e=Number(n);gt(e,at[e])}const t=Pr([...Rt].sort(()=>Math.random()-.5),Math.max(0,e),It);for(const n of t)gt(n.id,Math.random()<.5?"yes":"no");return t.length},pn=(e,t,n)=>{const o=e.allowed_sports??[];let r=null;we&&(0===o.length||o.some(e=>Yt(we,e,A)))?r=we:1===o.length&&(r=o[0]);const l=Gt(Zt(Qe??[],e,A),{category:_e,sportBaseKey:A});if(0===l.length)return;const a=e=>{return Pr((n=e?Gt(l,{sport:e,sportBaseKey:A}):l,[...n].sort(()=>Math.random()-.5)),Math.max(0,t),It);var n},i=/* @__PURE__ */new Map;for(const m of l){const e=Nt(m,l);"Other"!==e&&i.set(e,(i.get(e)??0)+1)}const s=[...i.keys()].sort((e,t)=>(i.get(t)??0)-(i.get(e)??0));let c=r??s[0]??null,d=a(c);for(const m of s){if(d.length>=t)break;if(m===c)continue;const e=a(m);e.length>d.length&&(d=e,c=m)}r=c;const u=lt?.id===e.id;pe.current=u?null:{count:t,stake:n},dt(e),qe(e.id),ke(r),u&&(ie(t),X(t),null!=n&&n>0&&_(n));for(const m of Object.keys(at)){const e=Number(m);gt(e,at[e])}for(const m of d)gt(m.id,Math.random()<.5?"yes":"no");pt()},hn=s(!1),fn=async()=>{if(lt&&nn&&!hn.current){if(Z){const e={id:Math.floor(1e4*Math.random()),game_id:lt.id,user_id:d,proposition_ids:Vt,selections:at,pending:!0,expected_correct:V,bet_amount:J};return D?.(e),ht(e),void me()}hn.current=!0;try{O&&await O(J);const e=await Re({game_id:lt.id,user_id:d,proposition_ids:Vt,selections:at,stake:J,rule_id:_t?.id??null});D?.(e),ht(e),me()}catch(e){}finally{hn.current=!1}}},xn=o(e=>W?.[e]??Tt.find(t=>t.key===e)?.label??Ot(e,void 0,A),[W,Tt,A]),gn=o(e=>Et(e,I),[I]),yn=i(()=>({theme:U,bodyFont:$,headingFont:K,games:ot,propositions:Rt,compositeComponentById:It,propositionsForCategoryPicker:St,sportsForSelectedGame:At,sportOptions:Bt,propositionsForSportPicker:Pt,sportSummaries:Tt,loading:kt,error:vt,step:rt,selectedGame:lt,selections:at,placedEntry:ct,selectedPropositionIds:Vt,selectedPropositions:Qt,selectionValid:nn,selectedRuleId:se,setSelectedRuleId:ce,selectedRule:_t,answeredCount:Xt,betAmount:J,setBetAmount:_,expectedCorrect:V,setExpectedCorrect:X,selectedPropositionCount:ae,handlePropositionCountChange:sn,upgradePropositionCount:cn,winningCounts:ee,payouts:ne,overloadPayouts:re,submitting:Ge,submitError:We,canSubmit:an,gamePrice:on,userBalance:de,hasSufficientBalance:ln,refreshUserBalance:me,handleSubmit:fn,selectGame:dn,goToSportSelection:()=>mt(),goToConfirmation:pt,goBack:ft,reset:xt,clearSelectedGame:ut,toggleSelection:qt,quickPickGame:pn,quickPickSelections:mn,selectedCategory:fe,setSelectedCategory:xe,selectedSport:we,setSelectedSport:ke,selectedEventId:ve,sameGameMultiEvents:Ht,selectSameGameMultiEvent:un,apiUrl:t,apiKey:n,fetchImpl:r,getAuthHeaders:a,userId:d,disableQuickPick:M,renderTeamLogo:S,renderPropositionSilk:L,selectionVariant:z,disableEventSwipe:P,enableSportFavourites:T,filterSport:N,initialSport:C,initialEventId:F,sportBaseKey:A,gameCategory:w,eventFilterActive:bt,eventFilterLabel:wt,clearEventFilter:yt,screenSize:R,displaySportName:xn,displayCategoryName:gn,maxPayouts:Ve??{},howToPlayMarkdown:Ke,onEntryPlaced:D,onCancel:E,onShare:j,onRecharge:Y,demoEntries:y,demoGames:x,demoPropositions:g}),[U,$,K,ot,Rt,It,St,Pt,At,Bt,Tt,kt,vt,rt,lt,at,ct,Vt,Qt,nn,Xt,J,V,ae,se,_t,ee,ne,re,Ge,We,an,on,t,n,d,de,r,a,M,S,L,z,P,T,N,C,F,A,w,R,bt,wt,yt,fe,we,ve,Ht,Ve,Ke,D,E,j,Y,H,y,x,g,xn,gn]);/* @__PURE__ */
|
|
97
|
+
return u(Ur.Provider,{value:yn,children:p})}function qr({onPress:t,onDoubleClick:n,label:o="QUICKPICK",size:l="md",yesColor:a,noColor:i,theme:s}){const c=r(Ur),d=s??c?.theme??te,p=E(d),h=d.colors,f=a??I(d),x=i??U(d),g="sm"===l,y=g?p.space.xs:p.space.sm,b=g?6:8,w=g?p.fontSize.sm:p.fontSize.md,k=g?8.5:10,[v,N]=e.useState(!1),[C,F]=e.useState(!1);/* @__PURE__ */
|
|
98
98
|
return m("button",{type:"button",onClick:t,onDoubleClick:n,onMouseDown:()=>N(!0),onMouseUp:()=>N(!1),onMouseLeave:()=>N(!1),onFocus:e=>{e.target.matches(":focus-visible")&&F(!0)},onBlur:()=>F(!1),style:{appearance:"none",display:"inline-flex",flexDirection:"column",width:"100%",minWidth:92,padding:0,margin:0,border:`1px solid ${z(h.border,.6)}`,background:"transparent",borderRadius:p.radius.sm,overflow:"hidden",cursor:"pointer",fontFamily:"inherit",transform:v?"scale(0.985)":"scale(1)",transition:`transform ${p.motion.durationFast}ms ${p.motion.easing}, box-shadow ${p.motion.durationFast}ms ${p.motion.easing}`,boxShadow:C?H(d):"none",outline:"none",minHeight:p.touchTarget.min},children:[/* @__PURE__ */m("span",{style:{position:"relative",display:"flex",flex:1},children:[
|
|
99
99
|
/* @__PURE__ */u("span",{"aria-hidden":!0,style:{position:"absolute",inset:0,background:f,clipPath:"polygon(0 0, 53% 0, 47% 100%, 0 100%)"}}),
|
|
100
100
|
/* @__PURE__ */u("span",{"aria-hidden":!0,style:{position:"absolute",inset:0,background:x,clipPath:"polygon(53% 0, 100% 0, 100% 100%, 47% 100%)"}}),
|
|
101
101
|
/* @__PURE__ */u("span",{style:{position:"relative",flex:1,textAlign:"center",padding:`${b}px ${y}px`,color:"#ffffff",fontSize:w,fontWeight:600,letterSpacing:.2,whiteSpace:"nowrap"},children:"Yes"}),
|
|
102
102
|
/* @__PURE__ */u("span",{style:{position:"relative",flex:1,textAlign:"center",padding:`${b}px ${y}px`,color:"#ffffff",fontSize:w,fontWeight:600,letterSpacing:.2,whiteSpace:"nowrap"},children:"No"}),
|
|
103
|
-
/* @__PURE__ */u("svg",{"aria-hidden":"true",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none"},preserveAspectRatio:"none",children:/* @__PURE__ */u("line",{x1:"53%",y1:"0",x2:"47%",y2:"100%",stroke:"rgba(255,255,255,0.85)",strokeWidth:"1.5"})})]}),/* @__PURE__ */u("span",{style:{background:h.buttonSecondary,color:h.buttonSecondaryText,fontSize:k,letterSpacing:"0.14em",padding:"3px 0 4px",textAlign:"center",fontWeight:700,fontFamily:d.fonts?.mono??"inherit"},children:o})]})}var
|
|
104
|
-
return u("div",{className:"absolute inset-0 flex items-stretch",style:{zIndex:3-n,transform:`translateY(${12*n}px) scale(${1-.04*n})`,transition:"transform 240ms cubic-bezier(0.22, 1, 0.36, 1)",pointerEvents:F?"auto":"none"},"aria-hidden":!F,children:/* @__PURE__ */m("div",{ref:k,className:"relative w-full"+(F?" cursor-grab active:cursor-grabbing":""),style:{touchAction:"pan-y",willChange:"transform",userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none"},onPointerDown:e=>{if(F&&!B.current&&!S.current){j(),E(),S.current={pointerId:e.pointerId,originX:e.clientX,originY:e.clientY,baseX:A.current.x,baseY:A.current.y},M.current={x:0,y:0},L.current=e.timeStamp;try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}D.current?.(!0)}},onPointerMove:e=>{const t=S.current;if(!t||t.pointerId!==e.pointerId||B.current)return;const n=t.baseX+(e.clientX-t.originX),o=Math.min(t.baseY+(e.clientY-t.originY),0),r=e.timeStamp-L.current;if(r>0){const t=1-Math.exp(-r/40);M.current.x+=((n-A.current.x)/r*1e3-M.current.x)*t,M.current.y+=((o-A.current.y)/r*1e3-M.current.y)*t,L.current=e.timeStamp}A.current.x=n,A.current.y=o,O()},onPointerUp:e=>{const t=S.current;if(!t||t.pointerId!==e.pointerId)return;S.current=null,D.current?.(!1);try{e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId)}catch{}if(B.current)return;e.timeStamp-L.current>90&&(M.current={x:0,y:0});const n=A.current,o=M.current;if(
|
|
103
|
+
/* @__PURE__ */u("svg",{"aria-hidden":"true",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none"},preserveAspectRatio:"none",children:/* @__PURE__ */u("line",{x1:"53%",y1:"0",x2:"47%",y2:"100%",stroke:"rgba(255,255,255,0.85)",strokeWidth:"1.5"})})]}),/* @__PURE__ */u("span",{style:{background:h.buttonSecondary,color:h.buttonSecondaryText,fontSize:k,letterSpacing:"0.14em",padding:"3px 0 4px",textAlign:"center",fontWeight:700,fontFamily:d.fonts?.mono??"inherit"},children:o})]})}var Vr=3;function Xr(e,t){const n=new Set(t.map(e=>e.eventId??e.event_id).filter(e=>Boolean(e)));if(0===n.size)return e;const o=[],r=[];for(const l of e){const e=l.eventId??l.event_id;(e&&n.has(e)?r:o).push(l)}return[...o,...r]}function Qr(e,t,n,r){const[a,d]=c([]),[u,m]=c([]),[p,h]=c([]),[f,x]=c([]),[g,y]=c(null),b=i(()=>{const t=/* @__PURE__ */new Map;for(const n of e)t.set(n.id,n);return t},[e]),w=i(()=>e.filter(e=>null!=t[e.id]),[e,t]),k=i(()=>e.map(e=>e.id).join(","),[e]),v=s(null);l(()=>()=>{v.current=null},[]),l(()=>{if(v.current===k)return;v.current=k;const n=e.filter(e=>!(e.id in t)),o=e.filter(e=>null!=t[e.id]);d(n.map(e=>e.id)),m(Xr(n,o).slice(0,3).map(e=>e.id)),h([]),x([]),y(null)},[k,e,t]);const N=i(()=>r?new Set(e.filter(e=>r(e)).map(e=>e.id)):/* @__PURE__ */new Set,[e,r]),C=i(()=>{const e=new Set(p);return[...Xr(a.map(e=>b.get(e)).filter(e=>!!e&&!N.has(e.id)).filter(t=>!e.has(t.id)),w).map(e=>e.id),...p.filter(e=>a.includes(e)&&!N.has(e))]},[a,b,w,p,N]);l(()=>{m(e=>{const t=new Set(a),n=e.filter(e=>t.has(e)&&!N.has(e));if(0===f.length&&!g){const t=C.slice(0,3);return t.length===n.length&&t.every((e,t)=>e===n[t])?n.length===e.length?e:n:t}if(n.length>=Math.min(3,a.length))return n.length===e.length?e:n;const o=[...n];for(const r of C){if(o.length>=3)break;o.includes(r)||o.push(r)}return o})},[a,C,f,g,N]);const F=i(()=>u.map(e=>b.get(e)).filter(e=>Boolean(e)),[u,b]),B=o((e,t)=>{y(null),t&&n(e,t),x(n=>[...n,{id:e,answer:t}]),m(t=>t.filter(t=>t!==e)),h(n=>{const o=n.filter(t=>t!==e);return t?o:[...o,e]}),d(n=>{const o=n.filter(t=>t!==e);return t?o:[...o,e]})},[n]),A=o(()=>{const e=f[f.length-1];e&&(e.answer&&n(e.id,e.answer),y({id:e.id,from:"yes"===e.answer?"right":"no"===e.answer?"left":"up"}),x(e=>e.slice(0,-1)),h(t=>t.filter(t=>t!==e.id)),d(t=>[e.id,...t.filter(t=>t!==e.id)]),m(t=>[e.id,...t.filter(t=>t!==e.id)].slice(0,3)))},[f,n]);return{visible:F,canSkip:a.filter(e=>!N.has(e)).length>1,canUndo:f.length>0,restored:g,resolve:B,undo:A}}var Jr={stiffness:420,damping:34},_r={stiffness:280,damping:28},el="#00C853",tl="#E53935";function nl(e){return"up"===e?{x:0,y:-720}:{x:"right"===e?640:-640,y:70}}function ol(e){return e<0?0:e>1?1:e}function rl(e,t,n){return n&&-t>Math.abs(e)}function ll({prop:e,theme:t,depth:n=0,enterFrom:a,canSkip:i=!1,onResolve:c,registerApi:p,onDragStateChange:h,children:f}){const x=r(Ur),g=t??x?.theme??te,y=be(g),b=g.colors.productYes??el,w=g.colors.productNo??tl,k=s(null),v=s(null),N=s(null),C=s(null),F=0===n,B=s(!1),A=s({x:0,y:0}),M=s({x:0,y:0}),S=s(null),L=s(0),z=s(null),P=s(null),T=s(i);T.current=i;const D=s(h);D.current=h;const O=o(()=>{const e=k.current;if(!e)return;const{x:t,y:n}=A.current,o=Math.max(-16,Math.min(16,t/260*16));e.style.transform=`translate3d(${t}px, ${n}px, 0) rotate(${o}deg)`;const r=(e,t)=>{e&&(e.style.opacity=String(t))},l=rl(t,n,T.current);r(v.current,l?0:ol((t-24)/108)),r(N.current,l?0:ol((-t-24)/108)),r(C.current,l?ol((-n-30)/90):0)},[]),E=o(()=>{for(const e of[k.current,v.current,N.current,C.current])e&&(e.style.transition="none")},[]),j=o(()=>{null!=z.current&&(cancelAnimationFrame(z.current),z.current=null)},[]),Y=o(e=>{j(),E();let t=null;const n=o=>{const r=Math.min(null==t?1/60:(o-t)/1e3,1/30);t=o;const l=A.current,a=M.current;if(a.x+=(-e.stiffness*l.x-e.damping*a.x)*r,a.y+=(-e.stiffness*l.y-e.damping*a.y)*r,l.x+=a.x*r,l.y+=a.y*r,Math.abs(l.x)<.5&&Math.abs(l.y)<.5&&Math.abs(a.x)<2&&Math.abs(a.y)<2)return l.x=0,l.y=0,a.x=0,a.y=0,O(),void(z.current=null);O(),z.current=requestAnimationFrame(n)};z.current=requestAnimationFrame(n)},[E,O,j]),H=o(t=>{if(B.current)return;if("up"===t&&!T.current)return;B.current=!0,j();const n="right"===t?"yes":"left"===t?"no":null,o=nl(t),r=k.current;r&&(r.style.transition="transform 260ms cubic-bezier(0.32, 0, 0.67, 0)");for(const e of[v.current,N.current,C.current])e&&(e.style.transition="opacity 260ms linear");A.current={...o},O(),P.current=setTimeout(()=>c(e.id,n),260)},[c,O,e.id,j]);l(()=>()=>{P.current&&clearTimeout(P.current),null!=z.current&&cancelAnimationFrame(z.current),S.current&&D.current?.(!1)},[]),l(()=>{if(!a)return j(),A.current={x:0,y:0},M.current={x:0,y:0},E(),void O();const e=nl(a);A.current={x:e.x,y:e.y},M.current={x:0,y:0},E(),O(),Y(_r)},[a,E,O,Y,j]),l(()=>{if(F&&p)return p({fly:H}),()=>p(null)},[H,F,p]);const R="pointer-events-none absolute top-5 rounded-xl border-4 px-3 py-1 text-2xl font-extrabold uppercase tracking-widest";/* @__PURE__ */
|
|
104
|
+
return u("div",{className:"absolute inset-0 flex items-stretch",style:{zIndex:3-n,transform:`translateY(${12*n}px) scale(${1-.04*n})`,transition:"transform 240ms cubic-bezier(0.22, 1, 0.36, 1)",pointerEvents:F?"auto":"none"},"aria-hidden":!F,children:/* @__PURE__ */m("div",{ref:k,className:"relative w-full"+(F?" cursor-grab active:cursor-grabbing":""),style:{touchAction:"pan-y",willChange:"transform",userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none"},onPointerDown:e=>{if(F&&!B.current&&!S.current){j(),E(),S.current={pointerId:e.pointerId,originX:e.clientX,originY:e.clientY,baseX:A.current.x,baseY:A.current.y},M.current={x:0,y:0},L.current=e.timeStamp;try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}D.current?.(!0)}},onPointerMove:e=>{const t=S.current;if(!t||t.pointerId!==e.pointerId||B.current)return;const n=t.baseX+(e.clientX-t.originX),o=Math.min(t.baseY+(e.clientY-t.originY),0),r=e.timeStamp-L.current;if(r>0){const t=1-Math.exp(-r/40);M.current.x+=((n-A.current.x)/r*1e3-M.current.x)*t,M.current.y+=((o-A.current.y)/r*1e3-M.current.y)*t,L.current=e.timeStamp}A.current.x=n,A.current.y=o,O()},onPointerUp:e=>{const t=S.current;if(!t||t.pointerId!==e.pointerId)return;S.current=null,D.current?.(!1);try{e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId)}catch{}if(B.current)return;e.timeStamp-L.current>90&&(M.current={x:0,y:0});const n=A.current,o=M.current;if(rl(n.x,n.y,T.current)){if(n.y<-110||o.y<-620)return H("up")}else{if(n.x>110||o.x>620)return H("right");if(n.x<-110||o.x<-620)return H("left")}Y(Jr)},onPointerCancel:e=>{const t=S.current;t&&t.pointerId===e.pointerId&&(S.current=null,M.current={x:0,y:0},D.current?.(!1),B.current||Y(Jr))},onDragStart:e=>e.preventDefault(),children:[f,F&&/* @__PURE__ */m(d,{children:[
|
|
105
105
|
/* @__PURE__ */u("div",{ref:v,className:`${R} left-5`,style:{opacity:0,transform:"rotate(-12deg)",color:b,borderColor:b,fontFamily:y},children:"Yes"}),
|
|
106
|
-
/* @__PURE__ */u("div",{ref:N,className:`${R} right-5`,style:{opacity:0,transform:"rotate(12deg)",color:w,borderColor:w,fontFamily:y},children:"No"}),i&&/* @__PURE__ */u("div",{ref:C,className:"pointer-events-none absolute inset-x-0 bottom-6 flex justify-center",style:{opacity:0},children:/* @__PURE__ */u("span",{className:"rounded-full px-3 py-1 text-xs font-semibold uppercase tracking-widest",style:{color:g.colors.primary,border:`1px solid ${g.colors.border}`,background:g.colors.background},children:"Skip"})})]})]})})}function
|
|
106
|
+
/* @__PURE__ */u("div",{ref:N,className:`${R} right-5`,style:{opacity:0,transform:"rotate(12deg)",color:w,borderColor:w,fontFamily:y},children:"No"}),i&&/* @__PURE__ */u("div",{ref:C,className:"pointer-events-none absolute inset-x-0 bottom-6 flex justify-center",style:{opacity:0},children:/* @__PURE__ */u("span",{className:"rounded-full px-3 py-1 text-xs font-semibold uppercase tracking-widest",style:{color:g.colors.primary,border:`1px solid ${g.colors.border}`,background:g.colors.background},children:"Skip"})})]})]})})}function al({prop:e}){const{theme:t,renderTeamLogo:n,renderPropositionSilk:o,displaySportName:r,gameCategory:l,compositeComponentById:a}=Kr(),i=t.colors,s=be(t),c=dt(e,a),d=rt(e),p=("racing"===l?[e.away_team?.trim()||e.home_team?.trim()]:[e.home_team?.trim(),e.away_team?.trim()]).filter(Boolean),h=(t,r)=>t&&o?.(t,r)||wl(t??e,n,p.join(" vs "))||null;/* @__PURE__ */
|
|
107
107
|
return m("div",{className:"flex h-full w-full flex-col overflow-hidden rounded-3xl border",style:{backgroundColor:V(t),borderColor:i.border,boxShadow:"0 18px 40px -24px rgba(10,20,22,0.45)"},children:[
|
|
108
108
|
/* @__PURE__ */u("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 px-5 py-3",style:{backgroundColor:X(t)},children:p.length>0?p.map((e,o)=>/* @__PURE__ */m("span",{className:"inline-flex items-center gap-1.5 text-sm font-semibold",style:{color:Z(t)},children:[o>0&&/* @__PURE__ */u("span",{className:"mr-1 text-xs font-normal",style:{color:q(t)},children:"vs"}),n?.(e),e]},`${e}-${o}`)):/* @__PURE__ */u("span",{className:"text-sm font-semibold",style:{color:Z(t)},children:e.league??r(e.sport??"")})}),
|
|
109
109
|
/* @__PURE__ */m("div",{className:"flex flex-1 flex-col justify-center gap-3 px-5 py-3 sm:gap-4 sm:py-6",children:[/* @__PURE__ */m("div",{className:"flex min-w-0 items-start gap-2",children:[!c&&h(e,32),c?/* @__PURE__ */m("div",{className:"flex min-w-0 flex-1 flex-col gap-3",children:[/* @__PURE__ */m("span",{className:"text-xs font-bold uppercase tracking-widest",style:{color:G(t)},children:["All ","OR"===c.operator?"or any of these":"of these"]}),/* @__PURE__ */u("ul",{className:"flex flex-col gap-2",children:c.legs.map((e,n)=>/* @__PURE__ */m("li",{className:"flex items-start gap-2",children:[
|
|
110
110
|
/* @__PURE__ */u("span",{"aria-hidden":!0,className:"text-base font-bold leading-snug",style:{color:i.primary},children:"OR"===c.operator?"/":"+"}),h(e.prop,24),
|
|
111
111
|
/* @__PURE__ */m("span",{className:"flex min-w-0 flex-col",children:[e.eventLabel&&/* @__PURE__ */u("span",{className:"text-[10px] font-semibold uppercase tracking-wide leading-tight",style:{color:i.textMuted},children:e.eventLabel}),/* @__PURE__ */u("span",{className:"text-base font-bold leading-snug",style:{color:W(t),fontFamily:s},children:e.text})]})]},n))})]}):/* @__PURE__ */u("p",{className:"min-w-0 flex-1 text-xl font-extrabold leading-snug tracking-tight sm:text-2xl",style:{color:W(t),fontFamily:s},children:e.description??e.proposition})]}),e.outcome_description&&e.outcome_description!==e.description&&/* @__PURE__ */u("p",{className:"text-sm leading-snug",style:{color:i.textMuted},children:e.outcome_description})]}),
|
|
112
|
-
/* @__PURE__ */m("div",{className:"flex flex-wrap items-center gap-2 border-t px-5 py-3 text-[11px]",style:{borderColor:i.borderSubtle??i.border,color:i.textMuted},children:[e.sport&&/* @__PURE__ */u("span",{className:"rounded-full px-2 py-0.5 font-semibold uppercase tracking-wide",style:{backgroundColor:i.infoBg,color:i.infoText},children:r(e.sport)}),d&&/* @__PURE__ */u("span",{className:"uppercase tracking-wide",children:d.replace(/[_-]+/g," ")}),e.commence_time&&/* @__PURE__ */u("span",{className:"ml-auto",children:kt(e.commence_time)})]})]})}function
|
|
113
|
-
return m("div",{className:`flex w-full flex-col ${a}`,style:{fontFamily:A},children:[n&&/* @__PURE__ */u("div",{className:"flex shrink-0 justify-end pb-3",children:n}),v?/* @__PURE__ */u("p",{className:"py-10 text-center text-sm",style:{color:B.textMuted},children:"Loading…"}):N?/* @__PURE__ */u("div",{className:"rounded-xl p-4 text-center",style:{background:B.errorBg,border:`1px solid ${B.error}`},children:/* @__PURE__ */u("p",{className:"text-sm",style:{color:B.errorText??B.error},children:N})}):/* @__PURE__ */m(d,{children:[/* @__PURE__ */u("div",{className:"flex min-h-0 flex-1 flex-col justify-center pb-3 pt-2 sm:pb-8 sm:pt-3",children:K?/* @__PURE__ */u("div",{className:"relative mx-auto w-full",style:{height:"clamp(14rem, 44dvh, 26rem)",maxWidth:384},children:D.map((e,t)=>/* @__PURE__ */u(
|
|
112
|
+
/* @__PURE__ */m("div",{className:"flex flex-wrap items-center gap-2 border-t px-5 py-3 text-[11px]",style:{borderColor:i.borderSubtle??i.border,color:i.textMuted},children:[e.sport&&/* @__PURE__ */u("span",{className:"rounded-full px-2 py-0.5 font-semibold uppercase tracking-wide",style:{backgroundColor:i.infoBg,color:i.infoText},children:r(e.sport)}),d&&/* @__PURE__ */u("span",{className:"uppercase tracking-wide",children:d.replace(/[_-]+/g," ")}),e.commence_time&&/* @__PURE__ */u("span",{className:"ml-auto",children:kt(e.commence_time)})]})]})}function il({onBack:e,onNext:t,viewSwitch:n,onDragStateChange:r,className:a=""}){const{theme:c,propositions:p,selections:h,toggleSelection:f,selectedGame:x,selectedPropositionCount:g,answeredCount:y,selectionValid:b,goToConfirmation:w,goToSportSelection:k,loading:v,error:N,selectedRule:C,compositeComponentById:F}=Kr(),B=c.colors,A=ye(c),M=be(c),S=B.productYes??el,L=B.productNo??tl,z=s(null);l(()=>{x||(k(),e?.())},[k,e,x]);const P=i(()=>zr(p,h,F),[p,h,F]),T=o(e=>P.isCapped(e),[P]),{visible:D,canSkip:O,canUndo:E,restored:j,resolve:Y,undo:H}=Qr(p,h,f,T),G=x?zt(x,g??void 0,C):{min:0,max:0},W=G.max,I=W>0&&y>=W,U=x?G.min>0&&G.min===G.max?G.min:rr(x,g)??(W>0?W:null):null,$=s(y);l(()=>{const e=$.current;if($.current=y,null==U||e>=U||y!==U)return;const n=setTimeout(()=>{w(),t?.()},420);return()=>clearTimeout(n)},[y,w,t,U]);const K=!I&&D.length>0;l(()=>{if(!K)return;const e=e=>{const t=e.target;if(!t||!/^(INPUT|TEXTAREA|SELECT)$/.test(t.tagName)){switch(e.key){case"ArrowRight":z.current?.fly("right");break;case"ArrowLeft":z.current?.fly("left");break;case"ArrowUp":z.current?.fly("up");break;case"ArrowDown":case"Backspace":H();break;default:return}e.preventDefault()}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[K,H]);const Z=o(e=>{z.current=e},[]);if(!x)return null;const q=(e,t,n,o)=>/* @__PURE__ */u("button",{type:"button",onClick:n,disabled:o,"aria-label":e,className:"flex h-11 w-11 items-center justify-center rounded-full border text-lg transition-transform active:scale-95 disabled:opacity-35",style:{borderColor:B.border,color:B.textMuted,background:B.background},children:/* @__PURE__ */u("span",{"aria-hidden":!0,children:t})});/* @__PURE__ */
|
|
113
|
+
return m("div",{className:`flex w-full flex-col ${a}`,style:{fontFamily:A},children:[n&&/* @__PURE__ */u("div",{className:"flex shrink-0 justify-end pb-3",children:n}),v?/* @__PURE__ */u("p",{className:"py-10 text-center text-sm",style:{color:B.textMuted},children:"Loading…"}):N?/* @__PURE__ */u("div",{className:"rounded-xl p-4 text-center",style:{background:B.errorBg,border:`1px solid ${B.error}`},children:/* @__PURE__ */u("p",{className:"text-sm",style:{color:B.errorText??B.error},children:N})}):/* @__PURE__ */m(d,{children:[/* @__PURE__ */u("div",{className:"flex min-h-0 flex-1 flex-col justify-center pb-3 pt-2 sm:pb-8 sm:pt-3",children:K?/* @__PURE__ */u("div",{className:"relative mx-auto w-full",style:{height:"clamp(14rem, 44dvh, 26rem)",maxWidth:384},children:D.map((e,t)=>/* @__PURE__ */u(ll,{prop:e,depth:t,canSkip:O,enterFrom:j?.id===e.id?j.from:null,onResolve:Y,registerApi:0===t?Z:void 0,onDragStateChange:0===t?r:void 0,children:/* @__PURE__ */u(al,{prop:e})},e.id))}):/* @__PURE__ */m("div",{className:"mx-auto flex w-full max-w-sm flex-col items-center gap-3 rounded-3xl px-6 py-10 text-center",style:{background:V(c),border:`1px dashed ${B.border}`},children:[
|
|
114
114
|
/* @__PURE__ */u("p",{className:"text-base font-extrabold",style:{color:R(c),fontFamily:M},children:I?"Card full":"That’s the last one"}),
|
|
115
115
|
/* @__PURE__ */u("p",{className:"text-sm",style:{color:B.textMuted},children:I?`You've picked all ${W} legs for ${x.game_name}. Undo a swipe to change one, or lock it in.`:b?"You've been through every proposition. Lock your card in, or undo to revisit a pick.":`No propositions left to answer${G.min>0?` — this game needs at least ${G.min}`:""}. Undo a swipe or head back to widen the pool.`}),E&&/* @__PURE__ */u("button",{type:"button",onClick:H,className:"rounded-full border px-5 py-2 text-sm font-semibold",style:{borderColor:B.border,color:B.text},children:"Undo last swipe"})]})}),/* @__PURE__ */m("div",{className:"shrink-0 rounded-2xl border px-3 pb-2.5 pt-3",style:{backgroundColor:V(c),borderColor:B.border},children:[/* @__PURE__ */m("div",{className:"mx-auto flex max-w-sm items-center justify-center gap-3",children:[q("Undo last swipe","↺",H,!E),
|
|
116
116
|
/* @__PURE__ */u("button",{type:"button",onClick:()=>z.current?.fly("left"),disabled:!K,className:"flex h-14 flex-1 items-center justify-center rounded-full text-lg font-extrabold uppercase tracking-wider text-white transition-transform active:scale-95 disabled:opacity-35",style:{backgroundColor:L,fontFamily:M},children:"No"}),
|
|
117
|
-
/* @__PURE__ */u("button",{type:"button",onClick:()=>z.current?.fly("right"),disabled:!K,className:"flex h-14 flex-1 items-center justify-center rounded-full text-lg font-extrabold uppercase tracking-wider text-white transition-transform active:scale-95 disabled:opacity-35",style:{backgroundColor:S,fontFamily:M},children:"Yes"}),q("Skip this proposition","↑",()=>z.current?.fly("up"),!K||!O)]}),/* @__PURE__ */u("p",{className:"mt-2 text-center text-[11px]",style:{color:B.textMuted},children:O?"Swipe right for Yes, left for No · ↑ to skip":"Swipe right for Yes, left for No"})]})]})]})}function
|
|
117
|
+
/* @__PURE__ */u("button",{type:"button",onClick:()=>z.current?.fly("right"),disabled:!K,className:"flex h-14 flex-1 items-center justify-center rounded-full text-lg font-extrabold uppercase tracking-wider text-white transition-transform active:scale-95 disabled:opacity-35",style:{backgroundColor:S,fontFamily:M},children:"Yes"}),q("Skip this proposition","↑",()=>z.current?.fly("up"),!K||!O)]}),/* @__PURE__ */u("p",{className:"mt-2 text-center text-[11px]",style:{color:B.textMuted},children:O?"Swipe right for Yes, left for No · ↑ to skip":"Swipe right for Yes, left for No"})]})]})]})}function sl({propositions:e,title:t,onClose:n}){const{theme:r,selections:a,toggleSelection:c,compositeComponentById:d}=Kr(),p=r.colors,h=i(()=>zr(e,a,d),[e,a,d]),f=o(e=>h.isCapped(e),[h]),{visible:x,canSkip:g,canUndo:y,restored:b,resolve:w,undo:k}=Qr(e,a,c,f),v=s(null),N=s(null),C=o(e=>{N.current=e},[]),F=o(()=>N.current?.fly("up"),[]),B=q(r),A=be(r),M=x.length>0,S=V(r),L=o(()=>v.current?.close(),[]);l(()=>{v.current?.showModal()},[]),l(()=>{const e=e=>{const t=e.target;if(!t||!/^(INPUT|TEXTAREA|SELECT)$/.test(t.tagName)){switch(e.key){case"ArrowRight":N.current?.fly("right");break;case"ArrowLeft":N.current?.fly("left");break;case"ArrowUp":N.current?.fly("up");break;case"ArrowDown":case"Backspace":k();break;default:return}e.preventDefault()}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[k]);const z="flex h-11 w-11 items-center justify-center rounded-full border text-lg transition-transform active:scale-95 disabled:opacity-35",P={borderColor:p.border,color:p.textMuted,background:p.background,cursor:"pointer"},T=(e,t,n)=>/* @__PURE__ */u("button",{type:"button",onClick:()=>N.current?.fly(e),disabled:!M,className:"flex h-14 flex-1 items-center justify-center rounded-full text-lg font-extrabold uppercase tracking-wider text-white transition-transform active:scale-95 disabled:opacity-35",style:{backgroundColor:n,fontFamily:A,cursor:"pointer"},children:t});/* @__PURE__ */
|
|
118
118
|
return m("dialog",{ref:v,onClose:n,onClick:e=>{e.target===v.current&&L()},className:"m-auto w-[min(100vw-2rem,420px)] overflow-hidden rounded-3xl border p-4 backdrop:bg-black/60",style:{backgroundColor:S,borderColor:p.border,color:Z(r)},children:[
|
|
119
119
|
/* @__PURE__ */m("div",{className:"flex items-center gap-2 mb-3",children:[/* @__PURE__ */u("span",{className:"flex-1 min-w-0 truncate text-sm font-bold",style:{fontFamily:A},children:t}),/* @__PURE__ */u("button",{type:"button",onClick:L,"aria-label":"Close",className:"h-8 w-8 shrink-0 rounded-full border text-base leading-none",style:{borderColor:p.border,color:B,cursor:"pointer"},children:"×"})]}),
|
|
120
|
-
/* @__PURE__ */u("div",{className:"flex flex-col justify-center pb-3 pt-1",children:M?/* @__PURE__ */u("div",{className:"relative mx-auto w-full",style:{height:"clamp(14rem, 44dvh, 26rem)"},children:x.map((e,t)=>/* @__PURE__ */u(
|
|
120
|
+
/* @__PURE__ */u("div",{className:"flex flex-col justify-center pb-3 pt-1",children:M?/* @__PURE__ */u("div",{className:"relative mx-auto w-full",style:{height:"clamp(14rem, 44dvh, 26rem)"},children:x.map((e,t)=>/* @__PURE__ */u(ll,{prop:e,depth:t,canSkip:g,enterFrom:b?.id===e.id?b.from:null,onResolve:w,registerApi:0===t?C:void 0,children:/* @__PURE__ */u(al,{prop:e})},e.id))}):/* @__PURE__ */m("div",{className:"mx-auto flex w-full flex-col items-center gap-3 rounded-3xl px-6 py-10 text-center",style:{background:S,border:`1px dashed ${p.border}`},children:[/* @__PURE__ */u("p",{className:"text-base font-extrabold",style:{color:R(r),fontFamily:A},children:"That’s the last one"}),/* @__PURE__ */u("p",{className:"text-sm",style:{color:p.textMuted},children:"You’ve been through every proposition on this fixture. Close to go back to the card, or undo to revisit a pick."})]})}),
|
|
121
121
|
/* @__PURE__ */m("div",{className:"shrink-0 pt-6",children:[/* @__PURE__ */m("div",{className:"mx-auto flex items-center justify-center gap-3",children:[
|
|
122
122
|
/* @__PURE__ */u("button",{type:"button",onClick:k,disabled:!y,"aria-label":"Undo last swipe",className:z,style:P,children:/* @__PURE__ */u("span",{"aria-hidden":!0,children:"↺"})}),T("left","No",U(r)),T("right","Yes",I(r)),
|
|
123
|
-
/* @__PURE__ */u("button",{type:"button",onClick:F,disabled:!M||!g,"aria-label":"Skip this proposition",className:z,style:P,children:/* @__PURE__ */u("span",{"aria-hidden":!0,children:"↑"})})]}),/* @__PURE__ */u("p",{className:"mt-2 text-center text-[11px]",style:{color:p.textMuted},children:g?"Swipe right for Yes, left for No · ↑ to skip":"Swipe right for Yes, left for No"})]})]})}var
|
|
123
|
+
/* @__PURE__ */u("button",{type:"button",onClick:F,disabled:!M||!g,"aria-label":"Skip this proposition",className:z,style:P,children:/* @__PURE__ */u("span",{"aria-hidden":!0,children:"↑"})})]}),/* @__PURE__ */u("p",{className:"mt-2 text-center text-[11px]",style:{color:p.textMuted},children:g?"Swipe right for Yes, left for No · ↑ to skip":"Swipe right for Yes, left for No"})]})]})}var cl=["split","split-inline","compact"];function dl(e){return new Intl.DateTimeFormat("en-AU",{weekday:"short",day:"numeric",month:"short"}).format(e).replace(",","")}function ul(e){return new Intl.DateTimeFormat("en-AU",{hour:"numeric",minute:"2-digit",hour12:!0}).format(e).replace(/\s/g,"").toLowerCase()}function ml(e){const t=(e??"").trim().split(/\s+/).filter(Boolean);return(t[t.length-1]??"").slice(0,3).toUpperCase()}function pl(e){if(!e.commence_time)return null;const t=new Date(e.commence_time);return Number.isNaN(t.getTime())?null:t}function hl(e){const t=e?.trim();if(t&&"undefined"!==t&&"null"!==t)return t}function fl(e,t=!1){const n=Object.entries(e).map(([e,n])=>function(e,t,n){const[o,r]=n?[]:e.split(" vs ").map(hl),l=t.map(pl).filter(e=>null!==e),a=l.length>0?new Date(Math.min(...l.map(e=>e.getTime()))):null;return{key:e,title:n||!o?n?e:hl(t[0]?.league??void 0)??"":[o,r].filter(Boolean).join(" vs "),home:o,away:r,racing:n,date:a,props:t}}(e,n,t)),o=n.filter(e=>null!==e.date).sort((e,t)=>e.date.getTime()-t.date.getTime()),r=n.filter(e=>null===e.date),l=/* @__PURE__ */new Map;for(const i of o){const e=i.date.toDateString(),t=l.get(e);t?t.events.push(i):l.set(e,{key:e,label:dl(i.date),events:[i]})}const a=[...l.values()];return r.length>0&&a.push({key:"undated",label:"",events:r}),a}var xl={split:"text-[13px] leading-snug",compact:"text-[11px] leading-snug"};function gl({variant:t,groups:n,racing:o,selections:r,onToggleSelection:l,atMax:a,theme:i,renderTeamLogo:s,componentById:p,disableEventSwipe:h=!1}){const f=i.colors,x=V(i),g=X(i),y=f.borderSubtle??f.border,b=Z(i),w=q(i),k=W(i),v=G(i),N=R(i),C=be(i),[F,B]=c(null),[A,M]=c(/* @__PURE__ */new Set),[S,L]=c(/* @__PURE__ */new Set),z=e=>t=>e(e=>{const n=new Set(e);return n.delete(t)||n.add(t),n}),P=z(M),T=z(L),D=e.useMemo(()=>fl(n,o),[n,o]),O=e.useMemo(()=>zr(Object.values(n).flat(),r,p),[n,r,p]),E=e=>a&&!(e.id in r)||O.isCapped(e),j=e=>{if(!O.isCapped(e))return;const t=Ar(e);return t?function(e){return`${kr[e]} already picked for this match`}(t):void 0},Y=(e,t)=>{E(e)||l(e.id,t)},H=e=>{const t=O.slotsFor(Sr(e.props[0]));return 0===t.length?null:/* @__PURE__ */u("span",{className:"hidden shrink-0 items-center gap-1 sm:flex",children:t.map(({family:e,label:t,filled:n})=>/* @__PURE__ */u("span",{title:Nr(e,n),"aria-label":Nr(e,n),className:"rounded-full border px-1.5 text-[8.5px] font-bold uppercase leading-[15px] tracking-wide "+(n?"":"border-dashed"),style:{borderColor:n?b:y,color:n?b:w,cursor:"help"},children:t},e))})},I=(e,t)=>e?s?.(e,t)??null:null,U=(e,t,n)=>/* @__PURE__ */u(Re,{theme:i,size:t,stretch:n,disabled:E(e),value:r[e.id]??null,onYes:()=>Y(e,"yes"),onNo:()=>Y(e,"no")}),$=(e,t)=>/* @__PURE__ */m("span",{className:"min-w-0 flex-1 flex items-start gap-2",children:[o?wl(e,s,null):null,/* @__PURE__ */u(Nl,{prop:e,colors:f,componentById:p,renderTeamLogo:s,textClass:xl[t],textColor:k})]}),K=e=>{if(h)return null;const t=e.props.filter(e=>!E(e));return 0===t.length?null:/* @__PURE__ */m("button",{type:"button",onClick:()=>B(e),"aria-label":`Swipe ${t.length} proposition${1===t.length?"":"s"}`,className:"flex h-7 shrink-0 items-center gap-1 rounded-full border px-1 transition-all duration-150 hover:-translate-y-px hover:border-current focus-visible:border-current active:scale-95",style:{borderColor:y,color:b,cursor:"pointer"},children:[/* @__PURE__ */u(yl,{}),/* @__PURE__ */u("span",{"aria-hidden":!0,className:"whitespace-nowrap text-[9px] font-bold uppercase tracking-wide",children:"Swipe"})]})},Q=(e,t,n)=>/* @__PURE__ */u("button",{type:"button",onClick:()=>P(e.key),"aria-expanded":t,"aria-controls":n,"aria-label":`${t?"Hide":"Show"} ${e.props.length} proposition${1===e.props.length?"":"s"}`,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full border transition-transform active:scale-95",style:{borderColor:y,color:v,cursor:"pointer"},children:/* @__PURE__ */u(bl,{rotated:!t})}),J=e=>{if(!e.home&&!e.away)/* @__PURE__ */return u("span",{className:"text-[11.5px] font-bold truncate",style:{color:b},children:e.title});const t=[e.home,e.away].filter(Boolean).join(" v "),n=S.has(e.key);/* @__PURE__ */
|
|
124
124
|
return u("button",{type:"button",onClick:()=>T(e.key),title:t,"aria-label":t,"aria-pressed":n,className:"min-w-0 max-w-full truncate text-[11.5px] font-bold leading-tight",style:{color:b,fontFamily:C,cursor:"pointer"},children:/* @__PURE__ */m(d,n?{children:[e.home,
|
|
125
|
-
/* @__PURE__ */u("span",{className:"text-[9px] font-semibold px-1",style:{color:w},children:"v"}),e.away]}:{children:[
|
|
126
|
-
/* @__PURE__ */u("span",{className:"text-[9px] font-semibold px-0.5",style:{color:w},children:"v"}),
|
|
127
|
-
/* @__PURE__ */u("span",{className:"text-[9px] font-semibold px-0.5",style:{color:w},children:"v"}),
|
|
125
|
+
/* @__PURE__ */u("span",{className:"text-[9px] font-semibold px-1",style:{color:w},children:"v"}),e.away]}:{children:[ml(e.home),
|
|
126
|
+
/* @__PURE__ */u("span",{className:"text-[9px] font-semibold px-0.5",style:{color:w},children:"v"}),ml(e.away)]})})},_=e=>/* @__PURE__ */u("span",{className:"max-w-full truncate text-[11.5px] font-bold leading-tight",style:{color:b,fontFamily:C},children:e.racing||!e.home?e.title:/* @__PURE__ */m(d,{children:[ml(e.home),
|
|
127
|
+
/* @__PURE__ */u("span",{className:"text-[9px] font-semibold px-0.5",style:{color:w},children:"v"}),ml(e.away)]})}),ee=e=>"compact"===t?(e=>/* @__PURE__ */m("div",{className:"rounded-2xl border overflow-hidden divide-y mb-2",style:{borderColor:f.border,backgroundColor:x},children:[/* @__PURE__ */m("div",{className:"flex items-center gap-1.5 min-w-0 px-3 py-2",style:{borderColor:y,backgroundColor:g},children:[!e.racing&&I(e.home,18),J(e),!e.racing&&I(e.away,18),e.date&&/* @__PURE__ */u("span",{className:"text-[9px] font-medium whitespace-nowrap ml-0.5",style:{color:w},children:ul(e.date)}),
|
|
128
128
|
/* @__PURE__ */u("span",{className:"ml-auto",children:K(e)})]}),e.props.map(e=>/* @__PURE__ */m("div",{title:j(e),className:"grid grid-cols-[1fr_auto] gap-2 items-center px-3 py-2.5",style:{borderColor:y,opacity:E(e)?.45:1},children:[/* @__PURE__ */u("div",{className:"min-w-0 flex",children:$(e,"compact")}),U(e,"xs")]},e.id))]},e.key))(e):((e,t)=>{const n=!A.has(e.key),o=`variant-split-${e.key}`,r=`${e.props.length} proposition${1===e.props.length?"":"s"}`;/* @__PURE__ */
|
|
129
|
-
return m("div",n?{className:"grid grid-cols-[80px_1fr] items-stretch rounded-2xl border overflow-hidden mb-2",style:{borderColor:f.border,backgroundColor:x},children:[/* @__PURE__ */m("div",{className:"flex flex-col items-center justify-center gap-1.5 text-center min-w-0 border-r px-2 py-3",style:{borderColor:y,backgroundColor:g},children:[!e.racing&&/* @__PURE__ */m("span",{className:"flex items-center gap-0.5",children:[I(e.home,24),I(e.away,24)]}),_(e),e.date&&/* @__PURE__ */u("span",{className:"text-[9.5px] font-medium",style:{color:w},children:
|
|
129
|
+
return m("div",n?{className:"grid grid-cols-[80px_1fr] items-stretch rounded-2xl border overflow-hidden mb-2",style:{borderColor:f.border,backgroundColor:x},children:[/* @__PURE__ */m("div",{className:"flex flex-col items-center justify-center gap-1.5 text-center min-w-0 border-r px-2 py-3",style:{borderColor:y,backgroundColor:g},children:[!e.racing&&/* @__PURE__ */m("span",{className:"flex items-center gap-0.5",children:[I(e.home,24),I(e.away,24)]}),_(e),e.date&&/* @__PURE__ */u("span",{className:"text-[9.5px] font-medium",style:{color:w},children:ul(e.date)}),K(e)]}),/* @__PURE__ */m("div",{id:o,className:"flex flex-col min-w-0 divide-y",style:{borderColor:y},children:[/* @__PURE__ */m("div",{className:"flex items-center gap-2 px-3 py-1.5",children:[/* @__PURE__ */u("span",{className:"min-w-0 truncate text-[11px] font-bold",style:{color:b,fontFamily:C},children:e.title}),/* @__PURE__ */m("span",{className:"ml-auto flex items-center gap-2",children:[H(e),Q(e,n,o)]})]}),/* @__PURE__ */u("div",{className:"flex flex-col justify-center gap-3 px-3 py-2.5",children:e.props.map(e=>/* @__PURE__ */m("div",{title:j(e),className:t?"grid grid-cols-[1fr_auto] gap-2.5 items-center":"flex flex-col gap-2.5",style:{opacity:E(e)?.45:1},children:[/* @__PURE__ */u("span",{className:"min-w-0 flex",children:$(e,"split")}),t?U(e,"xs"):U(e,"sm",!0)]},e.id))})]})]}:{className:"flex items-center rounded-2xl border overflow-hidden mb-2",style:{borderColor:f.border,backgroundColor:x},children:[
|
|
130
130
|
/* @__PURE__ */m("div",{className:"flex items-center gap-1 self-stretch border-r px-2 py-1.5",style:{borderColor:y,backgroundColor:g},children:[!e.racing&&/* @__PURE__ */m(d,{children:[I(e.home,16),I(e.away,16)]}),J(e)]}),
|
|
131
131
|
/* @__PURE__ */u("span",{id:o,className:"px-3 text-[11px] font-semibold",style:{color:w},children:r}),
|
|
132
132
|
/* @__PURE__ */u("span",{className:"ml-auto pr-2",children:Q(e,n,o)})]},e.key)})(e,"split-inline"===t);/* @__PURE__ */
|
|
133
|
-
return m("div",{className:"pb-4",children:[D.map(e=>{/* @__PURE__ */return m("div",{children:[e.label&&(t=e.label,/* @__PURE__ */m("div",{className:"flex items-center gap-2 mt-4 mb-2 first:mt-0",children:[/* @__PURE__ */u("span",{className:"text-[11px] font-bold tracking-wide",style:{color:N,fontFamily:C},children:t}),/* @__PURE__ */u("span",{className:"flex-1 h-px",style:{backgroundColor:y}})]})),e.events.map(ee)]},e.key);var t}),F&&/* @__PURE__ */u(
|
|
134
|
-
return m("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[/* @__PURE__ */u("rect",{x:"3",y:"5",width:"12",height:"16",rx:"2"}),/* @__PURE__ */u("path",{d:"M8.5 3h7a2 2 0 0 1 2 2v12"})]})}function
|
|
135
|
-
return u("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,style:{transform:e?"rotate(-90deg)":void 0,transition:"transform 0.15s ease"},children:/* @__PURE__ */u("path",{d:"m6 9 6 6 6-6"})})}function
|
|
133
|
+
return m("div",{className:"pb-4",children:[D.map(e=>{/* @__PURE__ */return m("div",{children:[e.label&&(t=e.label,/* @__PURE__ */m("div",{className:"flex items-center gap-2 mt-4 mb-2 first:mt-0",children:[/* @__PURE__ */u("span",{className:"text-[11px] font-bold tracking-wide",style:{color:N,fontFamily:C},children:t}),/* @__PURE__ */u("span",{className:"flex-1 h-px",style:{backgroundColor:y}})]})),e.events.map(ee)]},e.key);var t}),F&&/* @__PURE__ */u(sl,{propositions:F.props.filter(e=>!E(e)),title:F.title,onClose:()=>B(null)})]})}function yl(){/* @__PURE__ */
|
|
134
|
+
return m("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[/* @__PURE__ */u("rect",{x:"3",y:"5",width:"12",height:"16",rx:"2"}),/* @__PURE__ */u("path",{d:"M8.5 3h7a2 2 0 0 1 2 2v12"})]})}function bl({rotated:e}){/* @__PURE__ */
|
|
135
|
+
return u("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,style:{transform:e?"rotate(-90deg)":void 0,transition:"transform 0.15s ease"},children:/* @__PURE__ */u("path",{d:"m6 9 6 6 6-6"})})}function wl(e,t,n){if(!t||(o=n)&&o.split(" vs ").length>1)return null;var o;const r=e.outcome||e.description;return r?t(r):null}function kl({matchup:e,renderTeamLogo:t,altText:n,mutedColor:o,size:r="sm"}){const[l,a=""]=e.split(" vs "),i="md"===r?"text-sm sm:text-base":"text-sm";if(!(a.length>0))/* @__PURE__ */return u("span",{className:`font-semibold ${i} leading-snug break-words`,style:{color:n},children:e});const s=(e,n)=>/* @__PURE__ */m("span",{className:`inline-flex items-center gap-1 leading-snug min-w-0 max-w-full ${n}`,children:[t?.(e),/* @__PURE__ */u("span",{className:"break-words min-w-0",children:e})]});/* @__PURE__ */
|
|
136
136
|
return m("span",{className:`font-semibold ${i} grid grid-cols-[auto_1fr] items-center gap-x-1.5 min-w-0 max-w-full sm:flex sm:flex-wrap sm:items-center`,style:{color:n},children:[s(l,"col-start-2 row-start-1"),
|
|
137
|
-
/* @__PURE__ */u("span",{className:"text-xs font-normal flex-shrink-0 col-start-1 row-start-1 row-span-2 self-center",style:{color:o},children:"vs"}),s(a,"col-start-2 row-start-2")]})}function
|
|
138
|
-
return u("div",{className:"min-w-0 flex-1",children:g.map((o,r)=>{const l=o.prop?.home_team?.trim(),a=o.prop?.away_team?.trim(),i=s
|
|
139
|
-
return m(e.Fragment,{children:[r>0&&/* @__PURE__ */u("span",{className:"mx-1 align-middle",children:/* @__PURE__ */u(
|
|
137
|
+
/* @__PURE__ */u("span",{className:"text-xs font-normal flex-shrink-0 col-start-1 row-start-1 row-span-2 self-center",style:{color:o},children:"vs"}),s(a,"col-start-2 row-start-2")]})}function vl({label:e,colors:t}){const n="OR"===e?"If either wins, you win.":"Both must win for Yes.",[r,a]=c(!1),[i,d]=c({top:0,left:0}),p=s(null),h=o(()=>{const e=p.current;if(!e)return;const t=e.getBoundingClientRect();d({top:t.bottom+4,left:t.left})},[]);return l(()=>{if(!r)return;h();const e=()=>h();return window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[r,h]),/* @__PURE__ */m("span",{className:"relative inline-flex flex-shrink-0",onMouseEnter:()=>{h(),a(!0)},onMouseLeave:()=>a(!1),children:[/* @__PURE__ */u("button",{ref:p,type:"button",className:"px-2 py-0.5 rounded-md text-[10px] font-bold uppercase tracking-wide leading-none cursor-help",style:{color:t.primary,backgroundColor:z(t.primary,.14),border:`1px solid ${z(t.primary,.45)}`},"aria-label":n,"aria-expanded":r,onClick:e=>{e.stopPropagation(),h(),a(e=>!e)},children:e}),r&&/* @__PURE__ */u("span",{role:"tooltip",className:"fixed z-[9999] min-w-[12rem] max-w-[22rem] rounded-md px-2.5 py-1.5 text-[11px] leading-snug shadow-lg pointer-events-none",style:{top:i.top,left:i.left,color:t.text,backgroundColor:t.backgroundAlt??"#fff",border:`1px solid ${t.border??z(t.primary,.3)}`},children:n})]})}function Nl({prop:t,colors:n,size:o="sm",componentById:r,textClass:l,textColor:a,eventLabels:i="show",renderTeamLogo:s}){const c=dt(t,r),d=t.description??t.proposition??"",p=l??("md"===o?"text-sm sm:text-base font-medium":"text-xs sm:text-sm"),h=a??n.text,f=n.textMuted??n.textAltMuted??n.text;if(!c)/* @__PURE__ */return u("span",{className:p,style:{color:h},children:d});const{operator:x,legs:g}=c;if("show"===i&&g.some(e=>e.eventLabel)){const t=n.backgroundAlt??"transparent";/* @__PURE__ */
|
|
138
|
+
return u("div",{className:"min-w-0 flex-1",children:g.map((o,r)=>{const l=o.prop?.home_team?.trim(),a=o.prop?.away_team?.trim(),i=l?s?.(l,16)??null:null,c=a?s?.(a,16)??null:null,d=i||c?/* @__PURE__ */m("span",{className:"mr-1 inline-flex shrink-0 items-center gap-0.5 whitespace-nowrap rounded-full border px-1 py-0.5 align-middle",style:{backgroundColor:t,borderColor:n.border??"transparent"},title:o.eventLabel??void 0,"aria-label":o.eventLabel??void 0,children:[i,i&&c?/* @__PURE__ */u("span",{className:"text-[9px] font-semibold uppercase",style:{color:f},children:"vs"}):null,c]}):null;/* @__PURE__ */
|
|
139
|
+
return m(e.Fragment,{children:[r>0&&/* @__PURE__ */u("span",{className:"mx-1 align-middle",children:/* @__PURE__ */u(vl,{label:x,colors:n})}),d,!d&&o.eventLabel&&/* @__PURE__ */u("span",{className:"mr-1 inline-block rounded px-1 align-middle text-[9px] font-bold uppercase leading-[14px] tracking-wide",style:{backgroundColor:t,color:f},children:o.eventLabel}),
|
|
140
140
|
/* @__PURE__ */u("span",{className:p,style:{color:h},title:o.eventLabel??void 0,children:o.text})]},r)})})}/* @__PURE__ */
|
|
141
|
-
return u("div",{className:"min-w-0 flex-1",children:/* @__PURE__ */u("div",{className:"flex flex-wrap items-center gap-x-1.5 gap-y-1",children:g.map((t,o)=>/* @__PURE__ */m(e.Fragment,{children:[o>0&&/* @__PURE__ */u(
|
|
141
|
+
return u("div",{className:"min-w-0 flex-1",children:/* @__PURE__ */u("div",{className:"flex flex-wrap items-center gap-x-1.5 gap-y-1",children:g.map((t,o)=>/* @__PURE__ */m(e.Fragment,{children:[o>0&&/* @__PURE__ */u(vl,{label:x,colors:n}),/* @__PURE__ */u("span",{className:p,style:{color:h,textDecoration:t.eventLabel?"underline dotted":void 0,textUnderlineOffset:t.eventLabel?3:void 0,cursor:t.eventLabel?"help":void 0},title:t.eventLabel??void 0,children:t.text})]},o))})})}function Cl({game:t,propositions:n,selections:o,onToggleSelection:a,onNext:s,onBack:p,loading:h,error:f,theme:x,colorScheme:g,hideActions:y=!1,initialSport:b,renderTeamLogo:w,disableQuickPick:k=!1,selectedPropositionCount:v,onPropositionCountChange:N,gameCategory:C,headerExtra:F,variant:B,disableEventSwipe:A}){const M=r(Ur),S=M?.sportBaseKey,L=M?.compositeComponentById,P=B??M?.selectionVariant,T=A??M?.disableEventSwipe??!1,D=ge(x,g),O=D.colors,E=V(D),Y=Q(D),H=O.matchupHeader??(t.color?z(t.color,.14):X(D)),G=O.textAlt??O.text,W=j(D),I=ye(D);be(D),R(D);const U=!!(t.allowed_propositions&&t.allowed_propositions.length>0),{min:$,max:K}=zt(t,v),Z=$,q=K,[_,ee]=e.useState(()=>new Set(Object.keys(Qt(n,C,S)))),te=Z>0&&Z===q,ne=Z||1,oe=q||n.length,re=q||Z||n.length,[le,ae]=e.useState(re),ie=Object.keys(o).length,se=q>0&&ie>=q,ce=U?null!=v&&ie===v:Lt(ie,t.min_propositions,t.max_propositions);t.min_bet,q>0?Math.max(2,2*q):Math.max(2,2*ie);const de=e.useRef(ie),ue=U?null!=v&&ie===v:q>0&&ie===q;l(()=>{ue&&ie>de.current&&s?.(),de.current=ie},[ie,ue]);const me=i(()=>zr(n,o,L),[n,o,L]),pe=i(()=>n.some(e=>null!==Ar(e)),[n]),he=(e,t)=>{if(e in o)return void a(e,t);if(se)return;const r=n.find(t=>t.id===e);r&&me.isCapped(r)||a(e,t)},fe=e=>{if(!pe||0===e.length)return null;const t=me.slotsFor(Sr(e[0]));return 0===t.length?null:/* @__PURE__ */u("span",{className:"flex shrink-0 items-center gap-1",children:t.map(({family:e,label:t,filled:n})=>/* @__PURE__ */u("span",{title:Nr(e,n),"aria-label":Nr(e,n),className:"rounded-full border px-1.5 text-[9px] font-bold uppercase leading-[16px] tracking-wide "+(n?"":"border-dashed"),style:{borderColor:n?G:O.border,color:n?G:O.textMuted,cursor:"help"},children:t},e))})};l(()=>{const e=q||n.length,t=Z||1;ae(n=>te?q:Math.max(t,Math.min(n,e)))},[n.length,Z,q,te]);const xe=i(()=>/* @__PURE__ */new Date,[]),we=i(()=>function(e,t){const n=e.filter(e=>null!=function(e){if(!e.commence_time)return null;const t=new Date(e.commence_time);return Number.isNaN(t.getTime())?null:t}(e));if(n.length<2)return[];const o=[];for(const r of gr){let e=0,l=0;for(const o of n)if(br(o.commence_time,r,t)?e+=1:l+=1,e>0&&l>0)break;e>0&&l>0&&o.push({id:r,label:xr[r]})}return o}(n,xe),[n,xe]),[ke,ve]=c(null);l(()=>{ke&&!we.some(e=>e.id===ke)&&ve(null)},[we,ke]);const Ne=i(()=>function(e,t,n){return t?e.filter(e=>br(e.commence_time,t,n)):e.slice()}(n,ke,xe),[n,ke,xe]),Ce=i(()=>Tt(C,Ne,S),[C,Ne,S]),Fe=i(()=>Qt(Ne,C,S),[Ne,C,S]),Be=i(()=>{const e=/* @__PURE__ */new Set;for(const t of Ne){const n=rt(t);n&&e.add(n)}return Array.from(e).sort((e,t)=>e.localeCompare(t))},[Ne]),[Ae,Me]=c(null),[Se,Le]=c(!1);l(()=>{Ae&&!Be.includes(Ae)&&Me(null)},[Be,Ae]);const ze=i(()=>{if(!Ae)return Fe;const e={};for(const[t,n]of Object.entries(Fe)){const o=n.filter(e=>rt(e)===Ae);o.length>0&&(e[t]=o)}return e},[Fe,Ae]),Pe=Object.keys(ze);if(e.useEffect(()=>{const e=Object.keys(ze);e.length>0&&ee(t=>e.every(e=>t.has(e))?t:new Set(e))},[ze]),h)/* @__PURE__ */return u(vn,{colors:J(D),bodyFont:I,variant:"propositions"});if(f)/* @__PURE__ */return u("div",{className:"flex items-center justify-center p-8",style:{fontFamily:I},children:/* @__PURE__ */u("div",{style:{color:O.error},children:f})});const Te=!k&&n.length>0,De=we.length>0||Be.length>1,Oe=(null!=ke?1:0)+(null!=Ae?1:0);/* @__PURE__ */
|
|
142
142
|
return m("div",{className:"space-y-4 sm:space-y-6 pb-16",style:{fontFamily:I},children:[(De||F)&&/* @__PURE__ */m("div",{className:"flex items-center justify-between gap-2",children:[/* @__PURE__ */u("div",{className:"flex items-center gap-2",children:De&&/* @__PURE__ */m(d,{children:[/* @__PURE__ */m("button",{type:"button",onClick:()=>Le(e=>!e),"aria-expanded":Se,className:"inline-flex items-center gap-1.5 rounded-full px-3 py-1.5 text-[11px] font-bold transition-colors",style:{fontFamily:I,border:`1px solid ${Oe>0?O.primary:O.border}`,backgroundColor:Oe>0?O.primary:O.background??"#fff",color:Oe>0?O.primaryText:O.text,cursor:"pointer"},children:[
|
|
143
143
|
/* @__PURE__ */u(Qe,{size:13}),"Filter",Oe>0&&/* @__PURE__ */m("span",{children:["· ",Oe]}),
|
|
144
|
-
/* @__PURE__ */u("span",{className:"inline-flex transition-transform",style:{transform:`rotate(${Se?-90:90}deg)`,opacity:.75},children:/* @__PURE__ */u(Je,{size:13})})]}),Oe>0&&/* @__PURE__ */u("button",{type:"button",onClick:()=>{ve(null),Me(null)},className:"text-[11px] font-semibold",style:{color:O.textMuted,cursor:"pointer"},children:"Clear"})]})}),F]}),Se&&De&&/* @__PURE__ */m("div",{className:"space-y-2.5",children:[we.length>0&&/* @__PURE__ */u(ot,{label:"When",options:[{value:null,label:"All dates"},...we.map(e=>({value:e.id,label:e.label}))],value:ke,onChange:e=>ve(e),theme:D,bodyFont:I}),Be.length>1&&/* @__PURE__ */u(ot,{label:"Market",options:[{value:null,label:"All markets"},...Be.map(e=>{return{value:e,label:(t=e,t.replace(/[_-]+/g," ").replace(/\b\w/g,e=>e.toUpperCase()))};var t})],value:Ae,onChange:Me,theme:D,bodyFont:I})]}),Te&&/* @__PURE__ */u("div",{className:"flex flex-wrap items-center justify-end gap-2",children:/* @__PURE__ */m("div",{className:"flex items-center gap-1.5 sm:gap-2 flex-shrink-0",children:[!te&&/* @__PURE__ */m("div",{className:"flex items-center gap-1",children:[/* @__PURE__ */u("input",{type:"number",min:ne,max:oe,value:le,onChange:e=>{const t=parseInt(e.target.value,10);isNaN(t)||ae(Math.max(ne,Math.min(oe,t)))},className:"w-10 sm:w-14 px-1 sm:px-2 py-1 sm:py-1.5 rounded-lg text-xs sm:text-sm font-semibold text-center",style:{color:G,backgroundColor:O.backgroundAlt,border:`2px solid ${O.border}`}}),/* @__PURE__ */m("span",{className:"text-xs whitespace-nowrap",style:{color:O.textMuted},children:["/ ",n.length]})]}),/* @__PURE__ */u(
|
|
145
|
-
return m("div",{className:"transition-colors divide-y",style:{opacity:a?.45:1,borderColor:O.border},children:[/* @__PURE__ */m("div",{className:"px-4 py-2.5 sm:py-3 min-w-0",style:{backgroundColor:H},children:[/* @__PURE__ */u("div",{className:"min-w-0",children:/* @__PURE__ */u(
|
|
146
|
-
return m("div",{className:"rounded-xl border overflow-hidden",style:{borderColor:O.border,backgroundColor:E,boxShadow:W},children:[/* @__PURE__ */m("button",{type:"button",onClick:()=>{return t=e,ee(e=>{const n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n});var t},className:"w-full flex items-center justify-between px-4 py-3.5 transition-colors",style:{backgroundColor:H,cursor:"pointer"},children:[/* @__PURE__ */m("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[/* @__PURE__ */u("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"flex-shrink-0",style:{color:O.textAltMuted??O.textMuted,transform:n?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.15s ease"},"aria-hidden":!0,children:/* @__PURE__ */u("path",{d:"m6 9 6 6 6-6"})}),/* @__PURE__ */m("div",{className:"min-w-0",children:[/* @__PURE__ */u(
|
|
147
|
-
return u("div",{className:"px-4 py-3 sm:py-3.5 transition-colors",style:{backgroundColor:Y,opacity:a?.45:1},children:/* @__PURE__ */m("div",{className:"flex flex-wrap justify-between items-start gap-x-2 gap-y-2 sm:gap-4",children:[/* @__PURE__ */m("div",{className:"flex-1 min-w-0 flex items-start gap-2",style:{minWidth:"8rem"},children:[
|
|
144
|
+
/* @__PURE__ */u("span",{className:"inline-flex transition-transform",style:{transform:`rotate(${Se?-90:90}deg)`,opacity:.75},children:/* @__PURE__ */u(Je,{size:13})})]}),Oe>0&&/* @__PURE__ */u("button",{type:"button",onClick:()=>{ve(null),Me(null)},className:"text-[11px] font-semibold",style:{color:O.textMuted,cursor:"pointer"},children:"Clear"})]})}),F]}),Se&&De&&/* @__PURE__ */m("div",{className:"space-y-2.5",children:[we.length>0&&/* @__PURE__ */u(ot,{label:"When",options:[{value:null,label:"All dates"},...we.map(e=>({value:e.id,label:e.label}))],value:ke,onChange:e=>ve(e),theme:D,bodyFont:I}),Be.length>1&&/* @__PURE__ */u(ot,{label:"Market",options:[{value:null,label:"All markets"},...Be.map(e=>{return{value:e,label:(t=e,t.replace(/[_-]+/g," ").replace(/\b\w/g,e=>e.toUpperCase()))};var t})],value:Ae,onChange:Me,theme:D,bodyFont:I})]}),Te&&/* @__PURE__ */u("div",{className:"flex flex-wrap items-center justify-end gap-2",children:/* @__PURE__ */m("div",{className:"flex items-center gap-1.5 sm:gap-2 flex-shrink-0",children:[!te&&/* @__PURE__ */m("div",{className:"flex items-center gap-1",children:[/* @__PURE__ */u("input",{type:"number",min:ne,max:oe,value:le,onChange:e=>{const t=parseInt(e.target.value,10);isNaN(t)||ae(Math.max(ne,Math.min(oe,t)))},className:"w-10 sm:w-14 px-1 sm:px-2 py-1 sm:py-1.5 rounded-lg text-xs sm:text-sm font-semibold text-center",style:{color:G,backgroundColor:O.backgroundAlt,border:`2px solid ${O.border}`}}),/* @__PURE__ */m("span",{className:"text-xs whitespace-nowrap",style:{color:O.textMuted},children:["/ ",n.length]})]}),/* @__PURE__ */u(qr,{onPress:()=>{const e=te?q:le;for(const n of Object.keys(o)){const e=Number(n);a(e,o[e])}const{yesPicks:t,noPicks:r}=function(e,t){const n=[...e].sort(()=>Math.random()-.5).slice(0,t),o=[],r=[];for(const l of n)Math.random()<.5?o.push(l):r.push(l);return{yesPicks:o,noPicks:r}}(n,e);for(const n of t)a(n.id,"yes");for(const n of r)a(n.id,"no");s?.()}})]})}),n.length>0&&P&&/* @__PURE__ */u(gl,{variant:P,groups:ze,racing:Ce,selections:o,onToggleSelection:he,atMax:se,theme:D,renderTeamLogo:w,componentById:L,disableEventSwipe:T}),n.length>0&&!P&&/* @__PURE__ */u("div",{className:"space-y-4",children:Pe.every(e=>1===ze[e].length)?/* @__PURE__ */u("div",{className:"rounded-xl border overflow-hidden divide-y",style:{borderColor:O.border,backgroundColor:E,boxShadow:W},children:Pe.map(e=>{const t=ze[e][0],n="yes"===o[t.id],r="no"===o[t.id],l=t.id in o,a=se&&!l||me.isCapped(t);/* @__PURE__ */
|
|
145
|
+
return m("div",{className:"transition-colors divide-y",style:{opacity:a?.45:1,borderColor:O.border},children:[/* @__PURE__ */m("div",{className:"px-4 py-2.5 sm:py-3 min-w-0",style:{backgroundColor:H},children:[/* @__PURE__ */u("div",{className:"min-w-0",children:/* @__PURE__ */u(kl,{matchup:e,renderTeamLogo:w,altText:G,mutedColor:O.textAltMuted??O.textMuted??G})}),/* @__PURE__ */m("div",{className:"flex items-center gap-2 mt-0.5 min-w-0",children:[t.commence_time&&/* @__PURE__ */u("span",{className:"text-[11px]",style:{color:O.textAltMuted??O.textMuted,opacity:.7},children:kt(t.commence_time)}),fe([t])]})]}),/* @__PURE__ */m("div",{className:"flex items-center justify-between gap-3 px-4 py-3 sm:py-3.5",style:{backgroundColor:Y},children:[/* @__PURE__ */m("div",{className:"min-w-0 flex-1 flex items-start gap-2",children:[wl(t,w,e),/* @__PURE__ */u(Nl,{prop:t,colors:O,componentById:L,renderTeamLogo:w})]}),/* @__PURE__ */u(Re,{theme:D,size:"sm",value:n?"yes":r?"no":null,onYes:()=>he(t.id,"yes"),onNo:()=>he(t.id,"no"),disabled:a})]})]},t.id)})}):Pe.map(e=>{const t=ze[e],n=_.has(e),r=t.filter(e=>e.id in o).length,l=t[0]?.commence_time;/* @__PURE__ */
|
|
146
|
+
return m("div",{className:"rounded-xl border overflow-hidden",style:{borderColor:O.border,backgroundColor:E,boxShadow:W},children:[/* @__PURE__ */m("button",{type:"button",onClick:()=>{return t=e,ee(e=>{const n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n});var t},className:"w-full flex items-center justify-between px-4 py-3.5 transition-colors",style:{backgroundColor:H,cursor:"pointer"},children:[/* @__PURE__ */m("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[/* @__PURE__ */u("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"flex-shrink-0",style:{color:O.textAltMuted??O.textMuted,transform:n?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.15s ease"},"aria-hidden":!0,children:/* @__PURE__ */u("path",{d:"m6 9 6 6 6-6"})}),/* @__PURE__ */m("div",{className:"min-w-0",children:[/* @__PURE__ */u(kl,{matchup:e,renderTeamLogo:w,altText:G,mutedColor:O.textAltMuted??O.textMuted??G,size:"md"}),/* @__PURE__ */m("div",{className:"flex items-center gap-2 mt-0.5 min-w-0",children:[l&&/* @__PURE__ */u("span",{className:"text-xs text-left",style:{color:O.textAltMuted??O.textMuted,opacity:.7},children:kt(l)}),fe(t)]})]})]}),/* @__PURE__ */u("div",{className:"flex items-center gap-2 flex-shrink-0 ml-2",children:r>0&&/* @__PURE__ */m("span",{className:"text-xs px-2 py-0.5 rounded-full font-medium",style:{color:r>0?O.successText:O.textMuted,backgroundColor:r>0?O.successBg:O.backgroundAlt},children:[r,"/",t.length]})})]}),n&&/* @__PURE__ */u("div",{className:"divide-y",style:{borderColor:O.border},children:/* @__PURE__ */u(d,{children:t.map(t=>{const n="yes"===o[t.id],r="no"===o[t.id],l=t.id in o,a=se&&!l||me.isCapped(t);/* @__PURE__ */
|
|
147
|
+
return u("div",{className:"px-4 py-3 sm:py-3.5 transition-colors",style:{backgroundColor:Y,opacity:a?.45:1},children:/* @__PURE__ */m("div",{className:"flex flex-wrap justify-between items-start gap-x-2 gap-y-2 sm:gap-4",children:[/* @__PURE__ */m("div",{className:"flex-1 min-w-0 flex items-start gap-2",style:{minWidth:"8rem"},children:[wl(t,w,e),/* @__PURE__ */u(Nl,{prop:t,colors:O,size:"md",componentById:L,renderTeamLogo:w})]}),/* @__PURE__ */u(Re,{theme:D,size:"sm",value:n?"yes":r?"no":null,onYes:()=>he(t.id,"yes"),onNo:()=>he(t.id,"no"),disabled:a})]})},t.id)})})})]},e)})}),0===n.length&&/* @__PURE__ */u("div",{className:"text-center p-8",style:{color:O.textMuted},children:"No propositions available at this time"}),!y&&/* @__PURE__ */m("div",{className:"sticky bottom-0 z-10 -mx-4 sm:-mx-6 px-4 sm:px-6 py-3 sm:py-4 border-t flex items-center justify-between gap-3",style:{borderColor:O.border,backgroundColor:E},children:[/* @__PURE__ */u(je,{theme:D,variant:"secondary",onPress:p,children:"Back"}),/* @__PURE__ */u("div",{className:"flex items-center gap-2 sm:gap-3",children:/* @__PURE__ */u(je,{theme:D,variant:"primary",disabled:!ce,onPress:s,children:"Wager"})})]})]})}function Fl({propositions:e,selections:t,onToggleSelection:n,onNext:o,onBack:r,theme:l,colorScheme:a,hideActions:i=!1,renderTeamLogo:s,allowAnswerToggle:p=!0,gameName:h,potentialPayout:f,defaultExpanded:x=!1,componentById:g,addMorePicks:y}){const b=ge(l,a),w=b.colors,k=V(b),v=ye(b),N=be(b),C=R(b),F=w.textAlt??w.text,B=w.matchupHeader??X(b),A=Q(b),[M,S]=c(null),[L,z]=c(x),P=e.filter(e=>e.id in t),T=P.length,D=Jt(P);/* @__PURE__ */
|
|
148
148
|
return m("div",{className:"space-y-4 sm:space-y-6 pb-16",style:{fontFamily:v},children:[
|
|
149
149
|
/* @__PURE__ */m("div",{className:"p-4 sm:p-6 rounded-xl border",style:{backgroundColor:k,borderColor:w.border,boxShadow:j(b)},children:[
|
|
150
150
|
/* @__PURE__ */m("button",{type:"button",onClick:()=>z(e=>!e),"aria-expanded":L,"aria-controls":"selection-review-list",className:"w-full flex items-center justify-between gap-3 text-left",style:{background:"none",border:"none",padding:0,cursor:"pointer",color:"inherit"},children:[/* @__PURE__ */m("div",{className:"flex items-center gap-2 min-w-0",children:[/* @__PURE__ */u("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{color:w.textMuted,flexShrink:0,transform:L?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.15s ease"},children:/* @__PURE__ */u("path",{d:"m6 9 6 6 6-6"})}),/* @__PURE__ */m("div",{className:"min-w-0",children:[/* @__PURE__ */m("h3",{className:"text-base sm:text-lg font-semibold flex items-center gap-2",style:{color:C,fontFamily:N},children:[/* @__PURE__ */u("span",{children:"Your Selections"}),/* @__PURE__ */u("span",{className:"text-xs font-semibold px-1.5 py-0.5 rounded-full",style:{color:w.primaryText,backgroundColor:w.primary},children:T})]}),h&&/* @__PURE__ */u("p",{className:"text-sm mt-0.5 truncate",style:{color:w.textMuted},children:h})]})]}),null!=f&&f>0&&/* @__PURE__ */m("div",{className:"text-right flex-shrink-0",children:[/* @__PURE__ */u("span",{className:"text-[10px] uppercase tracking-wide block",style:{color:w.textMuted},children:"Potential Payout"}),/* @__PURE__ */u("span",{className:"text-sm font-bold",style:{color:C},children:wt(f)})]})]}),y&&y.remaining>0&&/* @__PURE__ */m("div",{className:"mt-3 sm:mt-4 p-3 rounded-lg border flex items-center justify-between gap-3",style:{backgroundColor:`${w.primary}08`,borderColor:`${w.primary}30`},children:[/* @__PURE__ */m("p",{className:"text-xs",style:{color:w.textMuted},children:[1===y.remaining?"Add ":"Add up to ",
|
|
151
151
|
/* @__PURE__ */m("span",{style:{color:w.primary,fontWeight:700},children:[y.remaining," more pick",1!==y.remaining?"s":""]}),null!=y.potentialPayout&&y.potentialPayout>0&&/* @__PURE__ */m(d,{children:[" ","to win up to"," ",
|
|
152
|
-
/* @__PURE__ */u("span",{style:{color:C,fontWeight:700},children:wt(y.potentialPayout)})," ","with ",y.max," picks"]})]}),/* @__PURE__ */u("button",{type:"button",onClick:e=>{e.stopPropagation(),y.onAdd()},className:"flex-shrink-0 px-3 py-1.5 rounded-lg text-xs font-semibold transition-colors",style:{color:w.buttonPrimaryText,backgroundColor:w.buttonPrimary,cursor:"pointer"},children:"Add picks"})]}),L&&(0===P.length?/* @__PURE__ */u("div",{className:"text-center py-8 mt-3 sm:mt-4",style:{color:w.textMuted},children:"No selections made yet"}):/* @__PURE__ */u("div",{id:"selection-review-list",className:"space-y-2 sm:space-y-3 mt-3 sm:mt-4",children:D.map(e=>/* @__PURE__ */m("div",{className:"rounded-lg overflow-hidden border",style:{borderColor:w.border},children:[e.key&&/* @__PURE__ */m("div",{className:"px-3 py-2 sm:px-3.5 sm:py-2.5 min-w-0",style:{backgroundColor:B},children:[/* @__PURE__ */u(
|
|
153
|
-
return m("div",{className:"flex items-center justify-between gap-2 px-3 py-2.5 sm:gap-3 sm:px-3.5 sm:py-3",style:{backgroundColor:A,borderTop:e.key||l>0?`1px solid ${w.border}`:void 0},children:[/* @__PURE__ */m("div",{className:"min-w-0 flex-1 flex items-start gap-2",children:[
|
|
154
|
-
/* @__PURE__ */u("div",{className:"p-4 sm:p-6 rounded-xl border",style:{backgroundColor:k,borderColor:w.border,boxShadow:j(b)},children:/* @__PURE__ */m("div",{className:"flex justify-between text-sm",children:[/* @__PURE__ */u("span",{style:{color:w.textMuted},children:"Total Selections"}),/* @__PURE__ */u("span",{className:"font-semibold",style:{color:w.text},children:P.length})]})}),!i&&/* @__PURE__ */m("div",{className:"sticky bottom-0 z-10 -mx-4 sm:-mx-6 px-4 sm:px-6 py-3 sm:py-4 border-t flex items-center justify-between gap-3",style:{borderColor:w.border,backgroundColor:w.background},children:[/* @__PURE__ */u(je,{theme:b,variant:"secondary",onPress:r,children:"Back"}),/* @__PURE__ */u(je,{theme:b,variant:"primary",disabled:0===P.length,onPress:o,children:"Place bet"})]})]})}function
|
|
152
|
+
/* @__PURE__ */u("span",{style:{color:C,fontWeight:700},children:wt(y.potentialPayout)})," ","with ",y.max," picks"]})]}),/* @__PURE__ */u("button",{type:"button",onClick:e=>{e.stopPropagation(),y.onAdd()},className:"flex-shrink-0 px-3 py-1.5 rounded-lg text-xs font-semibold transition-colors",style:{color:w.buttonPrimaryText,backgroundColor:w.buttonPrimary,cursor:"pointer"},children:"Add picks"})]}),L&&(0===P.length?/* @__PURE__ */u("div",{className:"text-center py-8 mt-3 sm:mt-4",style:{color:w.textMuted},children:"No selections made yet"}):/* @__PURE__ */u("div",{id:"selection-review-list",className:"space-y-2 sm:space-y-3 mt-3 sm:mt-4",children:D.map(e=>/* @__PURE__ */m("div",{className:"rounded-lg overflow-hidden border",style:{borderColor:w.border},children:[e.key&&/* @__PURE__ */m("div",{className:"px-3 py-2 sm:px-3.5 sm:py-2.5 min-w-0",style:{backgroundColor:B},children:[/* @__PURE__ */u(kl,{matchup:e.key,renderTeamLogo:s,altText:F,mutedColor:w.textAltMuted??w.textMuted??F}),e.props[0].commence_time&&/* @__PURE__ */u("span",{className:"text-[11px] block mt-0.5",style:{color:w.textAltMuted??w.textMuted,opacity:.7},children:kt(e.props[0].commence_time)})]}),e.props.map((o,l)=>{const a=t[o.id],i="yes"===a,c="no"===a;/* @__PURE__ */
|
|
153
|
+
return m("div",{className:"flex items-center justify-between gap-2 px-3 py-2.5 sm:gap-3 sm:px-3.5 sm:py-3",style:{backgroundColor:A,borderTop:e.key||l>0?`1px solid ${w.border}`:void 0},children:[/* @__PURE__ */m("div",{className:"min-w-0 flex-1 flex items-start gap-2",children:[wl(o,s,e.key),/* @__PURE__ */u(Nl,{prop:o,colors:w,componentById:g??void 0,renderTeamLogo:s,textClass:"text-sm leading-snug break-words",textColor:F})]}),/* @__PURE__ */m("div",{className:"flex items-center gap-1.5 flex-shrink-0 sm:gap-2",children:[p?/* @__PURE__ */u(Re,{theme:b,size:"sm",value:i?"yes":c?"no":null,onYes:e=>{e.stopPropagation(),n(o.id,"yes")},onNo:e=>{e.stopPropagation(),n(o.id,"no")}}):a&&/* @__PURE__ */u(Ge,{theme:b,value:"yes"===a?"yes":"no",size:"sm"}),/* @__PURE__ */u("button",{type:"button",onClick:e=>{e.stopPropagation(),n(o.id,t[o.id]),r()},onMouseEnter:()=>S(o.id),onMouseLeave:()=>S(null),className:"w-6 h-6 flex-shrink-0 flex items-center justify-center rounded-full transition-colors",style:{color:M===o.id?w.error:w.textAltMuted??w.textMuted,cursor:"pointer",backgroundColor:"transparent"},title:"Remove selection","aria-label":"Remove selection",children:/* @__PURE__ */u("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",children:/* @__PURE__ */u("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]})]},o.id)})]},e.key??`solo-${e.props[0].id}`))}))]}),
|
|
154
|
+
/* @__PURE__ */u("div",{className:"p-4 sm:p-6 rounded-xl border",style:{backgroundColor:k,borderColor:w.border,boxShadow:j(b)},children:/* @__PURE__ */m("div",{className:"flex justify-between text-sm",children:[/* @__PURE__ */u("span",{style:{color:w.textMuted},children:"Total Selections"}),/* @__PURE__ */u("span",{className:"font-semibold",style:{color:w.text},children:P.length})]})}),!i&&/* @__PURE__ */m("div",{className:"sticky bottom-0 z-10 -mx-4 sm:-mx-6 px-4 sm:px-6 py-3 sm:py-4 border-t flex items-center justify-between gap-3",style:{borderColor:w.border,backgroundColor:w.background},children:[/* @__PURE__ */u(je,{theme:b,variant:"secondary",onPress:r,children:"Back"}),/* @__PURE__ */u(je,{theme:b,variant:"primary",disabled:0===P.length,onPress:o,children:"Place bet"})]})]})}function Bl({game:t,propositions:n,selections:o,onToggleSelection:r,onRemoveSelection:l,onSubmit:a,onBack:i,loading:s,error:p,expectedCorrect:h,onExpectedCorrectChange:f,betAmount:x,onBetAmountChange:g,theme:y,colorScheme:b,hideActions:w=!1,winningCounts:k,payouts:v,renderTeamLogo:N,componentById:C,showCustomAmount:F=!1,betAmountLocked:B=!1,betAmountLockedNote:A,canSubmit:M,authenticated:S=!0,userBalance:L,onRecharge:z,boostBanner:P}){const T=ge(y,b),D=T.colors,O=V(T),E=ye(T),Y=be(T),H=R(T),I=G(T),U=W(T),$=D.textAlt??D.text,K=n.length,Z=t.min_bet??0,q=Math.max(Z,.01),J=t.max_bet??null,_=[5,10,20,50,100,200,500].filter(e=>e>=q&&(null===J||e<=J)).slice(0,4),ee={};for(let e=0;e<=K;e++)ee[e]=x*e;const te=v??ee,ne=te[h]??0,oe=Pt(t),re=oe.enabled&&h===K,[le,ae]=c(null),[ie,se]=c(!0),ce=s||x<q||!1===M,de=null!=L&&x>L,ue=w&&!!a&&S,me=o?n.filter(e=>e.id in o):n,pe=Jt(me),he=D.matchupHeader??X(T),fe=Q(T),xe=Object.entries(te).map(([e,t])=>({correct:Number(e),payout:t})).filter(e=>e.correct>0&&e.payout>0).sort((e,t)=>e.correct-t.correct),we=1===xe.length?xe[0].correct:null;return e.useEffect(()=>{null!==we&&h!==we&&f(we)},[we]),/* @__PURE__ */m("div",{className:"space-y-3 sm:space-y-4 pb-16",style:{fontFamily:E},children:[P,
|
|
155
155
|
/* @__PURE__ */m("div",{className:"p-4 sm:p-5 rounded-xl border",style:{backgroundColor:O,borderColor:D.border,boxShadow:j(T)},children:[
|
|
156
|
-
/* @__PURE__ */m("div",{className:"flex items-center justify-between gap-3",children:[/* @__PURE__ */m("button",{type:"button",onClick:()=>se(e=>!e),"aria-expanded":ie,"aria-controls":"entry-submission-selections","aria-label":ie?"Hide selections":"Show selections","data-testid":"entry-submission-selections-toggle",className:"flex items-center gap-2 min-w-0 flex-1 text-left",style:{background:"none",border:"none",padding:0,cursor:"pointer",color:"inherit"},children:[/* @__PURE__ */u("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{color:D.textMuted,flexShrink:0,transform:ie?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.15s ease"},children:/* @__PURE__ */u("path",{d:"m6 9 6 6 6-6"})}),/* @__PURE__ */u("h3",{className:"text-sm sm:text-base font-semibold",style:{color:H,fontFamily:Y},children:ie?"Hide Selections":"Review Selections"})]}),/* @__PURE__ */m("span",{className:"text-xs font-semibold px-2 py-0.5 rounded-full flex-shrink-0",style:{color:D.primary,backgroundColor:`${D.primary}15`},children:[me.length," pick",1!==me.length?"s":""]})]}),!ie&&/* @__PURE__ */u("p",{className:"text-xs mt-2",style:{color:D.textMuted},children:"Tap to show your picks"}),ie&&/* @__PURE__ */u("div",{id:"entry-submission-selections",className:"space-y-2 mt-3",children:pe.map(e=>/* @__PURE__ */m("div",{className:"rounded-lg overflow-hidden border",style:{borderColor:D.border},children:[e.key&&/* @__PURE__ */m("div",{className:"px-3 py-2 min-w-0",style:{backgroundColor:he},children:[/* @__PURE__ */u(
|
|
157
|
-
return m("div",{className:"flex items-center justify-between gap-2 px-3 py-2 cursor-default",style:{backgroundColor:fe,borderTop:e.key||n>0?`1px solid ${D.border}`:void 0},children:[/* @__PURE__ */m("div",{className:"min-w-0 flex-1 flex items-start gap-2",children:[
|
|
156
|
+
/* @__PURE__ */m("div",{className:"flex items-center justify-between gap-3",children:[/* @__PURE__ */m("button",{type:"button",onClick:()=>se(e=>!e),"aria-expanded":ie,"aria-controls":"entry-submission-selections","aria-label":ie?"Hide selections":"Show selections","data-testid":"entry-submission-selections-toggle",className:"flex items-center gap-2 min-w-0 flex-1 text-left",style:{background:"none",border:"none",padding:0,cursor:"pointer",color:"inherit"},children:[/* @__PURE__ */u("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{color:D.textMuted,flexShrink:0,transform:ie?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.15s ease"},children:/* @__PURE__ */u("path",{d:"m6 9 6 6 6-6"})}),/* @__PURE__ */u("h3",{className:"text-sm sm:text-base font-semibold",style:{color:H,fontFamily:Y},children:ie?"Hide Selections":"Review Selections"})]}),/* @__PURE__ */m("span",{className:"text-xs font-semibold px-2 py-0.5 rounded-full flex-shrink-0",style:{color:D.primary,backgroundColor:`${D.primary}15`},children:[me.length," pick",1!==me.length?"s":""]})]}),!ie&&/* @__PURE__ */u("p",{className:"text-xs mt-2",style:{color:D.textMuted},children:"Tap to show your picks"}),ie&&/* @__PURE__ */u("div",{id:"entry-submission-selections",className:"space-y-2 mt-3",children:pe.map(e=>/* @__PURE__ */m("div",{className:"rounded-lg overflow-hidden border",style:{borderColor:D.border},children:[e.key&&/* @__PURE__ */m("div",{className:"px-3 py-2 min-w-0",style:{backgroundColor:he},children:[/* @__PURE__ */u(kl,{matchup:e.key,renderTeamLogo:N,altText:$,mutedColor:D.textAltMuted??D.textMuted??$}),e.props[0].commence_time&&/* @__PURE__ */u("span",{className:"text-[11px] block mt-0.5",style:{color:D.textAltMuted??D.textMuted,opacity:.7},children:kt(e.props[0].commence_time)})]}),e.props.map((t,n)=>{const a=o?.[t.id],i="yes"===a,s="no"===a,c=!!r;/* @__PURE__ */
|
|
157
|
+
return m("div",{className:"flex items-center justify-between gap-2 px-3 py-2 cursor-default",style:{backgroundColor:fe,borderTop:e.key||n>0?`1px solid ${D.border}`:void 0},children:[/* @__PURE__ */m("div",{className:"min-w-0 flex-1 flex items-start gap-2",children:[wl(t,N,e.key),/* @__PURE__ */u(Nl,{prop:t,colors:D,componentById:C??void 0,renderTeamLogo:N,textClass:"text-xs sm:text-sm break-words leading-snug",textColor:$})]}),/* @__PURE__ */m("div",{className:"flex flex-shrink-0 items-center gap-1.5",children:[c?/* @__PURE__ */u(Re,{theme:T,size:"xs",value:i?"yes":s?"no":null,onYes:()=>r(t.id,"yes"),onNo:()=>r(t.id,"no")}):a?/* @__PURE__ */u(Ge,{theme:T,value:"yes"===a?"yes":"no",size:"sm",style:{flexShrink:0}}):null,ie&&l&&/* @__PURE__ */u("button",{type:"button","aria-label":"Remove selection",onClick:()=>{a&&r?.(t.id,a),l(t.id)},onMouseEnter:()=>ae(t.id),onMouseLeave:()=>ae(null),className:"flex-shrink-0 flex items-center justify-center",style:{width:44,height:44,background:"none",border:"none",padding:0,cursor:"pointer"},children:/* @__PURE__ */u("span",{className:"flex items-center justify-center rounded-full transition-colors",style:{width:26,height:26,color:le===t.id?"#fff":D.textMuted,backgroundColor:le===t.id?D.error:"transparent"},children:/* @__PURE__ */u("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",children:/* @__PURE__ */u("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})})]})]},t.id)})]},e.key??`solo-${e.props[0].id}`))})]}),ue&&/* @__PURE__ */m("p",{className:"text-xs sm:text-sm font-medium flex items-center gap-1.5 -mt-1","data-testid":"entry-submission-scroll-hint",style:{color:D.textMuted},children:[/* @__PURE__ */u("span",{"aria-hidden":!0,children:"↓"}),"Scroll down to set your bet and place your entry"]}),S?/* @__PURE__ */m(d,{children:[/* @__PURE__ */m("div",{className:"p-4 sm:p-6 rounded-xl border",style:{backgroundColor:O,borderColor:D.border,boxShadow:j(T)},children:[
|
|
158
158
|
/* @__PURE__ */m("div",{className:"flex items-center justify-between mb-3 sm:mb-4",children:[/* @__PURE__ */u("h3",{className:"text-base sm:text-lg font-semibold",style:{color:H,fontFamily:Y},children:"How much are you betting?"}),null!=L&&/* @__PURE__ */m("span",{className:"text-xs font-semibold",style:{color:D.textMuted},children:["Balance: ",/* @__PURE__ */u("span",{style:{color:de?D.error:D.success},children:wt(L)})]})]}),de&&/* @__PURE__ */m("div",{className:"mb-3 px-3 py-2 rounded-lg flex items-center justify-between gap-3",style:{backgroundColor:D.errorBg??`${D.error}15`,color:D.errorText??D.error},children:[/* @__PURE__ */m("span",{className:"text-xs font-medium",children:["Insufficient balance. Your bet of ",wt(x)," exceeds your available ",wt(L),"."]}),z&&/* @__PURE__ */u("button",{type:"button",onClick:z,className:"text-xs font-semibold px-3 py-1 rounded-md whitespace-nowrap",style:{backgroundColor:D.error,color:D.buttonPrimaryText??"#fff",cursor:"pointer"},children:"Add funds"})]}),/* @__PURE__ */m("div",B?{className:"flex items-center justify-between gap-3 rounded-lg px-3 py-2.5",style:{backgroundColor:D.backgroundAlt,border:`1px solid ${D.border}`},children:[/* @__PURE__ */u("span",{className:"text-xs",style:{color:D.textMuted},children:A??"Stake is set for this ticket."}),/* @__PURE__ */u("span",{className:"text-lg font-bold tabular-nums",style:{color:H,fontFamily:Y},children:wt(x)})]}:{className:"space-y-4",children:[F&&/* @__PURE__ */m("div",{children:[
|
|
159
159
|
/* @__PURE__ */u("p",{className:"text-xs sm:text-sm font-semibold mb-2",style:{color:I},children:"Entry amount"}),
|
|
160
160
|
/* @__PURE__ */m("div",{className:"relative",children:[/* @__PURE__ */u("span",{className:"absolute left-3 top-1/2 -translate-y-1/2",style:{color:D.textMuted},children:"$"}),/* @__PURE__ */u("input",{type:"number",inputMode:"decimal",min:q,max:J??void 0,step:"any",placeholder:"Enter amount","aria-label":"Entry amount",value:x||"",onChange:e=>{if(""===e.target.value)return void g(0);const t=Number(e.target.value);if(!Number.isFinite(t))return;const n=Math.max(0,Math.round(100*t)/100);g(null!==J?Math.min(n,J):n)},onFocus:e=>{e.currentTarget.style.borderColor=D.borderFocus??D.primary},onBlur:e=>{e.currentTarget.style.borderColor=D.border},className:"w-full pl-8 pr-4 py-3 border rounded-lg focus:outline-none text-lg font-semibold tabular-nums",style:{borderColor:D.border,color:$,backgroundColor:D.backgroundAlt,fontFamily:E,transition:"border-color .15s ease"}})]}),
|
|
@@ -163,157 +163,154 @@ return m("button",{type:"button",onClick:()=>{const t=x+e;g(null!==J?Math.min(t,
|
|
|
163
163
|
/* @__PURE__ */m("div",{className:"flex justify-between items-center text-sm mb-1",children:[/* @__PURE__ */u("span",{style:{color:I},children:"Bet"}),/* @__PURE__ */u("span",{className:"font-semibold",style:{color:U},children:wt(x)})]}),ne>0&&/* @__PURE__ */m("div",{className:"flex flex-wrap gap-x-2 justify-between items-center pt-2 border-t",style:{borderColor:D.border},children:[/* @__PURE__ */u("span",{className:"font-semibold text-sm",style:{color:I},children:"Potential Payout"}),/* @__PURE__ */m("span",{className:"font-bold text-lg",style:{color:H},children:[wt(ne),re&&/* @__PURE__ */u("span",{className:"text-xs ml-1",style:{color:D.warning},children:"+ Jackpot"})]})]}),oe.enabled&&/* @__PURE__ */m("div",{className:"flex justify-between items-center mt-2 rounded px-2 py-1.5",style:{backgroundColor:`${D.warning}08`,border:`1px solid ${D.warning}25`},children:[/* @__PURE__ */m("span",{className:"text-xs font-semibold",style:{color:D.warning},children:["★ ",oe.progressive?"Progressive Jackpot":"Jackpot"]}),/* @__PURE__ */u("span",{className:"text-sm font-bold",style:{color:D.warning},children:oe.progressive?oe.amount>0?wt(oe.amount):oe.limit>0?`Up to ${wt(oe.limit)}`:"Progressive":wt(oe.amount)})]})]});return e?/* @__PURE__ */m("div",{className:"flex items-stretch gap-4",children:[
|
|
164
164
|
/* @__PURE__ */u("div",{className:"flex-1 min-w-0",children:t}),
|
|
165
165
|
/* @__PURE__ */u("div",{className:"w-px self-stretch",style:{backgroundColor:D.border}}),
|
|
166
|
-
/* @__PURE__ */u("button",{type:"button",onClick:a,disabled:ce,"aria-busy":s,className:"flex-shrink-0 flex flex-col items-center justify-center px-5 py-3 rounded-lg text-sm font-semibold transition-colors disabled:opacity-50 disabled:cursor-not-allowed",style:{color:D.buttonPrimaryText,backgroundColor:D.buttonPrimary,cursor:ce?"not-allowed":"pointer",minWidth:120},children:s?/* @__PURE__ */m("span",{className:"flex flex-col items-center gap-2",children:[/* @__PURE__ */u(
|
|
166
|
+
/* @__PURE__ */u("button",{type:"button",onClick:a,disabled:ce,"aria-busy":s,className:"flex-shrink-0 flex flex-col items-center justify-center px-5 py-3 rounded-lg text-sm font-semibold transition-colors disabled:opacity-50 disabled:cursor-not-allowed",style:{color:D.buttonPrimaryText,backgroundColor:D.buttonPrimary,cursor:ce?"not-allowed":"pointer",minWidth:120},children:s?/* @__PURE__ */m("span",{className:"flex flex-col items-center gap-2",children:[/* @__PURE__ */u(cn,{color:D.buttonPrimaryText}),/* @__PURE__ */u("span",{children:"Placing Entry…"})]}):/* @__PURE__ */m(d,{children:[/* @__PURE__ */u("span",{className:"text-base font-bold leading-tight",children:"Place Entry"}),/* @__PURE__ */u("span",{className:"text-xs opacity-90 leading-tight mt-0.5",children:wt(x)})]})})]}):t})()})]}):/* @__PURE__ */m("div",{className:"p-4 sm:p-6 rounded-xl border",style:{backgroundColor:O,borderColor:D.border,boxShadow:j(T)},children:[
|
|
167
167
|
/* @__PURE__ */u("h3",{className:"text-base sm:text-lg font-semibold",style:{color:H,fontFamily:Y},children:"Log in to place this entry"}),
|
|
168
168
|
/* @__PURE__ */u("p",{className:"text-xs sm:text-sm mt-1 mb-4",style:{color:D.textMuted},children:"Your picks are held. Log in to set your bet and confirm."}),
|
|
169
|
-
/* @__PURE__ */u("button",{type:"button",onClick:a,className:"w-full px-6 py-3 rounded-lg text-sm font-semibold transition-colors",style:{color:D.buttonPrimaryText,backgroundColor:D.buttonPrimary,cursor:"pointer"},children:"Log in"})]}),p&&/* @__PURE__ */u("div",{className:"rounded-lg p-3",style:{backgroundColor:D.errorBg,border:`1px solid ${D.error}`},children:/* @__PURE__ */u("p",{className:"text-sm",style:{color:D.errorText},children:p})}),!w&&/* @__PURE__ */m("div",{className:"sticky bottom-0 z-10 -mx-4 sm:-mx-6 px-4 sm:px-6 py-3 sm:py-4 border-t flex items-center justify-between gap-3",style:{borderColor:D.border,backgroundColor:D.background},children:[/* @__PURE__ */u(je,{theme:T,variant:"secondary",disabled:s,onPress:i,children:"Back"}),/* @__PURE__ */u("button",{type:"button",onClick:a,disabled:ce,"aria-busy":s,className:"px-6 py-2.5 rounded-lg text-sm font-semibold transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2",style:{color:D.buttonPrimaryText,backgroundColor:D.buttonPrimary,cursor:ce?"not-allowed":"pointer"},children:s?/* @__PURE__ */m(d,{children:[/* @__PURE__ */u(
|
|
169
|
+
/* @__PURE__ */u("button",{type:"button",onClick:a,className:"w-full px-6 py-3 rounded-lg text-sm font-semibold transition-colors",style:{color:D.buttonPrimaryText,backgroundColor:D.buttonPrimary,cursor:"pointer"},children:"Log in"})]}),p&&/* @__PURE__ */u("div",{className:"rounded-lg p-3",style:{backgroundColor:D.errorBg,border:`1px solid ${D.error}`},children:/* @__PURE__ */u("p",{className:"text-sm",style:{color:D.errorText},children:p})}),!w&&/* @__PURE__ */m("div",{className:"sticky bottom-0 z-10 -mx-4 sm:-mx-6 px-4 sm:px-6 py-3 sm:py-4 border-t flex items-center justify-between gap-3",style:{borderColor:D.border,backgroundColor:D.background},children:[/* @__PURE__ */u(je,{theme:T,variant:"secondary",disabled:s,onPress:i,children:"Back"}),/* @__PURE__ */u("button",{type:"button",onClick:a,disabled:ce,"aria-busy":s,className:"px-6 py-2.5 rounded-lg text-sm font-semibold transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2",style:{color:D.buttonPrimaryText,backgroundColor:D.buttonPrimary,cursor:ce?"not-allowed":"pointer"},children:s?/* @__PURE__ */m(d,{children:[/* @__PURE__ */u(cn,{color:D.buttonPrimaryText}),/* @__PURE__ */u("span",{children:"Placing Entry…"})]}):/* @__PURE__ */u("span",{children:`Place Entry (${wt(x)})`})})]})]})}function Al({game:e,totalSelections:t,expectedCorrect:n,className:o="",onExpectedCorrectChange:r,theme:l=te,colorWinning:a,colorNone:i,winningCounts:s,payouts:c}){const d=l.colors,p=a??d.payoutWinning,h=i??d.payoutNone,f=Pt(e);/* @__PURE__ */
|
|
170
170
|
return m("div",{className:`space-y-4 ${o}`,children:[
|
|
171
171
|
/* @__PURE__ */u("h4",{className:"text-sm font-semibold text-center",style:{color:d.textMuted},children:"Payout Visualization"}),f.enabled&&/* @__PURE__ */m("div",{className:"flex items-center justify-center gap-2 py-2.5 px-4 rounded-lg text-sm font-semibold",style:{background:`linear-gradient(135deg, ${d.warning}18, ${d.warning}08)`,color:d.warning,border:`1px solid ${d.warning}30`},children:[/* @__PURE__ */u("svg",{className:"w-4 h-4 flex-shrink-0",viewBox:"0 0 24 24",fill:"currentColor",children:/* @__PURE__ */u("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87L18.18 22 12 18.27 5.82 22 7 14.14l-5-4.87 6.91-1.01L12 2z"})}),/* @__PURE__ */u("span",{children:f.progressive?f.amount>0?`Progressive Jackpot: ${wt(f.amount)}${f.limit>0?` (up to ${wt(f.limit)})`:""} for a perfect pick!`:f.limit>0?`Progressive Jackpot — up to ${wt(f.limit)} for a perfect pick!`:"Progressive Jackpot for a perfect pick!":`Jackpot: ${wt(f.amount)} for a perfect pick!`})]}),
|
|
172
172
|
/* @__PURE__ */u("div",{className:"flex flex-wrap gap-1.5 sm:gap-2 justify-center",children:Array.from({length:t+1},(e,o)=>{const l=s.includes(o),a=c[o]??0,i=a>0,x=o===t,g=f.enabled&&x,y=g?d.warning:l?p:h,b=o===n;/* @__PURE__ */
|
|
173
173
|
return m("button",{type:"button",onClick:()=>r?.(o),className:`relative flex flex-col items-center justify-center w-10 h-10 sm:w-12 sm:h-12 rounded-full border-2 font-semibold transition-all text-xs sm:text-sm ${g?"shadow-lg scale-110 ring-2 ring-offset-1":l?"shadow-lg scale-110":""} ${r?"cursor-pointer hover:scale-[1.12] hover:shadow-xl":""}`,style:{backgroundColor:y,borderColor:g?d.warning:l?y:void 0,color:l||g?"#ffffff":d.textMuted,zIndex:b?10:g?6:l?5:1,...g?{"--tw-ring-color":`${d.warning}80`}:{},...b?{outline:`3px solid ${d.primary}`,outlineOffset:"3px"}:{}},title:g?f.progressive?`${o} correct wins PROGRESSIVE JACKPOT${f.amount>0?` (currently ${wt(f.amount)})`:""}${f.limit>0?` — up to ${wt(f.limit)}`:""} + ${wt(a)}\nClick to select`:`${o} correct wins JACKPOT ${wt(f.amount)} + ${wt(a)}\nClick to select`:l?`${o} correct wins ${wt(a)}\nClick to select`:i?`${o} correct pays ${wt(a)} but does not win\nClick to select`:`${o} correct - no payout\nClick to select`,children:[g&&/* @__PURE__ */u("div",{className:"absolute -top-1.5 -right-1.5",children:/* @__PURE__ */u("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:d.warning,stroke:d.warning,strokeWidth:"1",children:/* @__PURE__ */u("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87L18.18 22 12 18.27 5.82 22 7 14.14l-5-4.87 6.91-1.01L12 2z"})})}),
|
|
174
174
|
/* @__PURE__ */u("div",{className:"text-sm sm:text-base leading-none",children:o}),a>0?/* @__PURE__ */u("div",{className:"text-[7px] sm:text-[8px] font-normal leading-none",children:wt(a)}):null]},o)})}),
|
|
175
|
-
/* @__PURE__ */u("div",{className:"text-xs text-center",style:{color:d.textMuted},children:/* @__PURE__ */m("p",{children:["Your expected: ",/* @__PURE__ */m("span",{className:"font-semibold",children:[n," correct"]})]})})]})}function
|
|
175
|
+
/* @__PURE__ */u("div",{className:"text-xs text-center",style:{color:d.textMuted},children:/* @__PURE__ */m("p",{children:["Your expected: ",/* @__PURE__ */m("span",{className:"font-semibold",children:[n," correct"]})]})})]})}function Ml({iconUrl:e,gameName:t,chipColor:n,textColor:o,iconColor:r,accentColor:l,brandColor:a,height:i=56,showTrademark:s=!0,className:c,compact:p=!1,onPress:h}){const f=n??a??"#0F4C5C",x=.85*i,g=1.8*x,y=x/2,b=.05*x,w=.18*x,k={display:"inline-flex",alignItems:"center",flexWrap:"wrap",gap:.2*i,color:o??f,fontFamily:"Manrope, Poppins, sans-serif",fontSize:i,lineHeight:1.15,maxWidth:"100%",minWidth:0},v=/* @__PURE__ */m(d,{children:[
|
|
176
176
|
/* @__PURE__ */m("span",{"aria-label":"YESNO",style:{letterSpacing:-1,whiteSpace:"nowrap"},children:[/* @__PURE__ */u("span",{style:{fontWeight:900},children:"YES"}),/* @__PURE__ */u("span",{style:{fontWeight:300},children:"NO"})]}),
|
|
177
|
-
/* @__PURE__ */u("span",{role:"img","aria-label":t,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:g,height:x,borderRadius:y,backgroundColor:f,flexShrink:0,transform:`translateY(${.06*-i}px)`},children:/* @__PURE__ */u(
|
|
178
|
-
/* @__PURE__ */m("span",{style:{fontWeight:500,whiteSpace:"normal",wordBreak:"break-word",minWidth:0,flexShrink:1},children:[t,s&&/* @__PURE__ */u("span",{style:{fontSize:"0.3em",fontWeight:600,marginLeft:"0.2em",display:"inline-block",transform:"translateY(-1.8em)"},children:"TM"})]})]});return h?/* @__PURE__ */u("button",{type:"button",onClick:h,className:c,"aria-label":`Play ${t}`,"data-testid":"brand-logo-play",style:{...k,background:"none",border:"none",padding:0,cursor:"pointer",textAlign:"left"},children:v}):/* @__PURE__ */u("div",{className:c,style:k,children:v})}function
|
|
177
|
+
/* @__PURE__ */u("span",{role:"img","aria-label":t,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:g,height:x,borderRadius:y,backgroundColor:f,flexShrink:0,transform:`translateY(${.06*-i}px)`},children:/* @__PURE__ */u(on,{iconUrl:e,width:g-2*w,height:x-2*b,iconColor:r,accentColor:l})}),
|
|
178
|
+
/* @__PURE__ */m("span",{style:{fontWeight:500,whiteSpace:"normal",wordBreak:"break-word",minWidth:0,flexShrink:1},children:[t,s&&/* @__PURE__ */u("span",{style:{fontSize:"0.3em",fontWeight:600,marginLeft:"0.2em",display:"inline-block",transform:"translateY(-1.8em)"},children:"TM"})]})]});return h?/* @__PURE__ */u("button",{type:"button",onClick:h,className:c,"aria-label":`Play ${t}`,"data-testid":"brand-logo-play",style:{...k,background:"none",border:"none",padding:0,cursor:"pointer",textAlign:"left"},children:v}):/* @__PURE__ */u("div",{className:c,style:k,children:v})}function Sl({apiUrl:e,apiKey:t,fetchImpl:n,getAuthHeaders:o,userId:r,demoEntries:a,demoGames:d,demoPropositions:p,onSelectEntry:h,theme:f,colorScheme:x,className:g="",renderTeamLogo:y,filterSport:b}){const w=ge(f,x),k=!!(a&&d&&p),v=w.colors,N=ye(w),C=be(w),[F,B]=c("pending"),[A,M]=c([]),S=i(()=>new Tr({apiUrl:e,apiKey:t,fetchImpl:n,getAuthHeaders:o}),[e,t,n,o]),{entries:L,loading:z,error:P,refetch:T}=jr(S,{user_id:r},{skip:k}),{games:D,loading:O,error:E}=Dr(S,void 0,{skip:k}),{propositions:j,loading:Y,error:H}=Or(S,void 0,{skip:k}),R=k?a:L,G=k?d:D,W=k?p:j,I=!k&&(z||O||Y),U=k?null:P||E||H,$=i(()=>R.map(e=>{const t={...e};return!t.created_at&&t.entry_date&&(t.created_at=t.entry_date),(!t.proposition_ids||0===t.proposition_ids.length)&&t.propositions&&t.propositions.length>0&&(t.proposition_ids=t.propositions.map(e=>e.id)),t}),[R]),K=i(()=>{const e=/* @__PURE__ */new Map;for(const t of G)e.set(t.id,t);return e},[G]),Z=i(()=>{const e=/* @__PURE__ */new Map;for(const t of W)e.set(t.id,t);for(const t of $)if(t.propositions)for(const n of t.propositions)e.has(n.id)||e.set(n.id,n);for(const t of A)e.set(t.id,t);return e},[W,$,A]),q=s(/* @__PURE__ */new Set);l(()=>{if(I||k)return;const e=[];for(const n of $)for(const t of n.proposition_ids??[])Z.has(t)||q.current.has(t)||(e.push(t),q.current.add(t));if(0===e.length)return;let t=!1;return(async()=>{try{const n=await S.getPropositionsByIds(e);!t&&n.length>0&&M(e=>[...e,...n])}catch{}})(),()=>{t=!0}},[$,Z,I,k,S]);const V=i(()=>b?$.filter(e=>{const t=e.proposition_ids??[];return 0===t.length||t.some(t=>(Z.get(t)??e.propositions?.find(e=>e.id===t))?.sport===b)}):$,[$,b,Z]),X=i(()=>V.filter(e=>bt(e.pending)),[V]),Q=i(()=>V.filter(e=>!bt(e.pending)),[V]),_="pending"===F?X:Q,ee=["flex-1",g].filter(Boolean).join(" ");return I?/* @__PURE__ */u("div",{className:ee,style:{fontFamily:N},role:"status","aria-label":"Loading entries",children:/* @__PURE__ */u(kn,{colors:J(w),rows:2})}):U?/* @__PURE__ */u("div",{className:ee,style:{fontFamily:N},children:/* @__PURE__ */m("div",{className:"rounded-lg p-4",style:{backgroundColor:v.errorBg,border:`1px solid ${v.error}`},children:[/* @__PURE__ */u("p",{style:{color:v.errorText},children:U}),/* @__PURE__ */u("button",{type:"button",onClick:T,className:"mt-2 text-sm font-medium underline",style:{color:v.error,cursor:"pointer"},children:"Try again"})]})}):/* @__PURE__ */m("div",{className:ee,style:{fontFamily:N},children:[
|
|
179
179
|
/* @__PURE__ */u("div",{className:"flex border-b mb-4",style:{borderColor:v.border},role:"tablist",children:["pending","completed"].map(e=>{const t=F===e,n="pending"===e?X.length:Q.length;/* @__PURE__ */
|
|
180
180
|
return m("button",{role:"tab","aria-selected":t,type:"button",onClick:()=>B(e),className:"flex items-center gap-2 px-4 py-2.5 text-sm font-medium transition-colors border-b-2 -mb-px",style:{borderColor:t?v.primary:"transparent",color:t?v.primary:v.textMuted,cursor:"pointer",fontFamily:C},children:["pending"===e?"Pending":"Completed",/* @__PURE__ */u("span",{className:"inline-flex items-center justify-center min-w-[20px] h-5 px-1.5 rounded-full text-xs font-semibold",style:{backgroundColor:t?`${v.primary}15`:v.backgroundAlt,color:t?v.primary:v.textMuted},children:n})]},e)})}),0===_.length&&/* @__PURE__ */m("div",{className:"flex flex-col items-center justify-center py-12 px-4 text-center",children:[
|
|
181
181
|
/* @__PURE__ */u("svg",{className:"w-12 h-12 mb-4",fill:"none",stroke:v.textMuted,strokeWidth:"1.5",viewBox:"0 0 24 24",children:/* @__PURE__ */u("path","pending"===F?{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6l4 2m6-2a10 10 0 1 1-20 0 10 10 0 0 1 20 0z"}:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m6 2a10 10 0 1 1-20 0 10 10 0 0 1 20 0z"})}),
|
|
182
182
|
/* @__PURE__ */u("p",{className:"text-base font-medium",style:{color:v.text},children:"pending"===F?"No pending entries":"No completed entries"}),
|
|
183
183
|
/* @__PURE__ */u("p",{className:"text-sm mt-1",style:{color:v.textMuted},children:"pending"===F?"Entries awaiting results will appear here":"Settled entries will appear here"})]}),
|
|
184
|
-
/* @__PURE__ */u("div",{className:"space-y-3",children:_.map(e=>/* @__PURE__ */u(
|
|
185
|
-
return m("div",{className:"rounded-xl border overflow-hidden transition-colors",style:{borderColor:a.border,backgroundColor:s,boxShadow:j(r)},children:[/* @__PURE__ */m("button",{type:"button","data-testid":"entry-card",onClick:()=>{z&&L(e=>!e),o?.({entry:e,game:t,propositions:f})},"aria-label":`Entry #${e.id}`,"aria-expanded":z?S:void 0,className:"w-full text-left px-4 py-3 flex items-center justify-between gap-3",style:{cursor:z||o?"pointer":"default",background:"none",border:"none"},children:[/* @__PURE__ */m("div",{className:"min-w-0",children:[(()=>{const n=t?t.allowed_propositions&&t.allowed_propositions.length>0&&t.game_name.replace(/\s+\d+\s*$/,"").trim()||t.game_name:`Game #${e.game_id}`;return t?/* @__PURE__ */u(
|
|
184
|
+
/* @__PURE__ */u("div",{className:"space-y-3",children:_.map(e=>/* @__PURE__ */u(Ll,{entry:e,game:K.get(e.game_id),propositionsById:Z,onSelect:h,theme:w,renderTeamLogo:y},e.id))})]})}function Ll({entry:e,game:t,propositionsById:n,onSelect:o,theme:r,renderTeamLogo:l}){const a=r.colors,s=V(r),p=be(r),h=e.proposition_ids??[],f=i(()=>h.map(e=>n.get(e)).filter(Boolean),[h,n]),x=h.length,g=i(()=>{const t=/* @__PURE__ */new Map;for(const n of e.propositions??[])t.set(n.id,n);return t},[e.propositions]),y=t=>{const o=e.selections?.[t];return null!=o?o:g.get(t)?.user_prediction??n.get(t)?.user_prediction},b=f.filter(e=>null!=e.result&&!e.is_voided).length,w=f.filter(e=>{if(null==e.result||e.is_voided)return!1;const t=y(e.id);return null!=t&&t===e.result}).length,k=null!=e.selections&&Object.keys(e.selections).length>0||(e.propositions??[]).some(e=>null!=e.user_prediction),v=bt(e.pending),N=!v&&yt(e.winning)>0,C=e.payout_status,F="fulfilled"===C&&N,B=v?"Pending":F?"Won — pay due":"paid_out"===C&&N?"Paid":N?"Won":"Lost",A=v||F?a.warningBg:N?a.successBg:a.errorBg,M=v||F?a.warningText:N?a.successText:a.errorText,[S,L]=c(!1),z=x>0;/* @__PURE__ */
|
|
185
|
+
return m("div",{className:"rounded-xl border overflow-hidden transition-colors",style:{borderColor:a.border,backgroundColor:s,boxShadow:j(r)},children:[/* @__PURE__ */m("button",{type:"button","data-testid":"entry-card",onClick:()=>{z&&L(e=>!e),o?.({entry:e,game:t,propositions:f})},"aria-label":`Entry #${e.id}`,"aria-expanded":z?S:void 0,className:"w-full text-left px-4 py-3 flex items-center justify-between gap-3",style:{cursor:z||o?"pointer":"default",background:"none",border:"none"},children:[/* @__PURE__ */m("div",{className:"min-w-0",children:[(()=>{const n=t?t.allowed_propositions&&t.allowed_propositions.length>0&&t.game_name.replace(/\s+\d+\s*$/,"").trim()||t.game_name:`Game #${e.game_id}`;return t?/* @__PURE__ */u(Ml,{iconUrl:Ae(t),gameName:n,height:18,chipColor:a.primary,textColor:a.text,iconColor:a.primaryText,accentColor:r.brand?.accent}):/* @__PURE__ */u("h3",{className:"text-base font-semibold truncate",style:{color:a.text,fontFamily:p},children:n})})(),/* @__PURE__ */m("div",{className:"flex items-center gap-2 mt-0.5",children:[(e.created_at||e.entry_date)&&/* @__PURE__ */u("span",{className:"text-xs",style:{color:a.textMuted},children:kt(e.created_at||e.entry_date)}),x>0&&/* @__PURE__ */m(d,{children:[/* @__PURE__ */u("span",{className:"text-xs",style:{color:a.textMuted},children:"·"}),/* @__PURE__ */u("span",{className:"text-xs font-medium",style:{color:k&&b>0?w>0?a.success:a.error:a.textMuted},children:k&&b>0?`${w}/${x} correct`:`${x} pick${1!==x?"s":""}`})]})]})]}),/* @__PURE__ */m("div",{className:"flex items-center gap-3 flex-shrink-0",children:[
|
|
186
186
|
/* @__PURE__ */m("div",{className:"text-right",children:[yt(e.bet_amount)>0&&/* @__PURE__ */u("p",{className:"text-xs",style:{color:a.textMuted},children:wt(yt(e.bet_amount))}),!v&&yt(e.winning)>0&&/* @__PURE__ */m("p",{className:"text-sm font-bold",style:{color:a.success},children:[wt(yt(e.winning)),(e.payout_jackpot??0)>0&&/* @__PURE__ */m("span",{className:"block text-xs font-normal",style:{color:a.textMuted},children:["incl. ",wt(yt(e.payout_jackpot))," jackpot"]})]})]}),
|
|
187
187
|
/* @__PURE__ */u("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-bold uppercase tracking-wide",style:{backgroundColor:A,color:M},children:B}),z&&/* @__PURE__ */u("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,style:{color:a.textMuted,transition:"transform .2s ease",transform:S?"rotate(180deg)":"none"},children:/* @__PURE__ */u("path",{d:"m6 9 6 6 6-6"})})]})]}),S&&x>0&&/* @__PURE__ */u("div",{className:"border-t divide-y",style:{borderColor:a.border},children:h.map(t=>{const o=(t=>n.get(t)??e.propositions?.find(e=>e.id===t))(t),i=y(t);if(!o)/* @__PURE__ */return m("div",{className:"px-4 py-2.5 flex items-center gap-3",style:{borderColor:a.border},children:[/* @__PURE__ */u("div",{className:"flex-1 min-w-0",children:/* @__PURE__ */m("p",{className:"text-sm",style:{color:a.textMuted},children:["Loading proposition #",t,"…"]})}),null!=i&&/* @__PURE__ */u(Ge,{theme:r,value:"yes"===i?"yes":"no",size:"sm"})]},t);const s=o.result,c=null!=s,d=!!o.is_voided,p=c&&!d&&null!=i&&i===s;let h,f,x;d?(h="Void",f=`${a.textMuted}20`,x=a.textMuted):c?p?(h="Won",f=a.successBg,x=a.successText):(h="Lost",f=a.errorBg,x=a.errorText):(h="Pending",f=a.warningBg,x=a.warningText);const g=Bt(o)?void 0:o.home_team;/* @__PURE__ */
|
|
188
188
|
return m("div",{className:"px-4 py-2.5 flex items-center gap-3",style:{borderColor:a.border},children:[
|
|
189
189
|
/* @__PURE__ */m("div",{className:"flex-1 min-w-0",children:[(o.home_team||o.away_team)&&/* @__PURE__ */m("p",{className:"text-sm font-medium leading-snug flex items-center gap-1.5",style:{color:a.text},children:[l&&g&&l(g),g&&/* @__PURE__ */u("span",{children:g}),g&&o.away_team&&/* @__PURE__ */u("span",{className:"text-xs font-normal",style:{color:a.textMuted},children:"vs"}),l&&o.away_team&&l(o.away_team),o.away_team&&/* @__PURE__ */u("span",{children:o.away_team})]}),(o.proposition||o.description)&&/* @__PURE__ */u("p",{className:"text-xs mt-0.5",style:{color:a.textMuted},children:o.proposition||o.description}),o.commence_time&&/* @__PURE__ */u("p",{className:"text-xs mt-0.5",style:{color:a.textMuted},children:kt(o.commence_time)})]}),
|
|
190
190
|
/* @__PURE__ */m("div",{className:"flex flex-col items-center gap-0.5 flex-shrink-0",children:[/* @__PURE__ */u("span",{className:"text-[9px] uppercase tracking-wide font-semibold",style:{color:a.textMuted},children:"Pick"}),null!=i?/* @__PURE__ */u(Ge,{theme:r,value:"yes"===i?"yes":"no",size:"sm"}):/* @__PURE__ */u("span",{className:"text-xs",style:{color:a.textMuted},children:"—"})]}),
|
|
191
|
-
/* @__PURE__ */m("div",{className:"flex flex-col items-center gap-0.5 flex-shrink-0",children:[/* @__PURE__ */u("span",{className:"text-[9px] uppercase tracking-wide font-semibold",style:{color:a.textMuted},children:"Result"}),/* @__PURE__ */u("span",{className:"px-2 py-0.5 rounded text-xs font-bold uppercase whitespace-nowrap",style:{backgroundColor:f,color:x},children:h})]})]},t)})})]})}function
|
|
191
|
+
/* @__PURE__ */m("div",{className:"flex flex-col items-center gap-0.5 flex-shrink-0",children:[/* @__PURE__ */u("span",{className:"text-[9px] uppercase tracking-wide font-semibold",style:{color:a.textMuted},children:"Result"}),/* @__PURE__ */u("span",{className:"px-2 py-0.5 rounded text-xs font-bold uppercase whitespace-nowrap",style:{backgroundColor:f,color:x},children:h})]})]},t)})})]})}function zl({className:e=""}){const{theme:t,eventFilterActive:n,eventFilterLabel:o,clearEventFilter:r,gameCategory:l}=Kr();if(!n)return null;const a=t.colors,i=o??("racing"===l?"This race":"This event");/* @__PURE__ */
|
|
192
192
|
return m("div",{className:`mb-4 flex flex-col gap-2 rounded-xl border px-3 py-2.5 sm:flex-row sm:items-center sm:justify-between ${e}`,style:{borderColor:`${a.primary}33`,backgroundColor:`${a.surface}`},children:[/* @__PURE__ */m("div",{className:"min-w-0",children:[
|
|
193
193
|
/* @__PURE__ */u("p",{className:"text-[10px] font-bold uppercase tracking-[0.12em]",style:{color:a.primary},children:"Event filter"}),
|
|
194
194
|
/* @__PURE__ */u("p",{className:"truncate text-sm font-semibold",style:{color:a.text},children:i}),
|
|
195
|
-
/* @__PURE__ */u("p",{className:"text-xs",style:{color:a.textMuted},children:"Only propositions from this event are shown."})]}),/* @__PURE__ */u("button",{type:"button",onClick:r,className:"shrink-0 self-start rounded-lg border px-3 py-1.5 text-xs font-semibold transition-opacity hover:opacity-90 sm:self-center",style:{borderColor:`${a.primary}44`,backgroundColor:a.background,color:a.text,cursor:"pointer"},children:"Show all events"})]})}function
|
|
196
|
-
return u("button",{type:"button",onClick:e,className:`inline-flex items-center justify-center rounded-full ${n}`,style:{color:r.textMuted,cursor:"pointer",background:"none",border:"none",padding:0,transition:"color .15s ease, transform .15s ease"},title:t,onMouseEnter:e=>{e.currentTarget.style.color=r.text,e.currentTarget.style.transform="translateX(-2px)"},onMouseLeave:e=>{e.currentTarget.style.color=r.textMuted,e.currentTarget.style.transform="translateX(0)"},children:/* @__PURE__ */m("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[/* @__PURE__ */u("path",{d:"M19 12H5"}),/* @__PURE__ */u("path",{d:"m12 19-7-7 7-7"})]})})}function
|
|
197
|
-
return m("button",{type:"button",onClick:e,className:"mb-3 inline-flex items-center gap-1.5 self-start text-sm font-semibold",style:{color:o.textMuted,background:"none",border:"none",padding:0,cursor:"pointer",transition:"color .15s ease, transform .15s ease"},onMouseEnter:e=>{e.currentTarget.style.color=o.primary,e.currentTarget.style.transform="translateX(-2px)"},onMouseLeave:e=>{e.currentTarget.style.color=o.textMuted,e.currentTarget.style.transform="translateX(0)"},children:[/* @__PURE__ */m("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[/* @__PURE__ */u("path",{d:"M19 12H5"}),/* @__PURE__ */u("path",{d:"m12 19-7-7 7-7"})]}),t]})}function
|
|
198
|
-
return m("div",{className:`pl-0 sm:pl-2 ${e}`,children:[/* @__PURE__ */m("div",{className:"flex items-start justify-between gap-3",children:[/* @__PURE__ */u("h1",{className:"text-lg sm:text-xl md:text-2xl font-bold leading-tight break-words min-w-0",style:{color:R(o),fontFamily:r},children:"Choose your game"}),a?.trim()&&/* @__PURE__ */u(qe,{content:a,title:"How to Play",colors:{text:c.text,textMuted:c.textMuted,border:c.border,background:c.background,backgroundAlt:c.backgroundAlt,primary:c.primary,primaryText:c.primaryText},bodyFont:l,headingFont:r,className:"shrink-0 mt-0.5"})]}),/* @__PURE__ */u(
|
|
199
|
-
/* @__PURE__ */u(
|
|
200
|
-
/* @__PURE__ */u("div",{className:"flex-1",children:/* @__PURE__ */u(
|
|
201
|
-
return m("div",{className:`pl-0 sm:pl-2 ${e}`,children:[/* @__PURE__ */u("h1",{className:"text-[10px] sm:text-xs font-bold uppercase tracking-[0.14em] sm:tracking-[0.18em] mb-3 sm:mb-4",style:{color:l.primary,fontFamily:r},children:"Pick a category"}),/* @__PURE__ */u(
|
|
202
|
-
return m("button",{type:"button",onClick:()=>{d(t),p(null),h(),e?.(t)},className:"group flex flex-col items-start justify-center gap-2 sm:gap-3 rounded-2xl border p-3.5 sm:p-5 text-left transition-all min-h-[112px] sm:min-h-[140px] min-w-0 w-full hover:shadow-md active:scale-[0.98]",style:{backgroundColor:g,borderColor:x.border,cursor:"pointer"},onMouseEnter:e=>{e.currentTarget.style.borderColor=x.primary},onMouseLeave:e=>{e.currentTarget.style.borderColor=x.border},children:[/* @__PURE__ */u(Ve,{label:f(t),category:t,icon:r?.(t),theme:i}),n?/* @__PURE__ */u("span",{className:"text-[10px] sm:text-xs font-medium uppercase tracking-[0.08em] sm:tracking-[0.1em] break-words",style:{color:x.primary},children:n}):null]},t)})})})]})}function
|
|
203
|
-
/* @__PURE__ */u(
|
|
195
|
+
/* @__PURE__ */u("p",{className:"text-xs",style:{color:a.textMuted},children:"Only propositions from this event are shown."})]}),/* @__PURE__ */u("button",{type:"button",onClick:r,className:"shrink-0 self-start rounded-lg border px-3 py-1.5 text-xs font-semibold transition-opacity hover:opacity-90 sm:self-center",style:{borderColor:`${a.primary}44`,backgroundColor:a.background,color:a.text,cursor:"pointer"},children:"Show all events"})]})}function Pl({onBack:e,title:t="Go back",className:n=""}){const{theme:o}=Kr(),r=o.colors;/* @__PURE__ */
|
|
196
|
+
return u("button",{type:"button",onClick:e,className:`inline-flex items-center justify-center rounded-full ${n}`,style:{color:r.textMuted,cursor:"pointer",background:"none",border:"none",padding:0,transition:"color .15s ease, transform .15s ease"},title:t,onMouseEnter:e=>{e.currentTarget.style.color=r.text,e.currentTarget.style.transform="translateX(-2px)"},onMouseLeave:e=>{e.currentTarget.style.color=r.textMuted,e.currentTarget.style.transform="translateX(0)"},children:/* @__PURE__ */m("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[/* @__PURE__ */u("path",{d:"M19 12H5"}),/* @__PURE__ */u("path",{d:"m12 19-7-7 7-7"})]})})}function Tl({onBack:e,label:t="Games"}){const{theme:n}=Kr(),o=n.colors;/* @__PURE__ */
|
|
197
|
+
return m("button",{type:"button",onClick:e,className:"mb-3 inline-flex items-center gap-1.5 self-start text-sm font-semibold",style:{color:o.textMuted,background:"none",border:"none",padding:0,cursor:"pointer",transition:"color .15s ease, transform .15s ease"},onMouseEnter:e=>{e.currentTarget.style.color=o.primary,e.currentTarget.style.transform="translateX(-2px)"},onMouseLeave:e=>{e.currentTarget.style.color=o.textMuted,e.currentTarget.style.transform="translateX(0)"},children:[/* @__PURE__ */m("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[/* @__PURE__ */u("path",{d:"M19 12H5"}),/* @__PURE__ */u("path",{d:"m12 19-7-7 7-7"})]}),t]})}function Dl({onBack:e,hideActions:t,label:n,children:o,className:r=""}){const{theme:l}=Kr(),a=l.colors;return e||null!=n||o?/* @__PURE__ */m("div",{className:`flex items-center gap-1.5 mt-0.5 ${r}`,children:[e&&(null!=n?/* @__PURE__ */m("button",{type:"button",onClick:e,title:"Go back",className:"inline-flex min-w-0 items-center gap-1.5 text-left",style:{color:a.textMuted,background:"none",border:"none",padding:0,cursor:"pointer",transition:"color .15s ease, transform .15s ease"},onMouseEnter:e=>{e.currentTarget.style.color=a.text,e.currentTarget.style.transform="translateX(-2px)"},onMouseLeave:e=>{e.currentTarget.style.color=a.textMuted,e.currentTarget.style.transform="translateX(0)"},children:[/* @__PURE__ */m("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,className:"shrink-0",children:[/* @__PURE__ */u("path",{d:"M19 12H5"}),/* @__PURE__ */u("path",{d:"m12 19-7-7 7-7"})]}),/* @__PURE__ */u("span",{className:"text-xs sm:text-sm break-words min-w-0",children:n})]}):/* @__PURE__ */u(Pl,{onBack:e})),!e&&null!=n&&/* @__PURE__ */u("p",{className:"text-xs sm:text-sm break-words min-w-0",style:{color:a.textMuted},children:n}),o]}):null}function Ol({className:e="",onBack:t,hideActions:n}){const{theme:o,headingFont:r,bodyFont:l,howToPlayMarkdown:a,selectedCategory:i,displayCategoryName:s}=Kr(),c=o.colors;/* @__PURE__ */
|
|
198
|
+
return m("div",{className:`pl-0 sm:pl-2 ${e}`,children:[/* @__PURE__ */m("div",{className:"flex items-start justify-between gap-3",children:[/* @__PURE__ */u("h1",{className:"text-lg sm:text-xl md:text-2xl font-bold leading-tight break-words min-w-0",style:{color:R(o),fontFamily:r},children:"Choose your game"}),a?.trim()&&/* @__PURE__ */u(qe,{content:a,title:"How to Play",colors:{text:c.text,textMuted:c.textMuted,border:c.border,background:c.background,backgroundAlt:c.backgroundAlt,primary:c.primary,primaryText:c.primaryText},bodyFont:l,headingFont:r,className:"shrink-0 mt-0.5"})]}),/* @__PURE__ */u(Dl,{onBack:t,hideActions:n,label:i?s(i):void 0})]})}function El({onCancel:e,className:t=""}){const{theme:n,screenSize:o}=Kr(),r=n.colors;return e&&"mobile"!==o?/* @__PURE__ */u("div",{className:`flex items-center pt-4 ${t}`,children:/* @__PURE__ */u("button",{type:"button",onClick:e,className:"px-5 py-2.5 rounded-lg text-sm font-medium transition-colors",style:{color:r.buttonSecondaryText,backgroundColor:r.buttonSecondary,cursor:"pointer"},children:"Cancel"})}):null}function jl({onSelectGame:t,onGameSetup:n,onRuleSetup:o,onGameSetBet:r,onPickYourDividend:l,onLadder:a,onMirror:i,onSafetyNet:s,onQuickPick:c,onCancel:d,hideTitle:p,hideActions:h,showPerfectPickSetup:f=!1,showTierFilter:x=!1,className:g=""}){const y=Kr(),{theme:b,games:w,loading:k,error:v,selectedGame:N,selectedPropositionCount:C,handlePropositionCountChange:F,maxPayouts:B}=y;b.colors;const A=e.useRef(N);return A.current=N,/* @__PURE__ */m("div",{className:`flex flex-col min-h-full ${g}`,style:{fontFamily:y.bodyFont},children:[!p&&/* @__PURE__ */u("div",{className:"mb-4 sm:mb-6",children:/* @__PURE__ */u(Ol,{onBack:d,hideActions:h})}),
|
|
199
|
+
/* @__PURE__ */u(zl,{}),
|
|
200
|
+
/* @__PURE__ */u("div",{className:"flex-1",children:/* @__PURE__ */u(fr,{games:w,selectedGame:N,onSelectGame:e=>{A.current=e,y.selectGame(e)},loading:k,error:v,theme:b,showTierFilter:x,selectedPropositionCount:C,onPropositionCountChange:F,onPropositionCountSelected:()=>{const e=A.current;if("rule_setup"===er(e)&&nr(e)&&!f)return y.goToSportSelection(),void t?.();const c=er(e);if("quick_pick"===c||"selections"===c)return y.goToSportSelection(),void t?.();n?n(c):({game_set:r,pick_your_dividend:l,ladder:a,mirror:i,safety_net:s,rule_setup:o}[c]??o)?.()},onQuickPickGame:(e,t)=>{y.quickPickGame(e,t),c?.()},maxPayouts:B})})]})}function Yl({className:e="",onBack:t,hideActions:n}){const{theme:o}=Kr(),r=be(o),l=o.colors;/* @__PURE__ */
|
|
201
|
+
return m("div",{className:`pl-0 sm:pl-2 ${e}`,children:[/* @__PURE__ */u("h1",{className:"text-[10px] sm:text-xs font-bold uppercase tracking-[0.14em] sm:tracking-[0.18em] mb-3 sm:mb-4",style:{color:l.primary,fontFamily:r},children:"Pick a category"}),/* @__PURE__ */u(Dl,{onBack:t,hideActions:n})]})}function Hl({onCancel:e,className:t=""}){const{theme:n,screenSize:o}=Kr(),r=n.colors;return e&&"mobile"!==o?/* @__PURE__ */u("div",{className:`flex items-center pt-4 ${t}`,children:/* @__PURE__ */u("button",{type:"button",onClick:e,className:"px-5 py-2.5 rounded-lg text-sm font-medium transition-colors",style:{color:r.buttonSecondaryText,backgroundColor:r.buttonSecondary,cursor:"pointer"},children:"Cancel"})}):null}function Rl({onSelectCategory:e,onCancel:t,hideTitle:n,hideActions:o,renderCategoryIcon:r,getCategoryTagline:l,className:a=""}){const{theme:i,propositionsForCategoryPicker:s,loading:c,setSelectedCategory:d,setSelectedSport:p,clearSelectedGame:h,displayCategoryName:f}=Kr(),x=i.colors,g=V(i),y=ye(i);At(s);const b=Mt(s);return c?/* @__PURE__ */u(vn,{colors:J(i),bodyFont:y,className:a,variant:"category",categoryCount:b.length>0?b.length:2}):/* @__PURE__ */m("div",{className:`flex flex-col min-h-full ${a}`,style:{fontFamily:y},children:[!n&&/* @__PURE__ */u("div",{className:"mb-2",children:/* @__PURE__ */u(Yl,{onBack:t,hideActions:o})}),/* @__PURE__ */u("div",{className:"flex-1",children:/* @__PURE__ */u("div",{className:"grid grid-cols-1 min-[400px]:grid-cols-2 gap-2.5 sm:gap-3",children:b.map(t=>{const n=l?.(t)??function(e){return pt[e]??""}(t);/* @__PURE__ */
|
|
202
|
+
return m("button",{type:"button",onClick:()=>{d(t),p(null),h(),e?.(t)},className:"group flex flex-col items-start justify-center gap-2 sm:gap-3 rounded-2xl border p-3.5 sm:p-5 text-left transition-all min-h-[112px] sm:min-h-[140px] min-w-0 w-full hover:shadow-md active:scale-[0.98]",style:{backgroundColor:g,borderColor:x.border,cursor:"pointer"},onMouseEnter:e=>{e.currentTarget.style.borderColor=x.primary},onMouseLeave:e=>{e.currentTarget.style.borderColor=x.border},children:[/* @__PURE__ */u(Ve,{label:f(t),category:t,icon:r?.(t),theme:i}),n?/* @__PURE__ */u("span",{className:"text-[10px] sm:text-xs font-medium uppercase tracking-[0.08em] sm:tracking-[0.1em] break-words",style:{color:x.primary},children:n}):null]},t)})})})]})}function Gl(e){if(!e)return"Start time to be confirmed";const t=new Date(e);return Number.isNaN(t.getTime())?e:new Intl.DateTimeFormat(void 0,{weekday:"short",day:"numeric",month:"short",hour:"numeric",minute:"2-digit"}).format(t)}function Wl({name:e,renderTeamLogo:t,muted:n}){return e?/* @__PURE__ */m("span",{className:"inline-flex min-w-0 max-w-full items-center gap-1.5",children:[t?.(e),/* @__PURE__ */u("span",{className:"break-words text-sm font-semibold sm:text-base",children:e})]}):/* @__PURE__ */u("span",{className:"text-sm font-semibold",style:{color:n},children:"TBC"})}function Il({onSelectEvent:t,className:n=""}){const{theme:o,loading:r,sameGameMultiEvents:l,selectSameGameMultiEvent:a,renderTeamLogo:i,displaySportName:s}=Kr(),[c,d]=e.useState(null),p=o.colors,h=ye(o),f=be(o),x=V(o),g=X(o);return r?/* @__PURE__ */u(vn,{colors:J(o),bodyFont:h,className:n,variant:"event"}):/* @__PURE__ */m("section",{className:n,"aria-label":"Available fixtures",style:{fontFamily:h},children:[/* @__PURE__ */u("p",{className:"mb-4 text-sm leading-relaxed",style:{color:p.textMuted},children:"All picks in your multi must come from one game."}),0===l.length?/* @__PURE__ */u("div",{role:"status",className:"rounded-2xl border p-6 text-center text-sm",style:{borderColor:p.border,backgroundColor:x,color:p.textMuted},children:"No fixtures with available propositions."}):/* @__PURE__ */u("div",{className:"grid grid-cols-1 gap-2.5 sm:gap-3",children:l.map(e=>/* @__PURE__ */m("button",{type:"button","aria-label":`Select ${Nn(e)}`,onClick:()=>{a(e.id),t?.(e.id)},className:"group flex min-h-16 w-full min-w-0 items-center justify-between gap-3 rounded-2xl border px-3.5 py-3.5 text-left transition-all hover:shadow-md active:scale-[0.99] sm:px-5 sm:py-4",style:{borderColor:p.border,backgroundColor:x,boxShadow:c===e.id?H(o):"none",color:p.text,cursor:"pointer"},onMouseEnter:e=>{e.currentTarget.style.borderColor=p.primary},onMouseLeave:e=>{e.currentTarget.style.borderColor=p.border},onFocus:t=>{d(e.id),t.currentTarget.style.borderColor=p.primary},onBlur:e=>{d(null),e.currentTarget.style.borderColor=p.border},children:[/* @__PURE__ */m("div",{className:"min-w-0 flex-1",children:[/* @__PURE__ */m("div",{className:"flex flex-col items-start gap-1 rounded-xl px-3 py-2.5 sm:flex-row sm:flex-wrap sm:items-center sm:gap-x-1.5",style:{backgroundColor:g,color:p.text,fontFamily:f},children:[
|
|
203
|
+
/* @__PURE__ */u(Wl,{name:e.homeTeam,renderTeamLogo:i,muted:p.textMuted}),
|
|
204
204
|
/* @__PURE__ */u("span",{className:"text-xs font-normal",style:{color:p.textMuted},children:"vs"}),
|
|
205
|
-
/* @__PURE__ */u(
|
|
206
|
-
return m("div",{ref:
|
|
205
|
+
/* @__PURE__ */u(Wl,{name:e.awayTeam,renderTeamLogo:i,muted:p.textMuted})]}),/* @__PURE__ */m("p",{className:"mt-2 text-[11px] font-medium sm:text-xs",style:{color:p.textMuted},children:[Gl(e.commenceTime)," · ",e.propositionCount," proposition",1===e.propositionCount?"":"s",(e.league||e.sport)&&` · ${e.league?.toUpperCase()??s(e.sport)}`]})]}),/* @__PURE__ */u(Je,{size:22,color:p.textMuted,className:"shrink-0 transition-transform group-hover:translate-x-0.5"})]},e.id))})]})}function Ul({counts:t,onPick:n,onDoubleAction:o,colors:r,align:l="right",direction:a="down",menuShadow:i="0 1px 0 rgba(255,255,255,0.6) inset, 0 20px 50px -24px rgba(15,23,42,0.22)"}){const[s,c]=e.useState(!1),[d,h]=e.useState(null),f=e.useRef(null),x=e.useRef(null),g=e.useRef(null),y=36+36*t.length+12;e.useEffect(()=>{if(!s)return void h(null);const e=f.current,t=e=>{const t=x.current;if(!t)return e;const n=t.offsetHeight-t.clientHeight,o=t.firstElementChild?.getBoundingClientRect().height??0,r=t.querySelector('[role="menuitem"]')?.getBoundingClientRect().height??0,l=Math.floor((e-n-o)/r);return r>0&&l>=1?n+o+l*r:e},n=()=>{if(!e||"undefined"==typeof window)return;const n=x.current;h(function({trigger:e,viewport:t,wanted:n,width:o,align:r,direction:l,snap:a}){const{height:i,width:s}=t,c=i-Math.max(e.bottom,0)-6-8,d=Math.min(e.top,i)-6-8,u="up"===l||n>c&&d>c,m=u?d:c,p=Math.max(i-16,132),h=n<=m?n:Math.min(n,a?a(p):p),f=u?e.top-6-h:e.bottom+6,x="left"===r?e.left:e.right-o;return{top:Math.max(8,Math.min(f,i-8-h)),left:Math.max(8,Math.min(x,s-8-o)),maxHeight:h}}({trigger:e.getBoundingClientRect(),viewport:{width:document.documentElement.clientWidth||window.innerWidth,height:document.documentElement.clientHeight||window.innerHeight},wanted:n?n.scrollHeight+n.offsetHeight-n.clientHeight:y,width:n?.offsetWidth??160,align:l,direction:a,snap:t}))};n();const o=requestAnimationFrame(n);window.addEventListener("resize",n),window.addEventListener("scroll",n,!0);const r=e=>{const t=e.target;f.current?.contains(t)||x.current?.contains(t)||c(!1)};return document.addEventListener("mousedown",r),()=>{cancelAnimationFrame(o),window.removeEventListener("resize",n),window.removeEventListener("scroll",n,!0),document.removeEventListener("mousedown",r)}},[s,y,l,a]);const b=s?/* @__PURE__ */m("div",{ref:x,role:"menu",className:"rounded-lg overflow-y-auto overscroll-contain",style:{position:"fixed",top:d?.top??0,left:d?.left??0,maxHeight:d?.maxHeight,visibility:d?"visible":"hidden",zIndex:20,backgroundColor:r.background,border:`1px solid ${r.border}`,boxShadow:i,minWidth:160},children:[/* @__PURE__ */u("div",{className:"px-3 py-1.5 text-[10px] font-bold tracking-wider uppercase",style:{color:r.text,opacity:.55,borderBottom:`1px solid ${r.border}`},children:"How many picks?"}),t.map(e=>/* @__PURE__ */m("button",{type:"button",role:"menuitem",onClick:()=>{n(e),c(!1)},className:"w-full flex items-center justify-between px-3 py-2 transition-colors",style:{background:"transparent",border:"none",cursor:"pointer",borderTop:`1px solid ${r.border}`},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=r.backgroundAlt},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent"},children:[/* @__PURE__ */m("span",{className:"text-sm font-semibold",style:{color:r.text},children:[e," picks"]}),/* @__PURE__ */u("span",{className:"text-[10px] font-bold tracking-wider",style:{background:r.backgroundAlt,color:r.text,padding:"2px 6px",borderRadius:4},children:"QP"})]},e))]}):null;/* @__PURE__ */
|
|
206
|
+
return m("div",{ref:f,className:"flex-shrink-0 relative",children:[/* @__PURE__ */u(qr,{onPress:()=>{o?null==g.current&&(g.current=window.setTimeout(()=>{g.current=null,c(e=>!e)},220)):c(e=>!e)},onDoubleClick:o?()=>{null!=g.current&&(window.clearTimeout(g.current),g.current=null),c(!1),o?.()}:void 0}),b&&"undefined"!=typeof document?p(b,document.body):null]})}var $l="Your stake";function Kl(e,t,n){const o=n?.stake&&n.stake>0?n.stake:20;if(Mo(n?.game)){const e=sr(n?.game??null,t,o);if(e>0)return e/o*20}const r=e?.top_payouts?.find(e=>Number(e.proposition_count)===t),l=r?.bet_amount&&r.bet_amount>0?r.bet_amount:20,a=Number(r?.net_payout);return r&&Number.isFinite(a)&&a>0?a/l*20:sr(n?.game??null,t,o,{expectedCorrect:n?.expectedCorrect})/o*20}function Zl({gameKey:e,short:t,size:n=56,footer:o="YESNO Multi",className:r,title:l,sportBaseKey:a}){const i=ht(e,a,t),s=function(e){return e.length<=3?92:4===e.length?72:56}(i),c=l??`${i} button`;/* @__PURE__ */
|
|
207
207
|
return m("svg",{viewBox:"0 0 360 360",width:n,height:n,xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid meet",className:r,role:"img","aria-label":c,children:[
|
|
208
208
|
/* @__PURE__ */u("title",{children:c}),
|
|
209
209
|
/* @__PURE__ */u("rect",{x:"2",y:"2",width:"356",height:"356",rx:"78",fill:"#DDD9D2",stroke:ut,strokeWidth:"4"}),
|
|
210
210
|
/* @__PURE__ */u("rect",{x:"50",y:"10",width:"260",height:"260",rx:"52",fill:ut,opacity:"0.30"}),
|
|
211
211
|
/* @__PURE__ */u("rect",{x:"50",y:"35",width:"260",height:"260",rx:"52",fill:ut,opacity:"0.55"}),
|
|
212
212
|
/* @__PURE__ */u("rect",{x:"50",y:"60",width:"260",height:"260",rx:"52",fill:ut}),
|
|
213
|
-
/* @__PURE__ */u("text",{x:"180",y:"220",fontFamily:"Manrope, Poppins, sans-serif",fontSize:s,letterSpacing:"-3",textAnchor:"middle",fontWeight:800,fill:"#DFFF1A",children:i}),o&&/* @__PURE__ */m(d,{children:[/* @__PURE__ */u("text",{x:"180",y:"345",fontFamily:"Manrope, Poppins, sans-serif",fontSize:"24",letterSpacing:"-0.5",textAnchor:"middle",fontWeight:700,fill:ut,children:o}),/* @__PURE__ */u("text",{x:"262",y:"333",fontFamily:"Manrope, Poppins, sans-serif",fontSize:"10",fontWeight:600,fill:ut,children:"TM"})]})]})}var
|
|
213
|
+
/* @__PURE__ */u("text",{x:"180",y:"220",fontFamily:"Manrope, Poppins, sans-serif",fontSize:s,letterSpacing:"-3",textAnchor:"middle",fontWeight:800,fill:"#DFFF1A",children:i}),o&&/* @__PURE__ */m(d,{children:[/* @__PURE__ */u("text",{x:"180",y:"345",fontFamily:"Manrope, Poppins, sans-serif",fontSize:"24",letterSpacing:"-0.5",textAnchor:"middle",fontWeight:700,fill:ut,children:o}),/* @__PURE__ */u("text",{x:"262",y:"333",fontFamily:"Manrope, Poppins, sans-serif",fontSize:"10",fontWeight:600,fill:ut,children:"TM"})]})]})}var ql="yesno:favourite-sport",Vl=null;function Xl(){try{return globalThis.localStorage??null}catch{return null}}function Ql({label:t="Pick your sport",sublabel:n,renderSportLogo:o,className:r=""}){const{theme:l,sportOptions:a,sportSummaries:i,selectedSport:s,setSelectedSport:c,sportBaseKey:d,displaySportName:p,selections:h,toggleSelection:f,enableSportFavourites:x}=Kr(),g=l.colors,y=V(l),b=ye(l),w=be(l),k=R(l),v=$(l),[N,C]=e.useState(null);if(e.useEffect(()=>{C(x?function(){try{const e=Xl()?.getItem(ql);if(e)return e}catch{}return Vl}():null)},[x]),a.length<2)return null;const F=N?[...a].sort((e,t)=>Number(t.key===N)-Number(e.key===N)):a,B=void 0===n?x?"Tap to select. Star your favourite to pin it up front.":"Tap to select.":n;/* @__PURE__ */
|
|
214
214
|
return m("div",{className:`min-w-0 ${r}`,style:{fontFamily:b},children:[t&&/* @__PURE__ */u("div",{className:"pl-0.5 text-sm font-extrabold leading-tight tracking-tight",style:{color:k,fontFamily:w},children:t}),B&&/* @__PURE__ */u("div",{className:"mb-1.5 pl-0.5 text-[12px] leading-snug",style:{color:g.textMuted},children:B}),
|
|
215
215
|
/* @__PURE__ */u(tt,{theme:l,itemCount:F.length,contentClassName:"gap-2.5 px-0.5 pb-2.5 pt-1",children:e=>F.map(({key:t})=>{const n=i.find(e=>e.key===t),r=n?.games_today??0,a=s===t,b=N===t,F=n?.label??p(t);/* @__PURE__ */
|
|
216
|
-
return m("div",{className:"relative flex-none",style:{width:88},children:[/* @__PURE__ */m("button",{type:"button","aria-pressed":a,onClick:()=>{e()||(e=>{if(e!==s){for(const e of Object.keys(h)){const t=Number(e);f(t,h[t])}c(e)}})(t)},className:"flex w-full flex-col items-center gap-1.5 rounded-2xl border px-1.5 pb-2 text-center transition-transform active:scale-[0.97]",style:{minHeight:44,paddingTop:x?26:12,backgroundColor:y,borderColor:a?g.primary:g.border,boxShadow:a?`inset 0 0 0 2px ${g.primary}, ${j(l)}`:j(l),cursor:"pointer"},children:[/* @__PURE__ */m("span",{className:"relative block leading-none",children:[o?o(t):/* @__PURE__ */u(
|
|
217
|
-
return u("span",{"aria-hidden":!0,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:t,height:t,borderRadius:.3*t,backgroundColor:r,border:`1px solid ${
|
|
216
|
+
return m("div",{className:"relative flex-none",style:{width:88},children:[/* @__PURE__ */m("button",{type:"button","aria-pressed":a,onClick:()=>{e()||(e=>{if(e!==s){for(const e of Object.keys(h)){const t=Number(e);f(t,h[t])}c(e)}})(t)},className:"flex w-full flex-col items-center gap-1.5 rounded-2xl border px-1.5 pb-2 text-center transition-transform active:scale-[0.97]",style:{minHeight:44,paddingTop:x?26:12,backgroundColor:y,borderColor:a?g.primary:g.border,boxShadow:a?`inset 0 0 0 2px ${g.primary}, ${j(l)}`:j(l),cursor:"pointer"},children:[/* @__PURE__ */m("span",{className:"relative block leading-none",children:[o?o(t):/* @__PURE__ */u(Zl,{gameKey:t,size:40,footer:null,sportBaseKey:d,title:`${F} button`}),r>0&&/* @__PURE__ */u("span",{"aria-hidden":!0,className:"absolute -right-0.5 -top-0.5 h-2.5 w-2.5 rounded-full",style:{backgroundColor:g.success,border:`2px solid ${y}`}})]}),/* @__PURE__ */u("span",{className:"line-clamp-2 max-w-full text-[11px] font-extrabold leading-tight tracking-tight",style:{color:a?k:g.text,fontFamily:w},children:F})]}),x&&/* @__PURE__ */u("button",{type:"button","aria-pressed":b,"aria-label":b?`Unpin ${F}`:`Pin ${F} to the front`,onClick:()=>{e()||(e=>{const t=N===e?null:e;C(t),function(e){Vl=e;try{e?Xl()?.setItem(ql,e):Xl()?.removeItem(ql)}catch{}}(t)})(t)},className:"absolute left-0 top-0 z-[1] flex h-8 w-8 items-center justify-center active:scale-90",style:{background:"none",border:"none",padding:0,cursor:"pointer"},children:/* @__PURE__ */u("span",{className:"flex h-5 w-5 items-center justify-center rounded-full border",style:{backgroundColor:b?z(v,.22):y,borderColor:b?v:g.border},children:/* @__PURE__ */u(et,{size:12,filled:b,color:b?k:z(g.textMuted,.6)})})})]},t)})})]})}function Jl(e,t){const n=/^#([0-9a-f]{6})$/i.exec(e?.trim()??"");if(!n)return e;const o=parseInt(n[1],16);return`rgba(${o>>16&255}, ${o>>8&255}, ${255&o}, ${t})`}function _l({iconUrl:e,size:t=56}){const{theme:n}=Kr(),o=n.colors,r=n.brand?.chip??o.primary,l=n.brand?.icon??o.primaryText,a=K(r,$(n),l);/* @__PURE__ */
|
|
217
|
+
return u("span",{"aria-hidden":!0,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:t,height:t,borderRadius:.3*t,backgroundColor:r,border:`1px solid ${Jl(l,.16)}`,flexShrink:0,boxShadow:`0 8px 18px -12px ${Jl(r,.9)}`},children:/* @__PURE__ */u(on,{iconUrl:e,width:Math.round(.68*t),height:Math.round(.68*t),iconColor:l,accentColor:a})})}function ea({eyebrow:e,iconUrl:t,gameName:n,tagline:o,className:r=""}){const{theme:l,screenSize:a}=Kr(),i=l.colors,s=be(l),c="mobile"===a;/* @__PURE__ */
|
|
218
218
|
return m("header",{className:`mb-4 flex flex-col items-center text-center sm:mb-7 ${r}`,children:[e&&/* @__PURE__ */u("h2",{className:"mb-4 hidden text-center text-xs font-bold uppercase tracking-[0.18em] sm:mb-5 sm:block",style:{color:i.primary,fontFamily:s},children:e}),
|
|
219
|
-
/* @__PURE__ */u(
|
|
220
|
-
return u(
|
|
221
|
-
return u("div",{role:"radiogroup","aria-label":t,className:`blade-gmc-strip -mx-1 flex snap-x snap-mandatory gap-2 overflow-x-auto px-1 pb-1 sm:mx-0 sm:grid sm:overflow-visible sm:px-0 sm:pb-0 ${e}`,children:n})}var
|
|
222
|
-
return m("span",{className:"flex items-center gap-[3px]","aria-hidden":!0,children:[Array.from({length:e}).map((e,t)=>/* @__PURE__ */u("span",{style:{width:5,height:5,borderRadius:1.5,backgroundColor:o,opacity:.85}},t)),t&&/* @__PURE__ */u("span",{style:{width:7,height:7,borderRadius:999,backgroundColor:r,marginLeft:2}})]})}function
|
|
223
|
-
return m("div",{className:"blade-gmc-card flex h-full flex-col rounded-3xl border-2 px-3.5 py-3.5 sm:px-5 sm:py-5",style:{backgroundColor:p,borderColor:i.border,boxShadow:`0 10px 24px -20px ${
|
|
224
|
-
/* @__PURE__ */m("div",{className:"flex min-w-0 flex-1 flex-col gap-1 sm:gap-1.5",children:[/* @__PURE__ */m("span",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[/* @__PURE__ */u("span",{className:"text-base font-extrabold leading-tight tracking-tight sm:text-xl",style:{color:c,fontFamily:s},children:t}),n&&/* @__PURE__ */u("span",{className:"rounded-full px-2 py-0.5 text-[9px] font-bold uppercase tracking-[0.08em]",style:{backgroundColor:
|
|
225
|
-
/* @__PURE__ */u("span",{className:"shrink-0 self-center transition-transform group-hover:translate-x-0.5",style:{color:d},"aria-hidden":!0,children:/* @__PURE__ */u("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */u("path",{d:"m9 6 6 6-6 6"})})})]}),l&&/* @__PURE__ */u("div",{className:"mt-3 border-t pt-3",style:{borderColor:
|
|
226
|
-
return u("style",{id:"blade-gmc-styles",children:"\n.blade-gmc-card{transition:transform .18s cubic-bezier(.2,.8,.2,1),box-shadow .18s cubic-bezier(.2,.8,.2,1),border-color .18s cubic-bezier(.2,.8,.2,1)}\n.blade-gmc-strip{scrollbar-width:none}\n.blade-gmc-strip::-webkit-scrollbar{display:none}\n.blade-gmc-card:hover{transform:translateY(-2px)}\n.blade-gmc-card:active{transform:translateY(0) scale(.995)}\n@media (prefers-reduced-motion:reduce){.blade-gmc-card{transition:none}}\n"})}function
|
|
227
|
-
return m("div",{className:`flex items-center justify-between gap-3 pl-2 ${e}`,children:[/* @__PURE__ */m("div",{children:[/* @__PURE__ */u("h1",{className:"text-xl sm:text-2xl font-bold",style:{color:R(r),fontFamily:l},children:
|
|
219
|
+
/* @__PURE__ */u(Ml,{iconUrl:t,gameName:n,height:c?20:32,chipColor:i.primary,textColor:i.text,iconColor:i.primaryText,accentColor:l.brand?.accent,compact:c}),o&&/* @__PURE__ */u("p",{className:"mt-2 max-w-sm text-[13px] leading-snug sm:mt-3 sm:text-[15px] sm:leading-relaxed",style:{color:i.textMuted},children:o})]})}function ta({className:e=""}){/* @__PURE__ */
|
|
220
|
+
return u(Ql,{className:`mb-4 ${e}`})}function na({smGridClassName:e,ariaLabel:t,children:n}){/* @__PURE__ */
|
|
221
|
+
return u("div",{role:"radiogroup","aria-label":t,className:`blade-gmc-strip -mx-1 flex snap-x snap-mandatory gap-2 overflow-x-auto px-1 pb-1 sm:mx-0 sm:grid sm:overflow-visible sm:px-0 sm:pb-0 ${e}`,children:n})}var oa="w-[124px] shrink-0 snap-start sm:w-auto sm:shrink";function ra({legs:e,prizeBall:t=!0}){const{theme:n}=Kr(),o=n.colors.primary,r=$(n);/* @__PURE__ */
|
|
222
|
+
return m("span",{className:"flex items-center gap-[3px]","aria-hidden":!0,children:[Array.from({length:e}).map((e,t)=>/* @__PURE__ */u("span",{style:{width:5,height:5,borderRadius:1.5,backgroundColor:o,opacity:.85}},t)),t&&/* @__PURE__ */u("span",{style:{width:7,height:7,borderRadius:999,backgroundColor:r,marginLeft:2}})]})}function la({tile:e,label:t,stat:n,detail:o,onSelect:r,children:l}){const{theme:a}=Kr(),i=a.colors,s=be(a),c=R(a),d=i.primary,p=i.selectionCard??i.backgroundAlt;/* @__PURE__ */
|
|
223
|
+
return m("div",{className:"blade-gmc-card flex h-full flex-col rounded-3xl border-2 px-3.5 py-3.5 sm:px-5 sm:py-5",style:{backgroundColor:p,borderColor:i.border,boxShadow:`0 10px 24px -20px ${Jl(c,.7)}`},onMouseEnter:e=>{e.currentTarget.style.borderColor=d,e.currentTarget.style.boxShadow=`0 18px 36px -24px ${Jl(d,.95)}`},onMouseLeave:e=>{e.currentTarget.style.borderColor=i.border,e.currentTarget.style.boxShadow=`0 10px 24px -20px ${Jl(c,.7)}`},children:[/* @__PURE__ */m("button",{type:"button",onClick:r,className:"group flex w-full flex-1 items-start gap-3.5 text-left sm:gap-4",style:{background:"none",border:"none",padding:0,cursor:"pointer"},children:[e,
|
|
224
|
+
/* @__PURE__ */m("div",{className:"flex min-w-0 flex-1 flex-col gap-1 sm:gap-1.5",children:[/* @__PURE__ */m("span",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[/* @__PURE__ */u("span",{className:"text-base font-extrabold leading-tight tracking-tight sm:text-xl",style:{color:c,fontFamily:s},children:t}),n&&/* @__PURE__ */u("span",{className:"rounded-full px-2 py-0.5 text-[9px] font-bold uppercase tracking-[0.08em]",style:{backgroundColor:Jl(d,.12),color:d},children:n})]}),o&&o.length>0&&/* @__PURE__ */u("div",{className:"flex flex-col gap-0.5",children:o.map((e,t)=>/* @__PURE__ */u("span",{className:"text-xs leading-snug sm:text-[13px] "+(0===t?"":"hidden sm:block"),style:{color:i.textMuted},children:e},e))})]}),
|
|
225
|
+
/* @__PURE__ */u("span",{className:"shrink-0 self-center transition-transform group-hover:translate-x-0.5",style:{color:d},"aria-hidden":!0,children:/* @__PURE__ */u("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */u("path",{d:"m9 6 6 6-6 6"})})})]}),l&&/* @__PURE__ */u("div",{className:"mt-3 border-t pt-3",style:{borderColor:Jl(c,.08)},children:l})]})}function aa(){/* @__PURE__ */
|
|
226
|
+
return u("style",{id:"blade-gmc-styles",children:"\n.blade-gmc-card{transition:transform .18s cubic-bezier(.2,.8,.2,1),box-shadow .18s cubic-bezier(.2,.8,.2,1),border-color .18s cubic-bezier(.2,.8,.2,1)}\n.blade-gmc-strip{scrollbar-width:none}\n.blade-gmc-strip::-webkit-scrollbar{display:none}\n.blade-gmc-card:hover{transform:translateY(-2px)}\n.blade-gmc-card:active{transform:translateY(0) scale(.995)}\n@media (prefers-reduced-motion:reduce){.blade-gmc-card{transition:none}}\n"})}function ia({className:e="",onBack:t,onNext:n,hideActions:o}){const{theme:r,headingFont:l,bodyFont:a,selectedGame:i,propositions:s,selectedPropositionCount:c,disableQuickPick:d,answeredCount:p,goToConfirmation:h,quickPickSelections:f,selectedEventId:x,sameGameMultiEvents:g,selectSameGameMultiEvent:y,selectedRule:b,howToPlayMarkdown:w,maxPayouts:k}=Kr(),v=r.colors,N=Ee(i),C=dr(i??{},i?k?.[i.id]:void 0),F=Fn(i)&&!x,B=g.find(e=>e.id===x),A=i?zt(i,c,b):{min:0,max:0},M=A.min,S=Fn(i)&&x?Math.min(A.max,s.length):A.max,L=M>0&&M===S,z=!!(i?.allowed_propositions&&i.allowed_propositions.length>0),P=rr(i,c),T=!lr(i)&&!z&&M>0&&S>M,D=P??(L?S:S||s.length),O=e=>{const t=e??D;return!(f(t)<t||(h(),n?.(),0))},E=!d&&s.length>0,j=T?Array.from({length:S-M+1},(e,t)=>M+t).filter(e=>e<=s.length):[],H=p>0?p:M||D;/* @__PURE__ */
|
|
227
|
+
return m("div",{className:`flex items-center justify-between gap-3 pl-2 ${e}`,children:[/* @__PURE__ */m("div",{children:[/* @__PURE__ */u("h1",{className:"text-xl sm:text-2xl font-bold",style:{color:R(r),fontFamily:l},children:F?"Choose a Game":"Select Propositions"}),i&&/* @__PURE__ */u(Dl,{onBack:x?()=>y(null):t,hideActions:o,label:B?Nn(B):i.game_name,children:(N||w?.trim())&&/* @__PURE__ */u(qe,{variant:"icon",content:w,panel:N,theme:r,title:`${i.game_name} — How to Play`,extra:/* @__PURE__ */u(ur,{tiers:C.hasGenericDividends?C.tiers:[],modes:C.modes,pydDividends:C.pydDividends,minBet:C.minBet,maxBet:C.maxBet,colors:v,bodyFont:a,headingFont:l}),colors:{text:v.text,textMuted:v.textMuted,border:v.border,background:v.background,backgroundAlt:v.backgroundAlt,primary:v.primary,primaryText:v.primaryText},bodyFont:a,headingFont:l})})]}),E&&(j.length>1?/* @__PURE__ */u(Ul,{counts:j,onPick:e=>O(e),onDoubleAction:()=>O(H),colors:v,menuShadow:Y(r)}):/* @__PURE__ */u("div",{className:"flex-shrink-0",children:/* @__PURE__ */u(qr,{onPress:()=>O()})}))]})}function sa({number:e,color:t,size:n=34,label:o,selected:r,onSelect:l}){const a=(e,o)=>({position:"absolute",left:e,top:.4*e,width:n,height:n,borderRadius:.26*n,backgroundColor:t,opacity:o});/* @__PURE__ */
|
|
228
228
|
return m("button",{type:"button","aria-label":o,"aria-pressed":r,onClick:l,style:{position:"relative",width:n+.2*n,height:1.3*n,flex:"0 0 auto",padding:0,border:"none",background:"none",cursor:"pointer",animation:"blade-slip-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1)"},children:[
|
|
229
229
|
/* @__PURE__ */u("span",{style:a(.44*n,.3)}),
|
|
230
230
|
/* @__PURE__ */u("span",{style:a(.22*n,.55)}),
|
|
231
|
-
/* @__PURE__ */u("span",{style:{position:"absolute",left:0,top:0,width:n,height:n,borderRadius:.26*n,backgroundColor:t,color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",fontSize:n*(e>9?.42:.5),fontWeight:800,letterSpacing:"-0.02em",boxShadow:r?"inset 0 0 0 2px #fff":"none"},children:e})]})}function
|
|
231
|
+
/* @__PURE__ */u("span",{style:{position:"absolute",left:0,top:0,width:n,height:n,borderRadius:.26*n,backgroundColor:t,color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",fontSize:n*(e>9?.42:.5),fontWeight:800,letterSpacing:"-0.02em",boxShadow:r?"inset 0 0 0 2px #fff":"none"},children:e})]})}function ca({onNext:t,onBack:n,hideButtons:o=!1,className:r=""}){const{theme:l,headingFont:a,selectedGame:i,selectedPropositionCount:s,selectedEventId:c,propositions:p,goToConfirmation:h,selectedRule:f,maxPayouts:x,betAmount:g,setBetAmount:y,selections:b,expectedCorrect:w,gamePrice:k,toggleSelection:v}=Kr(),N=l.colors,C=i?zt(i,s,f):{min:0,max:0},F=rr(i,s),B=F??C.min,A=F??(Fn(i)&&c?Math.min(C.max,p.length):C.max),M=e.useRef(!1);e.useEffect(()=>{M.current=!1},[i?.id]),e.useEffect(()=>{g<=0&&!M.current&&y(Math.max(20,k))},[g,k,y]);const S=e.useRef([]);S.current=function(e,t){const n=Object.keys(t).map(Number),o=new Set(n),r=e.filter(e=>o.has(e)),l=n.filter(e=>!r.includes(e)).sort((e,t)=>e-t);return 0===l.length&&r.length===e.length?e:[...r,...l]}(S.current,b);const L=function({selections:e,order:t,minReq:n,maxReq:o,stake:r,payout20:l=0}){const a=[];for(const u of t){const t=e[u];t&&a.push({id:u,number:a.length+1,side:t})}const i=a.length,s=i>=n,c=Math.max(0,n-i),d=s||o>0&&n===o?l*(r/20):0;return{legs:a,count:i,dividend:d,dividendText:wt(d),ctaLabel:s?`Continue with ${i} ›`:0===i?`Select at least ${n}`:`Add ${c} more to continue`,ctaDisabled:!s,atMax:o>0&&i>=o}}({selections:b,order:S.current,minReq:B,maxReq:A,stake:g,payout20:i?Kl(x?.[i.id],A>0&&B===A?A:S.current.length,{game:i,expectedCorrect:w,stake:g}):0}),z=I(l),P=U(l),T=N.primaryText,D=K(N.primary,$(l),N.primaryText),O="text-[10px] font-bold uppercase tracking-[0.08em]",E=ar(i),[j,Y]=e.useState(null),H=L.legs.find(e=>e.id===j)??null,R=H?p.find(e=>e.id===H.id)?.description??p.find(e=>e.id===H.id)?.proposition??"":"",G=e.useRef(null),W=L.legs[L.legs.length-1]?.side;return function(t,n,o){const r=e.useRef(null),l=e.useRef(t);e.useEffect(()=>{const e=e=>{r.current={x:e.clientX,y:e.clientY}};return document.addEventListener("pointerdown",e,!0),()=>document.removeEventListener("pointerdown",e,!0)},[]),e.useEffect(()=>{const e=t>l.current;l.current=t;const a=r.current,i=n.current?.lastElementChild;if(!e||!a||!i)return;if(window.matchMedia?.("(prefers-reduced-motion: reduce)").matches)return;const s=i.getBoundingClientRect(),c=s.height||44,d=document.createElement("div");d.setAttribute("aria-hidden","true"),Object.assign(d.style,{position:"fixed",left:a.x-c/2+"px",top:a.y-c/2+"px",width:`${c}px`,height:`${c}px`,borderRadius:.26*c+"px",backgroundColor:o,boxShadow:"0 9px 14px rgba(10,49,56,0.4)",pointerEvents:"none",zIndex:"3",transition:"transform 0.42s cubic-bezier(0.34,0.82,0.3,1), opacity 0.42s ease-in"}),document.body.appendChild(d);const u=s.left+s.width/2-a.x,m=s.top+s.height/2-a.y,p=requestAnimationFrame(()=>{d.style.transform=`translate(${u}px, ${m}px) scale(0.5) rotate(-8deg)`,d.style.opacity="0"}),h=()=>d.remove();d.addEventListener("transitionend",h);const f=window.setTimeout(h,700);return()=>{cancelAnimationFrame(p),window.clearTimeout(f),h()}},[t])}(L.count,G,"no"===W?P:z),/* @__PURE__ */m("div",{className:r,style:{fontFamily:a},children:[
|
|
232
232
|
/* @__PURE__ */u("style",{children:"@keyframes blade-slip-in{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}"}),
|
|
233
|
-
/* @__PURE__ */u("div",{ref:
|
|
234
|
-
/* @__PURE__ */u("span",{className:"px-
|
|
235
|
-
/* @__PURE__ */u("span",{
|
|
236
|
-
|
|
237
|
-
/* @__PURE__ */
|
|
238
|
-
return m("button",{type:"button",onClick:
|
|
239
|
-
return m("div",{
|
|
240
|
-
/* @__PURE__ */u("
|
|
241
|
-
|
|
242
|
-
return m("div",{
|
|
243
|
-
/* @__PURE__ */u("span",{style:{color:o.heading??o.text??o.primary},children:wt(M)}),
|
|
244
|
-
/* @__PURE__ */u("span",{style:{color:o.textMuted},children:` for $${N?Math.round(l):20}`})]}),/* @__PURE__ */u("button",{type:"button",onClick:()=>{return e=!k,void 0===x&&w(e),void g?.(e);var e},"aria-expanded":k,className:"text-xs font-semibold rounded-md transition-colors shrink-0",style:{background:k?o.buttonSecondary:o.background??"#ffffff",border:`1px solid ${k?o.primary??o.border:o.border}`,padding:"4px 10px",cursor:"pointer",color:o.text,fontFamily:r,lineHeight:1.35},children:k?"Hide dividends":"Show dividends"})]}):/* @__PURE__ */u("div",{"aria-hidden":"true",className:"text-xs font-semibold self-start",style:{padding:"2px 0",visibility:"hidden",fontFamily:r},children:"Show dividends"}))]})}function ca(e){return{game_id:e.selectedGame.id,rule_id:e.selectedRule?.id??null,proposition_ids:e.selectedPropositionIds,selections:e.selections,stake:e.betAmount}}function da({className:e="",onBack:t,hideActions:n}){const{theme:o,headingFont:r,selectedGame:l,selectedEventId:a,propositions:i,selections:s,toggleSelection:c,upgradePropositionCount:d,selectedPropositionCount:p,disableQuickPick:h,answeredCount:f,selectedRule:x}=Rr(),g=o.colors,y=l?zt(l,p,x):{min:0,max:0},b=y.min,w=Bn(l)&&a?Math.min(y.max,i.length):y.max,k=b>0&&b===w,v=!(l?.allowed_propositions&&l.allowed_propositions.length>0)&&b>0&&w>b,N=k?w:w||i.length,C=e=>{const t=Math.max(0,Math.min(e??N,i.length));for(const r of Object.keys(s)){const e=Number(r);c(e,s[e])}const{yesPicks:n,noPicks:o}=en(i,t);for(const r of n)c(r.id,"yes");for(const r of o)c(r.id,"no");d(t)},F=!h&&i.length>0,B=v?Array.from({length:w-b+1},(e,t)=>b+t):[],A=f>0?f:b||N;/* @__PURE__ */
|
|
245
|
-
return m("div",{className:`flex items-center justify-between gap-3 pl-2 ${e}`,children:[/* @__PURE__ */m("div",{children:[/* @__PURE__ */u("h1",{className:"text-xl sm:text-2xl font-bold",style:{color:R(o),fontFamily:r},children:"Place Your Wager"}),l&&/* @__PURE__ */u(Ml,{onBack:t,hideActions:n,label:l.game_name})]}),F&&(B.length>1?/* @__PURE__ */u(Yl,{counts:B,onPick:e=>C(e),onDoubleAction:()=>C(A),colors:g,menuShadow:Y(o)}):/* @__PURE__ */u("div",{className:"flex-shrink-0",children:/* @__PURE__ */u(Wr,{onPress:()=>C()})}))]})}function ua({onBack:e,onSubmitted:t,authenticated:n=!0,onUnauthenticated:o,className:r=""}){const l=Rr(),{theme:a,selectedGame:i,expectedCorrect:s,betAmount:c,submitting:d,submitError:p,canSubmit:h,payouts:f,selectedPropositionIds:x,screenSize:g}=l,y=a.colors;if(!i)return null;const b=f[s]??0,w=Pt(i),k=s===x.length,v=w?.enabled&&k;/* @__PURE__ */
|
|
233
|
+
/* @__PURE__ */u("div",{ref:G,className:"flex items-center overflow-x-auto min-h-[44px] pb-1.5",style:{scrollbarWidth:"none"},children:0===L.legs.length?/* @__PURE__ */u("span",{className:"text-[13px]",style:{color:N.textMuted},children:"Tap Yes or No to start building your multi."}):L.legs.map(e=>/* @__PURE__ */u(sa,{number:e.number,color:"yes"===e.side?z:P,label:`Leg ${e.number}, answered ${e.side}`,selected:e.id===j,onSelect:()=>Y(t=>t===e.id?null:e.id)},e.id))}),L.legs.length>0&&/* @__PURE__ */m("div",{className:"flex items-center gap-2 mb-2 text-[12px]",style:{color:N.text},children:[H?/* @__PURE__ */m(d,{children:[/* @__PURE__ */u("span",{className:"px-1.5 py-0.5 rounded font-bold text-[10px] uppercase shrink-0",style:{backgroundColor:"yes"===H.side?z:P,color:"#fff"},children:H.side}),/* @__PURE__ */u("span",{className:"line-clamp-2",children:R})]}):/* @__PURE__ */u("span",{style:{color:N.textMuted},children:"Tap a leg to read it."}),/* @__PURE__ */m("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[H&&/* @__PURE__ */u(je,{theme:l,variant:"ghost",size:"sm",radius:"pill",onPress:()=>{Y(null),v(H.id,H.side)},ariaLabel:`Remove leg ${H.number}`,children:"Remove"}),/* @__PURE__ */u(je,{theme:l,variant:"ghost",size:"sm",radius:"pill",onPress:()=>{Y(null);for(const e of L.legs)v(e.id,e.side)},ariaLabel:"Clear bet",children:"Clear bet"})]})]}),
|
|
234
|
+
/* @__PURE__ */m("div",{className:"flex flex-wrap items-center gap-2.5 mb-2",children:[/* @__PURE__ */m("div",{className:"flex items-center gap-2 flex-none",children:[/* @__PURE__ */u("span",{className:O,style:{color:N.textMuted},children:$l}),/* @__PURE__ */m("div",E?{className:"flex items-center gap-2 rounded-[10px] px-3 py-2",style:{border:`1px solid ${N.border}`,backgroundColor:N.backgroundAlt},title:ir(i),children:[/* @__PURE__ */u("span",{className:"text-[15px] font-extrabold",style:{color:N.text},children:wt(g)}),/* @__PURE__ */u("span",{className:"text-[10px]",style:{color:N.textMuted},children:"locked"})]}:{className:"flex items-center rounded-[10px] overflow-hidden w-[108px]",style:{border:`1px solid ${N.border}`,backgroundColor:N.background},children:[/* @__PURE__ */u("span",{className:"pl-3 text-base font-extrabold",style:{color:N.text},children:"$"}),/* @__PURE__ */u("input",{type:"number",min:1,step:1,inputMode:"decimal","aria-label":$l,value:g>0?String(g):"",onChange:e=>{M.current=!0,y(Math.max(0,parseFloat(e.target.value)||0))},className:"flex-1 min-w-0 bg-transparent outline-none border-0 py-2 pl-1 pr-2 text-[15px] font-extrabold",style:{color:N.text,fontFamily:a}})]})]}),/* @__PURE__ */m("div",{className:"flex items-baseline justify-end gap-2 rounded-[10px] px-3 py-1.5",style:{backgroundColor:N.primary,flex:"1 1 150px",minWidth:0},children:[/* @__PURE__ */u("span",{className:O,style:{color:T,opacity:.7},children:"Potential dividend"}),/* @__PURE__ */u("span",{className:"text-xl font-extrabold leading-none",style:{color:D},children:L.dividendText})]})]}),!o&&/* @__PURE__ */u(je,{theme:l,block:!0,size:"md",radius:"lg",disabled:L.ctaDisabled,onPress:()=>{h(),t?.()},children:L.ctaLabel})]})}function da({view:e,onChange:t}){const{theme:n}=Kr(),o=n.colors,r="list"===e?"swipe":"list",l="swipe"===r;/* @__PURE__ */
|
|
235
|
+
return m("button",{type:"button",onClick:()=>t(r),className:"inline-flex shrink-0 items-center gap-1.5 rounded-full px-3 py-1.5 text-[11px] font-bold transition-colors",style:{border:`1px solid ${o.primary}`,backgroundColor:Jl(o.primary,.1),color:o.primary,cursor:"pointer"},children:[/* @__PURE__ */u("span",{"aria-hidden":!0,style:{fontSize:13,lineHeight:1},children:l?"⇆":"☰"}),l?"Swipe cards":"List view"]})}function ua({onNext:t,onBack:n,hideTitle:o,hideActions:r,defaultView:l="list",view:a,onViewChange:i,hideViewSwitch:s,onSwipeDragStateChange:c,className:d=""}){const p=Kr(),{selectedRule:h}=p,{theme:f,bodyFont:x,selectedGame:g,propositions:y,selections:b,toggleSelection:w,loading:k,error:v,renderTeamLogo:N,filterSport:C,initialSport:F,gameCategory:B,selectedPropositionCount:A,handlePropositionCountChange:M,goToConfirmation:S,goBack:L,selectedCategory:z,setSelectedCategory:P,selectedSport:T,selectedEventId:D,propositionsForCategoryPicker:O,answeredCount:E}=p;f.colors;const[j,Y]=e.useState(l),H=a??j,R=e.useCallback(e=>{void 0===a&&Y(e),i?.(e)},[a,i]);e.useEffect(()=>{g||(p.goToSportSelection(),n?.())},[g,p,n]);const G=e.useMemo(()=>{if(!g)return null;const{min:e,max:t}=zt(g,A??void 0,h);return e>0&&e===t?e:rr(g,A)},[g,A]),W=e.useRef(E);e.useEffect(()=>{const e=W.current;W.current=E,null!=G&&e<G&&E===G&&(S(),t?.())},[E,G]);const I=e.useMemo(()=>Mt(O??[]),[O]);if(e.useEffect(()=>{g&&1===I.length&&z!==I[0]&&P(I[0])},[g,I,z,P]),!g)return null;const U=I.length>1&&!z,$=!U&&Fn(g)&&!D,K=(()=>{if(!Fn(g)||!D)return g;const e=Math.min(g.max_propositions??y.length,y.length);return{...g,max_propositions:e,allowed_propositions:g.allowed_propositions?.filter(t=>t<=e)}})(),Z=()=>{L(),n?.()};/* @__PURE__ */
|
|
236
|
+
return m("div",{className:`flex flex-col min-h-full ${d}`,style:{fontFamily:x},children:[!o&&/* @__PURE__ */u("div",{className:"mb-6",children:/* @__PURE__ */u(ia,{onBack:r?Z:void 0,onNext:r?t:void 0,hideActions:r})}),!Fn(g)&&/* @__PURE__ */u(zl,{}),
|
|
237
|
+
/* @__PURE__ */u("div",{className:"flex-1",children:U?/* @__PURE__ */u(Rl,{hideTitle:!0,hideActions:!0,onSelectCategory:e=>P(e)}):$?/* @__PURE__ */u(Il,{}):"swipe"===H?/* @__PURE__ */u(il,{onBack:Z,onNext:t,viewSwitch:s?void 0:/* @__PURE__ */u(da,{view:H,onChange:R}),onDragStateChange:c}):/* @__PURE__ */u(Cl,{game:K,propositions:y,selections:b,onToggleSelection:w,onNext:()=>{S(),t?.()},onBack:Z,loading:k,error:v,theme:f,hideActions:!0,initialSport:C??F,renderTeamLogo:N,disableQuickPick:!0,selectedPropositionCount:A,onPropositionCountChange:M,gameCategory:B,headerExtra:s?void 0:/* @__PURE__ */u(da,{view:H,onChange:R})})}),!r&&!U&&!$&&/* @__PURE__ */u("div",{className:"mt-6",children:/* @__PURE__ */u(ca,{onNext:t,onBack:n})})]})}function ma({count:e,payout20:t,selected:n,onSelect:o,colors:r,bodyFont:l,extraBetAmount:a,buttonLabel:i,hidePayouts:s,game:c}){const p=null!=a&&20!==a,h=null!=t&&t>0&&p?cr(t*(a/20),c):null;/* @__PURE__ */
|
|
238
|
+
return m("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center",width:82},children:[/* @__PURE__ */u("button",{type:"button",onClick:o,"aria-pressed":n,className:"px-3 py-1.5 rounded-lg border text-sm font-semibold transition-colors",style:{borderColor:n?r.buttonPrimary??r.primary:r.border??r.primary,color:n?r.buttonPrimaryText??"#ffffff":r.buttonSecondaryText??r.text,backgroundColor:n?r.buttonPrimary??r.primary:r.buttonSecondary??r.background,cursor:"pointer",fontFamily:l,whiteSpace:"nowrap",alignSelf:"stretch"},onMouseEnter:e=>{n||(e.currentTarget.style.borderColor=r.buttonPrimary??r.primary,e.currentTarget.style.backgroundColor=`${r.primary}12`)},onMouseLeave:e=>{n||(e.currentTarget.style.borderColor=r.border??r.primary,e.currentTarget.style.backgroundColor=r.buttonSecondary??r.background)},children:i?i(e):`Multi ${e}`}),!s&&null!=t&&t>0&&/* @__PURE__ */m(d,{children:[/* @__PURE__ */m("span",{className:"inline-flex items-center justify-center px-2 py-1 rounded-md text-xs font-bold",style:{backgroundColor:`${r.success}15`,color:r.success,alignSelf:"stretch",textAlign:"center"},children:[e,"/",e]}),p?null!=h&&/* @__PURE__ */u("span",{className:"inline-flex items-center justify-center px-2 py-1 rounded-md text-xs font-bold",style:{backgroundColor:`${r.primary}12`,color:r.primary,whiteSpace:"nowrap",alignSelf:"stretch",textAlign:"center"},children:wt(h)}):/* @__PURE__ */u("span",{className:"inline-flex items-center justify-center px-2 py-1 rounded-md text-xs font-bold",style:{backgroundColor:`${r.primary}12`,color:r.primary,whiteSpace:"nowrap",alignSelf:"stretch",textAlign:"center"},children:wt(t)})]})]})}function pa({tiers:e,game:t,selectedCount:n,onSelect:o,colors:r,bodyFont:l,extraBetAmount:a,buttonLabel:i,columnLabel:s="Legs",buildYourOwn:p,quickPickOnly:h,onQuickPick:f,collapsible:x,expanded:g,onExpandedChange:y,summaryTiers:b}){const[w,k]=c(!1),v=g??w,N=e.some(e=>e.payout20>0),C=null!=a&&20!==a,F=C?`$${Math.round(a)} returns`:"$20 returns",B=!!x&&!v,A=N&&!B,M=(b??e).reduce((e,t)=>t.payout20>e?t.payout20:e,0),S=C&&M>0?cr(M*(a/20),t):M,L=e.length>0?82*e.length+8*Math.max(0,e.length-1):82;/* @__PURE__ */
|
|
239
|
+
return m("div",{style:{display:"flex",flexDirection:"column",gap:8,alignSelf:"stretch"},children:[/* @__PURE__ */m("div",{style:{display:"flex",flexDirection:"row",gap:8,overflowX:h?"visible":"auto",overflowY:"visible",alignItems:"flex-start",paddingBottom:6},children:[/* @__PURE__ */m("div",{style:{display:"flex",flexDirection:"column",gap:8,flexShrink:0,width:70},children:[/* @__PURE__ */u("div",{className:"py-1.5 text-xs",style:{color:r.textMuted,fontFamily:l,display:"flex",alignItems:"center"},children:h?"Quick Pick":s}),A&&/* @__PURE__ */m(d,{children:[/* @__PURE__ */u("div",{className:"py-1 text-xs",style:{color:r.textMuted,fontFamily:l,display:"flex",alignItems:"center"},children:"Dividend"}),/* @__PURE__ */u("div",{className:"py-1 text-xs",style:{color:r.textMuted,fontFamily:l,display:"flex",alignItems:"center"},children:F})]})]}),h?/* @__PURE__ */m("div",{style:{display:"flex",flexDirection:"column",gap:8,alignSelf:"flex-start",width:L},children:[/* @__PURE__ */u(Ul,{counts:(b??e).map(e=>e.count),onPick:e=>f?f(e):o(e),align:"left",direction:"up",colors:{background:r.background??"#ffffff",backgroundAlt:r.backgroundAlt??"#f3f4f6",border:r.border??"#e5e7eb",text:r.text??"#111827"}}),N&&!B&&/* @__PURE__ */u("div",{style:{display:"flex",flexDirection:"row",gap:8},children:e.map(e=>/* @__PURE__ */u("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center",width:82},children:null!=e.payout20&&e.payout20>0?/* @__PURE__ */m(d,{children:[/* @__PURE__ */m("span",{className:"inline-flex items-center justify-center px-2 py-1 rounded-md text-xs font-bold",style:{backgroundColor:`${r.success}15`,color:r.success,alignSelf:"stretch",textAlign:"center"},children:[e.count,"/",e.count]}),/* @__PURE__ */u("span",{className:"inline-flex items-center justify-center px-2 py-1 rounded-md text-xs font-bold",style:{backgroundColor:`${r.primary}12`,color:r.primary,whiteSpace:"nowrap",alignSelf:"stretch",textAlign:"center"},children:wt(C?cr(e.payout20*(a/20),t):e.payout20)})]}):/* @__PURE__ */m(d,{children:[/* @__PURE__ */m("span",{className:"inline-flex items-center justify-center px-2 py-1 rounded-md text-xs font-bold",style:{backgroundColor:`${r.success}15`,color:r.success,alignSelf:"stretch",textAlign:"center"},children:[e.count,"/",e.count]}),/* @__PURE__ */u("span",{className:"inline-flex items-center justify-center px-2 py-1 rounded-md text-xs font-bold",style:{backgroundColor:`${r.primary}12`,color:r.primary,whiteSpace:"nowrap",alignSelf:"stretch",textAlign:"center"},children:"—"})]})},e.count))})]}):p?/* @__PURE__ */m("div",{style:{display:"flex",flexDirection:"column",gap:8,alignSelf:"flex-start",width:L},children:[/* @__PURE__ */u("button",{type:"button",onClick:()=>o(e[0]?.count??0),className:"w-full py-1.5 rounded-lg border text-sm font-semibold transition-colors",style:{borderColor:r.buttonPrimary??r.primary,color:r.buttonPrimaryText??"#ffffff",backgroundColor:r.buttonPrimary??r.primary,cursor:"pointer",fontFamily:l},children:"Make Your Selections"}),N&&!B&&/* @__PURE__ */u("div",{style:{display:"flex",flexDirection:"row",gap:8},children:e.map(e=>/* @__PURE__ */u("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center",width:82},children:null!=e.payout20&&e.payout20>0?/* @__PURE__ */m(d,{children:[/* @__PURE__ */m("span",{className:"inline-flex items-center justify-center px-2 py-1 rounded-md text-xs font-bold",style:{backgroundColor:`${r.success}15`,color:r.success,alignSelf:"stretch",textAlign:"center"},children:[e.count,"/",e.count]}),/* @__PURE__ */u("span",C?{className:"inline-flex items-center justify-center px-2 py-1 rounded-md text-xs font-bold",style:{backgroundColor:`${r.primary}12`,color:r.primary,whiteSpace:"nowrap",alignSelf:"stretch",textAlign:"center"},children:wt(cr(e.payout20*(a/20),t))}:{className:"inline-flex items-center justify-center px-2 py-1 rounded-md text-xs font-bold",style:{backgroundColor:`${r.primary}12`,color:r.primary,whiteSpace:"nowrap",alignSelf:"stretch",textAlign:"center"},children:wt(e.payout20)})]}):/* @__PURE__ */m(d,{children:[/* @__PURE__ */m("span",{className:"inline-flex items-center justify-center px-2 py-1 rounded-md text-xs font-bold",style:{backgroundColor:`${r.success}15`,color:r.success,alignSelf:"stretch",textAlign:"center"},children:[e.count,"/",e.count]}),/* @__PURE__ */u("span",{className:"inline-flex items-center justify-center px-2 py-1 rounded-md text-xs font-bold",style:{backgroundColor:`${r.primary}12`,color:r.primary,whiteSpace:"nowrap",alignSelf:"stretch",textAlign:"center"},children:"—"})]})},e.count))})]}):e.map(e=>/* @__PURE__ */u(ma,{count:e.count,payout20:e.payout20>0?e.payout20:null,selected:n===e.count,onSelect:()=>o(e.count),colors:r,bodyFont:l,extraBetAmount:a,buttonLabel:i,hidePayouts:B,game:t},e.count))]}),x&&(N?/* @__PURE__ */m("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 self-start max-w-full",style:{fontFamily:l},children:[/* @__PURE__ */m("span",{className:"text-xs font-semibold leading-snug",style:{color:r.text},children:["Win up to ",
|
|
240
|
+
/* @__PURE__ */u("span",{style:{color:r.heading??r.text??r.primary},children:wt(S)}),
|
|
241
|
+
/* @__PURE__ */u("span",{style:{color:r.textMuted},children:` for $${C?Math.round(a):20}`})]}),/* @__PURE__ */u("button",{type:"button",onClick:()=>{return e=!v,void 0===g&&k(e),void y?.(e);var e},"aria-expanded":v,className:"text-xs font-semibold rounded-md transition-colors shrink-0",style:{background:v?r.buttonSecondary:r.background??"#ffffff",border:`1px solid ${v?r.primary??r.border:r.border}`,padding:"4px 10px",cursor:"pointer",color:r.text,fontFamily:l,lineHeight:1.35},children:v?"Hide dividends":"Show dividends"})]}):/* @__PURE__ */u("div",{"aria-hidden":"true",className:"text-xs font-semibold self-start",style:{padding:"2px 0",visibility:"hidden",fontFamily:l},children:"Show dividends"}))]})}function ha(e){return{game_id:e.selectedGame.id,rule_id:e.selectedRule?.id??null,proposition_ids:e.selectedPropositionIds,selections:e.selections,stake:e.betAmount}}function fa({className:e="",onBack:t,hideActions:n}){const{theme:o,headingFont:r,selectedGame:l,selectedEventId:a,propositions:i,quickPickSelections:s,upgradePropositionCount:c,selectedPropositionCount:d,disableQuickPick:p,answeredCount:h,selectedRule:f}=Kr(),x=o.colors,g=l?zt(l,d,f):{min:0,max:0},y=g.min,b=Fn(l)&&a?Math.min(g.max,i.length):g.max,w=y>0&&y===b,k=!!(l?.allowed_propositions&&l.allowed_propositions.length>0),v=rr(l,d),N=!lr(l)&&!k&&y>0&&b>y,C=v??(w?b:b||i.length),F=e=>{c(s(e??C))},B=!p&&i.length>0,A=N?Array.from({length:b-y+1},(e,t)=>y+t):[],M=h>0?h:y||C;/* @__PURE__ */
|
|
242
|
+
return m("div",{className:`flex items-center justify-between gap-3 pl-2 ${e}`,children:[/* @__PURE__ */m("div",{children:[/* @__PURE__ */u("h1",{className:"text-xl sm:text-2xl font-bold",style:{color:R(o),fontFamily:r},children:"Place Your Wager"}),l&&/* @__PURE__ */u(Dl,{onBack:t,hideActions:n,label:l.game_name})]}),B&&(A.length>1?/* @__PURE__ */u(Ul,{counts:A,onPick:e=>F(e),onDoubleAction:()=>F(M),colors:x,menuShadow:Y(o)}):/* @__PURE__ */u("div",{className:"flex-shrink-0",children:/* @__PURE__ */u(qr,{onPress:()=>F()})}))]})}function xa({onBack:e,onSubmitted:t,authenticated:n=!0,onUnauthenticated:o,className:r=""}){const l=Kr(),{theme:a,selectedGame:i,expectedCorrect:s,betAmount:c,submitting:d,submitError:p,canSubmit:h,payouts:f,selectedPropositionIds:x,screenSize:g}=l,y=a.colors;if(!i)return null;const b=f[s]??0,w=Pt(i),k=s===x.length,v=w?.enabled&&k;/* @__PURE__ */
|
|
246
243
|
return m("div",{className:`flex items-center justify-between pt-4 ${r}`,children:[e&&"mobile"!==g&&/* @__PURE__ */u(je,{theme:a,variant:"secondary",onPress:e,children:"Back"}),/* @__PURE__ */m("div",{className:"flex items-center gap-3",children:[p&&/* @__PURE__ */u("span",{className:"text-xs",style:{color:y.error},children:p}),(b>0||v)&&/* @__PURE__ */m("div",{className:"text-right leading-tight hidden sm:block",children:[/* @__PURE__ */u("span",{className:"text-[10px] uppercase tracking-wide block",style:{color:y.textMuted},children:"Potential winnings"}),/* @__PURE__ */m("span",{className:"text-sm font-bold",style:{color:y.heading??y.text},children:[wt(b),v&&/* @__PURE__ */u("span",{style:{color:y.warning},children:" + Jackpot"})]})]}),
|
|
247
|
-
/* @__PURE__ */u(je,{theme:a,variant:"primary",disabled:!h,onPress:async()=>{n?(await l.handleSubmit(),t?.()):o?.(
|
|
248
|
-
/* @__PURE__ */u("div",{className:"flex-1",children:/* @__PURE__ */u(
|
|
249
|
-
/* @__PURE__ */u("p",{className:"text-[10px] font-bold uppercase tracking-[0.1em] mb-1",style:{color:G.textMuted},children:"How you win"}),
|
|
250
|
-
/* @__PURE__ */u("span",{className:"font-bold",style:{color:R(c)},children:wt(
|
|
251
|
-
/* @__PURE__ */m("span",{style:{fontWeight:700},children:[
|
|
244
|
+
/* @__PURE__ */u(je,{theme:a,variant:"primary",disabled:!h,onPress:async()=>{n?(await l.handleSubmit(),t?.()):o?.(ha(l))},children:n?d?"Placing…":`Place Entry (${wt(c)})`:"Log in to place entry"})]})]})}function ga({onBack:e,onSubmitted:t,authenticated:n=!0,onUnauthenticated:o,hideTitle:r,hideActions:a,className:i=""}){const s=Kr(),{theme:c,bodyFont:p,selectedGame:h,selectedPropositions:f,selections:x,compositeComponentById:g,propositions:y,disableQuickPick:b,selectedPropositionCount:w,selectedEventId:k,expectedCorrect:v,setExpectedCorrect:N,betAmount:C,setBetAmount:F,submitting:B,submitError:A,canSubmit:M,winningCounts:S,payouts:L,overloadPayouts:z,renderTeamLogo:P,userBalance:T,onRecharge:D,goBack:O,toggleSelection:E,upgradePropositionCount:j,goToSportSelection:Y,selectedRule:H}=s,G=c.colors;if(l(()=>{h||(Y(),e?.())},[h,Y,e]),!h)return null;const W=!!(h.allowed_propositions&&h.allowed_propositions.length>0),I=zt(h,w,H),U=rr(h,w),$=U??I.min,K=U??(Fn(h)&&k?Math.min(I.max,y.length):I.max),Z=Object.keys(x).length,q=$>0&&Z<$,V=!lr(h)&&!W&&$>0&&K>$&&Z>=$&&Z<K,X=W?[...h.allowed_propositions??[]].sort((e,t)=>e-t).filter(e=>e>(w??0)):[],Q=W&&X.length>0&&!q,J=V||Q,_=K-Z;G.textAlt??G.text,$>0&&$===K||K||y.length;const ee=()=>{O(),e?.()},te=(W?[...h.allowed_propositions??[]].sort((e,t)=>t-e):[]).find(e=>e===Z&&e<(w??1/0)),ne=W&&Z<Math.min(...h.allowed_propositions??[1/0]),oe=W&&q&&!ne,re=or(h),le=function(e,t,n,o){const r=e?.description?.trim();if(r)return r;const l=(t??[]).filter(e=>Number.isFinite(e)).sort((e,t)=>e-t);if(0===l.length||n<=0)return null;const a=l[0];if(a>=n)return"Get every pick right to win.";const i=l.length/2;if(l.length>=2&&l.length%2==0&&l.every((e,t)=>t<i?e===t:e===n-(l.length-1-t))){const e=i-1,t=`Get all ${n} picks right — or all ${n} wrong — to win.`;return 0===e?t:`${t} ${1===e?"One miss":`Up to ${e} misses`} either way still wins.`}if(!l.every((e,t)=>e===a+t)||l[l.length-1]!==n)return`Get exactly ${l.length>1?`${l.slice(0,-1).join(", ")} or ${l[l.length-1]}`:`${l[0]}`} of your ${n} picks right to win.`;const s=l.map(e=>o?.[e]).filter(e=>Number.isFinite(e));if(s.length===l.length&&s.length>1&&s.every((e,t)=>0===t||e>s[t-1]))return`Get at least ${a} of your ${n} picks right to win — every extra right pick grows the prize.`;const c=n-a;return`Get at least ${a} of your ${n} picks right to win — you can miss ${1===c?"one":`up to ${c}`}.`}(H,S,Z,L),ae=L[Z]||sr(h,Z,C),ie=(S??[]).length>1?"Top prize":"That pays",se=function(e,t,n){const o=[...new Set((e??[]).filter(e=>Number.isFinite(e)))].sort((e,t)=>t-e);if(o.length<2||t<=0)return[];const r=o.map(e=>({count:e,label:e===t?`Get all ${t}`:0===e?`All ${t} wrong`:`Get ${e}`,prize:n?.[e]??0}));return r.every(e=>e.prize>0)?r:[]}(S,Z,L),ce=null!=te?re.belowRequiredHint(te,w??$):re.belowRequiredAddOnlyHint(w??$);return l(()=>{!q||W&&!ne||ee()},[q,W,ne]),/* @__PURE__ */m("div",{className:`flex flex-col min-h-full ${i}`,style:{fontFamily:p},children:[!r&&/* @__PURE__ */u("div",{className:"mb-6",children:/* @__PURE__ */u(fa,{onBack:e,hideActions:a})}),
|
|
245
|
+
/* @__PURE__ */u("div",{className:"flex-1",children:/* @__PURE__ */u(Bl,{componentById:g,game:h,propositions:f,selections:x,onToggleSelection:E,onRemoveSelection:()=>{},onSubmit:async()=>{n?(await s.handleSubmit(),t?.()):o?.(ha(s))},onBack:ee,loading:B,error:A,expectedCorrect:v,onExpectedCorrectChange:N,betAmount:C,onBetAmountChange:F,theme:c,showCustomAmount:!0,betAmountLocked:ar(h),betAmountLockedNote:ir(h),hideActions:!0,winningCounts:S,payouts:L,renderTeamLogo:P,canSubmit:M,authenticated:n,userBalance:T,onRecharge:D,boostBanner:/* @__PURE__ */m(d,{children:[(le||ae>0)&&/* @__PURE__ */m("div",{className:"p-3 rounded-lg border mb-2",style:{backgroundColor:`${G.primary}08`,borderColor:`${G.primary}30`},children:[
|
|
246
|
+
/* @__PURE__ */u("p",{className:"text-[10px] font-bold uppercase tracking-[0.1em] mb-1",style:{color:G.textMuted},children:"How you win"}),le&&/* @__PURE__ */u("p",{className:"text-xs sm:text-sm",style:{color:G.text},children:le}),se.length>0?/* @__PURE__ */u("div",{className:"mt-2 space-y-1",children:se.map(e=>/* @__PURE__ */m("div",{className:"flex items-center justify-between gap-3 text-xs sm:text-sm",children:[/* @__PURE__ */u("span",{style:{color:G.textMuted},children:e.label}),/* @__PURE__ */u("span",{className:"font-bold",style:{color:R(c)},children:wt(e.prize)})]},e.count))}):ae>0&&/* @__PURE__ */m("p",{className:"text-xs sm:text-sm mt-1.5",style:{color:G.textMuted},children:[ie," ",
|
|
247
|
+
/* @__PURE__ */u("span",{className:"font-bold",style:{color:R(c)},children:wt(ae)})]})]}),oe&&/* @__PURE__ */m("div",{className:"p-3 rounded-lg border flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3",style:{backgroundColor:`${G.warning}10`,borderColor:`${G.warning}40`},children:[/* @__PURE__ */m("p",{className:"text-xs sm:text-sm",style:{color:G.text},children:["You have ",
|
|
248
|
+
/* @__PURE__ */m("span",{style:{fontWeight:700},children:[Z," pick",1!==Z?"s":""]}),"."," ",ce]}),/* @__PURE__ */m("div",{className:"flex gap-2 flex-shrink-0",children:[/* @__PURE__ */u("button",{type:"button",onClick:ee,className:"px-3 py-1.5 rounded-lg text-xs font-semibold transition-colors",style:{color:G.buttonSecondaryText,backgroundColor:G.buttonSecondary,cursor:"pointer"},children:"Add a pick"}),null!=te&&/* @__PURE__ */u("button",{type:"button",onClick:()=>j(te),className:"px-3 py-1.5 rounded-lg text-xs font-semibold transition-colors",style:{color:G.buttonPrimaryText,backgroundColor:G.buttonPrimary,cursor:"pointer"},children:re.switchTierLabel(te)})]})]}),J&&/* @__PURE__ */u("div",{className:"p-3 rounded-lg border",style:{backgroundColor:`${G.primary}08`,borderColor:`${G.primary}30`},children:Q?(()=>{const e=w??Z,t=z[e],n=C>0?C:20,o=null!=t&&t>0?cr(t*(n/20),h):null;/* @__PURE__ */
|
|
252
249
|
return m("div",{children:[
|
|
253
|
-
/* @__PURE__ */u("p",{className:"text-sm font-semibold mb-1",style:{color:G.primary},children:
|
|
250
|
+
/* @__PURE__ */u("p",{className:"text-sm font-semibold mb-1",style:{color:G.primary},children:re.overloadTitle}),null!=o&&/* @__PURE__ */m("p",{className:"text-xs mb-2",style:{color:G.textMuted},children:["Currently winning up to"," ",
|
|
254
251
|
/* @__PURE__ */u("span",{style:{color:G.heading??G.text,fontWeight:700},children:wt(o)})," ","with ",e," picks"]}),
|
|
255
|
-
/* @__PURE__ */u(
|
|
256
|
-
return m("div",{className:`flex items-center justify-between gap-3 pl-2 ${e}`,children:[/* @__PURE__ */m("div",{className:"min-w-0",children:[/* @__PURE__ */u("h1",{className:"text-xl sm:text-2xl font-bold",style:{color:R(o),fontFamily:r},children:"Entry Placed!"}),/* @__PURE__ */u(
|
|
257
|
-
/* @__PURE__ */m("span",{className:"font-mono font-semibold",style:{color:a.primary},children:["#",l.id]})," ","successfully submitted"]}):"Your entry has been successfully submitted"})})]}),/* @__PURE__ */u("div",{className:"w-12 h-12 sm:w-14 sm:h-14 rounded-full flex items-center justify-center flex-shrink-0",style:{backgroundColor:`${a.success}20`},children:/* @__PURE__ */u("svg",{className:"w-6 h-6 sm:w-7 sm:h-7",fill:"none",stroke:a.success,strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",viewBox:"0 0 24 24",children:/* @__PURE__ */u("path",{d:"M5 13l4 4L19 7"})})})]})}function
|
|
252
|
+
/* @__PURE__ */u(pa,{game:h,tiers:X.map(e=>({count:e,payout20:z[e]??0})),selectedCount:void 0,onSelect:e=>{j(e),ee()},colors:G,bodyFont:s.bodyFont,extraBetAmount:20!==n?n:void 0,columnLabel:re.tableColumnLabel,buttonLabel:re.tierButtonLabel})]})})():/* @__PURE__ */m("div",{className:"flex items-center justify-between gap-3",children:[/* @__PURE__ */m("p",{className:"text-xs",style:{color:G.textMuted},children:[1===_?"Add ":"Add up to ",/* @__PURE__ */m("span",{style:{color:G.primary,fontWeight:700},children:[_," more pick",1!==_?"s":""]})]}),/* @__PURE__ */u("button",{type:"button",onClick:ee,className:"flex-shrink-0 px-3 py-1.5 rounded-lg text-xs font-semibold transition-colors",style:{color:G.buttonPrimaryText,backgroundColor:G.buttonPrimary,cursor:"pointer"},children:"Add picks"})]})})]})})}),a&&A&&/* @__PURE__ */u("div",{className:"mt-3 flex justify-end",children:/* @__PURE__ */u("span",{className:"text-xs",style:{color:G.error},children:A})})]})}function ya({className:e="",onBack:t,hideActions:n}){const{theme:o,headingFont:r,placedEntry:l}=Kr(),a=o.colors;/* @__PURE__ */
|
|
253
|
+
return m("div",{className:`flex items-center justify-between gap-3 pl-2 ${e}`,children:[/* @__PURE__ */m("div",{className:"min-w-0",children:[/* @__PURE__ */u("h1",{className:"text-xl sm:text-2xl font-bold",style:{color:R(o),fontFamily:r},children:"Entry Placed!"}),/* @__PURE__ */u(Dl,{onBack:t,hideActions:n,children:/* @__PURE__ */u("p",{className:"text-sm",style:{color:a.textMuted},children:l?/* @__PURE__ */m(d,{children:["Entry"," ",
|
|
254
|
+
/* @__PURE__ */m("span",{className:"font-mono font-semibold",style:{color:a.primary},children:["#",l.id]})," ","successfully submitted"]}):"Your entry has been successfully submitted"})})]}),/* @__PURE__ */u("div",{className:"w-12 h-12 sm:w-14 sm:h-14 rounded-full flex items-center justify-center flex-shrink-0",style:{backgroundColor:`${a.success}20`},children:/* @__PURE__ */u("svg",{className:"w-6 h-6 sm:w-7 sm:h-7",fill:"none",stroke:a.success,strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",viewBox:"0 0 24 24",children:/* @__PURE__ */u("path",{d:"M5 13l4 4L19 7"})})})]})}function ba({onPlayAgain:e,onDone:t,onShare:n,className:o=""}){const{theme:r,reset:l,placedEntry:a,selectedGame:i,selectedPropositions:s,selections:c,betAmount:d}=Kr();return r.colors,/* @__PURE__ */m("div",{className:`flex items-center justify-between pt-4 ${o}`,children:[/* @__PURE__ */u(je,{theme:r,variant:"secondary",onPress:()=>{l(),e?.()},children:"Place Another"}),t&&/* @__PURE__ */u(je,{theme:r,variant:"primary",onPress:t,children:"Done"})]})}function wa({onPlayAgain:t,onDone:n,onBack:o,onShare:r,hideTitle:l,hideActions:a,className:i=""}){const s=Kr(),{theme:c,bodyFont:p,headingFont:h,selectedGame:f,placedEntry:x,betAmount:g,selectedPropositionIds:y,selectedPropositions:b,selections:w,payouts:k,onShare:v}=s,N=c.colors,C=V(c),F=N.textAlt??N.text,B=x?.proposition_ids?x.proposition_ids.length:y.length,A=k[B]??null,M=e.useRef(!1);return e.useEffect(()=>{x&&f?M.current=!1:(s.goToSportSelection(),M.current||(M.current=!0,t?t():n?.()))},[x,f,s,t,n]),x?/* @__PURE__ */m("div",{className:`flex flex-col min-h-full ${i}`,style:{fontFamily:p},children:[!l&&/* @__PURE__ */u("div",{className:"mb-6",children:/* @__PURE__ */u(ya,{onBack:o,hideActions:a})}),/* @__PURE__ */m("div",{className:"flex-1 space-y-3 sm:space-y-4",children:[/* @__PURE__ */m("div",{className:"p-4 sm:p-5 rounded-xl border",style:{backgroundColor:C,borderColor:N.border,boxShadow:j(c)},children:[/* @__PURE__ */m("div",{className:"flex items-center justify-between gap-3 mb-3",children:[(()=>{const e=f?f.allowed_propositions&&f.allowed_propositions.length>0&&f.game_name.replace(/\s+\d+\s*$/,"").trim()||f.game_name:"Entry summary";return f?/* @__PURE__ */u("div",{className:"min-w-0 flex-1",children:/* @__PURE__ */u(Ml,{iconUrl:Ae(f),gameName:e,height:18,chipColor:N.primary,textColor:N.text,iconColor:N.primaryText,accentColor:c.brand?.accent})}):/* @__PURE__ */u("h3",{className:"text-sm sm:text-base font-semibold min-w-0 flex-1 truncate",style:{color:R(c),fontFamily:h},children:e})})(),/* @__PURE__ */m("span",{className:"text-xs font-semibold px-2 py-0.5 rounded-full flex-shrink-0",style:{color:N.primary,backgroundColor:`${N.primary}15`},children:[B," pick",1!==B?"s":""]})]}),/* @__PURE__ */m("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3",children:[
|
|
258
255
|
/* @__PURE__ */m("div",{children:[/* @__PURE__ */u("div",{className:"text-[10px] uppercase tracking-wide font-semibold",style:{color:N.textMuted},children:"Selections"}),/* @__PURE__ */u("div",{className:"text-sm font-semibold mt-0.5",style:{color:F},children:B})]}),g>0&&/* @__PURE__ */m("div",{children:[/* @__PURE__ */u("div",{className:"text-[10px] uppercase tracking-wide font-semibold",style:{color:N.textMuted},children:"Wager"}),/* @__PURE__ */u("div",{className:"text-sm font-semibold mt-0.5",style:{color:F},children:wt(g)})]}),null!=A&&A>0&&/* @__PURE__ */m("div",{children:[/* @__PURE__ */u("div",{className:"text-[10px] uppercase tracking-wide font-semibold",style:{color:N.textMuted},children:"Potential win"}),/* @__PURE__ */u("div",{className:"text-sm font-bold mt-0.5",style:{color:N.heading??N.text},children:wt(A)})]})]})]}),b.length>0&&/* @__PURE__ */m("div",{className:"p-4 sm:p-5 rounded-xl border",style:{backgroundColor:C,borderColor:N.border,boxShadow:j(c)},children:[/* @__PURE__ */u("h4",{className:"text-sm sm:text-base font-semibold mb-2",style:{color:R(c),fontFamily:h},children:"Your picks"}),/* @__PURE__ */u("div",{className:"space-y-1.5",children:b.map((e,t)=>{const n=w?.[e.id],o="yes"===n;/* @__PURE__ */
|
|
259
256
|
return m("div",{className:"flex items-center gap-2 py-2 px-3 rounded",style:{backgroundColor:N.backgroundAlt},children:[
|
|
260
257
|
/* @__PURE__ */u("span",{className:"flex-shrink-0 w-5 h-5 rounded-full flex items-center justify-center text-[10px] font-bold",style:{backgroundColor:N.primary,color:N.primaryText},children:t+1}),
|
|
261
258
|
/* @__PURE__ */m("div",{className:"flex-1 min-w-0",children:[/* @__PURE__ */m("p",{className:"text-xs sm:text-sm font-medium truncate",style:{color:F},children:[!Bt(e)&&/* @__PURE__ */m(d,{children:[e.home_team," ",
|
|
262
|
-
/* @__PURE__ */u("span",{style:{color:N.textMuted},children:"vs"})," "]}),e.away_team]}),/* @__PURE__ */u("p",{className:"text-[11px] truncate",style:{color:N.textMuted},children:e.description})]}),null!=n&&/* @__PURE__ */u(Ge,{theme:c,value:o?"yes":"no",size:"sm",style:{flexShrink:0}})]},e.id)})})]})]})]}):null}function
|
|
263
|
-
return m("div",{className:`pl-2 ${e}`,children:[/* @__PURE__ */u("h1",{className:"text-xl sm:text-2xl font-bold",style:{color:R(o),fontFamily:r},children:"Your Entries"}),/* @__PURE__ */u(
|
|
264
|
-
return m("div",{className:`flex flex-col min-h-full ${e}`,style:{fontFamily:a},children:[!o&&/* @__PURE__ */u("div",{className:"mb-6",children:/* @__PURE__ */u(
|
|
265
|
-
return m("div",{className:`pl-0 sm:pl-2 ${e}`,children:[/* @__PURE__ */u("h1",{className:"text-[10px] sm:text-xs font-bold uppercase tracking-[0.14em] sm:tracking-[0.18em] mb-3 sm:mb-4",style:{color:a.primary,fontFamily:i},children:St(l)}),/* @__PURE__ */u(
|
|
266
|
-
return m("button",{type:"button",onClick:()=>{x(e),g(),t?.(e)},className:"group flex w-full min-w-0 items-center gap-3 rounded-2xl border px-3 py-3 text-left transition-all hover:-translate-y-0.5 active:translate-y-0 sm:gap-3.5 sm:px-4 sm:py-4",style:{backgroundColor:v,borderColor:k.border,boxShadow:j(d),cursor:"pointer"},onMouseEnter:e=>{e.currentTarget.style.borderColor=k.primary},onMouseLeave:e=>{e.currentTarget.style.borderColor=k.border},children:[l?/* @__PURE__ */u("span",{className:"shrink-0",children:l(e)}):/* @__PURE__ */u(
|
|
259
|
+
/* @__PURE__ */u("span",{style:{color:N.textMuted},children:"vs"})," "]}),e.away_team]}),/* @__PURE__ */u("p",{className:"text-[11px] truncate",style:{color:N.textMuted},children:e.description})]}),null!=n&&/* @__PURE__ */u(Ge,{theme:c,value:o?"yes":"no",size:"sm",style:{flexShrink:0}})]},e.id)})})]})]})]}):null}function ka({className:e="",onBack:t,hideActions:n}){const{theme:o,headingFont:r}=Kr();/* @__PURE__ */
|
|
260
|
+
return m("div",{className:`pl-2 ${e}`,children:[/* @__PURE__ */u("h1",{className:"text-xl sm:text-2xl font-bold",style:{color:R(o),fontFamily:r},children:"Your Entries"}),/* @__PURE__ */u(Dl,{onBack:t,hideActions:n})]})}function va({className:e="",onSelectEntry:t,onBack:n,hideTitle:o,hideActions:r}){const{theme:l,bodyFont:a,apiUrl:i,apiKey:s,fetchImpl:c,getAuthHeaders:d,userId:p,demoEntries:h,demoGames:f,demoPropositions:x,renderTeamLogo:g,filterSport:y}=Kr();/* @__PURE__ */
|
|
261
|
+
return m("div",{className:`flex flex-col min-h-full ${e}`,style:{fontFamily:a},children:[!o&&/* @__PURE__ */u("div",{className:"mb-6",children:/* @__PURE__ */u(ka,{onBack:n,hideActions:r})}),/* @__PURE__ */u("div",{className:"flex-1",children:/* @__PURE__ */u(Sl,{apiUrl:i,apiKey:s,fetchImpl:c,getAuthHeaders:d,userId:p,demoEntries:h,demoGames:f,demoPropositions:x,onSelectEntry:t,theme:l,renderTeamLogo:g,filterSport:y})})]})}function Na({className:e="",onBack:t,hideActions:n,backLabel:o="Category"}){const{theme:r,selectedCategory:l}=Kr(),a=r.colors,i=be(r);/* @__PURE__ */
|
|
262
|
+
return m("div",{className:`pl-0 sm:pl-2 ${e}`,children:[/* @__PURE__ */u("h1",{className:"text-[10px] sm:text-xs font-bold uppercase tracking-[0.14em] sm:tracking-[0.18em] mb-3 sm:mb-4",style:{color:a.primary,fontFamily:i},children:St(l)}),/* @__PURE__ */u(Dl,{onBack:t,hideActions:n,label:t?o:void 0})]})}function Ca({onCancel:e,className:t=""}){const{theme:n,screenSize:o}=Kr(),r=n.colors;return e&&"mobile"!==o?/* @__PURE__ */u("div",{className:`flex items-center pt-4 ${t}`,children:/* @__PURE__ */u("button",{type:"button",onClick:e,className:"px-5 py-2.5 rounded-lg text-sm font-medium transition-colors",style:{color:r.buttonSecondaryText,backgroundColor:r.buttonSecondary,cursor:"pointer"},children:"Cancel"})}):null}function Fa({onSelectSport:t,onCancel:n,hideTitle:o,hideActions:r,renderSportLogo:l,renderSportTagline:a,backLabel:i,comingSoonSports:s,className:c=""}){const{theme:d,propositionsForSportPicker:p,sportSummaries:h,loading:f,setSelectedSport:x,clearSelectedGame:g,selectedCategory:y,sportBaseKey:b,displaySportName:w}=Kr(),k=d.colors,v=V(d),N=ye(d),C=be(d),F=R(d),B=vt(p),A=Object.keys(B),[M,S]=e.useState(!1),L=e.useRef(null),P=e.useCallback(e=>{if(L.current?.disconnect(),L.current=null,!e)return;const t=()=>S(e.clientWidth<440);t(),"undefined"!=typeof ResizeObserver&&(L.current=new ResizeObserver(t),L.current.observe(e))},[]);return f?/* @__PURE__ */u(vn,{colors:J(d),bodyFont:N,className:c,variant:"sport",categoryCount:A.length>0?A.length:2}):/* @__PURE__ */m("div",{className:`flex flex-col min-h-full ${c}`,style:{fontFamily:N},children:[!o&&/* @__PURE__ */u("div",{className:"mb-2",children:/* @__PURE__ */u(Na,{onBack:n,hideActions:r,backLabel:i})}),/* @__PURE__ */u("div",{className:"flex-1",children:/* @__PURE__ */m("div",{ref:P,className:"grid gap-3 "+(M?"grid-cols-1":"grid-cols-2"),children:[A.map(e=>{const n=h.find(t=>t.key===e),o=n?.active_props??B[e].length,r=a?.(e,o)??(n?`${i=n.games_today} game${1===i?"":"s"} today · ${s=n.active_props} pick${1===s?"":"s"} available`:function(e,t){return 0===e?"racing"===t?"No races today":"casino"===t?"No games today":"No picks available":"racing"===t?`${e} race${1===e?"":"s"} today`:"casino"===t?`${e} game${1===e?"":"s"} available`:`${e} pick${1===e?"":"s"} available`}(o,y));var i,s;const c=w(e),p=n?n.games_today>0:o>0;/* @__PURE__ */
|
|
263
|
+
return m("button",{type:"button",onClick:()=>{x(e),g(),t?.(e)},className:"group flex w-full min-w-0 items-center gap-3 rounded-2xl border px-3 py-3 text-left transition-all hover:-translate-y-0.5 active:translate-y-0 sm:gap-3.5 sm:px-4 sm:py-4",style:{backgroundColor:v,borderColor:k.border,boxShadow:j(d),cursor:"pointer"},onMouseEnter:e=>{e.currentTarget.style.borderColor=k.primary},onMouseLeave:e=>{e.currentTarget.style.borderColor=k.border},children:[l?/* @__PURE__ */u("span",{className:"shrink-0",children:l(e)}):/* @__PURE__ */u(Zl,{gameKey:e,size:48,footer:null,sportBaseKey:b,title:`${c} button`,className:"h-10 w-10 shrink-0 sm:h-12 sm:w-12"}),
|
|
267
264
|
/* @__PURE__ */m("div",{className:"flex min-w-0 flex-1 flex-col",children:[/* @__PURE__ */u("span",{className:"max-w-full truncate text-sm font-extrabold leading-tight tracking-tight sm:text-base",style:{color:F,fontFamily:C},children:c}),/* @__PURE__ */m("span",{className:"mt-1 flex max-w-full items-center gap-1.5 text-[0.58rem] font-bold uppercase tracking-[0.12em]",style:{color:k.primary},children:[p&&/* @__PURE__ */u("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full",style:{backgroundColor:k.success}}),/* @__PURE__ */u("span",{className:"truncate",children:r})]})]}),
|
|
268
265
|
/* @__PURE__ */u(Je,{size:20,color:k.textMuted,className:"shrink-0 transition-transform group-hover:translate-x-0.5"})]},e)}),s?.map(e=>{const{game:t,league:n}=function(e,t){const n=e.match(/^(.*?)\s*\(([^)]+)\)\s*$/);return n?{game:n[1].trim(),league:n[2].trim()}:{game:e,league:t}}(e.label,e.short??ht(e.key,b));/* @__PURE__ */
|
|
269
266
|
return m("div",{className:"flex w-full min-w-0 items-center gap-3 rounded-2xl border px-3 py-3 text-left sm:gap-3.5 sm:px-4 sm:py-4",style:{backgroundColor:z(k.backgroundAlt,.4),borderColor:z(k.border,.7)},children:[
|
|
270
|
-
/* @__PURE__ */u("div",{className:"shrink-0",style:{opacity:.6,filter:"grayscale(1)"},children:l?l(e.key):/* @__PURE__ */u(
|
|
267
|
+
/* @__PURE__ */u("div",{className:"shrink-0",style:{opacity:.6,filter:"grayscale(1)"},children:l?l(e.key):/* @__PURE__ */u(Zl,{gameKey:e.key,short:e.short,size:48,footer:null,sportBaseKey:b,title:`${e.label} button`,className:"h-10 w-10 shrink-0 sm:h-12 sm:w-12"})}),
|
|
271
268
|
/* @__PURE__ */m("div",{className:"flex min-w-0 flex-1 flex-col",children:[/* @__PURE__ */m("span",{className:"max-w-full truncate text-sm font-extrabold leading-tight tracking-tight sm:text-base",style:{color:k.textMuted,fontFamily:C},children:[t,n&&n!==t?/* @__PURE__ */m("span",{className:"font-bold",children:[" · ",n]}):null]}),/* @__PURE__ */u("span",{className:"mt-1 max-w-full truncate text-[0.58rem] font-bold uppercase tracking-[0.12em]",style:{color:k.textMuted},children:(o=e.seasonStart,o?`Starts ${o}`:"Coming soon")})]}),
|
|
272
|
-
/* @__PURE__ */m("span",{className:"inline-flex shrink-0 items-center gap-1 rounded-full px-2 py-1 text-[10px] font-semibold uppercase tracking-[0.1em]",style:{backgroundColor:k.backgroundAlt,color:k.textMuted},children:[/* @__PURE__ */u(_e,{size:12,color:k.textMuted}),"Soon"]})]},e.key);var o})]})})]})}function
|
|
273
|
-
return u("style",{id:"blade-rulepage-styles",children:"\n.blade-rp{--e:cubic-bezier(.2,.8,.2,1)}\n.blade-rp-in{opacity:0;animation:blade-rp-in .5s var(--e) both}\n@keyframes blade-rp-in{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}\n.blade-rp-card{transition:transform .18s var(--e),box-shadow .18s var(--e),border-color .18s var(--e)}\n.blade-rp-card:hover{transform:translateY(-2px)}\n.blade-rp-card:active{transform:translateY(0) scale(.995)}\n@media (prefers-reduced-motion:reduce){.blade-rp *{animation:none!important}.blade-rp-in{opacity:1!important}}\n"})}function
|
|
269
|
+
/* @__PURE__ */m("span",{className:"inline-flex shrink-0 items-center gap-1 rounded-full px-2 py-1 text-[10px] font-semibold uppercase tracking-[0.1em]",style:{backgroundColor:k.backgroundAlt,color:k.textMuted},children:[/* @__PURE__ */u(_e,{size:12,color:k.textMuted}),"Soon"]})]},e.key);var o})]})})]})}function Ba(e,t){const n=/^#([0-9a-f]{6})$/i.exec(e?.trim()??"");if(!n)return e;const o=parseInt(n[1],16);return`rgba(${o>>16&255}, ${o>>8&255}, ${255&o}, ${t})`}function Aa(){/* @__PURE__ */
|
|
270
|
+
return u("style",{id:"blade-rulepage-styles",children:"\n.blade-rp{--e:cubic-bezier(.2,.8,.2,1)}\n.blade-rp-in{opacity:0;animation:blade-rp-in .5s var(--e) both}\n@keyframes blade-rp-in{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}\n.blade-rp-card{transition:transform .18s var(--e),box-shadow .18s var(--e),border-color .18s var(--e)}\n.blade-rp-card:hover{transform:translateY(-2px)}\n.blade-rp-card:active{transform:translateY(0) scale(.995)}\n@media (prefers-reduced-motion:reduce){.blade-rp *{animation:none!important}.blade-rp-in{opacity:1!important}}\n"})}function Ma({ink:e,ball:t,size:n,balls:o=1}){/* @__PURE__ */
|
|
274
271
|
return m("svg",{width:n,height:n,viewBox:"2 12 76 62",fill:"none","aria-hidden":!0,children:[
|
|
275
272
|
/* @__PURE__ */u("line",{x1:"9",y1:"18",x2:"71",y2:"18",stroke:e,strokeWidth:"2.5",strokeLinecap:"round"}),
|
|
276
273
|
/* @__PURE__ */u("path",{d:"M12 18L13 25.67 M17.6 18L19 25.67 M17.6 18L13 25.67 M23.2 18L25 25.67 M23.2 18L19 25.67 M28.8 18L31 25.67 M28.8 18L25 25.67 M34.4 18L37 25.67 M34.4 18L31 25.67 M40 18L43 25.67 M40 18L37 25.67 M45.6 18L49 25.67 M45.6 18L43 25.67 M51.2 18L55 25.67 M51.2 18L49 25.67 M56.8 18L61 25.67 M56.8 18L55 25.67 M62.4 18L67 25.67 M62.4 18L61 25.67 M68 18L67 25.67 M13 25.67L15.5 33.33 M19 25.67L21.62 33.33 M19 25.67L15.5 33.33 M25 25.67L27.75 33.33 M25 25.67L21.62 33.33 M31 25.67L33.88 33.33 M31 25.67L27.75 33.33 M37 25.67L40 33.33 M37 25.67L33.88 33.33 M43 25.67L46.12 33.33 M43 25.67L40 33.33 M49 25.67L52.25 33.33 M49 25.67L46.12 33.33 M55 25.67L58.38 33.33 M55 25.67L52.25 33.33 M61 25.67L64.5 33.33 M61 25.67L58.38 33.33 M67 25.67L64.5 33.33 M15.5 33.33L19 41 M21.62 33.33L25 41 M21.62 33.33L19 41 M27.75 33.33L31 41 M27.75 33.33L25 41 M33.88 33.33L37 41 M33.88 33.33L31 41 M40 33.33L43 41 M40 33.33L37 41 M46.12 33.33L49 41 M46.12 33.33L43 41 M52.25 33.33L55 41 M52.25 33.33L49 41 M58.38 33.33L61 41 M58.38 33.33L55 41 M64.5 33.33L61 41 M19 41L23 48.67 M25 41L28.67 48.67 M25 41L23 48.67 M31 41L34.33 48.67 M31 41L28.67 48.67 M37 41L40 48.67 M37 41L34.33 48.67 M43 41L45.67 48.67 M43 41L40 48.67 M49 41L51.33 48.67 M49 41L45.67 48.67 M55 41L57 48.67 M55 41L51.33 48.67 M61 41L57 48.67 M23 48.67L25 56.33 M28.67 48.67L31 56.33 M28.67 48.67L25 56.33 M34.33 48.67L37 56.33 M34.33 48.67L31 56.33 M40 48.67L43 56.33 M40 48.67L37 56.33 M45.67 48.67L49 56.33 M45.67 48.67L43 56.33 M51.33 48.67L55 56.33 M51.33 48.67L49 56.33 M57 48.67L55 56.33 M25 56.33L22 64 M31 56.33L31 60.1 M31 56.33L22 64 M37 56.33L40 59.5 M37 56.33L31 60.1 M43 56.33L49 60.1 M43 56.33L40 59.5 M49 56.33L58 64 M49 56.33L49 60.1 M55 56.33L58 64",fill:"none",stroke:e,strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",opacity:"0.9"}),
|
|
277
274
|
/* @__PURE__ */u("path",{d:"M12 18 C12.17 19.28 12.42 23.12 13 25.67 C13.58 28.23 14.5 30.77 15.5 33.33 C16.5 35.88 17.75 38.44 19 41 C20.25 43.56 22 46.12 23 48.67 C24 51.23 25.17 53.77 25 56.33 C24.83 58.88 22.5 62.72 22 64 M68 18 C67.83 19.28 67.58 23.12 67 25.67 C66.42 28.23 65.5 30.77 64.5 33.33 C63.5 35.88 62.25 38.44 61 41 C59.75 43.56 58 46.12 57 48.67 C56 51.23 54.83 53.77 55 56.33 C55.17 58.88 57.5 62.72 58 64",fill:"none",stroke:e,strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"}),
|
|
278
|
-
/* @__PURE__ */u("ellipse",{cx:"40",cy:"64",rx:"18",ry:"4.5",fill:"none",stroke:e,strokeWidth:"2.2"}),(o>=2?[{cx:33,cy:52,r:6.6},{cx:48,cy:49,r:6.6}]:[{cx:40,cy:50,r:8}]).map((e,n)=>/* @__PURE__ */u("circle",{cx:e.cx,cy:e.cy,r:e.r,fill:t},n))]})}function
|
|
275
|
+
/* @__PURE__ */u("ellipse",{cx:"40",cy:"64",rx:"18",ry:"4.5",fill:"none",stroke:e,strokeWidth:"2.2"}),(o>=2?[{cx:33,cy:52,r:6.6},{cx:48,cy:49,r:6.6}]:[{cx:40,cy:50,r:8}]).map((e,n)=>/* @__PURE__ */u("circle",{cx:e.cx,cy:e.cy,r:e.r,fill:t},n))]})}function Sa({ink:e,ball:t,size:n}){/* @__PURE__ */
|
|
279
276
|
return m("svg",{width:n,height:n,viewBox:"0 0 100 100",fill:"none","aria-hidden":!0,children:[
|
|
280
277
|
/* @__PURE__ */u("circle",{cx:"50",cy:"50",r:"34",stroke:e,strokeWidth:3,opacity:.9}),
|
|
281
278
|
/* @__PURE__ */u("circle",{cx:"50",cy:"50",r:"23",stroke:e,strokeWidth:3,opacity:.65}),
|
|
282
279
|
/* @__PURE__ */u("circle",{cx:"50",cy:"50",r:"8",fill:t}),
|
|
283
280
|
/* @__PURE__ */u("line",{x1:"80",y1:"20",x2:"55",y2:"45",stroke:e,strokeWidth:4,strokeLinecap:"round"}),
|
|
284
|
-
/* @__PURE__ */u("path",{d:"M50 50 l8 -3 -3 8 z",fill:e})]})}function
|
|
281
|
+
/* @__PURE__ */u("path",{d:"M50 50 l8 -3 -3 8 z",fill:e})]})}function La({ink:e,ball:t,size:n}){const o=[{x:16,h:22},{x:40,h:40},{x:64,h:60}];/* @__PURE__ */
|
|
285
282
|
return m("svg",{width:n,height:n,viewBox:"0 0 100 100",fill:"none","aria-hidden":!0,children:[
|
|
286
283
|
/* @__PURE__ */u("line",{x1:"10",y1:"84",x2:"90",y2:"84",stroke:e,strokeWidth:"2",opacity:"0.5"}),o.map((n,r)=>/* @__PURE__ */u("rect",{x:n.x,y:84-n.h,width:"16",height:n.h,rx:"3.5",fill:r===o.length-1?t:e,opacity:r===o.length-1?1:.5+.22*r},n.x)),
|
|
287
284
|
/* @__PURE__ */u("path",{d:"M14 60 L38 48 L62 30 L86 14",stroke:e,strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),
|
|
288
|
-
/* @__PURE__ */u("path",{d:"M86 14 l-9 1 M86 14 l1 9",stroke:e,strokeWidth:"3",strokeLinecap:"round"})]})}function
|
|
289
|
-
return u("span",{"aria-hidden":!0,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:t,height:t,borderRadius:.3*t,backgroundColor:l,border:`1px solid ${
|
|
290
|
-
return m("div",{className:"flex items-center justify-between gap-3",children:[/* @__PURE__ */m("span",{className:"flex min-w-0 flex-col gap-[3px]",children:[/* @__PURE__ */u("span",{className:"text-xs sm:text-[13px]",style:{color:o.text},children:t.label}),null!=i&&i>0&&/* @__PURE__ */m("span",{className:"flex items-center gap-[3px]","aria-hidden":!0,children:[Array.from({length:i}).map((e,t)=>/* @__PURE__ */u("span",{style:{width:5,height:5,borderRadius:1.5,backgroundColor:l,opacity:.85}},t)),0===t.misses&&/* @__PURE__ */u("span",{style:{width:7,height:7,borderRadius:999,backgroundColor:a,marginLeft:2}})]})]}),/* @__PURE__ */u("span",{className:"text-sm font-extrabold tabular-nums sm:text-base",style:{color:l,fontFamily:r},children:wt(t.payout20)})]},t.misses)})]})}function
|
|
285
|
+
/* @__PURE__ */u("path",{d:"M86 14 l-9 1 M86 14 l1 9",stroke:e,strokeWidth:"3",strokeLinecap:"round"})]})}function za({kind:e,balls:t,...n}){return"safety_net"===e?/* @__PURE__ */u(Ma,{...n,balls:t}):/* @__PURE__ */u("pick"===e?La:Sa,{...n})}function Pa({kind:e,size:t=56,balls:n}){const{theme:o}=Kr(),r=o.colors,l=o.brand?.chip??r.primary,a=o.brand?.icon??r.primaryText,i=$(o);/* @__PURE__ */
|
|
286
|
+
return u("span",{"aria-hidden":!0,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:t,height:t,borderRadius:.3*t,backgroundColor:l,border:`1px solid ${Ba(a,.16)}`,flexShrink:0,boxShadow:`0 8px 18px -12px ${Ba(l,.9)}`},children:/* @__PURE__ */u(za,{kind:e,ink:a,ball:i,balls:n,size:Math.round(.68*t)})})}function Ta({option:e,renderDividends:t}){const{theme:n}=Kr(),o=n.colors,r=be(n),l=o.primary,a=$(n),i=e.dividends??[];return t?/* @__PURE__ */u(d,{children:t(e)}):/* @__PURE__ */m("div",{className:"flex flex-col gap-1.5",children:[/* @__PURE__ */m("div",{className:"flex items-baseline justify-between text-[10px] font-semibold uppercase tracking-[0.1em]",style:{color:o.textMuted},children:[/* @__PURE__ */u("span",{children:"If you land"}),/* @__PURE__ */m("span",{children:["$",20," returns"]})]}),i.map((t,n)=>{const i=e.tierLegs?.[n];/* @__PURE__ */
|
|
287
|
+
return m("div",{className:"flex items-center justify-between gap-3",children:[/* @__PURE__ */m("span",{className:"flex min-w-0 flex-col gap-[3px]",children:[/* @__PURE__ */u("span",{className:"text-xs sm:text-[13px]",style:{color:o.text},children:t.label}),null!=i&&i>0&&/* @__PURE__ */m("span",{className:"flex items-center gap-[3px]","aria-hidden":!0,children:[Array.from({length:i}).map((e,t)=>/* @__PURE__ */u("span",{style:{width:5,height:5,borderRadius:1.5,backgroundColor:l,opacity:.85}},t)),0===t.misses&&/* @__PURE__ */u("span",{style:{width:7,height:7,borderRadius:999,backgroundColor:a,marginLeft:2}})]})]}),/* @__PURE__ */u("span",{className:"text-sm font-extrabold tabular-nums sm:text-base",style:{color:l,fontFamily:r},children:wt(t.payout20)})]},t.misses)})]})}function Da({option:e,renderDividends:t}){const{theme:n}=Kr(),r=n.colors,i=ye(n),h=Y(n),f=e.dividends??[],x=f.reduce((e,t)=>t.payout20>e?t.payout20:e,0),[g,y]=c(!1),b=s(null),w=s(null),[k,v]=c(null),N=40+36*Math.max(f.length,1)+12,C=o(()=>{const e=b.current;if(!e||"undefined"==typeof window)return;const t=e.getBoundingClientRect(),n=window.innerHeight-t.bottom,o=t.top,r=n<N&&o>n;v({left:t.left,top:r?t.top-6:t.bottom+6,flipUp:r})},[N]);a(()=>{if(!g)return void v(null);C();const e=()=>y(!1),t=()=>C();return window.addEventListener("scroll",e,!0),window.addEventListener("resize",t),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",t)}},[g,C]),l(()=>{if(!g)return;const e=e=>{const t=e.target;b.current?.contains(t)||w.current?.contains(t)||y(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[g]);const F=g&&k&&"undefined"!=typeof document?p(/* @__PURE__ */u("div",{ref:w,role:"listbox",className:"rounded-lg overflow-hidden",style:{position:"fixed",left:k.left,top:k.top,transform:k.flipUp?"translateY(-100%)":void 0,zIndex:9999,backgroundColor:r.background,border:`1px solid ${r.border}`,boxShadow:h,minWidth:220,fontFamily:i},children:t?/* @__PURE__ */u("div",{className:"px-3 py-2",children:t(e)}):/* @__PURE__ */m(d,{children:[/* @__PURE__ */m("div",{className:"px-3 py-1.5 text-[10px] font-bold tracking-wider uppercase",style:{color:r.text,opacity:.55,borderBottom:`1px solid ${r.border}`},children:["Dividends for $",20]}),f.map((e,t)=>/* @__PURE__ */m("div",{className:"flex items-center justify-between px-3 py-2",style:{borderTop:0===t?"none":`1px solid ${r.border}`,gap:14},children:[/* @__PURE__ */u("span",{style:{fontWeight:700,color:r.text,fontSize:13},children:e.label}),/* @__PURE__ */u("span",{style:{fontWeight:700,color:e.payout20>0?r.heading??r.text:r.textMuted,fontSize:13,textAlign:"right"},children:e.payout20>0?wt(e.payout20):"—"})]},e.misses))]})}),document.body):null;/* @__PURE__ */
|
|
291
288
|
return m("div",{className:"flex w-full justify-center",children:[/* @__PURE__ */m("div",{className:"flex flex-wrap items-center justify-center gap-x-2 gap-y-1 max-w-full",style:{fontFamily:i},children:[x>0&&/* @__PURE__ */m("span",{className:"text-xs font-semibold leading-snug",style:{color:r.text},children:["Win up to ",
|
|
292
289
|
/* @__PURE__ */u("span",{style:{color:r.heading??r.text},children:wt(x)}),
|
|
293
|
-
/* @__PURE__ */m("span",{style:{color:r.textMuted},children:[" for $",20]})]}),/* @__PURE__ */u("button",{ref:b,type:"button",onClick:()=>y(e=>!e),"aria-expanded":g,"aria-haspopup":"listbox",className:"text-xs font-semibold rounded-md transition-colors shrink-0",style:{background:g?r.buttonSecondary:r.background??"#ffffff",border:`1px solid ${g?r.primary??r.border:r.border}`,padding:"4px 10px",cursor:"pointer",color:r.text,fontFamily:i,lineHeight:1.35},children:g?"Hide dividends":"Show dividends"})]}),F]})}function
|
|
294
|
-
return m("div",{className:"blade-rp-card flex h-full flex-col rounded-3xl border-2 px-4 py-4 sm:px-5 sm:py-5",style:{backgroundColor:c,borderColor:l.border,boxShadow:`0 10px 24px -20px ${
|
|
295
|
-
/* @__PURE__ */u(
|
|
290
|
+
/* @__PURE__ */m("span",{style:{color:r.textMuted},children:[" for $",20]})]}),/* @__PURE__ */u("button",{ref:b,type:"button",onClick:()=>y(e=>!e),"aria-expanded":g,"aria-haspopup":"listbox",className:"text-xs font-semibold rounded-md transition-colors shrink-0",style:{background:g?r.buttonSecondary:r.background??"#ffffff",border:`1px solid ${g?r.primary??r.border:r.border}`,padding:"4px 10px",cursor:"pointer",color:r.text,fontFamily:i,lineHeight:1.35},children:g?"Hide dividends":"Show dividends"})]}),F]})}function Oa({kind:e,option:t,onSelect:n,renderDividends:o}){const{theme:r}=Kr(),l=r.colors,a=be(r),i=R(r),s=l.primary,c=l.selectionCard??l.backgroundAlt,d="safety_net"===e?Math.max(1,(t.detail?.length??2)-1):void 0,p=!!o||(t.dividends?.length??0)>0,h=p&&!!t.dividendsInline;/* @__PURE__ */
|
|
291
|
+
return m("div",{className:"blade-rp-card flex h-full flex-col rounded-3xl border-2 px-4 py-4 sm:px-5 sm:py-5",style:{backgroundColor:c,borderColor:l.border,boxShadow:`0 10px 24px -20px ${Ba(i,.7)}`},onMouseEnter:e=>{e.currentTarget.style.borderColor=s,e.currentTarget.style.boxShadow=`0 18px 36px -24px ${Ba(s,.95)}`},onMouseLeave:e=>{e.currentTarget.style.borderColor=l.border,e.currentTarget.style.boxShadow=`0 10px 24px -20px ${Ba(i,.7)}`},children:[/* @__PURE__ */m("button",{type:"button",onClick:n,className:"group flex w-full flex-1 items-start gap-3.5 text-left sm:gap-4",style:{background:"none",border:"none",padding:0,cursor:"pointer"},children:[
|
|
292
|
+
/* @__PURE__ */u(Pa,{kind:e,balls:d,size:60}),
|
|
296
293
|
/* @__PURE__ */m("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[
|
|
297
|
-
/* @__PURE__ */u("span",{className:"text-lg font-extrabold leading-none tracking-tight sm:text-xl",style:{color:i,fontFamily:a},children:t.label}),t.stat&&/* @__PURE__ */u("span",{className:"w-fit rounded-full px-2 py-0.5 text-[9px] font-bold uppercase tracking-[0.08em]",style:{backgroundColor:
|
|
298
|
-
/* @__PURE__ */u("span",{className:"shrink-0 self-center transition-transform group-hover:translate-x-0.5",style:{color:s},"aria-hidden":!0,children:/* @__PURE__ */u("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */u("path",{d:"m9 6 6 6-6 6"})})})]}),p&&/* @__PURE__ */u("div",{className:"mt-3 border-t pt-3",style:{borderColor:
|
|
299
|
-
return m("div",{className:`pl-0 sm:pl-2 ${e}`,children:[/* @__PURE__ */u("h1",{className:"text-[10px] sm:text-xs font-bold uppercase tracking-[0.14em] sm:tracking-[0.18em] mb-3 sm:mb-4",style:{color:i.primary,fontFamily:a},children:s?.title??"About this game"}),/* @__PURE__ */u(
|
|
294
|
+
/* @__PURE__ */u("span",{className:"text-lg font-extrabold leading-none tracking-tight sm:text-xl",style:{color:i,fontFamily:a},children:t.label}),t.stat&&/* @__PURE__ */u("span",{className:"w-fit rounded-full px-2 py-0.5 text-[9px] font-bold uppercase tracking-[0.08em]",style:{backgroundColor:Ba(s,.12),color:s},children:t.stat}),t.detail&&t.detail.length>0&&/* @__PURE__ */u("div",{className:"flex flex-col gap-0.5",style:{minHeight:"3.75rem"},children:t.detail.map(e=>/* @__PURE__ */u("span",{className:"text-xs leading-snug sm:text-[13px]",style:{color:l.textMuted},children:e},e))})]}),
|
|
295
|
+
/* @__PURE__ */u("span",{className:"shrink-0 self-center transition-transform group-hover:translate-x-0.5",style:{color:s},"aria-hidden":!0,children:/* @__PURE__ */u("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */u("path",{d:"m9 6 6 6-6 6"})})})]}),p&&/* @__PURE__ */u("div",{className:"mt-3 border-t pt-3",style:{borderColor:Ba(i,.08)},children:/* @__PURE__ */u(h?Ta:Da,{option:t,renderDividends:o})})]})}function Ea({className:e="",onBack:t,hideActions:n}){const{theme:o,selectedGame:r,selectedPropositionCount:l}=Kr(),a=be(o),i=o.colors,s=bo(r,l);/* @__PURE__ */
|
|
296
|
+
return m("div",{className:`pl-0 sm:pl-2 ${e}`,children:[/* @__PURE__ */u("h1",{className:"text-[10px] sm:text-xs font-bold uppercase tracking-[0.14em] sm:tracking-[0.18em] mb-3 sm:mb-4",style:{color:i.primary,fontFamily:a},children:s?.title??"About this game"}),/* @__PURE__ */u(Dl,{onBack:t,hideActions:n,label:r?`${r.game_name}${s?.subtitle?` · ${s.subtitle}`:""}`:void 0})]})}function ja({onContinue:e,canContinue:t,continueLabel:n="Continue",className:o=""}){const{theme:r,screenSize:l}=Kr(),a=r.colors;return e&&"mobile"!==l?/* @__PURE__ */u("div",{className:`flex items-center justify-end pt-4 ${o}`,children:/* @__PURE__ */u("button",{type:"button",onClick:e,disabled:!t,className:"px-5 py-2.5 rounded-lg text-sm font-semibold transition-colors disabled:opacity-45",style:{color:a.buttonPrimaryText,backgroundColor:a.buttonPrimary,cursor:t?"pointer":"not-allowed"},children:n})}):null}function Ya({onContinue:e,onBack:t,hideTitle:n,config:o,renderDividends:r,backLabel:l="Games",className:a=""}){const{theme:s,selectedGame:c,selectedPropositionCount:d,setExpectedCorrect:p,handlePropositionCountChange:h,screenSize:f}=Kr(),x=s.colors,g="mobile"===f,y=ye(s),b=be(s),w=R(s),k=$(s),v=i(()=>o??bo(c,d),[o,c,d]),N=v?.options??[],C=t=>{null!=t?.expectedCorrect&&p(t.expectedCorrect),null!=t?.propositionCount&&h(t.propositionCount),e?.()};if(!c||!v)/* @__PURE__ */return u("div",{className:a,style:{color:x.textMuted,fontFamily:y},children:"No rule setup required."});const F=v.kind,B=v.headline??v.heroTitle,A=v.continueLabel??"Continue";/* @__PURE__ */
|
|
300
297
|
return m("div",{className:`blade-rp flex min-h-full w-full flex-col ${a}`,style:{fontFamily:y},children:[
|
|
301
|
-
/* @__PURE__ */u(
|
|
298
|
+
/* @__PURE__ */u(Aa,{}),t&&/* @__PURE__ */u(Tl,{onBack:t,label:l}),
|
|
302
299
|
/* @__PURE__ */m("div",{className:"mx-auto flex w-full max-w-3xl flex-1 flex-col",children:[!n&&/* @__PURE__ */u("h2",{className:"blade-rp-in mb-4 text-center text-[10px] font-bold uppercase tracking-[0.14em] sm:mb-5 sm:text-xs sm:tracking-[0.18em]",style:{color:x.primary,fontFamily:b},children:v.title}),
|
|
303
300
|
/* @__PURE__ */m("header",{className:"blade-rp-in mb-6 flex flex-col items-center text-center sm:mb-7",children:[
|
|
304
|
-
/* @__PURE__ */u(
|
|
305
|
-
/* @__PURE__ */u(
|
|
306
|
-
/* @__PURE__ */u(
|
|
301
|
+
/* @__PURE__ */u(Ml,{iconUrl:Ae(c),gameName:c.game_name,height:g?24:32,chipColor:x.primary,textColor:x.text,iconColor:x.primaryText,accentColor:s.brand?.accent,compact:g}),v.subtitle&&/* @__PURE__ */u("p",{className:"mt-2 text-xs sm:text-sm",style:{color:x.textMuted},children:v.subtitle}),(B||v.heroTagline)&&/* @__PURE__ */u("p",{className:"mt-3 max-w-sm text-sm leading-relaxed sm:text-[15px]",style:{color:x.textMuted},children:v.heroTagline??B})]}),
|
|
302
|
+
/* @__PURE__ */u(ta,{className:"blade-rp-in"}),N.length>0?/* @__PURE__ */u("div",{className:N.length>1?"mx-auto grid w-full items-stretch gap-3 sm:grid-cols-2":"mx-auto flex w-full flex-col gap-3",children:N.map((e,t)=>/* @__PURE__ */u("div",{className:"blade-rp-in flex h-full min-h-0",style:{animationDelay:.06+.07*t+"s"},children:/* @__PURE__ */u(Oa,{kind:F,option:e,onSelect:()=>C(e),renderDividends:r})},e.id))}):v.highlights&&v.highlights.length>0&&/* @__PURE__ */u("div",{className:"blade-rp-in blade-rp-card flex flex-col rounded-3xl border-2 px-4 py-4 sm:px-5 sm:py-5",style:{backgroundColor:x.selectionCard??x.backgroundAlt,borderColor:x.border,boxShadow:`0 10px 24px -20px ${Ba(w,.7)}`,animationDelay:".06s"},onMouseEnter:e=>{e.currentTarget.style.borderColor=x.primary,e.currentTarget.style.boxShadow=`0 18px 36px -24px ${Ba(x.primary,.95)}`},onMouseLeave:e=>{e.currentTarget.style.borderColor=x.border,e.currentTarget.style.boxShadow=`0 10px 24px -20px ${Ba(w,.7)}`},children:/* @__PURE__ */m("button",{type:"button",onClick:()=>C(),"aria-label":A,className:"group flex w-full flex-1 items-start gap-3.5 text-left sm:gap-4",style:{background:"none",border:"none",padding:0,cursor:"pointer"},children:[
|
|
303
|
+
/* @__PURE__ */u(Pa,{kind:F,size:60}),
|
|
307
304
|
/* @__PURE__ */u("span",{className:"flex min-w-0 flex-1 flex-col gap-2",children:v.highlights.map(e=>/* @__PURE__ */m("span",{className:"flex items-start gap-3",children:[/* @__PURE__ */u("span",{className:"mt-[7px] h-1.5 w-1.5 shrink-0 rounded-full",style:{backgroundColor:k},"aria-hidden":!0}),/* @__PURE__ */u("span",{className:"text-sm leading-snug sm:text-[15px]",style:{color:w},children:e})]},e))}),
|
|
308
|
-
/* @__PURE__ */u("span",{className:"shrink-0 self-center transition-transform group-hover:translate-x-0.5",style:{color:x.primary},"aria-hidden":!0,children:/* @__PURE__ */u("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */u("path",{d:"m9 6 6 6-6 6"})})})]})})]})]})}function
|
|
309
|
-
return m("div",{className:`pl-0 sm:pl-2 ${e}`,children:[/* @__PURE__ */u("h1",{className:"text-[10px] sm:text-xs font-bold uppercase tracking-[0.14em] sm:tracking-[0.18em] mb-3 sm:mb-4",style:{color:a.primary,fontFamily:l},children:"The fastest multi"}),/* @__PURE__ */u(
|
|
305
|
+
/* @__PURE__ */u("span",{className:"shrink-0 self-center transition-transform group-hover:translate-x-0.5",style:{color:x.primary},"aria-hidden":!0,children:/* @__PURE__ */u("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */u("path",{d:"m9 6 6 6-6 6"})})})]})})]})]})}function Ha({className:e="",onBack:t,hideActions:n}){const{theme:o,selectedGame:r}=Kr(),l=be(o),a=o.colors;/* @__PURE__ */
|
|
306
|
+
return m("div",{className:`pl-0 sm:pl-2 ${e}`,children:[/* @__PURE__ */u("h1",{className:"text-[10px] sm:text-xs font-bold uppercase tracking-[0.14em] sm:tracking-[0.18em] mb-3 sm:mb-4",style:{color:a.primary,fontFamily:l},children:"The fastest multi"}),/* @__PURE__ */u(Dl,{onBack:t,hideActions:n,label:r?.game_name})]})}function Ra({onQuickPick:e,onPickYourOwn:t,onBack:n,hideTitle:o,config:r,backLabel:l="Games",className:a=""}){const{theme:s,selectedGame:d,selectedPropositionCount:p,handlePropositionCountChange:h,setExpectedCorrect:f,setBetAmount:x,quickPickGame:g,goToSportSelection:y}=Kr(),b=s.colors,w=ye(s),k=be(s),v=R(s),N=V(s),C=i(()=>r??Fo(d),[r,d]),[F,B]=c(()=>C?null!=p&&C.legOptions.includes(p)?p:C.defaultLegs:8),[A,M]=c(()=>C?.defaultStake??20);if(!d||!No(d)||!C)/* @__PURE__ */return u("div",{className:a,style:{color:b.textMuted,fontFamily:w},children:"No game set available."});const S=cr(Co(A,F,{operatorMargin:C.operatorMargin,perLegProbability:C.perLegProbability}).prize,d),L=A>=C.minStake,z=(e,t)=>/* @__PURE__ */m("div",{className:"mb-2 flex items-baseline justify-between",children:[/* @__PURE__ */u("span",{className:"text-[10px] font-bold uppercase tracking-[0.1em]",style:{color:b.textMuted},children:e}),/* @__PURE__ */u("span",{className:"text-xs font-semibold tabular-nums",style:{color:v},children:t})]});/* @__PURE__ */
|
|
310
307
|
return m("div",{className:`blade-gsb flex min-h-full w-full flex-col ${a}`,style:{fontFamily:w},children:[
|
|
311
308
|
/* @__PURE__ */u("style",{id:"blade-gsb-styles",children:"\n.blade-gsb{--e:cubic-bezier(.2,.8,.2,1)}\n.blade-gsb-in{opacity:0;animation:blade-gsb-in .5s var(--e) both}\n@keyframes blade-gsb-in{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}\n@media (prefers-reduced-motion:reduce){.blade-gsb *{animation:none!important}.blade-gsb-in{opacity:1!important}}\n"}),
|
|
312
|
-
/* @__PURE__ */u(
|
|
309
|
+
/* @__PURE__ */u(aa,{}),n&&/* @__PURE__ */u(Tl,{onBack:n,label:l}),
|
|
313
310
|
/* @__PURE__ */m("div",{className:"mx-auto flex w-full flex-1 flex-col",children:[
|
|
314
|
-
/* @__PURE__ */u(
|
|
315
|
-
/* @__PURE__ */u(
|
|
316
|
-
/* @__PURE__ */m("div",{className:"blade-gsb-in rounded-3xl border-2 px-4 py-4 sm:px-5 sm:py-5",style:{backgroundColor:N,borderColor:b.border,boxShadow:`0 10px 24px -20px ${
|
|
311
|
+
/* @__PURE__ */u(ea,{className:"blade-gsb-in",eyebrow:o?null:"The fastest multi",iconUrl:Ae(d),gameName:d.game_name,tagline:C.tagline}),
|
|
312
|
+
/* @__PURE__ */u(ta,{}),
|
|
313
|
+
/* @__PURE__ */m("div",{className:"blade-gsb-in rounded-3xl border-2 px-4 py-4 sm:px-5 sm:py-5",style:{backgroundColor:N,borderColor:b.border,boxShadow:`0 10px 24px -20px ${Jl(v,.7)}`,animationDelay:".06s"},children:[z("Legs",`${F} legs`),
|
|
317
314
|
/* @__PURE__ */u("div",{className:"flex flex-wrap gap-1.5",role:"radiogroup","aria-label":"Number of legs",children:C.legOptions.map(e=>{const t=e===F;/* @__PURE__ */
|
|
318
315
|
return u("button",{type:"button",role:"radio","aria-checked":t,onClick:()=>B(e),className:"min-w-[40px] flex-1 rounded-lg border px-1 py-2 text-sm font-bold transition-colors",style:{backgroundColor:t?b.primary:"transparent",borderColor:t?b.primary:b.border,color:t?b.primaryText:b.textMuted,cursor:"pointer"},children:e},e)})}),
|
|
319
316
|
/* @__PURE__ */m("div",{className:"mt-2 flex items-baseline justify-between text-[11px] italic",style:{color:b.textMuted},children:[/* @__PURE__ */u("span",{children:"Easier to land"}),/* @__PURE__ */u("span",{children:"Bigger prize"})]}),
|
|
@@ -321,46 +318,46 @@ return u("button",{type:"button",role:"radio","aria-checked":t,onClick:()=>B(e),
|
|
|
321
318
|
/* @__PURE__ */m("div",{className:"relative",children:[/* @__PURE__ */u("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 font-bold",style:{color:b.textMuted},children:"$"}),/* @__PURE__ */u("input",{type:"number",inputMode:"decimal",min:C.minStake,max:C.maxStake??void 0,step:"any",placeholder:"Enter stake","aria-label":"Stake amount",value:A||"",onChange:e=>{if(""===e.target.value)return void M(0);const t=Number(e.target.value);Number.isFinite(t)&&M((e=>{const t=Math.max(0,Math.round(100*e)/100);return null!==C.maxStake?Math.min(t,C.maxStake):t})(t))},onFocus:e=>{e.currentTarget.style.borderColor=b.borderFocus??b.primary},onBlur:e=>{e.currentTarget.style.borderColor=b.border},className:"w-full rounded-lg border py-3 pl-8 pr-4 text-lg font-semibold tabular-nums focus:outline-none",style:{borderColor:b.border,color:b.textAlt??b.text,backgroundColor:b.backgroundAlt,fontFamily:w,transition:"border-color .15s ease"}})]}),
|
|
322
319
|
/* @__PURE__ */u("div",{className:"mt-2 flex flex-wrap gap-1.5",children:C.quickStakes.map(e=>{const t=e===A;/* @__PURE__ */
|
|
323
320
|
return m("button",{type:"button",onClick:()=>M(e),className:"min-w-[48px] flex-1 rounded-lg border px-1 py-2 text-sm font-bold transition-colors",style:{backgroundColor:t?b.primary:"transparent",borderColor:t?b.primary:b.border,color:t?b.primaryText:b.textMuted,cursor:"pointer"},children:["$",e]},e)})}),!L&&A>0&&/* @__PURE__ */m("p",{className:"mt-2 text-xs",style:{color:b.error},children:["Minimum stake is ",wt(C.minStake),"."]})]}),
|
|
324
|
-
/* @__PURE__ */m("div",{className:"mt-4 border-t pt-3",style:{borderColor:
|
|
321
|
+
/* @__PURE__ */m("div",{className:"mt-4 border-t pt-3",style:{borderColor:Jl(v,.08)},children:[
|
|
325
322
|
/* @__PURE__ */m("div",{className:"flex items-baseline justify-between text-[10px] font-semibold uppercase tracking-[0.1em]",style:{color:b.textMuted},children:[/* @__PURE__ */m("span",{children:["If all ",F," land"]}),/* @__PURE__ */m("span",{children:[wt(A)," returns"]})]}),
|
|
326
|
-
/* @__PURE__ */m("div",{className:"mt-1.5 flex items-center justify-between gap-3",children:[/* @__PURE__ */m("span",{className:"flex min-w-0 flex-col gap-[3px]",children:[/* @__PURE__ */u("span",{className:"text-xs sm:text-[13px]",style:{color:b.text},children:"Perfect ticket"}),/* @__PURE__ */u(
|
|
323
|
+
/* @__PURE__ */m("div",{className:"mt-1.5 flex items-center justify-between gap-3",children:[/* @__PURE__ */m("span",{className:"flex min-w-0 flex-col gap-[3px]",children:[/* @__PURE__ */u("span",{className:"text-xs sm:text-[13px]",style:{color:b.text},children:"Perfect ticket"}),/* @__PURE__ */u(ra,{legs:F})]}),/* @__PURE__ */u("span",{className:"text-xl font-extrabold tabular-nums sm:text-2xl",style:{color:b.primary,fontFamily:k},children:wt(S)})]}),
|
|
327
324
|
/* @__PURE__ */u("p",{className:"mt-1 text-[11px] italic",style:{color:b.textMuted},children:"All or nothing. Miss a single leg and the ticket does not pay."})]})]}),
|
|
328
|
-
/* @__PURE__ */m("div",{className:"mt-4 grid gap-3 sm:mt-5 sm:grid-cols-2",children:[/* @__PURE__ */u("div",{className:"blade-gsb-in",style:{animationDelay:".13s"},children:/* @__PURE__ */u(
|
|
329
|
-
return m("div",{className:`pl-0 sm:pl-2 ${e}`,children:[/* @__PURE__ */u("h1",{className:"text-[10px] sm:text-xs font-bold uppercase tracking-[0.14em] sm:tracking-[0.18em] mb-3 sm:mb-4",style:{color:a.primary,fontFamily:l},children:"The dividend is set"}),/* @__PURE__ */u(
|
|
325
|
+
/* @__PURE__ */m("div",{className:"mt-4 grid gap-3 sm:mt-5 sm:grid-cols-2",children:[/* @__PURE__ */u("div",{className:"blade-gsb-in",style:{animationDelay:".13s"},children:/* @__PURE__ */u(la,{tile:/* @__PURE__ */u(_l,{iconUrl:Ae(d),size:60}),label:"Pick my own",stat:"Your calls",detail:["A clean yes or no on every leg","You read the games, you make the calls"],onSelect:()=>{L&&(h(F),f(F),x(A),y(),t?.())}})}),/* @__PURE__ */u("div",{className:"blade-gsb-in",style:{animationDelay:".2s"},children:/* @__PURE__ */u(la,{tile:/* @__PURE__ */u(_l,{iconUrl:`${ve}quickpick`,size:60}),label:"QuickPick for me",stat:"Fastest",detail:["We fill every leg for you","Straight to the bet slip"],onSelect:()=>{L&&(f(F),x(A),g(d,F,A),e?.())}})})]})]})]})}function Ga({className:e="",onBack:t,hideActions:n}){const{theme:o,selectedGame:r}=Kr(),l=be(o),a=o.colors;/* @__PURE__ */
|
|
326
|
+
return m("div",{className:`pl-0 sm:pl-2 ${e}`,children:[/* @__PURE__ */u("h1",{className:"text-[10px] sm:text-xs font-bold uppercase tracking-[0.14em] sm:tracking-[0.18em] mb-3 sm:mb-4",style:{color:a.primary,fontFamily:l},children:"The dividend is set"}),/* @__PURE__ */u(Dl,{onBack:t,hideActions:n,label:r?.game_name})]})}function Wa({onQuickPick:e,onPickYourOwn:t,onBack:n,hideTitle:o,config:r,backLabel:l="Games",className:a=""}){const{theme:s,selectedGame:d,selectedPropositionCount:p,handlePropositionCountChange:h,setExpectedCorrect:f,setBetAmount:x,quickPickGame:g,goToSportSelection:y}=Kr(),b=s.colors,w=ye(s),k=be(s),v=R(s),N=V(s),C=i(()=>r??Po(d),[r,d]),[F,B]=c(()=>C?.defaultDividend??1e4),[A,M]=c(()=>{const e=C?.dividends[0]?.rungs.map(e=>e.legs)??[];return null!=p&&e.includes(p)?p:C?.defaultLegs??9});if(!d||!Mo(d)||!C)/* @__PURE__ */return u("div",{className:a,style:{color:b.textMuted,fontFamily:w},children:"No dividend series available."});const S=C.dividends.find(e=>e.dividend===F)??C.dividends[0],L=S.rungs.find(e=>e.legs===A)??S.rungs[0],z=Math.max(...S.rungs.map(e=>e.legs)),P=Math.min(...S.rungs.map(e=>e.legs));/* @__PURE__ */
|
|
330
327
|
return m("div",{className:`blade-pyd flex min-h-full w-full flex-col ${a}`,style:{fontFamily:w},children:[
|
|
331
328
|
/* @__PURE__ */u("style",{id:"blade-pyd-styles",children:"\n.blade-pyd{--e:cubic-bezier(.2,.8,.2,1)}\n.blade-pyd-in{opacity:0;animation:blade-pyd-in .5s var(--e) both}\n@keyframes blade-pyd-in{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}\n@media (prefers-reduced-motion:reduce){.blade-pyd *{animation:none!important}.blade-pyd-in{opacity:1!important}}\n"}),
|
|
332
|
-
/* @__PURE__ */u(
|
|
329
|
+
/* @__PURE__ */u(aa,{}),n&&/* @__PURE__ */u(Tl,{onBack:n,label:l}),
|
|
333
330
|
/* @__PURE__ */m("div",{className:"mx-auto flex w-full flex-1 flex-col",children:[
|
|
334
|
-
/* @__PURE__ */u(
|
|
335
|
-
/* @__PURE__ */u(
|
|
336
|
-
/* @__PURE__ */m("div",{className:"blade-pyd-in rounded-3xl border-2 px-4 py-4 sm:px-5 sm:py-5",style:{backgroundColor:N,borderColor:b.border,boxShadow:`0 10px 24px -20px ${
|
|
337
|
-
/* @__PURE__ */u(
|
|
338
|
-
return m("button",{type:"button",role:"radio","aria-checked":t,onClick:()=>B(e.dividend),className:`rounded-xl border px-2 py-3 text-center transition-colors ${
|
|
331
|
+
/* @__PURE__ */u(ea,{className:"blade-pyd-in",eyebrow:o?null:"Pick your dividend",iconUrl:Ae(d),gameName:d.game_name,tagline:C.tagline}),
|
|
332
|
+
/* @__PURE__ */u(ta,{}),
|
|
333
|
+
/* @__PURE__ */m("div",{className:"blade-pyd-in rounded-3xl border-2 px-4 py-4 sm:px-5 sm:py-5",style:{backgroundColor:N,borderColor:b.border,boxShadow:`0 10px 24px -20px ${Jl(v,.7)}`,animationDelay:".06s"},children:[(T=wt(S.dividend),/* @__PURE__ */m("div",{className:"mb-2 flex items-baseline justify-between",children:[/* @__PURE__ */u("span",{className:"text-[10px] font-bold uppercase tracking-[0.1em]",style:{color:b.textMuted},children:"Set dividend"}),T&&/* @__PURE__ */u("span",{className:"text-xs font-semibold tabular-nums",style:{color:v},children:T})]})),
|
|
334
|
+
/* @__PURE__ */u(na,{smGridClassName:"sm:grid-cols-4",ariaLabel:"Set dividend",children:C.dividends.map(e=>{const t=e.dividend===F;/* @__PURE__ */
|
|
335
|
+
return m("button",{type:"button",role:"radio","aria-checked":t,onClick:()=>B(e.dividend),className:`rounded-xl border px-2 py-3 text-center transition-colors ${oa}`,style:{backgroundColor:t?Jl(b.primary,.08):"transparent",borderColor:t?b.primary:b.border,cursor:"pointer"},onMouseEnter:e=>{e.currentTarget.style.borderColor=b.primary},onMouseLeave:e=>{e.currentTarget.style.borderColor=t?b.primary:b.border},children:[/* @__PURE__ */u("span",{className:"block text-base font-extrabold leading-none tracking-tight tabular-nums sm:text-xl",style:{color:v,fontFamily:k},children:wt(e.dividend)}),/* @__PURE__ */m("span",{className:"mt-1 block text-[10px]",style:{color:b.textMuted},children:["from ",wt(e.rungs[0]?.stake??0)]})]},e.dividend)})}),
|
|
339
336
|
/* @__PURE__ */u("p",{className:"mt-2 text-[11px] italic",style:{color:b.textMuted},children:"One set amount — it does not move, whatever you spend."}),
|
|
340
|
-
/* @__PURE__ */m("div",{className:"mt-4 border-t pt-3",style:{borderColor:
|
|
337
|
+
/* @__PURE__ */m("div",{className:"mt-4 border-t pt-3",style:{borderColor:Jl(v,.08)},children:[
|
|
341
338
|
/* @__PURE__ */m("div",{className:"flex items-baseline justify-between text-[10px] font-semibold uppercase tracking-[0.1em]",style:{color:b.textMuted},children:[/* @__PURE__ */u("span",{children:"Legs to land"}),/* @__PURE__ */u("span",{children:"Your stake"})]}),
|
|
342
339
|
/* @__PURE__ */u("div",{className:"mt-1.5 flex flex-col gap-1.5",role:"radiogroup","aria-label":"Stake ladder",children:S.rungs.map(e=>{const t=e.legs===A;/* @__PURE__ */
|
|
343
|
-
return m("button",{type:"button",role:"radio","aria-checked":t,onClick:()=>M(e.legs),className:"flex items-center justify-between gap-3 rounded-xl border px-3 py-1.5 text-left transition-colors sm:py-2",style:{backgroundColor:t?
|
|
344
|
-
/* @__PURE__ */u("span",{className:"hidden sm:inline",children:e.legs===z?" · the long climb":e.legs===P?" · the sprint":""})]}),/* @__PURE__ */u(
|
|
340
|
+
return m("button",{type:"button",role:"radio","aria-checked":t,onClick:()=>M(e.legs),className:"flex items-center justify-between gap-3 rounded-xl border px-3 py-1.5 text-left transition-colors sm:py-2",style:{backgroundColor:t?Jl(b.primary,.08):"transparent",borderColor:t?b.primary:b.border,cursor:"pointer"},onMouseEnter:e=>{e.currentTarget.style.borderColor=b.primary},onMouseLeave:e=>{e.currentTarget.style.borderColor=t?b.primary:b.border},children:[/* @__PURE__ */m("span",{className:"flex min-w-0 flex-col gap-[3px]",children:[/* @__PURE__ */m("span",{className:"text-xs sm:text-[13px]",style:{color:b.text},children:[e.legs," legs",
|
|
341
|
+
/* @__PURE__ */u("span",{className:"hidden sm:inline",children:e.legs===z?" · the long climb":e.legs===P?" · the sprint":""})]}),/* @__PURE__ */u(ra,{legs:e.legs})]}),/* @__PURE__ */u("span",{className:"shrink-0 text-sm font-extrabold tabular-nums sm:text-base",style:{color:b.primary,fontFamily:k},children:wt(e.stake)})]},e.legs)})}),
|
|
345
342
|
/* @__PURE__ */u("p",{className:"mt-2 text-[11px] italic",style:{color:b.textMuted},children:"Same dividend on every rung — a little for the long climb, more for the short one."})]})]}),
|
|
346
|
-
/* @__PURE__ */m("div",{className:"mt-4 grid gap-3 sm:mt-5 sm:grid-cols-2",children:[/* @__PURE__ */u("div",{className:"blade-pyd-in",style:{animationDelay:".13s"},children:/* @__PURE__ */u(
|
|
347
|
-
return m("div",{className:`pl-0 sm:pl-2 ${e}`,children:[/* @__PURE__ */u("h1",{className:"text-[10px] sm:text-xs font-bold uppercase tracking-[0.14em] sm:tracking-[0.18em] mb-3 sm:mb-4",style:{color:a.primary,fontFamily:l},children:"Every step pays"}),/* @__PURE__ */u(
|
|
343
|
+
/* @__PURE__ */m("div",{className:"mt-4 grid gap-3 sm:mt-5 sm:grid-cols-2",children:[/* @__PURE__ */u("div",{className:"blade-pyd-in",style:{animationDelay:".13s"},children:/* @__PURE__ */u(la,{tile:/* @__PURE__ */u(_l,{iconUrl:Ae(d),size:60}),label:"Pick my own",stat:"Your calls",detail:[`A clean yes or no on all ${L.legs} legs`,`${wt(L.stake)} chasing the ${wt(S.dividend)}`],onSelect:()=>{var e;h((e=L).legs),f(e.legs),x(e.stake),y(),t?.()}})}),/* @__PURE__ */u("div",{className:"blade-pyd-in",style:{animationDelay:".2s"},children:/* @__PURE__ */u(la,{tile:/* @__PURE__ */u(_l,{iconUrl:`${ve}quickpick`,size:60}),label:"QuickPick for me",stat:"Fastest",detail:[`We fill all ${L.legs} legs at ${wt(L.stake)}`,"Straight to the bet slip"],onSelect:()=>{f(L.legs),x(L.stake),g(d,L.legs,L.stake),e?.()}})})]})]})]});var T}function Ia({className:e="",onBack:t,hideActions:n}){const{theme:o,selectedGame:r}=Kr(),l=be(o),a=o.colors;/* @__PURE__ */
|
|
344
|
+
return m("div",{className:`pl-0 sm:pl-2 ${e}`,children:[/* @__PURE__ */u("h1",{className:"text-[10px] sm:text-xs font-bold uppercase tracking-[0.14em] sm:tracking-[0.18em] mb-3 sm:mb-4",style:{color:a.primary,fontFamily:l},children:"Every step pays"}),/* @__PURE__ */u(Dl,{onBack:t,hideActions:n,label:r?.game_name})]})}function Ua({onQuickPick:t,onPickYourOwn:n,onBack:o,hideTitle:r,config:l,backLabel:a="Games",className:s=""}){const{theme:d,selectedGame:p,selectedPropositionCount:h,handlePropositionCountChange:f,setExpectedCorrect:x,setBetAmount:g,quickPickGame:y,goToSportSelection:b,screenSize:w}=Kr(),k=d.colors,v="mobile"===w,N=ye(d),C=be(d),F=R(d),B=$(d),A=V(d),M=i(()=>l??Go(p),[l,p]),[S,L]=c(()=>M?null!=h&&M.ladders.some(e=>e.legs===h)?h:M.defaultLegs:8),[z,P]=c(()=>M?.defaultStake??50),[T,D]=c(!1);if(!p||!Eo(p)||!M)/* @__PURE__ */return u("div",{className:s,style:{color:k.textMuted,fontFamily:N},children:"No ladders available."});const O=M.ladders.find(e=>e.legs===S)??M.ladders[0],E=Yo(O,z),j=Ho(O,z),Y=[...E].reverse(),H=v&&Y.length>4,G=H&&!T?Y.slice(0,3):Y,W=(e,t)=>/* @__PURE__ */m("div",{className:"mb-2 flex items-baseline justify-between",children:[/* @__PURE__ */u("span",{className:"text-[10px] font-bold uppercase tracking-[0.1em]",style:{color:k.textMuted},children:e}),t&&/* @__PURE__ */u("span",{className:"text-xs font-semibold tabular-nums",style:{color:F},children:t})]});/* @__PURE__ */
|
|
348
345
|
return m("div",{className:`blade-lad flex min-h-full w-full flex-col ${s}`,style:{fontFamily:N},children:[
|
|
349
346
|
/* @__PURE__ */u("style",{id:"blade-lad-styles",children:"\n.blade-lad{--e:cubic-bezier(.2,.8,.2,1)}\n.blade-lad-in{opacity:0;animation:blade-lad-in .5s var(--e) both}\n@keyframes blade-lad-in{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}\n@media (prefers-reduced-motion:reduce){.blade-lad *{animation:none!important}.blade-lad-in{opacity:1!important}}\n"}),
|
|
350
|
-
/* @__PURE__ */u(
|
|
347
|
+
/* @__PURE__ */u(aa,{}),o&&/* @__PURE__ */u(Tl,{onBack:o,label:a}),
|
|
351
348
|
/* @__PURE__ */m("div",{className:"mx-auto flex w-full flex-1 flex-col",children:[
|
|
352
|
-
/* @__PURE__ */u(
|
|
353
|
-
/* @__PURE__ */u(
|
|
354
|
-
/* @__PURE__ */m("div",{className:"blade-lad-in rounded-3xl border-2 px-4 py-4 sm:px-5 sm:py-5",style:{backgroundColor:A,borderColor:k.border,boxShadow:`0 10px 24px -20px ${
|
|
349
|
+
/* @__PURE__ */u(ea,{className:"blade-lad-in",eyebrow:r?null:"Climb the ladder. Stack the prizes.",iconUrl:Ae(p),gameName:p.game_name,tagline:M.tagline}),
|
|
350
|
+
/* @__PURE__ */u(ta,{}),
|
|
351
|
+
/* @__PURE__ */m("div",{className:"blade-lad-in rounded-3xl border-2 px-4 py-4 sm:px-5 sm:py-5",style:{backgroundColor:A,borderColor:k.border,boxShadow:`0 10px 24px -20px ${Jl(F,.7)}`,animationDelay:".06s"},children:[W("Your bet",wt(z)),
|
|
355
352
|
/* @__PURE__ */u("div",{className:"flex flex-wrap gap-1.5",role:"radiogroup","aria-label":"Bet size",children:M.stakes.map(e=>{const t=e===z;/* @__PURE__ */
|
|
356
353
|
return m("button",{type:"button",role:"radio","aria-checked":t,onClick:()=>P(e),className:"min-w-[52px] flex-1 rounded-lg border px-1 py-2 text-sm font-bold transition-colors",style:{backgroundColor:t?k.primary:"transparent",borderColor:t?k.primary:k.border,color:t?k.primaryText:k.textMuted,cursor:"pointer"},children:["$",e]},e)})}),
|
|
357
354
|
/* @__PURE__ */u("p",{className:"mt-2 text-[11px] italic",style:{color:k.textMuted},children:"Every prize scales with your bet."}),
|
|
358
|
-
/* @__PURE__ */m("div",{className:"mt-4",children:[W(`${M.ladders.length} ladders to choose from`),/* @__PURE__ */u(
|
|
359
|
-
return m("button",{type:"button",role:"radio","aria-checked":t,onClick:()=>L(e.legs),className:`rounded-xl border px-2 py-3 text-center transition-colors ${
|
|
355
|
+
/* @__PURE__ */m("div",{className:"mt-4",children:[W(`${M.ladders.length} ladders to choose from`),/* @__PURE__ */u(na,{smGridClassName:"sm:grid-cols-5",ariaLabel:"Ladder",children:M.ladders.map(e=>{const t=e.legs===S;/* @__PURE__ */
|
|
356
|
+
return m("button",{type:"button",role:"radio","aria-checked":t,onClick:()=>L(e.legs),className:`rounded-xl border px-2 py-3 text-center transition-colors ${oa}`,style:{backgroundColor:t?Jl(k.primary,.08):"transparent",borderColor:t?k.primary:k.border,cursor:"pointer"},onMouseEnter:e=>{e.currentTarget.style.borderColor=k.primary},onMouseLeave:e=>{e.currentTarget.style.borderColor=t?k.primary:k.border},children:[
|
|
360
357
|
/* @__PURE__ */m("span",{className:"block text-[10px] font-bold uppercase tracking-[0.1em]",style:{color:k.primary},children:["Ladder ",e.legs]}),
|
|
361
|
-
/* @__PURE__ */u("span",{className:"mt-1 block text-lg font-extrabold leading-none tracking-tight tabular-nums sm:text-xl",style:{color:F,fontFamily:C},children:wt(
|
|
358
|
+
/* @__PURE__ */u("span",{className:"mt-1 block text-lg font-extrabold leading-none tracking-tight tabular-nums sm:text-xl",style:{color:F,fontFamily:C},children:wt(Ho(e,z))}),
|
|
362
359
|
/* @__PURE__ */m("span",{className:"mt-1 block text-[10px]",style:{color:k.textMuted},children:["Win from ",e.firstPayingTier," right"]})]},e.legs)})})]}),
|
|
363
|
-
/* @__PURE__ */m("div",{className:"mt-4 border-t pt-3",style:{borderColor:
|
|
360
|
+
/* @__PURE__ */m("div",{className:"mt-4 border-t pt-3",style:{borderColor:Jl(F,.08)},children:[
|
|
364
361
|
/* @__PURE__ */m("p",{className:"mb-2 text-xs",style:{color:k.text},children:["Ladder ",O.legs," wins from ",O.firstPayingTier," right — every tier stacks into the"," ",
|
|
365
362
|
/* @__PURE__ */u("span",{style:{fontWeight:700,color:F},children:wt(j)})," Full Stack Prize."]}),
|
|
366
363
|
/* @__PURE__ */m("div",{className:"grid items-center gap-x-3 gap-y-1.5 sm:gap-x-4",style:{gridTemplateColumns:"minmax(0,1fr) auto auto"},children:[
|
|
@@ -368,56 +365,56 @@ return m("button",{type:"button",role:"radio","aria-checked":t,onClick:()=>L(e.l
|
|
|
368
365
|
/* @__PURE__ */u("span",{className:"text-right text-[10px] font-semibold uppercase tracking-[0.1em]",style:{color:k.textMuted},children:"Tier pays"}),
|
|
369
366
|
/* @__PURE__ */u("span",{className:"text-right text-[10px] font-semibold uppercase tracking-[0.1em]",style:{color:k.textMuted},children:"You collect"}),G.map(t=>{const n=t.atLeast===O.legs;/* @__PURE__ */
|
|
370
367
|
return m(e.Fragment,{children:[
|
|
371
|
-
/* @__PURE__ */m("span",{className:"flex min-w-0 flex-col gap-[3px]",children:[/* @__PURE__ */m("span",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-xs sm:text-[13px]",style:{color:k.text},children:[t.atLeast," of ",O.legs,n&&/* @__PURE__ */u("span",{className:"hidden rounded-full px-2 py-0.5 text-[9px] font-bold uppercase tracking-[0.08em] sm:inline",style:{backgroundColor:
|
|
368
|
+
/* @__PURE__ */m("span",{className:"flex min-w-0 flex-col gap-[3px]",children:[/* @__PURE__ */m("span",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-xs sm:text-[13px]",style:{color:k.text},children:[t.atLeast," of ",O.legs,n&&/* @__PURE__ */u("span",{className:"hidden rounded-full px-2 py-0.5 text-[9px] font-bold uppercase tracking-[0.08em] sm:inline",style:{backgroundColor:Jl(B,.35),color:F},children:"Full stack"})]}),/* @__PURE__ */u(ra,{legs:t.atLeast,prizeBall:n})]}),
|
|
372
369
|
/* @__PURE__ */u("span",{className:"text-right text-[11px] tabular-nums",style:{color:k.textMuted},children:wt(t.prize)}),
|
|
373
370
|
/* @__PURE__ */u("span",{className:"text-right text-sm font-extrabold tabular-nums sm:text-base",style:{color:k.primary,fontFamily:C},children:wt(t.cumulative)})]},t.atLeast)})]}),H&&/* @__PURE__ */u("button",{type:"button",onClick:()=>D(e=>!e),"aria-expanded":T,className:"mt-2 w-full rounded-lg border py-2 text-[11px] font-bold",style:{borderColor:k.border,color:k.primary,background:"transparent",cursor:"pointer"},children:T?"Show fewer tiers":`Show all ${Y.length} tiers`}),
|
|
374
371
|
/* @__PURE__ */m("p",{className:"mt-2 text-[11px] italic",style:{color:k.textMuted},children:["Land below ",O.firstPayingTier," right and the ticket does not pay."]})]})]}),
|
|
375
|
-
/* @__PURE__ */m("div",{className:"mt-4 grid gap-3 sm:mt-5 sm:grid-cols-2",children:[/* @__PURE__ */u("div",{className:"blade-lad-in",style:{animationDelay:".13s"},children:/* @__PURE__ */u(
|
|
372
|
+
/* @__PURE__ */m("div",{className:"mt-4 grid gap-3 sm:mt-5 sm:grid-cols-2",children:[/* @__PURE__ */u("div",{className:"blade-lad-in",style:{animationDelay:".13s"},children:/* @__PURE__ */u(la,{tile:/* @__PURE__ */u(_l,{iconUrl:Ae(p),size:60}),label:"Pick my own",stat:"Your calls",detail:[`A clean yes or no on all ${O.legs} outcomes`,`Win from ${O.firstPayingTier} right — every tier stacks`],onSelect:()=>{f(O.legs),x(O.legs),g(z),b(),n?.()}})}),/* @__PURE__ */u("div",{className:"blade-lad-in",style:{animationDelay:".2s"},children:/* @__PURE__ */u(la,{tile:/* @__PURE__ */u(_l,{iconUrl:`${ve}quickpick`,size:60}),label:"QuickPick for me",stat:"Fastest",detail:[`We fill all ${O.legs} legs at ${wt(z)}`,"Straight to the bet slip"],onSelect:()=>{x(O.legs),g(z),y(p,O.legs,z),t?.()}})})]})]})]})}var $a="blade-mir-styles",Ka="\n.blade-mir{--e:cubic-bezier(.2,.8,.2,1)}\n.blade-mir-in{opacity:0;animation:blade-mir-in .5s var(--e) both}\n@keyframes blade-mir-in{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}\n@media (prefers-reduced-motion:reduce){.blade-mir *{animation:none!important}.blade-mir-in{opacity:1!important}}\n";function Za({depth:e,theme:t}){const n=t.colors,o=$(t);/* @__PURE__ */
|
|
376
373
|
return u("span",{className:"mt-2 flex gap-[3px]","aria-hidden":!0,children:Array.from({length:9}).map((t,r)=>{const l=Math.min(r,8-r)<e;/* @__PURE__ */
|
|
377
|
-
return u("span",{className:"h-3.5 flex-1 rounded",style:{backgroundColor:l?r<4.5?n.primary:o:"transparent",border:l?"none":`1px solid ${n.border}`}},r)})})}function
|
|
374
|
+
return u("span",{className:"h-3.5 flex-1 rounded",style:{backgroundColor:l?r<4.5?n.primary:o:"transparent",border:l?"none":`1px solid ${n.border}`}},r)})})}function qa({legs:e,correct:t}){const{theme:n}=Kr(),o=n.colors.primary;/* @__PURE__ */
|
|
378
375
|
return u("span",{className:"flex items-center gap-[2px]","aria-hidden":!0,children:Array.from({length:e}).map((e,n)=>{const r=n<t;/* @__PURE__ */
|
|
379
|
-
return u("span",{className:"inline-flex justify-center",style:{width:14,fontSize:14,lineHeight:1,fontWeight:700,color:r?o:
|
|
380
|
-
return m("div",{className:`pl-0 sm:pl-2 ${e}`,children:[/* @__PURE__ */u("h1",{className:"text-[10px] sm:text-xs font-bold uppercase tracking-[0.14em] sm:tracking-[0.18em] mb-3 sm:mb-4",style:{color:a.primary,fontFamily:l},children:"All right, or all wrong"}),/* @__PURE__ */u(
|
|
381
|
-
/* @__PURE__ */u("style",{id
|
|
382
|
-
/* @__PURE__ */u(
|
|
376
|
+
return u("span",{className:"inline-flex justify-center",style:{width:14,fontSize:14,lineHeight:1,fontWeight:700,color:r?o:Jl(o,.45)},children:r?"✓":"✕"},n)})})}function Va({className:e="",onBack:t,hideActions:n}){const{theme:o,selectedGame:r}=Kr(),l=be(o),a=o.colors;/* @__PURE__ */
|
|
377
|
+
return m("div",{className:`pl-0 sm:pl-2 ${e}`,children:[/* @__PURE__ */u("h1",{className:"text-[10px] sm:text-xs font-bold uppercase tracking-[0.14em] sm:tracking-[0.18em] mb-3 sm:mb-4",style:{color:a.primary,fontFamily:l},children:"All right, or all wrong"}),/* @__PURE__ */u(Dl,{onBack:t,hideActions:n,label:r?.game_name})]})}function Xa({onQuickPick:e,onPickYourOwn:t,onBack:n,hideTitle:o,config:r,backLabel:l="Games",className:a=""}){const{theme:s,selectedGame:d,selectedPropositionCount:p,handlePropositionCountChange:h,setExpectedCorrect:f,setBetAmount:x,quickPickGame:g,goToSportSelection:y,games:b,selectGame:w}=Kr(),k=s.colors,v=ye(s),N=be(s),C=R(s),F=V(s),B=i(()=>r??Vn(d),[r,d]),[A,M]=c(()=>B?null!=p&&B.legOptions.includes(p)?p:B.defaultLegs:8),[S,L]=c(()=>B?.defaultStake??20),[z,P]=c(!1);if(!d||!Kn(d)||!B)/* @__PURE__ */return u("div",{className:a,style:{color:k.textMuted,fontFamily:v},children:"No mirror available."});const T=B.variant,D=B.legOptions,O=D.includes(A)?A:D[0],E=function(e){const{legs:t}=e;return e.tiers.flatMap(e=>e.correctCounts.map(n=>({correct:n,label:n===t?`All ${t} right`:0===n?`All ${t} wrong`:`${n} of ${t} right`,prize:e.prize})))}(_n(T.id,S,O,{operatorMargin:B.operatorMargin})),j=function(e,t){if(!t)return[];const n=En(t);return n<Dn.premier?[]:Xn.flatMap(t=>{const o=e.find(e=>Kn(e)&&Un(e.rule)===$n[t.id]&&En(e)===n);return o?[{variant:t,game:o}]:[]})}(b,d),Y=O-(T.depth-1);if(j.length>1&&!z)/* @__PURE__ */return m("div",{className:`blade-mir flex min-h-full w-full flex-col ${a}`,style:{fontFamily:v},children:[
|
|
378
|
+
/* @__PURE__ */u("style",{id:$a,children:Ka}),
|
|
379
|
+
/* @__PURE__ */u(aa,{}),n&&/* @__PURE__ */u(Tl,{onBack:n,label:l}),
|
|
383
380
|
/* @__PURE__ */m("div",{className:"mx-auto flex w-full flex-1 flex-col",children:[
|
|
384
|
-
/* @__PURE__ */u(
|
|
385
|
-
/* @__PURE__ */u(
|
|
386
|
-
/* @__PURE__ */u("div",{className:"grid gap-3 sm:grid-cols-3",children:
|
|
387
|
-
return u("div",{className:"blade-mir-in",style:{animationDelay:.06+.05*n+"s"},children:/* @__PURE__ */m(
|
|
381
|
+
/* @__PURE__ */u(ea,{className:"blade-mir-in",eyebrow:o?null:"All right, or all wrong",iconUrl:Ae(d),gameName:"Mirror",tagline:"Land near an edge. How wide the edge is, is the mirror you pick."}),
|
|
382
|
+
/* @__PURE__ */u(ta,{}),
|
|
383
|
+
/* @__PURE__ */u("div",{className:"grid gap-3 sm:grid-cols-3",children:j.map(({variant:e,game:t},n)=>{const o=Vn(t)?.legOptions??[];/* @__PURE__ */
|
|
384
|
+
return u("div",{className:"blade-mir-in",style:{animationDelay:.06+.05*n+"s"},children:/* @__PURE__ */m(la,{tile:/* @__PURE__ */u(_l,{iconUrl:Ae(t),size:60}),label:e.name,stat:e.waysToWin,detail:[e.description,...o.length>0?[`${o[0]}–${o[o.length-1]} legs`]:[]],onSelect:()=>{w(t),P(!0)},children:[/* @__PURE__ */u(Za,{depth:e.depth,theme:s}),/* @__PURE__ */m("div",{className:"mt-1 flex items-baseline justify-between text-[9px] font-bold uppercase tracking-[0.1em]",style:{color:k.textMuted},children:[/* @__PURE__ */u("span",{children:"All wrong"}),/* @__PURE__ */u("span",{children:"All right"})]})]})},t.id)})})]})]});const H=S>=B.minStake,G=(e,t)=>/* @__PURE__ */m("div",{className:"mb-2 flex items-baseline justify-between",children:[/* @__PURE__ */u("span",{className:"text-[10px] font-bold uppercase tracking-[0.1em]",style:{color:k.textMuted},children:e}),/* @__PURE__ */u("span",{className:"text-xs font-semibold tabular-nums",style:{color:C},children:t})]});/* @__PURE__ */
|
|
388
385
|
return m("div",{className:`blade-mir flex min-h-full w-full flex-col ${a}`,style:{fontFamily:v},children:[
|
|
389
|
-
/* @__PURE__ */u("style",{id
|
|
390
|
-
/* @__PURE__ */u(
|
|
386
|
+
/* @__PURE__ */u("style",{id:$a,children:Ka}),
|
|
387
|
+
/* @__PURE__ */u(aa,{}),j.length>1?/* @__PURE__ */u(Tl,{onBack:()=>P(!1),label:"Mirrors"}):n&&/* @__PURE__ */u(Tl,{onBack:n,label:l}),
|
|
391
388
|
/* @__PURE__ */m("div",{className:"mx-auto flex w-full flex-1 flex-col",children:[
|
|
392
|
-
/* @__PURE__ */u(
|
|
393
|
-
/* @__PURE__ */u(
|
|
394
|
-
/* @__PURE__ */m("div",{className:"blade-mir-in mb-3",style:{animationDelay:".03s"},children:[
|
|
395
|
-
/* @__PURE__ */u(
|
|
389
|
+
/* @__PURE__ */u(ea,{className:"blade-mir-in",eyebrow:o?null:"All right, or all wrong",iconUrl:Ae(d),gameName:d.game_name,tagline:B.tagline}),
|
|
390
|
+
/* @__PURE__ */u(ta,{}),
|
|
391
|
+
/* @__PURE__ */m("div",{className:"blade-mir-in mb-3",style:{animationDelay:".03s"},children:[G(T.name,T.waysToWin),
|
|
392
|
+
/* @__PURE__ */u(Za,{depth:T.depth,theme:s}),
|
|
396
393
|
/* @__PURE__ */m("div",{className:"mt-1 flex items-baseline justify-between text-[9px] font-bold uppercase tracking-[0.1em]",style:{color:k.textMuted},children:[
|
|
397
394
|
/* @__PURE__ */u("span",{children:"All wrong"}),
|
|
398
395
|
/* @__PURE__ */m("span",{children:[D[0],"–",D[D.length-1]," legs"]}),
|
|
399
396
|
/* @__PURE__ */u("span",{children:"All right"})]})]}),
|
|
400
|
-
/* @__PURE__ */m("div",{className:"blade-mir-in rounded-3xl border-2 px-4 py-4 sm:px-5 sm:py-5",style:{backgroundColor:F,borderColor:k.border,boxShadow:`0 10px 24px -20px ${
|
|
397
|
+
/* @__PURE__ */m("div",{className:"blade-mir-in rounded-3xl border-2 px-4 py-4 sm:px-5 sm:py-5",style:{backgroundColor:F,borderColor:k.border,boxShadow:`0 10px 24px -20px ${Jl(C,.7)}`,animationDelay:".06s"},children:[G("Legs",`${O} legs`),
|
|
401
398
|
/* @__PURE__ */u("div",{className:"flex flex-wrap gap-1.5",role:"radiogroup","aria-label":"Number of legs",children:D.map(e=>{const t=e===O;/* @__PURE__ */
|
|
402
399
|
return u("button",{type:"button",role:"radio","aria-checked":t,onClick:()=>M(e),className:"min-w-[40px] flex-1 rounded-lg border px-1 py-2 text-sm font-bold transition-colors",style:{backgroundColor:t?k.primary:"transparent",borderColor:t?k.primary:k.border,color:t?k.primaryText:k.textMuted,cursor:"pointer"},children:e},e)})}),
|
|
403
400
|
/* @__PURE__ */m("div",{className:"mt-2 flex items-baseline justify-between text-[11px] italic",style:{color:k.textMuted},children:[/* @__PURE__ */u("span",{children:"Easier to sweep"}),/* @__PURE__ */u("span",{children:"Bigger prize"})]}),
|
|
404
|
-
/* @__PURE__ */m("div",{className:"mt-4",children:[
|
|
401
|
+
/* @__PURE__ */m("div",{className:"mt-4",children:[G("Stake",wt(S)),
|
|
405
402
|
/* @__PURE__ */m("div",{className:"relative",children:[/* @__PURE__ */u("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 font-bold",style:{color:k.textMuted},children:"$"}),/* @__PURE__ */u("input",{type:"number",inputMode:"decimal",min:B.minStake,max:B.maxStake??void 0,step:"any",placeholder:"Enter stake","aria-label":"Stake amount",value:S||"",onChange:e=>{if(""===e.target.value)return void L(0);const t=Number(e.target.value);Number.isFinite(t)&&L((e=>{const t=Math.max(0,Math.round(100*e)/100);return null!==B.maxStake?Math.min(t,B.maxStake):t})(t))},onFocus:e=>{e.currentTarget.style.borderColor=k.borderFocus??k.primary},onBlur:e=>{e.currentTarget.style.borderColor=k.border},className:"w-full rounded-lg border py-3 pl-8 pr-4 text-lg font-semibold tabular-nums focus:outline-none",style:{borderColor:k.border,color:k.textAlt??k.text,backgroundColor:k.backgroundAlt,fontFamily:v,transition:"border-color .15s ease"}})]}),
|
|
406
403
|
/* @__PURE__ */u("div",{className:"mt-2 flex flex-wrap gap-1.5",children:B.quickStakes.map(e=>{const t=e===S;/* @__PURE__ */
|
|
407
|
-
return m("button",{type:"button",onClick:()=>L(e),className:"min-w-[48px] flex-1 rounded-lg border px-1 py-2 text-sm font-bold transition-colors",style:{backgroundColor:t?k.primary:"transparent",borderColor:t?k.primary:k.border,color:t?k.primaryText:k.textMuted,cursor:"pointer"},children:["$",e]},e)})}),!
|
|
408
|
-
/* @__PURE__ */m("div",{className:"mt-4 border-t pt-3",style:{borderColor:
|
|
409
|
-
/* @__PURE__ */m("div",{className:"flex items-center justify-between gap-2",children:[/* @__PURE__ */u("span",{className:"text-[10px] font-semibold uppercase tracking-[0.1em]",style:{color:k.textMuted},children:"What it pays"}),/* @__PURE__ */u("span",{className:"rounded-full px-2 py-0.5 text-[11px] font-extrabold",style:{backgroundColor:
|
|
410
|
-
/* @__PURE__ */u("div",{className:"mt-1.5 flex flex-col gap-2",children:
|
|
404
|
+
return m("button",{type:"button",onClick:()=>L(e),className:"min-w-[48px] flex-1 rounded-lg border px-1 py-2 text-sm font-bold transition-colors",style:{backgroundColor:t?k.primary:"transparent",borderColor:t?k.primary:k.border,color:t?k.primaryText:k.textMuted,cursor:"pointer"},children:["$",e]},e)})}),!H&&S>0&&/* @__PURE__ */m("p",{className:"mt-2 text-xs",style:{color:k.error},children:["Minimum stake is ",wt(B.minStake),"."]})]}),
|
|
405
|
+
/* @__PURE__ */m("div",{className:"mt-4 border-t pt-3",style:{borderColor:Jl(C,.08)},children:[
|
|
406
|
+
/* @__PURE__ */m("div",{className:"flex items-center justify-between gap-2",children:[/* @__PURE__ */u("span",{className:"text-[10px] font-semibold uppercase tracking-[0.1em]",style:{color:k.textMuted},children:"What it pays"}),/* @__PURE__ */u("span",{className:"rounded-full px-2 py-0.5 text-[11px] font-extrabold",style:{backgroundColor:Jl(k.primary,.12),color:k.primary},children:T.waysToWin})]}),
|
|
407
|
+
/* @__PURE__ */u("div",{className:"mt-1.5 flex flex-col gap-2",children:E.map(e=>/* @__PURE__ */m("div",{className:"flex items-center justify-between gap-3",children:[/* @__PURE__ */m("span",{className:"flex min-w-0 flex-col gap-[3px]",children:[/* @__PURE__ */u("span",{className:"text-xs font-semibold sm:text-[13px]",style:{color:k.text},children:e.label}),/* @__PURE__ */u(qa,{legs:O,correct:e.correct})]}),/* @__PURE__ */u("span",{className:"text-lg font-extrabold tabular-nums sm:text-xl",style:{color:k.primary,fontFamily:N},children:wt(e.prize)})]},e.correct))}),
|
|
411
408
|
/* @__PURE__ */u("p",{className:"mt-2 text-[11px] italic",style:{color:k.textMuted},children:"Anything in between — a split card — does not pay."})]})]}),
|
|
412
|
-
/* @__PURE__ */m("div",{className:"mt-4 grid gap-3 sm:mt-5 sm:grid-cols-2",children:[/* @__PURE__ */u("div",{className:"blade-mir-in",style:{animationDelay:".13s"},children:/* @__PURE__ */u(
|
|
413
|
-
return m("div",{className:`pl-0 sm:pl-2 ${e}`,children:[/* @__PURE__ */u("h1",{className:"text-[10px] sm:text-xs font-bold uppercase tracking-[0.14em] sm:tracking-[0.18em] mb-3 sm:mb-4",style:{color:a.primary,fontFamily:l},children:"Choose your safety net"}),/* @__PURE__ */u(
|
|
409
|
+
/* @__PURE__ */m("div",{className:"mt-4 grid gap-3 sm:mt-5 sm:grid-cols-2",children:[/* @__PURE__ */u("div",{className:"blade-mir-in",style:{animationDelay:".13s"},children:/* @__PURE__ */u(la,{tile:/* @__PURE__ */u(_l,{iconUrl:Ae(d),size:60}),label:"Pick my own",stat:"Your calls",detail:["A clean yes or no on every leg","Aim for the sweep — either direction pays"],onSelect:()=>{H&&(h(O),f(Y),x(S),y(),t?.())}})}),/* @__PURE__ */u("div",{className:"blade-mir-in",style:{animationDelay:".2s"},children:/* @__PURE__ */u(la,{tile:/* @__PURE__ */u(_l,{iconUrl:`${ve}quickpick`,size:60}),label:"QuickPick for me",stat:"Fastest",detail:["We fill every leg for you","Straight to the bet slip"],onSelect:()=>{H&&(f(Y),x(S),g(d,O,S),e?.())}})})]})]})]})}function Qa({className:e="",onBack:t,hideActions:n}){const{theme:o,selectedGame:r}=Kr(),l=be(o),a=o.colors;/* @__PURE__ */
|
|
410
|
+
return m("div",{className:`pl-0 sm:pl-2 ${e}`,children:[/* @__PURE__ */u("h1",{className:"text-[10px] sm:text-xs font-bold uppercase tracking-[0.14em] sm:tracking-[0.18em] mb-3 sm:mb-4",style:{color:a.primary,fontFamily:l},children:"Choose your safety net"}),/* @__PURE__ */u(Dl,{onBack:t,hideActions:n,label:r?.game_name})]})}function Ja({onQuickPick:e,onPickYourOwn:t,onBack:n,hideTitle:o,config:r,backLabel:l="Games",className:a=""}){const{theme:s,selectedGame:d,selectedPropositionCount:p,handlePropositionCountChange:h,setExpectedCorrect:f,setBetAmount:x,setSelectedRuleId:g,quickPickGame:y,goToSportSelection:b}=Kr(),w=s.colors,k=ye(s),v=be(s),N=R(s),C=V(s),F=i(()=>r??fo(d),[r,d]),[B,A]=c(()=>F?.defaultModeId??"extra_shot"),[M,S]=c(()=>{const e=F?.modes.find(e=>e.id===(F?.defaultModeId??"extra_shot"));return e?null!=p&&e.legOptions.includes(p)?p:e.defaultLegs:8}),[L,z]=c(()=>F?.defaultStake??20);if(!d||!ro(d)||!F)/* @__PURE__ */return u("div",{className:a,style:{color:w.textMuted,fontFamily:k},children:"No safety net available."});const P=F.modes.find(e=>e.id===B)??F.modes[0],T=so(L,M,P.allowedMisses,F.pricing),D=e=>{const t=Math.max(0,Math.round(100*e)/100);return null!==F.maxStake?Math.min(t,F.maxStake):t},O=L>=F.minStake,E=(e,t)=>/* @__PURE__ */m("div",{className:"mb-2 flex items-baseline justify-between",children:[/* @__PURE__ */u("span",{className:"text-[10px] font-bold uppercase tracking-[0.1em]",style:{color:w.textMuted},children:e}),/* @__PURE__ */u("span",{className:"text-xs font-semibold tabular-nums",style:{color:N},children:t})]}),j=(e,t,n,o)=>/* @__PURE__ */u("button",{type:"button",role:"radio","aria-checked":n,onClick:o,className:"min-w-[40px] flex-1 rounded-lg border px-1 py-2 text-sm font-bold transition-colors",style:{backgroundColor:n?w.primary:"transparent",borderColor:n?w.primary:w.border,color:n?w.primaryText:w.textMuted,cursor:"pointer"},children:t},e),Y=[{label:"Perfect",amount:T.perfect},...T.nearMiss.map((e,t)=>({label:`All but ${t+1}`,amount:e}))];/* @__PURE__ */
|
|
414
411
|
return m("div",{className:`blade-sn flex min-h-full w-full flex-col ${a}`,style:{fontFamily:k},children:[
|
|
415
412
|
/* @__PURE__ */u("style",{id:"blade-sn-styles",children:"\n.blade-sn{--e:cubic-bezier(.2,.8,.2,1)}\n.blade-sn-in{opacity:0;animation:blade-sn-in .5s var(--e) both}\n@keyframes blade-sn-in{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}\n@media (prefers-reduced-motion:reduce){.blade-sn *{animation:none!important}.blade-sn-in{opacity:1!important}}\n"}),
|
|
416
|
-
/* @__PURE__ */u(
|
|
413
|
+
/* @__PURE__ */u(aa,{}),n&&/* @__PURE__ */u(Tl,{onBack:n,label:l}),
|
|
417
414
|
/* @__PURE__ */m("div",{className:"mx-auto flex w-full flex-1 flex-col",children:[
|
|
418
|
-
/* @__PURE__ */u(
|
|
419
|
-
/* @__PURE__ */u(
|
|
420
|
-
/* @__PURE__ */m("div",{className:"blade-sn-in rounded-3xl border-2 px-4 py-4 sm:px-5 sm:py-5",style:{backgroundColor:C,borderColor:w.border,boxShadow:`0 10px 24px -20px ${
|
|
415
|
+
/* @__PURE__ */u(ea,{className:"blade-sn-in",eyebrow:o?null:"Choose your safety net",iconUrl:Ae(d),gameName:d.game_name,tagline:F.tagline}),
|
|
416
|
+
/* @__PURE__ */u(ta,{}),
|
|
417
|
+
/* @__PURE__ */m("div",{className:"blade-sn-in rounded-3xl border-2 px-4 py-4 sm:px-5 sm:py-5",style:{backgroundColor:C,borderColor:w.border,boxShadow:`0 10px 24px -20px ${Jl(N,.7)}`,animationDelay:".06s"},children:[E("Safety net",P.label),
|
|
421
418
|
/* @__PURE__ */u("div",{className:"flex flex-wrap gap-1.5",role:"radiogroup","aria-label":"Safety net mode",children:F.modes.map(e=>j(e.id,e.label,e.id===P.id,()=>(e=>{const t=F.modes.find(t=>t.id===e);t&&(A(e),g(t.ruleId),t.legOptions.includes(M)||S(t.legOptions.reduce((e,t)=>Math.abs(t-M)<Math.abs(e-M)?t:e,t.legOptions[0])))})(e.id)))}),
|
|
422
419
|
/* @__PURE__ */u("p",{className:"mt-2 text-xs leading-snug sm:text-[13px]",style:{color:w.textMuted},children:P.explain}),
|
|
423
420
|
/* @__PURE__ */m("div",{className:"mt-4",children:[E("Legs",`${M} legs`),
|
|
@@ -426,37 +423,37 @@ return m("div",{className:`blade-sn flex min-h-full w-full flex-col ${a}`,style:
|
|
|
426
423
|
/* @__PURE__ */m("div",{className:"mt-4",children:[E("Stake",wt(L)),
|
|
427
424
|
/* @__PURE__ */m("div",{className:"relative",children:[/* @__PURE__ */u("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 font-bold",style:{color:w.textMuted},children:"$"}),/* @__PURE__ */u("input",{type:"number",inputMode:"decimal",min:F.minStake,max:F.maxStake??void 0,step:"any",placeholder:"Enter stake","aria-label":"Stake amount",value:L||"",onChange:e=>{if(""===e.target.value)return void z(0);const t=Number(e.target.value);Number.isFinite(t)&&z(D(t))},onFocus:e=>{e.currentTarget.style.borderColor=w.borderFocus??w.primary},onBlur:e=>{e.currentTarget.style.borderColor=w.border},className:"w-full rounded-lg border py-3 pl-8 pr-4 text-lg font-semibold tabular-nums focus:outline-none",style:{borderColor:w.border,color:w.textAlt??w.text,backgroundColor:w.backgroundAlt,fontFamily:k,transition:"border-color .15s ease"}})]}),
|
|
428
425
|
/* @__PURE__ */u("div",{className:"mt-2 flex flex-wrap gap-1.5",children:F.quickAdds.map(e=>/* @__PURE__ */m("button",{type:"button",onClick:()=>z(D((L||0)+e)),className:"min-w-[48px] flex-1 rounded-lg border px-1 py-2 text-sm font-bold transition-colors",style:{backgroundColor:"transparent",borderColor:w.border,color:w.textMuted,cursor:"pointer"},children:["+$",e]},e))}),!O&&L>0&&/* @__PURE__ */m("p",{className:"mt-2 text-xs",style:{color:w.error},children:["Minimum stake is ",wt(F.minStake),"."]})]}),
|
|
429
|
-
/* @__PURE__ */m("div",{className:"mt-4 border-t pt-3",style:{borderColor:
|
|
426
|
+
/* @__PURE__ */m("div",{className:"mt-4 border-t pt-3",style:{borderColor:Jl(N,.08)},children:[
|
|
430
427
|
/* @__PURE__ */m("div",{className:"flex items-baseline justify-between text-[10px] font-semibold uppercase tracking-[0.1em]",style:{color:w.textMuted},children:[/* @__PURE__ */u("span",{children:"What you can win"}),/* @__PURE__ */m("span",{children:[wt(L)," returns"]})]}),
|
|
431
428
|
/* @__PURE__ */m("div",{className:"mt-1.5 flex flex-col gap-1.5",children:[Y.map(e=>/* @__PURE__ */m("div",{className:"flex items-center justify-between gap-3",children:[/* @__PURE__ */u("span",{className:"text-xs sm:text-[13px]",style:{color:w.text},children:e.label}),/* @__PURE__ */u("span",{className:"text-sm font-extrabold tabular-nums sm:text-base",style:{color:w.primary,fontFamily:v},children:wt(Math.round(e.amount))})]},e.label)),/* @__PURE__ */m("div",{className:"mt-1 flex items-center justify-between gap-3 rounded-xl px-3 py-2.5",style:{backgroundColor:w.primary},children:[/* @__PURE__ */m("span",{className:"flex min-w-0 flex-col gap-[2px]",children:[/* @__PURE__ */u("span",{className:"text-sm font-extrabold sm:text-[15px]",style:{color:w.primaryText,fontFamily:v},children:"Clean sweep"}),/* @__PURE__ */u("span",{className:"text-[10px] font-semibold uppercase tracking-[0.06em]",style:{color:w.primaryText,opacity:.75},children:"every leg right — all prizes"})]}),/* @__PURE__ */u("span",{className:"text-xl font-extrabold tabular-nums sm:text-2xl",style:{color:w.primaryText,fontFamily:v},children:wt(Math.round(T.sweep))})]})]}),
|
|
432
429
|
/* @__PURE__ */u("p",{className:"mt-1.5 text-[11px]",style:{color:w.textMuted},children:"Total returns, stake included."}),
|
|
433
430
|
/* @__PURE__ */m("p",{className:"mt-1 text-[11px] italic",style:{color:w.textMuted},children:["Miss ",1===P.allowedMisses?"two":"three"," or more and the ticket does not pay."]})]})]}),
|
|
434
|
-
/* @__PURE__ */m("div",{className:"mt-4 grid gap-3 sm:mt-5 sm:grid-cols-2",children:[/* @__PURE__ */u("div",{className:"blade-sn-in",style:{animationDelay:".13s"},children:/* @__PURE__ */u(
|
|
435
|
-
return m("div",{className:`pl-0 sm:pl-2 ${e}`,children:[/* @__PURE__ */u("h1",{className:"text-[10px] sm:text-xs font-bold uppercase tracking-[0.14em] sm:tracking-[0.18em] mb-3 sm:mb-4",style:{color:a.primary,fontFamily:l},children:"Set your play"}),/* @__PURE__ */u(
|
|
431
|
+
/* @__PURE__ */m("div",{className:"mt-4 grid gap-3 sm:mt-5 sm:grid-cols-2",children:[/* @__PURE__ */u("div",{className:"blade-sn-in",style:{animationDelay:".13s"},children:/* @__PURE__ */u(la,{tile:/* @__PURE__ */u(_l,{iconUrl:Ae(d),size:60}),label:"Pick my own",stat:"Your calls",detail:["A clean yes or no on every leg","You read the games, you make the calls"],onSelect:()=>{O&&(g(P.ruleId),h(M),f(M-P.allowedMisses),x(L),b(),t?.())}})}),/* @__PURE__ */u("div",{className:"blade-sn-in",style:{animationDelay:".2s"},children:/* @__PURE__ */u(la,{tile:/* @__PURE__ */u(_l,{iconUrl:`${ve}quickpick`,size:60}),label:"QuickPick for me",stat:"Fastest",detail:["We fill every leg for you","Straight to the bet slip"],onSelect:()=>{O&&(g(P.ruleId),f(M-P.allowedMisses),x(L),y(d,M,L),e?.())}})})]})]})]})}function _a({className:e="",onBack:t,hideActions:n}){const{theme:o,selectedGame:r}=Kr(),l=be(o),a=o.colors;/* @__PURE__ */
|
|
432
|
+
return m("div",{className:`pl-0 sm:pl-2 ${e}`,children:[/* @__PURE__ */u("h1",{className:"text-[10px] sm:text-xs font-bold uppercase tracking-[0.14em] sm:tracking-[0.18em] mb-3 sm:mb-4",style:{color:a.primary,fontFamily:l},children:"Set your play"}),/* @__PURE__ */u(Dl,{onBack:t,hideActions:n,label:r?.game_name})]})}function ei({onQuickPick:e,onPickYourOwn:t,onBack:n,hideTitle:o,config:r,backLabel:l="Games",className:a=""}){const{theme:s,selectedGame:d,handlePropositionCountChange:p,setExpectedCorrect:h,setBetAmount:f,setSelectedRuleId:x,quickPickGame:g,goToSportSelection:y}=Kr(),b=s.colors,w=ye(s),k=be(s),v=R(s),N=V(s),C=K(b.primary,$(s),b.primaryText),F=i(()=>r??_o(d),[r,d]),[B,A]=c(()=>F?.defaultUnit??10),[M,S]=c(qo);if(!d||!Zo(d)||!F)/* @__PURE__ */return u("div",{className:a,style:{color:b.textMuted,fontFamily:w},children:"No card available."});const L=Vo(B,M,F),z=1*B,P=B>F.unitMin,T=B<F.unitMax,D=e=>A(t=>Math.min(F.unitMax,Math.max(F.unitMin,t+e*F.unitStep))),O=()=>{x(L.ruleId),h(L.lowestWinningCount),f(L.stake)},E=(e,t)=>/* @__PURE__ */m("div",{className:"mb-2 flex items-baseline justify-between",children:[/* @__PURE__ */u("span",{className:"text-[10px] font-bold uppercase tracking-[0.1em]",style:{color:b.textMuted},children:e}),/* @__PURE__ */u("span",{className:"text-xs font-semibold tabular-nums",style:{color:v},children:t})]}),j=(e,t,n,o)=>/* @__PURE__ */u("button",{type:"button",onClick:n,disabled:!t,"aria-label":o,className:"h-11 w-11 shrink-0 rounded-xl text-2xl font-extrabold leading-none transition-opacity",style:{backgroundColor:b.primary,color:b.primaryText,border:"none",opacity:t?1:.35,cursor:t?"pointer":"default"},children:e}),Y={golden_point:{sub:`Go for the decider. Double your win to ${wt(B*F.baseMultiple*F.goldenPointFactor)}.`},captains_challenge:{sub:`Collect ${wt(B*F.challengeMultiple)} whenever you land ${F.legs-F.challengeMisses} or ${F.legs} of ${F.legs}. Stacks on a winning slip.`}};/* @__PURE__ */
|
|
436
433
|
return m("div",{className:`blade-sx flex min-h-full w-full flex-col ${a}`,style:{fontFamily:w},children:[
|
|
437
434
|
/* @__PURE__ */u("style",{id:"blade-sx-styles",children:"\n.blade-sx{--e:cubic-bezier(.2,.8,.2,1)}\n.blade-sx-in{opacity:0;animation:blade-sx-in .5s var(--e) both}\n@keyframes blade-sx-in{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}\n@media (prefers-reduced-motion:reduce){.blade-sx *{animation:none!important}.blade-sx-in{opacity:1!important}}\n"}),
|
|
438
|
-
/* @__PURE__ */u(
|
|
435
|
+
/* @__PURE__ */u(aa,{}),n&&/* @__PURE__ */u(Tl,{onBack:n,label:l}),
|
|
439
436
|
/* @__PURE__ */m("div",{className:"mx-auto flex w-full flex-1 flex-col",children:[
|
|
440
|
-
/* @__PURE__ */u(
|
|
441
|
-
/* @__PURE__ */u(
|
|
442
|
-
/* @__PURE__ */m("div",{className:"blade-sx-in rounded-3xl border-2 px-4 py-4 sm:px-5 sm:py-5",style:{backgroundColor:N,borderColor:b.border,boxShadow:`0 10px 24px -20px ${
|
|
437
|
+
/* @__PURE__ */u(ea,{className:"blade-sx-in",eyebrow:o?null:"Set your play",iconUrl:Ae(d),gameName:d.game_name,tagline:F.tagline}),
|
|
438
|
+
/* @__PURE__ */u(ta,{}),
|
|
439
|
+
/* @__PURE__ */m("div",{className:"blade-sx-in rounded-3xl border-2 px-4 py-4 sm:px-5 sm:py-5",style:{backgroundColor:N,borderColor:b.border,boxShadow:`0 10px 24px -20px ${Jl(v,.7)}`,animationDelay:".06s"},children:[
|
|
443
440
|
/* @__PURE__ */m("div",{className:"flex items-center justify-between gap-3 rounded-2xl px-4 py-3.5",style:{backgroundColor:b.primary},children:[/* @__PURE__ */m("span",{className:"flex min-w-0 flex-col",children:[/* @__PURE__ */u("span",{className:"text-[11px] font-semibold",style:{color:b.primaryText,opacity:.72},children:"Total stake"}),/* @__PURE__ */u("span",{className:"text-2xl font-extrabold tabular-nums",style:{color:b.primaryText,fontFamily:k},children:wt(L.stake)})]}),/* @__PURE__ */m("span",{className:"flex min-w-0 flex-col items-end",children:[/* @__PURE__ */u("span",{className:"text-[11px] font-semibold",style:{color:b.primaryText,opacity:.72},children:"To win"}),/* @__PURE__ */m("span",{className:"flex items-baseline gap-1.5",children:[/* @__PURE__ */u("span",{className:"text-[26px] font-extrabold leading-none tabular-nums",style:{color:C,fontFamily:k},children:wt(L.base)}),L.challenge>0&&/* @__PURE__ */m("span",{className:"rounded-md px-1.5 py-0.5 text-[11px] font-extrabold tabular-nums",style:{backgroundColor:C,color:v},children:["+",wt(L.challenge)]})]})]})]}),
|
|
444
441
|
/* @__PURE__ */m("div",{className:"mt-3",children:[E("Your stake",`steps of ${wt(F.unitStep)}`),/* @__PURE__ */m("div",{className:"flex items-center gap-3",children:[j("−",P,()=>D(-1),"Lower stake"),
|
|
445
442
|
/* @__PURE__ */m("div",{className:"flex-1 text-center",children:[/* @__PURE__ */u("div",{className:"text-2xl font-extrabold tabular-nums",style:{color:v,fontFamily:k},children:wt(B)}),/* @__PURE__ */u("div",{className:"text-[10px] font-bold uppercase tracking-[0.08em]",style:{color:b.textMuted},children:"per play"})]}),j("+",T,()=>D(1),"Raise stake")]})]}),
|
|
446
443
|
/* @__PURE__ */u("p",{className:"mt-2 min-h-[16px] text-center text-[11px] font-bold",style:{color:b.primary},children:L.challenge>0?`Captain's Challenge pays ${wt(L.challenge)} on ${F.legs-F.challengeMisses} or ${F.legs} of ${F.legs}.`:""}),
|
|
447
444
|
/* @__PURE__ */m("div",{className:"mt-4",children:[E("Boost your card",`${wt(z)} each`),/* @__PURE__ */u("div",{className:"flex flex-col gap-2",children:F.boosts.map(e=>{const t=M[e.id];/* @__PURE__ */
|
|
448
|
-
return m("button",{type:"button",role:"switch","aria-checked":t,onClick:()=>{return t=e.id,S(e=>({...e,[t]:!e[t]}));var t},className:"flex w-full items-center gap-3 rounded-2xl border px-3 py-3 text-left transition-colors",style:{backgroundColor:t?
|
|
449
|
-
/* @__PURE__ */m("div",{className:"mt-4 grid gap-3 sm:mt-5 sm:grid-cols-2",children:[/* @__PURE__ */u("div",{className:"blade-sx-in",style:{animationDelay:".13s"},children:/* @__PURE__ */u(
|
|
450
|
-
return m("div",{className:`pl-0 sm:pl-2 ${e}`,children:[/* @__PURE__ */u("h1",{className:"text-[10px] sm:text-xs font-bold uppercase tracking-[0.14em] sm:tracking-[0.18em] mb-3 sm:mb-4",style:{color:a.primary,fontFamily:l},children:"All or nothing"}),/* @__PURE__ */u(
|
|
445
|
+
return m("button",{type:"button",role:"switch","aria-checked":t,onClick:()=>{return t=e.id,S(e=>({...e,[t]:!e[t]}));var t},className:"flex w-full items-center gap-3 rounded-2xl border px-3 py-3 text-left transition-colors",style:{backgroundColor:t?Jl(b.primary,.08):"transparent",borderColor:t?b.primary:b.border,cursor:"pointer"},children:[/* @__PURE__ */m("span",{className:"min-w-0 flex-1",children:[/* @__PURE__ */m("span",{className:"flex items-center gap-2",children:[/* @__PURE__ */u("span",{className:"text-sm font-extrabold sm:text-[15px]",style:{color:v,fontFamily:k},children:e.label}),/* @__PURE__ */m("span",{className:"rounded-md px-1.5 py-0.5 text-[10px] font-extrabold tabular-nums",style:{backgroundColor:Jl(b.primary,.12),color:b.primary},children:["+",wt(z*e.costUnits)]})]}),/* @__PURE__ */u("span",{className:"mt-1 block text-[11px] leading-snug sm:text-xs",style:{color:b.textMuted},children:Y[e.id].sub})]}),/* @__PURE__ */u("span",{className:"relative h-7 w-12 shrink-0 rounded-full transition-colors",style:{backgroundColor:t?b.primary:b.border},"aria-hidden":!0,children:/* @__PURE__ */u("span",{className:"absolute top-[3px] h-[22px] w-[22px] rounded-full transition-transform",style:{left:3,backgroundColor:b.background,transform:t?"translateX(20px)":"none"}})})]},e.id)})})]})]}),
|
|
446
|
+
/* @__PURE__ */m("div",{className:"mt-4 grid gap-3 sm:mt-5 sm:grid-cols-2",children:[/* @__PURE__ */u("div",{className:"blade-sx-in",style:{animationDelay:".13s"},children:/* @__PURE__ */u(la,{tile:/* @__PURE__ */u(_l,{iconUrl:Ae(d),size:60}),label:`Pick my ${F.legs}`,stat:"Your calls",detail:["A clean yes or no on every call","You read the games, you make the calls"],onSelect:()=>{O(),p(F.legs),y(),t?.()}})}),/* @__PURE__ */u("div",{className:"blade-sx-in",style:{animationDelay:".2s"},children:/* @__PURE__ */u(la,{tile:/* @__PURE__ */u(_l,{iconUrl:`${ve}quickpick`,size:60}),label:"QuickPick for me",stat:"Fastest",detail:[`We fill all ${F.legs} calls for you`,"Straight to the bet slip"],onSelect:()=>{O(),g(d,F.legs,L.stake),e?.()}})})]})]})]})}function ti({className:e="",onBack:t,hideActions:n}){const{theme:o,selectedGame:r}=Kr(),l=be(o),a=o.colors;/* @__PURE__ */
|
|
447
|
+
return m("div",{className:`pl-0 sm:pl-2 ${e}`,children:[/* @__PURE__ */u("h1",{className:"text-[10px] sm:text-xs font-bold uppercase tracking-[0.14em] sm:tracking-[0.18em] mb-3 sm:mb-4",style:{color:a.primary,fontFamily:l},children:"All or nothing"}),/* @__PURE__ */u(Dl,{onBack:t,hideActions:n,label:r?.game_name})]})}function ni({onQuickPick:e,onPickYourOwn:t,onBack:n,hideTitle:o,backLabel:r="Games",className:l=""}){const{theme:a,selectedGame:s,selectedPropositionCount:d,handlePropositionCountChange:p,setExpectedCorrect:h,quickPickGame:f,goToSportSelection:x}=Kr(),g=a.colors,y=ye(a);be(a);const b=i(()=>{if(!s)return[];if(s.allowed_propositions&&s.allowed_propositions.length>0)return[...s.allowed_propositions].sort((e,t)=>e-t);const{min:e,max:t}=zt(s);return _t(e,t)},[s]),w=nr(s),k=b[0]??0,v=b[b.length-1]??0,[N]=c(()=>null!=d&&b.includes(d)?d:v),C=i(()=>bo(s,N||void 0),[s,N]);if(!s||0===b.length||"exact"!==C?.kind)/* @__PURE__ */return u("div",{className:l,style:{color:g.textMuted,fontFamily:y},children:"No setup available."});const F=w?["Any yes/no props in the pool",`Pick ${k}–${v} legs — all must land`]:["A clean yes or no on every leg",`All ${N} have to land`],B=w?[`We fill ${N} legs across any markets`,"Straight to the bet slip"]:[`We fill all ${N} legs for you`,"Straight to the bet slip"];/* @__PURE__ */
|
|
451
448
|
return m("div",{className:`blade-pp flex min-h-full w-full flex-col ${l}`,style:{fontFamily:y},children:[
|
|
452
449
|
/* @__PURE__ */u("style",{id:"blade-pp-styles",children:"\n.blade-pp{--e:cubic-bezier(.2,.8,.2,1)}\n.blade-pp-in{opacity:0;animation:blade-pp-in .5s var(--e) both}\n@keyframes blade-pp-in{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}\n@media (prefers-reduced-motion:reduce){.blade-pp *{animation:none!important}.blade-pp-in{opacity:1!important}}\n"}),
|
|
453
|
-
/* @__PURE__ */u(
|
|
450
|
+
/* @__PURE__ */u(aa,{}),n&&/* @__PURE__ */u(Tl,{onBack:n,label:r}),
|
|
454
451
|
/* @__PURE__ */m("div",{className:"mx-auto flex w-full flex-1 flex-col",children:[
|
|
455
|
-
/* @__PURE__ */u(
|
|
456
|
-
/* @__PURE__ */u(
|
|
457
|
-
/* @__PURE__ */m("div",{className:"grid gap-3 sm:grid-cols-2",children:[/* @__PURE__ */u("div",{className:"blade-pp-in",style:{animationDelay:".13s"},children:/* @__PURE__ */u(
|
|
452
|
+
/* @__PURE__ */u(ea,{className:"blade-pp-in",eyebrow:o?null:C.title,iconUrl:Ae(s),gameName:s.game_name,tagline:C.heroTagline}),
|
|
453
|
+
/* @__PURE__ */u(ta,{}),
|
|
454
|
+
/* @__PURE__ */m("div",{className:"grid gap-3 sm:grid-cols-2",children:[/* @__PURE__ */u("div",{className:"blade-pp-in",style:{animationDelay:".13s"},children:/* @__PURE__ */u(la,{tile:/* @__PURE__ */u(_l,{iconUrl:Ae(s),size:60}),label:"Pick my own",stat:"Your calls",detail:F,onSelect:()=>{w||(p(N),h(N)),x(),t?.()}})}),/* @__PURE__ */u("div",{className:"blade-pp-in",style:{animationDelay:".2s"},children:/* @__PURE__ */u(la,{tile:/* @__PURE__ */u(_l,{iconUrl:`${ve}quickpick`,size:60}),label:"QuickPick for me",stat:"Fastest",detail:B,onSelect:()=>{h(N),f(s,N),e?.()}})})]})]})]})}function oi({onPickYourOwn:e,onQuickPick:t,onBack:n,hideTitle:o,backLabel:r="Games",className:l=""}){const{theme:a,selectedGame:i,goToSportSelection:s,bodyFont:c}=Kr(),d={onPickYourOwn:e,onQuickPick:t,onBack:n,hideTitle:o,backLabel:r,className:l};switch(er(i)){case"game_set":/* @__PURE__ */return u(Ra,{...d});case"pick_your_dividend":/* @__PURE__ */return u(Wa,{...d});case"ladder":/* @__PURE__ */return u(Ua,{...d});case"mirror":/* @__PURE__ */return u(Xa,{...d});case"safety_net":/* @__PURE__ */return u(Ja,{...d});case"six_again":/* @__PURE__ */return u(ei,{...d});case"rule_setup":return"exact"===bo(i)?.kind?/* @__PURE__ */u(ni,{...d}):/* @__PURE__ */u(Ya,{onBack:n,hideTitle:o,backLabel:r,className:l,onContinue:()=>{s(),e?.()}});default:/* @__PURE__ */return u("div",{className:l,style:{color:a.colors.textMuted,fontFamily:c},children:"No setup required — this game goes straight to picks."})}}function ri({iconUrl:e,gameName:t,nameLines:n,height:o=56,showTrademark:r=!0,className:l}){const{theme:a}=Kr(),i=R(a),s=$(a),c=a.colors.primaryHover??function(e){const t=/^#([0-9a-f]{6})$/i.exec(e?.trim()??"");if(!t)return e;const n=parseInt(t[1],16);return`rgba(${n>>16&255}, ${n>>8&255}, ${255&n}, 0.7)`}(i),d=be(a)??"Manrope, Poppins, sans-serif",p=n&&n.length>0?n:t.split(/\s+/),h=.72*o,f=.5*o,x=Math.min(.62*o/p.length,.3*o);/* @__PURE__ */
|
|
458
455
|
return m("span",{role:"img","aria-label":`YESNO ${t}`,className:l,style:{display:"inline-flex",alignItems:"center",gap:.22*o,fontFamily:d,color:i},children:[
|
|
459
|
-
/* @__PURE__ */u(
|
|
456
|
+
/* @__PURE__ */u(on,{iconUrl:e,width:h,height:h,iconColor:i,accentColor:s,ariaLabel:""}),
|
|
460
457
|
/* @__PURE__ */m("span",{"aria-hidden":!0,style:{fontSize:f,letterSpacing:.045*-f,lineHeight:1,whiteSpace:"nowrap"},children:[/* @__PURE__ */u("span",{style:{fontWeight:800},children:"YES"}),/* @__PURE__ */u("span",{style:{fontWeight:600},children:"NO"})]}),
|
|
461
458
|
/* @__PURE__ */u("span",{"aria-hidden":!0,style:{width:Math.max(2,Math.round(.045*o)),height:.78*o,backgroundColor:c,flexShrink:0}}),
|
|
462
|
-
/* @__PURE__ */u("span",{"aria-hidden":!0,style:{display:"inline-flex",flexDirection:"column",fontSize:x,fontWeight:500,letterSpacing:.012*-x,lineHeight:1.14,textAlign:"left"},children:p.map((e,t)=>/* @__PURE__ */m("span",{style:{whiteSpace:"nowrap"},children:[e,r&&t===p.length-1&&/* @__PURE__ */u("sup",{style:{fontSize:.36*x,fontWeight:500,marginLeft:1},children:"™"})]},`${e}-${t}`))})]})}var
|
|
459
|
+
/* @__PURE__ */u("span",{"aria-hidden":!0,style:{display:"inline-flex",flexDirection:"column",fontSize:x,fontWeight:500,letterSpacing:.012*-x,lineHeight:1.14,textAlign:"left"},children:p.map((e,t)=>/* @__PURE__ */m("span",{style:{whiteSpace:"nowrap"},children:[e,r&&t===p.length-1&&/* @__PURE__ */u("sup",{style:{fontSize:.36*x,fontWeight:500,marginLeft:1},children:"™"})]},`${e}-${t}`))})]})}var li="1.30.6-pre.4";export{Tr as BladeApiClient,ri as BrandLockup,$o as CHALLENGE_MISSES,Uo as CHALLENGE_MULTIPLE,Xe as CategoryIcon,Rl as CategoryPickerPage,Hl as CategoryPickerPageActions,Yl as CategoryPickerPageTitle,Je as ChevronRightIcon,ga as ConfirmPage,xa as ConfirmPageActions,fa as ConfirmPageTitle,to as DOUBLE_SHOT_MIN_LEGS,eo as EXTRA_SHOT_MIN_LEGS,va as EntriesPage,ka as EntriesPageTitle,Bl as EntrySubmission,zl as EventFilterBanner,Il as EventPickerPage,sl as EventSwipeModal,nt as FilterChipCarousel,ot as FilterChipRow,Dn as GAME_TIER_LEVEL,On as GAME_TIER_TABS,Ko as GOLDEN_POINT_FACTOR,Sl as GameEntries,Zl as GameLogo,jl as GamePage,El as GamePageActions,Ol as GamePageTitle,fr as GameSelector,Ra as GameSetBetPage,Ha as GameSetBetPageTitle,oi as GameSetupPage,qe as HowToPlayButton,Ze as HowToPlayModal,Ke as HowToPlayPanel,Oo as LADDER_FAMILY,To as LADDER_REFERENCE_BET,Do as LADDER_STAKES,Ua as LadderPage,Ia as LadderPageTitle,_e as LockIcon,Rn as MIRROR_STANDARD_MARGIN,L as MarkdownContent,Xa as MirrorPage,Va as MirrorPageTitle,qo as NO_BOOSTS,Ao as PYD_LEG_RUNGS,Bo as PYD_RETAIL_DIVIDENDS,Al as PayoutCircles,ni as PerfectPickPage,ti as PerfectPickPageTitle,Wa as PickYourDividendPage,Ga as PickYourDividendPageTitle,Zr as PlaceEntryProvider,qr as QuickPickButton,Ya as RuleSetupPage,ja as RuleSetupPageActions,Ea as RuleSetupPageTitle,cl as SELECTION_VARIANTS,Io as SIX_AGAIN_LEGS,Wo as SIX_AGAIN_MARGIN,Ja as SafetyNetPage,Qa as SafetyNetPageTitle,tt as ScrollShelf,Fl as SelectionReview,gl as SelectionVariantList,ua as SelectionsPage,ca as SelectionsPageActions,ia as SelectionsPageTitle,ei as SixAgainPage,_a as SixAgainPageTitle,Fa as SportPickerPage,Ca as SportPickerPageActions,Na as SportPickerPageTitle,Ql as SportRail,et as StarIcon,wa as SuccessPage,ba as SuccessPageActions,ya as SuccessPageTitle,ll as SwipeCard,al as SwipeCardFace,il as SwipeDeck,Vr as VISIBLE_DEPTH,Ve as YesNoCategoryLabel,we as applyTheme,Yn as availableGameTierTabs,Xt as contrastTextColour,oe as darkTheme,Hn as defaultGameTierId,te as defaultTheme,ce as defaultThemeSet,jn as filterGamesByTierLevel,Pn as filterPropositionsToEvent,wt as formatCurrency,kt as formatDate,Nn as formatSameGameMultiEventLabel,Ho as fullStackPrize,wo as gameNeedsRuleSetup,Co as gameSetPrize,or as getConfirmBoostCopy,er as getGameFlow,Fo as getGameSetBetConfig,Pt as getJackpotInfo,Go as getLadderConfig,Vn as getMirrorConfig,Po as getPickYourDividendConfig,Bn as getPropositionEventId,bo as getRuleSetupConfig,fo as getSafetyNetConfig,lo as getSafetyNetPricing,_o as getSixAgainConfig,Dt as getSportDisplayName,pe as getTheme,he as getThemeSet,ae as goldLightTheme,re as goldTheme,ue as goldThemeSet,le as greenLightTheme,ne as greenTheme,de as greenThemeSet,vt as groupPropositionsBySport,An as groupSameGameMultiEvents,fl as groupSelectionDays,tr as isFixedCardExactGame,No as isGameSetBetGame,Eo as isLadderGame,Kn as isMirrorGame,nr as isOpenExactMultiGame,Mo as isPickYourDividendGame,ro as isSafetyNetGame,Fn as isSameGameMultiGame,zn as isSelectableSameGameMultiProposition,Zo as isSixAgainGame,ee as isThemeSet,Lt as isValidSelectionCount,Ro as ladderCollectAt,Yo as ladderTiers,qn as mirrorPrize,Tn as propositionsBelongToEvent,zo as pydLadder,Lo as pydRung,Et as resolveCategoryDisplayName,En as resolveGameTierLevel,gt as resolvePrice,Ot as resolveSportDisplayName,_ as resolveTheme,ao as roundDividendAmount,co as safetyNetCollect,so as safetyNetTicket,Xo as sixAgainRuleId,Qo as sixAgainStakeMultiples,Vo as sixAgainTicket,$ as themeAccent,ye as themeBodyFont,R as themeHeading,be as themeHeadingFont,G as themeLabel,xe as themeSets,Z as themeTextAlt,q as themeTextAltMuted,W as themeValue,fe as themes,ke as useBladeTheme,Wr as useCalculatePayout,Hr as useCreateGameEntry,Ir as useEntryPreview,Gr as useEvaluateRule,jr as useGameEntries,Yr as useGameMaxPayouts,Dr as useGames,Kr as usePlaceEntry,Rr as usePlaceEntryFlow,Or as usePropositions,ge as useResolvedTheme,Er as useSports,Qr as useSwipeDeck,li as version};
|