gz-research-assistant 1.0.10 → 1.0.11

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/index.js CHANGED
@@ -1,26 +1,26 @@
1
1
  import { _ as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as m, t as h, u as g } from "./core-CJ37HVMm.js";
2
2
  import { Component as _, createElement as ee, useCallback as v, useEffect as y, useId as b, useLayoutEffect as te, useMemo as ne, useRef as re, useState as x, useSyncExternalStore as ie } from "react";
3
3
  import { StyleProvider as ae } from "@ant-design/cssinjs";
4
- import { Alert as S, Badge as oe, Button as C, Card as se, Checkbox as w, Collapse as ce, ConfigProvider as le, Dropdown as ue, Empty as de, Input as T, InputNumber as fe, Select as E, Tabs as pe, Tag as D, Tooltip as me, Upload as he, getDesignTokenCssVariables as O } from "gz-ui-web";
5
- import { ApiOutlined as k, BulbOutlined as A, CameraOutlined as ge, CheckCircleOutlined as j, CheckOutlined as _e, CloseOutlined as ve, CodeOutlined as M, DashboardOutlined as N, DeleteOutlined as ye, DesktopOutlined as be, DownloadOutlined as xe, EditOutlined as P, EllipsisOutlined as F, ExperimentOutlined as Se, FieldTimeOutlined as Ce, FileAddOutlined as we, FileTextOutlined as Te, FlagOutlined as Ee, FolderOpenOutlined as De, FullscreenExitOutlined as I, FullscreenOutlined as L, HistoryOutlined as Oe, InfoCircleOutlined as R, LineChartOutlined as ke, LinkOutlined as Ae, MessageOutlined as je, MinusOutlined as z, PauseOutlined as Me, PlayCircleOutlined as Ne, PlusOutlined as B, ReadOutlined as Pe, SaveOutlined as V, ScissorOutlined as H, SearchOutlined as Fe, StopOutlined as Ie, UploadOutlined as Le, VideoCameraOutlined as Re, WarningOutlined as ze } from "@ant-design/icons";
6
- import { Fragment as U, jsx as W, jsxs as G } from "react/jsx-runtime";
7
- import { OverlayScrollbars as Be } from "overlayscrollbars";
8
- import { createRoot as Ve } from "react-dom/client";
4
+ import { Alert as S, Badge as oe, Button as C, Card as se, Checkbox as ce, Collapse as w, ConfigProvider as le, Dropdown as ue, Empty as de, Input as T, InputNumber as fe, Select as E, Tabs as pe, Tag as D, Tooltip as me, Upload as he, getDesignTokenCssVariables as O } from "gz-ui-web";
5
+ import { ApiOutlined as k, BulbOutlined as A, CameraOutlined as ge, CheckCircleOutlined as j, CheckOutlined as _e, CloseOutlined as ve, CodeOutlined as M, DashboardOutlined as N, DeleteOutlined as ye, DesktopOutlined as be, DownloadOutlined as xe, EditOutlined as P, EllipsisOutlined as F, ExperimentOutlined as Se, FieldTimeOutlined as Ce, FileAddOutlined as we, FileTextOutlined as Te, FlagOutlined as I, FolderOpenOutlined as Ee, FullscreenExitOutlined as L, FullscreenOutlined as R, HistoryOutlined as De, InfoCircleOutlined as z, LineChartOutlined as Oe, LinkOutlined as ke, MessageOutlined as Ae, MinusOutlined as B, PauseOutlined as je, PlayCircleOutlined as Me, PlusOutlined as V, ReadOutlined as Ne, SaveOutlined as H, ScissorOutlined as U, SearchOutlined as Pe, StopOutlined as Fe, UploadOutlined as Ie, VideoCameraOutlined as Le, WarningOutlined as Re } from "@ant-design/icons";
6
+ import { Fragment as W, jsx as G, jsxs as K } from "react/jsx-runtime";
7
+ import { OverlayScrollbars as ze } from "overlayscrollbars";
8
+ import { createRoot as Be } from "react-dom/client";
9
9
  // \0rolldown/runtime.js
