@simple-parlay/components 1.30.5 → 1.30.6-pre.10

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.
Files changed (131) hide show
  1. package/dist/index.cjs +1 -0
  2. package/dist/index.d.ts +1 -1
  3. package/dist/index.mjs +451 -374
  4. package/dist/react/components/CallGameCatalogue.d.ts +4 -0
  5. package/dist/react/components/CallPayoutTable.d.ts +6 -0
  6. package/dist/react/components/CallTicketBuilder.d.ts +3 -0
  7. package/dist/react/components/CorrelationChoicesSkeleton.d.ts +4 -0
  8. package/dist/react/components/CorrelationPricingDebug.d.ts +2 -0
  9. package/dist/react/components/CorrelationPropPlaceholder.d.ts +13 -0
  10. package/dist/react/components/DenseGameCatalogue.d.ts +2 -0
  11. package/dist/react/components/DenseUi.d.ts +30 -0
  12. package/dist/react/components/EntriesPage.d.ts +0 -4
  13. package/dist/react/components/EntrySubmission.d.ts +1 -1
  14. package/dist/react/components/EventSwipeModal.d.ts +19 -0
  15. package/dist/react/components/GameModeCard.d.ts +41 -6
  16. package/dist/react/components/GamePage.d.ts +3 -1
  17. package/dist/react/components/GameSelector.d.ts +9 -1
  18. package/dist/react/components/GameSetupPage.d.ts +6 -2
  19. package/dist/react/components/GameShelfCatalogue.d.ts +2 -0
  20. package/dist/react/components/GameShowcaseCatalogue.d.ts +9 -0
  21. package/dist/react/components/GameVariantCatalogue.d.ts +6 -0
  22. package/dist/react/components/HowToPlayButton.d.ts +3 -1
  23. package/dist/react/components/MatchRail.d.ts +30 -0
  24. package/dist/react/components/MultiLegTable.d.ts +3 -1
  25. package/dist/react/components/PageBackButton.d.ts +8 -0
  26. package/dist/react/components/PickerBrand.d.ts +7 -0
  27. package/dist/react/components/PlaceEntryProvider.d.ts +62 -5
  28. package/dist/react/components/PlaybookChooser.d.ts +7 -0
  29. package/dist/react/components/PropositionFilters.d.ts +3 -1
  30. package/dist/react/components/QuickPickButton.d.ts +3 -1
  31. package/dist/react/components/ScrollShelf.d.ts +25 -0
  32. package/dist/react/components/SelectionReview.d.ts +1 -1
  33. package/dist/react/components/SelectionVariantList.d.ts +20 -0
  34. package/dist/react/components/SelectionsPage.d.ts +1 -1
  35. package/dist/react/components/SportRail.d.ts +26 -0
  36. package/dist/react/components/SportSelector.d.ts +32 -2
  37. package/dist/react/components/_primitives/index.d.ts +9 -1
  38. package/dist/react/index.cjs +1 -0
  39. package/dist/react/index.d.ts +49 -16
  40. package/dist/react/index.mjs +451 -374
  41. package/dist/react/utils/dom.d.ts +7 -0
  42. package/dist/react/utils/index.d.ts +1 -1
  43. package/dist/react-native/components/CallGameCatalogue.d.ts +16 -0
  44. package/dist/react-native/components/CallPayoutTable.d.ts +6 -0
  45. package/dist/react-native/components/CallTicketBuilder.d.ts +33 -0
  46. package/dist/react-native/components/CorrelationChoicesSkeleton.d.ts +3 -0
  47. package/dist/react-native/components/CorrelationPricingDebug.d.ts +2 -0
  48. package/dist/react-native/components/CorrelationPropPlaceholder.d.ts +7 -0
  49. package/dist/react-native/components/DenseGameCatalogue.d.ts +2 -0
  50. package/dist/react-native/components/DenseUi.d.ts +59 -0
  51. package/dist/react-native/components/EntrySubmission.d.ts +1 -1
  52. package/dist/react-native/components/EventSwipeModal.d.ts +17 -0
  53. package/dist/react-native/components/GameModeCard.d.ts +41 -6
  54. package/dist/react-native/components/GamePage.d.ts +4 -1
  55. package/dist/react-native/components/GameSelector.d.ts +9 -1
  56. package/dist/react-native/components/GameSetupPage.d.ts +5 -14
  57. package/dist/react-native/components/GameShelfCatalogue.d.ts +7 -0
  58. package/dist/react-native/components/HowToPlayButton.d.ts +3 -1
  59. package/dist/react-native/components/LoadingIndicators.d.ts +1 -1
  60. package/dist/react-native/components/MatchRail.d.ts +36 -0
  61. package/dist/react-native/components/MultiLegTable.d.ts +3 -1
  62. package/dist/react-native/components/PageBackButton.d.ts +7 -0
  63. package/dist/react-native/components/PickerBrand.d.ts +6 -0
  64. package/dist/react-native/components/PlaceEntryProvider.d.ts +57 -5
  65. package/dist/react-native/components/PlaybookChooser.d.ts +7 -0
  66. package/dist/react-native/components/PropositionFilters.d.ts +3 -1
  67. package/dist/react-native/components/QuickPickButton.d.ts +3 -1
  68. package/dist/react-native/components/ScrollShelf.d.ts +23 -0
  69. package/dist/react-native/components/SelectionReview.d.ts +1 -1
  70. package/dist/react-native/components/SelectionVariantList.d.ts +20 -0
  71. package/dist/react-native/components/SelectionsPage.d.ts +1 -1
  72. package/dist/react-native/components/SportRail.d.ts +27 -0
  73. package/dist/react-native/components/SportSelector.d.ts +29 -2
  74. package/dist/react-native/components/_primitives/index.d.ts +12 -2
  75. package/dist/react-native/index.cjs +1 -0
  76. package/dist/react-native/index.d.ts +49 -16
  77. package/dist/react-native/index.mjs +438 -382
  78. package/dist/react-native/utils/index.d.ts +1 -1
  79. package/dist/shared/api-client.d.ts +4 -3
  80. package/dist/shared/call-presentation.d.ts +20 -0
  81. package/dist/shared/composite.d.ts +7 -0
  82. package/dist/shared/correlation-steering.d.ts +49 -0
  83. package/dist/shared/date-filters.d.ts +5 -4
  84. package/dist/shared/dense-ui.d.ts +54 -0
  85. package/dist/shared/favourite-sport.d.ts +2 -0
  86. package/dist/shared/game-artwork.d.ts +61 -0
  87. package/dist/shared/game-flow.d.ts +18 -1
  88. package/dist/shared/game-icons.d.ts +6 -3
  89. package/dist/shared/game-library.d.ts +58 -0
  90. package/dist/shared/game-set-bet.d.ts +0 -1
  91. package/dist/shared/game-shelf-artwork.d.ts +3 -0
  92. package/dist/shared/game-shelf-presentation.d.ts +43 -0
  93. package/dist/shared/game-variants.d.ts +5 -0
  94. package/dist/shared/hooks.d.ts +9 -8
  95. package/dist/shared/how-to-play-html.d.ts +1 -1
  96. package/dist/shared/how-to-play-logo.d.ts +1 -1
  97. package/dist/shared/menu-placement.d.ts +26 -0
  98. package/dist/shared/mirror.d.ts +88 -5
  99. package/dist/shared/pick-your-dividend.d.ts +2 -1
  100. package/dist/shared/picker-brand.d.ts +22 -0
  101. package/dist/shared/playbook.d.ts +29 -0
  102. package/dist/shared/selection-actions.d.ts +61 -0
  103. package/dist/shared/selection-caps.d.ts +68 -0
  104. package/dist/shared/selection-variants.d.ts +52 -0
  105. package/dist/shared/six-again.d.ts +105 -0
  106. package/dist/shared/swipe-deck.d.ts +1 -1
  107. package/dist/shared/themes.d.ts +22 -0
  108. package/dist/shared/types.d.ts +83 -3
  109. package/dist/shared/ui-system.d.ts +69 -0
  110. package/dist/shared/ui-variant.d.ts +16 -0
  111. package/dist/shared/use-call-payouts.d.ts +8 -0
  112. package/dist/shared/utils.d.ts +18 -6
  113. package/package.json +7 -8
  114. package/dist/index.js +0 -1
  115. package/dist/react/components/GameSetBetPage.d.ts +0 -21
  116. package/dist/react/components/LadderPage.d.ts +0 -21
  117. package/dist/react/components/MirrorPage.d.ts +0 -21
  118. package/dist/react/components/PerfectPickPage.d.ts +0 -22
  119. package/dist/react/components/PickYourDividendPage.d.ts +0 -21
  120. package/dist/react/components/RuleSetupPage.d.ts +0 -27
  121. package/dist/react/components/SafetyNetPage.d.ts +0 -16
  122. package/dist/react/index.js +0 -1
  123. package/dist/react/utils/design.d.ts +0 -55
  124. package/dist/react-native/components/GameSetBetPage.d.ts +0 -19
  125. package/dist/react-native/components/LadderPage.d.ts +0 -19
  126. package/dist/react-native/components/MirrorPage.d.ts +0 -19
  127. package/dist/react-native/components/PerfectPickPage.d.ts +0 -20
  128. package/dist/react-native/components/PickYourDividendPage.d.ts +0 -19
  129. package/dist/react-native/components/RuleSetupPage.d.ts +0 -23
  130. package/dist/react-native/components/SafetyNetPage.d.ts +0 -14
  131. package/dist/react-native/index.js +0 -1
