@simple-parlay/components 1.30.2 → 1.30.3
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 +197 -196
- package/dist/react/index.js +1 -1
- package/dist/react/index.mjs +197 -196
- package/dist/react-native/index.js +1 -1
- package/dist/react-native/index.mjs +236 -237
- package/dist/shared/utils.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -45,345 +45,346 @@ return u("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,stroke
|
|
|
45
45
|
return m("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2.25",strokeLinecap:"round",strokeLinejoin:"round",className:n,"aria-hidden":!0,children:[/* @__PURE__ */u("path",{d:"M5 11h14a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-6a2 2 0 0 1 2-2z"}),/* @__PURE__ */u("path",{d:"M8 11V7a4 4 0 1 1 8 0v4"})]})}function Qe({groups:t,theme:n,bodyFont:r,className:a=""}){const i=n.colors,d=s(null),[p,f]=c(!1),[h,x]=c(!1),[g,y]=c(!1);l(()=>{if("undefined"==typeof window||!window.matchMedia)return;const e=window.matchMedia("(pointer: coarse)"),t=()=>y(e.matches);return t(),e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]);const b=o(()=>{const e=d.current;if(!e)return;const t=e.scrollWidth-e.clientWidth;f(e.scrollLeft>2),x(e.scrollLeft<t-2)},[]);l(()=>{b(),window.addEventListener("resize",b);const e=d.current;let t;if(e&&"undefined"!=typeof ResizeObserver){t=new ResizeObserver(b),t.observe(e);for(const n of Array.from(e.children))t.observe(n)}return()=>{window.removeEventListener("resize",b),t?.disconnect()}},[b,t.length]);const w=e=>{const t=d.current;t&&t.scrollBy({left:e*Math.round(.7*t.clientWidth),behavior:"smooth"})},k=s({down:!1,lastX:0,travelled:0}),v=()=>{k.current.down=!1},N=i.background??"#fff",F={width:44,height:44,cursor:"pointer",background:"none",border:"none",padding:0},B={width:26,height:26,border:`1px solid ${i.border}`,backgroundColor:N,color:i.primary,boxShadow:"0 4px 10px -4px rgba(15, 76, 92, 0.55)"};return 0===t.length?null:/* @__PURE__ */m("div",{className:`relative min-w-0 ${a}`,style:{fontFamily: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, ${N}, 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(Ve,{size:14,className:"rotate-180"})})}),h&&/* @__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, ${N}, transparent)`}}),h&&!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(Ve,{size:14})})}),
|
|
46
46
|
/* @__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 select-none items-center gap-2 overflow-x-auto px-0.5 py-0.5 [-webkit-overflow-scrolling:touch] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",style:{cursor:k.current.down?"grabbing":"grab"},children:t.map((t,n)=>/* @__PURE__ */m(e.Fragment,{children:[n>0&&/* @__PURE__ */u("span",{"aria-hidden":!0,className:"h-5 w-px flex-none",style:{backgroundColor:i.border}}),t.label&&/* @__PURE__ */u("span",{className:"flex-none text-[10px] font-extrabold uppercase tracking-[0.14em]",style:{color:i.textMuted},children:t.label}),t.options.map(e=>{const n=e.value===t.value;/* @__PURE__ */
|
|
47
47
|
return u("button",{type:"button",onClick:()=>{k.current.travelled>4||t.onChange(e.value)},className:"flex-none 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:r,border:`1px solid ${n?i.primary:i.border}`,backgroundColor:n?i.primary:N,color:n?i.primaryText:i.primary,cursor:"pointer"},children:e.label},e.value??"__all")})]},t.label??n))})]})}function Je({label:e,options:t,value:n,onChange:o,theme:r,bodyFont:l,className:a=""}){/* @__PURE__ */
|
|
48
|
-
return u(Qe,{groups:[{label:e,options:t,value:n,onChange:o}],theme:r,bodyFont:l,className:a})}function _e(e){return(e.propositionType??e.proposition_type)?.trim()||void 0}function et(e){return(e.description??e.proposition??"").trim()}var tt={AND:/\s+AND\s+/,OR:/\s+OR\s+/};function nt(e){return"composite_and"===(t=_e(e))||"composite_or"===t;var t}function ot(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 rt(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 lt(e,t){if(!nt(e))return null;const n=function(e){return nt(e)?("composite_and"===(t=_e(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=ot(e);if(t&&o.length>=2){const e=[];for(const n of o){const o=t.get(n);o&&e.push({text:et(o),eventLabel:rt(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(tt[t]).map(e=>e.trim()).filter(Boolean);return o.length<2?null:o}(et(e),n);return r?{operator:n,legs:r.map(e=>({text:e,eventLabel:null}))}:null}var at="#0F4C5C",it={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"},st={sports:"Pick the winners",casino:"Beat the house",racing:"Back a winner"};function ct(e,t,n){if(n)return n.slice(0,4).toUpperCase();const o=it[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 dt(e){return!!e.is_composite_component||!!(t=_e(e))&&t.startsWith("co_");var t}function ut(e){return"object"==typeof e&&null!==e?Number(e.amount)||0:Number(e)||0}function mt(e){if(null==e)return 0;const t=Number(e);return Number.isFinite(t)?t:0}function pt(e){return"string"==typeof e?"true"===e.toLowerCase():!!e}function ft(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 ht(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 xt(e){return e.reduce((t,n)=>{const o=gt(n,e);return t[o]||(t[o]=[]),t[o].push(n),t},{})}function gt(e,t){if(e.sport)return e.sport;if(nt(e)&&t)for(const n of ot(e)){const e=t.find(e=>e.id===n);if(e?.sport)return e.sport}return"Other"}var yt=["sports","casino","racing"];function bt(e){const t=(e.category||"").toLowerCase(),n=e.sport||"",o=_e(e).toLowerCase();return"casino"===t||"casino"===o||n.startsWith("casino")?"casino":"racing"===t||n.startsWith("horse_racing")?"racing":"sports"}function wt(e){return"racing"===bt(e)}function kt(e){const t={};for(const n of e){const e=bt(n);t[e]||(t[e]=[]),t[e].push(n)}return t}function vt(e){const t=kt(e);return yt.filter(e=>(t[e]?.length??0)>0)}function Nt(e){switch(e){case"casino":return"Choose a Game";case"racing":return"Choose a Meeting";default:return"Choose a Sport"}}function Ft(e,t,n,o){return o&&o.length>0?o.includes(e):!(void 0!==t&&e<t||void 0!==n&&e>n)}function Bt(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 Ct(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 At(e,t){const n={basketball_nba:"NBA Basketball",americanfootball_nfl:"NFL Football",icehockey_nhl:"NHL Hockey",baseball_mlb:"MLB Baseball",soccer_epl:"Premier League",soccer_usa_mls:"MLS Soccer",horse_racing_aus:"Horse Racing",casino_blackjack:"Blackjack",casino_roulette:"Roulette",casino_slots:"Slots",aussierules_afl:"AFL",rugbyleague_nrl:"NRL","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 Mt(e,t,n){const o=t?.[e];return o||At(e,n)}function St(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 zt(e,t){if(e)return t&&e.startsWith(`${t}_`)?t:e}function Lt(e,t,n){return e===t||!!n&&(!(t!==n||!e.startsWith(`${n}_`))||!(e!==n||!t.startsWith(`${n}_`)))}function Pt(e,t,n){return!t||!!e&&(Lt(e,t,n)||Lt(t,e,n))}function Dt(e,t){return t.find(t=>t.id===e)}function Ot(e,t){let n=e;return t?.category&&(n=n.filter(e=>bt(e)===t.category)),t?.sport&&(n=n.filter(n=>nt(n)?function(e,t,n,o){if(Pt(e.sport,t,n))return!0;if(!o)return!1;for(const r of ot(e)){const e=Dt(r,o);if(e&&Pt(e.sport,t,n))return!0}return!1}(n,t.sport,t.sportBaseKey,e):Pt(n.sport,t.sport,t.sportBaseKey))),n}function Tt(e,t){return!t||function(e){const t=(e.category||"sports").toLowerCase();return"casino"===t||"racing"===t?t:"sports"}(e)===t}function Et(e,t,n){if(!t)return!0;const o=e.allowed_sports;return!o||0===o.length||o.some(e=>Lt(t,e,n))}function jt(e,t,n){return!(n?.category&&!Tt(e,n.category))&&!(n?.sport&&!Et(e,n.sport,n.sportBaseKey))&&Ot(Ht(t,e),n).length>0}function Yt(e,t){return t?.category||t?.sport?e.filter(e=>!(t.category&&!Tt(e,t.category)||t.sport&&!Et(e,t.sport,t.sportBaseKey))):e}function Ht(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(dt(a))return!1;if(r)if(nt(a)){if(!function(e,t,n,o){if(e.sport&&t.some(t=>Lt(e.sport,t,n)))return!0;if(!o)return!1;for(const r of ot(e)){const e=Dt(r,o);if(e?.sport&&t.some(t=>Lt(e.sport,t,n)))return!0}return!1}(a,o,n,e))return!1}else if(!a.sport||!o.some(e=>Lt(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=_e(e);return!!o&&n.includes(o)}(a,t))}):e.filter(e=>!dt(e))}function Rt(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 Gt=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function Wt(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 It(e,t,n){return function(e,t,n){return"racing"===e||!(!t?.length||!t.every(wt))||!!n&&Boolean(t?.some(e=>e.sport===n||(e.sport||"").startsWith(`${n}_`)))}(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 Ut(e){const t=[];for(const n of e){const e=n.home_team&&n.away_team&&!wt(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 Kt(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 Zt(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 $t=/* @__PURE__ */new Map,qt=/* @__PURE__ */new Map;function Vt(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 Xt({iconUrl:t,width:n,height:o,iconColor:r,accentColor:l,ariaLabel:a,style:i}){const s=Me(t),[c,d]=e.useState(()=>s??$t.get(t)??null);e.useEffect(()=>{const e=Me(t);if(e)return void d(e);if($t.has(t))return void d($t.get(t));let n=!1;return function(e){const t=$t.get(e);if(void 0!==t)return Promise.resolve(t);const n=qt.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=>($t.set(e,t),qt.delete(e),t)).catch(t=>{throw qt.delete(e),t});return qt.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__ */
|
|
49
|
-
return u("img",c?{src:
|
|
48
|
+
return u(Qe,{groups:[{label:e,options:t,value:n,onChange:o}],theme:r,bodyFont:l,className:a})}function _e(e){return(e.propositionType??e.proposition_type)?.trim()||void 0}function et(e){return(e.description??e.proposition??"").trim()}var tt={AND:/\s+AND\s+/,OR:/\s+OR\s+/};function nt(e){return"composite_and"===(t=_e(e))||"composite_or"===t;var t}function ot(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 rt(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 lt(e,t){if(!nt(e))return null;const n=function(e){return nt(e)?("composite_and"===(t=_e(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=ot(e);if(t&&o.length>=2){const e=[];for(const n of o){const o=t.get(n);o&&e.push({text:et(o),eventLabel:rt(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(tt[t]).map(e=>e.trim()).filter(Boolean);return o.length<2?null:o}(et(e),n);return r?{operator:n,legs:r.map(e=>({text:e,eventLabel:null}))}:null}var at="#0F4C5C",it={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"},st={sports:"Pick the winners",casino:"Beat the house",racing:"Back a winner"};function ct(e,t,n){if(n)return n.slice(0,4).toUpperCase();const o=it[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 dt(e,t){const n=t>0?Math.floor(t/68):e;return Math.max(2,Math.min(Math.ceil(e/2),n))}function ut(e){return!!e.is_composite_component||!!(t=_e(e))&&t.startsWith("co_");var t}function mt(e){return"object"==typeof e&&null!==e?Number(e.amount)||0:Number(e)||0}function pt(e){if(null==e)return 0;const t=Number(e);return Number.isFinite(t)?t:0}function ft(e){return"string"==typeof e?"true"===e.toLowerCase():!!e}function ht(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 xt(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 gt(e){return e.reduce((t,n)=>{const o=yt(n,e);return t[o]||(t[o]=[]),t[o].push(n),t},{})}function yt(e,t){if(e.sport)return e.sport;if(nt(e)&&t)for(const n of ot(e)){const e=t.find(e=>e.id===n);if(e?.sport)return e.sport}return"Other"}var bt=["sports","casino","racing"];function wt(e){const t=(e.category||"").toLowerCase(),n=e.sport||"",o=_e(e).toLowerCase();return"casino"===t||"casino"===o||n.startsWith("casino")?"casino":"racing"===t||n.startsWith("horse_racing")?"racing":"sports"}function kt(e){return"racing"===wt(e)}function vt(e){const t={};for(const n of e){const e=wt(n);t[e]||(t[e]=[]),t[e].push(n)}return t}function Nt(e){const t=vt(e);return bt.filter(e=>(t[e]?.length??0)>0)}function Ft(e){switch(e){case"casino":return"Choose a Game";case"racing":return"Choose a Meeting";default:return"Choose a Sport"}}function Bt(e,t,n,o){return o&&o.length>0?o.includes(e):!(void 0!==t&&e<t||void 0!==n&&e>n)}function Ct(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 At(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 Mt(e,t){const n={basketball_nba:"NBA Basketball",americanfootball_nfl:"NFL Football",icehockey_nhl:"NHL Hockey",baseball_mlb:"MLB Baseball",soccer_epl:"Premier League",soccer_usa_mls:"MLS Soccer",horse_racing_aus:"Horse Racing",casino_blackjack:"Blackjack",casino_roulette:"Roulette",casino_slots:"Slots",aussierules_afl:"AFL",rugbyleague_nrl:"NRL","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 St(e,t,n){const o=t?.[e];return o||Mt(e,n)}function zt(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 Lt(e,t){if(e)return t&&e.startsWith(`${t}_`)?t:e}function Pt(e,t,n){return e===t||!!n&&(!(t!==n||!e.startsWith(`${n}_`))||!(e!==n||!t.startsWith(`${n}_`)))}function Dt(e,t,n){return!t||!!e&&(Pt(e,t,n)||Pt(t,e,n))}function Ot(e,t){return t.find(t=>t.id===e)}function Tt(e,t){let n=e;return t?.category&&(n=n.filter(e=>wt(e)===t.category)),t?.sport&&(n=n.filter(n=>nt(n)?function(e,t,n,o){if(Dt(e.sport,t,n))return!0;if(!o)return!1;for(const r of ot(e)){const e=Ot(r,o);if(e&&Dt(e.sport,t,n))return!0}return!1}(n,t.sport,t.sportBaseKey,e):Dt(n.sport,t.sport,t.sportBaseKey))),n}function Et(e,t){return!t||function(e){const t=(e.category||"sports").toLowerCase();return"casino"===t||"racing"===t?t:"sports"}(e)===t}function jt(e,t,n){if(!t)return!0;const o=e.allowed_sports;return!o||0===o.length||o.some(e=>Pt(t,e,n))}function Yt(e,t,n){return!(n?.category&&!Et(e,n.category))&&!(n?.sport&&!jt(e,n.sport,n.sportBaseKey))&&Tt(Rt(t,e),n).length>0}function Ht(e,t){return t?.category||t?.sport?e.filter(e=>!(t.category&&!Et(e,t.category)||t.sport&&!jt(e,t.sport,t.sportBaseKey))):e}function Rt(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(ut(a))return!1;if(r)if(nt(a)){if(!function(e,t,n,o){if(e.sport&&t.some(t=>Pt(e.sport,t,n)))return!0;if(!o)return!1;for(const r of ot(e)){const e=Ot(r,o);if(e?.sport&&t.some(t=>Pt(e.sport,t,n)))return!0}return!1}(a,o,n,e))return!1}else if(!a.sport||!o.some(e=>Pt(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=_e(e);return!!o&&n.includes(o)}(a,t))}):e.filter(e=>!ut(e))}function Gt(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 Wt=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function It(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 Ut(e,t,n){return function(e,t,n){return"racing"===e||!(!t?.length||!t.every(kt))||!!n&&Boolean(t?.some(e=>e.sport===n||(e.sport||"").startsWith(`${n}_`)))}(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 Kt(e){const t=[];for(const n of e){const e=n.home_team&&n.away_team&&!kt(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 Zt(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 $t(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 qt=/* @__PURE__ */new Map,Vt=/* @__PURE__ */new Map;function Xt(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 Qt({iconUrl:t,width:n,height:o,iconColor:r,accentColor:l,ariaLabel:a,style:i}){const s=Me(t),[c,d]=e.useState(()=>s??qt.get(t)??null);e.useEffect(()=>{const e=Me(t);if(e)return void d(e);if(qt.has(t))return void d(qt.get(t));let n=!1;return function(e){const t=qt.get(e);if(void 0!==t)return Promise.resolve(t);const n=Vt.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=>(qt.set(e,t),Vt.delete(e),t)).catch(t=>{throw Vt.delete(e),t});return Vt.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__ */
|
|
49
|
+
return u("img",c?{src:Xt(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 Jt({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(),f=o/360,h=a??l,x=j(r,i,h),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:[
|
|
50
50
|
/* @__PURE__ */u("rect",{x:"2",y:"2",width:"356",height:"356",rx:"78",fill:l,stroke:r,strokeWidth:"4"}),
|
|
51
51
|
/* @__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"})}),
|
|
52
52
|
/* @__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"})}),
|
|
53
53
|
/* @__PURE__ */u("rect",{x:"40",y:"5",width:"210",height:"210",rx:"42",fill:r}),
|
|
54
54
|
/* @__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"}),
|
|
55
|
-
/* @__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*f,top:25*f,width:170*f,height:170*f,pointerEvents:"none"},children:/* @__PURE__ */u(
|
|
56
|
-
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
|
|
57
|
-
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
|
|
58
|
-
return u(
|
|
59
|
-
return u("span",{className:`inline-block animate-pulse rounded-md ${t}`,style:{backgroundColor:e,opacity:.35,...n},"aria-hidden":!0})}function
|
|
60
|
-
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
|
|
61
|
-
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:
|
|
62
|
-
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:
|
|
63
|
-
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:
|
|
64
|
-
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:
|
|
65
|
-
/* @__PURE__ */u(
|
|
66
|
-
/* @__PURE__ */u(
|
|
67
|
-
/* @__PURE__ */u(
|
|
68
|
-
/* @__PURE__ */u(
|
|
69
|
-
/* @__PURE__ */u(
|
|
70
|
-
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(
|
|
71
|
-
return m("div",{className:"flex flex-col w-full","aria-hidden":!0,children:[o&&/* @__PURE__ */u(
|
|
72
|
-
/* @__PURE__ */u(
|
|
73
|
-
return m("div",{className:"space-y-4 sm:space-y-6 pb-16 w-full","aria-hidden":!0,children:[/* @__PURE__ */u(
|
|
74
|
-
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(
|
|
75
|
-
return m("div",{className:"rounded-lg border overflow-hidden w-full",style:{borderColor:e.border,backgroundColor:
|
|
76
|
-
return m("div",{className:"w-full flex flex-col","aria-hidden":!0,children:[/* @__PURE__ */u(
|
|
77
|
-
return u(on,{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 xn(e){return e.homeTeam&&e.awayTeam?`${e.homeTeam} vs ${e.awayTeam}`:e.homeTeam??e.awayTeam??e.id}function gn(e){return(e??"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"")}function yn(e){if(!e||e.quick_pick_only)return!1;const t=gn(e.selection_scope);if("samegamemulti"===gn(e.rule)||!0===e.require_same_event||"singleevent"===t||"sameevent"===t)return!0;const n=[e.game_name,e.game_name_template].map(gn);return n.includes("samegame")||n.includes("samegamemulti")}function bn(e){return(e.eventId??e.event_id)?.trim()||null}function wn(e){const t=/* @__PURE__ */new Map;for(const n of e){if(!Fn(n))continue;const e=bn(n);if(!e)continue;const o=t.get(e);o?(o.propositionCount+=1,o.homeTeam=kn(o.homeTeam,n.home_team),o.awayTeam=kn(o.awayTeam,n.away_team),o.sport=kn(o.sport,n.sport),o.league=kn(o.league,n.league),o.commenceTime=Nn(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=vn(e.commenceTime),o=vn(t.commenceTime);return n!==o?n-o:e.id.localeCompare(t.id)})}function kn(e,t){const n=t?.trim();return n?e&&e.localeCompare(n)<=0?e:n:e}function vn(e){if(!e)return Number.MAX_SAFE_INTEGER;const t=new Date(e).getTime();return Number.isFinite(t)?t:Number.MAX_SAFE_INTEGER}function Nn(e,t){const n=t?.trim();if(!n)return e;if(!e)return n;const o=vn(e),r=vn(n);return r!==o?r<o?n:e:e.localeCompare(n)<=0?e:n}function Fn(e){return!1!==e.bettable&&!0!==e.is_suspended&&!0!==e.is_expired&&!0!==e.is_voided&&!0!==e.is_composite_component}function Bn(e,t){return t?e.filter(e=>Fn(e)&&bn(e)===t):[]}function Cn(e,t){return!!t&&e.length>0&&e.every(e=>Fn(e)&&bn(e)===t)}var An={signature:1,premier:2,exclusive:3},Mn=[{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 Sn(e){return"number"==typeof e.tier&&Number.isFinite(e.tier)?e.tier:1}function zn(e,t){return e.filter(e=>Sn(e)===t)}function Ln(e){const t=new Set(e.map(Sn));return Mn.filter(e=>t.has(e.level))}function Pn(e){return Ln(e)[0]?.id??"signature"}var Dn=4,On=6,Tn=[4,12],En=[5,10,20,50];function jn(e){return!!e&&!e.quick_pick_only&&"safety_net"===(e.rule??"").trim().toLowerCase()}function Yn(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 Hn(e,t){return t>0&&e>=t?Math.round(e/t)*t:Math.round(e)}function Rn(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 Gn(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=Rn(t,0);for(let d=1;d<=r;d+=1)c+=Rn(t,d),s.push(Hn(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 Wn(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 In(e){return e.includes(8)?8:e[Math.floor(e.length/2)]}function Un(e){return e.toLowerCase().replace(/[^a-z]+/g," ").trim()}function Kn(e,t){const n=Un(t);return e.permitted_rules?.find(e=>Un(e.name??"").includes(n))??null}function Zn(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 $n(e){if(!jn(e)||!e)return null;const t=e.min_propositions??e.allowed_propositions?.[0]??Tn[0],n=e.max_propositions??e.allowed_propositions?.[e.allowed_propositions.length-1]??Tn[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=Kn(e,"Extra Shot"),l=Kn(e,"Double Shot"),a=Zn(o,r,4).filter(e=>e>1),i=Zn(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:In(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:In(i),ruleId:l?.id??null});const d=Math.max(e.min_bet??5,.01),u=e.max_bet??null,m=En.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:Yn(e)}}function qn(e){return[{id:`target-${e}`,label:"Perfect pick",stat:"Top payout",detail:["Get every pick right","nothing else pays"],emphasis:!0,expectedCorrect:e}]}function Vn(e,t,n){const o=Math.max(0,e-t),r=Gn(20,e,o,n),l=[];for(let a=0;a<=o;a+=1){const t=Math.round(Wn(r,a));l.push({misses:a,label:`${e-a}/${e}`,multiplier:t/20,payout20:t})}return l}function Xn(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:Vn(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:Vn(e,e-2,t),expectedCorrect:e-2}]}function Qn(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:Xn(t,Yn(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:qn(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 Jn(e){return null!=Qn(e)}var _n=[2500,5e3,7500,1e4,12500,15e3,2e4],eo=[12,11,10,9,8,7,6];function to(e){return!!e&&!e.quick_pick_only&&"pick_your_dividend"===(e.rule??"").trim().toLowerCase()}function no(e){return Math.round(100*e)/100}function oo(e,t,n=.21875){const o=Math.pow(2,t),r=e/(1-n)/o,l=Number.isInteger(r),a=no(r),i=l?r:no(.96*r);return{legs:t,exactStake:a,stake:i,margin:1-e/(i*o),multiple:e/i,oddsOneIn:o,discounted:!l}}function ro(e,t=eo){return{dividend:e,rungs:t.map(t=>oo(e,t))}}function lo(e,t){if(!to(e)||!e)return null;const n=e.min_propositions??6,o=e.max_propositions??12,r=eo.filter(e=>e>=n&&e<=o);if(0===r.length)return null;const l=t?.dividends??_n;return{dividends:l.map(e=>ro(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 ao(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?Kt(o,r):[],i=/* @__PURE__ */new Map;for(const h of t?.top_payouts??[]){const e=Number(h.proposition_count),t=Number(h.net_payout),n=Number(h.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 h of a){const e=Number(h);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=to(e)?lo(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=Qn(e,c),f="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:f,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 io({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),[f,h]=c(()=>String(p(20))),x=parseFloat(f),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:"mt-2 flex items-center gap-1 text-[10px] italic",style:{color:a.textMuted,margin:"8px 0 0"},children:["Example values for a",
|
|
78
|
-
/* @__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:f,onChange:e=>h(e.target.value),onBlur:()=>h(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?` (${
|
|
55
|
+
/* @__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*f,top:25*f,width:170*f,height:170*f,pointerEvents:"none"},children:/* @__PURE__ */u(Qt,{iconUrl:e,width:"100%",height:"100%",iconColor:h,accentColor:x})})]});return n?/* @__PURE__ */u(_t,{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 _t({size:e,onPress:t,className:n,ariaLabel:o,renderInner:r}){const[l,a]=c(!1),[i,s]=c(!1);/* @__PURE__ */
|
|
56
|
+
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 en(e){return e.selectionCard??e.backgroundAlt}function tn({color:e,size:t=20,label:n="Loading"}){/* @__PURE__ */
|
|
57
|
+
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 nn({color:e="#ffffff",size:t=18}){/* @__PURE__ */
|
|
58
|
+
return u(tn,{color:e,size:t,label:"Loading"})}function on({color:e,className:t="",style:n}){/* @__PURE__ */
|
|
59
|
+
return u("span",{className:`inline-block animate-pulse rounded-md ${t}`,style:{backgroundColor:e,opacity:.35,...n},"aria-hidden":!0})}function rn({className:e="",bodyFont:t,children:n}){/* @__PURE__ */
|
|
60
|
+
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 ln({colors:e,count:t=2}){/* @__PURE__ */
|
|
61
|
+
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:en(e),borderColor:e.border},children:[/* @__PURE__ */u(on,{color:e.textMuted,className:"h-5 w-[11rem] max-w-full"}),/* @__PURE__ */u(on,{color:e.textMuted,className:"h-3 w-24 max-w-[70%]"})]},n))})}function an({colors:e,count:t=4}){/* @__PURE__ */
|
|
62
|
+
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:en(e),borderColor:e.border},children:[/* @__PURE__ */u(on,{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(on,{color:e.textMuted,className:"h-3.5 w-20 max-w-full"}),/* @__PURE__ */u(on,{color:e.textMuted,className:"h-2.5 w-12 max-w-[80%]"})]})]},n))})}function sn({colors:e,count:t=3}){/* @__PURE__ */
|
|
63
|
+
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:en(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(on,{color:e.textMuted,className:"h-4 w-44 max-w-full"})}),/* @__PURE__ */u(on,{color:e.textMuted,className:"h-3 w-40 max-w-[80%] mt-2"})]}),/* @__PURE__ */u(on,{color:e.textMuted,className:"h-5 w-5 rounded shrink-0"})]},n))})}function cn({colors:e,tileSize:t=116}){/* @__PURE__ */
|
|
64
|
+
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:en(e)},"aria-hidden":!0,children:[
|
|
65
|
+
/* @__PURE__ */u(on,{color:e.textMuted,className:"rounded-2xl",style:{width:t,height:t}}),
|
|
66
|
+
/* @__PURE__ */u(on,{color:e.textMuted,className:"h-3 w-11 mt-3"}),
|
|
67
|
+
/* @__PURE__ */u(on,{color:e.textMuted,className:"h-5 w-36 max-w-[80%] mt-2"}),
|
|
68
|
+
/* @__PURE__ */u(on,{color:e.textMuted,className:"h-3 w-48 max-w-[90%] mt-3"}),
|
|
69
|
+
/* @__PURE__ */u(on,{color:e.textMuted,className:"h-3 w-40 max-w-[75%] mt-1.5"})]})}function dn({colors:e}){/* @__PURE__ */
|
|
70
|
+
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(on,{color:e.textMuted,className:"h-[38px] w-full rounded-full"},t))})}function un({colors:e,count:t=3,tileSize:n=116,showTierTabs:o=!1}){/* @__PURE__ */
|
|
71
|
+
return m("div",{className:"flex flex-col w-full","aria-hidden":!0,children:[o&&/* @__PURE__ */u(dn,{colors:e}),
|
|
72
|
+
/* @__PURE__ */u(cn,{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(on,{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(on,{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(on,{color:e.textMuted,className:"h-[52px] w-[52px] rounded-2xl"}),/* @__PURE__ */u(on,{color:e.textMuted,className:"h-2.5 w-12"})]},n))})]})]})]})}function mn({colors:e,groups:t=2,rowsPerGroup:n=2}){/* @__PURE__ */
|
|
73
|
+
return m("div",{className:"space-y-4 sm:space-y-6 pb-16 w-full","aria-hidden":!0,children:[/* @__PURE__ */u(on,{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:en(e)},children:[/* @__PURE__ */m("div",{className:"px-4 py-3 flex flex-col gap-1.5",style:{backgroundColor:e.backgroundAlt},children:[/* @__PURE__ */u(on,{color:e.textMuted,className:"h-4 w-44 max-w-[80%]"}),/* @__PURE__ */u(on,{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(on,{color:e.textMuted,className:"h-4 flex-1 max-w-[58%]"}),/* @__PURE__ */m("div",{className:"flex gap-1.5 shrink-0",children:[/* @__PURE__ */u(on,{color:e.textMuted,className:"h-7 w-11 sm:h-8 sm:w-12 rounded-lg"}),/* @__PURE__ */u(on,{color:e.textMuted,className:"h-7 w-11 sm:h-8 sm:w-12 rounded-lg"})]})]},n))})]},o))})]})}function pn({colors:e}){/* @__PURE__ */
|
|
74
|
+
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(on,{color:e.textMuted,className:"h-3.5 w-[4.25rem]"}),/* @__PURE__ */u(on,{color:e.textMuted,className:"h-5 min-w-[1.25rem] w-5 rounded-full"})]},t))})}function fn({colors:e}){/* @__PURE__ */
|
|
75
|
+
return m("div",{className:"rounded-lg border overflow-hidden w-full",style:{borderColor:e.border,backgroundColor:en(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(on,{color:e.textMuted,className:"h-[18px] w-40 max-w-[75%]"}),/* @__PURE__ */u(on,{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(on,{color:e.textMuted,className:"h-3.5 w-10"}),/* @__PURE__ */u(on,{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(on,{color:e.textMuted,className:"h-3.5 w-[88%]"}),/* @__PURE__ */u(on,{color:e.textMuted,className:"h-3 w-[70%]"})]}),/* @__PURE__ */u(on,{color:e.textMuted,className:"h-5 w-10 rounded shrink-0"})]},t))})]})}function hn({colors:e,rows:t=2}){/* @__PURE__ */
|
|
76
|
+
return m("div",{className:"w-full flex flex-col","aria-hidden":!0,children:[/* @__PURE__ */u(pn,{colors:e}),/* @__PURE__ */u("div",{className:"space-y-3 w-full",children:Array.from({length:t}).map((t,n)=>/* @__PURE__ */u(fn,{colors:e},n))})]})}function xn({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(an,{colors:e,count:Math.max(i,2)});case"event":/* @__PURE__ */return u(sn,{colors:e});case"games":/* @__PURE__ */return u(un,{colors:e,count:a,showTierTabs:s});case"propositions":/* @__PURE__ */return u(mn,{colors:e});case"entries":/* @__PURE__ */return u(hn,{colors:e,rows:2});default:/* @__PURE__ */return u(ln,{colors:e,count:i})}})(),d=n?.trim()||"Loading";/* @__PURE__ */
|
|
77
|
+
return u(rn,{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 gn(e){return e.homeTeam&&e.awayTeam?`${e.homeTeam} vs ${e.awayTeam}`:e.homeTeam??e.awayTeam??e.id}function yn(e){return(e??"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"")}function bn(e){if(!e||e.quick_pick_only)return!1;const t=yn(e.selection_scope);if("samegamemulti"===yn(e.rule)||!0===e.require_same_event||"singleevent"===t||"sameevent"===t)return!0;const n=[e.game_name,e.game_name_template].map(yn);return n.includes("samegame")||n.includes("samegamemulti")}function wn(e){return(e.eventId??e.event_id)?.trim()||null}function kn(e){const t=/* @__PURE__ */new Map;for(const n of e){if(!Bn(n))continue;const e=wn(n);if(!e)continue;const o=t.get(e);o?(o.propositionCount+=1,o.homeTeam=vn(o.homeTeam,n.home_team),o.awayTeam=vn(o.awayTeam,n.away_team),o.sport=vn(o.sport,n.sport),o.league=vn(o.league,n.league),o.commenceTime=Fn(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=Nn(e.commenceTime),o=Nn(t.commenceTime);return n!==o?n-o:e.id.localeCompare(t.id)})}function vn(e,t){const n=t?.trim();return n?e&&e.localeCompare(n)<=0?e:n:e}function Nn(e){if(!e)return Number.MAX_SAFE_INTEGER;const t=new Date(e).getTime();return Number.isFinite(t)?t:Number.MAX_SAFE_INTEGER}function Fn(e,t){const n=t?.trim();if(!n)return e;if(!e)return n;const o=Nn(e),r=Nn(n);return r!==o?r<o?n:e:e.localeCompare(n)<=0?e:n}function Bn(e){return!1!==e.bettable&&!0!==e.is_suspended&&!0!==e.is_expired&&!0!==e.is_voided&&!0!==e.is_composite_component}function Cn(e,t){return t?e.filter(e=>Bn(e)&&wn(e)===t):[]}function An(e,t){return!!t&&e.length>0&&e.every(e=>Bn(e)&&wn(e)===t)}var Mn={signature:1,premier:2,exclusive:3},Sn=[{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 zn(e){return"number"==typeof e.tier&&Number.isFinite(e.tier)?e.tier:1}function Ln(e,t){return e.filter(e=>zn(e)===t)}function Pn(e){const t=new Set(e.map(zn));return Sn.filter(e=>t.has(e.level))}function Dn(e){return Pn(e)[0]?.id??"signature"}var On=4,Tn=6,En=[4,12],jn=[5,10,20,50];function Yn(e){return!!e&&!e.quick_pick_only&&"safety_net"===(e.rule??"").trim().toLowerCase()}function Hn(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 Rn(e,t){return t>0&&e>=t?Math.round(e/t)*t:Math.round(e)}function Gn(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 Wn(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=Gn(t,0);for(let d=1;d<=r;d+=1)c+=Gn(t,d),s.push(Rn(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 In(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 Un(e){return e.includes(8)?8:e[Math.floor(e.length/2)]}function Kn(e){return e.toLowerCase().replace(/[^a-z]+/g," ").trim()}function Zn(e,t){const n=Kn(t);return e.permitted_rules?.find(e=>Kn(e.name??"").includes(n))??null}function $n(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 qn(e){if(!Yn(e)||!e)return null;const t=e.min_propositions??e.allowed_propositions?.[0]??En[0],n=e.max_propositions??e.allowed_propositions?.[e.allowed_propositions.length-1]??En[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=Zn(e,"Extra Shot"),l=Zn(e,"Double Shot"),a=$n(o,r,4).filter(e=>e>1),i=$n(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:Un(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:Un(i),ruleId:l?.id??null});const d=Math.max(e.min_bet??5,.01),u=e.max_bet??null,m=jn.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:Hn(e)}}function Vn(e){return[{id:`target-${e}`,label:"Perfect pick",stat:"Top payout",detail:["Get every pick right","nothing else pays"],emphasis:!0,expectedCorrect:e}]}function Xn(e,t,n){const o=Math.max(0,e-t),r=Wn(20,e,o,n),l=[];for(let a=0;a<=o;a+=1){const t=Math.round(In(r,a));l.push({misses:a,label:`${e-a}/${e}`,multiplier:t/20,payout20:t})}return l}function Qn(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:Xn(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:Xn(e,e-2,t),expectedCorrect:e-2}]}function Jn(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:Qn(t,Hn(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:Vn(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 _n(e){return null!=Jn(e)}var eo=[2500,5e3,7500,1e4,12500,15e3,2e4],to=[12,11,10,9,8,7,6];function no(e){return!!e&&!e.quick_pick_only&&"pick_your_dividend"===(e.rule??"").trim().toLowerCase()}function oo(e){return Math.round(100*e)/100}function ro(e,t,n=.21875){const o=Math.pow(2,t),r=e/(1-n)/o,l=Number.isInteger(r),a=oo(r),i=l?r:oo(.96*r);return{legs:t,exactStake:a,stake:i,margin:1-e/(i*o),multiple:e/i,oddsOneIn:o,discounted:!l}}function lo(e,t=to){return{dividend:e,rungs:t.map(t=>ro(e,t))}}function ao(e,t){if(!no(e)||!e)return null;const n=e.min_propositions??6,o=e.max_propositions??12,r=to.filter(e=>e>=n&&e<=o);if(0===r.length)return null;const l=t?.dividends??eo;return{dividends:l.map(e=>lo(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 io(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?Zt(o,r):[],i=/* @__PURE__ */new Map;for(const h of t?.top_payouts??[]){const e=Number(h.proposition_count),t=Number(h.net_payout),n=Number(h.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 h of a){const e=Number(h);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=no(e)?ao(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=Jn(e,c),f="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:f,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 so({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),[f,h]=c(()=>String(p(20))),x=parseFloat(f),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:"mt-2 flex items-center gap-1 text-[10px] italic",style:{color:a.textMuted,margin:"8px 0 0"},children:["Example values for a",
|
|
78
|
+
/* @__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:f,onChange:e=>h(e.target.value),onBlur:()=>h(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?` (${ht(r)}–${ht(l)})`:` (min ${ht(r)})`,"."]}),v={marginTop:10,borderRadius:14,border:`1px solid ${a.border}`,backgroundColor:a.backgroundAlt??"#FCFBF9",padding:"12px 14px",textAlign:"left",fontFamily:i};/* @__PURE__ */
|
|
79
79
|
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__ */u("div",{style:v,children:t?.length?t.map((e,n)=>/* @__PURE__ */m("div",{style:{borderTop:0===n?"none":`1px solid ${a.border}`,paddingTop:0===n?0:8,marginTop:0===n?0:8},children:[
|
|
80
|
-
/* @__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:
|
|
81
|
-
/* @__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:
|
|
80
|
+
/* @__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:ht(e.payout20*y)})]},e.label)),n===t.length-1&&k]},e.id)):/* @__PURE__ */m(d,n?.length?{children:[
|
|
81
|
+
/* @__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:ht(e.dividend)}),/* @__PURE__ */u("span",{style:{fontWeight:600,color:a.text,fontSize:12},children:ht(e.stakeFrom)})]},e.dividend)),
|
|
82
82
|
/* @__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:[
|
|
83
|
-
/* @__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?
|
|
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 ${ce(o.primary,.55)}, 0 7px 12px -4px ${ce(o.primary,.35)}`:`0 4px 0 ${ce(o.border,.9)}, 0 6px 10px -4px ${ce(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__ */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?ht(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)}),k]})})]})}function co({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 ${ce(o.primary,.55)}, 0 7px 12px -4px ${ce(o.primary,.35)}`:`0 4px 0 ${ce(o.border,.9)}, 0 6px 10px -4px ${ce(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 uo({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:Y,className:"flex flex-col",style:{fontFamily:B},children:[g&&/* @__PURE__ */u(
|
|
91
|
-
/* @__PURE__ */m("div",{style:{position:"relative"},children:[/* @__PURE__ */u("div",{ref:V,className:"blade-game-track",style:{display:"flex",alignItems:"stretch",gap:14,overflowX:"auto",overflowY:"hidden",scrollSnapType:"x mandatory",scrollbarWidth:"none",paddingLeft:
|
|
92
|
-
return m("article",{className:"flex flex-col items-center text-center",style:{flex:
|
|
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(Qt,{iconUrl:e,width:"100%",height:"100%",iconColor:o,accentColor:r})})]})}function mo({iconUrl:e,gameName:t,size:n,brandColor:o,cardColor:r,iconColor:a,accentColor:i,captionColor:d,bodyFont:f,legOptions:h,onPick:x,colors:g,menuShadow:y}){const[b,w]=c(!1),[k,v]=c(null),N=s(null),F=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*h.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)||F.current?.contains(t)||w(!1)};return document.addEventListener("mousedown",t),()=>{window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0),document.removeEventListener("mousedown",t)}},[b,h.length]);const B=b&&k&&"undefined"!=typeof document?p(/* @__PURE__ */m("div",{ref:F,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:f},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?"}),h.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:ce(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(Jt,{iconUrl:e,gameName:t,onPress:()=>w(e=>!e),size:n,brandColor:o,cardColor:r,iconColor:a,accentColor:i,captionColor:d}),B]})}function po({games:e,selectedGame:t,onSelectGame:n,loading:r,error:a,theme:p,colorScheme:f,showTier:h=!1,showCategory:x=!1,showTierFilter:g=!1,onPropositionCountChange:y,onPropositionCountSelected:b,onQuickPickGame:w,maxPayouts:k}){const v=se(p,f),N=v.colors,F=R(v),B=ye(v),C=be(v),A=L(v),M=xe(v),S=he(v),z=E(v),D=i(()=>Pn(e),[e]),[O,T]=c(()=>Dn(e));l(()=>{0!==D.length&&(D.some(e=>e.id===O)||T(D[0].id))},[D,O]);const j=i(()=>!g||D.length<=1?e:Ln(e,Mn[O]),[e,g,D.length,O]),Y=s(null),H=s(null),[G,W]=c(0),[U,K]=c(0),Z=(e,t)=>{e.quick_pick_only&&w&&t>0?w(e,t):(t>0&&!bn(e)&&y?.(t),n(e),b?.())},$=e=>{Z(e,io(e,k?.[e.id]).maxLegCount)};l(()=>{const e=Y.current;if(!e)return;W(e.getBoundingClientRect().width);const t=new ResizeObserver(e=>{for(const t of e)W(t.contentRect.width)});return t.observe(e),()=>t.disconnect()},[]);const q=s(()=>{}),V=o(e=>{H.current?.removeEventListener("scroll",q.current),H.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)}),K(n)},e.addEventListener("scroll",q.current,{passive:!0}),q.current())},[]);l(()=>{q.current()},[G,j.length]),l(()=>{H.current?.scrollTo({left:0}),K(0)},[O]);const X=e=>e.allowed_propositions&&e.allowed_propositions.length>0&&e.game_name.replace(/\s+\d+\s*$/,"").trim()||e.game_name,Q=e=>{const t=H.current,n=t?.children[e];t&&n&&t.scrollTo({left:n.offsetLeft-(t.clientWidth-n.offsetWidth)/2,behavior:"smooth"})};if(r)/* @__PURE__ */return u(xn,{colors:I(v),bodyFont:B,variant:"games",gameCardCount:Math.min(Math.max(e.length,2),4),showTierTabs:g&&D.length>1});if(a)/* @__PURE__ */return u("div",{className:"flex items-center justify-center p-8",style:{fontFamily:B},children:/* @__PURE__ */u("div",{style:{color:N.error},children:a})});if(0===e.length)/* @__PURE__ */return u("div",{className:"flex items-center justify-center p-8",style:{fontFamily:B},children:/* @__PURE__ */u("div",{style:{color:N.textMuted},children:"No games available"})});const J=G>0&&G<400,_=J?108:124,ee=G>0?Math.min(.86*G,380):0,te=ee>0?Math.max((G-ee)/2,4):4,ne=j.length>1,oe=ne&&te>=48,re=e=>({position:"absolute",top:"38%",width:44,height:44,borderRadius:"50%",border:`1px solid ${N.border}`,backgroundColor:ce(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:Y,className:"flex flex-col",style:{fontFamily:B},children:[g&&/* @__PURE__ */u(co,{tabs:D,active:O,onChange:T,colors:N,bodyFont:B}),0===j.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:V,className:"blade-game-track",style:{display:"flex",alignItems:"stretch",gap:14,overflowX:"auto",overflowY:"hidden",scrollSnapType:"x mandatory",scrollbarWidth:"none",paddingLeft:te,paddingRight:te,paddingBottom:8,position:"relative"},children:j.map(e=>{const n=Gt(e),o=function(e){const t=e.available_days;if(!t||0===t.length)return null;const n=t.map(e=>Wt[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=At(e),i=e.description||e.rule,s=e.call_to_action?.trim()||null,{legOptions:c,maxLegCount:d,tiers:p,modes:f,pydDividends:g,hasGenericDividends:y,minBet:b,maxBet:S}=io(e,k?.[e.id]),L=Ae(e),D=!n&&o?`Available ${o}`:null;/* @__PURE__ */
|
|
92
|
+
return m("article",{className:"flex flex-col items-center text-center",style:{flex:ee>0?`0 0 ${ee}px`:"0 0 86%",scrollSnapAlign:"center",borderRadius:24,border:`1px solid ${r?N.primary:N.border}`,backgroundColor:r?N.infoBg:N.background??F,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(mo,{iconUrl:L,gameName:X(e),size:_,brandColor:N.primary,cardColor:F,iconColor:N.primaryText,accentColor:z,captionColor:N.textMuted,bodyFont:B,legOptions:c.map(Number),onPick:t=>Z(e,t),colors:N,menuShadow:M}):/* @__PURE__ */u(Jt,{iconUrl:L,gameName:X(e),onPress:()=>$(e),size:_,brandColor:N.primary,cardColor:F,iconColor:N.primaryText,accentColor:z,captionColor:N.primary}),
|
|
93
93
|
/* @__PURE__ */m("div",{className:"mt-2",style:{fontFamily:C,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:ce(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:C,fontSize:
|
|
95
|
-
/* @__PURE__ */u("style",{children:".blade-game-track::-webkit-scrollbar,.blade-game-strip::-webkit-scrollbar{display:none}"})]})}var po=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 fo(e,t,n){const[r,a]=c([]),[i,d]=c(null),[u,m]=c(!n?.skip),[p,f]=c(null),h=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),f(null);const t=await e.getGames(x.current);a(t.games),d(t.howToPlayMarkdown)}catch(t){f(t instanceof Error?t.message:"Failed to fetch games")}finally{m(!1)}},[e,h,g]);return l(()=>{y()},[y]),{games:r,howToPlayMarkdown:i,loading:u,error:p,refetch:o(async()=>{e.invalidate(),await y()},[e,y])}}function ho(e,t,n){const[r,a]=c([]),[i,d]=c(!n?.skip),[u,m]=c(null),p=n?.skip??!1,f=t?`${t.event_id||""}_${t.sport||""}_${t.category||""}`:"",h=s(t);h.current=t;const x=o(async()=>{if(!p)try{d(!0),m(null);const t=await e.getPropositions(h.current);a(t)}catch(t){m(t instanceof Error?t.message:"Failed to fetch propositions")}finally{d(!1)}},[e,f,p]);return l(()=>{x()},[x]),{propositions:r,loading:i,error:u,refetch:o(async()=>{e.invalidate(),await x()},[e,x])}}function xo(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 go(e,t,n){const[r,a]=c([]),[i,d]=c(!n?.skip),[u,m]=c(null),p=n?.skip??!1,f=t?`${t.user_id??""}_${t.pending??""}`:"",h=s(t);h.current=t;const x=o(async()=>{if(!p)try{d(!0),m(null);const t=await e.getGameEntries(h.current);a(t)}catch(t){m(t instanceof Error?t.message:"Failed to fetch entries")}finally{d(!1)}},[e,f,p]);return l(()=>{x()},[x]),{entries:r,loading:i,error:u,refetch:o(async()=>{e.invalidate(),await x()},[e,x])}}function yo(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 bo(e){const[t,n]=c(!1),[o,r]=c(null),[l,a]=c(null);return{createEntry:async t=>{try{n(!0),r(null);const o=await e.createGameEntry(t);return a(o),o}catch(o){const e=o instanceof Error?o.message:"Failed to create entry";throw r(e),new Error(e)}finally{n(!1)}},loading:t,error:o,entry:l}}function wo(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 ko(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 vo(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 No(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 Fo={today:"Today",weekend:"This weekend",next7:"Next 7 days"},Bo=["today","weekend","next7"];function Co(e,t){const n=new Date(e);return n.setDate(n.getDate()+t),n}function Ao(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:Co(n,1)};case"weekend":{const e=n.getDay(),t=Co(n,0===e?-1:(6-e)%7);return{start:t<n?n:t,end:Co(t,2)}}case"next7":return{start:n,end:Co(n,7)}}}(t,n);return o>=r&&o<l}var Mo=t(null),So={};function zo(){const e=r(Mo);if(!e)throw new Error("usePlaceEntry must be used within a <PlaceEntryProvider>");return e}function Lo({apiUrl:t,apiKey:n,fetchImpl:r,getAuthHeaders:a,userId:d,getUserBalance:m,children:p,theme:f,colorScheme:h,demoGames:x,demoPropositions:g,demoEntries:y,demoMaxPayouts:b,gameCategory:w,jurisdiction:k,initialGameId:v,filterSport:N,initialSport:F,initialEventId:B,initialEventLabel:C,sportBaseKey:A,disableQuickPick:M=!1,renderTeamLogo:S,onEntryPlaced:z,onBeforeSubmit:L,onCancel:P,onShare:D,onRecharge:O,onClearEventFilter:T,screenSize:E="desktop",howToPlayMarkdown:j,sportDisplayNames:Y,categoryDisplayNames:H}){const R=se(f,h),G=ye(R),W=be(R),I=!(!x||!g),U=i(()=>new po({apiUrl:t,apiKey:n,fetchImpl:r,getAuthHeaders:a}),[t,n,r,a]),[K,Z]=c(0),$=s(0),[q,V]=c(0),[X,Q]=c([]),[J,_]=c({}),[ee,te]=c({}),[ne,oe]=c(void 0),[re,le]=c(null),[ae,ie]=c(void 0),ce=e.useCallback(async()=>{if(m)try{const e=await m();"number"==typeof e&&Number.isFinite(e)&&ie(e)}catch(e){}},[m]);l(()=>{m?ce():ie(void 0)},[m,ce]);const de=s(null),[ue,me]=c(null),[pe,fe]=c(F??null),[he,xe]=c(B??null);l(()=>{F&&fe(F)},[F]),l(()=>{xe(B??null)},[B]);const[ge,we]=c(B),ke=s(!1);l(()=>{if(!B)return we(void 0),void(ke.current=!1);ke.current||we(B)},[B]);const ve=w??ue??void 0,Ne=N??F??void 0,Fe=zt(pe??Ne,A),Be=zt(Ne,A)??Ne,Ce=pe??void 0,{games:Ae,howToPlayMarkdown:Me,loading:Se,error:ze}=fo(U,{category:ve,jurisdiction:k,sport:Fe},{skip:I}),{propositions:Le,loading:Pe,error:De}=ho(U,{category:ve,sport:Be,event_id:ge},{skip:I}),{sports:Oe,loading:Te}=xo(U,{skip:I}),{createEntry:Ee,loading:je,error:Ye}=bo(U),{preview:He}=No(U),Re=i(()=>Yt((I?x:Ae)??[],{category:ve,sport:Fe??Ce,sportBaseKey:A}),[I,x,Ae,ve,Fe,Ce,A]),Ge=j??Me??null,{maxPayouts:We,refetchGame:Ie}=yo(U,Re??[],{skip:I,betAmount:20}),Ue=I?b??So:We,Ke=I?g:Le,Ze=N?(Ke??[]).filter(e=>e.sport===N):Ke,$e=i(()=>vt(Ze??[]),[Ze]),qe=i(()=>ve||(1===$e.length?$e[0]:void 0),[ve,$e]),Ve=i(()=>{const e=Ze??[];return qe?Ot(e,{category:qe,sportBaseKey:A}):e},[Ze,qe,A]),Xe=i(()=>Ce?Ot(Ve,{sport:Ce,sportBaseKey:A}):Ve,[Ve,Ce,A]),Qe=i(()=>({category:qe,sport:Ce,sportBaseKey:A}),[qe,Ce,A]),Je=i(()=>{const e=(Re??[]).filter(e=>e.active);if(!qe&&$e.length>1)return[];const t=qe?Yt(e,Qe):e;return qe||Ce?function(e,t,n){return n?.category||n?.sport?e.filter(e=>jt(e,t,n)):e}(t,Xe,Qe):t},[Re,Xe,Qe,qe,Ce,$e.length]),{step:_e,selectedGame:et,selections:tt,placedEntry:nt,setGameOnly:ot,clearSelectedGame:rt,goToSportSelection:lt,goToConfirmation:at,goToSuccess:it,goBack:st,reset:ct,toggleSelection:dt}=wo(v),ut=e.useCallback(()=>{ke.current=!0,we(void 0),ct(),T?.()},[ct,T]),mt=!!ge,pt=mt?C:void 0,ft=!I&&(et?Se||Pe||Te:Se),ht=I?null:et?ze||De:ze,xt=i(()=>et?Ht(Xe,et,A):Xe,[et,Xe,A]),yt=i(()=>et?xt:Ve,[et,xt,Ve]),wt=i(()=>Ot(et?xt:Ve,{category:qe}),[et,xt,Ve,qe]),kt=i(()=>{const e=new Set(wt.map(e=>e.sport).filter(Boolean));return Oe.filter(t=>e.has(t.key))},[Oe,wt]),Nt=i(()=>Ot(xt,{category:qe,sport:pe}),[xt,qe,pe]),Ct=i(()=>{if(!et||!yn(et))return[];const{min:e}=Bt(et,ne),t=ne??e;return wn(Nt).filter(e=>e.propositionCount>=t)},[et,ne,Nt]),At=i(()=>yn(et)?Bn(Nt,he):Nt,[et,Nt,he]),Pt=Object.keys(tt).map(Number),Dt=Pt.length,Et=i(()=>Nt.filter(e=>Pt.includes(e.id)),[Nt,Pt]);l(()=>{w||ue||1===$e.length&&me($e[0])},[w,ue,$e]),l(()=>{if(!et)return;const e=xt,t=new Set(e.map(bt));let n=ue;n&&t.has(n)||(n=1===t.size?Array.from(t)[0]:null,n!==ue&&me(n));const o=n?e.filter(e=>bt(e)===n):e,r=new Set(function(e){const t=/* @__PURE__ */new Set;for(const n of e){const o=gt(n,e);"Other"!==o&&t.add(o)}return[...t]}(o)),l=et.allowed_sports;fe(e=>e&&r.has(e)?e:1===l?.length&&r.has(l[0])?l[0]:l&&l.length>1?e&&l.includes(e)&&r.has(e)?e:null:1===r.size?Array.from(r)[0]:null)},[et?.id,xt,ue]),l(()=>{et&&qe&&(Tt(et,qe)||rt())},[et,qe,rt]),l(()=>{et&&(jt(et,Xe,{category:qe,sport:pe,sportBaseKey:A})||rt())},[et,qe,pe,A,Xe,rt]),l(()=>{if(et){if(V(0),de.current){const{count:e}=de.current;return de.current=null,oe(e),void Z(e)}if(et.allowed_propositions&&et.allowed_propositions.length>0){const e=ne;null!=e&&et.allowed_propositions.includes(e)?Z(e):(oe(void 0),Z(0))}else oe(void 0),Z(et.num_propositions||et.max_propositions||0)}},[et]);const Rt=(e,t,n)=>{const o=(Ue[e]?.top_payouts??[]).find(e=>e.proposition_count===t);if(!o)return 0;const r=o.bet_amount&&o.bet_amount>0?o.bet_amount:20;return r<=0?0:o.net_payout/r*n};l(()=>{if("sport"!==_e&&"confirm"!==_e||!et||I)return;const e=yn(et)&&he?At.length:Number.MAX_SAFE_INTEGER;let t;if(et.allowed_propositions&&et.allowed_propositions.length>0){const n=et.allowed_propositions?[...et.allowed_propositions].filter(t=>t<=e).sort((e,t)=>e-t):[];if(0===n.length)return void te({});const o=ne??n[0],r=n.filter(e=>e>o);if(0===r.length)return void te({});t=[o,...r]}else{const{min:n,max:o}=Bt(et),r=Math.min(o,e);if(n<=0||r<=n)return void te({});t=Array.from({length:r-n+1},(e,t)=>n+t)}const n={};for(const o of t)n[o]=Rt(et.id,o,20);te(n)},[_e,et,ne,he,At.length,I,Ue]),l(()=>{if("confirm"!==_e||!et)return;const e=Pt.length;if(0===e)return;let t=!1;const n={};for(let r=0;r<=e;r++)n[r]=Rt(et.id,r,q);_(n),e!==$.current?($.current=e,Z(e)):(K>e||K<=0&&e>0)&&Z(e);const o=q>0?q:Math.max(et.min_bet??20,.01);return(async()=>{try{const n=await He(et.id,{actual:K,predicted:K,total:e,bet_amount:o});if(t)return;Q(n.winning_counts)}catch{t||Q([])}})(),()=>{t=!0}},[_e,et,Pt.length,K,q,He,Ue]);const Gt=i(()=>{return t=re,(e=et)&&null!=t?e.permitted_rules?.find(e=>e.id===t)??null:null;var e,t},[et,re]),Wt=!yn(et)||Cn(Et,he),It=et?Bt(et,void 0,Gt):null,Ut=!(!et||!Wt)&&(et.allowed_propositions&&et.allowed_propositions.length>0?null!=ne&&Dt===ne&&Ft(Dt,It?.min,It?.max):Ft(Dt,It?.min,It?.max)),Kt=et?.min_bet??0,Zt=Math.max(Kt,.01),$t=null==ae||q<=ae,qt=!je&&q>=Zt&&Ut&&$t,Vt=e=>{oe(e),Z(e);for(const t of Object.keys(tt))dt(Number(t),tt[Number(t)])},Xt=e=>{oe(e),Z(e)},Qt=e=>{xe(yn(e)?B??null:null),ot(e)},Jt=e=>{if(e!==he){for(const e of Object.keys(tt)){const t=Number(e);dt(t,tt[t])}xe(e)}},_t=(e,t)=>{de.current={count:t},ot(e),Ie(e.id);const n=e.allowed_sports??[];let o=null;pe&&n.some(e=>Lt(pe,e,A))?o=pe:1===n.length&&(o=n[0]),fe(o);for(const i of Object.keys(tt)){const e=Number(i);dt(e,tt[e])}let r=Ot(Ht(Ze??[],e,A),{category:qe,sport:o,sportBaseKey:A});const l=Math.max(0,Math.min(t,r.length)),a=[...r].sort(()=>Math.random()-.5).slice(0,l);for(const i of a)dt(i.id,Math.random()<.5?"yes":"no");at()},en=async()=>{if(et&&Ut){if(I){const e={id:Math.floor(1e4*Math.random()),game_id:et.id,user_id:d,proposition_ids:Pt,selections:tt,pending:!0,expected_correct:K,bet_amount:q};return z?.(e),it(e),void ce()}try{L&&await L(q);const e=await Ee({game_id:et.id,user_id:d,proposition_ids:Pt,selections:tt,stake:q,rule_id:Gt?.id??null});z?.(e),it(e),ce()}catch(e){}}},tn=o(e=>Y?.[e]??kt.find(t=>t.key===e)?.label??Mt(e,void 0,A),[Y,kt,A]),nn=o(e=>St(e,H),[H]),on=i(()=>({theme:R,bodyFont:G,headingFont:W,games:Je,propositions:At,propositionsForCategoryPicker:yt,propositionsForSportPicker:wt,sportSummaries:kt,loading:ft,error:ht,step:_e,selectedGame:et,selections:tt,placedEntry:nt,selectedPropositionIds:Pt,selectedPropositions:Et,selectionValid:Ut,selectedRuleId:re,setSelectedRuleId:le,selectedRule:Gt,answeredCount:Dt,betAmount:q,setBetAmount:V,expectedCorrect:K,setExpectedCorrect:Z,selectedPropositionCount:ne,handlePropositionCountChange:Vt,upgradePropositionCount:Xt,winningCounts:X,payouts:J,overloadPayouts:ee,submitting:je,submitError:Ye,canSubmit:qt,gamePrice:Kt,userBalance:ae,hasSufficientBalance:$t,refreshUserBalance:ce,handleSubmit:en,selectGame:Qt,goToSportSelection:()=>lt(),goToConfirmation:at,goBack:st,reset:ct,clearSelectedGame:rt,toggleSelection:dt,quickPickGame:_t,selectedCategory:ue,setSelectedCategory:me,selectedSport:pe,setSelectedSport:fe,selectedEventId:he,sameGameMultiEvents:Ct,selectSameGameMultiEvent:Jt,apiUrl:t,apiKey:n,fetchImpl:r,getAuthHeaders:a,userId:d,disableQuickPick:M,renderTeamLogo:S,filterSport:N,initialSport:F,initialEventId:B,sportBaseKey:A,gameCategory:w,eventFilterActive:mt,eventFilterLabel:pt,clearEventFilter:ut,screenSize:E,displaySportName:tn,displayCategoryName:nn,maxPayouts:Ue??{},howToPlayMarkdown:Ge,onEntryPlaced:z,onCancel:P,onShare:D,onRecharge:O,demoEntries:y,demoGames:x,demoPropositions:g}),[R,G,W,Je,At,yt,wt,kt,ft,ht,_e,et,tt,nt,Pt,Et,Ut,Dt,q,K,ne,re,Gt,X,J,ee,je,Ye,qt,Kt,t,n,d,ae,r,a,M,S,N,F,B,A,w,E,mt,pt,ut,ue,pe,he,Ct,Ue,Ge,z,P,D,O,T,y,x,g,tn,nn]);/* @__PURE__ */
|
|
96
|
-
return u(Mo.Provider,{value:on,children:p})}function Po({onPress:t,onDoubleClick:n,label:o="QUICKPICK",size:l="md",yesColor:a,noColor:i,theme:s}){const c=r(Mo),d=s??c?.theme??Z,p=fe(d),f=d.colors,h=a??O(d),x=i??T(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),[F,B]=e.useState(!1);/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */m("h3",{className:"flex items-center justify-center gap-1.5 font-semibold leading-tight px-1 mt-0.5",style:{fontFamily:C,fontSize:J?19:21,color:A,letterSpacing:"-0.01em"},children:[X(e),/* @__PURE__ */u(Ke,{variant:"icon",panel:Ee(e),content:i||"Pick outcomes and land the payout for this game.",theme:v,title:X(e),label:`How to play ${X(e)}`,extra:/* @__PURE__ */u(so,{tiers:y?p:[],modes:f,pydDividends:g,onPlayCount:c.length>1?t=>Z(e,t):void 0,minBet:b,maxBet:S,colors:N,bodyFont:B,headingFont:C}),colors:N,bodyFont:B,headingFont:C})]}),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?ht(a.amount):a.limit>0?`Up to ${ht(a.limit)}`:"Jackpot":ht(a.amount)]}),(x||h)&&/* @__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:P(v)},children:e.category}),x&&/* @__PURE__ */u("span",{className:"px-1.5 py-0.5 rounded text-xs",style:{backgroundColor:N.backgroundAlt,color:P(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:P(v)},children:e.lotto_type}),h&&null!=e.tier&&/* @__PURE__ */m("span",{className:"px-1.5 py-0.5 rounded text-xs",style:{backgroundColor:N.backgroundAlt,color:P(v)},children:["Tier ",e.tier]})]}),D&&/* @__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:D})})]},l)})}),oe&&/* @__PURE__ */m(d,{children:[/* @__PURE__ */u("button",{type:"button","aria-label":"Previous game",onClick:()=>Q(U-1),style:{...re(U>0),left:2},children:"‹"}),/* @__PURE__ */u("button",{type:"button","aria-label":"Next game",onClick:()=>Q(U+1),style:{...re(U<j.length-1),right:2},children:"›"})]})]}),ne&&/* @__PURE__ */u("div",{className:"flex justify-center flex-wrap pt-1 pb-2",children:j.map((e,t)=>/* @__PURE__ */u("button",{type:"button","aria-label":`Go to ${X(e)}`,onClick:()=>Q(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===U?22:7,height:7,borderRadius:999,backgroundColor:t===U?N.primary:ce(N.primary,.25),transition:"width 200ms ease, background-color 200ms ease"}})},e.id))}),ne&&/* @__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:C},children:"All games"}),/* @__PURE__ */u("div",{className:"grid gap-1",style:{gridTemplateColumns:`repeat(${dt(j.length,G)}, minmax(0, 1fr))`},children:j.map((e,t)=>{const n=Gt(e);/* @__PURE__ */
|
|
95
|
+
return m("button",{type:"button",onClick:()=>$(e),disabled:!n,"aria-current":t===U,className:"flex flex-col items-center gap-1 px-1 py-1.5 rounded-2xl",style:{border:`1px solid ${t===U?N.primary:"transparent"}`,cursor:n?"pointer":"not-allowed",opacity:n?1:.5,background:"transparent",transition:"border-color 150ms ease"},children:[/* @__PURE__ */u(uo,{iconUrl:Ae(e),size:J?44:52,brandColor:N.primary,iconColor:N.primaryText,accentColor:z}),/* @__PURE__ */u("span",{className:"text-[11px] font-bold leading-tight",style:{color:t===U?N.primary:A,fontFamily:C,letterSpacing:"-0.01em",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:2,overflow:"hidden"},children:X(e)})]},e.id)})})]})]}),
|
|
96
|
+
/* @__PURE__ */u("style",{children:".blade-game-track::-webkit-scrollbar{display:none}"})]})}var fo=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 ho(e,t,n){const[r,a]=c([]),[i,d]=c(null),[u,m]=c(!n?.skip),[p,f]=c(null),h=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),f(null);const t=await e.getGames(x.current);a(t.games),d(t.howToPlayMarkdown)}catch(t){f(t instanceof Error?t.message:"Failed to fetch games")}finally{m(!1)}},[e,h,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,f=t?`${t.event_id||""}_${t.sport||""}_${t.category||""}`:"",h=s(t);h.current=t;const x=o(async()=>{if(!p)try{d(!0),m(null);const t=await e.getPropositions(h.current);a(t)}catch(t){m(t instanceof Error?t.message:"Failed to fetch propositions")}finally{d(!1)}},[e,f,p]);return l(()=>{x()},[x]),{propositions:r,loading:i,error:u,refetch:o(async()=>{e.invalidate(),await x()},[e,x])}}function go(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 yo(e,t,n){const[r,a]=c([]),[i,d]=c(!n?.skip),[u,m]=c(null),p=n?.skip??!1,f=t?`${t.user_id??""}_${t.pending??""}`:"",h=s(t);h.current=t;const x=o(async()=>{if(!p)try{d(!0),m(null);const t=await e.getGameEntries(h.current);a(t)}catch(t){m(t instanceof Error?t.message:"Failed to fetch entries")}finally{d(!1)}},[e,f,p]);return l(()=>{x()},[x]),{entries:r,loading:i,error:u,refetch:o(async()=>{e.invalidate(),await x()},[e,x])}}function bo(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 wo(e){const[t,n]=c(!1),[o,r]=c(null),[l,a]=c(null);return{createEntry:async t=>{try{n(!0),r(null);const o=await e.createGameEntry(t);return a(o),o}catch(o){const e=o instanceof Error?o.message:"Failed to create entry";throw r(e),new Error(e)}finally{n(!1)}},loading:t,error:o,entry:l}}function ko(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 vo(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 No(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 Fo(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 Bo={today:"Today",weekend:"This weekend",next7:"Next 7 days"},Co=["today","weekend","next7"];function Ao(e,t){const n=new Date(e);return n.setDate(n.getDate()+t),n}function Mo(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:Ao(n,1)};case"weekend":{const e=n.getDay(),t=Ao(n,0===e?-1:(6-e)%7);return{start:t<n?n:t,end:Ao(t,2)}}case"next7":return{start:n,end:Ao(n,7)}}}(t,n);return o>=r&&o<l}var So=t(null),zo={};function Lo(){const e=r(So);if(!e)throw new Error("usePlaceEntry must be used within a <PlaceEntryProvider>");return e}function Po({apiUrl:t,apiKey:n,fetchImpl:r,getAuthHeaders:a,userId:d,getUserBalance:m,children:p,theme:f,colorScheme:h,demoGames:x,demoPropositions:g,demoEntries:y,demoMaxPayouts:b,gameCategory:w,jurisdiction:k,initialGameId:v,filterSport:N,initialSport:F,initialEventId:B,initialEventLabel:C,sportBaseKey:A,disableQuickPick:M=!1,renderTeamLogo:S,onEntryPlaced:z,onBeforeSubmit:L,onCancel:P,onShare:D,onRecharge:O,onClearEventFilter:T,screenSize:E="desktop",howToPlayMarkdown:j,sportDisplayNames:Y,categoryDisplayNames:H}){const R=se(f,h),G=ye(R),W=be(R),I=!(!x||!g),U=i(()=>new fo({apiUrl:t,apiKey:n,fetchImpl:r,getAuthHeaders:a}),[t,n,r,a]),[K,Z]=c(0),$=s(0),[q,V]=c(0),[X,Q]=c([]),[J,_]=c({}),[ee,te]=c({}),[ne,oe]=c(void 0),[re,le]=c(null),[ae,ie]=c(void 0),ce=e.useCallback(async()=>{if(m)try{const e=await m();"number"==typeof e&&Number.isFinite(e)&&ie(e)}catch(e){}},[m]);l(()=>{m?ce():ie(void 0)},[m,ce]);const de=s(null),[ue,me]=c(null),[pe,fe]=c(F??null),[he,xe]=c(B??null);l(()=>{F&&fe(F)},[F]),l(()=>{xe(B??null)},[B]);const[ge,we]=c(B),ke=s(!1);l(()=>{if(!B)return we(void 0),void(ke.current=!1);ke.current||we(B)},[B]);const ve=w??ue??void 0,Ne=N??F??void 0,Fe=Lt(pe??Ne,A),Be=Lt(Ne,A)??Ne,Ce=pe??void 0,{games:Ae,howToPlayMarkdown:Me,loading:Se,error:ze}=ho(U,{category:ve,jurisdiction:k,sport:Fe},{skip:I}),{propositions:Le,loading:Pe,error:De}=xo(U,{category:ve,sport:Be,event_id:ge},{skip:I}),{sports:Oe,loading:Te}=go(U,{skip:I}),{createEntry:Ee,loading:je,error:Ye}=wo(U),{preview:He}=Fo(U),Re=i(()=>Ht((I?x:Ae)??[],{category:ve,sport:Fe??Ce,sportBaseKey:A}),[I,x,Ae,ve,Fe,Ce,A]),Ge=j??Me??null,{maxPayouts:We,refetchGame:Ie}=bo(U,Re??[],{skip:I,betAmount:20}),Ue=I?b??zo:We,Ke=I?g:Le,Ze=N?(Ke??[]).filter(e=>e.sport===N):Ke,$e=i(()=>Nt(Ze??[]),[Ze]),qe=i(()=>ve||(1===$e.length?$e[0]:void 0),[ve,$e]),Ve=i(()=>{const e=Ze??[];return qe?Tt(e,{category:qe,sportBaseKey:A}):e},[Ze,qe,A]),Xe=i(()=>Ce?Tt(Ve,{sport:Ce,sportBaseKey:A}):Ve,[Ve,Ce,A]),Qe=i(()=>({category:qe,sport:Ce,sportBaseKey:A}),[qe,Ce,A]),Je=i(()=>{const e=(Re??[]).filter(e=>e.active);if(!qe&&$e.length>1)return[];const t=qe?Ht(e,Qe):e;return qe||Ce?function(e,t,n){return n?.category||n?.sport?e.filter(e=>Yt(e,t,n)):e}(t,Xe,Qe):t},[Re,Xe,Qe,qe,Ce,$e.length]),{step:_e,selectedGame:et,selections:tt,placedEntry:nt,setGameOnly:ot,clearSelectedGame:rt,goToSportSelection:lt,goToConfirmation:at,goToSuccess:it,goBack:st,reset:ct,toggleSelection:dt}=ko(v),ut=e.useCallback(()=>{ke.current=!0,we(void 0),ct(),T?.()},[ct,T]),mt=!!ge,pt=mt?C:void 0,ft=!I&&(et?Se||Pe||Te:Se),ht=I?null:et?ze||De:ze,xt=i(()=>et?Rt(Xe,et,A):Xe,[et,Xe,A]),gt=i(()=>et?xt:Ve,[et,xt,Ve]),bt=i(()=>Tt(et?xt:Ve,{category:qe}),[et,xt,Ve,qe]),kt=i(()=>{const e=new Set(bt.map(e=>e.sport).filter(Boolean));return Oe.filter(t=>e.has(t.key))},[Oe,bt]),vt=i(()=>Tt(xt,{category:qe,sport:pe}),[xt,qe,pe]),Ft=i(()=>{if(!et||!bn(et))return[];const{min:e}=Ct(et,ne),t=ne??e;return kn(vt).filter(e=>e.propositionCount>=t)},[et,ne,vt]),At=i(()=>bn(et)?Cn(vt,he):vt,[et,vt,he]),Mt=Object.keys(tt).map(Number),Dt=Mt.length,Ot=i(()=>vt.filter(e=>Mt.includes(e.id)),[vt,Mt]);l(()=>{w||ue||1===$e.length&&me($e[0])},[w,ue,$e]),l(()=>{if(!et)return;const e=xt,t=new Set(e.map(wt));let n=ue;n&&t.has(n)||(n=1===t.size?Array.from(t)[0]:null,n!==ue&&me(n));const o=n?e.filter(e=>wt(e)===n):e,r=new Set(function(e){const t=/* @__PURE__ */new Set;for(const n of e){const o=yt(n,e);"Other"!==o&&t.add(o)}return[...t]}(o)),l=et.allowed_sports;fe(e=>e&&r.has(e)?e:1===l?.length&&r.has(l[0])?l[0]:l&&l.length>1?e&&l.includes(e)&&r.has(e)?e:null:1===r.size?Array.from(r)[0]:null)},[et?.id,xt,ue]),l(()=>{et&&qe&&(Et(et,qe)||rt())},[et,qe,rt]),l(()=>{et&&(Yt(et,Xe,{category:qe,sport:pe,sportBaseKey:A})||rt())},[et,qe,pe,A,Xe,rt]),l(()=>{if(et){if(V(0),de.current){const{count:e}=de.current;return de.current=null,oe(e),void Z(e)}if(et.allowed_propositions&&et.allowed_propositions.length>0){const e=ne;null!=e&&et.allowed_propositions.includes(e)?Z(e):(oe(void 0),Z(0))}else oe(void 0),Z(et.num_propositions||et.max_propositions||0)}},[et]);const jt=(e,t,n)=>{const o=(Ue[e]?.top_payouts??[]).find(e=>e.proposition_count===t);if(!o)return 0;const r=o.bet_amount&&o.bet_amount>0?o.bet_amount:20;return r<=0?0:o.net_payout/r*n};l(()=>{if("sport"!==_e&&"confirm"!==_e||!et||I)return;const e=bn(et)&&he?At.length:Number.MAX_SAFE_INTEGER;let t;if(et.allowed_propositions&&et.allowed_propositions.length>0){const n=et.allowed_propositions?[...et.allowed_propositions].filter(t=>t<=e).sort((e,t)=>e-t):[];if(0===n.length)return void te({});const o=ne??n[0],r=n.filter(e=>e>o);if(0===r.length)return void te({});t=[o,...r]}else{const{min:n,max:o}=Ct(et),r=Math.min(o,e);if(n<=0||r<=n)return void te({});t=Array.from({length:r-n+1},(e,t)=>n+t)}const n={};for(const o of t)n[o]=jt(et.id,o,20);te(n)},[_e,et,ne,he,At.length,I,Ue]),l(()=>{if("confirm"!==_e||!et)return;const e=Mt.length;if(0===e)return;let t=!1;const n={};for(let r=0;r<=e;r++)n[r]=jt(et.id,r,q);_(n),e!==$.current?($.current=e,Z(e)):(K>e||K<=0&&e>0)&&Z(e);const o=q>0?q:Math.max(et.min_bet??20,.01);return(async()=>{try{const n=await He(et.id,{actual:K,predicted:K,total:e,bet_amount:o});if(t)return;Q(n.winning_counts)}catch{t||Q([])}})(),()=>{t=!0}},[_e,et,Mt.length,K,q,He,Ue]);const Gt=i(()=>{return t=re,(e=et)&&null!=t?e.permitted_rules?.find(e=>e.id===t)??null:null;var e,t},[et,re]),Wt=!bn(et)||An(Ot,he),It=et?Ct(et,void 0,Gt):null,Ut=!(!et||!Wt)&&(et.allowed_propositions&&et.allowed_propositions.length>0?null!=ne&&Dt===ne&&Bt(Dt,It?.min,It?.max):Bt(Dt,It?.min,It?.max)),Kt=et?.min_bet??0,Zt=Math.max(Kt,.01),$t=null==ae||q<=ae,qt=!je&&q>=Zt&&Ut&&$t,Vt=e=>{oe(e),Z(e);for(const t of Object.keys(tt))dt(Number(t),tt[Number(t)])},Xt=e=>{oe(e),Z(e)},Qt=e=>{xe(bn(e)?B??null:null),ot(e)},Jt=e=>{if(e!==he){for(const e of Object.keys(tt)){const t=Number(e);dt(t,tt[t])}xe(e)}},_t=(e,t)=>{de.current={count:t},ot(e),Ie(e.id);const n=e.allowed_sports??[];let o=null;pe&&n.some(e=>Pt(pe,e,A))?o=pe:1===n.length&&(o=n[0]),fe(o);for(const i of Object.keys(tt)){const e=Number(i);dt(e,tt[e])}let r=Tt(Rt(Ze??[],e,A),{category:qe,sport:o,sportBaseKey:A});const l=Math.max(0,Math.min(t,r.length)),a=[...r].sort(()=>Math.random()-.5).slice(0,l);for(const i of a)dt(i.id,Math.random()<.5?"yes":"no");at()},en=async()=>{if(et&&Ut){if(I){const e={id:Math.floor(1e4*Math.random()),game_id:et.id,user_id:d,proposition_ids:Mt,selections:tt,pending:!0,expected_correct:K,bet_amount:q};return z?.(e),it(e),void ce()}try{L&&await L(q);const e=await Ee({game_id:et.id,user_id:d,proposition_ids:Mt,selections:tt,stake:q,rule_id:Gt?.id??null});z?.(e),it(e),ce()}catch(e){}}},tn=o(e=>Y?.[e]??kt.find(t=>t.key===e)?.label??St(e,void 0,A),[Y,kt,A]),nn=o(e=>zt(e,H),[H]),on=i(()=>({theme:R,bodyFont:G,headingFont:W,games:Je,propositions:At,propositionsForCategoryPicker:gt,propositionsForSportPicker:bt,sportSummaries:kt,loading:ft,error:ht,step:_e,selectedGame:et,selections:tt,placedEntry:nt,selectedPropositionIds:Mt,selectedPropositions:Ot,selectionValid:Ut,selectedRuleId:re,setSelectedRuleId:le,selectedRule:Gt,answeredCount:Dt,betAmount:q,setBetAmount:V,expectedCorrect:K,setExpectedCorrect:Z,selectedPropositionCount:ne,handlePropositionCountChange:Vt,upgradePropositionCount:Xt,winningCounts:X,payouts:J,overloadPayouts:ee,submitting:je,submitError:Ye,canSubmit:qt,gamePrice:Kt,userBalance:ae,hasSufficientBalance:$t,refreshUserBalance:ce,handleSubmit:en,selectGame:Qt,goToSportSelection:()=>lt(),goToConfirmation:at,goBack:st,reset:ct,clearSelectedGame:rt,toggleSelection:dt,quickPickGame:_t,selectedCategory:ue,setSelectedCategory:me,selectedSport:pe,setSelectedSport:fe,selectedEventId:he,sameGameMultiEvents:Ft,selectSameGameMultiEvent:Jt,apiUrl:t,apiKey:n,fetchImpl:r,getAuthHeaders:a,userId:d,disableQuickPick:M,renderTeamLogo:S,filterSport:N,initialSport:F,initialEventId:B,sportBaseKey:A,gameCategory:w,eventFilterActive:mt,eventFilterLabel:pt,clearEventFilter:ut,screenSize:E,displaySportName:tn,displayCategoryName:nn,maxPayouts:Ue??{},howToPlayMarkdown:Ge,onEntryPlaced:z,onCancel:P,onShare:D,onRecharge:O,demoEntries:y,demoGames:x,demoPropositions:g}),[R,G,W,Je,At,gt,bt,kt,ft,ht,_e,et,tt,nt,Mt,Ot,Ut,Dt,q,K,ne,re,Gt,X,J,ee,je,Ye,qt,Kt,t,n,d,ae,r,a,M,S,N,F,B,A,w,E,mt,pt,ut,ue,pe,he,Ft,Ue,Ge,z,P,D,O,T,y,x,g,tn,nn]);/* @__PURE__ */
|
|
97
|
+
return u(So.Provider,{value:on,children:p})}function Do({onPress:t,onDoubleClick:n,label:o="QUICKPICK",size:l="md",yesColor:a,noColor:i,theme:s}){const c=r(So),d=s??c?.theme??Z,p=fe(d),f=d.colors,h=a??O(d),x=i??T(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),[F,B]=e.useState(!1);/* @__PURE__ */
|
|
97
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")&&B(!0)},onBlur:()=>B(!1),style:{appearance:"none",display:"inline-flex",flexDirection:"column",width:"100%",minWidth:92,padding:0,margin:0,border:`1px solid ${ce(f.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:F?ge(d):"none",outline:"none",minHeight:p.touchTarget.min},children:[/* @__PURE__ */m("span",{style:{position:"relative",display:"flex",flex:1},children:[
|
|
98
99
|
/* @__PURE__ */u("span",{"aria-hidden":!0,style:{position:"absolute",inset:0,background:h,clipPath:"polygon(0 0, 53% 0, 47% 100%, 0 100%)"}}),
|
|
99
100
|
/* @__PURE__ */u("span",{"aria-hidden":!0,style:{position:"absolute",inset:0,background:x,clipPath:"polygon(53% 0, 100% 0, 100% 100%, 47% 100%)"}}),
|
|
100
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"}),
|
|
101
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"}),
|
|
102
|
-
/* @__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:f.buttonSecondary,color:f.buttonSecondaryText,fontSize:k,letterSpacing:"0.14em",padding:"3px 0 4px",textAlign:"center",fontWeight:700,fontFamily:d.fonts?.mono??"inherit"},children:o})]})}function
|
|
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:f.buttonSecondary,color:f.buttonSecondaryText,fontSize:k,letterSpacing:"0.14em",padding:"3px 0 4px",textAlign:"center",fontWeight:700,fontFamily:d.fonts?.mono??"inherit"},children:o})]})}function Oo(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 To({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__ */
|
|
103
104
|
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"),
|
|
104
|
-
/* @__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
|
|
105
|
-
/* @__PURE__ */u("span",{className:i,style:{color:n.text},children:e.text})]},t))}):/* @__PURE__ */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:d.map((t,o)=>/* @__PURE__ */m(e.Fragment,{children:[o>0&&/* @__PURE__ */u(
|
|
105
|
+
/* @__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 Eo({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),f=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;f();const e=()=>f();return window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[r,f]),/* @__PURE__ */m("span",{className:"relative inline-flex flex-shrink-0",onMouseEnter:()=>{f(),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:ce(t.primary,.14),border:`1px solid ${ce(t.primary,.45)}`},"aria-label":n,"aria-expanded":r,onClick:e=>{e.stopPropagation(),f(),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??ce(t.primary,.3)}`},children:n})]})}function jo({prop:t,colors:n,size:o="sm",componentById:r}){const l=lt(t,r),a=t.description??t.proposition??"",i="md"===o?"text-sm sm:text-base font-medium":"text-xs sm:text-sm",s=n.textMuted??n.textAltMuted??n.text;if(!l)/* @__PURE__ */return u("span",{className:i,style:{color:n.text},children:a});const{operator:c,legs:d}=l;return d.some(e=>e.eventLabel)?/* @__PURE__ */u("div",{className:"min-w-0 flex-1 flex flex-col gap-2",children:d.map((e,t)=>/* @__PURE__ */m("div",{className:"min-w-0",children:[t>0&&/* @__PURE__ */u("div",{className:"mb-1 flex items-center",children:/* @__PURE__ */u(Eo,{label:c,colors:n})}),e.eventLabel&&/* @__PURE__ */u("div",{className:"text-[10px] sm:text-xs font-semibold uppercase tracking-wide leading-tight break-words",style:{color:s},children:e.eventLabel}),
|
|
106
|
+
/* @__PURE__ */u("span",{className:i,style:{color:n.text},children:e.text})]},t))}):/* @__PURE__ */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:d.map((t,o)=>/* @__PURE__ */m(e.Fragment,{children:[o>0&&/* @__PURE__ */u(Eo,{label:c,colors:n}),/* @__PURE__ */u("span",{className:i,style:{color:n.text},children:t.text})]},o))})})}function Yo({game:t,propositions:n,selections:o,onToggleSelection:a,onNext:p,onBack:f,loading:h,error:x,theme:g,colorScheme:y,hideActions:b=!1,initialSport:w,renderTeamLogo:k,disableQuickPick:v=!1,selectedPropositionCount:N,onPropositionCountChange:F,gameCategory:B,headerExtra:C}){const A=r(So),M=A?.sportBaseKey,S=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(nt(n))for(const e of ot(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}(i(()=>A?.apiUrl?new fo({apiUrl:A.apiUrl,apiKey:A.apiKey,fetchImpl:A.fetchImpl,getAuthHeaders:A.getAuthHeaders}):null,[A?.apiUrl,A?.apiKey,A?.fetchImpl,A?.getAuthHeaders]),n),z=se(g,y),P=z.colors,D=R(z),O=W(z),T=P.matchupHeader??(t.color?ce(t.color,.14):G(z)),E=P.textAlt??P.text,j=he(z),Y=ye(z);be(z),L(z);const H=!!(t.allowed_propositions&&t.allowed_propositions.length>0),{min:U,max:K}=Ct(t,N),Z=U,$=K,[q,V]=e.useState(()=>new Set(Object.keys(Ut(n,B,M)))),X=Z>0&&Z===$,Q=Z||1,J=$||n.length,_=$||Z||n.length,[ee,te]=e.useState(_),ne=Object.keys(o).length,oe=$>0&&ne>=$,re=H?null!=N&&ne===N:Bt(ne,t.min_propositions,t.max_propositions);t.min_bet,$>0?Math.max(2,2*$):Math.max(2,2*ne);const le=e.useRef(ne),ae=H?null!=N&&ne===N:$>0&&ne===$;l(()=>{ae&&ne>le.current&&p?.(),le.current=ne},[ne,ae]);const ie=(e,t)=>{!(e in o)&&oe||a(e,t)};l(()=>{const e=$||n.length,t=Z||1;te(n=>X?$:Math.max(t,Math.min(n,e)))},[n.length,Z,$,X]);const de=i(()=>/* @__PURE__ */new Date,[]),ue=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 Co){let e=0,l=0;for(const o of n)if(Mo(o.commence_time,r,t)?e+=1:l+=1,e>0&&l>0)break;e>0&&l>0&&o.push({id:r,label:Bo[r]})}return o}(n,de),[n,de]),[me,pe]=c(null);l(()=>{me&&!ue.some(e=>e.id===me)&&pe(null)},[ue,me]);const fe=i(()=>function(e,t,n){return t?e.filter(e=>Mo(e.commence_time,t,n)):e.slice()}(n,me,de),[n,me,de]),xe=i(()=>Ut(fe,B,M),[fe,B,M]),ge=i(()=>{const e=/* @__PURE__ */new Set;for(const t of fe){const n=_e(t);n&&e.add(n)}return Array.from(e).sort((e,t)=>e.localeCompare(t))},[fe]),[we,ke]=c(null),[ve,Ne]=c(!1);l(()=>{we&&!ge.includes(we)&&ke(null)},[ge,we]);const Fe=i(()=>{if(!we)return xe;const e={};for(const[t,n]of Object.entries(xe)){const o=n.filter(e=>_e(e)===we);o.length>0&&(e[t]=o)}return e},[xe,we]),Be=Object.keys(Fe);if(e.useEffect(()=>{const e=Object.keys(Fe);e.length>0&&V(t=>e.every(e=>t.has(e))?t:new Set(e))},[Fe]),h)/* @__PURE__ */return u(xn,{colors:I(z),bodyFont:Y,variant:"propositions"});if(x)/* @__PURE__ */return u("div",{className:"flex items-center justify-center p-8",style:{fontFamily:Y},children:/* @__PURE__ */u("div",{style:{color:P.error},children:x})});const Ce=!v&&n.length>0,Ae=ue.length>0||ge.length>1,Me=(null!=me?1:0)+(null!=we?1:0);/* @__PURE__ */
|
|
106
107
|
return m("div",{className:"space-y-4 sm:space-y-6 pb-16",style:{fontFamily:Y},children:[(Ae||C)&&/* @__PURE__ */m("div",{className:"flex items-center justify-between gap-2",children:[/* @__PURE__ */u("div",{className:"flex items-center gap-2",children:Ae&&/* @__PURE__ */m(d,{children:[/* @__PURE__ */m("button",{type:"button",onClick:()=>Ne(e=>!e),"aria-expanded":ve,className:"inline-flex items-center gap-1.5 rounded-full px-3 py-1.5 text-[11px] font-bold transition-colors",style:{fontFamily:Y,border:`1px solid ${Me>0?P.primary:P.border}`,backgroundColor:Me>0?P.primary:P.background??"#fff",color:Me>0?P.primaryText:P.text,cursor:"pointer"},children:[
|
|
107
108
|
/* @__PURE__ */u(qe,{size:13}),"Filter",Me>0&&/* @__PURE__ */m("span",{children:["· ",Me]}),
|
|
108
|
-
/* @__PURE__ */u("span",{className:"inline-flex transition-transform",style:{transform:`rotate(${ve?-90:90}deg)`,opacity:.75},children:/* @__PURE__ */u(Ve,{size:13})})]}),Me>0&&/* @__PURE__ */u("button",{type:"button",onClick:()=>{pe(null),ke(null)},className:"text-[11px] font-semibold",style:{color:P.textMuted,cursor:"pointer"},children:"Clear"})]})}),C]}),ve&&Ae&&/* @__PURE__ */m("div",{className:"space-y-2.5",children:[ue.length>0&&/* @__PURE__ */u(Je,{label:"When",options:[{value:null,label:"All dates"},...ue.map(e=>({value:e.id,label:e.label}))],value:me,onChange:e=>pe(e),theme:z,bodyFont:Y}),ge.length>1&&/* @__PURE__ */u(Je,{label:"Market",options:[{value:null,label:"All markets"},...ge.map(e=>{return{value:e,label:(t=e,t.replace(/[_-]+/g," ").replace(/\b\w/g,e=>e.toUpperCase()))};var t})],value:we,onChange:ke,theme:z,bodyFont:Y})]}),Ce&&/* @__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:[!X&&/* @__PURE__ */m("div",{className:"flex items-center gap-1",children:[/* @__PURE__ */u("input",{type:"number",min:Q,max:J,value:ee,onChange:e=>{const t=parseInt(e.target.value,10);isNaN(t)||te(Math.max(Q,Math.min(J,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:E,backgroundColor:P.backgroundAlt,border:`2px solid ${P.border}`}}),/* @__PURE__ */m("span",{className:"text-xs whitespace-nowrap",style:{color:P.textMuted},children:["/ ",n.length]})]}),/* @__PURE__ */u(
|
|
109
|
-
return m("div",{className:"transition-colors divide-y",style:{opacity:a?.45:1,borderColor:P.border},children:[/* @__PURE__ */m("div",{className:"px-4 py-2.5 sm:py-3 min-w-0",style:{backgroundColor:T},children:[/* @__PURE__ */u("div",{className:"min-w-0",children:/* @__PURE__ */u(
|
|
110
|
-
return m("div",{className:"rounded-xl border overflow-hidden",style:{borderColor:P.border,backgroundColor:D,boxShadow:j},children:[/* @__PURE__ */m("button",{type:"button",onClick:()=>{return t=e,V(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:T,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:P.textAltMuted??P.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(
|
|
111
|
-
return u("div",{className:"px-4 py-3 sm:py-3.5 transition-colors",style:{backgroundColor:O,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:[
|
|
109
|
+
/* @__PURE__ */u("span",{className:"inline-flex transition-transform",style:{transform:`rotate(${ve?-90:90}deg)`,opacity:.75},children:/* @__PURE__ */u(Ve,{size:13})})]}),Me>0&&/* @__PURE__ */u("button",{type:"button",onClick:()=>{pe(null),ke(null)},className:"text-[11px] font-semibold",style:{color:P.textMuted,cursor:"pointer"},children:"Clear"})]})}),C]}),ve&&Ae&&/* @__PURE__ */m("div",{className:"space-y-2.5",children:[ue.length>0&&/* @__PURE__ */u(Je,{label:"When",options:[{value:null,label:"All dates"},...ue.map(e=>({value:e.id,label:e.label}))],value:me,onChange:e=>pe(e),theme:z,bodyFont:Y}),ge.length>1&&/* @__PURE__ */u(Je,{label:"Market",options:[{value:null,label:"All markets"},...ge.map(e=>{return{value:e,label:(t=e,t.replace(/[_-]+/g," ").replace(/\b\w/g,e=>e.toUpperCase()))};var t})],value:we,onChange:ke,theme:z,bodyFont:Y})]}),Ce&&/* @__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:[!X&&/* @__PURE__ */m("div",{className:"flex items-center gap-1",children:[/* @__PURE__ */u("input",{type:"number",min:Q,max:J,value:ee,onChange:e=>{const t=parseInt(e.target.value,10);isNaN(t)||te(Math.max(Q,Math.min(J,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:E,backgroundColor:P.backgroundAlt,border:`2px solid ${P.border}`}}),/* @__PURE__ */m("span",{className:"text-xs whitespace-nowrap",style:{color:P.textMuted},children:["/ ",n.length]})]}),/* @__PURE__ */u(Do,{onPress:()=>{const e=X?$:ee;for(const n of Object.keys(o)){const e=Number(n);a(e,o[e])}const{yesPicks:t,noPicks:r}=$t(n,e);for(const n of t)a(n.id,"yes");for(const n of r)a(n.id,"no");p?.()}})]})}),n.length>0&&/* @__PURE__ */u("div",{className:"space-y-4",children:Be.every(e=>1===Fe[e].length)?/* @__PURE__ */u("div",{className:"rounded-xl border overflow-hidden divide-y",style:{borderColor:P.border,backgroundColor:D,boxShadow:j},children:Be.map(e=>{const t=Fe[e][0],n="yes"===o[t.id],r="no"===o[t.id],l=t.id in o,a=oe&&!l;/* @__PURE__ */
|
|
110
|
+
return m("div",{className:"transition-colors divide-y",style:{opacity:a?.45:1,borderColor:P.border},children:[/* @__PURE__ */m("div",{className:"px-4 py-2.5 sm:py-3 min-w-0",style:{backgroundColor:T},children:[/* @__PURE__ */u("div",{className:"min-w-0",children:/* @__PURE__ */u(To,{matchup:e,renderTeamLogo:k,altText:E,mutedColor:P.textAltMuted??P.textMuted??E})}),t.commence_time&&/* @__PURE__ */u("span",{className:"text-[11px] block mt-0.5",style:{color:P.textAltMuted??P.textMuted,opacity:.7},children:xt(t.commence_time)})]}),/* @__PURE__ */m("div",{className:"flex items-center justify-between gap-3 px-4 py-3 sm:py-3.5",style:{backgroundColor:O},children:[/* @__PURE__ */m("div",{className:"min-w-0 flex-1 flex items-start gap-2",children:[Oo(t,k,e),/* @__PURE__ */u(jo,{prop:t,colors:P,componentById:S})]}),/* @__PURE__ */u(Re,{theme:z,size:"sm",value:n?"yes":r?"no":null,onYes:()=>ie(t.id,"yes"),onNo:()=>ie(t.id,"no"),disabled:a})]})]},t.id)})}):Be.map(e=>{const t=Fe[e],n=q.has(e),r=t.filter(e=>e.id in o).length,l=t[0]?.commence_time;/* @__PURE__ */
|
|
111
|
+
return m("div",{className:"rounded-xl border overflow-hidden",style:{borderColor:P.border,backgroundColor:D,boxShadow:j},children:[/* @__PURE__ */m("button",{type:"button",onClick:()=>{return t=e,V(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:T,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:P.textAltMuted??P.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(To,{matchup:e,renderTeamLogo:k,altText:E,mutedColor:P.textAltMuted??P.textMuted??E,size:"md"}),l&&/* @__PURE__ */u("p",{className:"text-xs mt-0.5 text-left",style:{color:P.textAltMuted??P.textMuted,opacity:.7},children:xt(l)})]})]}),/* @__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?P.successText:P.textMuted,backgroundColor:r>0?P.successBg:P.backgroundAlt},children:[r,"/",t.length]})})]}),n&&/* @__PURE__ */u("div",{className:"divide-y",style:{borderColor:P.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=oe&&!l;/* @__PURE__ */
|
|
112
|
+
return u("div",{className:"px-4 py-3 sm:py-3.5 transition-colors",style:{backgroundColor:O,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:[Oo(t,k,e),/* @__PURE__ */u(jo,{prop:t,colors:P,size:"md",componentById:S})]}),/* @__PURE__ */u(Re,{theme:z,size:"sm",value:n?"yes":r?"no":null,onYes:()=>ie(t.id,"yes"),onNo:()=>ie(t.id,"no"),disabled:a})]})},t.id)})})})]},e)})}),0===n.length&&/* @__PURE__ */u("div",{className:"text-center p-8",style:{color:P.textMuted},children:"No propositions available at this time"}),!b&&/* @__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:P.border,backgroundColor:D},children:[/* @__PURE__ */u(je,{theme:z,variant:"secondary",onPress:f,children:"Back"}),/* @__PURE__ */u("div",{className:"flex items-center gap-2 sm:gap-3",children:/* @__PURE__ */u(je,{theme:z,variant:"primary",disabled:!re,onPress:p,children:"Wager"})})]})]})}function Ho({propositions:e,selections:t,onToggleSelection:n,onNext:o,onBack:r,theme:l,colorScheme:a,hideActions:i=!1,renderTeamLogo:s,allowAnswerToggle:p=!0,gameName:f,potentialPayout:h,defaultExpanded:x=!1,addMorePicks:g}){const y=se(l,a),b=y.colors,w=R(y),k=ye(y),v=be(y),N=L(y),F=b.textAlt??b.text,B=b.matchupHeader??G(y),C=W(y),[A,M]=c(null),[S,z]=c(x),P=e.filter(e=>e.id in t),D=P.length,O=Kt(P);/* @__PURE__ */
|
|
112
113
|
return m("div",{className:"space-y-4 sm:space-y-6 pb-16",style:{fontFamily:k},children:[
|
|
113
114
|
/* @__PURE__ */m("div",{className:"p-4 sm:p-6 rounded-xl border",style:{backgroundColor:w,borderColor:b.border,boxShadow:he(y)},children:[
|
|
114
|
-
/* @__PURE__ */m("button",{type:"button",onClick:()=>z(e=>!e),"aria-expanded":S,"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:b.textMuted,flexShrink:0,transform:S?"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:N,fontFamily:v},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:b.primaryText,backgroundColor:b.primary},children:D})]}),f&&/* @__PURE__ */u("p",{className:"text-sm mt-0.5 truncate",style:{color:b.textMuted},children:f})]})]}),null!=h&&h>0&&/* @__PURE__ */m("div",{className:"text-right flex-shrink-0",children:[/* @__PURE__ */u("span",{className:"text-[10px] uppercase tracking-wide block",style:{color:b.textMuted},children:"Potential Payout"}),/* @__PURE__ */u("span",{className:"text-sm font-bold",style:{color:N},children:
|
|
115
|
+
/* @__PURE__ */m("button",{type:"button",onClick:()=>z(e=>!e),"aria-expanded":S,"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:b.textMuted,flexShrink:0,transform:S?"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:N,fontFamily:v},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:b.primaryText,backgroundColor:b.primary},children:D})]}),f&&/* @__PURE__ */u("p",{className:"text-sm mt-0.5 truncate",style:{color:b.textMuted},children:f})]})]}),null!=h&&h>0&&/* @__PURE__ */m("div",{className:"text-right flex-shrink-0",children:[/* @__PURE__ */u("span",{className:"text-[10px] uppercase tracking-wide block",style:{color:b.textMuted},children:"Potential Payout"}),/* @__PURE__ */u("span",{className:"text-sm font-bold",style:{color:N},children:ht(h)})]})]}),g&&g.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:`${b.primary}08`,borderColor:`${b.primary}30`},children:[/* @__PURE__ */m("p",{className:"text-xs",style:{color:b.textMuted},children:[1===g.remaining?"Add ":"Add up to ",
|
|
115
116
|
/* @__PURE__ */m("span",{style:{color:b.primary,fontWeight:700},children:[g.remaining," more pick",1!==g.remaining?"s":""]}),null!=g.potentialPayout&&g.potentialPayout>0&&/* @__PURE__ */m(d,{children:[" ","to win up to"," ",
|
|
116
|
-
/* @__PURE__ */u("span",{style:{color:N,fontWeight:700},children:
|
|
117
|
-
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:C,borderTop:e.key||l>0?`1px solid ${b.border}`:void 0},children:[/* @__PURE__ */m("div",{className:"min-w-0 flex-1 flex items-start gap-2",children:[
|
|
118
|
-
/* @__PURE__ */u("div",{className:"p-4 sm:p-6 rounded-xl border",style:{backgroundColor:w,borderColor:b.border,boxShadow:he(y)},children:/* @__PURE__ */m("div",{className:"flex justify-between text-sm",children:[/* @__PURE__ */u("span",{style:{color:b.textMuted},children:"Total Selections"}),/* @__PURE__ */u("span",{className:"font-semibold",style:{color:b.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:b.border,backgroundColor:b.background},children:[/* @__PURE__ */u(je,{theme:y,variant:"secondary",onPress:r,children:"Back"}),/* @__PURE__ */u(je,{theme:y,variant:"primary",disabled:0===P.length,onPress:o,children:"Place bet"})]})]})}function
|
|
117
|
+
/* @__PURE__ */u("span",{style:{color:N,fontWeight:700},children:ht(g.potentialPayout)})," ","with ",g.max," picks"]})]}),/* @__PURE__ */u("button",{type:"button",onClick:e=>{e.stopPropagation(),g.onAdd()},className:"flex-shrink-0 px-3 py-1.5 rounded-lg text-xs font-semibold transition-colors",style:{color:b.buttonPrimaryText,backgroundColor:b.buttonPrimary,cursor:"pointer"},children:"Add picks"})]}),S&&(0===P.length?/* @__PURE__ */u("div",{className:"text-center py-8 mt-3 sm:mt-4",style:{color:b.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:O.map(e=>/* @__PURE__ */m("div",{className:"rounded-lg overflow-hidden border",style:{borderColor:b.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(To,{matchup:e.key,renderTeamLogo:s,altText:F,mutedColor:b.textAltMuted??b.textMuted??F}),e.props[0].commence_time&&/* @__PURE__ */u("span",{className:"text-[11px] block mt-0.5",style:{color:b.textAltMuted??b.textMuted,opacity:.7},children:xt(e.props[0].commence_time)})]}),e.props.map((o,l)=>{const a=t[o.id],i="yes"===a,c="no"===a;/* @__PURE__ */
|
|
118
|
+
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:C,borderTop:e.key||l>0?`1px solid ${b.border}`:void 0},children:[/* @__PURE__ */m("div",{className:"min-w-0 flex-1 flex items-start gap-2",children:[Oo(o,s,e.key),/* @__PURE__ */u("p",{className:"text-sm leading-snug break-words",style:{color:F},children:o.description})]}),/* @__PURE__ */m("div",{className:"flex items-center gap-1.5 flex-shrink-0 sm:gap-2",children:[p?/* @__PURE__ */u(Re,{theme:y,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:y,value:"yes"===a?"yes":"no",size:"sm"}),/* @__PURE__ */u("button",{type:"button",onClick:e=>{e.stopPropagation(),n(o.id,t[o.id]),r()},onMouseEnter:()=>M(o.id),onMouseLeave:()=>M(null),className:"w-6 h-6 flex-shrink-0 flex items-center justify-center rounded-full transition-colors",style:{color:A===o.id?b.error:b.textAltMuted??b.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}`))}))]}),
|
|
119
|
+
/* @__PURE__ */u("div",{className:"p-4 sm:p-6 rounded-xl border",style:{backgroundColor:w,borderColor:b.border,boxShadow:he(y)},children:/* @__PURE__ */m("div",{className:"flex justify-between text-sm",children:[/* @__PURE__ */u("span",{style:{color:b.textMuted},children:"Total Selections"}),/* @__PURE__ */u("span",{className:"font-semibold",style:{color:b.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:b.border,backgroundColor:b.background},children:[/* @__PURE__ */u(je,{theme:y,variant:"secondary",onPress:r,children:"Back"}),/* @__PURE__ */u(je,{theme:y,variant:"primary",disabled:0===P.length,onPress:o,children:"Place bet"})]})]})}function Ro({game:t,propositions:n,selections:o,onToggleSelection:r,onRemoveSelection:l,onSubmit:a,onBack:i,loading:s,error:p,expectedCorrect:f,onExpectedCorrectChange:h,betAmount:x,onBetAmountChange:g,theme:y,colorScheme:b,hideActions:w=!1,winningCounts:k,payouts:v,renderTeamLogo:N,showCustomAmount:F=!1,betAmountLocked:B=!1,betAmountLockedNote:C,canSubmit:A,authenticated:M=!0,userBalance:S,onRecharge:z,boostBanner:O}){const T=se(y,b),E=T.colors,j=R(T),Y=ye(T),H=be(T),I=L(T),U=P(T),K=D(T),Z=E.textAlt??E.text,$=n.length,q=t.min_bet??0,V=Math.max(q,.01),X=t.max_bet??null,Q=[5,10,20,50,100,200,500].filter(e=>e>=V&&(null===X||e<=X)).slice(0,4),J={};for(let e=0;e<=$;e++)J[e]=x*e;const _=v??J,ee=_[f]??0,te=At(t),ne=te.enabled&&f===$,[oe,re]=c(null),[le,ae]=c(!0),ie=s||x<V||!1===A,ce=null!=S&&x>S,de=w&&!!a&&M,ue=o?n.filter(e=>e.id in o):n,me=Kt(ue),pe=E.matchupHeader??G(T),fe=W(T),xe=Object.entries(_).map(([e,t])=>({correct:Number(e),payout:t})).filter(e=>e.correct>0&&e.payout>0).sort((e,t)=>e.correct-t.correct),ge=1===xe.length?xe[0].correct:null;return e.useEffect(()=>{null!==ge&&f!==ge&&h(ge)},[ge]),/* @__PURE__ */m("div",{className:"space-y-3 sm:space-y-4 pb-16",style:{fontFamily:Y},children:[
|
|
119
120
|
/* @__PURE__ */m("div",{className:"p-4 sm:p-5 rounded-xl border",style:{backgroundColor:j,borderColor:E.border,boxShadow:he(T)},children:[
|
|
120
|
-
/* @__PURE__ */m("div",{className:"flex items-center justify-between gap-3",children:[/* @__PURE__ */m("button",{type:"button",onClick:()=>ae(e=>!e),"aria-expanded":le,"aria-controls":"entry-submission-selections","aria-label":le?"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:E.textMuted,flexShrink:0,transform:le?"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:I,fontFamily:H},children:le?"Hide Selections":"Review Selections"})]}),/* @__PURE__ */m("span",{className:"text-xs font-semibold px-2 py-0.5 rounded-full flex-shrink-0",style:{color:E.primary,backgroundColor:`${E.primary}15`},children:[ue.length," pick",1!==ue.length?"s":""]})]}),!le&&/* @__PURE__ */u("p",{className:"text-xs mt-2",style:{color:E.textMuted},children:"Tap to show your picks"}),le&&/* @__PURE__ */u("div",{id:"entry-submission-selections",className:"space-y-2 mt-3",children:me.map(e=>/* @__PURE__ */m("div",{className:"rounded-lg overflow-hidden border",style:{borderColor:E.border},children:[e.key&&/* @__PURE__ */m("div",{className:"px-3 py-2 min-w-0",style:{backgroundColor:pe},children:[/* @__PURE__ */u(
|
|
121
|
-
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 ${E.border}`:void 0},children:[/* @__PURE__ */m("div",{className:"min-w-0 flex-1 flex items-start gap-2",children:[
|
|
122
|
-
/* @__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:I,fontFamily:H},children:"How much are you betting?"}),null!=S&&/* @__PURE__ */m("span",{className:"text-xs font-semibold",style:{color:E.textMuted},children:["Balance: ",/* @__PURE__ */u("span",{style:{color:ce?E.error:E.success},children:
|
|
121
|
+
/* @__PURE__ */m("div",{className:"flex items-center justify-between gap-3",children:[/* @__PURE__ */m("button",{type:"button",onClick:()=>ae(e=>!e),"aria-expanded":le,"aria-controls":"entry-submission-selections","aria-label":le?"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:E.textMuted,flexShrink:0,transform:le?"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:I,fontFamily:H},children:le?"Hide Selections":"Review Selections"})]}),/* @__PURE__ */m("span",{className:"text-xs font-semibold px-2 py-0.5 rounded-full flex-shrink-0",style:{color:E.primary,backgroundColor:`${E.primary}15`},children:[ue.length," pick",1!==ue.length?"s":""]})]}),!le&&/* @__PURE__ */u("p",{className:"text-xs mt-2",style:{color:E.textMuted},children:"Tap to show your picks"}),le&&/* @__PURE__ */u("div",{id:"entry-submission-selections",className:"space-y-2 mt-3",children:me.map(e=>/* @__PURE__ */m("div",{className:"rounded-lg overflow-hidden border",style:{borderColor:E.border},children:[e.key&&/* @__PURE__ */m("div",{className:"px-3 py-2 min-w-0",style:{backgroundColor:pe},children:[/* @__PURE__ */u(To,{matchup:e.key,renderTeamLogo:N,altText:Z,mutedColor:E.textAltMuted??E.textMuted??Z}),e.props[0].commence_time&&/* @__PURE__ */u("span",{className:"text-[11px] block mt-0.5",style:{color:E.textAltMuted??E.textMuted,opacity:.7},children:xt(e.props[0].commence_time)})]}),e.props.map((t,n)=>{const a=o?.[t.id],i="yes"===a,s="no"===a,c=!!r;/* @__PURE__ */
|
|
122
|
+
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 ${E.border}`:void 0},children:[/* @__PURE__ */m("div",{className:"min-w-0 flex-1 flex items-start gap-2",children:[Oo(t,N,e.key),/* @__PURE__ */u("p",{className:"text-xs sm:text-sm break-words leading-snug",style:{color:Z},children:t.description})]}),/* @__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,le&&l&&/* @__PURE__ */u("button",{type:"button","aria-label":"Remove selection",onClick:()=>{a&&r?.(t.id,a),l(t.id)},onMouseEnter:()=>re(t.id),onMouseLeave:()=>re(null),className:"flex-shrink-0 flex items-center justify-center rounded-full transition-colors",style:{width:44,height:44,color:oe===t.id?"#fff":E.textMuted,backgroundColor:oe===t.id?E.error:"transparent",cursor:"pointer"},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}`))}),O&&/* @__PURE__ */u("div",{className:"mt-2",children:O})]}),de&&/* @__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:E.textMuted},children:[/* @__PURE__ */u("span",{"aria-hidden":!0,children:"↓"}),"Scroll down to set your bet and place your entry"]}),M?/* @__PURE__ */m(d,{children:[/* @__PURE__ */m("div",{className:"p-4 sm:p-6 rounded-xl border",style:{backgroundColor:j,borderColor:E.border,boxShadow:he(T)},children:[
|
|
123
|
+
/* @__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:I,fontFamily:H},children:"How much are you betting?"}),null!=S&&/* @__PURE__ */m("span",{className:"text-xs font-semibold",style:{color:E.textMuted},children:["Balance: ",/* @__PURE__ */u("span",{style:{color:ce?E.error:E.success},children:ht(S)})]})]}),ce&&/* @__PURE__ */m("div",{className:"mb-3 px-3 py-2 rounded-lg flex items-center justify-between gap-3",style:{backgroundColor:E.errorBg??`${E.error}15`,color:E.errorText??E.error},children:[/* @__PURE__ */m("span",{className:"text-xs font-medium",children:["Insufficient balance. Your bet of ",ht(x)," exceeds your available ",ht(S),"."]}),z&&/* @__PURE__ */u("button",{type:"button",onClick:z,className:"text-xs font-semibold px-3 py-1 rounded-md whitespace-nowrap",style:{backgroundColor:E.error,color:E.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:E.backgroundAlt,border:`1px solid ${E.border}`},children:[/* @__PURE__ */u("span",{className:"text-xs",style:{color:E.textMuted},children:C??"Stake is set for this ticket."}),/* @__PURE__ */u("span",{className:"text-lg font-bold tabular-nums",style:{color:I,fontFamily:H},children:ht(x)})]}:{className:"space-y-4",children:[F&&/* @__PURE__ */m("div",{children:[
|
|
123
124
|
/* @__PURE__ */u("p",{className:"text-xs sm:text-sm font-semibold mb-2",style:{color:U},children:"Entry amount"}),
|
|
124
125
|
/* @__PURE__ */m("div",{className:"relative",children:[/* @__PURE__ */u("span",{className:"absolute left-3 top-1/2 -translate-y-1/2",style:{color:E.textMuted},children:"$"}),/* @__PURE__ */u("input",{type:"number",inputMode:"decimal",min:V,max:X??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!==X?Math.min(n,X):n)},onFocus:e=>{e.currentTarget.style.borderColor=E.borderFocus??E.primary},onBlur:e=>{e.currentTarget.style.borderColor=E.border},className:"w-full pl-8 pr-4 py-3 border rounded-lg focus:outline-none text-lg font-semibold tabular-nums",style:{borderColor:E.border,color:Z,backgroundColor:E.backgroundAlt,fontFamily:Y,transition:"border-color .15s ease"}})]}),
|
|
125
|
-
/* @__PURE__ */m("p",{className:"text-xs mt-1.5",style:{color:E.textMuted},children:["Minimum bet: ",
|
|
126
|
-
return m("button",{type:"button",onClick:()=>{const t=x+e;g(null!==X?Math.min(t,X):t)},disabled:t,className:"px-3 py-2.5 rounded-lg text-sm font-semibold transition-colors min-w-0",style:{color:Z,backgroundColor:"transparent",border:`1px solid ${E.border}`,cursor:t?"not-allowed":"pointer",opacity:t?.5:1},children:["+",
|
|
127
|
-
/* @__PURE__ */m("div",{className:"flex justify-between items-center text-sm mb-1",children:[/* @__PURE__ */u("span",{style:{color:U},children:"Bet"}),/* @__PURE__ */u("span",{className:"font-semibold",style:{color:K},children:
|
|
126
|
+
/* @__PURE__ */m("p",{className:"text-xs mt-1.5",style:{color:E.textMuted},children:["Minimum bet: ",ht(V),null!==X&&/* @__PURE__ */m(d,{children:[" · Maximum: ",ht(X)]})]}),x>0&&x<V&&/* @__PURE__ */m("p",{className:"text-xs mt-1",style:{color:E.error},children:["Bet amount must be at least ",ht(V)]})]}),/* @__PURE__ */m("div",{children:[(F||x>0)&&/* @__PURE__ */m("div",{className:"flex items-center justify-between mb-2",children:[F?/* @__PURE__ */u("p",{className:"text-xs sm:text-sm font-semibold",style:{color:U},children:"Add to bet"}):/* @__PURE__ */u("span",{}),x>0&&/* @__PURE__ */u("button",{type:"button",onClick:()=>g(0),className:"text-xs font-semibold px-2.5 py-1 rounded-md transition-colors",style:{color:E.textMuted,backgroundColor:E.backgroundAlt,border:`1.5px solid ${E.border}`,cursor:"pointer"},children:"Clear bet"})]}),/* @__PURE__ */u("div",{style:{display:"grid",gridTemplateColumns:`repeat(${Math.max(Q.length,1)}, minmax(0, 1fr))`,gap:8},children:Q.map(e=>{const t=null!==X&&x>=X;/* @__PURE__ */
|
|
127
|
+
return m("button",{type:"button",onClick:()=>{const t=x+e;g(null!==X?Math.min(t,X):t)},disabled:t,className:"px-3 py-2.5 rounded-lg text-sm font-semibold transition-colors min-w-0",style:{color:Z,backgroundColor:"transparent",border:`1px solid ${E.border}`,cursor:t?"not-allowed":"pointer",opacity:t?.5:1},children:["+",ht(e)]},e)})})]})]})]}),/* @__PURE__ */u("div",{className:"p-4 sm:p-5 rounded-xl border",style:{backgroundColor:j,borderColor:E.border,boxShadow:he(T)},children:(()=>{const e=w&&!!a,t=/* @__PURE__ */m(d,{children:[
|
|
128
|
+
/* @__PURE__ */m("div",{className:"flex justify-between items-center text-sm mb-1",children:[/* @__PURE__ */u("span",{style:{color:U},children:"Bet"}),/* @__PURE__ */u("span",{className:"font-semibold",style:{color:K},children:ht(x)})]}),ee>0&&/* @__PURE__ */m("div",{className:"flex flex-wrap gap-x-2 justify-between items-center pt-2 border-t",style:{borderColor:E.border},children:[/* @__PURE__ */u("span",{className:"font-semibold text-sm",style:{color:U},children:"Potential Payout"}),/* @__PURE__ */m("span",{className:"font-bold text-lg",style:{color:I},children:[ht(ee),ne&&/* @__PURE__ */u("span",{className:"text-xs ml-1",style:{color:E.warning},children:"+ Jackpot"})]})]}),te.enabled&&/* @__PURE__ */m("div",{className:"flex justify-between items-center mt-2 rounded px-2 py-1.5",style:{backgroundColor:`${E.warning}08`,border:`1px solid ${E.warning}25`},children:[/* @__PURE__ */m("span",{className:"text-xs font-semibold",style:{color:E.warning},children:["★ ",te.progressive?"Progressive Jackpot":"Jackpot"]}),/* @__PURE__ */u("span",{className:"text-sm font-bold",style:{color:E.warning},children:te.progressive?te.amount>0?ht(te.amount):te.limit>0?`Up to ${ht(te.limit)}`:"Progressive":ht(te.amount)})]})]});return e?/* @__PURE__ */m("div",{className:"flex items-stretch gap-4",children:[
|
|
128
129
|
/* @__PURE__ */u("div",{className:"flex-1 min-w-0",children:t}),
|
|
129
130
|
/* @__PURE__ */u("div",{className:"w-px self-stretch",style:{backgroundColor:E.border}}),
|
|
130
|
-
/* @__PURE__ */u("button",{type:"button",onClick:a,disabled:ie,"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:E.buttonPrimaryText,backgroundColor:E.buttonPrimary,cursor:ie?"not-allowed":"pointer",minWidth:120},children:s?/* @__PURE__ */m("span",{className:"flex flex-col items-center gap-2",children:[/* @__PURE__ */u(
|
|
131
|
+
/* @__PURE__ */u("button",{type:"button",onClick:a,disabled:ie,"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:E.buttonPrimaryText,backgroundColor:E.buttonPrimary,cursor:ie?"not-allowed":"pointer",minWidth:120},children:s?/* @__PURE__ */m("span",{className:"flex flex-col items-center gap-2",children:[/* @__PURE__ */u(nn,{color:E.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:ht(x)})]})})]}):t})()})]}):/* @__PURE__ */m("div",{className:"p-4 sm:p-6 rounded-xl border",style:{backgroundColor:j,borderColor:E.border,boxShadow:he(T)},children:[
|
|
131
132
|
/* @__PURE__ */u("h3",{className:"text-base sm:text-lg font-semibold",style:{color:I,fontFamily:H},children:"Log in to place this entry"}),
|
|
132
133
|
/* @__PURE__ */u("p",{className:"text-xs sm:text-sm mt-1 mb-4",style:{color:E.textMuted},children:"Your picks are held. Log in to set your bet and confirm."}),
|
|
133
|
-
/* @__PURE__ */u("button",{type:"button",onClick:a,className:"w-full px-6 py-3 rounded-lg text-sm font-semibold transition-colors",style:{color:E.buttonPrimaryText,backgroundColor:E.buttonPrimary,cursor:"pointer"},children:"Log in"})]}),p&&/* @__PURE__ */u("div",{className:"rounded-lg p-3",style:{backgroundColor:E.errorBg,border:`1px solid ${E.error}`},children:/* @__PURE__ */u("p",{className:"text-sm",style:{color:E.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:E.border,backgroundColor:E.background},children:[/* @__PURE__ */u(je,{theme:T,variant:"secondary",disabled:s,onPress:i,children:"Back"}),/* @__PURE__ */u("button",{type:"button",onClick:a,disabled:ie,"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:E.buttonPrimaryText,backgroundColor:E.buttonPrimary,cursor:ie?"not-allowed":"pointer"},children:s?/* @__PURE__ */m(d,{children:[/* @__PURE__ */u(
|
|
134
|
+
/* @__PURE__ */u("button",{type:"button",onClick:a,className:"w-full px-6 py-3 rounded-lg text-sm font-semibold transition-colors",style:{color:E.buttonPrimaryText,backgroundColor:E.buttonPrimary,cursor:"pointer"},children:"Log in"})]}),p&&/* @__PURE__ */u("div",{className:"rounded-lg p-3",style:{backgroundColor:E.errorBg,border:`1px solid ${E.error}`},children:/* @__PURE__ */u("p",{className:"text-sm",style:{color:E.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:E.border,backgroundColor:E.background},children:[/* @__PURE__ */u(je,{theme:T,variant:"secondary",disabled:s,onPress:i,children:"Back"}),/* @__PURE__ */u("button",{type:"button",onClick:a,disabled:ie,"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:E.buttonPrimaryText,backgroundColor:E.buttonPrimary,cursor:ie?"not-allowed":"pointer"},children:s?/* @__PURE__ */m(d,{children:[/* @__PURE__ */u(nn,{color:E.buttonPrimaryText}),/* @__PURE__ */u("span",{children:"Placing Entry…"})]}):/* @__PURE__ */u("span",{children:`Place Entry (${ht(x)})`})})]})]})}function Go({game:e,totalSelections:t,expectedCorrect:n,className:o="",onExpectedCorrectChange:r,theme:l=Z,colorWinning:a,colorNone:i,winningCounts:s,payouts:c}){const d=l.colors,p=a??d.payoutWinning,f=i??d.payoutNone,h=At(e);/* @__PURE__ */
|
|
134
135
|
return m("div",{className:`space-y-4 ${o}`,children:[
|
|
135
|
-
/* @__PURE__ */u("h4",{className:"text-sm font-semibold text-center",style:{color:d.textMuted},children:"Payout Visualization"}),h.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:h.progressive?h.amount>0?`Progressive Jackpot: ${
|
|
136
|
+
/* @__PURE__ */u("h4",{className:"text-sm font-semibold text-center",style:{color:d.textMuted},children:"Payout Visualization"}),h.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:h.progressive?h.amount>0?`Progressive Jackpot: ${ht(h.amount)}${h.limit>0?` (up to ${ht(h.limit)})`:""} for a perfect pick!`:h.limit>0?`Progressive Jackpot — up to ${ht(h.limit)} for a perfect pick!`:"Progressive Jackpot for a perfect pick!":`Jackpot: ${ht(h.amount)} for a perfect pick!`})]}),
|
|
136
137
|
/* @__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=h.enabled&&x,y=g?d.warning:l?p:f,b=o===n;/* @__PURE__ */
|
|
137
|
-
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?h.progressive?`${o} correct wins PROGRESSIVE JACKPOT${h.amount>0?` (currently ${
|
|
138
|
-
/* @__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:
|
|
139
|
-
/* @__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
|
|
138
|
+
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?h.progressive?`${o} correct wins PROGRESSIVE JACKPOT${h.amount>0?` (currently ${ht(h.amount)})`:""}${h.limit>0?` — up to ${ht(h.limit)}`:""} + ${ht(a)}\nClick to select`:`${o} correct wins JACKPOT ${ht(h.amount)} + ${ht(a)}\nClick to select`:l?`${o} correct wins ${ht(a)}\nClick to select`:i?`${o} correct pays ${ht(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"})})}),
|
|
139
|
+
/* @__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:ht(a)}):null]},o)})}),
|
|
140
|
+
/* @__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 Wo({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:f}){const h=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??h,fontFamily:"Manrope, Poppins, sans-serif",fontSize:i,lineHeight:1.15,maxWidth:"100%",minWidth:0},v=/* @__PURE__ */m(d,{children:[
|
|
140
141
|
/* @__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"})]}),
|
|
141
|
-
/* @__PURE__ */u("span",{role:"img","aria-label":t,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:g,height:x,borderRadius:y,backgroundColor:h,flexShrink:0,transform:`translateY(${.06*-i}px)`},children:/* @__PURE__ */u(
|
|
142
|
-
/* @__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 f?/* @__PURE__ */u("button",{type:"button",onClick:f,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
|
|
142
|
+
/* @__PURE__ */u("span",{role:"img","aria-label":t,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:g,height:x,borderRadius:y,backgroundColor:h,flexShrink:0,transform:`translateY(${.06*-i}px)`},children:/* @__PURE__ */u(Qt,{iconUrl:e,width:g-2*w,height:x-2*b,iconColor:r,accentColor:l})}),
|
|
143
|
+
/* @__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 f?/* @__PURE__ */u("button",{type:"button",onClick:f,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 Io({apiUrl:e,apiKey:t,fetchImpl:n,getAuthHeaders:o,userId:r,demoEntries:a,demoGames:d,demoPropositions:p,onSelectEntry:f,theme:h,colorScheme:x,className:g="",renderTeamLogo:y,filterSport:b}){const w=se(h,x),k=!!(a&&d&&p),v=w.colors,N=ye(w),F=be(w),[B,C]=c("pending"),[A,M]=c([]),S=i(()=>new fo({apiUrl:e,apiKey:t,fetchImpl:n,getAuthHeaders:o}),[e,t,n,o]),{entries:z,loading:L,error:P,refetch:D}=yo(S,{user_id:r},{skip:k}),{games:O,loading:T,error:E}=ho(S,void 0,{skip:k}),{propositions:j,loading:Y,error:H}=xo(S,void 0,{skip:k}),R=k?a:z,G=k?d:O,W=k?p:j,U=!k&&(L||T||Y),K=k?null:P||E||H,Z=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]),$=i(()=>{const e=/* @__PURE__ */new Map;for(const t of G)e.set(t.id,t);return e},[G]),q=i(()=>{const e=/* @__PURE__ */new Map;for(const t of W)e.set(t.id,t);for(const t of Z)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,Z,A]),V=s(/* @__PURE__ */new Set);l(()=>{if(U||k)return;const e=[];for(const n of Z)for(const t of n.proposition_ids??[])q.has(t)||V.current.has(t)||(e.push(t),V.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,q,U,k,S]);const X=i(()=>b?Z.filter(e=>{const t=e.proposition_ids??[];return 0===t.length||t.some(t=>(q.get(t)??e.propositions?.find(e=>e.id===t))?.sport===b)}):Z,[Z,b,q]),Q=i(()=>X.filter(e=>ft(e.pending)),[X]),J=i(()=>X.filter(e=>!ft(e.pending)),[X]),_="pending"===B?Q:J,ee=["flex-1",g].filter(Boolean).join(" ");return U?/* @__PURE__ */u("div",{className:ee,style:{fontFamily:N},role:"status","aria-label":"Loading entries",children:/* @__PURE__ */u(hn,{colors:I(w),rows:2})}):K?/* @__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:K}),/* @__PURE__ */u("button",{type:"button",onClick:D,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:[
|
|
143
144
|
/* @__PURE__ */u("div",{className:"flex border-b mb-4",style:{borderColor:v.border},role:"tablist",children:["pending","completed"].map(e=>{const t=B===e,n="pending"===e?Q.length:J.length;/* @__PURE__ */
|
|
144
145
|
return m("button",{role:"tab","aria-selected":t,type:"button",onClick:()=>C(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:F},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:[
|
|
145
146
|
/* @__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"===B?{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"})}),
|
|
146
147
|
/* @__PURE__ */u("p",{className:"text-base font-medium",style:{color:v.text},children:"pending"===B?"No pending entries":"No completed entries"}),
|
|
147
148
|
/* @__PURE__ */u("p",{className:"text-sm mt-1",style:{color:v.textMuted},children:"pending"===B?"Entries awaiting results will appear here":"Settled entries will appear here"})]}),
|
|
148
|
-
/* @__PURE__ */u("div",{className:"space-y-3",children:_.map(e=>/* @__PURE__ */u(
|
|
149
|
-
return m("div",{className:"rounded-xl border overflow-hidden transition-colors",style:{borderColor:a.border,backgroundColor:s,boxShadow:he(r)},children:[/* @__PURE__ */m("button",{type:"button","data-testid":"entry-card",onClick:()=>{L&&z(e=>!e),o?.({entry:e,game:t,propositions:h})},"aria-label":`Entry #${e.id}`,"aria-expanded":L?S:void 0,className:"w-full text-left px-4 py-3 flex items-center justify-between gap-3",style:{cursor:L||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(
|
|
150
|
-
/* @__PURE__ */m("div",{className:"text-right",children:[
|
|
151
|
-
/* @__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:C}),L&&/* @__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:f.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 f,h,x;d?(f="Void",h=`${a.textMuted}20`,x=a.textMuted):c?p?(f="Won",h=a.successBg,x=a.successText):(f="Lost",h=a.errorBg,x=a.errorText):(f="Pending",h=a.warningBg,x=a.warningText);const g=
|
|
149
|
+
/* @__PURE__ */u("div",{className:"space-y-3",children:_.map(e=>/* @__PURE__ */u(Uo,{entry:e,game:$.get(e.game_id),propositionsById:q,onSelect:f,theme:w,renderTeamLogo:y},e.id))})]})}function Uo({entry:e,game:t,propositionsById:n,onSelect:o,theme:r,renderTeamLogo:l}){const a=r.colors,s=R(r),p=be(r),f=e.proposition_ids??[],h=i(()=>f.map(e=>n.get(e)).filter(Boolean),[f,n]),x=f.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=h.filter(e=>null!=e.result&&!e.is_voided).length,w=h.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=ft(e.pending),N=!v&&pt(e.winning)>0,F=e.payout_status,B="fulfilled"===F&&N,C=v?"Pending":B?"Won — pay due":"paid_out"===F&&N?"Paid":N?"Won":"Lost",A=v||B?a.warningBg:N?a.successBg:a.errorBg,M=v||B?a.warningText:N?a.successText:a.errorText,[S,z]=c(!1),L=x>0;/* @__PURE__ */
|
|
150
|
+
return m("div",{className:"rounded-xl border overflow-hidden transition-colors",style:{borderColor:a.border,backgroundColor:s,boxShadow:he(r)},children:[/* @__PURE__ */m("button",{type:"button","data-testid":"entry-card",onClick:()=>{L&&z(e=>!e),o?.({entry:e,game:t,propositions:h})},"aria-label":`Entry #${e.id}`,"aria-expanded":L?S:void 0,className:"w-full text-left px-4 py-3 flex items-center justify-between gap-3",style:{cursor:L||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(Wo,{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:xt(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:[
|
|
151
|
+
/* @__PURE__ */m("div",{className:"text-right",children:[pt(e.bet_amount)>0&&/* @__PURE__ */u("p",{className:"text-xs",style:{color:a.textMuted},children:ht(pt(e.bet_amount))}),!v&&pt(e.winning)>0&&/* @__PURE__ */m("p",{className:"text-sm font-bold",style:{color:a.success},children:[ht(pt(e.winning)),(e.payout_jackpot??0)>0&&/* @__PURE__ */m("span",{className:"block text-xs font-normal",style:{color:a.textMuted},children:["incl. ",ht(pt(e.payout_jackpot))," jackpot"]})]})]}),
|
|
152
|
+
/* @__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:C}),L&&/* @__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:f.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 f,h,x;d?(f="Void",h=`${a.textMuted}20`,x=a.textMuted):c?p?(f="Won",h=a.successBg,x=a.successText):(f="Lost",h=a.errorBg,x=a.errorText):(f="Pending",h=a.warningBg,x=a.warningText);const g=kt(o)?void 0:o.home_team;/* @__PURE__ */
|
|
152
153
|
return m("div",{className:"px-4 py-2.5 flex items-center gap-3",style:{borderColor:a.border},children:[
|
|
153
|
-
/* @__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:
|
|
154
|
+
/* @__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:xt(o.commence_time)})]}),
|
|
154
155
|
/* @__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:"—"})]}),
|
|
155
|
-
/* @__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:h,color:x},children:f})]})]},t)})})]})}function
|
|
156
|
+
/* @__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:h,color:x},children:f})]})]},t)})})]})}function Ko({className:e=""}){const{theme:t,eventFilterActive:n,eventFilterLabel:o,clearEventFilter:r,gameCategory:l}=Lo();if(!n)return null;const a=t.colors,i=o??("racing"===l?"This race":"This event");/* @__PURE__ */
|
|
156
157
|
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:[
|
|
157
158
|
/* @__PURE__ */u("p",{className:"text-[10px] font-bold uppercase tracking-[0.12em]",style:{color:a.primary},children:"Event filter"}),
|
|
158
159
|
/* @__PURE__ */u("p",{className:"truncate text-sm font-semibold",style:{color:a.text},children:i}),
|
|
159
|
-
/* @__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
|
|
160
|
-
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
|
|
161
|
-
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
|
|
162
|
-
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:L(o),fontFamily:r},children:"Choose your game"}),a?.trim()&&/* @__PURE__ */u(Ke,{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(
|
|
163
|
-
/* @__PURE__ */u(
|
|
164
|
-
/* @__PURE__ */u("div",{className:"flex-1",children:/* @__PURE__ */u(
|
|
165
|
-
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:B?"auto":"none"},"aria-hidden":!B,children:/* @__PURE__ */m("div",{ref:k,className:"relative w-full"+(B?" cursor-grab active:cursor-grabbing":""),style:{touchAction:"pan-y",willChange:"transform",userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none"},onPointerDown:e=>{if(B&&!C.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},z.current=e.timeStamp;try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}O.current?.(!0)}},onPointerMove:e=>{const t=S.current;if(!t||t.pointerId!==e.pointerId||C.current)return;const n=t.baseX+(e.clientX-t.originX),o=t.baseY+(e.clientY-t.originY),r=e.timeStamp-z.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,z.current=e.timeStamp}A.current.x=n,A.current.y=o,T()},onPointerUp:e=>{const t=S.current;if(!t||t.pointerId!==e.pointerId)return;S.current=null,O.current?.(!1);try{e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId)}catch{}if(C.current)return;e.timeStamp-z.current>90&&(M.current={x:0,y:0});const n=A.current,o=M.current;if(
|
|
160
|
+
/* @__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 Zo({onBack:e,title:t="Go back",className:n=""}){const{theme:o}=Lo(),r=o.colors;/* @__PURE__ */
|
|
161
|
+
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 $o({onBack:e,label:t="Games"}){const{theme:n}=Lo(),o=n.colors;/* @__PURE__ */
|
|
162
|
+
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 qo({onBack:e,hideActions:t,label:n,children:o,className:r=""}){const{theme:l}=Lo(),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(Zo,{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}var Vo=[1,5,10,20,50,100],Xo=[4,12];function Qo(e){return!!e&&!e.quick_pick_only&&"game_set"===(e.rule??"").trim().toLowerCase()}function Jo(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 _o(e){if(!Qo(e)||!e)return null;const t=e.min_propositions??e.allowed_propositions?.[0]??Xo[0],n=e.max_propositions??e.allowed_propositions?.[e.allowed_propositions.length-1]??Xo[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=Vo.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 er=50,tr=[25,50,75,100],nr=[{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 or(e){return!!e&&!e.quick_pick_only&&"ladder"===(e.rule??"").trim().toLowerCase()}function rr(e,t){return Math.round(e*t/50*100)/100}function lr(e,t){let n=0;return e.tiers50.map(([e,o])=>(n+=o,{atLeast:e,prize:rr(o,t),cumulative:rr(n,t)}))}function ar(e,t){return rr(e.tiers50.reduce((e,[,t])=>e+t,0),t)}function ir(e,t,n){return rr(e.tiers50.reduce((e,[n,o])=>n<=t?e+o:e,0),n)}function sr(e){if(!or(e)||!e)return null;const t=e.allowed_propositions,n=e.min_propositions??4,o=e.max_propositions??10,r=nr.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??tr[0],a=e.max_bet??tr[tr.length-1],i=tr.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:tr,tagline:"Climb the ladder. Every step pays its own prize, and every prize stacks on the one before."}}var cr=.21875,dr=[1,5,10,20,50],ur=[4,12];function mr(e){return!!e&&!e.quick_pick_only&&"mirror"===(e.rule??"").trim().toLowerCase()}function pr(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 fr(e){if(!mr(e)||!e)return null;const t=e.min_propositions??e.allowed_propositions?.[0]??ur[0],n=e.max_propositions??e.allowed_propositions?.[e.allowed_propositions.length-1]??ur[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=dr.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:"Call every leg. Get them all right, you win — all wrong, you win the same.",operatorMargin:e.operator_margin??.21875,perLegProbability:e.payout_structure?.per_leg_probability??.5}}function hr(e){return e?.quick_pick_only?"quick_pick":Qo(e)?"game_set":no(e)?"pick_your_dividend":or(e)?"ladder":mr(e)?"mirror":Yn(e)?"safety_net":bn(e)?"selections":_n(e)?"rule_setup":"selections"}function xr(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 gr(e){return!(!e||e.quick_pick_only||"exact"!==(e.rule??"").trim().toLowerCase()||bn(e)||xr(e))}function yr(e){switch(hr(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":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 br({className:e="",onBack:t,hideActions:n}){const{theme:o,headingFont:r,bodyFont:l,howToPlayMarkdown:a,selectedCategory:i,displayCategoryName:s}=Lo(),c=o.colors;/* @__PURE__ */
|
|
163
|
+
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:L(o),fontFamily:r},children:"Choose your game"}),a?.trim()&&/* @__PURE__ */u(Ke,{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(qo,{onBack:t,hideActions:n,label:i?s(i):void 0})]})}function wr({onCancel:e,className:t=""}){const{theme:n,screenSize:o}=Lo(),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 kr({onSelectGame:t,onGameSetup:n,onRuleSetup:o,onGameSetBet:r,onPickYourDividend:l,onLadder:a,onMirror:i,onSafetyNet:s,onQuickPick:c,onCancel:d,hideTitle:p,hideActions:f,showPerfectPickSetup:h=!1,showTierFilter:x=!1,className:g=""}){const y=Lo(),{theme:b,games:w,loading:k,error:v,selectedGame:N,selectedPropositionCount:F,handlePropositionCountChange:B,maxPayouts:C}=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(br,{onBack:d,hideActions:f})}),
|
|
164
|
+
/* @__PURE__ */u(Ko,{}),
|
|
165
|
+
/* @__PURE__ */u("div",{className:"flex-1",children:/* @__PURE__ */u(po,{games:w,selectedGame:N,onSelectGame:e=>{A.current=e,y.selectGame(e)},loading:k,error:v,theme:b,showTierFilter:x,selectedPropositionCount:F,onPropositionCountChange:B,onPropositionCountSelected:()=>{const e=A.current;if("rule_setup"===hr(e)&&gr(e)&&!h)return y.goToSportSelection(),void t?.();const c=hr(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:C})})]})}var vr=3;function Nr(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 Fr(e,t,n){const[r,a]=c([]),[d,u]=c([]),[m,p]=c([]),[f,h]=c([]),[x,g]=c(null),y=i(()=>{const t=/* @__PURE__ */new Map;for(const n of e)t.set(n.id,n);return t},[e]),b=i(()=>e.filter(e=>null!=t[e.id]),[e,t]),w=i(()=>e.map(e=>e.id).join(","),[e]),k=s(null);l(()=>{if(k.current===w)return;k.current=w;const n=e.filter(e=>!(e.id in t)),o=e.filter(e=>null!=t[e.id]);a(n.map(e=>e.id)),u(Nr(n,o).slice(0,3).map(e=>e.id)),p([]),h([]),g(null)},[w,e,t]);const v=i(()=>{const e=new Set(m);return[...Nr(r.map(e=>y.get(e)).filter(e=>Boolean(e)).filter(t=>!e.has(t.id)),b).map(e=>e.id),...m.filter(e=>r.includes(e))]},[r,y,b,m]);l(()=>{u(e=>{const t=new Set(r),n=e.filter(e=>t.has(e));if(0===f.length&&!x){const t=v.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,r.length))return n.length===e.length?e:n;const o=[...n];for(const r of v){if(o.length>=3)break;o.includes(r)||o.push(r)}return o})},[r,v,f,x]);const N=i(()=>d.map(e=>y.get(e)).filter(e=>Boolean(e)),[d,y]),F=o((e,t)=>{g(null),t&&n(e,t),h(n=>[...n,{id:e,answer:t}]),u(t=>t.filter(t=>t!==e)),p(n=>{const o=n.filter(t=>t!==e);return t?o:[...o,e]}),a(n=>{const o=n.filter(t=>t!==e);return t?o:[...o,e]})},[n]),B=o(()=>{const e=f[f.length-1];e&&(e.answer&&n(e.id,e.answer),g({id:e.id,from:"yes"===e.answer?"right":"no"===e.answer?"left":"up"}),h(e=>e.slice(0,-1)),p(t=>t.filter(t=>t!==e.id)),a(t=>[e.id,...t.filter(t=>t!==e.id)]),u(t=>[e.id,...t.filter(t=>t!==e.id)].slice(0,3)))},[f,n]);return{visible:N,canSkip:r.length>1,canUndo:f.length>0,restored:x,resolve:F,undo:B}}var Br={stiffness:420,damping:34},Cr={stiffness:280,damping:28},Ar="#00C853",Mr="#E53935";function Sr(e){return"up"===e?{x:0,y:-720}:{x:"right"===e?640:-640,y:70}}function zr(e){return e<0?0:e>1?1:e}function Lr(e,t,n){return n&&-t>Math.abs(e)}function Pr({prop:e,theme:t,depth:n=0,enterFrom:a,canSkip:i=!1,onResolve:c,registerApi:p,onDragStateChange:f,children:h}){const x=r(So),g=t??x?.theme??Z,y=be(g),b=g.colors.productYes??Ar,w=g.colors.productNo??Mr,k=s(null),v=s(null),N=s(null),F=s(null),B=0===n,C=s(!1),A=s({x:0,y:0}),M=s({x:0,y:0}),S=s(null),z=s(0),L=s(null),P=s(null),D=s(i);D.current=i;const O=s(f);O.current=f;const T=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=Lr(t,n,D.current);r(v.current,l?0:zr((t-24)/108)),r(N.current,l?0:zr((-t-24)/108)),r(F.current,l?zr((-n-30)/90):0)},[]),E=o(()=>{for(const e of[k.current,v.current,N.current,F.current])e&&(e.style.transition="none")},[]),j=o(()=>{null!=L.current&&(cancelAnimationFrame(L.current),L.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,T(),void(L.current=null);T(),L.current=requestAnimationFrame(n)};L.current=requestAnimationFrame(n)},[E,T,j]),H=o(t=>{if(C.current)return;if("up"===t&&!D.current)return;C.current=!0,j();const n="right"===t?"yes":"left"===t?"no":null,o=Sr(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,F.current])e&&(e.style.transition="opacity 260ms linear");A.current={...o},T(),P.current=setTimeout(()=>c(e.id,n),260)},[c,T,e.id,j]);l(()=>()=>{P.current&&clearTimeout(P.current),null!=L.current&&cancelAnimationFrame(L.current),S.current&&O.current?.(!1)},[]),l(()=>{if(!a)return j(),A.current={x:0,y:0},M.current={x:0,y:0},E(),void T();const e=Sr(a);A.current={x:e.x,y:e.y},M.current={x:0,y:0},E(),T(),Y(Cr)},[a,E,T,Y,j]),l(()=>{if(B&&p)return p({fly:H}),()=>p(null)},[H,B,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__ */
|
|
166
|
+
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:B?"auto":"none"},"aria-hidden":!B,children:/* @__PURE__ */m("div",{ref:k,className:"relative w-full"+(B?" cursor-grab active:cursor-grabbing":""),style:{touchAction:"pan-y",willChange:"transform",userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none"},onPointerDown:e=>{if(B&&!C.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},z.current=e.timeStamp;try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}O.current?.(!0)}},onPointerMove:e=>{const t=S.current;if(!t||t.pointerId!==e.pointerId||C.current)return;const n=t.baseX+(e.clientX-t.originX),o=t.baseY+(e.clientY-t.originY),r=e.timeStamp-z.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,z.current=e.timeStamp}A.current.x=n,A.current.y=o,T()},onPointerUp:e=>{const t=S.current;if(!t||t.pointerId!==e.pointerId)return;S.current=null,O.current?.(!1);try{e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId)}catch{}if(C.current)return;e.timeStamp-z.current>90&&(M.current={x:0,y:0});const n=A.current,o=M.current;if(Lr(n.x,n.y,D.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(Br)},onPointerCancel:e=>{const t=S.current;t&&t.pointerId===e.pointerId&&(S.current=null,M.current={x:0,y:0},O.current?.(!1),C.current||Y(Br))},onDragStart:e=>e.preventDefault(),children:[h,B&&/* @__PURE__ */m(d,{children:[
|
|
166
167
|
/* @__PURE__ */u("div",{ref:v,className:`${R} left-5`,style:{opacity:0,transform:"rotate(-12deg)",color:b,borderColor:b,fontFamily:y},children:"Yes"}),
|
|
167
|
-
/* @__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:F,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
|
|
168
|
+
/* @__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:F,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 Dr({prop:e}){const{theme:t,renderTeamLogo:n,displaySportName:o,gameCategory:r}=Lo(),l=t.colors,a=be(t),i=lt(e),s=_e(e),c=("racing"===r?[e.away_team?.trim()||e.home_team?.trim()]:[e.home_team?.trim(),e.away_team?.trim()]).filter(Boolean);/* @__PURE__ */
|
|
168
169
|
return m("div",{className:"flex h-full w-full flex-col overflow-hidden rounded-3xl border",style:{backgroundColor:R(t),borderColor:l.border,boxShadow:"0 18px 40px -24px rgba(10,20,22,0.45)"},children:[
|
|
169
170
|
/* @__PURE__ */u("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 px-5 py-3",style:{backgroundColor:G(t)},children:c.length>0?c.map((e,o)=>/* @__PURE__ */m("span",{className:"inline-flex items-center gap-1.5 text-sm font-semibold",style:{color:Y(t)},children:[o>0&&/* @__PURE__ */u("span",{className:"mr-1 text-xs font-normal",style:{color:H(t)},children:"vs"}),n?.(e),e]},`${e}-${o}`)):/* @__PURE__ */u("span",{className:"text-sm font-semibold",style:{color:Y(t)},children:e.league??o(e.sport??"")})}),
|
|
170
|
-
/* @__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:[
|
|
171
|
-
/* @__PURE__ */m("div",{className:"flex flex-wrap items-center gap-2 border-t px-5 py-3 text-[11px]",style:{borderColor:l.borderSubtle??l.border,color:l.textMuted},children:[e.sport&&/* @__PURE__ */u("span",{className:"rounded-full px-2 py-0.5 font-semibold uppercase tracking-wide",style:{backgroundColor:l.infoBg,color:l.infoText},children:o(e.sport)}),s&&/* @__PURE__ */u("span",{className:"uppercase tracking-wide",children:s.replace(/[_-]+/g," ")}),e.commence_time&&/* @__PURE__ */u("span",{className:"ml-auto",children:
|
|
172
|
-
return m("div",{className:`flex w-full flex-col ${a}`,style:{fontFamily:B},children:[n&&/* @__PURE__ */u("div",{className:"flex shrink-0 justify-end pb-3",children:n}),k?/* @__PURE__ */u("p",{className:"py-10 text-center text-sm",style:{color:F.textMuted},children:"Loading…"}):v?/* @__PURE__ */u("div",{className:"rounded-xl p-4 text-center",style:{background:F.errorBg,border:`1px solid ${F.error}`},children:/* @__PURE__ */u("p",{className:"text-sm",style:{color:F.errorText??F.error},children:v})}):/* @__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:I?/* @__PURE__ */u("div",{className:"relative mx-auto w-full",style:{height:"clamp(14rem, 44dvh, 26rem)",maxWidth:384},children:z.map((e,t)=>/* @__PURE__ */u(
|
|
171
|
+
/* @__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:[Oo(e,n,c.join(" vs ")),i?/* @__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:P(t)},children:["All ","OR"===i.operator?"or any of these":"of these"]}),/* @__PURE__ */u("ul",{className:"flex flex-col gap-2",children:i.legs.map((e,n)=>/* @__PURE__ */m("li",{className:"flex gap-2 text-base font-bold leading-snug",style:{color:D(t),fontFamily:a},children:[/* @__PURE__ */u("span",{"aria-hidden":!0,style:{color:l.primary},children:"OR"===i.operator?"/":"+"}),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:D(t),fontFamily:a},children:e.description??e.proposition})]}),e.outcome_description&&e.outcome_description!==e.description&&/* @__PURE__ */u("p",{className:"text-sm leading-snug",style:{color:l.textMuted},children:e.outcome_description})]}),
|
|
172
|
+
/* @__PURE__ */m("div",{className:"flex flex-wrap items-center gap-2 border-t px-5 py-3 text-[11px]",style:{borderColor:l.borderSubtle??l.border,color:l.textMuted},children:[e.sport&&/* @__PURE__ */u("span",{className:"rounded-full px-2 py-0.5 font-semibold uppercase tracking-wide",style:{backgroundColor:l.infoBg,color:l.infoText},children:o(e.sport)}),s&&/* @__PURE__ */u("span",{className:"uppercase tracking-wide",children:s.replace(/[_-]+/g," ")}),e.commence_time&&/* @__PURE__ */u("span",{className:"ml-auto",children:xt(e.commence_time)})]})]})}function Or({onBack:e,onNext:t,viewSwitch:n,onDragStateChange:r,className:a=""}){const{theme:i,propositions:c,selections:p,toggleSelection:f,selectedGame:h,selectedPropositionCount:x,answeredCount:g,selectionValid:y,goToConfirmation:b,goToSportSelection:w,loading:k,error:v,selectedRule:N}=Lo(),F=i.colors,B=ye(i),C=be(i),A=F.productYes??Ar,M=F.productNo??Mr,S=s(null);l(()=>{h||(w(),e?.())},[w,e,h]);const{visible:z,canSkip:P,canUndo:D,restored:O,resolve:T,undo:E}=Fr(c,p,f),j=h?Ct(h,x??void 0,N):{min:0,max:0},Y=j.max,H=Y>0&&g>=Y,G=(()=>{if(!h)return null;if(j.min>0&&j.min===j.max)return j.min;const e=hr(h);return null!=x&&x>0&&("game_set"===e||"pick_your_dividend"===e||xr(h))?x:Y>0?Y:null})(),W=s(g);l(()=>{const e=W.current;if(W.current=g,null==G||e>=G||g!==G)return;const n=setTimeout(()=>{b(),t?.()},420);return()=>clearTimeout(n)},[g,b,t,G]);const I=!H&&z.length>0;l(()=>{if(!I)return;const e=e=>{const t=e.target;if(!t||!/^(INPUT|TEXTAREA|SELECT)$/.test(t.tagName)){switch(e.key){case"ArrowRight":S.current?.fly("right");break;case"ArrowLeft":S.current?.fly("left");break;case"ArrowUp":S.current?.fly("up");break;case"ArrowDown":case"Backspace":E();break;default:return}e.preventDefault()}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[I,E]);const U=o(e=>{S.current=e},[]);if(!h)return null;const K=(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:F.border,color:F.textMuted,background:F.background},children:/* @__PURE__ */u("span",{"aria-hidden":!0,children:t})});/* @__PURE__ */
|
|
173
|
+
return m("div",{className:`flex w-full flex-col ${a}`,style:{fontFamily:B},children:[n&&/* @__PURE__ */u("div",{className:"flex shrink-0 justify-end pb-3",children:n}),k?/* @__PURE__ */u("p",{className:"py-10 text-center text-sm",style:{color:F.textMuted},children:"Loading…"}):v?/* @__PURE__ */u("div",{className:"rounded-xl p-4 text-center",style:{background:F.errorBg,border:`1px solid ${F.error}`},children:/* @__PURE__ */u("p",{className:"text-sm",style:{color:F.errorText??F.error},children:v})}):/* @__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:I?/* @__PURE__ */u("div",{className:"relative mx-auto w-full",style:{height:"clamp(14rem, 44dvh, 26rem)",maxWidth:384},children:z.map((e,t)=>/* @__PURE__ */u(Pr,{prop:e,depth:t,canSkip:P,enterFrom:O?.id===e.id?O.from:null,onResolve:T,registerApi:0===t?U:void 0,onDragStateChange:0===t?r:void 0,children:/* @__PURE__ */u(Dr,{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:R(i),border:`1px dashed ${F.border}`},children:[
|
|
173
174
|
/* @__PURE__ */u("p",{className:"text-base font-extrabold",style:{color:L(i),fontFamily:C},children:H?"Card full":"That’s the last one"}),
|
|
174
175
|
/* @__PURE__ */u("p",{className:"text-sm",style:{color:F.textMuted},children:H?`You've picked all ${Y} legs for ${h.game_name}. Undo a swipe to change one, or lock it in.`:y?"You've been through every proposition. Lock your card in, or undo to revisit a pick.":`No propositions left to answer${j.min>0?` — this game needs at least ${j.min}`:""}. Undo a swipe or head back to widen the pool.`}),D&&/* @__PURE__ */u("button",{type:"button",onClick:E,className:"rounded-full border px-5 py-2 text-sm font-semibold",style:{borderColor:F.border,color:F.text},children:"Undo last swipe"})]})}),/* @__PURE__ */m("div",{className:"shrink-0",children:[/* @__PURE__ */m("div",{className:"mx-auto flex max-w-sm items-center justify-center gap-3",children:[K("Undo last swipe","↺",E,!D),
|
|
175
176
|
/* @__PURE__ */u("button",{type:"button",onClick:()=>S.current?.fly("left"),disabled:!I,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:M,fontFamily:C},children:"No"}),
|
|
176
|
-
/* @__PURE__ */u("button",{type:"button",onClick:()=>S.current?.fly("right"),disabled:!I,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:A,fontFamily:C},children:"Yes"}),K("Skip this proposition","↑",()=>S.current?.fly("up"),!I||!P)]}),/* @__PURE__ */u("p",{className:"mt-2 text-center text-[11px]",style:{color:F.textMuted},children:P?"Swipe right for Yes, left for No · ↑ to skip":"Swipe right for Yes, left for No"})]})]})]})}function
|
|
177
|
+
/* @__PURE__ */u("button",{type:"button",onClick:()=>S.current?.fly("right"),disabled:!I,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:A,fontFamily:C},children:"Yes"}),K("Skip this proposition","↑",()=>S.current?.fly("up"),!I||!P)]}),/* @__PURE__ */u("p",{className:"mt-2 text-center text-[11px]",style:{color:F.textMuted},children:P?"Swipe right for Yes, left for No · ↑ to skip":"Swipe right for Yes, left for No"})]})]})]})}function Tr({gameKey:e,short:t,size:n=56,footer:o="YESNO Multi",className:r,title:l,sportBaseKey:a}){const i=ct(e,a,t),s=function(e){return e.length<=3?92:4===e.length?72:56}(i),c=l??`${i} button`;/* @__PURE__ */
|
|
177
178
|
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:[
|
|
178
179
|
/* @__PURE__ */u("title",{children:c}),
|
|
179
180
|
/* @__PURE__ */u("rect",{x:"2",y:"2",width:"356",height:"356",rx:"78",fill:"#DDD9D2",stroke:at,strokeWidth:"4"}),
|
|
180
181
|
/* @__PURE__ */u("rect",{x:"50",y:"10",width:"260",height:"260",rx:"52",fill:at,opacity:"0.30"}),
|
|
181
182
|
/* @__PURE__ */u("rect",{x:"50",y:"35",width:"260",height:"260",rx:"52",fill:at,opacity:"0.55"}),
|
|
182
183
|
/* @__PURE__ */u("rect",{x:"50",y:"60",width:"260",height:"260",rx:"52",fill:at}),
|
|
183
|
-
/* @__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:at,children:o}),/* @__PURE__ */u("text",{x:"262",y:"333",fontFamily:"Manrope, Poppins, sans-serif",fontSize:"10",fontWeight:600,fill:at,children:"TM"})]})]})}function
|
|
184
|
-
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:
|
|
185
|
-
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:he(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(
|
|
184
|
+
/* @__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:at,children:o}),/* @__PURE__ */u("text",{x:"262",y:"333",fontFamily:"Manrope, Poppins, sans-serif",fontSize:"10",fontWeight:600,fill:at,children:"TM"})]})]})}function Er({className:e="",onBack:t,hideActions:n,backLabel:o="Category"}){const{theme:r,selectedCategory:l}=Lo(),a=r.colors,i=be(r);/* @__PURE__ */
|
|
185
|
+
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:Ft(l)}),/* @__PURE__ */u(qo,{onBack:t,hideActions:n,label:t?o:void 0})]})}function jr({onCancel:e,className:t=""}){const{theme:n,screenSize:o}=Lo(),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 Yr({onSelectSport:t,onCancel:n,hideTitle:o,hideActions:r,renderSportLogo:l,renderSportTagline:a,backLabel:i,comingSoonSports:s,className:c=""}){const{theme:d,propositionsForSportPicker:p,sportSummaries:f,loading:h,setSelectedSport:x,clearSelectedGame:g,selectedCategory:y,sportBaseKey:b,displaySportName:w}=Lo(),k=d.colors,v=R(d),N=ye(d),F=be(d),B=L(d),C=gt(p),A=Object.keys(C),[M,S]=e.useState(!1),z=e.useRef(null),P=e.useCallback(e=>{if(z.current?.disconnect(),z.current=null,!e)return;const t=()=>S(e.clientWidth<440);t(),"undefined"!=typeof ResizeObserver&&(z.current=new ResizeObserver(t),z.current.observe(e))},[]);return h?/* @__PURE__ */u(xn,{colors:I(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(Er,{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=f.find(t=>t.key===e),o=n?.active_props??C[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__ */
|
|
186
|
+
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:he(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(Tr,{gameKey:e,size:48,footer:null,sportBaseKey:b,title:`${c} button`,className:"h-10 w-10 shrink-0 sm:h-12 sm:w-12"}),
|
|
186
187
|
/* @__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:B,fontFamily:F},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})]})]}),
|
|
187
188
|
/* @__PURE__ */u(Ve,{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??ct(e.key,b));/* @__PURE__ */
|
|
188
189
|
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:ce(k.backgroundAlt,.4),borderColor:ce(k.border,.7)},children:[
|
|
189
|
-
/* @__PURE__ */u("div",{className:"shrink-0",style:{opacity:.6,filter:"grayscale(1)"},children:l?l(e.key):/* @__PURE__ */u(
|
|
190
|
+
/* @__PURE__ */u("div",{className:"shrink-0",style:{opacity:.6,filter:"grayscale(1)"},children:l?l(e.key):/* @__PURE__ */u(Tr,{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"})}),
|
|
190
191
|
/* @__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:F},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")})]}),
|
|
191
|
-
/* @__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(Xe,{size:12,color:k.textMuted}),"Soon"]})]},e.key);var o})]})})]})}function
|
|
192
|
-
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(
|
|
193
|
-
return m("button",{type:"button",onClick:()=>{d(t),p(null),f(),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(Ze,{label:h(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
|
|
194
|
-
/* @__PURE__ */u(
|
|
192
|
+
/* @__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(Xe,{size:12,color:k.textMuted}),"Soon"]})]},e.key);var o})]})})]})}function Hr({className:e="",onBack:t,hideActions:n}){const{theme:o}=Lo(),r=be(o),l=o.colors;/* @__PURE__ */
|
|
193
|
+
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(qo,{onBack:t,hideActions:n})]})}function Rr({onCancel:e,className:t=""}){const{theme:n,screenSize:o}=Lo(),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 Gr({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:f,displayCategoryName:h}=Lo(),x=i.colors,g=R(i),y=ye(i);vt(s);const b=Nt(s);return c?/* @__PURE__ */u(xn,{colors:I(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(Hr,{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 st[e]??""}(t);/* @__PURE__ */
|
|
194
|
+
return m("button",{type:"button",onClick:()=>{d(t),p(null),f(),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(Ze,{label:h(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 Wr(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 Ir({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 Ur({onSelectEvent:t,className:n=""}){const{theme:o,loading:r,sameGameMultiEvents:l,selectSameGameMultiEvent:a,renderTeamLogo:i,displaySportName:s}=Lo(),[c,d]=e.useState(null),p=o.colors,f=ye(o),h=be(o),x=R(o),g=G(o);return r?/* @__PURE__ */u(xn,{colors:I(o),bodyFont:f,className:n,variant:"event"}):/* @__PURE__ */m("section",{className:n,"aria-label":"Available fixtures",style:{fontFamily:f},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 ${gn(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?ge(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:h},children:[
|
|
195
|
+
/* @__PURE__ */u(Ir,{name:e.homeTeam,renderTeamLogo:i,muted:p.textMuted}),
|
|
195
196
|
/* @__PURE__ */u("span",{className:"text-xs font-normal",style:{color:p.textMuted},children:"vs"}),
|
|
196
|
-
/* @__PURE__ */u(
|
|
197
|
-
return m("div",{ref:x,className:"flex-shrink-0 relative",children:[/* @__PURE__ */u(
|
|
198
|
-
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:L(r),fontFamily:l},children:C?"Choose a Game":"Select Propositions"}),i&&/* @__PURE__ */u(
|
|
197
|
+
/* @__PURE__ */u(Ir,{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:[Wr(e.commenceTime)," · ",e.propositionCount," proposition",1===e.propositionCount?"":"s",(e.league||e.sport)&&` · ${e.league?.toUpperCase()??s(e.sport)}`]})]}),/* @__PURE__ */u(Ve,{size:22,color:p.textMuted,className:"shrink-0 transition-transform group-hover:translate-x-0.5"})]},e.id))})]})}function Kr({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,p]=e.useState(!1),[f,h]=e.useState(null),x=e.useRef(null),g=e.useRef(null),y=e.useRef(null),b=36+36*t.length+12,w="up"===a||d?"up":"down";e.useEffect(()=>{if(!s)return p(!1),void h(null);const e=x.current,t=()=>{if(!e||"undefined"==typeof window)return;const t=e.getBoundingClientRect(),n=(document.documentElement.clientHeight||window.innerHeight)-t.bottom,o=t.top,r=n<b&&o>n;p(r),h(Math.max((r?o:n)-12,132))};t(),window.addEventListener("resize",t),window.addEventListener("scroll",t,!0);const n=e=>{const t=e.target;x.current?.contains(t)||g.current?.contains(t)||c(!1)};return document.addEventListener("mousedown",n),()=>{window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0),document.removeEventListener("mousedown",n)}},[s,b]);const k=s?/* @__PURE__ */m("div",{ref:g,role:"menu",className:"rounded-lg overflow-y-auto overscroll-contain",style:{position:"absolute",top:"up"===w?void 0:"calc(100% + 6px)",bottom:"up"===w?"calc(100% + 6px)":void 0,left:"left"===l?0:void 0,right:"right"===l?0:void 0,maxHeight:f??void 0,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__ */
|
|
198
|
+
return m("div",{ref:x,className:"flex-shrink-0 relative",children:[/* @__PURE__ */u(Do,{onPress:()=>{o?null==y.current&&(y.current=window.setTimeout(()=>{y.current=null,c(e=>!e)},220)):c(e=>!e)},onDoubleClick:o?()=>{null!=y.current&&(window.clearTimeout(y.current),y.current=null),c(!1),o?.()}:void 0}),k]})}function Zr({className:e="",onBack:t,onNext:n,hideActions:o}){const{theme:r,headingFont:l,bodyFont:a,selectedGame:i,propositions:s,selections:c,toggleSelection:d,selectedPropositionCount:p,disableQuickPick:f,answeredCount:h,goToConfirmation:x,selectedEventId:g,sameGameMultiEvents:y,selectSameGameMultiEvent:b,selectedRule:w,howToPlayMarkdown:k,maxPayouts:v}=Lo(),N=r.colors,F=Ee(i),B=io(i??{},i?v?.[i.id]:void 0),C=bn(i)&&!g,A=y.find(e=>e.id===g),M=i?Ct(i,p,w):{min:0,max:0},S=M.min,z=bn(i)&&g?Math.min(M.max,s.length):M.max,P=S>0&&S===z,D=!(i?.allowed_propositions&&i.allowed_propositions.length>0)&&S>0&&z>S,O=P?z:z||s.length,T=e=>{const t=Math.max(0,Math.min(e??O,s.length));for(const l of Object.keys(c)){const e=Number(l);d(e,c[e])}const n=[...s].sort(()=>Math.random()-.5).slice(0,t),o=[],r=[];for(const l of n)Math.random()<.5?o.push(l):r.push(l);for(const l of o)d(l.id,"yes");for(const l of r)d(l.id,"no")},E=!f&&s.length>0,j=D?Array.from({length:z-S+1},(e,t)=>S+t).filter(e=>e<=s.length):[],Y=h>0?h:S||O;/* @__PURE__ */
|
|
199
|
+
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:L(r),fontFamily:l},children:C?"Choose a Game":"Select Propositions"}),i&&/* @__PURE__ */u(qo,{onBack:g?()=>b(null):t,hideActions:o,label:A?gn(A):i.game_name,children:(F||k?.trim())&&/* @__PURE__ */u(Ke,{variant:"icon",content:k,panel:F,theme:r,title:`${i.game_name} — How to Play`,extra:/* @__PURE__ */u(so,{tiers:B.hasGenericDividends?B.tiers:[],modes:B.modes,pydDividends:B.pydDividends,minBet:B.minBet,maxBet:B.maxBet,colors:N,bodyFont:a,headingFont:l}),colors:{text:N.text,textMuted:N.textMuted,border:N.border,background:N.background,backgroundAlt:N.backgroundAlt,primary:N.primary,primaryText:N.primaryText},bodyFont:a,headingFont:l})})]}),E&&(j.length>1?/* @__PURE__ */u(Kr,{counts:j,onPick:e=>{T(e),x(),n?.()},onDoubleAction:()=>{T(Y),x(),n?.()},colors:N,menuShadow:xe(r)}):/* @__PURE__ */u("div",{className:"flex-shrink-0",children:/* @__PURE__ */u(Do,{onPress:()=>{T(),x(),n?.()}})}))]})}function $r({onNext:e,onBack:t,hideButtons:n=!1,className:o=""}){const{theme:r,selectionValid:l,answeredCount:a,selectedGame:i,selectedPropositionCount:s,selectedEventId:c,propositions:d,goToConfirmation:p,selectedRule:f}=Lo(),h=r.colors,x=R(r),g=h.textAlt??h.textMuted,y=i?Ct(i,s,f):{min:0,max:0},b=y.min,w=bn(i)&&c?Math.min(y.max,d.length):y.max,k=!!(i?.allowed_propositions&&i.allowed_propositions.length>0),v=!k&&b>0&&w>b&&a>=b&&a<w,N=w-a,F=!k&&b>0&&w>b,B=i?F?b:w||b||i.num_propositions||0:0,C=F?w:B,A=C>0?Math.min(a/C,1):0,M=F&&w>0?b/w*100:0,S=Math.max(0,b-a),z=l&&!!e,L=0===a?"Let's get started":F&&S>0?1===S?"1 to go — almost there":`${S} to go`:v?`${N} more pick${1!==N?"s":""} available`:A>=1?"✓ All selections made":A>=.75?"Almost there!":A>=.5?"Over halfway!":A>=.25?"Getting close":"Nice start",P=F?a>=b?`${a} of maximum ${w}`:`${a} of minimum ${b}`:`${a} / ${B||d.length} picks`;/* @__PURE__ */
|
|
199
200
|
return u("div",{className:o,children:/* @__PURE__ */u("div",{className:"rounded-xl border overflow-hidden mb-4",style:{borderColor:a>0?h.primary:h.border,backgroundColor:x,boxShadow:he(r)},children:/* @__PURE__ */m("div",{className:"w-full p-4 sm:p-5",style:{backgroundColor:a>0?`${h.primary}10`:"transparent"},children:[
|
|
200
201
|
/* @__PURE__ */m("div",{className:"flex items-center justify-between gap-2 mb-3",children:[
|
|
201
202
|
/* @__PURE__ */u("span",{className:"text-sm font-semibold shrink-0",style:{color:a>0?h.primary:g},children:P}),z?/* @__PURE__ */m("button",{type:"button",onClick:()=>{p(),e?.()},className:"shrink-0 px-3 py-1.5 rounded-lg text-xs font-semibold transition-colors",style:{color:h.buttonPrimaryText,backgroundColor:h.buttonPrimary,cursor:"pointer"},children:["Continue with ",a]}):/* @__PURE__ */u("span",{className:"text-xs font-semibold text-right",style:{color:A>=1?h.success:h.primary,animation:"fadeSlideIn 0.3s ease-out"},children:L},L),
|
|
202
203
|
/* @__PURE__ */u("style",{children:"@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }"})]}),
|
|
203
|
-
/* @__PURE__ */m("div",{className:"relative w-full h-2 rounded-full overflow-hidden",style:{backgroundColor:h.background},children:[/* @__PURE__ */u("div",{className:"h-full rounded-full transition-all duration-300",style:{width:`${Math.min(100*A,100)}%`,backgroundColor:l?h.success:h.primary}}),F&&/* @__PURE__ */u("div",{"aria-hidden":!0,title:`Minimum ${b}`,style:{position:"absolute",top:-1,bottom:-1,left:`${M}%`,width:2,marginLeft:-1,borderRadius:1,backgroundColor:x,boxShadow:`0 0 0 1px ${h.textMuted}55`}})]}),F&&/* @__PURE__ */m("div",{className:"flex items-center justify-between mt-1.5",children:[/* @__PURE__ */u("span",{className:"text-[11px]",style:{color:a>=b?h.success:h.textMuted},children:a>=b?`✓ Minimum ${b} reached`:`Minimum ${b}`}),/* @__PURE__ */m("span",{className:"text-[11px]",style:{color:h.textMuted},children:["Max ",w]})]})]})})})}function
|
|
204
|
+
/* @__PURE__ */m("div",{className:"relative w-full h-2 rounded-full overflow-hidden",style:{backgroundColor:h.background},children:[/* @__PURE__ */u("div",{className:"h-full rounded-full transition-all duration-300",style:{width:`${Math.min(100*A,100)}%`,backgroundColor:l?h.success:h.primary}}),F&&/* @__PURE__ */u("div",{"aria-hidden":!0,title:`Minimum ${b}`,style:{position:"absolute",top:-1,bottom:-1,left:`${M}%`,width:2,marginLeft:-1,borderRadius:1,backgroundColor:x,boxShadow:`0 0 0 1px ${h.textMuted}55`}})]}),F&&/* @__PURE__ */m("div",{className:"flex items-center justify-between mt-1.5",children:[/* @__PURE__ */u("span",{className:"text-[11px]",style:{color:a>=b?h.success:h.textMuted},children:a>=b?`✓ Minimum ${b} reached`:`Minimum ${b}`}),/* @__PURE__ */m("span",{className:"text-[11px]",style:{color:h.textMuted},children:["Max ",w]})]})]})})})}function qr({view:e,onChange:t}){const{theme:n}=Lo(),o=n.colors,r=(n,r)=>{const l=e===n;/* @__PURE__ */
|
|
204
205
|
return u("button",{type:"button",onClick:()=>t(n),"aria-pressed":l,className:"px-2.5 py-1 rounded-md text-xs font-semibold transition-colors",style:{background:l?o.primary:"transparent",color:l?o.primaryText:o.textMuted},children:r},n)};/* @__PURE__ */
|
|
205
|
-
return m("div",{className:"flex items-center gap-1 rounded-lg p-0.5 shrink-0",style:{background:o.backgroundAlt,border:`1px solid ${o.border}`},children:[r("list","List"),r("swipe","Swipe")]})}function
|
|
206
|
-
return m("div",{className:`flex flex-col min-h-full ${p}`,style:{fontFamily:g},children:[!o&&/* @__PURE__ */u("div",{className:"mb-6",children:/* @__PURE__ */u(
|
|
207
|
-
/* @__PURE__ */u("div",{className:"flex-1",children:q?/* @__PURE__ */u(
|
|
208
|
-
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"},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]}),c?null!=p&&/* @__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:
|
|
209
|
-
return m("div",{style:{display:"flex",flexDirection:"column",gap:8,alignSelf:"stretch"},children:[/* @__PURE__ */m("div",{style:{display:"flex",flexDirection:"row",gap:8,overflowX:p?"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:o.textMuted,fontFamily:r,display:"flex",alignItems:"center"},children:p?"Quick Pick":i}),C&&/* @__PURE__ */m(d,{children:[/* @__PURE__ */u("div",{className:"py-1 text-xs",style:{color:o.textMuted,fontFamily:r,display:"flex",alignItems:"center"},children:"Dividend"}),/* @__PURE__ */u("div",{className:"py-1 text-xs",style:{color:o.textMuted,fontFamily:r,display:"flex",alignItems:"center"},children:F})]})]}),p?/* @__PURE__ */m("div",{style:{display:"flex",flexDirection:"column",gap:8,alignSelf:"flex-start",width:S},children:[/* @__PURE__ */u(
|
|
210
|
-
/* @__PURE__ */u("span",{style:{color:o.heading??o.text??o.primary},children:
|
|
211
|
-
/* @__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
|
|
212
|
-
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:L(o),fontFamily:r},children:"Place Your Wager"}),l&&/* @__PURE__ */u(
|
|
213
|
-
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:[
|
|
214
|
-
/* @__PURE__ */u(je,{theme:a,variant:"primary",disabled:!f,onPress:async()=>{n?(await l.handleSubmit(),t?.()):o?.(
|
|
215
|
-
/* @__PURE__ */u("div",{className:"flex-1",children:/* @__PURE__ */u(
|
|
206
|
+
return m("div",{className:"flex items-center gap-1 rounded-lg p-0.5 shrink-0",style:{background:o.backgroundAlt,border:`1px solid ${o.border}`},children:[r("list","List"),r("swipe","Swipe")]})}function Vr({onNext:t,onBack:n,hideTitle:o,hideActions:r,defaultView:l="list",view:a,onViewChange:i,hideViewSwitch:s,onSwipeDragStateChange:c,className:p=""}){const f=Lo(),{selectedRule:h}=f,{theme:x,bodyFont:g,selectedGame:y,propositions:b,propositionsForSportPicker:w,selections:k,toggleSelection:v,loading:N,error:F,renderTeamLogo:B,filterSport:C,initialSport:A,gameCategory:M,selectedPropositionCount:S,handlePropositionCountChange:z,goToConfirmation:L,goBack:P,selectedCategory:D,setSelectedCategory:O,selectedSport:T,setSelectedSport:E,selectedEventId:j,propositionsForCategoryPicker:Y,answeredCount:H}=f;x.colors;const[R,G]=e.useState(l),W=a??R,I=e.useCallback(e=>{void 0===a&&G(e),i?.(e)},[a,i]);e.useEffect(()=>{y||(f.goToSportSelection(),n?.())},[y,f,n]);const U=e.useMemo(()=>{if(!y)return null;const{min:e,max:t}=Ct(y,S??void 0,h);if(e>0&&e===t)return e;const n=hr(y);return null!=S&&S>0&&("game_set"===n||"pick_your_dividend"===n||"safety_net"===n||xr(y))?S:null},[y,S]),K=e.useRef(H);e.useEffect(()=>{const e=K.current;K.current=H,null!=U&&e<U&&H===U&&(L(),t?.())},[H,U]);const Z=e.useMemo(()=>Nt(Y??[]),[Y]);e.useEffect(()=>{y&&1===Z.length&&D!==Z[0]&&O(Z[0])},[y,Z,D,O]);const $=e.useMemo(()=>{const e=/* @__PURE__ */new Set;for(const t of w??[])t.sport&&e.add(t.sport);return Array.from(e)},[w]);if(e.useEffect(()=>{y&&(Z.length>1&&!D||1===$.length&&T!==$[0]&&E($[0]))},[y,Z,D,$,T,E]),!y)return null;const q=Z.length>1&&!D,V=!q&&$.length>1&&!T,X=!q&&!V&&bn(y)&&!j,Q=(()=>{if(!bn(y)||!j)return y;const e=Math.min(y.max_propositions??b.length,b.length);return{...y,max_propositions:e,allowed_propositions:y.allowed_propositions?.filter(t=>t<=e)}})(),J=()=>{P(),n?.()};/* @__PURE__ */
|
|
207
|
+
return m("div",{className:`flex flex-col min-h-full ${p}`,style:{fontFamily:g},children:[!o&&/* @__PURE__ */u("div",{className:"mb-6",children:/* @__PURE__ */u(Zr,{onBack:r?J:void 0,onNext:r?t:void 0,hideActions:r})}),!bn(y)&&/* @__PURE__ */u(Ko,{}),
|
|
208
|
+
/* @__PURE__ */u("div",{className:"flex-1",children:q?/* @__PURE__ */u(Gr,{hideTitle:!0,hideActions:!0,onSelectCategory:e=>O(e)}):V?/* @__PURE__ */u(Yr,{hideTitle:!0,hideActions:!0,onSelectSport:e=>E(e)}):X?/* @__PURE__ */u(Ur,{}):"swipe"===W?/* @__PURE__ */u(Or,{onBack:J,onNext:t,viewSwitch:s?void 0:/* @__PURE__ */u(qr,{view:W,onChange:I}),onDragStateChange:c}):/* @__PURE__ */u(d,{children:/* @__PURE__ */u(Yo,{game:Q,propositions:b,selections:k,onToggleSelection:v,onNext:()=>{L(),t?.()},onBack:J,loading:N,error:F,theme:x,hideActions:!0,initialSport:C??A,renderTeamLogo:B,disableQuickPick:!0,selectedPropositionCount:S,onPropositionCountChange:z,gameCategory:M,headerExtra:s?void 0:/* @__PURE__ */u(qr,{view:W,onChange:I})})})}),!r&&!q&&!V&&!X&&/* @__PURE__ */u("div",{className:"mt-6",children:/* @__PURE__ */u($r,{onNext:t,onBack:n})})]})}function Xr({count:e,payout20:t,selected:n,onSelect:o,colors:r,bodyFont:l,extraBetAmount:a,buttonLabel:i,hidePayouts:s}){const c=null!=a&&20!==a,p=null!=t&&t>0&&c?t*(a/20):null;/* @__PURE__ */
|
|
209
|
+
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"},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]}),c?null!=p&&/* @__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:ht(p)}):/* @__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:ht(t)})]})]})}function Qr({tiers:e,selectedCount:t,onSelect:n,colors:o,bodyFont:r,extraBetAmount:l,buttonLabel:a,columnLabel:i="Legs",buildYourOwn:s,quickPickOnly:p,onQuickPick:f,collapsible:h,expanded:x,onExpandedChange:g,summaryTiers:y}){const[b,w]=c(!1),k=x??b,v=e.some(e=>e.payout20>0),N=null!=l&&20!==l,F=N?`$${Math.round(l)} returns`:"$20 returns",B=!!h&&!k,C=v&&!B,A=(y??e).reduce((e,t)=>t.payout20>e?t.payout20:e,0),M=N&&A>0?A*(l/20):A,S=e.length>0?82*e.length+8*Math.max(0,e.length-1):82;/* @__PURE__ */
|
|
210
|
+
return m("div",{style:{display:"flex",flexDirection:"column",gap:8,alignSelf:"stretch"},children:[/* @__PURE__ */m("div",{style:{display:"flex",flexDirection:"row",gap:8,overflowX:p?"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:o.textMuted,fontFamily:r,display:"flex",alignItems:"center"},children:p?"Quick Pick":i}),C&&/* @__PURE__ */m(d,{children:[/* @__PURE__ */u("div",{className:"py-1 text-xs",style:{color:o.textMuted,fontFamily:r,display:"flex",alignItems:"center"},children:"Dividend"}),/* @__PURE__ */u("div",{className:"py-1 text-xs",style:{color:o.textMuted,fontFamily:r,display:"flex",alignItems:"center"},children:F})]})]}),p?/* @__PURE__ */m("div",{style:{display:"flex",flexDirection:"column",gap:8,alignSelf:"flex-start",width:S},children:[/* @__PURE__ */u(Kr,{counts:(y??e).map(e=>e.count),onPick:e=>f?f(e):n(e),align:"left",direction:"up",colors:{background:o.background??"#ffffff",backgroundAlt:o.backgroundAlt??"#f3f4f6",border:o.border??"#e5e7eb",text:o.text??"#111827"}}),v&&!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:`${o.success}15`,color:o.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:`${o.primary}12`,color:o.primary,whiteSpace:"nowrap",alignSelf:"stretch",textAlign:"center"},children:ht(N?e.payout20*(l/20):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:`${o.success}15`,color:o.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:`${o.primary}12`,color:o.primary,whiteSpace:"nowrap",alignSelf:"stretch",textAlign:"center"},children:"—"})]})},e.count))})]}):s?/* @__PURE__ */m("div",{style:{display:"flex",flexDirection:"column",gap:8,alignSelf:"flex-start",width:S},children:[/* @__PURE__ */u("button",{type:"button",onClick:()=>n(e[0]?.count??0),className:"w-full py-1.5 rounded-lg border text-sm font-semibold transition-colors",style:{borderColor:o.buttonPrimary??o.primary,color:o.buttonPrimaryText??"#ffffff",backgroundColor:o.buttonPrimary??o.primary,cursor:"pointer",fontFamily:r},children:"Make Your Selections"}),v&&!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:`${o.success}15`,color:o.success,alignSelf:"stretch",textAlign:"center"},children:[e.count,"/",e.count]}),/* @__PURE__ */u("span",N?{className:"inline-flex items-center justify-center px-2 py-1 rounded-md text-xs font-bold",style:{backgroundColor:`${o.primary}12`,color:o.primary,whiteSpace:"nowrap",alignSelf:"stretch",textAlign:"center"},children:ht(e.payout20*(l/20))}:{className:"inline-flex items-center justify-center px-2 py-1 rounded-md text-xs font-bold",style:{backgroundColor:`${o.primary}12`,color:o.primary,whiteSpace:"nowrap",alignSelf:"stretch",textAlign:"center"},children:ht(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:`${o.success}15`,color:o.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:`${o.primary}12`,color:o.primary,whiteSpace:"nowrap",alignSelf:"stretch",textAlign:"center"},children:"—"})]})},e.count))})]}):e.map(e=>/* @__PURE__ */u(Xr,{count:e.count,payout20:e.payout20>0?e.payout20:null,selected:t===e.count,onSelect:()=>n(e.count),colors:o,bodyFont:r,extraBetAmount:l,buttonLabel:a,hidePayouts:B},e.count))]}),h&&(v?/* @__PURE__ */m("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 self-start max-w-full",style:{fontFamily:r},children:[/* @__PURE__ */m("span",{className:"text-xs font-semibold leading-snug",style:{color:o.text},children:["Win up to ",
|
|
211
|
+
/* @__PURE__ */u("span",{style:{color:o.heading??o.text??o.primary},children:ht(M)}),
|
|
212
|
+
/* @__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 Jr(e){return{game_id:e.selectedGame.id,rule_id:e.selectedRule?.id??null,proposition_ids:e.selectedPropositionIds,selections:e.selections,stake:e.betAmount}}function _r({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:f,answeredCount:h,selectedRule:x}=Lo(),g=o.colors,y=l?Ct(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,F=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}=$t(i,t);for(const r of n)c(r.id,"yes");for(const r of o)c(r.id,"no");d(t)},B=!f&&i.length>0,C=v?Array.from({length:w-b+1},(e,t)=>b+t):[],A=h>0?h:b||N;/* @__PURE__ */
|
|
213
|
+
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:L(o),fontFamily:r},children:"Place Your Wager"}),l&&/* @__PURE__ */u(qo,{onBack:t,hideActions:n,label:l.game_name})]}),B&&(C.length>1?/* @__PURE__ */u(Kr,{counts:C,onPick:e=>F(e),onDoubleAction:()=>F(A),colors:g,menuShadow:xe(o)}):/* @__PURE__ */u("div",{className:"flex-shrink-0",children:/* @__PURE__ */u(Do,{onPress:()=>F()})}))]})}function el({onBack:e,onSubmitted:t,authenticated:n=!0,onUnauthenticated:o,className:r=""}){const l=Lo(),{theme:a,selectedGame:i,expectedCorrect:s,betAmount:c,submitting:d,submitError:p,canSubmit:f,payouts:h,selectedPropositionIds:x,screenSize:g}=l,y=a.colors;if(!i)return null;const b=h[s]??0,w=At(i),k=s===x.length,v=w?.enabled&&k;/* @__PURE__ */
|
|
214
|
+
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:[ht(b),v&&/* @__PURE__ */u("span",{style:{color:y.warning},children:" + Jackpot"})]})]}),
|
|
215
|
+
/* @__PURE__ */u(je,{theme:a,variant:"primary",disabled:!f,onPress:async()=>{n?(await l.handleSubmit(),t?.()):o?.(Jr(l))},children:n?d?"Placing…":`Place Entry (${ht(c)})`:"Log in to place entry"})]})]})}function tl({onBack:e,onSubmitted:t,authenticated:n=!0,onUnauthenticated:o,hideTitle:r,hideActions:a,className:i=""}){const s=Lo(),{theme:c,bodyFont:p,selectedGame:f,selectedPropositions:h,selections:x,propositions:g,disableQuickPick:y,selectedPropositionCount:b,selectedEventId:w,expectedCorrect:k,setExpectedCorrect:v,betAmount:N,setBetAmount:F,submitting:B,submitError:C,canSubmit:A,winningCounts:M,payouts:S,overloadPayouts:z,renderTeamLogo:L,userBalance:P,onRecharge:D,goBack:O,toggleSelection:T,upgradePropositionCount:E,goToSportSelection:j,selectedRule:Y}=s,H=c.colors;if(l(()=>{f||(j(),e?.())},[f,j,e]),!f)return null;const R=!!(f.allowed_propositions&&f.allowed_propositions.length>0),G=Ct(f,b,Y),W=G.min,I=bn(f)&&w?Math.min(G.max,g.length):G.max,U=Object.keys(x).length,K=W>0&&U<W,Z=!R&&W>0&&I>W&&U>=W&&U<I,$=R?[...f.allowed_propositions??[]].sort((e,t)=>e-t).filter(e=>e>(b??0)):[],q=R&&$.length>0&&!K,V=Z||q,X=I-U;H.textAlt??H.text,W>0&&W===I||I||g.length;const Q=()=>{O(),e?.()},J=(R?[...f.allowed_propositions??[]].sort((e,t)=>t-e):[]).find(e=>e===U&&e<(b??1/0)),_=R&&U<Math.min(...f.allowed_propositions??[1/0]),ee=R&&K&&!_,te=yr(f),ne=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.";if(!l.every((e,t)=>e===a+t)||l[l.length-1]!==n)return 2===l.length&&0===l[0]&&l[1]===n?`Get all ${n} picks right — or all ${n} wrong — to win.`:`Get exactly ${l.join(" or ")} of your ${n} picks right to win.`;const i=l.map(e=>o?.[e]).filter(e=>Number.isFinite(e));if(i.length===l.length&&i.length>1&&i.every((e,t)=>0===t||e>i[t-1]))return`Get ${a} of your ${n} picks right to start winning — every pick after that grows the prize.`;const s=n-a;return`Get ${a} of your ${n} picks right to win — up to ${1===s?"one miss":`${s} misses`} still pays.`}(Y,M,U,S),oe=null!=J?te.belowRequiredHint(J,b??W):te.belowRequiredAddOnlyHint(b??W);return l(()=>{!K||R&&!_||Q()},[K,R,_]),/* @__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(_r,{onBack:e,hideActions:a})}),
|
|
216
|
+
/* @__PURE__ */u("div",{className:"flex-1",children:/* @__PURE__ */u(Ro,{game:f,propositions:h,selections:x,onToggleSelection:T,onRemoveSelection:()=>{},onSubmit:async()=>{n?(await s.handleSubmit(),t?.()):o?.(Jr(s))},onBack:Q,loading:B,error:C,expectedCorrect:k,onExpectedCorrectChange:v,betAmount:N,onBetAmountChange:F,theme:c,showCustomAmount:!0,betAmountLocked:no(f),betAmountLockedNote:"Set by your dividend ladder rung.",hideActions:!0,winningCounts:M,payouts:S,renderTeamLogo:L,canSubmit:A,authenticated:n,userBalance:P,onRecharge:D,boostBanner:/* @__PURE__ */m(d,{children:[ne&&/* @__PURE__ */m("div",{className:"p-3 rounded-lg border mb-2",style:{backgroundColor:`${H.primary}08`,borderColor:`${H.primary}30`},children:[/* @__PURE__ */u("p",{className:"text-[10px] font-bold uppercase tracking-[0.1em] mb-1",style:{color:H.textMuted},children:"How you win"}),/* @__PURE__ */u("p",{className:"text-xs sm:text-sm",style:{color:H.text},children:ne})]}),ee&&/* @__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:`${H.warning}10`,borderColor:`${H.warning}40`},children:[/* @__PURE__ */m("p",{className:"text-xs sm:text-sm",style:{color:H.text},children:["You have ",
|
|
216
217
|
/* @__PURE__ */m("span",{style:{fontWeight:700},children:[U," pick",1!==U?"s":""]}),"."," ",oe]}),/* @__PURE__ */m("div",{className:"flex gap-2 flex-shrink-0",children:[/* @__PURE__ */u("button",{type:"button",onClick:Q,className:"px-3 py-1.5 rounded-lg text-xs font-semibold transition-colors",style:{color:H.buttonSecondaryText,backgroundColor:H.buttonSecondary,cursor:"pointer"},children:"Add a pick"}),null!=J&&/* @__PURE__ */u("button",{type:"button",onClick:()=>E(J),className:"px-3 py-1.5 rounded-lg text-xs font-semibold transition-colors",style:{color:H.buttonPrimaryText,backgroundColor:H.buttonPrimary,cursor:"pointer"},children:te.switchTierLabel(J)})]})]}),V&&/* @__PURE__ */u("div",{className:"p-3 rounded-lg border",style:{backgroundColor:`${H.primary}08`,borderColor:`${H.primary}30`},children:q?(()=>{const e=b??U,t=z[e],n=N>0?N:20,o=null!=t&&t>0?t*(n/20):null;/* @__PURE__ */
|
|
217
218
|
return m("div",{children:[
|
|
218
219
|
/* @__PURE__ */u("p",{className:"text-sm font-semibold mb-1",style:{color:H.primary},children:te.overloadTitle}),null!=o&&/* @__PURE__ */m("p",{className:"text-xs mb-2",style:{color:H.textMuted},children:["Currently winning up to"," ",
|
|
219
|
-
/* @__PURE__ */u("span",{style:{color:H.heading??H.text,fontWeight:700},children:
|
|
220
|
-
/* @__PURE__ */u(
|
|
221
|
-
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:L(o),fontFamily:r},children:"Entry Placed!"}),/* @__PURE__ */u(
|
|
222
|
-
/* @__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
|
|
223
|
-
/* @__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:B},children:C})]}),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:B},children:
|
|
220
|
+
/* @__PURE__ */u("span",{style:{color:H.heading??H.text,fontWeight:700},children:ht(o)})," ","with ",e," picks"]}),
|
|
221
|
+
/* @__PURE__ */u(Qr,{tiers:$.map(e=>({count:e,payout20:z[e]??0})),selectedCount:void 0,onSelect:e=>{E(e),Q()},colors:H,bodyFont:s.bodyFont,extraBetAmount:20!==n?n:void 0,columnLabel:te.tableColumnLabel,buttonLabel:te.tierButtonLabel})]})})():/* @__PURE__ */m("div",{className:"flex items-center justify-between gap-3",children:[/* @__PURE__ */m("p",{className:"text-xs",style:{color:H.textMuted},children:[1===X?"Add ":"Add up to ",/* @__PURE__ */m("span",{style:{color:H.primary,fontWeight:700},children:[X," more pick",1!==X?"s":""]})]}),/* @__PURE__ */u("button",{type:"button",onClick:Q,className:"flex-shrink-0 px-3 py-1.5 rounded-lg text-xs font-semibold transition-colors",style:{color:H.buttonPrimaryText,backgroundColor:H.buttonPrimary,cursor:"pointer"},children:"Add picks"})]})})]})})}),a&&C&&/* @__PURE__ */u("div",{className:"mt-3 flex justify-end",children:/* @__PURE__ */u("span",{className:"text-xs",style:{color:H.error},children:C})})]})}function nl({className:e="",onBack:t,hideActions:n}){const{theme:o,headingFont:r,placedEntry:l}=Lo(),a=o.colors;/* @__PURE__ */
|
|
222
|
+
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:L(o),fontFamily:r},children:"Entry Placed!"}),/* @__PURE__ */u(qo,{onBack:t,hideActions:n,children:/* @__PURE__ */u("p",{className:"text-sm",style:{color:a.textMuted},children:l?/* @__PURE__ */m(d,{children:["Entry"," ",
|
|
223
|
+
/* @__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 ol({onPlayAgain:e,onDone:t,onShare:n,className:o=""}){const{theme:r,reset:l,placedEntry:a,selectedGame:i,selectedPropositions:s,selections:c,betAmount:d}=Lo();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 rl({onPlayAgain:t,onDone:n,onBack:o,onShare:r,hideTitle:l,hideActions:a,className:i=""}){const s=Lo(),{theme:c,bodyFont:p,headingFont:f,selectedGame:h,placedEntry:x,betAmount:g,selectedPropositionIds:y,selectedPropositions:b,selections:w,payouts:k,onShare:v}=s,N=c.colors,F=R(c),B=N.textAlt??N.text,C=x?.proposition_ids?x.proposition_ids.length:y.length,A=k[C]??null,M=e.useRef(!1);return e.useEffect(()=>{x&&h?M.current=!1:(s.goToSportSelection(),M.current||(M.current=!0,t?t():n?.()))},[x,h,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(nl,{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:F,borderColor:N.border,boxShadow:he(c)},children:[/* @__PURE__ */m("div",{className:"flex items-center justify-between gap-3 mb-3",children:[(()=>{const e=h?h.allowed_propositions&&h.allowed_propositions.length>0&&h.game_name.replace(/\s+\d+\s*$/,"").trim()||h.game_name:"Entry summary";return h?/* @__PURE__ */u("div",{className:"min-w-0 flex-1",children:/* @__PURE__ */u(Wo,{iconUrl:Ae(h),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:L(c),fontFamily:f},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:[C," pick",1!==C?"s":""]})]}),/* @__PURE__ */m("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3",children:[
|
|
224
|
+
/* @__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:B},children:C})]}),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:B},children:ht(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:ht(A)})]})]})]}),b.length>0&&/* @__PURE__ */m("div",{className:"p-4 sm:p-5 rounded-xl border",style:{backgroundColor:F,borderColor:N.border,boxShadow:he(c)},children:[/* @__PURE__ */u("h4",{className:"text-sm sm:text-base font-semibold mb-2",style:{color:L(c),fontFamily:f},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__ */
|
|
224
225
|
return m("div",{className:"flex items-center gap-2 py-2 px-3 rounded",style:{backgroundColor:N.backgroundAlt},children:[
|
|
225
226
|
/* @__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}),
|
|
226
|
-
/* @__PURE__ */m("div",{className:"flex-1 min-w-0",children:[/* @__PURE__ */m("p",{className:"text-xs sm:text-sm font-medium truncate",style:{color:B},children:[!
|
|
227
|
-
/* @__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
|
|
228
|
-
return m("div",{className:`pl-2 ${e}`,children:[/* @__PURE__ */u("h1",{className:"text-xl sm:text-2xl font-bold",style:{color:L(o),fontFamily:r},children:"Your Entries"}),/* @__PURE__ */u(
|
|
229
|
-
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(
|
|
230
|
-
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
|
|
227
|
+
/* @__PURE__ */m("div",{className:"flex-1 min-w-0",children:[/* @__PURE__ */m("p",{className:"text-xs sm:text-sm font-medium truncate",style:{color:B},children:[!kt(e)&&/* @__PURE__ */m(d,{children:[e.home_team," ",
|
|
228
|
+
/* @__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 ll({className:e="",onBack:t,hideActions:n}){const{theme:o,headingFont:r}=Lo();/* @__PURE__ */
|
|
229
|
+
return m("div",{className:`pl-2 ${e}`,children:[/* @__PURE__ */u("h1",{className:"text-xl sm:text-2xl font-bold",style:{color:L(o),fontFamily:r},children:"Your Entries"}),/* @__PURE__ */u(qo,{onBack:t,hideActions:n})]})}function al({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:f,demoGames:h,demoPropositions:x,renderTeamLogo:g,filterSport:y}=Lo();/* @__PURE__ */
|
|
230
|
+
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(ll,{onBack:n,hideActions:r})}),/* @__PURE__ */u("div",{className:"flex-1",children:/* @__PURE__ */u(Io,{apiUrl:i,apiKey:s,fetchImpl:c,getAuthHeaders:d,userId:p,demoEntries:f,demoGames:h,demoPropositions:x,onSelectEntry:t,theme:l,renderTeamLogo:g,filterSport:y})})]})}function il(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 sl(){/* @__PURE__ */
|
|
231
|
+
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 cl({ink:e,ball:t,size:n,balls:o=1}){/* @__PURE__ */
|
|
231
232
|
return m("svg",{width:n,height:n,viewBox:"2 12 76 62",fill:"none","aria-hidden":!0,children:[
|
|
232
233
|
/* @__PURE__ */u("line",{x1:"9",y1:"18",x2:"71",y2:"18",stroke:e,strokeWidth:"2.5",strokeLinecap:"round"}),
|
|
233
234
|
/* @__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"}),
|
|
234
235
|
/* @__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"}),
|
|
235
|
-
/* @__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
|
|
236
|
+
/* @__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 dl({ink:e,ball:t,size:n}){/* @__PURE__ */
|
|
236
237
|
return m("svg",{width:n,height:n,viewBox:"0 0 100 100",fill:"none","aria-hidden":!0,children:[
|
|
237
238
|
/* @__PURE__ */u("circle",{cx:"50",cy:"50",r:"34",stroke:e,strokeWidth:3,opacity:.9}),
|
|
238
239
|
/* @__PURE__ */u("circle",{cx:"50",cy:"50",r:"23",stroke:e,strokeWidth:3,opacity:.65}),
|
|
239
240
|
/* @__PURE__ */u("circle",{cx:"50",cy:"50",r:"8",fill:t}),
|
|
240
241
|
/* @__PURE__ */u("line",{x1:"80",y1:"20",x2:"55",y2:"45",stroke:e,strokeWidth:4,strokeLinecap:"round"}),
|
|
241
|
-
/* @__PURE__ */u("path",{d:"M50 50 l8 -3 -3 8 z",fill:e})]})}function
|
|
242
|
+
/* @__PURE__ */u("path",{d:"M50 50 l8 -3 -3 8 z",fill:e})]})}function ul({ink:e,ball:t,size:n}){const o=[{x:16,h:22},{x:40,h:40},{x:64,h:60}];/* @__PURE__ */
|
|
242
243
|
return m("svg",{width:n,height:n,viewBox:"0 0 100 100",fill:"none","aria-hidden":!0,children:[
|
|
243
244
|
/* @__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)),
|
|
244
245
|
/* @__PURE__ */u("path",{d:"M14 60 L38 48 L62 30 L86 14",stroke:e,strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),
|
|
245
|
-
/* @__PURE__ */u("path",{d:"M86 14 l-9 1 M86 14 l1 9",stroke:e,strokeWidth:"3",strokeLinecap:"round"})]})}function
|
|
246
|
-
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 ${
|
|
247
|
-
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:
|
|
246
|
+
/* @__PURE__ */u("path",{d:"M86 14 l-9 1 M86 14 l1 9",stroke:e,strokeWidth:"3",strokeLinecap:"round"})]})}function ml({kind:e,balls:t,...n}){return"safety_net"===e?/* @__PURE__ */u(cl,{...n,balls:t}):/* @__PURE__ */u("pick"===e?ul:dl,{...n})}function pl({kind:e,size:t=56,balls:n}){const{theme:o}=Lo(),r=o.colors,l=o.brand?.chip??r.primary,a=o.brand?.icon??r.primaryText,i=E(o);/* @__PURE__ */
|
|
247
|
+
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 ${il(a,.16)}`,flexShrink:0,boxShadow:`0 8px 18px -12px ${il(l,.9)}`},children:/* @__PURE__ */u(ml,{kind:e,ink:a,ball:i,balls:n,size:Math.round(.68*t)})})}function fl({option:e,renderDividends:t}){const{theme:n}=Lo(),o=n.colors,r=be(n),l=o.primary,a=E(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__ */
|
|
248
|
+
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:ht(t.payout20)})]},t.misses)})]})}function hl({option:e,renderDividends:t}){const{theme:n}=Lo(),r=n.colors,i=ye(n),f=xe(n),h=e.dividends??[],x=h.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(h.length,1)+12,F=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);F();const e=()=>y(!1),t=()=>F();return window.addEventListener("scroll",e,!0),window.addEventListener("resize",t),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",t)}},[g,F]),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 B=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:f,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]}),h.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?ht(e.payout20):"—"})]},e.misses))]})}),document.body):null;/* @__PURE__ */
|
|
248
249
|
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 ",
|
|
249
|
-
/* @__PURE__ */u("span",{style:{color:r.heading??r.text},children:
|
|
250
|
-
/* @__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"})]}),B]})}function
|
|
251
|
-
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 ${
|
|
252
|
-
/* @__PURE__ */u(
|
|
250
|
+
/* @__PURE__ */u("span",{style:{color:r.heading??r.text},children:ht(x)}),
|
|
251
|
+
/* @__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"})]}),B]})}function xl({kind:e,option:t,onSelect:n,renderDividends:o}){const{theme:r}=Lo(),l=r.colors,a=be(r),i=L(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,f=p&&!!t.dividendsInline;/* @__PURE__ */
|
|
252
|
+
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 ${il(i,.7)}`},onMouseEnter:e=>{e.currentTarget.style.borderColor=s,e.currentTarget.style.boxShadow=`0 18px 36px -24px ${il(s,.95)}`},onMouseLeave:e=>{e.currentTarget.style.borderColor=l.border,e.currentTarget.style.boxShadow=`0 10px 24px -20px ${il(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:[
|
|
253
|
+
/* @__PURE__ */u(pl,{kind:e,balls:d,size:60}),
|
|
253
254
|
/* @__PURE__ */m("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[
|
|
254
|
-
/* @__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:
|
|
255
|
-
/* @__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:
|
|
256
|
-
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(
|
|
255
|
+
/* @__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:il(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))})]}),
|
|
256
|
+
/* @__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:il(i,.08)},children:/* @__PURE__ */u(f?fl:hl,{option:t,renderDividends:o})})]})}function gl({className:e="",onBack:t,hideActions:n}){const{theme:o,selectedGame:r,selectedPropositionCount:l}=Lo(),a=be(o),i=o.colors,s=Jn(r,l);/* @__PURE__ */
|
|
257
|
+
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(qo,{onBack:t,hideActions:n,label:r?`${r.game_name}${s?.subtitle?` · ${s.subtitle}`:""}`:void 0})]})}function yl({onContinue:e,canContinue:t,continueLabel:n="Continue",className:o=""}){const{theme:r,screenSize:l}=Lo(),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 bl({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:f,screenSize:h}=Lo(),x=s.colors,g="mobile"===h,y=ye(s),b=be(s),w=L(s),k=E(s),v=i(()=>o??Jn(c,d),[o,c,d]),N=v?.options??[],F=t=>{null!=t?.expectedCorrect&&p(t.expectedCorrect),null!=t?.propositionCount&&f(t.propositionCount),e?.()};if(!c||!v)/* @__PURE__ */return u("div",{className:a,style:{color:x.textMuted,fontFamily:y},children:"No rule setup required."});const B=v.kind,C=v.headline??v.heroTitle,A=v.continueLabel??"Continue";/* @__PURE__ */
|
|
257
258
|
return m("div",{className:`blade-rp flex min-h-full w-full flex-col ${a}`,style:{fontFamily:y},children:[
|
|
258
|
-
/* @__PURE__ */u(
|
|
259
|
+
/* @__PURE__ */u(sl,{}),t&&/* @__PURE__ */u($o,{onBack:t,label:l}),
|
|
259
260
|
/* @__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}),
|
|
260
261
|
/* @__PURE__ */m("header",{className:"blade-rp-in mb-6 flex flex-col items-center text-center sm:mb-7",children:[
|
|
261
|
-
/* @__PURE__ */u(
|
|
262
|
-
/* @__PURE__ */u(
|
|
262
|
+
/* @__PURE__ */u(Wo,{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}),(C||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??C})]}),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(xl,{kind:B,option:e,onSelect:()=>F(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 ${il(w,.7)}`,animationDelay:".06s"},onMouseEnter:e=>{e.currentTarget.style.borderColor=x.primary,e.currentTarget.style.boxShadow=`0 18px 36px -24px ${il(x.primary,.95)}`},onMouseLeave:e=>{e.currentTarget.style.borderColor=x.border,e.currentTarget.style.boxShadow=`0 10px 24px -20px ${il(w,.7)}`},children:/* @__PURE__ */m("button",{type:"button",onClick:()=>F(),"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:[
|
|
263
|
+
/* @__PURE__ */u(pl,{kind:B,size:60}),
|
|
263
264
|
/* @__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))}),
|
|
264
|
-
/* @__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
|
|
265
|
-
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 ${
|
|
265
|
+
/* @__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 wl(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 kl({iconUrl:e,size:t=56}){const{theme:n}=Lo(),o=n.colors,r=n.brand?.chip??o.primary,l=n.brand?.icon??o.primaryText,a=j(r,E(n),l);/* @__PURE__ */
|
|
266
|
+
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 ${wl(l,.16)}`,flexShrink:0,boxShadow:`0 8px 18px -12px ${wl(r,.9)}`},children:/* @__PURE__ */u(Qt,{iconUrl:e,width:Math.round(.68*t),height:Math.round(.68*t),iconColor:l,accentColor:a})})}function vl({eyebrow:e,iconUrl:t,gameName:n,tagline:o,className:r=""}){const{theme:l,screenSize:a}=Lo(),i=l.colors,s=be(l),c="mobile"===a;/* @__PURE__ */
|
|
266
267
|
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}),
|
|
267
|
-
/* @__PURE__ */u(
|
|
268
|
-
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
|
|
269
|
-
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
|
|
270
|
-
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 ${
|
|
271
|
-
/* @__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:
|
|
272
|
-
/* @__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:
|
|
273
|
-
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
|
|
274
|
-
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(
|
|
268
|
+
/* @__PURE__ */u(Wo,{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 Nl({smGridClassName:e,ariaLabel:t,children:n}){/* @__PURE__ */
|
|
269
|
+
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 Fl="w-[124px] shrink-0 snap-start sm:w-auto sm:shrink";function Bl({legs:e,prizeBall:t=!0}){const{theme:n}=Lo(),o=n.colors.primary,r=E(n);/* @__PURE__ */
|
|
270
|
+
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 Cl({tile:e,label:t,stat:n,detail:o,onSelect:r,children:l}){const{theme:a}=Lo(),i=a.colors,s=be(a),c=L(a),d=i.primary,p=i.selectionCard??i.backgroundAlt;/* @__PURE__ */
|
|
271
|
+
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 ${wl(c,.7)}`},onMouseEnter:e=>{e.currentTarget.style.borderColor=d,e.currentTarget.style.boxShadow=`0 18px 36px -24px ${wl(d,.95)}`},onMouseLeave:e=>{e.currentTarget.style.borderColor=i.border,e.currentTarget.style.boxShadow=`0 10px 24px -20px ${wl(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,
|
|
272
|
+
/* @__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:wl(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))})]}),
|
|
273
|
+
/* @__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:wl(c,.08)},children:l})]})}function Al(){/* @__PURE__ */
|
|
274
|
+
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 Ml({className:e="",onBack:t,hideActions:n}){const{theme:o,selectedGame:r}=Lo(),l=be(o),a=o.colors;/* @__PURE__ */
|
|
275
|
+
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(qo,{onBack:t,hideActions:n,label:r?.game_name})]})}function Sl({onQuickPick:e,onPickYourOwn:t,onBack:n,hideTitle:o,config:r,backLabel:l="Games",className:a=""}){const{theme:s,selectedGame:d,selectedPropositionCount:p,handlePropositionCountChange:f,setExpectedCorrect:h,setBetAmount:x,quickPickGame:g,goToSportSelection:y}=Lo(),b=s.colors,w=ye(s),k=be(s),v=L(s),N=R(s),F=i(()=>r??_o(d),[r,d]),[B,C]=c(()=>F?null!=p&&F.legOptions.includes(p)?p:F.defaultLegs:8),[A,M]=c(()=>F?.defaultStake??20);if(!d||!Qo(d)||!F)/* @__PURE__ */return u("div",{className:a,style:{color:b.textMuted,fontFamily:w},children:"No game set available."});const S=Jo(A,B,{operatorMargin:F.operatorMargin,perLegProbability:F.perLegProbability}),z=A>=F.minStake,P=(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__ */
|
|
275
276
|
return m("div",{className:`blade-gsb flex min-h-full w-full flex-col ${a}`,style:{fontFamily:w},children:[
|
|
276
277
|
/* @__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"}),
|
|
277
|
-
/* @__PURE__ */u(
|
|
278
|
+
/* @__PURE__ */u(Al,{}),n&&/* @__PURE__ */u($o,{onBack:n,label:l}),
|
|
278
279
|
/* @__PURE__ */m("div",{className:"mx-auto flex w-full flex-1 flex-col",children:[
|
|
279
|
-
/* @__PURE__ */u(
|
|
280
|
-
/* @__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 ${
|
|
280
|
+
/* @__PURE__ */u(vl,{className:"blade-gsb-in",eyebrow:o?null:"The fastest multi",iconUrl:Ae(d),gameName:d.game_name,tagline:F.tagline}),
|
|
281
|
+
/* @__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 ${wl(v,.7)}`,animationDelay:".06s"},children:[P("Legs",`${B} legs`),
|
|
281
282
|
/* @__PURE__ */u("div",{className:"flex flex-wrap gap-1.5",role:"radiogroup","aria-label":"Number of legs",children:F.legOptions.map(e=>{const t=e===B;/* @__PURE__ */
|
|
282
283
|
return u("button",{type:"button",role:"radio","aria-checked":t,onClick:()=>C(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)})}),
|
|
283
284
|
/* @__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"})]}),
|
|
284
|
-
/* @__PURE__ */m("div",{className:"mt-4",children:[P("Stake",
|
|
285
|
+
/* @__PURE__ */m("div",{className:"mt-4",children:[P("Stake",ht(A)),
|
|
285
286
|
/* @__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:F.minStake,max:F.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!==F.maxStake?Math.min(t,F.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"}})]}),
|
|
286
287
|
/* @__PURE__ */u("div",{className:"mt-2 flex flex-wrap gap-1.5",children:F.quickStakes.map(e=>{const t=e===A;/* @__PURE__ */
|
|
287
|
-
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)})}),!z&&A>0&&/* @__PURE__ */m("p",{className:"mt-2 text-xs",style:{color:b.error},children:["Minimum stake is ",
|
|
288
|
-
/* @__PURE__ */m("div",{className:"mt-4 border-t pt-3",style:{borderColor:
|
|
289
|
-
/* @__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 ",B," land"]}),/* @__PURE__ */m("span",{children:[
|
|
290
|
-
/* @__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(
|
|
288
|
+
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)})}),!z&&A>0&&/* @__PURE__ */m("p",{className:"mt-2 text-xs",style:{color:b.error},children:["Minimum stake is ",ht(F.minStake),"."]})]}),
|
|
289
|
+
/* @__PURE__ */m("div",{className:"mt-4 border-t pt-3",style:{borderColor:wl(v,.08)},children:[
|
|
290
|
+
/* @__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 ",B," land"]}),/* @__PURE__ */m("span",{children:[ht(A)," returns"]})]}),
|
|
291
|
+
/* @__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(Bl,{legs:B})]}),/* @__PURE__ */u("span",{className:"text-xl font-extrabold tabular-nums sm:text-2xl",style:{color:b.primary,fontFamily:k},children:ht(S.prize)})]}),
|
|
291
292
|
/* @__PURE__ */m("p",{className:"mt-1.5 text-[11px] tabular-nums",style:{color:b.textMuted},children:[(D=S.multiple,`×${(Math.round(10*D)/10).toLocaleString("en-US",{maximumFractionDigits:1})}`)," your stake · total return, stake included"]}),
|
|
292
293
|
/* @__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."})]})]}),
|
|
293
|
-
/* @__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(
|
|
294
|
-
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(
|
|
294
|
+
/* @__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(Cl,{tile:/* @__PURE__ */u(kl,{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:()=>{z&&(f(B),h(B),x(A),y(),t?.())}})}),/* @__PURE__ */u("div",{className:"blade-gsb-in",style:{animationDelay:".2s"},children:/* @__PURE__ */u(Cl,{tile:/* @__PURE__ */u(kl,{iconUrl:`${ve}quickpick`,size:60}),label:"QuickPick for me",stat:"Fastest",detail:["We fill every leg for you","Straight to the bet slip"],onSelect:()=>{z&&(h(B),x(A),g(d,B),e?.())}})})]})]})]});var D}function zl({className:e="",onBack:t,hideActions:n}){const{theme:o,selectedGame:r}=Lo(),l=be(o),a=o.colors;/* @__PURE__ */
|
|
295
|
+
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(qo,{onBack:t,hideActions:n,label:r?.game_name})]})}function Ll({onQuickPick:e,onPickYourOwn:t,onBack:n,hideTitle:o,config:r,backLabel:l="Games",className:a=""}){const{theme:s,selectedGame:d,selectedPropositionCount:p,handlePropositionCountChange:f,setExpectedCorrect:h,setBetAmount:x,quickPickGame:g,goToSportSelection:y}=Lo(),b=s.colors,w=ye(s),k=be(s),v=L(s),N=R(s),F=i(()=>r??ao(d),[r,d]),[B,C]=c(()=>F?.defaultDividend??1e4),[A,M]=c(()=>{const e=F?.dividends[0]?.rungs.map(e=>e.legs)??[];return null!=p&&e.includes(p)?p:F?.defaultLegs??9});if(!d||!no(d)||!F)/* @__PURE__ */return u("div",{className:a,style:{color:b.textMuted,fontFamily:w},children:"No dividend series available."});const S=F.dividends.find(e=>e.dividend===B)??F.dividends[0],z=S.rungs.find(e=>e.legs===A)??S.rungs[0],P=Math.max(...S.rungs.map(e=>e.legs)),D=Math.min(...S.rungs.map(e=>e.legs));/* @__PURE__ */
|
|
295
296
|
return m("div",{className:`blade-pyd flex min-h-full w-full flex-col ${a}`,style:{fontFamily:w},children:[
|
|
296
297
|
/* @__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"}),
|
|
297
|
-
/* @__PURE__ */u(
|
|
298
|
+
/* @__PURE__ */u(Al,{}),n&&/* @__PURE__ */u($o,{onBack:n,label:l}),
|
|
298
299
|
/* @__PURE__ */m("div",{className:"mx-auto flex w-full flex-1 flex-col",children:[
|
|
299
|
-
/* @__PURE__ */u(
|
|
300
|
-
/* @__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 ${
|
|
301
|
-
/* @__PURE__ */u(
|
|
302
|
-
return m("button",{type:"button",role:"radio","aria-checked":t,onClick:()=>C(e.dividend),className:`rounded-xl border px-2 py-3 text-center transition-colors ${
|
|
300
|
+
/* @__PURE__ */u(vl,{className:"blade-pyd-in",eyebrow:o?null:"Pick your dividend",iconUrl:Ae(d),gameName:d.game_name,tagline:F.tagline}),
|
|
301
|
+
/* @__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 ${wl(v,.7)}`,animationDelay:".06s"},children:[(O=ht(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"}),O&&/* @__PURE__ */u("span",{className:"text-xs font-semibold tabular-nums",style:{color:v},children:O})]})),
|
|
302
|
+
/* @__PURE__ */u(Nl,{smGridClassName:"sm:grid-cols-4",ariaLabel:"Set dividend",children:F.dividends.map(e=>{const t=e.dividend===B;/* @__PURE__ */
|
|
303
|
+
return m("button",{type:"button",role:"radio","aria-checked":t,onClick:()=>C(e.dividend),className:`rounded-xl border px-2 py-3 text-center transition-colors ${Fl}`,style:{backgroundColor:t?wl(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:ht(e.dividend)}),/* @__PURE__ */m("span",{className:"mt-1 block text-[10px]",style:{color:b.textMuted},children:["from ",ht(e.rungs[0]?.stake??0)]})]},e.dividend)})}),
|
|
303
304
|
/* @__PURE__ */u("p",{className:"mt-2 text-[11px] italic",style:{color:b.textMuted},children:"One set amount — it does not move, whatever you spend."}),
|
|
304
|
-
/* @__PURE__ */m("div",{className:"mt-4 border-t pt-3",style:{borderColor:
|
|
305
|
+
/* @__PURE__ */m("div",{className:"mt-4 border-t pt-3",style:{borderColor:wl(v,.08)},children:[
|
|
305
306
|
/* @__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"})]}),
|
|
306
307
|
/* @__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__ */
|
|
307
|
-
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?
|
|
308
|
-
/* @__PURE__ */u("span",{className:"hidden sm:inline",children:e.legs===P?" · the long climb":e.legs===D?" · the sprint":""})]}),/* @__PURE__ */u(
|
|
308
|
+
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?wl(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",
|
|
309
|
+
/* @__PURE__ */u("span",{className:"hidden sm:inline",children:e.legs===P?" · the long climb":e.legs===D?" · the sprint":""})]}),/* @__PURE__ */u(Bl,{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:ht(e.stake)})]},e.legs)})}),
|
|
309
310
|
/* @__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."})]})]}),
|
|
310
|
-
/* @__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(
|
|
311
|
-
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(
|
|
311
|
+
/* @__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(Cl,{tile:/* @__PURE__ */u(kl,{iconUrl:Ae(d),size:60}),label:"Pick my own",stat:"Your calls",detail:[`A clean yes or no on all ${z.legs} legs`,`${ht(z.stake)} chasing the ${ht(S.dividend)}`],onSelect:()=>{var e;f((e=z).legs),h(e.legs),x(e.stake),y(),t?.()}})}),/* @__PURE__ */u("div",{className:"blade-pyd-in",style:{animationDelay:".2s"},children:/* @__PURE__ */u(Cl,{tile:/* @__PURE__ */u(kl,{iconUrl:`${ve}quickpick`,size:60}),label:"QuickPick for me",stat:"Fastest",detail:[`We fill all ${z.legs} legs at ${ht(z.stake)}`,"Straight to the bet slip"],onSelect:()=>{h(z.legs),x(z.stake),g(d,z.legs),e?.()}})})]})]})]});var O}function Pl({className:e="",onBack:t,hideActions:n}){const{theme:o,selectedGame:r}=Lo(),l=be(o),a=o.colors;/* @__PURE__ */
|
|
312
|
+
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(qo,{onBack:t,hideActions:n,label:r?.game_name})]})}function Dl({onQuickPick:t,onPickYourOwn:n,onBack:o,hideTitle:r,config:l,backLabel:a="Games",className:s=""}){const{theme:d,selectedGame:p,selectedPropositionCount:f,handlePropositionCountChange:h,setExpectedCorrect:x,setBetAmount:g,quickPickGame:y,goToSportSelection:b,screenSize:w}=Lo(),k=d.colors,v="mobile"===w,N=ye(d),F=be(d),B=L(d),C=E(d),A=R(d),M=i(()=>l??sr(p),[l,p]),[S,z]=c(()=>M?null!=f&&M.ladders.some(e=>e.legs===f)?f:M.defaultLegs:8),[P,D]=c(()=>M?.defaultStake??50),[O,T]=c(!1);if(!p||!or(p)||!M)/* @__PURE__ */return u("div",{className:s,style:{color:k.textMuted,fontFamily:N},children:"No ladders available."});const j=M.ladders.find(e=>e.legs===S)??M.ladders[0],Y=lr(j,P),H=ar(j,P),G=[...Y].reverse(),W=v&&G.length>4,I=W&&!O?G.slice(0,3):G,U=(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:B},children:t})]});/* @__PURE__ */
|
|
312
313
|
return m("div",{className:`blade-lad flex min-h-full w-full flex-col ${s}`,style:{fontFamily:N},children:[
|
|
313
314
|
/* @__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"}),
|
|
314
|
-
/* @__PURE__ */u(
|
|
315
|
+
/* @__PURE__ */u(Al,{}),o&&/* @__PURE__ */u($o,{onBack:o,label:a}),
|
|
315
316
|
/* @__PURE__ */m("div",{className:"mx-auto flex w-full flex-1 flex-col",children:[
|
|
316
|
-
/* @__PURE__ */u(
|
|
317
|
-
/* @__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 ${
|
|
317
|
+
/* @__PURE__ */u(vl,{className:"blade-lad-in",eyebrow:r?null:"Climb the ladder. Stack the prizes.",iconUrl:Ae(p),gameName:p.game_name,tagline:M.tagline}),
|
|
318
|
+
/* @__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 ${wl(B,.7)}`,animationDelay:".06s"},children:[U("Your bet",ht(P)),
|
|
318
319
|
/* @__PURE__ */u("div",{className:"flex flex-wrap gap-1.5",role:"radiogroup","aria-label":"Bet size",children:M.stakes.map(e=>{const t=e===P;/* @__PURE__ */
|
|
319
320
|
return m("button",{type:"button",role:"radio","aria-checked":t,onClick:()=>D(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)})}),
|
|
320
321
|
/* @__PURE__ */u("p",{className:"mt-2 text-[11px] italic",style:{color:k.textMuted},children:"Every prize scales with your bet."}),
|
|
321
|
-
/* @__PURE__ */m("div",{className:"mt-4",children:[U(`${M.ladders.length} ladders to choose from`),/* @__PURE__ */u(
|
|
322
|
-
return m("button",{type:"button",role:"radio","aria-checked":t,onClick:()=>z(e.legs),className:`rounded-xl border px-2 py-3 text-center transition-colors ${
|
|
322
|
+
/* @__PURE__ */m("div",{className:"mt-4",children:[U(`${M.ladders.length} ladders to choose from`),/* @__PURE__ */u(Nl,{smGridClassName:"sm:grid-cols-5",ariaLabel:"Ladder",children:M.ladders.map(e=>{const t=e.legs===S;/* @__PURE__ */
|
|
323
|
+
return m("button",{type:"button",role:"radio","aria-checked":t,onClick:()=>z(e.legs),className:`rounded-xl border px-2 py-3 text-center transition-colors ${Fl}`,style:{backgroundColor:t?wl(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:[
|
|
323
324
|
/* @__PURE__ */m("span",{className:"block text-[10px] font-bold uppercase tracking-[0.1em]",style:{color:k.primary},children:["Ladder ",e.legs]}),
|
|
324
|
-
/* @__PURE__ */u("span",{className:"mt-1 block text-lg font-extrabold leading-none tracking-tight tabular-nums sm:text-xl",style:{color:B,fontFamily:F},children:
|
|
325
|
+
/* @__PURE__ */u("span",{className:"mt-1 block text-lg font-extrabold leading-none tracking-tight tabular-nums sm:text-xl",style:{color:B,fontFamily:F},children:ht(ar(e,P))}),
|
|
325
326
|
/* @__PURE__ */m("span",{className:"mt-1 block text-[10px]",style:{color:k.textMuted},children:["Win from ",e.firstPayingTier," right"]})]},e.legs)})})]}),
|
|
326
|
-
/* @__PURE__ */m("div",{className:"mt-4 border-t pt-3",style:{borderColor:
|
|
327
|
+
/* @__PURE__ */m("div",{className:"mt-4 border-t pt-3",style:{borderColor:wl(B,.08)},children:[
|
|
327
328
|
/* @__PURE__ */m("p",{className:"mb-2 text-xs",style:{color:k.text},children:["Ladder ",j.legs," wins from ",j.firstPayingTier," right — every tier stacks into the"," ",
|
|
328
|
-
/* @__PURE__ */u("span",{style:{fontWeight:700,color:B},children:
|
|
329
|
+
/* @__PURE__ */u("span",{style:{fontWeight:700,color:B},children:ht(H)})," Full Stack Prize."]}),
|
|
329
330
|
/* @__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:[
|
|
330
331
|
/* @__PURE__ */u("span",{className:"text-[10px] font-semibold uppercase tracking-[0.1em]",style:{color:k.textMuted},children:"Get right"}),
|
|
331
332
|
/* @__PURE__ */u("span",{className:"text-right text-[10px] font-semibold uppercase tracking-[0.1em]",style:{color:k.textMuted},children:"Tier pays"}),
|
|
332
333
|
/* @__PURE__ */u("span",{className:"text-right text-[10px] font-semibold uppercase tracking-[0.1em]",style:{color:k.textMuted},children:"You collect"}),I.map(t=>{const n=t.atLeast===j.legs;/* @__PURE__ */
|
|
333
334
|
return m(e.Fragment,{children:[
|
|
334
|
-
/* @__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 ",j.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:
|
|
335
|
-
/* @__PURE__ */u("span",{className:"text-right text-[11px] tabular-nums",style:{color:k.textMuted},children:
|
|
336
|
-
/* @__PURE__ */u("span",{className:"text-right text-sm font-extrabold tabular-nums sm:text-base",style:{color:k.primary,fontFamily:F},children:
|
|
335
|
+
/* @__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 ",j.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:wl(C,.35),color:B},children:"Full stack"})]}),/* @__PURE__ */u(Bl,{legs:t.atLeast,prizeBall:n})]}),
|
|
336
|
+
/* @__PURE__ */u("span",{className:"text-right text-[11px] tabular-nums",style:{color:k.textMuted},children:ht(t.prize)}),
|
|
337
|
+
/* @__PURE__ */u("span",{className:"text-right text-sm font-extrabold tabular-nums sm:text-base",style:{color:k.primary,fontFamily:F},children:ht(t.cumulative)})]},t.atLeast)})]}),W&&/* @__PURE__ */u("button",{type:"button",onClick:()=>T(e=>!e),"aria-expanded":O,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:O?"Show fewer tiers":`Show all ${G.length} tiers`}),
|
|
337
338
|
/* @__PURE__ */m("p",{className:"mt-2 text-[11px] italic",style:{color:k.textMuted},children:["Land below ",j.firstPayingTier," right and the ticket does not pay."]})]})]}),
|
|
338
|
-
/* @__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(
|
|
339
|
-
return m("span",{className:"flex items-center gap-[3px]","aria-hidden":!0,children:[Array.from({length:e}).map((e,n)=>/* @__PURE__ */u("span",{style:{width:5,height:5,borderRadius:1.5,backgroundColor:t?o:"transparent",border:t?"none":`1px solid ${
|
|
340
|
-
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(
|
|
339
|
+
/* @__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(Cl,{tile:/* @__PURE__ */u(kl,{iconUrl:Ae(p),size:60}),label:"Pick my own",stat:"Your calls",detail:[`A clean yes or no on all ${j.legs} outcomes`,`Win from ${j.firstPayingTier} right — every tier stacks`],onSelect:()=>{h(j.legs),x(j.legs),g(P),b(),n?.()}})}),/* @__PURE__ */u("div",{className:"blade-lad-in",style:{animationDelay:".2s"},children:/* @__PURE__ */u(Cl,{tile:/* @__PURE__ */u(kl,{iconUrl:`${ve}quickpick`,size:60}),label:"QuickPick for me",stat:"Fastest",detail:[`We fill all ${j.legs} legs at ${ht(P)}`,"Straight to the bet slip"],onSelect:()=>{x(j.legs),g(P),y(p,j.legs),t?.()}})})]})]})]})}function Ol({legs:e,right:t}){const{theme:n}=Lo(),o=n.colors.primary,r=E(n);/* @__PURE__ */
|
|
340
|
+
return m("span",{className:"flex items-center gap-[3px]","aria-hidden":!0,children:[Array.from({length:e}).map((e,n)=>/* @__PURE__ */u("span",{style:{width:5,height:5,borderRadius:1.5,backgroundColor:t?o:"transparent",border:t?"none":`1px solid ${wl(o,.45)}`,opacity:t?.85:1}},n)),/* @__PURE__ */u("span",{style:{width:7,height:7,borderRadius:999,backgroundColor:r,marginLeft:2}})]})}function Tl({className:e="",onBack:t,hideActions:n}){const{theme:o,selectedGame:r}=Lo(),l=be(o),a=o.colors;/* @__PURE__ */
|
|
341
|
+
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(qo,{onBack:t,hideActions:n,label:r?.game_name})]})}function El({onQuickPick:e,onPickYourOwn:t,onBack:n,hideTitle:o,config:r,backLabel:l="Games",className:a=""}){const{theme:s,selectedGame:d,selectedPropositionCount:p,handlePropositionCountChange:f,setExpectedCorrect:h,setBetAmount:x,quickPickGame:g,goToSportSelection:y}=Lo(),b=s.colors,w=ye(s),k=be(s),v=L(s),N=R(s),F=i(()=>r??fr(d),[r,d]),[B,C]=c(()=>F?null!=p&&F.legOptions.includes(p)?p:F.defaultLegs:8),[A,M]=c(()=>F?.defaultStake??20);if(!d||!mr(d)||!F)/* @__PURE__ */return u("div",{className:a,style:{color:b.textMuted,fontFamily:w},children:"No mirror available."});const S=pr(A,B,{operatorMargin:F.operatorMargin,perLegProbability:F.perLegProbability}),z=A>=F.minStake,P=(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})]}),D=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 sm:text-[13px]",style:{color:b.text},children:e?`All ${B} right`:`All ${B} wrong`}),/* @__PURE__ */u(Ol,{legs:B,right:e})]}),/* @__PURE__ */u("span",{className:"text-lg font-extrabold tabular-nums sm:text-xl",style:{color:b.primary,fontFamily:k},children:ht(S.prize)})]});/* @__PURE__ */
|
|
341
342
|
return m("div",{className:`blade-mir flex min-h-full w-full flex-col ${a}`,style:{fontFamily:w},children:[
|
|
342
343
|
/* @__PURE__ */u("style",{id:"blade-mir-styles",children:"\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"}),
|
|
343
|
-
/* @__PURE__ */u(
|
|
344
|
+
/* @__PURE__ */u(Al,{}),n&&/* @__PURE__ */u($o,{onBack:n,label:l}),
|
|
344
345
|
/* @__PURE__ */m("div",{className:"mx-auto flex w-full flex-1 flex-col",children:[
|
|
345
|
-
/* @__PURE__ */u(
|
|
346
|
-
/* @__PURE__ */m("div",{className:"blade-mir-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 ${
|
|
346
|
+
/* @__PURE__ */u(vl,{className:"blade-mir-in",eyebrow:o?null:"All right, or all wrong",iconUrl:Ae(d),gameName:d.game_name,tagline:F.tagline}),
|
|
347
|
+
/* @__PURE__ */m("div",{className:"blade-mir-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 ${wl(v,.7)}`,animationDelay:".06s"},children:[P("Legs",`${B} legs`),
|
|
347
348
|
/* @__PURE__ */u("div",{className:"flex flex-wrap gap-1.5",role:"radiogroup","aria-label":"Number of legs",children:F.legOptions.map(e=>{const t=e===B;/* @__PURE__ */
|
|
348
349
|
return u("button",{type:"button",role:"radio","aria-checked":t,onClick:()=>C(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)})}),
|
|
349
350
|
/* @__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 sweep"}),/* @__PURE__ */u("span",{children:"Bigger prize"})]}),
|
|
350
|
-
/* @__PURE__ */m("div",{className:"mt-4",children:[P("Stake",
|
|
351
|
+
/* @__PURE__ */m("div",{className:"mt-4",children:[P("Stake",ht(A)),
|
|
351
352
|
/* @__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:F.minStake,max:F.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!==F.maxStake?Math.min(t,F.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"}})]}),
|
|
352
353
|
/* @__PURE__ */u("div",{className:"mt-2 flex flex-wrap gap-1.5",children:F.quickStakes.map(e=>{const t=e===A;/* @__PURE__ */
|
|
353
|
-
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)})}),!z&&A>0&&/* @__PURE__ */m("p",{className:"mt-2 text-xs",style:{color:b.error},children:["Minimum stake is ",
|
|
354
|
-
/* @__PURE__ */m("div",{className:"mt-4 border-t pt-3",style:{borderColor:
|
|
355
|
-
/* @__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:"Two ways to win"}),/* @__PURE__ */m("span",{children:[
|
|
354
|
+
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)})}),!z&&A>0&&/* @__PURE__ */m("p",{className:"mt-2 text-xs",style:{color:b.error},children:["Minimum stake is ",ht(F.minStake),"."]})]}),
|
|
355
|
+
/* @__PURE__ */m("div",{className:"mt-4 border-t pt-3",style:{borderColor:wl(v,.08)},children:[
|
|
356
|
+
/* @__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:"Two ways to win"}),/* @__PURE__ */m("span",{children:[ht(A)," pays each"]})]}),
|
|
356
357
|
/* @__PURE__ */m("div",{className:"mt-1.5 flex flex-col gap-2",children:[D(!0),D(!1)]}),
|
|
357
358
|
/* @__PURE__ */u("p",{className:"mt-2 text-[11px] italic",style:{color:b.textMuted},children:"Anything in between — a split card — does not pay."})]})]}),
|
|
358
|
-
/* @__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(
|
|
359
|
-
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(
|
|
359
|
+
/* @__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(Cl,{tile:/* @__PURE__ */u(kl,{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:()=>{z&&(f(B),h(B),x(A),y(),t?.())}})}),/* @__PURE__ */u("div",{className:"blade-mir-in",style:{animationDelay:".2s"},children:/* @__PURE__ */u(Cl,{tile:/* @__PURE__ */u(kl,{iconUrl:`${ve}quickpick`,size:60}),label:"QuickPick for me",stat:"Fastest",detail:["We fill every leg for you","Straight to the bet slip"],onSelect:()=>{z&&(h(B),x(A),g(d,B),e?.())}})})]})]})]})}function jl({className:e="",onBack:t,hideActions:n}){const{theme:o,selectedGame:r}=Lo(),l=be(o),a=o.colors;/* @__PURE__ */
|
|
360
|
+
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(qo,{onBack:t,hideActions:n,label:r?.game_name})]})}function Yl({onQuickPick:e,onPickYourOwn:t,onBack:n,hideTitle:o,config:r,backLabel:l="Games",className:a=""}){const{theme:s,selectedGame:d,selectedPropositionCount:p,handlePropositionCountChange:f,setExpectedCorrect:h,setBetAmount:x,setSelectedRuleId:g,quickPickGame:y,goToSportSelection:b}=Lo(),w=s.colors,k=ye(s),v=be(s),N=L(s),F=R(s),B=i(()=>r??qn(d),[r,d]),[C,A]=c(()=>B?.defaultModeId??"extra_shot"),[M,S]=c(()=>{const e=B?.modes.find(e=>e.id===(B?.defaultModeId??"extra_shot"));return e?null!=p&&e.legOptions.includes(p)?p:e.defaultLegs:8}),[z,P]=c(()=>B?.defaultStake??20);if(!d||!Yn(d)||!B)/* @__PURE__ */return u("div",{className:a,style:{color:w.textMuted,fontFamily:k},children:"No safety net available."});const D=B.modes.find(e=>e.id===C)??B.modes[0],O=Wn(z,M,D.allowedMisses,B.pricing),T=e=>{const t=Math.max(0,Math.round(100*e)/100);return null!==B.maxStake?Math.min(t,B.maxStake):t},E=z>=B.minStake,j=(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})]}),Y=(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),H=[{label:"Perfect",amount:O.perfect},...O.nearMiss.map((e,t)=>({label:`All but ${t+1}`,amount:e}))];/* @__PURE__ */
|
|
360
361
|
return m("div",{className:`blade-sn flex min-h-full w-full flex-col ${a}`,style:{fontFamily:k},children:[
|
|
361
362
|
/* @__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"}),
|
|
362
|
-
/* @__PURE__ */u(
|
|
363
|
+
/* @__PURE__ */u(Al,{}),n&&/* @__PURE__ */u($o,{onBack:n,label:l}),
|
|
363
364
|
/* @__PURE__ */m("div",{className:"mx-auto flex w-full flex-1 flex-col",children:[
|
|
364
|
-
/* @__PURE__ */u(
|
|
365
|
-
/* @__PURE__ */m("div",{className:"blade-sn-in rounded-3xl border-2 px-4 py-4 sm:px-5 sm:py-5",style:{backgroundColor:F,borderColor:w.border,boxShadow:`0 10px 24px -20px ${
|
|
365
|
+
/* @__PURE__ */u(vl,{className:"blade-sn-in",eyebrow:o?null:"Choose your safety net",iconUrl:Ae(d),gameName:d.game_name,tagline:B.tagline}),
|
|
366
|
+
/* @__PURE__ */m("div",{className:"blade-sn-in rounded-3xl border-2 px-4 py-4 sm:px-5 sm:py-5",style:{backgroundColor:F,borderColor:w.border,boxShadow:`0 10px 24px -20px ${wl(N,.7)}`,animationDelay:".06s"},children:[j("Safety net",D.label),
|
|
366
367
|
/* @__PURE__ */u("div",{className:"flex flex-wrap gap-1.5",role:"radiogroup","aria-label":"Safety net mode",children:B.modes.map(e=>Y(e.id,e.label,e.id===D.id,()=>(e=>{const t=B.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)))}),
|
|
367
368
|
/* @__PURE__ */u("p",{className:"mt-2 text-xs leading-snug sm:text-[13px]",style:{color:w.textMuted},children:D.explain}),
|
|
368
369
|
/* @__PURE__ */m("div",{className:"mt-4",children:[j("Legs",`${M} legs`),
|
|
369
370
|
/* @__PURE__ */u("div",{className:"flex flex-wrap gap-1.5",role:"radiogroup","aria-label":"Number of legs",children:D.legOptions.map(e=>Y(e,String(e),e===M,()=>S(e)))}),
|
|
370
371
|
/* @__PURE__ */m("div",{className:"mt-2 flex items-baseline justify-between text-[11px] italic",style:{color:w.textMuted},children:[/* @__PURE__ */u("span",{children:"Easier to land"}),/* @__PURE__ */u("span",{children:"Bigger prizes"})]})]}),
|
|
371
|
-
/* @__PURE__ */m("div",{className:"mt-4",children:[j("Stake",
|
|
372
|
+
/* @__PURE__ */m("div",{className:"mt-4",children:[j("Stake",ht(z)),
|
|
372
373
|
/* @__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:B.minStake,max:B.maxStake??void 0,step:"any",placeholder:"Enter stake","aria-label":"Stake amount",value:z||"",onChange:e=>{if(""===e.target.value)return void P(0);const t=Number(e.target.value);Number.isFinite(t)&&P(T(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"}})]}),
|
|
373
|
-
/* @__PURE__ */u("div",{className:"mt-2 flex flex-wrap gap-1.5",children:B.quickAdds.map(e=>/* @__PURE__ */m("button",{type:"button",onClick:()=>P(T((z||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))}),!E&&z>0&&/* @__PURE__ */m("p",{className:"mt-2 text-xs",style:{color:w.error},children:["Minimum stake is ",
|
|
374
|
-
/* @__PURE__ */m("div",{className:"mt-4 border-t pt-3",style:{borderColor:
|
|
375
|
-
/* @__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:[
|
|
376
|
-
/* @__PURE__ */m("div",{className:"mt-1.5 flex flex-col gap-1.5",children:[H.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:
|
|
374
|
+
/* @__PURE__ */u("div",{className:"mt-2 flex flex-wrap gap-1.5",children:B.quickAdds.map(e=>/* @__PURE__ */m("button",{type:"button",onClick:()=>P(T((z||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))}),!E&&z>0&&/* @__PURE__ */m("p",{className:"mt-2 text-xs",style:{color:w.error},children:["Minimum stake is ",ht(B.minStake),"."]})]}),
|
|
375
|
+
/* @__PURE__ */m("div",{className:"mt-4 border-t pt-3",style:{borderColor:wl(N,.08)},children:[
|
|
376
|
+
/* @__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:[ht(z)," returns"]})]}),
|
|
377
|
+
/* @__PURE__ */m("div",{className:"mt-1.5 flex flex-col gap-1.5",children:[H.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:ht(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:ht(Math.round(O.sweep))})]})]}),
|
|
377
378
|
/* @__PURE__ */u("p",{className:"mt-1.5 text-[11px]",style:{color:w.textMuted},children:"Total returns, stake included."}),
|
|
378
379
|
/* @__PURE__ */m("p",{className:"mt-1 text-[11px] italic",style:{color:w.textMuted},children:["Miss ",1===D.allowedMisses?"two":"three"," or more and the ticket does not pay."]})]})]}),
|
|
379
|
-
/* @__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(
|
|
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 or nothing"}),/* @__PURE__ */u(
|
|
380
|
+
/* @__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(Cl,{tile:/* @__PURE__ */u(kl,{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:()=>{E&&(g(D.ruleId),f(M),h(M-D.allowedMisses),x(z),b(),t?.())}})}),/* @__PURE__ */u("div",{className:"blade-sn-in",style:{animationDelay:".2s"},children:/* @__PURE__ */u(Cl,{tile:/* @__PURE__ */u(kl,{iconUrl:`${ve}quickpick`,size:60}),label:"QuickPick for me",stat:"Fastest",detail:["We fill every leg for you","Straight to the bet slip"],onSelect:()=>{E&&(g(D.ruleId),h(M-D.allowedMisses),x(z),y(d,M),e?.())}})})]})]})]})}function Hl({className:e="",onBack:t,hideActions:n}){const{theme:o,selectedGame:r}=Lo(),l=be(o),a=o.colors;/* @__PURE__ */
|
|
381
|
+
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(qo,{onBack:t,hideActions:n,label:r?.game_name})]})}function Rl({onQuickPick:e,onPickYourOwn:t,onBack:n,hideTitle:o,backLabel:r="Games",className:l=""}){const{theme:a,selectedGame:s,selectedPropositionCount:d,handlePropositionCountChange:p,setExpectedCorrect:f,quickPickGame:h,goToSportSelection:x}=Lo(),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}=Ct(s);return Zt(e,t)},[s]),w=gr(s),k=b[0]??0,v=b[b.length-1]??0,[N]=c(()=>null!=d&&b.includes(d)?d:v),F=i(()=>Jn(s,N||void 0),[s,N]);if(!s||0===b.length||"exact"!==F?.kind)/* @__PURE__ */return u("div",{className:l,style:{color:g.textMuted,fontFamily:y},children:"No setup available."});const B=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`],C=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__ */
|
|
381
382
|
return m("div",{className:`blade-pp flex min-h-full w-full flex-col ${l}`,style:{fontFamily:y},children:[
|
|
382
383
|
/* @__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"}),
|
|
383
|
-
/* @__PURE__ */u(
|
|
384
|
-
/* @__PURE__ */m("div",{className:"mx-auto flex w-full flex-1 flex-col",children:[/* @__PURE__ */u(
|
|
384
|
+
/* @__PURE__ */u(Al,{}),n&&/* @__PURE__ */u($o,{onBack:n,label:r}),
|
|
385
|
+
/* @__PURE__ */m("div",{className:"mx-auto flex w-full flex-1 flex-col",children:[/* @__PURE__ */u(vl,{className:"blade-pp-in",eyebrow:o?null:F.title,iconUrl:Ae(s),gameName:s.game_name,tagline:F.heroTagline}),/* @__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(Cl,{tile:/* @__PURE__ */u(kl,{iconUrl:Ae(s),size:60}),label:"Pick my own",stat:"Your calls",detail:B,onSelect:()=>{w||(p(N),f(N)),x(),t?.()}})}),/* @__PURE__ */u("div",{className:"blade-pp-in",style:{animationDelay:".2s"},children:/* @__PURE__ */u(Cl,{tile:/* @__PURE__ */u(kl,{iconUrl:`${ve}quickpick`,size:60}),label:"QuickPick for me",stat:"Fastest",detail:C,onSelect:()=>{f(N),h(s,N),e?.()}})})]})]})]})}function Gl({onPickYourOwn:e,onQuickPick:t,onBack:n,hideTitle:o,backLabel:r="Games",className:l=""}){const{theme:a,selectedGame:i,goToSportSelection:s,bodyFont:c}=Lo(),d={onPickYourOwn:e,onQuickPick:t,onBack:n,hideTitle:o,backLabel:r,className:l};switch(hr(i)){case"game_set":/* @__PURE__ */return u(Sl,{...d});case"pick_your_dividend":/* @__PURE__ */return u(Ll,{...d});case"ladder":/* @__PURE__ */return u(Dl,{...d});case"mirror":/* @__PURE__ */return u(El,{...d});case"safety_net":/* @__PURE__ */return u(Yl,{...d});case"rule_setup":return"exact"===Jn(i)?.kind?/* @__PURE__ */u(Rl,{...d}):/* @__PURE__ */u(bl,{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 Wl({iconUrl:e,gameName:t,nameLines:n,height:o=56,showTrademark:r=!0,className:l}){const{theme:a}=Lo(),i=L(a),s=E(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+/),f=.72*o,h=.5*o,x=Math.min(.62*o/p.length,.3*o);/* @__PURE__ */
|
|
385
386
|
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:[
|
|
386
|
-
/* @__PURE__ */u(
|
|
387
|
+
/* @__PURE__ */u(Qt,{iconUrl:e,width:f,height:f,iconColor:i,accentColor:s,ariaLabel:""}),
|
|
387
388
|
/* @__PURE__ */m("span",{"aria-hidden":!0,style:{fontSize:h,letterSpacing:.045*-h,lineHeight:1,whiteSpace:"nowrap"},children:[/* @__PURE__ */u("span",{style:{fontWeight:800},children:"YES"}),/* @__PURE__ */u("span",{style:{fontWeight:600},children:"NO"})]}),
|
|
388
389
|
/* @__PURE__ */u("span",{"aria-hidden":!0,style:{width:Math.max(2,Math.round(.045*o)),height:.78*o,backgroundColor:c,flexShrink:0}}),
|
|
389
|
-
/* @__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
|
|
390
|
+
/* @__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 Il="1.30.3";export{fo as BladeApiClient,Wl as BrandLockup,$e as CategoryIcon,Gr as CategoryPickerPage,Rr as CategoryPickerPageActions,Hr as CategoryPickerPageTitle,Ve as ChevronRightIcon,tl as ConfirmPage,el as ConfirmPageActions,_r as ConfirmPageTitle,Tn as DOUBLE_SHOT_MIN_LEGS,On as EXTRA_SHOT_MIN_LEGS,al as EntriesPage,ll as EntriesPageTitle,Ro as EntrySubmission,Ko as EventFilterBanner,Ur as EventPickerPage,Qe as FilterChipCarousel,Je as FilterChipRow,Mn as GAME_TIER_LEVEL,Sn as GAME_TIER_TABS,Io as GameEntries,Tr as GameLogo,kr as GamePage,wr as GamePageActions,br as GamePageTitle,po as GameSelector,Sl as GameSetBetPage,Ml as GameSetBetPageTitle,Gl as GameSetupPage,Ke as HowToPlayButton,Ue as HowToPlayModal,Ie as HowToPlayPanel,nr as LADDER_FAMILY,er as LADDER_REFERENCE_BET,tr as LADDER_STAKES,Dl as LadderPage,Pl as LadderPageTitle,Xe as LockIcon,cr as MIRROR_STANDARD_MARGIN,z as MarkdownContent,El as MirrorPage,Tl as MirrorPageTitle,to as PYD_LEG_RUNGS,eo as PYD_RETAIL_DIVIDENDS,Go as PayoutCircles,Rl as PerfectPickPage,Hl as PerfectPickPageTitle,Ll as PickYourDividendPage,zl as PickYourDividendPageTitle,Po as PlaceEntryProvider,Do as QuickPickButton,bl as RuleSetupPage,yl as RuleSetupPageActions,gl as RuleSetupPageTitle,Yl as SafetyNetPage,jl as SafetyNetPageTitle,Ho as SelectionReview,Vr as SelectionsPage,$r as SelectionsPageActions,Zr as SelectionsPageTitle,Yr as SportPickerPage,jr as SportPickerPageActions,Er as SportPickerPageTitle,rl as SuccessPage,ol as SuccessPageActions,nl as SuccessPageTitle,Pr as SwipeCard,Dr as SwipeCardFace,Or as SwipeDeck,vr as VISIBLE_DEPTH,Ze as YesNoCategoryLabel,we as applyTheme,Pn as availableGameTierTabs,It as contrastTextColour,q as darkTheme,Dn as defaultGameTierId,Z as defaultTheme,ee as defaultThemeSet,Ln as filterGamesByTierLevel,Cn as filterPropositionsToEvent,ht as formatCurrency,xt as formatDate,gn as formatSameGameMultiEventLabel,ar as fullStackPrize,_n as gameNeedsRuleSetup,Jo as gameSetPrize,yr as getConfirmBoostCopy,hr as getGameFlow,_o as getGameSetBetConfig,At as getJackpotInfo,sr as getLadderConfig,fr as getMirrorConfig,ao as getPickYourDividendConfig,wn as getPropositionEventId,Jn as getRuleSetupConfig,qn as getSafetyNetConfig,Hn as getSafetyNetPricing,Mt as getSportDisplayName,re as getTheme,le as getThemeSet,Q as goldLightTheme,V as goldTheme,ne as goldThemeSet,X as greenLightTheme,$ as greenTheme,te as greenThemeSet,gt as groupPropositionsBySport,kn as groupSameGameMultiEvents,xr as isFixedCardExactGame,Qo as isGameSetBetGame,or as isLadderGame,mr as isMirrorGame,gr as isOpenExactMultiGame,no as isPickYourDividendGame,Yn as isSafetyNetGame,bn as isSameGameMultiGame,Bn as isSelectableSameGameMultiProposition,K as isThemeSet,Bt as isValidSelectionCount,ir as ladderCollectAt,lr as ladderTiers,pr as mirrorPrize,An as propositionsBelongToEvent,lo as pydLadder,ro as pydRung,zt as resolveCategoryDisplayName,zn as resolveGameTierLevel,mt as resolvePrice,St as resolveSportDisplayName,U as resolveTheme,Rn as roundDividendAmount,In as safetyNetCollect,Wn as safetyNetTicket,E as themeAccent,ye as themeBodyFont,L as themeHeading,be as themeHeadingFont,P as themeLabel,ie as themeSets,Y as themeTextAlt,H as themeTextAltMuted,D as themeValue,ae as themes,ke as useBladeTheme,No as useCalculatePayout,wo as useCreateGameEntry,Fo as useEntryPreview,vo as useEvaluateRule,yo as useGameEntries,bo as useGameMaxPayouts,ho as useGames,Lo as usePlaceEntry,ko as usePlaceEntryFlow,xo as usePropositions,se as useResolvedTheme,go as useSports,Fr as useSwipeDeck,Il as version};
|