@idscan/onboarding 2.6.3 → 2.7.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.
@@ -1 +1 @@
1
- (self.webpackChunk_idscan_idvc2=self.webpackChunk_idscan_idvc2||[]).push([[9],{7358:(t,e,n)=>{n.r(e),n.d(e,{default:()=>A});var r=n(4554),i=n(813),o=n(4328),u=n(7286),a=n(8417),c=n(6955),l=n(528),f=n(683);function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function h(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function p(t,e,n,r,i,o,u){try{var a=t[o](u),c=a.value}catch(t){return void n(t)}a.done?e(c):Promise.resolve(c).then(r,i)}function y(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function d(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function b(t){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},b(t)}function v(t,e){return v=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},v(t,e)}function g(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o=[],u=!0,a=!1;try{for(n=n.call(t);!(u=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);u=!0);}catch(t){a=!0,i=t}finally{try{u||null==n.return||n.return()}finally{if(a)throw i}}return o}}(t,e)||w(t,e)||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(t){return function(t){if(Array.isArray(t))return s(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||w(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(t,e){if(t){if("string"==typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(t,e):void 0}}function S(t){var e=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(t){return!1}}();return function(){var n,r=b(t);if(e){var i=b(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(t,e){return!e||"object"!=((n=e)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)&&"function"!=typeof e?h(t):e;var n}(this,n)}}var I={confidence:.5,predictConfidence:.55,classes:["BACKS_MRZ","BACKS_MRZPDF","BACKS_NO","BACKS_PDF","BCC","CAC","DLIC","EA","GC","IID","MID_NEW","MID_OLD","PASSP","PC","VA","VHC"],inputImageWidth:320,inputImageHeight:224,inputTensorSize:[1,224,320,3],inputTensorName:"image_input",outputTensorSize:[1,21,1470],outputTensorName:"Identity"},x=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&v(t,e)}(o,t);var e,n,r=S(o);function o(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.z.WASM,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),d(h(t=r.call(this,e,n,u)),"canvasSize",{width:1,height:1}),t}return e=o,n=[{key:"setSizes",value:function(t){var e=t.height,n=t.width;this.canvasSize.width=n,this.canvasSize.height=e}},{key:"predictFromImage",value:function(t,e){var n,r=this;return(n=function(){var n,i,o,u,a,c,s;return function(t,e){var n,r,i,o,u={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(;u;)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 u.label++,{value:o[1],done:!1};case 5:u.label++,r=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){u=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){u.label=o[1];break}if(6===o[0]&&u.label<i[1]){u.label=i[1],i=o;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(o);break}i[2]&&u.ops.pop(),u.trys.pop();continue}o=e.call(t,u)}catch(t){o=[6,t],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])}}}(this,(function(h){switch(h.label){case 0:return r.loading?[2,{}]:(r.loading=!0,n=r.createSrc(t,"angles-input-canvas"),i=e||(0,l.vL)("general-type-canvas",{width:I.inputImageWidth,height:I.inputImageHeight}),o=(0,l.RT)({width:i.width,height:i.height},{width:n.width,height:n.height},10),(u=i.getContext("2d")).fillStyle="rgb(114, 114, 114)",u.fillRect(0,0,i.width,i.width),u.drawImage(n,o.x,o.y,o.width,o.height),a=(0,f.vG)(u.getImageData(0,0,i.width,i.height),f.eQ.WITHOUT),[4,r.predict(a)]);case 1:return c=h.sent(),s=r.processOutput(c[I.outputTensorName].data,i.width,i.height),r.setSizes(i),[2,r.interpret(s)]}}))},function(){var t=this,e=arguments;return new Promise((function(r,i){var o=n.apply(t,e);function u(t){p(o,r,i,u,a,"next",t)}function a(t){p(o,r,i,u,a,"throw",t)}u(void 0)}))})()}},{key:"interpret",value:function(t){var e=t.filter((function(t){return t[5]>I.predictConfidence}))[0]||[],n={side:"None",bbox:{topLeft:{x:0,y:0},bottomRight:{x:1,y:1}},perimeterInPercents:{width:0,height:0}};if(e.length){n.side=e[4];var r=e.slice(0,4);n.bbox.topLeft.x=r[0],n.bbox.topLeft.y=r[1],n.bbox.bottomRight.x=r[2],n.bbox.bottomRight.y=r[3],n.perimeterInPercents.width=(r[2]-r[0])/this.canvasSize.width*100,n.perimeterInPercents.height=(r[3]-r[1])/this.canvasSize.height*100}return this.loading=!1,n}},{key:"processOutput",value:function(t,e,n){for(var r=function(r){var i=m(Array(I.classes.length).keys()).map((function(e){return[e,t[u*(e+4)+r]]})).reduce((function(t,e){return e[1]>t[1]?e:t}),[0,0]);if(i[1]<I.confidence)return"continue";var a=I.classes[i[0]],c=t[r],l=t[u+r],f=t[2*u+r],s=t[3*u+r],h=(c-f/2)/I.inputImageWidth*e,p=(l-s/2)/I.inputImageHeight*n,y=(c+f/2)/I.inputImageWidth*e,d=(l+s/2)/I.inputImageHeight*n;o.push([h,p,y,d,a,i[1]])},i=this,o=[],u=I.outputTensorSize[I.outputTensorSize.length-1],a=0;a<u;a+=1)r(a);o=o.sort((function(t,e){return e[5]-t[5]}));for(var c=[];o.length>0;)c.push(o[0]),o=o.filter((function(t){return i.iou(o[0],t)<.2}));return c}},{key:"iou",value:function(t,e){return this.intersection(t,e)/this.union(t,e)}},{key:"union",value:function(t,e){var n=g(t,4),r=n[0],i=n[1],o=n[2],u=n[3],a=g(e,4),c=a[0],l=a[1];return(o-r)*(u-i)+(a[2]-c)*(a[3]-l)-this.intersection(t,e)}},{key:"intersection",value:function(t,e){var n=g(t,4),r=n[0],i=n[1],o=n[2],u=n[3],a=g(e,4),c=a[0],l=a[1],f=a[2],s=a[3],h=Math.max(r,c),p=Math.max(i,l);return(Math.min(o,f)-h)*(Math.min(u,s)-p)}},{key:"predict",value:function(t){var e=new a.es("float32",t,I.inputTensorSize),n=d({},I.inputTensorName,e);return this.session.run(n)}}],n&&y(e.prototype,n),o}(c.Z);function k(t,e,n,r,i,o,u){try{var a=t[o](u),c=a.value}catch(t){return void n(t)}a.done?e(c):Promise.resolve(c).then(r,i)}const A=function(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function u(t){k(o,r,i,u,a,"next",t)}function a(t){k(o,r,i,u,a,"throw",t)}u(void 0)}))}}((function(){var t;return function(t,e){var n,r,i,o,u={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(;u;)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 u.label++,{value:o[1],done:!1};case 5:u.label++,r=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){u=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){u.label=o[1];break}if(6===o[0]&&u.label<i[1]){u.label=i[1],i=o;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(o);break}i[2]&&u.ops.pop(),u.trys.pop();continue}o=e.call(t,u)}catch(t){o=[6,t],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])}}}(this,(function(e){return t=new x("".concat(r.t.JZ),i.z.WASM,o.Z.networkUrl),u.Z.setModule("model","generalTypeDetectionYolo",t),[2,[t.initialize.bind(t)]]}))}))}}]);
1
+ (self.webpackChunk_idscan_idvc2=self.webpackChunk_idscan_idvc2||[]).push([[9],{7358:(e,t,n)=>{n.r(t),n.d(t,{default:()=>x});var r=n(4554),i=n(813),o=n(4328),c=n(7286),u=n(8417),a=n(6955),l=n(528),s=n(683),f=n(6960);function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(e,t,n,r,i,o,c){try{var u=e[o](c),a=u.value}catch(e){return void n(e)}u.done?t(a):Promise.resolve(a).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 v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},v(e,t)}function g(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 function(e,t){return!t||"object"!=((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)&&"function"!=typeof t?h(e):t;var n}(this,n)}}var m={confidence:.5,predictConfidence:.9,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},w=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)}(o,e);var t,n,r=g(o);function o(){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,c=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,o),b(h(e=r.call(this,t,n,c)),"canvasSize",{width:1,height:1}),b(h(e),"documentPredictLabelIndex",5),b(h(e),"documentPredictConfidenceIndex",4),e}return t=o,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){var t=this,n=Array.from({length:e.length/m.predictLength},(function(t,n){return e.slice(n*m.predictLength,(n+1)*m.predictLength)})).filter((function(e){return e[t.documentPredictConfidenceIndex]>m.predictConfidence})).slice(0,2);return{documentPredict:n.find((function(e){return m.classes[e[t.documentPredictLabelIndex]]!==m.classes[16]})),facePredict:n.find((function(e){return m.classes[e[t.documentPredictLabelIndex]]===m.classes[16]}))}}},{key:"predictFromImage",value:function(e,t){var n,r=this;return(n=function(){var n,i,o,c,u,a,f;return function(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:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){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=(i=c.trys).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,u])}}}(this,(function(h){switch(h.label){case 0:return r.loading?[2,{}]:(r.loading=!0,n=r.createSrc(e,"angles-input-canvas"),i=t||(0,l.vL)("general-type-canvas",{width:m.inputImageWidth,height:m.inputImageHeight}),o=(0,l.RT)({width:i.width,height:i.height},{width:n.width,height:n.height},10),(c=i.getContext("2d")).fillStyle="rgb(114, 114, 114)",c.fillRect(0,0,i.width,i.width),c.drawImage(n,o.x,o.y,o.width,o.height),u=(0,s.vG)(c.getImageData(0,0,i.width,i.height),s.eQ.WITHOUT),[4,r.predict(u)]);case 1:return a=h.sent(),f=r.findHighestConfidencePredict(a.Identity.cpuData),r.setSizes(i),[2,r.interpret(f,o,10)]}}))},function(){var e=this,t=arguments;return new Promise((function(r,i){var o=n.apply(e,t);function c(e){d(o,r,i,c,u,"next",e)}function u(e){d(o,r,i,c,u,"throw",e)}c(void 0)}))})()}},{key:"interpret",value:function(e,t,n){var r=e.documentPredict,i=e.facePredict,o={side:"None",bbox:{topLeft:{x:0,y:0},bottomRight:{x:1,y:1}},perimeterInPercents:{width:0,height:0},isDocumentInsideFrame:!1,isHasFaceOnDocument:!1};if(r){o.side=m.classes[r[5]];var c=r.slice(0,4);o.bbox.topLeft.x=c[0],o.bbox.topLeft.y=c[1],o.bbox.bottomRight.x=c[2],o.bbox.bottomRight.y=c[3];var u=(0,f.Bo)(o.bbox,t,n);o.isDocumentInsideFrame=u.isInside,o.perimeterInPercents.width=+((c[2]-c[0])/t.width*100).toFixed(3),o.perimeterInPercents.height=+((c[3]-c[1])/t.height*100).toFixed(),i&&(o.isHasFaceOnDocument=!0)}return this.loading=!1,o}},{key:"predict",value:function(e){var t=new u.es("uint8",e,m.inputTensorSize),n=b({},m.inputTensorName,t);return this.session.run(n)}}],n&&p(t.prototype,n),o}(a.Z);function P(e,t,n,r,i,o,c){try{var u=e[o](c),a=u.value}catch(e){return void n(e)}u.done?t(a):Promise.resolve(a).then(r,i)}const x=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function c(e){P(o,r,i,c,u,"next",e)}function u(e){P(o,r,i,c,u,"throw",e)}c(void 0)}))}}((function(){var e;return function(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:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){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=(i=c.trys).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,u])}}}(this,(function(t){return e=new w("".concat(r.t.JZ),i.z.WASM,o.Z.networkUrl),c.Z.setModule("model","generalTypeDetectionYolo",e),[2,[e.initialize.bind(e)]]}))}))}}]);
@@ -1 +1 @@
1
- (self.webpackChunk_idscan_idvc2=self.webpackChunk_idscan_idvc2||[]).push([[596],{4550:(e,r,t)=>{t.d(r,{o:()=>c});var n=t(7885),o=t(7666);function i(e,r,t,n,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void t(e)}u.done?r(s):Promise.resolve(s).then(n,o)}function a(e){return function(){var r=this,t=arguments;return new Promise((function(n,o){var a=e.apply(r,t);function u(e){i(a,n,o,u,s,"next",e)}function s(e){i(a,n,o,u,s,"throw",e)}u(void 0)}))}}function u(e,r){var t,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=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 a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=r.call(e,a)}catch(e){i=[6,e],n=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}var s,l=(s=a((function(e){var r,t,i,a,s;return u(this,(function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),t=Uint8Array.bind,[4,(0,o.xl)(e)];case 1:return r=new(t.apply(Uint8Array,[void 0,u.sent()])),i=(0,n.ec)(r),a=new Blob([i.buffer],{type:"application/javascript"}),[2,URL.createObjectURL(a)];case 2:throw s=u.sent(),console.error("Error loading and decompressing worker file:",s),s;case 3:return[2]}}))})),function(e){return s.apply(this,arguments)}),c=function(){var e=a((function(e){var r;return u(this,(function(t){switch(t.label){case 0:return[4,l(e)];case 1:return r=t.sent(),[2,new Worker(r)]}}))}));return function(r){return e.apply(this,arguments)}}()},8766:(e,r,t)=>{t.r(r),t.d(r,{default:()=>m});var n=t(4328),o=t(6399);function i(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function a(e,r,t,n,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void t(e)}u.done?r(s):Promise.resolve(s).then(n,o)}function u(e){return function(){var r=this,t=arguments;return new Promise((function(n,o){var i=e.apply(r,t);function u(e){a(i,n,o,u,s,"next",e)}function s(e){a(i,n,o,u,s,"throw",e)}u(void 0)}))}}function s(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function l(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function c(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,i=[],a=!0,u=!1;try{for(t=t.call(e);!(a=(n=t.next()).done)&&(i.push(n.value),!r||i.length!==r);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==t.return||t.return()}finally{if(u)throw o}}return i}}(e,r)||function(e,r){if(e){if("string"==typeof e)return i(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?i(e,r):void 0}}(e,r)||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 f(e,r){var t,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=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 a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=r.call(e,a)}catch(e){i=[6,e],n=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}var d,p,h=function(){function e(r,t,n){var o=this;!function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,e),l(this,"module",void 0),l(this,"handle",null),l(this,"bw",0),l(this,"bh",0),l(this,"src",null),l(this,"out",null),l(this,"isAllocate",!1),l(this,"worker",void 0),l(this,"isProcessing",!1),l(this,"isInitialized",!1),l(this,"successCount",0),l(this,"pdfCapturedCount",0),l(this,"src2",null),l(this,"locations",null),l(this,"pdfCount",0),l(this,"geometry",void 0),l(this,"minPDFframes",1),l(this,"cropSizes",void 0),l(this,"canvasSizes",void 0),l(this,"privateErrorId",0),this.worker=r,this.worker.onmessage=function(e){var r=e.data,t=r.name,n=r.data;"initialization"===t&&(o.isInitialized=n)},this.worker.postMessage({fn:"init",key:t,isNeedToLoadPDFWIthPreprocess:n})}var r,t;return r=e,(t=[{key:"errorId",get:function(){return this.privateErrorId},set:function(e){this.privateErrorId=[o.l.Detected,o.l.Decoded].includes(e)?0:e}},{key:"errorVal",get:function(){var e;return this.errorId===o.l.LicenseKeyHasExpired&&(e=0),this.errorId===o.l.InvalidLicenseKey&&(e=1),e}},{key:"init",value:function(e,r,t,n){this.geometry=e,this.minPDFframes=r,this.cropSizes=t,this.canvasSizes=n}},{key:"licenseError",value:function(){return{error:!0,errorType:"licenceKeyError",errorVal:this.errorVal}}},{key:"create",value:function(){}},{key:"setSizes",value:function(e,r){this.bw=e,this.bh=r,this.worker.postMessage({fn:"setSizes",bw:e,bh:r})}},{key:"allocate",value:function(){this.worker.postMessage({fn:"allocate"})}},{key:"drawCords",value:function(e){var r=this,t=[];if(e){var n=[];Object.entries(e).forEach((function(e){var t=c(e,2),o=t[0],i=t[1],a=Math.trunc(i),u=o[0],s=+o[1]-1;n[s]||(n[s]={x:0,y:0}),"x"===u?n[s].x=r.canvasSizes.width*a/r.bw:n[s].y=r.canvasSizes.height*a/r.bh}));var o=[n[3].x-n[0].x,n[3].y-n[0].y],i=[n[1].x-n[0].x,n[1].y-n[0].y],a=[n[2].x-n[1].x,n[2].y-n[1].y],u=[n[3].x-n[2].x,n[3].y-n[2].y],s=this.geometry.angleBetweenTwoVectors(o,i),l=this.geometry.angleBetweenTwoVectors(a,u);s<=100&&s>=80&&l<=100&&l>=80&&(t=n)}return t}},{key:"processPDF",value:function(e){var r=this;return u((function(){var t,n;return f(this,(function(i){switch(i.label){case 0:return r.isProcessing?[2,{}]:(t={status:!1,predict:!1,touch:!1,image:null,type:"pdf",error:null,coords:[],trackString:"",pdfSuccessCount:0,pdfCount:0,isSuccessProcess:!1,pdfCapturedCount:0},r.isInitialized?(r.isProcessing=!0,[4,r.readPDF(e)]):[2,t]);case 1:return(n=i.sent()).error?(r.isProcessing=!1,t.error=n,[2,t]):(n&&"status"in n&&(n.status.value===o.l.Detected&&(r.pdfCapturedCount+=1),n.status.value===o.l.Detected||n.status.value===o.l.Decoded?(t.coords=r.drawCords(n.location),t.isSuccessProcess=!0):(r.successCount+=1,r.drawCords(null)),n.status.value===o.l.Decoded?(r.pdfCount+=1,r.pdfCount>=r.minPDFframes&&(r.successCount=0,r.pdfCount=0,t.trackString=n.trackString||n.data||"",t.status=!0,t.image=e,t.pdfCapturedCount=0)):r.pdfCount=0),t.pdfSuccessCount=r.successCount,t.pdfCount=r.pdfCount,t.pdfCapturedCount=r.pdfCapturedCount,r.isProcessing=!1,[2,t])}}))}))()}},{key:"processPDFWithPreProcess",value:function(e){var r=this;return new Promise((function(t){r.worker.onmessage=function(e){var n=e.data,o=n.name,i=n.data;if("result"===o){var a;r.errorId=null==i||null===(a=i.status)||void 0===a?void 0:a.value;var u=r.errorId?r.licenseError():null;t(u||i)}else t(i)},r.worker.postMessage({fn:"pdfWithPreProcess",iData:e})}))}},{key:"readPDF",value:function(e){var r=this;return u((function(){return f(this,(function(t){return[2,new Promise((function(t){r.worker.onmessage=function(e){var n=e.data,o=n.name,i=n.data,a=n.bw,u=n.bh;if("ready"===o)r.worker.postMessage({fn:"process"});else if("result"===o){var s;r.errorId=null==i||null===(s=i.status)||void 0===s?void 0:s.value;var l=(r.errorId?r.licenseError():null)||i;r.bw=a,r.bh=u,t(l)}else t(i)},r.worker.postMessage({fn:"prepare",iData:e})}))]}))}))()}}])&&s(r.prototype,t),e}(),y=t(7286),v=t(4550);function b(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function w(e,r,t,n,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void t(e)}u.done?r(s):Promise.resolve(s).then(n,o)}const m=(d=function(e){var r,t,o,i;return function(e,r){var t,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=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 a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=r.call(e,a)}catch(e){i=[6,e],n=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(a){switch(a.label){case 0:return r=e.pdf417key,t=!!Object.entries(n.Z.config.documentTypes).find((function(e){var r=function(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,i=[],a=!0,u=!1;try{for(t=t.call(e);!(a=(n=t.next()).done)&&(i.push(n.value),!r||i.length!==r);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==t.return||t.return()}finally{if(u)throw o}}return i}}(e,r)||function(e,r){if(e){if("string"==typeof e)return b(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?b(e,r):void 0}}(e,r)||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.")}()}(e,2);return r[0],r[1].find((function(e){return("pdf"===e.type||"back"===e.type)&&e.mode.uploader}))})),[4,(0,v.o)("".concat(n.Z.chunkPublicPath,"pdfWorker.js.gzip"))];case 1:return o=a.sent(),i=new h(o,r,t),y.Z.setModule("module","pdf",i),[2]}}))},p=function(){var e=this,r=arguments;return new Promise((function(t,n){var o=d.apply(e,r);function i(e){w(o,t,n,i,a,"next",e)}function a(e){w(o,t,n,i,a,"throw",e)}i(void 0)}))},function(e){return p.apply(this,arguments)})}}]);
1
+ (self.webpackChunk_idscan_idvc2=self.webpackChunk_idscan_idvc2||[]).push([[596],{4550:(e,r,t)=>{t.d(r,{o:()=>c});var n=t(7885),o=t(7666);function i(e,r,t,n,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void t(e)}u.done?r(s):Promise.resolve(s).then(n,o)}function a(e){return function(){var r=this,t=arguments;return new Promise((function(n,o){var a=e.apply(r,t);function u(e){i(a,n,o,u,s,"next",e)}function s(e){i(a,n,o,u,s,"throw",e)}u(void 0)}))}}function u(e,r){var t,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=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 a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=r.call(e,a)}catch(e){i=[6,e],n=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}var s,l=(s=a((function(e){var r,t,i,a,s;return u(this,(function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),t=Uint8Array.bind,[4,(0,o.xl)(e)];case 1:return r=new(t.apply(Uint8Array,[void 0,u.sent()])),i=(0,n.ec)(r),a=new Blob([i.buffer],{type:"application/javascript"}),[2,URL.createObjectURL(a)];case 2:throw s=u.sent(),console.error("Error loading and decompressing worker file:",s),s;case 3:return[2]}}))})),function(e){return s.apply(this,arguments)}),c=function(){var e=a((function(e){var r;return u(this,(function(t){switch(t.label){case 0:return[4,l(e)];case 1:return r=t.sent(),[2,new Worker(r)]}}))}));return function(r){return e.apply(this,arguments)}}()},8766:(e,r,t)=>{t.r(r),t.d(r,{default:()=>m});var n=t(4328),o=t(6399);function i(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function a(e,r,t,n,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void t(e)}u.done?r(s):Promise.resolve(s).then(n,o)}function u(e){return function(){var r=this,t=arguments;return new Promise((function(n,o){var i=e.apply(r,t);function u(e){a(i,n,o,u,s,"next",e)}function s(e){a(i,n,o,u,s,"throw",e)}u(void 0)}))}}function s(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function l(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function c(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,i=[],a=!0,u=!1;try{for(t=t.call(e);!(a=(n=t.next()).done)&&(i.push(n.value),!r||i.length!==r);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==t.return||t.return()}finally{if(u)throw o}}return i}}(e,r)||function(e,r){if(e){if("string"==typeof e)return i(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?i(e,r):void 0}}(e,r)||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 f(e,r){var t,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=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 a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=r.call(e,a)}catch(e){i=[6,e],n=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}var d,p,h=function(){function e(r,t,n){var o=this;!function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,e),l(this,"module",void 0),l(this,"handle",null),l(this,"bw",0),l(this,"bh",0),l(this,"src",null),l(this,"out",null),l(this,"isAllocate",!1),l(this,"worker",void 0),l(this,"isProcessing",!1),l(this,"isInitialized",!1),l(this,"successCount",0),l(this,"pdfCapturedCount",0),l(this,"src2",null),l(this,"locations",null),l(this,"pdfCount",0),l(this,"geometry",void 0),l(this,"minPDFframes",1),l(this,"cropSizes",void 0),l(this,"canvasSizes",void 0),l(this,"privateErrorId",0),this.worker=r,this.worker.onmessage=function(e){var r=e.data,t=r.name,n=r.data;"initialization"===t&&(o.isInitialized=n)},this.worker.postMessage({fn:"init",key:t,isNeedToLoadPDFWIthPreprocess:n})}var r,t;return r=e,(t=[{key:"errorId",get:function(){return this.privateErrorId},set:function(e){this.privateErrorId=[o.l.Detected,o.l.Decoded].includes(e)?0:e}},{key:"errorVal",get:function(){var e;return this.errorId===o.l.LicenseKeyHasExpired&&(e=0),this.errorId===o.l.InvalidLicenseKey&&(e=1),e}},{key:"init",value:function(e,r,t,n){this.geometry=e,this.minPDFframes=r,this.cropSizes=t,this.canvasSizes=n}},{key:"licenseError",value:function(){return{error:!0,errorType:"licenceKeyError",errorVal:this.errorVal}}},{key:"create",value:function(){}},{key:"setSizes",value:function(e,r){this.bw=e,this.bh=r,this.worker.postMessage({fn:"setSizes",bw:e,bh:r})}},{key:"allocate",value:function(){this.worker.postMessage({fn:"allocate"})}},{key:"drawCords",value:function(e){var r=this,t=[];if(e){var n=[];Object.entries(e).forEach((function(e){var t=c(e,2),o=t[0],i=t[1],a=Math.trunc(i),u=o[0],s=+o[1]-1;n[s]||(n[s]={x:0,y:0}),"x"===u?n[s].x=r.canvasSizes.width*a/r.bw:n[s].y=r.canvasSizes.height*a/r.bh}));var o=[n[3].x-n[0].x,n[3].y-n[0].y],i=[n[1].x-n[0].x,n[1].y-n[0].y],a=[n[2].x-n[1].x,n[2].y-n[1].y],u=[n[3].x-n[2].x,n[3].y-n[2].y],s=this.geometry.angleBetweenTwoVectors(o,i),l=this.geometry.angleBetweenTwoVectors(a,u);s<=100&&s>=80&&l<=100&&l>=80&&(t=n)}return t}},{key:"processPDF",value:function(e){var r=this;return u((function(){var t,n;return f(this,(function(i){switch(i.label){case 0:return r.isProcessing?[2,{}]:(t={status:!1,predict:!1,touch:!1,image:null,type:"pdf",error:null,coords:[],trackString:"",pdfSuccessCount:0,pdfCount:0,isSuccessProcess:!1,pdfCapturedCount:0},r.isInitialized?(r.isProcessing=!0,[4,r.readPDF(e)]):[2,t]);case 1:return(n=i.sent()).error?(r.isProcessing=!1,t.error=n,[2,t]):(n&&"status"in n&&(n.status.value===o.l.Detected&&(r.pdfCapturedCount+=1),n.status.value===o.l.Detected||n.status.value===o.l.Decoded?(t.coords=r.drawCords(n.location),t.isSuccessProcess=!0):(r.successCount+=1,r.drawCords(null)),n.status.value===o.l.Decoded?(r.pdfCount+=1,r.pdfCount>=r.minPDFframes&&(r.successCount=0,r.pdfCapturedCount=0,r.pdfCount=0,t.trackString=n.trackString||n.data||"",t.status=!0,t.image=e,t.pdfCapturedCount=0)):r.pdfCount=0),t.pdfSuccessCount=r.successCount,t.pdfCount=r.pdfCount,t.pdfCapturedCount=r.pdfCapturedCount,r.isProcessing=!1,[2,t])}}))}))()}},{key:"processPDFWithPreProcess",value:function(e){var r=this;return new Promise((function(t){r.worker.onmessage=function(e){var n=e.data,o=n.name,i=n.data;if("result"===o){var a;r.errorId=null==i||null===(a=i.status)||void 0===a?void 0:a.value;var u=r.errorId?r.licenseError():null;t(u||i)}else t(i)},r.worker.postMessage({fn:"pdfWithPreProcess",iData:e})}))}},{key:"readPDF",value:function(e){var r=this;return u((function(){return f(this,(function(t){return[2,new Promise((function(t){r.worker.onmessage=function(e){var n=e.data,o=n.name,i=n.data,a=n.bw,u=n.bh;if("ready"===o)r.worker.postMessage({fn:"process"});else if("result"===o){var s;r.errorId=null==i||null===(s=i.status)||void 0===s?void 0:s.value;var l=(r.errorId?r.licenseError():null)||i;r.bw=a,r.bh=u,t(l)}else t(i)},r.worker.postMessage({fn:"prepare",iData:e})}))]}))}))()}}])&&s(r.prototype,t),e}(),y=t(7286),v=t(4550);function b(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function w(e,r,t,n,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void t(e)}u.done?r(s):Promise.resolve(s).then(n,o)}const m=(d=function(e){var r,t,o,i;return function(e,r){var t,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=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 a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=r.call(e,a)}catch(e){i=[6,e],n=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(a){switch(a.label){case 0:return r=e.pdf417key,t=!!Object.entries(n.Z.config.documentTypes).find((function(e){var r=function(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,i=[],a=!0,u=!1;try{for(t=t.call(e);!(a=(n=t.next()).done)&&(i.push(n.value),!r||i.length!==r);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==t.return||t.return()}finally{if(u)throw o}}return i}}(e,r)||function(e,r){if(e){if("string"==typeof e)return b(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?b(e,r):void 0}}(e,r)||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.")}()}(e,2);return r[0],r[1].find((function(e){return("pdf"===e.type||"back"===e.type)&&e.mode.uploader}))})),[4,(0,v.o)("".concat(n.Z.chunkPublicPath,"pdfWorker.js.gzip"))];case 1:return o=a.sent(),i=new h(o,r,t),y.Z.setModule("module","pdf",i),[2]}}))},p=function(){var e=this,r=arguments;return new Promise((function(t,n){var o=d.apply(e,r);function i(e){w(o,t,n,i,a,"next",e)}function a(e){w(o,t,n,i,a,"throw",e)}i(void 0)}))},function(e){return p.apply(this,arguments)})}}]);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@idscan/onboarding",
3
- "version": "2.6.3",
4
- "description": "Wrapper of the IDVC library for DVS Online.",
3
+ "version": "2.7.0",
4
+ "description": "Wrapper of the IDVC library for DIVE Online.",
5
5
  "main": "dist/js/wrapper.js",
6
6
  "types": "dist/@types/src/Wrapper.d.ts",
7
7
  "files": [
@@ -20,7 +20,7 @@
20
20
  "minor": "npm version minor"
21
21
  },
22
22
  "dependencies": {
23
- "@idscan/idvc2": "2.11.0",
23
+ "@idscan/idvc2": "^2.11.1",
24
24
  "core-js": "^3.30.0",
25
25
  "qrcode": "^1.5.1",
26
26
  "regenerator-runtime": "^0.13.11"
@@ -53,6 +53,7 @@
53
53
  "html-loader": "^3.0.1",
54
54
  "html-webpack-plugin": "^5.5.0",
55
55
  "mini-css-extract-plugin": "^2.4.5",
56
+ "raw-loader": "^4.0.2",
56
57
  "sass": "^1.43.5",
57
58
  "sass-loader": "^12.3.0",
58
59
  "style-loader": "^3.3.1",
@@ -70,6 +71,7 @@
70
71
  "idvc",
71
72
  "onboarding",
72
73
  "dvs",
74
+ "dive",
73
75
  "online"
74
76
  ]
75
77
  }
package/readme.md CHANGED
@@ -178,6 +178,15 @@ btn.addEventListener('click', () => {
178
178
 
179
179
  ## Version history
180
180
 
181
+ - **2.7.0**
182
+ - feat: Added possibility to load IDVC web library from cdn, for this you need to set 'useCDN' option to true
183
+ - feat: A new option 'IDVCDownloadVersion' was added. It allows to select the IDVC version number which will be loaded, the value is a string in npm version format, e.g. '2.10.0'. Also, 'latest' value is available - in this case the current IDVC version will be loaded
184
+ - feat: Removed the necessity to import css styles, now styles are embedded in the page, and importing styles from the node_modules folder will cause an error.
185
+ (import '@idscan/onboarding/dist/css/onboarding.css')
186
+
187
+ - **2.6.4**
188
+ - feat: added support for HTTP status - 524
189
+
181
190
  - **2.6.3**
182
191
  - Updated IDVC component
183
192
  - fix: hide validation modal after using the 'setApplicant' method