@idscan/idvc2 3.9.5 → 3.10.1
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/README.md +7 -1
- package/dist/idvc.js +1 -1
- package/dist/idvc.js.gzip +0 -0
- package/dist/index.html +3 -72
- package/dist/js/defaultConfig.ts +1 -30
- package/dist/js/environment/documentTypes.ts +4 -20
- package/dist/js/environment/langs.js +1 -1
- package/dist/js/environment/networkNames.json +0 -1
- package/dist/js/environment/previewAnimation.ts +1 -1
- package/dist/js/environment/stepsDescription.ts +2 -12
- package/dist/langs.js.gzip +0 -0
- package/dist/networks/Face-chunk.js +1 -1
- package/dist/networks/GeneralTypeDetectionYolo-chunk.js +1 -1
- package/dist/networks/MRZ-chunk.js +1 -1
- package/dist/networks/blurWorker.js.gzip +0 -0
- package/dist/types/controllers/ModuleController.d.ts +0 -2
- package/dist/types/defaultConfig.d.ts +2 -4
- package/dist/types/environment/documentTypes.d.ts +4 -6
- package/dist/types/environment/langs.d.ts +1 -6
- package/dist/types/environment/stepsDescription.d.ts +1 -1
- package/dist/types/helpers/base64.d.ts +0 -1
- package/dist/types/helpers/manualUpload.d.ts +0 -1
- package/dist/types/idvc.d.ts +1 -0
- package/dist/types/initialize.d.ts +0 -1
- package/dist/types/integrations/prepareRequestDataForDiveApi.d.ts +0 -1
- package/dist/types/loader/loaderMeshFace.d.ts +1 -1
- package/dist/types/loop.d.ts +1 -1
- package/dist/types/modules/Config.d.ts +0 -20
- package/dist/types/modules/MetaData.d.ts +4 -3
- package/dist/types/modules/Step.d.ts +3 -6
- package/dist/types/modules/camera/camera.d.ts +2 -0
- package/dist/types/modules/image.d.ts +0 -2
- package/dist/types/modules/manualUploadProcessing.d.ts +0 -6
- package/dist/types/modules/moduleInitializer.d.ts +0 -1
- package/dist/types/modules/stepFunctions.d.ts +1 -1
- package/dist/types/modules/stepResultProcessing.d.ts +0 -1
- package/dist/types/modules/ui/DesktopNotification/DesktopNotification.d.ts +1 -1
- package/dist/types/modules/ui/VideoWrapper/CanvasWrapper.d.ts +1 -1
- package/dist/types/modules/ui/VideoWrapper/VideoWrapper.d.ts +1 -1
- package/dist/types/types/context.d.ts +0 -1
- package/package.json +1 -1
- package/dist/js/environment/realFaceModes.ts +0 -24
- package/dist/networks/ZXing-chunk.js +0 -1
- package/dist/networks/angle03032023.onnx.gzip +0 -0
- package/dist/types/environment/realFaceModes.d.ts +0 -22
- package/dist/types/helpers/dataManipulation.d.ts +0 -27
- package/dist/types/loader/loadAnglesModel.d.ts +0 -3
- package/dist/types/loader/loadFrontModels.d.ts +0 -3
- package/dist/types/loader/loaderZXing.d.ts +0 -2
- package/dist/types/modules/BarcodeModule.d.ts +0 -28
- package/dist/types/modules/step-result-processing/barcode.d.ts +0 -2
- package/dist/types/neural models/anglesModel.d.ts +0 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_idscan_idvc2=self.webpackChunk_idscan_idvc2||[]).push([[9],{7358:(e,t,n)=>{n.r(t),n.d(t,{default:()=>C});var r=n(4554),i=n(813),o=n(4328),c=n(7286),
|
|
1
|
+
(self.webpackChunk_idscan_idvc2=self.webpackChunk_idscan_idvc2||[]).push([[9],{7358:(e,t,n)=>{n.r(t),n.d(t,{default:()=>C});var r=n(4554),i=n(813),o=n(4328),c=n(7286),a=n(8417),u=n(6955),l=n(528),s=n(683),f=n(6960);function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e,t,n,r,i,o,c){try{var a=e[o](c),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function v(e,t){return!t||"object"!=((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)&&"function"!=typeof t?d(e):t;var n}function g(e,t){return g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},g(e,t)}function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y(e);if(t){var i=y(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return v(this,n)}}function w(e,t){var n,r,i,o,c={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;c;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return c.label++,{value:o[1],done:!1};case 5:c.label++,r=o[1],o=[0];continue;case 7:o=c.ops.pop(),c.trys.pop();continue;default:if(!(i=c.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){c=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){c.label=o[1];break}if(6===o[0]&&c.label<i[1]){c.label=i[1],i=o;break}if(i&&c.label<i[2]){c.label=i[2],c.ops.push(o);break}i[2]&&c.ops.pop(),c.trys.pop();continue}o=t.call(e,c)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}var P={confidence:.5,predictConfidence:.8,classes:["BACKS_MRZ","BACKS_MRZPDF","BACKS_NO","BACKS_PDF","BCC","CAC","DLIC","EA","GC","IID","MID_NEW","MID_OLD","PASSP","PC","VA","VHC","FACE"],inputImageWidth:320,inputImageHeight:224,inputTensorSize:[1,224,320,3],inputTensorName:"image_input",outputTensorSize:[1,21,1470],outputTensorName:"yolov10",predictLength:6,padding:0,documentFramePadding:10},x=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&g(e,t)}(c,e);var t,n,r,o=m(c);function c(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.z.WASM,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),b(d(e=o.call(this,t,n,r)),"canvasSize",{width:1,height:1}),b(d(e),"documentPredictLabelIndex",5),b(d(e),"documentPredictConfidenceIndex",4),e}return t=c,n=[{key:"setSizes",value:function(e){var t=e.height,n=e.width;this.canvasSize.width=n,this.canvasSize.height=t}},{key:"findHighestConfidencePredict",value:function(e,t){var n=this,r=Array.from({length:e.length/t.predictLength},(function(n,r){return e.slice(r*t.predictLength,(r+1)*t.predictLength)})).filter((function(e){return e[n.documentPredictConfidenceIndex]>t.predictConfidence})).slice(0,2);return{documentPredict:r.find((function(e){return t.classes[e[n.documentPredictLabelIndex]]!==t.classes[16]})),facePredict:r.find((function(e){return t.classes[e[n.documentPredictLabelIndex]]===t.classes[16]}))}}},{key:"predictFromImage",value:function(e,t,n){var r,i=this;return(r=function(){var r,o,c,a,u,f,d,h;return w(this,(function(p){switch(p.label){case 0:return i.loading?[2,{}]:(i.loading=!0,r=n?function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){b(e,t,n[t])}))}return e}({},P,n):P,o=i.createSrc(e,"angles-input-canvas"),c=t||(0,l.vL)("general-type-canvas",{width:r.inputImageWidth,height:r.inputImageHeight}),a=(0,l.RT)({width:c.width,height:c.height},{width:o.width,height:o.height},r.padding),(u=c.getContext("2d")).fillStyle="rgb(114, 114, 114)",u.fillRect(0,0,c.width,c.width),u.drawImage(o,a.x,a.y,a.width,a.height),f=(0,s.vG)(u.getImageData(0,0,c.width,c.height),s.eQ.WITHOUT),[4,i.predict(f,r)]);case 1:return d=p.sent(),h=i.findHighestConfidencePredict(d.Identity.cpuData,r),i.setSizes(c),[2,i.interpret(h,a,r.documentFramePadding,r)]}}))},function(){var e=this,t=arguments;return new Promise((function(n,i){var o=r.apply(e,t);function c(e){h(o,n,i,c,a,"next",e)}function a(e){h(o,n,i,c,a,"throw",e)}c(void 0)}))})()}},{key:"interpret",value:function(e,t,n,r){var i=e.documentPredict,o=e.facePredict,c={side:"None",bbox:{topLeft:{x:0,y:0},bottomRight:{x:1,y:1}},perimeterInPercents:{width:0,height:0},isDocumentInsideFrame:!1,isHasFaceOnDocument:!1};if(i){c.side=r.classes[i[5]];var a=i.slice(0,4);c.bbox.topLeft.x=a[0],c.bbox.topLeft.y=a[1],c.bbox.bottomRight.x=a[2],c.bbox.bottomRight.y=a[3];var u=(0,f.Bo)(c.bbox,t,n);c.isDocumentInsideFrame=u.isInside,c.perimeterInPercents.width=+((a[2]-a[0])/t.width*100).toFixed(3),c.perimeterInPercents.height=+((a[3]-a[1])/t.height*100).toFixed(),o&&(c.isHasFaceOnDocument=!0)}return this.loading=!1,c}},{key:"predict",value:function(e,t){var n=new a.es("uint8",e,t.inputTensorSize),r=b({},t.inputTensorName,n);return this.session.run(r)}}],n&&p(t.prototype,n),r&&p(t,r),c}(u.Z);function S(e,t,n,r,i,o,c){try{var a=e[o](c),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function I(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function c(e){S(o,r,i,c,a,"next",e)}function a(e){S(o,r,i,c,a,"throw",e)}c(void 0)}))}}function O(e,t){var n,r,i,o,c={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;c;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return c.label++,{value:o[1],done:!1};case 5:c.label++,r=o[1],o=[0];continue;case 7:o=c.ops.pop(),c.trys.pop();continue;default:if(!(i=c.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){c=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){c.label=o[1];break}if(6===o[0]&&c.label<i[1]){c.label=i[1],i=o;break}if(i&&c.label<i[2]){c.label=i[2],c.ops.push(o);break}i[2]&&c.ops.pop(),c.trys.pop();continue}o=t.call(e,c)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}const C=I((function(){var e;return O(this,(function(t){return e=new x("".concat(r.t.JZ),i.z.WASM,o.Z.networkUrl),c.Z.setModule("model","generalTypeDetectionYolo",e),[2,[e.initialize.bind(e)]]}))}))},4554:e=>{e.exports=JSON.parse('{"t":{"$I":"mrz03032023.onnx","nE":"faceLandmark03032023.onnx","GW":"faceDetection03032023.onnx","JZ":"yoloFaceFingers.onnx"}}')}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_idscan_idvc2=self.webpackChunk_idscan_idvc2||[]).push([[343],{4550:(e,t,r)=>{r.d(t,{o:()=>s});var n=r(7885),o=r(7666);function i(e,t,r,n,o,i,u){try{var a=e[i](u),c=a.value}catch(e){return void r(e)}a.done?t(c):Promise.resolve(c).then(n,o)}function u(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var u=e.apply(t,r);function a(e){i(u,n,o,a,c,"next",e)}function c(e){i(u,n,o,a,c,"throw",e)}a(void 0)}))}}function a(e,t){var r,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}var c,l=(c=u((function(e){var t,r,i,u,c;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),r=Uint8Array.bind,[4,(0,o.xl)(e)];case 1:return t=new(r.apply(Uint8Array,[void 0,a.sent()])),i=(0,n.ec)(t),u=new Blob([i.buffer],{type:"application/javascript"}),[2,URL.createObjectURL(u)];case 2:throw c=a.sent(),console.error("Error loading and decompressing worker file:",c),c;case 3:return[2]}}))})),function(e){return c.apply(this,arguments)}),s=function(){var e=u((function(e){var t;return a(this,(function(r){switch(r.label){case 0:return[4,l(e)];case 1:return t=r.sent(),[2,new Worker(t)]}}))}));return function(t){return e.apply(this,arguments)}}()},5470:(e,t,r)=>{r.r(t),r.d(t,{default:()=>D});var n=r(4328),o=r(7286),i=r(8417),u=r(6955),a=r(813),c=r(683),l=["0","1","2","3","4","*","5","6","7","*","8","9","A","*","B","C","*","D","*","E","*","F","*","G","*","H","I","J","*","K","*","L","*","M","N","O","P","*","Q","R","*","S","T","*","U","*","V","*","W","X","Y","*","Z","<","*"];function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e,t,r,n,o,i,u){try{var a=e[i](u),c=a.value}catch(e){return void r(e)}a.done?t(c):Promise.resolve(c).then(n,o)}function p(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function y(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function b(e,t){return!t||"object"!=((r=t)&&"undefined"!=typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)&&"function"!=typeof t?s(e):t;var r}function d(e,t){return d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},d(e,t)}function v(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=h(e);if(t){var o=h(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return b(this,r)}}function w(e,t){var r,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}var m=[1,28,28,1],g=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}(u,e);var t,r,n,o=v(u);function u(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.z.WASM,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),y(s(e=o.call(this,t,r,n)),"predictionList",void 0),y(s(e),"interpretedPredictionsList",void 0),e}return t=u,r=[{key:"predict",value:function(e){var t=y({},"input_1",new i.es("float32",e,m));return this.session.run(t)}},{key:"predictFromArray",value:function(e,t){var r,n=this;return(r=function(){var r,o,i;return w(this,(function(u){switch(u.label){case 0:if(n.predictionList||(n.predictionList=new Array(t).fill(0)),n.interpretedPredictionsList||(n.interpretedPredictionsList=new Array(t).fill(0)),n.loading)return[2,[]];r=(0,c.Fv)(e,c.eQ.STANDART),o=0,u.label=1;case 1:return o<t?(i=n.predictionList,[4,n.predict(r.subarray(784*o,784*(o+1)))]):[3,4];case 2:i[o]=u.sent(),u.label=3;case 3:return o+=1,[3,1];case 4:return n.predictionList.forEach((function(e,t){n.interpretedPredictionsList[t]=n.interpret(e.dense.data)})),[2,n.interpretedPredictionsList]}}))},function(){var e=this,t=arguments;return new Promise((function(n,o){var i=r.apply(e,t);function u(e){f(i,n,o,u,a,"next",e)}function a(e){f(i,n,o,u,a,"throw",e)}u(void 0)}))})()}},{key:"interpret",value:function(e){return Array.from(e).map((function(e,t){return{value:l[t],confidence:e}})).sort((function(e,t){return e.confidence-t.confidence})).slice(-3).reverse()}},{key:"isLoading",get:function(){return this.loading}},{key:"predictFromImage",value:function(e,t){}}],r&&p(t.prototype,r),n&&p(t,n),u}(u.Z),k=r(3970),O=r(4554);function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function x(e,t,r,n,o,i,u){try{var a=e[i](u),c=a.value}catch(e){return void r(e)}a.done?t(c):Promise.resolve(c).then(n,o)}function j(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function u(e){x(i,n,o,u,a,"next",e)}function a(e){x(i,n,o,u,a,"throw",e)}u(void 0)}))}}function S(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function R(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function A(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){R(e,t,r[t])}))}return e}function E(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})),e}function L(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],u=!0,a=!1;try{for(r=r.call(e);!(u=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);u=!0);}catch(e){a=!0,o=e}finally{try{u||null==r.return||r.return()}finally{if(a)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return P(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return P(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function M(e,t){var r,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}var T=function(){function e(t,r,n){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),R(this,"w",0),R(this,"h",0),R(this,"successCount",0),R(this,"worker",void 0),R(this,"model",void 0),R(this,"isInitialized",!1),R(this,"isProcessing",!1),R(this,"MIN_MRZ_FRAMES",3),this.model=new g("".concat(O.t.$I),a.z.WASM,n),this.worker=t,this.worker.postMessage({fn:"init",initData:{key:r,networkUrl:n}}),this.worker.onmessage=function(e){var t=e.data,r=t.name,n=t.data;"initialization"===r&&(o.isInitialized=n)}}var t,r,n;return t=e,r=[{key:"getErrorVal",value:function(e){var t;return-3===e&&(t=0),-2===e&&(t=1),t}},{key:"licenseError",value:function(e){return{error:!0,errorType:"licenceKeyError",errorVal:this.getErrorVal(e)}}},{key:"yComparator",value:function(e,t){return e.y<t.y?[e,t]:[t,e]}},{key:"allocate",value:function(){}},{key:"prepareMRZLocation",value:function(e){var t=[e.leftTop,e.rightTop,e.rightBottom,e.leftBottom].sort((function(e,t){return e.x-t.x})),r=L(this.yComparator(t[0],t[1]),2),n=r[0],o=r[1],i=L(this.yComparator(t[2],t[3]),2),u=i[0],a=i[1],c=.03;return{leftTop:{x:n.x-c,y:n.y-c},rightTop:{x:u.x+c,y:u.y-c},rightBottom:{x:a.x+c,y:a.y+c},leftBottom:{x:o.x-c,y:o.y+c}}}},{key:"writeResults",value:function(e){var t={mrzText:""},r=e.fields.filter((function(e){return-1!==e.name.indexOf("Line")&&e.value.length>0})).map((function(e){return e.value})).join("\n");return r.length>0&&(t.mrzText=window.btoa(r)),t}},{key:"predict",value:function(e,t){var r=this;return j((function(){var n;return M(this,(function(o){switch(o.label){case 0:return[4,r.model.predictFromArray(e,t)];case 1:return(n=o.sent()).filter((function(e){return"*"===L(e,1)[0].value})).length>3?[4,r.model.predictFromArray(e.reverse(),t)]:[3,3];case 2:n=o.sent(),o.label=3;case 3:return[2,n]}}))}))()}},{key:"scan",value:function(e){var t=this;return new Promise((function(r){t.worker.postMessage({fn:"prepare",iData:e});var n,o=t;t.worker.onmessage=(n=j((function(e){var t,n,i,u;return M(this,(function(a){switch(a.label){case 0:return t=e.data,n=t.name,i=t.data,"batchArr"!==n?[3,2]:[4,o.predict(i.batchArr,i.batchSize)];case 1:return u=a.sent(),o.worker.postMessage({fn:"process",predictions:u}),[2];case 2:return"result"===n&&r(i),r(i),[2]}}))})),function(e){return n.apply(this,arguments)})}))}},{key:"processMRZ",value:function(e){var t=this;return j((function(){var r,n,o,i,u,a,c;return M(this,(function(l){switch(l.label){case 0:return n={status:!1,cancel:!1,touch:!1,image:null,type:"mrz",isSuccessProcess:!1},t.isProcessing?[2,n]:t.isInitialized?(t.isProcessing=!0,[4,(0,k.L)("mrz_stream",(function(){return t.scan(e)}))]):[2,n];case 1:return(null==(o=l.sent())?void 0:o.errorId)?(t.isProcessing=!1,[2,E(A({},o),{error:t.licenseError(o.errorId)})]):(o&&0===(null==o||null===(r=o.status)||void 0===r?void 0:r.value)&&(null==o?void 0:o.count)>0?(i=t.estimateResults(o),u=i===o.count&&o.symbolsConf>.95?"green":"yellow",n.coords={locations:t.prepareMRZLocation(o.location),color:u},a=i===o.count&&o.symbolsConf>.85,c=i>=o.count-2,(a||c)&&(t.successCount+=1,n.isSuccessProcess=!0,t.successCount>=t.MIN_MRZ_FRAMES&&(n.status=!0,n.needToCut=!0,n.image=e,n.results=t.writeResults(o)))):(n.coords=null,t.successCount=0),t.isProcessing=!1,[2,n])}}))}))()}},{key:"estimateResults",value:function(e){return 0===e.count?0:e.fields.reduce((function(e,t){return"Valid"===t.status?e+1:e}),0)}},{key:"detectMrz",value:function(e){var t=this;return j((function(){var r,n,o,i,u;return M(this,(function(a){switch(a.label){case 0:return[4,(0,k.L)("mrz_upload",(function(){return t.scan(e)}))];case 1:return r=a.sent(),n=!0,r&&r.count>0&&r.symbolsConf>.8?(o=t.prepareMRZLocation(r.location),i=t.writeResults(r),[2,{status:!0,locations:o,results:i,isNotMRZ:n=!1}]):(r&&r.symbolsConf>.6&&(n=!1),u={status:!1,isNotMRZ:n},(null==r?void 0:r.errorId)&&(u.error=t.licenseError(r.errorId)),[2,u])}}))}))()}}],r&&S(t.prototype,r),n&&S(t,n),e}();const _=T;var C=r(4295),z=r(4550);function I(e,t,r,n,o,i,u){try{var a=e[i](u),c=a.value}catch(e){return void r(e)}a.done?t(c):Promise.resolve(c).then(n,o)}function Z(e,t){var r,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}const D=(U=function(e){var t,r,i,u;return Z(this,(function(a){switch(a.label){case 0:return(t=e.commonLicenseKey)?[3,1]:((0,C.Z)(),[3,3]);case 1:return[4,(0,z.o)("".concat(n.Z.networkUrl,"mrzWorker.js.gzip"))];case 2:i=a.sent(),u=new _(i,t,n.Z.networkUrl),o.Z.setModule("module","mrz",u),r=[u.model.initialize.bind(u.model)],a.label=3;case 3:return[2,r]}}))},B=function(){var e=this,t=arguments;return new Promise((function(r,n){var o=U.apply(e,t);function i(e){I(o,r,n,i,u,"next",e)}function u(e){I(o,r,n,i,u,"throw",e)}i(void 0)}))},function(e){return B.apply(this,arguments)});var U,B}}]);
|
|
1
|
+
(self.webpackChunk_idscan_idvc2=self.webpackChunk_idscan_idvc2||[]).push([[343],{4550:(e,t,r)=>{r.d(t,{o:()=>l});var n=r(7885),o=r(7666);function i(e,t,r,n,o,i,u){try{var a=e[i](u),c=a.value}catch(e){return void r(e)}a.done?t(c):Promise.resolve(c).then(n,o)}function u(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var u=e.apply(t,r);function a(e){i(u,n,o,a,c,"next",e)}function c(e){i(u,n,o,a,c,"throw",e)}a(void 0)}))}}function a(e,t){var r,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}var c,s=(c=u((function(e){var t,r,i,u,c;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),r=Uint8Array.bind,[4,(0,o.xl)(e)];case 1:return t=new(r.apply(Uint8Array,[void 0,a.sent()])),i=(0,n.ec)(t),u=new Blob([i.buffer],{type:"application/javascript"}),[2,URL.createObjectURL(u)];case 2:throw c=a.sent(),console.error("Error loading and decompressing worker file:",c),c;case 3:return[2]}}))})),function(e){return c.apply(this,arguments)}),l=function(){var e=u((function(e){var t;return a(this,(function(r){switch(r.label){case 0:return[4,s(e)];case 1:return t=r.sent(),[2,new Worker(t)]}}))}));return function(t){return e.apply(this,arguments)}}()},5470:(e,t,r)=>{r.r(t),r.d(t,{default:()=>D});var n=r(4328),o=r(7286),i=r(8417),u=r(6955),a=r(813),c=r(683),s=["0","1","2","3","4","*","5","6","7","*","8","9","A","*","B","C","*","D","*","E","*","F","*","G","*","H","I","J","*","K","*","L","*","M","N","O","P","*","Q","R","*","S","T","*","U","*","V","*","W","X","Y","*","Z","<","*"];function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e,t,r,n,o,i,u){try{var a=e[i](u),c=a.value}catch(e){return void r(e)}a.done?t(c):Promise.resolve(c).then(n,o)}function p(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function y(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function b(e,t){return!t||"object"!=((r=t)&&"undefined"!=typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)&&"function"!=typeof t?l(e):t;var r}function d(e,t){return d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},d(e,t)}function v(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=h(e);if(t){var o=h(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return b(this,r)}}function w(e,t){var r,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}var m=[1,28,28,1],g=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}(u,e);var t,r,n,o=v(u);function u(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.z.WASM,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),y(l(e=o.call(this,t,r,n)),"predictionList",void 0),y(l(e),"interpretedPredictionsList",void 0),e}return t=u,r=[{key:"predict",value:function(e){var t=y({},"input_1",new i.es("float32",e,m));return this.session.run(t)}},{key:"predictFromArray",value:function(e,t){var r,n=this;return(r=function(){var r,o,i;return w(this,(function(u){switch(u.label){case 0:if(n.predictionList||(n.predictionList=new Array(t).fill(0)),n.interpretedPredictionsList||(n.interpretedPredictionsList=new Array(t).fill(0)),n.loading)return[2,[]];r=(0,c.Fv)(e,c.eQ.STANDART),o=0,u.label=1;case 1:return o<t?(i=n.predictionList,[4,n.predict(r.subarray(784*o,784*(o+1)))]):[3,4];case 2:i[o]=u.sent(),u.label=3;case 3:return o+=1,[3,1];case 4:return n.predictionList.forEach((function(e,t){n.interpretedPredictionsList[t]=n.interpret(e.dense.data)})),[2,n.interpretedPredictionsList]}}))},function(){var e=this,t=arguments;return new Promise((function(n,o){var i=r.apply(e,t);function u(e){f(i,n,o,u,a,"next",e)}function a(e){f(i,n,o,u,a,"throw",e)}u(void 0)}))})()}},{key:"interpret",value:function(e){return Array.from(e).map((function(e,t){return{value:s[t],confidence:e}})).sort((function(e,t){return e.confidence-t.confidence})).slice(-3).reverse()}},{key:"isLoading",get:function(){return this.loading}},{key:"predictFromImage",value:function(e,t){}}],r&&p(t.prototype,r),n&&p(t,n),u}(u.Z),k=r(3970),O=r(4554);function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function x(e,t,r,n,o,i,u){try{var a=e[i](u),c=a.value}catch(e){return void r(e)}a.done?t(c):Promise.resolve(c).then(n,o)}function j(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function u(e){x(i,n,o,u,a,"next",e)}function a(e){x(i,n,o,u,a,"throw",e)}u(void 0)}))}}function S(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function R(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function A(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){R(e,t,r[t])}))}return e}function E(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})),e}function L(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],u=!0,a=!1;try{for(r=r.call(e);!(u=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);u=!0);}catch(e){a=!0,o=e}finally{try{u||null==r.return||r.return()}finally{if(a)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return P(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return P(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function M(e,t){var r,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}var T=function(){function e(t,r,n){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),R(this,"w",0),R(this,"h",0),R(this,"successCount",0),R(this,"worker",void 0),R(this,"model",void 0),R(this,"isInitialized",!1),R(this,"isProcessing",!1),R(this,"MIN_MRZ_FRAMES",3),this.model=new g("".concat(O.t.$I),a.z.WASM,n),this.worker=t,this.worker.postMessage({fn:"init",initData:{key:r,networkUrl:n}}),this.worker.onmessage=function(e){var t=e.data,r=t.name,n=t.data;"initialization"===r&&(o.isInitialized=n)}}var t,r,n;return t=e,r=[{key:"getErrorVal",value:function(e){var t;return-3===e&&(t=0),-2===e&&(t=1),t}},{key:"licenseError",value:function(e){return{error:!0,errorType:"licenceKeyError",errorVal:this.getErrorVal(e)}}},{key:"yComparator",value:function(e,t){return e.y<t.y?[e,t]:[t,e]}},{key:"allocate",value:function(){}},{key:"prepareMRZLocation",value:function(e){var t=[e.leftTop,e.rightTop,e.rightBottom,e.leftBottom].sort((function(e,t){return e.x-t.x})),r=L(this.yComparator(t[0],t[1]),2),n=r[0],o=r[1],i=L(this.yComparator(t[2],t[3]),2),u=i[0],a=i[1],c=.03;return{leftTop:{x:n.x-c,y:n.y-c},rightTop:{x:u.x+c,y:u.y-c},rightBottom:{x:a.x+c,y:a.y+c},leftBottom:{x:o.x-c,y:o.y+c}}}},{key:"writeResults",value:function(e){var t={mrzText:""},r=e.fields.filter((function(e){return-1!==e.name.indexOf("Line")&&e.value.length>0})).map((function(e){return e.value})).join("\n");return r.length>0&&(t.mrzText=window.btoa(r)),t}},{key:"predict",value:function(e,t){var r=this;return j((function(){var n;return M(this,(function(o){switch(o.label){case 0:return[4,r.model.predictFromArray(e,t)];case 1:return(n=o.sent()).filter((function(e){return"*"===L(e,1)[0].value})).length>3?[4,r.model.predictFromArray(e.reverse(),t)]:[3,3];case 2:n=o.sent(),o.label=3;case 3:return[2,n]}}))}))()}},{key:"scan",value:function(e){var t=this;return new Promise((function(r){t.worker.postMessage({fn:"prepare",iData:e});var n,o=t;t.worker.onmessage=(n=j((function(e){var t,n,i,u;return M(this,(function(a){switch(a.label){case 0:return t=e.data,n=t.name,i=t.data,"batchArr"!==n?[3,2]:[4,o.predict(i.batchArr,i.batchSize)];case 1:return u=a.sent(),o.worker.postMessage({fn:"process",predictions:u}),[2];case 2:return"result"===n&&r(i),r(i),[2]}}))})),function(e){return n.apply(this,arguments)})}))}},{key:"processMRZ",value:function(e){var t=this;return j((function(){var r,n,o,i,u,a,c;return M(this,(function(s){switch(s.label){case 0:return n={status:!1,cancel:!1,touch:!1,image:null,type:"mrz",isSuccessProcess:!1},t.isProcessing?[2,n]:t.isInitialized?(t.isProcessing=!0,[4,(0,k.L)("mrz_stream",(function(){return t.scan(e)}))]):[2,n];case 1:return(null==(o=s.sent())?void 0:o.errorId)?(t.isProcessing=!1,[2,E(A({},o),{error:t.licenseError(o.errorId)})]):(o&&0===(null==o||null===(r=o.status)||void 0===r?void 0:r.value)&&(null==o?void 0:o.count)>0?(i=t.estimateResults(o),u=i===o.count&&o.symbolsConf>.95?"green":"yellow",n.coords={locations:t.prepareMRZLocation(o.location),color:u},a=i===o.count&&o.symbolsConf>.85,c=i>=o.count-2,(a||c)&&(t.successCount+=1,n.isSuccessProcess=!0,t.successCount>=t.MIN_MRZ_FRAMES&&(n.status=!0,n.needToCut=!0,n.image=e,n.results=t.writeResults(o)))):(n.coords=null,t.successCount=0),t.isProcessing=!1,[2,n])}}))}))()}},{key:"estimateResults",value:function(e){return 0===e.count?0:e.fields.reduce((function(e,t){return"Valid"===t.status?e+1:e}),0)}},{key:"detectMrz",value:function(e){var t=this;return j((function(){var r,n,o,i,u;return M(this,(function(a){switch(a.label){case 0:return[4,(0,k.L)("mrz_upload",(function(){return t.scan(e)}))];case 1:return r=a.sent(),n=!0,r&&r.count>0&&r.symbolsConf>.8?(o=t.prepareMRZLocation(r.location),i=t.writeResults(r),[2,{status:!0,locations:o,results:i,isNotMRZ:n=!1}]):(r&&r.symbolsConf>.6&&(n=!1),u={status:!1,isNotMRZ:n},(null==r?void 0:r.errorId)&&(u.error=t.licenseError(r.errorId)),[2,u])}}))}))()}}],r&&S(t.prototype,r),n&&S(t,n),e}();const _=T;var z=r(4295),C=r(4550);function I(e,t,r,n,o,i,u){try{var a=e[i](u),c=a.value}catch(e){return void r(e)}a.done?t(c):Promise.resolve(c).then(n,o)}function Z(e,t){var r,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}const D=(F=function(e){var t,r,i,u;return Z(this,(function(a){switch(a.label){case 0:return(t=e.commonLicenseKey)?[3,1]:((0,z.Z)(),[3,3]);case 1:return[4,(0,C.o)("".concat(n.Z.networkUrl,"mrzWorker.js.gzip"))];case 2:i=a.sent(),u=new _(i,t,n.Z.networkUrl),o.Z.setModule("module","mrz",u),r=[u.model.initialize.bind(u.model)],a.label=3;case 3:return[2,r]}}))},U=function(){var e=this,t=arguments;return new Promise((function(r,n){var o=F.apply(e,t);function i(e){I(o,r,n,i,u,"next",e)}function u(e){I(o,r,n,i,u,"throw",e)}i(void 0)}))},function(e){return U.apply(this,arguments)});var F,U},4554:e=>{e.exports=JSON.parse('{"t":{"$I":"mrz03032023.onnx","nE":"faceLandmark03032023.onnx","GW":"faceDetection03032023.onnx","JZ":"yoloFaceFingers.onnx"}}')}}]);
|
|
Binary file
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
declare const models: {
|
|
2
2
|
type: any;
|
|
3
|
-
angles: any;
|
|
4
3
|
blazeFace: any;
|
|
5
4
|
meshFace: any;
|
|
6
5
|
generalTypeDetectionYolo: any;
|
|
@@ -9,7 +8,6 @@ declare const modules: {
|
|
|
9
8
|
mrz: any;
|
|
10
9
|
pdf: any;
|
|
11
10
|
face: any;
|
|
12
|
-
barcode: any;
|
|
13
11
|
docDetector: any;
|
|
14
12
|
heic: any;
|
|
15
13
|
blur: any;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { RealFaceMode } from './environment/realFaceModes';
|
|
2
1
|
import { DocumentTypeName } from './environment/documentTypes';
|
|
3
2
|
import { StepType } from './environment/stepsDescription';
|
|
4
3
|
import { AllLabels, supportedLanguages } from './environment/langs';
|
|
@@ -35,7 +34,7 @@ export type DocumentType = {
|
|
|
35
34
|
tooltipText?: string;
|
|
36
35
|
};
|
|
37
36
|
type ImageURI = 'png' | 'jpeg' | 'webp';
|
|
38
|
-
export type DefaultConfigName = 'el' | 'licenseKey' | 'networkUrl' | 'language' | 'customTranslations' | 'documentTypes' | '
|
|
37
|
+
export type DefaultConfigName = 'el' | 'licenseKey' | 'networkUrl' | 'language' | 'customTranslations' | 'documentTypes' | 'modalPosition' | 'resizeUploadedImage' | 'showSubmitBtn' | 'useCDN' | 'processingImageFormat' | 'allowSubmitWithWarnings' | 'autocaptureConfidence' | 'autoContinue' | 'autoStart' | 'playPreviewAnimations' | 'autocaptureDelay' | 'onChange' | 'onReset' | 'submit' | 'onRetakeHook' | 'onCameraError' | 'onMounted' | 'onDocumentTypeSelect' | 'onReloaded' | 'allowCameraSelection';
|
|
39
38
|
/**
|
|
40
39
|
* IDefaultConfig
|
|
41
40
|
* @param {string} name,
|
|
@@ -44,7 +43,6 @@ export type DefaultConfigName = 'el' | 'licenseKey' | 'networkUrl' | 'language'
|
|
|
44
43
|
* @param {string | boolean | DefaultValueFunction | number | DocumentType[] | MessageAfterDelay} defaultValue,
|
|
45
44
|
* @param {ValidationFn} validationFn,
|
|
46
45
|
* @parma {boolean} hidden?,
|
|
47
|
-
* @param {RealFaceMode[]} values?,
|
|
48
46
|
* @param {any[]} arrayValues,
|
|
49
47
|
* @param {boolean} multiple?,
|
|
50
48
|
*/
|
|
@@ -55,7 +53,7 @@ export interface IDefaultConfig {
|
|
|
55
53
|
defaultValue: StepMode | string | boolean | DefaultValueFunction | number | DocumentType[] | MessageAfterDelay;
|
|
56
54
|
validationFn: ValidationFn;
|
|
57
55
|
hidden?: boolean;
|
|
58
|
-
values?: ModalPositionKeys[] |
|
|
56
|
+
values?: ModalPositionKeys[] | typeof supportedLanguages[number][] | ImageURI[] | DeepPartial<AllLabels>;
|
|
59
57
|
arrayValues?: unknown[];
|
|
60
58
|
multiple?: boolean;
|
|
61
59
|
normalizedType?: NormalizedType;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export type DocumentTypeIndex = 1 | 2 | 3 | 4 | 6 | 7 | 9
|
|
2
|
-
export type DIVEDocumentTypeIndex = 1 | 2 | 3 | 6 | 7 | 9
|
|
3
|
-
export type DocumentTypeName = 'DL' | 'IC' | 'Passport' | 'PassportCard' | 'GreenCard' | 'InternationalId' | '
|
|
4
|
-
export type HumanName = 'Driver\'s License' | 'Identification Card' | 'Passport' | 'US Passport Card' | 'Green Card' | 'International ID' | '
|
|
1
|
+
export type DocumentTypeIndex = 1 | 2 | 3 | 4 | 6 | 7 | 9;
|
|
2
|
+
export type DIVEDocumentTypeIndex = 1 | 2 | 3 | 6 | 7 | 9;
|
|
3
|
+
export type DocumentTypeName = 'DL' | 'IC' | 'Passport' | 'PassportCard' | 'GreenCard' | 'InternationalId' | 'EmploymentAuthorization';
|
|
4
|
+
export type HumanName = 'Driver\'s License' | 'Identification Card' | 'Passport' | 'US Passport Card' | 'Green Card' | 'International ID' | 'Employment Authorization';
|
|
5
5
|
export type ImageSource = 'video' | 'file';
|
|
6
6
|
export declare enum DocumentTypeIDs {
|
|
7
7
|
'DL' = 1,
|
|
@@ -10,8 +10,6 @@ export declare enum DocumentTypeIDs {
|
|
|
10
10
|
'PassportCard' = 3,
|
|
11
11
|
'GreenCard' = 6,
|
|
12
12
|
'InternationalId' = 7,
|
|
13
|
-
'Barcode' = 11,
|
|
14
|
-
'FaceAuthorization' = 10,
|
|
15
13
|
'EmploymentAuthorization' = 9
|
|
16
14
|
}
|
|
17
15
|
export interface DocumentRecord {
|
|
@@ -26,13 +26,11 @@ interface IHintTexts {
|
|
|
26
26
|
switchToUploader: string;
|
|
27
27
|
switchToUploaderDisabled: string;
|
|
28
28
|
back: string;
|
|
29
|
-
barcode: string;
|
|
30
29
|
hold: {
|
|
31
30
|
front: string;
|
|
32
31
|
pdf: string;
|
|
33
32
|
mrz: string;
|
|
34
33
|
back: string;
|
|
35
|
-
barcode: string;
|
|
36
34
|
};
|
|
37
35
|
capture: {
|
|
38
36
|
pdf: string;
|
|
@@ -63,7 +61,6 @@ interface IGeneral {
|
|
|
63
61
|
mrzFront: string;
|
|
64
62
|
pdf: string;
|
|
65
63
|
face: string;
|
|
66
|
-
barcode: string;
|
|
67
64
|
back: string;
|
|
68
65
|
awaiting: string;
|
|
69
66
|
notificationStepSuccess: string;
|
|
@@ -116,7 +113,7 @@ interface IGeneral {
|
|
|
116
113
|
showCameraSelectionModal: string;
|
|
117
114
|
};
|
|
118
115
|
desktopNotification: {
|
|
119
|
-
|
|
116
|
+
document: string;
|
|
120
117
|
mrz: string;
|
|
121
118
|
other: string;
|
|
122
119
|
};
|
|
@@ -146,8 +143,6 @@ interface IDocumentsTypes {
|
|
|
146
143
|
GreenCard: string;
|
|
147
144
|
EmploymentAuthorization: string;
|
|
148
145
|
InternationalId: string;
|
|
149
|
-
Barcode: string;
|
|
150
|
-
FaceAuthorization: string;
|
|
151
146
|
}
|
|
152
147
|
interface IUploaderDescription {
|
|
153
148
|
textFront: string;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export type Base64 = string;
|
|
2
2
|
export type Base64DataUrl = string;
|
|
3
|
-
export declare const base64ToUint8Array: (base64: string) => Uint8Array;
|
|
4
3
|
export declare const isBase64DataUrl: (value: string) => value is string;
|
|
5
4
|
export declare const extractBase64: (input?: string | null) => Base64;
|
|
6
5
|
export declare function dataURItoBlob(dataURL: string): Blob;
|
|
@@ -2,6 +2,5 @@ export declare const resizeImageForStepProcessing: (data: any) => Promise<ImageD
|
|
|
2
2
|
declare const _default: {
|
|
3
3
|
getSmallImage: (data: string) => Promise<ImageData>;
|
|
4
4
|
setCurrentImage: (data: any) => Promise<void>;
|
|
5
|
-
fixOrientation: (image: HTMLImageElement) => Promise<ImageData>;
|
|
6
5
|
};
|
|
7
6
|
export default _default;
|
package/dist/types/idvc.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { NeuralModelInitializer } from '../neural models/neuralModel';
|
|
2
|
-
export declare const faceModuleLoader: (
|
|
2
|
+
export declare const faceModuleLoader: () => Promise<void>;
|
|
3
3
|
declare const loadMeshFace: () => Promise<Array<NeuralModelInitializer>>;
|
|
4
4
|
export default loadMeshFace;
|
package/dist/types/loop.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export interface IMrzCoords {
|
|
|
6
6
|
export declare const unmountIDVC: () => void;
|
|
7
7
|
export declare const loop: () => Promise<false>;
|
|
8
8
|
declare const _default: {
|
|
9
|
-
cancel: (topImage: any) => Promise<void>;
|
|
9
|
+
cancel: (topImage: any, isDemandCapture?: boolean) => Promise<void>;
|
|
10
10
|
unmountIDVC: () => void;
|
|
11
11
|
};
|
|
12
12
|
export default _default;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { StepConfig, ValidationFn } from '../defaultConfig';
|
|
2
|
-
import { RealFaceMode } from '../environment/realFaceModes';
|
|
3
2
|
import { AllLabels, SupportedLanguage } from '../environment/langs';
|
|
4
3
|
import { StepType } from '../environment/stepsDescription';
|
|
5
4
|
import { DocumentTypeName } from '../environment/documentTypes';
|
|
@@ -11,11 +10,9 @@ import ValidateDocumentTypes from './validation/ValidateDocumentTypes';
|
|
|
11
10
|
/**
|
|
12
11
|
* @param {string} el,
|
|
13
12
|
* @param {string} licenseKey,
|
|
14
|
-
* @param {RealFaceMode} realFaceMode,
|
|
15
13
|
* @param {IDocumentTypeConfig | null} documentTypes,
|
|
16
14
|
* @param {boolean} autoContinue?,
|
|
17
15
|
* @param {number} resizeUploadedImage?,
|
|
18
|
-
* @param {boolean} fixFrontOrientAfterUpload?,
|
|
19
16
|
* @param {boolean} useCDN?,
|
|
20
17
|
* @param {string} networkUrl?,
|
|
21
18
|
*/
|
|
@@ -24,13 +21,6 @@ export interface IConfig {
|
|
|
24
21
|
el: string;
|
|
25
22
|
/** license key for the web library provided for you by Idscan.net */
|
|
26
23
|
licenseKey: string;
|
|
27
|
-
/**
|
|
28
|
-
* an option that enables advanced image capturing with volumetric face detection. Available values: 'auto', 'all', 'none'
|
|
29
|
-
* - Auto - enable "realFaceMode" only for iPhone
|
|
30
|
-
* - All - enable "realFaceMode" for all devices
|
|
31
|
-
* - None - disable this option
|
|
32
|
-
*/
|
|
33
|
-
realFaceMode: RealFaceMode;
|
|
34
24
|
/**
|
|
35
25
|
* the array contains an object per document type that is configured. Each object has the document type listed in the type field and then in its steps array you can configure what steps you want the user to complete and what capture modes you will allow (i.e. uploader and/or video)
|
|
36
26
|
*
|
|
@@ -42,7 +32,6 @@ export interface IConfig {
|
|
|
42
32
|
* - GreenCard (6) – USA Permanent Resident Cards (only MRZ)
|
|
43
33
|
* - InternationalId (7) – Internationally approved U.S. IDs with 3 lines MRZ
|
|
44
34
|
* - EmploymentAuthorization (9) - Employment Authorization
|
|
45
|
-
* - Barcode (11) – 1-D and 2-D barcodes
|
|
46
35
|
|
|
47
36
|
*
|
|
48
37
|
* Available Step Types
|
|
@@ -51,7 +40,6 @@ export interface IConfig {
|
|
|
51
40
|
* - mrz – detection and capturing of the MRZ of a document
|
|
52
41
|
* - pdf – detection and capturing of pdf417 of a document
|
|
53
42
|
* - face – detection and capturing of the end user's face using the front camera
|
|
54
|
-
* - barcode – detection and capturing of 1 dimensional (barcodes) or 2 dimensional (qr codes)
|
|
55
43
|
* - back - capturing the back side of a document
|
|
56
44
|
*
|
|
57
45
|
* Available Capture Mode
|
|
@@ -66,8 +54,6 @@ export interface IConfig {
|
|
|
66
54
|
autocaptureDelay?: number;
|
|
67
55
|
/** sets the maximum size in pixels (of the largest of the height or width) for a manually uploaded picture */
|
|
68
56
|
resizeUploadedImage?: number;
|
|
69
|
-
/** this setting will change the orientation of a front step's image if it is not horizontal when it is uploaded */
|
|
70
|
-
fixFrontOrientAfterUpload?: boolean;
|
|
71
57
|
/** set to true if you prefer to load neural networks from a content delivery network instead of from your web server */
|
|
72
58
|
useCDN?: boolean;
|
|
73
59
|
/** Path to the folder with neural networks. Specify the path on the server if you need to remove the folder to another location */
|
|
@@ -78,10 +64,6 @@ export interface IConfig {
|
|
|
78
64
|
* Custom translations for UI strings (e.g., titles, buttons). Overrides the default library translations if provided.
|
|
79
65
|
*/
|
|
80
66
|
customTranslations?: DeepPartial<AllLabels>;
|
|
81
|
-
/**
|
|
82
|
-
* if this setting is set to false the document type dialog will not be displayed to the end user
|
|
83
|
-
*/
|
|
84
|
-
isShowDocumentTypeSelect?: boolean;
|
|
85
67
|
/**
|
|
86
68
|
* option to show the button 'submit' after capturing all the images. If the button is turned off, an event will automatically fire that triggers the submit event handler
|
|
87
69
|
*/
|
|
@@ -146,10 +128,8 @@ declare class Config implements IConfig {
|
|
|
146
128
|
autoContinue: boolean;
|
|
147
129
|
autocaptureDelay: number;
|
|
148
130
|
resizeUploadedImage: number;
|
|
149
|
-
fixFrontOrientAfterUpload: boolean;
|
|
150
131
|
useCDN: boolean;
|
|
151
132
|
networkUrl: string;
|
|
152
|
-
realFaceMode: "all" | "auto" | "none";
|
|
153
133
|
language: any;
|
|
154
134
|
constructor(configObject: IConfig);
|
|
155
135
|
getFunction(validationFn: ValidationFn): false | import("./validation/ValidateElement").default | import("./validation/ValidateBool").default | import("./validation/ValidateStringInArray").default | ValidateDocumentTypes | import("./validation/ValidateFunction").default | import("./validation/ValidateNumber").default | import("./validation/ValidateString").default | import("./validation/ValidateAllowCameraSelection").default | import("./validation/ValidateDictionaryLangMatch").default<Record<string, unknown>>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import type Step from './Step';
|
|
1
2
|
export default class MetaData {
|
|
2
3
|
userAgent: string;
|
|
3
4
|
capturedMethod: string;
|
|
4
5
|
version: string;
|
|
5
6
|
logs: Record<string, any>;
|
|
6
7
|
constructor(version?: string);
|
|
7
|
-
captureMethod(steps:
|
|
8
|
-
getMetaData(steps:
|
|
9
|
-
prepareMetaDataForSubmit(steps:
|
|
8
|
+
captureMethod(steps: Array<Step>): void;
|
|
9
|
+
getMetaData(steps: Array<Step>): {};
|
|
10
|
+
prepareMetaDataForSubmit(steps: Array<Step>): string;
|
|
10
11
|
}
|
|
@@ -34,12 +34,8 @@ export interface IStepCallback {
|
|
|
34
34
|
multiImagesBlob?: Blob | null;
|
|
35
35
|
/** step type */
|
|
36
36
|
type: StepType;
|
|
37
|
-
/** is it autocaptured from camera */
|
|
38
|
-
isAuto?: boolean;
|
|
39
37
|
/** image source */
|
|
40
38
|
source?: 'video' | 'file' | '';
|
|
41
|
-
/** step index */
|
|
42
|
-
index?: number;
|
|
43
39
|
/** trackstring from mrz or pdf */
|
|
44
40
|
trackString?: string;
|
|
45
41
|
/** mrz recognized text */
|
|
@@ -61,8 +57,9 @@ export default class Step implements IStepCallback, IStepObj {
|
|
|
61
57
|
trackString?: string;
|
|
62
58
|
err?: string | null;
|
|
63
59
|
text?: string;
|
|
64
|
-
isAuto?: boolean;
|
|
65
60
|
source?: 'video' | 'file';
|
|
61
|
+
/** internal: true when the user pressed the capture button, false on autocapture or file upload */
|
|
62
|
+
isDemandCapture?: boolean;
|
|
66
63
|
configs: StepConfig[];
|
|
67
64
|
name: string;
|
|
68
65
|
type: StepType;
|
|
@@ -80,5 +77,5 @@ export default class Step implements IStepCallback, IStepObj {
|
|
|
80
77
|
setConfig(configName: StepConfigNames, configValue: StepConfigValues): void;
|
|
81
78
|
hasConfig(configName: StepConfigNames): StepConfig | undefined;
|
|
82
79
|
getConfig(configName: StepConfigNames): StepConfigValues | null;
|
|
83
|
-
prepareStepForCallback(
|
|
80
|
+
prepareStepForCallback(): IStepCallback;
|
|
84
81
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { CameraError } from '../initErrorHandler';
|
|
2
2
|
import { Size } from '../../helpers/image';
|
|
3
3
|
export declare const stopTrack: () => void;
|
|
4
|
+
export declare const showCameraUnavailableState: (err?: Error | CameraError) => void;
|
|
4
5
|
export declare const cameraErrorHandling: (err: Error | CameraError) => Promise<never>;
|
|
5
6
|
declare const _default: {
|
|
6
7
|
initUploader: () => Promise<void>;
|
|
8
|
+
showCameraUnavailableState: (err?: Error | CameraError) => void;
|
|
7
9
|
stopTrack: () => void;
|
|
8
10
|
init: (label?: string) => Promise<void>;
|
|
9
11
|
start: (mode: VideoFacingModeEnum) => Promise<void>;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { BrowserInfo } from 'detect-browser';
|
|
2
|
-
export type Angle = 0 | 90 | 180 | 270;
|
|
3
|
-
export declare const rotateImageByAngle: (src: string, angle: Angle) => Promise<unknown>;
|
|
4
2
|
export declare const rotateImageByExif: (src: string, browser: BrowserInfo) => Promise<string>;
|
|
5
3
|
/**
|
|
6
4
|
*
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ErrorCodeNames } from '../environment/langs';
|
|
2
|
-
import { Base64 } from '../helpers/base64';
|
|
3
2
|
type ProcessingErrorCode = ErrorCodeNames | '';
|
|
4
3
|
type Coordinate = {
|
|
5
4
|
x: number;
|
|
@@ -20,11 +19,6 @@ export declare const mrzProcess: (smallImage: ImageData, { side, perimeter, isHa
|
|
|
20
19
|
export declare const pdfProcess: (smallImage: any, { perimeter }: {
|
|
21
20
|
perimeter: any;
|
|
22
21
|
}) => Promise<boolean>;
|
|
23
|
-
/**
|
|
24
|
-
*
|
|
25
|
-
* @param {Base64} data - base64 image
|
|
26
|
-
*/
|
|
27
|
-
export declare const barCodeProcess: (data: Base64) => Promise<boolean>;
|
|
28
22
|
export declare const frontProcess: ({ side, perimeter, isHasFace }: {
|
|
29
23
|
side: any;
|
|
30
24
|
perimeter: any;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type ModuleNames = 'mrz' | 'pdf' | 'face' | 'front'
|
|
1
|
+
type ModuleNames = 'mrz' | 'pdf' | 'face' | 'front';
|
|
2
2
|
type FunctionNames = ModuleNames | 'back';
|
|
3
3
|
declare const stepFunctionWrapper: (functionName: FunctionNames, ...args: any[]) => any;
|
|
4
4
|
export declare const isStepFunctionExist: (functionName: FunctionNames) => boolean;
|
|
@@ -4,7 +4,6 @@ declare const _default: {
|
|
|
4
4
|
mrz: (resultObject: any) => void;
|
|
5
5
|
SimpleFace: (resultObject: any) => void;
|
|
6
6
|
VolumeFace: (resultObject: import("../types/modules/realFace").RealFaceResultObject) => void;
|
|
7
|
-
barcode: (resultObject: any) => void;
|
|
8
7
|
back: (resultObject: any) => void;
|
|
9
8
|
};
|
|
10
9
|
export default _default;
|
|
@@ -2,7 +2,7 @@ import { ComponentLit } from '../ComponentLit';
|
|
|
2
2
|
import { StepType } from '../../../environment/stepsDescription';
|
|
3
3
|
export type DesktopNotificationState = {
|
|
4
4
|
enabled: boolean;
|
|
5
|
-
textType: '
|
|
5
|
+
textType: 'document' | 'other' | 'mrz';
|
|
6
6
|
};
|
|
7
7
|
export type DesktopNotificationVisibility = {
|
|
8
8
|
isEnabledDesktopNotification: boolean;
|
|
@@ -49,7 +49,7 @@ export declare class CanvasWrapper {
|
|
|
49
49
|
prepareFaceCanvas(width: number, height: number): void;
|
|
50
50
|
drawVideo(): void;
|
|
51
51
|
recreateWorkingCanvas(browser: BrowserInfo, browserMajorVersion: number): void;
|
|
52
|
-
drawResizedVideo(currentStepType: StepType,
|
|
52
|
+
drawResizedVideo(currentStepType: StepType, sizeK: number): void;
|
|
53
53
|
private drawResized;
|
|
54
54
|
private drawFace;
|
|
55
55
|
private recreateCanvas;
|
|
@@ -32,7 +32,7 @@ export declare class VideoWrapper {
|
|
|
32
32
|
private cameraErrorText;
|
|
33
33
|
private UIComponents;
|
|
34
34
|
constructor(componentWrapper: HTMLElement);
|
|
35
|
-
updateVideoWrap({ currentStepImg,
|
|
35
|
+
updateVideoWrap({ currentStepImg, }: UpdateVideoWrapParams): void;
|
|
36
36
|
setMirroring(isMirroring: boolean): void;
|
|
37
37
|
setVideoWrapEnabled(enabled?: boolean): void;
|
|
38
38
|
toggleVideoPos(isStarted: boolean): void;
|
package/package.json
CHANGED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export type RealFaceMode = keyof typeof realFaceModes;
|
|
2
|
-
|
|
3
|
-
const realFaceModes = {
|
|
4
|
-
/**
|
|
5
|
-
* enable "realFaceMode" only for iphone.
|
|
6
|
-
*/
|
|
7
|
-
auto: {
|
|
8
|
-
description: 'enable "realFaceMode" only for iphone.',
|
|
9
|
-
},
|
|
10
|
-
/**
|
|
11
|
-
* disable this option.
|
|
12
|
-
*/
|
|
13
|
-
none: {
|
|
14
|
-
description: 'disable this option.',
|
|
15
|
-
},
|
|
16
|
-
/**
|
|
17
|
-
* enable "realFaceMode" for all devices.
|
|
18
|
-
*/
|
|
19
|
-
all: {
|
|
20
|
-
description: 'enable "realFaceMode" for all devices.',
|
|
21
|
-
},
|
|
22
|
-
} as const;
|
|
23
|
-
|
|
24
|
-
export default realFaceModes;
|