@ekyc_qoobiss/qbs-ect-cmp 3.6.78 → 3.6.80

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.
@@ -294,6 +294,7 @@ const { state, onChange } = createStore({
294
294
  device: null,
295
295
  langIso: 'ro',
296
296
  logSteps: false,
297
+ modelsPath: '',
297
298
  });
298
299
  onChange('environment', value => {
299
300
  state.debug = value == 'QA';
@@ -503,6 +504,7 @@ class ApiCall {
503
504
  state.flowStatus = exports.FlowStatus[jsonResp.state];
504
505
  state.logSteps = jsonResp.logSteps;
505
506
  state.debug = jsonResp.debug;
507
+ state.modelsPath = jsonResp.modelsPath;
506
508
  return true;
507
509
  }
508
510
  async UploadFileForRequestB64(requestId, type, file) {
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-41696e0e.js');
6
- const TranslationUtils = require('./TranslationUtils-84b58b58.js');
6
+ const TranslationUtils = require('./TranslationUtils-6fdf7b55.js');
7
7
 
8
8
  const agreementCheckCss = "";
9
9
 
@@ -1485,7 +1485,7 @@ class ML5 {
1485
1485
  }
1486
1486
  async init() {
1487
1487
  return new Promise(async (resolve) => {
1488
- const modelPath = TranslationUtils.state.apiBaseUrl.includes("apimd") ? 'https://ekyc.blob.core.windows.net/$web/md/model.json' : 'https://ekyc.blob.core.windows.net/$web/model.json';
1488
+ const modelPath = TranslationUtils.state.modelsPath;
1489
1489
  this.classifier = await ml5.imageClassifier(modelPath, this.loaded);
1490
1490
  this.faceapi = await ml5.faceApi({ withLandmarks: true, withDescriptors: false }, this.loaded);
1491
1491
  //warmup
@@ -4888,7 +4888,7 @@ const HowToInfo = class {
4888
4888
  titleClass = 'color-white';
4889
4889
  bgDemo = 'container bg-black';
4890
4890
  }
4891
- return (index.h("div", { class: bgDemo }, index.h("div", { class: "row", hidden: this.imageLoaded == false }, index.h("div", { class: "div-ci align-center", hidden: this.showVideo }, index.h("img", { ref: el => (this.image = el) })), index.h("div", { hidden: this.showVideo == false }, index.h("video", { id: "howTo", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, index.h("source", { type: "video/mp4" }))), index.h("div", { class: "text-center" }, index.h("h1", { class: titleClass }, this.topTitle), index.h("p", { class: "font-size-2", hidden: this.subTitle == '' }, this.subTitle)), index.h("div", { class: "pos-relative show-bottom" }, index.h("div", { class: "btn-buletin" }, index.h("button", { class: "main-button", disabled: !this.buttonEnabled, onClick: () => this.buttonClick(), hidden: this.showVideo == true }, this.buttonText), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
4891
+ return (index.h("div", { class: bgDemo }, index.h("div", { class: "row", hidden: this.imageLoaded == false }, index.h("div", { class: "div-ci align-center", hidden: this.showVideo }, index.h("img", { ref: el => (this.image = el) })), index.h("div", { class: "container-video", hidden: this.showVideo == false }, index.h("video", { id: "howTo", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, index.h("source", { type: "video/mp4" }))), index.h("div", { class: "text-center" }, index.h("h1", { class: titleClass }, this.topTitle), index.h("p", { class: "font-size-2", hidden: this.subTitle == '' }, this.subTitle)), index.h("div", { class: "pos-relative show-bottom" }, index.h("div", { class: "btn-buletin" }, index.h("button", { class: "main-button", disabled: !this.buttonEnabled, onClick: () => this.buttonClick(), hidden: this.showVideo == true }, this.buttonText), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
4892
4892
  }
4893
4893
  };
4894
4894
  HowToInfo.style = howToInfoCss;
@@ -5247,7 +5247,7 @@ function v4(options, buf, offset) {
5247
5247
  }
5248
5248
 
5249
5249
  const name = "@ekyc_qoobiss/qbs-ect-cmp";
5250
- const version$1 = "3.6.78";
5250
+ const version$1 = "3.6.80";
5251
5251
  const description = "Person Identification Component";
5252
5252
  const main = "./dist/index.cjs.js";
5253
5253
  const module$1 = "./dist/index.js";
@@ -5547,12 +5547,12 @@ const IdentificationComponent = class {
5547
5547
  if (!this.order_id || this.order_id == '') {
5548
5548
  this.order_id = TranslationUtils.state.requestId;
5549
5549
  }
5550
+ ML5.getInstance();
5550
5551
  }
5551
5552
  }
5552
5553
  catch (e) {
5553
5554
  this.apiErrorEmitter(e, 'Request Initialisation RequestId:' + TranslationUtils.state.requestId + ' RedirectId:' + TranslationUtils.state.redirectId);
5554
5555
  }
5555
- ML5.getInstance();
5556
5556
  }
5557
5557
  disconnectedCallback() {
5558
5558
  Events.flowEvent(TranslationUtils.FlowSteps.ComponentLoaded, TranslationUtils.FlowMoments.Finalized);
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-41696e0e.js');
6
- const TranslationUtils = require('./TranslationUtils-84b58b58.js');
6
+ const TranslationUtils = require('./TranslationUtils-6fdf7b55.js');
7
7
 
8
8
  const randomActionsCss = "";
9
9
 
@@ -78,7 +78,7 @@ export class HowToInfo {
78
78
  titleClass = 'color-white';
79
79
  bgDemo = 'container bg-black';
80
80
  }
81
- return (h("div", { class: bgDemo }, h("div", { class: "row", hidden: this.imageLoaded == false }, h("div", { class: "div-ci align-center", hidden: this.showVideo }, h("img", { ref: el => (this.image = el) })), h("div", { hidden: this.showVideo == false }, h("video", { id: "howTo", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, h("source", { type: "video/mp4" }))), h("div", { class: "text-center" }, h("h1", { class: titleClass }, this.topTitle), h("p", { class: "font-size-2", hidden: this.subTitle == '' }, this.subTitle)), h("div", { class: "pos-relative show-bottom" }, h("div", { class: "btn-buletin" }, h("button", { class: "main-button", disabled: !this.buttonEnabled, onClick: () => this.buttonClick(), hidden: this.showVideo == true }, this.buttonText), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
81
+ return (h("div", { class: bgDemo }, h("div", { class: "row", hidden: this.imageLoaded == false }, h("div", { class: "div-ci align-center", hidden: this.showVideo }, h("img", { ref: el => (this.image = el) })), h("div", { class: "container-video", hidden: this.showVideo == false }, h("video", { id: "howTo", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, h("source", { type: "video/mp4" }))), h("div", { class: "text-center" }, h("h1", { class: titleClass }, this.topTitle), h("p", { class: "font-size-2", hidden: this.subTitle == '' }, this.subTitle)), h("div", { class: "pos-relative show-bottom" }, h("div", { class: "btn-buletin" }, h("button", { class: "main-button", disabled: !this.buttonEnabled, onClick: () => this.buttonClick(), hidden: this.showVideo == true }, this.buttonText), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
82
82
  }
83
83
  static get is() { return "how-to-info"; }
84
84
  static get originalStyleUrls() {
@@ -159,12 +159,12 @@ export class IdentificationComponent {
159
159
  if (!this.order_id || this.order_id == '') {
160
160
  this.order_id = store.requestId;
161
161
  }
162
+ ML5.getInstance();
162
163
  }
163
164
  }
164
165
  catch (e) {
165
166
  this.apiErrorEmitter(e, 'Request Initialisation RequestId:' + store.requestId + ' RedirectId:' + store.redirectId);
166
167
  }
167
- ML5.getInstance();
168
168
  }
169
169
  disconnectedCallback() {
170
170
  Events.flowEvent(FlowSteps.ComponentLoaded, FlowMoments.Finalized);
@@ -166,6 +166,7 @@ export class ApiCall {
166
166
  store.flowStatus = FlowStatus[jsonResp.state];
167
167
  store.logSteps = jsonResp.logSteps;
168
168
  store.debug = jsonResp.debug;
169
+ store.modelsPath = jsonResp.modelsPath;
169
170
  return true;
170
171
  }
171
172
  async UploadFileForRequestB64(requestId, type, file) {
@@ -14,7 +14,7 @@ export class ML5 {
14
14
  }
15
15
  async init() {
16
16
  return new Promise(async (resolve) => {
17
- const modelPath = store.apiBaseUrl.includes("apimd") ? 'https://ekyc.blob.core.windows.net/$web/md/model.json' : 'https://ekyc.blob.core.windows.net/$web/model.json';
17
+ const modelPath = store.modelsPath;
18
18
  this.classifier = await ml5.imageClassifier(modelPath, this.loaded);
19
19
  this.faceapi = await ml5.faceApi({ withLandmarks: true, withDescriptors: false }, this.loaded);
20
20
  //warmup
@@ -15,6 +15,7 @@ const { state, onChange } = createStore({
15
15
  device: null,
16
16
  langIso: 'ro',
17
17
  logSteps: false,
18
+ modelsPath: '',
18
19
  });
19
20
  onChange('environment', value => {
20
21
  state.debug = value == 'QA';
@@ -292,6 +292,7 @@ const { state, onChange } = createStore({
292
292
  device: null,
293
293
  langIso: 'ro',
294
294
  logSteps: false,
295
+ modelsPath: '',
295
296
  });
296
297
  onChange('environment', value => {
297
298
  state.debug = value == 'QA';
@@ -501,6 +502,7 @@ class ApiCall {
501
502
  state.flowStatus = FlowStatus[jsonResp.state];
502
503
  state.logSteps = jsonResp.logSteps;
503
504
  state.debug = jsonResp.debug;
505
+ state.modelsPath = jsonResp.modelsPath;
504
506
  return true;
505
507
  }
506
508
  async UploadFileForRequestB64(requestId, type, file) {
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h, g as getElement } from './index-cf54a432.js';
2
- import { A as ApiCall, T as Translations, F as FlowMoments, a as FlowSteps, s as state, S as SessionKeys, b as FlowStatus, I as IdCaptureValues, O as OrderStatuses, c as SelfieCaptureValues } from './TranslationUtils-93e9abe8.js';
2
+ import { A as ApiCall, T as Translations, F as FlowMoments, a as FlowSteps, s as state, S as SessionKeys, b as FlowStatus, I as IdCaptureValues, O as OrderStatuses, c as SelfieCaptureValues } from './TranslationUtils-57159270.js';
3
3
 
4
4
  const agreementCheckCss = "";
5
5
 
@@ -1481,7 +1481,7 @@ class ML5 {
1481
1481
  }
1482
1482
  async init() {
1483
1483
  return new Promise(async (resolve) => {
1484
- const modelPath = state.apiBaseUrl.includes("apimd") ? 'https://ekyc.blob.core.windows.net/$web/md/model.json' : 'https://ekyc.blob.core.windows.net/$web/model.json';
1484
+ const modelPath = state.modelsPath;
1485
1485
  this.classifier = await ml5.imageClassifier(modelPath, this.loaded);
1486
1486
  this.faceapi = await ml5.faceApi({ withLandmarks: true, withDescriptors: false }, this.loaded);
1487
1487
  //warmup
@@ -4884,7 +4884,7 @@ const HowToInfo = class {
4884
4884
  titleClass = 'color-white';
4885
4885
  bgDemo = 'container bg-black';
4886
4886
  }
4887
- return (h("div", { class: bgDemo }, h("div", { class: "row", hidden: this.imageLoaded == false }, h("div", { class: "div-ci align-center", hidden: this.showVideo }, h("img", { ref: el => (this.image = el) })), h("div", { hidden: this.showVideo == false }, h("video", { id: "howTo", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, h("source", { type: "video/mp4" }))), h("div", { class: "text-center" }, h("h1", { class: titleClass }, this.topTitle), h("p", { class: "font-size-2", hidden: this.subTitle == '' }, this.subTitle)), h("div", { class: "pos-relative show-bottom" }, h("div", { class: "btn-buletin" }, h("button", { class: "main-button", disabled: !this.buttonEnabled, onClick: () => this.buttonClick(), hidden: this.showVideo == true }, this.buttonText), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
4887
+ return (h("div", { class: bgDemo }, h("div", { class: "row", hidden: this.imageLoaded == false }, h("div", { class: "div-ci align-center", hidden: this.showVideo }, h("img", { ref: el => (this.image = el) })), h("div", { class: "container-video", hidden: this.showVideo == false }, h("video", { id: "howTo", class: "video-demo", playsinline: true, ref: el => (this.demoVideo = el) }, h("source", { type: "video/mp4" }))), h("div", { class: "text-center" }, h("h1", { class: titleClass }, this.topTitle), h("p", { class: "font-size-2", hidden: this.subTitle == '' }, this.subTitle)), h("div", { class: "pos-relative show-bottom" }, h("div", { class: "btn-buletin" }, h("button", { class: "main-button", disabled: !this.buttonEnabled, onClick: () => this.buttonClick(), hidden: this.showVideo == true }, this.buttonText), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText))))));
4888
4888
  }
4889
4889
  };
4890
4890
  HowToInfo.style = howToInfoCss;
@@ -5243,7 +5243,7 @@ function v4(options, buf, offset) {
5243
5243
  }
5244
5244
 
5245
5245
  const name = "@ekyc_qoobiss/qbs-ect-cmp";
5246
- const version$1 = "3.6.78";
5246
+ const version$1 = "3.6.80";
5247
5247
  const description = "Person Identification Component";
5248
5248
  const main = "./dist/index.cjs.js";
5249
5249
  const module = "./dist/index.js";
@@ -5543,12 +5543,12 @@ const IdentificationComponent = class {
5543
5543
  if (!this.order_id || this.order_id == '') {
5544
5544
  this.order_id = state.requestId;
5545
5545
  }
5546
+ ML5.getInstance();
5546
5547
  }
5547
5548
  }
5548
5549
  catch (e) {
5549
5550
  this.apiErrorEmitter(e, 'Request Initialisation RequestId:' + state.requestId + ' RedirectId:' + state.redirectId);
5550
5551
  }
5551
- ML5.getInstance();
5552
5552
  }
5553
5553
  disconnectedCallback() {
5554
5554
  Events.flowEvent(FlowSteps.ComponentLoaded, FlowMoments.Finalized);
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, h } from './index-cf54a432.js';
2
- import { T as Translations } from './TranslationUtils-93e9abe8.js';
2
+ import { T as Translations } from './TranslationUtils-57159270.js';
3
3
 
4
4
  const randomActionsCss = "";
5
5
 
@@ -0,0 +1 @@
1
+ import{a as t,f as e}from"./p-8942656c.js";var i;!function(t){t[t.Capturing=0]="Capturing",t[t.FinishedCapturing=1]="FinishedCapturing",t[t.Waiting=2]="Waiting",t[t.NotFound=3]="NotFound",t[t.Aborted=4]="Aborted"}(i||(i={}));const s=t=>!("isConnected"in t)||t.isConnected,n=(()=>{let t;return(...e)=>{t&&clearTimeout(t),t=setTimeout((()=>{t=0,(t=>{for(let e of t.keys())t.set(e,t.get(e).filter(s))})(...e)}),2e3)}})(),a=t=>"function"==typeof t?t():t;var o;!function(t){t[t.LANDING=0]="LANDING",t[t.MOBILE=1]="MOBILE",t[t.AGREEMENT=2]="AGREEMENT",t[t.PHONE=3]="PHONE",t[t.CODE=4]="CODE",t[t.CODEERROR=5]="CODEERROR",t[t.IDFRONTHOWTO=6]="IDFRONTHOWTO",t[t.IDFRONT=7]="IDFRONT",t[t.IDBACKHOWTO=8]="IDBACKHOWTO",t[t.IDBACK=9]="IDBACK",t[t.IDTILTHOWTO=10]="IDTILTHOWTO",t[t.IDTILT=11]="IDTILT",t[t.LIVENESSHOWTO=12]="LIVENESSHOWTO",t[t.LIVENESS=13]="LIVENESS",t[t.LIVENESSGESTUREHOWTO=14]="LIVENESSGESTUREHOWTO",t[t.LIVENESSGESTURE=15]="LIVENESSGESTURE",t[t.COMPLETE=16]="COMPLETE",t[t.ERROREND=17]="ERROREND",t[t.CAMERAERROR=18]="CAMERAERROR",t[t.ABORTED=19]="ABORTED",t[t.NONE=20]="NONE"}(o||(o={}));class r{}r.IDPoseDemoMapping={0:"https://ekyc.blob.core.windows.net/$web/animations/id/id_front.mp4",1:"https://ekyc.blob.core.windows.net/$web/animations/id/id_front_tilt.mp4",2:"https://ekyc.blob.core.windows.net/$web/animations/id/id_rotate.mp4",3:"https://ekyc.blob.core.windows.net/$web/animations/id/id_back.mp4",4:"https://ekyc.blob.core.windows.net/$web/animations/id/id_back_tilt.mp4"};class c{}c.FacePoseDemoMapping={0:"https://ekyc.blob.core.windows.net/$web/animations/selfie/selfie_rotate_left.mp4",1:"https://ekyc.blob.core.windows.net/$web/animations/selfie/selfie_rotate_right.mp4",2:"https://ekyc.blob.core.windows.net/$web/animations/selfie/selfie_tilt_back.mp4",3:"https://ekyc.blob.core.windows.net/$web/animations/selfie/selfie_tilt_front.mp4",4:"https://ekyc.blob.core.windows.net/$web/animations/selfie/selfie_main.mp4"};class l{}l.FlowStatusKey="qbs-ect-flowstatus",l.RequestIdKey="qbs-ect-requestid",l.TokenKey="qbs-ect-token",l.InitialisedKey="qbs-ect-initialised",l.HasIdBackKey="qbs-ect-has-id-back",l.AgreementValidationKey="qbs-ect-agreement-validation",l.PhoneValidationKey="qbs-ect-phone-validation",l.RefreshDoneKey="qbs-ect-refresh-done";class h{constructor(){this.uriEnv="/",this.uriEnv=["QA","DEMO"].includes(d.environment)?"/dev_":"/",this.OtpSend=this.uriEnv+"validation/otp/send",this.OtpCheck=this.uriEnv+"validation/otp/check",this.IdentityInsert=this.uriEnv+"validation/identity/insert",this.UploadCapture=this.uriEnv+"validation/upload/capture",this.GetAgreement=this.uriEnv+"validation/agreement/content",this.GenerateAgreement=this.uriEnv+"validation/agreement/generate",this.SendLink=this.uriEnv+"validation/otp/sendlink",this.GetStatus=this.uriEnv+"validation/identity/status",this.AddLog=this.uriEnv+"validation/logs/add",this.AddStep=this.uriEnv+"validation/logs/step",this.AbortRequest=this.uriEnv+"validation/identity/abort",this.Translations=this.uriEnv+"validation/translations/get",this.StartFlow=this.uriEnv+"validation/flowstate/startflow",this.NextFlowState=this.uriEnv+"validation/flowstate/nextstate",this.CurrentFlowState=this.uriEnv+"validation/flowstate/currentstate",this.NextStateForCaptureError=this.uriEnv+"validation/flowstate/nextstateforcaptureerror"}}const{state:d,onChange:u}=(()=>{const i=((t,e=((t,e)=>t!==e))=>{const i=a(t);let s=new Map(Object.entries(null!=i?i:{}));const n={dispose:[],get:[],set:[],reset:[]},o=()=>{var e;s=new Map(Object.entries(null!==(e=a(t))&&void 0!==e?e:{})),n.reset.forEach((t=>t()))},r=t=>(n.get.forEach((e=>e(t))),s.get(t)),c=(t,i)=>{const a=s.get(t);e(i,a,t)&&(s.set(t,i),n.set.forEach((e=>e(t,i,a))))},l="undefined"==typeof Proxy?{}:new Proxy(i,{get:(t,e)=>r(e),ownKeys:()=>Array.from(s.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(t,e)=>s.has(e),set:(t,e,i)=>(c(e,i),!0)}),h=(t,e)=>(n[t].push(e),()=>{((t,e)=>{const i=t.indexOf(e);i>=0&&(t[i]=t[t.length-1],t.length--)})(n[t],e)});return{state:l,get:r,set:c,on:h,onChange:(e,i)=>{const s=h("set",((t,s)=>{t===e&&i(s)})),n=h("reset",(()=>i(a(t)[e])));return()=>{s(),n()}},use:(...t)=>{const e=t.reduce(((t,e)=>(e.set&&t.push(h("set",e.set)),e.get&&t.push(h("get",e.get)),e.reset&&t.push(h("reset",e.reset)),e.dispose&&t.push(h("dispose",e.dispose)),t)),[]);return()=>e.forEach((t=>t()))},dispose:()=>{n.dispose.forEach((t=>t())),o()},reset:o,forceUpdate:t=>{const e=s.get(t);n.set.forEach((i=>i(t,e,e)))}}})({flowStatus:o.NONE,environment:"PROD",debug:!1,requestId:"",redirectId:"",token:"",cameraIds:[],cameraId:"",phoneNumber:"",apiBaseUrl:"https://apiro.id-kyc.com",device:null,langIso:"ro",logSteps:!1,modelsPath:""},void 0);return i.use((()=>{if("function"!=typeof t)return{};const i=new Map;return{dispose:()=>i.clear(),get:e=>{const s=t();s&&((t,e,i)=>{const s=t.get(e);s?s.includes(i)||s.push(i):t.set(e,[i])})(i,e,s)},set:t=>{const s=i.get(t);s&&i.set(t,s.filter(e)),n(i)},reset:()=>{i.forEach((t=>t.forEach(e))),n(i)}}})()),i})();var p,w;u("environment",(t=>{d.debug="QA"==t})),u("flowStatus",(t=>{sessionStorage.setItem(l.FlowStatusKey,o[t])})),u("token",(t=>{sessionStorage.setItem(l.TokenKey,t)})),u("requestId",(t=>{sessionStorage.setItem(l.RequestIdKey,t)})),function(t){t[t.ComponentLoaded="component-loaded"]="ComponentLoaded",t[t.MobileRedirect="mobile-redirect"]="MobileRedirect",t[t.Landing="landing"]="Landing",t[t.Agreements="agreements"]="Agreements",t[t.OtpSend="otp-send"]="OtpSend",t[t.OtpCheck="otp-check"]="OtpCheck",t[t.CiFront="ci-front"]="CiFront",t[t.CiFrontHowTo="ci-front-how-to"]="CiFrontHowTo",t[t.CiFrontCapture="ci-front-capture"]="CiFrontCapture",t[t.CiBack="ci-back"]="CiBack",t[t.CiBackHowTo="ci-back-how-to"]="CiBackHowTo",t[t.CiBackCapture="ci-back-capture"]="CiBackCapture",t[t.CiTilt="ci-tilt"]="CiTilt",t[t.CiError="ci-error"]="CiError",t[t.SelfieHowTo="selfie-how-to"]="SelfieHowTo",t[t.SelfieTilt="selfie-tilt"]="SelfieTilt",t[t.SelfieCapture="selfie-capture"]="SelfieCapture",t[t.Selfie="selfie"]="Selfie",t[t.SelfieError="selfie-error"]="SelfieError",t[t.End="end"]="End",t[t.CameraError="camera-error"]="CameraError",t[t.Default="default"]="Default"}(p||(p={})),function(t){t[t.Initialized="initialized"]="Initialized",t[t.Finalized="finalized"]="Finalized",t[t.None="none"]="None"}(w||(w={}));class f{static getInstance(){return f.instance||(f.instance=new f),f.instance}constructor(){this.serviceErrors=["Service Unavailable","Unauthorized"],this.toBase64=t=>new Promise(((e,i)=>{const s=new FileReader;s.readAsDataURL(t),s.onload=()=>e(s.result),s.onerror=t=>i(t)})),this.urls=new h}async http(t){const e=await fetch(t);if(!e.ok)throw new Error(e.statusText);try{return await e.json()}catch(t){throw new Error("No json found in response "+t)}}async post(t,e,i=!0){var s=new Request(d.apiBaseUrl+t,{method:"POST",body:e,headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+d.token}});try{return await this.http(s)}catch(s){if(!i||this.serviceErrors.includes(s.message))throw s;this.AddLog("Error in post ",s);try{var n=new Request(d.apiBaseUrl+t,{method:"POST",body:e,headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+d.token}});return await this.http(n)}catch(i){this.AddLog("Error in post ",i);var a=new Request(d.apiBaseUrl+t,{method:"POST",body:e,headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+d.token}});return await this.http(a)}}}async get(t,e=!0){var i=new Request(d.apiBaseUrl+t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+d.token}});try{return await this.http(i)}catch(i){if(!e||this.serviceErrors.includes(i.message))throw i;this.AddLog("Error in get ",i);try{var s=new Request(d.apiBaseUrl+t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+d.token}});return await this.http(s)}catch(e){this.AddLog("Error in get ",e);var n=new Request(d.apiBaseUrl+t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+d.token}});return await this.http(n)}}}async SendOTPCode(t,e){let i={requestId:t,phone:e};return await this.post(this.urls.OtpSend,JSON.stringify(i))}async CheckOTPCode(t,e){let i={requestId:t,otp:e};return await this.post(this.urls.OtpCheck,JSON.stringify(i))}async AddIdentificationRequest(t,e){d.debug&&console.log("Calling identity request with store:"+JSON.stringify(d));let i={requestId:d.requestId,clientDeviceInfo:JSON.stringify(t),redirectId:d.redirectId,phoneNumber:d.phoneNumber,version:e,demoMode:"DEMO"==d.environment},s=await this.post(this.urls.IdentityInsert,JSON.stringify(i));return""==d.requestId&&(d.requestId=s.requestId),d.phoneNumber=s.phoneNumber,d.flowStatus=o[s.state],d.logSteps=s.logSteps,d.debug=s.debug,d.modelsPath=s.modelsPath,!0}async UploadFileForRequestB64(t,e,i){let s={requestId:t,type:e,data:await this.toBase64(i)},n=await this.post(this.urls.UploadCapture,JSON.stringify(s));return d.debug&&console.log(`apicall | uploadfileforrequestb64 | ${n}`),n}async GetAgreement(t){return(await this.get(this.urls.GetAgreement+"?type="+t+"&requestId="+d.requestId)).htmlText}async GenerateAgreement(t){let e={requestId:d.requestId,documentType:t};return(await this.post(this.urls.GenerateAgreement,JSON.stringify(e))).generation}async GetStatus(t){let e=await this.get(this.urls.GetStatus+"?orderId="+t);return i[e.status]}async SendLink(t,e){let i={requestId:d.requestId,link:t,phoneNumber:e};return(await this.post(this.urls.SendLink,JSON.stringify(i))).sent}async AddLog(t,e){try{let i={requestId:d.requestId,action:o[d.flowStatus],message:JSON.stringify({error:t,context:e})};return(await this.post(this.urls.AddLog,JSON.stringify(i),!1)).saved}catch(t){}}async AddStep(t,e){if(0==d.logSteps)return;let i={requestId:d.requestId,redirectId:d.redirectId,step:p[t],moment:w[e],timestamp:(new Date).toISOString()};return(await this.post(this.urls.AddStep,JSON.stringify(i))).saved}async AbortRequest(){return await this.post(this.urls.AbortRequest,JSON.stringify({requestId:d.requestId}))}async GetTranslations(t){return await this.get(this.urls.Translations+"?langIso="+t)}async LandingValidationStartFlow(t){let e=await this.post(this.urls.StartFlow,JSON.stringify({requestId:d.requestId,cameraIsAccessible:t}));return o[e.state]}async GetNextFlowState(){let t=await this.get(this.urls.NextFlowState+"?requestId="+d.requestId);return o[t.state]}async GetFlowState(){let t=await this.get(this.urls.CurrentFlowState+"?requestId="+d.requestId);return o[t.state]}async GetNextStateForCaptureError(){let t=await this.get(this.urls.NextStateForCaptureError+"?requestId="+d.requestId);return o[t.state]}}const b=new class{async getValues(){return this.values||(this.values=await this.fetchTranslations()),this.values}getLocale(t=document.body){if(d.langIso&&""!=d.langIso)return d.langIso;{const e=t.closest("[lang]");return e?e.lang:"ro"}}async fetchTranslations(){const t=this.getLocale();try{const e=(new f).GetTranslations(t);if(e)return e}catch(e){return console.error(`Error loading locale: ${t}`,e),null}}};export{f as A,w as F,r as I,i as O,l as S,b as T,p as a,o as b,c,d as s}
@@ -1 +1 @@
1
- import{r as t,h as s}from"./p-8942656c.js";import{T as i}from"./p-194504d9.js";const o=class{constructor(s){t(this,s)}async componentWillLoad(){this.translations=await i.getValues()}buttonClick(){}render(){return s("div",{class:"container"},s("div",{class:"row"},s("div",{class:"text-center"},s("h1",null,this.topTitle)),s("div",{class:"pos-relative show-bottom"},s("div",{class:"btn-buletin"},s("button",{class:"main-button",onClick:()=>this.buttonClick()},this.buttonText),s("p",{class:"main-text font-size-18 text-right mb-0"},this.translations.GlobalValues.FooterText)))))}};o.style="";export{o as random_actions}
1
+ import{r as t,h as s}from"./p-8942656c.js";import{T as i}from"./p-8552ab44.js";const o=class{constructor(s){t(this,s)}async componentWillLoad(){this.translations=await i.getValues()}buttonClick(){}render(){return s("div",{class:"container"},s("div",{class:"row"},s("div",{class:"text-center"},s("h1",null,this.topTitle)),s("div",{class:"pos-relative show-bottom"},s("div",{class:"btn-buletin"},s("button",{class:"main-button",onClick:()=>this.buttonClick()},this.buttonText),s("p",{class:"main-text font-size-18 text-right mb-0"},this.translations.GlobalValues.FooterText)))))}};o.style="";export{o as random_actions}