@sim-design/training 1.0.0

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.
Files changed (46) hide show
  1. package/README.md +33 -0
  2. package/dist/ArrowLeftOutlined-CiSQq3bL.js +12 -0
  3. package/dist/AssessmentPlugin-Bx4VrBdV.js +607 -0
  4. package/dist/CaseAnalysisPlugin-CQvF9_zr.js +416 -0
  5. package/dist/CharacterDialoguePanel-Bvdab3qj.js +776 -0
  6. package/dist/CheckCircleFilled-Byo8CDfW.js +12 -0
  7. package/dist/CustomLayoutRenderer--rnQrqQ2.js +122524 -0
  8. package/dist/DecisionSelectPlugin-DtQ2KV34.js +863 -0
  9. package/dist/DecisionShared-Dh9oeQFT.js +65 -0
  10. package/dist/DialogueFormPlugin-C9ssnVMr.js +959 -0
  11. package/dist/DialoguePlugin-DU00QpmQ.js +416 -0
  12. package/dist/DocumentReviewPlugin-HNOZY1T4.js +977 -0
  13. package/dist/EyeOutlined-XvOAKlLs.js +12 -0
  14. package/dist/FormFillingPlugin-DURWsioi.js +445 -0
  15. package/dist/ModelEditor-BPJsPR0S.js +8264 -0
  16. package/dist/PluginHeader-B-GESJmT.js +87 -0
  17. package/dist/ProcessOperationPlugin-IijngDlX.js +88 -0
  18. package/dist/QAPlugin-Bh_UjK1N.js +184 -0
  19. package/dist/RadarChart-C5ZM0kWt.js +24963 -0
  20. package/dist/ReloadOutlined-Daor2m11.js +12 -0
  21. package/dist/SettingOutlined-CLEOgXB-.js +92 -0
  22. package/dist/StrategyLabPlugin-DGeZsr_7.js +14361 -0
  23. package/dist/ThunderboltOutlined-nH_FO_4A.js +44 -0
  24. package/dist/ToolOutlined-DtuNJDB2.js +28 -0
  25. package/dist/TrainingModelContainer-DpW-uB8O.js +11883 -0
  26. package/dist/UndoOutlined-ChUQYUul.js +84 -0
  27. package/dist/WarningFilled-1Rc4hr0C.js +12 -0
  28. package/dist/WarningOutlined-5g1d66hO.js +164 -0
  29. package/dist/adapters-D1FFZFoA.js +51 -0
  30. package/dist/analysisTools-CXyOvSZT.js +237 -0
  31. package/dist/creator.js +5 -0
  32. package/dist/index-CYjdXPgc.js +6568 -0
  33. package/dist/index-XuBVjlmu.js +44651 -0
  34. package/dist/index.js +11 -0
  35. package/dist/judgement-D_9i7x9S.js +20 -0
  36. package/dist/runtime.js +4 -0
  37. package/dist/types.js +8 -0
  38. package/dist/useDialogueLogic-IHELcN3X.js +368 -0
  39. package/dist-types/client/src/lib/adapters.d.ts +10 -0
  40. package/dist-types/client/src/lib/creator.d.ts +3 -0
  41. package/dist-types/client/src/lib/creatorIntegrationContext.d.ts +8 -0
  42. package/dist-types/client/src/lib/index.d.ts +5 -0
  43. package/dist-types/client/src/lib/public-types.d.ts +2 -0
  44. package/dist-types/client/src/lib/runtime.d.ts +3 -0
  45. package/dist-types/client/src/lib/types.d.ts +301 -0
  46. package/package.json +83 -0