10
- var He = Object.defineProperty, Ue = Object.getOwnPropertyDescriptor, We = Object.getOwnPropertyNames, Ge = Object.prototype.hasOwnProperty, Ke = (e, t) => {
10
+ var Ve = Object.defineProperty, He = Object.getOwnPropertyDescriptor, Ue = Object.getOwnPropertyNames, We = Object.prototype.hasOwnProperty, Ge = (e, t) => {
11
11
  let n = {};
12
- for (var r in e) He(n, r, {
12
+ for (var r in e) Ve(n, r, {
13
13
  get: e[r],
14
14
  enumerable: !0
15
15
  });
16
- return t || He(n, Symbol.toStringTag, { value: "Module" }), n;
17
- }, qe = (e, t, n, r) => {
18
- if (t && typeof t == "object" || typeof t == "function") for (var i = We(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !Ge.call(e, s) && s !== n && He(e, s, {
16
+ return t || Ve(n, Symbol.toStringTag, { value: "Module" }), n;
17
+ }, Ke = (e, t, n, r) => {
18
+ if (t && typeof t == "object" || typeof t == "function") for (var i = Ue(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !We.call(e, s) && s !== n && Ve(e, s, {
19
19
  get: ((e) => t[e]).bind(null, s),
20
- enumerable: !(r = Ue(t, s)) || r.enumerable
20
+ enumerable: !(r = He(t, s)) || r.enumerable
21
21
  });
22
22
  return e;
23
- }, Je = (e, t, n) => (qe(e, t, "default"), n && qe(n, t, "default")), Ye = { scope: "_scope_tudpr_1" }, K = {
23
+ }, qe = (e, t, n) => (Ke(e, t, "default"), n && Ke(n, t, "default")), Je = { scope: "_scope_tudpr_1" }, q = {
24
24
  dock: "_dock_1oshs_1",
25
25
  launcher: "_launcher_1oshs_12",
26
26
  launcherAvatar: "_launcherAvatar_1oshs_42",
@@ -55,11 +55,11 @@ var He = Object.defineProperty, Ue = Object.getOwnPropertyDescriptor, We = Objec
55
55
  request: "_request_1oshs_316",
56
56
  requestUrl: "_requestUrl_1oshs_448",
57
57
  toolbarActions: "_toolbarActions_1oshs_465"
58
- }, Xe = (e, t) => ({
58
+ }, Ye = (e, t) => ({
59
59
  x: Math.max(0, Math.min(e.x, Math.max(0, window.innerWidth - t.width - 12))),
60
60
  y: Math.max(0, Math.min(e.y, Math.max(0, window.innerHeight - t.height - 12)))
61
61
  });
62
- function Ze(e, t, n) {
62
+ function Xe(e, t, n) {
63
63
  y(() => {
64
64
  let r = e.current, i = r?.closest("[data-assistant-part=\"dock\"]");
65
65
  if (!r || !i) return;
@@ -97,7 +97,7 @@ function Ze(e, t, n) {
97
97
  }, m = (e) => {
98
98
  if (!s || s.id !== e.pointerId) return;
99
99
  let t = e.clientX - s.pointer.x, i = e.clientY - s.pointer.y;
100
- !s.moved && Math.hypot(t, i) < 5 || (s.moved || (s.moved = !0, c = !0, n(!0), r.setPointerCapture(e.pointerId)), e.preventDefault(), e.stopPropagation(), a = Xe({
100
+ !s.moved && Math.hypot(t, i) < 5 || (s.moved || (s.moved = !0, c = !0, n(!0), r.setPointerCapture(e.pointerId)), e.preventDefault(), e.stopPropagation(), a = Ye({
101
101
  x: s.origin.x + t,
102
102
  y: s.origin.y + i
103
103
  }, o), l ||= requestAnimationFrame(d));
@@ -111,7 +111,7 @@ function Ze(e, t, n) {
111
111
  }, ee = (e) => {
112
112
  u(e) && e.preventDefault();
113
113
  }, v = () => {
114
- a && (a = Xe(a, o), f());
114
+ a && (a = Ye(a, o), f());
115
115
  }, y = () => {
116
116
  s && (c = !0, h());
117
117
  };
@@ -127,7 +127,7 @@ function Ze(e, t, n) {
127
127
  n
128
128
  ]);
129
129
  }
130
- var q = {
130
+ var J = {
131
131
  formStack: "_formStack_175v2_1 _formStack_13kbl_763",
132
132
  subheading: "_subheading_175v2_4 _subheading_13kbl_639",
133
133
  json: "_json_175v2_7 _json_13kbl_377",
@@ -155,7 +155,7 @@ var q = {
155
155
  assertionResults: "_assertionResults_175v2_175",
156
156
  assertionResult: "_assertionResult_175v2_175",
157
157
  assertionSummary: "_assertionSummary_175v2_202"
158
- }, Qe = {
158
+ }, Ze = {
159
159
  click: "点击",
160
160
  fill: "输入",
161
161
  select: "选择",
@@ -164,25 +164,25 @@ var q = {
164
164
  "assert-text": "检查文字",
165
165
  assert: "断言",
166
166
  unsupported: "需要处理"
167
- }, J = /* @__PURE__ */ Ke({});
168
- import * as $e from "gz-laya-pilot/schema";
169
- Je(J, $e);
167
+ }, Y = /* @__PURE__ */ Ge({});
168
+ import * as Qe from "gz-laya-pilot/schema";
169
+ qe(Y, Qe);
170
170
  // src/pages/assistant/components/ActionMenu.tsx
171
- function et({ label: e, items: t, disabled: n }) {
172
- return /* @__PURE__ */ W(ue, {
171
+ function $e({ label: e, items: t, disabled: n }) {
172
+ return /* @__PURE__ */ G(ue, {
173
173
  trigger: ["click"],
174
174
  menu: { items: t },
175
175
  disabled: n,
176
- children: /* @__PURE__ */ W(C, {
176
+ children: /* @__PURE__ */ G(C, {
177
177
  type: "text",
178
- icon: /* @__PURE__ */ W(F, {}),
178
+ icon: /* @__PURE__ */ G(F, {}),
179
179
  "aria-label": e,
180
180
  disabled: n,
181
181
  children: "更多"
182
182
  })
183
183
  });
184
184
  }
185
- var Y = {
185
+ var X = {
186
186
  buttonRow: "_buttonRow_gry3r_1 _buttonRow_13kbl_627",
187
187
  field: "_field_gry3r_4 _field_13kbl_761",
188
188
  hint: "_hint_gry3r_7 _hint_13kbl_515",
@@ -192,7 +192,7 @@ var Y = {
192
192
  assertionFields: "_assertionFields_gry3r_29"
193
193
  };
194
194
  // src/pages/assistant/components/AssertionEditor/index.tsx
195
- function tt({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCancel: a }) {
195
+ function et({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCancel: a }) {
196
196
  let o = b(), [s, c] = x(e ?? {
197
197
  name: "",
198
198
  source: "page-text",
@@ -202,24 +202,24 @@ function tt({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
202
202
  }), [l, u] = x(n), [d, f] = x(""), p = (e) => c((t) => ({
203
203
  ...t,
204
204
  ...e
205
- })), m = (0, J.isRequestAssertion)(s.source), h = t.slice(0, l).some((e) => e.target);
206
- return /* @__PURE__ */ G("div", {
207
- className: [Y.assertionEditor, Y.formStack].join(" "),
205
+ })), m = (0, Y.isRequestAssertion)(s.source), h = t.slice(0, l).some((e) => e.target);
206
+ return /* @__PURE__ */ K("div", {
207
+ className: [X.assertionEditor, X.formStack].join(" "),
208
208
  "data-assistant-part": "assertion-editor form-stack",
209
209
  "aria-label": e ? "编辑断言配置" : "新增断言配置",
210
210
  children: [
211
- /* @__PURE__ */ G("h3", {
212
- className: Y.subheading,
211
+ /* @__PURE__ */ K("h3", {
212
+ className: X.subheading,
213
213
  "data-assistant-part": "subheading",
214
- children: [/* @__PURE__ */ W(j, {}), e ? "编辑断言" : "添加断言"]
214
+ children: [/* @__PURE__ */ G(j, {}), e ? "编辑断言" : "添加断言"]
215
215
  }),
216
- /* @__PURE__ */ G("div", {
217
- className: Y.field,
216
+ /* @__PURE__ */ K("div", {
217
+ className: X.field,
218
218
  "data-assistant-part": "field",
219
- children: [/* @__PURE__ */ W("label", {
219
+ children: [/* @__PURE__ */ G("label", {
220
220
  htmlFor: `${o}-name`,
221
221
  children: "断言名称"
222
- }), /* @__PURE__ */ W(T, {
222
+ }), /* @__PURE__ */ G(T, {
223
223
  id: `${o}-name`,
224
224
  placeholder: "例如:保存后显示成功提示",
225
225
  value: s.name,
@@ -228,13 +228,13 @@ function tt({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
228
228
  onChange: (e) => p({ name: e.target.value })
229
229
  })]
230
230
  }),
231
- !e && /* @__PURE__ */ G("div", {
232
- className: Y.field,
231
+ !e && /* @__PURE__ */ K("div", {
232
+ className: X.field,
233
233
  "data-assistant-part": "field",
234
- children: [/* @__PURE__ */ W("label", {
234
+ children: [/* @__PURE__ */ G("label", {
235
235
  htmlFor: `${o}-position`,
236
236
  children: "执行位置"
237
- }), /* @__PURE__ */ W(E, {
237
+ }), /* @__PURE__ */ G(E, {
238
238
  id: `${o}-position`,
239
239
  value: l,
240
240
  disabled: r,
@@ -248,60 +248,60 @@ function tt({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
248
248
  }))]
249
249
  })]
250
250
  }),
251
- /* @__PURE__ */ G("div", {
252
- className: Y.assertionFields,
251
+ /* @__PURE__ */ K("div", {
252
+ className: X.assertionFields,
253
253
  "data-assistant-part": "assertion-fields",
254
- children: [/* @__PURE__ */ G("div", {
255
- className: Y.field,
254
+ children: [/* @__PURE__ */ K("div", {
255
+ className: X.field,
256
256
  "data-assistant-part": "field",
257
- children: [/* @__PURE__ */ W("label", {
257
+ children: [/* @__PURE__ */ G("label", {
258
258
  htmlFor: `${o}-source`,
259
259
  children: "断言对象"
260
- }), /* @__PURE__ */ W(E, {
260
+ }), /* @__PURE__ */ G(E, {
261
261
  id: `${o}-source`,
262
262
  value: s.source,
263
263
  disabled: r,
264
- options: Object.entries(J.assertionSources).map(([e, t]) => ({
264
+ options: Object.entries(Y.assertionSources).map(([e, t]) => ({
265
265
  value: e,
266
266
  label: t
267
267
  })),
268
268
  onChange: (e) => p({
269
269
  source: e,
270
- operator: (0, J.operatorsFor)(e)[0],
270
+ operator: (0, Y.operatorsFor)(e)[0],
271
271
  expected: e === "element-count" || e === "request-count" ? "1" : "",
272
- timeout: (0, J.isRequestAssertion)(e) ? m ? s.timeout : 3e3 : m ? 1e4 : s.timeout,
272
+ timeout: (0, Y.isRequestAssertion)(e) ? m ? s.timeout : 3e3 : m ? 1e4 : s.timeout,
273
273
  method: s.method ?? "GET",
274
274
  selector: s.selector ?? ""
275
275
  })
276
276
  })]
277
- }), /* @__PURE__ */ G("div", {
278
- className: Y.field,
277
+ }), /* @__PURE__ */ K("div", {
278
+ className: X.field,
279
279
  "data-assistant-part": "field",
280
- children: [/* @__PURE__ */ W("label", {
280
+ children: [/* @__PURE__ */ G("label", {
281
281
  htmlFor: `${o}-operator`,
282
282
  children: "比较条件"
283
- }), /* @__PURE__ */ W(E, {
283
+ }), /* @__PURE__ */ G(E, {
284
284
  id: `${o}-operator`,
285
285
  value: s.operator,
286
286
  disabled: r,
287
287
  onChange: (e) => p({ operator: e }),
288
- options: (0, J.operatorsFor)(s.source).map((e) => ({
288
+ options: (0, Y.operatorsFor)(s.source).map((e) => ({
289
289
  value: e,
290
- label: J.assertionOperators[e]
290
+ label: Y.assertionOperators[e]
291
291
  }))
292
292
  })]
293
293
  })]
294
294
  }),
295
- m && /* @__PURE__ */ G(U, { children: [
296
- /* @__PURE__ */ G("div", {
297
- className: Y.assertionFields,
295
+ m && /* @__PURE__ */ K(W, { children: [
296
+ /* @__PURE__ */ K("div", {
297
+ className: X.assertionFields,
298
298
  "data-assistant-part": "assertion-fields",
299
- children: [/* @__PURE__ */ G("div", {
300
- className: Y.field,
301
- children: [/* @__PURE__ */ W("label", {
299
+ children: [/* @__PURE__ */ K("div", {
300
+ className: X.field,
301
+ children: [/* @__PURE__ */ G("label", {
302
302
  htmlFor: `${o}-method`,
303
303
  children: "请求方法"
304
- }), /* @__PURE__ */ W(E, {
304
+ }), /* @__PURE__ */ G(E, {
305
305
  id: `${o}-method`,
306
306
  value: s.method,
307
307
  disabled: r,
@@ -319,12 +319,12 @@ function tt({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
319
319
  })),
320
320
  onChange: (e) => p({ method: e })
321
321
  })]
322
- }), /* @__PURE__ */ G("div", {
323
- className: Y.field,
324
- children: [/* @__PURE__ */ W("label", {
322
+ }), /* @__PURE__ */ K("div", {
323
+ className: X.field,
324
+ children: [/* @__PURE__ */ G("label", {
325
325
  htmlFor: `${o}-pathname`,
326
326
  children: "接口路径"
327
- }), /* @__PURE__ */ W(T, {
327
+ }), /* @__PURE__ */ G(T, {
328
328
  id: `${o}-pathname`,
329
329
  placeholder: "/api/orders",
330
330
  maxLength: 2e3,
@@ -334,24 +334,24 @@ function tt({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
334
334
  })]
335
335
  })]
336
336
  }),
337
- /* @__PURE__ */ G("p", {
338
- className: Y.hint,
337
+ /* @__PURE__ */ K("p", {
338
+ className: X.hint,
339
339
  children: ["从上一操作开始,只统计同源 Fetch / XHR,忽略查询参数。", s.source === "request-success" && " 至少调用一次,且所有调用须在窗口内完成并返回 HTTP 2xx。"]
340
340
  }),
341
- !h && /* @__PURE__ */ W(S, {
341
+ !h && /* @__PURE__ */ G(S, {
342
342
  type: "warning",
343
343
  title: "接口断言必须放在一次操作之后"
344
344
  })
345
345
  ] }),
346
- (0, J.assertionNeedsSelector)(s.source) && /* @__PURE__ */ G("div", {
347
- className: Y.field,
346
+ (0, Y.assertionNeedsSelector)(s.source) && /* @__PURE__ */ K("div", {
347
+ className: X.field,
348
348
  "data-assistant-part": "field",
349
349
  children: [
350
- /* @__PURE__ */ W("label", {
350
+ /* @__PURE__ */ G("label", {
351
351
  htmlFor: `${o}-selector`,
352
352
  children: "元素定位(CSS)"
353
353
  }),
354
- /* @__PURE__ */ W(T, {
354
+ /* @__PURE__ */ G(T, {
355
355
  id: `${o}-selector`,
356
356
  value: s.selector,
357
357
  maxLength: 2e3,
@@ -359,20 +359,20 @@ function tt({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
359
359
  disabled: r,
360
360
  onChange: (e) => p({ selector: e.target.value })
361
361
  }),
362
- /* @__PURE__ */ W("p", {
363
- className: Y.hint,
362
+ /* @__PURE__ */ G("p", {
363
+ className: X.hint,
364
364
  "data-assistant-part": "hint",
365
365
  children: "可从步骤定位信息复制。除数量断言外,必须匹配唯一元素。"
366
366
  })
367
367
  ]
368
368
  }),
369
- (0, J.assertionNeedsExpected)(s.source) && /* @__PURE__ */ G("div", {
370
- className: Y.field,
369
+ (0, Y.assertionNeedsExpected)(s.source) && /* @__PURE__ */ K("div", {
370
+ className: X.field,
371
371
  "data-assistant-part": "field",
372
- children: [/* @__PURE__ */ W("label", {
372
+ children: [/* @__PURE__ */ G("label", {
373
373
  htmlFor: `${o}-expected`,
374
374
  children: m ? "调用次数" : "期望值"
375
- }), /* @__PURE__ */ W(T, {
375
+ }), /* @__PURE__ */ G(T, {
376
376
  id: `${o}-expected`,
377
377
  value: s.expected,
378
378
  maxLength: 2e3,
@@ -381,13 +381,13 @@ function tt({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
381
381
  onChange: (e) => p({ expected: e.target.value })
382
382
  })]
383
383
  }),
384
- /* @__PURE__ */ G("div", {
385
- className: Y.field,
384
+ /* @__PURE__ */ K("div", {
385
+ className: X.field,
386
386
  "data-assistant-part": "field",
387
- children: [/* @__PURE__ */ W("label", {
387
+ children: [/* @__PURE__ */ G("label", {
388
388
  htmlFor: `${o}-timeout`,
389
389
  children: m ? "观察时间(毫秒)" : "最长等待时间(毫秒)"
390
- }), /* @__PURE__ */ W(fe, {
390
+ }), /* @__PURE__ */ G(fe, {
391
391
  id: `${o}-timeout`,
392
392
  min: 500,
393
393
  max: 3e4,
@@ -397,21 +397,21 @@ function tt({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
397
397
  onChange: (e) => p({ timeout: e ?? (m ? 3e3 : 1e4) })
398
398
  })]
399
399
  }),
400
- d && /* @__PURE__ */ W(S, {
400
+ d && /* @__PURE__ */ G(S, {
401
401
  showIcon: !0,
402
402
  type: "error",
403
403
  title: d
404
404
  }),
405
- /* @__PURE__ */ G("div", {
406
- className: Y.buttonRow,
405
+ /* @__PURE__ */ K("div", {
406
+ className: X.buttonRow,
407
407
  "data-assistant-part": "button-row",
408
- children: [/* @__PURE__ */ W(C, {
409
- icon: /* @__PURE__ */ W(V, {}),
408
+ children: [/* @__PURE__ */ G(C, {
409
+ icon: /* @__PURE__ */ G(H, {}),
410
410
  type: "primary",
411
411
  disabled: r || m && !h,
412
412
  onClick: () => {
413
413
  try {
414
- let e = (0, J.parseAssertion)(s);
414
+ let e = (0, Y.parseAssertion)(s);
415
415
  if (e.selector) try {
416
416
  document.querySelector(e.selector);
417
417
  } catch {
@@ -423,7 +423,7 @@ function tt({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
423
423
  }
424
424
  },
425
425
  children: "保存断言"
426
- }), /* @__PURE__ */ W(C, {
426
+ }), /* @__PURE__ */ G(C, {
427
427
  onClick: a,
428
428
  children: "取消"
429
429
  })]
@@ -431,17 +431,17 @@ function tt({ initial: e, steps: t, position: n, disabled: r, onSave: i, onCance
431
431
  ]
432
432
  });
433
433
  }
434
- var nt = {
434
+ var tt = {
435
435
  field: "_field_1qtxy_1 _field_13kbl_761",
436
436
  formStack: "_formStack_1qtxy_4 _formStack_13kbl_763",
437
437
  hint: "_hint_1qtxy_7 _hint_13kbl_515",
438
438
  supplement: "_supplement_1qtxy_10"
439
439
  };
440
440
  // src/pages/assistant/components/StepSupplement/index.tsx
441
- function rt({ step: e, disabled: t, onApply: n }) {
441
+ function nt({ step: e, disabled: t, onApply: n }) {
442
442
  let r = b(), [i, a] = x("click"), [o, s] = x(""), [c, l] = x(""), [u, d] = x(""), [f, p] = x(!0), [m, h] = x("");
443
- return /* @__PURE__ */ W(ce, {
444
- className: nt.supplement,
443
+ return /* @__PURE__ */ G(w, {
444
+ className: tt.supplement,
445
445
  "data-assistant-part": "supplement",
446
446
  ghost: !0,
447
447
  size: "small",
@@ -455,22 +455,22 @@ function rt({ step: e, disabled: t, onApply: n }) {
455
455
  },
456
456
  items: [{
457
457
  key: "details",
458
- label: /* @__PURE__ */ W(U, { children: "补充为可执行步骤" }),
459
- children: /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("p", {
460
- className: nt.hint,
458
+ label: /* @__PURE__ */ G(W, { children: "补充为可执行步骤" }),
459
+ children: /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G("p", {
460
+ className: tt.hint,
461
461
  "data-assistant-part": "hint",
462
462
  children: "补充步骤不会改写原始事件。无法定位控件时,可退出选段后重新录制。"
463
- }), /* @__PURE__ */ G("div", {
464
- className: nt.formStack,
463
+ }), /* @__PURE__ */ K("div", {
464
+ className: tt.formStack,
465
465
  "data-assistant-part": "form-stack",
466
466
  children: [
467
- /* @__PURE__ */ G("div", {
468
- className: nt.field,
467
+ /* @__PURE__ */ K("div", {
468
+ className: tt.field,
469
469
  "data-assistant-part": "field",
470
- children: [/* @__PURE__ */ W("label", {
470
+ children: [/* @__PURE__ */ G("label", {
471
471
  htmlFor: r,
472
472
  children: "操作类型"
473
- }), /* @__PURE__ */ W(E, {
473
+ }), /* @__PURE__ */ G(E, {
474
474
  id: r,
475
475
  "aria-label": "补充操作类型",
476
476
  value: i,
@@ -505,30 +505,30 @@ function rt({ step: e, disabled: t, onApply: n }) {
505
505
  ]
506
506
  })]
507
507
  }),
508
- i !== "assert-text" && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ G("div", {
509
- className: nt.field,
508
+ i !== "assert-text" && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ K("div", {
509
+ className: tt.field,
510
510
  "data-assistant-part": "field",
511
- children: [/* @__PURE__ */ W("label", {
511
+ children: [/* @__PURE__ */ G("label", {
512
512
  htmlFor: `${r}-selector`,
513
513
  children: "CSS 定位"
514
- }), /* @__PURE__ */ W(T, {
514
+ }), /* @__PURE__ */ G(T, {
515
515
  id: `${r}-selector`,
516
- prefix: /* @__PURE__ */ W(M, {}),
516
+ prefix: /* @__PURE__ */ G(M, {}),
517
517
  placeholder: "例如 button[aria-label=\"展开\"]",
518
518
  maxLength: 2e3,
519
519
  value: o,
520
520
  disabled: t,
521
521
  onChange: (e) => s(e.target.value)
522
522
  })]
523
- }), /* @__PURE__ */ G("div", {
524
- className: nt.field,
523
+ }), /* @__PURE__ */ K("div", {
524
+ className: tt.field,
525
525
  "data-assistant-part": "field",
526
- children: [/* @__PURE__ */ W("label", {
526
+ children: [/* @__PURE__ */ G("label", {
527
527
  htmlFor: `${r}-label`,
528
528
  children: "控件文字"
529
- }), /* @__PURE__ */ W(T, {
529
+ }), /* @__PURE__ */ G(T, {
530
530
  id: `${r}-label`,
531
- prefix: /* @__PURE__ */ W(P, {}),
531
+ prefix: /* @__PURE__ */ G(P, {}),
532
532
  placeholder: "如按钮文字、无障碍名称或输入提示",
533
533
  maxLength: 200,
534
534
  value: c,
@@ -541,13 +541,13 @@ function rt({ step: e, disabled: t, onApply: n }) {
541
541
  "select",
542
542
  "press",
543
543
  "assert-text"
544
- ].includes(i) && /* @__PURE__ */ G("div", {
545
- className: nt.field,
544
+ ].includes(i) && /* @__PURE__ */ K("div", {
545
+ className: tt.field,
546
546
  "data-assistant-part": "field",
547
- children: [/* @__PURE__ */ W("label", {
547
+ children: [/* @__PURE__ */ G("label", {
548
548
  htmlFor: `${r}-value`,
549
549
  children: i === "press" ? "按键" : i === "assert-text" ? "预期文字" : "输入值"
550
- }), /* @__PURE__ */ W(T, {
550
+ }), /* @__PURE__ */ G(T, {
551
551
  id: `${r}-value`,
552
552
  placeholder: i === "press" ? "Enter / Escape / Tab" : void 0,
553
553
  maxLength: 2e3,
@@ -556,14 +556,14 @@ function rt({ step: e, disabled: t, onApply: n }) {
556
556
  onChange: (e) => d(e.target.value)
557
557
  })]
558
558
  }),
559
- i === "check" && /* @__PURE__ */ W(w, {
559
+ i === "check" && /* @__PURE__ */ G(ce, {
560
560
  checked: f,
561
561
  disabled: t,
562
562
  onChange: (e) => p(e.target.checked),
563
563
  children: "选中"
564
564
  }),
565
- /* @__PURE__ */ W(C, {
566
- icon: /* @__PURE__ */ W(_e, {}),
565
+ /* @__PURE__ */ G(C, {
566
+ icon: /* @__PURE__ */ G(_e, {}),
567
567
  disabled: t,
568
568
  onClick: () => {
569
569
  try {
@@ -599,7 +599,7 @@ function rt({ step: e, disabled: t, onApply: n }) {
599
599
  },
600
600
  children: "应用补充"
601
601
  }),
602
- m && /* @__PURE__ */ W("span", {
602
+ m && /* @__PURE__ */ G("span", {
603
603
  role: "alert",
604
604
  children: m
605
605
  })
@@ -609,7 +609,7 @@ function rt({ step: e, disabled: t, onApply: n }) {
609
609
  });
610
610
  }
611
611
  // src/api/automation.ts
612
- async function it(e, t, n) {
612
+ async function rt(e, t, n) {
613
613
  let r = await fetch(`${e.replace(/\/$/, "")}/agent/${t}`, n === void 0 ? {} : {
614
614
  method: "POST",
615
615
  headers: {
@@ -631,10 +631,10 @@ async function it(e, t, n) {
631
631
  ].includes(i.state)) throw Error("自主探索服务版本不匹配");
632
632
  return i;
633
633
  }
634
- var at = (e, t, n) => `${e.replace(/\/$/, "")}/agent/artifact?${new URLSearchParams({
634
+ var it = (e, t, n) => `${e.replace(/\/$/, "")}/agent/artifact?${new URLSearchParams({
635
635
  id: t,
636
636
  file: n
637
- })}`, X = {
637
+ })}`, Z = {
638
638
  card: "_card_1ixz9_1 _card_13kbl_633",
639
639
  cardHeading: "_cardHeading_1ixz9_6 _cardHeading_13kbl_633",
640
640
  buttonRow: "_buttonRow_1ixz9_9 _buttonRow_13kbl_627",
@@ -642,30 +642,30 @@ var at = (e, t, n) => `${e.replace(/\/$/, "")}/agent/artifact?${new URLSearchPar
642
642
  hint: "_hint_1ixz9_15 _hint_13kbl_515",
643
643
  stack: "_stack_1ixz9_18",
644
644
  caseHeading: "_caseHeading_1ixz9_25"
645
- }, ot = {
645
+ }, at = {
646
646
  idle: "待探索",
647
647
  running: "执行中",
648
648
  passed: "全部通过",
649
649
  partial: "部分完成",
650
650
  failed: "执行失败",
651
651
  stopped: "已停止"
652
- }, st = {
652
+ }, ot = {
653
653
  passed: "通过",
654
654
  failed: "失败",
655
655
  skipped: "未执行"
656
- }, ct = {
656
+ }, st = {
657
657
  state: "idle",
658
658
  mode: "explore",
659
659
  message: "",
660
660
  cases: [],
661
661
  decisions: 0
662
662
  };
663
- function lt({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
664
- let [r, i] = x(ct), [a, o] = x(), [s, c] = x(""), [l, u] = x(!1), [d, f] = x(!1), [p, m] = x(""), [h, g] = x(!1), [_, ee] = x();
663
+ function ct({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
664
+ let [r, i] = x(st), [a, o] = x(), [s, c] = x(""), [l, u] = x(!1), [d, f] = x(!1), [p, m] = x(""), [h, g] = x(!1), [_, ee] = x();
665
665
  y(() => {
666
666
  let t = !1, r, a = async () => {
667
667
  try {
668
- let r = await it(e, "status");
668
+ let r = await rt(e, "status");
669
669
  t || (g(!0), i(r), o(r.capabilities), n(r.state === "running"), c((e) => e || r.capabilities?.targets[0] || ""));
670
670
  } catch {
671
671
  t || g(!1);
@@ -680,7 +680,7 @@ function lt({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
680
680
  let v = d || r.state === "running", b = async (t) => {
681
681
  f(!0), m("");
682
682
  try {
683
- let r = await it(e, t, {
683
+ let r = await rt(e, t, {
684
684
  url: s,
685
685
  allowWrite: l,
686
686
  ...t === "replay" ? { workbook: _?.data } : {}
@@ -691,14 +691,14 @@ function lt({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
691
691
  } finally {
692
692
  f(!1);
693
693
  }
694
- }, te = (t, n) => r.id && /* @__PURE__ */ W(C, {
694
+ }, te = (t, n) => r.id && /* @__PURE__ */ G(C, {
695
695
  type: "link",
696
- icon: /* @__PURE__ */ W(xe, {}),
697
- href: at(e, r.id, t),
696
+ icon: /* @__PURE__ */ G(xe, {}),
697
+ href: it(e, r.id, t),
698
698
  children: n
699
699
  });
700
- return /* @__PURE__ */ G(se, {
701
- className: X.card,
700
+ return /* @__PURE__ */ K(se, {
701
+ className: Z.card,
702
702
  "aria-label": "自主探索",
703
703
  "data-assistant-part": "agent-card",
704
704
  styles: { body: {
@@ -708,26 +708,26 @@ function lt({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
708
708
  gap: 16
709
709
  } },
710
710
  children: [
711
- /* @__PURE__ */ G("div", {
712
- className: X.cardHeading,
713
- children: [/* @__PURE__ */ G("h3", { children: [/* @__PURE__ */ W(Se, {}), "自主探索"] }), /* @__PURE__ */ W(D, {
711
+ /* @__PURE__ */ K("div", {
712
+ className: Z.cardHeading,
713
+ children: [/* @__PURE__ */ K("h3", { children: [/* @__PURE__ */ G(Se, {}), "自主探索"] }), /* @__PURE__ */ G(D, {
714
714
  color: v ? "processing" : r.state === "passed" ? "success" : "default",
715
- children: ot[r.state]
715
+ children: at[r.state]
716
716
  })]
717
717
  }),
718
- h ? !a?.configured && /* @__PURE__ */ W(S, {
718
+ h ? !a?.configured && /* @__PURE__ */ G(S, {
719
719
  type: "info",
720
720
  title: a?.message ?? "模型尚未配置"
721
- }) : /* @__PURE__ */ W(S, {
721
+ }) : /* @__PURE__ */ G(S, {
722
722
  type: "info",
723
723
  title: "自主探索服务未连接,请启动宿主的 Laya 服务。"
724
724
  }),
725
- /* @__PURE__ */ G("div", {
726
- className: X.field,
727
- children: [/* @__PURE__ */ W("label", {
725
+ /* @__PURE__ */ K("div", {
726
+ className: Z.field,
727
+ children: [/* @__PURE__ */ G("label", {
728
728
  htmlFor: "assistant-explore-target",
729
729
  children: "测试页面"
730
- }), /* @__PURE__ */ W(E, {
730
+ }), /* @__PURE__ */ G(E, {
731
731
  id: "assistant-explore-target",
732
732
  "aria-label": "自主探索测试页面",
733
733
  placeholder: "选择测试页面",
@@ -741,66 +741,66 @@ function lt({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
741
741
  })) ?? []
742
742
  })]
743
743
  }),
744
- /* @__PURE__ */ W(w, {
744
+ /* @__PURE__ */ G(ce, {
745
745
  disabled: v || t,
746
746
  checked: l,
747
747
  onChange: (e) => u(e.target.checked),
748
748
  children: "允许创建、修改和删除本轮测试数据"
749
749
  }),
750
- /* @__PURE__ */ W("div", {
751
- className: X.buttonRow,
752
- children: v ? /* @__PURE__ */ W(C, {
750
+ /* @__PURE__ */ G("div", {
751
+ className: Z.buttonRow,
752
+ children: v ? /* @__PURE__ */ G(C, {
753
753
  type: "primary",
754
754
  danger: !0,
755
- icon: /* @__PURE__ */ W(Ie, {}),
755
+ icon: /* @__PURE__ */ G(Fe, {}),
756
756
  disabled: !v || d,
757
757
  onClick: () => void b("stop"),
758
758
  children: "停止探索"
759
- }) : /* @__PURE__ */ W(C, {
759
+ }) : /* @__PURE__ */ G(C, {
760
760
  type: "primary",
761
- icon: /* @__PURE__ */ W(Se, {}),
761
+ icon: /* @__PURE__ */ G(Se, {}),
762
762
  disabled: v || t || !s || !h || !a?.configured,
763
763
  onClick: () => void b("explore"),
764
764
  children: "开始自主探索"
765
765
  })
766
766
  }),
767
- r.state !== "idle" && /* @__PURE__ */ G("span", {
768
- className: X.hint,
767
+ r.state !== "idle" && /* @__PURE__ */ K("span", {
768
+ className: Z.hint,
769
769
  children: [
770
770
  r.message,
771
771
  " ",
772
772
  r.decisions > 0 && `· ${r.decisions} 次模型决策`
773
773
  ]
774
774
  }),
775
- p && /* @__PURE__ */ W(S, {
775
+ p && /* @__PURE__ */ G(S, {
776
776
  closable: !0,
777
777
  type: "error",
778
778
  title: p,
779
779
  onClose: () => m("")
780
780
  }),
781
- /* @__PURE__ */ G("div", {
782
- className: X.buttonRow,
781
+ /* @__PURE__ */ K("div", {
782
+ className: Z.buttonRow,
783
783
  children: [
784
784
  r.workbook && te(r.workbook, "下载 Excel 用例"),
785
785
  r.id && !v && r.cases.length > 0 && te("results.xlsx", "下载执行报告"),
786
786
  r.trace && te(r.trace, "下载 Trace")
787
787
  ]
788
788
  }),
789
- /* @__PURE__ */ W(ce, {
789
+ /* @__PURE__ */ G(w, {
790
790
  size: "small",
791
791
  items: [{
792
792
  key: "replay",
793
793
  label: "Excel 回放",
794
- children: /* @__PURE__ */ G("div", {
795
- className: X.stack,
794
+ children: /* @__PURE__ */ K("div", {
795
+ className: Z.stack,
796
796
  children: [
797
- /* @__PURE__ */ W("span", {
798
- className: X.hint,
797
+ /* @__PURE__ */ G("span", {
798
+ className: Z.hint,
799
799
  children: "使用自主探索生成的 Excel,入口需与所选测试页面一致。"
800
800
  }),
801
- /* @__PURE__ */ G("div", {
802
- className: X.buttonRow,
803
- children: [/* @__PURE__ */ W(he, {
801
+ /* @__PURE__ */ K("div", {
802
+ className: Z.buttonRow,
803
+ children: [/* @__PURE__ */ G(he, {
804
804
  accept: ".xlsx",
805
805
  maxCount: 1,
806
806
  showUploadList: !1,
@@ -821,51 +821,51 @@ function lt({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
821
821
  }
822
822
  return !1;
823
823
  },
824
- children: /* @__PURE__ */ W(C, {
824
+ children: /* @__PURE__ */ G(C, {
825
825
  type: "text",
826
- icon: /* @__PURE__ */ W(Le, {}),
826
+ icon: /* @__PURE__ */ G(Ie, {}),
827
827
  disabled: v || t,
828
828
  children: "导入 Excel"
829
829
  })
830
- }), /* @__PURE__ */ W(C, {
830
+ }), /* @__PURE__ */ G(C, {
831
831
  type: "primary",
832
- icon: /* @__PURE__ */ W(Ne, {}),
832
+ icon: /* @__PURE__ */ G(Me, {}),
833
833
  disabled: v || t || !h || !a?.configured || !s || !_,
834
834
  onClick: () => void b("replay"),
835
835
  children: "新会话回放"
836
836
  })]
837
837
  }),
838
- _ && /* @__PURE__ */ W("span", { children: _.name })
838
+ _ && /* @__PURE__ */ G("span", { children: _.name })
839
839
  ]
840
840
  })
841
841
  }]
842
842
  }),
843
- r.cases.length > 0 && /* @__PURE__ */ W(ce, {
843
+ r.cases.length > 0 && /* @__PURE__ */ G(w, {
844
844
  size: "small",
845
845
  items: r.cases.map((e) => ({
846
846
  key: e.id,
847
- label: /* @__PURE__ */ G("div", {
848
- className: X.caseHeading,
849
- children: [/* @__PURE__ */ W(D, {
847
+ label: /* @__PURE__ */ K("div", {
848
+ className: Z.caseHeading,
849
+ children: [/* @__PURE__ */ G(D, {
850
850
  color: e.state === "passed" ? "success" : e.state === "failed" ? "error" : "default",
851
- children: st[e.state]
852
- }), /* @__PURE__ */ W("span", { children: e.title })]
851
+ children: ot[e.state]
852
+ }), /* @__PURE__ */ G("span", { children: e.title })]
853
853
  }),
854
- children: /* @__PURE__ */ G("div", {
855
- className: X.stack,
854
+ children: /* @__PURE__ */ K("div", {
855
+ className: Z.stack,
856
856
  children: [
857
- /* @__PURE__ */ W("span", { children: e.reason }),
858
- e.assertions.map((e, t) => /* @__PURE__ */ W(S, {
857
+ /* @__PURE__ */ G("span", { children: e.reason }),
858
+ e.assertions.map((e, t) => /* @__PURE__ */ G(S, {
859
859
  type: e.passed ? "success" : "error",
860
860
  title: e.expected,
861
861
  description: `实际:${e.actual}`
862
862
  }, t)),
863
- e.errors.map((e, t) => /* @__PURE__ */ W(S, {
863
+ e.errors.map((e, t) => /* @__PURE__ */ G(S, {
864
864
  type: "error",
865
865
  title: e
866
866
  }, t)),
867
- e.cleanup && /* @__PURE__ */ W("span", {
868
- className: X.hint,
867
+ e.cleanup && /* @__PURE__ */ G("span", {
868
+ className: Z.hint,
869
869
  children: e.cleanup
870
870
  }),
871
871
  e.screenshot && te(e.screenshot, "查看截图证据")
@@ -877,7 +877,7 @@ function lt({ bridgeUrl: e, disabled: t, onRunningChange: n }) {
877
877
  });
878
878
  }
879
879
  // src/pages/assistant/components/TestLibraryPanel/libraryRequest.ts
880
- function ut(e) {
880
+ function lt(e) {
881
881
  return v(async (t = "", n = "GET", r, i) => {
882
882
  let a = await fetch(e + t, {
883
883
  method: n,
@@ -895,15 +895,22 @@ function ut(e) {
895
895
  return o;
896
896
  }, [e]);
897
897
  }
898
- var Z = {
899
- card: "_card_137oe_1 _card_13kbl_633",
900
- hint: "_hint_137oe_4 _hint_13kbl_515",
901
- buttonRow: "_buttonRow_137oe_7 _buttonRow_13kbl_627",
902
- stack: "_stack_137oe_10",
903
- list: "_list_137oe_11",
904
- entryLink: "_entryLink_137oe_26",
905
- resourceList: "_resourceList_137oe_33"
906
- }, dt = {
898
+ var Q = {
899
+ card: "_card_1xwqo_1 _card_13kbl_633",
900
+ hint: "_hint_1xwqo_4 _hint_13kbl_515",
901
+ buttonRow: "_buttonRow_1xwqo_7 _buttonRow_13kbl_627",
902
+ stack: "_stack_1xwqo_10",
903
+ list: "_list_1xwqo_11",
904
+ entryLink: "_entryLink_1xwqo_26",
905
+ resourceList: "_resourceList_1xwqo_33",
906
+ header: "_header_1xwqo_54",
907
+ headerAction: "_headerAction_1xwqo_71",
908
+ tabAction: "_tabAction_1xwqo_75",
909
+ fitButton: "_fitButton_1xwqo_78",
910
+ resourceName: "_resourceName_1xwqo_88",
911
+ breadcrumbs: "_breadcrumbs_1xwqo_95",
912
+ breadcrumbName: "_breadcrumbName_1xwqo_103"
913
+ }, ut = {
907
914
  running: "执行中",
908
915
  stopping: "停止中",
909
916
  passed: "通过",
@@ -913,20 +920,20 @@ var Z = {
913
920
  idle: "未执行",
914
921
  interrupted: "已中断"
915
922
  };
916
- function ft({ run: e, base: t, onExport: n }) {
917
- return /* @__PURE__ */ G("div", {
918
- className: Z.stack,
923
+ function dt({ run: e, base: t, onExport: n }) {
924
+ return /* @__PURE__ */ K("div", {
925
+ className: Q.stack,
919
926
  children: [
920
- /* @__PURE__ */ W("div", {
921
- className: Z.buttonRow,
922
- children: /* @__PURE__ */ W(C, {
927
+ /* @__PURE__ */ G("div", {
928
+ className: Q.buttonRow,
929
+ children: /* @__PURE__ */ G(C, {
923
930
  type: "text",
924
931
  onClick: n,
925
932
  children: "导出报告 JSON"
926
933
  })
927
934
  }),
928
- /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W(D, { children: dt[e.state] ?? e.state }), e.message] }),
929
- e.iterations?.map(({ iteration: n, cases: r }) => /* @__PURE__ */ G("details", { children: [/* @__PURE__ */ G("summary", { children: [
935
+ /* @__PURE__ */ K("div", { children: [/* @__PURE__ */ G(D, { children: ut[e.state] ?? e.state }), e.message] }),
936
+ e.iterations?.map(({ iteration: n, cases: r }) => /* @__PURE__ */ K("details", { children: [/* @__PURE__ */ K("summary", { children: [
930
937
  "第 ",
931
938
  n,
932
939
  " / ",
@@ -934,17 +941,17 @@ function ft({ run: e, base: t, onExport: n }) {
934
941
  " 轮 · ",
935
942
  r.length,
936
943
  " 个用例"
937
- ] }), /* @__PURE__ */ W("ul", {
938
- className: Z.list,
939
- children: r.map((r) => /* @__PURE__ */ G("li", { children: [
940
- /* @__PURE__ */ G("strong", { children: [
944
+ ] }), /* @__PURE__ */ G("ul", {
945
+ className: Q.list,
946
+ children: r.map((r) => /* @__PURE__ */ K("li", { children: [
947
+ /* @__PURE__ */ K("strong", { children: [
941
948
  r.suiteName,
942
949
  " · ",
943
950
  r.caseName
944
951
  ] }),
945
- /* @__PURE__ */ W("code", { children: r.url ?? r.path }),
946
- /* @__PURE__ */ G("span", { children: [
947
- /* @__PURE__ */ W(D, { children: dt[r.status.state] ?? r.status.state }),
952
+ /* @__PURE__ */ G("code", { children: r.url ?? r.path }),
953
+ /* @__PURE__ */ K("span", { children: [
954
+ /* @__PURE__ */ G(D, { children: ut[r.status.state] ?? r.status.state }),
948
955
  "步骤 ",
949
956
  r.status.step,
950
957
  " / ",
@@ -952,22 +959,22 @@ function ft({ run: e, base: t, onExport: n }) {
952
959
  " · ",
953
960
  r.status.message
954
961
  ] }),
955
- r.status.failure && /* @__PURE__ */ G("div", { children: [
956
- /* @__PURE__ */ W("strong", { children: "已观察" }),
957
- /* @__PURE__ */ G("div", { children: [
962
+ r.status.failure && /* @__PURE__ */ K("div", { children: [
963
+ /* @__PURE__ */ G("strong", { children: "已观察" }),
964
+ /* @__PURE__ */ K("div", { children: [
958
965
  r.status.failure.label,
959
966
  " ",
960
- r.status.failure.selector && /* @__PURE__ */ W("code", { children: r.status.failure.selector })
967
+ r.status.failure.selector && /* @__PURE__ */ G("code", { children: r.status.failure.selector })
961
968
  ] }),
962
- r.status.failure.matchedCount !== void 0 && /* @__PURE__ */ G("div", { children: [
969
+ r.status.failure.matchedCount !== void 0 && /* @__PURE__ */ K("div", { children: [
963
970
  "匹配到 ",
964
971
  r.status.failure.matchedCount,
965
972
  " 个元素"
966
973
  ] }),
967
- r.status.failure.hint && /* @__PURE__ */ G("div", { children: ["建议检查:", r.status.failure.hint] })
974
+ r.status.failure.hint && /* @__PURE__ */ K("div", { children: ["建议检查:", r.status.failure.hint] })
968
975
  ] }),
969
- r.status.assertions?.map((e) => /* @__PURE__ */ G("div", { children: [
970
- /* @__PURE__ */ W(D, {
976
+ r.status.assertions?.map((e) => /* @__PURE__ */ K("div", { children: [
977
+ /* @__PURE__ */ G(D, {
971
978
  color: e.passed ? "green" : "red",
972
979
  children: e.passed ? "通过" : "失败"
973
980
  }),
@@ -981,15 +988,15 @@ function ft({ run: e, base: t, onExport: n }) {
981
988
  " ",
982
989
  e.actual
983
990
  ] }, e.step)),
984
- r.trace && /* @__PURE__ */ G("div", {
985
- className: Z.buttonRow,
986
- children: [/* @__PURE__ */ W(C, {
991
+ r.trace && /* @__PURE__ */ K("div", {
992
+ className: Q.buttonRow,
993
+ children: [/* @__PURE__ */ G(C, {
987
994
  size: "small",
988
995
  href: `${t}/runs/${e.id}/trace?iteration=${n}&caseIndex=${r.caseIndex}`,
989
996
  download: !0,
990
997
  children: "下载 Trace"
991
- }), /* @__PURE__ */ W("small", {
992
- className: Z.hint,
998
+ }), /* @__PURE__ */ G("small", {
999
+ className: Q.hint,
993
1000
  children: "含页面与网络信息,仅在本机查看"
994
1001
  })]
995
1002
  })
@@ -999,8 +1006,8 @@ function ft({ run: e, base: t, onExport: n }) {
999
1006
  });
1000
1007
  }
1001
1008
  // src/pages/assistant/components/TestLibraryPanel/LibraryDetail.tsx
1002
- function pt({ options: e, values: t, onChange: n }) {
1003
- return /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(E, {
1009
+ function ft({ options: e, values: t, onChange: n }) {
1010
+ return /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(E, {
1004
1011
  "aria-label": "添加到执行顺序",
1005
1012
  placeholder: "选择要添加的项目",
1006
1013
  value: null,
@@ -1009,11 +1016,11 @@ function pt({ options: e, values: t, onChange: n }) {
1009
1016
  onChange: (e) => {
1010
1017
  e && n([...t, e]);
1011
1018
  }
1012
- }), /* @__PURE__ */ W("ol", {
1013
- className: Z.list,
1014
- children: t.map((r, i) => /* @__PURE__ */ G("li", { children: [/* @__PURE__ */ W("span", { children: e.find(({ value: e }) => e === r)?.label ?? r }), /* @__PURE__ */ G("div", {
1015
- className: Z.buttonRow,
1016
- children: [/* @__PURE__ */ W(C, {
1019
+ }), /* @__PURE__ */ G("ol", {
1020
+ className: Q.list,
1021
+ children: t.map((r, i) => /* @__PURE__ */ K("li", { children: [/* @__PURE__ */ G("span", { children: e.find(({ value: e }) => e === r)?.label ?? r }), /* @__PURE__ */ K("div", {
1022
+ className: Q.buttonRow,
1023
+ children: [/* @__PURE__ */ G(C, {
1017
1024
  size: "small",
1018
1025
  type: "text",
1019
1026
  "aria-label": `上移第 ${i + 1} 项`,
@@ -1023,7 +1030,7 @@ function pt({ options: e, values: t, onChange: n }) {
1023
1030
  [e[i - 1], e[i]] = [e[i], e[i - 1]], n(e);
1024
1031
  },
1025
1032
  children: "上移"
1026
- }), /* @__PURE__ */ W(C, {
1033
+ }), /* @__PURE__ */ G(C, {
1027
1034
  size: "small",
1028
1035
  type: "text",
1029
1036
  "aria-label": `移除第 ${i + 1} 项`,
@@ -1033,15 +1040,15 @@ function pt({ options: e, values: t, onChange: n }) {
1033
1040
  })] }, i))
1034
1041
  })] });
1035
1042
  }
1036
- function mt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, onEdit: o, recording: s, incomingDraft: c, onConsumeDraft: l, renderEditor: u }) {
1037
- let [d, f] = x(), [m, h] = x([]), [g, _] = x("cases"), ee = re(null), [b, ne] = x(!1), [ie, ae] = x(""), [oe, w] = x(), [ce, le] = x(), [ue, me] = x(!1), [he, O] = x(!1), [k, A] = x(), ge = !!(k && k.baseline !== JSON.stringify(i)), j = () => !s && (!ge || window.confirm("当前用例有未保存修改,确定离开?")), _e = (e, t, n) => {
1038
- o(e), w(t), xe(void 0), le(n), A({
1043
+ function pt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, onEdit: o, recording: s, incomingDraft: c, onConsumeDraft: l, renderEditor: u }) {
1044
+ let [d, f] = x(), [m, h] = x([]), [g, _] = x("cases"), ee = re(null), [b, ne] = x(!1), [ie, ae] = x(""), [oe, ce] = x(), [w, le] = x(), [ue, me] = x(!1), [he, O] = x(!1), [k, A] = x(), ge = !!(k && k.baseline !== JSON.stringify(i)), j = () => !s && (!ge || window.confirm("当前用例有未保存修改,确定离开?")), _e = (e, t, n) => {
1045
+ o(e), ce(t), xe(void 0), le(n), A({
1039
1046
  caseId: t,
1040
1047
  suiteId: n,
1041
1048
  baseline: JSON.stringify(e)
1042
1049
  }), _("cases");
1043
1050
  }, ve = (e) => {
1044
- !b && !s && j() && Re() && ze() && (A(void 0), me(!1), O(!1), _(e));
1051
+ !b && !s && j() && Le() && Re() && (A(void 0), me(!1), O(!1), _(e));
1045
1052
  }, [M, N] = x({
1046
1053
  id: "",
1047
1054
  name: "",
@@ -1053,7 +1060,7 @@ function mt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1053
1060
  repeat: 1
1054
1061
  }), [Se, Ce] = x(), [we, Te] = x();
1055
1062
  y(() => {
1056
- c && d && !s && !b && ((!ge || window.confirm("时间线草稿会替换当前未保存的编辑。继续?")) && Re() && ze() && (me(!1), O(!1), w(void 0), le(void 0), o(c), A({ baseline: "" }), _("cases")), l?.());
1063
+ c && d && !s && !b && ((!ge || window.confirm("时间线草稿会替换当前未保存的编辑。继续?")) && Le() && Re() && (me(!1), O(!1), ce(void 0), le(void 0), o(c), A({ baseline: "" }), _("cases")), l?.());
1057
1064
  }, [
1058
1065
  c,
1059
1066
  d,
@@ -1063,7 +1070,7 @@ function mt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1063
1070
  o,
1064
1071
  l
1065
1072
  ]);
1066
- let Ee = Se ?? m[0]?.id, De = m.some((e) => e.state === "running" || e.state === "stopping"), I = ut(e), L = async (e) => {
1073
+ let I = Se ?? m[0]?.id, Ee = m.some((e) => e.state === "running" || e.state === "stopping"), L = lt(e), R = async (e) => {
1067
1074
  if (!b) {
1068
1075
  ne(!0), ae("");
1069
1076
  try {
@@ -1074,48 +1081,48 @@ function mt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1074
1081
  ne(!1);
1075
1082
  }
1076
1083
  }
1077
- }, Oe = v(async (e) => {
1078
- let t = await I("", "GET", void 0, e);
1084
+ }, De = v(async (e) => {
1085
+ let t = await L("", "GET", void 0, e);
1079
1086
  if (t.version !== 1 || !Array.isArray(t.cases)) throw Error("本机测试库服务版本不匹配");
1080
- let n = await I("/runs", "GET", void 0, e);
1087
+ let n = await L("/runs", "GET", void 0, e);
1081
1088
  e?.aborted || (f(t), h(n));
1082
- }, [I]), R = () => void L(Oe);
1089
+ }, [L]), z = () => void R(De);
1083
1090
  y(() => {
1084
1091
  let e = new AbortController();
1085
- return ne(!0), Oe(e.signal).catch((t) => {
1092
+ return ne(!0), De(e.signal).catch((t) => {
1086
1093
  e.signal.aborted || ae(t instanceof Error ? t.message : "本机测试库服务未连接");
1087
1094
  }).finally(() => {
1088
1095
  e.signal.aborted || ne(!1);
1089
1096
  }), () => e.abort();
1090
- }, [Oe]), y(() => {
1091
- if (!De && (!Ee || g !== "reports")) return;
1097
+ }, [De]), y(() => {
1098
+ if (!Ee && (!I || g !== "reports")) return;
1092
1099
  let e = new AbortController(), t = async () => {
1093
- let t = await I("/runs", "GET", void 0, e.signal), n = g === "reports" && Ee ? await I(`/runs/${Ee}`, "GET", void 0, e.signal) : void 0;
1100
+ let t = await L("/runs", "GET", void 0, e.signal), n = g === "reports" && I ? await L(`/runs/${I}`, "GET", void 0, e.signal) : void 0;
1094
1101
  e.signal.aborted || (h(t), n && Te(n));
1095
1102
  }, n = () => void t().catch(() => {});
1096
1103
  n();
1097
- let r = De ? setInterval(n, 1e3) : void 0;
1104
+ let r = Ee ? setInterval(n, 1e3) : void 0;
1098
1105
  return () => {
1099
1106
  clearInterval(r), e.abort();
1100
1107
  };
1101
1108
  }, [
1109
+ L,
1102
1110
  I,
1103
1111
  Ee,
1104
- De,
1105
1112
  g
1106
1113
  ]);
1107
- let ke = async (e) => {
1108
- f(await I("", "PUT", e));
1109
- }, Ae = (e, t) => {
1114
+ let Oe = async (e) => {
1115
+ f(await L("", "PUT", e));
1116
+ }, ke = (e, t) => {
1110
1117
  let n = URL.createObjectURL(new Blob([JSON.stringify(e, null, 2)], { type: "application/json" })), r = document.createElement("a");
1111
1118
  r.href = n, r.download = t, r.click(), setTimeout(() => URL.revokeObjectURL(n), 3e4);
1112
- }, je = (e, t) => e.some(({ id: e }) => e === t.id) ? e.map((e) => e.id === t.id ? t : e) : [...e, t], z = !a && !b && !De, Me = d?.cases.map(({ id: e, testCase: t }) => ({
1119
+ }, Ae = (e, t) => e.some(({ id: e }) => e === t.id) ? e.map((e) => e.id === t.id ? t : e) : [...e, t], B = !a && !b && !Ee, je = d?.cases.map(({ id: e, testCase: t }) => ({
1113
1120
  label: t.name,
1114
1121
  value: e
1115
- })) ?? [], Ne = d?.suites.map(({ id: e, name: t }) => ({
1122
+ })) ?? [], Me = d?.suites.map(({ id: e, name: t }) => ({
1116
1123
  label: t,
1117
1124
  value: e
1118
- })) ?? [], B = d?.cases.find(({ id: e }) => e === oe), Pe = B ? d?.suites.filter((e) => !e.caseIds.includes(B.id)) ?? [] : [], V = d?.suites.find(({ id: e }) => e === M.id), H = d?.plans.find(({ id: e }) => e === P.id), Fe = V?.caseIds ?? [], Ie = M.name !== (V?.name ?? "") || JSON.stringify(M.caseIds) !== JSON.stringify(Fe), Le = P.name !== (H?.name ?? "") || P.repeat !== (H?.repeat ?? 1) || JSON.stringify(P.suiteIds) !== JSON.stringify(H?.suiteIds ?? []), Re = () => !ue || !Ie || window.confirm("当前套件有未保存修改,确定放弃?"), ze = () => !he || !Le || window.confirm("当前计划有未保存修改,确定放弃?");
1125
+ })) ?? [], V = d?.cases.find(({ id: e }) => e === oe), Ne = V ? d?.suites.filter((e) => !e.caseIds.includes(V.id)) ?? [] : [], H = d?.suites.find(({ id: e }) => e === M.id), U = d?.plans.find(({ id: e }) => e === P.id), Pe = H?.caseIds ?? [], Fe = M.name !== (H?.name ?? "") || JSON.stringify(M.caseIds) !== JSON.stringify(Pe), Ie = P.name !== (U?.name ?? "") || P.repeat !== (U?.repeat ?? 1) || JSON.stringify(P.suiteIds) !== JSON.stringify(U?.suiteIds ?? []), Le = () => !ue || !Fe || window.confirm("当前套件有未保存修改,确定放弃?"), Re = () => !he || !Ie || window.confirm("当前计划有未保存修改,确定放弃?");
1119
1126
  te(() => {
1120
1127
  let e = ee.current?.closest("[role=\"dialog\"]");
1121
1128
  if (e) for (let t = ee.current?.parentElement; t && t !== e; t = t.parentElement) t.scrollTop && (t.scrollTop = 0);
@@ -1128,8 +1135,8 @@ function mt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1128
1135
  P.id,
1129
1136
  he
1130
1137
  ]);
1131
- let Be = g === "cases" ? B?.testCase.name : g === "suites" ? V?.name : g === "plans" ? H?.name : void 0, Ve = () => {
1132
- !b && j() && Re() && ze() && (w(void 0), A(void 0), me(!1), O(!1), N({
1138
+ let ze = g === "cases" ? V?.testCase.name : g === "suites" ? H?.name : g === "plans" ? U?.name : void 0, Be = () => {
1139
+ !b && j() && Le() && Re() && (ce(void 0), A(void 0), me(!1), O(!1), N({
1133
1140
  id: "",
1134
1141
  name: "",
1135
1142
  caseIds: []
@@ -1140,8 +1147,8 @@ function mt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1140
1147
  repeat: 1
1141
1148
  }));
1142
1149
  };
1143
- return /* @__PURE__ */ G(se, {
1144
- className: Z.card,
1150
+ return /* @__PURE__ */ K(se, {
1151
+ className: Q.card,
1145
1152
  "aria-label": "本机测试库",
1146
1153
  styles: { body: {
1147
1154
  padding: 0,
@@ -1150,123 +1157,177 @@ function mt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1150
1157
  gap: 16
1151
1158
  } },
1152
1159
  children: [
1153
- /* @__PURE__ */ G("nav", {
1154
- ref: ee,
1155
- "aria-label": "当前位置",
1156
- className: Z.buttonRow,
1157
- children: [
1158
- /* @__PURE__ */ W(C, {
1159
- type: "link",
1160
- size: "small",
1161
- className: Z.entryLink,
1162
- disabled: b || s,
1163
- onClick: () => {
1164
- j() && Re() && ze() && n();
1165
- },
1166
- children: "测试库"
1167
- }),
1168
- /* @__PURE__ */ W("span", {
1169
- "aria-hidden": "true",
1170
- children: "/"
1171
- }),
1172
- Be || k || ue || he ? /* @__PURE__ */ G(U, { children: [
1173
- /* @__PURE__ */ W(C, {
1160
+ /* @__PURE__ */ K("header", {
1161
+ className: Q.header,
1162
+ children: [/* @__PURE__ */ K("nav", {
1163
+ ref: ee,
1164
+ "aria-label": "当前位置",
1165
+ className: Q.breadcrumbs,
1166
+ children: [
1167
+ /* @__PURE__ */ G(C, {
1174
1168
  type: "link",
1175
1169
  size: "small",
1176
- className: Z.entryLink,
1170
+ className: Q.entryLink,
1177
1171
  disabled: b || s,
1178
- onClick: Ve,
1179
- children: t
1172
+ onClick: () => {
1173
+ j() && Le() && Re() && n();
1174
+ },
1175
+ children: "测试库"
1180
1176
  }),
1181
- /* @__PURE__ */ W("span", {
1177
+ /* @__PURE__ */ G("span", {
1182
1178
  "aria-hidden": "true",
1183
1179
  children: "/"
1184
1180
  }),
1185
- /* @__PURE__ */ W("span", {
1186
- "aria-current": "page",
1187
- children: Be ?? (k ? "新建用例" : ue ? "新建套件" : "新建计划")
1181
+ ze || k || ue || he ? /* @__PURE__ */ K(W, { children: [
1182
+ /* @__PURE__ */ G(C, {
1183
+ type: "link",
1184
+ size: "small",
1185
+ className: Q.breadcrumbName,
1186
+ title: t,
1187
+ disabled: b || s,
1188
+ onClick: Be,
1189
+ children: /* @__PURE__ */ G("span", {
1190
+ className: Q.resourceName,
1191
+ children: t
1192
+ })
1193
+ }),
1194
+ /* @__PURE__ */ G("span", {
1195
+ "aria-hidden": "true",
1196
+ children: "/"
1197
+ }),
1198
+ /* @__PURE__ */ G("span", {
1199
+ "aria-current": "page",
1200
+ className: Q.resourceName,
1201
+ title: ze,
1202
+ children: ze ?? (k ? "新建用例" : ue ? "新建套件" : "新建计划")
1203
+ })
1204
+ ] }) : /* @__PURE__ */ G("h3", {
1205
+ className: Q.resourceName,
1206
+ title: t,
1207
+ children: t
1188
1208
  })
1189
- ] }) : /* @__PURE__ */ W("h3", { children: t })
1190
- ]
1209
+ ]
1210
+ }), d && !ze && !k && !ue && !he && /* @__PURE__ */ K("div", {
1211
+ className: Q.headerAction,
1212
+ children: [/* @__PURE__ */ G($e, {
1213
+ label: "测试库更多操作",
1214
+ items: [
1215
+ {
1216
+ key: "rename",
1217
+ label: "重命名",
1218
+ disabled: !B,
1219
+ onClick: r
1220
+ },
1221
+ {
1222
+ key: "refresh",
1223
+ label: "刷新测试库",
1224
+ disabled: b,
1225
+ onClick: z
1226
+ },
1227
+ {
1228
+ key: "import",
1229
+ label: "导入测试库",
1230
+ disabled: !B,
1231
+ onClick: () => ye.current?.click()
1232
+ },
1233
+ {
1234
+ key: "export",
1235
+ label: "导出测试库",
1236
+ title: "导出包含用例入口的查询参数和片段,分享前请移除敏感值。",
1237
+ disabled: b,
1238
+ onClick: () => ke(d, "研发小蜜测试库.json")
1239
+ }
1240
+ ]
1241
+ }), /* @__PURE__ */ G("input", {
1242
+ hidden: !0,
1243
+ type: "file",
1244
+ ref: ye,
1245
+ accept: ".json,application/json",
1246
+ onChange: (e) => {
1247
+ let t = e.target.files?.[0];
1248
+ e.target.value = "", t && B && window.confirm("导入会替换当前测试库中的用例、套件和计划。继续?") && R(async () => {
1249
+ if (t.size > 2097152) throw Error("测试库文件不能超过 2 MB");
1250
+ let e = JSON.parse(await t.text());
1251
+ await Oe({
1252
+ ...e,
1253
+ revision: d.revision
1254
+ }), Be(), Ce(void 0), _("cases");
1255
+ });
1256
+ }
1257
+ })]
1258
+ })]
1191
1259
  }),
1192
- ie && /* @__PURE__ */ W(S, {
1260
+ ie && /* @__PURE__ */ G(S, {
1193
1261
  type: "error",
1194
1262
  title: ie,
1195
- action: d && /* @__PURE__ */ W(C, {
1263
+ action: d && /* @__PURE__ */ G(C, {
1196
1264
  type: "text",
1197
1265
  size: "small",
1198
1266
  disabled: b || s,
1199
- onClick: R,
1267
+ onClick: z,
1200
1268
  children: "刷新测试库"
1201
1269
  })
1202
1270
  }),
1203
- d ? /* @__PURE__ */ G(U, { children: [!k && !ue && !he && !(g === "cases" && B) && !(g === "suites" && V) && !(g === "plans" && H) && /* @__PURE__ */ G("div", {
1204
- className: Z.buttonRow,
1205
- children: [/* @__PURE__ */ W(et, {
1206
- label: "测试库更多操作",
1207
- items: [
1208
- {
1209
- key: "rename",
1210
- label: "重命名",
1211
- disabled: !z,
1212
- onClick: r
1213
- },
1214
- {
1215
- key: "refresh",
1216
- label: "刷新测试库",
1217
- disabled: b,
1218
- onClick: R
1219
- },
1220
- {
1221
- key: "import",
1222
- label: "导入测试库",
1223
- disabled: !z,
1224
- onClick: () => ye.current?.click()
1225
- },
1226
- {
1227
- key: "export",
1228
- label: "导出测试库",
1229
- title: "导出包含用例入口的查询参数和片段,分享前请移除敏感值。",
1230
- disabled: b,
1231
- onClick: () => Ae(d, "研发小蜜测试库.json")
1232
- }
1233
- ]
1234
- }), /* @__PURE__ */ W("input", {
1235
- hidden: !0,
1236
- type: "file",
1237
- ref: ye,
1238
- accept: ".json,application/json",
1239
- onChange: (e) => {
1240
- let t = e.target.files?.[0];
1241
- e.target.value = "", t && z && window.confirm("导入会替换当前测试库中的用例、套件和计划。继续?") && L(async () => {
1242
- if (t.size > 2097152) throw Error("测试库文件不能超过 2 MB");
1243
- let e = JSON.parse(await t.text());
1244
- await ke({
1245
- ...e,
1246
- revision: d.revision
1247
- }), Ve(), Ce(void 0), _("cases");
1248
- });
1249
- }
1250
- })]
1251
- }), /* @__PURE__ */ W(pe, {
1271
+ d ? /* @__PURE__ */ G(W, { children: /* @__PURE__ */ G(pe, {
1252
1272
  activeKey: g,
1253
1273
  onChange: ve,
1274
+ tabBarExtraContent: { right: /* @__PURE__ */ K("div", {
1275
+ className: Q.tabAction,
1276
+ children: [
1277
+ g === "cases" && !k && !V && /* @__PURE__ */ G(C, {
1278
+ type: "primary",
1279
+ size: "small",
1280
+ disabled: !B,
1281
+ onClick: () => {
1282
+ _e(p());
1283
+ },
1284
+ children: "新建用例"
1285
+ }),
1286
+ g === "suites" && !ue && !H && /* @__PURE__ */ G(C, {
1287
+ type: "primary",
1288
+ size: "small",
1289
+ disabled: !B,
1290
+ onClick: () => {
1291
+ N({
1292
+ id: "",
1293
+ name: "",
1294
+ caseIds: []
1295
+ }), me(!0);
1296
+ },
1297
+ children: "新建套件"
1298
+ }),
1299
+ g === "plans" && !he && !U && /* @__PURE__ */ G(C, {
1300
+ type: "primary",
1301
+ size: "small",
1302
+ disabled: !B,
1303
+ onClick: () => {
1304
+ F({
1305
+ id: "",
1306
+ name: "",
1307
+ suiteIds: [],
1308
+ repeat: 1
1309
+ }), O(!0);
1310
+ },
1311
+ children: "新建计划"
1312
+ })
1313
+ ]
1314
+ }) },
1254
1315
  items: [
1255
1316
  {
1256
1317
  key: "cases",
1257
1318
  label: "用例",
1258
- children: k ? /* @__PURE__ */ G("div", {
1259
- className: Z.stack,
1260
- children: [/* @__PURE__ */ G("div", {
1261
- className: Z.buttonRow,
1262
- children: [/* @__PURE__ */ W("h4", { children: k.caseId ? "编辑用例" : "新建用例" }), /* @__PURE__ */ W(D, { children: ge ? "未保存" : k.caseId ? "已保存" : "新用例" })]
1319
+ children: k ? /* @__PURE__ */ K("div", {
1320
+ className: Q.stack,
1321
+ children: [/* @__PURE__ */ K("div", {
1322
+ className: Q.buttonRow,
1323
+ children: [/* @__PURE__ */ G("h4", { children: k.caseId ? "编辑用例" : "新建用例" }), /* @__PURE__ */ G(D, { children: ge ? "未保存" : k.caseId ? "已保存" : "新用例" })]
1263
1324
  }), u({
1264
- busy: b || De || a && !s,
1325
+ busy: b || Ee || a && !s,
1265
1326
  dirty: ge,
1266
1327
  cancel: () => {
1267
1328
  j() && (A(void 0), k.suiteId && !k.caseId && _("suites"));
1268
1329
  },
1269
- save: (e) => L(async () => {
1330
+ save: (e) => R(async () => {
1270
1331
  let t = k.caseId ?? crypto.randomUUID();
1271
1332
  if (k.caseId && !d.cases.some(({ id: e }) => e === t)) throw Error("当前用例已被删除,可返回后另存为新用例");
1272
1333
  let n = d.suites.find(({ id: e }) => e === k.suiteId);
@@ -1275,78 +1336,78 @@ function mt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1275
1336
  ...n,
1276
1337
  caseIds: [...n.caseIds, t]
1277
1338
  } : n;
1278
- await ke({
1339
+ await Oe({
1279
1340
  ...d,
1280
- cases: je(d.cases, {
1341
+ cases: Ae(d.cases, {
1281
1342
  id: t,
1282
1343
  testCase: e
1283
1344
  }),
1284
- suites: r ? je(d.suites, r) : d.suites
1285
- }), r && N(r), o(e), w(t), A(void 0);
1345
+ suites: r ? Ae(d.suites, r) : d.suites
1346
+ }), r && N(r), o(e), ce(t), A(void 0);
1286
1347
  })
1287
1348
  })]
1288
- }) : B ? /* @__PURE__ */ G("section", {
1289
- className: Z.stack,
1349
+ }) : V ? /* @__PURE__ */ K("section", {
1350
+ className: Q.stack,
1290
1351
  "aria-label": "用例详情",
1291
1352
  children: [
1292
- /* @__PURE__ */ W("h4", { children: B.testCase.name }),
1293
- /* @__PURE__ */ W("code", { children: B.url ?? B.testCase.path }),
1294
- /* @__PURE__ */ W("ol", {
1295
- className: Z.list,
1296
- children: B.testCase.steps.map((e, t) => /* @__PURE__ */ G("li", { children: [/* @__PURE__ */ G("strong", { children: [Qe[e.kind], e.assertion?.name ? ` · ${e.assertion.name}` : ""] }), e.assertion ? /* @__PURE__ */ G(U, { children: [
1297
- /* @__PURE__ */ W("span", { children: J.assertionSources[e.assertion.source] }),
1298
- e.assertion.method && /* @__PURE__ */ G("code", { children: [
1353
+ /* @__PURE__ */ G("h4", { children: V.testCase.name }),
1354
+ /* @__PURE__ */ G("code", { children: V.url ?? V.testCase.path }),
1355
+ /* @__PURE__ */ G("ol", {
1356
+ className: Q.list,
1357
+ children: V.testCase.steps.map((e, t) => /* @__PURE__ */ K("li", { children: [/* @__PURE__ */ K("strong", { children: [Ze[e.kind], e.assertion?.name ? ` · ${e.assertion.name}` : ""] }), e.assertion ? /* @__PURE__ */ K(W, { children: [
1358
+ /* @__PURE__ */ G("span", { children: Y.assertionSources[e.assertion.source] }),
1359
+ e.assertion.method && /* @__PURE__ */ K("code", { children: [
1299
1360
  e.assertion.method,
1300
1361
  " ",
1301
1362
  e.assertion.pathname
1302
1363
  ] }),
1303
- e.assertion.selector && /* @__PURE__ */ W("code", { children: e.assertion.selector }),
1304
- /* @__PURE__ */ G("span", { children: [
1305
- J.assertionOperators[e.assertion.operator],
1364
+ e.assertion.selector && /* @__PURE__ */ G("code", { children: e.assertion.selector }),
1365
+ /* @__PURE__ */ K("span", { children: [
1366
+ Y.assertionOperators[e.assertion.operator],
1306
1367
  e.assertion.expected !== void 0 && ` · 期望:${e.assertion.expected === "" ? "空字符串" : e.assertion.expected}`,
1307
1368
  " · ",
1308
1369
  e.assertion.timeout / 1e3,
1309
1370
  " 秒"
1310
1371
  ] })
1311
- ] }) : /* @__PURE__ */ G(U, { children: [
1312
- e.target?.label && /* @__PURE__ */ W("span", { children: e.target.label }),
1313
- e.target?.selector && /* @__PURE__ */ W("code", { children: e.target.selector }),
1314
- e.kind === "check" && /* @__PURE__ */ W("span", { children: e.checked ? "选中" : "取消选中" }),
1315
- e.value !== void 0 && /* @__PURE__ */ W("span", { children: e.value || "空字符串" })
1372
+ ] }) : /* @__PURE__ */ K(W, { children: [
1373
+ e.target?.label && /* @__PURE__ */ G("span", { children: e.target.label }),
1374
+ e.target?.selector && /* @__PURE__ */ G("code", { children: e.target.selector }),
1375
+ e.kind === "check" && /* @__PURE__ */ G("span", { children: e.checked ? "选中" : "取消选中" }),
1376
+ e.value !== void 0 && /* @__PURE__ */ G("span", { children: e.value || "空字符串" })
1316
1377
  ] })] }, t))
1317
1378
  }),
1318
- /* @__PURE__ */ G("div", {
1319
- className: Z.buttonRow,
1320
- children: [/* @__PURE__ */ W(C, {
1379
+ /* @__PURE__ */ K("div", {
1380
+ className: Q.buttonRow,
1381
+ children: [/* @__PURE__ */ G(C, {
1321
1382
  type: "primary",
1322
- disabled: !z,
1323
- onClick: () => _e(B.testCase, B.id, ce),
1383
+ disabled: !B,
1384
+ onClick: () => _e(V.testCase, V.id, w),
1324
1385
  children: "编辑用例"
1325
- }), /* @__PURE__ */ W(et, {
1386
+ }), /* @__PURE__ */ G($e, {
1326
1387
  label: "用例更多操作",
1327
- disabled: !z,
1388
+ disabled: !B,
1328
1389
  items: [{
1329
1390
  key: "delete",
1330
1391
  label: "删除用例",
1331
1392
  danger: !0,
1332
- onClick: () => void L(async () => {
1333
- if (d.suites.some((e) => e.caseIds.includes(B.id))) throw Error("请先从套件移除此用例");
1334
- window.confirm("删除该用例?") && (await ke({
1393
+ onClick: () => void R(async () => {
1394
+ if (d.suites.some((e) => e.caseIds.includes(V.id))) throw Error("请先从套件移除此用例");
1395
+ window.confirm("删除该用例?") && (await Oe({
1335
1396
  ...d,
1336
- cases: d.cases.filter(({ id: e }) => e !== B.id)
1337
- }), w(void 0));
1397
+ cases: d.cases.filter(({ id: e }) => e !== V.id)
1398
+ }), ce(void 0));
1338
1399
  })
1339
1400
  }]
1340
1401
  })]
1341
1402
  }),
1342
- /* @__PURE__ */ G("section", {
1343
- className: Z.stack,
1403
+ /* @__PURE__ */ K("section", {
1404
+ className: Q.stack,
1344
1405
  "aria-label": "所属套件",
1345
- children: [/* @__PURE__ */ W("h5", { children: "所属套件" }), /* @__PURE__ */ G("div", {
1346
- className: Z.buttonRow,
1406
+ children: [/* @__PURE__ */ G("h5", { children: "所属套件" }), /* @__PURE__ */ K("div", {
1407
+ className: Q.buttonRow,
1347
1408
  children: [
1348
- d.suites.filter((e) => e.caseIds.includes(B.id)).map((e) => /* @__PURE__ */ W(C, {
1349
- className: Z.entryLink,
1409
+ d.suites.filter((e) => e.caseIds.includes(V.id)).map((e) => /* @__PURE__ */ G(C, {
1410
+ className: Q.entryLink,
1350
1411
  type: "link",
1351
1412
  size: "small",
1352
1413
  onClick: () => {
@@ -1354,42 +1415,42 @@ function mt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1354
1415
  },
1355
1416
  children: e.name
1356
1417
  }, e.id)),
1357
- Pe.length > 0 && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(E, {
1418
+ Ne.length > 0 && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(E, {
1358
1419
  "aria-label": "选择套件",
1359
1420
  placeholder: "选择套件",
1360
1421
  value: be,
1361
- options: Pe.map(({ id: e, name: t }) => ({
1422
+ options: Ne.map(({ id: e, name: t }) => ({
1362
1423
  value: e,
1363
1424
  label: t
1364
1425
  })),
1365
1426
  loading: b,
1366
- disabled: !z,
1427
+ disabled: !B,
1367
1428
  onChange: xe
1368
- }), /* @__PURE__ */ W(C, {
1429
+ }), /* @__PURE__ */ G(C, {
1369
1430
  type: "text",
1370
- disabled: !z || !be,
1431
+ disabled: !B || !be,
1371
1432
  onClick: () => {
1372
- let e = Pe.find((e) => e.id === be);
1373
- e && L(async () => {
1374
- await ke({
1433
+ let e = Ne.find((e) => e.id === be);
1434
+ e && R(async () => {
1435
+ await Oe({
1375
1436
  ...d,
1376
- suites: je(d.suites, {
1437
+ suites: Ae(d.suites, {
1377
1438
  ...e,
1378
- caseIds: [...e.caseIds, B.id]
1439
+ caseIds: [...e.caseIds, V.id]
1379
1440
  })
1380
1441
  }), xe(void 0);
1381
1442
  });
1382
1443
  },
1383
1444
  children: "添加到套件"
1384
1445
  })] }),
1385
- /* @__PURE__ */ W(C, {
1446
+ /* @__PURE__ */ G(C, {
1386
1447
  type: "link",
1387
- disabled: !z,
1448
+ disabled: !B,
1388
1449
  onClick: () => {
1389
1450
  N({
1390
1451
  id: "",
1391
1452
  name: "",
1392
- caseIds: [B.id]
1453
+ caseIds: [V.id]
1393
1454
  }), me(!0), _("suites");
1394
1455
  },
1395
1456
  children: "新建套件"
@@ -1398,60 +1459,55 @@ function mt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1398
1459
  })]
1399
1460
  })
1400
1461
  ]
1401
- }) : /* @__PURE__ */ G("div", {
1402
- className: Z.stack,
1403
- children: [
1404
- /* @__PURE__ */ W(C, {
1405
- type: "primary",
1406
- disabled: !z,
1407
- onClick: () => _e(p()),
1408
- children: "新建用例"
1409
- }),
1410
- !d.cases.length && /* @__PURE__ */ W(de, { description: "暂无用例" }),
1411
- /* @__PURE__ */ W("ul", {
1412
- className: Z.resourceList,
1413
- children: d.cases.map(({ id: e, testCase: t, url: n }) => /* @__PURE__ */ W("li", { children: /* @__PURE__ */ G("div", { children: [
1414
- /* @__PURE__ */ W(C, {
1415
- type: "link",
1416
- size: "small",
1417
- className: Z.entryLink,
1418
- onClick: () => {
1419
- le(void 0), w(e), xe(void 0);
1420
- },
1462
+ }) : /* @__PURE__ */ K("div", {
1463
+ className: Q.stack,
1464
+ children: [!d.cases.length && /* @__PURE__ */ G(de, { description: "暂无用例" }), /* @__PURE__ */ G("ul", {
1465
+ className: Q.resourceList,
1466
+ children: d.cases.map(({ id: e, testCase: t, url: n }) => /* @__PURE__ */ G("li", { children: /* @__PURE__ */ K("div", { children: [
1467
+ /* @__PURE__ */ G(C, {
1468
+ type: "link",
1469
+ size: "small",
1470
+ className: Q.entryLink,
1471
+ onClick: () => {
1472
+ le(void 0), ce(e), xe(void 0);
1473
+ },
1474
+ children: /* @__PURE__ */ G("span", {
1475
+ className: Q.resourceName,
1476
+ title: t.name,
1421
1477
  children: t.name
1422
- }),
1423
- " ",
1424
- /* @__PURE__ */ G(D, { children: [t.steps.length, " 步"] }),
1425
- /* @__PURE__ */ W("br", {}),
1426
- /* @__PURE__ */ W("code", { children: n ?? t.path })
1427
- ] }) }, e))
1428
- })
1429
- ]
1478
+ })
1479
+ }),
1480
+ " ",
1481
+ /* @__PURE__ */ K(D, { children: [t.steps.length, " 步"] }),
1482
+ /* @__PURE__ */ G("br", {}),
1483
+ /* @__PURE__ */ G("code", { children: n ?? t.path })
1484
+ ] }) }, e))
1485
+ })]
1430
1486
  })
1431
1487
  },
1432
1488
  {
1433
1489
  key: "suites",
1434
1490
  label: "套件",
1435
- children: ue ? /* @__PURE__ */ G("section", {
1436
- className: Z.stack,
1491
+ children: ue ? /* @__PURE__ */ K("section", {
1492
+ className: Q.stack,
1437
1493
  "aria-label": "套件编辑",
1438
1494
  children: [
1439
- /* @__PURE__ */ W(C, {
1495
+ /* @__PURE__ */ G(C, {
1440
1496
  disabled: b,
1441
1497
  onClick: () => {
1442
- Re() && me(!1);
1498
+ Le() && me(!1);
1443
1499
  },
1444
1500
  children: "取消"
1445
1501
  }),
1446
- /* @__PURE__ */ W("h4", { children: M.id ? "编辑套件" : "新建套件" }),
1447
- /* @__PURE__ */ G("div", {
1448
- className: Z.stack,
1502
+ /* @__PURE__ */ G("h4", { children: M.id ? "编辑套件" : "新建套件" }),
1503
+ /* @__PURE__ */ K("div", {
1504
+ className: Q.stack,
1449
1505
  children: [
1450
- /* @__PURE__ */ W("label", {
1506
+ /* @__PURE__ */ G("label", {
1451
1507
  htmlFor: "assistant-suite-name",
1452
1508
  children: "套件名称"
1453
1509
  }),
1454
- /* @__PURE__ */ W(T, {
1510
+ /* @__PURE__ */ G(T, {
1455
1511
  id: "assistant-suite-name",
1456
1512
  "aria-required": "true",
1457
1513
  "aria-invalid": !M.name.trim(),
@@ -1463,97 +1519,97 @@ function mt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1463
1519
  name: e.target.value
1464
1520
  })
1465
1521
  }),
1466
- !M.name.trim() && /* @__PURE__ */ W("span", {
1467
- className: Z.hint,
1522
+ !M.name.trim() && /* @__PURE__ */ G("span", {
1523
+ className: Q.hint,
1468
1524
  id: "assistant-suite-name-error",
1469
1525
  children: "请输入套件名称"
1470
1526
  })
1471
1527
  ]
1472
1528
  }),
1473
- /* @__PURE__ */ W(pt, {
1474
- options: Me,
1529
+ /* @__PURE__ */ G(ft, {
1530
+ options: je,
1475
1531
  values: M.caseIds,
1476
1532
  onChange: (e) => N({
1477
1533
  ...M,
1478
1534
  caseIds: e
1479
1535
  })
1480
1536
  }),
1481
- /* @__PURE__ */ W(C, {
1537
+ /* @__PURE__ */ G(C, {
1482
1538
  type: "primary",
1483
- disabled: !z || !M.name.trim() || !M.caseIds.length,
1484
- onClick: () => void L(async () => {
1539
+ disabled: !B || !M.name.trim() || !M.caseIds.length,
1540
+ onClick: () => void R(async () => {
1485
1541
  let e = {
1486
1542
  ...M,
1487
1543
  id: M.id || crypto.randomUUID(),
1488
1544
  name: M.name.trim()
1489
1545
  };
1490
- await ke({
1546
+ await Oe({
1491
1547
  ...d,
1492
- suites: je(d.suites, e)
1548
+ suites: Ae(d.suites, e)
1493
1549
  }), N(e), me(!1);
1494
1550
  }),
1495
1551
  children: "保存套件"
1496
1552
  })
1497
1553
  ]
1498
- }) : V ? /* @__PURE__ */ G("section", {
1499
- className: Z.stack,
1554
+ }) : H ? /* @__PURE__ */ K("section", {
1555
+ className: Q.stack,
1500
1556
  "aria-label": "套件详情",
1501
1557
  children: [
1502
- /* @__PURE__ */ W("h4", { children: V.name }),
1503
- /* @__PURE__ */ W("ol", {
1504
- className: Z.list,
1505
- children: V.caseIds.map((e, t) => /* @__PURE__ */ W("li", { children: /* @__PURE__ */ W(C, {
1558
+ /* @__PURE__ */ G("h4", { children: H.name }),
1559
+ /* @__PURE__ */ G("ol", {
1560
+ className: Q.list,
1561
+ children: H.caseIds.map((e, t) => /* @__PURE__ */ G("li", { children: /* @__PURE__ */ G(C, {
1506
1562
  type: "link",
1507
1563
  size: "small",
1508
- className: Z.entryLink,
1564
+ className: Q.entryLink,
1509
1565
  onClick: () => {
1510
- w(e), le(V.id), xe(void 0), _("cases");
1566
+ ce(e), le(H.id), xe(void 0), _("cases");
1511
1567
  },
1512
- children: Me.find(({ value: t }) => t === e)?.label ?? e
1568
+ children: je.find(({ value: t }) => t === e)?.label ?? e
1513
1569
  }) }, t))
1514
1570
  }),
1515
- /* @__PURE__ */ G("div", {
1516
- className: Z.buttonRow,
1571
+ /* @__PURE__ */ K("div", {
1572
+ className: Q.buttonRow,
1517
1573
  children: [
1518
- /* @__PURE__ */ W(C, {
1574
+ /* @__PURE__ */ G(C, {
1519
1575
  type: "primary",
1520
- disabled: !z,
1576
+ disabled: !B,
1521
1577
  onClick: () => {
1522
- N(V), me(!0);
1578
+ N(H), me(!0);
1523
1579
  },
1524
1580
  children: "编辑套件"
1525
1581
  }),
1526
- /* @__PURE__ */ W(C, {
1582
+ /* @__PURE__ */ G(C, {
1527
1583
  type: "text",
1528
- disabled: !z,
1529
- onClick: () => _e(p(), void 0, V.id),
1584
+ disabled: !B,
1585
+ onClick: () => _e(p(), void 0, H.id),
1530
1586
  children: "新建用例"
1531
1587
  }),
1532
- /* @__PURE__ */ W(C, {
1588
+ /* @__PURE__ */ G(C, {
1533
1589
  type: "text",
1534
- disabled: !z,
1590
+ disabled: !B,
1535
1591
  onClick: () => {
1536
1592
  F({
1537
1593
  id: "",
1538
1594
  name: "",
1539
- suiteIds: [V.id],
1595
+ suiteIds: [H.id],
1540
1596
  repeat: 1
1541
1597
  }), O(!0), _("plans");
1542
1598
  },
1543
1599
  children: "创建计划"
1544
1600
  }),
1545
- /* @__PURE__ */ W(et, {
1601
+ /* @__PURE__ */ G($e, {
1546
1602
  label: "套件更多操作",
1547
- disabled: !z,
1603
+ disabled: !B,
1548
1604
  items: [{
1549
1605
  key: "delete",
1550
1606
  label: "删除套件",
1551
1607
  danger: !0,
1552
- onClick: () => void L(async () => {
1553
- if (d.plans.some((e) => e.suiteIds.includes(V.id))) throw Error("请先从计划移除此套件");
1554
- window.confirm("删除该套件?") && (await ke({
1608
+ onClick: () => void R(async () => {
1609
+ if (d.plans.some((e) => e.suiteIds.includes(H.id))) throw Error("请先从计划移除此套件");
1610
+ window.confirm("删除该套件?") && (await Oe({
1555
1611
  ...d,
1556
- suites: d.suites.filter(({ id: e }) => e !== V.id)
1612
+ suites: d.suites.filter(({ id: e }) => e !== H.id)
1557
1613
  }), N({
1558
1614
  id: "",
1559
1615
  name: "",
@@ -1565,60 +1621,49 @@ function mt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1565
1621
  ]
1566
1622
  })
1567
1623
  ]
1568
- }) : /* @__PURE__ */ G("div", {
1569
- className: Z.stack,
1570
- children: [
1571
- /* @__PURE__ */ W(C, {
1572
- type: "primary",
1573
- disabled: !z,
1624
+ }) : /* @__PURE__ */ K("div", {
1625
+ className: Q.stack,
1626
+ children: [!d.suites.length && /* @__PURE__ */ G(de, { description: "暂无套件" }), /* @__PURE__ */ G("ul", {
1627
+ className: Q.resourceList,
1628
+ children: d.suites.map((e) => /* @__PURE__ */ K("li", { children: [/* @__PURE__ */ G(C, {
1629
+ type: "link",
1630
+ size: "small",
1631
+ className: Q.entryLink,
1574
1632
  onClick: () => {
1575
- N({
1576
- id: "",
1577
- name: "",
1578
- caseIds: []
1579
- }), me(!0);
1633
+ N(e);
1580
1634
  },
1581
- children: "新建套件"
1582
- }),
1583
- !d.suites.length && /* @__PURE__ */ W(de, { description: "暂无套件" }),
1584
- /* @__PURE__ */ W("ul", {
1585
- className: Z.resourceList,
1586
- children: d.suites.map((e) => /* @__PURE__ */ G("li", { children: [/* @__PURE__ */ W(C, {
1587
- type: "link",
1588
- size: "small",
1589
- className: Z.entryLink,
1590
- onClick: () => {
1591
- N(e);
1592
- },
1635
+ children: /* @__PURE__ */ G("span", {
1636
+ className: Q.resourceName,
1637
+ title: e.name,
1593
1638
  children: e.name
1594
- }), /* @__PURE__ */ G("span", { children: [e.caseIds.length, " 个用例"] })] }, e.id))
1595
- })
1596
- ]
1639
+ })
1640
+ }), /* @__PURE__ */ K("span", { children: [e.caseIds.length, " 个用例"] })] }, e.id))
1641
+ })]
1597
1642
  })
1598
1643
  },
1599
1644
  {
1600
1645
  key: "plans",
1601
1646
  label: "计划",
1602
- children: he ? /* @__PURE__ */ G("section", {
1603
- className: Z.stack,
1647
+ children: he ? /* @__PURE__ */ K("section", {
1648
+ className: Q.stack,
1604
1649
  "aria-label": "计划编辑",
1605
1650
  children: [
1606
- /* @__PURE__ */ W(C, {
1651
+ /* @__PURE__ */ G(C, {
1607
1652
  disabled: b,
1608
1653
  onClick: () => {
1609
- ze() && O(!1);
1654
+ Re() && O(!1);
1610
1655
  },
1611
1656
  children: "取消"
1612
1657
  }),
1613
- /* @__PURE__ */ W("h4", { children: P.id ? "编辑计划" : "新建计划" }),
1614
- /* @__PURE__ */ G("div", {
1615
- className: Z.stack,
1658
+ /* @__PURE__ */ G("h4", { children: P.id ? "编辑计划" : "新建计划" }),
1659
+ /* @__PURE__ */ K("div", {
1660
+ className: Q.stack,
1616
1661
  children: [
1617
- /* @__PURE__ */ W("label", {
1662
+ /* @__PURE__ */ G("label", {
1618
1663
  htmlFor: "assistant-plan-name",
1619
1664
  children: "计划名称"
1620
1665
  }),
1621
- /* @__PURE__ */ W(T, {
1666
+ /* @__PURE__ */ G(T, {
1622
1667
  id: "assistant-plan-name",
1623
1668
  "aria-required": "true",
1624
1669
  "aria-invalid": !P.name.trim(),
@@ -1630,17 +1675,17 @@ function mt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1630
1675
  name: e.target.value
1631
1676
  })
1632
1677
  }),
1633
- !P.name.trim() && /* @__PURE__ */ W("span", {
1634
- className: Z.hint,
1678
+ !P.name.trim() && /* @__PURE__ */ G("span", {
1679
+ className: Q.hint,
1635
1680
  id: "assistant-plan-name-error",
1636
1681
  children: "请输入计划名称"
1637
1682
  })
1638
1683
  ]
1639
1684
  }),
1640
- /* @__PURE__ */ G("label", { children: [
1685
+ /* @__PURE__ */ K("label", { children: [
1641
1686
  "重复轮数",
1642
1687
  " ",
1643
- /* @__PURE__ */ W(fe, {
1688
+ /* @__PURE__ */ G(fe, {
1644
1689
  min: 1,
1645
1690
  max: 20,
1646
1691
  precision: 0,
@@ -1652,74 +1697,74 @@ function mt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1652
1697
  })
1653
1698
  })
1654
1699
  ] }),
1655
- /* @__PURE__ */ W(pt, {
1656
- options: Ne,
1700
+ /* @__PURE__ */ G(ft, {
1701
+ options: Me,
1657
1702
  values: P.suiteIds,
1658
1703
  onChange: (e) => F({
1659
1704
  ...P,
1660
1705
  suiteIds: e
1661
1706
  })
1662
1707
  }),
1663
- /* @__PURE__ */ W(C, {
1708
+ /* @__PURE__ */ G(C, {
1664
1709
  type: "primary",
1665
- disabled: !z || !P.name.trim() || !P.suiteIds.length,
1666
- onClick: () => void L(async () => {
1710
+ disabled: !B || !P.name.trim() || !P.suiteIds.length,
1711
+ onClick: () => void R(async () => {
1667
1712
  let e = {
1668
1713
  ...P,
1669
1714
  id: P.id || crypto.randomUUID(),
1670
1715
  name: P.name.trim()
1671
1716
  };
1672
- await ke({
1717
+ await Oe({
1673
1718
  ...d,
1674
- plans: je(d.plans, e)
1719
+ plans: Ae(d.plans, e)
1675
1720
  }), F(e), O(!1);
1676
1721
  }),
1677
1722
  children: "保存计划"
1678
1723
  })
1679
1724
  ]
1680
- }) : H ? /* @__PURE__ */ G("section", {
1681
- className: Z.stack,
1725
+ }) : U ? /* @__PURE__ */ K("section", {
1726
+ className: Q.stack,
1682
1727
  "aria-label": "计划详情",
1683
1728
  children: [
1684
- /* @__PURE__ */ W("h4", { children: H.name }),
1685
- /* @__PURE__ */ G("span", { children: [
1729
+ /* @__PURE__ */ G("h4", { children: U.name }),
1730
+ /* @__PURE__ */ K("span", { children: [
1686
1731
  "重复 ",
1687
- H.repeat,
1732
+ U.repeat,
1688
1733
  " 轮"
1689
1734
  ] }),
1690
- /* @__PURE__ */ W("ol", {
1691
- className: Z.list,
1692
- children: H.suiteIds.map((e, t) => /* @__PURE__ */ W("li", { children: /* @__PURE__ */ W(C, {
1735
+ /* @__PURE__ */ G("ol", {
1736
+ className: Q.list,
1737
+ children: U.suiteIds.map((e, t) => /* @__PURE__ */ G("li", { children: /* @__PURE__ */ G(C, {
1693
1738
  type: "link",
1694
1739
  size: "small",
1695
- className: Z.entryLink,
1740
+ className: Q.entryLink,
1696
1741
  onClick: () => {
1697
1742
  let t = d.suites.find((t) => t.id === e);
1698
1743
  t && (N(t), _("suites"));
1699
1744
  },
1700
- children: Ne.find(({ value: t }) => t === e)?.label ?? e
1745
+ children: Me.find(({ value: t }) => t === e)?.label ?? e
1701
1746
  }) }, t))
1702
1747
  }),
1703
- /* @__PURE__ */ G("div", {
1704
- className: Z.buttonRow,
1705
- children: [/* @__PURE__ */ W(C, {
1748
+ /* @__PURE__ */ K("div", {
1749
+ className: Q.buttonRow,
1750
+ children: [/* @__PURE__ */ G(C, {
1706
1751
  type: "text",
1707
- disabled: !z,
1752
+ disabled: !B,
1708
1753
  onClick: () => {
1709
- F(H), O(!0);
1754
+ F(U), O(!0);
1710
1755
  },
1711
1756
  children: "编辑计划"
1712
- }), /* @__PURE__ */ W(et, {
1757
+ }), /* @__PURE__ */ G($e, {
1713
1758
  label: "计划更多操作",
1714
- disabled: !z,
1759
+ disabled: !B,
1715
1760
  items: [{
1716
1761
  key: "delete",
1717
1762
  label: "删除计划",
1718
1763
  danger: !0,
1719
- onClick: () => void L(async () => {
1720
- window.confirm("删除该计划?") && (await ke({
1764
+ onClick: () => void R(async () => {
1765
+ window.confirm("删除该计划?") && (await Oe({
1721
1766
  ...d,
1722
- plans: d.plans.filter(({ id: e }) => e !== H.id)
1767
+ plans: d.plans.filter(({ id: e }) => e !== U.id)
1723
1768
  }), F({
1724
1769
  id: "",
1725
1770
  name: "",
@@ -1730,111 +1775,100 @@ function mt({ base: e, name: t, onBack: n, onRename: r, draft: i, disabled: a, o
1730
1775
  }]
1731
1776
  })]
1732
1777
  }),
1733
- /* @__PURE__ */ W("p", {
1734
- className: Z.hint,
1778
+ /* @__PURE__ */ G("p", {
1779
+ className: Q.hint,
1735
1780
  children: "回放会实际操作测试数据,且不会自动恢复。"
1736
1781
  }),
1737
- /* @__PURE__ */ W(C, {
1782
+ /* @__PURE__ */ G(C, {
1738
1783
  type: "primary",
1739
- disabled: !z,
1740
- onClick: () => void L(async () => {
1741
- let e = await I("/run", "POST", { planId: H.id });
1784
+ disabled: !B,
1785
+ onClick: () => void R(async () => {
1786
+ let e = await L("/run", "POST", { planId: U.id });
1742
1787
  h([e, ...m]), Ce(e.id), _("reports");
1743
1788
  }),
1744
1789
  children: "运行计划"
1745
1790
  })
1746
1791
  ]
1747
- }) : /* @__PURE__ */ G("div", {
1748
- className: Z.stack,
1749
- children: [
1750
- /* @__PURE__ */ W(C, {
1751
- type: "primary",
1752
- disabled: !z,
1753
- onClick: () => {
1754
- F({
1755
- id: "",
1756
- name: "",
1757
- suiteIds: [],
1758
- repeat: 1
1759
- }), O(!0);
1760
- },
1761
- children: "新建计划"
1762
- }),
1763
- !d.plans.length && /* @__PURE__ */ W(de, { description: "暂无计划" }),
1764
- /* @__PURE__ */ W("ul", {
1765
- className: Z.resourceList,
1766
- children: d.plans.map((e) => /* @__PURE__ */ G("li", { children: [/* @__PURE__ */ W(C, {
1767
- type: "link",
1768
- size: "small",
1769
- className: Z.entryLink,
1770
- onClick: () => F(e),
1792
+ }) : /* @__PURE__ */ K("div", {
1793
+ className: Q.stack,
1794
+ children: [!d.plans.length && /* @__PURE__ */ G(de, { description: "暂无计划" }), /* @__PURE__ */ G("ul", {
1795
+ className: Q.resourceList,
1796
+ children: d.plans.map((e) => /* @__PURE__ */ K("li", { children: [/* @__PURE__ */ G(C, {
1797
+ type: "link",
1798
+ size: "small",
1799
+ className: Q.entryLink,
1800
+ onClick: () => F(e),
1801
+ children: /* @__PURE__ */ G("span", {
1802
+ className: Q.resourceName,
1803
+ title: e.name,
1771
1804
  children: e.name
1772
- }), /* @__PURE__ */ G("span", { children: [
1773
- e.suiteIds.length,
1774
- " 个套件 · 重复 ",
1775
- e.repeat,
1776
- " 轮"
1777
- ] })] }, e.id))
1778
- })
1779
- ]
1805
+ })
1806
+ }), /* @__PURE__ */ K("span", { children: [
1807
+ e.suiteIds.length,
1808
+ " 个套件 · 重复 ",
1809
+ e.repeat,
1810
+ " 轮"
1811
+ ] })] }, e.id))
1812
+ })]
1780
1813
  })
1781
1814
  },
1782
1815
  {
1783
1816
  key: "reports",
1784
1817
  label: "报告",
1785
- children: /* @__PURE__ */ G("div", {
1786
- className: Z.stack,
1818
+ children: /* @__PURE__ */ K("div", {
1819
+ className: Q.stack,
1787
1820
  children: [
1788
- /* @__PURE__ */ G("div", {
1789
- className: Z.buttonRow,
1790
- children: [/* @__PURE__ */ W(C, {
1821
+ /* @__PURE__ */ K("div", {
1822
+ className: Q.buttonRow,
1823
+ children: [/* @__PURE__ */ G(C, {
1791
1824
  type: "text",
1792
1825
  disabled: b,
1793
- onClick: () => void L(async () => {
1794
- h(await I("/runs")), Ee && Te(await I(`/runs/${Ee}`));
1826
+ onClick: () => void R(async () => {
1827
+ h(await L("/runs")), I && Te(await L(`/runs/${I}`));
1795
1828
  }),
1796
1829
  children: "刷新报告"
1797
- }), /* @__PURE__ */ W(C, {
1830
+ }), /* @__PURE__ */ G(C, {
1798
1831
  type: "primary",
1799
1832
  danger: !0,
1800
- disabled: b || !De,
1801
- onClick: () => void L(async () => {
1802
- let e = await I("/stop", "POST", {});
1833
+ disabled: b || !Ee,
1834
+ onClick: () => void R(async () => {
1835
+ let e = await L("/stop", "POST", {});
1803
1836
  h(m.map((t) => t.id === e.id ? e : t));
1804
1837
  }),
1805
1838
  children: "停止计划"
1806
1839
  })]
1807
1840
  }),
1808
- !m.length && /* @__PURE__ */ W(de, { description: "暂无运行报告" }),
1809
- m.length > 0 && /* @__PURE__ */ W(E, {
1841
+ !m.length && /* @__PURE__ */ G(de, { description: "暂无运行报告" }),
1842
+ m.length > 0 && /* @__PURE__ */ G(E, {
1810
1843
  "aria-label": "运行报告",
1811
1844
  value: Se ?? m[0].id,
1812
1845
  onChange: Ce,
1813
1846
  options: m.map((e) => ({
1814
1847
  value: e.id,
1815
- label: `${e.planName} · ${dt[e.state] ?? e.state} · ${e.id.slice(0, 8)}`
1848
+ label: `${e.planName} · ${ut[e.state] ?? e.state} · ${e.id.slice(0, 8)}`
1816
1849
  }))
1817
1850
  }),
1818
- we && we.id === Ee && /* @__PURE__ */ W(ft, {
1851
+ we && we.id === I && /* @__PURE__ */ G(dt, {
1819
1852
  run: we,
1820
1853
  base: e,
1821
- onExport: () => Ae(we, `研发小蜜报告-${we.id}.json`)
1854
+ onExport: () => ke(we, `研发小蜜报告-${we.id}.json`)
1822
1855
  })
1823
1856
  ]
1824
1857
  })
1825
1858
  }
1826
1859
  ]
1827
- })] }) : /* @__PURE__ */ W(C, {
1860
+ }) }) : /* @__PURE__ */ G(C, {
1861
+ className: Q.fitButton,
1828
1862
  loading: b,
1829
- onClick: R,
1863
+ onClick: z,
1830
1864
  children: b ? "正在读取测试库" : "重试读取测试库"
1831
1865
  })
1832
1866
  ]
1833
1867
  });
1834
1868
  }
1835
1869
  // src/pages/assistant/components/TestLibraryPanel/index.tsx
1836
- function ht({ bridgeUrl: e, exploration: t, ...n }) {
1837
- let r = `${e.replace(/\/$/, "")}/library`, i = ut(r), [a, o] = x(), [s, c] = x(), [l, u] = x(), [d, f] = x("libraries"), [p, m] = x(!1), [h, g] = x(""), _ = async (e) => {
1870
+ function mt({ bridgeUrl: e, exploration: t, ...n }) {
1871
+ let r = `${e.replace(/\/$/, "")}/library`, i = lt(r), [a, o] = x(), [s, c] = x(), [l, u] = x(), [d, f] = x("libraries"), [p, m] = x(!1), [h, g] = x(""), _ = async (e) => {
1838
1872
  let t = await i("/collections", "GET", void 0, e);
1839
1873
  e?.aborted || o(t.collections);
1840
1874
  }, v = async (e, t) => {
@@ -1857,8 +1891,8 @@ function ht({ bridgeUrl: e, exploration: t, ...n }) {
1857
1891
  if (p) return;
1858
1892
  let t = a?.find(({ id: e }) => e === l?.id);
1859
1893
  (!l || l.name === (t?.name ?? "") || window.confirm("测试库名称尚未保存,确定放弃?")) && (u(void 0), f(e));
1860
- }, te = /* @__PURE__ */ G(se, {
1861
- className: Z.card,
1894
+ }, te = /* @__PURE__ */ K(se, {
1895
+ className: Q.card,
1862
1896
  "aria-label": "测试库列表",
1863
1897
  styles: { body: {
1864
1898
  padding: 0,
@@ -1867,17 +1901,25 @@ function ht({ bridgeUrl: e, exploration: t, ...n }) {
1867
1901
  gap: 16
1868
1902
  } },
1869
1903
  children: [
1870
- /* @__PURE__ */ W("h3", { children: "测试库" }),
1871
- h && /* @__PURE__ */ W(S, {
1904
+ /* @__PURE__ */ K("header", {
1905
+ className: Q.header,
1906
+ children: [/* @__PURE__ */ G("h3", { children: "测试库" }), a && !l && /* @__PURE__ */ G(C, {
1907
+ type: "primary",
1908
+ disabled: p || n.disabled,
1909
+ onClick: () => u({ name: "" }),
1910
+ children: "新建测试库"
1911
+ })]
1912
+ }),
1913
+ h && /* @__PURE__ */ G(S, {
1872
1914
  type: "error",
1873
1915
  title: h
1874
1916
  }),
1875
- n.incomingDraft && /* @__PURE__ */ W(S, {
1917
+ n.incomingDraft && /* @__PURE__ */ G(S, {
1876
1918
  type: "info",
1877
1919
  title: "请选择测试库,继续编辑时间线用例"
1878
1920
  }),
1879
- a ? l ? /* @__PURE__ */ G("form", {
1880
- className: Z.stack,
1921
+ a ? l ? /* @__PURE__ */ K("form", {
1922
+ className: Q.stack,
1881
1923
  onSubmit: (e) => {
1882
1924
  e.preventDefault(), l.name.trim() && !p && v(async () => {
1883
1925
  let e = await i(l.id ? "/collections/" + encodeURIComponent(l.id) : "/collections", l.id ? "PATCH" : "POST", { name: l.name.trim() });
@@ -1885,11 +1927,11 @@ function ht({ bridgeUrl: e, exploration: t, ...n }) {
1885
1927
  });
1886
1928
  },
1887
1929
  children: [
1888
- /* @__PURE__ */ W("label", {
1930
+ /* @__PURE__ */ G("label", {
1889
1931
  htmlFor: "assistant-library-name",
1890
1932
  children: "测试库名称"
1891
1933
  }),
1892
- /* @__PURE__ */ W(T, {
1934
+ /* @__PURE__ */ G(T, {
1893
1935
  id: "assistant-library-name",
1894
1936
  "aria-required": "true",
1895
1937
  "aria-invalid": !l.name.trim(),
@@ -1902,63 +1944,59 @@ function ht({ bridgeUrl: e, exploration: t, ...n }) {
1902
1944
  name: e.target.value
1903
1945
  })
1904
1946
  }),
1905
- !l.name.trim() && /* @__PURE__ */ W("span", {
1906
- className: Z.hint,
1947
+ !l.name.trim() && /* @__PURE__ */ G("span", {
1948
+ className: Q.hint,
1907
1949
  id: "assistant-library-name-error",
1908
1950
  children: "请输入测试库名称"
1909
1951
  }),
1910
- /* @__PURE__ */ G("div", {
1911
- className: Z.buttonRow,
1912
- children: [/* @__PURE__ */ W(C, {
1952
+ /* @__PURE__ */ K("div", {
1953
+ className: Q.buttonRow,
1954
+ children: [/* @__PURE__ */ G(C, {
1913
1955
  htmlType: "submit",
1914
1956
  type: "primary",
1915
1957
  loading: p,
1916
1958
  disabled: !l.name.trim(),
1917
1959
  children: l.id ? "保存" : "创建"
1918
- }), /* @__PURE__ */ W(C, {
1960
+ }), /* @__PURE__ */ G(C, {
1919
1961
  disabled: p,
1920
1962
  onClick: () => u(void 0),
1921
1963
  children: "取消"
1922
1964
  })]
1923
1965
  })
1924
1966
  ]
1925
- }) : /* @__PURE__ */ G(U, { children: [
1926
- /* @__PURE__ */ W(C, {
1927
- type: "primary",
1928
- disabled: p || n.disabled,
1929
- onClick: () => u({ name: "" }),
1930
- children: "新建测试库"
1931
- }),
1932
- !a.length && /* @__PURE__ */ W(de, { description: "暂无测试库" }),
1933
- /* @__PURE__ */ W("ul", {
1934
- className: Z.resourceList,
1935
- children: a.map((e) => /* @__PURE__ */ G("li", { children: [/* @__PURE__ */ W(C, {
1936
- type: "link",
1937
- size: "small",
1938
- className: Z.entryLink,
1939
- disabled: p || n.recording,
1940
- onClick: () => c(e),
1967
+ }) : /* @__PURE__ */ K(W, { children: [!a.length && /* @__PURE__ */ G(de, { description: "暂无测试库" }), /* @__PURE__ */ G("ul", {
1968
+ className: Q.resourceList,
1969
+ children: a.map((e) => /* @__PURE__ */ K("li", { children: [/* @__PURE__ */ G(C, {
1970
+ type: "link",
1971
+ size: "small",
1972
+ className: Q.entryLink,
1973
+ title: e.name,
1974
+ disabled: p || n.recording,
1975
+ onClick: () => c(e),
1976
+ children: /* @__PURE__ */ G("span", {
1977
+ className: Q.resourceName,
1941
1978
  children: e.name
1942
- }), /* @__PURE__ */ G("span", { children: [
1943
- e.caseCount,
1944
- " 个用例 · ",
1945
- e.suiteCount,
1946
- " 个套件 ·",
1947
- " ",
1948
- e.planCount,
1949
- " 个计划"
1950
- ] })] }, e.id))
1951
- })
1952
- ] }) : /* @__PURE__ */ W(C, {
1979
+ })
1980
+ }), /* @__PURE__ */ K("span", { children: [
1981
+ e.caseCount,
1982
+ " 个用例 · ",
1983
+ e.suiteCount,
1984
+ " 个套件 ·",
1985
+ " ",
1986
+ e.planCount,
1987
+ " 个计划"
1988
+ ] })] }, e.id))
1989
+ })] }) : /* @__PURE__ */ G(C, {
1990
+ className: Q.fitButton,
1953
1991
  loading: p,
1954
1992
  onClick: () => void v(_),
1955
1993
  children: p ? "正在读取测试库列表" : "重试读取测试库列表"
1956
1994
  })
1957
1995
  ]
1958
1996
  });
1959
- return /* @__PURE__ */ G(U, { children: [s && /* @__PURE__ */ W("div", {
1997
+ return /* @__PURE__ */ K(W, { children: [s && /* @__PURE__ */ G("div", {
1960
1998
  hidden: !!l,
1961
- children: /* @__PURE__ */ ee(mt, {
1999
+ children: /* @__PURE__ */ ee(pt, {
1962
2000
  ...n,
1963
2001
  key: s.id,
1964
2002
  base: `${r}/collections/${encodeURIComponent(s.id)}`,
@@ -1973,9 +2011,9 @@ function ht({ bridgeUrl: e, exploration: t, ...n }) {
1973
2011
  });
1974
2012
  }
1975
2013
  })
1976
- }), /* @__PURE__ */ W("div", {
2014
+ }), /* @__PURE__ */ G("div", {
1977
2015
  hidden: !!s && !l,
1978
- children: /* @__PURE__ */ W(pe, {
2016
+ children: /* @__PURE__ */ G(pe, {
1979
2017
  activeKey: d,
1980
2018
  onChange: b,
1981
2019
  items: [{
@@ -1992,7 +2030,7 @@ function ht({ bridgeUrl: e, exploration: t, ...n }) {
1992
2030
  })] });
1993
2031
  }
1994
2032
  // src/pages/assistant/components/AutomationPanel/index.tsx
1995
- function gt({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2033
+ function ht({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
1996
2034
  let i = ie(s.subscribe, s.getState), a = re(null), [o, c] = x(""), [l, u] = x(null), d = re(null), f = (e, t) => {
1997
2035
  u({
1998
2036
  position: e,
@@ -2015,18 +2053,18 @@ function gt({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2015
2053
  supplemented: !0
2016
2054
  } : n)
2017
2055
  });
2018
- return /* @__PURE__ */ G("div", {
2019
- className: q.section,
2056
+ return /* @__PURE__ */ K("div", {
2057
+ className: J.section,
2020
2058
  "data-assistant-part": "section automation",
2021
- children: [o && /* @__PURE__ */ W(S, {
2059
+ children: [o && /* @__PURE__ */ G(S, {
2022
2060
  closable: !0,
2023
2061
  onClose: () => c(""),
2024
2062
  type: "error",
2025
2063
  title: o
2026
- }), /* @__PURE__ */ W("div", {
2027
- className: q.automationLayout,
2064
+ }), /* @__PURE__ */ G("div", {
2065
+ className: J.automationLayout,
2028
2066
  "data-assistant-part": "automation-layout",
2029
- children: /* @__PURE__ */ W(ht, {
2067
+ children: /* @__PURE__ */ G(mt, {
2030
2068
  bridgeUrl: t,
2031
2069
  draft: i.draft,
2032
2070
  disabled: p || i.recording,
@@ -2036,26 +2074,26 @@ function gt({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2036
2074
  onEdit: (e) => {
2037
2075
  s.loadDraft(e), u(null);
2038
2076
  },
2039
- exploration: /* @__PURE__ */ W(lt, {
2077
+ exploration: /* @__PURE__ */ G(ct, {
2040
2078
  bridgeUrl: t,
2041
2079
  disabled: i.recording,
2042
2080
  onRunningChange: m
2043
2081
  }),
2044
- renderEditor: ({ save: t, busy: n, dirty: r, cancel: o }) => /* @__PURE__ */ G(U, { children: [
2045
- /* @__PURE__ */ G("div", {
2046
- className: q.field,
2082
+ renderEditor: ({ save: t, busy: n, dirty: r, cancel: o }) => /* @__PURE__ */ K(W, { children: [
2083
+ /* @__PURE__ */ K("div", {
2084
+ className: J.field,
2047
2085
  "data-assistant-part": "field",
2048
2086
  children: [
2049
- /* @__PURE__ */ W("label", {
2087
+ /* @__PURE__ */ G("label", {
2050
2088
  htmlFor: "assistant-case-name",
2051
2089
  children: "用例名称"
2052
2090
  }),
2053
- /* @__PURE__ */ W(T, {
2091
+ /* @__PURE__ */ G(T, {
2054
2092
  id: "assistant-case-name",
2055
2093
  "aria-required": "true",
2056
2094
  "aria-invalid": !i.draft.name.trim(),
2057
2095
  "aria-describedby": i.draft.name.trim() ? void 0 : "assistant-case-name-error",
2058
- prefix: /* @__PURE__ */ W(Te, {}),
2096
+ prefix: /* @__PURE__ */ G(Te, {}),
2059
2097
  "aria-label": "测试用例名称",
2060
2098
  value: i.draft.name,
2061
2099
  maxLength: 100,
@@ -2065,20 +2103,20 @@ function gt({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2065
2103
  name: e.target.value
2066
2104
  })
2067
2105
  }),
2068
- !i.draft.name.trim() && /* @__PURE__ */ W("span", {
2069
- className: q.hint,
2106
+ !i.draft.name.trim() && /* @__PURE__ */ G("span", {
2107
+ className: J.hint,
2070
2108
  id: "assistant-case-name-error",
2071
2109
  children: "请输入用例名称"
2072
2110
  })
2073
2111
  ]
2074
2112
  }),
2075
- /* @__PURE__ */ G("div", {
2076
- className: q.field,
2113
+ /* @__PURE__ */ K("div", {
2114
+ className: J.field,
2077
2115
  "data-assistant-part": "field",
2078
- children: [/* @__PURE__ */ W("label", {
2116
+ children: [/* @__PURE__ */ G("label", {
2079
2117
  htmlFor: "assistant-case-path",
2080
2118
  children: "用例入口"
2081
- }), /* @__PURE__ */ W(T, {
2119
+ }), /* @__PURE__ */ G(T, {
2082
2120
  id: "assistant-case-path",
2083
2121
  value: i.draft.path,
2084
2122
  maxLength: 2e3,
@@ -2089,8 +2127,8 @@ function gt({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2089
2127
  })
2090
2128
  })]
2091
2129
  }),
2092
- /* @__PURE__ */ G(se, {
2093
- className: q.card,
2130
+ /* @__PURE__ */ K(se, {
2131
+ className: J.card,
2094
2132
  "data-assistant-part": "card record-card",
2095
2133
  "aria-label": "录制操作",
2096
2134
  styles: { body: {
@@ -2100,10 +2138,10 @@ function gt({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2100
2138
  gap: 16
2101
2139
  } },
2102
2140
  children: [
2103
- /* @__PURE__ */ G("div", {
2104
- className: q.cardHeading,
2141
+ /* @__PURE__ */ K("div", {
2142
+ className: J.cardHeading,
2105
2143
  "data-assistant-part": "card-heading",
2106
- children: [/* @__PURE__ */ G("h3", { children: [/* @__PURE__ */ W(Re, {}), "录制操作"] }), /* @__PURE__ */ G(D, {
2144
+ children: [/* @__PURE__ */ K("h3", { children: [/* @__PURE__ */ G(Le, {}), "录制操作"] }), /* @__PURE__ */ K(D, {
2107
2145
  color: i.recording ? "red" : "default",
2108
2146
  children: [
2109
2147
  i.recording ? "录制中" : "待录制",
@@ -2113,18 +2151,18 @@ function gt({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2113
2151
  ]
2114
2152
  })]
2115
2153
  }),
2116
- /* @__PURE__ */ W("div", {
2117
- className: q.buttonRow,
2154
+ /* @__PURE__ */ G("div", {
2155
+ className: J.buttonRow,
2118
2156
  "data-assistant-part": "button-row",
2119
- children: i.recording ? /* @__PURE__ */ W(C, {
2157
+ children: i.recording ? /* @__PURE__ */ G(C, {
2120
2158
  type: "primary",
2121
2159
  danger: !0,
2122
- icon: /* @__PURE__ */ W(Ie, {}),
2160
+ icon: /* @__PURE__ */ G(Fe, {}),
2123
2161
  disabled: !i.recording,
2124
2162
  onClick: () => s.stop(),
2125
2163
  children: "结束录制"
2126
- }) : /* @__PURE__ */ W(C, {
2127
- icon: /* @__PURE__ */ W(Re, {}),
2164
+ }) : /* @__PURE__ */ G(C, {
2165
+ icon: /* @__PURE__ */ G(Le, {}),
2128
2166
  type: "primary",
2129
2167
  disabled: n || i.recording,
2130
2168
  onClick: () => void h(() => {
@@ -2136,13 +2174,13 @@ function gt({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2136
2174
  children: "开始录制"
2137
2175
  })
2138
2176
  }),
2139
- /* @__PURE__ */ W("p", {
2140
- className: q.hint,
2177
+ /* @__PURE__ */ G("p", {
2178
+ className: J.hint,
2141
2179
  "data-assistant-part": "hint",
2142
2180
  children: "展开、切换页签等准备操作也需录下来。"
2143
2181
  }),
2144
- /* @__PURE__ */ W(ce, {
2145
- className: q.help,
2182
+ /* @__PURE__ */ G(w, {
2183
+ className: J.help,
2146
2184
  "data-assistant-part": "help",
2147
2185
  ghost: !0,
2148
2186
  size: "small",
@@ -2156,13 +2194,13 @@ function gt({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2156
2194
  },
2157
2195
  items: [{
2158
2196
  key: "details",
2159
- label: /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(R, {}), "录制范围"] }),
2160
- children: /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("p", {
2161
- className: q.hint,
2197
+ label: /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(z, {}), "录制范围"] }),
2198
+ children: /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G("p", {
2199
+ className: J.hint,
2162
2200
  "data-assistant-part": "hint",
2163
2201
  children: "从业务页面的初始状态开始录制。回放目标由宿主配置。"
2164
- }), /* @__PURE__ */ W("p", {
2165
- className: q.hint,
2202
+ }), /* @__PURE__ */ G("p", {
2203
+ className: J.hint,
2166
2204
  "data-assistant-part": "hint",
2167
2205
  children: "普通字段的输入值会写入用例。密码等敏感输入、文件上传、跨域 iframe、拖动和刷新不记录或不支持。"
2168
2206
  })] })
@@ -2170,8 +2208,8 @@ function gt({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2170
2208
  })
2171
2209
  ]
2172
2210
  }),
2173
- /* @__PURE__ */ G(se, {
2174
- className: q.card,
2211
+ /* @__PURE__ */ K(se, {
2212
+ className: J.card,
2175
2213
  "data-assistant-part": "card editor-card",
2176
2214
  "aria-label": "编辑用例",
2177
2215
  styles: { body: {
@@ -2181,73 +2219,73 @@ function gt({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2181
2219
  gap: 16
2182
2220
  } },
2183
2221
  children: [
2184
- /* @__PURE__ */ G("div", {
2185
- className: q.cardHeading,
2222
+ /* @__PURE__ */ K("div", {
2223
+ className: J.cardHeading,
2186
2224
  "data-assistant-part": "card-heading",
2187
- children: [/* @__PURE__ */ G("h3", { children: [/* @__PURE__ */ W(P, {}), "编辑用例"] }), /* @__PURE__ */ G("span", { children: [i.draft.steps.length, " 个步骤"] })]
2225
+ children: [/* @__PURE__ */ K("h3", { children: [/* @__PURE__ */ G(P, {}), "编辑用例"] }), /* @__PURE__ */ K("span", { children: [i.draft.steps.length, " 个步骤"] })]
2188
2226
  }),
2189
- !i.draft.steps.length && /* @__PURE__ */ G("div", {
2190
- className: q.emptySteps,
2227
+ !i.draft.steps.length && /* @__PURE__ */ K("div", {
2228
+ className: J.emptySteps,
2191
2229
  "data-assistant-part": "empty-steps",
2192
- children: [/* @__PURE__ */ W(Te, {}), /* @__PURE__ */ W("span", { children: "暂无操作步骤" })]
2230
+ children: [/* @__PURE__ */ G(Te, {}), /* @__PURE__ */ G("span", { children: "暂无操作步骤" })]
2193
2231
  }),
2194
- /* @__PURE__ */ W("ol", {
2195
- className: q.caseSteps,
2232
+ /* @__PURE__ */ G("ol", {
2233
+ className: J.caseSteps,
2196
2234
  "data-assistant-part": "case-steps",
2197
- children: i.draft.steps.map((e, t) => /* @__PURE__ */ G("li", { children: [
2198
- /* @__PURE__ */ G("div", {
2199
- className: q.stepHeading,
2235
+ children: i.draft.steps.map((e, t) => /* @__PURE__ */ K("li", { children: [
2236
+ /* @__PURE__ */ K("div", {
2237
+ className: J.stepHeading,
2200
2238
  "data-assistant-part": "step-heading",
2201
2239
  children: [
2202
- /* @__PURE__ */ W("span", {
2203
- className: q.stepNumber,
2240
+ /* @__PURE__ */ G("span", {
2241
+ className: J.stepNumber,
2204
2242
  "data-assistant-part": "step-number",
2205
2243
  children: String(t + 1).padStart(2, "0")
2206
2244
  }),
2207
- /* @__PURE__ */ W(D, {
2245
+ /* @__PURE__ */ G(D, {
2208
2246
  color: e.kind === "unsupported" ? "red" : "blue",
2209
- children: Qe[e.kind]
2247
+ children: Ze[e.kind]
2210
2248
  }),
2211
- /* @__PURE__ */ W("strong", { children: e.assertion?.name ?? e.target?.label ?? e.value }),
2212
- e.sourceEventId && /* @__PURE__ */ G(D, { children: ["源事件 #", e.sourceEventId] }),
2213
- e.supplemented && /* @__PURE__ */ W(D, {
2249
+ /* @__PURE__ */ G("strong", { children: e.assertion?.name ?? e.target?.label ?? e.value }),
2250
+ e.sourceEventId && /* @__PURE__ */ K(D, { children: ["源事件 #", e.sourceEventId] }),
2251
+ e.supplemented && /* @__PURE__ */ G(D, {
2214
2252
  color: "orange",
2215
2253
  children: "人工补充"
2216
2254
  })
2217
2255
  ]
2218
2256
  }),
2219
- e.assertion && /* @__PURE__ */ G("div", {
2220
- className: q.assertionSummary,
2257
+ e.assertion && /* @__PURE__ */ K("div", {
2258
+ className: J.assertionSummary,
2221
2259
  "data-assistant-part": "assertion-summary",
2222
2260
  children: [
2223
- /* @__PURE__ */ W(D, {
2261
+ /* @__PURE__ */ G(D, {
2224
2262
  color: "green",
2225
- children: J.assertionSources[e.assertion.source]
2263
+ children: Y.assertionSources[e.assertion.source]
2226
2264
  }),
2227
- /* @__PURE__ */ G("span", { children: [
2228
- J.assertionOperators[e.assertion.operator],
2265
+ /* @__PURE__ */ K("span", { children: [
2266
+ Y.assertionOperators[e.assertion.operator],
2229
2267
  " ",
2230
2268
  e.assertion.expected === "" ? "空字符串" : e.assertion.expected
2231
2269
  ] }),
2232
- /* @__PURE__ */ G("span", {
2233
- className: q.hint,
2270
+ /* @__PURE__ */ K("span", {
2271
+ className: J.hint,
2234
2272
  "data-assistant-part": "hint",
2235
2273
  children: [
2236
- (0, J.isRequestAssertion)(e.assertion.source) ? "观察" : "最多等待",
2274
+ (0, Y.isRequestAssertion)(e.assertion.source) ? "观察" : "最多等待",
2237
2275
  " ",
2238
2276
  e.assertion.timeout / 1e3,
2239
2277
  " 秒"
2240
2278
  ]
2241
2279
  }),
2242
- e.assertion.selector && /* @__PURE__ */ W("code", { children: e.assertion.selector }),
2243
- e.assertion.method && /* @__PURE__ */ G("code", { children: [
2280
+ e.assertion.selector && /* @__PURE__ */ G("code", { children: e.assertion.selector }),
2281
+ e.assertion.method && /* @__PURE__ */ K("code", { children: [
2244
2282
  e.assertion.method,
2245
2283
  " ",
2246
2284
  e.assertion.pathname
2247
2285
  ] })
2248
2286
  ]
2249
2287
  }),
2250
- e.kind === "unsupported" && /* @__PURE__ */ W(rt, {
2288
+ e.kind === "unsupported" && /* @__PURE__ */ G(nt, {
2251
2289
  step: e,
2252
2290
  disabled: i.recording || n,
2253
2291
  onApply: (e) => s.edit({
@@ -2255,15 +2293,15 @@ function gt({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2255
2293
  steps: i.draft.steps.map((n, r) => r === t ? e : n)
2256
2294
  })
2257
2295
  }, JSON.stringify(e)),
2258
- e.value !== void 0 && e.kind !== "unsupported" && /* @__PURE__ */ W(T, {
2296
+ e.value !== void 0 && e.kind !== "unsupported" && /* @__PURE__ */ G(T, {
2259
2297
  "aria-label": `第 ${t + 1} 步内容`,
2260
2298
  value: e.value,
2261
2299
  maxLength: 2e3,
2262
2300
  disabled: i.recording || n,
2263
2301
  onChange: (e) => g(t, { value: e.target.value })
2264
2302
  }),
2265
- e.kind === "check" && /* @__PURE__ */ W("span", { children: e.checked ? "选中" : "取消选中" }),
2266
- e.target && /* @__PURE__ */ W(ce, {
2303
+ e.kind === "check" && /* @__PURE__ */ G("span", { children: e.checked ? "选中" : "取消选中" }),
2304
+ e.target && /* @__PURE__ */ G(w, {
2267
2305
  ghost: !0,
2268
2306
  size: "small",
2269
2307
  styles: {
@@ -2276,25 +2314,25 @@ function gt({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2276
2314
  },
2277
2315
  items: [{
2278
2316
  key: "details",
2279
- label: /* @__PURE__ */ W(U, { children: "定位信息" }),
2280
- children: /* @__PURE__ */ W(U, { children: /* @__PURE__ */ W("code", { children: e.target.selector }) })
2317
+ label: /* @__PURE__ */ G(W, { children: "定位信息" }),
2318
+ children: /* @__PURE__ */ G(W, { children: /* @__PURE__ */ G("code", { children: e.target.selector }) })
2281
2319
  }]
2282
2320
  }),
2283
- /* @__PURE__ */ G("div", {
2284
- className: [q.buttonRow, q.stepActions].join(" "),
2321
+ /* @__PURE__ */ K("div", {
2322
+ className: [J.buttonRow, J.stepActions].join(" "),
2285
2323
  "data-assistant-part": "button-row step-actions",
2286
2324
  children: [
2287
- /* @__PURE__ */ W(C, {
2325
+ /* @__PURE__ */ G(C, {
2288
2326
  size: "small",
2289
2327
  type: "text",
2290
- icon: /* @__PURE__ */ W(j, {}),
2328
+ icon: /* @__PURE__ */ G(j, {}),
2291
2329
  disabled: i.recording || n || !e.assertion && i.draft.steps.length >= 100,
2292
2330
  onClick: () => f(t + 1, e.assertion ? t : void 0),
2293
2331
  children: e.assertion ? "编辑断言" : "在此步后添加断言"
2294
2332
  }),
2295
- /* @__PURE__ */ G(C, {
2333
+ /* @__PURE__ */ K(C, {
2296
2334
  type: "text",
2297
- icon: /* @__PURE__ */ W(B, {}),
2335
+ icon: /* @__PURE__ */ G(V, {}),
2298
2336
  size: "small",
2299
2337
  disabled: i.recording || n || i.draft.steps.length >= 100,
2300
2338
  onClick: () => {
@@ -2316,9 +2354,9 @@ function gt({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2316
2354
  " 步前插入"
2317
2355
  ]
2318
2356
  }),
2319
- /* @__PURE__ */ G(C, {
2357
+ /* @__PURE__ */ K(C, {
2320
2358
  type: "text",
2321
- icon: /* @__PURE__ */ W(ye, {}),
2359
+ icon: /* @__PURE__ */ G(ye, {}),
2322
2360
  danger: !0,
2323
2361
  size: "small",
2324
2362
  disabled: i.recording || n,
@@ -2338,7 +2376,7 @@ function gt({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2338
2376
  })
2339
2377
  ] }, t))
2340
2378
  }),
2341
- i.draft.timeline && /* @__PURE__ */ W(ce, {
2379
+ i.draft.timeline && /* @__PURE__ */ G(w, {
2342
2380
  ghost: !0,
2343
2381
  size: "small",
2344
2382
  styles: {
@@ -2351,31 +2389,31 @@ function gt({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2351
2389
  },
2352
2390
  items: [{
2353
2391
  key: "details",
2354
- label: /* @__PURE__ */ G(U, { children: [
2392
+ label: /* @__PURE__ */ K(W, { children: [
2355
2393
  "选段原始证据(",
2356
2394
  i.draft.timeline.events.length,
2357
2395
  " 条,只读)"
2358
2396
  ] }),
2359
- children: /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("p", { children: "接口、异常和性能事件不执行;人工补充与移除步骤不会改写这里的来源记录。" }), /* @__PURE__ */ W("pre", {
2360
- className: q.json,
2397
+ children: /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G("p", { children: "接口、异常和性能事件不执行;人工补充与移除步骤不会改写这里的来源记录。" }), /* @__PURE__ */ G("pre", {
2398
+ className: J.json,
2361
2399
  "data-assistant-part": "json",
2362
2400
  children: JSON.stringify(i.draft.timeline, null, 2)
2363
2401
  })] })
2364
2402
  }]
2365
2403
  }),
2366
- /* @__PURE__ */ G("div", {
2404
+ /* @__PURE__ */ K("div", {
2367
2405
  ref: d,
2368
- className: q.assertionArea,
2406
+ className: J.assertionArea,
2369
2407
  "data-assistant-part": "assertion-area",
2370
- children: [/* @__PURE__ */ G("div", {
2371
- className: q.cardHeading,
2408
+ children: [/* @__PURE__ */ K("div", {
2409
+ className: J.cardHeading,
2372
2410
  "data-assistant-part": "card-heading",
2373
- children: [/* @__PURE__ */ G("h3", { children: [/* @__PURE__ */ W(j, {}), " 结果断言"] }), /* @__PURE__ */ G(D, { children: [
2411
+ children: [/* @__PURE__ */ K("h3", { children: [/* @__PURE__ */ G(j, {}), " 结果断言"] }), /* @__PURE__ */ K(D, { children: [
2374
2412
  i.draft.steps.filter((e) => e.kind === "assert" || e.kind === "assert-text").length,
2375
2413
  " ",
2376
2414
  "条"
2377
2415
  ] })]
2378
- }), l ? /* @__PURE__ */ W(tt, {
2416
+ }), l ? /* @__PURE__ */ G(et, {
2379
2417
  initial: l.edit === void 0 ? void 0 : i.draft.steps[l.edit]?.assertion,
2380
2418
  steps: i.draft.steps,
2381
2419
  position: l.position,
@@ -2392,36 +2430,36 @@ function gt({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2392
2430
  kind: "assert",
2393
2431
  assertion: e,
2394
2432
  supplemented: !0
2395
- }, s.edit((0, J.parseCase)({
2433
+ }, s.edit((0, Y.parseCase)({
2396
2434
  ...i.draft,
2397
2435
  steps: n
2398
2436
  })), u(null);
2399
2437
  }
2400
- }, `${l.position}-${l.edit ?? "new"}`) : /* @__PURE__ */ W(C, {
2438
+ }, `${l.position}-${l.edit ?? "new"}`) : /* @__PURE__ */ G(C, {
2401
2439
  type: "text",
2402
- icon: /* @__PURE__ */ W(B, {}),
2440
+ icon: /* @__PURE__ */ G(V, {}),
2403
2441
  disabled: n || i.recording || i.draft.steps.length >= 100,
2404
2442
  onClick: () => f(i.draft.steps.length),
2405
2443
  children: "添加断言"
2406
2444
  })]
2407
2445
  }),
2408
- /* @__PURE__ */ G("div", {
2409
- className: [q.buttonRow, q.cardActions].join(" "),
2446
+ /* @__PURE__ */ K("div", {
2447
+ className: [J.buttonRow, J.cardActions].join(" "),
2410
2448
  "data-assistant-part": "button-row card-actions",
2411
2449
  children: [
2412
- /* @__PURE__ */ W(C, {
2413
- icon: /* @__PURE__ */ W(V, {}),
2450
+ /* @__PURE__ */ G(C, {
2451
+ icon: /* @__PURE__ */ G(H, {}),
2414
2452
  type: "primary",
2415
2453
  disabled: i.recording || n || !i.draft.name.trim() || !i.draft.steps.length,
2416
- onClick: () => void h(() => t((0, J.parseCase)(i.draft))),
2454
+ onClick: () => void h(() => t((0, Y.parseCase)(i.draft))),
2417
2455
  children: "保存用例"
2418
2456
  }),
2419
- /* @__PURE__ */ W(C, {
2457
+ /* @__PURE__ */ G(C, {
2420
2458
  disabled: n || i.recording,
2421
2459
  onClick: o,
2422
2460
  children: "取消"
2423
2461
  }),
2424
- /* @__PURE__ */ W(et, {
2462
+ /* @__PURE__ */ G($e, {
2425
2463
  label: "用例文件操作",
2426
2464
  disabled: n || i.recording,
2427
2465
  items: [{
@@ -2433,12 +2471,12 @@ function gt({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2433
2471
  label: "导出用例 JSON",
2434
2472
  disabled: !i.draft.steps.length,
2435
2473
  onClick: () => void h(() => {
2436
- let e = (0, J.parseCase)(i.draft), t = URL.createObjectURL(new Blob([JSON.stringify(e, null, 2)], { type: "application/json" })), n = document.createElement("a");
2474
+ let e = (0, Y.parseCase)(i.draft), t = URL.createObjectURL(new Blob([JSON.stringify(e, null, 2)], { type: "application/json" })), n = document.createElement("a");
2437
2475
  n.href = t, n.download = "页面录制用例.json", document.body.append(n), n.click(), n.remove(), setTimeout(() => URL.revokeObjectURL(t), 3e4);
2438
2476
  })
2439
2477
  }]
2440
2478
  }),
2441
- /* @__PURE__ */ W("input", {
2479
+ /* @__PURE__ */ G("input", {
2442
2480
  hidden: !0,
2443
2481
  type: "file",
2444
2482
  ref: a,
@@ -2447,7 +2485,7 @@ function gt({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2447
2485
  let t = e.target.files?.[0];
2448
2486
  e.target.value = "", !t || i.recording || n || h(async () => {
2449
2487
  if (t.size > 524288) throw Error("用例不能超过 512 KB");
2450
- (!r || window.confirm("导入会替换当前未保存草稿。继续?")) && (s.loadDraft((0, J.parseCase)(JSON.parse(await t.text()))), u(null));
2488
+ (!r || window.confirm("导入会替换当前未保存草稿。继续?")) && (s.loadDraft((0, Y.parseCase)(JSON.parse(await t.text()))), u(null));
2451
2489
  });
2452
2490
  }
2453
2491
  })
@@ -2460,7 +2498,7 @@ function gt({ close: e, bridgeUrl: t, incomingDraft: n, onConsumeDraft: r }) {
2460
2498
  })]
2461
2499
  });
2462
2500
  }
2463
- var Q = {
2501
+ var gt = {
2464
2502
  json: "_json_62man_1 _json_13kbl_377",
2465
2503
  eventMeta: "_eventMeta_62man_4 _eventMeta_13kbl_629",
2466
2504
  hint: "_hint_62man_7 _hint_13kbl_515",
@@ -2503,7 +2541,7 @@ function yt(e, t, n) {
2503
2541
  if (i.length >= 100) throw Error("操作过多,请缩小选段范围(需为前置步骤预留一个位置)");
2504
2542
  let a = new URL(i[0].page);
2505
2543
  if (!["http:", "https:"].includes(a.protocol) || i.some((e) => new URL(e.page).origin !== a.origin)) throw Error("请选择同一站点内的片段");
2506
- return (0, J.parseCase)({
2544
+ return (0, Y.parseCase)({
2507
2545
  schema: "zhidao-recorded-case",
2508
2546
  version: 1,
2509
2547
  name: `时间线片段 #${t}–#${n}`,
@@ -2533,24 +2571,24 @@ var bt = {
2533
2571
  };
2534
2572
  function xt({ events: e, onDraft: t }) {
2535
2573
  let n = ie(s.subscribe, s.getState), [r, i] = x(null), [a, o] = x(), [c, l] = x(), [u, d] = x("all"), [f, p] = x(""), [m, h] = x(""), g = r ? vt(r, a, c) : [], _ = new Set(g.map((e) => e.id)), ee = r ?? e.filter((e) => (u === "all" || e.kind === u) && (e.title + e.page).includes(f));
2536
- return /* @__PURE__ */ G("div", {
2537
- className: Q.section,
2574
+ return /* @__PURE__ */ K("div", {
2575
+ className: gt.section,
2538
2576
  "data-assistant-part": "section",
2539
2577
  children: [
2540
- /* @__PURE__ */ G("div", {
2541
- className: Q.sectionHeading,
2578
+ /* @__PURE__ */ K("div", {
2579
+ className: gt.sectionHeading,
2542
2580
  "data-assistant-part": "section-heading",
2543
- children: [/* @__PURE__ */ W("span", {
2544
- className: Q.headingIcon,
2581
+ children: [/* @__PURE__ */ G("span", {
2582
+ className: gt.headingIcon,
2545
2583
  "data-assistant-part": "heading-icon",
2546
- children: /* @__PURE__ */ W(Oe, {})
2547
- }), /* @__PURE__ */ W("div", { children: /* @__PURE__ */ W("h3", { children: "操作时间线" }) })]
2584
+ children: /* @__PURE__ */ G(De, {})
2585
+ }), /* @__PURE__ */ G("div", { children: /* @__PURE__ */ G("h3", { children: "操作时间线" }) })]
2548
2586
  }),
2549
- t && /* @__PURE__ */ G("div", {
2550
- className: Q.buttonRow,
2587
+ t && /* @__PURE__ */ K("div", {
2588
+ className: gt.buttonRow,
2551
2589
  "data-assistant-part": "button-row",
2552
- children: [!r && /* @__PURE__ */ W(C, {
2553
- icon: /* @__PURE__ */ W(H, {}),
2590
+ children: [!r && /* @__PURE__ */ G(C, {
2591
+ icon: /* @__PURE__ */ G(U, {}),
2554
2592
  disabled: n.recording || !e.length,
2555
2593
  onClick: () => {
2556
2594
  try {
@@ -2560,14 +2598,14 @@ function xt({ events: e, onDraft: t }) {
2560
2598
  }
2561
2599
  },
2562
2600
  children: "开始选段"
2563
- }), r && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(C, {
2564
- icon: /* @__PURE__ */ W(ve, {}),
2601
+ }), r && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(C, {
2602
+ icon: /* @__PURE__ */ G(ve, {}),
2565
2603
  onClick: () => {
2566
2604
  i(null), o(void 0), l(void 0), h("");
2567
2605
  },
2568
2606
  children: "退出选段"
2569
- }), /* @__PURE__ */ W(C, {
2570
- icon: /* @__PURE__ */ W(we, {}),
2607
+ }), /* @__PURE__ */ G(C, {
2608
+ icon: /* @__PURE__ */ G(we, {}),
2571
2609
  type: "primary",
2572
2610
  disabled: !g.length || n.recording,
2573
2611
  onClick: () => {
@@ -2580,8 +2618,8 @@ function xt({ events: e, onDraft: t }) {
2580
2618
  children: "生成用例草稿"
2581
2619
  })] })]
2582
2620
  }),
2583
- r && /* @__PURE__ */ G("p", {
2584
- className: Q.hint,
2621
+ r && /* @__PURE__ */ K("p", {
2622
+ className: gt.hint,
2585
2623
  "aria-live": "polite",
2586
2624
  children: [
2587
2625
  a ? "#" + a : "选起点",
@@ -2593,14 +2631,14 @@ function xt({ events: e, onDraft: t }) {
2593
2631
  g.length > 0 && " · 输入值与定位需补充"
2594
2632
  ]
2595
2633
  }),
2596
- m && /* @__PURE__ */ W(S, {
2634
+ m && /* @__PURE__ */ G(S, {
2597
2635
  type: "warning",
2598
2636
  title: m
2599
2637
  }),
2600
- !r && /* @__PURE__ */ G("div", {
2601
- className: Q.filters,
2638
+ !r && /* @__PURE__ */ K("div", {
2639
+ className: gt.filters,
2602
2640
  "data-assistant-part": "filters",
2603
- children: [/* @__PURE__ */ W(E, {
2641
+ children: [/* @__PURE__ */ G(E, {
2604
2642
  "aria-label": "事件类型",
2605
2643
  value: u,
2606
2644
  onChange: d,
@@ -2611,8 +2649,8 @@ function xt({ events: e, onDraft: t }) {
2611
2649
  value: e,
2612
2650
  label: t
2613
2651
  }))]
2614
- }), /* @__PURE__ */ W(T, {
2615
- prefix: /* @__PURE__ */ W(Fe, {}),
2652
+ }), /* @__PURE__ */ G(T, {
2653
+ prefix: /* @__PURE__ */ G(Pe, {}),
2616
2654
  "aria-label": "搜索时间线",
2617
2655
  placeholder: "搜索操作或页面",
2618
2656
  value: f,
@@ -2620,35 +2658,35 @@ function xt({ events: e, onDraft: t }) {
2620
2658
  allowClear: !0
2621
2659
  })]
2622
2660
  }),
2623
- !ee.length && /* @__PURE__ */ W(de, { description: e.length ? "没有匹配的事件" : "暂无时间线记录" }),
2624
- /* @__PURE__ */ W("ol", {
2625
- className: Q.timeline,
2661
+ !ee.length && /* @__PURE__ */ G(de, { description: e.length ? "没有匹配的事件" : "暂无时间线记录" }),
2662
+ /* @__PURE__ */ G("ol", {
2663
+ className: gt.timeline,
2626
2664
  "data-assistant-part": "timeline",
2627
- children: ee.slice().sort((e, t) => t.time - e.time || t.id - e.id).map((e) => /* @__PURE__ */ G("li", {
2628
- className: e.kind === "error" ? Q.error : "",
2665
+ children: ee.slice().sort((e, t) => t.time - e.time || t.id - e.id).map((e) => /* @__PURE__ */ K("li", {
2666
+ className: e.kind === "error" ? gt.error : "",
2629
2667
  children: [
2630
- /* @__PURE__ */ G("div", {
2631
- className: Q.eventMeta,
2668
+ /* @__PURE__ */ K("div", {
2669
+ className: gt.eventMeta,
2632
2670
  "data-assistant-part": "event-meta",
2633
2671
  children: [
2634
- /* @__PURE__ */ W(D, {
2672
+ /* @__PURE__ */ G(D, {
2635
2673
  color: e.kind === "error" ? "red" : "blue",
2636
2674
  children: bt[e.kind]
2637
2675
  }),
2638
- /* @__PURE__ */ W("time", { children: new Date(e.time).toLocaleTimeString("zh-CN", { hour12: !1 }) }),
2639
- /* @__PURE__ */ G("small", { children: ["#", e.id] }),
2640
- _.has(e.id) && /* @__PURE__ */ W(D, {
2676
+ /* @__PURE__ */ G("time", { children: new Date(e.time).toLocaleTimeString("zh-CN", { hour12: !1 }) }),
2677
+ /* @__PURE__ */ K("small", { children: ["#", e.id] }),
2678
+ _.has(e.id) && /* @__PURE__ */ G(D, {
2641
2679
  color: "gold",
2642
2680
  children: "已选"
2643
2681
  })
2644
2682
  ]
2645
2683
  }),
2646
- /* @__PURE__ */ W("strong", { children: e.title }),
2647
- r && /* @__PURE__ */ G("div", {
2648
- className: Q.buttonRow,
2684
+ /* @__PURE__ */ G("strong", { children: e.title }),
2685
+ r && /* @__PURE__ */ K("div", {
2686
+ className: gt.buttonRow,
2649
2687
  "data-assistant-part": "button-row",
2650
- children: [/* @__PURE__ */ W(C, {
2651
- icon: /* @__PURE__ */ W(Ee, {}),
2688
+ children: [/* @__PURE__ */ G(C, {
2689
+ icon: /* @__PURE__ */ G(I, {}),
2652
2690
  size: "small",
2653
2691
  "aria-label": `从事件 ${e.id} 开始`,
2654
2692
  "aria-pressed": a === e.id,
@@ -2656,8 +2694,8 @@ function xt({ events: e, onDraft: t }) {
2656
2694
  o(e.id), l(void 0);
2657
2695
  },
2658
2696
  children: "设为起点"
2659
- }), /* @__PURE__ */ W(C, {
2660
- icon: /* @__PURE__ */ W(j, {}),
2697
+ }), /* @__PURE__ */ G(C, {
2698
+ icon: /* @__PURE__ */ G(j, {}),
2661
2699
  size: "small",
2662
2700
  "aria-label": `到事件 ${e.id} 结束`,
2663
2701
  "aria-pressed": c === e.id,
@@ -2666,7 +2704,7 @@ function xt({ events: e, onDraft: t }) {
2666
2704
  children: "设为终点"
2667
2705
  })]
2668
2706
  }),
2669
- /* @__PURE__ */ W(ce, {
2707
+ /* @__PURE__ */ G(w, {
2670
2708
  ghost: !0,
2671
2709
  size: "small",
2672
2710
  styles: {
@@ -2679,9 +2717,9 @@ function xt({ events: e, onDraft: t }) {
2679
2717
  },
2680
2718
  items: [{
2681
2719
  key: "details",
2682
- label: /* @__PURE__ */ G(U, { children: ["详情", e.actionId ? ` · 关联操作 #${e.actionId}` : ""] }),
2683
- children: /* @__PURE__ */ W(U, { children: /* @__PURE__ */ W("pre", {
2684
- className: Q.json,
2720
+ label: /* @__PURE__ */ K(W, { children: ["详情", e.actionId ? ` · 关联操作 #${e.actionId}` : ""] }),
2721
+ children: /* @__PURE__ */ G(W, { children: /* @__PURE__ */ G("pre", {
2722
+ className: gt.json,
2685
2723
  "data-assistant-part": "json",
2686
2724
  children: JSON.stringify({
2687
2725
  page: e.page,
@@ -2699,22 +2737,22 @@ function xt({ events: e, onDraft: t }) {
2699
2737
  var St = { avatar: "_avatar_1modk_1" };
2700
2738
  // src/components/AssistantAvatar/index.tsx
2701
2739
  function Ct({ className: e }) {
2702
- return /* @__PURE__ */ W("span", {
2740
+ return /* @__PURE__ */ G("span", {
2703
2741
  className: [St.avatar, e].filter(Boolean).join(" "),
2704
2742
  "data-assistant-part": "avatar",
2705
2743
  "aria-hidden": "true",
2706
- children: /* @__PURE__ */ G("svg", {
2744
+ children: /* @__PURE__ */ K("svg", {
2707
2745
  viewBox: "0 0 40 40",
2708
2746
  fill: "none",
2709
2747
  focusable: "false",
2710
2748
  children: [
2711
- /* @__PURE__ */ W("path", {
2749
+ /* @__PURE__ */ G("path", {
2712
2750
  d: "M19 5v6M16 5h6",
2713
2751
  stroke: "currentColor",
2714
2752
  strokeWidth: "2.5",
2715
2753
  strokeLinecap: "round"
2716
2754
  }),
2717
- /* @__PURE__ */ W("rect", {
2755
+ /* @__PURE__ */ G("rect", {
2718
2756
  x: "6",
2719
2757
  y: "11",
2720
2758
  width: "28",
@@ -2722,7 +2760,7 @@ function Ct({ className: e }) {
2722
2760
  rx: "11",
2723
2761
  fill: "currentColor"
2724
2762
  }),
2725
- /* @__PURE__ */ W("rect", {
2763
+ /* @__PURE__ */ G("rect", {
2726
2764
  x: "2",
2727
2765
  y: "20",
2728
2766
  width: "2.5",
@@ -2730,7 +2768,7 @@ function Ct({ className: e }) {
2730
2768
  rx: "1.25",
2731
2769
  fill: "currentColor"
2732
2770
  }),
2733
- /* @__PURE__ */ W("rect", {
2771
+ /* @__PURE__ */ G("rect", {
2734
2772
  x: "35.5",
2735
2773
  y: "20",
2736
2774
  width: "2.5",
@@ -2738,7 +2776,7 @@ function Ct({ className: e }) {
2738
2776
  rx: "1.25",
2739
2777
  fill: "currentColor"
2740
2778
  }),
2741
- /* @__PURE__ */ W("rect", {
2779
+ /* @__PURE__ */ G("rect", {
2742
2780
  x: "11",
2743
2781
  y: "17",
2744
2782
  width: "18",
@@ -2746,7 +2784,7 @@ function Ct({ className: e }) {
2746
2784
  rx: "6",
2747
2785
  fill: "#244b40"
2748
2786
  }),
2749
- /* @__PURE__ */ W("rect", {
2787
+ /* @__PURE__ */ G("rect", {
2750
2788
  x: "15",
2751
2789
  y: "21",
2752
2790
  width: "3",
@@ -2754,7 +2792,7 @@ function Ct({ className: e }) {
2754
2792
  rx: "1.5",
2755
2793
  fill: "currentColor"
2756
2794
  }),
2757
- /* @__PURE__ */ W("rect", {
2795
+ /* @__PURE__ */ G("rect", {
2758
2796
  x: "22",
2759
2797
  y: "21",
2760
2798
  width: "3",
@@ -2762,7 +2800,7 @@ function Ct({ className: e }) {
2762
2800
  rx: "1.5",
2763
2801
  fill: "currentColor"
2764
2802
  }),
2765
- /* @__PURE__ */ W("path", {
2803
+ /* @__PURE__ */ G("path", {
2766
2804
  d: "m32 3 1.3 3.7L37 8l-3.7 1.3L32 13l-1.3-3.7L27 8l3.7-1.3Z",
2767
2805
  fill: "#ffe2ac"
2768
2806
  })
@@ -2787,7 +2825,7 @@ function Tt(e, t) {
2787
2825
  if (!n || !t) return;
2788
2826
  let r = /* @__PURE__ */ new Map(), i = 0, a = () => {
2789
2827
  for (let [e, t] of r) n.contains(e) || (t.destroy(), r.delete(e));
2790
- for (let e of n.querySelectorAll("[data-assistant-part~=\"body\"],[data-assistant-part~=\"json\"],.ant-tabs-content-holder,.ant-tabs-body-holder")) r.has(e) || r.set(e, Be({
2828
+ for (let e of n.querySelectorAll("[data-assistant-part~=\"body\"],[data-assistant-part~=\"json\"],.ant-tabs-content-holder,.ant-tabs-body-holder")) r.has(e) || r.set(e, ze({
2791
2829
  target: e,
2792
2830
  elements: { viewport: e }
2793
2831
  }, {
@@ -2860,7 +2898,7 @@ var Et = 12, Dt = (e) => {
2860
2898
  }, h = () => {
2861
2899
  f.current = null, u(!1);
2862
2900
  };
2863
- return /* @__PURE__ */ G("section", {
2901
+ return /* @__PURE__ */ K("section", {
2864
2902
  ref: d,
2865
2903
  id: "research-assistant-window",
2866
2904
  role: "dialog",
@@ -2887,10 +2925,10 @@ var Et = 12, Dt = (e) => {
2887
2925
  e.key === "Escape" && e.target === e.currentTarget && n();
2888
2926
  },
2889
2927
  children: [
2890
- /* @__PURE__ */ G("header", {
2928
+ /* @__PURE__ */ K("header", {
2891
2929
  className: wt.header,
2892
2930
  "data-assistant-part": "header",
2893
- children: [/* @__PURE__ */ G("div", {
2931
+ children: [/* @__PURE__ */ K("div", {
2894
2932
  className: wt.drag,
2895
2933
  "data-assistant-part": "drag",
2896
2934
  tabIndex: 0,
@@ -2917,30 +2955,30 @@ var Et = 12, Dt = (e) => {
2917
2955
  y: n.y + (e.key === "ArrowUp" ? -t : e.key === "ArrowDown" ? t : 0)
2918
2956
  }));
2919
2957
  },
2920
- children: [/* @__PURE__ */ W(Ct, {}), /* @__PURE__ */ W("div", { children: /* @__PURE__ */ G("h2", {
2958
+ children: [/* @__PURE__ */ G(Ct, {}), /* @__PURE__ */ G("div", { children: /* @__PURE__ */ K("h2", {
2921
2959
  id: "research-assistant-title",
2922
- children: ["研发小蜜 ", /* @__PURE__ */ W("span", { children: i ? "开发助手" : "问题反馈" })]
2960
+ children: ["研发小蜜 ", /* @__PURE__ */ G("span", { children: i ? "开发助手" : "问题反馈" })]
2923
2961
  }) })]
2924
- }), /* @__PURE__ */ G("div", {
2962
+ }), /* @__PURE__ */ K("div", {
2925
2963
  className: wt.windowActions,
2926
2964
  "data-assistant-part": "window-actions",
2927
- children: [/* @__PURE__ */ W(C, {
2965
+ children: [/* @__PURE__ */ G(C, {
2928
2966
  type: "text",
2929
2967
  "aria-label": s ? "还原小窗" : "放大分析",
2930
2968
  title: s ? "还原小窗" : "放大分析",
2931
2969
  onClick: () => c((e) => !e),
2932
- children: W(s ? I : L, {})
2933
- }), /* @__PURE__ */ W(C, {
2970
+ children: G(s ? L : R, {})
2971
+ }), /* @__PURE__ */ G(C, {
2934
2972
  type: "text",
2935
2973
  "aria-label": "最小化研发小蜜",
2936
2974
  title: "最小化",
2937
2975
  onClick: n,
2938
- children: /* @__PURE__ */ W(z, {})
2976
+ children: /* @__PURE__ */ G(B, {})
2939
2977
  })]
2940
2978
  })]
2941
2979
  }),
2942
2980
  r,
2943
- !s && /* @__PURE__ */ W("div", {
2981
+ !s && /* @__PURE__ */ G("div", {
2944
2982
  className: wt.resize,
2945
2983
  "data-assistant-part": "resize",
2946
2984
  role: "group",
@@ -2982,28 +3020,28 @@ var Et = 12, Dt = (e) => {
2982
3020
  // src/pages/assistant/components/PerformancePanel/index.tsx
2983
3021
  function kt({ metrics: e, data: t, now: n, paused: r, offline: i }) {
2984
3022
  let a = f(e, t, n), s = t.heapSamples, c = s.at(-1), l = Math.min(...s.map((e) => e.used)), u = Math.max(...s.map((e) => e.used)), d = s[0]?.time ?? n, p = s.map((e) => `${4 + (e.time - d) / Math.max(1, (c?.time ?? n) - d) * 592},${76 - (e.used - l) / Math.max(1048576, u - l) * 60}`).join(" ");
2985
- return /* @__PURE__ */ G("div", {
3023
+ return /* @__PURE__ */ K("div", {
2986
3024
  className: $.section,
2987
3025
  "data-assistant-part": "section",
2988
3026
  children: [
2989
- /* @__PURE__ */ G("div", {
3027
+ /* @__PURE__ */ K("div", {
2990
3028
  className: $.sectionHeading,
2991
3029
  "data-assistant-part": "section-heading",
2992
3030
  children: [
2993
- /* @__PURE__ */ W("span", {
3031
+ /* @__PURE__ */ G("span", {
2994
3032
  className: $.headingIcon,
2995
3033
  "data-assistant-part": "heading-icon",
2996
- children: /* @__PURE__ */ W(N, {})
3034
+ children: /* @__PURE__ */ G(N, {})
2997
3035
  }),
2998
- /* @__PURE__ */ W("div", { children: /* @__PURE__ */ W("h3", { children: "性能诊断" }) }),
2999
- /* @__PURE__ */ W(D, { children: i ? "快照分析" : r ? "采集已暂停" : "自动监测中" }),
3000
- !a.length && /* @__PURE__ */ W(D, { children: "未触发告警" })
3036
+ /* @__PURE__ */ G("div", { children: /* @__PURE__ */ G("h3", { children: "性能诊断" }) }),
3037
+ /* @__PURE__ */ G(D, { children: i ? "快照分析" : r ? "采集已暂停" : "自动监测中" }),
3038
+ !a.length && /* @__PURE__ */ G(D, { children: "未触发告警" })
3001
3039
  ]
3002
3040
  }),
3003
- /* @__PURE__ */ W("div", {
3041
+ /* @__PURE__ */ G("div", {
3004
3042
  className: $.issueList,
3005
3043
  "data-assistant-part": "issue-list",
3006
- children: a.map((e) => /* @__PURE__ */ G(se, {
3044
+ children: a.map((e) => /* @__PURE__ */ K(se, {
3007
3045
  className: [$.card, $.performanceIssue].join(" "),
3008
3046
  "data-assistant-part": "card performance-issue",
3009
3047
  styles: { body: {
@@ -3013,16 +3051,16 @@ function kt({ metrics: e, data: t, now: n, paused: r, offline: i }) {
3013
3051
  gap: 16
3014
3052
  } },
3015
3053
  children: [
3016
- /* @__PURE__ */ W("div", {
3054
+ /* @__PURE__ */ G("div", {
3017
3055
  className: $.cardHeading,
3018
3056
  "data-assistant-part": "card-heading",
3019
- children: /* @__PURE__ */ G("h3", { children: [/* @__PURE__ */ W(D, {
3057
+ children: /* @__PURE__ */ K("h3", { children: [/* @__PURE__ */ G(D, {
3020
3058
  color: e.severity === "error" ? "red" : "orange",
3021
3059
  children: e.severity === "error" ? "较高风险" : "需关注"
3022
3060
  }), e.title] })
3023
3061
  }),
3024
- /* @__PURE__ */ W("p", { children: e.evidence }),
3025
- /* @__PURE__ */ W(ce, {
3062
+ /* @__PURE__ */ G("p", { children: e.evidence }),
3063
+ /* @__PURE__ */ G(w, {
3026
3064
  ghost: !0,
3027
3065
  size: "small",
3028
3066
  styles: {
@@ -3035,19 +3073,19 @@ function kt({ metrics: e, data: t, now: n, paused: r, offline: i }) {
3035
3073
  },
3036
3074
  items: [{
3037
3075
  key: "details",
3038
- label: /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(A, {}), " 排查建议与触发依据"] }),
3039
- children: /* @__PURE__ */ G(U, { children: [
3040
- /* @__PURE__ */ W("ol", { children: e.suggestions.map((e) => /* @__PURE__ */ W("li", { children: e }, e)) }),
3041
- /* @__PURE__ */ W("p", {
3076
+ label: /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(A, {}), " 排查建议与触发依据"] }),
3077
+ children: /* @__PURE__ */ K(W, { children: [
3078
+ /* @__PURE__ */ G("ol", { children: e.suggestions.map((e) => /* @__PURE__ */ G("li", { children: e }, e)) }),
3079
+ /* @__PURE__ */ G("p", {
3042
3080
  className: $.hint,
3043
3081
  "data-assistant-part": "hint",
3044
3082
  children: e.rule
3045
3083
  }),
3046
- /* @__PURE__ */ G("a", {
3084
+ /* @__PURE__ */ K("a", {
3047
3085
  href: e.url,
3048
3086
  target: "_blank",
3049
3087
  rel: "noreferrer",
3050
- children: [/* @__PURE__ */ W(Ae, {}), " 查看官方排查文档"]
3088
+ children: [/* @__PURE__ */ G(ke, {}), " 查看官方排查文档"]
3051
3089
  })
3052
3090
  ] })
3053
3091
  }]
@@ -3055,7 +3093,7 @@ function kt({ metrics: e, data: t, now: n, paused: r, offline: i }) {
3055
3093
  ]
3056
3094
  }, e.id))
3057
3095
  }),
3058
- /* @__PURE__ */ G(se, {
3096
+ /* @__PURE__ */ K(se, {
3059
3097
  className: $.card,
3060
3098
  "data-assistant-part": "card",
3061
3099
  styles: { body: {
@@ -3064,51 +3102,51 @@ function kt({ metrics: e, data: t, now: n, paused: r, offline: i }) {
3064
3102
  flexDirection: "column",
3065
3103
  gap: 16
3066
3104
  } },
3067
- children: [/* @__PURE__ */ G("div", {
3105
+ children: [/* @__PURE__ */ K("div", {
3068
3106
  className: $.cardHeading,
3069
3107
  "data-assistant-part": "card-heading",
3070
- children: [/* @__PURE__ */ W("h3", { children: "JS 堆内存趋势" }), /* @__PURE__ */ W("span", { children: c ? o(c.used) : "暂无采样" })]
3071
- }), s.length > 1 ? /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ G("svg", {
3108
+ children: [/* @__PURE__ */ G("h3", { children: "JS 堆内存趋势" }), /* @__PURE__ */ G("span", { children: c ? o(c.used) : "暂无采样" })]
3109
+ }), s.length > 1 ? /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ K("svg", {
3072
3110
  className: $.memoryChart,
3073
3111
  "data-assistant-part": "memory-chart",
3074
3112
  viewBox: "0 0 600 90",
3075
3113
  role: "img",
3076
3114
  "aria-label": `内存趋势,最低 ${o(l)},最高 ${o(u)},当前 ${o(c.used)}`,
3077
- children: [/* @__PURE__ */ W("path", {
3115
+ children: [/* @__PURE__ */ G("path", {
3078
3116
  d: "M4 76 H596",
3079
3117
  stroke: "currentColor",
3080
3118
  opacity: ".2"
3081
- }), /* @__PURE__ */ W("polyline", {
3119
+ }), /* @__PURE__ */ G("polyline", {
3082
3120
  points: p,
3083
3121
  fill: "none",
3084
3122
  stroke: "currentColor",
3085
3123
  strokeWidth: "2",
3086
3124
  vectorEffect: "non-scaling-stroke"
3087
3125
  })]
3088
- }), /* @__PURE__ */ G("div", {
3126
+ }), /* @__PURE__ */ K("div", {
3089
3127
  className: $.cardHeading,
3090
3128
  "data-assistant-part": "card-heading",
3091
- children: [/* @__PURE__ */ G("span", { children: [
3129
+ children: [/* @__PURE__ */ K("span", { children: [
3092
3130
  new Date(d).toLocaleTimeString(),
3093
3131
  " · ",
3094
3132
  o(l)
3095
- ] }), /* @__PURE__ */ G("span", { children: [
3133
+ ] }), /* @__PURE__ */ K("span", { children: [
3096
3134
  new Date(c.time).toLocaleTimeString(),
3097
3135
  " · 峰值 ",
3098
3136
  o(u)
3099
3137
  ] })]
3100
- })] }) : /* @__PURE__ */ W("p", {
3138
+ })] }) : /* @__PURE__ */ G("p", {
3101
3139
  className: $.hint,
3102
3140
  "data-assistant-part": "hint",
3103
3141
  children: c ? "正在积累连续采样,持续增长风险至少需要观察 60 秒。" : "暂无连续采样,可能因浏览器不支持、采集暂停或快照过旧。"
3104
3142
  })]
3105
3143
  }),
3106
- /* @__PURE__ */ G("h3", {
3144
+ /* @__PURE__ */ K("h3", {
3107
3145
  className: $.subheading,
3108
3146
  "data-assistant-part": "subheading",
3109
- children: [/* @__PURE__ */ W(N, {}), " 页面指标"]
3147
+ children: [/* @__PURE__ */ G(N, {}), " 页面指标"]
3110
3148
  }),
3111
- /* @__PURE__ */ W("div", {
3149
+ /* @__PURE__ */ G("div", {
3112
3150
  className: $.metrics,
3113
3151
  "data-assistant-part": "metrics",
3114
3152
  children: [
@@ -3120,18 +3158,18 @@ function kt({ metrics: e, data: t, now: n, paused: r, offline: i }) {
3120
3158
  ["load", "页面加载"],
3121
3159
  ["longTasks", "长任务次数"],
3122
3160
  ["longTaskDuration", "长任务总耗时"]
3123
- ].map(([t, n]) => /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ G("span", { children: [
3161
+ ].map(([t, n]) => /* @__PURE__ */ K("div", { children: [/* @__PURE__ */ K("span", { children: [
3124
3162
  n,
3125
3163
  " · ",
3126
3164
  t
3127
- ] }), /* @__PURE__ */ W("strong", { children: e[t] == null ? "不可用" : t === "CLS" ? e[t].toFixed(4) : `${Math.round(e[t])}${t === "longTasks" ? " 次" : " ms"}` })] }, t))
3165
+ ] }), /* @__PURE__ */ G("strong", { children: e[t] == null ? "不可用" : t === "CLS" ? e[t].toFixed(4) : `${Math.round(e[t])}${t === "longTasks" ? " 次" : " ms"}` })] }, t))
3128
3166
  }),
3129
- /* @__PURE__ */ G("details", {
3167
+ /* @__PURE__ */ K("details", {
3130
3168
  className: $.hint,
3131
3169
  children: [
3132
- /* @__PURE__ */ W("summary", { children: "采集范围" }),
3133
- /* @__PURE__ */ G("p", { children: [i ? "仅分析快照数据,旧快照可能没有连续采样。" : "前台每 5 秒采样,最多保留 15 分钟。", "堆内存为估算值,请用 DevTools 堆快照确认泄漏。"] }),
3134
- /* @__PURE__ */ W("p", { children: "LCP / CLS 按文档统计,业务路由切换不重置。尚未采集完整 INP。" })
3170
+ /* @__PURE__ */ G("summary", { children: "采集范围" }),
3171
+ /* @__PURE__ */ K("p", { children: [i ? "仅分析快照数据,旧快照可能没有连续采样。" : "前台每 5 秒采样,最多保留 15 分钟。", "堆内存为估算值,请用 DevTools 堆快照确认泄漏。"] }),
3172
+ /* @__PURE__ */ G("p", { children: "LCP / CLS 按文档统计,业务路由切换不重置。尚未采集完整 INP。" })
3135
3173
  ]
3136
3174
  })
3137
3175
  ]
@@ -3139,8 +3177,8 @@ function kt({ metrics: e, data: t, now: n, paused: r, offline: i }) {
3139
3177
  }
3140
3178
  // src/pages/assistant/index.tsx
3141
3179
  function At({ value: e }) {
3142
- return /* @__PURE__ */ W("pre", {
3143
- className: K.json,
3180
+ return /* @__PURE__ */ G("pre", {
3181
+ className: q.json,
3144
3182
  "data-assistant-part": "json",
3145
3183
  children: JSON.stringify(e, null, 2)
3146
3184
  });
@@ -3149,83 +3187,83 @@ var jt = (e) => new Date(e).toLocaleTimeString("zh-CN", { hour12: !1 });
3149
3187
  function Mt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly: i = !1 } = {}) {
3150
3188
  let a = ie(m.subscribe, m.getState), o = ie(s.subscribe, s.getState), [u, p] = x(!1), [h, _] = x(i ? "diagnostics" : "feedback"), [ee, b] = x("timeline"), [te, ne] = x(), ae = re(null), se = () => {
3151
3189
  p(!1), requestAnimationFrame(() => ae.current?.focus({ preventScroll: !0 }));
3152
- }, [w, le] = x(""), [ue, fe] = x(""), [E, O] = x(null), [A, j] = x("live"), [_e, M] = x(c), [F, we] = x(!1), [Te, Ee] = x(!1), I = v(() => {
3153
- Ee(!1), p(!0), M(c());
3190
+ }, [ce, le] = x(""), [ue, fe] = x(""), [E, O] = x(null), [A, j] = x("live"), [_e, M] = x(c), [F, we] = x(!1), [Te, I] = x(!1), L = v(() => {
3191
+ I(!1), p(!0), M(c());
3154
3192
  }, []);
3155
- Ze(ae, I, v((e) => {
3156
- we(e), e && Ee(!1);
3193
+ Xe(ae, L, v((e) => {
3194
+ we(e), e && I(!1);
3157
3195
  }, []));
3158
- let L = v(() => {
3196
+ let R = v(() => {
3159
3197
  m.clear(), i && s.clear(), j("live"), O(null), fe("内存记录已清空");
3160
3198
  }, [i]);
3161
3199
  y(() => {
3162
- if (i) return window.addEventListener("gz-research-assistant:clear-data", L), () => window.removeEventListener("gz-research-assistant:clear-data", L);
3163
- }, [i, L]), y(() => {
3200
+ if (i) return window.addEventListener("gz-research-assistant:clear-data", R), () => window.removeEventListener("gz-research-assistant:clear-data", R);
3201
+ }, [i, R]), y(() => {
3164
3202
  if (!u) return;
3165
3203
  let e = setInterval(() => M(c()), 2e3);
3166
3204
  return () => clearInterval(e);
3167
3205
  }, [u]);
3168
- let R = A === "imported" ? E : A === "frozen" ? a.frozen : null, Ae = R?.events ?? a.events, z = R?.requests ?? a.requests, B = R?.metrics ?? a.metrics, V = R?.environment ?? _e, H = R ?? a.frozen, Fe = /* @__PURE__ */ G("div", {
3169
- className: K.section,
3206
+ let z = A === "imported" ? E : A === "frozen" ? a.frozen : null, ke = z?.events ?? a.events, B = z?.requests ?? a.requests, V = z?.metrics ?? a.metrics, H = z?.environment ?? _e, U = z ?? a.frozen, Pe = /* @__PURE__ */ K("div", {
3207
+ className: q.section,
3170
3208
  "data-assistant-part": "section",
3171
3209
  children: [
3172
- /* @__PURE__ */ G("div", {
3173
- className: K.stats,
3210
+ /* @__PURE__ */ K("div", {
3211
+ className: q.stats,
3174
3212
  "data-assistant-part": "stats",
3175
3213
  children: [
3176
- /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ G("strong", { children: [Ae.length, /* @__PURE__ */ W("small", { children: "条" })] }), /* @__PURE__ */ G("span", {
3177
- className: K.statLabel,
3214
+ /* @__PURE__ */ K("div", { children: [/* @__PURE__ */ K("strong", { children: [ke.length, /* @__PURE__ */ G("small", { children: "条" })] }), /* @__PURE__ */ K("span", {
3215
+ className: q.statLabel,
3178
3216
  "data-assistant-part": "stat-label",
3179
- children: [/* @__PURE__ */ W(Oe, {}), "操作与事件"]
3217
+ children: [/* @__PURE__ */ G(De, {}), "操作与事件"]
3180
3218
  })] }),
3181
- /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ G("strong", { children: [z.length, /* @__PURE__ */ W("small", { children: "条" })] }), /* @__PURE__ */ G("span", {
3182
- className: K.statLabel,
3219
+ /* @__PURE__ */ K("div", { children: [/* @__PURE__ */ K("strong", { children: [B.length, /* @__PURE__ */ G("small", { children: "条" })] }), /* @__PURE__ */ K("span", {
3220
+ className: q.statLabel,
3183
3221
  "data-assistant-part": "stat-label",
3184
- children: [/* @__PURE__ */ W(k, {}), "接口记录"]
3222
+ children: [/* @__PURE__ */ G(k, {}), "接口记录"]
3185
3223
  })] }),
3186
- /* @__PURE__ */ G("div", {
3187
- className: z.some((e) => e.failed) ? K.hasErrors : "",
3188
- children: [/* @__PURE__ */ G("strong", { children: [z.filter((e) => e.failed).length, /* @__PURE__ */ W("small", { children: "条" })] }), /* @__PURE__ */ G("span", {
3189
- className: K.statLabel,
3224
+ /* @__PURE__ */ K("div", {
3225
+ className: B.some((e) => e.failed) ? q.hasErrors : "",
3226
+ children: [/* @__PURE__ */ K("strong", { children: [B.filter((e) => e.failed).length, /* @__PURE__ */ G("small", { children: "条" })] }), /* @__PURE__ */ K("span", {
3227
+ className: q.statLabel,
3190
3228
  "data-assistant-part": "stat-label",
3191
- children: [/* @__PURE__ */ W(ze, {}), "失败接口"]
3229
+ children: [/* @__PURE__ */ G(Re, {}), "失败接口"]
3192
3230
  })]
3193
3231
  })
3194
3232
  ]
3195
3233
  }),
3196
- /* @__PURE__ */ G("div", {
3197
- className: [K.buttonRow, K.actions].join(" "),
3234
+ /* @__PURE__ */ K("div", {
3235
+ className: [q.buttonRow, q.actions].join(" "),
3198
3236
  "data-assistant-part": "button-row actions",
3199
- children: [/* @__PURE__ */ W(C, {
3237
+ children: [/* @__PURE__ */ G(C, {
3200
3238
  type: "primary",
3201
- icon: /* @__PURE__ */ W(ge, {}),
3239
+ icon: /* @__PURE__ */ G(ge, {}),
3202
3240
  onClick: () => {
3203
3241
  g("用户手动截取现场"), j("frozen"), fe("已冻结现场。后续操作不会改变这份快照。");
3204
3242
  },
3205
3243
  children: "截取当前现场"
3206
- }), /* @__PURE__ */ W(C, {
3207
- icon: /* @__PURE__ */ W(xe, {}),
3244
+ }), /* @__PURE__ */ G(C, {
3245
+ icon: /* @__PURE__ */ G(xe, {}),
3208
3246
  onClick: () => {
3209
- let e = H ?? n();
3210
- t(e, w), fe(`已导出 ${jt(e.capturedAt)} 的快照,请将 JSON 文件发送给研发人员。`);
3247
+ let e = U ?? n();
3248
+ t(e, ce), fe(`已导出 ${jt(e.capturedAt)} 的快照,请将 JSON 文件发送给研发人员。`);
3211
3249
  },
3212
3250
  children: "导出快照 JSON"
3213
3251
  })]
3214
3252
  }),
3215
- /* @__PURE__ */ G("p", {
3216
- className: K.hint,
3253
+ /* @__PURE__ */ K("p", {
3254
+ className: q.hint,
3217
3255
  "data-assistant-part": "hint",
3218
- children: [H ? `导出:${H.reason} · ${jt(H.capturedAt)}` : "导出:当前现场", " · 现场仅存于内存,刷新或关闭前请导出"]
3256
+ children: [U ? `导出:${U.reason} · ${jt(U.capturedAt)}` : "导出:当前现场", " · 现场仅存于内存,刷新或关闭前请导出"]
3219
3257
  }),
3220
- /* @__PURE__ */ G("div", {
3221
- className: K.field,
3258
+ /* @__PURE__ */ K("div", {
3259
+ className: q.field,
3222
3260
  "data-assistant-part": "field",
3223
- children: [/* @__PURE__ */ G("label", {
3261
+ children: [/* @__PURE__ */ K("label", {
3224
3262
  htmlFor: "research-feedback",
3225
- children: [/* @__PURE__ */ W(P, {}), "问题描述"]
3226
- }), /* @__PURE__ */ W(T.TextArea, {
3263
+ children: [/* @__PURE__ */ G(P, {}), "问题描述"]
3264
+ }), /* @__PURE__ */ G(T.TextArea, {
3227
3265
  id: "research-feedback",
3228
- value: w,
3266
+ value: ce,
3229
3267
  onChange: (e) => le(e.target.value),
3230
3268
  maxLength: 1e3,
3231
3269
  showCount: !0,
@@ -3233,7 +3271,7 @@ function Mt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3233
3271
  placeholder: "例如:保存表单时报错"
3234
3272
  })]
3235
3273
  }),
3236
- /* @__PURE__ */ W(ce, {
3274
+ /* @__PURE__ */ G(w, {
3237
3275
  ghost: !0,
3238
3276
  size: "small",
3239
3277
  styles: {
@@ -3246,40 +3284,40 @@ function Mt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3246
3284
  },
3247
3285
  items: [{
3248
3286
  key: "details",
3249
- label: /* @__PURE__ */ W(U, { children: "快照包含哪些内容" }),
3250
- children: /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("p", { children: "最近 15 分钟内最多 300 条事件、60 条接口记录,页面地址与布局信息、浏览器环境、性能指标及已脱敏的 JSON 正文。页面状态快照不包含屏幕截图或输入框值。" }), /* @__PURE__ */ W("p", { children: "数据只在当前页面内存中保存,不自动上传。字段脱敏无法识别所有业务敏感内容,分享前可先查看导出的 JSON。" })] })
3287
+ label: /* @__PURE__ */ G(W, { children: "快照包含哪些内容" }),
3288
+ children: /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G("p", { children: "最近 15 分钟内最多 300 条事件、60 条接口记录,页面地址与布局信息、浏览器环境、性能指标及已脱敏的 JSON 正文。页面状态快照不包含屏幕截图或输入框值。" }), /* @__PURE__ */ G("p", { children: "数据只在当前页面内存中保存,不自动上传。字段脱敏无法识别所有业务敏感内容,分享前可先查看导出的 JSON。" })] })
3251
3289
  }]
3252
3290
  })
3253
3291
  ]
3254
- }), Ie = /* @__PURE__ */ W(xt, {
3255
- events: Ae,
3292
+ }), Fe = /* @__PURE__ */ G(xt, {
3293
+ events: ke,
3256
3294
  onDraft: i ? void 0 : (e) => {
3257
3295
  ne(e), _("automation");
3258
3296
  }
3259
- }, 0 + A + (R?.capturedAt ?? "live")), Re = /* @__PURE__ */ G("div", {
3260
- className: K.section,
3297
+ }, 0 + A + (z?.capturedAt ?? "live")), Le = /* @__PURE__ */ K("div", {
3298
+ className: q.section,
3261
3299
  "data-assistant-part": "section",
3262
3300
  children: [
3263
- /* @__PURE__ */ G("div", {
3264
- className: K.sectionHeading,
3301
+ /* @__PURE__ */ K("div", {
3302
+ className: q.sectionHeading,
3265
3303
  "data-assistant-part": "section-heading",
3266
3304
  children: [
3267
- /* @__PURE__ */ W("span", {
3268
- className: K.headingIcon,
3305
+ /* @__PURE__ */ G("span", {
3306
+ className: q.headingIcon,
3269
3307
  "data-assistant-part": "heading-icon",
3270
- children: /* @__PURE__ */ W(k, {})
3308
+ children: /* @__PURE__ */ G(k, {})
3271
3309
  }),
3272
- /* @__PURE__ */ W("div", { children: /* @__PURE__ */ W("h3", { children: "接口记录" }) }),
3273
- /* @__PURE__ */ G(D, { children: [z.length, " 条"] })
3310
+ /* @__PURE__ */ G("div", { children: /* @__PURE__ */ G("h3", { children: "接口记录" }) }),
3311
+ /* @__PURE__ */ K(D, { children: [B.length, " 条"] })
3274
3312
  ]
3275
3313
  }),
3276
- /* @__PURE__ */ G("details", {
3277
- className: K.hint,
3278
- children: [/* @__PURE__ */ W("summary", { children: "采集范围" }), "Fetch / XHR 正文最多读取 16 KB,认证接口不采集正文。 耗时截至 Fetch 响应头到达或 XHR 请求结束。"]
3314
+ /* @__PURE__ */ K("details", {
3315
+ className: q.hint,
3316
+ children: [/* @__PURE__ */ G("summary", { children: "采集范围" }), "Fetch / XHR 正文最多读取 16 KB,认证接口不采集正文。 耗时截至 Fetch 响应头到达或 XHR 请求结束。"]
3279
3317
  }),
3280
- !z.length && /* @__PURE__ */ W(de, { description: "暂无接口记录" }),
3281
- z.slice().sort((e, t) => e.time - t.time).map((e) => /* @__PURE__ */ W(ce, {
3282
- className: K.request,
3318
+ !B.length && /* @__PURE__ */ G(de, { description: "暂无接口记录" }),
3319
+ B.slice().sort((e, t) => e.time - t.time).map((e) => /* @__PURE__ */ G(w, {
3320
+ className: q.request,
3283
3321
  "data-assistant-part": "request",
3284
3322
  ghost: !0,
3285
3323
  size: "small",
@@ -3293,173 +3331,173 @@ function Mt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3293
3331
  },
3294
3332
  items: [{
3295
3333
  key: "details",
3296
- label: /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ G("span", {
3297
- className: K.requestMeta,
3334
+ label: /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ K("span", {
3335
+ className: q.requestMeta,
3298
3336
  "data-assistant-part": "request-meta",
3299
3337
  children: [
3300
- /* @__PURE__ */ W(D, {
3338
+ /* @__PURE__ */ G(D, {
3301
3339
  color: e.failed ? "red" : "green",
3302
3340
  children: e.status || "失败"
3303
3341
  }),
3304
- /* @__PURE__ */ W("b", { children: e.method }),
3342
+ /* @__PURE__ */ G("b", { children: e.method }),
3305
3343
  " ",
3306
- /* @__PURE__ */ G("span", { children: [
3307
- /* @__PURE__ */ W(Ce, {}),
3344
+ /* @__PURE__ */ K("span", { children: [
3345
+ /* @__PURE__ */ G(Ce, {}),
3308
3346
  Math.round(e.duration),
3309
3347
  " ms"
3310
3348
  ] })
3311
3349
  ]
3312
- }), /* @__PURE__ */ W("span", {
3313
- className: K.requestUrl,
3350
+ }), /* @__PURE__ */ G("span", {
3351
+ className: q.requestUrl,
3314
3352
  "data-assistant-part": "request-url",
3315
3353
  children: e.url
3316
3354
  })] }),
3317
- children: /* @__PURE__ */ W(U, { children: /* @__PURE__ */ W(At, { value: e }) })
3355
+ children: /* @__PURE__ */ G(W, { children: /* @__PURE__ */ G(At, { value: e }) })
3318
3356
  }]
3319
3357
  }, e.id))
3320
3358
  ]
3321
- }), Be = R ? R.performance ?? l() : a.performance, Ve = R ? Date.parse(R.capturedAt) : a.performanceUpdatedAt, He = f(B, Be, Ve), Ue = f(a.metrics, a.performance, a.performanceUpdatedAt).length, We = /* @__PURE__ */ W(kt, {
3322
- metrics: B,
3323
- data: Be,
3324
- now: Ve,
3359
+ }), ze = z ? z.performance ?? l() : a.performance, Be = z ? Date.parse(z.capturedAt) : a.performanceUpdatedAt, Ve = f(V, ze, Be), He = f(a.metrics, a.performance, a.performanceUpdatedAt).length, Ue = /* @__PURE__ */ G(kt, {
3360
+ metrics: V,
3361
+ data: ze,
3362
+ now: Be,
3325
3363
  paused: a.paused,
3326
- offline: !!R
3327
- }), Ge = /* @__PURE__ */ G("div", {
3328
- className: K.section,
3364
+ offline: !!z
3365
+ }), We = /* @__PURE__ */ K("div", {
3366
+ className: q.section,
3329
3367
  "data-assistant-part": "section",
3330
3368
  children: [
3331
- /* @__PURE__ */ G("div", {
3332
- className: K.sectionHeading,
3369
+ /* @__PURE__ */ K("div", {
3370
+ className: q.sectionHeading,
3333
3371
  "data-assistant-part": "section-heading",
3334
- children: [/* @__PURE__ */ W("span", {
3335
- className: K.headingIcon,
3372
+ children: [/* @__PURE__ */ G("span", {
3373
+ className: q.headingIcon,
3336
3374
  "data-assistant-part": "heading-icon",
3337
- children: /* @__PURE__ */ W(be, {})
3338
- }), /* @__PURE__ */ W("div", { children: /* @__PURE__ */ W("h3", { children: "环境与数据" }) })]
3375
+ children: /* @__PURE__ */ G(be, {})
3376
+ }), /* @__PURE__ */ G("div", { children: /* @__PURE__ */ G("h3", { children: "环境与数据" }) })]
3339
3377
  }),
3340
- /* @__PURE__ */ G("dl", { children: [
3341
- /* @__PURE__ */ W("dt", { children: "网络状态" }),
3342
- /* @__PURE__ */ W("dd", { children: V.online == null ? "未知" : V.online ? "在线" : "离线" }),
3343
- /* @__PURE__ */ W("dt", { children: "浏览器语言" }),
3344
- /* @__PURE__ */ W("dd", { children: V.language || "未知" }),
3345
- /* @__PURE__ */ W("dt", { children: "时区" }),
3346
- /* @__PURE__ */ W("dd", { children: V.timezone || "未知" }),
3347
- /* @__PURE__ */ W("dt", { children: "设备内存" }),
3348
- /* @__PURE__ */ W("dd", { children: typeof V.deviceMemoryGB == "number" ? `${V.deviceMemoryGB} GB` : "不可用" })
3378
+ /* @__PURE__ */ K("dl", { children: [
3379
+ /* @__PURE__ */ G("dt", { children: "网络状态" }),
3380
+ /* @__PURE__ */ G("dd", { children: H.online == null ? "未知" : H.online ? "在线" : "离线" }),
3381
+ /* @__PURE__ */ G("dt", { children: "浏览器语言" }),
3382
+ /* @__PURE__ */ G("dd", { children: H.language || "未知" }),
3383
+ /* @__PURE__ */ G("dt", { children: "时区" }),
3384
+ /* @__PURE__ */ G("dd", { children: H.timezone || "未知" }),
3385
+ /* @__PURE__ */ G("dt", { children: "设备内存" }),
3386
+ /* @__PURE__ */ G("dd", { children: typeof H.deviceMemoryGB == "number" ? `${H.deviceMemoryGB} GB` : "不可用" })
3349
3387
  ] }),
3350
- /* @__PURE__ */ G("details", { children: [
3351
- /* @__PURE__ */ W("summary", { children: "完整环境与采集范围" }),
3352
- /* @__PURE__ */ W("p", {
3353
- className: K.hint,
3388
+ /* @__PURE__ */ K("details", { children: [
3389
+ /* @__PURE__ */ G("summary", { children: "完整环境与采集范围" }),
3390
+ /* @__PURE__ */ G("p", {
3391
+ className: q.hint,
3354
3392
  children: "不采集 Cookie、localStorage、sessionStorage 的值。"
3355
3393
  }),
3356
- /* @__PURE__ */ W(At, { value: V })
3394
+ /* @__PURE__ */ G(At, { value: H })
3357
3395
  ] }),
3358
- R && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("h3", { children: "现场页面状态" }), /* @__PURE__ */ W(At, { value: R.page })] })
3396
+ z && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G("h3", { children: "现场页面状态" }), /* @__PURE__ */ G(At, { value: z.page })] })
3359
3397
  ]
3360
- }), Ke = /* @__PURE__ */ W("div", {
3361
- className: K.section,
3398
+ }), Ge = /* @__PURE__ */ G("div", {
3399
+ className: q.section,
3362
3400
  "data-assistant-part": "section",
3363
- children: /* @__PURE__ */ W(de, { description: "知识问答尚未接入" })
3401
+ children: /* @__PURE__ */ G(de, { description: "知识问答尚未接入" })
3364
3402
  });
3365
- return /* @__PURE__ */ G("div", {
3403
+ return /* @__PURE__ */ K("div", {
3366
3404
  "data-research-assistant": !0,
3367
- children: [/* @__PURE__ */ G("div", {
3368
- className: K.dock,
3405
+ children: [/* @__PURE__ */ K("div", {
3406
+ className: q.dock,
3369
3407
  "data-assistant-part": "dock",
3370
3408
  "data-recording": o.recording,
3371
3409
  hidden: u,
3372
- children: [/* @__PURE__ */ W(me, {
3410
+ children: [/* @__PURE__ */ G(me, {
3373
3411
  open: Te && !F && !u,
3374
3412
  trigger: F ? [] : "hover",
3375
- onOpenChange: (e) => Ee(e && !F && !u),
3376
- title: o.recording ? `研发小蜜 · 录制中 ${o.draft.steps.length} 步` : Ue ? `研发小蜜 · ${Ue} 项性能告警` : a.frozen ? "研发小蜜 · 已保留异常现场" : "研发小蜜",
3377
- children: /* @__PURE__ */ W(oe, {
3378
- dot: o.recording || !!a.frozen || Ue > 0,
3413
+ onOpenChange: (e) => I(e && !F && !u),
3414
+ title: o.recording ? `研发小蜜 · 录制中 ${o.draft.steps.length} 步` : He ? `研发小蜜 · ${He} 项性能告警` : a.frozen ? "研发小蜜 · 已保留异常现场" : "研发小蜜",
3415
+ children: /* @__PURE__ */ G(oe, {
3416
+ dot: o.recording || !!a.frozen || He > 0,
3379
3417
  color: o.recording ? "red" : "orange",
3380
3418
  offset: [-5, 5],
3381
- children: /* @__PURE__ */ W(C, {
3419
+ children: /* @__PURE__ */ G(C, {
3382
3420
  ref: ae,
3383
- className: K.launcher,
3421
+ className: q.launcher,
3384
3422
  "data-assistant-part": "launcher",
3385
3423
  "data-draggable": !0,
3386
3424
  "aria-label": "打开研发小蜜",
3387
3425
  "aria-expanded": u,
3388
3426
  "aria-controls": "research-assistant-window",
3389
- onClick: I,
3390
- icon: /* @__PURE__ */ W(Ct, { className: K.launcherAvatar })
3427
+ onClick: L,
3428
+ icon: /* @__PURE__ */ G(Ct, { className: q.launcherAvatar })
3391
3429
  })
3392
3430
  })
3393
- }), /* @__PURE__ */ W("span", {
3394
- className: K.srOnly,
3431
+ }), /* @__PURE__ */ G("span", {
3432
+ className: q.srOnly,
3395
3433
  "data-assistant-part": "sr-only",
3396
3434
  role: "status",
3397
- children: o.recording ? `录制中 ${o.draft.steps.length} 步` : Ue ? `${Ue} 项性能告警` : a.frozen ? "已保留异常现场" : ""
3435
+ children: o.recording ? `录制中 ${o.draft.steps.length} 步` : He ? `${He} 项性能告警` : a.frozen ? "已保留异常现场" : ""
3398
3436
  })]
3399
- }), /* @__PURE__ */ W(Ot, {
3437
+ }), /* @__PURE__ */ G(Ot, {
3400
3438
  open: u,
3401
3439
  onMinimize: se,
3402
3440
  developer: e,
3403
- children: /* @__PURE__ */ G("div", {
3441
+ children: /* @__PURE__ */ K("div", {
3404
3442
  "data-research-assistant": !0,
3405
- className: K.body,
3443
+ className: q.body,
3406
3444
  "data-assistant-part": "body",
3407
3445
  children: [
3408
- /* @__PURE__ */ G("div", {
3409
- className: K.toolbar,
3446
+ /* @__PURE__ */ K("div", {
3447
+ className: q.toolbar,
3410
3448
  "data-assistant-part": "toolbar",
3411
- children: [/* @__PURE__ */ G("span", { children: [/* @__PURE__ */ W("i", { className: a.paused ? K.paused : "" }), R ? "查看离线现场" : a.paused ? "采集已暂停" : "正在采集"] }), /* @__PURE__ */ G("div", {
3412
- className: [K.buttonRow, K.toolbarActions].join(" "),
3449
+ children: [/* @__PURE__ */ K("span", { children: [/* @__PURE__ */ G("i", { className: a.paused ? q.paused : "" }), z ? "查看离线现场" : a.paused ? "采集已暂停" : "正在采集"] }), /* @__PURE__ */ K("div", {
3450
+ className: [q.buttonRow, q.toolbarActions].join(" "),
3413
3451
  "data-assistant-part": "button-row toolbar-actions",
3414
- children: [/* @__PURE__ */ W(C, {
3452
+ children: [/* @__PURE__ */ G(C, {
3415
3453
  type: "text",
3416
3454
  size: "small",
3417
- icon: a.paused ? /* @__PURE__ */ W(Ne, {}) : /* @__PURE__ */ W(Me, {}),
3455
+ icon: a.paused ? /* @__PURE__ */ G(Me, {}) : /* @__PURE__ */ G(je, {}),
3418
3456
  onClick: () => m.pause(!a.paused),
3419
3457
  children: a.paused ? "继续采集" : "暂停采集"
3420
- }), /* @__PURE__ */ W(C, {
3458
+ }), /* @__PURE__ */ G(C, {
3421
3459
  type: "text",
3422
3460
  danger: !0,
3423
3461
  size: "small",
3424
- icon: /* @__PURE__ */ W(ye, {}),
3425
- onClick: L,
3462
+ icon: /* @__PURE__ */ G(ye, {}),
3463
+ onClick: R,
3426
3464
  children: "清空记录"
3427
3465
  })]
3428
3466
  })]
3429
3467
  }),
3430
- ue && /* @__PURE__ */ W(S, {
3468
+ ue && /* @__PURE__ */ G(S, {
3431
3469
  closable: !0,
3432
3470
  title: ue,
3433
3471
  type: "info",
3434
3472
  onClose: () => fe("")
3435
3473
  }),
3436
- R?.feedback && /* @__PURE__ */ W(S, {
3474
+ z?.feedback && /* @__PURE__ */ G(S, {
3437
3475
  title: "快照中的问题描述",
3438
- description: R.feedback,
3476
+ description: z.feedback,
3439
3477
  type: "info"
3440
3478
  }),
3441
- e && /* @__PURE__ */ G("div", {
3442
- className: K.sources,
3479
+ e && /* @__PURE__ */ K("div", {
3480
+ className: q.sources,
3443
3481
  "data-assistant-part": "sources",
3444
3482
  children: [
3445
- /* @__PURE__ */ W(C, {
3483
+ /* @__PURE__ */ G(C, {
3446
3484
  size: "small",
3447
- icon: /* @__PURE__ */ W(Oe, {}),
3485
+ icon: /* @__PURE__ */ G(De, {}),
3448
3486
  "aria-pressed": A === "live",
3449
3487
  type: A === "live" ? "primary" : "text",
3450
3488
  onClick: () => j("live"),
3451
3489
  children: "实时记录"
3452
3490
  }),
3453
- (!i || a.frozen) && /* @__PURE__ */ W(C, {
3491
+ (!i || a.frozen) && /* @__PURE__ */ G(C, {
3454
3492
  size: "small",
3455
- icon: /* @__PURE__ */ W(ge, {}),
3493
+ icon: /* @__PURE__ */ G(ge, {}),
3456
3494
  disabled: !a.frozen,
3457
3495
  "aria-pressed": A === "frozen",
3458
3496
  type: A === "frozen" ? "primary" : "text",
3459
3497
  onClick: () => j("frozen"),
3460
3498
  children: "已冻结现场"
3461
3499
  }),
3462
- /* @__PURE__ */ W(he, {
3500
+ /* @__PURE__ */ G(he, {
3463
3501
  accept: ".json,application/json",
3464
3502
  showUploadList: !1,
3465
3503
  beforeUpload: async (e) => {
@@ -3471,33 +3509,33 @@ function Mt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3471
3509
  }
3472
3510
  return he.LIST_IGNORE;
3473
3511
  },
3474
- children: /* @__PURE__ */ W(C, {
3512
+ children: /* @__PURE__ */ G(C, {
3475
3513
  type: "text",
3476
3514
  size: "small",
3477
- icon: /* @__PURE__ */ W(Le, {}),
3515
+ icon: /* @__PURE__ */ G(Ie, {}),
3478
3516
  children: "导入快照"
3479
3517
  })
3480
3518
  }),
3481
- E && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(C, {
3519
+ E && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(C, {
3482
3520
  size: "small",
3483
- icon: /* @__PURE__ */ W(De, {}),
3521
+ icon: /* @__PURE__ */ G(Ee, {}),
3484
3522
  "aria-pressed": A === "imported",
3485
3523
  type: A === "imported" ? "primary" : "text",
3486
3524
  onClick: () => j("imported"),
3487
3525
  children: "导入的现场"
3488
- }), /* @__PURE__ */ W(C, {
3526
+ }), /* @__PURE__ */ G(C, {
3489
3527
  type: "text",
3490
3528
  "aria-label": "关闭导入现场",
3491
3529
  size: "small",
3492
- icon: /* @__PURE__ */ W(ve, {}),
3530
+ icon: /* @__PURE__ */ G(ve, {}),
3493
3531
  onClick: () => {
3494
3532
  O(null), j("live");
3495
3533
  }
3496
3534
  })] })
3497
3535
  ]
3498
3536
  }),
3499
- /* @__PURE__ */ W(pe, {
3500
- className: K.mainTabs,
3537
+ /* @__PURE__ */ G(pe, {
3538
+ className: q.mainTabs,
3501
3539
  "data-assistant-part": "main-tabs",
3502
3540
  "data-diagnostics-only": i || void 0,
3503
3541
  activeKey: h,
@@ -3506,14 +3544,14 @@ function Mt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3506
3544
  {
3507
3545
  key: "feedback",
3508
3546
  label: "问题反馈",
3509
- icon: /* @__PURE__ */ W(je, { "aria-hidden": !0 }),
3510
- children: Fe
3547
+ icon: /* @__PURE__ */ G(Ae, { "aria-hidden": !0 }),
3548
+ children: Pe
3511
3549
  },
3512
3550
  ...e ? [{
3513
3551
  key: "automation",
3514
3552
  label: "自动化测试",
3515
- icon: /* @__PURE__ */ W(Se, { "aria-hidden": !0 }),
3516
- children: /* @__PURE__ */ W(gt, {
3553
+ icon: /* @__PURE__ */ G(Se, { "aria-hidden": !0 }),
3554
+ children: /* @__PURE__ */ G(ht, {
3517
3555
  close: se,
3518
3556
  bridgeUrl: r,
3519
3557
  incomingDraft: te,
@@ -3521,10 +3559,10 @@ function Mt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3521
3559
  })
3522
3560
  }, {
3523
3561
  key: "diagnostics",
3524
- label: !R && Ue > 0 ? `诊断(${Ue})` : "诊断",
3525
- icon: /* @__PURE__ */ W(ke, { "aria-hidden": !0 }),
3526
- children: /* @__PURE__ */ W(pe, {
3527
- className: K.diagnosticTabs,
3562
+ label: !z && He > 0 ? `诊断(${He})` : "诊断",
3563
+ icon: /* @__PURE__ */ G(Oe, { "aria-hidden": !0 }),
3564
+ children: /* @__PURE__ */ G(pe, {
3565
+ className: q.diagnosticTabs,
3528
3566
  "data-assistant-part": "diagnostic-tabs",
3529
3567
  activeKey: ee,
3530
3568
  onChange: b,
@@ -3532,26 +3570,26 @@ function Mt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3532
3570
  {
3533
3571
  key: "timeline",
3534
3572
  label: "时间线",
3535
- icon: /* @__PURE__ */ W(Oe, { "aria-hidden": !0 }),
3536
- children: Ie
3573
+ icon: /* @__PURE__ */ G(De, { "aria-hidden": !0 }),
3574
+ children: Fe
3537
3575
  },
3538
3576
  {
3539
3577
  key: "network",
3540
3578
  label: "接口",
3541
- icon: /* @__PURE__ */ W(k, { "aria-hidden": !0 }),
3542
- children: Re
3579
+ icon: /* @__PURE__ */ G(k, { "aria-hidden": !0 }),
3580
+ children: Le
3543
3581
  },
3544
3582
  {
3545
3583
  key: "performance",
3546
- label: He.length ? `性能 (${He.length})` : "性能",
3547
- icon: /* @__PURE__ */ W(N, { "aria-hidden": !0 }),
3548
- children: We
3584
+ label: Ve.length ? `性能 (${Ve.length})` : "性能",
3585
+ icon: /* @__PURE__ */ G(N, { "aria-hidden": !0 }),
3586
+ children: Ue
3549
3587
  },
3550
3588
  {
3551
3589
  key: "data",
3552
3590
  label: "环境与数据",
3553
- icon: /* @__PURE__ */ W(be, { "aria-hidden": !0 }),
3554
- children: Ge
3591
+ icon: /* @__PURE__ */ G(be, { "aria-hidden": !0 }),
3592
+ children: We
3555
3593
  }
3556
3594
  ]
3557
3595
  })
@@ -3559,8 +3597,8 @@ function Mt({ developer: e = !0, bridgeUrl: r = "/__laya-pilot", diagnosticsOnly
3559
3597
  {
3560
3598
  key: "knowledge",
3561
3599
  label: "知识问答",
3562
- icon: /* @__PURE__ */ W(Pe, { "aria-hidden": !0 }),
3563
- children: Ke
3600
+ icon: /* @__PURE__ */ G(Ne, { "aria-hidden": !0 }),
3601
+ children: Ge
3564
3602
  }
3565
3603
  ].filter((e) => !i || e.key === "diagnostics")
3566
3604
  })
@@ -3605,9 +3643,9 @@ function Pt({ developer: e, bridgeUrl: t = "/__laya-pilot", runtimeOptions: n, t
3605
3643
  themeMode: r,
3606
3644
  includeCustom: !1
3607
3645
  }), [r]);
3608
- return /* @__PURE__ */ W(ae, {
3646
+ return /* @__PURE__ */ G(ae, {
3609
3647
  hashPriority: "high",
3610
- children: /* @__PURE__ */ W(le, {
3648
+ children: /* @__PURE__ */ G(le, {
3611
3649
  themeMode: r,
3612
3650
  theme: {
3613
3651
  inherit: !1,
@@ -3639,12 +3677,12 @@ function Pt({ developer: e, bridgeUrl: t = "/__laya-pilot", runtimeOptions: n, t
3639
3677
  tooltip: {},
3640
3678
  empty: {},
3641
3679
  flex: {},
3642
- children: /* @__PURE__ */ W("div", {
3680
+ children: /* @__PURE__ */ G("div", {
3643
3681
  "data-research-assistant": !0,
3644
3682
  "data-assistant-part": "scope",
3645
- className: Ye.scope,
3683
+ className: Je.scope,
3646
3684
  style: u,
3647
- children: /* @__PURE__ */ W(Mt, {
3685
+ children: /* @__PURE__ */ G(Mt, {
3648
3686
  developer: e,
3649
3687
  bridgeUrl: t,
3650
3688
  diagnosticsOnly: o
@@ -3654,14 +3692,14 @@ function Pt({ developer: e, bridgeUrl: t = "/__laya-pilot", runtimeOptions: n, t
3654
3692
  });
3655
3693
  }
3656
3694
  function Ft(e = {}) {
3657
- return e.enabled === !1 ? null : /* @__PURE__ */ W(Nt, { children: /* @__PURE__ */ W(Pt, { ...e }) }, e.sessionKey);
3695
+ return e.enabled === !1 ? null : /* @__PURE__ */ G(Nt, { children: /* @__PURE__ */ G(Pt, { ...e }) }, e.sessionKey);
3658
3696
  }
3659
3697
  // src/inject.tsx
3660
3698
  var It = (e) => typeof e == "function" ? e() : e, Lt = {}, Rt, zt, Bt, Vt = () => {
3661
3699
  if (!zt) return;
3662
3700
  let { enabled: e = !0, sessionKey: t, themeMode: n } = Lt;
3663
3701
  try {
3664
- zt.render(/* @__PURE__ */ W(Ft, {
3702
+ zt.render(/* @__PURE__ */ G(Ft, {
3665
3703
  developer: Lt.developer,
3666
3704
  bridgeUrl: Lt.bridgeUrl,
3667
3705
  runtimeOptions: Lt.runtimeOptions,
@@ -3686,7 +3724,7 @@ var It = (e) => typeof e == "function" ? e() : e, Lt = {}, Rt, zt, Bt, Vt = () =
3686
3724
  }
3687
3725
  }, Ut = () => {
3688
3726
  if (!(zt || typeof document > "u")) {
3689
- Rt = document.createElement("div"), Rt.dataset.researchAssistantMount = "npm", document.body.append(Rt), zt = Ve(Rt);
3727
+ Rt = document.createElement("div"), Rt.dataset.researchAssistantMount = "npm", document.body.append(Rt), zt = Be(Rt);
3690
3728
  try {
3691
3729
  Vt(), Bt = Lt.subscribe?.(Vt);
3692
3730
  } catch (e) {