@sensiblestats/widget-react 0.130.0 → 0.130.1
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/CHANGELOG.md +8 -0
- package/dist/index.cjs +46 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +46 -5
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1285,7 +1285,7 @@ function parseOddsFormat(value) {
|
|
|
1285
1285
|
}
|
|
1286
1286
|
|
|
1287
1287
|
// src/version.generated.ts
|
|
1288
|
-
var WIDGET_REACT_VERSION = "0.130.
|
|
1288
|
+
var WIDGET_REACT_VERSION = "0.130.1";
|
|
1289
1289
|
|
|
1290
1290
|
// src/config.ts
|
|
1291
1291
|
function hostTag(cfg) {
|
|
@@ -2154,7 +2154,7 @@ function comboLegToSlipSelection(leg, conversationId) {
|
|
|
2154
2154
|
if (leg.quotedAtUtc !== void 0) selection.quotedAtUtc = leg.quotedAtUtc;
|
|
2155
2155
|
if (leg.sport !== void 0) selection.sport = leg.sport;
|
|
2156
2156
|
if (conversationId !== void 0) selection.conversationId = conversationId;
|
|
2157
|
-
return withMatch(selection, { home: leg.homeTeamName, away: leg.awayTeamName, kickoffUtc: leg.kickoffUtc, marketLabel: leg.market });
|
|
2157
|
+
return withMatch(selection, { home: leg.homeTeamName, away: leg.awayTeamName, kickoffUtc: leg.kickoffUtc, marketLabel: leg.market, player: leg.player });
|
|
2158
2158
|
}
|
|
2159
2159
|
var isNum = (v) => typeof v === "number" && Number.isFinite(v);
|
|
2160
2160
|
var isObj = (v) => typeof v === "object" && v !== null;
|
|
@@ -2287,7 +2287,37 @@ function toNbaSlipSelection(vm, key, conversationId) {
|
|
|
2287
2287
|
sport: "basketball"
|
|
2288
2288
|
};
|
|
2289
2289
|
if (conversationId !== void 0) selection.conversationId = conversationId;
|
|
2290
|
-
return withMatch(selection, { home: vm.homeTeamName, away: vm.awayTeamName, kickoffUtc: vm.kickoffUtc });
|
|
2290
|
+
return withMatch(selection, { home: vm.homeTeamName, away: vm.awayTeamName, kickoffUtc: vm.kickoffUtc, ...nbaPropOf(vm.evidence, key) });
|
|
2291
|
+
}
|
|
2292
|
+
function nbaPropOf(evidence, key) {
|
|
2293
|
+
switch (evidence.kind) {
|
|
2294
|
+
case "prop_reason":
|
|
2295
|
+
return { player: evidence.propReason.playerName, marketLabel: evidence.propReason.statLabel };
|
|
2296
|
+
case "vs_opponent":
|
|
2297
|
+
return { player: evidence.vsOpponent.playerName, marketLabel: evidence.vsOpponent.statLabel };
|
|
2298
|
+
case "teammate_out": {
|
|
2299
|
+
const row = evidence.teammateOut.rows.find((r) => r.selectionKey === key);
|
|
2300
|
+
return row ? { player: row.playerName, marketLabel: row.statLabel } : null;
|
|
2301
|
+
}
|
|
2302
|
+
case "co_hit": {
|
|
2303
|
+
const leg = evidence.coHit.legs.find((l) => l.selectionKey === key);
|
|
2304
|
+
return leg ? { player: leg.playerName, marketLabel: leg.statLabel } : null;
|
|
2305
|
+
}
|
|
2306
|
+
case "ladder": {
|
|
2307
|
+
const stat = evidence.ladder.stats.find((st) => st.rungs.some((r) => r.selectionKey === key));
|
|
2308
|
+
return stat ? { player: evidence.ladder.playerName, marketLabel: stat.statLabel } : null;
|
|
2309
|
+
}
|
|
2310
|
+
case "quarter_ladder": {
|
|
2311
|
+
const stat = evidence.quarterLadder.stats.find((st) => st.rungs.some((r) => r.selectionKey === key));
|
|
2312
|
+
return stat ? { player: evidence.quarterLadder.playerName, marketLabel: stat.statLabel } : null;
|
|
2313
|
+
}
|
|
2314
|
+
case "matchup": {
|
|
2315
|
+
const pos = evidence.matchup.position;
|
|
2316
|
+
return pos?.playerName && (pos.overSelectionKey === key || pos.underSelectionKey === key) ? { player: pos.playerName, marketLabel: pos.statLabel } : null;
|
|
2317
|
+
}
|
|
2318
|
+
default:
|
|
2319
|
+
return null;
|
|
2320
|
+
}
|
|
2291
2321
|
}
|
|
2292
2322
|
function nbaCoHitLegs(vm, conversationId) {
|
|
2293
2323
|
if (vm.evidence.kind !== "co_hit") return [];
|
|
@@ -2301,7 +2331,8 @@ function nbaCoHitLegs(vm, conversationId) {
|
|
|
2301
2331
|
homeTeamName: vm.homeTeamName ?? "",
|
|
2302
2332
|
awayTeamName: vm.awayTeamName ?? "",
|
|
2303
2333
|
kickoffUtc: vm.kickoffUtc ?? void 0,
|
|
2304
|
-
market:
|
|
2334
|
+
market: leg.statLabel,
|
|
2335
|
+
player: leg.playerName,
|
|
2305
2336
|
marketDeveloperName: s.marketDeveloperName,
|
|
2306
2337
|
selection: s.selectionLabel,
|
|
2307
2338
|
selectionLabel: s.selectionLabel,
|
|
@@ -2407,7 +2438,17 @@ function toNflSlipSelection(vm, key, nowMs, conversationId) {
|
|
|
2407
2438
|
sport: "americanfootball"
|
|
2408
2439
|
};
|
|
2409
2440
|
if (conversationId !== void 0) selection.conversationId = conversationId;
|
|
2410
|
-
return withMatch(selection, { home: vm.homeTeamName, away: vm.awayTeamName, kickoffUtc: vm.kickoffUtc });
|
|
2441
|
+
return withMatch(selection, { home: vm.homeTeamName, away: vm.awayTeamName, kickoffUtc: vm.kickoffUtc, ...nflPropOf(vm.evidence) });
|
|
2442
|
+
}
|
|
2443
|
+
function nflPropOf(evidence) {
|
|
2444
|
+
switch (evidence.kind) {
|
|
2445
|
+
case "prop_reason":
|
|
2446
|
+
return { player: evidence.propReason.playerName, marketLabel: evidence.propReason.propLabel };
|
|
2447
|
+
case "ladder":
|
|
2448
|
+
return { player: evidence.ladder.playerName, marketLabel: evidence.ladder.propLabel };
|
|
2449
|
+
default:
|
|
2450
|
+
return null;
|
|
2451
|
+
}
|
|
2411
2452
|
}
|
|
2412
2453
|
|
|
2413
2454
|
// src/slipKey.ts
|