pi-mega-compact 0.20.65 → 0.20.67
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/dist/extensions/mega-compact-s38.test/_helpers.js +2 -1
- package/dist/extensions/mega-compact.test/_helpers.js +4 -1
- package/dist/extensions/mega-events/agent-handlers/agentEndHandler.js +2 -2
- package/dist/extensions/mega-events/agent-handlers/turnEndHandler/errorRetry-transient.js +131 -0
- package/dist/extensions/mega-events/agent-handlers/turnEndHandler/errorRetry.js +13 -137
- package/dist/extensions/mega-events/compact-handlers.js +3 -3
- package/dist/extensions/mega-events/outage-advisor.js +5 -5
- package/dist/extensions/mega-events/send-safe.js +16 -0
- package/extensions/dashboard-client/dist/assets/{AdminTab-B31efZ_R.js → AdminTab-t4kzAKba.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{AdminTab-B31efZ_R.js.map → AdminTab-t4kzAKba.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{AreaChart-BpjHNUZm.js → AreaChart-B_2FnM5A.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{AreaChart-BpjHNUZm.js.map → AreaChart-B_2FnM5A.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{BarChart-CY2FndXC.js → BarChart-D0-fTEoK.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{BarChart-CY2FndXC.js.map → BarChart-D0-fTEoK.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{CacheTab-kMSrMD3e.js → CacheTab-CUQPLCcM.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{CacheTab-kMSrMD3e.js.map → CacheTab-CUQPLCcM.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{ConfigTab-BrKpv2YG.js → ConfigTab-xtAz7do-.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{ConfigTab-BrKpv2YG.js.map → ConfigTab-xtAz7do-.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{EventsTab-DaClreCm.js → EventsTab-DLie9_So.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{EventsTab-DaClreCm.js.map → EventsTab-DLie9_So.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{HealthTab-CxKQDqF3.js → HealthTab-DC-K1UGr.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{HealthTab-CxKQDqF3.js.map → HealthTab-DC-K1UGr.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{MaintenanceTab-BKSlSjv0.js → MaintenanceTab-BRiZnnzk.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{MaintenanceTab-BKSlSjv0.js.map → MaintenanceTab-BRiZnnzk.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{MemoryMapTab-C2goWDt8.js → MemoryMapTab-DUHG7tll.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{MemoryMapTab-C2goWDt8.js.map → MemoryMapTab-DUHG7tll.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{MetricsCards-DCPuCnrw.js → MetricsCards-Bm19vWjr.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{MetricsCards-DCPuCnrw.js.map → MetricsCards-Bm19vWjr.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/MetricsTab-Bp-FbUfh.js +2 -0
- package/extensions/dashboard-client/dist/assets/{MetricsTab-Bz0Mdyb_.js.map → MetricsTab-Bp-FbUfh.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/OverviewTab-C7kYy6VF.js +16 -0
- package/extensions/dashboard-client/dist/assets/OverviewTab-C7kYy6VF.js.map +1 -0
- package/extensions/dashboard-client/dist/assets/{ReposTab-W_NKRWpk.js → ReposTab-6kRj8MNh.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{ReposTab-W_NKRWpk.js.map → ReposTab-6kRj8MNh.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{SessionsTab-GYrtNt4_.js → SessionsTab-duEyKw7t.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{SessionsTab-GYrtNt4_.js.map → SessionsTab-duEyKw7t.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{SetupTab-_1xa6eTJ.js → SetupTab-Dooq2vR4.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{SetupTab-_1xa6eTJ.js.map → SetupTab-Dooq2vR4.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{TimeSavedCard-Ciu8anVG.js → TimeSavedCard-CBIPgwK6.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{TimeSavedCard-Ciu8anVG.js.map → TimeSavedCard-CBIPgwK6.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{TurnMemoryView-BhXLIjWr.js → TurnMemoryView-BBnlvBRc.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{TurnMemoryView-BhXLIjWr.js.map → TurnMemoryView-BBnlvBRc.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/TurnsTab-DuJmr4S6.js +2 -0
- package/extensions/dashboard-client/dist/assets/{TurnsTab-C-f3DggL.js.map → TurnsTab-DuJmr4S6.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{VcStatusBadge-D97V04WE.js → VcStatusBadge-fU5-lO5O.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{VcStatusBadge-D97V04WE.js.map → VcStatusBadge-fU5-lO5O.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{VectorCortexTab-cyDJPAPB.js → VectorCortexTab-D5ef9CPz.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{VectorCortexTab-cyDJPAPB.js.map → VectorCortexTab-D5ef9CPz.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{WikiTab-dQ96DyjP.js → WikiTab-D5f8LD_4.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{WikiTab-dQ96DyjP.js.map → WikiTab-D5f8LD_4.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{button-B1beLEiV.js → button-DzfeNezP.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{button-B1beLEiV.js.map → button-DzfeNezP.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{card-CK9KH_ob.js → card-OZB1m8yv.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{card-CK9KH_ob.js.map → card-OZB1m8yv.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{client-extra-gN7xjggX.js → client-extra-DmQSTHzm.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{client-extra-gN7xjggX.js.map → client-extra-DmQSTHzm.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{generateCategoricalChart-MB2_0u55.js → generateCategoricalChart-o4NdniRd.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{generateCategoricalChart-MB2_0u55.js.map → generateCategoricalChart-o4NdniRd.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{index-CKVd_Ym_.js → index-BBhaR8pI.js} +3 -3
- package/extensions/dashboard-client/dist/assets/{index-CKVd_Ym_.js.map → index-BBhaR8pI.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{switch-CswmYrO_.js → switch-WUfyEw15.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{switch-CswmYrO_.js.map → switch-WUfyEw15.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{toggle-CMepFsf0.js → toggle-CoNdXeaQ.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{toggle-CMepFsf0.js.map → toggle-CoNdXeaQ.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{useSSE-Bl55LQFZ.js → useSSE-5AzRO3h7.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{useSSE-Bl55LQFZ.js.map → useSSE-5AzRO3h7.js.map} +1 -1
- package/extensions/dashboard-client/dist/index.html +1 -1
- package/extensions/dashboard-client/src/components/RepoContextStack.tsx +37 -11
- package/extensions/dashboard-client/src/components/SessionContextGauges.tsx +10 -3
- package/extensions/mega-compact-s38.test/_helpers.ts +1 -1
- package/extensions/mega-compact.test/_helpers.ts +3 -1
- package/extensions/mega-events/agent-handlers/agentEndHandler.ts +2 -2
- package/extensions/mega-events/agent-handlers/turnEndHandler/errorRetry-transient.ts +170 -0
- package/extensions/mega-events/agent-handlers/turnEndHandler/errorRetry.ts +12 -147
- package/extensions/mega-events/compact-handlers.ts +3 -3
- package/extensions/mega-events/outage-advisor.ts +5 -5
- package/extensions/mega-events/send-safe.ts +35 -4
- package/package.json +1 -1
- package/extensions/dashboard-client/dist/assets/MetricsTab-Bz0Mdyb_.js +0 -2
- package/extensions/dashboard-client/dist/assets/OverviewTab-B-eZ-eDR.js +0 -16
- package/extensions/dashboard-client/dist/assets/OverviewTab-B-eZ-eDR.js.map +0 -1
- package/extensions/dashboard-client/dist/assets/TurnsTab-C-f3DggL.js +0 -2
|
@@ -131,7 +131,8 @@ export function harness(opts = {}) {
|
|
|
131
131
|
registerCommand: () => { }, registerTool: () => { }, registerShortcut: () => { },
|
|
132
132
|
registerFlag: () => { }, getFlag: () => undefined,
|
|
133
133
|
registerMessageRenderer: () => { }, registerEntryRenderer: () => { },
|
|
134
|
-
sendMessage: () => {
|
|
134
|
+
sendMessage: (m) => { if (typeof m?.content === "string")
|
|
135
|
+
sendUserMessages.push(m.content); }, sendUserMessage: (m) => { sendUserMessages.push(m); },
|
|
135
136
|
appendEntry: (t, d) => appended.push({ t, d }),
|
|
136
137
|
setSessionName: () => { }, getSessionName: () => undefined, setLabel: () => { },
|
|
137
138
|
exec: async () => ({ stdout: "", stderr: "", code: 0 }),
|
|
@@ -186,7 +186,10 @@ export function harness(opts = {}) {
|
|
|
186
186
|
getFlag: () => undefined,
|
|
187
187
|
registerMessageRenderer: () => { },
|
|
188
188
|
registerEntryRenderer: () => { },
|
|
189
|
-
sendMessage: (
|
|
189
|
+
sendMessage: (m) => {
|
|
190
|
+
if (typeof m?.content === "string")
|
|
191
|
+
sendUserMessages.push(m.content);
|
|
192
|
+
},
|
|
190
193
|
sendUserMessage: (m) => {
|
|
191
194
|
sendUserMessages.push(m);
|
|
192
195
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { piCompactWouldNoop } from "../../mega-pipeline.js";
|
|
2
|
-
import {
|
|
2
|
+
import { safeSendInvisibleMessage } from "../send-safe.js";
|
|
3
3
|
/** Handle the `agent_end` pi event. Non-fatal end-to-end. */
|
|
4
4
|
export async function handleAgentEnd(ctx, pi, runtime, config) {
|
|
5
5
|
runtime.activeAgents = Math.max(0, runtime.activeAgents - 1);
|
|
@@ -200,7 +200,7 @@ export async function handleAgentEnd(ctx, pi, runtime, config) {
|
|
|
200
200
|
const nudgeMsg = lengthStop && !didDurableTrim
|
|
201
201
|
? "[mega-compact] the last response hit the output-token cap; continue from where it stopped."
|
|
202
202
|
: "[mega-compact] continue from the compacted context above.";
|
|
203
|
-
await
|
|
203
|
+
await safeSendInvisibleMessage(pi, nudgeMsg);
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
206
|
catch {
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { errorRetryBackoffMs } from "../../error-classifier.js";
|
|
2
|
+
import { safeSendInvisibleMessage } from "../../send-safe.js";
|
|
3
|
+
import { maybeSendProviderOutageAdvisory } from "../../outage-advisor.js";
|
|
4
|
+
/** Handle the transient or permanent error-retry path. Non-fatal. */
|
|
5
|
+
export async function transientRetry(event, _ctx, pi, runtime, config, tc) {
|
|
6
|
+
const { effectiveCategory, detail, errSig } = tc;
|
|
7
|
+
// S38.7: hard-stop switch — bypass ALL retry logic when set.
|
|
8
|
+
if (config.errorRetryHardStop) {
|
|
9
|
+
runtime.rt.errorRetryCount = 0;
|
|
10
|
+
runtime.dashboard.event("error_retry_disabled", {
|
|
11
|
+
category: effectiveCategory,
|
|
12
|
+
turnIndex: event.turnIndex,
|
|
13
|
+
reason: "hard-stop",
|
|
14
|
+
});
|
|
15
|
+
return; // early exit — no retry
|
|
16
|
+
}
|
|
17
|
+
// S38.6: circuit-breaker — stop retrying after too many consecutive errors.
|
|
18
|
+
runtime.rt.consecutiveErrors++;
|
|
19
|
+
// R10: send calm "provider outage" advisory once per episode.
|
|
20
|
+
await maybeSendProviderOutageAdvisory(effectiveCategory, runtime, pi, config, { signal: detail.signal, rawText: (errSig || '').slice(0, 500) });
|
|
21
|
+
if (runtime.rt.consecutiveErrors > config.maxConsecutiveErrors) {
|
|
22
|
+
runtime.dashboard.event("error_retry_circuit_open", {
|
|
23
|
+
consecutive: runtime.rt.consecutiveErrors,
|
|
24
|
+
max: config.maxConsecutiveErrors,
|
|
25
|
+
turnIndex: event.turnIndex,
|
|
26
|
+
});
|
|
27
|
+
runtime.logger.warn("error-retry-circuit-open", {
|
|
28
|
+
sessionId: runtime.rt.sessionId,
|
|
29
|
+
consecutive: runtime.rt.consecutiveErrors,
|
|
30
|
+
max: config.maxConsecutiveErrors,
|
|
31
|
+
});
|
|
32
|
+
return; // early exit — circuit breaker tripped
|
|
33
|
+
}
|
|
34
|
+
const max = effectiveCategory === "transient"
|
|
35
|
+
? config.autoRetryTransientMax
|
|
36
|
+
: config.autoRetryPermanentMax;
|
|
37
|
+
// max === 0 disables the category entirely (revert to S28-only).
|
|
38
|
+
if (max <= 0) {
|
|
39
|
+
runtime.rt.errorRetryCount = 0;
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
runtime.rt.errorRetryCount++;
|
|
43
|
+
if (runtime.rt.errorRetryCount > max) {
|
|
44
|
+
// Exhausted — surface the error, reset for the next burst.
|
|
45
|
+
runtime.dashboard.event("error_retry_exhausted", {
|
|
46
|
+
category: effectiveCategory,
|
|
47
|
+
count: runtime.rt.errorRetryCount,
|
|
48
|
+
max,
|
|
49
|
+
turnIndex: event.turnIndex,
|
|
50
|
+
});
|
|
51
|
+
runtime.logger.info("error-retry-exhausted", {
|
|
52
|
+
sessionId: runtime.rt.sessionId,
|
|
53
|
+
category: effectiveCategory,
|
|
54
|
+
count: runtime.rt.errorRetryCount,
|
|
55
|
+
max,
|
|
56
|
+
});
|
|
57
|
+
runtime.rt.errorRetryCount = 0;
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
// R2: session-global cap — total S38 nudges per session across ALL bursts.
|
|
61
|
+
// Independent of the per-burst max and the circuit breaker. Hitting it is
|
|
62
|
+
// terminal for the session: log + dashboard event, stop nudging. `0` disables.
|
|
63
|
+
if (config.errorRetrySessionMax > 0 &&
|
|
64
|
+
runtime.rt.errorRetrySessionCount >= config.errorRetrySessionMax) {
|
|
65
|
+
runtime.dashboard.event("error_retry_session_exhausted", {
|
|
66
|
+
count: runtime.rt.errorRetrySessionCount,
|
|
67
|
+
max: config.errorRetrySessionMax,
|
|
68
|
+
category: effectiveCategory,
|
|
69
|
+
turnIndex: event.turnIndex,
|
|
70
|
+
});
|
|
71
|
+
runtime.logger.warn("error-retry-session-exhausted", {
|
|
72
|
+
sessionId: runtime.rt.sessionId,
|
|
73
|
+
count: runtime.rt.errorRetrySessionCount,
|
|
74
|
+
max: config.errorRetrySessionMax,
|
|
75
|
+
category: effectiveCategory,
|
|
76
|
+
});
|
|
77
|
+
runtime.rt.errorRetryCount = 0;
|
|
78
|
+
return; // terminal for the session — no nudge
|
|
79
|
+
}
|
|
80
|
+
// R1: in-flight nudge dedup — a nudge queued via deliverAs:'followUp' must
|
|
81
|
+
// not be re-sent until consumed by an actual new agent turn (turn_start
|
|
82
|
+
// resets retryNudgePending). Without this, a fast-erroring provider + a
|
|
83
|
+
// per-turn nudge → N nudges queue up and pi dispatches N retry turns, each
|
|
84
|
+
// re-submitting the same failing prompt (the 2026-07-28 incident).
|
|
85
|
+
if (runtime.rt.retryNudgePending) {
|
|
86
|
+
runtime.dashboard.event("error_retry_dedup_skip", {
|
|
87
|
+
category: effectiveCategory,
|
|
88
|
+
count: runtime.rt.errorRetryCount,
|
|
89
|
+
max,
|
|
90
|
+
turnIndex: event.turnIndex,
|
|
91
|
+
});
|
|
92
|
+
return; // pending nudge not yet consumed — skip
|
|
93
|
+
}
|
|
94
|
+
// R1: gating backoff — errorRetryUntil is GATING. A nudge cannot fire before
|
|
95
|
+
// the previous backoff elapses. Paces retries (5s/10s/20s/30s default).
|
|
96
|
+
const now = Date.now();
|
|
97
|
+
if (now < runtime.rt.errorRetryUntil) {
|
|
98
|
+
runtime.dashboard.event("error_retry_backoff_skip", {
|
|
99
|
+
category: effectiveCategory,
|
|
100
|
+
count: runtime.rt.errorRetryCount,
|
|
101
|
+
max,
|
|
102
|
+
turnIndex: event.turnIndex,
|
|
103
|
+
});
|
|
104
|
+
return; // backoff not elapsed — skip
|
|
105
|
+
}
|
|
106
|
+
// Fire the retry nudge. Set pending (R1 dedup) + backoff (R1 pacing) +
|
|
107
|
+
// session count (R2 cap) BEFORE the await so a re-entrant turn_end during
|
|
108
|
+
// the send can't double-fire.
|
|
109
|
+
runtime.rt.retryNudgePending = true;
|
|
110
|
+
runtime.rt.lastErrorRetryAt = now;
|
|
111
|
+
runtime.rt.errorRetryUntil =
|
|
112
|
+
now +
|
|
113
|
+
errorRetryBackoffMs(runtime.rt.errorRetryCount, config.errorRetryBackoffMs);
|
|
114
|
+
runtime.rt.errorRetrySessionCount++;
|
|
115
|
+
runtime.dashboard.event("error_retry", {
|
|
116
|
+
category: effectiveCategory,
|
|
117
|
+
count: runtime.rt.errorRetryCount,
|
|
118
|
+
max,
|
|
119
|
+
turnIndex: event.turnIndex,
|
|
120
|
+
});
|
|
121
|
+
runtime.logger.info("error-retry", {
|
|
122
|
+
sessionId: runtime.rt.sessionId,
|
|
123
|
+
category: effectiveCategory,
|
|
124
|
+
count: runtime.rt.errorRetryCount,
|
|
125
|
+
max,
|
|
126
|
+
});
|
|
127
|
+
// PREVENT-PI-003: user-role only (queued + catch-guarded).
|
|
128
|
+
// Invisible: display:false so the retry trigger fires without
|
|
129
|
+
// rendering "Follow-up:" spam in the conversation UI.
|
|
130
|
+
await safeSendInvisibleMessage(pi, "[mega-compact] the last turn ended with an error; please retry.");
|
|
131
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { piCompactWouldNoop } from "../../../mega-pipeline.js";
|
|
2
|
-
import { classifyError, classifyErrorDetailed,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { classifyError, classifyErrorDetailed, extractErrorSignature, isKnownRetryableTransient, } from "../../error-classifier.js";
|
|
3
|
+
import { safeSendInvisibleMessage } from "../../send-safe.js";
|
|
4
|
+
import { transientRetry } from "./errorRetry-transient.js";
|
|
5
5
|
/** S38: broader error-retry safety net. Non-fatal end-to-end. */
|
|
6
6
|
export async function errorRetry(event, ctx, pi, runtime, config) {
|
|
7
7
|
// S38: broader error-retry safety net. S28 only catches stopReason==='length';
|
|
@@ -209,7 +209,10 @@ export async function errorRetry(event, ctx, pi, runtime, config) {
|
|
|
209
209
|
// Default ON (advisoryChannel=true): dashboard-only, no user message.
|
|
210
210
|
if (!config.advisoryChannel) {
|
|
211
211
|
// PREVENT-PI-003: user-role sendUserMessage only.
|
|
212
|
-
|
|
212
|
+
// Invisible: display:false — the dashboard event + log already
|
|
213
|
+
// capture the poisoned-context signal; the user does not need a
|
|
214
|
+
// visible "Follow-up:" message.
|
|
215
|
+
await safeSendInvisibleMessage(pi, "[mega-compact] this session's context may be poisoned (the provider is rejecting every request). Run /clear or /new to start a fresh context.");
|
|
213
216
|
}
|
|
214
217
|
// (c) one guarded compact per error signature (attempt to remove
|
|
215
218
|
// the poisoned region). Race-guarded + deferred, mirroring the
|
|
@@ -245,139 +248,12 @@ export async function errorRetry(event, ctx, pi, runtime, config) {
|
|
|
245
248
|
}
|
|
246
249
|
else {
|
|
247
250
|
// (5) transient or permanent — retry with exponential backoff.
|
|
248
|
-
//
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
reason: "hard-stop",
|
|
255
|
-
});
|
|
256
|
-
return; // early exit — no retry
|
|
257
|
-
}
|
|
258
|
-
// S38.6: circuit-breaker — stop retrying after too many consecutive errors.
|
|
259
|
-
runtime.rt.consecutiveErrors++;
|
|
260
|
-
// R10: send calm "provider outage" advisory once per episode.
|
|
261
|
-
await maybeSendProviderOutageAdvisory(effectiveCategory, runtime, pi, config, { signal: detail.signal, rawText: (errSig || '').slice(0, 500) });
|
|
262
|
-
if (runtime.rt.consecutiveErrors > config.maxConsecutiveErrors) {
|
|
263
|
-
runtime.dashboard.event("error_retry_circuit_open", {
|
|
264
|
-
consecutive: runtime.rt.consecutiveErrors,
|
|
265
|
-
max: config.maxConsecutiveErrors,
|
|
266
|
-
turnIndex: event.turnIndex,
|
|
267
|
-
});
|
|
268
|
-
runtime.logger.warn("error-retry-circuit-open", {
|
|
269
|
-
sessionId: runtime.rt.sessionId,
|
|
270
|
-
consecutive: runtime.rt.consecutiveErrors,
|
|
271
|
-
max: config.maxConsecutiveErrors,
|
|
272
|
-
});
|
|
273
|
-
return; // early exit — circuit breaker tripped
|
|
274
|
-
}
|
|
275
|
-
const max = effectiveCategory === "transient"
|
|
276
|
-
? config.autoRetryTransientMax
|
|
277
|
-
: config.autoRetryPermanentMax;
|
|
278
|
-
// max === 0 disables the category entirely (revert to S28-only).
|
|
279
|
-
if (max <= 0) {
|
|
280
|
-
runtime.rt.errorRetryCount = 0;
|
|
281
|
-
}
|
|
282
|
-
else {
|
|
283
|
-
runtime.rt.errorRetryCount++;
|
|
284
|
-
if (runtime.rt.errorRetryCount > max) {
|
|
285
|
-
// Exhausted — surface the error, reset for the next burst.
|
|
286
|
-
runtime.dashboard.event("error_retry_exhausted", {
|
|
287
|
-
category: effectiveCategory,
|
|
288
|
-
count: runtime.rt.errorRetryCount,
|
|
289
|
-
max,
|
|
290
|
-
turnIndex: event.turnIndex,
|
|
291
|
-
});
|
|
292
|
-
runtime.logger.info("error-retry-exhausted", {
|
|
293
|
-
sessionId: runtime.rt.sessionId,
|
|
294
|
-
category: effectiveCategory,
|
|
295
|
-
count: runtime.rt.errorRetryCount,
|
|
296
|
-
max,
|
|
297
|
-
});
|
|
298
|
-
runtime.rt.errorRetryCount = 0;
|
|
299
|
-
}
|
|
300
|
-
else {
|
|
301
|
-
// R2: session-global cap — total S38 nudges per session across
|
|
302
|
-
// ALL bursts. Independent of the per-burst max and the circuit
|
|
303
|
-
// breaker. Hitting it is terminal for the session: log +
|
|
304
|
-
// dashboard event, stop nudging. `0` disables (reverts to
|
|
305
|
-
// per-burst + circuit-breaker only).
|
|
306
|
-
if (config.errorRetrySessionMax > 0 &&
|
|
307
|
-
runtime.rt.errorRetrySessionCount >= config.errorRetrySessionMax) {
|
|
308
|
-
runtime.dashboard.event("error_retry_session_exhausted", {
|
|
309
|
-
count: runtime.rt.errorRetrySessionCount,
|
|
310
|
-
max: config.errorRetrySessionMax,
|
|
311
|
-
category: effectiveCategory,
|
|
312
|
-
turnIndex: event.turnIndex,
|
|
313
|
-
});
|
|
314
|
-
runtime.logger.warn("error-retry-session-exhausted", {
|
|
315
|
-
sessionId: runtime.rt.sessionId,
|
|
316
|
-
count: runtime.rt.errorRetrySessionCount,
|
|
317
|
-
max: config.errorRetrySessionMax,
|
|
318
|
-
category: effectiveCategory,
|
|
319
|
-
});
|
|
320
|
-
runtime.rt.errorRetryCount = 0;
|
|
321
|
-
return; // terminal for the session — no nudge
|
|
322
|
-
}
|
|
323
|
-
// R1: in-flight nudge dedup — a nudge queued via
|
|
324
|
-
// deliverAs:'followUp' must not be re-sent until it has been
|
|
325
|
-
// consumed by an actual new agent turn (turn_start resets
|
|
326
|
-
// retryNudgePending). Without this, a fast-erroring provider +
|
|
327
|
-
// a per-turn nudge → N nudges queue up and pi dispatches N
|
|
328
|
-
// retry turns, each re-submitting the same failing prompt
|
|
329
|
-
// (the 2026-07-28 incident). errorRetryCount still advances
|
|
330
|
-
// (this IS an error turn), so the per-burst max + circuit
|
|
331
|
-
// breaker still bound the burst.
|
|
332
|
-
if (runtime.rt.retryNudgePending) {
|
|
333
|
-
runtime.dashboard.event("error_retry_dedup_skip", {
|
|
334
|
-
category: effectiveCategory,
|
|
335
|
-
count: runtime.rt.errorRetryCount,
|
|
336
|
-
max,
|
|
337
|
-
turnIndex: event.turnIndex,
|
|
338
|
-
});
|
|
339
|
-
return; // pending nudge not yet consumed — skip
|
|
340
|
-
}
|
|
341
|
-
// R1: gating backoff — errorRetryUntil is now GATING
|
|
342
|
-
// (previously documented as non-gating). A nudge cannot fire
|
|
343
|
-
// before the previous backoff elapses. This paces retries
|
|
344
|
-
// (5s/10s/20s/30s by default) so a fast-erroring provider
|
|
345
|
-
// doesn't slam N nudges in <1s.
|
|
346
|
-
const now = Date.now();
|
|
347
|
-
if (now < runtime.rt.errorRetryUntil) {
|
|
348
|
-
runtime.dashboard.event("error_retry_backoff_skip", {
|
|
349
|
-
category: effectiveCategory,
|
|
350
|
-
count: runtime.rt.errorRetryCount,
|
|
351
|
-
max,
|
|
352
|
-
turnIndex: event.turnIndex,
|
|
353
|
-
});
|
|
354
|
-
return; // backoff not elapsed — skip
|
|
355
|
-
}
|
|
356
|
-
// Fire the retry nudge. Set pending (R1 dedup) + backoff
|
|
357
|
-
// (R1 pacing) + session count (R2 cap) BEFORE the await so a
|
|
358
|
-
// re-entrant turn_end during the send can't double-fire.
|
|
359
|
-
runtime.rt.retryNudgePending = true;
|
|
360
|
-
runtime.rt.lastErrorRetryAt = now;
|
|
361
|
-
runtime.rt.errorRetryUntil =
|
|
362
|
-
now +
|
|
363
|
-
errorRetryBackoffMs(runtime.rt.errorRetryCount, config.errorRetryBackoffMs);
|
|
364
|
-
runtime.rt.errorRetrySessionCount++;
|
|
365
|
-
runtime.dashboard.event("error_retry", {
|
|
366
|
-
category: effectiveCategory,
|
|
367
|
-
count: runtime.rt.errorRetryCount,
|
|
368
|
-
max,
|
|
369
|
-
turnIndex: event.turnIndex,
|
|
370
|
-
});
|
|
371
|
-
runtime.logger.info("error-retry", {
|
|
372
|
-
sessionId: runtime.rt.sessionId,
|
|
373
|
-
category: effectiveCategory,
|
|
374
|
-
count: runtime.rt.errorRetryCount,
|
|
375
|
-
max,
|
|
376
|
-
});
|
|
377
|
-
// PREVENT-PI-003: user-role sendUserMessage only (queued + catch-guarded).
|
|
378
|
-
await safeSendUserMessage(pi, "[mega-compact] the last turn ended with an error; please retry.");
|
|
379
|
-
}
|
|
380
|
-
}
|
|
251
|
+
// Delegated to errorRetry-transient.ts (delegate-shell split).
|
|
252
|
+
await transientRetry(event, ctx, pi, runtime, config, {
|
|
253
|
+
effectiveCategory,
|
|
254
|
+
detail,
|
|
255
|
+
errSig,
|
|
256
|
+
});
|
|
381
257
|
}
|
|
382
258
|
}
|
|
383
259
|
}
|
|
@@ -3,7 +3,7 @@ import { estimateBlockTokens } from "../../src/tokens.js";
|
|
|
3
3
|
import { recordScore, getDedupStats } from "../../src/store/sqlite.js";
|
|
4
4
|
import { evaluateAndUnlockAchievements } from "../../src/store/sqlite/game-achievements.js";
|
|
5
5
|
import { resolveRepoRoot } from "../mega-config.js";
|
|
6
|
-
import {
|
|
6
|
+
import { safeSendInvisibleMessage } from "./send-safe.js";
|
|
7
7
|
/**
|
|
8
8
|
* Build a minimal fallback compaction so pi never runs its throwing compact().
|
|
9
9
|
*
|
|
@@ -36,7 +36,7 @@ function fallbackCompaction(event) {
|
|
|
36
36
|
* Debounced resume-nudge: restart the agent loop after a compaction (which
|
|
37
37
|
* may have stopped it). Idempotent — one nudge per 30s, never blocks.
|
|
38
38
|
*
|
|
39
|
-
* Uses
|
|
39
|
+
* Uses safeSendInvisibleMessage ({ deliverAs: 'followUp' } + catch-guard) so that a
|
|
40
40
|
* nudge fired during session_before_compact (which is mid-prompt-submission,
|
|
41
41
|
* so the agent can be busy) QUEUES instead of throwing
|
|
42
42
|
* "Agent is already processing. Specify streamingBehavior (steer or followUp)".
|
|
@@ -47,7 +47,7 @@ async function nudgeResume(pi, runtime) {
|
|
|
47
47
|
if (now >= runtime.resumeNudgeUntil) {
|
|
48
48
|
runtime.resumeNudgeUntil = now + 30_000;
|
|
49
49
|
runtime.rt.extensionInitiatedTurn = true; // R13: suppress self-classification
|
|
50
|
-
await
|
|
50
|
+
await safeSendInvisibleMessage(pi, "[mega-compact] continue from the compacted context above.");
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
catch {
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
* Distinct from the poisoned-context /clear advise: the outage advisory is
|
|
10
10
|
* for transient errors where the user's context is fine.
|
|
11
11
|
*
|
|
12
|
-
* PREVENT-PI-003: sends via
|
|
12
|
+
* PREVENT-PI-003: sends via safeSendInvisibleMessage (user-role only).
|
|
13
13
|
* PREVENT-PI-004: local ctx call, no network.
|
|
14
14
|
*/
|
|
15
|
-
import {
|
|
15
|
+
import { safeSendInvisibleMessage } from "./send-safe.js";
|
|
16
16
|
/**
|
|
17
17
|
* Check the provider-outage advisory condition and fire once per episode.
|
|
18
18
|
*
|
|
@@ -21,7 +21,7 @@ import { safeSendUserMessage } from "./send-safe.js";
|
|
|
21
21
|
*
|
|
22
22
|
* @param effectiveCategory — must be "transient" for the advisory to fire.
|
|
23
23
|
* @param runtime — the live MegaRuntime (mutated on advisory fire).
|
|
24
|
-
* @param pi — pi ExtensionAPI for
|
|
24
|
+
* @param pi — pi ExtensionAPI for safeSendInvisibleMessage.
|
|
25
25
|
* @param config — providerOutageAdviseThreshold config.
|
|
26
26
|
* @param detail — R11: optional signal + rawText for forensics.
|
|
27
27
|
*/
|
|
@@ -53,7 +53,7 @@ export async function maybeSendProviderOutageAdvisory(effectiveCategory, runtime
|
|
|
53
53
|
// injecting into the conversation scares users and triggers false-positive
|
|
54
54
|
// re-classification of the resulting turn (2026-07-31 incident).
|
|
55
55
|
if (!config.advisoryChannel) {
|
|
56
|
-
// Legacy path (flag OFF): user-role message
|
|
57
|
-
await
|
|
56
|
+
// Legacy path (flag OFF): invisible user-role message (display:false).
|
|
57
|
+
await safeSendInvisibleMessage(pi, `[mega-compact] the provider is having issues (${runtime.rt.consecutiveErrors} consecutive failures — timeouts/5xx/rate-limits). Retries are bounded and continue automatically; your context is fine — do NOT clear or reset it. Work resumes as soon as the provider recovers.`);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* safeSendUserMessage — await + catch-guard + queue-safe wrapper for
|
|
3
3
|
* pi.sendUserMessage. Never throws; never produces an unhandled rejection.
|
|
4
|
+
* The message IS visible in the conversation UI ("Follow-up:").
|
|
4
5
|
*/
|
|
5
6
|
export async function safeSendUserMessage(pi, content) {
|
|
6
7
|
try {
|
|
@@ -10,3 +11,18 @@ export async function safeSendUserMessage(pi, content) {
|
|
|
10
11
|
/* non-fatal: a failed/queued nudge never blocks the agent loop */
|
|
11
12
|
}
|
|
12
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* safeSendInvisibleMessage — like safeSendUserMessage but uses pi.sendMessage
|
|
16
|
+
* with `display: false` so the retry trigger is delivered to the agent WITHOUT
|
|
17
|
+
* rendering in the conversation UI. Fixes the "Follow-up: [mega-compact] ..."
|
|
18
|
+
* pile-up when the API retries repeatedly — the retry mechanism still fires,
|
|
19
|
+
* the user just doesn't see the queued messages.
|
|
20
|
+
*/
|
|
21
|
+
export async function safeSendInvisibleMessage(pi, content) {
|
|
22
|
+
try {
|
|
23
|
+
await pi.sendMessage({ customType: "mega-compact-retry", content, display: false }, { deliverAs: "followUp" });
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
/* non-fatal: a failed/queued nudge never blocks the agent loop */
|
|
27
|
+
}
|
|
28
|
+
}
|
package/extensions/dashboard-client/dist/assets/{AdminTab-B31efZ_R.js → AdminTab-t4kzAKba.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as s,u as o,e as c,j as e}from"./index-
|
|
2
|
-
//# sourceMappingURL=AdminTab-
|
|
1
|
+
import{r as s,u as o,e as c,j as e}from"./index-BBhaR8pI.js";import{T as i}from"./toggle-CoNdXeaQ.js";import r from"./MaintenanceTab-BRiZnnzk.js";import{C as l}from"./ConfigTab-xtAz7do-.js";import"./card-OZB1m8yv.js";import"./button-DzfeNezP.js";import"./switch-WUfyEw15.js";const f="MEGACOMPACT_DASH_0C";function m(n){if(!n)return!1;for(const t of n.categories)for(const a of t.settings)if(a.key===f&&a.type==="boolean")return a.value===!0;return!1}function h(){const[n,t]=s.useState("maintenance"),{data:a}=o(s.useCallback(()=>c(),[]),{pollInterval:0,maxRetries:0});return m(a)?e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2",role:"tablist","aria-label":"Admin views",children:[e.jsx(i,{pressed:n==="maintenance",onClick:()=>t("maintenance"),children:"Maintenance"}),e.jsx(i,{pressed:n==="config",onClick:()=>t("config"),children:"Config"})]}),n==="maintenance"?e.jsx(r,{}):e.jsx(l,{})]}):e.jsx(r,{})}export{h as default};
|
|
2
|
+
//# sourceMappingURL=AdminTab-t4kzAKba.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdminTab-
|
|
1
|
+
{"version":3,"file":"AdminTab-t4kzAKba.js","sources":["../../src/tabs/AdminTab.tsx"],"sourcesContent":["/**\n * dashboard-client/src/tabs/AdminTab.tsx — Admin tab (DASH-0c delegate-shell).\n *\n * DASH-0c: the Admin surface combines the maintenance actions with the config\n * editor. A `AdminViews` toggle (\"maintenance\" / \"config\") switches between\n * `MaintenanceTab` (the maintenance shell over MaintenanceTab/*) and `ConfigTab`\n * (the config editor). Both bodies are UNCHANGED — only their hosting changes to\n * this new delegate-shell. `MaintenanceTab.tsx` and `ConfigTab.tsx` stay importable\n * from their original hosts (`ConfigTab` also stays wired into SetupTab per the\n * dual-host note). Flag-ON renders the toggle + both views; flag-OFF renders only\n * the maintenance view (the predecessor's `admin → MaintenanceTab` mapping),\n * and App.tsx keeps its current TabId routing this sprint (DASH-0d rewires).\n *\n * Flag: `MEGACOMPACT_DASH_0C` default ON. The dashboard client is a browser\n * bundle with NO `process` global, so the positive sprint flag cannot be read\n * server-side-style (`process.env`) inside the client. Instead the flag is read\n * from the server-authoritative `/api/rag-settings` state: the server resolves\n * `process.env[\"MEGACOMPACT_DASH_0C\"] ?? default` into the `SettingState.value`\n * boolean.\n */\n\nimport type React from \"react\";\nimport { useCallback, useState } from \"react\";\nimport type { SettingsResponse } from \"@contracts\";\nimport { useApi } from \"../hooks/useApi\";\nimport { fetchSettings } from \"../api/client\";\nimport { Toggle } from \"../components/ui/toggle\";\nimport MaintenanceTab from \"./MaintenanceTab\";\nimport ConfigTab from \"./ConfigTab\";\n\nconst DASH_0C_KEY = \"MEGACOMPACT_DASH_0C\";\n\n/** Resolve the DASH-0c consolidation flag from the server settings state.\n * Absent/not-yet-loaded => false (flag-off posture), so flag-off users never\n * see the toggle flash; the toggle appears only once settings confirm it is ON. */\nfunction dash0cEnabled(settings: SettingsResponse | null): boolean {\n\tif (!settings) return false;\n\tfor (const cat of settings.categories) {\n\t\tfor (const s of cat.settings) {\n\t\t\tif (s.key === DASH_0C_KEY && s.type === \"boolean\") return s.value === true;\n\t\t}\n\t}\n\treturn false;\n}\n\ntype AdminViews = \"maintenance\" | \"config\";\n\nexport default function AdminTab(): React.ReactElement {\n\tconst [view, setView] = useState<AdminViews>(\"maintenance\");\n\n\tconst { data: settingsData } = useApi<SettingsResponse>(\n\t\tuseCallback(() => fetchSettings(), []),\n\t\t{ pollInterval: 0, maxRetries: 0 },\n\t);\n\tconst dash0cOn = dash0cEnabled(settingsData);\n\n\tif (!dash0cOn) {\n\t\treturn <MaintenanceTab />;\n\t}\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<div\n\t\t\t\tclassName=\"flex items-center gap-2\"\n\t\t\t\trole=\"tablist\"\n\t\t\t\taria-label=\"Admin views\"\n\t\t\t>\n\t\t\t\t<Toggle\n\t\t\t\t\tpressed={view === \"maintenance\"}\n\t\t\t\t\tonClick={() => setView(\"maintenance\")}\n\t\t\t\t>\n\t\t\t\t\tMaintenance\n\t\t\t\t</Toggle>\n\t\t\t\t<Toggle pressed={view === \"config\"} onClick={() => setView(\"config\")}>\n\t\t\t\t\tConfig\n\t\t\t\t</Toggle>\n\t\t\t</div>\n\t\t\t{view === \"maintenance\" ? <MaintenanceTab /> : <ConfigTab />}\n\t\t</div>\n\t);\n}\n"],"names":["DASH_0C_KEY","dash0cEnabled","settings","cat","s","AdminTab","view","setView","useState","settingsData","useApi","useCallback","fetchSettings","jsxs","jsx","Toggle","MaintenanceTab","ConfigTab"],"mappings":"mRA8BA,MAAMA,EAAc,sBAKpB,SAASC,EAAcC,EAA4C,CAClE,GAAI,CAACA,EAAU,MAAO,GACtB,UAAWC,KAAOD,EAAS,WAC1B,UAAWE,KAAKD,EAAI,SACnB,GAAIC,EAAE,MAAQJ,GAAeI,EAAE,OAAS,UAAW,OAAOA,EAAE,QAAU,GAGxE,MAAO,EACR,CAIA,SAAwBC,GAA+B,CACtD,KAAM,CAACC,EAAMC,CAAO,EAAIC,EAAAA,SAAqB,aAAa,EAEpD,CAAE,KAAMC,CAAA,EAAiBC,EAC9BC,cAAY,IAAMC,EAAA,EAAiB,EAAE,EACrC,CAAE,aAAc,EAAG,WAAY,CAAA,CAAE,EAIlC,OAFiBX,EAAcQ,CAAY,EAO1CI,EAAAA,KAAC,MAAA,CAAI,UAAU,sBACd,SAAA,CAAAA,EAAAA,KAAC,MAAA,CACA,UAAU,0BACV,KAAK,UACL,aAAW,cAEX,SAAA,CAAAC,EAAAA,IAACC,EAAA,CACA,QAAST,IAAS,cAClB,QAAS,IAAMC,EAAQ,aAAa,EACpC,SAAA,aAAA,CAAA,EAGDO,EAAAA,IAACC,EAAA,CAAO,QAAST,IAAS,SAAU,QAAS,IAAMC,EAAQ,QAAQ,EAAG,SAAA,QAAA,CAEtE,CAAA,CAAA,CAAA,EAEAD,IAAS,cAAgBQ,MAACE,EAAA,CAAA,CAAe,QAAMC,EAAA,CAAA,CAAU,CAAA,EAC3D,QArBQD,EAAA,EAAe,CAuBzB"}
|
package/extensions/dashboard-client/dist/assets/{AreaChart-BpjHNUZm.js → AreaChart-B_2FnM5A.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as R,c as W,m as T,i as C,d as F,A as ie,e as B,h as q,j as oe,k as G,l as se,n as le,u as ue,o as K,G as ce,p as J,q as Q,D as fe,g as pe,X as he,Y as de,f as me}from"./generateCategoricalChart-MB2_0u55.js";import{R as p,J as ee,r as ve}from"./index-CKVd_Ym_.js";var ye=["layout","type","stroke","connectNulls","isRange","ref"],be=["key"],te;function M(e){"@babel/helpers - typeof";return M=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M(e)}function ae(e,t){if(e==null)return{};var r=Ae(e,t),a,n;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)a=i[n],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}function Ae(e,t){if(e==null)return{};var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){if(t.indexOf(a)>=0)continue;r[a]=e[a]}return r}function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},D.apply(this,arguments)}function U(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,a)}return r}function S(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?U(Object(r),!0).forEach(function(a){E(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):U(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function ge(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Z(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,ne(a.key),a)}}function xe(e,t,r){return t&&Z(e.prototype,t),r&&Z(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Pe(e,t,r){return t=$(t),Oe(e,re()?Reflect.construct(t,r||[],$(e).constructor):t.apply(e,r))}function Oe(e,t){if(t&&(M(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ee(e)}function Ee(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function re(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(re=function(){return!!e})()}function $(e){return $=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},$(e)}function we(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&X(e,t)}function X(e,t){return X=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,n){return a.__proto__=n,a},X(e,t)}function E(e,t,r){return t=ne(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ne(e){var t=_e(e,"string");return M(t)=="symbol"?t:t+""}function _e(e,t){if(M(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(M(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var L=function(e){function t(){var r;ge(this,t);for(var a=arguments.length,n=new Array(a),i=0;i<a;i++)n[i]=arguments[i];return r=Pe(this,t,[].concat(n)),E(r,"state",{isAnimationFinished:!0}),E(r,"id",ue("recharts-area-")),E(r,"handleAnimationEnd",function(){var o=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),K(o)&&o()}),E(r,"handleAnimationStart",function(){var o=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),K(o)&&o()}),r}return we(t,e),xe(t,[{key:"renderDots",value:function(a,n,i){var o=this.props.isAnimationActive,s=this.state.isAnimationFinished;if(o&&!s)return null;var u=this.props,l=u.dot,f=u.points,c=u.dataKey,h=R(this.props,!1),A=R(l,!0),g=f.map(function(v,O){var y=S(S(S({key:"dot-".concat(O),r:3},h),A),{},{index:O,cx:v.x,cy:v.y,dataKey:c,value:v.value,payload:v.payload,points:f});return t.renderDotItem(l,y)}),x={clipPath:a?"url(#clipPath-".concat(n?"":"dots-").concat(i,")"):null};return p.createElement(W,D({className:"recharts-area-dots"},x),g)}},{key:"renderHorizontalRect",value:function(a){var n=this.props,i=n.baseLine,o=n.points,s=n.strokeWidth,u=o[0].x,l=o[o.length-1].x,f=a*Math.abs(u-l),c=T(o.map(function(h){return h.y||0}));return C(i)&&typeof i=="number"?c=Math.max(i,c):i&&Array.isArray(i)&&i.length&&(c=Math.max(T(i.map(function(h){return h.y||0})),c)),C(c)?p.createElement("rect",{x:u<l?u:u-f,y:0,width:f,height:Math.floor(c+(s?parseInt("".concat(s),10):1))}):null}},{key:"renderVerticalRect",value:function(a){var n=this.props,i=n.baseLine,o=n.points,s=n.strokeWidth,u=o[0].y,l=o[o.length-1].y,f=a*Math.abs(u-l),c=T(o.map(function(h){return h.x||0}));return C(i)&&typeof i=="number"?c=Math.max(i,c):i&&Array.isArray(i)&&i.length&&(c=Math.max(T(i.map(function(h){return h.x||0})),c)),C(c)?p.createElement("rect",{x:0,y:u<l?u:u-f,width:c+(s?parseInt("".concat(s),10):1),height:Math.floor(f)}):null}},{key:"renderClipRect",value:function(a){var n=this.props.layout;return n==="vertical"?this.renderVerticalRect(a):this.renderHorizontalRect(a)}},{key:"renderAreaStatically",value:function(a,n,i,o){var s=this.props,u=s.layout,l=s.type,f=s.stroke,c=s.connectNulls,h=s.isRange;s.ref;var A=ae(s,ye);return p.createElement(W,{clipPath:i?"url(#clipPath-".concat(o,")"):null},p.createElement(F,D({},R(A,!0),{points:a,connectNulls:c,type:l,baseLine:n,layout:u,stroke:"none",className:"recharts-area-area"})),f!=="none"&&p.createElement(F,D({},R(this.props,!1),{className:"recharts-area-curve",layout:u,type:l,connectNulls:c,fill:"none",points:a})),f!=="none"&&h&&p.createElement(F,D({},R(this.props,!1),{className:"recharts-area-curve",layout:u,type:l,connectNulls:c,fill:"none",points:n})))}},{key:"renderAreaWithAnimation",value:function(a,n){var i=this,o=this.props,s=o.points,u=o.baseLine,l=o.isAnimationActive,f=o.animationBegin,c=o.animationDuration,h=o.animationEasing,A=o.animationId,g=this.state,x=g.prevPoints,v=g.prevBaseLine;return p.createElement(ie,{begin:f,duration:c,isActive:l,easing:h,from:{t:0},to:{t:1},key:"area-".concat(A),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(O){var y=O.t;if(x){var _=x.length/s.length,d=s.map(function(P,N){var k=Math.floor(N*_);if(x[k]){var j=x[k],I=B(j.x,P.x),V=B(j.y,P.y);return S(S({},P),{},{x:I(y),y:V(y)})}return P}),m;if(C(u)&&typeof u=="number"){var b=B(v,u);m=b(y)}else if(q(u)||oe(u)){var w=B(v,0);m=w(y)}else m=u.map(function(P,N){var k=Math.floor(N*_);if(v[k]){var j=v[k],I=B(j.x,P.x),V=B(j.y,P.y);return S(S({},P),{},{x:I(y),y:V(y)})}return P});return i.renderAreaStatically(d,m,a,n)}return p.createElement(W,null,p.createElement("defs",null,p.createElement("clipPath",{id:"animationClipPath-".concat(n)},i.renderClipRect(y))),p.createElement(W,{clipPath:"url(#animationClipPath-".concat(n,")")},i.renderAreaStatically(s,u,a,n)))})}},{key:"renderArea",value:function(a,n){var i=this.props,o=i.points,s=i.baseLine,u=i.isAnimationActive,l=this.state,f=l.prevPoints,c=l.prevBaseLine,h=l.totalLength;return u&&o&&o.length&&(!f&&h>0||!G(f,o)||!G(c,s))?this.renderAreaWithAnimation(a,n):this.renderAreaStatically(o,s,a,n)}},{key:"render",value:function(){var a,n=this.props,i=n.hide,o=n.dot,s=n.points,u=n.className,l=n.top,f=n.left,c=n.xAxis,h=n.yAxis,A=n.width,g=n.height,x=n.isAnimationActive,v=n.id;if(i||!s||!s.length)return null;var O=this.state.isAnimationFinished,y=s.length===1,_=ee("recharts-area",u),d=c&&c.allowDataOverflow,m=h&&h.allowDataOverflow,b=d||m,w=q(v)?this.id:v,P=(a=R(o,!1))!==null&&a!==void 0?a:{r:3,strokeWidth:2},N=P.r,k=N===void 0?3:N,j=P.strokeWidth,I=j===void 0?2:j,V=se(o)?o:{},Y=V.clipDot,H=Y===void 0?!0:Y,z=k*2+I;return p.createElement(W,{className:_},d||m?p.createElement("defs",null,p.createElement("clipPath",{id:"clipPath-".concat(w)},p.createElement("rect",{x:d?f:f-A/2,y:m?l:l-g/2,width:d?A:A*2,height:m?g:g*2})),!H&&p.createElement("clipPath",{id:"clipPath-dots-".concat(w)},p.createElement("rect",{x:f-z/2,y:l-z/2,width:A+z,height:g+z}))):null,y?null:this.renderArea(b,w),(o||y)&&this.renderDots(b,H,w),(!x||O)&&le.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(a,n){return a.animationId!==n.prevAnimationId?{prevAnimationId:a.animationId,curPoints:a.points,curBaseLine:a.baseLine,prevPoints:n.curPoints,prevBaseLine:n.curBaseLine}:a.points!==n.curPoints||a.baseLine!==n.curBaseLine?{curPoints:a.points,curBaseLine:a.baseLine}:null}}])}(ve.PureComponent);te=L;E(L,"displayName","Area");E(L,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!ce.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});E(L,"getBaseValue",function(e,t,r,a){var n=e.layout,i=e.baseValue,o=t.props.baseValue,s=o??i;if(C(s)&&typeof s=="number")return s;var u=n==="horizontal"?a:r,l=u.scale.domain();if(u.type==="number"){var f=Math.max(l[0],l[1]),c=Math.min(l[0],l[1]);return s==="dataMin"?c:s==="dataMax"||f<0?f:Math.max(Math.min(l[0],l[1]),0)}return s==="dataMin"?l[0]:s==="dataMax"?l[1]:l[0]});E(L,"getComposedData",function(e){var t=e.props,r=e.item,a=e.xAxis,n=e.yAxis,i=e.xAxisTicks,o=e.yAxisTicks,s=e.bandSize,u=e.dataKey,l=e.stackedData,f=e.dataStartIndex,c=e.displayedData,h=e.offset,A=t.layout,g=l&&l.length,x=te.getBaseValue(t,r,a,n),v=A==="horizontal",O=!1,y=c.map(function(d,m){var b;g?b=l[f+m]:(b=J(d,u),Array.isArray(b)?O=!0:b=[x,b]);var w=b[1]==null||g&&J(d,u)==null;return v?{x:Q({axis:a,ticks:i,bandSize:s,entry:d,index:m}),y:w?null:n.scale(b[1]),value:b,payload:d}:{x:w?null:a.scale(b[1]),y:Q({axis:n,ticks:o,bandSize:s,entry:d,index:m}),value:b,payload:d}}),_;return g||O?_=y.map(function(d){var m=Array.isArray(d.value)?d.value[0]:null;return v?{x:d.x,y:m!=null&&d.y!=null?n.scale(m):null}:{x:m!=null?a.scale(m):null,y:d.y}}):_=v?n.scale(x):a.scale(x),S({points:y,baseLine:_,layout:A,isRange:O},h)});E(L,"renderDotItem",function(e,t){var r;if(p.isValidElement(e))r=p.cloneElement(e,t);else if(K(e))r=e(t);else{var a=ee("recharts-area-dot",typeof e!="boolean"?e.className:""),n=t.key,i=ae(t,be);r=p.createElement(fe,D({},i,{key:n,className:a}))}return r});var ke=pe({chartName:"AreaChart",GraphicalChild:L,axisComponents:[{axisType:"xAxis",AxisComp:he},{axisType:"yAxis",AxisComp:de}],formatAxisMap:me});export{ke as A,L as a};
|
|
2
|
-
//# sourceMappingURL=AreaChart-
|
|
1
|
+
import{b as R,c as W,m as T,i as C,d as F,A as ie,e as B,h as q,j as oe,k as G,l as se,n as le,u as ue,o as K,G as ce,p as J,q as Q,D as fe,g as pe,X as he,Y as de,f as me}from"./generateCategoricalChart-o4NdniRd.js";import{R as p,J as ee,r as ve}from"./index-BBhaR8pI.js";var ye=["layout","type","stroke","connectNulls","isRange","ref"],be=["key"],te;function M(e){"@babel/helpers - typeof";return M=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M(e)}function ae(e,t){if(e==null)return{};var r=Ae(e,t),a,n;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)a=i[n],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}function Ae(e,t){if(e==null)return{};var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){if(t.indexOf(a)>=0)continue;r[a]=e[a]}return r}function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},D.apply(this,arguments)}function U(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,a)}return r}function S(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?U(Object(r),!0).forEach(function(a){E(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):U(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function ge(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Z(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,ne(a.key),a)}}function xe(e,t,r){return t&&Z(e.prototype,t),r&&Z(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Pe(e,t,r){return t=$(t),Oe(e,re()?Reflect.construct(t,r||[],$(e).constructor):t.apply(e,r))}function Oe(e,t){if(t&&(M(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ee(e)}function Ee(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function re(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(re=function(){return!!e})()}function $(e){return $=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},$(e)}function we(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&X(e,t)}function X(e,t){return X=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,n){return a.__proto__=n,a},X(e,t)}function E(e,t,r){return t=ne(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ne(e){var t=_e(e,"string");return M(t)=="symbol"?t:t+""}function _e(e,t){if(M(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(M(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var L=function(e){function t(){var r;ge(this,t);for(var a=arguments.length,n=new Array(a),i=0;i<a;i++)n[i]=arguments[i];return r=Pe(this,t,[].concat(n)),E(r,"state",{isAnimationFinished:!0}),E(r,"id",ue("recharts-area-")),E(r,"handleAnimationEnd",function(){var o=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),K(o)&&o()}),E(r,"handleAnimationStart",function(){var o=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),K(o)&&o()}),r}return we(t,e),xe(t,[{key:"renderDots",value:function(a,n,i){var o=this.props.isAnimationActive,s=this.state.isAnimationFinished;if(o&&!s)return null;var u=this.props,l=u.dot,f=u.points,c=u.dataKey,h=R(this.props,!1),A=R(l,!0),g=f.map(function(v,O){var y=S(S(S({key:"dot-".concat(O),r:3},h),A),{},{index:O,cx:v.x,cy:v.y,dataKey:c,value:v.value,payload:v.payload,points:f});return t.renderDotItem(l,y)}),x={clipPath:a?"url(#clipPath-".concat(n?"":"dots-").concat(i,")"):null};return p.createElement(W,D({className:"recharts-area-dots"},x),g)}},{key:"renderHorizontalRect",value:function(a){var n=this.props,i=n.baseLine,o=n.points,s=n.strokeWidth,u=o[0].x,l=o[o.length-1].x,f=a*Math.abs(u-l),c=T(o.map(function(h){return h.y||0}));return C(i)&&typeof i=="number"?c=Math.max(i,c):i&&Array.isArray(i)&&i.length&&(c=Math.max(T(i.map(function(h){return h.y||0})),c)),C(c)?p.createElement("rect",{x:u<l?u:u-f,y:0,width:f,height:Math.floor(c+(s?parseInt("".concat(s),10):1))}):null}},{key:"renderVerticalRect",value:function(a){var n=this.props,i=n.baseLine,o=n.points,s=n.strokeWidth,u=o[0].y,l=o[o.length-1].y,f=a*Math.abs(u-l),c=T(o.map(function(h){return h.x||0}));return C(i)&&typeof i=="number"?c=Math.max(i,c):i&&Array.isArray(i)&&i.length&&(c=Math.max(T(i.map(function(h){return h.x||0})),c)),C(c)?p.createElement("rect",{x:0,y:u<l?u:u-f,width:c+(s?parseInt("".concat(s),10):1),height:Math.floor(f)}):null}},{key:"renderClipRect",value:function(a){var n=this.props.layout;return n==="vertical"?this.renderVerticalRect(a):this.renderHorizontalRect(a)}},{key:"renderAreaStatically",value:function(a,n,i,o){var s=this.props,u=s.layout,l=s.type,f=s.stroke,c=s.connectNulls,h=s.isRange;s.ref;var A=ae(s,ye);return p.createElement(W,{clipPath:i?"url(#clipPath-".concat(o,")"):null},p.createElement(F,D({},R(A,!0),{points:a,connectNulls:c,type:l,baseLine:n,layout:u,stroke:"none",className:"recharts-area-area"})),f!=="none"&&p.createElement(F,D({},R(this.props,!1),{className:"recharts-area-curve",layout:u,type:l,connectNulls:c,fill:"none",points:a})),f!=="none"&&h&&p.createElement(F,D({},R(this.props,!1),{className:"recharts-area-curve",layout:u,type:l,connectNulls:c,fill:"none",points:n})))}},{key:"renderAreaWithAnimation",value:function(a,n){var i=this,o=this.props,s=o.points,u=o.baseLine,l=o.isAnimationActive,f=o.animationBegin,c=o.animationDuration,h=o.animationEasing,A=o.animationId,g=this.state,x=g.prevPoints,v=g.prevBaseLine;return p.createElement(ie,{begin:f,duration:c,isActive:l,easing:h,from:{t:0},to:{t:1},key:"area-".concat(A),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(O){var y=O.t;if(x){var _=x.length/s.length,d=s.map(function(P,N){var k=Math.floor(N*_);if(x[k]){var j=x[k],I=B(j.x,P.x),V=B(j.y,P.y);return S(S({},P),{},{x:I(y),y:V(y)})}return P}),m;if(C(u)&&typeof u=="number"){var b=B(v,u);m=b(y)}else if(q(u)||oe(u)){var w=B(v,0);m=w(y)}else m=u.map(function(P,N){var k=Math.floor(N*_);if(v[k]){var j=v[k],I=B(j.x,P.x),V=B(j.y,P.y);return S(S({},P),{},{x:I(y),y:V(y)})}return P});return i.renderAreaStatically(d,m,a,n)}return p.createElement(W,null,p.createElement("defs",null,p.createElement("clipPath",{id:"animationClipPath-".concat(n)},i.renderClipRect(y))),p.createElement(W,{clipPath:"url(#animationClipPath-".concat(n,")")},i.renderAreaStatically(s,u,a,n)))})}},{key:"renderArea",value:function(a,n){var i=this.props,o=i.points,s=i.baseLine,u=i.isAnimationActive,l=this.state,f=l.prevPoints,c=l.prevBaseLine,h=l.totalLength;return u&&o&&o.length&&(!f&&h>0||!G(f,o)||!G(c,s))?this.renderAreaWithAnimation(a,n):this.renderAreaStatically(o,s,a,n)}},{key:"render",value:function(){var a,n=this.props,i=n.hide,o=n.dot,s=n.points,u=n.className,l=n.top,f=n.left,c=n.xAxis,h=n.yAxis,A=n.width,g=n.height,x=n.isAnimationActive,v=n.id;if(i||!s||!s.length)return null;var O=this.state.isAnimationFinished,y=s.length===1,_=ee("recharts-area",u),d=c&&c.allowDataOverflow,m=h&&h.allowDataOverflow,b=d||m,w=q(v)?this.id:v,P=(a=R(o,!1))!==null&&a!==void 0?a:{r:3,strokeWidth:2},N=P.r,k=N===void 0?3:N,j=P.strokeWidth,I=j===void 0?2:j,V=se(o)?o:{},Y=V.clipDot,H=Y===void 0?!0:Y,z=k*2+I;return p.createElement(W,{className:_},d||m?p.createElement("defs",null,p.createElement("clipPath",{id:"clipPath-".concat(w)},p.createElement("rect",{x:d?f:f-A/2,y:m?l:l-g/2,width:d?A:A*2,height:m?g:g*2})),!H&&p.createElement("clipPath",{id:"clipPath-dots-".concat(w)},p.createElement("rect",{x:f-z/2,y:l-z/2,width:A+z,height:g+z}))):null,y?null:this.renderArea(b,w),(o||y)&&this.renderDots(b,H,w),(!x||O)&&le.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(a,n){return a.animationId!==n.prevAnimationId?{prevAnimationId:a.animationId,curPoints:a.points,curBaseLine:a.baseLine,prevPoints:n.curPoints,prevBaseLine:n.curBaseLine}:a.points!==n.curPoints||a.baseLine!==n.curBaseLine?{curPoints:a.points,curBaseLine:a.baseLine}:null}}])}(ve.PureComponent);te=L;E(L,"displayName","Area");E(L,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!ce.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});E(L,"getBaseValue",function(e,t,r,a){var n=e.layout,i=e.baseValue,o=t.props.baseValue,s=o??i;if(C(s)&&typeof s=="number")return s;var u=n==="horizontal"?a:r,l=u.scale.domain();if(u.type==="number"){var f=Math.max(l[0],l[1]),c=Math.min(l[0],l[1]);return s==="dataMin"?c:s==="dataMax"||f<0?f:Math.max(Math.min(l[0],l[1]),0)}return s==="dataMin"?l[0]:s==="dataMax"?l[1]:l[0]});E(L,"getComposedData",function(e){var t=e.props,r=e.item,a=e.xAxis,n=e.yAxis,i=e.xAxisTicks,o=e.yAxisTicks,s=e.bandSize,u=e.dataKey,l=e.stackedData,f=e.dataStartIndex,c=e.displayedData,h=e.offset,A=t.layout,g=l&&l.length,x=te.getBaseValue(t,r,a,n),v=A==="horizontal",O=!1,y=c.map(function(d,m){var b;g?b=l[f+m]:(b=J(d,u),Array.isArray(b)?O=!0:b=[x,b]);var w=b[1]==null||g&&J(d,u)==null;return v?{x:Q({axis:a,ticks:i,bandSize:s,entry:d,index:m}),y:w?null:n.scale(b[1]),value:b,payload:d}:{x:w?null:a.scale(b[1]),y:Q({axis:n,ticks:o,bandSize:s,entry:d,index:m}),value:b,payload:d}}),_;return g||O?_=y.map(function(d){var m=Array.isArray(d.value)?d.value[0]:null;return v?{x:d.x,y:m!=null&&d.y!=null?n.scale(m):null}:{x:m!=null?a.scale(m):null,y:d.y}}):_=v?n.scale(x):a.scale(x),S({points:y,baseLine:_,layout:A,isRange:O},h)});E(L,"renderDotItem",function(e,t){var r;if(p.isValidElement(e))r=p.cloneElement(e,t);else if(K(e))r=e(t);else{var a=ee("recharts-area-dot",typeof e!="boolean"?e.className:""),n=t.key,i=ae(t,be);r=p.createElement(fe,D({},i,{key:n,className:a}))}return r});var ke=pe({chartName:"AreaChart",GraphicalChild:L,axisComponents:[{axisType:"xAxis",AxisComp:he},{axisType:"yAxis",AxisComp:de}],formatAxisMap:me});export{ke as A,L as a};
|
|
2
|
+
//# sourceMappingURL=AreaChart-B_2FnM5A.js.map
|