@jaak.ai/stamps 2.1.0-dev.4 → 2.1.0-dev.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/jaak-stamps.cjs.entry.js +3 -15
- package/dist/cjs/jaak-stamps.cjs.entry.js.map +1 -1
- package/dist/cjs/jaak-stamps.entry.cjs.js.map +1 -1
- package/dist/collection/components/my-component/my-component.js +3 -15
- package/dist/collection/components/my-component/my-component.js.map +1 -1
- package/dist/components/jaak-stamps.js +3 -15
- package/dist/components/jaak-stamps.js.map +1 -1
- package/dist/esm/jaak-stamps.entry.js +3 -15
- package/dist/esm/jaak-stamps.entry.js.map +1 -1
- package/dist/jaak-stamps-webcomponent/jaak-stamps-webcomponent.esm.js +1 -1
- package/dist/jaak-stamps-webcomponent/jaak-stamps.entry.esm.js.map +1 -1
- package/dist/jaak-stamps-webcomponent/{p-091d609b.entry.js → p-c08802a9.entry.js} +2 -2
- package/dist/jaak-stamps-webcomponent/p-c08802a9.entry.js.map +1 -0
- package/package.json +1 -1
- package/dist/jaak-stamps-webcomponent/p-091d609b.entry.js.map +0 -1
|
@@ -497,7 +497,6 @@ export class JaakStamps {
|
|
|
497
497
|
await this.detectionService.loadModel();
|
|
498
498
|
}
|
|
499
499
|
catch (modelError) {
|
|
500
|
-
console.error('Error cargando modelo de detección:', modelError);
|
|
501
500
|
this.switchToManualModeWithError('Error al cargar modelo de detección');
|
|
502
501
|
throw modelError;
|
|
503
502
|
}
|
|
@@ -506,7 +505,6 @@ export class JaakStamps {
|
|
|
506
505
|
await this.detectionService.loadClassificationModel();
|
|
507
506
|
}
|
|
508
507
|
catch (classificationError) {
|
|
509
|
-
console.error('Error cargando modelo de clasificación:', classificationError);
|
|
510
508
|
this.switchToManualModeWithError('Error al cargar modelo de clasificación');
|
|
511
509
|
throw classificationError;
|
|
512
510
|
}
|
|
@@ -630,7 +628,6 @@ export class JaakStamps {
|
|
|
630
628
|
await this.detectionService.loadModel();
|
|
631
629
|
}
|
|
632
630
|
catch (modelError) {
|
|
633
|
-
console.error('Error cargando modelo de detección:', modelError);
|
|
634
631
|
this.switchToManualModeWithError('Error al cargar modelo de detección');
|
|
635
632
|
throw modelError;
|
|
636
633
|
}
|
|
@@ -639,7 +636,6 @@ export class JaakStamps {
|
|
|
639
636
|
await this.detectionService.loadClassificationModel();
|
|
640
637
|
}
|
|
641
638
|
catch (classificationError) {
|
|
642
|
-
console.error('Error cargando modelo de clasificación:', classificationError);
|
|
643
639
|
this.switchToManualModeWithError('Error al cargar modelo de clasificación');
|
|
644
640
|
throw classificationError;
|
|
645
641
|
}
|
|
@@ -755,7 +751,6 @@ export class JaakStamps {
|
|
|
755
751
|
inputTensor = this.detectionService.preprocess(this.videoRef);
|
|
756
752
|
}
|
|
757
753
|
catch (preprocessError) {
|
|
758
|
-
console.error('Error en preprocesamiento:', preprocessError);
|
|
759
754
|
this.switchToManualModeWithError('Error al procesar imagen');
|
|
760
755
|
return;
|
|
761
756
|
}
|
|
@@ -765,7 +760,6 @@ export class JaakStamps {
|
|
|
765
760
|
inferenceTime = performance.now() - inferenceStartTime;
|
|
766
761
|
}
|
|
767
762
|
catch (inferenceError) {
|
|
768
|
-
console.error('Error en inferencia ONNX:', inferenceError);
|
|
769
763
|
this.switchToManualModeWithError('Error en detección automática');
|
|
770
764
|
return;
|
|
771
765
|
}
|
|
@@ -891,7 +885,7 @@ export class JaakStamps {
|
|
|
891
885
|
isCapturing: false
|
|
892
886
|
};
|
|
893
887
|
const cameraInfo = this.cameraInfoWithAutofocus;
|
|
894
|
-
return (h("div", { key: '
|
|
888
|
+
return (h("div", { key: '687a01ebb87f3c9e4424f4bcd355cd68c21366f0', class: "detector-container" }, h("div", { key: 'd4c9f1fbf653ea7764dcc7265f5f7180c99fe5e7', class: "video-container" }, h("video", { key: '37a159daaaa4682d8e14a1dcdef32225706e1f20', ref: el => this.videoRef = el, autoplay: true, muted: true, playsinline: true, class: this.shouldMirrorVideo ? 'mirror' : '', style: { display: captureState.isVideoActive ? 'block' : 'none' } }), h("div", { key: '74fe5c8612be7a8d904510c226d68a6860a0f67d', ref: el => this.detectionContainer = el, class: `detection-overlay ${this.shouldMirrorVideo ? 'mirror' : ''}` }, this.debug && this.detectionBoxes.map((box, index) => (h("div", { key: index, class: "detection-box", style: {
|
|
895
889
|
position: 'absolute',
|
|
896
890
|
left: `${box.x}px`,
|
|
897
891
|
top: `${box.y}px`,
|
|
@@ -900,9 +894,9 @@ export class JaakStamps {
|
|
|
900
894
|
border: '2px solid #32406C',
|
|
901
895
|
pointerEvents: 'none',
|
|
902
896
|
boxSizing: 'border-box'
|
|
903
|
-
} })))), this.isMaskReady && (h("div", { key: '
|
|
897
|
+
} })))), this.isMaskReady && (h("div", { key: '4f2e282a8eb99947b1e67690ef236019e87ad87e', class: "overlay-mask" }, h("div", { key: '1d102684d59e5f7f5d6243f95e39ee0e1812032e', class: "card-outline" }, h("div", { key: '4ba0df1528de02cc037022948e425ffb13c49822', class: "side side-top" }), h("div", { key: '36bc3f2d39f61d39af2522ffe13b6df16c8bf00b', class: "side side-right" }), h("div", { key: '88d2402044de0309055c31fd98e596b88b1d51ce', class: "side side-bottom" }), h("div", { key: '72262621ee2c2b4824f3b313f27a5793fa4c123f', class: "side side-left" })), !captureState.showFlipAnimation && !captureState.showSuccessAnimation && (h("div", { key: 'df9320c0f5518c04b1504d355223730e6d686779', class: `guide-text ${this.showPerformanceMessage ? 'performance-warning-text' : ''}` }, this.getGuideText(captureState.step))), captureState.step === 'back' && !captureState.showFlipAnimation && !captureState.showSuccessAnimation && (h("div", { key: 'e86f6eec1ea7712fb8c94d1455dd9c0c7c01db21', class: "back-capture-section" }, h("div", { key: 'ad965847b25eeae92eb22c3d89b09e953fabb2d2', class: "back-capture-buttons" }, (!this.useDocumentDetector || this.performanceDegradedMode) && (h("button", { key: '3e57f0bf7600bc650e44f40e3c1fd13747885781', class: "capture-button primary-button", onClick: () => this.takeManualScreenshot(), type: "button", disabled: captureState.isCapturing }, captureState.isCapturing ? 'Capturando...' : 'Capturar Reverso')), h("button", { key: 'd598cd7778869b46b5c7ceafcb43c469b4b5c7e7', class: "skip-button", onClick: () => this.skipBackCapture(), type: "button" }, this.enableBackDocumentTimer && this.backDocumentTimerRemaining > 0
|
|
904
898
|
? `Saltar reverso (${this.backDocumentTimerRemaining}s)`
|
|
905
|
-
: 'Saltar reverso')))), captureState.isVideoActive && (h("div", { key: '
|
|
899
|
+
: 'Saltar reverso')))), captureState.isVideoActive && (h("div", { key: 'b1508382d2b75584a19dade3f8e685a34ff2c3a3', class: "camera-controls" }, h("button", { key: '9c1f945b051f8e000f87fb3674ecfd386bdc2208', class: `camera-selector-button ${this.isSwitchingCamera ? 'loading' : ''}`, onClick: () => this.toggleCameraSelector(), type: "button", title: "Seleccionar c\u00E1mara", disabled: this.isSwitchingCamera }, this.isSwitchingCamera ? (h("div", { class: "button-spinner" })) : ('Cámaras')))), this.showCameraSelector && cameraInfo.availableCameras.length > 0 && (h("div", { key: '4adab3b896be86322be168db377cbacbcb3a7422', class: "camera-selector-dropdown" }, h("div", { key: 'a60e3f46cfe5997cf9b82d685a1574b7002c0071', class: "camera-selector-header" }, h("span", { key: '71e012a8a4953f584aeffc985040e434fadfb00b' }, "Seleccionar C\u00E1mara"), h("button", { key: '046ee4f6d81b34349ecad4e9de98f4d8653dad6b', class: "close-selector", onClick: () => this.toggleCameraSelector(), type: "button" }, "\u00D7")), h("div", { key: '539ad135914d9ceb3a6b9a2de2d9ae4ea7a996b3', class: "camera-list" }, cameraInfo.availableCameras.map((camera) => (h("button", { key: camera.id, class: `camera-option ${cameraInfo.selectedCameraId === camera.id ? 'selected' : ''}`, onClick: () => this.handleCameraSwitch(camera.id), type: "button" }, h("span", { class: "camera-label" }, camera.label || `Cámara ${cameraInfo.availableCameras.indexOf(camera) + 1}`, camera.hasAutofocus && (h("span", { class: "autofocus-icon", title: "Autofoco disponible" }, "\u29BF"))), cameraInfo.selectedCameraId === camera.id && (h("span", { class: "selected-indicator" }, "\u2713")))))), h("div", { key: '082d1cc259af3c1fc95b53da1e754382e874b837', class: "device-info" }, h("small", { key: 'dad398582ac7bfd31ee43704d47fd3036fc59d06' }, "Dispositivo: ", cameraInfo.deviceType)))), this.showManualCaptureButton && captureState.step === 'front' && !captureState.showFlipAnimation && !captureState.showSuccessAnimation && (h("div", { key: '231ff3eb4672b4ac310419cccc8cd6d1caab9e14', class: "manual-capture-section" }, h("button", { key: 'fa2fcc4bfe63bf2ccdba2c2ad3c8c4b4a5aabbb5', class: "manual-capture-button", onClick: () => this.takeManualScreenshot(), type: "button", disabled: captureState.isCapturing }, captureState.isCapturing ? 'Capturando...' : 'Capturar Frente'))))), captureState.isCapturing && (h("div", { key: '39426754973f1a9e07b56399f344add21bf9b848', class: "capture-animation" })), captureState.showFlipAnimation && (h("div", { key: '307a7eb06b41a8baebe37ad26b1f5e4cf0a43ec1', class: "flip-animation" }, h("div", { key: '7070ad263e3894dc1488bb8a17f5bf23b7b757f0', class: "id-card-icon" }), h("div", { key: '81a0d8b6377b397bbeebe2e31800fe88f88593a0', class: "flip-text" }, "\u00A1Voltea tu identificaci\u00F3n!"))), captureState.showSuccessAnimation && (h("div", { key: '741e5043bd57a3e13e39fd897a64cd20a75dad2e', class: "success-animation" }, h("div", { key: '6269a51c0651e5f76490906e50eb111f6a88f267', class: "check-icon" }), h("div", { key: '1c90a9cf6c90bb10af90660c714b7ff1ed6acfa0', class: "success-text" }, "\u00A1Proceso completado!"))), h("div", { key: 'f6746c1fb15cc238846f047743a9d45b1d4a41f8', class: `component-status status-${this.currentStatus.type}` }, (this.currentStatus.type === 'loading' || this.currentStatus.type === 'initializing') && (h("div", { key: '00d198abdc90683e5f05a9fd9b54d44e55c16630', class: "status-spinner" })), h("div", { key: 'b0254dea36bae65692bfbd200dfb75eb5a3a50dc', class: "status-content" }, h("div", { key: 'e3e48ea04f40ddd7c66aa8eda3d341f24a9c3dc4', class: "status-message" }, this.currentStatus.message), this.currentStatus.description && (h("div", { key: 'd3f40ca5b72a661f9631145880fc6d1bba878961', class: "status-description" }, this.currentStatus.description)))), this.debug && (h("div", { key: 'eabe40809e744eb62b2ac76733952060988b675c', class: "performance-monitor" }, h("div", { key: '44e51257d4ba2c2153749cf14f3aebbf22ca02ec', class: "performance-expanded" }, h("div", { key: '493fc680db2d1e82068eadda3786fad57e8594cc', class: "metrics-row" }, h("div", { key: 'aaa734d066246c9364d51c04d41a0a84d0b7e216', class: "metric-compact" }, h("span", { key: 'f0b59f76e8aa1723a429289b7898d35f22ff86d4', class: "metric-label" }, "FPS"), h("span", { key: 'a562359df92cabe40f54b355ffa264f246e7ec8e', class: `metric-value ${this.performanceData.fps < 15 ? 'warning' : this.performanceData.fps < 10 ? 'danger' : 'good'}` }, this.performanceData.fps)), h("div", { key: '9adca77e934ee3cd07fb54a056132e305637848c', class: "metric-compact" }, h("span", { key: '65ec83dca0e74b42065962d2a2e4bae7515b9fc1', class: "metric-label" }, "MEM"), h("span", { key: '427fc6b5b538742d0987b0240f526616b910ae69', class: `metric-value ${this.performanceData.memoryUsage > 100 ? 'warning' : this.performanceData.memoryUsage > 200 ? 'danger' : 'good'}` }, this.performanceData.memoryUsage, "MB"))), h("div", { key: 'fc551d8ef39308980437b72b3fb4c0bdb2bfbf67', class: "metrics-row" }, h("div", { key: 'b88785c108e5586fecc8702f3e4da883ace00f15', class: "metric-compact" }, h("span", { key: '31db440861e6fd9c2ee36ccd242f1b7bb3d47f45', class: "metric-label" }, "INF"), h("span", { key: 'af45bbb41110a04ed3d22a9e112b8644dd7ec355', class: `metric-value ${this.performanceData.inferenceTime > 100 ? 'warning' : this.performanceData.inferenceTime > 200 ? 'danger' : 'good'}` }, this.performanceData.inferenceTime, "ms")), h("div", { key: 'deabe5ce0661557fabe4ccdde1af48beed564ad9', class: "metric-compact" }, h("span", { key: '072f9159e95b3f3226f07b879b377a3d34940825', class: "metric-label" }, "FRAME"), h("span", { key: '841de1ae8df76919c2b644c6ff813dd927b52013', class: `metric-value ${this.performanceData.frameProcessingTime > 50 ? 'warning' : this.performanceData.frameProcessingTime > 100 ? 'danger' : 'good'}` }, this.performanceData.frameProcessingTime, "ms"))), h("div", { key: '68c6c777db1430987f20536849a3ed9169ec794a', class: "metrics-row" }, h("div", { key: '736e361beaa88d268041ec55fd73db0ee405e1ae', class: "metric-compact" }, h("span", { key: 'bfa6c3aa54a96e5eab32dc4fa0227ca836142561', class: "metric-label" }, "DET"), h("span", { key: 'f9a2479c470779403bf1cbfd4f433f80e5fa34d8', class: "metric-value good" }, this.performanceData.successfulDetections, "/", this.performanceData.totalDetections)), h("div", { key: 'bfc1d7f8cbc7449a96e751b005a02bb112e63a86', class: "metric-compact" }, h("span", { key: '45a7171a72ac6ae9c29a4de3c7a260ae78681dc1', class: "metric-label" }, "RATE"), h("span", { key: '7419ace73d0302d662b3a6308f313be271049b5a', class: `metric-value ${this.performanceData.detectionRate < 30 ? 'danger' : this.performanceData.detectionRate < 60 ? 'warning' : 'good'}` }, this.performanceData.detectionRate, "%")))))), h("div", { key: '786544dff913bb4b1003e62d9ab35b3f29f4b497', class: "watermark" }, h("img", { key: 'e08c893afa8bad94d04b01ea4732044b1c9a2d6c', src: "https://storage.googleapis.com/jaak-static/commons/powered-by-jaak.png", alt: "Powered by Jaak" })))));
|
|
906
900
|
}
|
|
907
901
|
// Utility methods
|
|
908
902
|
updateDetectionBoxes(boxes) {
|
|
@@ -1100,7 +1094,6 @@ export class JaakStamps {
|
|
|
1100
1094
|
}
|
|
1101
1095
|
}
|
|
1102
1096
|
catch (classifyError) {
|
|
1103
|
-
console.error('Error clasificando documento:', classifyError);
|
|
1104
1097
|
// No cambiar a manual aquí, solo registrar el error y continuar
|
|
1105
1098
|
}
|
|
1106
1099
|
}
|
|
@@ -1171,7 +1164,6 @@ export class JaakStamps {
|
|
|
1171
1164
|
}
|
|
1172
1165
|
}
|
|
1173
1166
|
catch (classifyError) {
|
|
1174
|
-
console.error('Error clasificando documento:', classifyError);
|
|
1175
1167
|
// No cambiar a manual aquí, solo registrar el error y continuar
|
|
1176
1168
|
}
|
|
1177
1169
|
}
|
|
@@ -1230,7 +1222,6 @@ export class JaakStamps {
|
|
|
1230
1222
|
}
|
|
1231
1223
|
// Método para cambiar a modo manual por errores de ONNX
|
|
1232
1224
|
switchToManualModeWithError(errorMessage) {
|
|
1233
|
-
console.error(`[ONNX Error] ${errorMessage}`);
|
|
1234
1225
|
// Solo cambiar si el detector está habilitado y no se ha cambiado ya
|
|
1235
1226
|
if (!this.useDocumentDetector || this.hasAutoSwitchedToManual) {
|
|
1236
1227
|
return;
|
|
@@ -1255,16 +1246,13 @@ export class JaakStamps {
|
|
|
1255
1246
|
}
|
|
1256
1247
|
// Método para liberar recursos de ONNX cuando se cambia a modo manual
|
|
1257
1248
|
releaseOnnxResources() {
|
|
1258
|
-
console.log('[ONNX] Liberando recursos de modelos ONNX...');
|
|
1259
1249
|
try {
|
|
1260
1250
|
// Liberar recursos del servicio de detección
|
|
1261
1251
|
if (this.detectionService) {
|
|
1262
1252
|
this.detectionService.cleanup();
|
|
1263
|
-
console.log('[ONNX] Recursos de ONNX liberados exitosamente');
|
|
1264
1253
|
}
|
|
1265
1254
|
}
|
|
1266
1255
|
catch (error) {
|
|
1267
|
-
console.error('[ONNX] Error al liberar recursos:', error);
|
|
1268
1256
|
}
|
|
1269
1257
|
}
|
|
1270
1258
|
completeProcess(skippedBack = false) {
|