(t0)
| 50 | onOpenRateLimitOptions?: () => void; |
| 51 | }; |
| 52 | export function RateLimitMessage(t0) { |
| 53 | const $ = _c(16); |
| 54 | const { |
| 55 | text, |
| 56 | onOpenRateLimitOptions |
| 57 | } = t0; |
| 58 | let t1; |
| 59 | if ($[0] === Symbol.for("react.memo_cache_sentinel")) { |
| 60 | t1 = getSubscriptionType(); |
| 61 | $[0] = t1; |
| 62 | } else { |
| 63 | t1 = $[0]; |
| 64 | } |
| 65 | const subscriptionType = t1; |
| 66 | let t2; |
| 67 | if ($[1] === Symbol.for("react.memo_cache_sentinel")) { |
| 68 | t2 = getRateLimitTier(); |
| 69 | $[1] = t2; |
| 70 | } else { |
| 71 | t2 = $[1]; |
| 72 | } |
| 73 | const rateLimitTier = t2; |
| 74 | const isTeamOrEnterprise = subscriptionType === "team" || subscriptionType === "enterprise"; |
| 75 | const isMax20x = rateLimitTier === "default_claude_max_20x"; |
| 76 | let t3; |
| 77 | if ($[2] === Symbol.for("react.memo_cache_sentinel")) { |
| 78 | t3 = shouldProcessMockLimits() || isClaudeAISubscriber(); |
| 79 | $[2] = t3; |
| 80 | } else { |
| 81 | t3 = $[2]; |
| 82 | } |
| 83 | const shouldShowUpsell = t3; |
| 84 | const canSeeRateLimitOptionsUpsell = shouldShowUpsell && !isMax20x; |
| 85 | const [hasOpenedInteractiveMenu, setHasOpenedInteractiveMenu] = useState(false); |
| 86 | const claudeAiLimits = useClaudeAiLimits(); |
| 87 | const isCurrentlyRateLimited = claudeAiLimits.status === "rejected" && claudeAiLimits.resetsAt !== undefined && !claudeAiLimits.isUsingOverage; |
| 88 | const shouldAutoOpenRateLimitOptionsMenu = canSeeRateLimitOptionsUpsell && !hasOpenedInteractiveMenu && isCurrentlyRateLimited && onOpenRateLimitOptions; |
| 89 | let t4; |
| 90 | let t5; |
| 91 | if ($[3] !== onOpenRateLimitOptions || $[4] !== shouldAutoOpenRateLimitOptionsMenu) { |
| 92 | t4 = () => { |
| 93 | if (shouldAutoOpenRateLimitOptionsMenu) { |
| 94 | setHasOpenedInteractiveMenu(true); |
| 95 | onOpenRateLimitOptions(); |
| 96 | } |
| 97 | }; |
| 98 | t5 = [shouldAutoOpenRateLimitOptionsMenu, onOpenRateLimitOptions]; |
| 99 | $[3] = onOpenRateLimitOptions; |
| 100 | $[4] = shouldAutoOpenRateLimitOptionsMenu; |
| 101 | $[5] = t4; |
| 102 | $[6] = t5; |
| 103 | } else { |
| 104 | t4 = $[5]; |
| 105 | t5 = $[6]; |
| 106 | } |
| 107 | useEffect(t4, t5); |
| 108 | let t6; |
| 109 | bb0: { |
nothing calls this directly
no test coverage detected