// The splash's one way down, and the ceiling the fan's launch rule borrows.//// The boot gate itself is the core's (`shell.home`, boundary review move 5):// it decides the stage, the waits and where a refusal stands, and the app// draws what it answers (`CottonUI/Boot/BootModel.swift`).importFoundation/// The boot's ceiling, as the fan's launch rule waits it out/// (`FanLaunchRule`): the core's own is `shell_home::CEILING_MS`.publiclet AUTH_INIT_FALLBACK_MS = 5_000/// Take the splash down, ONCE, from whichever screen paints first.////// Three screens paint OUTSIDE any route — `ErrorFallback`,/// `ServerRefusalScreen` and `GateScreen` — and each hides the splash/// itself. Before this seam existed on the phone, neither of the first two did,/// so a boot-time error looked exactly like a hang: issue #15 was eleven/// launches across two TestFlight builds, each one an error screen nobody could/// see behind the constellation.////// It is a global rather than a member of the overlay because the caller is/// whichever screen wins the race, and "once" has to survive all of them/// asking. `@MainActor` so the flag needs no lock and the overlay's `withAnimation`/// runs where SwiftUI wants it.@MainActorpublicfinalclassSplashState {publicstaticlet shared = SplashState()/// Observed by the overlay. False until somebody takes the splash down.publicprivate(set) var hidden = falseprivatevar listeners: [@MainActor () -> Void] = []privateinit() {}publicfunc onHidden(_ listener: @escaping @MainActor () -> Void) {if hidden { listener()return } listeners.append(listener) }/// Fires exactly once and survives re-entry.publicfunc hideOnce() {guard !hidden else { return } hidden = truelet waiting = listeners listeners = []for listener in waiting { listener() } }/// Test seam only: the guard is process state.publicfunc resetForTests() { hidden = false listeners = [] }}/// Take the native splash down, once. The one call site rule of design P16.@MainActorpublicfunc hideSplashOnce() {SplashState.shared.hideOnce()}