@manohub/skill-select-workbench 0.0.1-beta1 → 0.0.1-beta3

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,763 +1,3314 @@
1
- import { request as e } from "@gsp-sys/utils";
2
- import { computed as t, createTextVNode as n, createVNode as r, defineComponent as i, ref as a, shallowRef as o, watch as s } from "vue";
3
- import { FButton as c, FDataGrid as ee, FPagination as l, FTreeView as u } from "@farris/ui-vue";
4
- //#region src/types.ts
5
- var d = { items: [] };
6
- function f(e) {
7
- let t = e.displayName || e.name;
8
- return {
9
- value: e.id,
10
- text: t,
11
- skill: e
12
- };
13
- }
14
- //#endregion
15
- //#region src/constants.ts
16
- var p = [{
17
- value: "GENERAL_OFFICE",
18
- label: "通用办公技能"
19
- }, {
20
- value: "BUSINESS_SYSTEM",
21
- label: "业务系统技能"
22
- }], m = "GENERAL_OFFICE";
23
- function h(e) {
24
- if (!e) return "-";
25
- let t = p.find((t) => t.value === e);
26
- return t ? t.label : e;
27
- }
28
- var g = 10, _ = [
29
- 10,
30
- 20,
31
- 50
32
- ], v = class extends Error {
33
- status;
34
- details;
35
- code;
36
- category;
37
- constructor(e, t, n, r, i) {
38
- super(e), this.name = "ApiError", this.status = t, this.details = n, this.code = r, this.category = i;
39
- }
40
- get serverMessage() {
41
- return this.details;
42
- }
43
- get innerMessage() {
44
- return this.details;
45
- }
46
- }, y = "/api/runtime/aihub/v1.0";
47
- function b() {
48
- return typeof window > "u" ? {} : window.__SKILLHUB_RUNTIME_CONFIG__ ?? {};
49
- }
50
- function x(e) {
51
- let t = b().apiBaseUrl;
52
- return t && e.startsWith("/") ? `${t.replace(/\/$/, "")}${e}` : e;
53
- }
54
- var S = {
55
- GET: "get",
56
- POST: "post",
57
- PUT: "put",
58
- DELETE: "delete",
59
- PATCH: "patch"
1
+ import { shallowRef as ht, computed as J, defineComponent as Mt, ref as F, watch as mt, createVNode as R, Teleport as Rn, createTextVNode as M } from "vue";
2
+ import { FTreeView as _n, FDataGrid as On, FPagination as An, FButton as wt } from "@farris/ui-vue";
3
+ const fo = { items: [] };
4
+ function Ve(e) {
5
+ const t = e.displayName || e.name;
6
+ return { value: e.id, text: t, skill: e };
7
+ }
8
+ const qt = [
9
+ { value: "GENERAL_OFFICE", label: "通用办公技能" },
10
+ { value: "BUSINESS_SYSTEM", label: "业务系统技能" }
11
+ ], po = "GENERAL_OFFICE";
12
+ function Tn(e) {
13
+ if (!e) return "-";
14
+ const t = qt.find((n) => n.value === e);
15
+ return t ? t.label : e;
16
+ }
17
+ const yt = 10, Cn = [10, 20, 50];
18
+ function Ht(e, t) {
19
+ return function() {
20
+ return e.apply(t, arguments);
21
+ };
22
+ }
23
+ const { toString: xn } = Object.prototype, { getPrototypeOf: pe } = Object, { iterator: Oe, toStringTag: zt } = Symbol, Be = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), _e = (e, t) => {
24
+ let n = e;
25
+ const r = [];
26
+ for (; n != null && n !== Object.prototype; ) {
27
+ if (r.indexOf(n) !== -1)
28
+ return !1;
29
+ if (r.push(n), Be(n, t))
30
+ return !0;
31
+ n = pe(n);
32
+ }
33
+ return !1;
34
+ }, vn = (e, t) => e != null && _e(e, t) ? e[t] : void 0, st = /* @__PURE__ */ ((e) => (t) => {
35
+ const n = xn.call(t);
36
+ return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
37
+ })(/* @__PURE__ */ Object.create(null)), V = (e) => (e = e.toLowerCase(), (t) => st(t) === e), qe = (e) => (t) => typeof t === e, { isArray: oe } = Array, ie = qe("undefined");
38
+ function he(e) {
39
+ return e !== null && !ie(e) && e.constructor !== null && !ie(e.constructor) && q(e.constructor.isBuffer) && e.constructor.isBuffer(e);
40
+ }
41
+ const $t = V("ArrayBuffer");
42
+ function Pn(e) {
43
+ let t;
44
+ return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && $t(e.buffer), t;
45
+ }
46
+ const Dn = qe("string"), q = qe("function"), Vt = qe("number"), me = (e) => e !== null && typeof e == "object", Nn = (e) => e === !0 || e === !1, Ue = (e) => {
47
+ if (!me(e))
48
+ return !1;
49
+ const t = pe(e);
50
+ return (t === null || t === Object.prototype || pe(t) === null) && // Treat any genuine (non-Object.prototype-polluted) Symbol.toStringTag or
51
+ // Symbol.iterator as evidence the value is a tagged/iterable type rather
52
+ // than a plain object, while ignoring keys injected onto Object.prototype.
53
+ !_e(e, zt) && !_e(e, Oe);
54
+ }, Ln = (e) => {
55
+ if (!me(e) || he(e))
56
+ return !1;
57
+ try {
58
+ return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
59
+ } catch {
60
+ return !1;
61
+ }
62
+ }, Fn = V("Date"), Un = V("File"), In = (e) => !!(e && typeof e.uri < "u"), kn = (e) => e && typeof e.getParts < "u", Bn = V("Blob"), jn = V("FileList"), Mn = V("Set"), qn = (e) => me(e) && q(e.pipe);
63
+ function Hn() {
64
+ return typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {};
65
+ }
66
+ const gt = Hn(), bt = typeof gt.FormData < "u" ? gt.FormData : void 0, zn = (e) => {
67
+ if (!e) return !1;
68
+ if (bt && e instanceof bt) return !0;
69
+ const t = pe(e);
70
+ if (!t || t === Object.prototype || !q(e.append)) return !1;
71
+ const n = st(e);
72
+ return n === "formdata" || // detect form-data instance
73
+ n === "object" && q(e.toString) && e.toString() === "[object FormData]";
74
+ }, $n = V("URLSearchParams"), [Vn, Wn, Jn, Kn] = [
75
+ "ReadableStream",
76
+ "Request",
77
+ "Response",
78
+ "Headers"
79
+ ].map(V), Gn = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
80
+ function Ae(e, t, { allOwnKeys: n = !1 } = {}) {
81
+ if (e === null || typeof e > "u")
82
+ return;
83
+ let r, s;
84
+ if (typeof e != "object" && (e = [e]), oe(e))
85
+ for (r = 0, s = e.length; r < s; r++)
86
+ t.call(null, e[r], r, e);
87
+ else {
88
+ if (he(e))
89
+ return;
90
+ const o = n ? Object.getOwnPropertyNames(e) : Object.keys(e), i = o.length;
91
+ let l;
92
+ for (r = 0; r < i; r++)
93
+ l = o[r], t.call(null, e[l], l, e);
94
+ }
95
+ }
96
+ function Wt(e, t) {
97
+ if (he(e))
98
+ return null;
99
+ t = t.toLowerCase();
100
+ const n = Object.keys(e);
101
+ let r = n.length, s;
102
+ for (; r-- > 0; )
103
+ if (s = n[r], t === s.toLowerCase())
104
+ return s;
105
+ return null;
106
+ }
107
+ const re = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Jt = (e) => !ie(e) && e !== re;
108
+ function et(...e) {
109
+ const { caseless: t, skipUndefined: n } = Jt(this) && this || {}, r = {}, s = (o, i) => {
110
+ if (i === "__proto__" || i === "constructor" || i === "prototype")
111
+ return;
112
+ const l = t && typeof i == "string" && Wt(r, i) || i, u = Be(r, l) ? r[l] : void 0;
113
+ Ue(u) && Ue(o) ? r[l] = et(u, o) : Ue(o) ? r[l] = et({}, o) : oe(o) ? r[l] = o.slice() : (!n || !ie(o)) && (r[l] = o);
114
+ };
115
+ for (let o = 0, i = e.length; o < i; o++) {
116
+ const l = e[o];
117
+ if (!l || he(l) || (Ae(l, s), typeof l != "object" || oe(l)))
118
+ continue;
119
+ const u = Object.getOwnPropertySymbols(l);
120
+ for (let d = 0; d < u.length; d++) {
121
+ const f = u[d];
122
+ ar.call(l, f) && s(l[f], f);
123
+ }
124
+ }
125
+ return r;
126
+ }
127
+ const Xn = (e, t, n, { allOwnKeys: r } = {}) => (Ae(
128
+ t,
129
+ (s, o) => {
130
+ n && q(s) ? Object.defineProperty(e, o, {
131
+ // Null-proto descriptor so a polluted Object.prototype.get cannot
132
+ // hijack defineProperty's accessor-vs-data resolution.
133
+ __proto__: null,
134
+ value: Ht(s, n),
135
+ writable: !0,
136
+ enumerable: !0,
137
+ configurable: !0
138
+ }) : Object.defineProperty(e, o, {
139
+ __proto__: null,
140
+ value: s,
141
+ writable: !0,
142
+ enumerable: !0,
143
+ configurable: !0
144
+ });
145
+ },
146
+ { allOwnKeys: r }
147
+ ), e), Yn = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Zn = (e, t, n, r) => {
148
+ e.prototype = Object.create(t.prototype, r), Object.defineProperty(e.prototype, "constructor", {
149
+ __proto__: null,
150
+ value: e,
151
+ writable: !0,
152
+ enumerable: !1,
153
+ configurable: !0
154
+ }), Object.defineProperty(e, "super", {
155
+ __proto__: null,
156
+ value: t.prototype
157
+ }), n && Object.assign(e.prototype, n);
158
+ }, Qn = (e, t, n, r) => {
159
+ let s, o, i;
160
+ const l = {};
161
+ if (t = t || {}, e == null) return t;
162
+ do {
163
+ for (s = Object.getOwnPropertyNames(e), o = s.length; o-- > 0; )
164
+ i = s[o], (!r || r(i, e, t)) && !l[i] && (t[i] = e[i], l[i] = !0);
165
+ e = n !== !1 && pe(e);
166
+ } while (e && (!n || n(e, t)) && e !== Object.prototype);
167
+ return t;
168
+ }, er = (e, t, n) => {
169
+ e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
170
+ const r = e.indexOf(t, n);
171
+ return r !== -1 && r === n;
172
+ }, tr = (e) => {
173
+ if (!e) return null;
174
+ if (oe(e)) return e;
175
+ let t = e.length;
176
+ if (!Vt(t)) return null;
177
+ const n = new Array(t);
178
+ for (; t-- > 0; )
179
+ n[t] = e[t];
180
+ return n;
181
+ }, nr = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && pe(Uint8Array)), rr = (e, t) => {
182
+ const r = (e && e[Oe]).call(e);
183
+ let s;
184
+ for (; (s = r.next()) && !s.done; ) {
185
+ const o = s.value;
186
+ t.call(e, o[0], o[1]);
187
+ }
188
+ }, sr = (e, t) => {
189
+ let n;
190
+ const r = [];
191
+ for (; (n = e.exec(t)) !== null; )
192
+ r.push(n);
193
+ return r;
194
+ }, or = V("HTMLFormElement"), ir = (e) => e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function(n, r, s) {
195
+ return r.toUpperCase() + s;
196
+ }), { propertyIsEnumerable: ar } = Object.prototype, lr = V("RegExp"), Kt = (e, t) => {
197
+ const n = Object.getOwnPropertyDescriptors(e), r = {};
198
+ Ae(n, (s, o) => {
199
+ let i;
200
+ (i = t(s, o, e)) !== !1 && (r[o] = i || s);
201
+ }), Object.defineProperties(e, r);
202
+ }, cr = (e) => {
203
+ Kt(e, (t, n) => {
204
+ if (q(e) && ["arguments", "caller", "callee"].includes(n))
205
+ return !1;
206
+ const r = e[n];
207
+ if (q(r)) {
208
+ if (t.enumerable = !1, "writable" in t) {
209
+ t.writable = !1;
210
+ return;
211
+ }
212
+ t.set || (t.set = () => {
213
+ throw Error("Can not rewrite read-only method '" + n + "'");
214
+ });
215
+ }
216
+ });
217
+ }, ur = (e, t) => {
218
+ const n = {}, r = (s) => {
219
+ s.forEach((o) => {
220
+ n[o] = !0;
221
+ });
222
+ };
223
+ return oe(e) ? r(e) : r(String(e).split(t)), n;
224
+ }, fr = () => {
225
+ }, dr = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
226
+ function pr(e) {
227
+ return !!(e && q(e.append) && e[zt] === "FormData" && e[Oe]);
228
+ }
229
+ const hr = (e) => {
230
+ const t = /* @__PURE__ */ new WeakSet(), n = (r) => {
231
+ if (me(r)) {
232
+ if (t.has(r))
233
+ return;
234
+ if (he(r))
235
+ return r;
236
+ if (!("toJSON" in r)) {
237
+ t.add(r);
238
+ let s;
239
+ if (Mn(r)) {
240
+ s = [];
241
+ for (const o of r) {
242
+ const i = n(o);
243
+ !ie(i) && s.push(i);
244
+ }
245
+ } else
246
+ s = oe(r) ? [] : {}, Ae(r, (o, i) => {
247
+ const l = n(o);
248
+ !ie(l) && (s[i] = l);
249
+ });
250
+ return t.delete(r), s;
251
+ }
252
+ }
253
+ return r;
254
+ };
255
+ return n(e);
256
+ }, mr = V("AsyncFunction"), wr = (e) => e && (me(e) || q(e)) && q(e.then) && q(e.catch), Gt = ((e, t) => e ? setImmediate : t ? ((n, r) => (re.addEventListener(
257
+ "message",
258
+ ({ source: s, data: o }) => {
259
+ s === re && o === n && r.length && r.shift()();
260
+ },
261
+ !1
262
+ ), (s) => {
263
+ r.push(s), re.postMessage(n, "*");
264
+ }))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(typeof setImmediate == "function", q(re.postMessage)), yr = typeof queueMicrotask < "u" ? queueMicrotask.bind(re) : typeof process < "u" && process.nextTick || Gt, Xt = (e) => e != null && q(e[Oe]), gr = (e) => e != null && _e(e, Oe) && Xt(e), a = {
265
+ isArray: oe,
266
+ isArrayBuffer: $t,
267
+ isBuffer: he,
268
+ isFormData: zn,
269
+ isArrayBufferView: Pn,
270
+ isString: Dn,
271
+ isNumber: Vt,
272
+ isBoolean: Nn,
273
+ isObject: me,
274
+ isPlainObject: Ue,
275
+ isEmptyObject: Ln,
276
+ isReadableStream: Vn,
277
+ isRequest: Wn,
278
+ isResponse: Jn,
279
+ isHeaders: Kn,
280
+ isUndefined: ie,
281
+ isDate: Fn,
282
+ isFile: Un,
283
+ isReactNativeBlob: In,
284
+ isReactNative: kn,
285
+ isBlob: Bn,
286
+ isRegExp: lr,
287
+ isFunction: q,
288
+ isStream: qn,
289
+ isURLSearchParams: $n,
290
+ isTypedArray: nr,
291
+ isFileList: jn,
292
+ forEach: Ae,
293
+ merge: et,
294
+ extend: Xn,
295
+ trim: Gn,
296
+ stripBOM: Yn,
297
+ inherits: Zn,
298
+ toFlatObject: Qn,
299
+ kindOf: st,
300
+ kindOfTest: V,
301
+ endsWith: er,
302
+ toArray: tr,
303
+ forEachEntry: rr,
304
+ matchAll: sr,
305
+ isHTMLForm: or,
306
+ hasOwnProperty: Be,
307
+ hasOwnProp: Be,
308
+ // an alias to avoid ESLint no-prototype-builtins detection
309
+ hasOwnInPrototypeChain: _e,
310
+ getSafeProp: vn,
311
+ reduceDescriptors: Kt,
312
+ freezeMethods: cr,
313
+ toObjectSet: ur,
314
+ toCamelCase: ir,
315
+ noop: fr,
316
+ toFiniteNumber: dr,
317
+ findKey: Wt,
318
+ global: re,
319
+ isContextDefined: Jt,
320
+ isSpecCompliantForm: pr,
321
+ toJSONObject: hr,
322
+ isAsyncFn: mr,
323
+ isThenable: wr,
324
+ setImmediate: Gt,
325
+ asap: yr,
326
+ isIterable: Xt,
327
+ isSafeIterable: gr
328
+ }, br = a.toObjectSet([
329
+ "age",
330
+ "authorization",
331
+ "content-length",
332
+ "content-type",
333
+ "etag",
334
+ "expires",
335
+ "from",
336
+ "host",
337
+ "if-modified-since",
338
+ "if-unmodified-since",
339
+ "last-modified",
340
+ "location",
341
+ "max-forwards",
342
+ "proxy-authorization",
343
+ "referer",
344
+ "retry-after",
345
+ "user-agent"
346
+ ]), Er = (e) => {
347
+ const t = {};
348
+ let n, r, s;
349
+ return e && e.split(`
350
+ `).forEach(function(i) {
351
+ s = i.indexOf(":"), n = i.substring(0, s).trim().toLowerCase(), r = i.substring(s + 1).trim();
352
+ const l = a.hasOwnProp(t, n);
353
+ !n || l && a.hasOwnProp(br, n) || (n === "set-cookie" ? l ? t[n].push(r) : t[n] = [r] : t[n] = l ? t[n] + ", " + r : r);
354
+ }), t;
355
+ };
356
+ function Sr(e) {
357
+ let t = 0, n = e.length;
358
+ for (; t < n; ) {
359
+ const r = e.charCodeAt(t);
360
+ if (r !== 9 && r !== 32)
361
+ break;
362
+ t += 1;
363
+ }
364
+ for (; n > t; ) {
365
+ const r = e.charCodeAt(n - 1);
366
+ if (r !== 9 && r !== 32)
367
+ break;
368
+ n -= 1;
369
+ }
370
+ return t === 0 && n === e.length ? e : e.slice(t, n);
371
+ }
372
+ const Rr = new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+", "g"), _r = new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+", "g");
373
+ function ot(e, t) {
374
+ return a.isArray(e) ? e.map((n) => ot(n, t)) : Sr(String(e).replace(t, ""));
375
+ }
376
+ const Or = (e) => ot(e, Rr), Ar = (e) => ot(e, _r);
377
+ function Yt(e) {
378
+ const t = /* @__PURE__ */ Object.create(null);
379
+ return a.forEach(e.toJSON(), (n, r) => {
380
+ t[r] = Ar(n);
381
+ }), t;
382
+ }
383
+ const Et = /* @__PURE__ */ Symbol("internals");
384
+ function be(e) {
385
+ return e && String(e).trim().toLowerCase();
386
+ }
387
+ function Ie(e) {
388
+ return e === !1 || e == null ? e : a.isArray(e) ? e.map(Ie) : Or(String(e));
389
+ }
390
+ function Tr(e) {
391
+ const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
392
+ let r;
393
+ for (; r = n.exec(e); )
394
+ t[r[1]] = r[2];
395
+ return t;
396
+ }
397
+ const Cr = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
398
+ function We(e) {
399
+ let t = 0, n = e.length;
400
+ for (; t < n; ) {
401
+ const r = e.charCodeAt(t);
402
+ if (r !== 9 && r !== 32)
403
+ break;
404
+ t += 1;
405
+ }
406
+ for (; n > t; ) {
407
+ const r = e.charCodeAt(n - 1);
408
+ if (r !== 9 && r !== 32)
409
+ break;
410
+ n -= 1;
411
+ }
412
+ return t === 0 && n === e.length ? e : e.slice(t, n);
413
+ }
414
+ function xr(e) {
415
+ const t = e.length - 1;
416
+ if (t < 1 || e.charCodeAt(0) !== 34 || e.charCodeAt(t) !== 34)
417
+ return e;
418
+ let n = "";
419
+ for (let r = 1; r < t; r++) {
420
+ const s = e.charCodeAt(r);
421
+ if (s === 34 || s === 92 && (r += 1, r >= t))
422
+ return e;
423
+ n += e[r];
424
+ }
425
+ return n;
426
+ }
427
+ function vr(e) {
428
+ const t = /* @__PURE__ */ Object.create(null), n = String(e);
429
+ let r = 0, s = !1, o = !1;
430
+ function i(l) {
431
+ const u = We(n.slice(r, l)), d = u.indexOf("=");
432
+ if (d < 1)
433
+ return;
434
+ const f = We(u.slice(0, d));
435
+ if (!Cr.test(f))
436
+ return;
437
+ const p = f.toLowerCase();
438
+ if (p === "__proto__" || p === "constructor" || p === "prototype")
439
+ return;
440
+ const S = We(u.slice(d + 1));
441
+ t[p] = xr(S);
442
+ }
443
+ for (let l = 0; l < n.length; l++) {
444
+ const u = n.charCodeAt(l);
445
+ s ? o ? o = !1 : u === 92 ? o = !0 : u === 34 && (s = !1) : u === 34 ? s = !0 : (u === 44 || u === 59) && (i(l), r = l + 1);
446
+ }
447
+ return i(n.length), t;
448
+ }
449
+ const Pr = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
450
+ function Je(e, t, n, r, s) {
451
+ if (a.isFunction(r))
452
+ return r.call(this, t, n);
453
+ if (s && (t = n), !!a.isString(t)) {
454
+ if (a.isString(r))
455
+ return t.indexOf(r) !== -1;
456
+ if (a.isRegExp(r))
457
+ return r.test(t);
458
+ }
459
+ }
460
+ function Dr(e) {
461
+ return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
462
+ }
463
+ function Nr(e, t) {
464
+ const n = a.toCamelCase(" " + t);
465
+ ["get", "set", "has"].forEach((r) => {
466
+ Object.defineProperty(e, r + n, {
467
+ // Null-proto descriptor so a polluted Object.prototype.get cannot turn
468
+ // this data descriptor into an accessor descriptor on the way in.
469
+ __proto__: null,
470
+ value: function(s, o, i) {
471
+ return this[r].call(this, t, s, o, i);
472
+ },
473
+ configurable: !0
474
+ });
475
+ });
476
+ }
477
+ let k = class {
478
+ constructor(t) {
479
+ t && this.set(t);
480
+ }
481
+ set(t, n, r) {
482
+ const s = this;
483
+ function o(l, u, d) {
484
+ const f = be(u);
485
+ if (!f)
486
+ return;
487
+ const p = a.findKey(s, f);
488
+ (!p || s[p] === void 0 || d === !0 || d === void 0 && s[p] !== !1) && (s[p || u] = Ie(l));
489
+ }
490
+ const i = (l, u) => a.forEach(l, (d, f) => o(d, f, u));
491
+ if (a.isPlainObject(t) || t instanceof this.constructor)
492
+ i(t, n);
493
+ else if (a.isString(t) && (t = t.trim()) && !Pr(t))
494
+ i(Er(t), n);
495
+ else if (a.isObject(t) && a.isSafeIterable(t)) {
496
+ let l = /* @__PURE__ */ Object.create(null), u, d;
497
+ for (const f of t) {
498
+ if (!a.isArray(f))
499
+ throw new TypeError("Object iterator must return a key-value pair");
500
+ d = f[0], a.hasOwnProp(l, d) ? (u = l[d], l[d] = a.isArray(u) ? [...u, f[1]] : [u, f[1]]) : l[d] = f[1];
501
+ }
502
+ i(l, n);
503
+ } else
504
+ t != null && o(n, t, r);
505
+ return this;
506
+ }
507
+ get(t, n) {
508
+ if (t = be(t), t) {
509
+ const r = a.findKey(this, t);
510
+ if (r) {
511
+ const s = this[r];
512
+ if (!n)
513
+ return s;
514
+ if (n === !0)
515
+ return Tr(s);
516
+ if (a.isFunction(n))
517
+ return n.call(this, s, r);
518
+ if (a.isRegExp(n))
519
+ return n.exec(s);
520
+ throw new TypeError("parser must be boolean|regexp|function");
521
+ }
522
+ }
523
+ }
524
+ has(t, n) {
525
+ if (t = be(t), t) {
526
+ const r = a.findKey(this, t);
527
+ return !!(r && this[r] !== void 0 && (!n || Je(this, this[r], r, n)));
528
+ }
529
+ return !1;
530
+ }
531
+ delete(t, n) {
532
+ const r = this;
533
+ let s = !1;
534
+ function o(i) {
535
+ if (i = be(i), i) {
536
+ const l = a.findKey(r, i);
537
+ l && (!n || Je(r, r[l], l, n)) && (delete r[l], s = !0);
538
+ }
539
+ }
540
+ return a.isArray(t) ? t.forEach(o) : o(t), s;
541
+ }
542
+ clear(t) {
543
+ const n = Object.keys(this);
544
+ let r = n.length, s = !1;
545
+ for (; r--; ) {
546
+ const o = n[r];
547
+ (!t || Je(this, this[o], o, t, !0)) && (delete this[o], s = !0);
548
+ }
549
+ return s;
550
+ }
551
+ normalize(t) {
552
+ const n = this, r = {};
553
+ return a.forEach(this, (s, o) => {
554
+ const i = a.findKey(r, o);
555
+ if (i) {
556
+ n[i] = Ie(s), delete n[o];
557
+ return;
558
+ }
559
+ const l = t ? Dr(o) : String(o).trim();
560
+ l !== o && delete n[o], n[l] = Ie(s), r[l] = !0;
561
+ }), this;
562
+ }
563
+ concat(...t) {
564
+ return this.constructor.concat(this, ...t);
565
+ }
566
+ toJSON(t) {
567
+ const n = /* @__PURE__ */ Object.create(null);
568
+ return a.forEach(this, (r, s) => {
569
+ r != null && r !== !1 && (n[s] = t && a.isArray(r) ? r.join(", ") : r);
570
+ }), n;
571
+ }
572
+ [Symbol.iterator]() {
573
+ return Object.entries(this.toJSON())[Symbol.iterator]();
574
+ }
575
+ toString() {
576
+ return Object.entries(this.toJSON()).map(([t, n]) => t + ": " + n).join(`
577
+ `);
578
+ }
579
+ getSetCookie() {
580
+ const t = this.get("set-cookie");
581
+ return a.isArray(t) ? t : t == null || t === !1 ? [] : [t];
582
+ }
583
+ get [Symbol.toStringTag]() {
584
+ return "AxiosHeaders";
585
+ }
586
+ static from(t) {
587
+ return t instanceof this ? t : new this(t);
588
+ }
589
+ static parseParameters(t) {
590
+ return vr(t);
591
+ }
592
+ static concat(t, ...n) {
593
+ const r = new this(t);
594
+ return n.forEach((s) => r.set(s)), r;
595
+ }
596
+ static accessor(t) {
597
+ const r = (this[Et] = this[Et] = {
598
+ accessors: {}
599
+ }).accessors, s = this.prototype;
600
+ function o(i) {
601
+ const l = be(i);
602
+ r[l] || (Nr(s, i), r[l] = !0);
603
+ }
604
+ return a.isArray(t) ? t.forEach(o) : o(t), this;
605
+ }
606
+ };
607
+ k.accessor([
608
+ "Content-Type",
609
+ "Content-Length",
610
+ "Accept",
611
+ "Accept-Encoding",
612
+ "User-Agent",
613
+ "Authorization"
614
+ ]);
615
+ a.reduceDescriptors(k.prototype, ({ value: e }, t) => {
616
+ let n = t[0].toUpperCase() + t.slice(1);
617
+ return {
618
+ get: () => e,
619
+ set(r) {
620
+ this[n] = r;
621
+ }
622
+ };
623
+ });
624
+ a.freezeMethods(k);
625
+ const je = "[REDACTED ****]";
626
+ function Lr(e) {
627
+ if (a.hasOwnProp(e, "toJSON"))
628
+ return !0;
629
+ let t = Object.getPrototypeOf(e);
630
+ for (; t && t !== Object.prototype; ) {
631
+ if (a.hasOwnProp(t, "toJSON"))
632
+ return !0;
633
+ t = Object.getPrototypeOf(t);
634
+ }
635
+ return !1;
636
+ }
637
+ function Fr(e, t) {
638
+ const n = new Set(t.map((o) => String(o).toLowerCase())), r = [], s = (o) => {
639
+ if (o === null || typeof o != "object" || a.isBuffer(o)) return o;
640
+ if (r.indexOf(o) !== -1) return;
641
+ o instanceof k && (o = o.toJSON()), r.push(o);
642
+ let i;
643
+ if (a.isArray(o))
644
+ i = [], o.forEach((l, u) => {
645
+ const d = s(l);
646
+ a.isUndefined(d) || (i[u] = d);
647
+ });
648
+ else {
649
+ if (!a.isPlainObject(o) && Lr(o))
650
+ return r.pop(), o;
651
+ i = /* @__PURE__ */ Object.create(null);
652
+ for (const [l, u] of Object.entries(o)) {
653
+ const d = n.has(l.toLowerCase()) ? je : s(u);
654
+ a.isUndefined(d) || (i[l] = d);
655
+ }
656
+ }
657
+ return r.pop(), i;
658
+ };
659
+ return s(e);
660
+ }
661
+ function St(e) {
662
+ try {
663
+ return String(e);
664
+ } catch {
665
+ return "";
666
+ }
667
+ }
668
+ function Ur(e) {
669
+ return e.errors.map((n) => {
670
+ try {
671
+ return n && n.message ? St(n.message) : St(n);
672
+ } catch {
673
+ return "";
674
+ }
675
+ }).filter(Boolean).join("; ") || e.name || "AggregateError";
676
+ }
677
+ let w = class Zt extends Error {
678
+ static from(t, n, r, s, o, i) {
679
+ let l = t.message;
680
+ !l && a.isArray(t.errors) && t.errors.length && (l = Ur(t));
681
+ const u = new Zt(l, n || t.code, r, s, o);
682
+ return Object.defineProperty(u, "cause", {
683
+ __proto__: null,
684
+ value: t,
685
+ writable: !0,
686
+ enumerable: !1,
687
+ configurable: !0
688
+ }), u.name = t.name, t.status != null && u.status == null && (u.status = t.status), i && Object.assign(u, i), u;
689
+ }
690
+ /**
691
+ * Create an Error with the specified message, config, error code, request and response.
692
+ *
693
+ * @param {string} message The error message.
694
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
695
+ * @param {Object} [config] The config.
696
+ * @param {Object} [request] The request.
697
+ * @param {Object} [response] The response.
698
+ *
699
+ * @returns {Error} The created error.
700
+ */
701
+ constructor(t, n, r, s, o) {
702
+ super(t), Object.defineProperty(this, "message", {
703
+ // Null-proto descriptor so a polluted Object.prototype.get cannot turn
704
+ // this data descriptor into an accessor descriptor on the way in.
705
+ __proto__: null,
706
+ value: t,
707
+ enumerable: !0,
708
+ writable: !0,
709
+ configurable: !0
710
+ }), this.name = "AxiosError", this.isAxiosError = !0, n && (this.code = n), r && (this.config = r), s && (this.request = s), o && (this.response = o, this.status = o.status);
711
+ }
712
+ toJSON() {
713
+ const t = this.config, n = t && a.hasOwnProp(t, "redact") ? t.redact : void 0, r = a.isArray(n) && n.length > 0 ? Fr(t, n) : a.toJSONObject(t);
714
+ return {
715
+ // Standard
716
+ message: this.message,
717
+ name: this.name,
718
+ // Microsoft
719
+ description: this.description,
720
+ number: this.number,
721
+ // Mozilla
722
+ fileName: this.fileName,
723
+ lineNumber: this.lineNumber,
724
+ columnNumber: this.columnNumber,
725
+ stack: this.stack,
726
+ // Axios
727
+ config: r,
728
+ code: this.code,
729
+ status: this.status
730
+ };
731
+ }
732
+ };
733
+ w.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
734
+ w.ERR_BAD_OPTION = "ERR_BAD_OPTION";
735
+ w.ECONNABORTED = "ECONNABORTED";
736
+ w.ETIMEDOUT = "ETIMEDOUT";
737
+ w.ECONNREFUSED = "ECONNREFUSED";
738
+ w.ERR_NETWORK = "ERR_NETWORK";
739
+ w.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
740
+ w.ERR_DEPRECATED = "ERR_DEPRECATED";
741
+ w.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
742
+ w.ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
743
+ w.ERR_CANCELED = "ERR_CANCELED";
744
+ w.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
745
+ w.ERR_INVALID_URL = "ERR_INVALID_URL";
746
+ w.ERR_FORM_DATA_DEPTH_EXCEEDED = "ERR_FORM_DATA_DEPTH_EXCEEDED";
747
+ const Ir = null, Qt = 100;
748
+ function tt(e) {
749
+ return a.isPlainObject(e) || a.isArray(e);
750
+ }
751
+ function en(e) {
752
+ return a.endsWith(e, "[]") ? e.slice(0, -2) : e;
753
+ }
754
+ function Ke(e, t, n) {
755
+ return e ? e.concat(t).map(function(s, o) {
756
+ return s = en(s), !n && o ? "[" + s + "]" : s;
757
+ }).join(n ? "." : "") : t;
758
+ }
759
+ function kr(e) {
760
+ return a.isArray(e) && !e.some(tt);
761
+ }
762
+ const Br = a.toFlatObject(a, {}, null, function(t) {
763
+ return /^is[A-Z]/.test(t);
764
+ });
765
+ function He(e, t, n) {
766
+ if (!a.isObject(e))
767
+ throw new TypeError("target must be an object");
768
+ t = t || new FormData(), n = a.toFlatObject(
769
+ n,
770
+ {
771
+ metaTokens: !0,
772
+ dots: !1,
773
+ indexes: !1
774
+ },
775
+ !1,
776
+ function(y, g) {
777
+ return !a.isUndefined(g[y]);
778
+ }
779
+ );
780
+ const r = n.metaTokens, s = n.visitor || _, o = n.dots, i = n.indexes, l = n.Blob || typeof Blob < "u" && Blob, u = n.maxDepth === void 0 ? Qt : n.maxDepth, d = l && a.isSpecCompliantForm(t), f = [];
781
+ if (!a.isFunction(s))
782
+ throw new TypeError("visitor must be a function");
783
+ function p(c) {
784
+ if (c === null) return "";
785
+ if (a.isDate(c))
786
+ return c.toISOString();
787
+ if (a.isBoolean(c))
788
+ return c.toString();
789
+ if (!d && a.isBlob(c))
790
+ throw new w("Blob is not supported. Use a Buffer instead.");
791
+ if (a.isArrayBuffer(c) || a.isTypedArray(c)) {
792
+ if (d && typeof l == "function")
793
+ return new l([c]);
794
+ throw new w("Blob is not supported. Use a Buffer instead.", w.ERR_NOT_SUPPORT);
795
+ }
796
+ return c;
797
+ }
798
+ function S(c) {
799
+ if (c > u)
800
+ throw new w(
801
+ "Object is too deeply nested (" + c + " levels). Max depth: " + u,
802
+ w.ERR_FORM_DATA_DEPTH_EXCEEDED
803
+ );
804
+ }
805
+ function O(c, y) {
806
+ if (u === 1 / 0)
807
+ return JSON.stringify(c);
808
+ const g = [];
809
+ return JSON.stringify(c, function(T, C) {
810
+ if (!a.isObject(C))
811
+ return C;
812
+ for (; g.length && g[g.length - 1] !== this; )
813
+ g.pop();
814
+ return g.push(C), S(y + g.length - 1), C;
815
+ });
816
+ }
817
+ function _(c, y, g) {
818
+ let E = c;
819
+ if (a.isReactNative(t) && a.isReactNativeBlob(c))
820
+ return t.append(Ke(g, y, o), p(c)), !1;
821
+ if (c && !g && typeof c == "object") {
822
+ if (a.endsWith(y, "{}"))
823
+ y = r ? y : y.slice(0, -2), c = O(c, 1);
824
+ else if (a.isArray(c) && kr(c) || (a.isFileList(c) || a.endsWith(y, "[]")) && (E = a.toArray(c)))
825
+ return y = en(y), E.forEach(function(C, L) {
826
+ !(a.isUndefined(C) || C === null) && t.append(
827
+ // eslint-disable-next-line no-nested-ternary
828
+ i === !0 ? Ke([y], L, o) : i === null ? y : y + "[]",
829
+ p(C)
830
+ );
831
+ }), !1;
832
+ }
833
+ return tt(c) ? !0 : (t.append(Ke(g, y, o), p(c)), !1);
834
+ }
835
+ const A = Object.assign(Br, {
836
+ defaultVisitor: _,
837
+ convertValue: p,
838
+ isVisitable: tt
839
+ });
840
+ function h(c, y, g = 0) {
841
+ if (!a.isUndefined(c)) {
842
+ if (S(g), f.indexOf(c) !== -1)
843
+ throw new Error("Circular reference detected in " + y.join("."));
844
+ f.push(c), a.forEach(c, function(T, C) {
845
+ (!(a.isUndefined(T) || T === null) && s.call(t, T, a.isString(C) ? C.trim() : C, y, A)) === !0 && h(T, y ? y.concat(C) : [C], g + 1);
846
+ }), f.pop();
847
+ }
848
+ }
849
+ if (!a.isObject(e))
850
+ throw new TypeError("data must be an object");
851
+ return h(e), t;
852
+ }
853
+ function Rt(e) {
854
+ const t = {
855
+ "!": "%21",
856
+ "'": "%27",
857
+ "(": "%28",
858
+ ")": "%29",
859
+ "~": "%7E",
860
+ "%20": "+"
861
+ };
862
+ return encodeURIComponent(e).replace(/[!'()~]|%20/g, function(r) {
863
+ return t[r];
864
+ });
865
+ }
866
+ function it(e, t) {
867
+ this._pairs = [], e && He(e, this, t);
868
+ }
869
+ const tn = it.prototype;
870
+ tn.append = function(t, n) {
871
+ this._pairs.push([t, n]);
872
+ };
873
+ tn.toString = function(t) {
874
+ const n = t ? (r) => t.call(this, r, Rt) : Rt;
875
+ return this._pairs.map(function(s) {
876
+ return n(s[0]) + "=" + n(s[1]);
877
+ }, "").join("&");
878
+ };
879
+ function jr(e) {
880
+ return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
881
+ }
882
+ function nn(e, t, n) {
883
+ if (!t)
884
+ return e;
885
+ e = e || "";
886
+ const r = a.isFunction(n) ? {
887
+ serialize: n
888
+ } : n, s = a.getSafeProp(r, "encode") || jr, o = a.getSafeProp(r, "serialize");
889
+ let i;
890
+ if (o ? i = o(t, r) : i = a.isURLSearchParams(t) ? t.toString() : new it(t, r).toString(s), i) {
891
+ const l = e.indexOf("#");
892
+ l !== -1 && (e = e.slice(0, l)), e += (e.indexOf("?") === -1 ? "?" : "&") + i;
893
+ }
894
+ return e;
895
+ }
896
+ class _t {
897
+ constructor() {
898
+ this.handlers = [];
899
+ }
900
+ /**
901
+ * Add a new interceptor to the stack
902
+ *
903
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
904
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
905
+ * @param {Object} options The options for the interceptor, synchronous and runWhen
906
+ *
907
+ * @return {Number} An ID used to remove interceptor later
908
+ */
909
+ use(t, n, r) {
910
+ return this.handlers.push({
911
+ fulfilled: t,
912
+ rejected: n,
913
+ synchronous: r ? r.synchronous : !1,
914
+ runWhen: r ? r.runWhen : null
915
+ }), this.handlers.length - 1;
916
+ }
917
+ /**
918
+ * Remove an interceptor from the stack
919
+ *
920
+ * @param {Number} id The ID that was returned by `use`
921
+ *
922
+ * @returns {void}
923
+ */
924
+ eject(t) {
925
+ this.handlers[t] && (this.handlers[t] = null);
926
+ }
927
+ /**
928
+ * Clear all interceptors from the stack
929
+ *
930
+ * @returns {void}
931
+ */
932
+ clear() {
933
+ this.handlers && (this.handlers = []);
934
+ }
935
+ /**
936
+ * Iterate over all the registered interceptors
937
+ *
938
+ * This method is particularly useful for skipping over any
939
+ * interceptors that may have become `null` calling `eject`.
940
+ *
941
+ * @param {Function} fn The function to call for each interceptor
942
+ *
943
+ * @returns {void}
944
+ */
945
+ forEach(t) {
946
+ a.forEach(this.handlers, function(r) {
947
+ r !== null && t(r);
948
+ });
949
+ }
950
+ }
951
+ const at = {
952
+ silentJSONParsing: !0,
953
+ forcedJSONParsing: !0,
954
+ clarifyTimeoutError: !1,
955
+ legacyInterceptorReqResOrdering: !0,
956
+ advertiseZstdAcceptEncoding: !1,
957
+ validateStatusUndefinedResolves: !0
958
+ }, Mr = typeof URLSearchParams < "u" ? URLSearchParams : it, qr = typeof FormData < "u" ? FormData : null, Hr = typeof Blob < "u" ? Blob : null, zr = {
959
+ isBrowser: !0,
960
+ classes: {
961
+ URLSearchParams: Mr,
962
+ FormData: qr,
963
+ Blob: Hr
964
+ },
965
+ protocols: ["http", "https", "file", "blob", "url", "data"]
966
+ }, lt = typeof window < "u" && typeof document < "u", nt = typeof navigator == "object" && navigator || void 0, $r = lt && (!nt || ["ReactNative", "NativeScript", "NS"].indexOf(nt.product) < 0), Vr = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
967
+ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Wr = lt && window.location.href || "http://localhost", Jr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
968
+ __proto__: null,
969
+ hasBrowserEnv: lt,
970
+ hasStandardBrowserEnv: $r,
971
+ hasStandardBrowserWebWorkerEnv: Vr,
972
+ navigator: nt,
973
+ origin: Wr
974
+ }, Symbol.toStringTag, { value: "Module" })), U = {
975
+ ...Jr,
976
+ ...zr
977
+ };
978
+ function Kr(e, t) {
979
+ return He(e, new U.classes.URLSearchParams(), {
980
+ visitor: function(n, r, s, o) {
981
+ return U.isNode && a.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
982
+ },
983
+ ...t
984
+ });
985
+ }
986
+ const Ot = Qt;
987
+ function rn(e) {
988
+ if (e > Ot)
989
+ throw new w(
990
+ "FormData field is too deeply nested (" + e + " levels). Max depth: " + Ot,
991
+ w.ERR_FORM_DATA_DEPTH_EXCEEDED
992
+ );
993
+ }
994
+ function Gr(e) {
995
+ const t = [], n = /[^.[\]]+|\[([^.[\]]*)]/g;
996
+ let r;
997
+ for (; (r = n.exec(e)) !== null; )
998
+ rn(t.length), t.push(r[0] === "[]" ? "" : r[1] || r[0]);
999
+ return t;
1000
+ }
1001
+ function Xr(e) {
1002
+ const t = {}, n = Object.keys(e);
1003
+ let r;
1004
+ const s = n.length;
1005
+ let o;
1006
+ for (r = 0; r < s; r++)
1007
+ o = n[r], t[o] = e[o];
1008
+ return t;
1009
+ }
1010
+ function sn(e) {
1011
+ function t(n, r, s, o) {
1012
+ rn(o);
1013
+ let i = n[o++];
1014
+ if (i === "__proto__") return !0;
1015
+ const l = Number.isFinite(+i), u = o >= n.length;
1016
+ return i = !i && a.isArray(s) ? s.length : i, u ? (a.hasOwnProp(s, i) ? s[i] = a.isArray(s[i]) ? s[i].concat(r) : [s[i], r] : s[i] = r, !l) : ((!a.hasOwnProp(s, i) || !a.isObject(s[i])) && (s[i] = []), t(n, r, s[i], o) && a.isArray(s[i]) && (s[i] = Xr(s[i])), !l);
1017
+ }
1018
+ if (a.isFormData(e) && a.isFunction(e.entries)) {
1019
+ const n = {};
1020
+ return a.forEachEntry(e, (r, s) => {
1021
+ t(Gr(r), s, n, 0);
1022
+ }), n;
1023
+ }
1024
+ return null;
1025
+ }
1026
+ const de = (e, t) => e != null && a.hasOwnProp(e, t) ? e[t] : void 0;
1027
+ function Yr(e, t, n) {
1028
+ if (a.isString(e))
1029
+ try {
1030
+ return (t || JSON.parse)(e), a.trim(e);
1031
+ } catch (r) {
1032
+ if (r.name !== "SyntaxError")
1033
+ throw r;
1034
+ }
1035
+ return (n || JSON.stringify)(e);
1036
+ }
1037
+ const Te = {
1038
+ transitional: at,
1039
+ adapter: ["xhr", "http", "fetch"],
1040
+ transformRequest: [
1041
+ function(t, n) {
1042
+ const r = n.getContentType() || "", s = r.indexOf("application/json") > -1, o = a.isObject(t);
1043
+ if (o && a.isHTMLForm(t) && (t = new FormData(t)), a.isFormData(t))
1044
+ return s ? JSON.stringify(sn(t)) : t;
1045
+ if (a.isArrayBuffer(t) || a.isBuffer(t) || a.isStream(t) || a.isFile(t) || a.isBlob(t) || a.isReadableStream(t))
1046
+ return t;
1047
+ if (a.isArrayBufferView(t))
1048
+ return t.buffer;
1049
+ if (a.isURLSearchParams(t))
1050
+ return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
1051
+ let l;
1052
+ if (o) {
1053
+ const u = de(this, "formSerializer");
1054
+ if (r.indexOf("application/x-www-form-urlencoded") > -1)
1055
+ return Kr(t, u).toString();
1056
+ if ((l = a.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
1057
+ const d = de(this, "env"), f = d && d.FormData;
1058
+ return He(
1059
+ l ? { "files[]": t } : t,
1060
+ f && new f(),
1061
+ u
1062
+ );
1063
+ }
1064
+ }
1065
+ return o || s ? (n.setContentType("application/json", !1), Yr(t)) : t;
1066
+ }
1067
+ ],
1068
+ transformResponse: [
1069
+ function(t) {
1070
+ const n = de(this, "transitional") || Te.transitional, r = n && n.forcedJSONParsing, s = de(this, "responseType"), o = s === "json";
1071
+ if (a.isResponse(t) || a.isReadableStream(t))
1072
+ return t;
1073
+ if (t && a.isString(t) && (r && !s || o)) {
1074
+ const l = !(n && n.silentJSONParsing) && o;
1075
+ try {
1076
+ return JSON.parse(t, de(this, "parseReviver"));
1077
+ } catch (u) {
1078
+ if (l)
1079
+ throw u.name === "SyntaxError" ? w.from(u, w.ERR_BAD_RESPONSE, this, null, de(this, "response")) : u;
1080
+ }
1081
+ }
1082
+ return t;
1083
+ }
1084
+ ],
1085
+ /**
1086
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
1087
+ * timeout is not created.
1088
+ */
1089
+ timeout: 0,
1090
+ xsrfCookieName: "XSRF-TOKEN",
1091
+ xsrfHeaderName: "X-XSRF-TOKEN",
1092
+ maxContentLength: -1,
1093
+ maxBodyLength: -1,
1094
+ env: {
1095
+ FormData: U.classes.FormData,
1096
+ Blob: U.classes.Blob
1097
+ },
1098
+ validateStatus: function(t) {
1099
+ return t >= 200 && t < 300;
1100
+ },
1101
+ headers: {
1102
+ common: {
1103
+ Accept: "application/json, text/plain, */*",
1104
+ "Content-Type": void 0
1105
+ }
1106
+ }
1107
+ };
1108
+ a.forEach(["delete", "get", "head", "post", "put", "patch", "query"], (e) => {
1109
+ Te.headers[e] = {};
1110
+ });
1111
+ function Ge(e, t) {
1112
+ const n = this || Te, r = t || n, s = k.from(r.headers);
1113
+ let o = r.data;
1114
+ return a.forEach(e, function(l) {
1115
+ o = l.call(n, o, s.normalize(), t ? t.status : void 0);
1116
+ }), s.normalize(), o;
1117
+ }
1118
+ function on(e) {
1119
+ return !!(e && e.__CANCEL__);
1120
+ }
1121
+ let Ce = class extends w {
1122
+ /**
1123
+ * A `CanceledError` is an object that is thrown when an operation is canceled.
1124
+ *
1125
+ * @param {string=} message The message.
1126
+ * @param {Object=} config The config.
1127
+ * @param {Object=} request The request.
1128
+ *
1129
+ * @returns {CanceledError} The created error.
1130
+ */
1131
+ constructor(t, n, r) {
1132
+ super(t ?? "canceled", w.ERR_CANCELED, n, r), this.name = "CanceledError", this.__CANCEL__ = !0;
1133
+ }
1134
+ };
1135
+ function an(e, t, n) {
1136
+ const r = n.config.validateStatus;
1137
+ !n.status || !r || r(n.status) ? e(n) : t(new w(
1138
+ "Request failed with status code " + n.status,
1139
+ n.status >= 400 && n.status < 500 ? w.ERR_BAD_REQUEST : w.ERR_BAD_RESPONSE,
1140
+ n.config,
1141
+ n.request,
1142
+ n
1143
+ ));
1144
+ }
1145
+ function Zr(e) {
1146
+ const t = /^([-+\w]{1,25}):(?:\/\/)?/.exec(e);
1147
+ return t && t[1] || "";
1148
+ }
1149
+ function Qr(e, t) {
1150
+ e = e || 10;
1151
+ const n = new Array(e), r = new Array(e);
1152
+ let s = 0, o = 0, i;
1153
+ return t = t !== void 0 ? t : 1e3, function(u) {
1154
+ const d = Date.now(), f = r[o];
1155
+ i || (i = d), n[s] = u, r[s] = d;
1156
+ let p = o, S = 0;
1157
+ for (; p !== s; )
1158
+ S += n[p++], p = p % e;
1159
+ if (s = (s + 1) % e, s === o && (o = (o + 1) % e), d - i < t)
1160
+ return;
1161
+ const O = f && d - f;
1162
+ return O ? Math.round(S * 1e3 / O) : void 0;
1163
+ };
1164
+ }
1165
+ function es(e, t) {
1166
+ let n = 0, r = 1e3 / t, s, o;
1167
+ const i = (d, f = Date.now()) => {
1168
+ n = f, s = null, o && (clearTimeout(o), o = null), e(...d);
1169
+ };
1170
+ return [(...d) => {
1171
+ const f = Date.now(), p = f - n;
1172
+ p >= r ? i(d, f) : (s = d, o || (o = setTimeout(() => {
1173
+ o = null, i(s);
1174
+ }, r - p)));
1175
+ }, () => s && i(s)];
1176
+ }
1177
+ const Me = (e, t, n = 3) => {
1178
+ let r = 0;
1179
+ const s = Qr(50, 250);
1180
+ return es((o) => {
1181
+ if (!o || typeof o.loaded != "number")
1182
+ return;
1183
+ const i = o.loaded, l = o.lengthComputable ? o.total : void 0, u = Math.max(0, l != null ? Math.min(i, l) : i), d = Math.max(0, u - r), f = s(d);
1184
+ r = Math.max(r, u);
1185
+ const p = {
1186
+ loaded: u,
1187
+ total: l,
1188
+ progress: l ? u / l : void 0,
1189
+ bytes: d,
1190
+ rate: f || void 0,
1191
+ estimated: f && l ? (l - u) / f : void 0,
1192
+ event: o,
1193
+ lengthComputable: l != null,
1194
+ [t ? "download" : "upload"]: !0
1195
+ };
1196
+ e(p);
1197
+ }, n);
1198
+ }, At = (e, t) => {
1199
+ const n = e != null;
1200
+ return [
1201
+ (r) => t[0]({
1202
+ lengthComputable: n,
1203
+ total: e,
1204
+ loaded: r
1205
+ }),
1206
+ t[1]
1207
+ ];
1208
+ }, Tt = (e, t = a.asap) => (...n) => t(() => e(...n)), ts = U.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, U.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
1209
+ new URL(U.origin),
1210
+ U.navigator && /(msie|trident)/i.test(U.navigator.userAgent)
1211
+ ) : () => !0, ns = U.hasStandardBrowserEnv ? (
1212
+ // Standard browser envs support document.cookie
1213
+ {
1214
+ write(e, t, n, r, s, o, i) {
1215
+ if (typeof document > "u") return;
1216
+ const l = [`${e}=${encodeURIComponent(t)}`];
1217
+ a.isNumber(n) && l.push(`expires=${new Date(n).toUTCString()}`), a.isString(r) && l.push(`path=${r}`), a.isString(s) && l.push(`domain=${s}`), o === !0 && l.push("secure"), a.isString(i) && l.push(`SameSite=${i}`), document.cookie = l.join("; ");
1218
+ },
1219
+ read(e) {
1220
+ if (typeof document > "u") return null;
1221
+ const t = document.cookie.split(";");
1222
+ for (let n = 0; n < t.length; n++) {
1223
+ const r = t[n].replace(/^\s+/, ""), s = r.indexOf("=");
1224
+ if (s !== -1 && r.slice(0, s) === e)
1225
+ try {
1226
+ return decodeURIComponent(r.slice(s + 1));
1227
+ } catch {
1228
+ return r.slice(s + 1);
1229
+ }
1230
+ }
1231
+ return null;
1232
+ },
1233
+ remove(e) {
1234
+ this.write(e, "", Date.now() - 864e5, "/");
1235
+ }
1236
+ }
1237
+ ) : (
1238
+ // Non-standard browser env (web workers, react-native) lack needed support.
1239
+ {
1240
+ write() {
1241
+ },
1242
+ read() {
1243
+ return null;
1244
+ },
1245
+ remove() {
1246
+ }
1247
+ }
1248
+ );
1249
+ function rs(e) {
1250
+ return typeof e != "string" ? !1 : /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
1251
+ }
1252
+ function ss(e, t) {
1253
+ if (!t)
1254
+ return e;
1255
+ let n = e.length;
1256
+ for (; n > 0 && e.charCodeAt(n - 1) === 47; )
1257
+ n--;
1258
+ return e.slice(0, n) + "/" + t.replace(/^\/+/, "");
1259
+ }
1260
+ const os = /^https?:(?!\/\/)/i, is = /[\t\n\r]/g;
1261
+ function as(e) {
1262
+ let t = 0;
1263
+ for (; t < e.length && e.charCodeAt(t) <= 32; )
1264
+ t++;
1265
+ return e.slice(t);
1266
+ }
1267
+ function ls(e) {
1268
+ return as(e).replace(is, "");
1269
+ }
1270
+ function cs(e) {
1271
+ return e && e.replace(/(^|&)([^=&]*=)?[^&]+/g, (t, n, r = "") => `${n}${r}${je}`);
1272
+ }
1273
+ function us(e) {
1274
+ const t = e.replace(/^(https?:\/{0,2})[^/?#]*@/i, `$1${je}@`), n = t.indexOf("#"), s = (n === -1 ? t : t.slice(0, n)).replace(
1275
+ /([?&][^=&#]*=)[^&#]*/g,
1276
+ `$1${je}`
1277
+ );
1278
+ return n === -1 ? s : `${s}#${cs(t.slice(n + 1))}`;
1279
+ }
1280
+ function Ct(e, t) {
1281
+ if (typeof e == "string") {
1282
+ const n = ls(e);
1283
+ if (os.test(n))
1284
+ throw new w(
1285
+ `Invalid URL ${JSON.stringify(us(n))}: missing "//" after protocol`,
1286
+ w.ERR_INVALID_URL,
1287
+ t
1288
+ );
1289
+ }
1290
+ }
1291
+ function ln(e, t, n, r) {
1292
+ Ct(t, r);
1293
+ let s = !rs(t);
1294
+ return e && (s || n === !1) ? (Ct(e, r), ss(e, t)) : t;
1295
+ }
1296
+ const xt = (e) => e instanceof k ? { ...e } : e, fs = (e) => Object.getOwnPropertySymbols && Object.getOwnPropertyDescriptor ? Object.keys(e).concat(
1297
+ Object.getOwnPropertySymbols(e).filter(
1298
+ (t) => Object.getOwnPropertyDescriptor(e, t).enumerable
1299
+ )
1300
+ ) : Object.keys(e);
1301
+ function ae(e, t) {
1302
+ e = e || {}, t = t || {};
1303
+ const n = /* @__PURE__ */ Object.create(null);
1304
+ Object.defineProperty(n, "hasOwnProperty", {
1305
+ // Null-proto descriptor so a polluted Object.prototype.get cannot turn
1306
+ // this data descriptor into an accessor descriptor on the way in.
1307
+ __proto__: null,
1308
+ value: Object.prototype.hasOwnProperty,
1309
+ enumerable: !1,
1310
+ writable: !0,
1311
+ configurable: !0
1312
+ });
1313
+ function r(f, p, S, O) {
1314
+ return a.isPlainObject(f) && a.isPlainObject(p) ? a.merge.call({ caseless: O }, f, p) : a.isPlainObject(p) ? a.merge({}, p) : a.isArray(p) ? p.slice() : p;
1315
+ }
1316
+ function s(f, p, S, O) {
1317
+ if (a.isUndefined(p)) {
1318
+ if (!a.isUndefined(f))
1319
+ return r(void 0, f, S, O);
1320
+ } else return r(f, p, S, O);
1321
+ }
1322
+ function o(f, p) {
1323
+ if (!a.isUndefined(p))
1324
+ return r(void 0, p);
1325
+ }
1326
+ function i(f, p) {
1327
+ if (a.isUndefined(p)) {
1328
+ if (!a.isUndefined(f))
1329
+ return r(void 0, f);
1330
+ } else return r(void 0, p);
1331
+ }
1332
+ function l(f) {
1333
+ const p = a.hasOwnProp(t, "transitional") ? t.transitional : void 0;
1334
+ if (!a.isUndefined(p))
1335
+ if (a.isPlainObject(p)) {
1336
+ if (a.hasOwnProp(p, f))
1337
+ return p[f];
1338
+ } else
1339
+ return;
1340
+ const S = a.hasOwnProp(e, "transitional") ? e.transitional : void 0;
1341
+ if (a.isPlainObject(S) && a.hasOwnProp(S, f))
1342
+ return S[f];
1343
+ }
1344
+ function u(f, p, S) {
1345
+ if (a.hasOwnProp(t, S))
1346
+ return r(f, p);
1347
+ if (a.hasOwnProp(e, S))
1348
+ return r(void 0, f);
1349
+ }
1350
+ const d = {
1351
+ url: o,
1352
+ method: o,
1353
+ data: o,
1354
+ baseURL: i,
1355
+ transformRequest: i,
1356
+ transformResponse: i,
1357
+ paramsSerializer: i,
1358
+ timeout: i,
1359
+ timeoutMessage: i,
1360
+ withCredentials: i,
1361
+ withXSRFToken: i,
1362
+ adapter: i,
1363
+ responseType: i,
1364
+ xsrfCookieName: i,
1365
+ xsrfHeaderName: i,
1366
+ onUploadProgress: i,
1367
+ onDownloadProgress: i,
1368
+ decompress: i,
1369
+ maxContentLength: i,
1370
+ maxBodyLength: i,
1371
+ beforeRedirect: i,
1372
+ transport: i,
1373
+ httpAgent: i,
1374
+ httpsAgent: i,
1375
+ cancelToken: i,
1376
+ socketPath: i,
1377
+ allowedSocketPaths: i,
1378
+ responseEncoding: i,
1379
+ validateStatus: u,
1380
+ headers: (f, p, S) => s(xt(f), xt(p), S, !0)
1381
+ };
1382
+ return a.forEach(fs({ ...e, ...t }), function(p) {
1383
+ if (p === "__proto__" || p === "constructor" || p === "prototype") return;
1384
+ const S = a.hasOwnProp(d, p) ? d[p] : s, O = a.hasOwnProp(e, p) ? e[p] : void 0, _ = a.hasOwnProp(t, p) ? t[p] : void 0, A = S(O, _, p);
1385
+ a.isUndefined(A) && S !== u || (n[p] = A);
1386
+ }), a.hasOwnProp(t, "validateStatus") && a.isUndefined(t.validateStatus) && l("validateStatusUndefinedResolves") === !1 && (a.hasOwnProp(e, "validateStatus") ? n.validateStatus = r(void 0, e.validateStatus) : delete n.validateStatus), n;
1387
+ }
1388
+ const ds = ["content-type", "content-length"];
1389
+ function ps(e, t, n) {
1390
+ if (n !== "content-only") {
1391
+ e.set(t);
1392
+ return;
1393
+ }
1394
+ Object.entries(t || {}).forEach(([r, s]) => {
1395
+ ds.includes(r.toLowerCase()) && e.set(r, s);
1396
+ });
1397
+ }
1398
+ const hs = (e) => encodeURIComponent(e).replace(
1399
+ /%([0-9A-F]{2})/gi,
1400
+ (t, n) => String.fromCharCode(parseInt(n, 16))
1401
+ );
1402
+ function cn(e) {
1403
+ const t = ae({}, e), n = (S) => a.hasOwnProp(t, S) ? t[S] : void 0, r = n("data");
1404
+ let s = n("withXSRFToken");
1405
+ const o = n("xsrfHeaderName"), i = n("xsrfCookieName");
1406
+ let l = n("headers");
1407
+ const u = n("auth"), d = n("baseURL"), f = n("allowAbsoluteUrls"), p = n("url");
1408
+ if (t.headers = l = k.from(l), t.url = nn(
1409
+ ln(d, p, f, t),
1410
+ n("params"),
1411
+ n("paramsSerializer")
1412
+ ), u) {
1413
+ const S = a.getSafeProp(u, "username") || "", O = a.getSafeProp(u, "password") || "";
1414
+ try {
1415
+ l.set(
1416
+ "Authorization",
1417
+ "Basic " + btoa(S + ":" + (O ? hs(O) : ""))
1418
+ );
1419
+ } catch (_) {
1420
+ throw w.from(_, w.ERR_BAD_OPTION_VALUE, e);
1421
+ }
1422
+ }
1423
+ if (a.isFormData(r) && (U.hasStandardBrowserEnv || U.hasStandardBrowserWebWorkerEnv || a.isReactNative(r) ? l.setContentType(void 0) : a.isFunction(r.getHeaders) && ps(l, r.getHeaders(), n("formDataHeaderPolicy"))), U.hasStandardBrowserEnv && (a.isFunction(s) && (s = s(t)), s === !0 || s == null && ts(t.url))) {
1424
+ const O = o && i && ns.read(i);
1425
+ O && l.set(o, O);
1426
+ }
1427
+ return t;
1428
+ }
1429
+ const ms = typeof XMLHttpRequest < "u", ws = ms && function(e) {
1430
+ return new Promise(function(n, r) {
1431
+ const s = cn(e);
1432
+ let o = s.data;
1433
+ const i = k.from(s.headers).normalize();
1434
+ let { responseType: l, onUploadProgress: u, onDownloadProgress: d } = s, f, p, S, O, _;
1435
+ function A() {
1436
+ O && O(), _ && _(), s.cancelToken && s.cancelToken.unsubscribe(f), s.signal && s.signal.removeEventListener("abort", f);
1437
+ }
1438
+ let h = new XMLHttpRequest();
1439
+ h.open(s.method.toUpperCase(), s.url, !0), h.timeout = s.timeout;
1440
+ function c() {
1441
+ if (!h)
1442
+ return;
1443
+ const g = k.from(
1444
+ "getAllResponseHeaders" in h && h.getAllResponseHeaders()
1445
+ ), T = {
1446
+ data: !l || l === "text" || l === "json" ? h.responseText : h.response,
1447
+ status: h.status,
1448
+ statusText: h.statusText,
1449
+ headers: g,
1450
+ config: e,
1451
+ request: h
1452
+ };
1453
+ an(
1454
+ function(L) {
1455
+ n(L), A();
1456
+ },
1457
+ function(L) {
1458
+ r(L), A();
1459
+ },
1460
+ T
1461
+ ), h = null;
1462
+ }
1463
+ "onloadend" in h ? h.onloadend = c : h.onreadystatechange = function() {
1464
+ !h || h.readyState !== 4 || h.status === 0 && !(h.responseURL && h.responseURL.startsWith("file:")) || setTimeout(c);
1465
+ }, h.onabort = function() {
1466
+ h && (r(new w("Request aborted", w.ECONNABORTED, e, h)), A(), h = null);
1467
+ }, h.onerror = function(E) {
1468
+ const T = E && E.message ? E.message : "Network Error", C = new w(T, w.ERR_NETWORK, e, h);
1469
+ C.event = E || null, r(C), A(), h = null;
1470
+ }, h.ontimeout = function() {
1471
+ let E = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
1472
+ const T = s.transitional || at;
1473
+ s.timeoutErrorMessage && (E = s.timeoutErrorMessage), r(
1474
+ new w(
1475
+ E,
1476
+ T.clarifyTimeoutError ? w.ETIMEDOUT : w.ECONNABORTED,
1477
+ e,
1478
+ h
1479
+ )
1480
+ ), A(), h = null;
1481
+ }, o === void 0 && i.setContentType(null), "setRequestHeader" in h && a.forEach(Yt(i), function(E, T) {
1482
+ h.setRequestHeader(T, E);
1483
+ }), a.isUndefined(s.withCredentials) || (h.withCredentials = !!s.withCredentials), l && l !== "json" && (h.responseType = s.responseType), d && ([S, _] = Me(d, !0), h.addEventListener("progress", S)), u && h.upload && ([p, O] = Me(u), h.upload.addEventListener("progress", p), h.upload.addEventListener("loadend", O)), (s.cancelToken || s.signal) && (f = (g) => {
1484
+ h && (r(!g || g.type ? new Ce(null, e, h) : g), h.abort(), A(), h = null);
1485
+ }, s.cancelToken && s.cancelToken.subscribe(f), s.signal && (s.signal.aborted ? f() : s.signal.addEventListener("abort", f)));
1486
+ const y = Zr(s.url);
1487
+ if (y && !U.protocols.includes(y)) {
1488
+ r(
1489
+ new w(
1490
+ "Unsupported protocol " + y + ":",
1491
+ w.ERR_BAD_REQUEST,
1492
+ e
1493
+ )
1494
+ ), A();
1495
+ return;
1496
+ }
1497
+ h.send(o || null);
1498
+ });
1499
+ }, ys = (e, t) => {
1500
+ if (e = e ? e.filter(Boolean) : [], !t && !e.length)
1501
+ return;
1502
+ const n = new AbortController();
1503
+ let r = !1;
1504
+ const s = function(u) {
1505
+ if (!r) {
1506
+ r = !0, i();
1507
+ const d = u instanceof Error ? u : this.reason;
1508
+ n.abort(
1509
+ d instanceof w ? d : new Ce(d instanceof Error ? d.message : d)
1510
+ );
1511
+ }
1512
+ };
1513
+ let o = t && setTimeout(() => {
1514
+ o = null, s(new w(`timeout of ${t}ms exceeded`, w.ETIMEDOUT));
1515
+ }, t);
1516
+ const i = () => {
1517
+ e && (o && clearTimeout(o), o = null, e.forEach((u) => {
1518
+ u.unsubscribe ? u.unsubscribe(s) : u.removeEventListener("abort", s);
1519
+ }), e = null);
1520
+ };
1521
+ e.forEach((u) => {
1522
+ if (!r) {
1523
+ if (u.aborted) {
1524
+ s.call(u);
1525
+ return;
1526
+ }
1527
+ u.addEventListener("abort", s, { once: !0 });
1528
+ }
1529
+ });
1530
+ const { signal: l } = n;
1531
+ return l.unsubscribe = () => a.asap(i), l;
1532
+ }, gs = function* (e, t) {
1533
+ let n = e.byteLength;
1534
+ if (n < t) {
1535
+ yield e;
1536
+ return;
1537
+ }
1538
+ let r = 0, s;
1539
+ for (; r < n; )
1540
+ s = r + t, yield e.slice(r, s), r = s;
1541
+ }, bs = async function* (e, t) {
1542
+ for await (const n of Es(e))
1543
+ yield* gs(n, t);
1544
+ }, Es = async function* (e) {
1545
+ if (e[Symbol.asyncIterator]) {
1546
+ yield* e;
1547
+ return;
1548
+ }
1549
+ const t = e.getReader();
1550
+ try {
1551
+ for (; ; ) {
1552
+ const { done: n, value: r } = await t.read();
1553
+ if (n)
1554
+ break;
1555
+ yield r;
1556
+ }
1557
+ } finally {
1558
+ await t.cancel();
1559
+ }
1560
+ }, vt = (e, t, n, r) => {
1561
+ const s = bs(e, t);
1562
+ let o = 0, i, l = (u) => {
1563
+ i || (i = !0, r && r(u));
1564
+ };
1565
+ return new ReadableStream(
1566
+ {
1567
+ async pull(u) {
1568
+ try {
1569
+ const { done: d, value: f } = await s.next();
1570
+ if (d) {
1571
+ l(), u.close();
1572
+ return;
1573
+ }
1574
+ let p = f.byteLength;
1575
+ if (n) {
1576
+ let S = o += p;
1577
+ n(S);
1578
+ }
1579
+ u.enqueue(new Uint8Array(f));
1580
+ } catch (d) {
1581
+ throw l(d), d;
1582
+ }
1583
+ },
1584
+ cancel(u) {
1585
+ return l(u), s.return();
1586
+ }
1587
+ },
1588
+ {
1589
+ highWaterMark: 2
1590
+ }
1591
+ );
1592
+ }, Pt = (e) => e >= 48 && e <= 57 || e >= 65 && e <= 70 || e >= 97 && e <= 102, un = (e, t, n) => t + 2 < n && Pt(e.charCodeAt(t + 1)) && Pt(e.charCodeAt(t + 2)), Dt = (e) => e <= 57 ? e - 48 : (e & 223) - 55, Ss = (e) => e >= 65 && e <= 90 || // A-Z
1593
+ e >= 97 && e <= 122 || // a-z
1594
+ e >= 48 && e <= 57 || // 0-9
1595
+ e === 43 || // +
1596
+ e === 47 || // /
1597
+ e === 45 || // - (base64url)
1598
+ e === 95, Rs = (e) => e === 9 || e === 10 || e === 12 || e === 13 || e === 32, _s = (e) => {
1599
+ const t = Math.floor(e / 4), n = e % 4;
1600
+ return t * 3 + (n === 2 ? 1 : n === 3 ? 2 : 0);
1601
+ }, Os = (e) => {
1602
+ const t = e.length;
1603
+ let n = 0;
1604
+ return t > 0 && e.charCodeAt(t - 1) === 61 && (n++, t > 1 && e.charCodeAt(t - 2) === 61 && n++), Math.floor((t - n) * 3 / 4);
1605
+ }, As = (e) => {
1606
+ const t = e.length;
1607
+ let n = 0, r = 0, s = !1;
1608
+ for (let o = 0; o < t; o++) {
1609
+ let i = e.charCodeAt(o);
1610
+ if (i === 37 && un(e, o, t) && (i = Dt(e.charCodeAt(o + 1)) * 16 + Dt(e.charCodeAt(o + 2)), o += 2), !Rs(i)) {
1611
+ if (i === 61) {
1612
+ r++;
1613
+ continue;
1614
+ }
1615
+ if (!Ss(i) || r > 0) {
1616
+ s = !0;
1617
+ continue;
1618
+ }
1619
+ n++;
1620
+ }
1621
+ }
1622
+ return s || r > 2 || r > 0 && (n + r) % 4 !== 0 || n % 4 === 1 ? Os(e) : _s(n);
1623
+ }, Ts = (e, t) => {
1624
+ if (!e || typeof e != "string" || !e.startsWith("data:")) return 0;
1625
+ const n = e.indexOf(",");
1626
+ if (n < 0) return 0;
1627
+ const r = e.slice(5, n), s = e.slice(n + 1);
1628
+ if (/;base64/i.test(r))
1629
+ return t(s);
1630
+ let i = 0;
1631
+ for (let l = 0, u = s.length; l < u; l++) {
1632
+ const d = s.charCodeAt(l);
1633
+ if (d === 37 && un(s, l, u))
1634
+ i += 1, l += 2;
1635
+ else if (d < 128)
1636
+ i += 1;
1637
+ else if (d < 2048)
1638
+ i += 2;
1639
+ else if (d >= 55296 && d <= 56319 && l + 1 < u) {
1640
+ const f = s.charCodeAt(l + 1);
1641
+ f >= 56320 && f <= 57343 ? (i += 4, l++) : i += 3;
1642
+ } else
1643
+ i += 3;
1644
+ }
1645
+ return i;
60
1646
  };
61
- function C(e) {
62
- let t = {};
63
- typeof e?.body == "string" && (t["Content-Type"] = "application/json");
64
- try {
65
- t["Accept-Language"] = localStorage.getItem("language") || navigator.language.split("-")[0] || "en";
66
- } catch {}
67
- return t;
68
- }
69
- function te(e) {
70
- if (e && typeof e == "object" && !Array.isArray(e)) {
71
- let t = e;
72
- if ("code" in t && "data" in t || "success" in t && "data" in t) return null;
73
- }
74
- return e;
75
- }
76
- function w(e) {
77
- let t = e?.message ?? e?.Message ?? e?.errorMessage;
78
- return typeof t == "string" && t ? t : void 0;
79
- }
80
- function T(e) {
81
- if (e instanceof v) return e;
82
- let t = e;
83
- if (t?.isAxiosError) {
84
- if (t.code === "ECONNABORTED" || t.code === "ETIMEDOUT") return new v("error.request.timeout", 408, "");
85
- let e = t.response?.status ?? 0, n = w(t.response?.data) ?? `HTTP ${e || 0}`;
86
- return new v(n, e, n);
87
- }
88
- if (e && typeof e == "object") {
89
- let t = e, n = w(t) ?? "error", r = Number(t.code ?? t.Code ?? t.status) || 0, i = t.error;
90
- return new v(n, r, n, i?.code, i?.category);
91
- }
92
- return typeof e == "string" ? new v(e || "error", 0, e || "error") : e instanceof Error ? new v(e.message || "error", 0, e.message || "error") : new v("error", 0, "");
93
- }
94
- async function E(t, n, r) {
95
- let i = (n?.method ? S[n.method.toUpperCase()] : "get") ?? "get";
96
- try {
97
- return te(await e({
98
- url: t,
99
- method: i,
100
- headers: C(n),
101
- data: n?.body,
102
- notLoading: !0,
103
- ...r ? { responseType: r } : {}
104
- }));
105
- } catch (e) {
106
- throw T(e);
107
- }
108
- }
109
- function D(e) {
110
- let t = new URLSearchParams();
111
- for (let [n, r] of Object.entries(e)) r != null && r !== "" && t.append(n, String(r));
112
- let n = t.toString();
113
- return n ? `?${n}` : "";
114
- }
115
- //#endregion
116
- //#region ../api-client/src/fetch/repo.ts
117
- function O(e, t) {
118
- return E(x(e), t);
119
- }
120
- //#endregion
121
- //#region ../api-client/src/fetch/skill.ts
122
- function k(e, t) {
123
- return E(x(e), t);
124
- }
125
- //#endregion
126
- //#region ../api-client/src/api/custom-skills.ts
127
- var A = `${y}/customSkills`;
128
- async function j(e, t) {
129
- return k(`${A}/listByAuth${D({
130
- page: e.page,
131
- size: e.size,
132
- keyword: e.keyword,
133
- group: e.group,
134
- businessDomain: e.businessDomain,
135
- topic: e.topic,
136
- category: e.category,
137
- repo: e.repo
138
- })}`, { signal: t });
139
- }
140
- `${y}`;
141
- //#endregion
142
- //#region ../api-client/src/api/topics.ts
143
- var M = `${y}/topics`;
144
- async function N() {
145
- return O(M);
146
- }
147
- `${y}`;
148
- //#endregion
149
- //#region ../api-client/src/api/business-domains.ts
150
- async function P() {
151
- return await k("/api/runtime/aihub/v1.0/business-domains/tree") ?? [];
152
- }
153
- //#endregion
154
- //#region src/api/skill-select-data.ts
155
- var F = "__all_skills__", I = null, L = null, R = null, z = null;
156
- async function B() {
157
- return R || z || (z = N().then((e) => (R = e ?? [], R)).finally(() => {
158
- z = null;
159
- }), z);
160
- }
161
- function V(e) {
162
- return {
163
- id: e?.id ?? e?.code ?? "",
164
- code: e?.code ?? e?.id,
165
- name: e?.name ?? e?.code ?? "未命名",
166
- children: Array.isArray(e?.children) ? e.children.map(V) : void 0
167
- };
168
- }
169
- async function ne() {
170
- return [{
171
- id: F,
172
- name: "全部技能",
173
- children: await H()
174
- }];
175
- }
176
- async function H() {
177
- return I || L || (L = P().then((e) => (e ?? []).map(V)).then((e) => (I = e, e)).finally(() => {
178
- L = null;
179
- }), L);
180
- }
181
- function re(e) {
182
- let t = /* @__PURE__ */ new Map(), n = (e) => {
183
- for (let r of e) r.code && t.set(r.code, r.name), r.children && n(r.children);
184
- };
185
- return n(e), t;
186
- }
187
- async function U() {
188
- let e = await B(), t = /* @__PURE__ */ new Map();
189
- for (let n of e) {
190
- let e = n?.name ?? n?.code ?? n?.id;
191
- e && (n?.code && t.set(n.code, e), n?.id && t.set(n.id, e));
192
- }
193
- return t;
194
- }
195
- async function W() {
196
- return (await B()).filter((e) => !!e?.code).map((e) => ({
197
- id: e.code,
198
- code: e.code,
199
- name: e?.name ?? e.code
200
- }));
201
- }
202
- async function ie() {
203
- return [{
204
- id: F,
205
- name: "全部技能",
206
- children: await W()
207
- }];
208
- }
209
- function G(e, t) {
210
- return j({
211
- page: e.page ?? 0,
212
- size: e.size ?? 10,
213
- keyword: e.keyword?.trim() || void 0,
214
- businessDomain: e.businessDomain || void 0,
215
- topic: e.topic || void 0,
216
- category: e.category || void 0
217
- }, t);
218
- }
219
- //#endregion
220
- //#region src/composables/use-skill-selection.ts
221
- function K(e) {
222
- let t = e ?? {};
223
- return (t?.raw ?? t)?.id ?? t?.id;
224
- }
225
- function q(e = {}) {
226
- let n = e.singleSelect ?? !1, r = o(/* @__PURE__ */ new Map()), i = o(/* @__PURE__ */ new Map());
227
- function a(e) {
228
- if (!e?.length) return;
229
- let t = new Map(i.value);
230
- for (let n of e) t.set(n.id, n);
231
- i.value = t;
232
- }
233
- function s(e, t) {
234
- let a = n && e.length > 1 ? e.slice(-1) : e, o = /* @__PURE__ */ new Map();
235
- for (let e of a) {
236
- let t = r.value.get(e);
237
- if (t) {
238
- o.set(e, t);
239
- continue;
240
- }
241
- let n = i.value.get(e);
242
- n ? o.set(e, f(n)) : o.set(e, {
243
- value: e,
244
- text: e
245
- });
246
- }
247
- if (t) for (let [e, n] of r.value) t.has(e) || o.set(e, n);
248
- r.value = o;
249
- }
250
- function c(e, t, n) {
251
- s(Array.isArray(t) && t.length ? t : Array.isArray(e) ? e.map(K).filter(Boolean) : [], n);
252
- }
253
- function ee(e) {
254
- let t = K(e);
255
- if (!t) return;
256
- let n = new Map(r.value);
257
- if (n.has(t)) n.delete(t);
258
- else {
259
- let e = i.value.get(t);
260
- n.set(t, e ? f(e) : {
261
- value: t,
262
- text: t
263
- });
264
- }
265
- r.value = n;
266
- }
267
- function l(e) {
268
- let t = K(e);
269
- t && s([t]);
270
- }
271
- function u(e) {
272
- let t = new Map(r.value);
273
- t.delete(e), r.value = t;
274
- }
275
- function d() {
276
- r.value = /* @__PURE__ */ new Map();
277
- }
278
- function p(e) {
279
- if (!e?.length) {
280
- r.value = /* @__PURE__ */ new Map();
281
- return;
282
- }
283
- let t = /* @__PURE__ */ new Map();
284
- for (let n of e) n?.value && t.set(n.value, n);
285
- r.value = t;
286
- }
287
- return {
288
- singleSelect: n,
289
- selectedIds: t(() => [...r.value.keys()]),
290
- items: t(() => [...r.value.values()]),
291
- count: t(() => r.value.size),
292
- indexPageItems: a,
293
- handleGridSelectionUpdate: c,
294
- toggleItem: ee,
295
- selectRow: l,
296
- removeItem: u,
297
- clear: d,
298
- restore: p
299
- };
300
- }
301
- //#endregion
302
- //#region src/components/skill-select-dialog.tsx
303
- var ae = [
304
- {
305
- field: "_name",
306
- title: "技能名称",
307
- width: "26%",
308
- showEllipsis: !0,
309
- showTips: !0,
310
- tipMode: "auto"
311
- },
312
- {
313
- field: "_version",
314
- title: "最新版本",
315
- width: "10%"
316
- },
317
- {
318
- field: "_category",
319
- title: "使用类别",
320
- width: "14%",
321
- showEllipsis: !0
322
- },
323
- {
324
- field: "_topicName",
325
- title: "技能分类",
326
- width: "17%",
327
- showEllipsis: !0,
328
- showTips: !0,
329
- tipMode: "auto"
330
- },
331
- {
332
- field: "_domainName",
333
- title: "所属业务域",
334
- width: "18%",
335
- showEllipsis: !0,
336
- showTips: !0,
337
- tipMode: "auto"
338
- },
339
- {
340
- field: "_author",
341
- title: "作者",
342
- width: "15%",
343
- showEllipsis: !0
344
- }
345
- ], oe = "GENERAL_OFFICE", se = [
346
- {
347
- field: "_name",
348
- title: "技能名称",
349
- width: "33%",
350
- showEllipsis: !0,
351
- showTips: !0,
352
- tipMode: "auto"
353
- },
354
- {
355
- field: "_version",
356
- title: "最新版本",
357
- width: "34%"
358
- },
359
- {
360
- field: "_topicName",
361
- title: "技能分类",
362
- width: "33%",
363
- showEllipsis: !0,
364
- showTips: !0,
365
- tipMode: "auto"
366
- }
367
- ], ce = [
368
- {
369
- field: "_name",
370
- title: "技能名称",
371
- width: "33%",
372
- showEllipsis: !0,
373
- showTips: !0,
374
- tipMode: "auto"
375
- },
376
- {
377
- field: "_version",
378
- title: "最新版本",
379
- width: "34%"
380
- },
381
- {
382
- field: "_domainName",
383
- title: "所属业务域",
384
- width: "33%",
385
- showEllipsis: !0,
386
- showTips: !0,
387
- tipMode: "auto"
388
- }
389
- ], J = /* @__PURE__ */ i({
390
- name: "SkillSelectDialog",
391
- props: {
392
- modelValue: {
393
- type: Boolean,
394
- default: !1
395
- },
396
- singleSelect: {
397
- type: Boolean,
398
- default: !1
399
- },
400
- initSelected: {
401
- type: Array,
402
- default: () => []
403
- },
404
- initCategory: {
405
- type: String,
406
- default: ""
407
- },
408
- title: {
409
- type: String,
410
- default: "选择技能"
411
- }
412
- },
413
- emits: ["update:modelValue", "confirm"],
414
- setup(e, { emit: i }) {
415
- let o = t(() => e.modelValue), d = t(() => e.initCategory === oe), f = a(null), m = a(null), g = a(0), v = a(F), y = a(/* @__PURE__ */ new Map()), b = a(/* @__PURE__ */ new Map()), x = t(() => d.value ? m.value : f.value), S = t(() => x.value ? [x.value] : []), C = t(() => e.initCategory === "GENERAL_OFFICE" ? se : e.initCategory === "BUSINESS_SYSTEM" ? ce : ae), te = {
416
- enableSelectRow: !0,
417
- multiSelect: !1,
418
- showCheckbox: !1,
419
- showSelectAll: !1,
420
- showSelection: !0
421
- }, w = a(""), T = a(""), E = a(""), D = a(0), O = a(10), k = a(0), A = a([]), j = a(!1), M = a(null), N = a(0), P = q({ singleSelect: e.singleSelect }), I = t(() => e.singleSelect ? {
422
- enableSelectRow: !1,
423
- multiSelect: !1,
424
- showCheckbox: !0,
425
- showSelectAll: !1,
426
- showSelection: !1
427
- } : {
428
- enableSelectRow: !1,
429
- multiSelect: !0,
430
- showCheckbox: !0,
431
- showSelectAll: !0,
432
- showSelection: !1,
433
- multiSelectMode: "DependOnCheck",
434
- keepSelectingOnPaging: !0
435
- });
436
- function L(e) {
437
- return {
438
- ...e,
439
- _name: e.displayName || e.name,
440
- _version: e.latestVersion || "-",
441
- _category: h(e.category),
442
- _topicName: e.topic ? b.value.get(e.topic) ?? e.topic : "-",
443
- _domainName: e.businessDomain ? y.value.get(e.businessDomain) ?? e.businessDomain : "-",
444
- _author: e.ownerDisplayName || e.author || "-"
445
- };
446
- }
447
- let R = t(() => A.value.map(L));
448
- s(R, (e) => {
449
- M.value?.updateDataSource && M.value.updateDataSource(e);
450
- }, { flush: "post" });
451
- async function z() {
452
- let e = ++N.value;
453
- j.value = !0;
454
- try {
455
- let t = B(), n = await G({
456
- page: D.value,
457
- size: O.value,
458
- keyword: T.value,
459
- businessDomain: d.value ? void 0 : t,
460
- topic: d.value ? t : void 0,
461
- category: E.value || void 0
462
- });
463
- if (e !== N.value) return;
464
- A.value = n?.items ?? [], k.value = n?.total ?? 0, P.indexPageItems(A.value);
465
- } catch (t) {
466
- if (e !== N.value) return;
467
- A.value = [], k.value = 0, console.error("[skill-select-workbench] 查询技能列表失败", t);
468
- } finally {
469
- e === N.value && (j.value = !1);
470
- }
471
- }
472
- function B() {
473
- let e = x.value;
474
- if (!e || v.value === "__all_skills__") return;
475
- let t = (e) => {
476
- if (e) for (let n of e) {
477
- if (n.id === v.value) return n.code;
478
- let e = t(n.children);
479
- if (e) return e;
480
- }
481
- };
482
- return t(e.children);
483
- }
484
- function V(e) {
485
- e?.id && (v.value = e.id, D.value = 0, z());
486
- }
487
- let H = t(() => (A.value.length, P.selectedIds.value));
488
- function W(e, t) {
489
- let n = new Set(A.value.map((e) => e.id));
490
- P.handleGridSelectionUpdate(e, t, n);
491
- }
492
- let K = null;
493
- function J(e) {
494
- K = e.target;
495
- }
496
- function Y() {
497
- let e = K;
498
- return !!e && typeof e.closest == "function" && !!e.closest(".custom-checkbox, label, input[type=\"checkbox\"]");
499
- }
500
- function le(e) {
501
- let t = e ?? {};
502
- return t.raw?.id ?? t.id;
503
- }
504
- function ue(t, n) {
505
- if (!Y()) {
506
- if (e.singleSelect) {
507
- let e = le(n), t = P.items.value;
508
- if (e && t.length === 1 && t[0].value === e) {
509
- P.clear();
510
- return;
511
- }
512
- P.selectRow(n);
513
- return;
514
- }
515
- P.toggleItem(n);
516
- }
517
- }
518
- function de(e) {
519
- D.value = e, z();
520
- }
521
- function fe(e) {
522
- O.value = e, D.value = 0, z();
523
- }
524
- function X(e) {
525
- E.value = e, D.value = 0, z();
526
- }
527
- let Z;
528
- function pe(e) {
529
- w.value = e.target.value, Z && clearTimeout(Z), Z = setTimeout(() => {
530
- T.value = w.value.trim(), D.value = 0, z();
531
- }, 350);
532
- }
533
- function me() {
534
- w.value = "", T.value = "", D.value = 0, z();
535
- }
536
- let Q = !1;
537
- async function he() {
538
- if (!Q) {
539
- Q = !0;
540
- try {
541
- w.value = "", T.value = "", E.value = e.initCategory, D.value = 0, O.value = 10, k.value = 0, A.value = [], N.value++, v.value = F, P.restore(e.initSelected);
542
- try {
543
- if (d.value) {
544
- if (!m.value) {
545
- let e = await ie();
546
- m.value = e[0], g.value++;
547
- }
548
- } else if (!f.value) {
549
- let e = await ne();
550
- f.value = e[0], y.value = re(e[0]?.children ?? []), g.value++;
551
- }
552
- if (b.value.size === 0) {
553
- let e = await U();
554
- b.value.size === 0 && (b.value = e);
555
- }
556
- } catch (e) {
557
- console.error("[skill-select-workbench] 加载筛选数据失败", e);
558
- }
559
- await z();
560
- } finally {
561
- Q = !1;
562
- }
563
- }
564
- }
565
- s(o, (e) => {
566
- e && he();
567
- }, { immediate: !0 });
568
- function $() {
569
- i("update:modelValue", !1);
570
- }
571
- function ge() {
572
- i("confirm", { items: P.items.value }), $();
573
- }
574
- function _e(e) {
575
- P.removeItem(e);
576
- }
577
- function ve() {
578
- P.clear();
579
- }
580
- function ye(e) {
581
- e.stopPropagation();
582
- }
583
- return () => o.value ? r("div", {
584
- class: "ssw-overlay",
585
- onMousedown: ye,
586
- onClick: ye
587
- }, [r("div", {
588
- class: "ssw-dialog",
589
- role: "dialog",
590
- "aria-modal": "true"
591
- }, [
592
- r("div", { class: "ssw-dialog__header" }, [r("span", { class: "ssw-dialog__title" }, [e.title]), r("button", {
593
- type: "button",
594
- class: "ssw-dialog__close",
595
- onClick: $,
596
- "aria-label": "关闭"
597
- }, [r("span", { class: "ssw-icon-close" }, [n("×")])])]),
598
- r("div", { class: "ssw-dialog__body" }, [r("div", { class: "ssw-pane ssw-pane--tree" }, [r("div", { class: "ssw-pane__head" }, [r("span", null, [d.value ? "技能分类" : "业务域"])]), r("div", { class: "ssw-tree-wrap" }, [S.value.length ? r(u, {
599
- key: g.value,
600
- data: S.value,
601
- idField: "id",
602
- displayField: "name",
603
- columns: [{
604
- field: "name",
605
- title: "",
606
- width: "100%",
607
- showEllipsis: !0,
608
- showTips: !0,
609
- tipMode: "auto"
610
- }],
611
- selection: te,
612
- selectionValues: [v.value],
613
- fit: !0,
614
- onClickRow: (e, t) => V(t)
615
- }, null) : r("div", { class: "ssw-tree-empty" }, [n("加载中…")])])]), r("div", { class: "ssw-pane ssw-pane--grid" }, [
616
- r("div", { class: "ssw-toolbar" }, [r("div", { class: "ssw-search" }, [r("input", {
617
- class: "ssw-search__input",
618
- placeholder: "搜索技能名称",
619
- value: w.value,
620
- onInput: pe
621
- }, null), w.value ? r("button", {
622
- type: "button",
623
- class: "ssw-search__clear",
624
- onClick: me
625
- }, [n("×")]) : null])]),
626
- !e.initCategory && r("div", { class: "ssw-filter" }, [
627
- r("span", { class: "ssw-filter__label" }, [n("技能类型")]),
628
- r("button", {
629
- type: "button",
630
- class: ["ssw-filter__btn", E.value === "" ? "ssw-filter__btn--active" : ""].join(" "),
631
- onClick: () => X("")
632
- }, [n("全部")]),
633
- p.map((e) => r("button", {
634
- type: "button",
635
- class: ["ssw-filter__btn", E.value === e.value ? "ssw-filter__btn--active" : ""].join(" "),
636
- onClick: () => X(e.value)
637
- }, [e.label]))
638
- ]),
639
- r("div", {
640
- class: "ssw-grid-wrap",
641
- onClickCapture: J
642
- }, [
643
- r(ee, {
644
- ref: M,
645
- idField: "id",
646
- data: R.value,
647
- columns: C.value,
648
- selection: I.value,
649
- selectionValues: H.value,
650
- onSelectionUpdate: W,
651
- onClickRow: ue,
652
- fit: !0,
653
- showHeader: !0
654
- }, null),
655
- j.value && r("div", { class: "ssw-grid-loading" }, [n("加载中…")]),
656
- !j.value && R.value.length === 0 && r("div", { class: "ssw-grid-empty" }, [n("暂无可选技能")])
657
- ]),
658
- k.value > 0 && r("div", { class: "ssw-pagination" }, [r(l, {
659
- currentPage: D.value + 1,
660
- totalItems: k.value,
661
- pageSize: O.value,
662
- pageList: _,
663
- showPageList: !0,
664
- showGoButton: !1,
665
- showPageInfo: !0,
666
- "onUpdate:currentPage": (e) => de(e - 1),
667
- "onUpdate:pageSize": (e) => fe(e)
668
- }, null)])
669
- ])]),
670
- r("div", { class: "ssw-dialog__footer" }, [r("div", { class: "ssw-footer-selection" }, [P.items.value.length === 0 ? r("span", { class: "ssw-footer-placeholder" }, [e.singleSelect ? "请选择一个技能" : "请选择技能,可跨页多选"]) : P.items.value.map((e) => r("span", {
671
- key: e.value,
672
- class: "ssw-chip",
673
- title: e.text
674
- }, [r("span", { class: "ssw-chip__text" }, [e.text]), r("a", {
675
- class: "ssw-chip__remove",
676
- onClick: (t) => {
677
- t.stopPropagation(), _e(e.value);
678
- }
679
- }, [n("×")])]))]), r("div", { class: "ssw-footer-actions" }, [
680
- r("span", { class: "ssw-footer-count" }, [
681
- n("已选 "),
682
- P.count.value,
683
- n(" 条"),
684
- P.count.value > 0 && r("a", {
685
- class: "ssw-clear-all",
686
- onClick: ve
687
- }, [n("清空")])
688
- ]),
689
- r(c, { onClick: $ }, { default: () => [n("取消")] }),
690
- r(c, {
691
- type: "primary",
692
- onClick: ge
693
- }, { default: () => [n("确定")] })
694
- ])])
695
- ])]) : null;
696
- }
697
- }), Y = /* @__PURE__ */ i({
698
- name: "SkillSelectField",
699
- props: {
700
- singleSelect: {
701
- type: Boolean,
702
- default: !1
703
- },
704
- asyncMode: {
705
- type: Boolean,
706
- default: !0
707
- },
708
- disabled: {
709
- type: Boolean,
710
- default: !1
711
- },
712
- placeholder: {
713
- type: String,
714
- default: "请选择技能"
715
- },
716
- selectedItems: {
717
- type: Array,
718
- default: () => []
719
- }
720
- },
721
- emits: ["update:selectedItems"],
722
- setup(e, { emit: t }) {
723
- let i = a(!1);
724
- function o() {
725
- e.disabled || (i.value = !0);
726
- }
727
- function s(e) {
728
- t("update:selectedItems", e.items), i.value = !1;
729
- }
730
- function c(e) {
731
- e.stopPropagation();
732
- }
733
- return () => {
734
- let a = e.selectedItems ?? [];
735
- return r("div", null, [r("div", {
736
- class: ["ssw-field", { "ssw-field--disabled": e.disabled }].join(" "),
737
- onClick: o
738
- }, [a.length === 0 ? r("span", { class: "ssw-field__placeholder" }, [e.placeholder]) : r("span", {
739
- class: "ssw-field__value",
740
- title: a.map((e) => e.text).join("、")
741
- }, [e.singleSelect ? a[a.length - 1]?.text : `${a[0]?.text}${a.length > 1 ? ` 等 ${a.length} 项` : ""}`]), r("span", { class: "ssw-field__actions" }, [a.length > 0 && r("a", {
742
- class: "ssw-field__clear",
743
- role: "button",
744
- "aria-label": "清空",
745
- onClick: (e) => {
746
- c(e), t("update:selectedItems", []);
747
- }
748
- }, [n("×")]), r("span", {
749
- class: "ssw-field__open",
750
- role: "button",
751
- "aria-label": "选择"
752
- }, [n("···")])])]), i.value && r(J, {
753
- modelValue: i.value,
754
- "onUpdate:modelValue": (e) => i.value = e,
755
- singleSelect: e.singleSelect,
756
- initSelected: a,
757
- onConfirm: s
758
- }, null)]);
759
- };
760
- }
1647
+ function Cs(e) {
1648
+ const t = typeof e == "string" ? e.indexOf("#") : -1;
1649
+ return Ts(
1650
+ t === -1 ? e : e.slice(0, t),
1651
+ As
1652
+ );
1653
+ }
1654
+ const ct = "1.19.0", Nt = 64 * 1024, { isFunction: Le } = a, xs = (e) => encodeURIComponent(e).replace(
1655
+ /%([0-9A-F]{2})/gi,
1656
+ (t, n) => String.fromCharCode(parseInt(n, 16))
1657
+ ), Lt = (e) => {
1658
+ if (!a.isString(e))
1659
+ return e;
1660
+ try {
1661
+ return decodeURIComponent(e);
1662
+ } catch {
1663
+ return e;
1664
+ }
1665
+ }, Ft = (e, ...t) => {
1666
+ try {
1667
+ return !!e(...t);
1668
+ } catch {
1669
+ return !1;
1670
+ }
1671
+ }, vs = (e) => {
1672
+ const t = e.indexOf("://");
1673
+ let n = e;
1674
+ return t !== -1 && (n = n.slice(t + 3)), n.includes("@") || n.includes(":");
1675
+ }, Ps = (e) => {
1676
+ const t = a.global !== void 0 && a.global !== null ? a.global : globalThis, { ReadableStream: n, TextEncoder: r } = t;
1677
+ e = a.merge.call(
1678
+ {
1679
+ skipUndefined: !0
1680
+ },
1681
+ {
1682
+ Request: t.Request,
1683
+ Response: t.Response
1684
+ },
1685
+ e
1686
+ );
1687
+ const { fetch: s, Request: o, Response: i } = e, l = s ? Le(s) : typeof fetch == "function", u = Le(o), d = Le(i);
1688
+ if (!l)
1689
+ return !1;
1690
+ const f = l && Le(n), p = l && (typeof r == "function" ? /* @__PURE__ */ ((c) => (y) => c.encode(y))(new r()) : async (c) => new Uint8Array(await new o(c).arrayBuffer())), S = u && f && Ft(() => {
1691
+ let c = !1;
1692
+ const y = new o(U.origin, {
1693
+ body: new n(),
1694
+ method: "POST",
1695
+ get duplex() {
1696
+ return c = !0, "half";
1697
+ }
1698
+ }), g = y.headers.has("Content-Type");
1699
+ return y.body != null && y.body.cancel(), c && !g;
1700
+ }), O = d && f && Ft(() => a.isReadableStream(new i("").body)), _ = {
1701
+ stream: O && ((c) => c.body)
1702
+ };
1703
+ l && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((c) => {
1704
+ !_[c] && (_[c] = (y, g) => {
1705
+ let E = y && y[c];
1706
+ if (E)
1707
+ return E.call(y);
1708
+ throw new w(
1709
+ `Response type '${c}' is not supported`,
1710
+ w.ERR_NOT_SUPPORT,
1711
+ g
1712
+ );
1713
+ });
1714
+ });
1715
+ const A = async (c) => {
1716
+ if (c == null)
1717
+ return 0;
1718
+ if (a.isBlob(c))
1719
+ return c.size;
1720
+ if (a.isSpecCompliantForm(c))
1721
+ return (await new o(U.origin, {
1722
+ method: "POST",
1723
+ body: c
1724
+ }).arrayBuffer()).byteLength;
1725
+ if (a.isArrayBufferView(c) || a.isArrayBuffer(c))
1726
+ return c.byteLength;
1727
+ if (a.isURLSearchParams(c) && (c = c + ""), a.isString(c))
1728
+ return (await p(c)).byteLength;
1729
+ }, h = async (c, y) => {
1730
+ const g = a.toFiniteNumber(c.getContentLength());
1731
+ return g ?? A(y);
1732
+ };
1733
+ return async (c) => {
1734
+ let {
1735
+ url: y,
1736
+ method: g,
1737
+ data: E,
1738
+ signal: T,
1739
+ cancelToken: C,
1740
+ timeout: L,
1741
+ onDownloadProgress: N,
1742
+ onUploadProgress: we,
1743
+ responseType: K,
1744
+ headers: H,
1745
+ withCredentials: z = "same-origin",
1746
+ fetchOptions: xe,
1747
+ maxContentLength: $,
1748
+ maxBodyLength: le
1749
+ } = cn(c);
1750
+ const te = a.isNumber($) && $ > -1, ce = a.isNumber(le) && le > -1, $e = (x) => a.hasOwnProp(c, x) ? c[x] : void 0;
1751
+ let ve = s || fetch;
1752
+ K = K ? (K + "").toLowerCase() : "text";
1753
+ let G = ys(
1754
+ [T, C && C.toAbortSignal()],
1755
+ L
1756
+ ), D = null;
1757
+ const Y = G && G.unsubscribe && (() => {
1758
+ G.unsubscribe();
1759
+ });
1760
+ let Z, Q = null;
1761
+ const ue = () => new w(
1762
+ "Request body larger than maxBodyLength limit",
1763
+ w.ERR_BAD_REQUEST,
1764
+ c,
1765
+ D
1766
+ );
1767
+ try {
1768
+ let x;
1769
+ const j = $e("auth");
1770
+ if (j) {
1771
+ const b = a.getSafeProp(j, "username") || "", v = a.getSafeProp(j, "password") || "";
1772
+ x = {
1773
+ username: b,
1774
+ password: v
1775
+ };
1776
+ }
1777
+ if (vs(y)) {
1778
+ const b = new URL(y, U.origin);
1779
+ if (!x && (b.username || b.password)) {
1780
+ const v = Lt(b.username), B = Lt(b.password);
1781
+ x = {
1782
+ username: v,
1783
+ password: B
1784
+ };
1785
+ }
1786
+ (b.username || b.password) && (b.username = "", b.password = "", y = b.href);
1787
+ }
1788
+ if (x && (H.delete("authorization"), H.set(
1789
+ "Authorization",
1790
+ "Basic " + btoa(xs((x.username || "") + ":" + (x.password || "")))
1791
+ )), te && typeof y == "string" && y.startsWith("data:") && Cs(y) > $)
1792
+ throw new w(
1793
+ "maxContentLength size of " + $ + " exceeded",
1794
+ w.ERR_BAD_RESPONSE,
1795
+ c,
1796
+ D
1797
+ );
1798
+ if (ce && g !== "get" && g !== "head") {
1799
+ const b = await A(E);
1800
+ if (typeof b == "number" && isFinite(b) && (Z = b, b > le))
1801
+ throw ue();
1802
+ }
1803
+ const ee = ce && (a.isReadableStream(E) || a.isStream(E)), Pe = (b, v, B) => vt(
1804
+ b,
1805
+ Nt,
1806
+ (X) => {
1807
+ if (ce && X > le)
1808
+ throw Q = ue();
1809
+ v && v(X);
1810
+ },
1811
+ B
1812
+ );
1813
+ if (S && g !== "get" && g !== "head" && (we || ee)) {
1814
+ if (Z = Z ?? await h(H, E), Z !== 0 || ee) {
1815
+ let b = new o(y, {
1816
+ method: "POST",
1817
+ body: E,
1818
+ duplex: "half"
1819
+ }), v;
1820
+ if (a.isFormData(E) && (v = b.headers.get("content-type")) && H.setContentType(v), b.body) {
1821
+ const [B, X] = we && At(
1822
+ Z,
1823
+ Me(Tt(we))
1824
+ ) || [];
1825
+ E = Pe(b.body, B, X);
1826
+ }
1827
+ }
1828
+ } else if (ee && !u && f && g !== "get" && g !== "head")
1829
+ E = Pe(E);
1830
+ else if (ee && u && !S && g !== "get" && g !== "head")
1831
+ throw new w(
1832
+ "Stream request bodies are not supported by the current fetch implementation",
1833
+ w.ERR_NOT_SUPPORT,
1834
+ c,
1835
+ D
1836
+ );
1837
+ a.isString(z) || (z = z ? "include" : "omit");
1838
+ const ye = u && "credentials" in o.prototype;
1839
+ if (a.isFormData(E)) {
1840
+ const b = H.getContentType();
1841
+ b && /^multipart\/form-data/i.test(b) && !/boundary=/i.test(b) && H.delete("content-type");
1842
+ }
1843
+ H.set("User-Agent", "axios/" + ct, !1);
1844
+ const De = {
1845
+ ...xe,
1846
+ signal: G,
1847
+ method: g.toUpperCase(),
1848
+ headers: Yt(H.normalize()),
1849
+ body: E,
1850
+ duplex: "half",
1851
+ credentials: ye ? z : void 0
1852
+ };
1853
+ D = u && new o(y, De);
1854
+ let W = await (u ? ve(D, xe) : ve(y, De));
1855
+ const Ne = k.from(W.headers);
1856
+ if (te) {
1857
+ const b = a.toFiniteNumber(Ne.getContentLength());
1858
+ if (b != null && b > $)
1859
+ throw new w(
1860
+ "maxContentLength size of " + $ + " exceeded",
1861
+ w.ERR_BAD_RESPONSE,
1862
+ c,
1863
+ D
1864
+ );
1865
+ }
1866
+ const fe = O && (K === "stream" || K === "response");
1867
+ if (O && W.body && (N || te || fe && Y)) {
1868
+ const b = {};
1869
+ ["status", "statusText", "headers"].forEach((ge) => {
1870
+ b[ge] = W[ge];
1871
+ });
1872
+ const v = a.toFiniteNumber(Ne.getContentLength()), [B, X] = N && At(
1873
+ v,
1874
+ Me(Tt(N), !0)
1875
+ ) || [];
1876
+ let pt = 0;
1877
+ const Sn = (ge) => {
1878
+ if (te && (pt = ge, pt > $))
1879
+ throw new w(
1880
+ "maxContentLength size of " + $ + " exceeded",
1881
+ w.ERR_BAD_RESPONSE,
1882
+ c,
1883
+ D
1884
+ );
1885
+ B && B(ge);
1886
+ };
1887
+ W = new i(
1888
+ vt(W.body, Nt, Sn, () => {
1889
+ X && X(), Y && Y();
1890
+ }),
1891
+ b
1892
+ );
1893
+ }
1894
+ K = K || "text";
1895
+ let m = await _[a.findKey(_, K) || "text"](
1896
+ W,
1897
+ c
1898
+ );
1899
+ if (te && !O && !fe) {
1900
+ let b;
1901
+ if (m != null && (typeof m.byteLength == "number" ? b = m.byteLength : typeof m.size == "number" ? b = m.size : typeof m == "string" && (b = typeof r == "function" ? new r().encode(m).byteLength : m.length)), typeof b == "number" && b > $)
1902
+ throw new w(
1903
+ "maxContentLength size of " + $ + " exceeded",
1904
+ w.ERR_BAD_RESPONSE,
1905
+ c,
1906
+ D
1907
+ );
1908
+ }
1909
+ return !fe && Y && Y(), await new Promise((b, v) => {
1910
+ an(b, v, {
1911
+ data: m,
1912
+ headers: k.from(W.headers),
1913
+ status: W.status,
1914
+ statusText: W.statusText,
1915
+ config: c,
1916
+ request: D
1917
+ });
1918
+ });
1919
+ } catch (x) {
1920
+ if (Y && Y(), G && G.aborted && G.reason instanceof w) {
1921
+ const j = G.reason;
1922
+ throw j.config = c, D && (j.request = D), x !== j && Object.defineProperty(j, "cause", {
1923
+ __proto__: null,
1924
+ value: x,
1925
+ writable: !0,
1926
+ enumerable: !1,
1927
+ configurable: !0
1928
+ }), j;
1929
+ }
1930
+ if (Q)
1931
+ throw D && !Q.request && (Q.request = D), Q;
1932
+ if (x instanceof w)
1933
+ throw D && !x.request && (x.request = D), x;
1934
+ if (x && x.name === "TypeError" && /Load failed|fetch/i.test(x.message)) {
1935
+ const j = new w(
1936
+ "Network Error",
1937
+ w.ERR_NETWORK,
1938
+ c,
1939
+ D,
1940
+ x && x.response
1941
+ );
1942
+ throw Object.defineProperty(j, "cause", {
1943
+ __proto__: null,
1944
+ value: x.cause || x,
1945
+ writable: !0,
1946
+ enumerable: !1,
1947
+ configurable: !0
1948
+ }), j;
1949
+ }
1950
+ throw w.from(x, x && x.code, c, D, x && x.response);
1951
+ }
1952
+ };
1953
+ }, Ds = /* @__PURE__ */ new Map(), fn = (e) => {
1954
+ let t = e && e.env || {};
1955
+ const { fetch: n, Request: r, Response: s } = t, o = [r, s, n];
1956
+ let i = o.length, l = i, u, d, f = Ds;
1957
+ for (; l--; )
1958
+ u = o[l], d = f.get(u), d === void 0 && f.set(u, d = l ? /* @__PURE__ */ new Map() : Ps(t)), f = d;
1959
+ return d;
1960
+ };
1961
+ fn();
1962
+ const ut = {
1963
+ http: Ir,
1964
+ xhr: ws,
1965
+ fetch: {
1966
+ get: fn
1967
+ }
1968
+ };
1969
+ a.forEach(ut, (e, t) => {
1970
+ if (e) {
1971
+ try {
1972
+ Object.defineProperty(e, "name", { __proto__: null, value: t });
1973
+ } catch {
1974
+ }
1975
+ Object.defineProperty(e, "adapterName", { __proto__: null, value: t });
1976
+ }
1977
+ });
1978
+ const Ut = (e) => `- ${e}`, Ns = (e) => a.isFunction(e) || e === null || e === !1;
1979
+ function Ls(e, t) {
1980
+ e = a.isArray(e) ? e : [e];
1981
+ const { length: n } = e;
1982
+ let r, s;
1983
+ const o = {};
1984
+ for (let i = 0; i < n; i++) {
1985
+ r = e[i];
1986
+ let l;
1987
+ if (s = r, !Ns(r) && (s = ut[(l = String(r)).toLowerCase()], s === void 0))
1988
+ throw new w(`Unknown adapter '${l}'`);
1989
+ if (s && (a.isFunction(s) || (s = s.get(t))))
1990
+ break;
1991
+ o[l || "#" + i] = s;
1992
+ }
1993
+ if (!s) {
1994
+ const i = Object.entries(o).map(
1995
+ ([u, d]) => `adapter ${u} ` + (d === !1 ? "is not supported by the environment" : "is not available in the build")
1996
+ );
1997
+ let l = n ? i.length > 1 ? `since :
1998
+ ` + i.map(Ut).join(`
1999
+ `) : " " + Ut(i[0]) : "as no adapter specified";
2000
+ throw new w(
2001
+ "There is no suitable adapter to dispatch the request " + l,
2002
+ w.ERR_NOT_SUPPORT
2003
+ );
2004
+ }
2005
+ return s;
2006
+ }
2007
+ const dn = {
2008
+ /**
2009
+ * Resolve an adapter from a list of adapter names or functions.
2010
+ * @type {Function}
2011
+ */
2012
+ getAdapter: Ls,
2013
+ /**
2014
+ * Exposes all known adapters
2015
+ * @type {Object<string, Function|Object>}
2016
+ */
2017
+ adapters: ut
2018
+ };
2019
+ function Xe(e) {
2020
+ if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
2021
+ throw new Ce(null, e);
2022
+ }
2023
+ function Ye(e) {
2024
+ return Xe(e), e.headers = k.from(e.headers), e.data = Ge.call(e, e.transformRequest), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), dn.getAdapter(e.adapter || Te.adapter, e)(e).then(
2025
+ function(r) {
2026
+ Xe(e), e.response = r;
2027
+ try {
2028
+ r.data = Ge.call(e, e.transformResponse, r);
2029
+ } finally {
2030
+ delete e.response;
2031
+ }
2032
+ return r.headers = k.from(r.headers), r;
2033
+ },
2034
+ function(r) {
2035
+ if (!on(r) && (Xe(e), r && r.response)) {
2036
+ e.response = r.response;
2037
+ try {
2038
+ r.response.data = Ge.call(
2039
+ e,
2040
+ e.transformResponse,
2041
+ r.response
2042
+ );
2043
+ } finally {
2044
+ delete e.response;
2045
+ }
2046
+ r.response.headers = k.from(r.response.headers);
2047
+ }
2048
+ return Promise.reject(r);
2049
+ }
2050
+ );
2051
+ }
2052
+ const ze = {};
2053
+ ["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
2054
+ ze[e] = function(r) {
2055
+ return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
2056
+ };
2057
+ });
2058
+ const It = {};
2059
+ ze.transitional = function(t, n, r) {
2060
+ function s(o, i) {
2061
+ return "[Axios v" + ct + "] Transitional option '" + o + "'" + i + (r ? ". " + r : "");
2062
+ }
2063
+ return (o, i, l) => {
2064
+ if (t === !1)
2065
+ throw new w(
2066
+ s(i, " has been removed" + (n ? " in " + n : "")),
2067
+ w.ERR_DEPRECATED
2068
+ );
2069
+ return n && !It[i] && (It[i] = !0, console.warn(
2070
+ s(
2071
+ i,
2072
+ " has been deprecated since v" + n + " and will be removed in the near future"
2073
+ )
2074
+ )), t ? t(o, i, l) : !0;
2075
+ };
2076
+ };
2077
+ ze.spelling = function(t) {
2078
+ return (n, r) => (console.warn(`${r} is likely a misspelling of ${t}`), !0);
2079
+ };
2080
+ function Fs(e, t, n) {
2081
+ if (typeof e != "object" || e === null)
2082
+ throw new w("options must be an object", w.ERR_BAD_OPTION_VALUE);
2083
+ const r = Object.keys(e);
2084
+ let s = r.length;
2085
+ for (; s-- > 0; ) {
2086
+ const o = r[s], i = Object.prototype.hasOwnProperty.call(t, o) ? t[o] : void 0;
2087
+ if (i) {
2088
+ const l = e[o], u = l === void 0 || i(l, o, e);
2089
+ if (u !== !0)
2090
+ throw new w(
2091
+ "option " + o + " must be " + u,
2092
+ w.ERR_BAD_OPTION_VALUE
2093
+ );
2094
+ continue;
2095
+ }
2096
+ if (n !== !0)
2097
+ throw new w("Unknown option " + o, w.ERR_BAD_OPTION);
2098
+ }
2099
+ }
2100
+ const ke = {
2101
+ assertOptions: Fs,
2102
+ validators: ze
2103
+ }, I = ke.validators;
2104
+ let se = class {
2105
+ constructor(t) {
2106
+ this.defaults = t || {}, this.interceptors = {
2107
+ request: new _t(),
2108
+ response: new _t()
2109
+ };
2110
+ }
2111
+ /**
2112
+ * Dispatch a request
2113
+ *
2114
+ * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
2115
+ * @param {?Object} config
2116
+ *
2117
+ * @returns {Promise} The Promise to be fulfilled
2118
+ */
2119
+ async request(t, n) {
2120
+ try {
2121
+ return await this._request(t, n);
2122
+ } catch (r) {
2123
+ if (r instanceof Error) {
2124
+ let s = {};
2125
+ Error.captureStackTrace ? Error.captureStackTrace(s) : s = new Error();
2126
+ const o = (() => {
2127
+ if (!s.stack)
2128
+ return "";
2129
+ const i = s.stack.indexOf(`
2130
+ `);
2131
+ return i === -1 ? "" : s.stack.slice(i + 1);
2132
+ })();
2133
+ try {
2134
+ if (!r.stack)
2135
+ r.stack = o;
2136
+ else if (o) {
2137
+ const i = o.indexOf(`
2138
+ `), l = i === -1 ? -1 : o.indexOf(`
2139
+ `, i + 1), u = l === -1 ? "" : o.slice(l + 1);
2140
+ String(r.stack).endsWith(u) || (r.stack += `
2141
+ ` + o);
2142
+ }
2143
+ } catch {
2144
+ }
2145
+ }
2146
+ throw r;
2147
+ }
2148
+ }
2149
+ _request(t, n) {
2150
+ typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = ae(this.defaults, n);
2151
+ const { transitional: r, paramsSerializer: s, headers: o } = n;
2152
+ r !== void 0 && ke.assertOptions(
2153
+ r,
2154
+ {
2155
+ silentJSONParsing: I.transitional(I.boolean),
2156
+ forcedJSONParsing: I.transitional(I.boolean),
2157
+ clarifyTimeoutError: I.transitional(I.boolean),
2158
+ legacyInterceptorReqResOrdering: I.transitional(I.boolean),
2159
+ advertiseZstdAcceptEncoding: I.transitional(I.boolean),
2160
+ validateStatusUndefinedResolves: I.transitional(I.boolean)
2161
+ },
2162
+ !1
2163
+ ), s != null && (a.isFunction(s) ? n.paramsSerializer = {
2164
+ serialize: s
2165
+ } : ke.assertOptions(
2166
+ s,
2167
+ {
2168
+ encode: I.function,
2169
+ serialize: I.function
2170
+ },
2171
+ !0
2172
+ )), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), ke.assertOptions(
2173
+ n,
2174
+ {
2175
+ baseUrl: I.spelling("baseURL"),
2176
+ withXsrfToken: I.spelling("withXSRFToken")
2177
+ },
2178
+ !0
2179
+ ), n.method = (n.method || this.defaults.method || "get").toLowerCase();
2180
+ let i = o && a.merge(o.common, o[n.method]);
2181
+ o && a.forEach(["delete", "get", "head", "post", "put", "patch", "query", "common"], (_) => {
2182
+ delete o[_];
2183
+ }), n.headers = k.concat(i, o);
2184
+ const l = [];
2185
+ let u = !0;
2186
+ this.interceptors.request.forEach(function(A) {
2187
+ if (typeof A.runWhen == "function" && A.runWhen(n) === !1)
2188
+ return;
2189
+ u = u && A.synchronous;
2190
+ const h = n.transitional || at;
2191
+ h && h.legacyInterceptorReqResOrdering ? l.unshift(A.fulfilled, A.rejected) : l.push(A.fulfilled, A.rejected);
2192
+ });
2193
+ const d = [];
2194
+ this.interceptors.response.forEach(function(A) {
2195
+ d.push(A.fulfilled, A.rejected);
2196
+ });
2197
+ let f, p = 0, S;
2198
+ if (!u) {
2199
+ const _ = [Ye.bind(this), void 0];
2200
+ for (_.unshift(...l), _.push(...d), S = _.length, f = Promise.resolve(n); p < S; )
2201
+ f = f.then(_[p++], _[p++]);
2202
+ return f;
2203
+ }
2204
+ S = l.length;
2205
+ let O = n;
2206
+ for (; p < S; ) {
2207
+ const _ = l[p++], A = l[p++];
2208
+ try {
2209
+ O = _ ? _(O) : O;
2210
+ } catch (h) {
2211
+ if (!A) {
2212
+ f = Promise.reject(h);
2213
+ break;
2214
+ }
2215
+ try {
2216
+ const c = A.call(this, h);
2217
+ a.isThenable(c) && (f = Promise.resolve(c).then(
2218
+ () => Ye.call(this, O)
2219
+ ));
2220
+ } catch (c) {
2221
+ f = Promise.reject(c);
2222
+ }
2223
+ break;
2224
+ }
2225
+ }
2226
+ if (!f)
2227
+ try {
2228
+ f = Ye.call(this, O);
2229
+ } catch (_) {
2230
+ f = Promise.reject(_);
2231
+ }
2232
+ for (p = 0, S = d.length; p < S; )
2233
+ f = f.then(d[p++], d[p++]);
2234
+ return f;
2235
+ }
2236
+ getUri(t) {
2237
+ t = ae(this.defaults, t);
2238
+ const n = ln(t.baseURL, t.url, t.allowAbsoluteUrls, t);
2239
+ return nn(n, t.params, t.paramsSerializer);
2240
+ }
2241
+ };
2242
+ a.forEach(["delete", "get", "head", "options"], function(t) {
2243
+ se.prototype[t] = function(n, r) {
2244
+ return this.request(
2245
+ ae(r || {}, {
2246
+ method: t,
2247
+ url: n,
2248
+ data: r && a.hasOwnProp(r, "data") ? r.data : void 0
2249
+ })
2250
+ );
2251
+ };
2252
+ });
2253
+ a.forEach(["post", "put", "patch", "query"], function(t) {
2254
+ function n(r) {
2255
+ return function(o, i, l) {
2256
+ return this.request(
2257
+ ae(l || {}, {
2258
+ method: t,
2259
+ headers: r ? {
2260
+ "Content-Type": "multipart/form-data"
2261
+ } : {},
2262
+ url: o,
2263
+ data: i
2264
+ })
2265
+ );
2266
+ };
2267
+ }
2268
+ se.prototype[t] = n(), t !== "query" && (se.prototype[t + "Form"] = n(!0));
2269
+ });
2270
+ let Us = class pn {
2271
+ constructor(t) {
2272
+ if (typeof t != "function")
2273
+ throw new TypeError("executor must be a function.");
2274
+ let n;
2275
+ this.promise = new Promise(function(o) {
2276
+ n = o;
2277
+ });
2278
+ const r = this;
2279
+ this.promise.then((s) => {
2280
+ if (!r._listeners) return;
2281
+ let o = r._listeners.length;
2282
+ for (; o-- > 0; )
2283
+ r._listeners[o](s);
2284
+ r._listeners = null;
2285
+ }), this.promise.then = (s) => {
2286
+ let o;
2287
+ const i = new Promise((l) => {
2288
+ r.subscribe(l), o = l;
2289
+ }).then(s);
2290
+ return i.cancel = function() {
2291
+ r.unsubscribe(o);
2292
+ }, i;
2293
+ }, t(function(o, i, l) {
2294
+ r.reason || (r.reason = new Ce(o, i, l), n(r.reason));
2295
+ });
2296
+ }
2297
+ /**
2298
+ * Throws a `CanceledError` if cancellation has been requested.
2299
+ */
2300
+ throwIfRequested() {
2301
+ if (this.reason)
2302
+ throw this.reason;
2303
+ }
2304
+ /**
2305
+ * Subscribe to the cancel signal
2306
+ */
2307
+ subscribe(t) {
2308
+ if (this.reason) {
2309
+ t(this.reason);
2310
+ return;
2311
+ }
2312
+ this._listeners ? this._listeners.push(t) : this._listeners = [t];
2313
+ }
2314
+ /**
2315
+ * Unsubscribe from the cancel signal
2316
+ */
2317
+ unsubscribe(t) {
2318
+ if (!this._listeners)
2319
+ return;
2320
+ const n = this._listeners.indexOf(t);
2321
+ n !== -1 && this._listeners.splice(n, 1);
2322
+ }
2323
+ toAbortSignal() {
2324
+ const t = new AbortController(), n = (r) => {
2325
+ t.abort(r);
2326
+ };
2327
+ return this.subscribe(n), t.signal.unsubscribe = () => this.unsubscribe(n), t.signal;
2328
+ }
2329
+ /**
2330
+ * Returns an object that contains a new `CancelToken` and a function that, when called,
2331
+ * cancels the `CancelToken`.
2332
+ */
2333
+ static source() {
2334
+ let t;
2335
+ return {
2336
+ token: new pn(function(s) {
2337
+ t = s;
2338
+ }),
2339
+ cancel: t
2340
+ };
2341
+ }
2342
+ };
2343
+ function Is(e) {
2344
+ return function(n) {
2345
+ return e.apply(null, n);
2346
+ };
2347
+ }
2348
+ function ks(e) {
2349
+ return a.isObject(e) && e.isAxiosError === !0;
2350
+ }
2351
+ const rt = {
2352
+ Continue: 100,
2353
+ SwitchingProtocols: 101,
2354
+ Processing: 102,
2355
+ EarlyHints: 103,
2356
+ Ok: 200,
2357
+ Created: 201,
2358
+ Accepted: 202,
2359
+ NonAuthoritativeInformation: 203,
2360
+ NoContent: 204,
2361
+ ResetContent: 205,
2362
+ PartialContent: 206,
2363
+ MultiStatus: 207,
2364
+ AlreadyReported: 208,
2365
+ ImUsed: 226,
2366
+ MultipleChoices: 300,
2367
+ MovedPermanently: 301,
2368
+ Found: 302,
2369
+ SeeOther: 303,
2370
+ NotModified: 304,
2371
+ UseProxy: 305,
2372
+ Unused: 306,
2373
+ TemporaryRedirect: 307,
2374
+ PermanentRedirect: 308,
2375
+ BadRequest: 400,
2376
+ Unauthorized: 401,
2377
+ PaymentRequired: 402,
2378
+ Forbidden: 403,
2379
+ NotFound: 404,
2380
+ MethodNotAllowed: 405,
2381
+ NotAcceptable: 406,
2382
+ ProxyAuthenticationRequired: 407,
2383
+ RequestTimeout: 408,
2384
+ Conflict: 409,
2385
+ Gone: 410,
2386
+ LengthRequired: 411,
2387
+ PreconditionFailed: 412,
2388
+ PayloadTooLarge: 413,
2389
+ UriTooLong: 414,
2390
+ UnsupportedMediaType: 415,
2391
+ RangeNotSatisfiable: 416,
2392
+ ExpectationFailed: 417,
2393
+ ImATeapot: 418,
2394
+ MisdirectedRequest: 421,
2395
+ UnprocessableEntity: 422,
2396
+ Locked: 423,
2397
+ FailedDependency: 424,
2398
+ TooEarly: 425,
2399
+ UpgradeRequired: 426,
2400
+ PreconditionRequired: 428,
2401
+ TooManyRequests: 429,
2402
+ RequestHeaderFieldsTooLarge: 431,
2403
+ UnavailableForLegalReasons: 451,
2404
+ InternalServerError: 500,
2405
+ NotImplemented: 501,
2406
+ BadGateway: 502,
2407
+ ServiceUnavailable: 503,
2408
+ GatewayTimeout: 504,
2409
+ HttpVersionNotSupported: 505,
2410
+ VariantAlsoNegotiates: 506,
2411
+ InsufficientStorage: 507,
2412
+ LoopDetected: 508,
2413
+ NotExtended: 510,
2414
+ NetworkAuthenticationRequired: 511,
2415
+ WebServerReturnsAnUnknownError: 520,
2416
+ WebServerIsDown: 521,
2417
+ ConnectionTimedOut: 522,
2418
+ OriginIsUnreachable: 523,
2419
+ TimeoutOccurred: 524,
2420
+ SslHandshakeFailed: 525,
2421
+ InvalidSslCertificate: 526
2422
+ };
2423
+ Object.entries(rt).forEach(([e, t]) => {
2424
+ rt[t] = e;
2425
+ });
2426
+ function hn(e) {
2427
+ const t = new se(e), n = Ht(se.prototype.request, t);
2428
+ return a.extend(n, se.prototype, t, { allOwnKeys: !0 }), a.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(s) {
2429
+ return hn(ae(e, s));
2430
+ }, n;
2431
+ }
2432
+ const P = hn(Te);
2433
+ P.Axios = se;
2434
+ P.CanceledError = Ce;
2435
+ P.CancelToken = Us;
2436
+ P.isCancel = on;
2437
+ P.VERSION = ct;
2438
+ P.toFormData = He;
2439
+ P.AxiosError = w;
2440
+ P.Cancel = P.CanceledError;
2441
+ P.all = function(t) {
2442
+ return Promise.all(t);
2443
+ };
2444
+ P.spread = Is;
2445
+ P.isAxiosError = ks;
2446
+ P.mergeConfig = ae;
2447
+ P.AxiosHeaders = k;
2448
+ P.formToJSON = (e) => sn(a.isHTMLForm(e) ? new FormData(e) : e);
2449
+ P.getAdapter = dn.getAdapter;
2450
+ P.HttpStatusCode = rt;
2451
+ P.default = P;
2452
+ const {
2453
+ Axios: yo,
2454
+ AxiosError: go,
2455
+ CanceledError: bo,
2456
+ isCancel: Eo,
2457
+ CancelToken: So,
2458
+ VERSION: Ro,
2459
+ all: _o,
2460
+ Cancel: Oo,
2461
+ isAxiosError: Ao,
2462
+ spread: To,
2463
+ toFormData: Co,
2464
+ AxiosHeaders: xo,
2465
+ HttpStatusCode: vo,
2466
+ formToJSON: Po,
2467
+ getAdapter: Do,
2468
+ mergeConfig: No,
2469
+ create: Lo
2470
+ } = P;
2471
+ class ne extends Error {
2472
+ constructor(t, n, r, s, o) {
2473
+ super(t), this.name = "ApiError", this.status = n, this.details = r, this.code = s, this.category = o;
2474
+ }
2475
+ // 兼容各子应用本地 ApiError 的 serverMessage 字段(details 即服务端返回的消息)
2476
+ get serverMessage() {
2477
+ return this.details;
2478
+ }
2479
+ // 兼容 innerMessage 字段(同 details)
2480
+ get innerMessage() {
2481
+ return this.details;
2482
+ }
2483
+ }
2484
+ const ft = "/api/runtime/aihub/v1.0";
2485
+ function Bs() {
2486
+ return typeof window > "u" ? {} : window.__SKILLHUB_RUNTIME_CONFIG__ ?? {};
2487
+ }
2488
+ function mn(e) {
2489
+ const t = Bs().apiBaseUrl;
2490
+ return t && e.startsWith("/") ? `${t.replace(/\/$/, "")}${e}` : e;
2491
+ }
2492
+ const js = {
2493
+ GET: "get",
2494
+ POST: "post",
2495
+ PUT: "put",
2496
+ DELETE: "delete",
2497
+ PATCH: "patch"
2498
+ };
2499
+ function Ms(e) {
2500
+ const t = {};
2501
+ typeof e?.body == "string" ? t["Content-Type"] = "application/json" : typeof FormData < "u" && e?.body instanceof FormData && (t["Content-Type"] = "multipart/form-data");
2502
+ try {
2503
+ const n = localStorage.getItem("language") || navigator.language.split("-")[0] || "en";
2504
+ t["Accept-Language"] = n;
2505
+ } catch {
2506
+ }
2507
+ return t;
2508
+ }
2509
+ function qs(e) {
2510
+ if (e && typeof e == "object" && !Array.isArray(e)) {
2511
+ const t = e;
2512
+ if ("code" in t && "data" in t || "success" in t && "data" in t)
2513
+ return null;
2514
+ }
2515
+ return e;
2516
+ }
2517
+ function kt(e) {
2518
+ const t = e?.message ?? e?.Message ?? e?.errorMessage;
2519
+ return typeof t == "string" && t ? t : void 0;
2520
+ }
2521
+ function Hs(e) {
2522
+ if (e instanceof ne) return e;
2523
+ const t = e;
2524
+ if (t?.isAxiosError) {
2525
+ if (t.code === "ECONNABORTED" || t.code === "ETIMEDOUT")
2526
+ return new ne("error.request.timeout", 408, "");
2527
+ const n = t.response?.status ?? 0, s = kt(t.response?.data) ?? `HTTP ${n || 0}`;
2528
+ return new ne(s, n, s);
2529
+ }
2530
+ if (e && typeof e == "object") {
2531
+ const n = e, r = kt(n) ?? "error", s = Number(n.code ?? n.Code ?? n.status) || 0, o = n.error;
2532
+ return new ne(r, s, r, o?.code, o?.category);
2533
+ }
2534
+ return typeof e == "string" ? new ne(e || "error", 0, e || "error") : e instanceof Error ? new ne(e.message || "error", 0, e.message || "error") : new ne("error", 0, "");
2535
+ }
2536
+ const zs = P.create({
2537
+ // 与 @gsp-sys/utils request 的平台 axios 超时保持一致(300s)
2538
+ timeout: 3e5
761
2539
  });
762
- //#endregion
763
- export { F as ALL_SKILLS_NODE_ID, m as DEFAULT_CATEGORY, d as EMPTY_SKILL_SELECT_PAYLOAD, p as SKILL_CATEGORIES, g as SKILL_PAGE_SIZE, _ as SKILL_PAGE_SIZE_OPTIONS, J as SkillSelectDialog, Y as SkillSelectField, h as categoryLabel, H as loadDomainTree, ne as loadDomainTreeWithRoot, U as loadTopicNameMap, G as querySkillPage, f as toSkillSelectItem, q as useSkillSelection };
2540
+ function $s(e) {
2541
+ if (!e || typeof e != "object" || Array.isArray(e))
2542
+ return 200;
2543
+ const t = e;
2544
+ let n = t.status || t.code || t.success || 200;
2545
+ n === !0 && (n = 200);
2546
+ const r = Number(n);
2547
+ return Number.isNaN(r) ? 200 : r;
2548
+ }
2549
+ async function wn(e, t, n) {
2550
+ const r = (t?.method ? js[t.method.toUpperCase()] : "get") ?? "get";
2551
+ try {
2552
+ const o = (await zs.request({
2553
+ url: e,
2554
+ method: r,
2555
+ headers: Ms(t),
2556
+ data: t?.body,
2557
+ ...n ? { responseType: n } : {}
2558
+ })).data, i = $s(o), u = (o && typeof o == "object" ? o : null)?.data || o;
2559
+ if (i !== 200 && i !== 204)
2560
+ throw u || "error";
2561
+ return qs(u);
2562
+ } catch (s) {
2563
+ throw Hs(s);
2564
+ }
2565
+ }
2566
+ function yn(e) {
2567
+ const t = new URLSearchParams();
2568
+ for (const [r, s] of Object.entries(e))
2569
+ s == null || s === "" || t.append(r, String(s));
2570
+ const n = t.toString();
2571
+ return n ? `?${n}` : "";
2572
+ }
2573
+ function Vs(e, t) {
2574
+ return wn(mn(e), t);
2575
+ }
2576
+ function dt(e, t) {
2577
+ return wn(mn(e), t);
2578
+ }
2579
+ const gn = `${ft}/customSkills`;
2580
+ async function Ws(e, t) {
2581
+ const n = yn({
2582
+ page: e.page,
2583
+ size: e.size,
2584
+ keyword: e.keyword,
2585
+ group: e.group,
2586
+ businessDomain: e.businessDomain,
2587
+ topic: e.topic,
2588
+ category: e.category,
2589
+ repo: e.repo
2590
+ });
2591
+ return dt(`${gn}/listByAuth${n}`, { signal: t });
2592
+ }
2593
+ async function Js(e, t) {
2594
+ const n = yn({
2595
+ page: e.page,
2596
+ size: e.size,
2597
+ keyword: e.keyword,
2598
+ businessDomain: e.businessDomain,
2599
+ orgId: e.orgId
2600
+ });
2601
+ return dt(`${gn}/listAll${n}`, { signal: t });
2602
+ }
2603
+ const Ks = `${ft}/topics`;
2604
+ async function Gs() {
2605
+ return Vs(Ks);
2606
+ }
2607
+ async function Xs() {
2608
+ return await dt(
2609
+ `${ft}/business-domains/tree`
2610
+ ) ?? [];
2611
+ }
2612
+ const Re = "__all_skills__";
2613
+ let Ze = null, Ee = null, Fe = null, Se = null;
2614
+ async function bn() {
2615
+ return Fe || Se || (Se = Gs().then((e) => (Fe = e ?? [], Fe)).finally(() => {
2616
+ Se = null;
2617
+ }), Se);
2618
+ }
2619
+ function En(e) {
2620
+ return {
2621
+ id: e?.id ?? e?.code ?? "",
2622
+ code: e?.code ?? e?.id,
2623
+ name: e?.name ?? e?.code ?? "未命名",
2624
+ children: Array.isArray(e?.children) ? e.children.map(En) : void 0
2625
+ };
2626
+ }
2627
+ async function Ys() {
2628
+ const e = await Zs();
2629
+ return [
2630
+ {
2631
+ id: Re,
2632
+ name: "全部技能",
2633
+ children: e
2634
+ }
2635
+ ];
2636
+ }
2637
+ async function Zs() {
2638
+ return Ze || Ee || (Ee = Xs().then((e) => (e ?? []).map(En)).then((e) => (Ze = e, e)).finally(() => {
2639
+ Ee = null;
2640
+ }), Ee);
2641
+ }
2642
+ function Qs(e) {
2643
+ const t = /* @__PURE__ */ new Map(), n = (r) => {
2644
+ for (const s of r)
2645
+ s.code && t.set(s.code, s.name), s.children && n(s.children);
2646
+ };
2647
+ return n(e), t;
2648
+ }
2649
+ async function eo() {
2650
+ const e = await bn(), t = /* @__PURE__ */ new Map();
2651
+ for (const n of e) {
2652
+ const r = n?.name ?? n?.code ?? n?.id;
2653
+ r && (n?.code && t.set(n.code, r), n?.id && t.set(n.id, r));
2654
+ }
2655
+ return t;
2656
+ }
2657
+ async function to() {
2658
+ return (await bn()).filter((t) => !!t?.code).map((t) => ({
2659
+ id: t.code,
2660
+ code: t.code,
2661
+ name: t?.name ?? t.code
2662
+ }));
2663
+ }
2664
+ async function no() {
2665
+ const e = await to();
2666
+ return [
2667
+ {
2668
+ id: Re,
2669
+ name: "全部技能",
2670
+ children: e
2671
+ }
2672
+ ];
2673
+ }
2674
+ function ro(e, t) {
2675
+ return e.orgId ? Js(
2676
+ {
2677
+ page: e.page ?? 0,
2678
+ size: e.size ?? 10,
2679
+ keyword: e.keyword?.trim() || void 0,
2680
+ businessDomain: e.businessDomain || void 0,
2681
+ orgId: e.orgId
2682
+ },
2683
+ t
2684
+ ) : Ws(
2685
+ {
2686
+ page: e.page ?? 0,
2687
+ size: e.size ?? 10,
2688
+ keyword: e.keyword?.trim() || void 0,
2689
+ businessDomain: e.businessDomain || void 0,
2690
+ topic: e.topic || void 0,
2691
+ category: e.category || void 0
2692
+ },
2693
+ t
2694
+ );
2695
+ }
2696
+ function Qe(e) {
2697
+ const t = e ?? {};
2698
+ return (t?.raw ?? t)?.id ?? t?.id;
2699
+ }
2700
+ function so(e = {}) {
2701
+ const t = e.singleSelect ?? !1, n = ht(/* @__PURE__ */ new Map()), r = ht(/* @__PURE__ */ new Map());
2702
+ function s(h) {
2703
+ if (!h?.length) return;
2704
+ const c = new Map(r.value);
2705
+ for (const y of h) c.set(y.id, y);
2706
+ r.value = c;
2707
+ }
2708
+ function o(h, c) {
2709
+ const y = t && h.length > 1 ? h.slice(-1) : h, g = /* @__PURE__ */ new Map();
2710
+ for (const E of y) {
2711
+ const T = n.value.get(E);
2712
+ if (T) {
2713
+ g.set(E, T);
2714
+ continue;
2715
+ }
2716
+ const C = r.value.get(E);
2717
+ C ? g.set(E, Ve(C)) : g.set(E, { value: E, text: E });
2718
+ }
2719
+ if (c)
2720
+ for (const [E, T] of n.value)
2721
+ c.has(E) || g.set(E, T);
2722
+ n.value = g;
2723
+ }
2724
+ function i(h, c, y) {
2725
+ const g = Array.isArray(c) && c.length ? c : Array.isArray(h) ? h.map(Qe).filter(Boolean) : [];
2726
+ o(g, y);
2727
+ }
2728
+ function l(h) {
2729
+ if (!Array.isArray(h) || h.length === 0) return;
2730
+ const c = new Map(n.value);
2731
+ for (const y of h) {
2732
+ const g = y ?? {}, E = g?.raw ?? g, T = E?.id ?? g?.id, C = E.__fv_checked__;
2733
+ if (!(!T || typeof C != "boolean"))
2734
+ if (C) {
2735
+ if (!c.has(T)) {
2736
+ const L = r.value.get(T);
2737
+ c.set(T, L ? Ve(L) : { value: T, text: T });
2738
+ }
2739
+ } else
2740
+ c.delete(T);
2741
+ }
2742
+ n.value = c;
2743
+ }
2744
+ function u(h) {
2745
+ const c = Qe(h);
2746
+ if (!c) return;
2747
+ const y = new Map(n.value);
2748
+ if (y.has(c))
2749
+ y.delete(c);
2750
+ else {
2751
+ const g = r.value.get(c);
2752
+ y.set(c, g ? Ve(g) : { value: c, text: c });
2753
+ }
2754
+ n.value = y;
2755
+ }
2756
+ function d(h) {
2757
+ const c = Qe(h);
2758
+ c && o([c]);
2759
+ }
2760
+ function f(h) {
2761
+ const c = new Map(n.value);
2762
+ c.delete(h), n.value = c;
2763
+ }
2764
+ function p() {
2765
+ n.value = /* @__PURE__ */ new Map();
2766
+ }
2767
+ function S(h) {
2768
+ if (!h?.length) {
2769
+ n.value = /* @__PURE__ */ new Map();
2770
+ return;
2771
+ }
2772
+ const c = /* @__PURE__ */ new Map();
2773
+ for (const y of h)
2774
+ y?.value && c.set(y.value, y);
2775
+ n.value = c;
2776
+ }
2777
+ const O = J(() => [...n.value.keys()]), _ = J(() => [...n.value.values()]), A = J(() => n.value.size);
2778
+ return {
2779
+ singleSelect: t,
2780
+ selectedIds: O,
2781
+ items: _,
2782
+ count: A,
2783
+ indexPageItems: s,
2784
+ handleGridSelectionUpdate: i,
2785
+ reconcilePageFromFlags: l,
2786
+ toggleItem: u,
2787
+ selectRow: d,
2788
+ removeItem: f,
2789
+ clear: p,
2790
+ restore: S
2791
+ };
2792
+ }
2793
+ const Bt = [{
2794
+ field: "_name",
2795
+ title: "技能名称",
2796
+ width: "26%",
2797
+ showEllipsis: !0,
2798
+ showTips: !0,
2799
+ tipMode: "auto"
2800
+ }, {
2801
+ field: "_version",
2802
+ title: "最新版本",
2803
+ width: "10%"
2804
+ }, {
2805
+ field: "_category",
2806
+ title: "使用类别",
2807
+ width: "14%",
2808
+ showEllipsis: !0
2809
+ }, {
2810
+ field: "_topicName",
2811
+ title: "技能分类",
2812
+ width: "17%",
2813
+ showEllipsis: !0,
2814
+ showTips: !0,
2815
+ tipMode: "auto"
2816
+ }, {
2817
+ field: "_domainName",
2818
+ title: "所属业务域",
2819
+ width: "18%",
2820
+ showEllipsis: !0,
2821
+ showTips: !0,
2822
+ tipMode: "auto"
2823
+ }, {
2824
+ field: "_author",
2825
+ title: "作者",
2826
+ width: "15%",
2827
+ showEllipsis: !0
2828
+ }], jt = "GENERAL_OFFICE", oo = "BUSINESS_SYSTEM", io = [{
2829
+ field: "_name",
2830
+ title: "技能名称",
2831
+ width: "33%",
2832
+ showEllipsis: !0,
2833
+ showTips: !0,
2834
+ tipMode: "auto"
2835
+ }, {
2836
+ field: "_version",
2837
+ title: "最新版本",
2838
+ width: "34%"
2839
+ }, {
2840
+ field: "_topicName",
2841
+ title: "技能分类",
2842
+ width: "33%",
2843
+ showEllipsis: !0,
2844
+ showTips: !0,
2845
+ tipMode: "auto"
2846
+ }], ao = [{
2847
+ field: "_name",
2848
+ title: "技能名称",
2849
+ width: "33%",
2850
+ showEllipsis: !0,
2851
+ showTips: !0,
2852
+ tipMode: "auto"
2853
+ }, {
2854
+ field: "_version",
2855
+ title: "最新版本",
2856
+ width: "34%"
2857
+ }, {
2858
+ field: "_domainName",
2859
+ title: "所属业务域",
2860
+ width: "33%",
2861
+ showEllipsis: !0,
2862
+ showTips: !0,
2863
+ tipMode: "auto"
2864
+ }], lo = /* @__PURE__ */ Mt({
2865
+ name: "SkillSelectDialog",
2866
+ props: {
2867
+ modelValue: {
2868
+ type: Boolean,
2869
+ default: !1
2870
+ },
2871
+ /** 单选模式:一次只能选定一个技能 */
2872
+ singleSelect: {
2873
+ type: Boolean,
2874
+ default: !1
2875
+ },
2876
+ /** 打开弹窗时的初始已选项(回显) */
2877
+ initSelected: {
2878
+ type: Array,
2879
+ default: () => []
2880
+ },
2881
+ /** 调用方指定的技能类型(使用类别):GENERAL_OFFICE / BUSINESS_SYSTEM。非空=锁定该类型,隐藏类型切换行,仅加载该类型数据;'' = 不锁定(弹窗内可选全部) */
2882
+ initCategory: {
2883
+ type: String,
2884
+ default: ""
2885
+ },
2886
+ /** 组织维度过滤(必传则按 orgid 过滤,权限分配等场景):非空时走 listAll 接口,仅返回该组织可见技能;
2887
+ * 该模式下列表为全类型(服务端忽略使用类别/技能分类过滤),左侧导航固定为业务域树、隐藏技能类型切换行 */
2888
+ orgId: {
2889
+ type: String,
2890
+ default: ""
2891
+ },
2892
+ title: {
2893
+ type: String,
2894
+ default: "选择技能"
2895
+ }
2896
+ },
2897
+ emits: ["update:modelValue", "confirm"],
2898
+ setup(e, {
2899
+ emit: t
2900
+ }) {
2901
+ const n = J(() => e.modelValue), r = J(() => !e.orgId && e.initCategory === jt), s = F(null), o = F(null), i = F(0), l = F(Re), u = F(/* @__PURE__ */ new Map()), d = F(/* @__PURE__ */ new Map()), f = J(() => r.value ? o.value : s.value), p = J(() => f.value ? [f.value] : []), S = J(() => e.orgId ? Bt : e.initCategory === jt ? io : e.initCategory === oo ? ao : Bt), O = {
2902
+ enableSelectRow: !0,
2903
+ multiSelect: !1,
2904
+ showCheckbox: !1,
2905
+ showSelectAll: !1,
2906
+ showSelection: !0
2907
+ }, _ = F(""), A = F(""), h = F(""), c = F(0), y = F(yt), g = F(0), E = F([]), T = F(!1), C = F(null), L = F(0), N = so({
2908
+ singleSelect: e.singleSelect
2909
+ }), we = J(() => e.singleSelect ? {
2910
+ enableSelectRow: !1,
2911
+ multiSelect: !1,
2912
+ showCheckbox: !0,
2913
+ showSelectAll: !1,
2914
+ showSelection: !1
2915
+ } : {
2916
+ // enableSelectRow 必须为 true:farris 行级复选框多选依赖它,置 false 时勾新行会把旧行改为未选(单选替换),即「勾新行冲掉旧的」
2917
+ enableSelectRow: !0,
2918
+ multiSelect: !0,
2919
+ showCheckbox: !0,
2920
+ showSelectAll: !0,
2921
+ // 已选计数由底部操作区统一展示,关闭表格内建计数条
2922
+ showSelection: !1,
2923
+ multiSelectMode: "DependOnCheck",
2924
+ keepSelectingOnPaging: !0
2925
+ });
2926
+ function K(m) {
2927
+ return {
2928
+ ...m,
2929
+ _name: m.displayName || m.name,
2930
+ _version: m.latestVersion || "-",
2931
+ _category: Tn(m.category),
2932
+ _topicName: m.topic ? d.value.get(m.topic) ?? m.topic : "-",
2933
+ _domainName: m.businessDomain ? u.value.get(m.businessDomain) ?? m.businessDomain : "-",
2934
+ _author: m.ownerDisplayName || m.author || "-"
2935
+ };
2936
+ }
2937
+ const H = J(() => E.value.map(K));
2938
+ mt(H, (m) => {
2939
+ C.value?.updateDataSource && C.value.updateDataSource(m);
2940
+ }, {
2941
+ flush: "post"
2942
+ });
2943
+ async function z() {
2944
+ const m = ++L.value;
2945
+ T.value = !0;
2946
+ try {
2947
+ const b = xe(), v = await ro({
2948
+ page: c.value,
2949
+ size: y.value,
2950
+ keyword: A.value,
2951
+ businessDomain: r.value ? void 0 : b,
2952
+ topic: r.value ? b : void 0,
2953
+ category: h.value || void 0,
2954
+ orgId: e.orgId || void 0
2955
+ });
2956
+ if (m !== L.value) return;
2957
+ E.value = v?.items ?? [], g.value = v?.total ?? 0, N.indexPageItems(E.value);
2958
+ } catch (b) {
2959
+ if (m !== L.value) return;
2960
+ E.value = [], g.value = 0, console.error("[skill-select-workbench] 查询技能列表失败", b);
2961
+ } finally {
2962
+ m === L.value && (T.value = !1);
2963
+ }
2964
+ }
2965
+ function xe() {
2966
+ const m = f.value;
2967
+ if (!m || l.value === Re) return;
2968
+ const b = (v) => {
2969
+ if (v)
2970
+ for (const B of v) {
2971
+ if (B.id === l.value) return B.code;
2972
+ const X = b(B.children);
2973
+ if (X) return X;
2974
+ }
2975
+ };
2976
+ return b(m.children);
2977
+ }
2978
+ function $(m) {
2979
+ m?.id && (l.value = m.id, c.value = 0, z());
2980
+ }
2981
+ const le = J(() => (E.value.length, N.selectedIds.value));
2982
+ function te(m, b) {
2983
+ N.reconcilePageFromFlags(H.value);
2984
+ }
2985
+ let ce = null;
2986
+ function $e(m) {
2987
+ ce = m.target;
2988
+ }
2989
+ function ve() {
2990
+ const m = ce;
2991
+ return !!m && typeof m.closest == "function" && !!m.closest('.custom-checkbox, label, input[type="checkbox"]');
2992
+ }
2993
+ function G(m) {
2994
+ const b = m ?? {};
2995
+ return b.raw?.id ?? b.id;
2996
+ }
2997
+ function D(m, b) {
2998
+ if (ve() || !e.singleSelect) return;
2999
+ const v = G(b), B = N.items.value;
3000
+ if (v && B.length === 1 && B[0].value === v) {
3001
+ N.clear();
3002
+ return;
3003
+ }
3004
+ N.selectRow(b);
3005
+ }
3006
+ function Y(m) {
3007
+ c.value = m, z();
3008
+ }
3009
+ function Z(m) {
3010
+ y.value = m, c.value = 0, z();
3011
+ }
3012
+ function Q(m) {
3013
+ h.value = m, c.value = 0, z();
3014
+ }
3015
+ let ue;
3016
+ function x(m) {
3017
+ _.value = m.target.value, ue && clearTimeout(ue), ue = setTimeout(() => {
3018
+ A.value = _.value.trim(), c.value = 0, z();
3019
+ }, 350);
3020
+ }
3021
+ function j() {
3022
+ _.value = "", A.value = "", c.value = 0, z();
3023
+ }
3024
+ let ee = !1;
3025
+ async function Pe() {
3026
+ if (!ee) {
3027
+ ee = !0;
3028
+ try {
3029
+ _.value = "", A.value = "", h.value = e.orgId ? "" : e.initCategory, c.value = 0, y.value = yt, g.value = 0, E.value = [], L.value++, l.value = Re, N.restore(e.initSelected);
3030
+ try {
3031
+ if (r.value) {
3032
+ if (!o.value) {
3033
+ const m = await no();
3034
+ o.value = m[0], i.value++;
3035
+ }
3036
+ } else if (!s.value) {
3037
+ const m = await Ys();
3038
+ s.value = m[0], u.value = Qs(m[0]?.children ?? []), i.value++;
3039
+ }
3040
+ if (d.value.size === 0) {
3041
+ const m = await eo();
3042
+ d.value.size === 0 && (d.value = m);
3043
+ }
3044
+ } catch (m) {
3045
+ console.error("[skill-select-workbench] 加载筛选数据失败", m);
3046
+ }
3047
+ await z();
3048
+ } finally {
3049
+ ee = !1;
3050
+ }
3051
+ }
3052
+ }
3053
+ mt(
3054
+ n,
3055
+ (m) => {
3056
+ m && Pe();
3057
+ },
3058
+ // immediate:兼容“挂载即打开”的用法(如 SkillSelectField,modelValue 初始即 true)
3059
+ {
3060
+ immediate: !0
3061
+ }
3062
+ );
3063
+ function ye() {
3064
+ t("update:modelValue", !1);
3065
+ }
3066
+ function De() {
3067
+ t("confirm", {
3068
+ items: N.items.value
3069
+ }), ye();
3070
+ }
3071
+ function W(m) {
3072
+ N.removeItem(m);
3073
+ }
3074
+ function Ne() {
3075
+ N.clear();
3076
+ }
3077
+ function fe(m) {
3078
+ m.stopPropagation();
3079
+ }
3080
+ return () => n.value ? R(Rn, {
3081
+ to: "body"
3082
+ }, {
3083
+ default: () => [R("div", {
3084
+ class: "ssw-overlay",
3085
+ onMousedown: fe,
3086
+ onClick: fe
3087
+ }, [R("div", {
3088
+ class: "ssw-dialog",
3089
+ role: "dialog",
3090
+ "aria-modal": "true"
3091
+ }, [R("div", {
3092
+ class: "ssw-dialog__header"
3093
+ }, [R("span", {
3094
+ class: "ssw-dialog__title"
3095
+ }, [e.title]), R("button", {
3096
+ type: "button",
3097
+ class: "ssw-dialog__close",
3098
+ onClick: ye,
3099
+ "aria-label": "关闭"
3100
+ }, [R("span", {
3101
+ class: "ssw-icon-close"
3102
+ }, [M("×")])])]), R("div", {
3103
+ class: "ssw-dialog__body"
3104
+ }, [R("div", {
3105
+ class: "ssw-pane ssw-pane--tree"
3106
+ }, [R("div", {
3107
+ class: "ssw-pane__head"
3108
+ }, [R("span", null, [r.value ? "技能分类" : "业务域"])]), R("div", {
3109
+ class: "ssw-tree-wrap"
3110
+ }, [p.value.length ? R(_n, {
3111
+ key: i.value,
3112
+ data: p.value,
3113
+ idField: "id",
3114
+ displayField: "name",
3115
+ columns: [{
3116
+ field: "name",
3117
+ title: "",
3118
+ width: "100%",
3119
+ showEllipsis: !0,
3120
+ showTips: !0,
3121
+ tipMode: "auto"
3122
+ }],
3123
+ selection: O,
3124
+ selectionValues: [l.value],
3125
+ fit: !0,
3126
+ onClickRow: (m, b) => $(b)
3127
+ }, null) : R("div", {
3128
+ class: "ssw-tree-empty"
3129
+ }, [M("加载中…")])])]), R("div", {
3130
+ class: "ssw-pane ssw-pane--grid"
3131
+ }, [R("div", {
3132
+ class: "ssw-toolbar"
3133
+ }, [R("div", {
3134
+ class: "ssw-search"
3135
+ }, [R("input", {
3136
+ class: "ssw-search__input",
3137
+ placeholder: "搜索技能名称",
3138
+ value: _.value,
3139
+ onInput: x
3140
+ }, null), _.value ? R("button", {
3141
+ type: "button",
3142
+ class: "ssw-search__clear",
3143
+ onClick: j
3144
+ }, [M("×")]) : null])]), !e.initCategory && !e.orgId && R("div", {
3145
+ class: "ssw-filter"
3146
+ }, [R("span", {
3147
+ class: "ssw-filter__label"
3148
+ }, [M("技能类型")]), R("button", {
3149
+ type: "button",
3150
+ class: ["ssw-filter__btn", h.value === "" ? "ssw-filter__btn--active" : ""].join(" "),
3151
+ onClick: () => Q("")
3152
+ }, [M("全部")]), qt.map((m) => R("button", {
3153
+ type: "button",
3154
+ class: ["ssw-filter__btn", h.value === m.value ? "ssw-filter__btn--active" : ""].join(" "),
3155
+ onClick: () => Q(m.value)
3156
+ }, [m.label]))]), R("div", {
3157
+ class: "ssw-grid-wrap",
3158
+ onClickCapture: $e
3159
+ }, [R(On, {
3160
+ ref: C,
3161
+ idField: "id",
3162
+ data: H.value,
3163
+ columns: S.value,
3164
+ selection: we.value,
3165
+ selectionValues: le.value,
3166
+ onSelectionUpdate: te,
3167
+ onClickRow: D,
3168
+ fit: !0,
3169
+ showHeader: !0
3170
+ }, null), T.value && R("div", {
3171
+ class: "ssw-grid-loading"
3172
+ }, [M("加载中…")]), !T.value && H.value.length === 0 && R("div", {
3173
+ class: "ssw-grid-empty"
3174
+ }, [e.orgId ? "该组织暂无已授权技能,可先在「技能列表」页勾选授权" : "暂无可选技能"])]), g.value > 0 && R("div", {
3175
+ class: "ssw-pagination"
3176
+ }, [R(An, {
3177
+ currentPage: c.value + 1,
3178
+ totalItems: g.value,
3179
+ pageSize: y.value,
3180
+ pageList: Cn,
3181
+ showPageList: !0,
3182
+ showGoButton: !1,
3183
+ showPageInfo: !0,
3184
+ "onUpdate:currentPage": (m) => Y(m - 1),
3185
+ "onUpdate:pageSize": (m) => Z(m)
3186
+ }, null)])])]), R("div", {
3187
+ class: "ssw-dialog__footer"
3188
+ }, [R("div", {
3189
+ class: "ssw-footer-selection"
3190
+ }, [N.items.value.length === 0 ? R("span", {
3191
+ class: "ssw-footer-placeholder"
3192
+ }, [e.singleSelect ? "请选择一个技能" : "请选择技能,可跨页多选"]) : N.items.value.map((m) => R("span", {
3193
+ key: m.value,
3194
+ class: "ssw-chip",
3195
+ title: m.text
3196
+ }, [R("span", {
3197
+ class: "ssw-chip__text"
3198
+ }, [m.text]), R("a", {
3199
+ class: "ssw-chip__remove",
3200
+ onClick: (b) => {
3201
+ b.stopPropagation(), W(m.value);
3202
+ }
3203
+ }, [M("×")])]))]), R("div", {
3204
+ class: "ssw-footer-actions"
3205
+ }, [R("span", {
3206
+ class: "ssw-footer-count"
3207
+ }, [M("已选 "), N.count.value, M(" 条"), N.count.value > 0 && R("a", {
3208
+ class: "ssw-clear-all",
3209
+ onClick: Ne
3210
+ }, [M("清空")])]), R(wt, {
3211
+ onClick: ye
3212
+ }, {
3213
+ default: () => [M("取消")]
3214
+ }), R(wt, {
3215
+ type: "primary",
3216
+ onClick: De
3217
+ }, {
3218
+ default: () => [M("确定")]
3219
+ })])])])])]
3220
+ }) : null;
3221
+ }
3222
+ }), Fo = /* @__PURE__ */ Mt({
3223
+ name: "SkillSelectField",
3224
+ props: {
3225
+ /** 单选模式 */
3226
+ singleSelect: {
3227
+ type: Boolean,
3228
+ default: !1
3229
+ },
3230
+ /** 兼容字段帮助的 asyncMode 开关(本组件始终按需异步加载,保留以对齐既有调用方) */
3231
+ asyncMode: {
3232
+ type: Boolean,
3233
+ default: !0
3234
+ },
3235
+ disabled: {
3236
+ type: Boolean,
3237
+ default: !1
3238
+ },
3239
+ placeholder: {
3240
+ type: String,
3241
+ default: "请选择技能"
3242
+ },
3243
+ /** 当前已选技能(v-model) */
3244
+ selectedItems: {
3245
+ type: Array,
3246
+ default: () => []
3247
+ }
3248
+ },
3249
+ emits: ["update:selectedItems"],
3250
+ setup(e, {
3251
+ emit: t
3252
+ }) {
3253
+ const n = F(!1);
3254
+ function r() {
3255
+ e.disabled || (n.value = !0);
3256
+ }
3257
+ function s(i) {
3258
+ t("update:selectedItems", i.items), n.value = !1;
3259
+ }
3260
+ function o(i) {
3261
+ i.stopPropagation();
3262
+ }
3263
+ return () => {
3264
+ const i = e.selectedItems ?? [];
3265
+ return R("div", null, [R("div", {
3266
+ class: ["ssw-field", {
3267
+ "ssw-field--disabled": e.disabled
3268
+ }].join(" "),
3269
+ onClick: r
3270
+ }, [i.length === 0 ? R("span", {
3271
+ class: "ssw-field__placeholder"
3272
+ }, [e.placeholder]) : R("span", {
3273
+ class: "ssw-field__value",
3274
+ title: i.map((l) => l.text).join("、")
3275
+ }, [e.singleSelect ? i[i.length - 1]?.text : `${i[0]?.text}${i.length > 1 ? ` 等 ${i.length} 项` : ""}`]), R("span", {
3276
+ class: "ssw-field__actions"
3277
+ }, [i.length > 0 && R("a", {
3278
+ class: "ssw-field__clear",
3279
+ role: "button",
3280
+ "aria-label": "清空",
3281
+ onClick: (l) => {
3282
+ o(l), t("update:selectedItems", []);
3283
+ }
3284
+ }, [M("×")]), R("span", {
3285
+ class: "ssw-field__open",
3286
+ role: "button",
3287
+ "aria-label": "选择"
3288
+ }, [M("···")])])]), n.value && R(lo, {
3289
+ modelValue: n.value,
3290
+ "onUpdate:modelValue": (l) => n.value = l,
3291
+ singleSelect: e.singleSelect,
3292
+ initSelected: i,
3293
+ onConfirm: s
3294
+ }, null)]);
3295
+ };
3296
+ }
3297
+ });
3298
+ export {
3299
+ Re as ALL_SKILLS_NODE_ID,
3300
+ po as DEFAULT_CATEGORY,
3301
+ fo as EMPTY_SKILL_SELECT_PAYLOAD,
3302
+ qt as SKILL_CATEGORIES,
3303
+ yt as SKILL_PAGE_SIZE,
3304
+ Cn as SKILL_PAGE_SIZE_OPTIONS,
3305
+ lo as SkillSelectDialog,
3306
+ Fo as SkillSelectField,
3307
+ Tn as categoryLabel,
3308
+ Zs as loadDomainTree,
3309
+ Ys as loadDomainTreeWithRoot,
3310
+ eo as loadTopicNameMap,
3311
+ ro as querySkillPage,
3312
+ Ve as toSkillSelectItem,
3313
+ so as useSkillSelection
3314
+ };