@@ -0,0 +1,416 @@
1
+ import { c as D, j as r, i as rr, g as er, a as or, r as X } from "./RadarChart-C5ZM0kWt.js";
2
+ import { useState as R, useMemo as sr, useCallback as $ } from "react";
3
+ import { Button as E, Card as w, Tag as A, Typography as nr, Space as K, Input as lr, Spin as tr, Alert as ir, Collapse as cr, message as q } from "antd";
4
+ import { a as dr, p as ar } from "./TrainingModelContainer-DpW-uB8O.js";
5
+ import { a as pr } from "./judgement-D_9i7x9S.js";
6
+ import { g as gr } from "./analysisTools-CXyOvSZT.js";
7
+ import { P as mr } from "./PluginHeader-B-GESJmT.js";
8
+ import { R as Z, a as yr, b as hr } from "./ToolOutlined-DtuNJDB2.js";
9
+ import { f as M, a as T } from "./WarningOutlined-5g1d66hO.js";
10
+ import { R as fr } from "./ReloadOutlined-Daor2m11.js";
11
+ const { TextArea: xr } = lr, { Text: V } = nr;
12
+ function jr(e) {
13
+ var g;
14
+ const a = {};
15
+ for (const y of e)
16
+ (a[g = y.category] || (a[g] = [])).push(y);
17
+ return a;
18
+ }
19
+ function ur(e, a) {
20
+ const g = [];
21
+ for (let y = 0; y < e.length; y += a)
22
+ g.push(e.slice(y, y + a));
23
+ return g;
24
+ }
25
+ const br = ({
26
+ phase: e,
27
+ caseDescription: a,
28
+ analysisPoints: g,
29
+ tools: y,
30
+ recommendedTool: h,
31
+ selectedTool: o,
32
+ dimensionAnswers: C,
33
+ evaluation: t,
34
+ loading: S,
35
+ uiConfig: l,
36
+ onStartAnalysis: b,
37
+ onSelectTool: v,
38
+ onDimensionChange: f,
39
+ onSubmit: F,
40
+ onRetry: U,
41
+ onComplete: H
42
+ }) => {
43
+ const n = D(l.theme), O = l.caseCardStyle || "card", z = l.toolSelectLayout || "grid", I = l.toolColumns || 3, _ = l.dimensionInputRows || 4, W = l.submitButtonText || "提交分析", J = l.showToolDescription !== !1, L = l.feedbackStyle || "collapse", i = n.borderRadius, N = () => a ? O === "banner" ? /* @__PURE__ */ r.jsx(mr, { title: a, variant: "banner", theme: n }) : O === "minimal" ? /* @__PURE__ */ r.jsx("div", { style: { marginBottom: 16, padding: "12px 16px", borderLeft: `4px solid ${n.primaryColor}`, backgroundColor: n.backgroundColor, borderRadius: i }, children: /* @__PURE__ */ r.jsx("div", { style: { fontSize: 14, lineHeight: 1.8, color: "#262626", whiteSpace: "pre-wrap" }, children: a }) }) : /* @__PURE__ */ r.jsx(
44
+ w,
45
+ {
46
+ size: "small",
47
+ style: { marginBottom: 16, borderRadius: i, borderColor: n.borderColor },
48
+ title: /* @__PURE__ */ r.jsxs("span", { style: { fontWeight: 600, color: n.headerColor }, children: [
49
+ /* @__PURE__ */ r.jsx(hr, { style: { marginRight: 8 } }),
50
+ "案例背景"
51
+ ] }),
52
+ children: /* @__PURE__ */ r.jsx("div", { style: { fontSize: 14, lineHeight: 1.8, color: "#262626", whiteSpace: "pre-wrap" }, children: a })
53
+ }
54
+ ) : null, B = () => !g || g.length === 0 ? null : /* @__PURE__ */ r.jsxs("div", { style: { marginBottom: 16, display: "flex", alignItems: "center", gap: 8, flexWrap: "wrap" }, children: [
55
+ /* @__PURE__ */ r.jsxs("span", { style: { fontSize: 13, fontWeight: 600, color: n.headerColor }, children: [
56
+ /* @__PURE__ */ r.jsx(T, { style: { marginRight: 4 } }),
57
+ "分析要点:"
58
+ ] }),
59
+ g.map((k, c) => /* @__PURE__ */ r.jsx(A, { style: { borderColor: n.primaryColor, color: n.primaryColor, borderRadius: 20, padding: "2px 12px", fontSize: 13, background: "transparent" }, children: k }, c))
60
+ ] });
61
+ if (e === "reading")
62
+ return /* @__PURE__ */ r.jsxs("div", { style: { height: "100%", overflow: "auto", padding: 20, ...l.styleOverrides }, children: [
63
+ N(),
64
+ B(),
65
+ /* @__PURE__ */ r.jsx("div", { style: { textAlign: "center", marginTop: 24 }, children: /* @__PURE__ */ r.jsx(E, { type: "primary", size: "large", icon: /* @__PURE__ */ r.jsx(Z, {}), onClick: b, style: { borderRadius: i, backgroundColor: n.primaryColor, borderColor: n.primaryColor }, children: "开始分析" }) })
66
+ ] });
67
+ if (e === "analyzing") {
68
+ const k = jr(y);
69
+ return /* @__PURE__ */ r.jsxs("div", { style: { height: "100%", overflow: "auto", padding: 20, ...l.styleOverrides }, children: [
70
+ N(),
71
+ B(),
72
+ /* @__PURE__ */ r.jsx(
73
+ w,
74
+ {
75
+ size: "small",
76
+ style: { marginBottom: 16, borderRadius: i, borderColor: n.borderColor },
77
+ title: /* @__PURE__ */ r.jsxs("span", { style: { fontWeight: 600, color: n.headerColor }, children: [
78
+ /* @__PURE__ */ r.jsx(Z, { style: { marginRight: 8 } }),
79
+ "选择分析工具"
80
+ ] }),
81
+ children: z === "grid" ? (
82
+ // grid 模式:所有工具平铺,按 toolColumns 分行
83
+ ur(y, I).map((s, d) => /* @__PURE__ */ r.jsxs("div", { style: { display: "flex", gap: 8, marginBottom: 8 }, children: [
84
+ s.map((p) => /* @__PURE__ */ r.jsxs(
85
+ "div",
86
+ {
87
+ onClick: () => v(p.key),
88
+ style: {
89
+ flex: "1 1 0",
90
+ minWidth: 0,
91
+ padding: "8px 12px",
92
+ borderRadius: i,
93
+ border: `1px solid ${(o == null ? void 0 : o.key) === p.key ? n.primaryColor : n.borderColor}`,
94
+ backgroundColor: (o == null ? void 0 : o.key) === p.key ? n.backgroundColor : "#fff",
95
+ cursor: "pointer",
96
+ transition: "all 0.2s"
97
+ },
98
+ children: [
99
+ /* @__PURE__ */ r.jsxs("div", { style: { fontWeight: 600, fontSize: 13 }, children: [
100
+ p.name,
101
+ h === p.key && /* @__PURE__ */ r.jsx(A, { color: n.primaryColor, style: { marginLeft: 6, fontSize: 11, lineHeight: "18px", padding: "0 6px" }, children: "推荐" }),
102
+ /* @__PURE__ */ r.jsx(A, { style: { marginLeft: 6, fontSize: 10, lineHeight: "16px", padding: "0 4px", color: "#8c8c8c", borderColor: "#d9d9d9" }, children: p.category })
103
+ ] }),
104
+ J && /* @__PURE__ */ r.jsx("div", { style: { fontSize: 12, color: "#8c8c8c", marginTop: 2 }, children: p.description })
105
+ ]
106
+ },
107
+ p.key
108
+ )),
109
+ s.length < I && Array.from({ length: I - s.length }).map((p, u) => /* @__PURE__ */ r.jsx("div", { style: { flex: "1 1 0", minWidth: 0 } }, `empty-${u}`))
110
+ ] }, d))
111
+ ) : (
112
+ // list 模式:按分类分组,每组内纵向排列
113
+ Object.entries(k).map(([c, s]) => /* @__PURE__ */ r.jsxs("div", { style: { marginBottom: 16 }, children: [
114
+ /* @__PURE__ */ r.jsx(V, { type: "secondary", style: { fontSize: 12, fontWeight: 600, display: "block", marginBottom: 8 }, children: c }),
115
+ s.map((d) => /* @__PURE__ */ r.jsxs(
116
+ "div",
117
+ {
118
+ onClick: () => v(d.key),
119
+ style: {
120
+ padding: "8px 12px",
121
+ marginBottom: 8,
122
+ borderRadius: i,
123
+ border: `1px solid ${(o == null ? void 0 : o.key) === d.key ? n.primaryColor : n.borderColor}`,
124
+ backgroundColor: (o == null ? void 0 : o.key) === d.key ? n.backgroundColor : "#fff",
125
+ cursor: "pointer",
126
+ transition: "all 0.2s"
127
+ },
128
+ children: [
129
+ /* @__PURE__ */ r.jsxs("div", { style: { fontWeight: 600, fontSize: 13 }, children: [
130
+ d.name,
131
+ h === d.key && /* @__PURE__ */ r.jsx(A, { color: n.primaryColor, style: { marginLeft: 6, fontSize: 11, lineHeight: "18px", padding: "0 6px" }, children: "推荐" })
132
+ ] }),
133
+ J && /* @__PURE__ */ r.jsx("div", { style: { fontSize: 12, color: "#8c8c8c", marginTop: 2 }, children: d.description })
134
+ ]
135
+ },
136
+ d.key
137
+ ))
138
+ ] }, c))
139
+ )
140
+ }
141
+ ),
142
+ o && /* @__PURE__ */ r.jsx(
143
+ w,
144
+ {
145
+ size: "small",
146
+ style: { marginBottom: 16, borderRadius: i, borderColor: n.borderColor },
147
+ title: /* @__PURE__ */ r.jsxs("span", { style: { fontWeight: 600, color: n.headerColor }, children: [
148
+ o.name,
149
+ " — 维度分析"
150
+ ] }),
151
+ children: /* @__PURE__ */ r.jsx(K, { direction: "vertical", style: { width: "100%" }, size: "middle", children: o.dimensions.map((c) => /* @__PURE__ */ r.jsxs("div", { children: [
152
+ /* @__PURE__ */ r.jsxs("div", { style: { marginBottom: 4 }, children: [
153
+ /* @__PURE__ */ r.jsx(V, { strong: !0, style: { fontSize: 13 }, children: c.label }),
154
+ /* @__PURE__ */ r.jsx(V, { type: "secondary", style: { fontSize: 12, marginLeft: 8 }, children: c.description })
155
+ ] }),
156
+ /* @__PURE__ */ r.jsx(
157
+ xr,
158
+ {
159
+ rows: _,
160
+ placeholder: c.placeholder,
161
+ value: C[c.key] || "",
162
+ onChange: (s) => f(c.key, s.target.value),
163
+ style: { borderRadius: i, borderColor: n.borderColor }
164
+ }
165
+ )
166
+ ] }, c.key)) })
167
+ }
168
+ ),
169
+ /* @__PURE__ */ r.jsx("div", { style: { textAlign: "right", marginTop: 16 }, children: /* @__PURE__ */ r.jsx(
170
+ E,
171
+ {
172
+ type: "primary",
173
+ size: "large",
174
+ onClick: F,
175
+ disabled: !o || Object.values(C).every((c) => !c.trim()),
176
+ loading: S,
177
+ style: { borderRadius: i, backgroundColor: n.primaryColor, borderColor: n.primaryColor },
178
+ children: W
179
+ }
180
+ ) })
181
+ ] });
182
+ }
183
+ if (e === "evaluating")
184
+ return /* @__PURE__ */ r.jsx("div", { style: { height: "100%", overflow: "auto", padding: 20, textAlign: "center", ...l.styleOverrides }, children: /* @__PURE__ */ r.jsx(tr, { size: "large", tip: "AI 正在评估您的分析..." }) });
185
+ if (e === "feedback" && t) {
186
+ const k = t.totalScore >= 80 ? "#52c41a" : t.totalScore >= 60 ? "#faad14" : "#ff4d4f", c = t.dimensions.map((s, d) => {
187
+ var p, u;
188
+ return {
189
+ key: String(d),
190
+ label: /* @__PURE__ */ r.jsxs("span", { children: [
191
+ s.name,
192
+ /* @__PURE__ */ r.jsxs(A, { color: s.score >= 80 ? "green" : s.score >= 60 ? "orange" : "red", style: { marginLeft: 8 }, children: [
193
+ s.score,
194
+ "分"
195
+ ] })
196
+ ] }),
197
+ children: /* @__PURE__ */ r.jsxs("div", { children: [
198
+ /* @__PURE__ */ r.jsx("div", { style: { fontSize: 14, lineHeight: 1.8, color: "#595959", marginBottom: (p = s.errors) != null && p.length || (u = s.suggestions) != null && u.length ? 8 : 0 }, children: s.feedback }),
199
+ s.errors && s.errors.length > 0 && /* @__PURE__ */ r.jsx("div", { style: { marginBottom: 6 }, children: s.errors.map((m, x) => /* @__PURE__ */ r.jsxs("div", { style: { display: "flex", gap: 8, fontSize: 13, color: "#ff4d4f", marginBottom: 2 }, children: [
200
+ /* @__PURE__ */ r.jsx(M, { style: { marginTop: 3 } }),
201
+ m
202
+ ] }, x)) }),
203
+ s.suggestions && s.suggestions.length > 0 && /* @__PURE__ */ r.jsx("div", { children: s.suggestions.map((m, x) => /* @__PURE__ */ r.jsxs("div", { style: { display: "flex", gap: 8, fontSize: 13, color: "#fa8c16", marginBottom: 2 }, children: [
204
+ /* @__PURE__ */ r.jsx(T, { style: { marginTop: 3 } }),
205
+ m
206
+ ] }, x)) })
207
+ ] })
208
+ };
209
+ });
210
+ return /* @__PURE__ */ r.jsxs("div", { style: { height: "100%", overflow: "auto", padding: 20, ...l.styleOverrides }, children: [
211
+ /* @__PURE__ */ r.jsx(
212
+ ir,
213
+ {
214
+ type: t.pass ? t.totalScore >= 80 ? "success" : "warning" : "error",
215
+ showIcon: !0,
216
+ style: { marginBottom: 16, borderRadius: i },
217
+ message: /* @__PURE__ */ r.jsxs("span", { style: { fontSize: 16, fontWeight: 600 }, children: [
218
+ "综合评分:",
219
+ /* @__PURE__ */ r.jsx("span", { style: { color: k, fontSize: 24 }, children: t.totalScore }),
220
+ " 分",
221
+ /* @__PURE__ */ r.jsx(A, { color: t.pass ? "green" : "red", style: { marginLeft: 12, fontSize: 13 }, children: t.pass ? "通过" : "未通过" })
222
+ ] }),
223
+ description: t.nextStepAdvice
224
+ }
225
+ ),
226
+ L === "collapse" ? /* @__PURE__ */ r.jsx(cr, { items: c, defaultActiveKey: c.map((s) => s.key), style: { marginBottom: 16, borderRadius: i } }) : /* @__PURE__ */ r.jsx(K, { direction: "vertical", style: { width: "100%", marginBottom: 16 }, size: "small", children: t.dimensions.map((s, d) => {
227
+ var p, u, m, x;
228
+ return /* @__PURE__ */ r.jsxs(w, { size: "small", style: { borderRadius: i, borderColor: n.borderColor }, children: [
229
+ /* @__PURE__ */ r.jsxs("div", { style: { fontWeight: 600, marginBottom: 4 }, children: [
230
+ s.name,
231
+ /* @__PURE__ */ r.jsxs(A, { color: s.score >= 80 ? "green" : s.score >= 60 ? "orange" : "red", style: { marginLeft: 8 }, children: [
232
+ s.score,
233
+ "分"
234
+ ] })
235
+ ] }),
236
+ /* @__PURE__ */ r.jsx("div", { style: { fontSize: 14, color: "#595959", marginBottom: (p = s.errors) != null && p.length || (u = s.suggestions) != null && u.length ? 6 : 0 }, children: s.feedback }),
237
+ (m = s.errors) == null ? void 0 : m.map((j, P) => /* @__PURE__ */ r.jsxs("div", { style: { display: "flex", gap: 6, fontSize: 13, color: "#ff4d4f", marginBottom: 2 }, children: [
238
+ /* @__PURE__ */ r.jsx(M, { style: { marginTop: 3 } }),
239
+ j
240
+ ] }, P)),
241
+ (x = s.suggestions) == null ? void 0 : x.map((j, P) => /* @__PURE__ */ r.jsxs("div", { style: { display: "flex", gap: 6, fontSize: 13, color: "#fa8c16", marginBottom: 2 }, children: [
242
+ /* @__PURE__ */ r.jsx(T, { style: { marginTop: 3 } }),
243
+ j
244
+ ] }, P))
245
+ ] }, d);
246
+ }) }),
247
+ t.highlights.length > 0 && /* @__PURE__ */ r.jsx(w, { size: "small", style: { marginBottom: 16, borderRadius: i, borderColor: "#b7eb8f", backgroundColor: "#f6ffed" }, title: /* @__PURE__ */ r.jsxs("span", { style: { color: "#52c41a", fontWeight: 600 }, children: [
248
+ /* @__PURE__ */ r.jsx(yr, { style: { marginRight: 8 } }),
249
+ "分析亮点"
250
+ ] }), children: t.highlights.map((s, d) => /* @__PURE__ */ r.jsxs("div", { style: { display: "flex", gap: 8, marginBottom: 4, fontSize: 14, color: "#595959" }, children: [
251
+ /* @__PURE__ */ r.jsx(rr, { style: { color: "#52c41a", marginTop: 4 } }),
252
+ s
253
+ ] }, d)) }),
254
+ t.improvements.length > 0 && /* @__PURE__ */ r.jsx(w, { size: "small", style: { marginBottom: 16, borderRadius: i, borderColor: "#ffd591", backgroundColor: "#fff7e6" }, title: /* @__PURE__ */ r.jsxs("span", { style: { color: "#fa8c16", fontWeight: 600 }, children: [
255
+ /* @__PURE__ */ r.jsx(M, { style: { marginRight: 8 } }),
256
+ "改进建议"
257
+ ] }), children: t.improvements.map((s, d) => /* @__PURE__ */ r.jsxs("div", { style: { display: "flex", gap: 8, marginBottom: 4, fontSize: 14, color: "#595959" }, children: [
258
+ /* @__PURE__ */ r.jsx(T, { style: { color: "#fa8c16", marginTop: 4 } }),
259
+ s
260
+ ] }, d)) }),
261
+ /* @__PURE__ */ r.jsx("div", { style: { textAlign: "right", marginTop: 16 }, children: /* @__PURE__ */ r.jsxs(K, { children: [
262
+ /* @__PURE__ */ r.jsx(E, { icon: /* @__PURE__ */ r.jsx(fr, {}), onClick: U, style: { borderRadius: i }, children: "重新分析" }),
263
+ /* @__PURE__ */ r.jsx(E, { type: "primary", size: "large", onClick: H, style: { borderRadius: i, backgroundColor: n.primaryColor, borderColor: n.primaryColor }, children: "完成" })
264
+ ] }) })
265
+ ] });
266
+ }
267
+ return null;
268
+ }, Lr = ({
269
+ initData: e,
270
+ checkRules: a,
271
+ onFinish: g
272
+ }) => {
273
+ const [y, h] = R("reading"), [o, C] = R(null), [t, S] = R({}), [l, b] = R(null), [v, f] = R(!1), F = er("CASE_ANALYSIS"), U = (e == null ? void 0 : e.currentUser) || { userId: "student-001" }, { callAI: H, ready: n } = dr(F, U), O = (e == null ? void 0 : e.uiConfig) || {}, z = e == null ? void 0 : e.caseData, { filledData: I } = or(), _ = (e == null ? void 0 : e.caseDescription) || (z == null ? void 0 : z.description) || "", W = X(_, z, I), L = ((e == null ? void 0 : e.analysisPoints) || []).map((m) => X(m, z, I)), i = (e == null ? void 0 : e.referenceAnswer) || "", N = e == null ? void 0 : e.recommendedTool, B = sr(
274
+ () => gr(e == null ? void 0 : e.availableTools, e == null ? void 0 : e.customTools),
275
+ [e == null ? void 0 : e.availableTools, e == null ? void 0 : e.customTools]
276
+ ), k = $(() => {
277
+ h("analyzing");
278
+ }, []), c = $(
279
+ (m) => {
280
+ const x = B.find((j) => j.key === m) || null;
281
+ C(x), S({});
282
+ },
283
+ [B]
284
+ ), s = $((m, x) => {
285
+ S((j) => ({ ...j, [m]: x }));
286
+ }, []), d = $(async () => {
287
+ if (o) {
288
+ if (!n) {
289
+ q.error("AI 服务未就绪");
290
+ return;
291
+ }
292
+ h("evaluating"), f(!0);
293
+ try {
294
+ const m = Cr(
295
+ W,
296
+ L,
297
+ o,
298
+ t,
299
+ i,
300
+ a
301
+ );
302
+ let x = "";
303
+ await H(m, (j, P) => {
304
+ if (x = j, P) {
305
+ const { command: Y, cleanContent: G } = ar(j, "evaluation");
306
+ if (Y) {
307
+ b(Y.data), h("feedback");
308
+ return;
309
+ }
310
+ try {
311
+ const Q = JSON.parse(G);
312
+ if (Q.type) {
313
+ q.info("AI 返回了非评价指令,请重试"), h("analyzing");
314
+ return;
315
+ }
316
+ b(Q), h("feedback");
317
+ } catch {
318
+ console.error("AI 返回解析失败:", G), q.error("AI 评价结果解析失败,请重试"), h("analyzing");
319
+ }
320
+ }
321
+ });
322
+ } catch (m) {
323
+ console.error("AI 调用失败:", m), q.error("AI 评价失败,请重试"), h("analyzing");
324
+ } finally {
325
+ f(!1);
326
+ }
327
+ }
328
+ }, [o, n, H, W, L, t, i, a]), p = $(() => {
329
+ h("analyzing"), C(null), S({}), b(null);
330
+ }, []), u = $(() => {
331
+ g({
332
+ stepId: (e == null ? void 0 : e.stepId) || "unknown",
333
+ operationType: "case-analysis",
334
+ operationData: {
335
+ selectedTool: o == null ? void 0 : o.key,
336
+ selectedToolName: o == null ? void 0 : o.name,
337
+ dimensionAnswers: t,
338
+ evaluation: l,
339
+ overallScore: l == null ? void 0 : l.totalScore
340
+ },
341
+ operationLog: [],
342
+ timestamp: Date.now(),
343
+ evidenceSummary: pr({
344
+ sourceStepId: (e == null ? void 0 : e.stepId) || "unknown",
345
+ sourceStepName: (e == null ? void 0 : e.stepName) || "案例分析",
346
+ sourceType: "case-analysis",
347
+ title: `${(e == null ? void 0 : e.stepName) || "案例分析"}摘要`,
348
+ summary: `使用 ${(o == null ? void 0 : o.name) || "未选择工具"} 完成分析${(l == null ? void 0 : l.totalScore) != null ? `,总分 ${l.totalScore}` : ""}。`,
349
+ keyFacts: [
350
+ { label: "分析工具", value: (o == null ? void 0 : o.name) || "未选择" },
351
+ ...(l == null ? void 0 : l.totalScore) != null ? [{ label: "总分", value: String(l.totalScore) }] : []
352
+ ]
353
+ })
354
+ });
355
+ }, [g, e == null ? void 0 : e.stepId, o, t, l]);
356
+ return /* @__PURE__ */ r.jsx(
357
+ br,
358
+ {
359
+ phase: y,
360
+ caseDescription: W,
361
+ analysisPoints: L,
362
+ tools: B,
363
+ recommendedTool: N,
364
+ selectedTool: o,
365
+ dimensionAnswers: t,
366
+ evaluation: l,
367
+ loading: v,
368
+ uiConfig: O,
369
+ onStartAnalysis: k,
370
+ onSelectTool: c,
371
+ onDimensionChange: s,
372
+ onSubmit: d,
373
+ onRetry: p,
374
+ onComplete: u
375
+ }
376
+ );
377
+ };
378
+ function Cr(e, a, g, y, h, o) {
379
+ var b, v;
380
+ const C = g.dimensions.map((f) => `### ${f.label}
381
+ ${y[f.key] || "(未填写)"}`).join(`
382
+
383
+ `), t = (b = o == null ? void 0 : o.requiredPoints) != null && b.length ? `
384
+ 【必须涵盖的要点】
385
+ ${o.requiredPoints.map((f) => `- ${f}`).join(`
386
+ `)}` : "", S = (v = o == null ? void 0 : o.scoringCriteria) != null && v.length ? `
387
+ 【评分标准】
388
+ ${o.scoringCriteria.map((f) => `- ${f}`).join(`
389
+ `)}` : "", l = h ? `
390
+ 【参考答案】
391
+ ${h}` : "";
392
+ return `
393
+ 【评估任务】
394
+ 请评估学生的案例分析质量。
395
+
396
+ 【案例描述】
397
+ ${e}
398
+
399
+ 【分析要点】
400
+ ${a.map((f) => `- ${f}`).join(`
401
+ `)}
402
+
403
+ 【学生选择的分析工具】
404
+ ${g.name}(${g.description})
405
+
406
+ 【学生的分析内容】
407
+ ${C}
408
+ ${l}
409
+ ${t}
410
+ ${S}
411
+
412
+ `.trim();
413
+ }
414
+ export {
415
+ Lr as default
416
+ };