@idscan/idvc2 2.9.0 → 2.10.0
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 +10 -4
- package/dist/css/idvc.css +1 -1
- package/dist/idvc.js +1 -1
- package/dist/idvc.js.gzip +0 -0
- package/dist/index.html +41 -45
- package/dist/js/defaultConfig.ts +5 -5
- package/dist/js/environment/langs.js +1 -1
- package/dist/js/environment/networkNames.json +1 -2
- package/dist/js/environment/stepsDescription.ts +5 -4
- package/dist/langs.js.gzip +0 -0
- package/dist/networks/Face-chunk.js +1 -1
- package/dist/networks/MRZ-chunk.js +1 -1
- package/dist/networks/blurWorker.js.gzip +0 -0
- package/dist/networks/generalTypeDetectionYolo29052024.onnx.gzip +0 -0
- package/dist/networks/mrzWorker.js.gzip +0 -0
- package/dist/types/bl.d.ts +2 -2
- package/dist/types/constatnts/animations.d.ts +1 -0
- package/dist/types/context.d.ts +1 -129
- package/dist/types/controllers/ModuleController.d.ts +26 -7
- package/dist/types/defaultConfig.d.ts +1 -1
- package/dist/types/environment/langs.d.ts +69 -8
- package/dist/types/environment/stepsDescription.d.ts +1 -0
- package/dist/types/eventListeners/eventListeners.d.ts +1 -1
- package/dist/types/eventListeners/selectDocumentType/selectHandler.d.ts +1 -3
- package/dist/types/helpers/cameraConstraints.d.ts +6 -0
- package/dist/types/helpers/canvas.d.ts +3 -3
- package/dist/types/helpers/detectLanguage.d.ts +1 -0
- package/dist/types/helpers/image.d.ts +6 -7
- package/dist/types/helpers/layoutBreakpoints.d.ts +10 -0
- package/dist/types/helpers/step-background.d.ts +2 -2
- package/dist/types/idvc.d.ts +1 -1
- package/dist/types/loop.d.ts +2 -2
- package/dist/types/{modules/manualUpload.d.ts → manualUpload.d.ts} +3 -3
- package/dist/types/modules/App/UI-Types.d.ts +9 -0
- package/dist/types/modules/App/UI.d.ts +52 -0
- package/dist/types/modules/App/WebLibManualUploader.d.ts +13 -0
- package/dist/types/modules/Config.d.ts +2 -2
- package/dist/types/modules/MrzModule.d.ts +3 -3
- package/dist/types/modules/PdfModule.d.ts +3 -3
- package/dist/types/modules/Slider.d.ts +10 -0
- package/dist/types/modules/Spinner/Spinner.d.ts +22 -0
- package/dist/types/modules/Step.d.ts +7 -3
- package/dist/types/modules/camera/camera.d.ts +2 -2
- package/dist/types/modules/camera/cameraManager.d.ts +6 -2
- package/dist/types/modules/manualUploadProcessing.d.ts +8 -8
- package/dist/types/modules/ui/CardStep/Card.d.ts +33 -0
- package/dist/types/modules/ui/CardStep/CardStep.d.ts +10 -0
- package/dist/types/modules/ui/Component.d.ts +32 -0
- package/dist/types/modules/ui/ControlButton/ControlButton.d.ts +22 -0
- package/dist/types/modules/ui/DesktopNotification/DesktopNotification.d.ts +17 -0
- package/dist/types/modules/ui/DocumentsList/DocumentsList.d.ts +21 -0
- package/dist/types/modules/ui/IDVCVersionPlank/IDVCVersionPlank.d.ts +10 -0
- package/dist/types/modules/ui/InitialLoader/initialLoader.d.ts +12 -0
- package/dist/types/modules/ui/MainScreen/MainScreen.d.ts +75 -0
- package/dist/types/modules/ui/MessageBox/MessageBox.d.ts +30 -0
- package/dist/types/modules/ui/Modal.d.ts +5 -7
- package/dist/types/modules/ui/ModeSwitch/ModeSwitch.d.ts +20 -0
- package/dist/types/modules/ui/Notification/Notification.d.ts +24 -0
- package/dist/types/modules/ui/SelectDocumentType.d.ts +8 -11
- package/dist/types/modules/ui/Spinner/SpinnerUI.d.ts +11 -0
- package/dist/types/modules/ui/StepsList/StepsList.d.ts +48 -0
- package/dist/types/modules/ui/Uploader/UploaderUI.d.ts +39 -0
- package/dist/types/modules/ui/VideoWrapper/CanvasWrapper.d.ts +46 -0
- package/dist/types/modules/ui/{Flashlight.d.ts → VideoWrapper/Flashlight.d.ts} +8 -8
- package/dist/types/modules/ui/VideoWrapper/MaskCapture.d.ts +47 -0
- package/dist/types/modules/ui/VideoWrapper/StepPreview/StepPreview.d.ts +16 -0
- package/dist/types/modules/ui/VideoWrapper/UIHints.d.ts +27 -0
- package/dist/types/modules/ui/VideoWrapper/VideoWrapper.d.ts +44 -0
- package/dist/types/modules/ui/selectDocumentType/documentSelectedEvent.d.ts +2 -2
- package/dist/types/neural models/generalTypeDetectionYoloModel.d.ts +1 -1
- package/dist/types/stepProcessing.d.ts +3 -3
- package/dist/types/types/context.d.ts +121 -0
- package/dist/types/util.d.ts +1 -1
- package/package.json +5 -1
- package/dist/networks/ClassLocal-chunk.js +0 -1
- package/dist/networks/classLocal03032023.onnx.gzip +0 -0
- package/dist/types/loader/loaderClassLocal.d.ts +0 -3
- package/dist/types/modules/heic.d.ts +0 -11
- package/dist/types/modules/ui/MaskCapture.d.ts +0 -76
- package/dist/types/modules/ui/MessageBox.d.ts +0 -21
- package/dist/types/modules/ui/canvas.d.ts +0 -49
- package/dist/types/modules/ui/forceCaptruringBtn.d.ts +0 -12
- package/dist/types/modules/ui/hints.d.ts +0 -17
- package/dist/types/modules/ui/limitations.d.ts +0 -2
- package/dist/types/modules/ui/manualSwitchBtn.d.ts +0 -30
- package/dist/types/modules/ui/spinner.d.ts +0 -13
- package/dist/types/modules/uploader.d.ts +0 -58
- package/dist/types/neural models/classLocal/exits.d.ts +0 -4
- package/dist/types/neural models/classLocalModel.d.ts +0 -29
- package/dist/types/ui.d.ts +0 -93
|
@@ -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:()=>Z});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 v(e,t){return v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},v(e,t)}function d(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&&v(e,t)}(u,e);var t,r,n,o=d(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(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 O(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 x(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function u(e){O(i,n,o,u,a,"next",e)}function a(e){O(i,n,o,u,a,"throw",e)}u(void 0)}))}}function j(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 S(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function R(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){S(e,t,r[t])}))}return e}function A(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 E(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),S(this,"w",0),S(this,"h",0),S(this,"successCount",0),S(this,"worker",void 0),S(this,"model",void 0),S(this,"isInitialized",!1),S(this,"isProcessing",!1),S(this,"MIN_MRZ_FRAMES",3),this.model=new g("".concat(k.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=E(this.yComparator(t[0],t[1]),2),n=r[0],o=r[1],i=E(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 x((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"*"===E(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=x((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 x((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,t.scan(e)]):[2,n];case 1:return(null==(o=l.sent())?void 0:o.errorId)?(t.isProcessing=!1,[2,A(R({},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 x((function(){var r,n,o,i,u;return M(this,(function(a){switch(a.label){case 0:return[4,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&&j(t.prototype,r),n&&j(t,n),e}();const C=T;var _=r(4295),L=r(4550);function z(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 I(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 Z=(D=function(e){var t,r,i,u;return I(this,(function(a){switch(a.label){case 0:return(t=e.commonLicenseKey)?[3,1]:((0,_.Z)(),[3,3]);case 1:return[4,(0,L.o)("".concat(n.Z.chunkPublicPath,"mrzWorker.js.gzip"))];case 2:i=a.sent(),u=new C(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=D.apply(e,t);function i(e){z(o,r,n,i,u,"next",e)}function u(e){z(o,r,n,i,u,"throw",e)}i(void 0)}))},function(e){return B.apply(this,arguments)});var D,B}}]);
|
|
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:()=>Z});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 v(e,t){return v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},v(e,t)}function d(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&&v(e,t)}(u,e);var t,r,n,o=d(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(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 O(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 x(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function u(e){O(i,n,o,u,a,"next",e)}function a(e){O(i,n,o,u,a,"throw",e)}u(void 0)}))}}function j(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 S(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function R(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){S(e,t,r[t])}))}return e}function A(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 E(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 L=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),S(this,"w",0),S(this,"h",0),S(this,"successCount",0),S(this,"worker",void 0),S(this,"model",void 0),S(this,"isInitialized",!1),S(this,"isProcessing",!1),S(this,"MIN_MRZ_FRAMES",3),this.model=new g("".concat(k.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=E(this.yComparator(t[0],t[1]),2),n=r[0],o=r[1],i=E(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 x((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"*"===E(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=x((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 x((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,t.scan(e)]):[2,n];case 1:return(null==(o=l.sent())?void 0:o.errorId)?(t.isProcessing=!1,[2,A(R({},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 x((function(){var r,n,o,i,u;return M(this,(function(a){switch(a.label){case 0:return[4,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&&j(t.prototype,r),n&&j(t,n),e}();const T=L;var C=r(4295),_=r(4550);function z(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 I(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 Z=(D=function(e){var t,r,i,u;return I(this,(function(a){switch(a.label){case 0:return(t=e.commonLicenseKey)?[3,1]:((0,C.Z)(),[3,3]);case 1:return[4,(0,_.o)("".concat(n.Z.chunkPublicPath,"mrzWorker.js.gzip"))];case 2:i=a.sent(),u=new T(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=D.apply(e,t);function i(e){z(o,r,n,i,u,"next",e)}function u(e){z(o,r,n,i,u,"throw",e)}i(void 0)}))},function(e){return B.apply(this,arguments)});var D,B}}]);
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/types/bl.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { IConfig } from './modules/Config';
|
|
2
2
|
import { IDocumentTypeConfig } from './modules/validator';
|
|
3
3
|
declare const bl: {
|
|
4
|
-
showSelectDocumentTypeModal(
|
|
4
|
+
showSelectDocumentTypeModal(isFirstInit: boolean): void;
|
|
5
5
|
postInit(): Promise<void>;
|
|
6
6
|
mount(): Promise<void>;
|
|
7
7
|
start(): Promise<void>;
|
|
8
8
|
changeDocumentType(): void;
|
|
9
9
|
resetAllSteps(): Promise<void>;
|
|
10
|
-
resetSteps(): void
|
|
10
|
+
resetSteps(): Promise<void>;
|
|
11
11
|
updateDocumentTypes(documentTypes: IDocumentTypeConfig): Promise<any>;
|
|
12
12
|
reloadComponent(config: Partial<IConfig>): Promise<void>;
|
|
13
13
|
showSpinner(val: boolean): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SHOW_PREVIEW_DELAY = 4000;
|
package/dist/types/context.d.ts
CHANGED
|
@@ -1,131 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DocumentTypeIndex } from './environment/documentTypes';
|
|
3
|
-
import Uploader from './modules/uploader';
|
|
4
|
-
import LoggerController from './controllers/LoggerController';
|
|
5
|
-
import Step from './modules/Step';
|
|
6
|
-
import { Base64Image, ISize, IOffset } from './helpers/image';
|
|
7
|
-
import MetaData from './modules/MetaData';
|
|
8
|
-
import { StepType } from './environment/stepsDescription';
|
|
9
|
-
import { StepConfig, StepMode } from './defaultConfig';
|
|
10
|
-
import { IMRZResults } from './types/mrz';
|
|
11
|
-
import { RealFaceTurnSide } from './types/enums/realFace';
|
|
12
|
-
import { InitClient } from './modules/supaBaseClient';
|
|
13
|
-
type LoopFunction = () => Promise<false>;
|
|
14
|
-
export interface Context {
|
|
15
|
-
isIIphone: boolean;
|
|
16
|
-
minPDFframes: number;
|
|
17
|
-
sizeK: number;
|
|
18
|
-
VERSION: string;
|
|
19
|
-
topImage: ImageData | null;
|
|
20
|
-
running: boolean;
|
|
21
|
-
allowedTypesIds: (DocumentTypeIndex | 0)[];
|
|
22
|
-
type: DocumentTypeIndex | 0;
|
|
23
|
-
capturingMode: 'processImage5' | 'processImage4';
|
|
24
|
-
isBrowserSupport: boolean;
|
|
25
|
-
resizedData: ImageData | null;
|
|
26
|
-
origData: ImageData | null;
|
|
27
|
-
cameraSupported: boolean;
|
|
28
|
-
isMirroring: boolean;
|
|
29
|
-
config: Record<string, any>;
|
|
30
|
-
networkUrl: string;
|
|
31
|
-
chunkPublicPath: string;
|
|
32
|
-
showForceCapturingBtn: boolean;
|
|
33
|
-
imageFormat: 'webp' | 'jpeg';
|
|
34
|
-
supabase: ReturnType<typeof InitClient> | null;
|
|
35
|
-
cameraInfo: Record<string, any>;
|
|
36
|
-
idvcLinkParam: string;
|
|
37
|
-
mobileInfo: Record<string, any>;
|
|
38
|
-
metaData: MetaData | null;
|
|
39
|
-
uploader: Uploader | null;
|
|
40
|
-
loggerController: LoggerController | null;
|
|
41
|
-
browser?: BrowserInfo;
|
|
42
|
-
browserMajorVersion?: number;
|
|
43
|
-
steps: Step[];
|
|
44
|
-
currentStepType: StepType;
|
|
45
|
-
currentStepCamera: VideoFacingModeEnum;
|
|
46
|
-
currentStepImg: Base64Image | null;
|
|
47
|
-
currentStepBlob: Blob | null;
|
|
48
|
-
curStep: number;
|
|
49
|
-
currentStep: number;
|
|
50
|
-
currentStepObj: Step;
|
|
51
|
-
isStarted: boolean;
|
|
52
|
-
loopFrame: boolean;
|
|
53
|
-
loopStarted: boolean;
|
|
54
|
-
isRealFaceAvailable: boolean;
|
|
55
|
-
realFaceTurnSide: RealFaceTurnSide;
|
|
56
|
-
invertFace: boolean;
|
|
57
|
-
isDetectFace: boolean;
|
|
58
|
-
isVerification: boolean;
|
|
59
|
-
isMobile: boolean;
|
|
60
|
-
processFace3d: {
|
|
61
|
-
started: boolean;
|
|
62
|
-
ended: boolean;
|
|
63
|
-
start(): void;
|
|
64
|
-
end(): void;
|
|
65
|
-
};
|
|
66
|
-
baseWidth: number;
|
|
67
|
-
baseHeight: number;
|
|
68
|
-
videoLoading: boolean;
|
|
69
|
-
isVideoCapture: boolean;
|
|
70
|
-
track: MediaStreamTrack | null;
|
|
71
|
-
stream: MediaStream | null;
|
|
72
|
-
isShowStayText: boolean;
|
|
73
|
-
isShowHoldText: boolean;
|
|
74
|
-
isShowHelpText: boolean;
|
|
75
|
-
isShowSwitchToUploaderText: boolean;
|
|
76
|
-
isShowCloserText: boolean;
|
|
77
|
-
isShowCenterText: boolean;
|
|
78
|
-
isShowAwayText: boolean;
|
|
79
|
-
isShowComeBackText: boolean;
|
|
80
|
-
isShowTurnText: boolean;
|
|
81
|
-
isShowFacePercentText: boolean;
|
|
82
|
-
isShowStayCalmText: boolean;
|
|
83
|
-
isShowNotSeeText: boolean;
|
|
84
|
-
isShowDocumentCloserText: boolean;
|
|
85
|
-
keys: {
|
|
86
|
-
imageProcessingKey: string;
|
|
87
|
-
pdf417key: string;
|
|
88
|
-
commonLicenseKey: string;
|
|
89
|
-
};
|
|
90
|
-
licenseKeyError: string | null | undefined;
|
|
91
|
-
resizedCanvasSizes: ISize;
|
|
92
|
-
videoCanvasSizes: ISize;
|
|
93
|
-
resizedToBorderScale: ISize;
|
|
94
|
-
cropSizes: ISize;
|
|
95
|
-
cropSize: ISize;
|
|
96
|
-
cropResizedSizes: ISize;
|
|
97
|
-
cropResizedSize: ISize;
|
|
98
|
-
cropFaceSize: ISize;
|
|
99
|
-
cropFace: ISize;
|
|
100
|
-
/**
|
|
101
|
-
* разрешение камеры
|
|
102
|
-
*/
|
|
103
|
-
baseSizes: ISize;
|
|
104
|
-
resizedToBorder: ISize;
|
|
105
|
-
offsetsFace: IOffset;
|
|
106
|
-
offsetsResized: IOffset;
|
|
107
|
-
offsets: IOffset;
|
|
108
|
-
loop: null | LoopFunction;
|
|
109
|
-
get currentStepMode(): StepMode;
|
|
110
|
-
get currentStepDelay(): number;
|
|
111
|
-
get hasFrontStep(): boolean;
|
|
112
|
-
calculateIsMirroring(): void;
|
|
113
|
-
dropKeys(): void;
|
|
114
|
-
resetStats(): void;
|
|
115
|
-
dropSizes(): void;
|
|
116
|
-
resetHints(): void;
|
|
117
|
-
dropMediaDevices(): void;
|
|
118
|
-
dropState(): void;
|
|
119
|
-
clearStepData(): void;
|
|
120
|
-
fillSteps(): void;
|
|
121
|
-
setMRZParsedResults(res: IMRZResults): void;
|
|
122
|
-
initImageFormat(): void;
|
|
123
|
-
initVerificationState(): void;
|
|
124
|
-
initLogging(): void;
|
|
125
|
-
init(): void;
|
|
126
|
-
dropCounters(): void;
|
|
127
|
-
updateRealFaceTurnSide(): void;
|
|
128
|
-
getStepConfigValue<K extends keyof StepConfig>(key: K): StepConfig[K];
|
|
129
|
-
}
|
|
1
|
+
import type { Context } from './types/context';
|
|
130
2
|
declare const context: Context;
|
|
131
3
|
export default context;
|
|
@@ -1,11 +1,30 @@
|
|
|
1
|
+
declare const models: {
|
|
2
|
+
type: any;
|
|
3
|
+
angles: any;
|
|
4
|
+
blazeFace: any;
|
|
5
|
+
meshFace: any;
|
|
6
|
+
generalTypeDetectionYolo: any;
|
|
7
|
+
};
|
|
8
|
+
declare const modules: {
|
|
9
|
+
mrz: any;
|
|
10
|
+
pdf: any;
|
|
11
|
+
face: any;
|
|
12
|
+
barcode: any;
|
|
13
|
+
docDetector: any;
|
|
14
|
+
heic: any;
|
|
15
|
+
blur: any;
|
|
16
|
+
bubble: any;
|
|
17
|
+
};
|
|
18
|
+
export type ModuleType = 'module' | 'model';
|
|
19
|
+
export type ModuleName = keyof typeof models | keyof typeof modules;
|
|
1
20
|
declare const _default: {
|
|
2
|
-
isExist: (type:
|
|
3
|
-
isLoaded: (type:
|
|
4
|
-
setModule: (type:
|
|
5
|
-
execute: (type:
|
|
6
|
-
asyncExecute: (type:
|
|
7
|
-
addCallback: (type:
|
|
8
|
-
existPropertyInModule: (
|
|
21
|
+
isExist: (type: ModuleType, name: ModuleName) => boolean;
|
|
22
|
+
isLoaded: (type: ModuleType, name: ModuleName) => boolean;
|
|
23
|
+
setModule: (type: ModuleType, name: ModuleName, module: any) => void;
|
|
24
|
+
execute: (type: ModuleType, name: ModuleName, method: any, ...params: any[]) => any;
|
|
25
|
+
asyncExecute: (type: ModuleType, name: ModuleName, method: any, ...params: any[]) => Promise<any>;
|
|
26
|
+
addCallback: (type: ModuleType, name: ModuleName, cb: any) => void;
|
|
27
|
+
existPropertyInModule: (name: ModuleName, propertyName: any) => boolean;
|
|
9
28
|
allocateAll: () => Promise<void>[];
|
|
10
29
|
};
|
|
11
30
|
export default _default;
|
|
@@ -28,7 +28,7 @@ export type DocumentType = {
|
|
|
28
28
|
mode?: StepMode;
|
|
29
29
|
};
|
|
30
30
|
type ImageURI = 'png' | 'jpeg' | 'webp';
|
|
31
|
-
export type DefaultConfigName = 'el' | 'licenseKey' | 'networkUrl' | 'chunkPublicPath' | 'language' | 'documentTypes' | 'realFaceMode' | 'modalPosition' | 'resizeUploadedImage' | 'showSubmitBtn' | 'h_stepMode' | 'isShowDocumentTypeSelect' | 'useCDN' | 'useHeic' | 'processingImageFormat' | '
|
|
31
|
+
export type DefaultConfigName = 'el' | 'licenseKey' | 'networkUrl' | 'chunkPublicPath' | 'language' | 'documentTypes' | 'realFaceMode' | 'modalPosition' | 'resizeUploadedImage' | 'showSubmitBtn' | 'h_stepMode' | 'isShowDocumentTypeSelect' | 'useCDN' | 'useHeic' | 'processingImageFormat' | 'allowSubmitWithWarnings' | 'autoContinue' | 'autocaptureDelay' | 'isShowGuidelinesButton' | 'fixFrontOrientAfterUpload' | 'onChange' | 'clickGuidlines' | 'onReset' | 'submit' | 'onRetakeHook' | 'onCameraError' | 'onMounted' | 'onReloaded';
|
|
32
32
|
/**
|
|
33
33
|
* IDefaultConfig
|
|
34
34
|
* @param {string} name,
|
|
@@ -13,9 +13,10 @@ type GetTranslation = {
|
|
|
13
13
|
(groupName: 'spinnerText'): ISpinnerText;
|
|
14
14
|
(groupName: LabelGroup): AllTypes;
|
|
15
15
|
};
|
|
16
|
-
export type ErrorCodeNames = 'mrzNotFound' | 'mrzNotRecognized' | 'barcodeNotFound' | 'barcodeNotRecognized' | 'heic' | 'fileType' | 'fileTypeHeic' | 'faceNotFound' | 'disableStepFileUpload' | 'notAllowedDocument' | 'documentSideLowPerimeter' | 'frontSideNotDetected' | 'backSideNotDetected' | 'default' | 'lowImageResolution' | 'imageIsBlurred' | 'faceLowArea' | keyof typeof CameraNotSupportedReason;
|
|
16
|
+
export type ErrorCodeNames = 'mrzNotFound' | 'mrzNotRecognized' | 'barcodeNotFound' | 'barcodeNotRecognized' | 'heic' | 'fileType' | 'fileTypeHeic' | 'faceNotFound' | 'disableStepFileUpload' | 'notAllowedDocument' | 'documentSideLowPerimeter' | 'frontSideNotDetected' | 'backSideNotDetected' | 'default' | 'lowImageResolution' | 'imageIsBlurred' | 'faceLowArea' | 'disabledManualUpload' | keyof typeof CameraNotSupportedReason;
|
|
17
|
+
export type ErrorCodes = '' | ErrorCodeNames;
|
|
17
18
|
export type SupportedLanguage = typeof supportedLanguages[number];
|
|
18
|
-
type IErrorCodes = Record<ErrorCodeNames, string
|
|
19
|
+
type IErrorCodes = Record<ErrorCodeNames, string | Record<string, any>>;
|
|
19
20
|
interface IHintTexts {
|
|
20
21
|
front: string;
|
|
21
22
|
frontMRZ: string;
|
|
@@ -25,7 +26,13 @@ interface IHintTexts {
|
|
|
25
26
|
switchToUploader: string;
|
|
26
27
|
back: string;
|
|
27
28
|
barcode: string;
|
|
28
|
-
hold:
|
|
29
|
+
hold: {
|
|
30
|
+
front: string;
|
|
31
|
+
pdf: string;
|
|
32
|
+
mrz: string;
|
|
33
|
+
back: string;
|
|
34
|
+
barcode: string;
|
|
35
|
+
};
|
|
29
36
|
dontSee: string;
|
|
30
37
|
dontMove: string;
|
|
31
38
|
turnFaceLeft: string;
|
|
@@ -44,8 +51,65 @@ interface ICameraLabels {
|
|
|
44
51
|
awaiting: string;
|
|
45
52
|
}
|
|
46
53
|
interface IGeneral {
|
|
54
|
+
step: string;
|
|
55
|
+
scan: string;
|
|
56
|
+
front: string;
|
|
57
|
+
mrz: string;
|
|
58
|
+
mrzFront: string;
|
|
59
|
+
pdf: string;
|
|
60
|
+
face: string;
|
|
61
|
+
barcode: string;
|
|
62
|
+
back: string;
|
|
63
|
+
photo: string;
|
|
64
|
+
notificationStepSuccess: string;
|
|
65
|
+
notificationStepWarning: string;
|
|
66
|
+
notificationDocumentTypeChangedInfo: string;
|
|
67
|
+
notificationStepsResetInfo: string;
|
|
68
|
+
notificationStepMinSize: string;
|
|
69
|
+
notificationSubmit: string;
|
|
70
|
+
initialLoader: {
|
|
71
|
+
top: string;
|
|
72
|
+
bottom: string;
|
|
73
|
+
};
|
|
74
|
+
card: {
|
|
75
|
+
edit: string;
|
|
76
|
+
complete: string;
|
|
77
|
+
};
|
|
78
|
+
modeSwitch: {
|
|
79
|
+
video: string;
|
|
80
|
+
uploader: string;
|
|
81
|
+
};
|
|
82
|
+
uploader: {
|
|
83
|
+
dragHint: string;
|
|
84
|
+
dividerHint: string;
|
|
85
|
+
fileHint: string;
|
|
86
|
+
successUpload: string;
|
|
87
|
+
warningUpload: string;
|
|
88
|
+
mainHint: string;
|
|
89
|
+
complete: string;
|
|
90
|
+
};
|
|
91
|
+
messageBox: {
|
|
92
|
+
default: string;
|
|
93
|
+
};
|
|
94
|
+
controlButtons: {
|
|
95
|
+
upload: string;
|
|
96
|
+
reset: string;
|
|
97
|
+
submit: string;
|
|
98
|
+
start: string;
|
|
99
|
+
back: string;
|
|
100
|
+
edit: string;
|
|
101
|
+
continue: string;
|
|
102
|
+
capture: string;
|
|
103
|
+
retake: string;
|
|
104
|
+
};
|
|
105
|
+
desktopNotification: {
|
|
106
|
+
barcode: string;
|
|
107
|
+
mrz: string;
|
|
108
|
+
other: string;
|
|
109
|
+
};
|
|
47
110
|
documentType: string;
|
|
48
111
|
selectDocumentTypeText: string;
|
|
112
|
+
changeDocumentTypeText: string;
|
|
49
113
|
changeBtn: string;
|
|
50
114
|
correctBtn: string;
|
|
51
115
|
cancelBtn: string;
|
|
@@ -55,11 +119,6 @@ interface IGeneral {
|
|
|
55
119
|
continueBtn: string;
|
|
56
120
|
submitBtn: string;
|
|
57
121
|
resetAllStepsBtn: string;
|
|
58
|
-
desktopNotification: {
|
|
59
|
-
barcode: string;
|
|
60
|
-
mrz: string;
|
|
61
|
-
other: string;
|
|
62
|
-
};
|
|
63
122
|
btnUploader: string;
|
|
64
123
|
btnCamera: string;
|
|
65
124
|
pressToUpdateText: string;
|
|
@@ -71,6 +130,8 @@ interface IDocumentsTypes {
|
|
|
71
130
|
PassportCard: string;
|
|
72
131
|
GreenCard: string;
|
|
73
132
|
InternationalId: string;
|
|
133
|
+
VIN: string;
|
|
134
|
+
Barcode: string;
|
|
74
135
|
}
|
|
75
136
|
interface IUploaderDescription {
|
|
76
137
|
textFront: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IConfig } from '../modules/Config';
|
|
2
2
|
type BLTemp2 = {
|
|
3
3
|
postInit: () => Promise<void>;
|
|
4
|
-
mount: (() => Promise<void>)
|
|
4
|
+
mount: (() => Promise<void>);
|
|
5
5
|
start: (() => Promise<void>) | (() => void);
|
|
6
6
|
changeDocumentType: () => void;
|
|
7
7
|
resetAllSteps: () => Promise<void>;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
import { DocumentSelectEvent } from '../../modules/ui/selectDocumentType/documentSelectedEvent';
|
|
2
|
-
declare const _default: (
|
|
3
|
-
mount: () => void;
|
|
4
|
-
}, { docType, id }: DocumentSelectEvent) => Promise<void>;
|
|
2
|
+
declare const _default: ({ docType, id }: DocumentSelectEvent) => Promise<void>;
|
|
5
3
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Size } from './image';
|
|
2
2
|
import { ICrop, IOffset } from './ts/common';
|
|
3
3
|
import { Bbox } from '../types/geometry';
|
|
4
4
|
type GetIDataFromCenter = (offsetVertical: number, offsetHorizontal: number) => ImageData;
|
|
@@ -21,12 +21,12 @@ export declare const drawImageOnTestCanvas: (idata: ImageData | HTMLImageElement
|
|
|
21
21
|
ctx: CanvasRenderingContext2D;
|
|
22
22
|
};
|
|
23
23
|
export declare const drawCropOnCanvas: (bbox: Bbox, ctx: CanvasRenderingContext2D) => void;
|
|
24
|
-
export declare const resize: (src: HTMLCanvasElement | HTMLVideoElement, dst: HTMLCanvasElement, offsets?: IOffset, cropSizes?:
|
|
24
|
+
export declare const resize: (src: HTMLCanvasElement | HTMLVideoElement, dst: HTMLCanvasElement, offsets?: IOffset, cropSizes?: Size) => ImageData;
|
|
25
25
|
export declare const cropAndResize: (src: HTMLCanvasElement | HTMLVideoElement, dst: HTMLCanvasElement) => {
|
|
26
26
|
crop: ICrop;
|
|
27
27
|
resized: ImageData;
|
|
28
28
|
};
|
|
29
|
-
export declare const createCanvas: (id: string, size:
|
|
29
|
+
export declare const createCanvas: (id: string, size: Size) => HTMLCanvasElement;
|
|
30
30
|
export declare const createCanvasFromImage: (id: string, image: HTMLImageElement) => HTMLCanvasElement;
|
|
31
31
|
export declare const createCanvasFromImageData: (id: string, imageData: ImageData) => HTMLCanvasElement;
|
|
32
32
|
export declare function calculateFitInSquare(outerBox: any, innerBox: any, padding?: number): {
|
|
@@ -5,18 +5,17 @@ export type RGBColor8 = Uint8ClampedArray;
|
|
|
5
5
|
export type RGBColor32 = Float32Array;
|
|
6
6
|
type PixelPosition = number;
|
|
7
7
|
type Segmentize = (binarizedImg: Uint8ClampedArray, width: number) => Set<PixelPosition>[];
|
|
8
|
-
type
|
|
9
|
-
export interface IOffset {
|
|
8
|
+
export type Offset = {
|
|
10
9
|
top: number;
|
|
11
10
|
left: number;
|
|
12
|
-
}
|
|
11
|
+
};
|
|
13
12
|
/**
|
|
14
13
|
* { width: number, height: number }
|
|
15
14
|
*/
|
|
16
|
-
export
|
|
15
|
+
export type Size = {
|
|
17
16
|
width: number;
|
|
18
17
|
height: number;
|
|
19
|
-
}
|
|
18
|
+
};
|
|
20
19
|
export declare const generateFaceColorFromAngle: (angle: number) => RGBAColor;
|
|
21
20
|
/**
|
|
22
21
|
*
|
|
@@ -24,7 +23,7 @@ export declare const generateFaceColorFromAngle: (angle: number) => RGBAColor;
|
|
|
24
23
|
* @param {number} threshold
|
|
25
24
|
* @return number[] - black and whited array;
|
|
26
25
|
*/
|
|
27
|
-
export declare const binarize:
|
|
26
|
+
export declare const binarize: (iData: any, threshold?: number) => Uint8ClampedArray;
|
|
28
27
|
export declare const segmentize2: Segmentize;
|
|
29
28
|
export declare const getResizedSizes: (size: any, { baseWidth, baseHeight }: {
|
|
30
29
|
baseWidth: any;
|
|
@@ -33,5 +32,5 @@ export declare const getResizedSizes: (size: any, { baseWidth, baseHeight }: {
|
|
|
33
32
|
width: number;
|
|
34
33
|
height: number;
|
|
35
34
|
};
|
|
36
|
-
export declare const getCrop: (src:
|
|
35
|
+
export declare const getCrop: (src: Size, dst: Size) => ICrop;
|
|
37
36
|
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type LayoutBreakpoints = {
|
|
2
|
+
'2560': Record<string, any>;
|
|
3
|
+
'1920': Record<string, any>;
|
|
4
|
+
'1440': Record<string, any>;
|
|
5
|
+
'600': Record<string, any>;
|
|
6
|
+
'400': Record<string, any>;
|
|
7
|
+
'360': Record<string, any>;
|
|
8
|
+
'320': Record<string, any>;
|
|
9
|
+
};
|
|
10
|
+
export declare const getLayoutConfigKey: (config: LayoutBreakpoints) => number;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
import { StepTypeImageName } from '../environment/stepsDescription';
|
|
2
|
+
export declare const getStepBackground: (stepType: StepTypeImageName) => string;
|
package/dist/types/idvc.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export default class VideoCapturing {
|
|
|
13
13
|
resetAllSteps(): void;
|
|
14
14
|
reloadComponent(newConfig: Partial<IConfig>): void;
|
|
15
15
|
updateDocumentTypes(documentTypes: IDocumentTypeConfig): void;
|
|
16
|
-
showSpinner(val:
|
|
16
|
+
showSpinner(val: any): void;
|
|
17
17
|
showLoader(val: boolean, bottomText?: string, topText?: string): void;
|
|
18
18
|
private init;
|
|
19
19
|
}
|
package/dist/types/loop.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MRZLocation } from './modules/manualUploadProcessing';
|
|
2
2
|
import { Cancel } from './types/loop';
|
|
3
3
|
export interface IMrzCoords {
|
|
4
|
-
locations:
|
|
4
|
+
locations: MRZLocation;
|
|
5
5
|
color: 'green' | 'yellow';
|
|
6
6
|
}
|
|
7
7
|
export declare const loopTimeout: (ms: number) => Promise<unknown>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Base64Image } from '
|
|
2
|
-
|
|
1
|
+
import { Base64Image } from './helpers/image';
|
|
2
|
+
type Base64Object = {
|
|
3
3
|
data: ImageData | Base64Image | null;
|
|
4
4
|
err: boolean;
|
|
5
|
-
}
|
|
5
|
+
};
|
|
6
6
|
declare const dropFile: (base64Obj: Base64Object) => Promise<void>;
|
|
7
7
|
export default dropFile;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IStepModeKeys } from '../../defaultConfig';
|
|
2
|
+
export type SwitchComponentModeEventDetail = {
|
|
3
|
+
mode: IStepModeKeys;
|
|
4
|
+
};
|
|
5
|
+
export type SwitchComponentModeCustomEvent = CustomEvent<SwitchComponentModeEventDetail>;
|
|
6
|
+
export type ChangeStepEventDetail = {
|
|
7
|
+
stepNumber: number;
|
|
8
|
+
};
|
|
9
|
+
export type ChangeStepCustomEvent = CustomEvent<ChangeStepEventDetail>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { MainScreen } from '../ui/MainScreen/MainScreen';
|
|
2
|
+
import { Size } from '../../helpers/image';
|
|
3
|
+
import { Spinner } from '../Spinner/Spinner';
|
|
4
|
+
import SelectDocumentType from '../ui/SelectDocumentType';
|
|
5
|
+
import { InitialLoader } from '../ui/InitialLoader/initialLoader';
|
|
6
|
+
import { DocumentsList } from '../ui/DocumentsList/DocumentsList';
|
|
7
|
+
import { StepsList } from '../ui/StepsList/StepsList';
|
|
8
|
+
import { IDVCVersionPlank } from '../ui/IDVCVersionPlank/IDVCVersionPlank';
|
|
9
|
+
import { AnimationSettings, Notification, NotificationState } from '../ui/Notification/Notification';
|
|
10
|
+
import type { Context } from '../../types/context';
|
|
11
|
+
export declare class WeblibUI {
|
|
12
|
+
mountElement: HTMLElement;
|
|
13
|
+
initialLoader: InitialLoader;
|
|
14
|
+
mainScreen: MainScreen;
|
|
15
|
+
spinner: Spinner;
|
|
16
|
+
selectDocumentType: SelectDocumentType;
|
|
17
|
+
initScreen: DocumentsList;
|
|
18
|
+
stepsScreen: StepsList;
|
|
19
|
+
idvcVersionContainer: IDVCVersionPlank;
|
|
20
|
+
constructor(mountElement: HTMLElement);
|
|
21
|
+
createNotification(notificationContainer: HTMLElement, { status, message, }: NotificationState, animationSettings: AnimationSettings): Notification;
|
|
22
|
+
updateResetButton({ steps, }: Context): void;
|
|
23
|
+
updateControlButtons({ steps, config, }: Context): void;
|
|
24
|
+
initGeneralText(context: Context): void;
|
|
25
|
+
updateMessageBox({ type, licenseKeyError }: Context): void;
|
|
26
|
+
resizeBorders(): void;
|
|
27
|
+
setResizedCanvasSizes({ width, height }: Size): void;
|
|
28
|
+
showMainScreen(): void;
|
|
29
|
+
showStepsList(): void;
|
|
30
|
+
private setFaceOffsets;
|
|
31
|
+
private setCropFace;
|
|
32
|
+
private initMainScreenComponents;
|
|
33
|
+
private initStepsList;
|
|
34
|
+
private initDocumentsList;
|
|
35
|
+
private mainScreenEditButtonClick;
|
|
36
|
+
private mainScreenControlButtonClick;
|
|
37
|
+
private stepsListControlButtonClick;
|
|
38
|
+
private initStepsListScreen;
|
|
39
|
+
switchComponentMode(mode: 'uploader' | 'video'): void;
|
|
40
|
+
private switchCapturingMode;
|
|
41
|
+
private changeStep;
|
|
42
|
+
private getCropSizes;
|
|
43
|
+
private setResizedOffsets;
|
|
44
|
+
private setResizedCrops;
|
|
45
|
+
private getResizedBaseSizes;
|
|
46
|
+
private setCropSizes;
|
|
47
|
+
private setDefaultVideoCanvasSizes;
|
|
48
|
+
private setOffsets;
|
|
49
|
+
}
|
|
50
|
+
declare let UI: WeblibUI;
|
|
51
|
+
declare const initUI: () => void;
|
|
52
|
+
export { initUI, UI };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { UploaderUI } from '../ui/Uploader/UploaderUI';
|
|
2
|
+
export declare class WebLibManualUploader {
|
|
3
|
+
private ui;
|
|
4
|
+
private manualUploaderEvents;
|
|
5
|
+
constructor(ui: UploaderUI, onHandle: () => void, onSubmit: () => void);
|
|
6
|
+
handleClick(): void;
|
|
7
|
+
private handleDrop;
|
|
8
|
+
private checkType;
|
|
9
|
+
private handleFiles;
|
|
10
|
+
}
|
|
11
|
+
declare let ManualUploader: WebLibManualUploader;
|
|
12
|
+
declare const initManualUploader: (uploaderUI: any, onHandle: any, onSubmit: any) => void;
|
|
13
|
+
export { ManualUploader, initManualUploader };
|