@jaak.ai/stamps 2.5.5-dev.1 → 2.5.5-dev.2
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 +20 -12
- 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 +20 -12
- package/dist/collection/components/my-component/my-component.js.map +1 -1
- package/dist/components/jaak-stamps.js +20 -12
- package/dist/components/jaak-stamps.js.map +1 -1
- package/dist/esm/jaak-stamps.entry.js +20 -12
- 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-178aea65.entry.js → p-569b2c6e.entry.js} +3 -3
- package/dist/jaak-stamps-webcomponent/p-569b2c6e.entry.js.map +1 -0
- package/dist/types/components/my-component/my-component.d.ts +2 -0
- package/package.json +1 -1
- package/dist/jaak-stamps-webcomponent/p-178aea65.entry.js.map +0 -1
|
@@ -18950,6 +18950,14 @@ const JaakStamps = class {
|
|
|
18950
18950
|
this.captureDelay = 1500;
|
|
18951
18951
|
}
|
|
18952
18952
|
}
|
|
18953
|
+
// Pin onnxruntime-web to a specific version so JS bindings and WASM binary
|
|
18954
|
+
// always come from the same release. Without a version pin, jsDelivr serves
|
|
18955
|
+
// "latest" and a browser that cached files from a previous release may end up
|
|
18956
|
+
// mixing old JS with newer WASM (or vice versa) → ABI mismatch → main-thread
|
|
18957
|
+
// freeze on InferenceSession.create. Bump this constant deliberately when
|
|
18958
|
+
// upgrading and validate against all supported browsers.
|
|
18959
|
+
ORT_VERSION = '1.24.3';
|
|
18960
|
+
ORT_CDN_BASE = `https://cdn.jsdelivr.net/npm/onnxruntime-web@${this.ORT_VERSION}/dist/`;
|
|
18953
18961
|
async loadOnnxRuntime() {
|
|
18954
18962
|
if (!window.ort) {
|
|
18955
18963
|
this.updateStatus('Preparando herramientas...', 'Configurando funciones de captura', 'initializing');
|
|
@@ -18958,18 +18966,18 @@ const JaakStamps = class {
|
|
|
18958
18966
|
// All iOS browsers use WebKit, so this applies to Safari, Chrome, Firefox, etc.
|
|
18959
18967
|
const ua = navigator.userAgent;
|
|
18960
18968
|
const isIOS = /iPad|iPhone|iPod/.test(ua);
|
|
18961
|
-
|
|
18962
|
-
script.src = 'https://cdn.jsdelivr.net/npm/onnxruntime-web/dist/ort.wasm.min.js';
|
|
18963
|
-
}
|
|
18964
|
-
else {
|
|
18965
|
-
script.src = 'https://cdn.jsdelivr.net/npm/onnxruntime-web/dist/ort.min.js';
|
|
18966
|
-
}
|
|
18969
|
+
script.src = `${this.ORT_CDN_BASE}${isIOS ? 'ort.wasm.min.js' : 'ort.min.js'}`;
|
|
18967
18970
|
document.head.appendChild(script);
|
|
18968
18971
|
await new Promise((resolve) => {
|
|
18969
18972
|
script.onload = () => {
|
|
18973
|
+
const ort = window.ort;
|
|
18974
|
+
// Pin the WASM binary URLs to the same release as the JS bindings.
|
|
18975
|
+
// Without this, ort would resolve wasm files from "latest" again.
|
|
18976
|
+
if (ort?.env?.wasm) {
|
|
18977
|
+
ort.env.wasm.wasmPaths = this.ORT_CDN_BASE;
|
|
18978
|
+
}
|
|
18970
18979
|
// Configure ONNX for iOS low memory mode
|
|
18971
|
-
if (isIOS &&
|
|
18972
|
-
const ort = window.ort;
|
|
18980
|
+
if (isIOS && ort?.env) {
|
|
18973
18981
|
ort.env.wasm.simd = false;
|
|
18974
18982
|
ort.env.wasm.numThreads = 1;
|
|
18975
18983
|
ort.env.wasm.proxy = false;
|
|
@@ -20191,7 +20199,7 @@ const JaakStamps = class {
|
|
|
20191
20199
|
isCapturing: false
|
|
20192
20200
|
};
|
|
20193
20201
|
const cameraInfo = this.cameraInfoWithAutofocus;
|
|
20194
|
-
return (index.h("div", { key: '
|
|
20202
|
+
return (index.h("div", { key: 'a3d244546eaeef7149d64aa95ecbb8be015ada66', class: "detector-container" }, !this.licenseValid && this.licenseError && (index.h("div", { key: '6400a254607f90316927c6e4798b8a2db7464864', class: "license-error-container" }, index.h("div", { key: '08d6ac784c680b8ca326951c8dec078c4400525b', class: "license-error-card" }, index.h("svg", { key: 'bbd5a1989469beaf8c18b4d8c683ae993b29828f', class: "license-error-icon", width: "64", height: "64", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { key: 'a136775f4775c0f4619921493ef98ec2a4ee22c2', d: "M12 22C12 22 20 18 20 12V5L12 2L4 5V12C4 18 12 22 12 22Z", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("path", { key: '87b34ca04da868f1e4d109c2f8c41763d6442408', d: "M12 8V12", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round" }), index.h("circle", { key: 'c4b81005418baa0ae7548c192719017a62824627', cx: "12", cy: "16", r: "0.5", fill: "currentColor", stroke: "currentColor", "stroke-width": "1" })), index.h("h2", { key: 'ed12b053433315b6f06b76388471f48fbeedf6ba', class: "license-error-title" }, "Licencia Requerida"), index.h("p", { key: '07d429c3568f7623656b349467ec0b45da85b974', class: "license-error-message" }, this.licenseError), index.h("p", { key: 'c03e509b2de76977c96929c5dc4995195e723c91', class: "license-error-help" }, "Contacte a soporte: ", index.h("a", { key: 'dacd34365bb1a34148e949638ebd02c792ed0591', href: "mailto:support@jaak.ai" }, "support@jaak.ai")), index.h("div", { key: 'e77324a34dd06629f599d32b019a30d042913004', class: "license-error-footer" }, "JAAK Stamps")))), this.licenseValid && (index.h("div", { key: 'ae30ba52e849f494cf2618802e0779d4cf84ec17', class: "video-container" }, index.h("video", { key: '9ae44f392d00753800a6313ce42cc0aee4344407', ref: el => this.videoRef = el, autoplay: true, muted: true, playsinline: true, class: this.shouldMirrorVideo ? 'mirror' : '', style: {
|
|
20195
20203
|
// Keep the element rendered (display: block) so the browser
|
|
20196
20204
|
// loads stream metadata and fires 'loadedmetadata'. Hiding it
|
|
20197
20205
|
// with display:none prevents metadata loading in Chrome and
|
|
@@ -20200,7 +20208,7 @@ const JaakStamps = class {
|
|
|
20200
20208
|
// render context alive.
|
|
20201
20209
|
opacity: captureState.isVideoActive ? '1' : '0',
|
|
20202
20210
|
visibility: captureState.isVideoActive ? 'visible' : 'hidden',
|
|
20203
|
-
} }), index.h("div", { key: '
|
|
20211
|
+
} }), index.h("div", { key: '59a38f3b6802619fee5d842aeeb6a43836b7f968', ref: el => this.detectionContainer = el, class: `detection-overlay ${this.shouldMirrorVideo ? 'mirror' : ''}` }, this.debug && this.detectionBoxes.map((box, index$1) => (index.h("div", { key: index$1, class: "detection-box", style: {
|
|
20204
20212
|
position: 'absolute',
|
|
20205
20213
|
left: `${box.x}px`,
|
|
20206
20214
|
top: `${box.y}px`,
|
|
@@ -20209,9 +20217,9 @@ const JaakStamps = class {
|
|
|
20209
20217
|
border: '2px solid #32406C',
|
|
20210
20218
|
pointerEvents: 'none',
|
|
20211
20219
|
boxSizing: 'border-box'
|
|
20212
|
-
} })))), this.isMaskReady && (index.h("div", { key: '
|
|
20220
|
+
} })))), this.isMaskReady && (index.h("div", { key: '1ed03a5e802b37135a40d378626bd74bb073a43f', class: "overlay-mask" }, index.h("div", { key: '78a0b501f4843da323084c3d497a8f56328afb5b', class: "card-outline" }, index.h("div", { key: 'f0336bbed8bb46da78a39b65bb16d0270db35a57', class: "side side-top" }), index.h("div", { key: 'adc08df2c33f1b118eb4ce9db64bb601b8b8d12c', class: "side side-right" }), index.h("div", { key: '5ec3d1a15fe62b8ca5a55bf6627fd02afa8feb8f', class: "side side-bottom" }), index.h("div", { key: '426b2309dfd9285d915bdf6ec4cb291eb2069593', class: "side side-left" })), !captureState.showFlipAnimation && !captureState.showSuccessAnimation && (index.h("div", { key: '8018f394316265e3057b47b89e5e9c452524ea71', class: `guide-text ${this.showPerformanceMessage ? 'performance-warning-text' : ''}` }, this.getGuideText(captureState.step))), captureState.step === 'back' && !captureState.showFlipAnimation && !captureState.showSuccessAnimation && (index.h("div", { key: '29925b48f81be064d2e33626bb8175c5243b3864', class: "back-capture-section" }, index.h("div", { key: '7f3308c16486accc43462c915ae6038d97f87b58', class: "back-capture-buttons" }, (!this.useDocumentDetector || this.performanceDegradedMode || this.showManualCaptureButton) && (index.h("button", { key: '8369d371a1c96758ca622bc8b4e8d24b29459719', class: "capture-button primary-button", onClick: () => this.takeManualScreenshot(), type: "button", disabled: this.processingButton !== null }, this.processingButton === 'capture-back' && (index.h("span", { key: '019265cc28c7f080b1dae6f61e1cf219ee2c0a95', class: "button-spinner" })), "Capturar Reverso")), index.h("button", { key: '5c5a9e7d629d615102af2060548cb0a06b307906', class: "skip-button", onClick: () => this.skipBackCapture(), type: "button", disabled: this.processingButton !== null }, this.processingButton === 'skip-back' && (index.h("span", { key: 'df999e06a6e161591fa591117c75a0763954846b', class: "button-spinner" })), this.enableBackDocumentTimer && this.backDocumentTimerRemaining > 0
|
|
20213
20221
|
? `Saltar reverso (${this.backDocumentTimerRemaining}s)`
|
|
20214
|
-
: 'Saltar reverso')))), captureState.isVideoActive && (index.h("div", { key: '
|
|
20222
|
+
: 'Saltar reverso')))), captureState.isVideoActive && (index.h("div", { key: 'e6a79f49886c03ecf262ade76d53994887adb17c', class: "camera-controls" }, index.h("button", { key: '1ca0f1e46a853411d689b8228f7418f2e8ff24b5', class: `camera-selector-button ${this.isSwitchingCamera ? 'loading' : ''}`, onClick: () => this.toggleCameraSelector(), type: "button", title: "Seleccionar c\u00E1mara", disabled: this.isSwitchingCamera }, this.isSwitchingCamera ? (index.h("div", { class: "button-spinner" })) : ('Cámaras')))), this.showCameraSelector && cameraInfo.availableCameras.length > 0 && (index.h("div", { key: '2a8eb6c6938875ae9971a047c20b999efd6509dc', class: "camera-selector-dropdown" }, index.h("div", { key: 'd95f49de7bc6ab29c6254024cf1deba6e1e13cfc', class: "camera-selector-header" }, index.h("span", { key: 'fd423f2b078b758dec5283faa54e64a7f7ba0bce' }, "Seleccionar C\u00E1mara"), index.h("button", { key: '6aca1ad6dcafe54e144cf1c0dcd08dd3a2c497f0', class: "close-selector", onClick: () => this.toggleCameraSelector(), type: "button" }, "\u00D7")), index.h("div", { key: '2bc34b3d59cbd0a572eee969f5a305ca08673f83', class: "camera-list" }, cameraInfo.availableCameras.map((camera) => (index.h("button", { key: camera.id, class: `camera-option ${cameraInfo.selectedCameraId === camera.id ? 'selected' : ''}`, onClick: () => this.handleCameraSwitch(camera.id), type: "button" }, index.h("span", { class: "camera-label" }, camera.label || `Cámara ${cameraInfo.availableCameras.indexOf(camera) + 1}`, camera.hasAutofocus && (index.h("span", { class: "autofocus-icon", title: "Autofoco disponible" }, "\u29BF"))), cameraInfo.selectedCameraId === camera.id && (index.h("span", { class: "selected-indicator" }, "\u2713")))))), index.h("div", { key: '5d21a6b9e6c8e205f14643b6e84487dbda375548', class: "device-info" }, index.h("small", { key: '5d581972b430af0fc61cc42f7f0de000e6b174ee' }, "Dispositivo: ", cameraInfo.deviceType)))), this.showManualCaptureButton && captureState.step === 'front' && !captureState.showFlipAnimation && !captureState.showSuccessAnimation && (index.h("div", { key: 'eb18c71b9e514a619b1e112db5ae106b38c81190', class: "manual-capture-section" }, index.h("button", { key: '2edec59ada00c0429e84e27e4de01d813a366bc3', class: "manual-capture-button", onClick: () => this.takeManualScreenshot(), type: "button", disabled: this.processingButton !== null }, this.processingButton === 'capture-front' && (index.h("span", { key: '505e7abe8858b90fe5683676a42d1634729e6b6f', class: "button-spinner" })), "Capturar Frente"))))), captureState.isCapturing && (index.h("div", { key: '7345607ae827e8cca3f3fc40c727f9042e239072', class: "capture-animation" })), captureState.showFlipAnimation && (index.h("div", { key: 'a683f98e07a91ef4b97c219180922efea393854e', class: "flip-animation" }, index.h("div", { key: '4b9ca137471d62e90d416690182bf222b7c498c1', class: "id-card-icon" }), index.h("div", { key: 'ac3f39c86800a3ea5010055068f64889fd35cfe0', class: "flip-text" }, "\u00A1Voltea tu identificaci\u00F3n!"))), captureState.showSuccessAnimation && (index.h("div", { key: 'bbb692da28e5564de42c1eb56284caa864dcb9b3', class: "success-animation" }, index.h("div", { key: '6cc653c662db4ef5d9b2c8b5c806c9776eaab816', class: "check-icon" }), index.h("div", { key: 'e486173624aec1d944015ad0a0a857b9127876fc', class: "success-text" }, "\u00A1Proceso completado!"))), index.h("div", { key: 'dc9dd48bd3cefe8ee90e2725a0ebc600f0382f17', class: `component-status status-${this.currentStatus.type}` }, (this.currentStatus.type === 'loading' || this.currentStatus.type === 'initializing') && (index.h("div", { key: '90961611abd91d6cf9eacc7950c89ecd8b017237', class: "status-spinner" })), index.h("div", { key: '43d8e13ccda8d7c64119ddad6d4ada0868b3f038', class: "status-content" }, index.h("div", { key: '39ff2f9d94580b3759bc5ad7d01eb050316d2cd2', class: "status-message" }, this.currentStatus.message), this.currentStatus.description && (index.h("div", { key: 'a0dba517725af922d83afd2f36dbc6e69d2acd56', class: "status-description" }, this.currentStatus.description)))), this.debug && (index.h("div", { key: '6d5f577de7bcea145355870ac7e246963f3fe85e', class: "performance-monitor" }, index.h("div", { key: '6f1bb9e5e74a84272fef5f13f7179a19fc162955', class: "performance-expanded" }, index.h("div", { key: '17fc9a04076d6b4104ccef4d010554263e0a6e9b', class: "metrics-row" }, index.h("div", { key: '9ba18148930854ab784f68d5e28952d891007fe9', class: "metric-compact" }, index.h("span", { key: '70918fd23d3039654d07231d2ebdaff0e2d3c986', class: "metric-label" }, "FPS"), index.h("span", { key: 'fa95b3d6446910fc9090408334bccd84b00baf5a', class: `metric-value ${this.performanceData.fps < 15 ? 'warning' : this.performanceData.fps < 10 ? 'danger' : 'good'}` }, this.performanceData.fps)), index.h("div", { key: 'fec1b176842e9731f8385bd2f121c0481c2df058', class: "metric-compact" }, index.h("span", { key: '3cabbd63dadb8d2f756f080dd8f4a4d7f6708dfb', class: "metric-label" }, "MEM"), index.h("span", { key: '84f2e1b13e2630b63bb2728705311ae13dc3e5b1', class: `metric-value ${this.performanceData.memoryUsage > 100 ? 'warning' : this.performanceData.memoryUsage > 200 ? 'danger' : 'good'}` }, this.performanceData.memoryUsage, "MB"))), index.h("div", { key: '2753b4ee2eb2698a9f664b738d87264a0f5cf192', class: "metrics-row" }, index.h("div", { key: '89e256e02ff73b9c1b348fd60c4e90803cbd52de', class: "metric-compact" }, index.h("span", { key: '7bf4f222a8b44d856717e44343d7471c96d23669', class: "metric-label" }, "INF"), index.h("span", { key: '3ddf0e7aa7daaf5d715b6867c77641ac56339225', class: `metric-value ${this.performanceData.inferenceTime > 100 ? 'warning' : this.performanceData.inferenceTime > 200 ? 'danger' : 'good'}` }, this.performanceData.inferenceTime, "ms")), index.h("div", { key: '396ce3d444bf4125e49b38862204c3ecf176e842', class: "metric-compact" }, index.h("span", { key: 'b95910b6a51c4639cd32cfe509b23229de8992f5', class: "metric-label" }, "FRAME"), index.h("span", { key: '5d66332f1d1a79fd882e72ea0d082a90f9ac8a1d', class: `metric-value ${this.performanceData.frameProcessingTime > 50 ? 'warning' : this.performanceData.frameProcessingTime > 100 ? 'danger' : 'good'}` }, this.performanceData.frameProcessingTime, "ms"))), index.h("div", { key: '93b93682098d0c05b35b93059f287dd06fbaefa4', class: "metrics-row" }, index.h("div", { key: '7336b87d7e9041620843786a497c906c67de3024', class: "metric-compact" }, index.h("span", { key: '8e2428de98ccf2fb3d85365d53170f061c564f51', class: "metric-label" }, "DET"), index.h("span", { key: '5c909118072f4b66f42439fe2ede035dcd5be7e3', class: "metric-value good" }, this.performanceData.successfulDetections, "/", this.performanceData.totalDetections)), index.h("div", { key: '16882eccf6996698a90f7c17ad65ebeac82af0fa', class: "metric-compact" }, index.h("span", { key: 'b5bed40ee58ff219c37f0c4d3e99b9647a0b0061', class: "metric-label" }, "RATE"), index.h("span", { key: 'ce1317db2062cca13c728dbc437f316b90d518d1', class: `metric-value ${this.performanceData.detectionRate < 30 ? 'danger' : this.performanceData.detectionRate < 60 ? 'warning' : 'good'}` }, this.performanceData.detectionRate, "%")))))), index.h("div", { key: '9e760ab7f19424f10bf7bf8d0e8a1e3892cee3da', class: "watermark" }, index.h("img", { key: 'ce2700c6224bdbd0a498bf0251cee4308442dbdd', src: "https://static.jaak.ai/commons/powered-by-jaak.png", alt: "Powered by Jaak", onError: (e) => { e.target.src = index.getAssetPath('/assets/powered-by-jaak.png'); } }))))));
|
|
20215
20223
|
}
|
|
20216
20224
|
// Utility methods
|
|
20217
20225
|
updateDetectionBoxes(boxes) {
|