luo-image-annotator 0.0.14 → 0.0.15
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.
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
var ae = Object.defineProperty;
|
|
2
2
|
var le = (w, t, n) => t in w ? ae(w, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : w[t] = n;
|
|
3
3
|
var T = (w, t, n) => le(w, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
-
import { defineComponent as ct, ref as M, watchEffect as ce, openBlock as v, createElementBlock as m, normalizeClass as
|
|
4
|
+
import { defineComponent as ct, ref as M, watchEffect as ce, openBlock as v, createElementBlock as m, normalizeClass as X, computed as V, onMounted as kt, nextTick as at, watch as K, createElementVNode as h, toDisplayString as z, Fragment as N, renderList as J, normalizeStyle as U, createCommentVNode as B, createVNode as R, withModifiers as It, createBlock as vt, withDirectives as ft, vModelText as mt, createTextVNode as lt } from "vue";
|
|
5
5
|
const pt = (w, t) => Math.sqrt(Math.pow(w.x - t.x, 2) + Math.pow(w.y - t.y, 2)), re = (w, t) => {
|
|
6
6
|
let n = !1;
|
|
7
|
-
for (let e = 0,
|
|
8
|
-
const
|
|
9
|
-
|
|
7
|
+
for (let e = 0, l = t.length - 1; e < t.length; l = e++) {
|
|
8
|
+
const o = t[e].x, c = t[e].y, g = t[l].x, u = t[l].y;
|
|
9
|
+
c > w.y != u > w.y && w.x < (g - o) * (w.y - c) / (u - c) + o && (n = !n);
|
|
10
10
|
}
|
|
11
11
|
return n;
|
|
12
12
|
}, At = (w, t, n) => {
|
|
13
|
-
const e = n * (Math.PI / 180),
|
|
13
|
+
const e = n * (Math.PI / 180), l = Math.cos(e), o = Math.sin(e), c = w.x - t.x, g = w.y - t.y;
|
|
14
14
|
return {
|
|
15
|
-
x: t.x + (
|
|
16
|
-
y: t.y + (
|
|
15
|
+
x: t.x + (c * l - g * o),
|
|
16
|
+
y: t.y + (c * o + g * l)
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
19
|
class he {
|
|
@@ -89,8 +89,8 @@ class he {
|
|
|
89
89
|
zoom(t) {
|
|
90
90
|
const e = t > 0 ? this.scale * 1.1 : this.scale / 1.1;
|
|
91
91
|
if (e < 0.1 || e > 10) return;
|
|
92
|
-
const
|
|
93
|
-
this.scale = e, this.offset.x =
|
|
92
|
+
const l = this.canvas.width / 2, o = this.canvas.height / 2, c = this.toImageCoords(l, o);
|
|
93
|
+
this.scale = e, this.offset.x = l - c.x * this.scale, this.offset.y = o - c.y * this.scale, this.clampViewportOffset(), this.render();
|
|
94
94
|
}
|
|
95
95
|
resize() {
|
|
96
96
|
this.fitImageToCanvas(), this.render();
|
|
@@ -118,18 +118,20 @@ class he {
|
|
|
118
118
|
}
|
|
119
119
|
clampViewportOffset() {
|
|
120
120
|
if (this.img.width === 0 || this.img.height === 0) return;
|
|
121
|
-
const t = this.img.width * this.scale, n = this.img.height * this.scale;
|
|
122
|
-
if (t <= this.canvas.width)
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
this.
|
|
121
|
+
const t = this.img.width * this.scale, n = this.img.height * this.scale, e = 100;
|
|
122
|
+
if (t <= this.canvas.width) {
|
|
123
|
+
const l = -t + e, o = this.canvas.width - e;
|
|
124
|
+
this.offset.x = Math.min(o, Math.max(l, this.offset.x));
|
|
125
|
+
} else {
|
|
126
|
+
const l = this.canvas.width - t - e, o = e;
|
|
127
|
+
this.offset.x = Math.min(o, Math.max(l, this.offset.x));
|
|
127
128
|
}
|
|
128
|
-
if (n <= this.canvas.height)
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
this.
|
|
129
|
+
if (n <= this.canvas.height) {
|
|
130
|
+
const l = -n + e, o = this.canvas.height - e;
|
|
131
|
+
this.offset.y = Math.min(o, Math.max(l, this.offset.y));
|
|
132
|
+
} else {
|
|
133
|
+
const l = this.canvas.height - n - e, o = e;
|
|
134
|
+
this.offset.y = Math.min(o, Math.max(l, this.offset.y));
|
|
133
135
|
}
|
|
134
136
|
}
|
|
135
137
|
// --- 事件处理 ---
|
|
@@ -151,28 +153,28 @@ class he {
|
|
|
151
153
|
}
|
|
152
154
|
}
|
|
153
155
|
handleMouseDown(t) {
|
|
154
|
-
const n = this.canvas.getBoundingClientRect(), e = t.clientX - n.left,
|
|
155
|
-
if (this.
|
|
156
|
-
this.isPanning = !0, this.panStartPoint = { x: e, y:
|
|
156
|
+
const n = this.canvas.getBoundingClientRect(), e = t.clientX - n.left, l = t.clientY - n.top, o = this.toImageCoords(e, l);
|
|
157
|
+
if (this.interactionMode === "pan") {
|
|
158
|
+
this.isPanning = !0, this.panStartPoint = { x: e, y: l }, this.canvas.style.cursor = "grabbing";
|
|
157
159
|
return;
|
|
158
160
|
}
|
|
159
161
|
if (this.interactionMode === "select" && this.activeAnnotation) {
|
|
160
|
-
const u = this.getHitHandle(e,
|
|
162
|
+
const u = this.getHitHandle(e, l, this.activeAnnotation);
|
|
161
163
|
if (u !== -100) {
|
|
162
|
-
this.isDragging = !0, this.dragStartPoint =
|
|
164
|
+
this.isDragging = !0, this.dragStartPoint = o, this.selectedHandleIndex = u, this.dragStartAnnotation = JSON.parse(JSON.stringify(this.activeAnnotation));
|
|
163
165
|
return;
|
|
164
166
|
}
|
|
165
167
|
}
|
|
166
|
-
const
|
|
167
|
-
if (
|
|
168
|
-
this.activeAnnotation =
|
|
168
|
+
const c = this.interactionMode === "select" ? this.getHitCategory(e, l) : null;
|
|
169
|
+
if (c) {
|
|
170
|
+
this.activeAnnotation = c, this.isDragging = !1, this.selectedHandleIndex = -1, this.emit("annotationChange", { action: "select", changedItem: c, imageUrl: this.imageUrl }), this.render();
|
|
169
171
|
return;
|
|
170
172
|
}
|
|
171
|
-
const g = this.getHitAnnotation(
|
|
173
|
+
const g = this.getHitAnnotation(o);
|
|
172
174
|
if (this.interactionMode === "select") {
|
|
173
175
|
if (g) {
|
|
174
176
|
if (!(this.visibleLabels.size > 0 && !this.visibleLabels.has(g.label))) {
|
|
175
|
-
this.activeAnnotation = g, this.isDragging = !0, this.dragStartPoint =
|
|
177
|
+
this.activeAnnotation = g, this.isDragging = !0, this.dragStartPoint = o, this.selectedHandleIndex = -1, this.dragStartAnnotation = JSON.parse(JSON.stringify(g)), this.emit("annotationChange", { action: "select", changedItem: g, imageUrl: this.imageUrl }), this.render();
|
|
176
178
|
return;
|
|
177
179
|
}
|
|
178
180
|
} else
|
|
@@ -182,42 +184,42 @@ class he {
|
|
|
182
184
|
if (this.interactionMode === "draw") {
|
|
183
185
|
if (this.isDrawing && this.currentTool === "polygon" && this.activeAnnotation) {
|
|
184
186
|
const u = this.activeAnnotation.coordinates;
|
|
185
|
-
if (u.points.length > 2 && pt(
|
|
187
|
+
if (u.points.length > 2 && pt(o, u.points[0]) < 20 / this.scale) {
|
|
186
188
|
this.finishDrawing();
|
|
187
189
|
return;
|
|
188
190
|
}
|
|
189
|
-
this.startDrawing(
|
|
191
|
+
this.startDrawing(o);
|
|
190
192
|
return;
|
|
191
193
|
}
|
|
192
194
|
if (this.currentTool) {
|
|
193
195
|
if (this.currentTool === "polygon" && !this.isDrawing) {
|
|
194
|
-
this.startDrawing(
|
|
196
|
+
this.startDrawing(o);
|
|
195
197
|
return;
|
|
196
198
|
}
|
|
197
|
-
this.startDrawing(
|
|
199
|
+
this.startDrawing(o);
|
|
198
200
|
}
|
|
199
201
|
return;
|
|
200
202
|
}
|
|
201
203
|
this.activeAnnotation = null, this.render();
|
|
202
204
|
}
|
|
203
205
|
handleMouseMove(t) {
|
|
204
|
-
const n = this.canvas.getBoundingClientRect(), e = t.clientX - n.left,
|
|
206
|
+
const n = this.canvas.getBoundingClientRect(), e = t.clientX - n.left, l = t.clientY - n.top, o = this.toImageCoords(e, l);
|
|
205
207
|
if (this.isPanning && this.panStartPoint) {
|
|
206
|
-
const
|
|
207
|
-
this.offset.x +=
|
|
208
|
+
const c = e - this.panStartPoint.x, g = l - this.panStartPoint.y;
|
|
209
|
+
this.offset.x += c, this.offset.y += g, this.clampViewportOffset(), this.panStartPoint = { x: e, y: l }, this.render();
|
|
208
210
|
return;
|
|
209
211
|
}
|
|
210
|
-
if (this.lastMouseMovePoint =
|
|
212
|
+
if (this.lastMouseMovePoint = o, this.isDrawing) {
|
|
211
213
|
if (this.currentTool === "polygon" && this.activeAnnotation) {
|
|
212
|
-
const
|
|
213
|
-
if (
|
|
214
|
-
const g =
|
|
214
|
+
const c = this.activeAnnotation.coordinates;
|
|
215
|
+
if (c.points.length > 2) {
|
|
216
|
+
const g = c.points[0], u = pt(o, g);
|
|
215
217
|
this.isHoveringStartPoint = u < 20 / this.scale;
|
|
216
218
|
} else
|
|
217
219
|
this.isHoveringStartPoint = !1;
|
|
218
220
|
}
|
|
219
|
-
this.updateDrawing(
|
|
220
|
-
} else this.isDragging && this.activeAnnotation && this.dragStartPoint ? this.updateDragging(
|
|
221
|
+
this.updateDrawing(o);
|
|
222
|
+
} else this.isDragging && this.activeAnnotation && this.dragStartPoint ? this.updateDragging(o) : this.checkHover(e, l, o);
|
|
221
223
|
this.render();
|
|
222
224
|
}
|
|
223
225
|
handleMouseUp(t) {
|
|
@@ -242,8 +244,8 @@ class he {
|
|
|
242
244
|
// 辅助函数:将 hex 转换为 rgba
|
|
243
245
|
hexToRgba(t, n) {
|
|
244
246
|
if (!t.startsWith("#")) return t;
|
|
245
|
-
const e = parseInt(t.slice(1, 3), 16),
|
|
246
|
-
return `rgba(${e}, ${
|
|
247
|
+
const e = parseInt(t.slice(1, 3), 16), l = parseInt(t.slice(3, 5), 16), o = parseInt(t.slice(5, 7), 16);
|
|
248
|
+
return `rgba(${e}, ${l}, ${o}, ${n})`;
|
|
247
249
|
}
|
|
248
250
|
startDrawing(t) {
|
|
249
251
|
if (!this.currentTool) return;
|
|
@@ -298,8 +300,8 @@ class he {
|
|
|
298
300
|
const n = this.activeAnnotation.coordinates;
|
|
299
301
|
n.x2 = t.x, n.y2 = t.y;
|
|
300
302
|
} else if (this.activeAnnotation.type === "rotatedRect" && this.dragStartPoint) {
|
|
301
|
-
const n = this.activeAnnotation.coordinates, e = Math.abs(t.x - this.dragStartPoint.x),
|
|
302
|
-
n.width = e * 2, n.height =
|
|
303
|
+
const n = this.activeAnnotation.coordinates, e = Math.abs(t.x - this.dragStartPoint.x), l = Math.abs(t.y - this.dragStartPoint.y);
|
|
304
|
+
n.width = e * 2, n.height = l * 2;
|
|
303
305
|
} else this.activeAnnotation.type;
|
|
304
306
|
}
|
|
305
307
|
finishDrawing() {
|
|
@@ -310,8 +312,8 @@ class he {
|
|
|
310
312
|
this.activeAnnotation = null, this.isDrawing = !1;
|
|
311
313
|
return;
|
|
312
314
|
}
|
|
313
|
-
const n = Math.min(t.x1, t.x2), e = Math.max(t.x1, t.x2),
|
|
314
|
-
t.x1 = n, t.x2 = e, t.y1 =
|
|
315
|
+
const n = Math.min(t.x1, t.x2), e = Math.max(t.x1, t.x2), l = Math.min(t.y1, t.y2), o = Math.max(t.y1, t.y2);
|
|
316
|
+
t.x1 = n, t.x2 = e, t.y1 = l, t.y2 = o, this.annotations.push(this.activeAnnotation), this.emit("annotationChange", { action: "add", changedItem: this.activeAnnotation, imageUrl: this.imageUrl });
|
|
315
317
|
} else if (this.activeAnnotation.type === "polygon") {
|
|
316
318
|
if (this.activeAnnotation.coordinates.points.length < 3) {
|
|
317
319
|
this.activeAnnotation = null, this.isDrawing = !1;
|
|
@@ -335,43 +337,43 @@ class he {
|
|
|
335
337
|
const n = t.x - this.dragStartPoint.x, e = t.y - this.dragStartPoint.y;
|
|
336
338
|
this.selectedHandleIndex === -1 ? this.moveAnnotation(this.activeAnnotation, this.dragStartAnnotation, n, e) : this.resizeAnnotation(this.activeAnnotation, this.dragStartAnnotation, this.selectedHandleIndex, t);
|
|
337
339
|
}
|
|
338
|
-
moveAnnotation(t, n, e,
|
|
340
|
+
moveAnnotation(t, n, e, l) {
|
|
339
341
|
if (t.type === "rectangle") {
|
|
340
|
-
const
|
|
341
|
-
|
|
342
|
+
const o = n.coordinates, c = t.coordinates;
|
|
343
|
+
c.x1 = o.x1 + e, c.x2 = o.x2 + e, c.y1 = o.y1 + l, c.y2 = o.y2 + l;
|
|
342
344
|
} else if (t.type === "point") {
|
|
343
|
-
const
|
|
344
|
-
|
|
345
|
+
const o = n.coordinates, c = t.coordinates;
|
|
346
|
+
c.points = o.points.map((g) => ({ x: g.x + e, y: g.y + l }));
|
|
345
347
|
} else if (t.type === "rotatedRect") {
|
|
346
|
-
const
|
|
347
|
-
|
|
348
|
+
const o = n.coordinates, c = t.coordinates;
|
|
349
|
+
c.x = o.x + e, c.y = o.y + l;
|
|
348
350
|
} else if (t.type === "polygon") {
|
|
349
|
-
const
|
|
350
|
-
|
|
351
|
+
const o = n.coordinates, c = t.coordinates;
|
|
352
|
+
c.points = o.points.map((g) => ({ x: g.x + e, y: g.y + l }));
|
|
351
353
|
} else if (t.type === "category") {
|
|
352
|
-
const
|
|
353
|
-
|
|
354
|
+
const o = n.coordinates, c = t.coordinates;
|
|
355
|
+
o && c && (c.x = o.x + e, c.y = o.y + l);
|
|
354
356
|
}
|
|
355
357
|
}
|
|
356
|
-
resizeAnnotation(t, n, e,
|
|
358
|
+
resizeAnnotation(t, n, e, l) {
|
|
357
359
|
if (t.type === "rectangle") {
|
|
358
|
-
const
|
|
359
|
-
e === 0 && (
|
|
360
|
+
const o = t.coordinates;
|
|
361
|
+
e === 0 && (o.x1 = l.x, o.y1 = l.y), e === 1 && (o.x2 = l.x, o.y1 = l.y), e === 2 && (o.x2 = l.x, o.y2 = l.y), e === 3 && (o.x1 = l.x, o.y2 = l.y);
|
|
360
362
|
} else if (t.type === "polygon") {
|
|
361
|
-
const
|
|
362
|
-
e >= 0 && e <
|
|
363
|
+
const o = t.coordinates;
|
|
364
|
+
e >= 0 && e < o.points.length && (o.points[e] = l);
|
|
363
365
|
} else if (t.type === "point") {
|
|
364
|
-
const
|
|
365
|
-
e >= 0 && e <
|
|
366
|
+
const o = t.coordinates;
|
|
367
|
+
e >= 0 && e < o.points.length && (o.points[e] = l);
|
|
366
368
|
} else if (t.type === "rotatedRect") {
|
|
367
|
-
const
|
|
369
|
+
const o = t.coordinates;
|
|
368
370
|
if (e === -2) {
|
|
369
|
-
const
|
|
370
|
-
let
|
|
371
|
-
|
|
371
|
+
const c = o.x, g = o.y, u = l.x - c, r = l.y - g;
|
|
372
|
+
let k = Math.atan2(r, u) * 180 / Math.PI;
|
|
373
|
+
k += 90, o.angle = k;
|
|
372
374
|
} else {
|
|
373
|
-
const
|
|
374
|
-
(e === 0 || e === 3) && (
|
|
375
|
+
const c = o.angle * Math.PI / 180, g = Math.cos(-c), u = Math.sin(-c), r = l.x - o.x, k = l.y - o.y, x = r * g - k * u, D = r * u + k * g;
|
|
376
|
+
(e === 0 || e === 3) && (o.width / 2, o.width = Math.abs(x) * 2), (e === 1 || e === 2) && (o.width = Math.abs(x) * 2), (e === 0 || e === 1) && (o.height = Math.abs(D) * 2), (e === 2 || e === 3) && (o.height = Math.abs(D) * 2);
|
|
375
377
|
}
|
|
376
378
|
}
|
|
377
379
|
}
|
|
@@ -392,18 +394,18 @@ class he {
|
|
|
392
394
|
const e = n.coordinates;
|
|
393
395
|
return re(t, e.points);
|
|
394
396
|
} else if (n.type === "rotatedRect") {
|
|
395
|
-
const e = n.coordinates,
|
|
396
|
-
return
|
|
397
|
+
const e = n.coordinates, l = At(t, { x: e.x, y: e.y }, -e.angle), o = e.width / 2, c = e.height / 2;
|
|
398
|
+
return l.x >= e.x - o && l.x <= e.x + o && l.y >= e.y - c && l.y <= e.y + c;
|
|
397
399
|
} else if (n.type === "point")
|
|
398
|
-
return n.coordinates.points.some((
|
|
400
|
+
return n.coordinates.points.some((l) => pt(t, l) < 10 / this.scale);
|
|
399
401
|
return !1;
|
|
400
402
|
}
|
|
401
403
|
getHitHandle(t, n, e) {
|
|
402
|
-
const
|
|
403
|
-
for (let
|
|
404
|
-
const g = c
|
|
405
|
-
if (Math.abs(t - u.x) <
|
|
406
|
-
return e.type === "rotatedRect" &&
|
|
404
|
+
const l = this.getAnnotationHandles(e), o = 6;
|
|
405
|
+
for (let c = 0; c < l.length; c++) {
|
|
406
|
+
const g = l[c], u = this.toScreenCoords(g.x, g.y);
|
|
407
|
+
if (Math.abs(t - u.x) < o && Math.abs(n - u.y) < o)
|
|
408
|
+
return e.type === "rotatedRect" && c === 4 ? -2 : c;
|
|
407
409
|
}
|
|
408
410
|
return -100;
|
|
409
411
|
}
|
|
@@ -426,24 +428,24 @@ class he {
|
|
|
426
428
|
if (t.type === "point")
|
|
427
429
|
return t.coordinates.points;
|
|
428
430
|
if (t.type === "rotatedRect") {
|
|
429
|
-
const n = t.coordinates, e = { x: n.x, y: n.y },
|
|
430
|
-
return [
|
|
431
|
+
const n = t.coordinates, e = { x: n.x, y: n.y }, l = n.width / 2, o = n.height / 2, c = { x: n.x - l, y: n.y - o }, g = { x: n.x + l, y: n.y - o }, u = { x: n.x + l, y: n.y + o }, r = { x: n.x - l, y: n.y + o }, k = { x: n.x, y: n.y - o - 20 / this.scale };
|
|
432
|
+
return [c, g, u, r, k].map((x) => At(x, e, n.angle));
|
|
431
433
|
}
|
|
432
434
|
}
|
|
433
435
|
return [];
|
|
434
436
|
}
|
|
435
437
|
checkHover(t, n, e) {
|
|
436
|
-
const
|
|
437
|
-
if (
|
|
438
|
-
this.canvas.style.cursor = "pointer", this.hoverAnnotation =
|
|
438
|
+
const l = this.getHitCategory(t, n);
|
|
439
|
+
if (l) {
|
|
440
|
+
this.canvas.style.cursor = "pointer", this.hoverAnnotation = l;
|
|
439
441
|
return;
|
|
440
442
|
}
|
|
441
443
|
if (this.activeAnnotation && this.getHitHandle(t, n, this.activeAnnotation) !== -100) {
|
|
442
444
|
this.canvas.style.cursor = "pointer";
|
|
443
445
|
return;
|
|
444
446
|
}
|
|
445
|
-
const
|
|
446
|
-
|
|
447
|
+
const o = this.getHitAnnotation(e);
|
|
448
|
+
o ? (this.canvas.style.cursor = "move", this.hoverAnnotation = o) : (this.canvas.style.cursor = "default", this.hoverAnnotation = null);
|
|
447
449
|
}
|
|
448
450
|
render() {
|
|
449
451
|
this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height), this.img.complete && this.img.width > 0 && this.ctx.drawImage(this.img, this.offset.x, this.offset.y, this.img.width * this.scale, this.img.height * this.scale), this.annotations.forEach((t) => {
|
|
@@ -456,72 +458,72 @@ class he {
|
|
|
456
458
|
this.ctx.save(), this.ctx.font = "14px sans-serif", this.ctx.textBaseline = "middle", this.ctx.textAlign = "center";
|
|
457
459
|
const n = 12;
|
|
458
460
|
t.forEach((e) => {
|
|
459
|
-
var
|
|
460
|
-
const
|
|
461
|
+
var _;
|
|
462
|
+
const l = e.label || "未命名分类", o = this.ctx.measureText(l).width + n * 2, c = 28, g = this.activeAnnotation === e, u = this.hoverAnnotation === e;
|
|
461
463
|
let r = { x: 20, y: 20 };
|
|
462
464
|
e.coordinates && typeof e.coordinates.x == "number" && typeof e.coordinates.y == "number" && (r = this.toScreenCoords(e.coordinates.x, e.coordinates.y));
|
|
463
|
-
const
|
|
464
|
-
this.ctx.fillStyle = g ? D : this.hexToRgba(D, 0.85), u && !g && (this.ctx.fillStyle = D), g ? (this.ctx.strokeStyle = "#ffffff", this.ctx.lineWidth = 2) : (this.ctx.strokeStyle = "transparent", this.ctx.lineWidth = 0), this.ctx.beginPath(), this.ctx.roundRect(
|
|
465
|
+
const k = r.x - o / 2, x = r.y - c / 2, D = ((_ = e.style) == null ? void 0 : _.strokeColor) || "#2196F3";
|
|
466
|
+
this.ctx.fillStyle = g ? D : this.hexToRgba(D, 0.85), u && !g && (this.ctx.fillStyle = D), g ? (this.ctx.strokeStyle = "#ffffff", this.ctx.lineWidth = 2) : (this.ctx.strokeStyle = "transparent", this.ctx.lineWidth = 0), this.ctx.beginPath(), this.ctx.roundRect(k, x, o, c, 6), this.ctx.fill(), g && (this.ctx.stroke(), this.ctx.save(), this.ctx.strokeStyle = D, this.ctx.lineWidth = 2, this.ctx.strokeRect(k - 3, x - 3, o + 6, c + 6), this.ctx.restore()), this.ctx.fillStyle = "#ffffff", this.ctx.fillText(l, r.x, r.y);
|
|
465
467
|
}), this.ctx.restore();
|
|
466
468
|
}
|
|
467
469
|
getHitCategory(t, n) {
|
|
468
470
|
const e = this.annotations.filter((g) => g.type === "category");
|
|
469
471
|
if (e.length === 0) return null;
|
|
470
472
|
this.ctx.save(), this.ctx.font = "14px sans-serif";
|
|
471
|
-
const
|
|
472
|
-
let
|
|
473
|
+
const l = 12, o = 28;
|
|
474
|
+
let c = null;
|
|
473
475
|
for (let g = e.length - 1; g >= 0; g--) {
|
|
474
|
-
const u = e[g], r = u.label || "未命名分类",
|
|
476
|
+
const u = e[g], r = u.label || "未命名分类", k = this.ctx.measureText(r).width + l * 2;
|
|
475
477
|
let x = { x: 20, y: 20 };
|
|
476
478
|
u.coordinates && typeof u.coordinates.x == "number" && typeof u.coordinates.y == "number" && (x = this.toScreenCoords(u.coordinates.x, u.coordinates.y));
|
|
477
|
-
const D = x.x -
|
|
478
|
-
if (t >= D && t <= D +
|
|
479
|
-
|
|
479
|
+
const D = x.x - k / 2, _ = x.y - o / 2;
|
|
480
|
+
if (t >= D && t <= D + k && n >= _ && n <= _ + o) {
|
|
481
|
+
c = u;
|
|
480
482
|
break;
|
|
481
483
|
}
|
|
482
484
|
}
|
|
483
|
-
return this.ctx.restore(),
|
|
485
|
+
return this.ctx.restore(), c;
|
|
484
486
|
}
|
|
485
487
|
drawItem(t, n) {
|
|
486
|
-
var
|
|
488
|
+
var o;
|
|
487
489
|
if (this.visibleLabels.size > 0 && !this.visibleLabels.has(t.label) && !n)
|
|
488
490
|
return;
|
|
489
491
|
this.ctx.save();
|
|
490
|
-
const e = ((
|
|
491
|
-
if (this.ctx.strokeStyle =
|
|
492
|
-
const
|
|
493
|
-
this.ctx.strokeRect(r,
|
|
492
|
+
const e = ((o = t.style) == null ? void 0 : o.strokeColor) || "#FF4081", l = n ? "#00E5FF" : e;
|
|
493
|
+
if (this.ctx.strokeStyle = l, this.ctx.lineWidth = 2, t.type === "rectangle") {
|
|
494
|
+
const c = t.coordinates, g = this.toScreenCoords(c.x1, c.y1), u = this.toScreenCoords(c.x2, c.y2), r = Math.min(g.x, u.x), k = Math.min(g.y, u.y), x = Math.abs(g.x - u.x), D = Math.abs(g.y - u.y);
|
|
495
|
+
this.ctx.strokeRect(r, k, x, D), n && this.drawHandles(this.getAnnotationHandles(t));
|
|
494
496
|
} else if (t.type === "polygon") {
|
|
495
|
-
const
|
|
496
|
-
if (
|
|
497
|
+
const c = t.coordinates;
|
|
498
|
+
if (c.points.length === 0) {
|
|
497
499
|
this.ctx.restore();
|
|
498
500
|
return;
|
|
499
501
|
}
|
|
500
502
|
this.ctx.beginPath();
|
|
501
|
-
const g = this.toScreenCoords(
|
|
503
|
+
const g = this.toScreenCoords(c.points[0].x, c.points[0].y);
|
|
502
504
|
this.ctx.moveTo(g.x, g.y);
|
|
503
|
-
for (let u = 1; u <
|
|
504
|
-
const r = this.toScreenCoords(
|
|
505
|
+
for (let u = 1; u < c.points.length; u++) {
|
|
506
|
+
const r = this.toScreenCoords(c.points[u].x, c.points[u].y);
|
|
505
507
|
this.ctx.lineTo(r.x, r.y);
|
|
506
508
|
}
|
|
507
509
|
if (!this.isDrawing || t !== this.activeAnnotation)
|
|
508
510
|
this.ctx.closePath();
|
|
509
511
|
else if (this.lastMouseMovePoint) {
|
|
510
512
|
let u = this.lastMouseMovePoint;
|
|
511
|
-
if (this.isHoveringStartPoint &&
|
|
512
|
-
u =
|
|
513
|
-
const
|
|
514
|
-
this.ctx.save(), this.ctx.beginPath(), this.ctx.arc(
|
|
513
|
+
if (this.isHoveringStartPoint && c.points.length > 0) {
|
|
514
|
+
u = c.points[0];
|
|
515
|
+
const k = this.toScreenCoords(c.points[0].x, c.points[0].y);
|
|
516
|
+
this.ctx.save(), this.ctx.beginPath(), this.ctx.arc(k.x, k.y, 10, 0, Math.PI * 2), this.ctx.fillStyle = "rgba(255, 215, 0, 0.6)", this.ctx.strokeStyle = "#FFFFFF", this.ctx.lineWidth = 2, this.ctx.fill(), this.ctx.stroke(), this.ctx.restore();
|
|
515
517
|
}
|
|
516
518
|
const r = this.toScreenCoords(u.x, u.y);
|
|
517
519
|
this.ctx.lineTo(r.x, r.y);
|
|
518
520
|
}
|
|
519
521
|
this.ctx.stroke(), n && this.drawHandles(this.getAnnotationHandles(t));
|
|
520
522
|
} else if (t.type === "rotatedRect") {
|
|
521
|
-
const
|
|
522
|
-
this.ctx.translate(this.toScreenCoords(
|
|
523
|
-
const g =
|
|
524
|
-
this.ctx.strokeRect(-g / 2, -u / 2, g, u), this.ctx.rotate(-
|
|
523
|
+
const c = t.coordinates;
|
|
524
|
+
this.ctx.translate(this.toScreenCoords(c.x, c.y).x, this.toScreenCoords(c.x, c.y).y), this.ctx.rotate(c.angle * Math.PI / 180);
|
|
525
|
+
const g = c.width * this.scale, u = c.height * this.scale;
|
|
526
|
+
this.ctx.strokeRect(-g / 2, -u / 2, g, u), this.ctx.rotate(-c.angle * Math.PI / 180), this.ctx.translate(-this.toScreenCoords(c.x, c.y).x, -this.toScreenCoords(c.x, c.y).y), n && this.drawHandles(this.getAnnotationHandles(t));
|
|
525
527
|
} else t.type === "point" && t.coordinates.points.forEach((g) => {
|
|
526
528
|
const u = this.toScreenCoords(g.x, g.y);
|
|
527
529
|
this.ctx.beginPath(), this.ctx.arc(u.x, u.y, 5, 0, Math.PI * 2), this.ctx.fillStyle = n ? "#00E5FF" : e, this.ctx.fill(), this.ctx.stroke();
|
|
@@ -535,31 +537,31 @@ class he {
|
|
|
535
537
|
});
|
|
536
538
|
}
|
|
537
539
|
}
|
|
538
|
-
const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032114659" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="21132" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M512 391.68c-66.56 0-120.32 54.187-120.32 120.32 0 66.56 53.76 120.32 120.32 120.32 66.133 0 120.32-53.76 120.32-120.32A120.747 120.747 0 0 0 512 391.68z" p-id="21133" fill="#515151"></path><path d="M512 113.493c-219.733 0-398.507 178.774-398.507 398.507S292.267 910.507 512 910.507 910.507 731.733 910.507 512 731.733 113.493 512 113.493z m0 720.214c-177.493 0-321.707-144.214-321.707-321.707S334.507 190.293 512 190.293 833.707 334.507 833.707 512 689.493 833.707 512 833.707z" p-id="21134" fill="#515151"></path></svg>', ge = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M15.7 4.3c.4.4.4 1 0 1.4L9.4 12l6.3 6.3c.4.4.4 1 0 1.4-.4.4-1 .4-1.4 0l-7-7c-.4-.4-.4-1 0-1.4l7-7c.4-.4 1-.4 1.4 0z"/></svg>', ue = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032015085" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="16560" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M911.872 972.629333l-2.645333-1.621333-209.92-208.554667-91.306667 193.194667-147.029333-494.933333 486.4 179.968-177.834667 68.266666 201.472 200.362667a9.898667 9.898667 0 0 1 2.133333 4.608 10.069333 10.069333 0 0 1-1.024 4.778667l-2.389333 3.157333-47.786667 47.530667a9.813333 9.813333 0 0 1-4.522666 2.901333 12.544 12.544 0 0 1-2.56 0z m-657.066667-12.970666L0.256 501.248l97.109333-175.445333 64.256-115.456L254.805333 42.581333h510.208l259.328 466.858667h-100.608L714.325333 132.778667H305.322667l-204.8 368.384 204.8 368.725333H418.133333v90.026667z" fill="#515151" p-id="16561"></path></svg>', ve = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032973956" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6763" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M613.6 960H97.2c-17.7 0-32-14.3-32-32V98.5c0-17.7 14.3-32 32-32h829.5c17.7 0 32 14.3 32 32v518.2c0 17.7-14.3 32-32 32s-32-14.3-32-32V130.5H129.2V896h484.4c17.7 0 32 14.3 32 32s-14.3 32-32 32z" fill="#515151" p-id="6764"></path><path d="M711.3 694.9l120.3 46.9-100.7 80.7z" fill="#515151" p-id="6765"></path><path d="M707.6 882.1L671.3 645l223.6 87.1-187.3 150z m43.7-137.3l2.8 18 14.2-11.4-17-6.6z" fill="#515151" p-id="6766"></path><path d="M927 957.9c-8.2 0-16.4-3.1-22.6-9.4L723.2 767.2c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l181.2 181.2c12.5 12.5 12.5 32.8 0 45.3-6.3 6.3-14.5 9.5-22.7 9.5z" fill="#515151" p-id="6767"></path></svg>', fe = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M19 6h-4V5c0-1.1-.9-2-2-2h-2c-1.1 0-2 .9-2 2v1H5c-.6 0-1 .4-1 1s.4 1 1 1h14c.6 0 1-.4 1-1s-.4-1-1-1zM10 5h4v1h-4V5z"/><path fill="currentColor" d="M6 9v10c0 1.7 1.3 3 3 3h6c1.7 0 3-1.3 3-3V9H6zm4 9c0 .6-.4 1-1 1s-1-.4-1-1v-5c0-.6.4-1 1-1s1 .4 1 1v5zm4 0c0 .6-.4 1-1 1s-1-.4-1-1v-5c0-.6.4-1 1-1s1 .4 1 1v5z"/></svg>', me = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M19 15v4c0 1.1-.9 2-2 2H7c-1.1 0-2-.9-2-2v-4c0-.6.4-1 1-1s1 .4 1 1v4h10v-4c0-.6.4-1 1-1s1 .4 1 1zm-7.7 1.3c.2.2.4.3.7.3s.5-.1.7-.3l4.6-4.6c.4-.4.4-1 0-1.4-.4-.4-1-.4-1.4 0l-2.9 2.9V3c0-.6-.4-1-1-1s-1 .4-1 1v8.3l-2.9-2.9c-.4-.4-1-.4-1.4 0-.4.4-.4 1 0 1.4l4.6 4.6z"/></svg>', pe = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M3 17.2v4.3c0 .3.2.5.5.5h4.3c.1 0 .3-.1.4-.2l11.1-11.1-5.1-5.1L3.1 16.8c-.1.1-.1.3-.1.4zm18.8-10.9c.4-.4.4-1 0-1.4l-3.7-3.7c-.4-.4-1-.4-1.4 0l-2.3 2.3 5.1 5.1 2.3-2.3z"/></svg>', ye = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M18.7 4.3c.4.4.4 1 0 1.4L12.4 12l6.3 6.3c.4.4.4 1 0 1.4-.4.4-1 .4-1.4 0l-7-7c-.4-.4-.4-1 0-1.4l7-7c.4-.4 1-.4 1.4 0z"/><path fill="currentColor" d="M10.7 4.3c.4.4.4 1 0 1.4L4.4 12l6.3 6.3c.4.4.4 1 0 1.4-.4.4-1 .4-1.4 0l-7-7c-.4-.4-.4-1 0-1.4l7-7c.4-.4 1-.4 1.4 0z"/></svg>', we = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032412624" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3527" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M870.2976 144.0256l51.2 51.2-122.88 122.88a514.304 514.304 0 0 1 170.7264 193.8688C885.0432 679.04 711.8848 793.6 512 793.6c-56.832 0-111.488-9.2672-162.56-26.3424L197.4016 919.296l-51.2-51.2L870.2976 144.0256z m-127.1552 229.5296l-76.6208 76.6208a166.4 166.4 0 0 1-216.32 216.3712l-38.6048 38.5792c29.5168 6.9632 60.032 10.9312 91.1872 11.5712L512 716.8c150.6816 0 287.488-77.2096 366.464-200.3456l2.816-4.48-2.816-4.48a435.8144 435.8144 0 0 0-135.3216-133.9392zM512 230.4c49.664 0 97.664 7.0656 143.0528 20.2496l-63.8208 63.7696a436.4032 436.4032 0 0 0-70.016-7.1168L512 307.2a434.8928 434.8928 0 0 0-366.464 200.3456l-2.816 4.48 2.816 4.48a435.84 435.84 0 0 0 119.8848 123.776l-55.0912 55.04a514.2528 514.2528 0 0 1-155.648-183.296C138.9312 344.96 312.0896 230.4 512 230.4z m89.5488 284.8l-86.3744 86.2976 1.7408-0.0256a89.6 89.6 0 0 0 84.6336-86.272zM512 345.6a166.656 166.656 0 0 1 42.5728 5.504l-79.0272 79.0272a89.9328 89.9328 0 0 0-45.4144 45.4144l-79.0272 79.0272A166.4 166.4 0 0 1 512 345.6z" p-id="3528" fill="#515151"></path></svg>', xe = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M5.3 19.7c-.4-.4-.4-1 0-1.4l6.3-6.3-6.3-6.3c-.4-.4-.4-1 0-1.4.4-.4 1-.4 1.4 0l7 7c.4.4.4 1 0 1.4l-7 7c-.4.4-1 .4-1.4 0z"/><path fill="currentColor" d="M13.3 19.7c-.4-.4-.4-1 0-1.4l6.3-6.3-6.3-6.3c-.4-.4-.4-1 0-1.4.4-.4 1-.4 1.4 0l7 7c.4.4.4 1 0 1.4l-7 7c-.4.4-1 .4-1.4 0z"/></svg>', be = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775031871732" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="12257" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M174.63 78.98c0.03-12.61 16.41-19.91 25.81-11.5l328.72 293.98 318.27 284.63c10.51 9.4 0.4 26.75-14.25 24.46L435.7 608.43c-6.23-0.97-12.72 1.92-16.16 7.2L199.96 952.72c-8.09 12.42-27.76 8.34-27.72-5.76l1.17-426.97 1.22-441.01z" fill="#515151" p-id="12258"></path></svg>', _e = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032210611" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="23146" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M543.487882 0.00128a161.919393 161.919393 0 0 0-114.55957 47.359822L47.553742 428.991671a162.111392 162.111392 0 0 0 0 229.119141l318.270806 318.398806a161.983393 161.983393 0 0 0 229.119141 0l381.630569-381.694569A162.111392 162.111392 0 0 0 1023.99808 480.255479V161.920673A161.919393 161.919393 0 0 0 861.886688 0.00128H543.487882z m0 90.55966l318.462806 0.064a71.295733 71.295733 0 0 1 71.487732 71.295733v318.270806c0 18.943929-7.615971 37.119861-21.055921 50.559811l-381.56657 381.758568a71.423732 71.423732 0 0 1-101.055621 0L111.489502 594.111052a71.487732 71.487732 0 0 1 0-101.119621l381.566569-381.566569c13.37595-13.37595 31.551882-20.863922 50.431811-20.863922z m112.447578 124.159535a153.023426 153.023426 0 1 0 0 306.046852 153.023426 153.023426 0 0 0 0-306.046852z m57.727784 129.151515a62.463766 62.463766 0 1 1-115.455567 47.807821 62.463766 62.463766 0 0 1 115.455567-47.807821z" p-id="23147" fill="#515151"></path></svg>', Ce = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M20.5 10.5V11c0 4.7-3.8 8.5-8.5 8.5S3.5 15.7 3.5 11v-4c0-1.4 1.1-2.5 2.5-2.5s2.5 1.1 2.5 2.5v1.5c0 .3.2.5.5.5s.5-.2.5-.5v-4c0-1.4 1.1-2.5 2.5-2.5s2.5 1.1 2.5 2.5v1.5c0 .3.2.5.5.5s.5-.2.5-.5v-1c0-1.4 1.1-2.5 2.5-2.5s2.5 1.1 2.5 2.5v2.5c0 .3.2.5.5.5s.5-.2.5-.5v-1.5c0-1.4 1.1-2.5 2.5-2.5s2.5 1.1 2.5 2.5z"/></svg>', ke = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775033156525" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3463" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M694.4 960H195.2C131.7 960 80 908.4 80 845.1V462c0-63.4 51.7-114.9 115.2-114.9h499.2c63.5 0 115.2 51.6 115.2 114.9v383.1c0 63.3-51.7 114.9-115.2 114.9zM195.2 423.7c-21.2 0-38.4 17.2-38.4 38.3v383.1c0 21.1 17.2 38.3 38.4 38.3h499.2c21.2 0 38.4-17.2 38.4-38.3V462c0-21.1-17.2-38.3-38.4-38.3H195.2z" fill="#515151" p-id="3464"></path><path d="M905.6 450.3c-14.8 0-28.9-8.6-35.2-23C788.6 240.8 592.7 213 483.2 213c-21.2 0-38.4-17.2-38.4-38.3s17.2-38.3 38.4-38.3c218.2 0 385 94.9 457.6 260.3 8.5 19.4-0.4 42-19.8 50.5-5 2.1-10.3 3.1-15.4 3.1z" fill="#515151" p-id="3465"></path><path d="M473.6 285.4c-9.8 0-19.7-3.7-27.2-11.2l-72.5-72.4c-15-15-15-39.2 0-54.2l72.5-72.4c15-15 39.3-15 54.3 0s15 39.2 0 54.2l-45.4 45.3 45.4 45.3c15 15 15 39.2 0 54.2-7.4 7.4-17.3 11.2-27.1 11.2z" fill="#515151" p-id="3466"></path></svg>', Ie = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M8.3 19.7c-.4-.4-.4-1 0-1.4l6.3-6.3-6.3-6.3c-.4-.4-.4-1 0-1.4.4-.4 1-.4 1.4 0l7 7c.4.4.4 1 0 1.4l-7 7c-.4.4-1 .4-1.4 0z"/></svg>', Ae = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032400373" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3314" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M512 230.4c199.8848 0 373.0176 114.5344 457.344 281.5744C885.0432 679.04 711.8848 793.6 512 793.6c-199.8848 0-373.0176-114.5344-457.344-281.5744C138.9568 344.96 312.1152 230.4 512 230.4z m0 76.8a434.8928 434.8928 0 0 0-366.464 200.3456l-2.816 4.48 2.816 4.48a434.944 434.944 0 0 0 357.248 200.192L512 716.8c150.6816 0 287.488-77.2096 366.464-200.3456l2.816-4.48-2.816-4.48a434.944 434.944 0 0 0-357.248-200.192L512 307.2z m0 38.4a166.4 166.4 0 1 1 0 332.8 166.4 166.4 0 0 1 0-332.8z m0 76.8a89.6 89.6 0 1 0 0 179.2 89.6 89.6 0 0 0 0-179.2z" p-id="3315" fill="#515151"></path></svg>', Se = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032548251" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4695" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M849.7664 778.1376c1.9968 1.4848 3.84 3.072 5.632 4.864l72.3968 72.3968a51.2 51.2 0 1 1-72.3968 72.3968l-72.3968-72.3968a51.6096 51.6096 0 0 1-4.864-5.632 448 448 0 1 1 71.68-71.68zM460.8 460.8V358.4a51.2 51.2 0 1 1 102.4 0v102.4h102.4a51.2 51.2 0 0 1 0 102.4h-102.4v102.4a51.2 51.2 0 0 1-102.4 0v-102.4H358.4a51.2 51.2 0 0 1 0-102.4h102.4z m38.4 384a345.6 345.6 0 1 0 0-691.2 345.6 345.6 0 0 0 0 691.2z" fill="#515151" p-id="4696"></path></svg>', Me = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032629657" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1933" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M849.7664 778.1376c1.9968 1.4848 3.84 3.072 5.632 4.864l72.3968 72.3968a51.2 51.2 0 1 1-72.3968 72.3968l-72.3968-72.3968a51.6096 51.6096 0 0 1-4.864-5.632 448 448 0 1 1 71.68-71.68zM499.2 844.8a345.6 345.6 0 1 0 0-691.2 345.6 345.6 0 0 0 0 691.2zM358.4 563.2a51.2 51.2 0 0 1 0-102.4h307.2a51.2 51.2 0 0 1 0 102.4H358.4z" fill="#666666" p-id="1934"></path></svg>', Te = ["innerHTML"], De = /* @__PURE__ */ ct({
|
|
540
|
+
const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032114659" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="21132" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M512 391.68c-66.56 0-120.32 54.187-120.32 120.32 0 66.56 53.76 120.32 120.32 120.32 66.133 0 120.32-53.76 120.32-120.32A120.747 120.747 0 0 0 512 391.68z" p-id="21133" fill="#515151"></path><path d="M512 113.493c-219.733 0-398.507 178.774-398.507 398.507S292.267 910.507 512 910.507 910.507 731.733 910.507 512 731.733 113.493 512 113.493z m0 720.214c-177.493 0-321.707-144.214-321.707-321.707S334.507 190.293 512 190.293 833.707 334.507 833.707 512 689.493 833.707 512 833.707z" p-id="21134" fill="#515151"></path></svg>', ge = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M15.7 4.3c.4.4.4 1 0 1.4L9.4 12l6.3 6.3c.4.4.4 1 0 1.4-.4.4-1 .4-1.4 0l-7-7c-.4-.4-.4-1 0-1.4l7-7c.4-.4 1-.4 1.4 0z"/></svg>', ue = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032015085" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="16560" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M911.872 972.629333l-2.645333-1.621333-209.92-208.554667-91.306667 193.194667-147.029333-494.933333 486.4 179.968-177.834667 68.266666 201.472 200.362667a9.898667 9.898667 0 0 1 2.133333 4.608 10.069333 10.069333 0 0 1-1.024 4.778667l-2.389333 3.157333-47.786667 47.530667a9.813333 9.813333 0 0 1-4.522666 2.901333 12.544 12.544 0 0 1-2.56 0z m-657.066667-12.970666L0.256 501.248l97.109333-175.445333 64.256-115.456L254.805333 42.581333h510.208l259.328 466.858667h-100.608L714.325333 132.778667H305.322667l-204.8 368.384 204.8 368.725333H418.133333v90.026667z" fill="#515151" p-id="16561"></path></svg>', ve = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032973956" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6763" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M613.6 960H97.2c-17.7 0-32-14.3-32-32V98.5c0-17.7 14.3-32 32-32h829.5c17.7 0 32 14.3 32 32v518.2c0 17.7-14.3 32-32 32s-32-14.3-32-32V130.5H129.2V896h484.4c17.7 0 32 14.3 32 32s-14.3 32-32 32z" fill="#515151" p-id="6764"></path><path d="M711.3 694.9l120.3 46.9-100.7 80.7z" fill="#515151" p-id="6765"></path><path d="M707.6 882.1L671.3 645l223.6 87.1-187.3 150z m43.7-137.3l2.8 18 14.2-11.4-17-6.6z" fill="#515151" p-id="6766"></path><path d="M927 957.9c-8.2 0-16.4-3.1-22.6-9.4L723.2 767.2c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l181.2 181.2c12.5 12.5 12.5 32.8 0 45.3-6.3 6.3-14.5 9.5-22.7 9.5z" fill="#515151" p-id="6767"></path></svg>', fe = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M19 6h-4V5c0-1.1-.9-2-2-2h-2c-1.1 0-2 .9-2 2v1H5c-.6 0-1 .4-1 1s.4 1 1 1h14c.6 0 1-.4 1-1s-.4-1-1-1zM10 5h4v1h-4V5z"/><path fill="currentColor" d="M6 9v10c0 1.7 1.3 3 3 3h6c1.7 0 3-1.3 3-3V9H6zm4 9c0 .6-.4 1-1 1s-1-.4-1-1v-5c0-.6.4-1 1-1s1 .4 1 1v5zm4 0c0 .6-.4 1-1 1s-1-.4-1-1v-5c0-.6.4-1 1-1s1 .4 1 1v5z"/></svg>', me = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M19 15v4c0 1.1-.9 2-2 2H7c-1.1 0-2-.9-2-2v-4c0-.6.4-1 1-1s1 .4 1 1v4h10v-4c0-.6.4-1 1-1s1 .4 1 1zm-7.7 1.3c.2.2.4.3.7.3s.5-.1.7-.3l4.6-4.6c.4-.4.4-1 0-1.4-.4-.4-1-.4-1.4 0l-2.9 2.9V3c0-.6-.4-1-1-1s-1 .4-1 1v8.3l-2.9-2.9c-.4-.4-1-.4-1.4 0-.4.4-.4 1 0 1.4l4.6 4.6z"/></svg>', pe = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M3 17.2v4.3c0 .3.2.5.5.5h4.3c.1 0 .3-.1.4-.2l11.1-11.1-5.1-5.1L3.1 16.8c-.1.1-.1.3-.1.4zm18.8-10.9c.4-.4.4-1 0-1.4l-3.7-3.7c-.4-.4-1-.4-1.4 0l-2.3 2.3 5.1 5.1 2.3-2.3z"/></svg>', ye = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M18.7 4.3c.4.4.4 1 0 1.4L12.4 12l6.3 6.3c.4.4.4 1 0 1.4-.4.4-1 .4-1.4 0l-7-7c-.4-.4-.4-1 0-1.4l7-7c.4-.4 1-.4 1.4 0z"/><path fill="currentColor" d="M10.7 4.3c.4.4.4 1 0 1.4L4.4 12l6.3 6.3c.4.4.4 1 0 1.4-.4.4-1 .4-1.4 0l-7-7c-.4-.4-.4-1 0-1.4l7-7c.4-.4 1-.4 1.4 0z"/></svg>', we = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032412624" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3527" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M870.2976 144.0256l51.2 51.2-122.88 122.88a514.304 514.304 0 0 1 170.7264 193.8688C885.0432 679.04 711.8848 793.6 512 793.6c-56.832 0-111.488-9.2672-162.56-26.3424L197.4016 919.296l-51.2-51.2L870.2976 144.0256z m-127.1552 229.5296l-76.6208 76.6208a166.4 166.4 0 0 1-216.32 216.3712l-38.6048 38.5792c29.5168 6.9632 60.032 10.9312 91.1872 11.5712L512 716.8c150.6816 0 287.488-77.2096 366.464-200.3456l2.816-4.48-2.816-4.48a435.8144 435.8144 0 0 0-135.3216-133.9392zM512 230.4c49.664 0 97.664 7.0656 143.0528 20.2496l-63.8208 63.7696a436.4032 436.4032 0 0 0-70.016-7.1168L512 307.2a434.8928 434.8928 0 0 0-366.464 200.3456l-2.816 4.48 2.816 4.48a435.84 435.84 0 0 0 119.8848 123.776l-55.0912 55.04a514.2528 514.2528 0 0 1-155.648-183.296C138.9312 344.96 312.0896 230.4 512 230.4z m89.5488 284.8l-86.3744 86.2976 1.7408-0.0256a89.6 89.6 0 0 0 84.6336-86.272zM512 345.6a166.656 166.656 0 0 1 42.5728 5.504l-79.0272 79.0272a89.9328 89.9328 0 0 0-45.4144 45.4144l-79.0272 79.0272A166.4 166.4 0 0 1 512 345.6z" p-id="3528" fill="#515151"></path></svg>', xe = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M5.3 19.7c-.4-.4-.4-1 0-1.4l6.3-6.3-6.3-6.3c-.4-.4-.4-1 0-1.4.4-.4 1-.4 1.4 0l7 7c.4.4.4 1 0 1.4l-7 7c-.4.4-1 .4-1.4 0z"/><path fill="currentColor" d="M13.3 19.7c-.4-.4-.4-1 0-1.4l6.3-6.3-6.3-6.3c-.4-.4-.4-1 0-1.4.4-.4 1-.4 1.4 0l7 7c.4.4.4 1 0 1.4l-7 7c-.4.4-1 .4-1.4 0z"/></svg>', be = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775031871732" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="12257" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M174.63 78.98c0.03-12.61 16.41-19.91 25.81-11.5l328.72 293.98 318.27 284.63c10.51 9.4 0.4 26.75-14.25 24.46L435.7 608.43c-6.23-0.97-12.72 1.92-16.16 7.2L199.96 952.72c-8.09 12.42-27.76 8.34-27.72-5.76l1.17-426.97 1.22-441.01z" fill="#515151" p-id="12258"></path></svg>', Ce = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032210611" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="23146" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M543.487882 0.00128a161.919393 161.919393 0 0 0-114.55957 47.359822L47.553742 428.991671a162.111392 162.111392 0 0 0 0 229.119141l318.270806 318.398806a161.983393 161.983393 0 0 0 229.119141 0l381.630569-381.694569A162.111392 162.111392 0 0 0 1023.99808 480.255479V161.920673A161.919393 161.919393 0 0 0 861.886688 0.00128H543.487882z m0 90.55966l318.462806 0.064a71.295733 71.295733 0 0 1 71.487732 71.295733v318.270806c0 18.943929-7.615971 37.119861-21.055921 50.559811l-381.56657 381.758568a71.423732 71.423732 0 0 1-101.055621 0L111.489502 594.111052a71.487732 71.487732 0 0 1 0-101.119621l381.566569-381.566569c13.37595-13.37595 31.551882-20.863922 50.431811-20.863922z m112.447578 124.159535a153.023426 153.023426 0 1 0 0 306.046852 153.023426 153.023426 0 0 0 0-306.046852z m57.727784 129.151515a62.463766 62.463766 0 1 1-115.455567 47.807821 62.463766 62.463766 0 0 1 115.455567-47.807821z" p-id="23147" fill="#515151"></path></svg>', _e = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775096284335" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4580" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M308.377435 102.251961C318.982967 47.176334 372.449479 0 448.66303 0c39.496466 0 68.314257 20.040799 85.063685 46.07921 11.995223 18.577967 17.919693 39.935315 20.040799 60.341823 13.384913-4.388496 27.35496-6.582744 41.398147-6.655886 38.911333 0 68.021691 19.455666 85.72196 44.616378 16.822569 23.990446 23.551596 53.100804 23.551596 79.724347v29.988058c0.146283 98.960589 0.292566 197.921178 0.658274 296.954909-0.073142 13.165489 1.097124 26.47726 3.510797 39.569608 8.484426-7.533585 16.237436-15.213453 24.795004-23.69788l13.165488-13.019205c13.970046-13.604338 30.353765-28.598367 49.809432-41.178723 42.056422-27.208676 93.694394-39.642749 162.813209-22.600755 27.574384 6.802169 44.982086 25.380136 54.344211 44.543236 8.776992 18.285401 11.117524 38.545625 10.386108 56.392176-1.38969 33.864562-14.920887 75.26271-43.738679 101.447404l-1.755398 1.755398c-37.375359 36.424518-75.335851 72.263904-113.881477 107.518157-31.450889 28.964075-63.486912 57.050451-96.327491 84.478552-29.037217 24.063587-58.293858 46.51806-80.967755 58.952132A491.511574 491.511574 0 0 1 421.527495 1023.982446a45.567219 45.567219 0 0 1-46.810626-44.25067c0-24.795004 20.699074-44.835803 46.225493-44.762661a395.403507 395.403507 0 0 0 215.036314-64.072045 49.955715 49.955715 0 0 1 4.022788-2.340531c13.458055-7.167877 37.009651-24.502437 67.363417-49.590007 31.597173-26.47726 62.609212-53.612795 92.889836-81.552888a5027.973235 5027.973235 0 0 0 111.687228-105.470192l1.755399-1.755398 0.585133-0.511991 1.682257-1.535974a42.056422 42.056422 0 0 0 9.362125-15.140312c3.291372-8.118718 5.119912-16.749427 5.631903-25.453278a46.07921 46.07921 0 0 0-1.023982-12.580356c-39.715891-8.557568-62.536071-0.658274-81.479746 11.556374a234.126272 234.126272 0 0 0-35.473678 29.841774l-10.386108 10.239824c-9.800975 9.654692-20.845357 20.699074-31.96288 30.500049l-0.146283 0.146283c-19.016817 16.603144-42.787838 31.597173-70.435364 32.182306a74.897002 74.897002 0 0 1-65.096027-35.54682 141.602144 141.602144 0 0 1-18.870534-51.930538 302.074822 302.074822 0 0 1-4.169071-50.613989c-0.365708-99.033731-0.511991-198.213745-0.511992-297.247476v-29.988058c0-13.311772-3.65708-24.136729-7.826151-30.13434a13.896905 13.896905 0 0 0-4.388496-4.388496 7.679868 7.679868 0 0 0-4.022789-0.804558 46.956909 46.956909 0 0 0-28.232658 10.532391 30.719473 30.719473 0 0 0-12.214648 24.721862v232.736582a45.567219 45.567219 0 0 1-46.591201 44.543236 45.567219 45.567219 0 0 1-46.51806-44.616378V124.340726c0-14.628321-3.364514-25.745844-7.094736-31.45089a10.093541 10.093541 0 0 0-2.925664-3.364514 1.901682 1.901682 0 0 0-0.511991-0.292566 9.435267 9.435267 0 0 0-2.340531-0.146283c-38.618767 0-49.443724 23.697879-49.078016 33.791421v1.682256l-0.292567 77.822666v3.876505l-1.023982 253.508797a45.567219 45.567219 0 0 1-46.810626 44.323812 45.567219 45.567219 0 0 1-46.298635-44.68952l1.023983-250.656274a32.036022 32.036022 0 0 0-7.75301-15.140312c-1.82854-1.682257-5.851328-4.827346-17.188277-4.827346a41.178723 41.178723 0 0 0-26.477261 9.069559c-5.558762 4.754204-10.678674 12.580356-10.678674 26.257835v296.589202a45.567219 45.567219 0 0 1-46.518059 44.543236 45.567219 45.567219 0 0 1-46.51806-44.616378v-169.688519a31.158323 31.158323 0 0 0-4.607921-5.705045 11.84894 11.84894 0 0 0-5.193054-3.218231c-1.023982-0.292566-4.681063-1.023982-12.653497 1.462832-17.700268 5.705045-26.111552 14.994029-30.792615 27.208676-5.48562 14.189471-6.582744 35.10797-1.097124 61.438947 42.202705 201.139409 64.949744 301.123981 83.162003 350.34828 16.091153 43.372971 47.615184 81.918596 90.915013 109.566122a43.372971 43.372971 0 0 1 12.872922 61.804654 47.834609 47.834609 0 0 1-64.510894 12.28779c-59.171557-37.741067-103.934218-91.500146-127.046965-153.963075C71.179216 755.406479 46.896203 647.449472 5.571197 449.601435-1.889246 414.127758-3.059512 375.216425 10.471685 340.108455 24.734297 302.806238 54.210364 273.330171 99.265591 258.921276c16.603144-5.558762 34.376554-7.460444 51.784255-5.631904v-29.256641c0-81.18718 67.655983-124.340726 130.265196-124.340726 9.435267 0 18.431684 0.877699 27.062393 2.486815z" p-id="4581" fill="#515151"></path></svg>', ke = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775033156525" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3463" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M694.4 960H195.2C131.7 960 80 908.4 80 845.1V462c0-63.4 51.7-114.9 115.2-114.9h499.2c63.5 0 115.2 51.6 115.2 114.9v383.1c0 63.3-51.7 114.9-115.2 114.9zM195.2 423.7c-21.2 0-38.4 17.2-38.4 38.3v383.1c0 21.1 17.2 38.3 38.4 38.3h499.2c21.2 0 38.4-17.2 38.4-38.3V462c0-21.1-17.2-38.3-38.4-38.3H195.2z" fill="#515151" p-id="3464"></path><path d="M905.6 450.3c-14.8 0-28.9-8.6-35.2-23C788.6 240.8 592.7 213 483.2 213c-21.2 0-38.4-17.2-38.4-38.3s17.2-38.3 38.4-38.3c218.2 0 385 94.9 457.6 260.3 8.5 19.4-0.4 42-19.8 50.5-5 2.1-10.3 3.1-15.4 3.1z" fill="#515151" p-id="3465"></path><path d="M473.6 285.4c-9.8 0-19.7-3.7-27.2-11.2l-72.5-72.4c-15-15-15-39.2 0-54.2l72.5-72.4c15-15 39.3-15 54.3 0s15 39.2 0 54.2l-45.4 45.3 45.4 45.3c15 15 15 39.2 0 54.2-7.4 7.4-17.3 11.2-27.1 11.2z" fill="#515151" p-id="3466"></path></svg>', Ie = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M8.3 19.7c-.4-.4-.4-1 0-1.4l6.3-6.3-6.3-6.3c-.4-.4-.4-1 0-1.4.4-.4 1-.4 1.4 0l7 7c.4.4.4 1 0 1.4l-7 7c-.4.4-1 .4-1.4 0z"/></svg>', Ae = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032400373" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3314" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M512 230.4c199.8848 0 373.0176 114.5344 457.344 281.5744C885.0432 679.04 711.8848 793.6 512 793.6c-199.8848 0-373.0176-114.5344-457.344-281.5744C138.9568 344.96 312.1152 230.4 512 230.4z m0 76.8a434.8928 434.8928 0 0 0-366.464 200.3456l-2.816 4.48 2.816 4.48a434.944 434.944 0 0 0 357.248 200.192L512 716.8c150.6816 0 287.488-77.2096 366.464-200.3456l2.816-4.48-2.816-4.48a434.944 434.944 0 0 0-357.248-200.192L512 307.2z m0 38.4a166.4 166.4 0 1 1 0 332.8 166.4 166.4 0 0 1 0-332.8z m0 76.8a89.6 89.6 0 1 0 0 179.2 89.6 89.6 0 0 0 0-179.2z" p-id="3315" fill="#515151"></path></svg>', Se = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032548251" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4695" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M849.7664 778.1376c1.9968 1.4848 3.84 3.072 5.632 4.864l72.3968 72.3968a51.2 51.2 0 1 1-72.3968 72.3968l-72.3968-72.3968a51.6096 51.6096 0 0 1-4.864-5.632 448 448 0 1 1 71.68-71.68zM460.8 460.8V358.4a51.2 51.2 0 1 1 102.4 0v102.4h102.4a51.2 51.2 0 0 1 0 102.4h-102.4v102.4a51.2 51.2 0 0 1-102.4 0v-102.4H358.4a51.2 51.2 0 0 1 0-102.4h102.4z m38.4 384a345.6 345.6 0 1 0 0-691.2 345.6 345.6 0 0 0 0 691.2z" fill="#515151" p-id="4696"></path></svg>', Me = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032629657" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1933" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M849.7664 778.1376c1.9968 1.4848 3.84 3.072 5.632 4.864l72.3968 72.3968a51.2 51.2 0 1 1-72.3968 72.3968l-72.3968-72.3968a51.6096 51.6096 0 0 1-4.864-5.632 448 448 0 1 1 71.68-71.68zM499.2 844.8a345.6 345.6 0 1 0 0-691.2 345.6 345.6 0 0 0 0 691.2zM358.4 563.2a51.2 51.2 0 0 1 0-102.4h307.2a51.2 51.2 0 0 1 0 102.4H358.4z" fill="#666666" p-id="1934"></path></svg>', Te = ["innerHTML"], De = /* @__PURE__ */ ct({
|
|
539
541
|
__name: "SvgIcon",
|
|
540
542
|
props: {
|
|
541
543
|
name: {},
|
|
542
544
|
size: {}
|
|
543
545
|
},
|
|
544
546
|
setup(w) {
|
|
545
|
-
const t = w, n = M(""), e = /* @__PURE__ */ Object.assign({ "../assets/svg/aim.svg": de, "../assets/svg/back.svg": ge, "../assets/svg/connection.svg": ue, "../assets/svg/crop.svg": ve, "../assets/svg/delete.svg": fe, "../assets/svg/download.svg": me, "../assets/svg/edit.svg": pe, "../assets/svg/first.svg": ye, "../assets/svg/hide.svg": we, "../assets/svg/last.svg": xe, "../assets/svg/pointer.svg": be, "../assets/svg/price-tag.svg":
|
|
547
|
+
const t = w, n = M(""), e = /* @__PURE__ */ Object.assign({ "../assets/svg/aim.svg": de, "../assets/svg/back.svg": ge, "../assets/svg/connection.svg": ue, "../assets/svg/crop.svg": ve, "../assets/svg/delete.svg": fe, "../assets/svg/download.svg": me, "../assets/svg/edit.svg": pe, "../assets/svg/first.svg": ye, "../assets/svg/hide.svg": we, "../assets/svg/last.svg": xe, "../assets/svg/pointer.svg": be, "../assets/svg/price-tag.svg": Ce, "../assets/svg/rank.svg": _e, "../assets/svg/refresh-right.svg": ke, "../assets/svg/right.svg": Ie, "../assets/svg/view.svg": Ae, "../assets/svg/zoom-in.svg": Se, "../assets/svg/zoom-out.svg": Me });
|
|
546
548
|
return ce(() => {
|
|
547
|
-
const
|
|
548
|
-
|
|
549
|
-
}), (
|
|
550
|
-
class:
|
|
549
|
+
const l = `../assets/svg/${t.name}.svg`, o = e[l];
|
|
550
|
+
o ? n.value = o : (console.warn(`Icon ${t.name} not found at path ${l}`), n.value = "");
|
|
551
|
+
}), (l, o) => (v(), m("i", {
|
|
552
|
+
class: X(["svg-icon", [w.size ? `size-${w.size}` : ""]]),
|
|
551
553
|
innerHTML: n.value
|
|
552
554
|
}, null, 10, Te));
|
|
553
555
|
}
|
|
554
556
|
}), rt = (w, t) => {
|
|
555
557
|
const n = w.__vccOpts || w;
|
|
556
|
-
for (const [e,
|
|
557
|
-
n[e] =
|
|
558
|
+
for (const [e, l] of t)
|
|
559
|
+
n[e] = l;
|
|
558
560
|
return n;
|
|
559
|
-
}, L = /* @__PURE__ */ rt(De, [["__scopeId", "data-v-3928607b"]]),
|
|
561
|
+
}, L = /* @__PURE__ */ rt(De, [["__scopeId", "data-v-3928607b"]]), Pe = {
|
|
560
562
|
key: 0,
|
|
561
563
|
class: "image-list-sidebar"
|
|
562
|
-
},
|
|
564
|
+
}, ze = { class: "image-list-header" }, $e = ["onClick"], Le = { class: "image-list-stage" }, Be = ["src", "alt"], Re = {
|
|
563
565
|
key: 0,
|
|
564
566
|
class: "thumb-overlay-layer"
|
|
565
567
|
}, He = {
|
|
@@ -567,7 +569,7 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
|
|
|
567
569
|
class: "thumb-overlay-svg",
|
|
568
570
|
viewBox: "0 0 100 100",
|
|
569
571
|
preserveAspectRatio: "none"
|
|
570
|
-
},
|
|
572
|
+
}, Ee = ["points"], Ue = { class: "image-list-text" }, Ve = { class: "center-sidebar" }, Oe = {
|
|
571
573
|
key: 0,
|
|
572
574
|
class: "left-sidebar"
|
|
573
575
|
}, Fe = ["onClick", "title"], Ne = {
|
|
@@ -576,10 +578,10 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
|
|
|
576
578
|
}, We = { class: "center-area" }, Ge = {
|
|
577
579
|
key: 0,
|
|
578
580
|
class: "floating-label-selector"
|
|
579
|
-
},
|
|
581
|
+
}, Ye = {
|
|
580
582
|
key: 0,
|
|
581
583
|
class: "current-label"
|
|
582
|
-
},
|
|
584
|
+
}, Je = { class: "label-name" }, je = {
|
|
583
585
|
key: 1,
|
|
584
586
|
class: "current-label empty"
|
|
585
587
|
}, Xe = {
|
|
@@ -612,7 +614,7 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
|
|
|
612
614
|
},
|
|
613
615
|
emits: ["annotationChange", "batchChange", "labelChange", "ready", "error", "tool:change", "viewport:change", "annotation:add", "annotation:update", "annotation:delete", "annotation:select", "prediction:loaded", "prediction:apply", "prediction:reject"],
|
|
614
616
|
setup(w, { expose: t, emit: n }) {
|
|
615
|
-
const e = w,
|
|
617
|
+
const e = w, l = n, o = M(null), c = M(null), g = M(null), u = M([]), r = M(null), k = M(null), x = M(0), D = M(""), _ = M([]), $ = M(""), q = M(!1), C = M({ name: "", color: "#FF0000" }), S = M("none"), p = M([]), H = M({}), O = V(() => k.value === "select" && !!D.value), G = M(!1), Z = V(() => _.value.find((s) => s.id === $.value)), yt = (s) => {
|
|
616
618
|
s.stopPropagation(), G.value = !G.value;
|
|
617
619
|
}, wt = (s) => {
|
|
618
620
|
tt(s), G.value = !1;
|
|
@@ -623,13 +625,13 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
|
|
|
623
625
|
});
|
|
624
626
|
});
|
|
625
627
|
const it = (s) => {
|
|
626
|
-
if (!s ||
|
|
628
|
+
if (!s || H.value[s]) return;
|
|
627
629
|
const i = new Image();
|
|
628
630
|
i.onload = () => {
|
|
629
|
-
const
|
|
630
|
-
|
|
631
|
-
...
|
|
632
|
-
[s]: { width:
|
|
631
|
+
const a = i.naturalWidth || 1, d = i.naturalHeight || 1;
|
|
632
|
+
H.value = {
|
|
633
|
+
...H.value,
|
|
634
|
+
[s]: { width: a, height: d }
|
|
633
635
|
};
|
|
634
636
|
}, i.src = s;
|
|
635
637
|
}, nt = () => {
|
|
@@ -639,43 +641,43 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
|
|
|
639
641
|
}, ht = (s, i) => {
|
|
640
642
|
u.value[i] = s;
|
|
641
643
|
}, Q = (s = x.value) => {
|
|
642
|
-
const i = g.value,
|
|
643
|
-
if (!i || !
|
|
644
|
-
const d = i.scrollTop, f = d + i.clientHeight,
|
|
645
|
-
if (
|
|
644
|
+
const i = g.value, a = u.value[s];
|
|
645
|
+
if (!i || !a) return;
|
|
646
|
+
const d = i.scrollTop, f = d + i.clientHeight, A = a.offsetTop, P = A + a.offsetHeight;
|
|
647
|
+
if (A < d) {
|
|
646
648
|
i.scrollTo({
|
|
647
|
-
top: Math.max(
|
|
649
|
+
top: Math.max(A - 8, 0),
|
|
648
650
|
behavior: "smooth"
|
|
649
651
|
});
|
|
650
652
|
return;
|
|
651
653
|
}
|
|
652
|
-
|
|
653
|
-
top:
|
|
654
|
+
P > f && i.scrollTo({
|
|
655
|
+
top: P - i.clientHeight + 8,
|
|
654
656
|
behavior: "smooth"
|
|
655
657
|
});
|
|
656
|
-
},
|
|
657
|
-
var
|
|
658
|
-
const s = e.batchImages[x.value], i = (s == null ? void 0 : s.imageUrl) || ((
|
|
658
|
+
}, j = () => {
|
|
659
|
+
var a, d, f, A;
|
|
660
|
+
const s = e.batchImages[x.value], i = (s == null ? void 0 : s.imageUrl) || ((a = e.image) == null ? void 0 : a.url);
|
|
659
661
|
return {
|
|
660
662
|
eventId: `${Date.now()}-${Math.random().toString(36).slice(2, 10)}`,
|
|
661
663
|
timestamp: Date.now(),
|
|
662
664
|
requestId: e.requestId,
|
|
663
665
|
taskId: (d = e.session) == null ? void 0 : d.taskId,
|
|
664
666
|
imageId: ((f = e.image) == null ? void 0 : f.id) || i,
|
|
665
|
-
operator: (
|
|
667
|
+
operator: (A = e.session) == null ? void 0 : A.userId
|
|
666
668
|
};
|
|
667
669
|
}, y = (s) => {
|
|
668
670
|
var d;
|
|
669
671
|
const i = s == null ? void 0 : s.action;
|
|
670
672
|
if (!i) return;
|
|
671
|
-
const
|
|
672
|
-
meta:
|
|
673
|
+
const a = {
|
|
674
|
+
meta: j(),
|
|
673
675
|
action: i,
|
|
674
676
|
current: s == null ? void 0 : s.changedItem,
|
|
675
677
|
source: (d = s == null ? void 0 : s.changedItem) != null && d.predictionId ? "prediction" : "manual"
|
|
676
678
|
};
|
|
677
|
-
i === "add" &&
|
|
678
|
-
}, b = V(() => e.annotationTypes),
|
|
679
|
+
i === "add" && l("annotation:add", a), i === "update" && l("annotation:update", a), i === "delete" && l("annotation:delete", a), i === "select" && l("annotation:select", a);
|
|
680
|
+
}, b = V(() => e.annotationTypes), I = (s) => ({
|
|
679
681
|
rectangle: "crop",
|
|
680
682
|
polygon: "connection",
|
|
681
683
|
point: "aim",
|
|
@@ -689,27 +691,27 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
|
|
|
689
691
|
category: "分类标签"
|
|
690
692
|
})[s] || s;
|
|
691
693
|
kt(() => {
|
|
692
|
-
if (nt(),
|
|
693
|
-
r.value = new he(
|
|
694
|
-
var
|
|
694
|
+
if (nt(), o.value) {
|
|
695
|
+
r.value = new he(o.value), r.value.on("annotationChange", (i) => {
|
|
696
|
+
var a, d;
|
|
695
697
|
if (i.action === "add" && i.changedItem) {
|
|
696
|
-
const f =
|
|
698
|
+
const f = _.value.find((A) => A.id === $.value);
|
|
697
699
|
f && (i.changedItem.label = f.name, i.changedItem.labelId = f.id);
|
|
698
700
|
}
|
|
699
|
-
i.action === "select" ? D.value = ((
|
|
700
|
-
}), W(),
|
|
701
|
+
i.action === "select" ? D.value = ((a = i.changedItem) == null ? void 0 : a.id) || "" : i.action === "delete" && ((d = i.changedItem) == null ? void 0 : d.id) === D.value && (D.value = ""), l("annotationChange", i), y(i);
|
|
702
|
+
}), W(), E();
|
|
701
703
|
const s = new ResizeObserver(() => {
|
|
702
704
|
var i;
|
|
703
705
|
(i = r.value) == null || i.resize();
|
|
704
706
|
});
|
|
705
|
-
|
|
707
|
+
c.value && s.observe(c.value), e.defaultActiveType && Y(e.defaultActiveType), at(() => Q()), l("ready", { meta: j() });
|
|
706
708
|
}
|
|
707
709
|
});
|
|
708
|
-
const
|
|
710
|
+
const E = () => {
|
|
709
711
|
if (!r.value) return;
|
|
710
|
-
const s =
|
|
712
|
+
const s = _.value.find((a) => a.id === $.value);
|
|
711
713
|
s && r.value.setLabelStyle(s.color);
|
|
712
|
-
const i =
|
|
714
|
+
const i = _.value.filter((a) => a.visible).map((a) => a.name);
|
|
713
715
|
r.value.setVisibleLabels(i);
|
|
714
716
|
}, W = () => {
|
|
715
717
|
var s;
|
|
@@ -721,19 +723,19 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
|
|
|
721
723
|
const i = e.batchImages[x.value];
|
|
722
724
|
r.value.loadImage(i.imageUrl), i.annotations ? r.value.setAnnotations(i.annotations) : r.value.setAnnotations([]);
|
|
723
725
|
} else (s = e.image) != null && s.url && r.value.loadImage(e.image.url);
|
|
724
|
-
},
|
|
725
|
-
var i,
|
|
726
|
-
if (
|
|
726
|
+
}, Y = (s) => {
|
|
727
|
+
var i, a;
|
|
728
|
+
if (k.value = s, D.value = "", s !== "pan" && s !== "select" && _.value.length === 0) {
|
|
727
729
|
alert("请先创建标签!");
|
|
728
730
|
return;
|
|
729
731
|
}
|
|
730
|
-
s === "pan" || s === "select" ? (i = r.value) == null || i.setTool(s) : (
|
|
732
|
+
s === "pan" || s === "select" ? (i = r.value) == null || i.setTool(s) : (a = r.value) == null || a.setTool(s), l("tool:change", { meta: j(), tool: s });
|
|
731
733
|
}, St = () => {
|
|
732
734
|
var s;
|
|
733
735
|
(s = r.value) != null && s.activeAnnotation && r.value.deleteAnnotation(r.value.activeAnnotation.id);
|
|
734
736
|
}, xt = () => {
|
|
735
|
-
r.value &&
|
|
736
|
-
meta:
|
|
737
|
+
r.value && l("viewport:change", {
|
|
738
|
+
meta: j(),
|
|
737
739
|
scale: r.value.scale,
|
|
738
740
|
offset: { ...r.value.offset }
|
|
739
741
|
});
|
|
@@ -744,64 +746,64 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
|
|
|
744
746
|
var s;
|
|
745
747
|
(s = r.value) == null || s.zoom(-1), xt();
|
|
746
748
|
}, Dt = () => {
|
|
747
|
-
|
|
749
|
+
C.value = { name: "", color: "#2196F3" }, q.value = !0;
|
|
748
750
|
}, dt = () => {
|
|
749
|
-
|
|
750
|
-
},
|
|
751
|
-
if (!
|
|
751
|
+
q.value = !1;
|
|
752
|
+
}, Pt = () => {
|
|
753
|
+
if (!C.value.name.trim()) {
|
|
752
754
|
alert("请输入标签名称");
|
|
753
755
|
return;
|
|
754
756
|
}
|
|
755
757
|
const i = {
|
|
756
758
|
id: Date.now().toString(),
|
|
757
|
-
name:
|
|
758
|
-
color:
|
|
759
|
+
name: C.value.name,
|
|
760
|
+
color: C.value.color,
|
|
759
761
|
visible: !0
|
|
760
762
|
};
|
|
761
|
-
|
|
763
|
+
_.value.push(i), l("labelChange", _.value), E(), _.value.length === 1 && tt(i), dt();
|
|
762
764
|
}, tt = (s) => {
|
|
763
765
|
var i;
|
|
764
766
|
$.value = s.id, (i = r.value) == null || i.setLabelStyle(s.color);
|
|
765
|
-
},
|
|
767
|
+
}, zt = (s, i) => {
|
|
766
768
|
if (!s.startsWith("#")) return s;
|
|
767
|
-
let
|
|
768
|
-
return s.length === 4 ? (
|
|
769
|
+
let a = 0, d = 0, f = 0;
|
|
770
|
+
return s.length === 4 ? (a = parseInt(s[1] + s[1], 16), d = parseInt(s[2] + s[2], 16), f = parseInt(s[3] + s[3], 16)) : s.length === 7 && (a = parseInt(s.slice(1, 3), 16), d = parseInt(s.slice(3, 5), 16), f = parseInt(s.slice(5, 7), 16)), `rgba(${a}, ${d}, ${f}, ${i})`;
|
|
769
771
|
}, $t = (s) => {
|
|
770
772
|
var i;
|
|
771
773
|
if (s.id === $.value && ((i = r.value) == null || i.setLabelStyle(s.color)), r.value) {
|
|
772
|
-
const
|
|
774
|
+
const a = r.value.getAnnotations();
|
|
773
775
|
let d = !1;
|
|
774
|
-
|
|
775
|
-
f.label === s.name && (f.style || (f.style = {}), f.style.strokeColor = s.color, f.style.fillColor =
|
|
776
|
+
a.forEach((f) => {
|
|
777
|
+
f.label === s.name && (f.style || (f.style = {}), f.style.strokeColor = s.color, f.style.fillColor = zt(s.color, 0.2), d = !0);
|
|
776
778
|
}), d && r.value.render();
|
|
777
779
|
}
|
|
778
|
-
|
|
780
|
+
l("labelChange", _.value), E();
|
|
779
781
|
}, Lt = (s) => {
|
|
780
|
-
s.visible = !s.visible,
|
|
781
|
-
},
|
|
782
|
-
const i =
|
|
783
|
-
i > -1 && (
|
|
782
|
+
s.visible = !s.visible, E();
|
|
783
|
+
}, Bt = (s) => {
|
|
784
|
+
const i = _.value.findIndex((a) => a.id === s);
|
|
785
|
+
i > -1 && (_.value.splice(i, 1), l("labelChange", _.value), $.value === s && ($.value = _.value.length > 0 ? _.value[0].id : "", $.value && tt(_.value[0])), E());
|
|
784
786
|
};
|
|
785
787
|
K(() => e.labels, (s) => {
|
|
786
788
|
const i = JSON.parse(JSON.stringify(s || []));
|
|
787
|
-
if (
|
|
788
|
-
if (!$.value || !
|
|
789
|
-
tt(
|
|
789
|
+
if (_.value = i, _.value.length > 0)
|
|
790
|
+
if (!$.value || !_.value.find((a) => a.id === $.value))
|
|
791
|
+
tt(_.value[0]);
|
|
790
792
|
else {
|
|
791
|
-
const
|
|
792
|
-
|
|
793
|
+
const a = _.value.find((d) => d.id === $.value);
|
|
794
|
+
a && tt(a);
|
|
793
795
|
}
|
|
794
796
|
else
|
|
795
797
|
$.value = "";
|
|
796
|
-
|
|
798
|
+
E();
|
|
797
799
|
}, { immediate: !0, deep: !0 });
|
|
798
|
-
const
|
|
800
|
+
const Rt = () => {
|
|
799
801
|
x.value > 0 && (gt(), x.value--, W(), ut());
|
|
800
802
|
}, Ht = () => {
|
|
801
803
|
x.value < e.batchImages.length - 1 && (gt(), x.value++, W(), ut());
|
|
802
|
-
}, Ut = () => {
|
|
803
|
-
x.value > 0 && ot(0);
|
|
804
804
|
}, Et = () => {
|
|
805
|
+
x.value > 0 && ot(0);
|
|
806
|
+
}, Ut = () => {
|
|
805
807
|
x.value < e.batchImages.length - 1 && ot(e.batchImages.length - 1);
|
|
806
808
|
}, gt = () => {
|
|
807
809
|
if (r.value) {
|
|
@@ -810,7 +812,7 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
|
|
|
810
812
|
}
|
|
811
813
|
}, ut = () => {
|
|
812
814
|
const s = e.batchImages[x.value];
|
|
813
|
-
|
|
815
|
+
l("batchChange", {
|
|
814
816
|
currentIndex: x.value,
|
|
815
817
|
total: e.batchImages.length,
|
|
816
818
|
currentImageUrl: s.imageUrl,
|
|
@@ -824,12 +826,12 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
|
|
|
824
826
|
return;
|
|
825
827
|
}
|
|
826
828
|
S.value = "loaded";
|
|
827
|
-
const
|
|
828
|
-
const
|
|
829
|
-
return
|
|
829
|
+
const a = (r.value.getAnnotations() || []).filter((A) => !A.predictionId), d = p.value.map((A) => {
|
|
830
|
+
const P = JSON.parse(JSON.stringify(A.annotation));
|
|
831
|
+
return P.id = P.id || `pred-${A.id}`, P.predictionId = A.id, P.modelRunId = A.modelRunId || P.modelRunId, P.confidence = A.confidence ?? P.confidence, P.reviewStatus = P.reviewStatus || "draft", P;
|
|
830
832
|
});
|
|
831
|
-
r.value.setAnnotations([...
|
|
832
|
-
meta:
|
|
833
|
+
r.value.setAnnotations([...a, ...d]), l("prediction:loaded", {
|
|
834
|
+
meta: j(),
|
|
833
835
|
modelRunId: (f = p.value[0]) == null ? void 0 : f.modelRunId,
|
|
834
836
|
candidates: p.value
|
|
835
837
|
});
|
|
@@ -837,11 +839,11 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
|
|
|
837
839
|
var f;
|
|
838
840
|
if (!r.value) return [];
|
|
839
841
|
S.value = "applying";
|
|
840
|
-
const d = (r.value.getAnnotations() || []).filter((
|
|
841
|
-
return d.forEach((
|
|
842
|
-
|
|
843
|
-
}), S.value = "applied",
|
|
844
|
-
meta:
|
|
842
|
+
const d = (r.value.getAnnotations() || []).filter((A) => A.predictionId && s.includes(A.predictionId));
|
|
843
|
+
return d.forEach((A) => {
|
|
844
|
+
A.reviewStatus = "accepted";
|
|
845
|
+
}), S.value = "applied", l("prediction:apply", {
|
|
846
|
+
meta: j(),
|
|
845
847
|
modelRunId: (f = d[0]) == null ? void 0 : f.modelRunId,
|
|
846
848
|
candidateIds: s,
|
|
847
849
|
threshold: i,
|
|
@@ -850,10 +852,10 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
|
|
|
850
852
|
}, Ot = (s, i) => {
|
|
851
853
|
var f;
|
|
852
854
|
if (!r.value) return;
|
|
853
|
-
const
|
|
854
|
-
r.value.setAnnotations(d),
|
|
855
|
-
meta:
|
|
856
|
-
modelRunId: (f =
|
|
855
|
+
const a = r.value.getAnnotations() || [], d = a.filter((A) => !(A.predictionId && s.includes(A.predictionId)));
|
|
856
|
+
r.value.setAnnotations(d), l("prediction:reject", {
|
|
857
|
+
meta: j(),
|
|
858
|
+
modelRunId: (f = a.find((A) => A.predictionId && s.includes(A.predictionId))) == null ? void 0 : f.modelRunId,
|
|
857
859
|
candidateIds: s,
|
|
858
860
|
reason: i
|
|
859
861
|
});
|
|
@@ -862,15 +864,15 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
|
|
|
862
864
|
}, Nt = (s) => {
|
|
863
865
|
var i;
|
|
864
866
|
(i = r.value) == null || i.setAnnotations(s);
|
|
865
|
-
},
|
|
867
|
+
}, Ct = () => {
|
|
866
868
|
var s;
|
|
867
869
|
return ((s = r.value) == null ? void 0 : s.getAnnotations()) || [];
|
|
868
870
|
}, Wt = (s = "json") => {
|
|
869
|
-
var
|
|
870
|
-
const i =
|
|
871
|
+
var a, d;
|
|
872
|
+
const i = Ct();
|
|
871
873
|
return {
|
|
872
874
|
format: s,
|
|
873
|
-
image: ((
|
|
875
|
+
image: ((a = e.batchImages[x.value]) == null ? void 0 : a.imageUrl) || ((d = e.image) == null ? void 0 : d.url) || "",
|
|
874
876
|
annotations: i
|
|
875
877
|
};
|
|
876
878
|
}, ot = (s) => {
|
|
@@ -878,35 +880,35 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
|
|
|
878
880
|
}, Gt = (s) => {
|
|
879
881
|
var i;
|
|
880
882
|
return s === x.value && r.value ? r.value.getAnnotations() || [] : ((i = e.batchImages[s]) == null ? void 0 : i.annotations) || [];
|
|
881
|
-
},
|
|
882
|
-
var
|
|
883
|
-
const i = (
|
|
883
|
+
}, Yt = (s) => s.type === "rectangle", Jt = (s) => s.type === "polygon", jt = (s) => s.type === "point", Xt = (s) => s.type === "rotatedRect", qt = (s) => s.type === "category", et = (s) => {
|
|
884
|
+
var a, d;
|
|
885
|
+
const i = (a = _.value.find((f) => f.name === s.label)) == null ? void 0 : a.color;
|
|
884
886
|
return ((d = s.style) == null ? void 0 : d.strokeColor) || i || "#409eff";
|
|
885
|
-
},
|
|
887
|
+
}, _t = (s) => {
|
|
886
888
|
const i = s.coordinates;
|
|
887
889
|
return (i == null ? void 0 : i.points) || [];
|
|
888
890
|
}, st = (s) => {
|
|
889
891
|
const i = e.batchImages[s];
|
|
890
892
|
if (i != null && i.width && (i != null && i.height))
|
|
891
893
|
return { width: i.width, height: i.height };
|
|
892
|
-
const
|
|
893
|
-
return
|
|
894
|
+
const a = i != null && i.imageUrl ? H.value[i.imageUrl] : void 0;
|
|
895
|
+
return a || (i != null && i.imageUrl && it(i.imageUrl), { width: 1, height: 1 });
|
|
894
896
|
}, Kt = (s) => {
|
|
895
897
|
const i = e.batchImages[s];
|
|
896
|
-
return i != null && i.width && (i != null && i.height) ? !0 : i != null && i.imageUrl ? !!
|
|
898
|
+
return i != null && i.width && (i != null && i.height) ? !0 : i != null && i.imageUrl ? !!H.value[i.imageUrl] : !1;
|
|
897
899
|
}, Zt = (s, i) => {
|
|
898
|
-
const
|
|
900
|
+
const a = i.coordinates, d = st(s), f = et(i), A = Math.min(a.x1, a.x2), P = Math.min(a.y1, a.y2), ne = Math.max(a.x1, a.x2), oe = Math.max(a.y1, a.y2);
|
|
899
901
|
return {
|
|
900
|
-
left: `${
|
|
901
|
-
top: `${
|
|
902
|
-
width: `${(ne -
|
|
903
|
-
height: `${(oe -
|
|
902
|
+
left: `${A / d.width * 100}%`,
|
|
903
|
+
top: `${P / d.height * 100}%`,
|
|
904
|
+
width: `${(ne - A) / d.width * 100}%`,
|
|
905
|
+
height: `${(oe - P) / d.height * 100}%`,
|
|
904
906
|
borderColor: f,
|
|
905
907
|
backgroundColor: `${f}22`
|
|
906
908
|
};
|
|
907
909
|
}, Qt = (s, i) => {
|
|
908
|
-
const
|
|
909
|
-
return
|
|
910
|
+
const a = st(s);
|
|
911
|
+
return _t(i).map((d) => `${d.x / a.width * 100},${d.y / a.height * 100}`).join(" ");
|
|
910
912
|
}, te = (s) => {
|
|
911
913
|
const i = et(s);
|
|
912
914
|
return {
|
|
@@ -914,29 +916,29 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
|
|
|
914
916
|
stroke: i,
|
|
915
917
|
strokeWidth: "1.4"
|
|
916
918
|
};
|
|
917
|
-
}, ee = (s, i,
|
|
918
|
-
const d = st(s), f = et(
|
|
919
|
+
}, ee = (s, i, a) => {
|
|
920
|
+
const d = st(s), f = et(a);
|
|
919
921
|
return {
|
|
920
922
|
left: `${i.x / d.width * 100}%`,
|
|
921
923
|
top: `${i.y / d.height * 100}%`,
|
|
922
924
|
backgroundColor: f
|
|
923
925
|
};
|
|
924
926
|
}, se = (s, i) => {
|
|
925
|
-
const
|
|
927
|
+
const a = i.coordinates, d = st(s), f = et(i), A = Math.abs(a.width), P = Math.abs(a.height);
|
|
926
928
|
return {
|
|
927
|
-
left: `${(
|
|
928
|
-
top: `${(
|
|
929
|
-
width: `${
|
|
930
|
-
height: `${
|
|
931
|
-
transform: `rotate(${
|
|
929
|
+
left: `${(a.x - A / 2) / d.width * 100}%`,
|
|
930
|
+
top: `${(a.y - P / 2) / d.height * 100}%`,
|
|
931
|
+
width: `${A / d.width * 100}%`,
|
|
932
|
+
height: `${P / d.height * 100}%`,
|
|
933
|
+
transform: `rotate(${a.angle || 0}deg)`,
|
|
932
934
|
borderColor: f,
|
|
933
935
|
backgroundColor: `${f}22`
|
|
934
936
|
};
|
|
935
937
|
}, ie = (s, i) => {
|
|
936
|
-
const
|
|
938
|
+
const a = i.coordinates, d = st(s), f = et(i);
|
|
937
939
|
return {
|
|
938
|
-
left: `${
|
|
939
|
-
top: `${
|
|
940
|
+
left: `${a.x / d.width * 100}%`,
|
|
941
|
+
top: `${a.y / d.height * 100}%`,
|
|
940
942
|
backgroundColor: `${f}d9`
|
|
941
943
|
// ~85% opacity
|
|
942
944
|
};
|
|
@@ -945,8 +947,8 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
|
|
|
945
947
|
jumpTo: ot,
|
|
946
948
|
setImage: Ft,
|
|
947
949
|
setAnnotations: Nt,
|
|
948
|
-
getAnnotations:
|
|
949
|
-
selectTool:
|
|
950
|
+
getAnnotations: Ct,
|
|
951
|
+
selectTool: Y,
|
|
950
952
|
loadPredictionCandidates: bt,
|
|
951
953
|
applyPredictions: Vt,
|
|
952
954
|
rejectPredictions: Ot,
|
|
@@ -959,10 +961,10 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
|
|
|
959
961
|
}];
|
|
960
962
|
},
|
|
961
963
|
getCurrentAnnotation: () => {
|
|
962
|
-
var s, i,
|
|
964
|
+
var s, i, a;
|
|
963
965
|
return {
|
|
964
966
|
imageUrl: ((s = e.batchImages[x.value]) == null ? void 0 : s.imageUrl) || ((i = e.image) == null ? void 0 : i.url) || "",
|
|
965
|
-
annotations: ((
|
|
967
|
+
annotations: ((a = r.value) == null ? void 0 : a.getAnnotations()) || []
|
|
966
968
|
};
|
|
967
969
|
}
|
|
968
970
|
}), K(() => {
|
|
@@ -985,231 +987,238 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
|
|
|
985
987
|
at(() => Q());
|
|
986
988
|
}
|
|
987
989
|
), (s, i) => (v(), m("div", {
|
|
988
|
-
class:
|
|
990
|
+
class: X(["annotation-container", w.theme])
|
|
989
991
|
}, [
|
|
990
|
-
w.batchImages && w.batchImages.length > 0 ? (v(), m("div",
|
|
991
|
-
h("div",
|
|
992
|
+
w.batchImages && w.batchImages.length > 0 ? (v(), m("div", Pe, [
|
|
993
|
+
h("div", ze, "共 " + z(w.batchImages.length) + " 张", 1),
|
|
992
994
|
h("div", {
|
|
993
995
|
ref_key: "imageListScrollRef",
|
|
994
996
|
ref: g,
|
|
995
997
|
class: "image-list-scroll"
|
|
996
998
|
}, [
|
|
997
|
-
(v(!0), m(N, null, J(w.batchImages, (
|
|
998
|
-
key: `${
|
|
999
|
+
(v(!0), m(N, null, J(w.batchImages, (a, d) => (v(), m("button", {
|
|
1000
|
+
key: `${a.imageUrl}-${d}`,
|
|
999
1001
|
ref_for: !0,
|
|
1000
1002
|
ref: (f) => ht(f, d),
|
|
1001
|
-
class:
|
|
1003
|
+
class: X(["image-list-item", { active: d === x.value }]),
|
|
1002
1004
|
onClick: (f) => ot(d)
|
|
1003
1005
|
}, [
|
|
1004
1006
|
h("div", Le, [
|
|
1005
1007
|
h("img", {
|
|
1006
|
-
src:
|
|
1008
|
+
src: a.imageUrl,
|
|
1007
1009
|
alt: `第${d + 1}张`,
|
|
1008
1010
|
class: "image-list-thumb"
|
|
1009
|
-
}, null, 8,
|
|
1010
|
-
Kt(d) ? (v(), m("div",
|
|
1011
|
+
}, null, 8, Be),
|
|
1012
|
+
Kt(d) ? (v(), m("div", Re, [
|
|
1011
1013
|
(v(!0), m(N, null, J(Gt(d), (f) => (v(), m(N, {
|
|
1012
1014
|
key: f.id
|
|
1013
1015
|
}, [
|
|
1014
|
-
|
|
1016
|
+
Yt(f) ? (v(), m("div", {
|
|
1015
1017
|
key: 0,
|
|
1016
1018
|
class: "thumb-overlay-rect",
|
|
1017
|
-
style:
|
|
1018
|
-
}, null, 4)) :
|
|
1019
|
+
style: U(Zt(d, f))
|
|
1020
|
+
}, null, 4)) : Jt(f) ? (v(), m("svg", He, [
|
|
1019
1021
|
h("polygon", {
|
|
1020
1022
|
points: Qt(d, f),
|
|
1021
|
-
style:
|
|
1022
|
-
}, null, 12,
|
|
1023
|
-
])) : jt(f) ? (v(!0), m(N, { key: 2 }, J(
|
|
1024
|
-
key: `${f.id}-${
|
|
1023
|
+
style: U(te(f))
|
|
1024
|
+
}, null, 12, Ee)
|
|
1025
|
+
])) : jt(f) ? (v(!0), m(N, { key: 2 }, J(_t(f), (A, P) => (v(), m("div", {
|
|
1026
|
+
key: `${f.id}-${P}`,
|
|
1025
1027
|
class: "thumb-overlay-point",
|
|
1026
|
-
style:
|
|
1028
|
+
style: U(ee(d, A, f))
|
|
1027
1029
|
}, null, 4))), 128)) : Xt(f) ? (v(), m("div", {
|
|
1028
1030
|
key: 3,
|
|
1029
1031
|
class: "thumb-overlay-rotated",
|
|
1030
|
-
style:
|
|
1032
|
+
style: U(se(d, f))
|
|
1031
1033
|
}, null, 4)) : qt(f) ? (v(), m("div", {
|
|
1032
1034
|
key: 4,
|
|
1033
1035
|
class: "thumb-overlay-category",
|
|
1034
|
-
style:
|
|
1035
|
-
},
|
|
1036
|
+
style: U(ie(d, f))
|
|
1037
|
+
}, z(f.label), 5)) : B("", !0)
|
|
1036
1038
|
], 64))), 128))
|
|
1037
|
-
])) :
|
|
1039
|
+
])) : B("", !0)
|
|
1038
1040
|
]),
|
|
1039
|
-
h("span",
|
|
1041
|
+
h("span", Ue, "第 " + z(d + 1) + " 张", 1)
|
|
1040
1042
|
], 10, $e))), 128))
|
|
1041
1043
|
], 512)
|
|
1042
|
-
])) :
|
|
1044
|
+
])) : B("", !0),
|
|
1043
1045
|
h("div", Ve, [
|
|
1044
|
-
w.readOnly ?
|
|
1046
|
+
w.readOnly ? B("", !0) : (v(), m("div", Oe, [
|
|
1047
|
+
h("div", {
|
|
1048
|
+
class: X(["tool-btn", { active: k.value === "pan" }]),
|
|
1049
|
+
onClick: i[0] || (i[0] = (a) => Y("pan")),
|
|
1050
|
+
title: "拖动"
|
|
1051
|
+
}, [
|
|
1052
|
+
R(L, { name: "rank" })
|
|
1053
|
+
], 2),
|
|
1045
1054
|
h("div", {
|
|
1046
|
-
class:
|
|
1047
|
-
onClick: i[
|
|
1055
|
+
class: X(["tool-btn", { active: k.value === "select" }]),
|
|
1056
|
+
onClick: i[1] || (i[1] = (a) => Y("select")),
|
|
1048
1057
|
title: "选择"
|
|
1049
1058
|
}, [
|
|
1050
|
-
|
|
1059
|
+
R(L, { name: "pointer" })
|
|
1051
1060
|
], 2),
|
|
1052
|
-
i[
|
|
1053
|
-
(v(!0), m(N, null, J(b.value, (
|
|
1054
|
-
key:
|
|
1055
|
-
class:
|
|
1056
|
-
onClick: (d) =>
|
|
1057
|
-
title: F(
|
|
1061
|
+
i[5] || (i[5] = h("div", { class: "divider" }, null, -1)),
|
|
1062
|
+
(v(!0), m(N, null, J(b.value, (a) => (v(), m("div", {
|
|
1063
|
+
key: a,
|
|
1064
|
+
class: X(["tool-btn", { active: k.value === a }]),
|
|
1065
|
+
onClick: (d) => Y(a),
|
|
1066
|
+
title: F(a)
|
|
1058
1067
|
}, [
|
|
1059
|
-
|
|
1060
|
-
name:
|
|
1068
|
+
R(L, {
|
|
1069
|
+
name: I(a)
|
|
1061
1070
|
}, null, 8, ["name"])
|
|
1062
1071
|
], 10, Fe))), 128)),
|
|
1063
|
-
i[
|
|
1072
|
+
i[6] || (i[6] = h("div", { class: "divider" }, null, -1)),
|
|
1064
1073
|
h("div", {
|
|
1065
1074
|
class: "tool-btn",
|
|
1066
1075
|
onClick: Mt,
|
|
1067
1076
|
title: "放大"
|
|
1068
1077
|
}, [
|
|
1069
|
-
|
|
1078
|
+
R(L, { name: "zoom-in" })
|
|
1070
1079
|
]),
|
|
1071
1080
|
h("div", {
|
|
1072
1081
|
class: "tool-btn",
|
|
1073
1082
|
onClick: Tt,
|
|
1074
1083
|
title: "缩小"
|
|
1075
1084
|
}, [
|
|
1076
|
-
|
|
1085
|
+
R(L, { name: "zoom-out" })
|
|
1077
1086
|
]),
|
|
1078
|
-
O.value ? (v(), m("div", Ne)) :
|
|
1087
|
+
O.value ? (v(), m("div", Ne)) : B("", !0),
|
|
1079
1088
|
O.value ? (v(), m("div", {
|
|
1080
1089
|
key: 1,
|
|
1081
1090
|
class: "tool-btn",
|
|
1082
1091
|
onClick: St,
|
|
1083
1092
|
title: "删除选中"
|
|
1084
1093
|
}, [
|
|
1085
|
-
|
|
1086
|
-
])) :
|
|
1094
|
+
R(L, { name: "delete" })
|
|
1095
|
+
])) : B("", !0)
|
|
1087
1096
|
]))
|
|
1088
1097
|
]),
|
|
1089
1098
|
h("div", We, [
|
|
1090
1099
|
h("div", {
|
|
1091
1100
|
class: "canvas-wrapper",
|
|
1092
1101
|
ref_key: "canvasWrapper",
|
|
1093
|
-
ref:
|
|
1094
|
-
onWheel: i[
|
|
1102
|
+
ref: c,
|
|
1103
|
+
onWheel: i[2] || (i[2] = It(() => {
|
|
1095
1104
|
}, ["prevent"]))
|
|
1096
1105
|
}, [
|
|
1097
1106
|
h("canvas", {
|
|
1098
1107
|
ref_key: "canvasRef",
|
|
1099
|
-
ref:
|
|
1108
|
+
ref: o
|
|
1100
1109
|
}, null, 512),
|
|
1101
|
-
w.readOnly ?
|
|
1110
|
+
w.readOnly ? B("", !0) : (v(), m("div", Ge, [
|
|
1102
1111
|
h("div", {
|
|
1103
1112
|
class: "selector-trigger",
|
|
1104
1113
|
onClick: yt
|
|
1105
1114
|
}, [
|
|
1106
|
-
Z.value ? (v(), m("div",
|
|
1115
|
+
Z.value ? (v(), m("div", Ye, [
|
|
1107
1116
|
h("span", {
|
|
1108
1117
|
class: "color-dot",
|
|
1109
|
-
style:
|
|
1118
|
+
style: U({ backgroundColor: Z.value.color })
|
|
1110
1119
|
}, null, 4),
|
|
1111
|
-
h("span",
|
|
1112
|
-
])) : (v(), m("div", je, [...i[
|
|
1120
|
+
h("span", Je, z(Z.value.name), 1)
|
|
1121
|
+
])) : (v(), m("div", je, [...i[7] || (i[7] = [
|
|
1113
1122
|
h("span", { class: "label-name" }, "请选择标签", -1)
|
|
1114
1123
|
])])),
|
|
1115
|
-
|
|
1124
|
+
R(L, {
|
|
1116
1125
|
name: "right",
|
|
1117
|
-
class:
|
|
1126
|
+
class: X(["arrow-icon", { "is-open": G.value }])
|
|
1118
1127
|
}, null, 8, ["class"])
|
|
1119
1128
|
]),
|
|
1120
1129
|
G.value ? (v(), m("div", Xe, [
|
|
1121
|
-
|
|
1122
|
-
key:
|
|
1123
|
-
class:
|
|
1124
|
-
onClick: (d) => wt(
|
|
1130
|
+
_.value.length === 0 ? (v(), m("div", qe, "请在右侧创建标签")) : (v(!0), m(N, { key: 1 }, J(_.value, (a) => (v(), m("div", {
|
|
1131
|
+
key: a.id,
|
|
1132
|
+
class: X(["dropdown-item", { active: $.value === a.id }]),
|
|
1133
|
+
onClick: (d) => wt(a)
|
|
1125
1134
|
}, [
|
|
1126
1135
|
h("span", {
|
|
1127
1136
|
class: "color-dot",
|
|
1128
|
-
style:
|
|
1137
|
+
style: U({ backgroundColor: a.color })
|
|
1129
1138
|
}, null, 4),
|
|
1130
|
-
h("span", Ze,
|
|
1131
|
-
$.value ===
|
|
1139
|
+
h("span", Ze, z(a.name), 1),
|
|
1140
|
+
$.value === a.id ? (v(), vt(L, {
|
|
1132
1141
|
key: 0,
|
|
1133
1142
|
name: "aim",
|
|
1134
1143
|
class: "check-icon"
|
|
1135
|
-
})) :
|
|
1144
|
+
})) : B("", !0)
|
|
1136
1145
|
], 10, Ke))), 128))
|
|
1137
|
-
])) :
|
|
1146
|
+
])) : B("", !0)
|
|
1138
1147
|
]))
|
|
1139
1148
|
], 544),
|
|
1140
1149
|
w.batchImages && w.batchImages.length > 0 ? (v(), m("div", Qe, [
|
|
1141
1150
|
h("button", {
|
|
1142
1151
|
class: "icon-btn",
|
|
1143
|
-
onClick:
|
|
1152
|
+
onClick: Et,
|
|
1144
1153
|
disabled: x.value <= 0,
|
|
1145
1154
|
title: "第一张"
|
|
1146
1155
|
}, [
|
|
1147
|
-
|
|
1156
|
+
R(L, { name: "first" })
|
|
1148
1157
|
], 8, ts),
|
|
1149
1158
|
h("button", {
|
|
1150
1159
|
class: "icon-btn",
|
|
1151
|
-
onClick:
|
|
1160
|
+
onClick: Rt,
|
|
1152
1161
|
disabled: x.value <= 0,
|
|
1153
1162
|
title: "上一张"
|
|
1154
1163
|
}, [
|
|
1155
|
-
|
|
1164
|
+
R(L, { name: "back" })
|
|
1156
1165
|
], 8, es),
|
|
1157
|
-
h("span", null,
|
|
1166
|
+
h("span", null, z(x.value + 1) + " / " + z(w.batchImages.length), 1),
|
|
1158
1167
|
h("button", {
|
|
1159
1168
|
class: "icon-btn",
|
|
1160
1169
|
onClick: Ht,
|
|
1161
1170
|
disabled: x.value >= w.batchImages.length - 1,
|
|
1162
1171
|
title: "下一张"
|
|
1163
1172
|
}, [
|
|
1164
|
-
|
|
1173
|
+
R(L, { name: "right" })
|
|
1165
1174
|
], 8, ss),
|
|
1166
1175
|
h("button", {
|
|
1167
1176
|
class: "icon-btn",
|
|
1168
|
-
onClick:
|
|
1177
|
+
onClick: Ut,
|
|
1169
1178
|
disabled: x.value >= w.batchImages.length - 1,
|
|
1170
1179
|
title: "最后一张"
|
|
1171
1180
|
}, [
|
|
1172
|
-
|
|
1181
|
+
R(L, { name: "last" })
|
|
1173
1182
|
], 8, is)
|
|
1174
|
-
])) :
|
|
1183
|
+
])) : B("", !0)
|
|
1175
1184
|
]),
|
|
1176
|
-
w.readOnly ?
|
|
1185
|
+
w.readOnly ? B("", !0) : (v(), m("div", ns, [
|
|
1177
1186
|
h("div", { class: "sidebar-header" }, [
|
|
1178
|
-
i[
|
|
1187
|
+
i[8] || (i[8] = h("h3", null, "标签", -1)),
|
|
1179
1188
|
h("button", {
|
|
1180
1189
|
class: "add-btn",
|
|
1181
1190
|
onClick: Dt
|
|
1182
1191
|
}, "添加标签")
|
|
1183
1192
|
]),
|
|
1184
1193
|
h("div", os, [
|
|
1185
|
-
(v(!0), m(N, null, J(
|
|
1186
|
-
key:
|
|
1194
|
+
(v(!0), m(N, null, J(_.value, (a) => (v(), m("div", {
|
|
1195
|
+
key: a.id,
|
|
1187
1196
|
class: "label-item",
|
|
1188
|
-
style:
|
|
1197
|
+
style: U({ backgroundColor: a.color + "1A", color: a.color })
|
|
1189
1198
|
}, [
|
|
1190
1199
|
h("div", as, [
|
|
1191
1200
|
h("label", {
|
|
1192
1201
|
class: "color-wrapper",
|
|
1193
|
-
style:
|
|
1202
|
+
style: U({ backgroundColor: a.color })
|
|
1194
1203
|
}, [
|
|
1195
1204
|
ft(h("input", {
|
|
1196
1205
|
type: "color",
|
|
1197
|
-
"onUpdate:modelValue": (d) =>
|
|
1198
|
-
onChange: (d) => $t(
|
|
1206
|
+
"onUpdate:modelValue": (d) => a.color = d,
|
|
1207
|
+
onChange: (d) => $t(a),
|
|
1199
1208
|
style: { visibility: "hidden", width: "0", height: "0" }
|
|
1200
1209
|
}, null, 40, ls), [
|
|
1201
|
-
[mt,
|
|
1210
|
+
[mt, a.color]
|
|
1202
1211
|
])
|
|
1203
1212
|
], 4),
|
|
1204
1213
|
h("span", {
|
|
1205
1214
|
class: "label-name",
|
|
1206
|
-
title:
|
|
1207
|
-
},
|
|
1215
|
+
title: a.name
|
|
1216
|
+
}, z(a.name), 9, cs),
|
|
1208
1217
|
h("span", {
|
|
1209
1218
|
class: "action-icon eye",
|
|
1210
|
-
onClick: (d) => Lt(
|
|
1219
|
+
onClick: (d) => Lt(a)
|
|
1211
1220
|
}, [
|
|
1212
|
-
|
|
1221
|
+
a.visible ? (v(), vt(L, {
|
|
1213
1222
|
key: 0,
|
|
1214
1223
|
name: "view"
|
|
1215
1224
|
})) : (v(), vt(L, {
|
|
@@ -1218,59 +1227,59 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
|
|
|
1218
1227
|
}))
|
|
1219
1228
|
], 8, rs),
|
|
1220
1229
|
h("div", hs, [
|
|
1221
|
-
i[
|
|
1230
|
+
i[9] || (i[9] = h("span", { class: "dots" }, "•••", -1)),
|
|
1222
1231
|
h("span", {
|
|
1223
1232
|
class: "delete-btn",
|
|
1224
|
-
onClick: (d) =>
|
|
1233
|
+
onClick: (d) => Bt(a.id),
|
|
1225
1234
|
title: "删除"
|
|
1226
1235
|
}, [
|
|
1227
|
-
|
|
1236
|
+
R(L, { name: "delete" })
|
|
1228
1237
|
], 8, ds)
|
|
1229
1238
|
])
|
|
1230
1239
|
])
|
|
1231
1240
|
], 4))), 128))
|
|
1232
1241
|
])
|
|
1233
1242
|
])),
|
|
1234
|
-
|
|
1243
|
+
q.value ? (v(), m("div", {
|
|
1235
1244
|
key: 2,
|
|
1236
1245
|
class: "modal-overlay",
|
|
1237
1246
|
onClick: It(dt, ["self"])
|
|
1238
1247
|
}, [
|
|
1239
1248
|
h("div", gs, [
|
|
1240
|
-
i[
|
|
1249
|
+
i[12] || (i[12] = h("div", { class: "modal-header" }, [
|
|
1241
1250
|
h("h3", null, "新增标签")
|
|
1242
1251
|
], -1)),
|
|
1243
1252
|
h("div", us, [
|
|
1244
1253
|
h("div", vs, [
|
|
1245
|
-
i[
|
|
1254
|
+
i[10] || (i[10] = h("label", null, [
|
|
1246
1255
|
lt("标签名称 "),
|
|
1247
1256
|
h("span", { class: "required" }, "*")
|
|
1248
1257
|
], -1)),
|
|
1249
1258
|
ft(h("input", {
|
|
1250
|
-
"onUpdate:modelValue": i[
|
|
1259
|
+
"onUpdate:modelValue": i[3] || (i[3] = (a) => C.value.name = a),
|
|
1251
1260
|
placeholder: "请输入标签名称",
|
|
1252
1261
|
class: "modal-input",
|
|
1253
1262
|
autofocus: ""
|
|
1254
1263
|
}, null, 512), [
|
|
1255
|
-
[mt,
|
|
1264
|
+
[mt, C.value.name]
|
|
1256
1265
|
])
|
|
1257
1266
|
]),
|
|
1258
1267
|
h("div", fs, [
|
|
1259
|
-
i[
|
|
1268
|
+
i[11] || (i[11] = h("label", null, "标签颜色", -1)),
|
|
1260
1269
|
h("div", ms, [
|
|
1261
1270
|
h("label", {
|
|
1262
1271
|
class: "color-picker-box",
|
|
1263
|
-
style:
|
|
1272
|
+
style: U({ backgroundColor: C.value.color })
|
|
1264
1273
|
}, [
|
|
1265
1274
|
ft(h("input", {
|
|
1266
1275
|
type: "color",
|
|
1267
|
-
"onUpdate:modelValue": i[
|
|
1276
|
+
"onUpdate:modelValue": i[4] || (i[4] = (a) => C.value.color = a),
|
|
1268
1277
|
class: "modal-color-picker"
|
|
1269
1278
|
}, null, 512), [
|
|
1270
|
-
[mt,
|
|
1279
|
+
[mt, C.value.color]
|
|
1271
1280
|
])
|
|
1272
1281
|
], 4),
|
|
1273
|
-
h("span", ps,
|
|
1282
|
+
h("span", ps, z(C.value.color), 1)
|
|
1274
1283
|
])
|
|
1275
1284
|
])
|
|
1276
1285
|
]),
|
|
@@ -1280,19 +1289,19 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
|
|
|
1280
1289
|
class: "cancel-btn"
|
|
1281
1290
|
}, "取消"),
|
|
1282
1291
|
h("button", {
|
|
1283
|
-
onClick:
|
|
1292
|
+
onClick: Pt,
|
|
1284
1293
|
class: "confirm-btn",
|
|
1285
|
-
disabled: !
|
|
1294
|
+
disabled: !C.value.name.trim()
|
|
1286
1295
|
}, "确认", 8, ws)
|
|
1287
1296
|
])
|
|
1288
1297
|
])
|
|
1289
|
-
])) :
|
|
1298
|
+
])) : B("", !0)
|
|
1290
1299
|
], 2));
|
|
1291
1300
|
}
|
|
1292
|
-
}), bs = /* @__PURE__ */ rt(xs, [["__scopeId", "data-v-
|
|
1301
|
+
}), bs = /* @__PURE__ */ rt(xs, [["__scopeId", "data-v-914fe07d"]]), Cs = {
|
|
1293
1302
|
class: "thumbnail-wrapper",
|
|
1294
1303
|
ref: "wrapper"
|
|
1295
|
-
},
|
|
1304
|
+
}, _s = ["src", "alt"], ks = ["viewBox", "preserveAspectRatio"], Is = ["x", "y", "width", "height", "stroke", "stroke-width"], As = ["points", "stroke", "stroke-width"], Ss = ["transform"], Ms = ["x", "y", "width", "height", "stroke", "stroke-width"], Ts = { key: 3 }, Ds = ["cx", "cy", "r", "fill", "stroke-width"], Ps = ["x", "y", "width", "height", "fill"], zs = ["x", "y", "fill", "font-size", "font-weight", "text-anchor", "dominant-baseline"], $s = {
|
|
1296
1305
|
key: 1,
|
|
1297
1306
|
class: "loading-placeholder"
|
|
1298
1307
|
}, Ls = /* @__PURE__ */ ct({
|
|
@@ -1307,54 +1316,54 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
|
|
|
1307
1316
|
fontSize: {}
|
|
1308
1317
|
},
|
|
1309
1318
|
setup(w) {
|
|
1310
|
-
const t = w, n = M(null), e = M(!1),
|
|
1311
|
-
n.value && (
|
|
1312
|
-
}, g = V(() => t.fit === "contain" ? "xMidYMid meet" : "xMidYMid slice"), u = V(() => t.strokeWidth ?? 10), r = V(() => t.fontSize ?? 30),
|
|
1319
|
+
const t = w, n = M(null), e = M(!1), l = M(0), o = M(0), c = () => {
|
|
1320
|
+
n.value && (l.value = n.value.naturalWidth, o.value = n.value.naturalHeight, e.value = !0);
|
|
1321
|
+
}, g = V(() => t.fit === "contain" ? "xMidYMid meet" : "xMidYMid slice"), u = V(() => t.strokeWidth ?? 10), r = V(() => t.fontSize ?? 30), k = (C) => {
|
|
1313
1322
|
var S;
|
|
1314
|
-
if ((S =
|
|
1323
|
+
if ((S = C.style) != null && S.strokeColor) return C.style.strokeColor;
|
|
1315
1324
|
if (t.labels) {
|
|
1316
|
-
const p = t.labels.find((
|
|
1325
|
+
const p = t.labels.find((H) => H.name === C.label);
|
|
1317
1326
|
if (p) return p.color;
|
|
1318
1327
|
}
|
|
1319
1328
|
return "#FF0000";
|
|
1320
|
-
}, x = (
|
|
1321
|
-
const S =
|
|
1322
|
-
return { x: p, y:
|
|
1323
|
-
}, D = (
|
|
1324
|
-
if (
|
|
1325
|
-
const S = x(
|
|
1329
|
+
}, x = (C) => {
|
|
1330
|
+
const S = C.coordinates, p = Math.min(S.x1, S.x2), H = Math.min(S.y1, S.y2), O = Math.abs(S.x1 - S.x2), G = Math.abs(S.y1 - S.y2);
|
|
1331
|
+
return { x: p, y: H, width: O, height: G };
|
|
1332
|
+
}, D = (C) => C.coordinates.points.map((p) => `${p.x},${p.y}`).join(" "), _ = (C) => {
|
|
1333
|
+
if (C.type === "rectangle") {
|
|
1334
|
+
const S = x(C);
|
|
1326
1335
|
return { x: S.x, y: S.y - 5 };
|
|
1327
|
-
} else if (
|
|
1328
|
-
const S =
|
|
1336
|
+
} else if (C.type === "polygon") {
|
|
1337
|
+
const S = C.coordinates.points;
|
|
1329
1338
|
if (S.length > 0) return { x: S[0].x, y: S[0].y - 5 };
|
|
1330
1339
|
} else {
|
|
1331
|
-
if (
|
|
1332
|
-
return { x:
|
|
1333
|
-
if (
|
|
1334
|
-
const S =
|
|
1340
|
+
if (C.type === "rotatedRect")
|
|
1341
|
+
return { x: C.coordinates.x, y: C.coordinates.y - C.coordinates.height / 2 - 5 };
|
|
1342
|
+
if (C.type === "point") {
|
|
1343
|
+
const S = C.coordinates.points;
|
|
1335
1344
|
if (S.length > 0) return { x: S[0].x, y: S[0].y - 15 };
|
|
1336
|
-
} else if (
|
|
1337
|
-
return { x:
|
|
1345
|
+
} else if (C.type === "category")
|
|
1346
|
+
return { x: C.coordinates.x, y: C.coordinates.y };
|
|
1338
1347
|
}
|
|
1339
1348
|
return { x: 0, y: 0 };
|
|
1340
|
-
}, $ = (
|
|
1341
|
-
const { x: S, y: p, angle:
|
|
1349
|
+
}, $ = (C) => {
|
|
1350
|
+
const { x: S, y: p, angle: H } = C.coordinates, O = H * 180 / Math.PI;
|
|
1342
1351
|
return `translate(${S}, ${p}) rotate(${O})`;
|
|
1343
|
-
},
|
|
1344
|
-
return (
|
|
1352
|
+
}, q = (C) => ({ x: C.coordinates.x, y: C.coordinates.y });
|
|
1353
|
+
return (C, S) => (v(), m("div", Cs, [
|
|
1345
1354
|
h("img", {
|
|
1346
1355
|
ref_key: "img",
|
|
1347
1356
|
ref: n,
|
|
1348
1357
|
src: w.src,
|
|
1349
1358
|
class: "thumbnail-image",
|
|
1350
|
-
style:
|
|
1351
|
-
onLoad:
|
|
1359
|
+
style: U({ objectFit: w.fit }),
|
|
1360
|
+
onLoad: c,
|
|
1352
1361
|
alt: w.alt
|
|
1353
|
-
}, null, 44,
|
|
1362
|
+
}, null, 44, _s),
|
|
1354
1363
|
e.value ? (v(), m("svg", {
|
|
1355
1364
|
key: 0,
|
|
1356
1365
|
class: "annotation-overlay",
|
|
1357
|
-
viewBox: `0 0 ${
|
|
1366
|
+
viewBox: `0 0 ${l.value} ${o.value}`,
|
|
1358
1367
|
preserveAspectRatio: g.value
|
|
1359
1368
|
}, [
|
|
1360
1369
|
(v(!0), m(N, null, J(w.annotations, (p) => (v(), m(N, {
|
|
@@ -1366,13 +1375,13 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
|
|
|
1366
1375
|
y: x(p).y,
|
|
1367
1376
|
width: x(p).width,
|
|
1368
1377
|
height: x(p).height,
|
|
1369
|
-
stroke:
|
|
1378
|
+
stroke: k(p),
|
|
1370
1379
|
"stroke-width": u.value,
|
|
1371
1380
|
fill: "transparent"
|
|
1372
1381
|
}, null, 8, Is)) : p.type === "polygon" ? (v(), m("polygon", {
|
|
1373
1382
|
key: 1,
|
|
1374
1383
|
points: D(p),
|
|
1375
|
-
stroke:
|
|
1384
|
+
stroke: k(p),
|
|
1376
1385
|
"stroke-width": u.value,
|
|
1377
1386
|
fill: "transparent"
|
|
1378
1387
|
}, null, 8, As)) : p.type === "rotatedRect" ? (v(), m("g", {
|
|
@@ -1384,50 +1393,50 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
|
|
|
1384
1393
|
y: -p.coordinates.height / 2,
|
|
1385
1394
|
width: p.coordinates.width,
|
|
1386
1395
|
height: p.coordinates.height,
|
|
1387
|
-
stroke:
|
|
1396
|
+
stroke: k(p),
|
|
1388
1397
|
"stroke-width": u.value,
|
|
1389
1398
|
fill: "transparent"
|
|
1390
1399
|
}, null, 8, Ms)
|
|
1391
1400
|
], 8, Ss)) : p.type === "point" ? (v(), m("g", Ts, [
|
|
1392
|
-
(v(!0), m(N, null, J(p.coordinates.points, (
|
|
1401
|
+
(v(!0), m(N, null, J(p.coordinates.points, (H, O) => (v(), m("circle", {
|
|
1393
1402
|
key: O,
|
|
1394
|
-
cx:
|
|
1395
|
-
cy:
|
|
1403
|
+
cx: H.x,
|
|
1404
|
+
cy: H.y,
|
|
1396
1405
|
r: u.value * 1.5,
|
|
1397
|
-
fill:
|
|
1406
|
+
fill: k(p),
|
|
1398
1407
|
stroke: "white",
|
|
1399
1408
|
"stroke-width": u.value * 0.5
|
|
1400
1409
|
}, null, 8, Ds))), 128))
|
|
1401
1410
|
])) : p.type === "category" ? (v(), m("rect", {
|
|
1402
1411
|
key: 4,
|
|
1403
|
-
x:
|
|
1404
|
-
y:
|
|
1412
|
+
x: q(p).x - (p.label || "").length * r.value * 0.6 / 2 - 8,
|
|
1413
|
+
y: q(p).y - r.value / 2 - 4,
|
|
1405
1414
|
width: (p.label || "").length * r.value * 0.6 + 16,
|
|
1406
1415
|
height: r.value + 8,
|
|
1407
1416
|
rx: "6",
|
|
1408
1417
|
ry: "6",
|
|
1409
|
-
fill:
|
|
1418
|
+
fill: k(p),
|
|
1410
1419
|
"fill-opacity": "0.85"
|
|
1411
|
-
}, null, 8,
|
|
1420
|
+
}, null, 8, Ps)) : B("", !0),
|
|
1412
1421
|
p.label ? (v(), m("text", {
|
|
1413
1422
|
key: 5,
|
|
1414
|
-
x:
|
|
1415
|
-
y:
|
|
1416
|
-
fill: p.type === "category" ? "#ffffff" :
|
|
1423
|
+
x: _(p).x,
|
|
1424
|
+
y: _(p).y,
|
|
1425
|
+
fill: p.type === "category" ? "#ffffff" : k(p),
|
|
1417
1426
|
"font-size": r.value,
|
|
1418
1427
|
"font-weight": p.type === "category" ? "normal" : "bold",
|
|
1419
1428
|
"text-anchor": p.type === "category" ? "middle" : "start",
|
|
1420
1429
|
"dominant-baseline": p.type === "category" ? "middle" : "auto",
|
|
1421
|
-
class:
|
|
1422
|
-
},
|
|
1430
|
+
class: X({ "anno-label": p.type !== "category" })
|
|
1431
|
+
}, z(p.label), 11, zs)) : B("", !0)
|
|
1423
1432
|
], 64))), 128))
|
|
1424
1433
|
], 8, ks)) : (v(), m("div", $s, "Loading..."))
|
|
1425
1434
|
], 512));
|
|
1426
1435
|
}
|
|
1427
|
-
}),
|
|
1436
|
+
}), Bs = /* @__PURE__ */ rt(Ls, [["__scopeId", "data-v-159a7956"]]), Rs = {
|
|
1428
1437
|
key: 0,
|
|
1429
1438
|
class: "gallery-view"
|
|
1430
|
-
}, Hs = { class: "gallery-layout" },
|
|
1439
|
+
}, Hs = { class: "gallery-layout" }, Es = { class: "gallery-sidebar" }, Us = { class: "label-stats-table" }, Vs = { class: "label-cover-wrapper" }, Os = ["src"], Fs = { class: "gallery-content" }, Ns = ["onClick"], Ws = { class: "thumbnail-wrapper" }, Gs = { class: "img-meta" }, Ys = { class: "img-index" }, Js = { class: "anno-count" }, js = {
|
|
1431
1440
|
key: 0,
|
|
1432
1441
|
class: "bottom-bar"
|
|
1433
1442
|
}, Xs = {
|
|
@@ -1443,59 +1452,59 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
|
|
|
1443
1452
|
thumbStrokeWidth: {},
|
|
1444
1453
|
thumbFontSize: {}
|
|
1445
1454
|
},
|
|
1446
|
-
emits: ["export", "update:images", "imageClick", "update:labels"],
|
|
1455
|
+
emits: ["export", "update:images", "imageClick", "update:labels", "pageChange"],
|
|
1447
1456
|
setup(w, { expose: t, emit: n }) {
|
|
1448
|
-
const e = w,
|
|
1457
|
+
const e = w, l = n, o = M("gallery"), c = M([]), g = M([]), u = M(0), r = M(null), k = M(null), x = M(null), D = V(() => {
|
|
1449
1458
|
var y, b;
|
|
1450
1459
|
return ((b = (y = e.actionBar) == null ? void 0 : y.annotateButton) == null ? void 0 : b.show) === !0;
|
|
1451
|
-
}),
|
|
1460
|
+
}), _ = V(() => {
|
|
1452
1461
|
var y, b;
|
|
1453
1462
|
return ((b = (y = e.actionBar) == null ? void 0 : y.exportButton) == null ? void 0 : b.show) === !0;
|
|
1454
|
-
}), $ = V(() => D.value ||
|
|
1463
|
+
}), $ = V(() => D.value || _.value), q = V(() => {
|
|
1455
1464
|
var y, b;
|
|
1456
1465
|
return ((b = (y = e.actionBar) == null ? void 0 : y.annotateButton) == null ? void 0 : b.text) || "手动标注";
|
|
1457
|
-
}),
|
|
1466
|
+
}), C = V(() => {
|
|
1458
1467
|
var y, b;
|
|
1459
1468
|
return ((b = (y = e.actionBar) == null ? void 0 : y.exportButton) == null ? void 0 : b.text) || "导出";
|
|
1460
1469
|
}), S = V(() => e.clickToEnterEditor !== !1), p = V(() => {
|
|
1461
1470
|
const y = {};
|
|
1462
|
-
g.value.forEach((
|
|
1463
|
-
y[
|
|
1471
|
+
g.value.forEach((I) => {
|
|
1472
|
+
y[I.name] = { count: 0, cover: "" };
|
|
1464
1473
|
});
|
|
1465
1474
|
let b = 0;
|
|
1466
|
-
return
|
|
1467
|
-
|
|
1475
|
+
return c.value.forEach((I) => {
|
|
1476
|
+
I.annotations && I.annotations.forEach((F) => {
|
|
1468
1477
|
var W;
|
|
1469
|
-
const
|
|
1470
|
-
|
|
1478
|
+
const E = F.label || (F.labelId ? (W = g.value.find((Y) => Y.id === F.labelId)) == null ? void 0 : W.name : null);
|
|
1479
|
+
E && y[E] && (y[E].count++, b++, y[E].cover || (y[E].cover = I.imageUrl));
|
|
1471
1480
|
});
|
|
1472
|
-
}), g.value.map((
|
|
1473
|
-
var W,
|
|
1474
|
-
const F = ((W = y[
|
|
1481
|
+
}), g.value.map((I) => {
|
|
1482
|
+
var W, Y;
|
|
1483
|
+
const F = ((W = y[I.name]) == null ? void 0 : W.count) || 0, E = b === 0 ? "0.00%" : (F / b * 100).toFixed(2) + "%";
|
|
1475
1484
|
return {
|
|
1476
|
-
id:
|
|
1477
|
-
name:
|
|
1478
|
-
color:
|
|
1485
|
+
id: I.id,
|
|
1486
|
+
name: I.name,
|
|
1487
|
+
color: I.color,
|
|
1479
1488
|
count: F,
|
|
1480
|
-
percentage:
|
|
1481
|
-
cover: ((
|
|
1489
|
+
percentage: E,
|
|
1490
|
+
cover: ((Y = y[I.name]) == null ? void 0 : Y.cover) || ""
|
|
1482
1491
|
};
|
|
1483
1492
|
});
|
|
1484
|
-
}),
|
|
1493
|
+
}), H = (y) => ({
|
|
1485
1494
|
color: y.color,
|
|
1486
1495
|
backgroundColor: y.color + "1A"
|
|
1487
1496
|
// 1A represents ~10% opacity in hex
|
|
1488
1497
|
});
|
|
1489
1498
|
K(() => e.images, (y) => {
|
|
1490
|
-
|
|
1499
|
+
c.value = JSON.parse(JSON.stringify(y));
|
|
1491
1500
|
}, { immediate: !0, deep: !0 }), K(() => e.labels, (y) => {
|
|
1492
1501
|
g.value = JSON.parse(JSON.stringify(y || []));
|
|
1493
1502
|
}, { immediate: !0, deep: !0 });
|
|
1494
1503
|
const O = (y) => {
|
|
1495
|
-
u.value = y,
|
|
1496
|
-
|
|
1497
|
-
var b,
|
|
1498
|
-
(
|
|
1504
|
+
u.value = y, o.value = "editor", l("pageChange", { nowPage: "editPage" }), x.value && (x.value.scrollTop = 0), at(() => {
|
|
1505
|
+
k.value && (k.value.scrollTop = 0), window.scrollTo(0, 0), requestAnimationFrame(() => {
|
|
1506
|
+
var b, I;
|
|
1507
|
+
(I = (b = r.value) == null ? void 0 : b.jumpTo) == null || I.call(b, y);
|
|
1499
1508
|
});
|
|
1500
1509
|
});
|
|
1501
1510
|
}, G = (y, b) => {
|
|
@@ -1503,8 +1512,8 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
|
|
|
1503
1512
|
O(y);
|
|
1504
1513
|
return;
|
|
1505
1514
|
}
|
|
1506
|
-
|
|
1507
|
-
}, Z = (y) =>
|
|
1515
|
+
l("imageClick", { index: y, imageId: b.id, image: b });
|
|
1516
|
+
}, Z = (y) => c.value.findIndex((b) => b.id === y);
|
|
1508
1517
|
t({
|
|
1509
1518
|
openImageById: (y) => {
|
|
1510
1519
|
const b = Z(y);
|
|
@@ -1514,41 +1523,41 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
|
|
|
1514
1523
|
const b = Z(y);
|
|
1515
1524
|
if (b < 0)
|
|
1516
1525
|
return !1;
|
|
1517
|
-
const
|
|
1518
|
-
return
|
|
1526
|
+
const I = c.value[b];
|
|
1527
|
+
return I ? (l("imageClick", { index: b, imageId: I.id, image: I }), !0) : !1;
|
|
1519
1528
|
},
|
|
1520
1529
|
getFinalData: () => ({
|
|
1521
|
-
images: JSON.parse(JSON.stringify(
|
|
1530
|
+
images: JSON.parse(JSON.stringify(c.value)),
|
|
1522
1531
|
labels: JSON.parse(JSON.stringify(g.value))
|
|
1523
1532
|
})
|
|
1524
1533
|
});
|
|
1525
1534
|
const it = () => {
|
|
1526
1535
|
if (r.value && r.value.getCurrentAnnotation) {
|
|
1527
1536
|
const y = r.value.getCurrentAnnotation();
|
|
1528
|
-
|
|
1537
|
+
c.value[u.value] && (c.value[u.value].annotations = y.annotations);
|
|
1529
1538
|
}
|
|
1530
|
-
|
|
1539
|
+
o.value = "gallery", l("pageChange", { nowPage: "listPage" });
|
|
1531
1540
|
}, nt = () => {
|
|
1532
|
-
|
|
1541
|
+
l("export", c.value);
|
|
1533
1542
|
}, ht = (y) => {
|
|
1534
|
-
u.value = y.currentIndex,
|
|
1543
|
+
u.value = y.currentIndex, c.value[y.currentIndex] && (c.value[y.currentIndex].annotations = y.currentAnnotations);
|
|
1535
1544
|
}, Q = (y) => {
|
|
1536
1545
|
if (r.value && r.value.getCurrentAnnotation) {
|
|
1537
1546
|
const b = r.value.getCurrentAnnotation();
|
|
1538
|
-
|
|
1547
|
+
c.value[u.value] && (c.value[u.value].annotations = b.annotations, l("update:images", c.value));
|
|
1539
1548
|
}
|
|
1540
|
-
},
|
|
1541
|
-
g.value = JSON.parse(JSON.stringify(y || [])),
|
|
1549
|
+
}, j = (y) => {
|
|
1550
|
+
g.value = JSON.parse(JSON.stringify(y || [])), l("update:labels", g.value);
|
|
1542
1551
|
};
|
|
1543
1552
|
return (y, b) => (v(), m("div", {
|
|
1544
1553
|
ref_key: "batchRootRef",
|
|
1545
|
-
ref:
|
|
1554
|
+
ref: k,
|
|
1546
1555
|
class: "batch-annotator"
|
|
1547
1556
|
}, [
|
|
1548
|
-
|
|
1557
|
+
o.value === "gallery" ? (v(), m("div", Rs, [
|
|
1549
1558
|
h("div", Hs, [
|
|
1550
|
-
h("div",
|
|
1551
|
-
h("table",
|
|
1559
|
+
h("div", Es, [
|
|
1560
|
+
h("table", Us, [
|
|
1552
1561
|
b[1] || (b[1] = h("thead", null, [
|
|
1553
1562
|
h("tr", null, [
|
|
1554
1563
|
h("th", null, "标签封面"),
|
|
@@ -1558,26 +1567,26 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
|
|
|
1558
1567
|
])
|
|
1559
1568
|
], -1)),
|
|
1560
1569
|
h("tbody", null, [
|
|
1561
|
-
(v(!0), m(N, null, J(p.value, (
|
|
1562
|
-
key:
|
|
1563
|
-
style:
|
|
1570
|
+
(v(!0), m(N, null, J(p.value, (I) => (v(), m("tr", {
|
|
1571
|
+
key: I.id,
|
|
1572
|
+
style: U(H(I))
|
|
1564
1573
|
}, [
|
|
1565
1574
|
h("td", null, [
|
|
1566
1575
|
h("div", Vs, [
|
|
1567
|
-
|
|
1576
|
+
I.cover ? (v(), m("img", {
|
|
1568
1577
|
key: 0,
|
|
1569
|
-
src:
|
|
1578
|
+
src: I.cover,
|
|
1570
1579
|
class: "label-cover"
|
|
1571
1580
|
}, null, 8, Os)) : (v(), m("div", {
|
|
1572
1581
|
key: 1,
|
|
1573
1582
|
class: "label-cover-empty",
|
|
1574
|
-
style:
|
|
1583
|
+
style: U({ backgroundColor: I.color })
|
|
1575
1584
|
}, null, 4))
|
|
1576
1585
|
])
|
|
1577
1586
|
]),
|
|
1578
|
-
h("td", null,
|
|
1579
|
-
h("td", null,
|
|
1580
|
-
h("td", null,
|
|
1587
|
+
h("td", null, z(I.name), 1),
|
|
1588
|
+
h("td", null, z(I.count), 1),
|
|
1589
|
+
h("td", null, z(I.percentage), 1)
|
|
1581
1590
|
], 4))), 128))
|
|
1582
1591
|
])
|
|
1583
1592
|
])
|
|
@@ -1588,15 +1597,15 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
|
|
|
1588
1597
|
ref: x,
|
|
1589
1598
|
class: "gallery-grid"
|
|
1590
1599
|
}, [
|
|
1591
|
-
(v(!0), m(N, null, J(
|
|
1600
|
+
(v(!0), m(N, null, J(c.value, (I, F) => (v(), m("div", {
|
|
1592
1601
|
key: F,
|
|
1593
1602
|
class: "gallery-item",
|
|
1594
|
-
onClick: (
|
|
1603
|
+
onClick: (E) => G(F, I)
|
|
1595
1604
|
}, [
|
|
1596
1605
|
h("div", Ws, [
|
|
1597
|
-
|
|
1598
|
-
src:
|
|
1599
|
-
annotations:
|
|
1606
|
+
R(Bs, {
|
|
1607
|
+
src: I.imageUrl,
|
|
1608
|
+
annotations: I.annotations || [],
|
|
1600
1609
|
labels: g.value,
|
|
1601
1610
|
fit: "cover",
|
|
1602
1611
|
strokeWidth: e.thumbStrokeWidth,
|
|
@@ -1604,8 +1613,8 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
|
|
|
1604
1613
|
}, null, 8, ["src", "annotations", "labels", "strokeWidth", "fontSize"])
|
|
1605
1614
|
]),
|
|
1606
1615
|
h("div", Gs, [
|
|
1607
|
-
h("span",
|
|
1608
|
-
h("span",
|
|
1616
|
+
h("span", Ys, "#" + z(F + 1), 1),
|
|
1617
|
+
h("span", Js, z((I.annotations || []).length) + " 标注", 1)
|
|
1609
1618
|
])
|
|
1610
1619
|
], 8, Ns))), 128))
|
|
1611
1620
|
], 512)
|
|
@@ -1615,20 +1624,20 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
|
|
|
1615
1624
|
D.value ? (v(), m("button", {
|
|
1616
1625
|
key: 0,
|
|
1617
1626
|
class: "action-btn primary",
|
|
1618
|
-
onClick: b[0] || (b[0] = (
|
|
1627
|
+
onClick: b[0] || (b[0] = (I) => O(0))
|
|
1619
1628
|
}, [
|
|
1620
|
-
|
|
1621
|
-
lt(" " +
|
|
1622
|
-
])) :
|
|
1623
|
-
|
|
1629
|
+
R(L, { name: "edit" }),
|
|
1630
|
+
lt(" " + z(q.value), 1)
|
|
1631
|
+
])) : B("", !0),
|
|
1632
|
+
_.value ? (v(), m("button", {
|
|
1624
1633
|
key: 1,
|
|
1625
1634
|
class: "action-btn success",
|
|
1626
1635
|
onClick: nt
|
|
1627
1636
|
}, [
|
|
1628
|
-
|
|
1629
|
-
lt(" " +
|
|
1630
|
-
])) :
|
|
1631
|
-
])) :
|
|
1637
|
+
R(L, { name: "download" }),
|
|
1638
|
+
lt(" " + z(C.value), 1)
|
|
1639
|
+
])) : B("", !0)
|
|
1640
|
+
])) : B("", !0)
|
|
1632
1641
|
])) : (v(), m("div", Xs, [
|
|
1633
1642
|
h("div", qs, [
|
|
1634
1643
|
h("div", Ks, [
|
|
@@ -1636,32 +1645,32 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
|
|
|
1636
1645
|
class: "back-btn",
|
|
1637
1646
|
onClick: it
|
|
1638
1647
|
}, [
|
|
1639
|
-
|
|
1648
|
+
R(L, {
|
|
1640
1649
|
name: "back",
|
|
1641
1650
|
class: "back-icon"
|
|
1642
1651
|
}),
|
|
1643
1652
|
b[2] || (b[2] = lt()),
|
|
1644
1653
|
b[3] || (b[3] = h("span", { class: "back-text" }, "返回", -1))
|
|
1645
1654
|
]),
|
|
1646
|
-
h("span", Zs, "正在标注: " +
|
|
1655
|
+
h("span", Zs, "正在标注: " + z(u.value + 1) + " / " + z(c.value.length), 1)
|
|
1647
1656
|
])
|
|
1648
1657
|
]),
|
|
1649
1658
|
h("div", Qs, [
|
|
1650
|
-
|
|
1659
|
+
R(bs, {
|
|
1651
1660
|
ref_key: "annotatorRef",
|
|
1652
1661
|
ref: r,
|
|
1653
|
-
batchImages:
|
|
1662
|
+
batchImages: c.value,
|
|
1654
1663
|
labels: g.value,
|
|
1655
1664
|
annotationTypes: ["rectangle", "polygon", "point", "rotatedRect", "category"],
|
|
1656
1665
|
onBatchChange: ht,
|
|
1657
1666
|
onAnnotationChange: Q,
|
|
1658
|
-
onLabelChange:
|
|
1667
|
+
onLabelChange: j
|
|
1659
1668
|
}, null, 8, ["batchImages", "labels"])
|
|
1660
1669
|
])
|
|
1661
1670
|
]))
|
|
1662
1671
|
], 512));
|
|
1663
1672
|
}
|
|
1664
|
-
}), ii = /* @__PURE__ */ rt(ti, [["__scopeId", "data-v-
|
|
1673
|
+
}), ii = /* @__PURE__ */ rt(ti, [["__scopeId", "data-v-701c81a6"]]);
|
|
1665
1674
|
export {
|
|
1666
1675
|
ii as BatchAnnotator,
|
|
1667
1676
|
bs as ImageAnnotator,
|