'use client'; import type { Action, GameView } from '@/game/engine'; import { phaseAnyBidClaimText } from '@/game/phase-any-bid-promises'; import { Button } from './ui/button'; type Props = { game: GameView; busy: boolean; send: (action: Action) => void }; /** Use only the exact server-selected declaration for the live source and owner. */ export function PhaseAnyBidGuideButton(props: Props) { const game = props.game, guide = game.phaseAnyBidGuide; if (!guide) return null; const actor = game.me, turn = game.turn, action = guide.action; const signature = JSON.stringify(action), ordinary = game.auction, special = game.richeseAuction; const ordinarySignature = ordinary && JSON.stringify([ordinary.bid, ordinary.bidder, ordinary.active, ordinary.remaining]); const specialSignature = special && JSON.stringify([special.event, special.method, special.active, special.bid, special.bidder, special.submitted, special.ownBid]); const canAct = () => { const current = props.game, me = current.players.find(player => player.id === actor); if (props.busy || current !== game || current.me !== actor || current.turn !== turn || current.status !== 'playing' || current.phase !== 3 || current.phaseAnyBidGuide !== guide || guide.action !== action || JSON.stringify(action) !== signature || !me || me.autopilot || current.truthtrance || current.response || current.decision || current.phaseOpening || current.automaticContinuationPending || current.roomControl?.paused || current.roomControl?.closed || typeof action.phaseAnyBidPromiseEvent !== 'string' || !current.phaseAnyBidPromises.some(promise => promise.event === action.phaseAnyBidPromiseEvent && promise.player === actor && promise.turn === turn && !promise.fulfilled && !promise.released)) return false; if (action.richeseBidPromiseId !== undefined) { if (action.type !== 'richeseBid' || typeof action.richeseBidPromiseId !== 'string' || !special || ![...current.richeseBidPromises, ...current.mixedRicheseBidPromises].some(promise => promise.id === action.richeseBidPromiseId && promise.player === actor && promise.turn === turn && promise.event === special.event && !promise.fulfilled && !promise.released)) return false; } if (action.bidPromiseEvent !== undefined) { if ((action.type !== 'bid' && action.type !== 'passBid') || typeof action.bidPromiseEvent !== 'string' || typeof action.phaseAnyBidLot !== 'number' || current.bidPromiseLot?.turn !== turn || current.bidPromiseLot.lot !== action.phaseAnyBidLot || ![...current.bidPromises, ...current.mixedBidPromises].some(promise => promise.event === action.bidPromiseEvent && promise.player === actor && promise.turn === turn && promise.lot === action.phaseAnyBidLot && !promise.fulfilled && !promise.released)) return false; } if (action.type === 'bid' || action.type === 'passBid') return !!ordinary && current.auction === ordinary && ordinary.active === actor && JSON.stringify([ordinary.bid, ordinary.bidder, ordinary.active, ordinary.remaining]) === ordinarySignature && typeof action.phaseAnyBidLot === 'number' && current.bidPromiseLot?.turn === turn && current.bidPromiseLot.lot === action.phaseAnyBidLot; if (action.type !== 'richeseBid' || !special || current.richeseAuction !== special || special.event !== action.event || special.event !== action.phaseAnyBidLotEvent || JSON.stringify([special.event, special.method, special.active, special.bid, special.bidder, special.submitted, special.ownBid]) !== specialSignature) return false; return special.method === 'silent' ? !special.submitted.includes(actor) : special.active === actor; }; return ; } export function PhaseAnyBidPromises(props: Props) { const game = props.game, own = game.phaseAnyBidPromises.filter(promise => promise.player === game.me); if (!own.length) return null; const waiting = own.some(promise => promise.turn === game.turn && !promise.fulfilled && !promise.released); return

Your any-auction bid promises

Yes requires a qualifying future bid while possible. No forbids qualifying bids through Bidding close. Ordinary, Richese cache and Black Market auctions count. A bid can fulfill Yes even if another player wins; its native funding and payment rules still apply.

Earlier bids do not count. The answer adds no funds or bidding opportunity. Some combinations with other bidding commitments remain unavailable.

{waiting && !game.phaseAnyBidGuide &&

Your next supported opportunity may still be ahead.

} {waiting && }
; }