luo-image-annotator 0.0.19 → 0.0.20
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 +1 @@
|
|
|
1
|
-
.svg-icon[data-v-3928607b]{display:inline-flex;align-items:center;justify-content:center;width:1em;height:1em;fill:currentColor;font-style:normal;line-height:0;text-align:center;text-transform:none;vertical-align:-.125em;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.svg-icon[data-v-3928607b] svg{width:1em;height:1em;fill:currentColor}.size-small[data-v-3928607b]{font-size:12px}.size-large[data-v-3928607b]{font-size:20px}.annotation-container[data-v-08cbbaca]{display:flex;height:100%;width:100%;background:transparent;padding:12px;gap:12px;box-sizing:border-box;overflow:hidden;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif}.image-list-sidebar[data-v-08cbbaca]{width:200px;background:#fff;border-radius:12px;display:flex;flex-direction:column;box-shadow:0 4px 16px #00000014;border:1px solid #ebeef5;overflow:hidden;height:100%}.image-list-header[data-v-08cbbaca]{height:44px;display:flex;align-items:center;padding:0 16px;font-size:13px;color:#909399;background:#fafafa;border-bottom:1px solid #ebeef5;font-weight:500;flex-shrink:0}.image-list-scroll[data-v-08cbbaca]{flex:1;padding:12px;display:flex;flex-direction:column;gap:12px;overflow-y:auto}.image-list-scroll[data-v-08cbbaca]::-webkit-scrollbar{width:6px}.image-list-scroll[data-v-08cbbaca]::-webkit-scrollbar-track{background:transparent}.image-list-scroll[data-v-08cbbaca]::-webkit-scrollbar-thumb{background:#dcdfe6;border-radius:3px}.image-list-scroll[data-v-08cbbaca]::-webkit-scrollbar-thumb:hover{background:#c0c4cc}.image-list-item[data-v-08cbbaca]{border:2px solid transparent;border-radius:8px;background:#fff;padding:6px;display:flex;flex-direction:column;gap:8px;cursor:pointer;text-align:left;transition:all .2s ease;box-shadow:0 2px 6px #0000000a}.image-list-item[data-v-08cbbaca]:hover{border-color:#dcdfe6;transform:translateY(-1px);box-shadow:0 4px 12px #00000014}.image-list-item.active[data-v-08cbbaca]{border-color:#1677ff;background:#f0f7ff;box-shadow:0 4px 12px #1677ff26}.image-list-stage[data-v-08cbbaca]{width:100%;height:100px;position:relative;border-radius:4px;overflow:hidden;background:#e4e7ed}.image-list-thumb[data-v-08cbbaca]{width:100%;height:100%;object-fit:cover}.image-list-text[data-v-08cbbaca]{font-size:13px;color:#606266;padding:0 4px;font-weight:500}.thumb-overlay-layer[data-v-08cbbaca]{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none}.thumb-overlay-rect[data-v-08cbbaca]{position:absolute;border:1px solid;box-sizing:border-box;border-radius:2px}.thumb-overlay-svg[data-v-08cbbaca]{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%}.thumb-overlay-point[data-v-08cbbaca]{position:absolute;width:8px;height:8px;border-radius:50%;transform:translate(-50%,-50%);box-shadow:0 0 0 1px #fff}.thumb-overlay-rotated[data-v-08cbbaca]{position:absolute;border:1px solid;box-sizing:border-box;border-radius:2px;transform-origin:center center}.thumb-overlay-category[data-v-08cbbaca]{position:absolute;padding:2px 4px;border-radius:4px;color:#fff;font-size:10px;line-height:1;white-space:nowrap;transform:translate(-50%,-50%);box-shadow:0 1px 2px #0003;z-index:10}.center-sidebar[data-v-08cbbaca]{height:100%;display:flex;align-items:center}.left-sidebar[data-v-08cbbaca]{width:45px;background:#fff;border-radius:16px;display:flex;flex-direction:column;align-items:center;padding:16px 0;gap:12px;z-index:10;box-shadow:0 4px 16px #00000026;flex-shrink:0}.tool-btn[data-v-08cbbaca]{width:40px;height:40px;display:flex;align-items:center;justify-content:center;border-radius:8px;cursor:pointer;-webkit-user-select:none;user-select:none;font-size:20px;color:#606266;transition:all .2s ease}.tool-btn[data-v-08cbbaca]:hover{background:#f5f7fa;color:#1677ff}.tool-btn.active[data-v-08cbbaca]{background:#e6f4ff;color:#1677ff}.divider[data-v-08cbbaca]{width:60%;height:1px;background:#f0f2f5;margin:4px 0}.center-area[data-v-08cbbaca]{flex:1;display:flex;flex-direction:column;position:relative;overflow:hidden;background:#fff;border-radius:8px}.canvas-wrapper[data-v-08cbbaca]{flex:1;background:#fff;position:relative;overflow:hidden;overscroll-behavior:none;touch-action:none}.floating-label-selector[data-v-08cbbaca]{position:absolute;top:16px;left:50%;transform:translate(-50%);z-index:100;width:240px}.selector-trigger[data-v-08cbbaca]{display:flex;align-items:center;justify-content:space-between;height:40px;padding:0 16px;background:#fff;border-radius:20px;box-shadow:0 4px 12px #0000001a;cursor:pointer;border:1px solid #e4e7ed;transition:all .2s ease}.selector-trigger[data-v-08cbbaca]:hover{box-shadow:0 6px 16px #0000001f;border-color:#dcdfe6}.current-label[data-v-08cbbaca]{display:flex;align-items:center;gap:8px;flex:1;overflow:hidden}.current-label.empty .label-name[data-v-08cbbaca]{color:#909399}.color-dot[data-v-08cbbaca]{width:12px;height:12px;border-radius:50%;flex-shrink:0}.label-name[data-v-08cbbaca]{font-size:14px;color:#1f2329;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.arrow-icon[data-v-08cbbaca]{font-size:16px;color:#909399;transition:transform .3s ease}.arrow-icon.is-open[data-v-08cbbaca]{transform:rotate(90deg)}.selector-dropdown[data-v-08cbbaca]{position:absolute;top:calc(100% + 8px);left:0;width:100%;background:#fff;border-radius:12px;box-shadow:0 4px 20px #00000026;border:1px solid #e4e7ed;max-height:300px;overflow-y:auto;padding:8px;box-sizing:border-box}.dropdown-empty[data-v-08cbbaca]{padding:12px;text-align:center;color:#909399;font-size:13px}.dropdown-item[data-v-08cbbaca]{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:8px;cursor:pointer;transition:background .2s ease}.dropdown-item[data-v-08cbbaca]:hover{background:#f5f7fa}.dropdown-item.active[data-v-08cbbaca]{background:#e6f4ff}.dropdown-item .label-name[data-v-08cbbaca]{flex:1}.check-icon[data-v-08cbbaca]{font-size:16px;color:#1677ff}.batch-nav[data-v-08cbbaca]{height:56px;background:#fff;border-top:1px solid #f0f2f5;display:flex;justify-content:center;align-items:center;gap:16px;z-index:5;flex-shrink:0}.batch-nav .icon-btn[data-v-08cbbaca]{display:flex;align-items:center;justify-content:center;width:36px;height:36px;padding:0;background:transparent;border:none;border-radius:6px;cursor:pointer;font-size:20px;color:#606266;transition:all .2s}.batch-nav .icon-btn[data-v-08cbbaca]:hover:not(:disabled){color:#1677ff;background:#f5f7fa}.batch-nav .icon-btn[data-v-08cbbaca]:disabled{opacity:.3;cursor:not-allowed;background:transparent}.batch-nav span[data-v-08cbbaca]{font-size:14px;color:#1f2329;font-weight:500;min-width:60px;text-align:center}.right-sidebar[data-v-08cbbaca]{width:280px;background:#fff;border-radius:12px;display:flex;flex-direction:column;z-index:10;box-shadow:0 4px 16px #00000014;border:1px solid #ebeef5;flex-shrink:0;height:fit-content;max-height:100%;overflow:hidden}.sidebar-header[data-v-08cbbaca]{height:44px;padding:0 16px;border-bottom:1px solid #ebeef5;background:#fafafa;display:flex;justify-content:space-between;align-items:center;flex-shrink:0}.sidebar-header h3[data-v-08cbbaca]{margin:0;font-size:13px;color:#909399;font-weight:500}.add-btn[data-v-08cbbaca]{display:inline-flex;align-items:center;justify-content:center;padding:0;background:transparent;color:#1677ff;border:none;cursor:pointer;font-size:13px;font-weight:500;transition:all .2s}.add-btn[data-v-08cbbaca]:hover{color:#4096ff;text-decoration:underline}.label-list[data-v-08cbbaca]{flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:10px}.label-item[data-v-08cbbaca]{padding:10px 12px;border-radius:8px;border:1px solid transparent;transition:all .2s}.label-item[data-v-08cbbaca]:hover{box-shadow:0 2px 8px #00000014;transform:translateY(-1px)}.label-row[data-v-08cbbaca]{display:flex;align-items:center;gap:12px}.color-wrapper[data-v-08cbbaca]{width:18px;height:18px;border-radius:4px;cursor:pointer;flex-shrink:0;box-shadow:inset 0 0 0 1px #0000001a}.label-name[data-v-08cbbaca]{flex:1;font-size:14px;color:inherit;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.action-icon[data-v-08cbbaca]{cursor:pointer;font-size:18px;color:inherit;opacity:.7;-webkit-user-select:none;user-select:none;display:flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:6px;transition:all .2s}.action-icon[data-v-08cbbaca]:hover{opacity:1;background:#0000000d}.more-actions[data-v-08cbbaca]{position:relative}.more-actions .delete-btn[data-v-08cbbaca]{display:none;font-size:16px}.more-actions:hover .dots[data-v-08cbbaca]{display:none}.more-actions:hover .delete-btn[data-v-08cbbaca]{display:flex;color:#f53f3f}.more-actions[data-v-08cbbaca]:hover{background:#fff1f0}.modal-overlay[data-v-08cbbaca]{position:fixed;top:0;left:0;width:100%;height:100%;background:#00000073;display:flex;justify-content:center;align-items:center;z-index:1000;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}.modal-content[data-v-08cbbaca]{background:#fff;border-radius:12px;width:400px;box-shadow:0 8px 32px #0000001f;display:flex;flex-direction:column;overflow:hidden;animation:modal-fade-in-08cbbaca .2s ease-out}@keyframes modal-fade-in-08cbbaca{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}.modal-header[data-v-08cbbaca]{padding:16px 20px;border-bottom:1px solid #f0f2f5;display:flex;justify-content:space-between;align-items:center;background:#fafafa}.modal-header h3[data-v-08cbbaca]{margin:0;font-size:16px;color:#1f2329;font-weight:600}.modal-body[data-v-08cbbaca]{padding:24px 20px}.form-group[data-v-08cbbaca]{margin-bottom:20px}.form-group[data-v-08cbbaca]:last-child{margin-bottom:0}.form-group label[data-v-08cbbaca]{display:block;margin-bottom:8px;font-size:14px;color:#1f2329;font-weight:500}.required[data-v-08cbbaca]{color:#f53f3f;margin-left:4px}.modal-input[data-v-08cbbaca]{width:100%;padding:10px 12px;border:1px solid #dcdfe6;border-radius:6px;font-size:14px;box-sizing:border-box;transition:all .2s;color:#1f2329;outline:none}.modal-input[data-v-08cbbaca]:focus{border-color:#1677ff;box-shadow:0 0 0 2px #1677ff1a}.modal-input[data-v-08cbbaca]::placeholder{color:#c0c4cc}.color-input-wrapper[data-v-08cbbaca]{display:flex;align-items:center;gap:12px}.color-picker-box[data-v-08cbbaca]{width:32px;height:32px;border-radius:6px;cursor:pointer;box-shadow:inset 0 0 0 1px #0000001a;display:flex;align-items:center;justify-content:center;overflow:hidden;position:relative;transition:transform .1s}.color-picker-box[data-v-08cbbaca]:hover{transform:scale(1.05)}.modal-color-picker[data-v-08cbbaca]{position:absolute;width:200%;height:200%;top:-50%;left:-50%;opacity:0;cursor:pointer}.color-value[data-v-08cbbaca]{font-size:14px;color:#606266;font-family:monospace;background:#f5f7fa;padding:4px 8px;border-radius:4px;border:1px solid #ebeef5}.modal-actions[data-v-08cbbaca]{padding:16px 20px;display:flex;justify-content:flex-end;gap:12px;border-top:1px solid #f0f2f5;background:#fff}.cancel-btn[data-v-08cbbaca],.confirm-btn[data-v-08cbbaca]{padding:8px 20px;border-radius:6px;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;border:1px solid transparent}.cancel-btn[data-v-08cbbaca]{background:#fff;border-color:#dcdfe6;color:#606266}.cancel-btn[data-v-08cbbaca]:hover{color:#1677ff;border-color:#1677ff;background:#f0f7ff}.confirm-btn[data-v-08cbbaca]{background:#1677ff;color:#fff}.confirm-btn[data-v-08cbbaca]:hover:not(:disabled){background:#4096ff}.confirm-btn[data-v-08cbbaca]:disabled{background:#a0cfff;cursor:not-allowed}.thumbnail-wrapper[data-v-46e27181]{position:relative;width:100%;height:100%;overflow:hidden;border-radius:4px;background:#f0f0f0}.thumbnail-image[data-v-46e27181]{width:100%;height:100%;object-fit:cover;display:block}.annotation-overlay[data-v-46e27181]{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.loading-placeholder[data-v-46e27181]{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;color:#999;font-size:12px}.batch-annotator[data-v-1d13568a]{width:100%;display:flex;flex-direction:column;background:transparent;height:100%}.gallery-view[data-v-1d13568a]{flex:1;display:flex;flex-direction:column;overflow:hidden;padding:20px;position:relative;background:transparent}.gallery-layout[data-v-1d13568a]{display:flex;gap:20px;flex:1;min-height:0}.gallery-sidebar[data-v-1d13568a]{width:320px;flex-shrink:0;background:#fff;border-radius:8px;box-shadow:0 2px 8px #0000000d;padding:16px;height:fit-content;max-height:100%;overflow-y:auto}.label-stats-table[data-v-1d13568a]{width:100%;border-collapse:collapse;text-align:center;font-size:13px}.label-stats-table th[data-v-1d13568a]{color:#606266;font-weight:500;padding:12px 8px;background-color:#f5f7fa;border-bottom:1px solid #ebeef5}.label-stats-table th[data-v-1d13568a]:first-child{border-top-left-radius:6px;border-bottom-left-radius:6px}.label-stats-table th[data-v-1d13568a]:last-child{border-top-right-radius:6px;border-bottom-right-radius:6px}.label-stats-table td[data-v-1d13568a]{padding:12px 8px;vertical-align:middle}.label-stats-table tbody tr[data-v-1d13568a]{border-radius:6px;overflow:hidden}.label-stats-table tbody tr td[data-v-1d13568a]:first-child{border-top-left-radius:6px;border-bottom-left-radius:6px}.label-stats-table tbody tr td[data-v-1d13568a]:last-child{border-top-right-radius:6px;border-bottom-right-radius:6px}.label-cover-wrapper[data-v-1d13568a]{width:48px;height:32px;border-radius:4px;overflow:hidden;margin:0 auto;display:flex;align-items:center;justify-content:center;background:#f0f2f5}.label-cover[data-v-1d13568a]{width:100%;height:100%;object-fit:cover}.label-cover-empty[data-v-1d13568a]{width:100%;height:100%;opacity:.5}.gallery-content[data-v-1d13568a]{flex:1;overflow:hidden;display:flex;flex-direction:column}.gallery-header[data-v-1d13568a]{display:none}.gallery-grid[data-v-1d13568a]{flex:1;height:100%;display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:20px;overflow:auto;padding-bottom:80px}.gallery-item[data-v-1d13568a]{background:#fff;border-radius:8px;overflow:hidden;box-shadow:0 2px 8px #0000001a;cursor:pointer;transition:transform .2s,box-shadow .2s;display:flex;flex-direction:column;height:240px}.gallery-item[data-v-1d13568a]:hover{transform:translateY(-4px);box-shadow:0 4px 12px #00000026}.thumbnail-wrapper[data-v-1d13568a]{flex:1;overflow:hidden;position:relative}.img-meta[data-v-1d13568a]{padding:8px;font-size:12px;color:#666;display:flex;justify-content:space-between;background:#fff;border-top:1px solid #eee;height:32px;align-items:center}.bottom-bar[data-v-1d13568a]{position:absolute;bottom:0;left:0;width:100%;height:60px;background:#fff;border-top:1px solid #e0e0e0;display:flex;justify-content:space-between;align-items:center;padding:0 40px;box-shadow:0 -2px 10px #0000000d;z-index:100}.action-btn[data-v-1d13568a]{display:flex;align-items:center;gap:8px;padding:10px 24px;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:background .2s}.action-btn.primary[data-v-1d13568a]{background:#2196f3;color:#fff}.action-btn.primary[data-v-1d13568a]:hover{background:#1976d2}.action-btn.success[data-v-1d13568a]{background:#4caf50;color:#fff}.action-btn.success[data-v-1d13568a]:hover{background:#388e3c}.editor-view[data-v-1d13568a]{flex:1;display:flex;flex-direction:column;min-height:0;background:transparent}.editor-header[data-v-1d13568a]{height:54px;background:#fff;border-bottom:1px solid #f0f2f5;display:flex;align-items:center;padding:0 20px;justify-content:space-between;flex-shrink:0;z-index:5}.header-left[data-v-1d13568a]{display:flex;align-items:center;gap:16px}.editor-title[data-v-1d13568a]{font-size:14px;font-weight:500;color:#1f2329}.back-btn[data-v-1d13568a]{display:inline-flex;align-items:center;justify-content:center;gap:4px;background:transparent;border:none;padding:0;cursor:pointer;font-size:14px;color:#606266;transition:all .2s;font-weight:500}.back-btn[data-v-1d13568a]:hover{color:#1677ff}.back-icon[data-v-1d13568a]{font-size:16px}.editor-content[data-v-1d13568a]{flex:1;overflow:hidden;position:relative;min-height:0}
|
|
1
|
+
.svg-icon[data-v-3928607b]{display:inline-flex;align-items:center;justify-content:center;width:1em;height:1em;fill:currentColor;font-style:normal;line-height:0;text-align:center;text-transform:none;vertical-align:-.125em;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.svg-icon[data-v-3928607b] svg{width:1em;height:1em;fill:currentColor}.size-small[data-v-3928607b]{font-size:12px}.size-large[data-v-3928607b]{font-size:20px}.annotation-container[data-v-08cbbaca]{display:flex;height:100%;width:100%;background:transparent;padding:12px;gap:12px;box-sizing:border-box;overflow:hidden;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif}.image-list-sidebar[data-v-08cbbaca]{width:200px;background:#fff;border-radius:12px;display:flex;flex-direction:column;box-shadow:0 4px 16px #00000014;border:1px solid #ebeef5;overflow:hidden;height:100%}.image-list-header[data-v-08cbbaca]{height:44px;display:flex;align-items:center;padding:0 16px;font-size:13px;color:#909399;background:#fafafa;border-bottom:1px solid #ebeef5;font-weight:500;flex-shrink:0}.image-list-scroll[data-v-08cbbaca]{flex:1;padding:12px;display:flex;flex-direction:column;gap:12px;overflow-y:auto}.image-list-scroll[data-v-08cbbaca]::-webkit-scrollbar{width:6px}.image-list-scroll[data-v-08cbbaca]::-webkit-scrollbar-track{background:transparent}.image-list-scroll[data-v-08cbbaca]::-webkit-scrollbar-thumb{background:#dcdfe6;border-radius:3px}.image-list-scroll[data-v-08cbbaca]::-webkit-scrollbar-thumb:hover{background:#c0c4cc}.image-list-item[data-v-08cbbaca]{border:2px solid transparent;border-radius:8px;background:#fff;padding:6px;display:flex;flex-direction:column;gap:8px;cursor:pointer;text-align:left;transition:all .2s ease;box-shadow:0 2px 6px #0000000a}.image-list-item[data-v-08cbbaca]:hover{border-color:#dcdfe6;transform:translateY(-1px);box-shadow:0 4px 12px #00000014}.image-list-item.active[data-v-08cbbaca]{border-color:#1677ff;background:#f0f7ff;box-shadow:0 4px 12px #1677ff26}.image-list-stage[data-v-08cbbaca]{width:100%;height:100px;position:relative;border-radius:4px;overflow:hidden;background:#e4e7ed}.image-list-thumb[data-v-08cbbaca]{width:100%;height:100%;object-fit:cover}.image-list-text[data-v-08cbbaca]{font-size:13px;color:#606266;padding:0 4px;font-weight:500}.thumb-overlay-layer[data-v-08cbbaca]{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none}.thumb-overlay-rect[data-v-08cbbaca]{position:absolute;border:1px solid;box-sizing:border-box;border-radius:2px}.thumb-overlay-svg[data-v-08cbbaca]{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%}.thumb-overlay-point[data-v-08cbbaca]{position:absolute;width:8px;height:8px;border-radius:50%;transform:translate(-50%,-50%);box-shadow:0 0 0 1px #fff}.thumb-overlay-rotated[data-v-08cbbaca]{position:absolute;border:1px solid;box-sizing:border-box;border-radius:2px;transform-origin:center center}.thumb-overlay-category[data-v-08cbbaca]{position:absolute;padding:2px 4px;border-radius:4px;color:#fff;font-size:10px;line-height:1;white-space:nowrap;transform:translate(-50%,-50%);box-shadow:0 1px 2px #0003;z-index:10}.center-sidebar[data-v-08cbbaca]{height:100%;display:flex;align-items:center}.left-sidebar[data-v-08cbbaca]{width:45px;background:#fff;border-radius:16px;display:flex;flex-direction:column;align-items:center;padding:16px 0;gap:12px;z-index:10;box-shadow:0 4px 16px #00000026;flex-shrink:0}.tool-btn[data-v-08cbbaca]{width:40px;height:40px;display:flex;align-items:center;justify-content:center;border-radius:8px;cursor:pointer;-webkit-user-select:none;user-select:none;font-size:20px;color:#606266;transition:all .2s ease}.tool-btn[data-v-08cbbaca]:hover{background:#f5f7fa;color:#1677ff}.tool-btn.active[data-v-08cbbaca]{background:#e6f4ff;color:#1677ff}.divider[data-v-08cbbaca]{width:60%;height:1px;background:#f0f2f5;margin:4px 0}.center-area[data-v-08cbbaca]{flex:1;display:flex;flex-direction:column;position:relative;overflow:hidden;background:#fff;border-radius:8px}.canvas-wrapper[data-v-08cbbaca]{flex:1;background:#fff;position:relative;overflow:hidden;overscroll-behavior:none;touch-action:none}.floating-label-selector[data-v-08cbbaca]{position:absolute;top:16px;left:50%;transform:translate(-50%);z-index:100;width:240px}.selector-trigger[data-v-08cbbaca]{display:flex;align-items:center;justify-content:space-between;height:40px;padding:0 16px;background:#fff;border-radius:20px;box-shadow:0 4px 12px #0000001a;cursor:pointer;border:1px solid #e4e7ed;transition:all .2s ease}.selector-trigger[data-v-08cbbaca]:hover{box-shadow:0 6px 16px #0000001f;border-color:#dcdfe6}.current-label[data-v-08cbbaca]{display:flex;align-items:center;gap:8px;flex:1;overflow:hidden}.current-label.empty .label-name[data-v-08cbbaca]{color:#909399}.color-dot[data-v-08cbbaca]{width:12px;height:12px;border-radius:50%;flex-shrink:0}.label-name[data-v-08cbbaca]{font-size:14px;color:#1f2329;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.arrow-icon[data-v-08cbbaca]{font-size:16px;color:#909399;transition:transform .3s ease}.arrow-icon.is-open[data-v-08cbbaca]{transform:rotate(90deg)}.selector-dropdown[data-v-08cbbaca]{position:absolute;top:calc(100% + 8px);left:0;width:100%;background:#fff;border-radius:12px;box-shadow:0 4px 20px #00000026;border:1px solid #e4e7ed;max-height:300px;overflow-y:auto;padding:8px;box-sizing:border-box}.dropdown-empty[data-v-08cbbaca]{padding:12px;text-align:center;color:#909399;font-size:13px}.dropdown-item[data-v-08cbbaca]{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:8px;cursor:pointer;transition:background .2s ease}.dropdown-item[data-v-08cbbaca]:hover{background:#f5f7fa}.dropdown-item.active[data-v-08cbbaca]{background:#e6f4ff}.dropdown-item .label-name[data-v-08cbbaca]{flex:1}.check-icon[data-v-08cbbaca]{font-size:16px;color:#1677ff}.batch-nav[data-v-08cbbaca]{height:56px;background:#fff;border-top:1px solid #f0f2f5;display:flex;justify-content:center;align-items:center;gap:16px;z-index:5;flex-shrink:0}.batch-nav .icon-btn[data-v-08cbbaca]{display:flex;align-items:center;justify-content:center;width:36px;height:36px;padding:0;background:transparent;border:none;border-radius:6px;cursor:pointer;font-size:20px;color:#606266;transition:all .2s}.batch-nav .icon-btn[data-v-08cbbaca]:hover:not(:disabled){color:#1677ff;background:#f5f7fa}.batch-nav .icon-btn[data-v-08cbbaca]:disabled{opacity:.3;cursor:not-allowed;background:transparent}.batch-nav span[data-v-08cbbaca]{font-size:14px;color:#1f2329;font-weight:500;min-width:60px;text-align:center}.right-sidebar[data-v-08cbbaca]{width:280px;background:#fff;border-radius:12px;display:flex;flex-direction:column;z-index:10;box-shadow:0 4px 16px #00000014;border:1px solid #ebeef5;flex-shrink:0;height:fit-content;max-height:100%;overflow:hidden}.sidebar-header[data-v-08cbbaca]{height:44px;padding:0 16px;border-bottom:1px solid #ebeef5;background:#fafafa;display:flex;justify-content:space-between;align-items:center;flex-shrink:0}.sidebar-header h3[data-v-08cbbaca]{margin:0;font-size:13px;color:#909399;font-weight:500}.add-btn[data-v-08cbbaca]{display:inline-flex;align-items:center;justify-content:center;padding:0;background:transparent;color:#1677ff;border:none;cursor:pointer;font-size:13px;font-weight:500;transition:all .2s}.add-btn[data-v-08cbbaca]:hover{color:#4096ff;text-decoration:underline}.label-list[data-v-08cbbaca]{flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:10px}.label-item[data-v-08cbbaca]{padding:10px 12px;border-radius:8px;border:1px solid transparent;transition:all .2s}.label-item[data-v-08cbbaca]:hover{box-shadow:0 2px 8px #00000014;transform:translateY(-1px)}.label-row[data-v-08cbbaca]{display:flex;align-items:center;gap:12px}.color-wrapper[data-v-08cbbaca]{width:18px;height:18px;border-radius:4px;cursor:pointer;flex-shrink:0;box-shadow:inset 0 0 0 1px #0000001a}.label-name[data-v-08cbbaca]{flex:1;font-size:14px;color:inherit;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.action-icon[data-v-08cbbaca]{cursor:pointer;font-size:18px;color:inherit;opacity:.7;-webkit-user-select:none;user-select:none;display:flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:6px;transition:all .2s}.action-icon[data-v-08cbbaca]:hover{opacity:1;background:#0000000d}.more-actions[data-v-08cbbaca]{position:relative}.more-actions .delete-btn[data-v-08cbbaca]{display:none;font-size:16px}.more-actions:hover .dots[data-v-08cbbaca]{display:none}.more-actions:hover .delete-btn[data-v-08cbbaca]{display:flex;color:#f53f3f}.more-actions[data-v-08cbbaca]:hover{background:#fff1f0}.modal-overlay[data-v-08cbbaca]{position:fixed;top:0;left:0;width:100%;height:100%;background:#00000073;display:flex;justify-content:center;align-items:center;z-index:1000;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}.modal-content[data-v-08cbbaca]{background:#fff;border-radius:12px;width:400px;box-shadow:0 8px 32px #0000001f;display:flex;flex-direction:column;overflow:hidden;animation:modal-fade-in-08cbbaca .2s ease-out}@keyframes modal-fade-in-08cbbaca{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}.modal-header[data-v-08cbbaca]{padding:16px 20px;border-bottom:1px solid #f0f2f5;display:flex;justify-content:space-between;align-items:center;background:#fafafa}.modal-header h3[data-v-08cbbaca]{margin:0;font-size:16px;color:#1f2329;font-weight:600}.modal-body[data-v-08cbbaca]{padding:24px 20px}.form-group[data-v-08cbbaca]{margin-bottom:20px}.form-group[data-v-08cbbaca]:last-child{margin-bottom:0}.form-group label[data-v-08cbbaca]{display:block;margin-bottom:8px;font-size:14px;color:#1f2329;font-weight:500}.required[data-v-08cbbaca]{color:#f53f3f;margin-left:4px}.modal-input[data-v-08cbbaca]{width:100%;padding:10px 12px;border:1px solid #dcdfe6;border-radius:6px;font-size:14px;box-sizing:border-box;transition:all .2s;color:#1f2329;outline:none}.modal-input[data-v-08cbbaca]:focus{border-color:#1677ff;box-shadow:0 0 0 2px #1677ff1a}.modal-input[data-v-08cbbaca]::placeholder{color:#c0c4cc}.color-input-wrapper[data-v-08cbbaca]{display:flex;align-items:center;gap:12px}.color-picker-box[data-v-08cbbaca]{width:32px;height:32px;border-radius:6px;cursor:pointer;box-shadow:inset 0 0 0 1px #0000001a;display:flex;align-items:center;justify-content:center;overflow:hidden;position:relative;transition:transform .1s}.color-picker-box[data-v-08cbbaca]:hover{transform:scale(1.05)}.modal-color-picker[data-v-08cbbaca]{position:absolute;width:200%;height:200%;top:-50%;left:-50%;opacity:0;cursor:pointer}.color-value[data-v-08cbbaca]{font-size:14px;color:#606266;font-family:monospace;background:#f5f7fa;padding:4px 8px;border-radius:4px;border:1px solid #ebeef5}.modal-actions[data-v-08cbbaca]{padding:16px 20px;display:flex;justify-content:flex-end;gap:12px;border-top:1px solid #f0f2f5;background:#fff}.cancel-btn[data-v-08cbbaca],.confirm-btn[data-v-08cbbaca]{padding:8px 20px;border-radius:6px;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;border:1px solid transparent}.cancel-btn[data-v-08cbbaca]{background:#fff;border-color:#dcdfe6;color:#606266}.cancel-btn[data-v-08cbbaca]:hover{color:#1677ff;border-color:#1677ff;background:#f0f7ff}.confirm-btn[data-v-08cbbaca]{background:#1677ff;color:#fff}.confirm-btn[data-v-08cbbaca]:hover:not(:disabled){background:#4096ff}.confirm-btn[data-v-08cbbaca]:disabled{background:#a0cfff;cursor:not-allowed}.thumbnail-wrapper[data-v-46e27181]{position:relative;width:100%;height:100%;overflow:hidden;border-radius:4px;background:#f0f0f0}.thumbnail-image[data-v-46e27181]{width:100%;height:100%;object-fit:cover;display:block}.annotation-overlay[data-v-46e27181]{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.loading-placeholder[data-v-46e27181]{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;color:#999;font-size:12px}.batch-annotator[data-v-13881d5c]{width:100%;display:flex;flex-direction:column;background:transparent;height:100%}.gallery-view[data-v-13881d5c]{flex:1;display:flex;flex-direction:column;overflow:hidden;padding:20px;position:relative;background:transparent}.gallery-layout[data-v-13881d5c]{display:flex;gap:20px;flex:1;min-height:0}.gallery-sidebar[data-v-13881d5c]{width:320px;flex-shrink:0;background:#fff;border-radius:8px;box-shadow:0 2px 8px #0000000d;padding:16px;height:fit-content;max-height:100%;overflow-y:auto}.gallery-sidebar[data-v-13881d5c]::-webkit-scrollbar{width:6px}.gallery-sidebar[data-v-13881d5c]::-webkit-scrollbar-track{background:transparent}.gallery-sidebar[data-v-13881d5c]::-webkit-scrollbar-thumb{background:#dcdfe6;border-radius:3px}.gallery-sidebar[data-v-13881d5c]::-webkit-scrollbar-thumb:hover{background:#c0c4cc}.label-stats-table[data-v-13881d5c]{width:100%;border-collapse:collapse;text-align:center;font-size:13px}.label-stats-table th[data-v-13881d5c]{color:#606266;font-weight:500;padding:12px 8px;background-color:#f5f7fa;border-bottom:1px solid #ebeef5}.label-stats-table th[data-v-13881d5c]:first-child{border-top-left-radius:6px;border-bottom-left-radius:6px}.label-stats-table th[data-v-13881d5c]:last-child{border-top-right-radius:6px;border-bottom-right-radius:6px}.label-stats-table td[data-v-13881d5c]{padding:12px 8px;vertical-align:middle}.label-stats-table tbody tr[data-v-13881d5c]{border-radius:6px;overflow:hidden}.label-stats-table tbody tr td[data-v-13881d5c]:first-child{border-top-left-radius:6px;border-bottom-left-radius:6px}.label-stats-table tbody tr td[data-v-13881d5c]:last-child{border-top-right-radius:6px;border-bottom-right-radius:6px}.label-cover-wrapper[data-v-13881d5c]{width:48px;height:32px;border-radius:4px;overflow:hidden;margin:0 auto;display:flex;align-items:center;justify-content:center;background:#f0f2f5}.label-cover[data-v-13881d5c]{width:100%;height:100%;object-fit:cover}.label-cover-empty[data-v-13881d5c]{width:100%;height:100%;opacity:.5}.gallery-content[data-v-13881d5c]{flex:1;overflow:hidden;display:flex;flex-direction:column}.gallery-header[data-v-13881d5c]{display:none}.gallery-grid[data-v-13881d5c]{flex:1;height:100%;display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:20px;overflow:auto;padding-bottom:80px}.gallery-grid[data-v-13881d5c]::-webkit-scrollbar{width:6px}.gallery-grid[data-v-13881d5c]::-webkit-scrollbar-track{background:transparent}.gallery-grid[data-v-13881d5c]::-webkit-scrollbar-thumb{background:#dcdfe6;border-radius:3px}.gallery-grid[data-v-13881d5c]::-webkit-scrollbar-thumb:hover{background:#c0c4cc}.gallery-item[data-v-13881d5c]{background:#fff;border-radius:8px;overflow:hidden;box-shadow:0 2px 8px #0000001a;cursor:pointer;transition:transform .2s,box-shadow .2s;display:flex;flex-direction:column;height:240px}.gallery-item[data-v-13881d5c]:hover{transform:translateY(-4px);box-shadow:0 4px 12px #00000026}.thumbnail-wrapper[data-v-13881d5c]{flex:1;overflow:hidden;position:relative}.img-meta[data-v-13881d5c]{padding:8px;font-size:12px;color:#666;display:flex;justify-content:space-between;background:#fff;border-top:1px solid #eee;height:32px;align-items:center}.bottom-bar[data-v-13881d5c]{position:absolute;bottom:0;left:0;width:100%;height:60px;background:#fff;border-top:1px solid #e0e0e0;display:flex;justify-content:space-between;align-items:center;padding:0 40px;box-shadow:0 -2px 10px #0000000d;z-index:100}.action-btn[data-v-13881d5c]{display:flex;align-items:center;gap:8px;padding:10px 24px;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:background .2s}.action-btn.primary[data-v-13881d5c]{background:#2196f3;color:#fff}.action-btn.primary[data-v-13881d5c]:hover{background:#1976d2}.action-btn.success[data-v-13881d5c]{background:#4caf50;color:#fff}.action-btn.success[data-v-13881d5c]:hover{background:#388e3c}.editor-view[data-v-13881d5c]{flex:1;display:flex;flex-direction:column;min-height:0;background:transparent}.editor-header[data-v-13881d5c]{height:54px;background:#fff;border-bottom:1px solid #f0f2f5;display:flex;align-items:center;padding:0 20px;justify-content:space-between;flex-shrink:0;z-index:5}.header-left[data-v-13881d5c]{display:flex;align-items:center;gap:16px}.editor-title[data-v-13881d5c]{font-size:14px;font-weight:500;color:#1f2329}.back-btn[data-v-13881d5c]{display:inline-flex;align-items:center;justify-content:center;gap:4px;background:transparent;border:none;padding:0;cursor:pointer;font-size:14px;color:#606266;transition:all .2s;font-weight:500}.back-btn[data-v-13881d5c]:hover{color:#1677ff}.back-icon[data-v-13881d5c]{font-size:16px}.editor-content[data-v-13881d5c]{flex:1;overflow:hidden;position:relative;min-height:0}
|
|
@@ -1723,7 +1723,7 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
|
|
|
1723
1723
|
]))
|
|
1724
1724
|
], 512));
|
|
1725
1725
|
}
|
|
1726
|
-
}), ii = /* @__PURE__ */ rt(ti, [["__scopeId", "data-v-
|
|
1726
|
+
}), ii = /* @__PURE__ */ rt(ti, [["__scopeId", "data-v-13881d5c"]]);
|
|
1727
1727
|
export {
|
|
1728
1728
|
ii as BatchAnnotator,
|
|
1729
1729
|
bs as ImageAnnotator,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(T,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(T=typeof globalThis<"u"?globalThis:T||self,t(T.VueImageAnnotator={},T.Vue))})(this,(function(T,t){"use strict";var Tn=Object.defineProperty;var Dn=(T,t,H)=>t in T?Tn(T,t,{enumerable:!0,configurable:!0,writable:!0,value:H}):T[t]=H;var E=(T,t,H)=>Dn(T,typeof t!="symbol"?t+"":t,H);const H=(w,e)=>Math.sqrt(Math.pow(w.x-e.x,2)+Math.pow(w.y-e.y,2)),ht=(w,e)=>{let a=!1;for(let n=0,c=e.length-1;n<e.length;c=n++){const i=e[n].x,l=e[n].y,g=e[c].x,m=e[c].y;l>w.y!=m>w.y&&w.x<(g-i)*(w.y-l)/(m-l)+i&&(a=!a)}return a},et=(w,e,a)=>{const n=a*(Math.PI/180),c=Math.cos(n),i=Math.sin(n),l=w.x-e.x,g=w.y-e.y;return{x:e.x+(l*c-g*i),y:e.y+(l*i+g*c)}};class dt{constructor(e){E(this,"canvas");E(this,"ctx");E(this,"img");E(this,"annotations",[]);E(this,"currentTool",null);E(this,"interactionMode","none");E(this,"activeAnnotation",null);E(this,"hoverAnnotation",null);E(this,"isDrawing",!1);E(this,"isDragging",!1);E(this,"isPanning",!1);E(this,"panStartPoint",null);E(this,"dragStartPoint",null);E(this,"dragStartAnnotation",null);E(this,"lastMouseMovePoint",null);E(this,"isHoveringStartPoint",!1);E(this,"currentLabelColor","#FF4081");E(this,"visibleLabels",new Set);E(this,"selectedHandleIndex",-1);E(this,"hoverHandleIndex",-1);E(this,"scale",1);E(this,"offset",{x:0,y:0});E(this,"showLabels",!1);E(this,"listeners",{});E(this,"imageUrl","");this.canvas=e;const a=e.getContext("2d");if(!a)throw new Error("Could not get 2d context");this.ctx=a,this.img=new Image,this.img.crossOrigin="Anonymous",this.img.onload=()=>{this.fitImageToCanvas(),this.render()},this.bindEvents()}on(e,a){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(a)}emit(e,a){this.listeners[e]&&this.listeners[e].forEach(n=>n(a))}loadImage(e){this.imageUrl=e,this.img.src=e,this.activeAnnotation=null,this.isDrawing=!1}setAnnotations(e){this.annotations=JSON.parse(JSON.stringify(e)),this.render()}getAnnotations(){return this.annotations}setTool(e){e==="pan"?(this.interactionMode="pan",this.currentTool=null,this.isPanning=!1,this.canvas.style.cursor="grab"):e==="select"?(this.interactionMode="select",this.currentTool=null,this.canvas.style.cursor="default"):e?(this.interactionMode="draw",this.currentTool=e,this.canvas.style.cursor="crosshair"):(this.interactionMode="none",this.currentTool=null,this.canvas.style.cursor="default"),this.activeAnnotation=null,this.isDrawing=!1,this.render()}setLabelStyle(e){this.currentLabelColor=e}setVisibleLabels(e){this.visibleLabels=new Set(e),this.render()}setShowLabels(e){this.showLabels=e,this.render()}zoom(e){const n=e>0?this.scale*1.1:this.scale/1.1;if(n<.1||n>10)return;const c=this.canvas.width/2,i=this.canvas.height/2,l=this.toImageCoords(c,i);this.scale=n,this.offset.x=c-l.x*this.scale,this.offset.y=i-l.y*this.scale,this.clampViewportOffset(),this.render()}resize(){this.fitImageToCanvas(),this.render()}toImageCoords(e,a){return{x:(e-this.offset.x)/this.scale,y:(a-this.offset.y)/this.scale}}toScreenCoords(e,a){return{x:e*this.scale+this.offset.x,y:a*this.scale+this.offset.y}}fitImageToCanvas(){const e=this.canvas.parentElement;if(e){if(this.canvas.width=e.clientWidth,this.canvas.height=e.clientHeight,this.img.width===0)return;const a=this.canvas.width/this.img.width,n=this.canvas.height/this.img.height;this.scale=Math.min(a,n),this.offset.x=(this.canvas.width-this.img.width*this.scale)/2,this.offset.y=(this.canvas.height-this.img.height*this.scale)/2,this.clampViewportOffset()}}clampViewportOffset(){if(this.img.width===0||this.img.height===0)return;const e=this.img.width*this.scale,a=this.img.height*this.scale,n=100;if(e<=this.canvas.width){const c=-e+n,i=this.canvas.width-n;this.offset.x=Math.min(i,Math.max(c,this.offset.x))}else{const c=this.canvas.width-e-n,i=n;this.offset.x=Math.min(i,Math.max(c,this.offset.x))}if(a<=this.canvas.height){const c=-a+n,i=this.canvas.height-n;this.offset.y=Math.min(i,Math.max(c,this.offset.y))}else{const c=this.canvas.height-a-n,i=n;this.offset.y=Math.min(i,Math.max(c,this.offset.y))}}bindEvents(){this.canvas.addEventListener("mousedown",this.handleMouseDown.bind(this)),this.canvas.addEventListener("mousemove",this.handleMouseMove.bind(this)),this.canvas.addEventListener("mouseup",this.handleMouseUp.bind(this)),this.canvas.addEventListener("mouseleave",this.handleMouseUp.bind(this)),window.addEventListener("keydown",this.handleKeyDown.bind(this))}handleKeyDown(e){this.interactionMode==="select"&&(e.key==="Delete"||e.key==="Backspace")&&this.activeAnnotation&&this.deleteAnnotation(this.activeAnnotation.id)}deleteAnnotation(e){const a=this.annotations.findIndex(n=>n.id===e);if(a>-1){const n=this.annotations[a];this.annotations.splice(a,1),this.activeAnnotation=null,this.emit("annotationChange",{action:"delete",changedItem:n,imageUrl:this.imageUrl}),this.render()}}handleMouseDown(e){const a=this.canvas.getBoundingClientRect(),n=e.clientX-a.left,c=e.clientY-a.top,i=this.toImageCoords(n,c);if(this.interactionMode==="pan"){this.isPanning=!0,this.panStartPoint={x:n,y:c},this.canvas.style.cursor="grabbing";return}if(this.interactionMode==="select"&&this.activeAnnotation){const m=this.getHitHandle(n,c,this.activeAnnotation);if(m!==-100){this.isDragging=!0,this.dragStartPoint=i,this.selectedHandleIndex=m,this.dragStartAnnotation=JSON.parse(JSON.stringify(this.activeAnnotation));return}}const l=this.interactionMode==="select"?this.getHitCategory(n,c):null;if(l){this.activeAnnotation=l,this.isDragging=!1,this.selectedHandleIndex=-1,this.emit("annotationChange",{action:"select",changedItem:l,imageUrl:this.imageUrl}),this.render();return}const g=this.getHitAnnotation(i);if(this.interactionMode==="select"){if(g){if(!(this.visibleLabels.size>0&&!this.visibleLabels.has(g.label))){this.activeAnnotation=g,this.isDragging=!0,this.dragStartPoint=i,this.selectedHandleIndex=-1,this.dragStartAnnotation=JSON.parse(JSON.stringify(g)),this.emit("annotationChange",{action:"select",changedItem:g,imageUrl:this.imageUrl}),this.render();return}}else this.activeAnnotation=null,this.emit("annotationChange",{action:"select",changedItem:void 0,imageUrl:this.imageUrl}),this.render();return}if(this.interactionMode==="draw"){if(this.isDrawing&&this.currentTool==="polygon"&&this.activeAnnotation){const m=this.activeAnnotation.coordinates;if(m.points.length>2&&H(i,m.points[0])<20/this.scale){this.finishDrawing();return}this.startDrawing(i);return}if(this.currentTool){if(this.currentTool==="polygon"&&!this.isDrawing){this.startDrawing(i);return}this.startDrawing(i)}return}this.activeAnnotation=null,this.render()}handleMouseMove(e){const a=this.canvas.getBoundingClientRect(),n=e.clientX-a.left,c=e.clientY-a.top,i=this.toImageCoords(n,c);if(this.isPanning&&this.panStartPoint){const l=n-this.panStartPoint.x,g=c-this.panStartPoint.y;this.offset.x+=l,this.offset.y+=g,this.clampViewportOffset(),this.panStartPoint={x:n,y:c},this.render();return}if(this.lastMouseMovePoint=i,this.isDrawing){if(this.currentTool==="polygon"&&this.activeAnnotation){const l=this.activeAnnotation.coordinates;if(l.points.length>2){const g=l.points[0],m=H(i,g);this.isHoveringStartPoint=m<20/this.scale}else this.isHoveringStartPoint=!1}this.updateDrawing(i)}else this.isDragging&&this.activeAnnotation&&this.dragStartPoint?this.updateDragging(i):this.checkHover(n,c,i);this.render()}handleMouseUp(e){if(this.isPanning){this.isPanning=!1,this.panStartPoint=null,this.canvas.style.cursor="grab";return}if(this.isDrawing){if(this.currentTool==="polygon"){this.render();return}this.finishDrawing()}else this.isDragging&&this.activeAnnotation&&this.emit("annotationChange",{action:"update",changedItem:this.activeAnnotation,imageUrl:this.imageUrl});this.currentTool!=="polygon"&&(this.isDrawing=!1),this.isDragging=!1,this.dragStartPoint=null,this.selectedHandleIndex=-1,this.render()}hexToRgba(e,a){if(!e.startsWith("#"))return e;const n=parseInt(e.slice(1,3),16),c=parseInt(e.slice(3,5),16),i=parseInt(e.slice(5,7),16);return`rgba(${n}, ${c}, ${i}, ${a})`}startDrawing(e){if(!this.currentTool)return;const a=Date.now().toString();if(this.hexToRgba(this.currentLabelColor,.2),this.currentLabelColor,this.currentTool==="rectangle")this.isDrawing=!0,this.dragStartPoint=e,this.activeAnnotation={id:a,type:"rectangle",label:"",coordinates:{x1:e.x,y1:e.y,x2:e.x,y2:e.y},style:{strokeColor:this.currentLabelColor}};else if(this.currentTool==="point"){const n={id:a,type:"point",label:"",coordinates:{points:[e]},style:{strokeColor:this.currentLabelColor}};this.annotations.push(n),this.emit("annotationChange",{action:"add",changedItem:n,imageUrl:this.imageUrl}),this.activeAnnotation=n}else if(this.currentTool==="polygon")this.activeAnnotation&&this.activeAnnotation.type==="polygon"&&this.isDrawing?this.activeAnnotation.coordinates.points.push(e):(this.isDrawing=!0,this.activeAnnotation={id:a,type:"polygon",label:"",coordinates:{points:[e]},style:{strokeColor:this.currentLabelColor}});else if(this.currentTool==="category"){const n={id:a,type:"category",label:"",coordinates:{x:e.x,y:e.y},style:{strokeColor:this.currentLabelColor}};this.annotations.push(n),this.emit("annotationChange",{action:"add",changedItem:n,imageUrl:this.imageUrl}),this.activeAnnotation=n}else this.currentTool==="rotatedRect"&&(this.isDrawing=!0,this.dragStartPoint=e,this.activeAnnotation={id:a,type:"rotatedRect",label:"",coordinates:{x:e.x,y:e.y,width:0,height:0,angle:0},style:{strokeColor:this.currentLabelColor}})}updateDrawing(e){if(this.activeAnnotation)if(this.activeAnnotation.type==="rectangle"&&this.dragStartPoint){const a=this.activeAnnotation.coordinates;a.x2=e.x,a.y2=e.y}else if(this.activeAnnotation.type==="rotatedRect"&&this.dragStartPoint){const a=this.activeAnnotation.coordinates,n=Math.abs(e.x-this.dragStartPoint.x),c=Math.abs(e.y-this.dragStartPoint.y);a.width=n*2,a.height=c*2}else this.activeAnnotation.type}finishDrawing(){if(this.activeAnnotation){if(this.activeAnnotation.type==="rectangle"){const e=this.activeAnnotation.coordinates;if(Math.abs(e.x1-e.x2)<2||Math.abs(e.y1-e.y2)<2){this.activeAnnotation=null,this.isDrawing=!1;return}const a=Math.min(e.x1,e.x2),n=Math.max(e.x1,e.x2),c=Math.min(e.y1,e.y2),i=Math.max(e.y1,e.y2);e.x1=a,e.x2=n,e.y1=c,e.y2=i,this.annotations.push(this.activeAnnotation),this.emit("annotationChange",{action:"add",changedItem:this.activeAnnotation,imageUrl:this.imageUrl})}else if(this.activeAnnotation.type==="polygon"){if(this.activeAnnotation.coordinates.points.length<3){this.activeAnnotation=null,this.isDrawing=!1;return}this.annotations.push(this.activeAnnotation),this.emit("annotationChange",{action:"add",changedItem:this.activeAnnotation,imageUrl:this.imageUrl})}else if(this.activeAnnotation.type==="rotatedRect"){const e=this.activeAnnotation.coordinates;if(e.width<2||e.height<2){this.activeAnnotation=null,this.isDrawing=!1;return}this.annotations.push(this.activeAnnotation),this.emit("annotationChange",{action:"add",changedItem:this.activeAnnotation,imageUrl:this.imageUrl})}this.activeAnnotation.type}this.isDrawing=!1}updateDragging(e){if(!this.activeAnnotation||!this.dragStartPoint||!this.dragStartAnnotation)return;const a=e.x-this.dragStartPoint.x,n=e.y-this.dragStartPoint.y;this.selectedHandleIndex===-1?this.moveAnnotation(this.activeAnnotation,this.dragStartAnnotation,a,n):this.resizeAnnotation(this.activeAnnotation,this.dragStartAnnotation,this.selectedHandleIndex,e)}moveAnnotation(e,a,n,c){if(e.type==="rectangle"){const i=a.coordinates,l=e.coordinates;l.x1=i.x1+n,l.x2=i.x2+n,l.y1=i.y1+c,l.y2=i.y2+c}else if(e.type==="point"){const i=a.coordinates,l=e.coordinates;l.points=i.points.map(g=>({x:g.x+n,y:g.y+c}))}else if(e.type==="rotatedRect"){const i=a.coordinates,l=e.coordinates;l.x=i.x+n,l.y=i.y+c}else if(e.type==="polygon"){const i=a.coordinates,l=e.coordinates;l.points=i.points.map(g=>({x:g.x+n,y:g.y+c}))}else if(e.type==="category"){const i=a.coordinates,l=e.coordinates;i&&l&&(l.x=i.x+n,l.y=i.y+c)}}resizeAnnotation(e,a,n,c){if(e.type==="rectangle"){const i=e.coordinates;n===0&&(i.x1=c.x,i.y1=c.y),n===1&&(i.x2=c.x,i.y1=c.y),n===2&&(i.x2=c.x,i.y2=c.y),n===3&&(i.x1=c.x,i.y2=c.y)}else if(e.type==="polygon"){const i=e.coordinates;n>=0&&n<i.points.length&&(i.points[n]=c)}else if(e.type==="point"){const i=e.coordinates;n>=0&&n<i.points.length&&(i.points[n]=c)}else if(e.type==="rotatedRect"){const i=e.coordinates;if(n===-2){const l=i.x,g=i.y,m=c.x-l,h=c.y-g;let _=Math.atan2(h,m)*180/Math.PI;_+=90,i.angle=_}else{const l=i.angle*Math.PI/180,g=Math.cos(-l),m=Math.sin(-l),h=c.x-i.x,_=c.y-i.y,u=h*g-_*m,B=h*m+_*g;(n===0||n===3)&&(i.width/2,i.width=Math.abs(u)*2),(n===1||n===2)&&(i.width=Math.abs(u)*2),(n===0||n===1)&&(i.height=Math.abs(B)*2),(n===2||n===3)&&(i.height=Math.abs(B)*2)}}}getHitAnnotation(e){for(let a=this.annotations.length-1;a>=0;a--){const n=this.annotations[a];if(this.isPointInAnnotation(e,n))return n}return null}isPointInAnnotation(e,a){if(a.type==="rectangle"){const n=a.coordinates;return e.x>=n.x1&&e.x<=n.x2&&e.y>=n.y1&&e.y<=n.y2}else if(a.type==="polygon"){const n=a.coordinates;return ht(e,n.points)}else if(a.type==="rotatedRect"){const n=a.coordinates,c=et(e,{x:n.x,y:n.y},-n.angle),i=n.width/2,l=n.height/2;return c.x>=n.x-i&&c.x<=n.x+i&&c.y>=n.y-l&&c.y<=n.y+l}else if(a.type==="point")return a.coordinates.points.some(c=>H(e,c)<10/this.scale);return!1}getHitHandle(e,a,n){const c=this.getAnnotationHandles(n),i=6;for(let l=0;l<c.length;l++){const g=c[l],m=this.toScreenCoords(g.x,g.y);if(Math.abs(e-m.x)<i&&Math.abs(a-m.y)<i)return n.type==="rotatedRect"&&l===4?-2:l}return-100}getAnnotationHandles(e){if(e.type==="rectangle"){const a=e.coordinates;return[{x:a.x1,y:a.y1},{x:a.x2,y:a.y1},{x:a.x2,y:a.y2},{x:a.x1,y:a.y2}]}else{if(e.type==="polygon")return e.coordinates.points;if(e.type==="point")return e.coordinates.points;if(e.type==="rotatedRect"){const a=e.coordinates,n={x:a.x,y:a.y},c=a.width/2,i=a.height/2,l={x:a.x-c,y:a.y-i},g={x:a.x+c,y:a.y-i},m={x:a.x+c,y:a.y+i},h={x:a.x-c,y:a.y+i},_={x:a.x,y:a.y-i-20/this.scale};return[l,g,m,h,_].map(u=>et(u,n,a.angle))}}return[]}checkHover(e,a,n){const c=this.getHitCategory(e,a);if(c){this.canvas.style.cursor="pointer",this.hoverAnnotation=c;return}if(this.activeAnnotation&&this.getHitHandle(e,a,this.activeAnnotation)!==-100){this.canvas.style.cursor="pointer";return}const i=this.getHitAnnotation(n);i?(this.canvas.style.cursor="move",this.hoverAnnotation=i):(this.canvas.style.cursor="default",this.hoverAnnotation=null)}render(){if(this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),!this.img.complete||this.img.width===0){this.ctx.save(),this.ctx.fillStyle="#999",this.ctx.font="14px sans-serif",this.ctx.textAlign="center",this.ctx.textBaseline="middle",this.ctx.fillText("Loading image...",this.canvas.width/2,this.canvas.height/2),this.ctx.restore();return}this.ctx.drawImage(this.img,this.offset.x,this.offset.y,this.img.width*this.scale,this.img.height*this.scale),this.annotations.forEach(e=>{e!==this.activeAnnotation&&this.drawItem(e,!1)}),this.activeAnnotation&&this.drawItem(this.activeAnnotation,!0),this.renderCategories()}renderCategories(){const e=this.annotations.filter(n=>n.type==="category");if(e.length===0)return;this.ctx.save(),this.ctx.font="14px sans-serif",this.ctx.textBaseline="middle",this.ctx.textAlign="center";const a=12;e.forEach(n=>{var b;const c=n.label||"未命名分类",i=this.ctx.measureText(c).width+a*2,l=28,g=this.activeAnnotation===n,m=this.hoverAnnotation===n;let h={x:20,y:20};n.coordinates&&typeof n.coordinates.x=="number"&&typeof n.coordinates.y=="number"&&(h=this.toScreenCoords(n.coordinates.x,n.coordinates.y));const _=h.x-i/2,u=h.y-l/2,B=((b=n.style)==null?void 0:b.strokeColor)||"#2196F3";this.ctx.fillStyle=g?B:this.hexToRgba(B,.85),m&&!g&&(this.ctx.fillStyle=B),g?(this.ctx.strokeStyle="#ffffff",this.ctx.lineWidth=2):(this.ctx.strokeStyle="transparent",this.ctx.lineWidth=0),this.ctx.beginPath(),this.ctx.roundRect(_,u,i,l,6),this.ctx.fill(),g&&(this.ctx.stroke(),this.ctx.save(),this.ctx.strokeStyle=B,this.ctx.lineWidth=2,this.ctx.strokeRect(_-3,u-3,i+6,l+6),this.ctx.restore()),this.ctx.fillStyle="#ffffff",this.ctx.fillText(c,h.x,h.y)}),this.ctx.restore()}getHitCategory(e,a){const n=this.annotations.filter(g=>g.type==="category");if(n.length===0)return null;this.ctx.save(),this.ctx.font="14px sans-serif";const c=12,i=28;let l=null;for(let g=n.length-1;g>=0;g--){const m=n[g],h=m.label||"未命名分类",_=this.ctx.measureText(h).width+c*2;let u={x:20,y:20};m.coordinates&&typeof m.coordinates.x=="number"&&typeof m.coordinates.y=="number"&&(u=this.toScreenCoords(m.coordinates.x,m.coordinates.y));const B=u.x-_/2,b=u.y-i/2;if(e>=B&&e<=B+_&&a>=b&&a<=b+i){l=m;break}}return this.ctx.restore(),l}drawItem(e,a){var i;if(this.visibleLabels.size>0&&!this.visibleLabels.has(e.label)&&!a)return;this.ctx.save();const n=((i=e.style)==null?void 0:i.strokeColor)||"#FF4081",c=a?"#00E5FF":n;if(this.ctx.strokeStyle=c,this.ctx.lineWidth=2,e.type==="rectangle"){const l=e.coordinates,g=this.toScreenCoords(l.x1,l.y1),m=this.toScreenCoords(l.x2,l.y2),h=Math.min(g.x,m.x),_=Math.min(g.y,m.y),u=Math.abs(g.x-m.x),B=Math.abs(g.y-m.y);this.ctx.strokeRect(h,_,u,B),a&&this.drawHandles(this.getAnnotationHandles(e))}else if(e.type==="polygon"){const l=e.coordinates;if(l.points.length===0){this.ctx.restore();return}this.ctx.beginPath();const g=this.toScreenCoords(l.points[0].x,l.points[0].y);this.ctx.moveTo(g.x,g.y);for(let m=1;m<l.points.length;m++){const h=this.toScreenCoords(l.points[m].x,l.points[m].y);this.ctx.lineTo(h.x,h.y)}if(!this.isDrawing||e!==this.activeAnnotation)this.ctx.closePath();else if(this.lastMouseMovePoint){let m=this.lastMouseMovePoint;if(this.isHoveringStartPoint&&l.points.length>0){m=l.points[0];const _=this.toScreenCoords(l.points[0].x,l.points[0].y);this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(_.x,_.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()}const h=this.toScreenCoords(m.x,m.y);this.ctx.lineTo(h.x,h.y)}this.ctx.stroke(),a&&this.drawHandles(this.getAnnotationHandles(e))}else if(e.type==="rotatedRect"){const l=e.coordinates;this.ctx.translate(this.toScreenCoords(l.x,l.y).x,this.toScreenCoords(l.x,l.y).y),this.ctx.rotate(l.angle*Math.PI/180);const g=l.width*this.scale,m=l.height*this.scale;this.ctx.strokeRect(-g/2,-m/2,g,m),this.ctx.rotate(-l.angle*Math.PI/180),this.ctx.translate(-this.toScreenCoords(l.x,l.y).x,-this.toScreenCoords(l.x,l.y).y),a&&this.drawHandles(this.getAnnotationHandles(e))}else e.type==="point"&&e.coordinates.points.forEach(g=>{const m=this.toScreenCoords(g.x,g.y);this.ctx.beginPath(),this.ctx.arc(m.x,m.y,5,0,Math.PI*2),this.ctx.fillStyle=a?"#00E5FF":n,this.ctx.fill(),this.ctx.stroke()});this.showLabels&&e.label&&e.type!=="category"&&this.drawAnnotationLabel(e,n),this.ctx.restore()}drawAnnotationLabel(e,a){let n=0,c=0;if(e.type==="rectangle"){const i=e.coordinates,l=this.toScreenCoords(Math.min(i.x1,i.x2),Math.min(i.y1,i.y2));n=l.x,c=l.y-8}else if(e.type==="polygon"){const i=e.coordinates;if(i.points.length>0){const l=this.toScreenCoords(i.points[0].x,i.points[0].y);n=l.x,c=l.y-8}}else if(e.type==="rotatedRect"){const i=e.coordinates,l=this.toScreenCoords(i.x,i.y-i.height/2);n=l.x,c=l.y-8}else if(e.type==="point"){const i=e.coordinates;if(i.points.length>0){const l=this.toScreenCoords(i.points[0].x,i.points[0].y);n=l.x,c=l.y-8}}if(n!==0||c!==0){this.ctx.save(),this.ctx.font="12px sans-serif",this.ctx.textBaseline="bottom";const i=e.label,l=this.ctx.measureText(i).width,g=8,m=4;this.ctx.fillStyle=this.hexToRgba(a,.8),this.ctx.beginPath(),this.ctx.roundRect(n,c-14-m,l+g*2,14+m*2,4),this.ctx.fill(),this.ctx.fillStyle="#FFFFFF",this.ctx.fillText(i,n+g,c),this.ctx.restore()}}drawHandles(e){this.ctx.fillStyle="#FFFFFF",this.ctx.strokeStyle="#000000",this.ctx.lineWidth=1,e.forEach(a=>{const n=this.toScreenCoords(a.x,a.y);this.ctx.fillRect(n.x-4,n.y-4,8,8),this.ctx.strokeRect(n.x-4,n.y-4,8,8)})}}const gt='<?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>',mt='<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>',pt='<?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>',ft='<?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>',yt='<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>',ut='<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>',xt='<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>',wt='<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>',vt='<?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>',bt='<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>',kt='<?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>',Ct='<?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>',_t='<?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>',St='<?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>',Et='<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>',Bt='<?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>',It='<?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>',At='<?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>',Vt=["innerHTML"],Nt=t.defineComponent({__name:"SvgIcon",props:{name:{},size:{}},setup(w){const e=w,a=t.ref(""),n=Object.assign({"../assets/svg/aim.svg":gt,"../assets/svg/back.svg":mt,"../assets/svg/connection.svg":pt,"../assets/svg/crop.svg":ft,"../assets/svg/delete.svg":yt,"../assets/svg/download.svg":ut,"../assets/svg/edit.svg":xt,"../assets/svg/first.svg":wt,"../assets/svg/hide.svg":vt,"../assets/svg/last.svg":bt,"../assets/svg/pointer.svg":kt,"../assets/svg/price-tag.svg":Ct,"../assets/svg/rank.svg":_t,"../assets/svg/refresh-right.svg":St,"../assets/svg/right.svg":Et,"../assets/svg/view.svg":Bt,"../assets/svg/zoom-in.svg":It,"../assets/svg/zoom-out.svg":At});return t.watchEffect(()=>{const c=`../assets/svg/${e.name}.svg`,i=n[c];i?a.value=i:(console.warn(`Icon ${e.name} not found at path ${c}`),a.value="")}),(c,i)=>(t.openBlock(),t.createElementBlock("i",{class:t.normalizeClass(["svg-icon",[w.size?`size-${w.size}`:""]]),innerHTML:a.value},null,10,Vt))}}),J=(w,e)=>{const a=w.__vccOpts||w;for(const[n,c]of e)a[n]=c;return a},A=J(Nt,[["__scopeId","data-v-3928607b"]]),Tt={key:0,class:"image-list-sidebar"},Dt={class:"image-list-header"},Mt=["onClick"],zt={class:"image-list-stage"},Lt=["src","alt"],Pt={key:0,class:"thumb-overlay-layer"},$t={key:1,class:"thumb-overlay-svg",viewBox:"0 0 100 100",preserveAspectRatio:"none"},Rt=["points"],Ht={class:"image-list-text"},Ot={class:"center-sidebar"},Ut={key:0,class:"left-sidebar"},Ft=["onClick","title"],Wt={key:0,class:"divider"},Gt={class:"center-area"},Yt={key:0,class:"floating-label-selector"},Jt={key:0,class:"current-label"},jt={class:"label-name"},Xt={key:1,class:"current-label empty"},qt={key:0,class:"selector-dropdown"},Kt={key:0,class:"dropdown-empty"},Zt=["onClick"],Qt={class:"label-name"},te={key:0,class:"batch-nav"},ee=["disabled"],ne=["disabled"],oe=["disabled"],se=["disabled"],ie={key:1,class:"right-sidebar"},ae={class:"label-list"},le={class:"label-row"},ce=["onUpdate:modelValue","onChange"],re=["title"],he=["onClick"],de={class:"action-icon more-actions"},ge=["onClick"],me={class:"modal-content"},pe={class:"modal-body"},fe={class:"form-group"},ye={class:"form-group"},ue={class:"color-input-wrapper"},xe={class:"color-value"},we={class:"modal-actions"},ve=["disabled"],nt=J(t.defineComponent({__name:"ImageAnnotator",props:{annotationTypes:{default:()=>["rectangle","polygon","point","rotatedRect","category"]},batchImages:{default:()=>[]},labels:{default:()=>[]},defaultActiveType:{},theme:{default:"light"},readOnly:{type:Boolean,default:!1},image:{},predictionCandidates:{},session:{},requestId:{},minZoom:{},maxZoom:{}},emits:["annotationChange","batchChange","labelChange","ready","error","tool:change","viewport:change","annotation:add","annotation:update","annotation:delete","annotation:select","prediction:loaded","prediction:apply","prediction:reject"],setup(w,{expose:e,emit:a}){const n=w,c=a,i=t.ref(null),l=t.ref(null),g=t.ref(null),m=t.ref([]),h=t.ref(null),_=t.ref(null),u=t.ref(0),B=t.ref(""),b=t.ref([]),V=t.ref(""),O=t.ref(!1),v=t.ref({name:"",color:"#FF0000"}),S=t.ref("none"),y=t.ref([]),N=t.ref({}),M=t.computed(()=>_.value==="select"&&!!B.value),P=t.ref(!1),U=t.computed(()=>b.value.find(o=>o.id===V.value)),st=o=>{o.stopPropagation(),P.value=!P.value},it=o=>{W(o),P.value=!1};t.onMounted(()=>{document.addEventListener("click",o=>{o.target.closest(".floating-label-selector")||(P.value=!1)})});const j=o=>{if(!o||N.value[o])return;const s=new Image;s.onload=()=>{const r=s.naturalWidth||1,d=s.naturalHeight||1;N.value={...N.value,[o]:{width:r,height:d}}},s.src=o},X=()=>{n.batchImages.forEach(o=>{j(o.imageUrl)})},K=(o,s)=>{m.value[s]=o},F=(o=u.value)=>{const s=g.value,r=m.value[o];if(!s||!r)return;const d=s.scrollTop,p=d+s.clientHeight,C=r.offsetTop,I=C+r.offsetHeight;if(C<d){s.scrollTo({top:Math.max(C-8,0),behavior:"smooth"});return}I>p&&s.scrollTo({top:I-s.clientHeight+8,behavior:"smooth"})},R=()=>{var r,d,p,C;const o=n.batchImages[u.value],s=(o==null?void 0:o.imageUrl)||((r=n.image)==null?void 0:r.url);return{eventId:`${Date.now()}-${Math.random().toString(36).slice(2,10)}`,timestamp:Date.now(),requestId:n.requestId,taskId:(d=n.session)==null?void 0:d.taskId,imageId:((p=n.image)==null?void 0:p.id)||s,operator:(C=n.session)==null?void 0:C.userId}},f=o=>{var d;const s=o==null?void 0:o.action;if(!s)return;const r={meta:R(),action:s,current:o==null?void 0:o.changedItem,source:(d=o==null?void 0:o.changedItem)!=null&&d.predictionId?"prediction":"manual"};s==="add"&&c("annotation:add",r),s==="update"&&c("annotation:update",r),s==="delete"&&c("annotation:delete",r),s==="select"&&c("annotation:select",r)},x=t.computed(()=>n.annotationTypes),k=o=>({rectangle:"crop",polygon:"connection",point:"aim",rotatedRect:"refresh-right",category:"price-tag"})[o]||o,z=o=>({rectangle:"矩形框",polygon:"多边形",point:"关键点",rotatedRect:"旋转矩形",category:"分类标签"})[o]||o;t.onMounted(()=>{if(X(),i.value){h.value=new dt(i.value),h.value.setShowLabels(n.readOnly),h.value.on("annotationChange",s=>{var r,d;if(s.action==="add"&&s.changedItem){const p=b.value.find(C=>C.id===V.value);p&&(s.changedItem.label=p.name,s.changedItem.labelId=p.id)}s.action==="select"?B.value=((r=s.changedItem)==null?void 0:r.id)||"":s.action==="delete"&&((d=s.changedItem)==null?void 0:d.id)===B.value&&(B.value=""),c("annotationChange",s),f(s)}),L(),D();const o=new ResizeObserver(()=>{var s;(s=h.value)==null||s.resize()});l.value&&o.observe(l.value),n.defaultActiveType&&$(n.defaultActiveType),t.nextTick(()=>F()),c("ready",{meta:R()})}});const D=()=>{if(!h.value)return;const o=b.value.find(r=>r.id===V.value);o&&h.value.setLabelStyle(o.color);const s=b.value.filter(r=>r.visible).map(r=>r.name);h.value.setVisibleLabels(s)},L=()=>{var o;if(h.value)if(B.value="",requestAnimationFrame(()=>{var s;(s=h.value)==null||s.resize()}),n.batchImages.length>0){const s=n.batchImages[u.value];h.value.loadImage(s.imageUrl),s.annotations?h.value.setAnnotations(s.annotations):h.value.setAnnotations([])}else(o=n.image)!=null&&o.url&&h.value.loadImage(n.image.url)},$=o=>{var s,r;if(_.value=o,B.value="",o!=="pan"&&o!=="select"&&b.value.length===0){alert("请先创建标签!");return}o==="pan"||o==="select"?(s=h.value)==null||s.setTool(o):(r=h.value)==null||r.setTool(o),c("tool:change",{meta:R(),tool:o})},Ze=()=>{var o;(o=h.value)!=null&&o.activeAnnotation&&h.value.deleteAnnotation(h.value.activeAnnotation.id)},at=()=>{h.value&&c("viewport:change",{meta:R(),scale:h.value.scale,offset:{...h.value.offset}})},Qe=()=>{var o;(o=h.value)==null||o.zoom(1),at()},tn=()=>{var o;(o=h.value)==null||o.zoom(-1),at()},en=()=>{v.value={name:"",color:"#2196F3"},O.value=!0},Z=()=>{O.value=!1},nn=()=>{if(!v.value.name.trim()){alert("请输入标签名称");return}const s={id:Date.now().toString(),name:v.value.name,color:v.value.color,visible:!0};b.value.push(s),c("labelChange",b.value),D(),b.value.length===1&&W(s),Z()},W=o=>{var s;V.value=o.id,(s=h.value)==null||s.setLabelStyle(o.color)},on=(o,s)=>{if(!o.startsWith("#"))return o;let r=0,d=0,p=0;return o.length===4?(r=parseInt(o[1]+o[1],16),d=parseInt(o[2]+o[2],16),p=parseInt(o[3]+o[3],16)):o.length===7&&(r=parseInt(o.slice(1,3),16),d=parseInt(o.slice(3,5),16),p=parseInt(o.slice(5,7),16)),`rgba(${r}, ${d}, ${p}, ${s})`},sn=o=>{var s;if(o.id===V.value&&((s=h.value)==null||s.setLabelStyle(o.color)),h.value){const r=h.value.getAnnotations();let d=!1;r.forEach(p=>{p.label===o.name&&(p.style||(p.style={}),p.style.strokeColor=o.color,p.style.fillColor=on(o.color,.2),d=!0)}),d&&h.value.render()}c("labelChange",b.value),D()},an=o=>{o.visible=!o.visible,D()},ln=o=>{const s=b.value.findIndex(r=>r.id===o);s>-1&&(b.value.splice(s,1),c("labelChange",b.value),V.value===o&&(V.value=b.value.length>0?b.value[0].id:"",V.value&&W(b.value[0])),D())};t.watch(()=>n.labels,o=>{const s=JSON.parse(JSON.stringify(o||[]));if(b.value=s,b.value.length>0)if(!V.value||!b.value.find(r=>r.id===V.value))W(b.value[0]);else{const r=b.value.find(d=>d.id===V.value);r&&W(r)}else V.value="";D()},{immediate:!0,deep:!0});const cn=()=>{u.value>0&&(Q(),u.value--,L(),tt())},rn=()=>{u.value<n.batchImages.length-1&&(Q(),u.value++,L(),tt())},hn=()=>{u.value>0&&q(0)},dn=()=>{u.value<n.batchImages.length-1&&q(n.batchImages.length-1)},Q=()=>{if(h.value){const o=h.value.getAnnotations();n.batchImages[u.value].annotations=o}},tt=()=>{const o=n.batchImages[u.value];c("batchChange",{currentIndex:u.value,total:n.batchImages.length,currentImageUrl:o.imageUrl,currentAnnotations:o.annotations||[]})},lt=(o=[])=>{var p;if(!h.value)return;if(y.value=JSON.parse(JSON.stringify(o)),y.value.length===0){S.value="none";return}S.value="loaded";const r=(h.value.getAnnotations()||[]).filter(C=>!C.predictionId),d=y.value.map(C=>{const I=JSON.parse(JSON.stringify(C.annotation));return I.id=I.id||`pred-${C.id}`,I.predictionId=C.id,I.modelRunId=C.modelRunId||I.modelRunId,I.confidence=C.confidence??I.confidence,I.reviewStatus=I.reviewStatus||"draft",I});h.value.setAnnotations([...r,...d]),c("prediction:loaded",{meta:R(),modelRunId:(p=y.value[0])==null?void 0:p.modelRunId,candidates:y.value})},gn=(o,s)=>{var p;if(!h.value)return[];S.value="applying";const d=(h.value.getAnnotations()||[]).filter(C=>C.predictionId&&o.includes(C.predictionId));return d.forEach(C=>{C.reviewStatus="accepted"}),S.value="applied",c("prediction:apply",{meta:R(),modelRunId:(p=d[0])==null?void 0:p.modelRunId,candidateIds:o,threshold:s,acceptedAnnotations:d}),h.value.render(),d},mn=(o,s)=>{var p;if(!h.value)return;const r=h.value.getAnnotations()||[],d=r.filter(C=>!(C.predictionId&&o.includes(C.predictionId)));h.value.setAnnotations(d),c("prediction:reject",{meta:R(),modelRunId:(p=r.find(C=>C.predictionId&&o.includes(C.predictionId)))==null?void 0:p.modelRunId,candidateIds:o,reason:s})},pn=(o,s=[])=>{h.value&&(h.value.loadImage(o.url),h.value.setAnnotations(s))},fn=o=>{var s;(s=h.value)==null||s.setAnnotations(o)},ct=()=>{var o;return((o=h.value)==null?void 0:o.getAnnotations())||[]},yn=(o="json")=>{var r,d;const s=ct();return{format:o,image:((r=n.batchImages[u.value])==null?void 0:r.imageUrl)||((d=n.image)==null?void 0:d.url)||"",annotations:s}},q=o=>{o>=0&&o<n.batchImages.length&&(Q(),u.value=o,L(),tt())},un=o=>{var s;return o===u.value&&h.value?h.value.getAnnotations()||[]:((s=n.batchImages[o])==null?void 0:s.annotations)||[]},xn=o=>o.type==="rectangle",wn=o=>o.type==="polygon",vn=o=>o.type==="point",bn=o=>o.type==="rotatedRect",kn=o=>o.type==="category",G=o=>{var r,d;const s=(r=b.value.find(p=>p.name===o.label))==null?void 0:r.color;return((d=o.style)==null?void 0:d.strokeColor)||s||"#409eff"},rt=o=>{const s=o.coordinates;return(s==null?void 0:s.points)||[]},Y=o=>{const s=n.batchImages[o];if(s!=null&&s.width&&(s!=null&&s.height))return{width:s.width,height:s.height};const r=s!=null&&s.imageUrl?N.value[s.imageUrl]:void 0;return r||(s!=null&&s.imageUrl&&j(s.imageUrl),{width:1,height:1})},Cn=o=>{const s=n.batchImages[o];return s!=null&&s.width&&(s!=null&&s.height)?!0:s!=null&&s.imageUrl?!!N.value[s.imageUrl]:!1},_n=(o,s)=>{const r=s.coordinates,d=Y(o),p=G(s),C=Math.min(r.x1,r.x2),I=Math.min(r.y1,r.y2),Vn=Math.max(r.x1,r.x2),Nn=Math.max(r.y1,r.y2);return{left:`${C/d.width*100}%`,top:`${I/d.height*100}%`,width:`${(Vn-C)/d.width*100}%`,height:`${(Nn-I)/d.height*100}%`,borderColor:p,backgroundColor:`${p}22`}},Sn=(o,s)=>{const r=Y(o);return rt(s).map(d=>`${d.x/r.width*100},${d.y/r.height*100}`).join(" ")},En=o=>{const s=G(o);return{fill:`${s}33`,stroke:s,strokeWidth:"1.4"}},Bn=(o,s,r)=>{const d=Y(o),p=G(r);return{left:`${s.x/d.width*100}%`,top:`${s.y/d.height*100}%`,backgroundColor:p}},In=(o,s)=>{const r=s.coordinates,d=Y(o),p=G(s),C=Math.abs(r.width),I=Math.abs(r.height);return{left:`${(r.x-C/2)/d.width*100}%`,top:`${(r.y-I/2)/d.height*100}%`,width:`${C/d.width*100}%`,height:`${I/d.height*100}%`,transform:`rotate(${r.angle||0}deg)`,borderColor:p,backgroundColor:`${p}22`}},An=(o,s)=>{const r=s.coordinates,d=Y(o),p=G(s);return{left:`${r.x/d.width*100}%`,top:`${r.y/d.height*100}%`,backgroundColor:`${p}d9`}};return e({jumpTo:q,setImage:pn,setAnnotations:fn,getAnnotations:ct,selectTool:$,loadPredictionCandidates:lt,applyPredictions:gn,rejectPredictions:mn,exportAnnotations:yn,getAllAnnotations:()=>{var o,s;return n.batchImages.length>0?n.batchImages:[{imageUrl:((o=n.image)==null?void 0:o.url)||"",annotations:((s=h.value)==null?void 0:s.getAnnotations())||[]}]},getCurrentAnnotation:()=>{var o,s,r;return{imageUrl:((o=n.batchImages[u.value])==null?void 0:o.imageUrl)||((s=n.image)==null?void 0:s.url)||"",annotations:((r=h.value)==null?void 0:r.getAnnotations())||[]}}}),t.watch(()=>{var o;return(o=n.image)==null?void 0:o.url},()=>{var o;n.batchImages.length===0&&((o=n.image)!=null&&o.url)&&L()}),t.watch(()=>n.predictionCandidates,o=>{o&<(o)},{immediate:!0,deep:!0}),t.watch(()=>n.batchImages.map(o=>`${o.imageUrl}:${o.width||""}x${o.height||""}`),()=>{X(),m.value=m.value.slice(0,n.batchImages.length),t.nextTick(()=>F())},{immediate:!0}),t.watch(()=>u.value,()=>{t.nextTick(()=>F())}),t.watch(()=>n.readOnly,o=>{h.value&&h.value.setShowLabels(o)}),(o,s)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["annotation-container",w.theme])},[w.batchImages&&w.batchImages.length>0?(t.openBlock(),t.createElementBlock("div",Tt,[t.createElementVNode("div",Dt,"共 "+t.toDisplayString(w.batchImages.length)+" 张",1),t.createElementVNode("div",{ref_key:"imageListScrollRef",ref:g,class:"image-list-scroll"},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(w.batchImages,(r,d)=>(t.openBlock(),t.createElementBlock("button",{key:`${r.imageUrl}-${d}`,ref_for:!0,ref:p=>K(p,d),class:t.normalizeClass(["image-list-item",{active:d===u.value}]),onClick:p=>q(d)},[t.createElementVNode("div",zt,[t.createElementVNode("img",{src:r.imageUrl,alt:`第${d+1}张`,class:"image-list-thumb"},null,8,Lt),Cn(d)?(t.openBlock(),t.createElementBlock("div",Pt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(un(d),p=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:p.id},[xn(p)?(t.openBlock(),t.createElementBlock("div",{key:0,class:"thumb-overlay-rect",style:t.normalizeStyle(_n(d,p))},null,4)):wn(p)?(t.openBlock(),t.createElementBlock("svg",$t,[t.createElementVNode("polygon",{points:Sn(d,p),style:t.normalizeStyle(En(p))},null,12,Rt)])):vn(p)?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:2},t.renderList(rt(p),(C,I)=>(t.openBlock(),t.createElementBlock("div",{key:`${p.id}-${I}`,class:"thumb-overlay-point",style:t.normalizeStyle(Bn(d,C,p))},null,4))),128)):bn(p)?(t.openBlock(),t.createElementBlock("div",{key:3,class:"thumb-overlay-rotated",style:t.normalizeStyle(In(d,p))},null,4)):kn(p)?(t.openBlock(),t.createElementBlock("div",{key:4,class:"thumb-overlay-category",style:t.normalizeStyle(An(d,p))},t.toDisplayString(p.label),5)):t.createCommentVNode("",!0)],64))),128))])):t.createCommentVNode("",!0)]),t.createElementVNode("span",Ht,"第 "+t.toDisplayString(d+1)+" 张",1)],10,Mt))),128))],512)])):t.createCommentVNode("",!0),t.createElementVNode("div",Ot,[w.readOnly?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",Ut,[t.createElementVNode("div",{class:t.normalizeClass(["tool-btn",{active:_.value==="pan"}]),onClick:s[0]||(s[0]=r=>$("pan")),title:"拖动"},[t.createVNode(A,{name:"rank"})],2),t.createElementVNode("div",{class:t.normalizeClass(["tool-btn",{active:_.value==="select"}]),onClick:s[1]||(s[1]=r=>$("select")),title:"选择"},[t.createVNode(A,{name:"pointer"})],2),s[5]||(s[5]=t.createElementVNode("div",{class:"divider"},null,-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(x.value,r=>(t.openBlock(),t.createElementBlock("div",{key:r,class:t.normalizeClass(["tool-btn",{active:_.value===r}]),onClick:d=>$(r),title:z(r)},[t.createVNode(A,{name:k(r)},null,8,["name"])],10,Ft))),128)),s[6]||(s[6]=t.createElementVNode("div",{class:"divider"},null,-1)),t.createElementVNode("div",{class:"tool-btn",onClick:Qe,title:"放大"},[t.createVNode(A,{name:"zoom-in"})]),t.createElementVNode("div",{class:"tool-btn",onClick:tn,title:"缩小"},[t.createVNode(A,{name:"zoom-out"})]),M.value?(t.openBlock(),t.createElementBlock("div",Wt)):t.createCommentVNode("",!0),M.value?(t.openBlock(),t.createElementBlock("div",{key:1,class:"tool-btn",onClick:Ze,title:"删除选中"},[t.createVNode(A,{name:"delete"})])):t.createCommentVNode("",!0)]))]),t.createElementVNode("div",Gt,[t.createElementVNode("div",{class:"canvas-wrapper",ref_key:"canvasWrapper",ref:l,onWheel:s[2]||(s[2]=t.withModifiers(()=>{},["prevent"]))},[t.createElementVNode("canvas",{ref_key:"canvasRef",ref:i},null,512),w.readOnly?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",Yt,[t.createElementVNode("div",{class:"selector-trigger",onClick:st},[U.value?(t.openBlock(),t.createElementBlock("div",Jt,[t.createElementVNode("span",{class:"color-dot",style:t.normalizeStyle({backgroundColor:U.value.color})},null,4),t.createElementVNode("span",jt,t.toDisplayString(U.value.name),1)])):(t.openBlock(),t.createElementBlock("div",Xt,[...s[7]||(s[7]=[t.createElementVNode("span",{class:"label-name"},"请选择标签",-1)])])),t.createVNode(A,{name:"right",class:t.normalizeClass(["arrow-icon",{"is-open":P.value}])},null,8,["class"])]),P.value?(t.openBlock(),t.createElementBlock("div",qt,[b.value.length===0?(t.openBlock(),t.createElementBlock("div",Kt,"请在右侧创建标签")):(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:1},t.renderList(b.value,r=>(t.openBlock(),t.createElementBlock("div",{key:r.id,class:t.normalizeClass(["dropdown-item",{active:V.value===r.id}]),onClick:d=>it(r)},[t.createElementVNode("span",{class:"color-dot",style:t.normalizeStyle({backgroundColor:r.color})},null,4),t.createElementVNode("span",Qt,t.toDisplayString(r.name),1),V.value===r.id?(t.openBlock(),t.createBlock(A,{key:0,name:"aim",class:"check-icon"})):t.createCommentVNode("",!0)],10,Zt))),128))])):t.createCommentVNode("",!0)]))],544),w.batchImages&&w.batchImages.length>0?(t.openBlock(),t.createElementBlock("div",te,[t.createElementVNode("button",{class:"icon-btn",onClick:hn,disabled:u.value<=0,title:"第一张"},[t.createVNode(A,{name:"first"})],8,ee),t.createElementVNode("button",{class:"icon-btn",onClick:cn,disabled:u.value<=0,title:"上一张"},[t.createVNode(A,{name:"back"})],8,ne),t.createElementVNode("span",null,t.toDisplayString(u.value+1)+" / "+t.toDisplayString(w.batchImages.length),1),t.createElementVNode("button",{class:"icon-btn",onClick:rn,disabled:u.value>=w.batchImages.length-1,title:"下一张"},[t.createVNode(A,{name:"right"})],8,oe),t.createElementVNode("button",{class:"icon-btn",onClick:dn,disabled:u.value>=w.batchImages.length-1,title:"最后一张"},[t.createVNode(A,{name:"last"})],8,se)])):t.createCommentVNode("",!0)]),w.readOnly?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",ie,[t.createElementVNode("div",{class:"sidebar-header"},[s[8]||(s[8]=t.createElementVNode("h3",null,"标签",-1)),t.createElementVNode("button",{class:"add-btn",onClick:en},"添加标签")]),t.createElementVNode("div",ae,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(b.value,r=>(t.openBlock(),t.createElementBlock("div",{key:r.id,class:"label-item",style:t.normalizeStyle({backgroundColor:r.color+"1A",color:r.color})},[t.createElementVNode("div",le,[t.createElementVNode("label",{class:"color-wrapper",style:t.normalizeStyle({backgroundColor:r.color})},[t.withDirectives(t.createElementVNode("input",{type:"color","onUpdate:modelValue":d=>r.color=d,onChange:d=>sn(r),style:{visibility:"hidden",width:"0",height:"0"}},null,40,ce),[[t.vModelText,r.color]])],4),t.createElementVNode("span",{class:"label-name",title:r.name},t.toDisplayString(r.name),9,re),t.createElementVNode("span",{class:"action-icon eye",onClick:d=>an(r)},[r.visible?(t.openBlock(),t.createBlock(A,{key:0,name:"view"})):(t.openBlock(),t.createBlock(A,{key:1,name:"hide"}))],8,he),t.createElementVNode("div",de,[s[9]||(s[9]=t.createElementVNode("span",{class:"dots"},"•••",-1)),t.createElementVNode("span",{class:"delete-btn",onClick:d=>ln(r.id),title:"删除"},[t.createVNode(A,{name:"delete"})],8,ge)])])],4))),128))])])),O.value?(t.openBlock(),t.createElementBlock("div",{key:2,class:"modal-overlay",onClick:t.withModifiers(Z,["self"])},[t.createElementVNode("div",me,[s[12]||(s[12]=t.createElementVNode("div",{class:"modal-header"},[t.createElementVNode("h3",null,"新增标签")],-1)),t.createElementVNode("div",pe,[t.createElementVNode("div",fe,[s[10]||(s[10]=t.createElementVNode("label",null,[t.createTextVNode("标签名称 "),t.createElementVNode("span",{class:"required"},"*")],-1)),t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":s[3]||(s[3]=r=>v.value.name=r),placeholder:"请输入标签名称",class:"modal-input",autofocus:""},null,512),[[t.vModelText,v.value.name]])]),t.createElementVNode("div",ye,[s[11]||(s[11]=t.createElementVNode("label",null,"标签颜色",-1)),t.createElementVNode("div",ue,[t.createElementVNode("label",{class:"color-picker-box",style:t.normalizeStyle({backgroundColor:v.value.color})},[t.withDirectives(t.createElementVNode("input",{type:"color","onUpdate:modelValue":s[4]||(s[4]=r=>v.value.color=r),class:"modal-color-picker"},null,512),[[t.vModelText,v.value.color]])],4),t.createElementVNode("span",xe,t.toDisplayString(v.value.color),1)])])]),t.createElementVNode("div",we,[t.createElementVNode("button",{onClick:Z,class:"cancel-btn"},"取消"),t.createElementVNode("button",{onClick:nn,class:"confirm-btn",disabled:!v.value.name.trim()},"确认",8,ve)])])])):t.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-08cbbaca"]]),be={class:"thumbnail-wrapper",ref:"wrapper"},ke=["src","alt"],Ce=["viewBox","preserveAspectRatio"],_e=["x","y","width","height","stroke","stroke-width"],Se=["points","stroke","stroke-width"],Ee=["transform"],Be=["x","y","width","height","stroke","stroke-width"],Ie={key:3},Ae=["cx","cy","r","fill","stroke-width"],Ve={key:4},Ne=["x","y","height"],Te={key:1,class:"loading-placeholder"},De=J(t.defineComponent({__name:"AnnotationThumbnail",props:{src:{},annotations:{},alt:{},labels:{},fit:{},strokeWidth:{},fontSize:{}},setup(w){const e=w,a=t.ref(null),n=t.ref(!1),c=t.ref(0),i=t.ref(0),l=()=>{a.value&&(c.value=a.value.naturalWidth,i.value=a.value.naturalHeight,n.value=!0)},g=t.computed(()=>e.fit==="contain"?"xMidYMid meet":"xMidYMid slice"),m=t.computed(()=>e.strokeWidth??10),h=t.computed(()=>e.fontSize??30),_=v=>{var S;if((S=v.style)!=null&&S.strokeColor)return v.style.strokeColor;if(e.labels){const y=e.labels.find(N=>N.name===v.label);if(y)return y.color}return"#FF0000"},u=v=>{const S=v.coordinates,y=Math.min(S.x1,S.x2),N=Math.min(S.y1,S.y2),M=Math.abs(S.x1-S.x2),P=Math.abs(S.y1-S.y2);return{x:y,y:N,width:M,height:P}},B=v=>v.coordinates.points.map(y=>`${y.x},${y.y}`).join(" "),b=v=>{if(v.type==="rectangle"){const S=u(v);return{x:S.x,y:S.y-5}}else if(v.type==="polygon"){const S=v.coordinates.points;if(S.length>0)return{x:S[0].x,y:S[0].y-5}}else{if(v.type==="rotatedRect")return{x:v.coordinates.x,y:v.coordinates.y-v.coordinates.height/2-5};if(v.type==="point"){const S=v.coordinates.points;if(S.length>0)return{x:S[0].x,y:S[0].y-15}}else if(v.type==="category")return{x:v.coordinates.x,y:v.coordinates.y}}return{x:0,y:0}},V=v=>{const{x:S,y,angle:N}=v.coordinates,M=N*180/Math.PI;return`translate(${S}, ${y}) rotate(${M})`},O=v=>({x:v.coordinates.x,y:v.coordinates.y});return(v,S)=>(t.openBlock(),t.createElementBlock("div",be,[t.createElementVNode("img",{ref_key:"img",ref:a,src:w.src,class:"thumbnail-image",style:t.normalizeStyle({objectFit:w.fit}),onLoad:l,alt:w.alt},null,44,ke),n.value?(t.openBlock(),t.createElementBlock("svg",{key:0,class:"annotation-overlay",viewBox:`0 0 ${c.value} ${i.value}`,preserveAspectRatio:g.value},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(w.annotations,y=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:y.id},[y.type==="rectangle"?(t.openBlock(),t.createElementBlock("rect",{key:0,x:u(y).x,y:u(y).y,width:u(y).width,height:u(y).height,stroke:_(y),"stroke-width":m.value,fill:"transparent"},null,8,_e)):y.type==="polygon"?(t.openBlock(),t.createElementBlock("polygon",{key:1,points:B(y),stroke:_(y),"stroke-width":m.value,fill:"transparent"},null,8,Se)):y.type==="rotatedRect"?(t.openBlock(),t.createElementBlock("g",{key:2,transform:V(y)},[t.createElementVNode("rect",{x:-y.coordinates.width/2,y:-y.coordinates.height/2,width:y.coordinates.width,height:y.coordinates.height,stroke:_(y),"stroke-width":m.value,fill:"transparent"},null,8,Be)],8,Ee)):y.type==="point"?(t.openBlock(),t.createElementBlock("g",Ie,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(y.coordinates.points,(N,M)=>(t.openBlock(),t.createElementBlock("circle",{key:M,cx:N.x,cy:N.y,r:m.value*1.5,fill:_(y),stroke:"white","stroke-width":m.value*.5},null,8,Ae))),128))])):t.createCommentVNode("",!0),y.label?(t.openBlock(),t.createElementBlock("g",Ve,[(t.openBlock(),t.createElementBlock("foreignObject",{x:y.type==="category"?O(y).x-100:b(y).x,y:y.type==="category"?O(y).y-h.value-8:b(y).y-h.value-8,width:"200",height:h.value+16,style:{overflow:"visible"}},[t.createElementVNode("div",{style:t.normalizeStyle({display:"inline-flex",alignItems:"center",justifyContent:y.type==="category"?"center":"flex-start",backgroundColor:`${_(y)}cc`,color:"#ffffff",fontSize:`${h.value}px`,padding:"4px 8px",borderRadius:"4px",whiteSpace:"nowrap",lineHeight:1,transform:y.type==="category"?"translateX(calc(100px - 50%))":"none"})},t.toDisplayString(y.label),5)],8,Ne))])):t.createCommentVNode("",!0)],64))),128))],8,Ce)):(t.openBlock(),t.createElementBlock("div",Te,"Loading..."))],512))}}),[["__scopeId","data-v-46e27181"]]),Me={key:0,class:"gallery-view"},ze={class:"gallery-layout"},Le={key:0,class:"gallery-sidebar"},Pe={class:"label-stats-table"},$e={class:"label-cover-wrapper"},Re=["src"],He={class:"gallery-content"},Oe=["onClick"],Ue={class:"thumbnail-wrapper"},Fe={class:"img-meta"},We={class:"img-index"},Ge={class:"anno-count"},Ye={key:0,class:"bottom-bar"},Je={key:1,class:"editor-view"},je={class:"editor-header"},Xe={class:"header-left"},qe={class:"editor-title"},Ke={class:"editor-content"},ot=J(t.defineComponent({__name:"BatchAnnotator",props:{images:{},labels:{},actionBar:{},clickToEnterEditor:{type:Boolean},thumbStrokeWidth:{},thumbFontSize:{},readOnly:{type:Boolean},showSidebar:{type:Boolean,default:!0}},emits:["export","update:images","imageClick","update:labels","pageChange"],setup(w,{expose:e,emit:a}){const n=w,c=a,i=t.ref("gallery"),l=t.ref([]),g=t.ref([]),m=t.ref(0),h=t.ref(null),_=t.ref(null),u=t.ref(null),B=t.computed(()=>{var f,x;return((x=(f=n.actionBar)==null?void 0:f.annotateButton)==null?void 0:x.show)===!0}),b=t.computed(()=>{var f,x;return((x=(f=n.actionBar)==null?void 0:f.exportButton)==null?void 0:x.show)===!0}),V=t.computed(()=>B.value||b.value),O=t.computed(()=>{var f,x;return((x=(f=n.actionBar)==null?void 0:f.annotateButton)==null?void 0:x.text)||"手动标注"}),v=t.computed(()=>{var f,x;return((x=(f=n.actionBar)==null?void 0:f.exportButton)==null?void 0:x.text)||"导出"}),S=t.computed(()=>n.clickToEnterEditor!==!1),y=t.computed(()=>{const f={};g.value.forEach(k=>{f[k.name]={count:0,cover:""}});let x=0;return l.value.forEach(k=>{k.annotations&&k.annotations.forEach(z=>{var L;const D=z.label||(z.labelId?(L=g.value.find($=>$.id===z.labelId))==null?void 0:L.name:null);D&&f[D]&&(f[D].count++,x++,f[D].cover||(f[D].cover=k.imageUrl))})}),g.value.map(k=>{var L,$;const z=((L=f[k.name])==null?void 0:L.count)||0,D=x===0?"0.00%":(z/x*100).toFixed(2)+"%";return{id:k.id,name:k.name,color:k.color,count:z,percentage:D,cover:(($=f[k.name])==null?void 0:$.cover)||""}})}),N=f=>({color:f.color,backgroundColor:f.color+"1A"});t.onMounted(()=>{c("pageChange",{nowPage:"listPage"})}),t.watch(()=>n.images,f=>{l.value=JSON.parse(JSON.stringify(f))},{immediate:!0,deep:!0}),t.watch(()=>n.labels,f=>{g.value=JSON.parse(JSON.stringify(f||[]))},{immediate:!0,deep:!0});const M=f=>{m.value=f,i.value="editor",c("pageChange",{nowPage:"editPage"}),u.value&&(u.value.scrollTop=0),t.nextTick(()=>{_.value&&(_.value.scrollTop=0),window.scrollTo(0,0),requestAnimationFrame(()=>{var x,k;(k=(x=h.value)==null?void 0:x.jumpTo)==null||k.call(x,f)})})},P=(f,x)=>{if(S.value){M(f);return}c("imageClick",{index:f,imageId:x.id,image:x})},U=f=>l.value.findIndex(x=>x.id===f);e({openImageById:f=>{const x=U(f);return x<0?!1:(M(x),!0)},triggerImageClickById:f=>{const x=U(f);if(x<0)return!1;const k=l.value[x];return k?(c("imageClick",{index:x,imageId:k.id,image:k}),!0):!1},getFinalData:()=>({images:JSON.parse(JSON.stringify(l.value)),labels:JSON.parse(JSON.stringify(g.value))})});const j=()=>{if(h.value&&h.value.getCurrentAnnotation){const f=h.value.getCurrentAnnotation();l.value[m.value]&&(l.value[m.value].annotations=f.annotations)}i.value="gallery",c("pageChange",{nowPage:"listPage"})},X=()=>{c("export",l.value)},K=f=>{m.value=f.currentIndex,l.value[f.currentIndex]&&(l.value[f.currentIndex].annotations=f.currentAnnotations)},F=f=>{if(h.value&&h.value.getCurrentAnnotation){const x=h.value.getCurrentAnnotation();l.value[m.value]&&(l.value[m.value].annotations=x.annotations,c("update:images",l.value))}},R=f=>{g.value=JSON.parse(JSON.stringify(f||[])),c("update:labels",g.value)};return(f,x)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"batchRootRef",ref:_,class:"batch-annotator"},[i.value==="gallery"?(t.openBlock(),t.createElementBlock("div",Me,[t.createElementVNode("div",ze,[w.showSidebar?(t.openBlock(),t.createElementBlock("div",Le,[t.createElementVNode("table",Pe,[x[1]||(x[1]=t.createElementVNode("thead",null,[t.createElementVNode("tr",null,[t.createElementVNode("th",null,"标签封面"),t.createElementVNode("th",null,"标签名称"),t.createElementVNode("th",null,"标注数"),t.createElementVNode("th",null,"占比")])],-1)),t.createElementVNode("tbody",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(y.value,k=>(t.openBlock(),t.createElementBlock("tr",{key:k.id,style:t.normalizeStyle(N(k))},[t.createElementVNode("td",null,[t.createElementVNode("div",$e,[k.cover?(t.openBlock(),t.createElementBlock("img",{key:0,src:k.cover,class:"label-cover"},null,8,Re)):(t.openBlock(),t.createElementBlock("div",{key:1,class:"label-cover-empty",style:t.normalizeStyle({backgroundColor:k.color})},null,4))])]),t.createElementVNode("td",null,t.toDisplayString(k.name),1),t.createElementVNode("td",null,t.toDisplayString(k.count),1),t.createElementVNode("td",null,t.toDisplayString(k.percentage),1)],4))),128))])])])):t.createCommentVNode("",!0),t.createElementVNode("div",He,[t.createElementVNode("div",{ref_key:"galleryGridRef",ref:u,class:"gallery-grid"},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.value,(k,z)=>(t.openBlock(),t.createElementBlock("div",{key:z,class:"gallery-item",onClick:D=>P(z,k)},[t.createElementVNode("div",Ue,[t.createVNode(De,{src:k.imageUrl,annotations:k.annotations||[],labels:g.value,fit:"cover",strokeWidth:n.thumbStrokeWidth,fontSize:n.thumbFontSize},null,8,["src","annotations","labels","strokeWidth","fontSize"])]),t.createElementVNode("div",Fe,[t.createElementVNode("span",We,"#"+t.toDisplayString(z+1),1),t.createElementVNode("span",Ge,t.toDisplayString((k.annotations||[]).length)+" 标注",1)])],8,Oe))),128))],512)])]),V.value?(t.openBlock(),t.createElementBlock("div",Ye,[B.value?(t.openBlock(),t.createElementBlock("button",{key:0,class:"action-btn primary",onClick:x[0]||(x[0]=k=>M(0))},[t.createVNode(A,{name:"edit"}),t.createTextVNode(" "+t.toDisplayString(O.value),1)])):t.createCommentVNode("",!0),b.value?(t.openBlock(),t.createElementBlock("button",{key:1,class:"action-btn success",onClick:X},[t.createVNode(A,{name:"download"}),t.createTextVNode(" "+t.toDisplayString(v.value),1)])):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)])):(t.openBlock(),t.createElementBlock("div",Je,[t.createElementVNode("div",je,[t.createElementVNode("div",Xe,[t.createElementVNode("button",{class:"back-btn",onClick:j},[t.createVNode(A,{name:"back",class:"back-icon"}),x[2]||(x[2]=t.createTextVNode()),x[3]||(x[3]=t.createElementVNode("span",{class:"back-text"},"返回",-1))]),t.createElementVNode("span",qe,t.toDisplayString(w.readOnly?"正在查看":"正在标注")+": "+t.toDisplayString(m.value+1)+" / "+t.toDisplayString(l.value.length),1)])]),t.createElementVNode("div",Ke,[t.createVNode(nt,{ref_key:"annotatorRef",ref:h,batchImages:l.value,labels:g.value,readOnly:w.readOnly,annotationTypes:["rectangle","polygon","point","rotatedRect","category"],onBatchChange:K,onAnnotationChange:F,onLabelChange:R},null,8,["batchImages","labels","readOnly"])])]))],512))}}),[["__scopeId","data-v-1d13568a"]]);T.BatchAnnotator=ot,T.ImageAnnotator=nt,T.default=ot,Object.defineProperties(T,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
1
|
+
(function(T,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(T=typeof globalThis<"u"?globalThis:T||self,t(T.VueImageAnnotator={},T.Vue))})(this,(function(T,t){"use strict";var Tn=Object.defineProperty;var Dn=(T,t,H)=>t in T?Tn(T,t,{enumerable:!0,configurable:!0,writable:!0,value:H}):T[t]=H;var E=(T,t,H)=>Dn(T,typeof t!="symbol"?t+"":t,H);const H=(w,e)=>Math.sqrt(Math.pow(w.x-e.x,2)+Math.pow(w.y-e.y,2)),ht=(w,e)=>{let a=!1;for(let n=0,c=e.length-1;n<e.length;c=n++){const i=e[n].x,l=e[n].y,g=e[c].x,m=e[c].y;l>w.y!=m>w.y&&w.x<(g-i)*(w.y-l)/(m-l)+i&&(a=!a)}return a},et=(w,e,a)=>{const n=a*(Math.PI/180),c=Math.cos(n),i=Math.sin(n),l=w.x-e.x,g=w.y-e.y;return{x:e.x+(l*c-g*i),y:e.y+(l*i+g*c)}};class dt{constructor(e){E(this,"canvas");E(this,"ctx");E(this,"img");E(this,"annotations",[]);E(this,"currentTool",null);E(this,"interactionMode","none");E(this,"activeAnnotation",null);E(this,"hoverAnnotation",null);E(this,"isDrawing",!1);E(this,"isDragging",!1);E(this,"isPanning",!1);E(this,"panStartPoint",null);E(this,"dragStartPoint",null);E(this,"dragStartAnnotation",null);E(this,"lastMouseMovePoint",null);E(this,"isHoveringStartPoint",!1);E(this,"currentLabelColor","#FF4081");E(this,"visibleLabels",new Set);E(this,"selectedHandleIndex",-1);E(this,"hoverHandleIndex",-1);E(this,"scale",1);E(this,"offset",{x:0,y:0});E(this,"showLabels",!1);E(this,"listeners",{});E(this,"imageUrl","");this.canvas=e;const a=e.getContext("2d");if(!a)throw new Error("Could not get 2d context");this.ctx=a,this.img=new Image,this.img.crossOrigin="Anonymous",this.img.onload=()=>{this.fitImageToCanvas(),this.render()},this.bindEvents()}on(e,a){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(a)}emit(e,a){this.listeners[e]&&this.listeners[e].forEach(n=>n(a))}loadImage(e){this.imageUrl=e,this.img.src=e,this.activeAnnotation=null,this.isDrawing=!1}setAnnotations(e){this.annotations=JSON.parse(JSON.stringify(e)),this.render()}getAnnotations(){return this.annotations}setTool(e){e==="pan"?(this.interactionMode="pan",this.currentTool=null,this.isPanning=!1,this.canvas.style.cursor="grab"):e==="select"?(this.interactionMode="select",this.currentTool=null,this.canvas.style.cursor="default"):e?(this.interactionMode="draw",this.currentTool=e,this.canvas.style.cursor="crosshair"):(this.interactionMode="none",this.currentTool=null,this.canvas.style.cursor="default"),this.activeAnnotation=null,this.isDrawing=!1,this.render()}setLabelStyle(e){this.currentLabelColor=e}setVisibleLabels(e){this.visibleLabels=new Set(e),this.render()}setShowLabels(e){this.showLabels=e,this.render()}zoom(e){const n=e>0?this.scale*1.1:this.scale/1.1;if(n<.1||n>10)return;const c=this.canvas.width/2,i=this.canvas.height/2,l=this.toImageCoords(c,i);this.scale=n,this.offset.x=c-l.x*this.scale,this.offset.y=i-l.y*this.scale,this.clampViewportOffset(),this.render()}resize(){this.fitImageToCanvas(),this.render()}toImageCoords(e,a){return{x:(e-this.offset.x)/this.scale,y:(a-this.offset.y)/this.scale}}toScreenCoords(e,a){return{x:e*this.scale+this.offset.x,y:a*this.scale+this.offset.y}}fitImageToCanvas(){const e=this.canvas.parentElement;if(e){if(this.canvas.width=e.clientWidth,this.canvas.height=e.clientHeight,this.img.width===0)return;const a=this.canvas.width/this.img.width,n=this.canvas.height/this.img.height;this.scale=Math.min(a,n),this.offset.x=(this.canvas.width-this.img.width*this.scale)/2,this.offset.y=(this.canvas.height-this.img.height*this.scale)/2,this.clampViewportOffset()}}clampViewportOffset(){if(this.img.width===0||this.img.height===0)return;const e=this.img.width*this.scale,a=this.img.height*this.scale,n=100;if(e<=this.canvas.width){const c=-e+n,i=this.canvas.width-n;this.offset.x=Math.min(i,Math.max(c,this.offset.x))}else{const c=this.canvas.width-e-n,i=n;this.offset.x=Math.min(i,Math.max(c,this.offset.x))}if(a<=this.canvas.height){const c=-a+n,i=this.canvas.height-n;this.offset.y=Math.min(i,Math.max(c,this.offset.y))}else{const c=this.canvas.height-a-n,i=n;this.offset.y=Math.min(i,Math.max(c,this.offset.y))}}bindEvents(){this.canvas.addEventListener("mousedown",this.handleMouseDown.bind(this)),this.canvas.addEventListener("mousemove",this.handleMouseMove.bind(this)),this.canvas.addEventListener("mouseup",this.handleMouseUp.bind(this)),this.canvas.addEventListener("mouseleave",this.handleMouseUp.bind(this)),window.addEventListener("keydown",this.handleKeyDown.bind(this))}handleKeyDown(e){this.interactionMode==="select"&&(e.key==="Delete"||e.key==="Backspace")&&this.activeAnnotation&&this.deleteAnnotation(this.activeAnnotation.id)}deleteAnnotation(e){const a=this.annotations.findIndex(n=>n.id===e);if(a>-1){const n=this.annotations[a];this.annotations.splice(a,1),this.activeAnnotation=null,this.emit("annotationChange",{action:"delete",changedItem:n,imageUrl:this.imageUrl}),this.render()}}handleMouseDown(e){const a=this.canvas.getBoundingClientRect(),n=e.clientX-a.left,c=e.clientY-a.top,i=this.toImageCoords(n,c);if(this.interactionMode==="pan"){this.isPanning=!0,this.panStartPoint={x:n,y:c},this.canvas.style.cursor="grabbing";return}if(this.interactionMode==="select"&&this.activeAnnotation){const m=this.getHitHandle(n,c,this.activeAnnotation);if(m!==-100){this.isDragging=!0,this.dragStartPoint=i,this.selectedHandleIndex=m,this.dragStartAnnotation=JSON.parse(JSON.stringify(this.activeAnnotation));return}}const l=this.interactionMode==="select"?this.getHitCategory(n,c):null;if(l){this.activeAnnotation=l,this.isDragging=!1,this.selectedHandleIndex=-1,this.emit("annotationChange",{action:"select",changedItem:l,imageUrl:this.imageUrl}),this.render();return}const g=this.getHitAnnotation(i);if(this.interactionMode==="select"){if(g){if(!(this.visibleLabels.size>0&&!this.visibleLabels.has(g.label))){this.activeAnnotation=g,this.isDragging=!0,this.dragStartPoint=i,this.selectedHandleIndex=-1,this.dragStartAnnotation=JSON.parse(JSON.stringify(g)),this.emit("annotationChange",{action:"select",changedItem:g,imageUrl:this.imageUrl}),this.render();return}}else this.activeAnnotation=null,this.emit("annotationChange",{action:"select",changedItem:void 0,imageUrl:this.imageUrl}),this.render();return}if(this.interactionMode==="draw"){if(this.isDrawing&&this.currentTool==="polygon"&&this.activeAnnotation){const m=this.activeAnnotation.coordinates;if(m.points.length>2&&H(i,m.points[0])<20/this.scale){this.finishDrawing();return}this.startDrawing(i);return}if(this.currentTool){if(this.currentTool==="polygon"&&!this.isDrawing){this.startDrawing(i);return}this.startDrawing(i)}return}this.activeAnnotation=null,this.render()}handleMouseMove(e){const a=this.canvas.getBoundingClientRect(),n=e.clientX-a.left,c=e.clientY-a.top,i=this.toImageCoords(n,c);if(this.isPanning&&this.panStartPoint){const l=n-this.panStartPoint.x,g=c-this.panStartPoint.y;this.offset.x+=l,this.offset.y+=g,this.clampViewportOffset(),this.panStartPoint={x:n,y:c},this.render();return}if(this.lastMouseMovePoint=i,this.isDrawing){if(this.currentTool==="polygon"&&this.activeAnnotation){const l=this.activeAnnotation.coordinates;if(l.points.length>2){const g=l.points[0],m=H(i,g);this.isHoveringStartPoint=m<20/this.scale}else this.isHoveringStartPoint=!1}this.updateDrawing(i)}else this.isDragging&&this.activeAnnotation&&this.dragStartPoint?this.updateDragging(i):this.checkHover(n,c,i);this.render()}handleMouseUp(e){if(this.isPanning){this.isPanning=!1,this.panStartPoint=null,this.canvas.style.cursor="grab";return}if(this.isDrawing){if(this.currentTool==="polygon"){this.render();return}this.finishDrawing()}else this.isDragging&&this.activeAnnotation&&this.emit("annotationChange",{action:"update",changedItem:this.activeAnnotation,imageUrl:this.imageUrl});this.currentTool!=="polygon"&&(this.isDrawing=!1),this.isDragging=!1,this.dragStartPoint=null,this.selectedHandleIndex=-1,this.render()}hexToRgba(e,a){if(!e.startsWith("#"))return e;const n=parseInt(e.slice(1,3),16),c=parseInt(e.slice(3,5),16),i=parseInt(e.slice(5,7),16);return`rgba(${n}, ${c}, ${i}, ${a})`}startDrawing(e){if(!this.currentTool)return;const a=Date.now().toString();if(this.hexToRgba(this.currentLabelColor,.2),this.currentLabelColor,this.currentTool==="rectangle")this.isDrawing=!0,this.dragStartPoint=e,this.activeAnnotation={id:a,type:"rectangle",label:"",coordinates:{x1:e.x,y1:e.y,x2:e.x,y2:e.y},style:{strokeColor:this.currentLabelColor}};else if(this.currentTool==="point"){const n={id:a,type:"point",label:"",coordinates:{points:[e]},style:{strokeColor:this.currentLabelColor}};this.annotations.push(n),this.emit("annotationChange",{action:"add",changedItem:n,imageUrl:this.imageUrl}),this.activeAnnotation=n}else if(this.currentTool==="polygon")this.activeAnnotation&&this.activeAnnotation.type==="polygon"&&this.isDrawing?this.activeAnnotation.coordinates.points.push(e):(this.isDrawing=!0,this.activeAnnotation={id:a,type:"polygon",label:"",coordinates:{points:[e]},style:{strokeColor:this.currentLabelColor}});else if(this.currentTool==="category"){const n={id:a,type:"category",label:"",coordinates:{x:e.x,y:e.y},style:{strokeColor:this.currentLabelColor}};this.annotations.push(n),this.emit("annotationChange",{action:"add",changedItem:n,imageUrl:this.imageUrl}),this.activeAnnotation=n}else this.currentTool==="rotatedRect"&&(this.isDrawing=!0,this.dragStartPoint=e,this.activeAnnotation={id:a,type:"rotatedRect",label:"",coordinates:{x:e.x,y:e.y,width:0,height:0,angle:0},style:{strokeColor:this.currentLabelColor}})}updateDrawing(e){if(this.activeAnnotation)if(this.activeAnnotation.type==="rectangle"&&this.dragStartPoint){const a=this.activeAnnotation.coordinates;a.x2=e.x,a.y2=e.y}else if(this.activeAnnotation.type==="rotatedRect"&&this.dragStartPoint){const a=this.activeAnnotation.coordinates,n=Math.abs(e.x-this.dragStartPoint.x),c=Math.abs(e.y-this.dragStartPoint.y);a.width=n*2,a.height=c*2}else this.activeAnnotation.type}finishDrawing(){if(this.activeAnnotation){if(this.activeAnnotation.type==="rectangle"){const e=this.activeAnnotation.coordinates;if(Math.abs(e.x1-e.x2)<2||Math.abs(e.y1-e.y2)<2){this.activeAnnotation=null,this.isDrawing=!1;return}const a=Math.min(e.x1,e.x2),n=Math.max(e.x1,e.x2),c=Math.min(e.y1,e.y2),i=Math.max(e.y1,e.y2);e.x1=a,e.x2=n,e.y1=c,e.y2=i,this.annotations.push(this.activeAnnotation),this.emit("annotationChange",{action:"add",changedItem:this.activeAnnotation,imageUrl:this.imageUrl})}else if(this.activeAnnotation.type==="polygon"){if(this.activeAnnotation.coordinates.points.length<3){this.activeAnnotation=null,this.isDrawing=!1;return}this.annotations.push(this.activeAnnotation),this.emit("annotationChange",{action:"add",changedItem:this.activeAnnotation,imageUrl:this.imageUrl})}else if(this.activeAnnotation.type==="rotatedRect"){const e=this.activeAnnotation.coordinates;if(e.width<2||e.height<2){this.activeAnnotation=null,this.isDrawing=!1;return}this.annotations.push(this.activeAnnotation),this.emit("annotationChange",{action:"add",changedItem:this.activeAnnotation,imageUrl:this.imageUrl})}this.activeAnnotation.type}this.isDrawing=!1}updateDragging(e){if(!this.activeAnnotation||!this.dragStartPoint||!this.dragStartAnnotation)return;const a=e.x-this.dragStartPoint.x,n=e.y-this.dragStartPoint.y;this.selectedHandleIndex===-1?this.moveAnnotation(this.activeAnnotation,this.dragStartAnnotation,a,n):this.resizeAnnotation(this.activeAnnotation,this.dragStartAnnotation,this.selectedHandleIndex,e)}moveAnnotation(e,a,n,c){if(e.type==="rectangle"){const i=a.coordinates,l=e.coordinates;l.x1=i.x1+n,l.x2=i.x2+n,l.y1=i.y1+c,l.y2=i.y2+c}else if(e.type==="point"){const i=a.coordinates,l=e.coordinates;l.points=i.points.map(g=>({x:g.x+n,y:g.y+c}))}else if(e.type==="rotatedRect"){const i=a.coordinates,l=e.coordinates;l.x=i.x+n,l.y=i.y+c}else if(e.type==="polygon"){const i=a.coordinates,l=e.coordinates;l.points=i.points.map(g=>({x:g.x+n,y:g.y+c}))}else if(e.type==="category"){const i=a.coordinates,l=e.coordinates;i&&l&&(l.x=i.x+n,l.y=i.y+c)}}resizeAnnotation(e,a,n,c){if(e.type==="rectangle"){const i=e.coordinates;n===0&&(i.x1=c.x,i.y1=c.y),n===1&&(i.x2=c.x,i.y1=c.y),n===2&&(i.x2=c.x,i.y2=c.y),n===3&&(i.x1=c.x,i.y2=c.y)}else if(e.type==="polygon"){const i=e.coordinates;n>=0&&n<i.points.length&&(i.points[n]=c)}else if(e.type==="point"){const i=e.coordinates;n>=0&&n<i.points.length&&(i.points[n]=c)}else if(e.type==="rotatedRect"){const i=e.coordinates;if(n===-2){const l=i.x,g=i.y,m=c.x-l,h=c.y-g;let _=Math.atan2(h,m)*180/Math.PI;_+=90,i.angle=_}else{const l=i.angle*Math.PI/180,g=Math.cos(-l),m=Math.sin(-l),h=c.x-i.x,_=c.y-i.y,u=h*g-_*m,B=h*m+_*g;(n===0||n===3)&&(i.width/2,i.width=Math.abs(u)*2),(n===1||n===2)&&(i.width=Math.abs(u)*2),(n===0||n===1)&&(i.height=Math.abs(B)*2),(n===2||n===3)&&(i.height=Math.abs(B)*2)}}}getHitAnnotation(e){for(let a=this.annotations.length-1;a>=0;a--){const n=this.annotations[a];if(this.isPointInAnnotation(e,n))return n}return null}isPointInAnnotation(e,a){if(a.type==="rectangle"){const n=a.coordinates;return e.x>=n.x1&&e.x<=n.x2&&e.y>=n.y1&&e.y<=n.y2}else if(a.type==="polygon"){const n=a.coordinates;return ht(e,n.points)}else if(a.type==="rotatedRect"){const n=a.coordinates,c=et(e,{x:n.x,y:n.y},-n.angle),i=n.width/2,l=n.height/2;return c.x>=n.x-i&&c.x<=n.x+i&&c.y>=n.y-l&&c.y<=n.y+l}else if(a.type==="point")return a.coordinates.points.some(c=>H(e,c)<10/this.scale);return!1}getHitHandle(e,a,n){const c=this.getAnnotationHandles(n),i=6;for(let l=0;l<c.length;l++){const g=c[l],m=this.toScreenCoords(g.x,g.y);if(Math.abs(e-m.x)<i&&Math.abs(a-m.y)<i)return n.type==="rotatedRect"&&l===4?-2:l}return-100}getAnnotationHandles(e){if(e.type==="rectangle"){const a=e.coordinates;return[{x:a.x1,y:a.y1},{x:a.x2,y:a.y1},{x:a.x2,y:a.y2},{x:a.x1,y:a.y2}]}else{if(e.type==="polygon")return e.coordinates.points;if(e.type==="point")return e.coordinates.points;if(e.type==="rotatedRect"){const a=e.coordinates,n={x:a.x,y:a.y},c=a.width/2,i=a.height/2,l={x:a.x-c,y:a.y-i},g={x:a.x+c,y:a.y-i},m={x:a.x+c,y:a.y+i},h={x:a.x-c,y:a.y+i},_={x:a.x,y:a.y-i-20/this.scale};return[l,g,m,h,_].map(u=>et(u,n,a.angle))}}return[]}checkHover(e,a,n){const c=this.getHitCategory(e,a);if(c){this.canvas.style.cursor="pointer",this.hoverAnnotation=c;return}if(this.activeAnnotation&&this.getHitHandle(e,a,this.activeAnnotation)!==-100){this.canvas.style.cursor="pointer";return}const i=this.getHitAnnotation(n);i?(this.canvas.style.cursor="move",this.hoverAnnotation=i):(this.canvas.style.cursor="default",this.hoverAnnotation=null)}render(){if(this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),!this.img.complete||this.img.width===0){this.ctx.save(),this.ctx.fillStyle="#999",this.ctx.font="14px sans-serif",this.ctx.textAlign="center",this.ctx.textBaseline="middle",this.ctx.fillText("Loading image...",this.canvas.width/2,this.canvas.height/2),this.ctx.restore();return}this.ctx.drawImage(this.img,this.offset.x,this.offset.y,this.img.width*this.scale,this.img.height*this.scale),this.annotations.forEach(e=>{e!==this.activeAnnotation&&this.drawItem(e,!1)}),this.activeAnnotation&&this.drawItem(this.activeAnnotation,!0),this.renderCategories()}renderCategories(){const e=this.annotations.filter(n=>n.type==="category");if(e.length===0)return;this.ctx.save(),this.ctx.font="14px sans-serif",this.ctx.textBaseline="middle",this.ctx.textAlign="center";const a=12;e.forEach(n=>{var b;const c=n.label||"未命名分类",i=this.ctx.measureText(c).width+a*2,l=28,g=this.activeAnnotation===n,m=this.hoverAnnotation===n;let h={x:20,y:20};n.coordinates&&typeof n.coordinates.x=="number"&&typeof n.coordinates.y=="number"&&(h=this.toScreenCoords(n.coordinates.x,n.coordinates.y));const _=h.x-i/2,u=h.y-l/2,B=((b=n.style)==null?void 0:b.strokeColor)||"#2196F3";this.ctx.fillStyle=g?B:this.hexToRgba(B,.85),m&&!g&&(this.ctx.fillStyle=B),g?(this.ctx.strokeStyle="#ffffff",this.ctx.lineWidth=2):(this.ctx.strokeStyle="transparent",this.ctx.lineWidth=0),this.ctx.beginPath(),this.ctx.roundRect(_,u,i,l,6),this.ctx.fill(),g&&(this.ctx.stroke(),this.ctx.save(),this.ctx.strokeStyle=B,this.ctx.lineWidth=2,this.ctx.strokeRect(_-3,u-3,i+6,l+6),this.ctx.restore()),this.ctx.fillStyle="#ffffff",this.ctx.fillText(c,h.x,h.y)}),this.ctx.restore()}getHitCategory(e,a){const n=this.annotations.filter(g=>g.type==="category");if(n.length===0)return null;this.ctx.save(),this.ctx.font="14px sans-serif";const c=12,i=28;let l=null;for(let g=n.length-1;g>=0;g--){const m=n[g],h=m.label||"未命名分类",_=this.ctx.measureText(h).width+c*2;let u={x:20,y:20};m.coordinates&&typeof m.coordinates.x=="number"&&typeof m.coordinates.y=="number"&&(u=this.toScreenCoords(m.coordinates.x,m.coordinates.y));const B=u.x-_/2,b=u.y-i/2;if(e>=B&&e<=B+_&&a>=b&&a<=b+i){l=m;break}}return this.ctx.restore(),l}drawItem(e,a){var i;if(this.visibleLabels.size>0&&!this.visibleLabels.has(e.label)&&!a)return;this.ctx.save();const n=((i=e.style)==null?void 0:i.strokeColor)||"#FF4081",c=a?"#00E5FF":n;if(this.ctx.strokeStyle=c,this.ctx.lineWidth=2,e.type==="rectangle"){const l=e.coordinates,g=this.toScreenCoords(l.x1,l.y1),m=this.toScreenCoords(l.x2,l.y2),h=Math.min(g.x,m.x),_=Math.min(g.y,m.y),u=Math.abs(g.x-m.x),B=Math.abs(g.y-m.y);this.ctx.strokeRect(h,_,u,B),a&&this.drawHandles(this.getAnnotationHandles(e))}else if(e.type==="polygon"){const l=e.coordinates;if(l.points.length===0){this.ctx.restore();return}this.ctx.beginPath();const g=this.toScreenCoords(l.points[0].x,l.points[0].y);this.ctx.moveTo(g.x,g.y);for(let m=1;m<l.points.length;m++){const h=this.toScreenCoords(l.points[m].x,l.points[m].y);this.ctx.lineTo(h.x,h.y)}if(!this.isDrawing||e!==this.activeAnnotation)this.ctx.closePath();else if(this.lastMouseMovePoint){let m=this.lastMouseMovePoint;if(this.isHoveringStartPoint&&l.points.length>0){m=l.points[0];const _=this.toScreenCoords(l.points[0].x,l.points[0].y);this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(_.x,_.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()}const h=this.toScreenCoords(m.x,m.y);this.ctx.lineTo(h.x,h.y)}this.ctx.stroke(),a&&this.drawHandles(this.getAnnotationHandles(e))}else if(e.type==="rotatedRect"){const l=e.coordinates;this.ctx.translate(this.toScreenCoords(l.x,l.y).x,this.toScreenCoords(l.x,l.y).y),this.ctx.rotate(l.angle*Math.PI/180);const g=l.width*this.scale,m=l.height*this.scale;this.ctx.strokeRect(-g/2,-m/2,g,m),this.ctx.rotate(-l.angle*Math.PI/180),this.ctx.translate(-this.toScreenCoords(l.x,l.y).x,-this.toScreenCoords(l.x,l.y).y),a&&this.drawHandles(this.getAnnotationHandles(e))}else e.type==="point"&&e.coordinates.points.forEach(g=>{const m=this.toScreenCoords(g.x,g.y);this.ctx.beginPath(),this.ctx.arc(m.x,m.y,5,0,Math.PI*2),this.ctx.fillStyle=a?"#00E5FF":n,this.ctx.fill(),this.ctx.stroke()});this.showLabels&&e.label&&e.type!=="category"&&this.drawAnnotationLabel(e,n),this.ctx.restore()}drawAnnotationLabel(e,a){let n=0,c=0;if(e.type==="rectangle"){const i=e.coordinates,l=this.toScreenCoords(Math.min(i.x1,i.x2),Math.min(i.y1,i.y2));n=l.x,c=l.y-8}else if(e.type==="polygon"){const i=e.coordinates;if(i.points.length>0){const l=this.toScreenCoords(i.points[0].x,i.points[0].y);n=l.x,c=l.y-8}}else if(e.type==="rotatedRect"){const i=e.coordinates,l=this.toScreenCoords(i.x,i.y-i.height/2);n=l.x,c=l.y-8}else if(e.type==="point"){const i=e.coordinates;if(i.points.length>0){const l=this.toScreenCoords(i.points[0].x,i.points[0].y);n=l.x,c=l.y-8}}if(n!==0||c!==0){this.ctx.save(),this.ctx.font="12px sans-serif",this.ctx.textBaseline="bottom";const i=e.label,l=this.ctx.measureText(i).width,g=8,m=4;this.ctx.fillStyle=this.hexToRgba(a,.8),this.ctx.beginPath(),this.ctx.roundRect(n,c-14-m,l+g*2,14+m*2,4),this.ctx.fill(),this.ctx.fillStyle="#FFFFFF",this.ctx.fillText(i,n+g,c),this.ctx.restore()}}drawHandles(e){this.ctx.fillStyle="#FFFFFF",this.ctx.strokeStyle="#000000",this.ctx.lineWidth=1,e.forEach(a=>{const n=this.toScreenCoords(a.x,a.y);this.ctx.fillRect(n.x-4,n.y-4,8,8),this.ctx.strokeRect(n.x-4,n.y-4,8,8)})}}const gt='<?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>',mt='<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>',pt='<?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>',ft='<?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>',yt='<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>',ut='<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>',xt='<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>',wt='<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>',vt='<?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>',bt='<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>',kt='<?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>',Ct='<?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>',_t='<?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>',St='<?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>',Et='<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>',Bt='<?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>',It='<?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>',At='<?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>',Vt=["innerHTML"],Nt=t.defineComponent({__name:"SvgIcon",props:{name:{},size:{}},setup(w){const e=w,a=t.ref(""),n=Object.assign({"../assets/svg/aim.svg":gt,"../assets/svg/back.svg":mt,"../assets/svg/connection.svg":pt,"../assets/svg/crop.svg":ft,"../assets/svg/delete.svg":yt,"../assets/svg/download.svg":ut,"../assets/svg/edit.svg":xt,"../assets/svg/first.svg":wt,"../assets/svg/hide.svg":vt,"../assets/svg/last.svg":bt,"../assets/svg/pointer.svg":kt,"../assets/svg/price-tag.svg":Ct,"../assets/svg/rank.svg":_t,"../assets/svg/refresh-right.svg":St,"../assets/svg/right.svg":Et,"../assets/svg/view.svg":Bt,"../assets/svg/zoom-in.svg":It,"../assets/svg/zoom-out.svg":At});return t.watchEffect(()=>{const c=`../assets/svg/${e.name}.svg`,i=n[c];i?a.value=i:(console.warn(`Icon ${e.name} not found at path ${c}`),a.value="")}),(c,i)=>(t.openBlock(),t.createElementBlock("i",{class:t.normalizeClass(["svg-icon",[w.size?`size-${w.size}`:""]]),innerHTML:a.value},null,10,Vt))}}),J=(w,e)=>{const a=w.__vccOpts||w;for(const[n,c]of e)a[n]=c;return a},A=J(Nt,[["__scopeId","data-v-3928607b"]]),Tt={key:0,class:"image-list-sidebar"},Dt={class:"image-list-header"},Mt=["onClick"],zt={class:"image-list-stage"},Lt=["src","alt"],Pt={key:0,class:"thumb-overlay-layer"},$t={key:1,class:"thumb-overlay-svg",viewBox:"0 0 100 100",preserveAspectRatio:"none"},Rt=["points"],Ht={class:"image-list-text"},Ot={class:"center-sidebar"},Ut={key:0,class:"left-sidebar"},Ft=["onClick","title"],Wt={key:0,class:"divider"},Gt={class:"center-area"},Yt={key:0,class:"floating-label-selector"},Jt={key:0,class:"current-label"},jt={class:"label-name"},Xt={key:1,class:"current-label empty"},qt={key:0,class:"selector-dropdown"},Kt={key:0,class:"dropdown-empty"},Zt=["onClick"],Qt={class:"label-name"},te={key:0,class:"batch-nav"},ee=["disabled"],ne=["disabled"],oe=["disabled"],se=["disabled"],ie={key:1,class:"right-sidebar"},ae={class:"label-list"},le={class:"label-row"},ce=["onUpdate:modelValue","onChange"],re=["title"],he=["onClick"],de={class:"action-icon more-actions"},ge=["onClick"],me={class:"modal-content"},pe={class:"modal-body"},fe={class:"form-group"},ye={class:"form-group"},ue={class:"color-input-wrapper"},xe={class:"color-value"},we={class:"modal-actions"},ve=["disabled"],nt=J(t.defineComponent({__name:"ImageAnnotator",props:{annotationTypes:{default:()=>["rectangle","polygon","point","rotatedRect","category"]},batchImages:{default:()=>[]},labels:{default:()=>[]},defaultActiveType:{},theme:{default:"light"},readOnly:{type:Boolean,default:!1},image:{},predictionCandidates:{},session:{},requestId:{},minZoom:{},maxZoom:{}},emits:["annotationChange","batchChange","labelChange","ready","error","tool:change","viewport:change","annotation:add","annotation:update","annotation:delete","annotation:select","prediction:loaded","prediction:apply","prediction:reject"],setup(w,{expose:e,emit:a}){const n=w,c=a,i=t.ref(null),l=t.ref(null),g=t.ref(null),m=t.ref([]),h=t.ref(null),_=t.ref(null),u=t.ref(0),B=t.ref(""),b=t.ref([]),V=t.ref(""),O=t.ref(!1),v=t.ref({name:"",color:"#FF0000"}),S=t.ref("none"),y=t.ref([]),N=t.ref({}),M=t.computed(()=>_.value==="select"&&!!B.value),P=t.ref(!1),U=t.computed(()=>b.value.find(o=>o.id===V.value)),st=o=>{o.stopPropagation(),P.value=!P.value},it=o=>{W(o),P.value=!1};t.onMounted(()=>{document.addEventListener("click",o=>{o.target.closest(".floating-label-selector")||(P.value=!1)})});const j=o=>{if(!o||N.value[o])return;const s=new Image;s.onload=()=>{const r=s.naturalWidth||1,d=s.naturalHeight||1;N.value={...N.value,[o]:{width:r,height:d}}},s.src=o},X=()=>{n.batchImages.forEach(o=>{j(o.imageUrl)})},K=(o,s)=>{m.value[s]=o},F=(o=u.value)=>{const s=g.value,r=m.value[o];if(!s||!r)return;const d=s.scrollTop,p=d+s.clientHeight,C=r.offsetTop,I=C+r.offsetHeight;if(C<d){s.scrollTo({top:Math.max(C-8,0),behavior:"smooth"});return}I>p&&s.scrollTo({top:I-s.clientHeight+8,behavior:"smooth"})},R=()=>{var r,d,p,C;const o=n.batchImages[u.value],s=(o==null?void 0:o.imageUrl)||((r=n.image)==null?void 0:r.url);return{eventId:`${Date.now()}-${Math.random().toString(36).slice(2,10)}`,timestamp:Date.now(),requestId:n.requestId,taskId:(d=n.session)==null?void 0:d.taskId,imageId:((p=n.image)==null?void 0:p.id)||s,operator:(C=n.session)==null?void 0:C.userId}},f=o=>{var d;const s=o==null?void 0:o.action;if(!s)return;const r={meta:R(),action:s,current:o==null?void 0:o.changedItem,source:(d=o==null?void 0:o.changedItem)!=null&&d.predictionId?"prediction":"manual"};s==="add"&&c("annotation:add",r),s==="update"&&c("annotation:update",r),s==="delete"&&c("annotation:delete",r),s==="select"&&c("annotation:select",r)},x=t.computed(()=>n.annotationTypes),k=o=>({rectangle:"crop",polygon:"connection",point:"aim",rotatedRect:"refresh-right",category:"price-tag"})[o]||o,z=o=>({rectangle:"矩形框",polygon:"多边形",point:"关键点",rotatedRect:"旋转矩形",category:"分类标签"})[o]||o;t.onMounted(()=>{if(X(),i.value){h.value=new dt(i.value),h.value.setShowLabels(n.readOnly),h.value.on("annotationChange",s=>{var r,d;if(s.action==="add"&&s.changedItem){const p=b.value.find(C=>C.id===V.value);p&&(s.changedItem.label=p.name,s.changedItem.labelId=p.id)}s.action==="select"?B.value=((r=s.changedItem)==null?void 0:r.id)||"":s.action==="delete"&&((d=s.changedItem)==null?void 0:d.id)===B.value&&(B.value=""),c("annotationChange",s),f(s)}),L(),D();const o=new ResizeObserver(()=>{var s;(s=h.value)==null||s.resize()});l.value&&o.observe(l.value),n.defaultActiveType&&$(n.defaultActiveType),t.nextTick(()=>F()),c("ready",{meta:R()})}});const D=()=>{if(!h.value)return;const o=b.value.find(r=>r.id===V.value);o&&h.value.setLabelStyle(o.color);const s=b.value.filter(r=>r.visible).map(r=>r.name);h.value.setVisibleLabels(s)},L=()=>{var o;if(h.value)if(B.value="",requestAnimationFrame(()=>{var s;(s=h.value)==null||s.resize()}),n.batchImages.length>0){const s=n.batchImages[u.value];h.value.loadImage(s.imageUrl),s.annotations?h.value.setAnnotations(s.annotations):h.value.setAnnotations([])}else(o=n.image)!=null&&o.url&&h.value.loadImage(n.image.url)},$=o=>{var s,r;if(_.value=o,B.value="",o!=="pan"&&o!=="select"&&b.value.length===0){alert("请先创建标签!");return}o==="pan"||o==="select"?(s=h.value)==null||s.setTool(o):(r=h.value)==null||r.setTool(o),c("tool:change",{meta:R(),tool:o})},Ze=()=>{var o;(o=h.value)!=null&&o.activeAnnotation&&h.value.deleteAnnotation(h.value.activeAnnotation.id)},at=()=>{h.value&&c("viewport:change",{meta:R(),scale:h.value.scale,offset:{...h.value.offset}})},Qe=()=>{var o;(o=h.value)==null||o.zoom(1),at()},tn=()=>{var o;(o=h.value)==null||o.zoom(-1),at()},en=()=>{v.value={name:"",color:"#2196F3"},O.value=!0},Z=()=>{O.value=!1},nn=()=>{if(!v.value.name.trim()){alert("请输入标签名称");return}const s={id:Date.now().toString(),name:v.value.name,color:v.value.color,visible:!0};b.value.push(s),c("labelChange",b.value),D(),b.value.length===1&&W(s),Z()},W=o=>{var s;V.value=o.id,(s=h.value)==null||s.setLabelStyle(o.color)},on=(o,s)=>{if(!o.startsWith("#"))return o;let r=0,d=0,p=0;return o.length===4?(r=parseInt(o[1]+o[1],16),d=parseInt(o[2]+o[2],16),p=parseInt(o[3]+o[3],16)):o.length===7&&(r=parseInt(o.slice(1,3),16),d=parseInt(o.slice(3,5),16),p=parseInt(o.slice(5,7),16)),`rgba(${r}, ${d}, ${p}, ${s})`},sn=o=>{var s;if(o.id===V.value&&((s=h.value)==null||s.setLabelStyle(o.color)),h.value){const r=h.value.getAnnotations();let d=!1;r.forEach(p=>{p.label===o.name&&(p.style||(p.style={}),p.style.strokeColor=o.color,p.style.fillColor=on(o.color,.2),d=!0)}),d&&h.value.render()}c("labelChange",b.value),D()},an=o=>{o.visible=!o.visible,D()},ln=o=>{const s=b.value.findIndex(r=>r.id===o);s>-1&&(b.value.splice(s,1),c("labelChange",b.value),V.value===o&&(V.value=b.value.length>0?b.value[0].id:"",V.value&&W(b.value[0])),D())};t.watch(()=>n.labels,o=>{const s=JSON.parse(JSON.stringify(o||[]));if(b.value=s,b.value.length>0)if(!V.value||!b.value.find(r=>r.id===V.value))W(b.value[0]);else{const r=b.value.find(d=>d.id===V.value);r&&W(r)}else V.value="";D()},{immediate:!0,deep:!0});const cn=()=>{u.value>0&&(Q(),u.value--,L(),tt())},rn=()=>{u.value<n.batchImages.length-1&&(Q(),u.value++,L(),tt())},hn=()=>{u.value>0&&q(0)},dn=()=>{u.value<n.batchImages.length-1&&q(n.batchImages.length-1)},Q=()=>{if(h.value){const o=h.value.getAnnotations();n.batchImages[u.value].annotations=o}},tt=()=>{const o=n.batchImages[u.value];c("batchChange",{currentIndex:u.value,total:n.batchImages.length,currentImageUrl:o.imageUrl,currentAnnotations:o.annotations||[]})},lt=(o=[])=>{var p;if(!h.value)return;if(y.value=JSON.parse(JSON.stringify(o)),y.value.length===0){S.value="none";return}S.value="loaded";const r=(h.value.getAnnotations()||[]).filter(C=>!C.predictionId),d=y.value.map(C=>{const I=JSON.parse(JSON.stringify(C.annotation));return I.id=I.id||`pred-${C.id}`,I.predictionId=C.id,I.modelRunId=C.modelRunId||I.modelRunId,I.confidence=C.confidence??I.confidence,I.reviewStatus=I.reviewStatus||"draft",I});h.value.setAnnotations([...r,...d]),c("prediction:loaded",{meta:R(),modelRunId:(p=y.value[0])==null?void 0:p.modelRunId,candidates:y.value})},gn=(o,s)=>{var p;if(!h.value)return[];S.value="applying";const d=(h.value.getAnnotations()||[]).filter(C=>C.predictionId&&o.includes(C.predictionId));return d.forEach(C=>{C.reviewStatus="accepted"}),S.value="applied",c("prediction:apply",{meta:R(),modelRunId:(p=d[0])==null?void 0:p.modelRunId,candidateIds:o,threshold:s,acceptedAnnotations:d}),h.value.render(),d},mn=(o,s)=>{var p;if(!h.value)return;const r=h.value.getAnnotations()||[],d=r.filter(C=>!(C.predictionId&&o.includes(C.predictionId)));h.value.setAnnotations(d),c("prediction:reject",{meta:R(),modelRunId:(p=r.find(C=>C.predictionId&&o.includes(C.predictionId)))==null?void 0:p.modelRunId,candidateIds:o,reason:s})},pn=(o,s=[])=>{h.value&&(h.value.loadImage(o.url),h.value.setAnnotations(s))},fn=o=>{var s;(s=h.value)==null||s.setAnnotations(o)},ct=()=>{var o;return((o=h.value)==null?void 0:o.getAnnotations())||[]},yn=(o="json")=>{var r,d;const s=ct();return{format:o,image:((r=n.batchImages[u.value])==null?void 0:r.imageUrl)||((d=n.image)==null?void 0:d.url)||"",annotations:s}},q=o=>{o>=0&&o<n.batchImages.length&&(Q(),u.value=o,L(),tt())},un=o=>{var s;return o===u.value&&h.value?h.value.getAnnotations()||[]:((s=n.batchImages[o])==null?void 0:s.annotations)||[]},xn=o=>o.type==="rectangle",wn=o=>o.type==="polygon",vn=o=>o.type==="point",bn=o=>o.type==="rotatedRect",kn=o=>o.type==="category",G=o=>{var r,d;const s=(r=b.value.find(p=>p.name===o.label))==null?void 0:r.color;return((d=o.style)==null?void 0:d.strokeColor)||s||"#409eff"},rt=o=>{const s=o.coordinates;return(s==null?void 0:s.points)||[]},Y=o=>{const s=n.batchImages[o];if(s!=null&&s.width&&(s!=null&&s.height))return{width:s.width,height:s.height};const r=s!=null&&s.imageUrl?N.value[s.imageUrl]:void 0;return r||(s!=null&&s.imageUrl&&j(s.imageUrl),{width:1,height:1})},Cn=o=>{const s=n.batchImages[o];return s!=null&&s.width&&(s!=null&&s.height)?!0:s!=null&&s.imageUrl?!!N.value[s.imageUrl]:!1},_n=(o,s)=>{const r=s.coordinates,d=Y(o),p=G(s),C=Math.min(r.x1,r.x2),I=Math.min(r.y1,r.y2),Vn=Math.max(r.x1,r.x2),Nn=Math.max(r.y1,r.y2);return{left:`${C/d.width*100}%`,top:`${I/d.height*100}%`,width:`${(Vn-C)/d.width*100}%`,height:`${(Nn-I)/d.height*100}%`,borderColor:p,backgroundColor:`${p}22`}},Sn=(o,s)=>{const r=Y(o);return rt(s).map(d=>`${d.x/r.width*100},${d.y/r.height*100}`).join(" ")},En=o=>{const s=G(o);return{fill:`${s}33`,stroke:s,strokeWidth:"1.4"}},Bn=(o,s,r)=>{const d=Y(o),p=G(r);return{left:`${s.x/d.width*100}%`,top:`${s.y/d.height*100}%`,backgroundColor:p}},In=(o,s)=>{const r=s.coordinates,d=Y(o),p=G(s),C=Math.abs(r.width),I=Math.abs(r.height);return{left:`${(r.x-C/2)/d.width*100}%`,top:`${(r.y-I/2)/d.height*100}%`,width:`${C/d.width*100}%`,height:`${I/d.height*100}%`,transform:`rotate(${r.angle||0}deg)`,borderColor:p,backgroundColor:`${p}22`}},An=(o,s)=>{const r=s.coordinates,d=Y(o),p=G(s);return{left:`${r.x/d.width*100}%`,top:`${r.y/d.height*100}%`,backgroundColor:`${p}d9`}};return e({jumpTo:q,setImage:pn,setAnnotations:fn,getAnnotations:ct,selectTool:$,loadPredictionCandidates:lt,applyPredictions:gn,rejectPredictions:mn,exportAnnotations:yn,getAllAnnotations:()=>{var o,s;return n.batchImages.length>0?n.batchImages:[{imageUrl:((o=n.image)==null?void 0:o.url)||"",annotations:((s=h.value)==null?void 0:s.getAnnotations())||[]}]},getCurrentAnnotation:()=>{var o,s,r;return{imageUrl:((o=n.batchImages[u.value])==null?void 0:o.imageUrl)||((s=n.image)==null?void 0:s.url)||"",annotations:((r=h.value)==null?void 0:r.getAnnotations())||[]}}}),t.watch(()=>{var o;return(o=n.image)==null?void 0:o.url},()=>{var o;n.batchImages.length===0&&((o=n.image)!=null&&o.url)&&L()}),t.watch(()=>n.predictionCandidates,o=>{o&<(o)},{immediate:!0,deep:!0}),t.watch(()=>n.batchImages.map(o=>`${o.imageUrl}:${o.width||""}x${o.height||""}`),()=>{X(),m.value=m.value.slice(0,n.batchImages.length),t.nextTick(()=>F())},{immediate:!0}),t.watch(()=>u.value,()=>{t.nextTick(()=>F())}),t.watch(()=>n.readOnly,o=>{h.value&&h.value.setShowLabels(o)}),(o,s)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["annotation-container",w.theme])},[w.batchImages&&w.batchImages.length>0?(t.openBlock(),t.createElementBlock("div",Tt,[t.createElementVNode("div",Dt,"共 "+t.toDisplayString(w.batchImages.length)+" 张",1),t.createElementVNode("div",{ref_key:"imageListScrollRef",ref:g,class:"image-list-scroll"},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(w.batchImages,(r,d)=>(t.openBlock(),t.createElementBlock("button",{key:`${r.imageUrl}-${d}`,ref_for:!0,ref:p=>K(p,d),class:t.normalizeClass(["image-list-item",{active:d===u.value}]),onClick:p=>q(d)},[t.createElementVNode("div",zt,[t.createElementVNode("img",{src:r.imageUrl,alt:`第${d+1}张`,class:"image-list-thumb"},null,8,Lt),Cn(d)?(t.openBlock(),t.createElementBlock("div",Pt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(un(d),p=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:p.id},[xn(p)?(t.openBlock(),t.createElementBlock("div",{key:0,class:"thumb-overlay-rect",style:t.normalizeStyle(_n(d,p))},null,4)):wn(p)?(t.openBlock(),t.createElementBlock("svg",$t,[t.createElementVNode("polygon",{points:Sn(d,p),style:t.normalizeStyle(En(p))},null,12,Rt)])):vn(p)?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:2},t.renderList(rt(p),(C,I)=>(t.openBlock(),t.createElementBlock("div",{key:`${p.id}-${I}`,class:"thumb-overlay-point",style:t.normalizeStyle(Bn(d,C,p))},null,4))),128)):bn(p)?(t.openBlock(),t.createElementBlock("div",{key:3,class:"thumb-overlay-rotated",style:t.normalizeStyle(In(d,p))},null,4)):kn(p)?(t.openBlock(),t.createElementBlock("div",{key:4,class:"thumb-overlay-category",style:t.normalizeStyle(An(d,p))},t.toDisplayString(p.label),5)):t.createCommentVNode("",!0)],64))),128))])):t.createCommentVNode("",!0)]),t.createElementVNode("span",Ht,"第 "+t.toDisplayString(d+1)+" 张",1)],10,Mt))),128))],512)])):t.createCommentVNode("",!0),t.createElementVNode("div",Ot,[w.readOnly?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",Ut,[t.createElementVNode("div",{class:t.normalizeClass(["tool-btn",{active:_.value==="pan"}]),onClick:s[0]||(s[0]=r=>$("pan")),title:"拖动"},[t.createVNode(A,{name:"rank"})],2),t.createElementVNode("div",{class:t.normalizeClass(["tool-btn",{active:_.value==="select"}]),onClick:s[1]||(s[1]=r=>$("select")),title:"选择"},[t.createVNode(A,{name:"pointer"})],2),s[5]||(s[5]=t.createElementVNode("div",{class:"divider"},null,-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(x.value,r=>(t.openBlock(),t.createElementBlock("div",{key:r,class:t.normalizeClass(["tool-btn",{active:_.value===r}]),onClick:d=>$(r),title:z(r)},[t.createVNode(A,{name:k(r)},null,8,["name"])],10,Ft))),128)),s[6]||(s[6]=t.createElementVNode("div",{class:"divider"},null,-1)),t.createElementVNode("div",{class:"tool-btn",onClick:Qe,title:"放大"},[t.createVNode(A,{name:"zoom-in"})]),t.createElementVNode("div",{class:"tool-btn",onClick:tn,title:"缩小"},[t.createVNode(A,{name:"zoom-out"})]),M.value?(t.openBlock(),t.createElementBlock("div",Wt)):t.createCommentVNode("",!0),M.value?(t.openBlock(),t.createElementBlock("div",{key:1,class:"tool-btn",onClick:Ze,title:"删除选中"},[t.createVNode(A,{name:"delete"})])):t.createCommentVNode("",!0)]))]),t.createElementVNode("div",Gt,[t.createElementVNode("div",{class:"canvas-wrapper",ref_key:"canvasWrapper",ref:l,onWheel:s[2]||(s[2]=t.withModifiers(()=>{},["prevent"]))},[t.createElementVNode("canvas",{ref_key:"canvasRef",ref:i},null,512),w.readOnly?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",Yt,[t.createElementVNode("div",{class:"selector-trigger",onClick:st},[U.value?(t.openBlock(),t.createElementBlock("div",Jt,[t.createElementVNode("span",{class:"color-dot",style:t.normalizeStyle({backgroundColor:U.value.color})},null,4),t.createElementVNode("span",jt,t.toDisplayString(U.value.name),1)])):(t.openBlock(),t.createElementBlock("div",Xt,[...s[7]||(s[7]=[t.createElementVNode("span",{class:"label-name"},"请选择标签",-1)])])),t.createVNode(A,{name:"right",class:t.normalizeClass(["arrow-icon",{"is-open":P.value}])},null,8,["class"])]),P.value?(t.openBlock(),t.createElementBlock("div",qt,[b.value.length===0?(t.openBlock(),t.createElementBlock("div",Kt,"请在右侧创建标签")):(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:1},t.renderList(b.value,r=>(t.openBlock(),t.createElementBlock("div",{key:r.id,class:t.normalizeClass(["dropdown-item",{active:V.value===r.id}]),onClick:d=>it(r)},[t.createElementVNode("span",{class:"color-dot",style:t.normalizeStyle({backgroundColor:r.color})},null,4),t.createElementVNode("span",Qt,t.toDisplayString(r.name),1),V.value===r.id?(t.openBlock(),t.createBlock(A,{key:0,name:"aim",class:"check-icon"})):t.createCommentVNode("",!0)],10,Zt))),128))])):t.createCommentVNode("",!0)]))],544),w.batchImages&&w.batchImages.length>0?(t.openBlock(),t.createElementBlock("div",te,[t.createElementVNode("button",{class:"icon-btn",onClick:hn,disabled:u.value<=0,title:"第一张"},[t.createVNode(A,{name:"first"})],8,ee),t.createElementVNode("button",{class:"icon-btn",onClick:cn,disabled:u.value<=0,title:"上一张"},[t.createVNode(A,{name:"back"})],8,ne),t.createElementVNode("span",null,t.toDisplayString(u.value+1)+" / "+t.toDisplayString(w.batchImages.length),1),t.createElementVNode("button",{class:"icon-btn",onClick:rn,disabled:u.value>=w.batchImages.length-1,title:"下一张"},[t.createVNode(A,{name:"right"})],8,oe),t.createElementVNode("button",{class:"icon-btn",onClick:dn,disabled:u.value>=w.batchImages.length-1,title:"最后一张"},[t.createVNode(A,{name:"last"})],8,se)])):t.createCommentVNode("",!0)]),w.readOnly?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",ie,[t.createElementVNode("div",{class:"sidebar-header"},[s[8]||(s[8]=t.createElementVNode("h3",null,"标签",-1)),t.createElementVNode("button",{class:"add-btn",onClick:en},"添加标签")]),t.createElementVNode("div",ae,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(b.value,r=>(t.openBlock(),t.createElementBlock("div",{key:r.id,class:"label-item",style:t.normalizeStyle({backgroundColor:r.color+"1A",color:r.color})},[t.createElementVNode("div",le,[t.createElementVNode("label",{class:"color-wrapper",style:t.normalizeStyle({backgroundColor:r.color})},[t.withDirectives(t.createElementVNode("input",{type:"color","onUpdate:modelValue":d=>r.color=d,onChange:d=>sn(r),style:{visibility:"hidden",width:"0",height:"0"}},null,40,ce),[[t.vModelText,r.color]])],4),t.createElementVNode("span",{class:"label-name",title:r.name},t.toDisplayString(r.name),9,re),t.createElementVNode("span",{class:"action-icon eye",onClick:d=>an(r)},[r.visible?(t.openBlock(),t.createBlock(A,{key:0,name:"view"})):(t.openBlock(),t.createBlock(A,{key:1,name:"hide"}))],8,he),t.createElementVNode("div",de,[s[9]||(s[9]=t.createElementVNode("span",{class:"dots"},"•••",-1)),t.createElementVNode("span",{class:"delete-btn",onClick:d=>ln(r.id),title:"删除"},[t.createVNode(A,{name:"delete"})],8,ge)])])],4))),128))])])),O.value?(t.openBlock(),t.createElementBlock("div",{key:2,class:"modal-overlay",onClick:t.withModifiers(Z,["self"])},[t.createElementVNode("div",me,[s[12]||(s[12]=t.createElementVNode("div",{class:"modal-header"},[t.createElementVNode("h3",null,"新增标签")],-1)),t.createElementVNode("div",pe,[t.createElementVNode("div",fe,[s[10]||(s[10]=t.createElementVNode("label",null,[t.createTextVNode("标签名称 "),t.createElementVNode("span",{class:"required"},"*")],-1)),t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":s[3]||(s[3]=r=>v.value.name=r),placeholder:"请输入标签名称",class:"modal-input",autofocus:""},null,512),[[t.vModelText,v.value.name]])]),t.createElementVNode("div",ye,[s[11]||(s[11]=t.createElementVNode("label",null,"标签颜色",-1)),t.createElementVNode("div",ue,[t.createElementVNode("label",{class:"color-picker-box",style:t.normalizeStyle({backgroundColor:v.value.color})},[t.withDirectives(t.createElementVNode("input",{type:"color","onUpdate:modelValue":s[4]||(s[4]=r=>v.value.color=r),class:"modal-color-picker"},null,512),[[t.vModelText,v.value.color]])],4),t.createElementVNode("span",xe,t.toDisplayString(v.value.color),1)])])]),t.createElementVNode("div",we,[t.createElementVNode("button",{onClick:Z,class:"cancel-btn"},"取消"),t.createElementVNode("button",{onClick:nn,class:"confirm-btn",disabled:!v.value.name.trim()},"确认",8,ve)])])])):t.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-08cbbaca"]]),be={class:"thumbnail-wrapper",ref:"wrapper"},ke=["src","alt"],Ce=["viewBox","preserveAspectRatio"],_e=["x","y","width","height","stroke","stroke-width"],Se=["points","stroke","stroke-width"],Ee=["transform"],Be=["x","y","width","height","stroke","stroke-width"],Ie={key:3},Ae=["cx","cy","r","fill","stroke-width"],Ve={key:4},Ne=["x","y","height"],Te={key:1,class:"loading-placeholder"},De=J(t.defineComponent({__name:"AnnotationThumbnail",props:{src:{},annotations:{},alt:{},labels:{},fit:{},strokeWidth:{},fontSize:{}},setup(w){const e=w,a=t.ref(null),n=t.ref(!1),c=t.ref(0),i=t.ref(0),l=()=>{a.value&&(c.value=a.value.naturalWidth,i.value=a.value.naturalHeight,n.value=!0)},g=t.computed(()=>e.fit==="contain"?"xMidYMid meet":"xMidYMid slice"),m=t.computed(()=>e.strokeWidth??10),h=t.computed(()=>e.fontSize??30),_=v=>{var S;if((S=v.style)!=null&&S.strokeColor)return v.style.strokeColor;if(e.labels){const y=e.labels.find(N=>N.name===v.label);if(y)return y.color}return"#FF0000"},u=v=>{const S=v.coordinates,y=Math.min(S.x1,S.x2),N=Math.min(S.y1,S.y2),M=Math.abs(S.x1-S.x2),P=Math.abs(S.y1-S.y2);return{x:y,y:N,width:M,height:P}},B=v=>v.coordinates.points.map(y=>`${y.x},${y.y}`).join(" "),b=v=>{if(v.type==="rectangle"){const S=u(v);return{x:S.x,y:S.y-5}}else if(v.type==="polygon"){const S=v.coordinates.points;if(S.length>0)return{x:S[0].x,y:S[0].y-5}}else{if(v.type==="rotatedRect")return{x:v.coordinates.x,y:v.coordinates.y-v.coordinates.height/2-5};if(v.type==="point"){const S=v.coordinates.points;if(S.length>0)return{x:S[0].x,y:S[0].y-15}}else if(v.type==="category")return{x:v.coordinates.x,y:v.coordinates.y}}return{x:0,y:0}},V=v=>{const{x:S,y,angle:N}=v.coordinates,M=N*180/Math.PI;return`translate(${S}, ${y}) rotate(${M})`},O=v=>({x:v.coordinates.x,y:v.coordinates.y});return(v,S)=>(t.openBlock(),t.createElementBlock("div",be,[t.createElementVNode("img",{ref_key:"img",ref:a,src:w.src,class:"thumbnail-image",style:t.normalizeStyle({objectFit:w.fit}),onLoad:l,alt:w.alt},null,44,ke),n.value?(t.openBlock(),t.createElementBlock("svg",{key:0,class:"annotation-overlay",viewBox:`0 0 ${c.value} ${i.value}`,preserveAspectRatio:g.value},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(w.annotations,y=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:y.id},[y.type==="rectangle"?(t.openBlock(),t.createElementBlock("rect",{key:0,x:u(y).x,y:u(y).y,width:u(y).width,height:u(y).height,stroke:_(y),"stroke-width":m.value,fill:"transparent"},null,8,_e)):y.type==="polygon"?(t.openBlock(),t.createElementBlock("polygon",{key:1,points:B(y),stroke:_(y),"stroke-width":m.value,fill:"transparent"},null,8,Se)):y.type==="rotatedRect"?(t.openBlock(),t.createElementBlock("g",{key:2,transform:V(y)},[t.createElementVNode("rect",{x:-y.coordinates.width/2,y:-y.coordinates.height/2,width:y.coordinates.width,height:y.coordinates.height,stroke:_(y),"stroke-width":m.value,fill:"transparent"},null,8,Be)],8,Ee)):y.type==="point"?(t.openBlock(),t.createElementBlock("g",Ie,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(y.coordinates.points,(N,M)=>(t.openBlock(),t.createElementBlock("circle",{key:M,cx:N.x,cy:N.y,r:m.value*1.5,fill:_(y),stroke:"white","stroke-width":m.value*.5},null,8,Ae))),128))])):t.createCommentVNode("",!0),y.label?(t.openBlock(),t.createElementBlock("g",Ve,[(t.openBlock(),t.createElementBlock("foreignObject",{x:y.type==="category"?O(y).x-100:b(y).x,y:y.type==="category"?O(y).y-h.value-8:b(y).y-h.value-8,width:"200",height:h.value+16,style:{overflow:"visible"}},[t.createElementVNode("div",{style:t.normalizeStyle({display:"inline-flex",alignItems:"center",justifyContent:y.type==="category"?"center":"flex-start",backgroundColor:`${_(y)}cc`,color:"#ffffff",fontSize:`${h.value}px`,padding:"4px 8px",borderRadius:"4px",whiteSpace:"nowrap",lineHeight:1,transform:y.type==="category"?"translateX(calc(100px - 50%))":"none"})},t.toDisplayString(y.label),5)],8,Ne))])):t.createCommentVNode("",!0)],64))),128))],8,Ce)):(t.openBlock(),t.createElementBlock("div",Te,"Loading..."))],512))}}),[["__scopeId","data-v-46e27181"]]),Me={key:0,class:"gallery-view"},ze={class:"gallery-layout"},Le={key:0,class:"gallery-sidebar"},Pe={class:"label-stats-table"},$e={class:"label-cover-wrapper"},Re=["src"],He={class:"gallery-content"},Oe=["onClick"],Ue={class:"thumbnail-wrapper"},Fe={class:"img-meta"},We={class:"img-index"},Ge={class:"anno-count"},Ye={key:0,class:"bottom-bar"},Je={key:1,class:"editor-view"},je={class:"editor-header"},Xe={class:"header-left"},qe={class:"editor-title"},Ke={class:"editor-content"},ot=J(t.defineComponent({__name:"BatchAnnotator",props:{images:{},labels:{},actionBar:{},clickToEnterEditor:{type:Boolean},thumbStrokeWidth:{},thumbFontSize:{},readOnly:{type:Boolean},showSidebar:{type:Boolean,default:!0}},emits:["export","update:images","imageClick","update:labels","pageChange"],setup(w,{expose:e,emit:a}){const n=w,c=a,i=t.ref("gallery"),l=t.ref([]),g=t.ref([]),m=t.ref(0),h=t.ref(null),_=t.ref(null),u=t.ref(null),B=t.computed(()=>{var f,x;return((x=(f=n.actionBar)==null?void 0:f.annotateButton)==null?void 0:x.show)===!0}),b=t.computed(()=>{var f,x;return((x=(f=n.actionBar)==null?void 0:f.exportButton)==null?void 0:x.show)===!0}),V=t.computed(()=>B.value||b.value),O=t.computed(()=>{var f,x;return((x=(f=n.actionBar)==null?void 0:f.annotateButton)==null?void 0:x.text)||"手动标注"}),v=t.computed(()=>{var f,x;return((x=(f=n.actionBar)==null?void 0:f.exportButton)==null?void 0:x.text)||"导出"}),S=t.computed(()=>n.clickToEnterEditor!==!1),y=t.computed(()=>{const f={};g.value.forEach(k=>{f[k.name]={count:0,cover:""}});let x=0;return l.value.forEach(k=>{k.annotations&&k.annotations.forEach(z=>{var L;const D=z.label||(z.labelId?(L=g.value.find($=>$.id===z.labelId))==null?void 0:L.name:null);D&&f[D]&&(f[D].count++,x++,f[D].cover||(f[D].cover=k.imageUrl))})}),g.value.map(k=>{var L,$;const z=((L=f[k.name])==null?void 0:L.count)||0,D=x===0?"0.00%":(z/x*100).toFixed(2)+"%";return{id:k.id,name:k.name,color:k.color,count:z,percentage:D,cover:(($=f[k.name])==null?void 0:$.cover)||""}})}),N=f=>({color:f.color,backgroundColor:f.color+"1A"});t.onMounted(()=>{c("pageChange",{nowPage:"listPage"})}),t.watch(()=>n.images,f=>{l.value=JSON.parse(JSON.stringify(f))},{immediate:!0,deep:!0}),t.watch(()=>n.labels,f=>{g.value=JSON.parse(JSON.stringify(f||[]))},{immediate:!0,deep:!0});const M=f=>{m.value=f,i.value="editor",c("pageChange",{nowPage:"editPage"}),u.value&&(u.value.scrollTop=0),t.nextTick(()=>{_.value&&(_.value.scrollTop=0),window.scrollTo(0,0),requestAnimationFrame(()=>{var x,k;(k=(x=h.value)==null?void 0:x.jumpTo)==null||k.call(x,f)})})},P=(f,x)=>{if(S.value){M(f);return}c("imageClick",{index:f,imageId:x.id,image:x})},U=f=>l.value.findIndex(x=>x.id===f);e({openImageById:f=>{const x=U(f);return x<0?!1:(M(x),!0)},triggerImageClickById:f=>{const x=U(f);if(x<0)return!1;const k=l.value[x];return k?(c("imageClick",{index:x,imageId:k.id,image:k}),!0):!1},getFinalData:()=>({images:JSON.parse(JSON.stringify(l.value)),labels:JSON.parse(JSON.stringify(g.value))})});const j=()=>{if(h.value&&h.value.getCurrentAnnotation){const f=h.value.getCurrentAnnotation();l.value[m.value]&&(l.value[m.value].annotations=f.annotations)}i.value="gallery",c("pageChange",{nowPage:"listPage"})},X=()=>{c("export",l.value)},K=f=>{m.value=f.currentIndex,l.value[f.currentIndex]&&(l.value[f.currentIndex].annotations=f.currentAnnotations)},F=f=>{if(h.value&&h.value.getCurrentAnnotation){const x=h.value.getCurrentAnnotation();l.value[m.value]&&(l.value[m.value].annotations=x.annotations,c("update:images",l.value))}},R=f=>{g.value=JSON.parse(JSON.stringify(f||[])),c("update:labels",g.value)};return(f,x)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"batchRootRef",ref:_,class:"batch-annotator"},[i.value==="gallery"?(t.openBlock(),t.createElementBlock("div",Me,[t.createElementVNode("div",ze,[w.showSidebar?(t.openBlock(),t.createElementBlock("div",Le,[t.createElementVNode("table",Pe,[x[1]||(x[1]=t.createElementVNode("thead",null,[t.createElementVNode("tr",null,[t.createElementVNode("th",null,"标签封面"),t.createElementVNode("th",null,"标签名称"),t.createElementVNode("th",null,"标注数"),t.createElementVNode("th",null,"占比")])],-1)),t.createElementVNode("tbody",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(y.value,k=>(t.openBlock(),t.createElementBlock("tr",{key:k.id,style:t.normalizeStyle(N(k))},[t.createElementVNode("td",null,[t.createElementVNode("div",$e,[k.cover?(t.openBlock(),t.createElementBlock("img",{key:0,src:k.cover,class:"label-cover"},null,8,Re)):(t.openBlock(),t.createElementBlock("div",{key:1,class:"label-cover-empty",style:t.normalizeStyle({backgroundColor:k.color})},null,4))])]),t.createElementVNode("td",null,t.toDisplayString(k.name),1),t.createElementVNode("td",null,t.toDisplayString(k.count),1),t.createElementVNode("td",null,t.toDisplayString(k.percentage),1)],4))),128))])])])):t.createCommentVNode("",!0),t.createElementVNode("div",He,[t.createElementVNode("div",{ref_key:"galleryGridRef",ref:u,class:"gallery-grid"},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.value,(k,z)=>(t.openBlock(),t.createElementBlock("div",{key:z,class:"gallery-item",onClick:D=>P(z,k)},[t.createElementVNode("div",Ue,[t.createVNode(De,{src:k.imageUrl,annotations:k.annotations||[],labels:g.value,fit:"cover",strokeWidth:n.thumbStrokeWidth,fontSize:n.thumbFontSize},null,8,["src","annotations","labels","strokeWidth","fontSize"])]),t.createElementVNode("div",Fe,[t.createElementVNode("span",We,"#"+t.toDisplayString(z+1),1),t.createElementVNode("span",Ge,t.toDisplayString((k.annotations||[]).length)+" 标注",1)])],8,Oe))),128))],512)])]),V.value?(t.openBlock(),t.createElementBlock("div",Ye,[B.value?(t.openBlock(),t.createElementBlock("button",{key:0,class:"action-btn primary",onClick:x[0]||(x[0]=k=>M(0))},[t.createVNode(A,{name:"edit"}),t.createTextVNode(" "+t.toDisplayString(O.value),1)])):t.createCommentVNode("",!0),b.value?(t.openBlock(),t.createElementBlock("button",{key:1,class:"action-btn success",onClick:X},[t.createVNode(A,{name:"download"}),t.createTextVNode(" "+t.toDisplayString(v.value),1)])):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)])):(t.openBlock(),t.createElementBlock("div",Je,[t.createElementVNode("div",je,[t.createElementVNode("div",Xe,[t.createElementVNode("button",{class:"back-btn",onClick:j},[t.createVNode(A,{name:"back",class:"back-icon"}),x[2]||(x[2]=t.createTextVNode()),x[3]||(x[3]=t.createElementVNode("span",{class:"back-text"},"返回",-1))]),t.createElementVNode("span",qe,t.toDisplayString(w.readOnly?"正在查看":"正在标注")+": "+t.toDisplayString(m.value+1)+" / "+t.toDisplayString(l.value.length),1)])]),t.createElementVNode("div",Ke,[t.createVNode(nt,{ref_key:"annotatorRef",ref:h,batchImages:l.value,labels:g.value,readOnly:w.readOnly,annotationTypes:["rectangle","polygon","point","rotatedRect","category"],onBatchChange:K,onAnnotationChange:F,onLabelChange:R},null,8,["batchImages","labels","readOnly"])])]))],512))}}),[["__scopeId","data-v-13881d5c"]]);T.BatchAnnotator=ot,T.ImageAnnotator=nt,T.default=ot,Object.defineProperties(T,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|