(t0)
| 85 | return t5; |
| 86 | } |
| 87 | export function TokenWarning(t0) { |
| 88 | const $ = _c(13); |
| 89 | const { |
| 90 | tokenUsage, |
| 91 | model |
| 92 | } = t0; |
| 93 | let t1; |
| 94 | if ($[0] !== model || $[1] !== tokenUsage) { |
| 95 | t1 = calculateTokenWarningState(tokenUsage, model); |
| 96 | $[0] = model; |
| 97 | $[1] = tokenUsage; |
| 98 | $[2] = t1; |
| 99 | } else { |
| 100 | t1 = $[2]; |
| 101 | } |
| 102 | const { |
| 103 | percentLeft, |
| 104 | isAboveWarningThreshold, |
| 105 | isAboveErrorThreshold |
| 106 | } = t1; |
| 107 | const suppressWarning = useCompactWarningSuppression(); |
| 108 | if (!isAboveWarningThreshold || suppressWarning) { |
| 109 | return null; |
| 110 | } |
| 111 | let t2; |
| 112 | if ($[3] === Symbol.for("react.memo_cache_sentinel")) { |
| 113 | t2 = isAutoCompactEnabled(); |
| 114 | $[3] = t2; |
| 115 | } else { |
| 116 | t2 = $[3]; |
| 117 | } |
| 118 | const showAutoCompactWarning = t2; |
| 119 | let t3; |
| 120 | if ($[4] === Symbol.for("react.memo_cache_sentinel")) { |
| 121 | t3 = getUpgradeMessage("warning"); |
| 122 | $[4] = t3; |
| 123 | } else { |
| 124 | t3 = $[4]; |
| 125 | } |
| 126 | const upgradeMessage = t3; |
| 127 | let displayPercentLeft = percentLeft; |
| 128 | let reactiveOnlyMode = false; |
| 129 | let collapseMode = false; |
| 130 | if (feature("REACTIVE_COMPACT")) { |
| 131 | if (getFeatureValue_CACHED_MAY_BE_STALE("tengu_cobalt_raccoon", false)) { |
| 132 | reactiveOnlyMode = true; |
| 133 | } |
| 134 | } |
| 135 | if (feature("CONTEXT_COLLAPSE")) { |
| 136 | const { |
| 137 | isContextCollapseEnabled |
| 138 | } = require("../services/contextCollapse/index.js") as typeof import('../services/contextCollapse/index.js'); |
| 139 | if (isContextCollapseEnabled()) { |
| 140 | collapseMode = true; |
| 141 | } |
| 142 | } |
| 143 | if (reactiveOnlyMode || collapseMode) { |
| 144 | const effectiveWindow = getEffectiveContextWindowSize(model); |
nothing calls this directly
no test coverage detected