@@ -13,11 +13,13 @@ import { Game } from './types';
13
13
  * Pricing (suite-standard 21.875% margin): the prize budget is the stake less
14
14
  * the margin, split equally across the two winning outcomes, so each side pays
15
15
  * prize = stake × (1 − margin) × 2^(N−1)
16
- * quoted EXACT — no rounding. Each extra leg exactly doubles the prize and the
17
- * margin holds flat at every leg count (RTP 78.125%).
16
+ * quoted in whole dollars — a dividend is advertised as $1,333, never
17
+ * $1,333.33. Each extra leg doubles the prize and the margin holds flat at
18
+ * every leg count (RTP 78.125%, within the cent the rounding moves).
18
19
  */
19
20
  /** Suite-standard operator margin for Mirror Standard. */
20
21
  export declare const MIRROR_STANDARD_MARGIN = 0.21875;
22
+ export declare function resolveMirrorMargin(stored: number | null | undefined): number;
21
23
  /** A live prize quote for a stake/legs combination. */
22
24
  export interface MirrorPrize {
23
25
  legs: number;
@@ -34,7 +36,7 @@ export interface MirrorPrize {
34
36
  oddsOneIn: number;
35
37
  }
36
38
  export interface MirrorConfig {
37
- /** Selectable leg counts, smallest first (official range 4–12). */
39
+ variant: MirrorVariant;
38
40
  legOptions: number[];
39
41
  /** Leg count preselected on entry. */
40
42
  defaultLegs: number;
@@ -49,10 +51,18 @@ export interface MirrorConfig {
49
51
  operatorMargin: number;
50
52
  perLegProbability: number;
51
53
  }
52
- /** Whether a game is a Mirror (routes to the one-screen Straight Mirror builder). */
54
+ /**
55
+ * The server rule behind each mirror. They are separate games in the catalogue,
56
+ * not a switch inside one — each carries its own tier, pricing and settlement,
57
+ * so the rule on the game is what says which mirror the player opened.
58
+ */
59
+ export declare const MIRROR_RULES: Record<MirrorVariantId, string>;
60
+ /** Whether a game is any of the mirrors (all route to the one-screen builder). */
53
61
  export declare function isMirrorGame(game: Game | null | undefined): boolean;
62
+ /** Which mirror this game is. Unknown rules fall back to the straight one. */
63
+ export declare function resolveMirrorVariantId(game: Game | null | undefined): MirrorVariantId;
54
64
  /**
55
- * Price a Mirror ticket: what each winning side pays, exact to the cent.
65
+ * Price a Mirror ticket: what each winning side pays, to the dollar.
56
66
  *
57
67
  * The prize is fixed at the fair 50/50 price — stake × (1 − margin) × 2^(N−1) —
58
68
  * so it is independent of `perLegProbability`; a skewed leg probability only
@@ -64,3 +74,76 @@ export declare function mirrorPrize(stake: number, legs: number, opts?: {
64
74
  }): MirrorPrize;
65
75
  /** Resolve the ticket-builder config for a Mirror game. */
66
76
  export declare function getMirrorConfig(game: Game | null | undefined): MirrorConfig | null;
77
+ export type MirrorVariantId = 'straight' | 'double' | 'triple';
78
+ export interface MirrorVariant {
79
+ id: MirrorVariantId;
80
+ name: string;
81
+ depth: number;
82
+ minLegs: number;
83
+ waysToWin: string;
84
+ description: string;
85
+ /** One-line hook under the lockup on this mirror's setup page. */
86
+ tagline: string;
87
+ tierNames: string[];
88
+ }
89
+ export declare const MIRROR_VARIANTS: MirrorVariant[];
90
+ export declare function getMirrorVariant(id: MirrorVariantId): MirrorVariant;
91
+ export interface MirrorTierPrize {
92
+ distance: number;
93
+ label: string;
94
+ correctCounts: number[];
95
+ prize: number;
96
+ outcomes: number;
97
+ }
98
+ export interface MirrorSuitePrize {
99
+ variant: MirrorVariantId;
100
+ legs: number;
101
+ stake: number;
102
+ tiers: MirrorTierPrize[];
103
+ totalOutcomes: number;
104
+ winningOutcomes: number;
105
+ oddsOneIn: number;
106
+ }
107
+ export declare function mirrorCombinations(n: number, k: number): number;
108
+ export declare function mirrorSuitePrize(variantId: MirrorVariantId, stake: number, legs: number, opts?: {
109
+ operatorMargin?: number;
110
+ }): MirrorSuitePrize;
111
+ /** Marks on a prize row: a call landed, a call missed. */
112
+ export declare const MIRROR_TICK = "\u2713";
113
+ export declare const MIRROR_CROSS = "\u2715";
114
+ /** One payable outcome: the two sweeps are two rows, not one "12 or 0" row. */
115
+ export interface MirrorPrizeRow {
116
+ /** Correct calls this row pays on — also how many ticks the row shows. */
117
+ correct: number;
118
+ label: string;
119
+ prize: number;
120
+ }
121
+ /**
122
+ * Flatten the tiers into one row per winning outcome. A tier reaching both
123
+ * edges pays twice, and quoting it as "12 or 0 of 12" reads as one way to win
124
+ * with strange wording — so each edge gets its own row and its own price.
125
+ */
126
+ export declare function mirrorPrizeRows(quote: MirrorSuitePrize): MirrorPrizeRow[];
127
+ /** A mirror in the catalogue, paired with the variant its rule names. */
128
+ export interface MirrorVariantGame {
129
+ variant: MirrorVariant;
130
+ game: Game;
131
+ }
132
+ /**
133
+ * The mirrors a player can switch between from `current`, straight first.
134
+ *
135
+ * The base mirror is the Straight Mirror and nothing else: on Signature it is
136
+ * one game with no depth to choose. The set of three lives on Premier, so only
137
+ * a Premier mirror offers the switch, and only to the mirrors sharing its tier.
138
+ * They are separate games, so the page can only offer what the catalogue
139
+ * carries — one mirror at that tier means no choice to make.
140
+ */
141
+ export declare function mirrorVariantGames(games: Game[], current: Game | null | undefined): MirrorVariantGame[];
142
+ /**
143
+ * The catalogue as the games menu should show it. A tier carrying a full
144
+ * mirror set lists one tile — the straight mirror, the set's front door —
145
+ * because its page is where the deeper two are chosen. A deeper mirror with no
146
+ * straight mirror beside it keeps its own tile, or there would be no way in.
147
+ */
148
+ export declare function collapseMirrorSet(games: Game[]): Game[];
149
+ export declare function mirrorVariantLegOptions(config: MirrorConfig, variantId: MirrorVariantId): number[];
@@ -15,7 +15,7 @@ import { Game } from './types';
15
15
  * that rung at an 18.62% margin. The dividend is never rounded — rounding
16
16
  * lives in the stake by construction.
17
17
  */
18
- /** Retail dividend tiers — "Seven set dividends, from $2,500 to $20,000". */
18
+ /** Retail dividend tiers — the set dividends, from $500 to $15,000. */
19
19
  export declare const PYD_RETAIL_DIVIDENDS: number[];
20
20
  /** Rungs offered per dividend, longest climb first (12 legs down to 6). */
21
21
  export declare const PYD_LEG_RUNGS: number[];
@@ -57,3 +57,4 @@ export declare function pydLadder(dividend: number, legs?: number[]): PydDividen
57
57
  export declare function getPickYourDividendConfig(game: Game | null | undefined, overrides?: {
58
58
  dividends?: number[];
59
59
  }): PickYourDividendConfig | null;
60
+ export declare function pydDividendForTicket(legs: number, stake: number, dividends?: number[]): number;
@@ -2,8 +2,30 @@ export declare const PICKER_BRAND: {
2
2
  readonly stone: "#DDD9D2";
3
3
  readonly teal: "#0F4C5C";
4
4
  readonly citron: "#DFFF1A";
5
+ readonly tealMid: "#4B7985";
6
+ readonly tealSoft: "#7B9DA5";
5
7
  };
6
8
  export declare const SPORT_SHORT_CODES: Record<string, string>;
9
+ /**
10
+ * What a league's acronym stands for. The sport track rides on short codes and
11
+ * swaps in the full names once it is wide enough to hold them, so the leagues
12
+ * whose display name *is* the acronym need a longer one to open into.
13
+ */
14
+ export declare const SPORT_LONG_NAMES: Record<string, string>;
15
+ export declare function getSportLongName(sport: string, fallback: string): string;
16
+ /**
17
+ * The pair of labels one sport track segment rides on: the code it shows at
18
+ * rest and the name it opens out to. `shown` is whatever the flow calls the
19
+ * sport — a host override, the API's label, or the derived name.
20
+ *
21
+ * A `shown` that is already an acronym *is* the code (deriving one from the raw
22
+ * key gave AFLW the code "RUG"), and a sport whose name is only its acronym
23
+ * opens out to the long form, if there is one to open into.
24
+ */
25
+ export declare function sportTrackLabels(sport: string, shown: string, sportBaseKey?: string | null): {
26
+ code: string;
27
+ name: string;
28
+ };
7
29
  export declare function getCategoryTagline(category: string): string;
8
30
  export declare function getSportShortCode(sport: string, sportBaseKey?: string | null, override?: string): string;
9
31
  export declare function getSportPickerTagline(count: number, selectedCategory?: string | null): string;
@@ -0,0 +1,29 @@
1
+ import { Game, TopPayoutsResponse } from './types';
2
+ import { GameTierId } from './game-tiers';
3
+ /**
4
+ * Playbook chooser: one featured hero above a comparison grid. The copy and
5
+ * numbers here are shared by the web and native twins so both read the same.
6
+ */
7
+ /** "Perfect Pick 8" → "Perfect Pick" when the count is chosen on the card. */
8
+ export declare function playbookName(game: Game): string;
9
+ /** The mechanic in one line — the Call catalogue's copy, with the set-card games told apart. */
10
+ export declare function playbookMechanic(game: Game): string;
11
+ export interface PlaybookHook {
12
+ amount: number;
13
+ count: number;
14
+ stake: number;
15
+ }
16
+ /** The payout hook: the dividend at the game's default count and the default stake. */
17
+ export declare function playbookHook(game: Game, payouts?: TopPayoutsResponse, stake?: number): PlaybookHook | null;
18
+ export declare function playbookTier(game: Game): {
19
+ id: GameTierId;
20
+ label: string;
21
+ };
22
+ export type PlaybookTierFilter = GameTierId | 'all';
23
+ /** Tier segments with counts; empty when every game sits in one tier. */
24
+ export declare function playbookTierTabs(games: readonly Game[]): {
25
+ id: PlaybookTierFilter;
26
+ label: string;
27
+ count: number;
28
+ }[];
29
+ export declare function playbookFilter(games: readonly Game[], tier: PlaybookTierFilter): Game[];
@@ -0,0 +1,61 @@
1
+ import { Game, TopPayoutsResponse } from './types';
2
+ /** Copy for the live slip docked under the selection list. */
3
+ export declare const SLIP_EMPTY_HINT = "Tap Yes or No to start building your multi.";
4
+ export declare const SLIP_STAKE_LABEL = "Your stake";
5
+ export declare const SLIP_DIVIDEND_LABEL = "Potential dividend";
6
+ export declare const SLIP_LEG_HINT = "Tap a leg to read it.";
7
+ export declare const SLIP_LEG_REMOVE = "Remove";
8
+ export declare const SLIP_CLEAR = "Clear bet";
9
+ export declare const SPORT_LOCKED_HINT = "One sport per bet.";
10
+ export declare const VIEW_LIST_GLYPH = "\u2630";
11
+ export declare const VIEW_SWIPE_GLYPH = "\u21C6";
12
+ export declare const VIEW_LIST_LABEL = "List";
13
+ export declare const VIEW_SWIPE_LABEL = "Swipe";
14
+ export interface LiveSlipLeg {
15
+ id: number;
16
+ /** 1-based position in the multi — the number printed on the tile. */
17
+ number: number;
18
+ side: 'yes' | 'no';
19
+ }
20
+ export interface LiveSlipInput {
21
+ /** Picks so far, keyed by proposition id. */
22
+ selections: Record<number, 'yes' | 'no'>;
23
+ /** Proposition ids in the order they should be numbered. */
24
+ order: number[];
25
+ /** Minimum picks before the multi is live (0 when the game has no minimum). */
26
+ minReq: number;
27
+ /** Maximum picks the card accepts (0 when unbounded). */
28
+ maxReq: number;
29
+ /** Stake the player has typed into the slip. */
30
+ stake: number;
31
+ /** Dividend for this many picks, normalised to a $20 bet. */
32
+ payout20?: number;
33
+ }
34
+ export interface LiveSlip {
35
+ legs: LiveSlipLeg[];
36
+ count: number;
37
+ dividend: number;
38
+ dividendText: string;
39
+ ctaLabel: string;
40
+ ctaDisabled: boolean;
41
+ atMax: boolean;
42
+ }
43
+ /**
44
+ * The bottom slip: every pick becomes a numbered leg tile, and the stake drives
45
+ * a dividend that moves on each pick. Dead until the minimum is reached.
46
+ */
47
+ export declare function buildLiveSlip({ selections, order, minReq, maxReq, stake, payout20, }: LiveSlipInput): LiveSlip;
48
+ /**
49
+ * Picks keep the order they were made in: existing legs hold their number, new
50
+ * ones land on the end. Returns `prev` untouched when nothing moved.
51
+ */
52
+ export declare function mergePickOrder(prev: number[], selections: Record<number, 'yes' | 'no'>): number[];
53
+ /**
54
+ * Dividend for a leg count, normalised to a $20 bet. Reads the game's own
55
+ * `/max-payout` table
56
+ */
57
+ export declare function payout20AtCount(payouts: TopPayoutsResponse | undefined, count: number, opts?: {
58
+ game?: Game | null;
59
+ expectedCorrect?: number;
60
+ stake?: number;
61
+ }): number;
@@ -0,0 +1,68 @@
1
+ import { Game, Proposition } from './types';
2
+ /**
3
+ * Which games ration the slots at all.
4
+ *
5
+ * Only Cross Game SGM: it is the product that invites several legs off one
6
+ * fixture, so it is the only one that has to hold them to one apiece. Same
7
+ * Game is already confined to a single fixture and priced for it, and every
8
+ * other game leaves the slots alone — nothing greyed, no slot chips drawn.
9
+ *
10
+ * No game means no caps, so a caller that forgets to pass one shows no
11
+ * limitation rather than an unexplained one.
12
+ */
13
+ export declare function selectionCapsApply(game?: Game | null): boolean;
14
+ export type MarketFamily = 'totals' | 'spread' | 'player';
15
+ export declare const MARKET_FAMILIES: MarketFamily[];
16
+ export declare const MARKET_CAPS: Record<MarketFamily, number>;
17
+ export declare function marketCaps(game?: Game | null): Record<MarketFamily, number>;
18
+ /** Slot names, as they read on a fixture header. */
19
+ export declare const MARKET_FAMILY_LABEL: Record<MarketFamily, string>;
20
+ /** How the market filter names each family — plural, since it picks many. */
21
+ export declare const MARKET_FAMILY_FILTER_LABEL: Record<MarketFamily, string>;
22
+ /** A raw feed market type as a filter chip reads it: `player_first_try` → "Player First Try". */
23
+ export declare function formatMarketTypeLabel(marketType: string): string;
24
+ export declare function slotTooltip(family: MarketFamily, filled: boolean): string;
25
+ /** Why a greyed row won't answer. */
26
+ export declare function capReason(family: MarketFamily): string;
27
+ /**
28
+ * Which slot a proposition spends, or null when it spends none.
29
+ *
30
+ * Market type first — it is the only field the feed guarantees a shape for —
31
+ * and the description second, for the markets whose type is a product name
32
+ * rather than a market key.
33
+ */
34
+ export declare function marketFamily(prop: Proposition): MarketFamily | null;
35
+ /**
36
+ * Every slot a proposition spends. A composite spends one per leg: "the total
37
+ * is over AND Hawthorn covers" is a total and a line bought together, so it
38
+ * blocks — and is blocked by — the singles that spend the same slots.
39
+ */
40
+ export declare function marketFamilies(prop: Proposition, componentById?: ReadonlyMap<number, Proposition> | null): MarketFamily[];
41
+ /**
42
+ * The fixture a proposition belongs to. Event id when the feed has one, the
43
+ * matchup otherwise; null when neither, which leaves the prop uncapped — with
44
+ * no fixture to count against there is no slot to spend.
45
+ */
46
+ export declare function capFixtureKey(prop: Proposition): string | null;
47
+ export interface SelectionCaps {
48
+ /** True when this prop's slot is already spent by a different pick in its fixture. */
49
+ isCapped: (prop: Proposition) => boolean;
50
+ /** Families already spent in a fixture — for the slot chips on its header. */
51
+ filledFor: (key: string | null) => ReadonlySet<MarketFamily>;
52
+ slotsFor: (key: string | null) => {
53
+ family: MarketFamily;
54
+ label: string;
55
+ filled: boolean;
56
+ }[];
57
+ }
58
+ /**
59
+ * Read the picks so far as spent slots. Everything the UI needs to grey a row
60
+ * or tick a chip comes off the returned object, so web and native ask the same
61
+ * question and get the same answer.
62
+ */
63
+ export declare function buildSelectionCaps(propositions: readonly Proposition[], selections: Record<number, 'yes' | 'no'>, componentById?: ReadonlyMap<number, Proposition> | null, game?: Game | null): SelectionCaps;
64
+ /**
65
+ * Quick pick's pool, thinned to what a player could have picked by hand — one
66
+ * slot per family per fixture, in the order it is handed (already shuffled).
67
+ */
68
+ export declare function takeWithinCaps(pool: readonly Proposition[], count: number, componentById?: ReadonlyMap<number, Proposition> | null, game?: Game | null): Proposition[];
@@ -0,0 +1,52 @@
1
+ import { Proposition } from './types';
2
+ /**
3
+ * Alternative shapes for the proposition list — YESNO's fixture-first designs,
4
+ * ported from the demo site. `undefined` means the packaged matchup list, which
5
+ * stays the default for every host that never asks for a variant.
6
+ *
7
+ * All of them are fed the same already-filtered, already-grouped propositions
8
+ * the default list draws, so date/market filters, composites, jerseys and the
9
+ * leg cap behave identically whichever one is on screen.
10
+ */
11
+ export type SelectionVariant = 'split' | 'split-inline' | 'call' | 'shelf' | 'playboard' | 'matchbook' | 'game-deck' | 'compact';
12
+ export declare const SELECTION_VARIANTS: SelectionVariant[];
13
+ /** One fixture (or race) and every question asked about it. */
14
+ export interface SelectionEvent {
15
+ /** The grouping key as `groupPropositionsForDisplay` produced it. */
16
+ key: string;
17
+ /** `Home vs Away`, the race name, or '' when the props carry no event at all. */
18
+ title: string;
19
+ home?: string;
20
+ away?: string;
21
+ /** No club badges and no `A v B` label — the race name stands alone. */
22
+ racing: boolean;
23
+ date: Date | null;
24
+ props: Proposition[];
25
+ }
26
+ export interface SelectionDay {
27
+ key: string;
28
+ /** '' for the trailing block of undated fixtures, which gets no header. */
29
+ label: string;
30
+ events: SelectionEvent[];
31
+ }
32
+ /** `Thu 14 Aug` — the day header above a block of fixtures. */
33
+ export declare function formatFixtureDay(date: Date): string;
34
+ /** `8:00pm` — kick-off time on a fixture header. */
35
+ export declare function formatFixtureTime(date: Date): string;
36
+ /**
37
+ * Three-letter badge code — the mascot, which is the last word of an
38
+ * Australian club name (`South Sydney Rabbitohs` → `RAB`).
39
+ */
40
+ export declare function teamCode(team: string | null | undefined): string;
41
+ /** `HAW v ADE` — a chip-sized fixture label; races and team-less groups keep their title. */
42
+ export declare function fixtureShortLabel(event: SelectionEvent): string;
43
+ /** Both teams in full — the selected match chip, when the rail has room. */
44
+ export declare function fixtureFullLabel(event: SelectionEvent): string;
45
+ /**
46
+ * Fixtures in kick-off order, split into day blocks; undated ones trail.
47
+ *
48
+ * Takes the output of `groupPropositionsForDisplay` rather than a flat list, so
49
+ * the variants group exactly as the default list does — same racing handling,
50
+ * same composite handling, same filtered pool.
51
+ */
52
+ export declare function groupSelectionDays(groups: Record<string, Proposition[]>, racing?: boolean): SelectionDay[];
@@ -0,0 +1,105 @@
1
+ import { Game } from './types';
2
+ /**
3
+ * YESNO 6 Again — the six-leg NRL card with two optional boosts.
4
+ *
5
+ * Six calls, every one a 50/50. Land all six and the base play pays
6
+ * `unit × 2^6 × (1 − margin)` — 50× at the suite-standard 21.875% margin.
7
+ * On top of the base play the player can buy either boost, each costing one
8
+ * more unit of stake:
9
+ *
10
+ * - **Golden Point** — doubles the perfect prize. Economically this is simply
11
+ * a second unit riding on the same bet, so it settles on the base rule.
12
+ * - **Captain's Challenge** — a side bet that collects `unit × 5` whenever the
13
+ * card lands five or six of six, and stacks on top of a winning slip. It
14
+ * changes the payout shape, so it settles on its own rule.
15
+ *
16
+ * The entry's `stake` is the TOTAL wager (unit × number of plays bought), so
17
+ * every server expression is written against the total. That is why the
18
+ * Captain's Challenge needs two rules — with Golden Point the total is three
19
+ * units, without it two, and the same prize is a different multiple of each:
20
+ *
21
+ * | boosts | stake | 6 of 6 | 5 of 6 | rule |
22
+ * |-------------------|-------|---------------|--------------|-----------------|
23
+ * | none | 1u | 50u = 50.0S | — | base |
24
+ * | Golden Point | 2u | 100u = 50.0S | — | base |
25
+ * | Challenge | 2u | 55u = 27.5S | 5u = 2.5S | challenge |
26
+ * | Golden + Challenge| 3u | 105u = 35.0S | 5u = 5S/3 | golden_challenge|
27
+ *
28
+ * Those multiples are the literals in the server rules' `expression` payout
29
+ * structures; they are derived from {@link SixAgainConfig.baseMultiple} and
30
+ * {@link SixAgainConfig.challengeMultiple} by {@link sixAgainStakeMultiples},
31
+ * so the two sides can be checked against each other rather than trusted.
32
+ */
33
+ /** Suite-standard operator margin — 2^6 × 0.78125 = a clean 50× perfect prize. */
34
+ export declare const SIX_AGAIN_MARGIN = 0.21875;
35
+ /** Legs on the card. "6 Again" is the six-again restart call — the six is the product. */
36
+ export declare const SIX_AGAIN_LEGS = 6;
37
+ /** Captain's Challenge collects this multiple of one unit on five or six of six. */
38
+ export declare const CHALLENGE_MULTIPLE = 5;
39
+ /** Misses the Captain's Challenge still collects on. */
40
+ export declare const CHALLENGE_MISSES = 1;
41
+ /** Golden Point doubles the perfect prize. */
42
+ export declare const GOLDEN_POINT_FACTOR = 2;
43
+ export type SixAgainBoostId = 'golden_point' | 'captains_challenge';
44
+ /** Which boosts are switched on. */
45
+ export type SixAgainBoosts = Record<SixAgainBoostId, boolean>;
46
+ export interface SixAgainBoost {
47
+ id: SixAgainBoostId;
48
+ label: string;
49
+ /** Extra units of stake this boost costs. */
50
+ costUnits: number;
51
+ }
52
+ export interface SixAgainConfig {
53
+ legs: number;
54
+ /** Smallest unit stake, and the step the stepper moves in. */
55
+ unitMin: number;
56
+ unitStep: number;
57
+ /** Largest unit stake — set so unit × every boost still fits the game's max bet. */
58
+ unitMax: number;
59
+ defaultUnit: number;
60
+ /** Perfect prize on the base play, as a multiple of one unit (50 at 21.875%). */
61
+ baseMultiple: number;
62
+ challengeMultiple: number;
63
+ challengeMisses: number;
64
+ goldenPointFactor: number;
65
+ boosts: SixAgainBoost[];
66
+ tagline: string;
67
+ /** Which server rule settles each boost combination. */
68
+ ruleIds: {
69
+ base: number | null;
70
+ challenge: number | null;
71
+ goldenChallenge: number | null;
72
+ };
73
+ }
74
+ export interface SixAgainTicket {
75
+ legs: number;
76
+ unit: number;
77
+ /** Total wager — what the entry is placed for. */
78
+ stake: number;
79
+ /** Base play's prize on a perfect card, Golden Point included. */
80
+ base: number;
81
+ /** Captain's Challenge collect — 0 when the boost is off. */
82
+ challenge: number;
83
+ /** Everything a perfect card collects. */
84
+ perfect: number;
85
+ /** Fewest correct calls that pay anything. */
86
+ lowestWinningCount: number;
87
+ /** Rule the entry settles on. */
88
+ ruleId: number | null;
89
+ }
90
+ /** Whether a game is 6 Again (routes to the one-screen boost builder). */
91
+ export declare function isSixAgainGame(game: Game | null | undefined): boolean;
92
+ export declare const NO_BOOSTS: SixAgainBoosts;
93
+ /** Price a ticket: what the player pays and what each outcome collects. */
94
+ export declare function sixAgainTicket(unit: number, boosts: SixAgainBoosts, config: SixAgainConfig): SixAgainTicket;
95
+ export declare function sixAgainRuleId(boosts: SixAgainBoosts, config: SixAgainConfig): number | null;
96
+ /**
97
+ * The payout multiples on the TOTAL stake for one boost combination — the
98
+ * literals the matching server rule's expression must carry.
99
+ */
100
+ export declare function sixAgainStakeMultiples(boosts: SixAgainBoosts, config: SixAgainConfig): {
101
+ perfect: number;
102
+ challenge: number;
103
+ };
104
+ /** Resolve the one-screen boost-builder config for a 6 Again game. */
105
+ export declare function getSixAgainConfig(game: Game | null | undefined): SixAgainConfig | null;
@@ -19,4 +19,4 @@ export interface SwipeDeckState {
19
19
  * The platform-free half of the swipe deck — queue, visible stack, and what
20
20
  * skip/answer/undo do. The twins wrap it with their own gesture layers.
21
21
  */
22
- export declare function useSwipeDeck(propositions: Proposition[], selections: Record<number, 'yes' | 'no'>, toggleSelection: (id: number, answer: 'yes' | 'no') => void): SwipeDeckState;
22
+ export declare function useSwipeDeck(propositions: Proposition[], selections: Record<number, 'yes' | 'no'>, toggleSelection: (id: number, answer: 'yes' | 'no') => void, isBlocked?: (prop: Proposition) => boolean): SwipeDeckState;
@@ -92,6 +92,28 @@ export interface BladeTheme {
92
92
  buttonSecondaryHover: string;
93
93
  buttonSecondaryText: string;
94
94
  };
95
+ /** Optional Game Shelf skin. Omitted values follow the normal theme colors. */
96
+ shelf?: {
97
+ canvas?: string;
98
+ onCanvas?: string;
99
+ surface?: string;
100
+ text?: string;
101
+ muted?: string;
102
+ accent?: string;
103
+ button?: string;
104
+ buttonText?: string;
105
+ coverText?: string;
106
+ coverColors?: Record<string, string>;
107
+ /** Cover colour for games without artwork, by tier id (signature / premier / exclusive). */
108
+ tierColors?: Record<string, string>;
109
+ /** Replacement artwork by game icon id — Shelf covers and Showcase tiles; null hides the bundled Shelf cover. */
110
+ artwork?: Record<string, string | null>;
111
+ /** Replacement Showcase hero image by category (sports / racing / prediction / fantasy); null hides it. */
112
+ heroArtwork?: Record<string, string | null>;
113
+ categoryColors?: Record<string, string>;
114
+ /** Replacement category artwork; null hides the bundled image. */
115
+ categoryArtwork?: Record<string, string | null>;
116
+ };
95
117
  brand?: {
96
118
  chip?: string;
97
119
  text?: string;