@ekyc_qoobiss/qbs-ect-cmp 3.6.31 → 3.6.33

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.
@@ -566,9 +566,6 @@ class ApiCall {
566
566
  }
567
567
 
568
568
  class TranslationsController {
569
- constructor() {
570
- this.apiCall = new ApiCall();
571
- }
572
569
  async getValues() {
573
570
  if (this.values) {
574
571
  return this.values;
@@ -590,7 +587,7 @@ class TranslationsController {
590
587
  async fetchTranslations() {
591
588
  const locale = this.getLocale();
592
589
  try {
593
- const result = this.apiCall.GetTranslations(locale);
590
+ const result = new ApiCall().GetTranslations(locale);
594
591
  if (result) {
595
592
  return result;
596
593
  }
@@ -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-05fc03bc.js');
6
+ const TranslationUtils = require('./TranslationUtils-bfe4477a.js');
7
7
 
8
8
  var MobileOS;
9
9
  (function (MobileOS) {
@@ -5541,7 +5541,7 @@ function v4(options, buf, offset) {
5541
5541
  }
5542
5542
 
5543
5543
  const name = "@ekyc_qoobiss/qbs-ect-cmp";
5544
- const version$1 = "3.6.31";
5544
+ const version$1 = "3.6.33";
5545
5545
  const description = "Person Identification Component";
5546
5546
  const main = "./dist/index.cjs.js";
5547
5547
  const module$1 = "./dist/index.js";
@@ -8890,7 +8890,7 @@ const MobileRedirect = class {
8890
8890
  ev.target.value = this.contact;
8891
8891
  }
8892
8892
  render() {
8893
- return (index.h("div", { class: "container" }, index.h("div", { class: "row" }, index.h("div", { hidden: this.waitingMobile }, index.h("div", { class: "text-center" }, index.h("p", { class: "font-size-2" }, this.infoTextTop)), index.h("div", { class: "qr-canvas align-center" }, index.h("img", { src: this.qrCode })), index.h("div", { class: "text-center" }, index.h("p", { class: "font-size-2" }, this.infoTextBottom)), index.h("div", { class: "input-container mb-15" }, index.h("label", { class: "font-size-18 mb-1 color-red", hidden: this.invalidValue == false }, index.h("b", null, this.translations.MobileRedirectValues.Validation)), index.h("input", { type: "text", id: "codeInput", class: "main-input", disabled: this.prefilledPhone, value: this.contact, onInput: ev => this.handleChangeContact(ev) })), index.h("div", { class: "pos-relative" }, index.h("div", { class: "btn-buletin" }, index.h("button", { class: "main-button", onClick: () => this.buttonClick() }, "Trimite"), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText)))), index.h("div", { hidden: this.waitingMobile == false }, index.h("div", { class: "text-center" }, index.h("p", { class: "font-size-2" }, this.infoTextTop))))));
8893
+ return (index.h("div", { class: "container" }, index.h("div", { class: "row" }, index.h("div", { hidden: this.waitingMobile }, index.h("div", { class: "text-center" }, index.h("p", { class: "font-size-2" }, this.infoTextTop)), index.h("div", { class: "qr-canvas align-center" }, index.h("img", { src: this.qrCode })), index.h("div", { class: "text-center" }, index.h("p", { class: "font-size-2" }, this.infoTextBottom)), index.h("div", { class: "input-container mb-15" }, index.h("label", { class: "font-size-18 mb-1 color-red", hidden: this.invalidValue == false }, index.h("b", null, this.translations.MobileRedirectValues.Validation)), index.h("input", { type: "text", id: "codeInput", class: "main-input", disabled: this.prefilledPhone, value: this.contact, onInput: ev => this.handleChangeContact(ev) })), index.h("div", { class: "pos-relative" }, index.h("div", { class: "btn-buletin" }, index.h("button", { class: "main-button", onClick: () => this.buttonClick() }, this.translations.MobileRedirectValues.Send), index.h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText)))), index.h("div", { hidden: this.waitingMobile == false }, index.h("div", { class: "text-center" }, index.h("p", { class: "font-size-2" }, this.infoTextTop))))));
8894
8894
  }
8895
8895
  };
8896
8896
  MobileRedirect.style = mobileRedirectCss;
@@ -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-05fc03bc.js');
6
+ const TranslationUtils = require('./TranslationUtils-bfe4477a.js');
7
7
 
8
8
  const randomActionsCss = "";
9
9
 
@@ -98,7 +98,7 @@ export class MobileRedirect {
98
98
  ev.target.value = this.contact;
99
99
  }
100
100
  render() {
101
- return (h("div", { class: "container" }, h("div", { class: "row" }, h("div", { hidden: this.waitingMobile }, h("div", { class: "text-center" }, h("p", { class: "font-size-2" }, this.infoTextTop)), h("div", { class: "qr-canvas align-center" }, h("img", { src: this.qrCode })), h("div", { class: "text-center" }, h("p", { class: "font-size-2" }, this.infoTextBottom)), h("div", { class: "input-container mb-15" }, h("label", { class: "font-size-18 mb-1 color-red", hidden: this.invalidValue == false }, h("b", null, this.translations.MobileRedirectValues.Validation)), h("input", { type: "text", id: "codeInput", class: "main-input", disabled: this.prefilledPhone, value: this.contact, onInput: ev => this.handleChangeContact(ev) })), h("div", { class: "pos-relative" }, h("div", { class: "btn-buletin" }, h("button", { class: "main-button", onClick: () => this.buttonClick() }, "Trimite"), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText)))), h("div", { hidden: this.waitingMobile == false }, h("div", { class: "text-center" }, h("p", { class: "font-size-2" }, this.infoTextTop))))));
101
+ return (h("div", { class: "container" }, h("div", { class: "row" }, h("div", { hidden: this.waitingMobile }, h("div", { class: "text-center" }, h("p", { class: "font-size-2" }, this.infoTextTop)), h("div", { class: "qr-canvas align-center" }, h("img", { src: this.qrCode })), h("div", { class: "text-center" }, h("p", { class: "font-size-2" }, this.infoTextBottom)), h("div", { class: "input-container mb-15" }, h("label", { class: "font-size-18 mb-1 color-red", hidden: this.invalidValue == false }, h("b", null, this.translations.MobileRedirectValues.Validation)), h("input", { type: "text", id: "codeInput", class: "main-input", disabled: this.prefilledPhone, value: this.contact, onInput: ev => this.handleChangeContact(ev) })), h("div", { class: "pos-relative" }, h("div", { class: "btn-buletin" }, h("button", { class: "main-button", onClick: () => this.buttonClick() }, this.translations.MobileRedirectValues.Send), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText)))), h("div", { hidden: this.waitingMobile == false }, h("div", { class: "text-center" }, h("p", { class: "font-size-2" }, this.infoTextTop))))));
102
102
  }
103
103
  static get is() { return "mobile-redirect"; }
104
104
  static get originalStyleUrls() {
@@ -1,9 +1,6 @@
1
1
  import { ApiCall } from './ApiCall';
2
2
  import store from './store';
3
3
  class TranslationsController {
4
- constructor() {
5
- this.apiCall = new ApiCall();
6
- }
7
4
  async getValues() {
8
5
  if (this.values) {
9
6
  return this.values;
@@ -25,7 +22,7 @@ class TranslationsController {
25
22
  async fetchTranslations() {
26
23
  const locale = this.getLocale();
27
24
  try {
28
- const result = this.apiCall.GetTranslations(locale);
25
+ const result = new ApiCall().GetTranslations(locale);
29
26
  if (result) {
30
27
  return result;
31
28
  }
@@ -564,9 +564,6 @@ class ApiCall {
564
564
  }
565
565
 
566
566
  class TranslationsController {
567
- constructor() {
568
- this.apiCall = new ApiCall();
569
- }
570
567
  async getValues() {
571
568
  if (this.values) {
572
569
  return this.values;
@@ -588,7 +585,7 @@ class TranslationsController {
588
585
  async fetchTranslations() {
589
586
  const locale = this.getLocale();
590
587
  try {
591
- const result = this.apiCall.GetTranslations(locale);
588
+ const result = new ApiCall().GetTranslations(locale);
592
589
  if (result) {
593
590
  return result;
594
591
  }
@@ -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, s as state, F as FlowMoments, a as FlowSteps, T as Translations, b as FlowStatus, S as SessionKeys, I as IdCaptureValues, O as OrderStatuses, c as SelfieCaptureValues } from './TranslationUtils-2450f38e.js';
2
+ import { A as ApiCall, s as state, F as FlowMoments, a as FlowSteps, T as Translations, b as FlowStatus, S as SessionKeys, I as IdCaptureValues, O as OrderStatuses, c as SelfieCaptureValues } from './TranslationUtils-7e68bc94.js';
3
3
 
4
4
  var MobileOS;
5
5
  (function (MobileOS) {
@@ -5537,7 +5537,7 @@ function v4(options, buf, offset) {
5537
5537
  }
5538
5538
 
5539
5539
  const name = "@ekyc_qoobiss/qbs-ect-cmp";
5540
- const version$1 = "3.6.31";
5540
+ const version$1 = "3.6.33";
5541
5541
  const description = "Person Identification Component";
5542
5542
  const main = "./dist/index.cjs.js";
5543
5543
  const module = "./dist/index.js";
@@ -8886,7 +8886,7 @@ const MobileRedirect = class {
8886
8886
  ev.target.value = this.contact;
8887
8887
  }
8888
8888
  render() {
8889
- return (h("div", { class: "container" }, h("div", { class: "row" }, h("div", { hidden: this.waitingMobile }, h("div", { class: "text-center" }, h("p", { class: "font-size-2" }, this.infoTextTop)), h("div", { class: "qr-canvas align-center" }, h("img", { src: this.qrCode })), h("div", { class: "text-center" }, h("p", { class: "font-size-2" }, this.infoTextBottom)), h("div", { class: "input-container mb-15" }, h("label", { class: "font-size-18 mb-1 color-red", hidden: this.invalidValue == false }, h("b", null, this.translations.MobileRedirectValues.Validation)), h("input", { type: "text", id: "codeInput", class: "main-input", disabled: this.prefilledPhone, value: this.contact, onInput: ev => this.handleChangeContact(ev) })), h("div", { class: "pos-relative" }, h("div", { class: "btn-buletin" }, h("button", { class: "main-button", onClick: () => this.buttonClick() }, "Trimite"), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText)))), h("div", { hidden: this.waitingMobile == false }, h("div", { class: "text-center" }, h("p", { class: "font-size-2" }, this.infoTextTop))))));
8889
+ return (h("div", { class: "container" }, h("div", { class: "row" }, h("div", { hidden: this.waitingMobile }, h("div", { class: "text-center" }, h("p", { class: "font-size-2" }, this.infoTextTop)), h("div", { class: "qr-canvas align-center" }, h("img", { src: this.qrCode })), h("div", { class: "text-center" }, h("p", { class: "font-size-2" }, this.infoTextBottom)), h("div", { class: "input-container mb-15" }, h("label", { class: "font-size-18 mb-1 color-red", hidden: this.invalidValue == false }, h("b", null, this.translations.MobileRedirectValues.Validation)), h("input", { type: "text", id: "codeInput", class: "main-input", disabled: this.prefilledPhone, value: this.contact, onInput: ev => this.handleChangeContact(ev) })), h("div", { class: "pos-relative" }, h("div", { class: "btn-buletin" }, h("button", { class: "main-button", onClick: () => this.buttonClick() }, this.translations.MobileRedirectValues.Send), h("p", { class: "main-text font-size-18 text-right mb-0" }, this.translations.GlobalValues.FooterText)))), h("div", { hidden: this.waitingMobile == false }, h("div", { class: "text-center" }, h("p", { class: "font-size-2" }, this.infoTextTop))))));
8890
8890
  }
8891
8891
  };
8892
8892
  MobileRedirect.style = mobileRedirectCss;
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, h } from './index-cf54a432.js';
2
- import { T as Translations } from './TranslationUtils-2450f38e.js';
2
+ import { T as Translations } from './TranslationUtils-7e68bc94.js';
3
3
 
4
4
  const randomActionsCss = "";
5
5
 
@@ -1 +1 @@
1
- import{r as t,h as s}from"./p-8942656c.js";import{T as i}from"./p-e207156a.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-d35256e9.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 +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 n=t=>!("isConnected"in t)||t.isConnected,s=(()=>{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(n))})(...e)}),2e3)}})(),a=t=>"function"==typeof t?t():t;var o;!function(t){t[t.LANDING=0]="LANDING",t[t.AGREEMENT=1]="AGREEMENT",t[t.PHONE=2]="PHONE",t[t.CODE=3]="CODE",t[t.CODEERROR=4]="CODEERROR",t[t.ID=5]="ID",t[t.LIVENESS=6]="LIVENESS",t[t.COMPLETE=7]="COMPLETE",t[t.ERROREND=8]="ERROREND",t[t.CAMERAERROR=9]="CAMERAERROR",t[t.NONE=10]="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 d{}d.FlowStatusKey="qbs-ect-flowstatus",d.RequestIdKey="qbs-ect-requestid",d.TokenKey="qbs-ect-token",d.InitialisedKey="qbs-ect-initialised",d.HasIdBackKey="qbs-ect-has-id-back",d.AgreementValidationKey="qbs-ect-agreement-validation",d.PhoneValidationKey="qbs-ect-phone-validation",d.RefreshDoneKey="qbs-ect-refresh-done";class h{constructor(){this.uriEnv="/",this.uriEnv="QA"==l.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"}}const{state:l,onChange:u}=(()=>{const i=((t,e=((t,e)=>t!==e))=>{const i=a(t);let n=new Map(Object.entries(null!=i?i:{}));const s={dispose:[],get:[],set:[],reset:[]},o=()=>{var e;n=new Map(Object.entries(null!==(e=a(t))&&void 0!==e?e:{})),s.reset.forEach((t=>t()))},r=t=>(s.get.forEach((e=>e(t))),n.get(t)),c=(t,i)=>{const a=n.get(t);e(i,a,t)&&(n.set(t,i),s.set.forEach((e=>e(t,i,a))))},d="undefined"==typeof Proxy?{}:new Proxy(i,{get:(t,e)=>r(e),ownKeys:()=>Array.from(n.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(t,e)=>n.has(e),set:(t,e,i)=>(c(e,i),!0)}),h=(t,e)=>(s[t].push(e),()=>{((t,e)=>{const i=t.indexOf(e);i>=0&&(t[i]=t[t.length-1],t.length--)})(s[t],e)});return{state:d,get:r,set:c,on:h,onChange:(e,i)=>{const n=h("set",((t,n)=>{t===e&&i(n)})),s=h("reset",(()=>i(a(t)[e])));return()=>{n(),s()}},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:()=>{s.dispose.forEach((t=>t())),o()},reset:o,forceUpdate:t=>{const e=n.get(t);s.set.forEach((i=>i(t,e,e)))}}})({flowStatus:o.NONE,environment:"PROD",debug:!1,requestId:"",redirectId:"",initialised:!1,token:"",cameraIds:[],cameraId:"",hasIdBack:!1,hasSelfieGesture:!1,hasIdTilt:!1,agreementsValidation:!0,phoneValidation:!0,phoneNumber:"",apiBaseUrl:"https://apiro.id-kyc.com",device:null,langIso:"ro"},void 0);return i.use((()=>{if("function"!=typeof t)return{};const i=new Map;return{dispose:()=>i.clear(),get:e=>{const n=t();n&&((t,e,i)=>{const n=t.get(e);n?n.includes(i)||n.push(i):t.set(e,[i])})(i,e,n)},set:t=>{const n=i.get(t);n&&i.set(t,n.filter(e)),s(i)},reset:()=>{i.forEach((t=>t.forEach(e))),s(i)}}})()),i})();var p,w;u("environment",(t=>{l.debug="QA"==t})),u("flowStatus",(t=>{sessionStorage.setItem(d.FlowStatusKey,o[t])})),u("token",(t=>{sessionStorage.setItem(d.TokenKey,t)})),u("requestId",(t=>{sessionStorage.setItem(d.RequestIdKey,t)})),u("initialised",(t=>{sessionStorage.setItem(d.InitialisedKey,String(t))})),u("hasIdBack",(t=>{sessionStorage.setItem(d.HasIdBackKey,String(t))})),u("agreementsValidation",(t=>{sessionStorage.setItem(d.AgreementValidationKey,String(t))})),u("phoneValidation",(t=>{sessionStorage.setItem(d.PhoneValidationKey,String(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"}(p||(p={})),function(t){t[t.Initialized="initialized"]="Initialized",t[t.Finalized="finalized"]="Finalized",t[t.None="none"]="None"}(w||(w={}));class b{constructor(){this.serviceErrors=["Service Unavailable","Unauthorized"],this.toBase64=t=>new Promise(((e,i)=>{const n=new FileReader;n.readAsDataURL(t),n.onload=()=>e(n.result),n.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 n=new Request(l.apiBaseUrl+t,{method:"POST",body:e,headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.token}});try{return await this.http(n)}catch(n){if(!i||this.serviceErrors.includes(n.message))throw n;this.AddLog("Error in post ",n);try{var s=new Request(l.apiBaseUrl+t,{method:"POST",body:e,headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.token}});return await this.http(s)}catch(i){this.AddLog("Error in post ",i);var a=new Request(l.apiBaseUrl+t,{method:"POST",body:e,headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.token}});return await this.http(a)}}}async get(t,e=!0){var i=new Request(l.apiBaseUrl+t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.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 n=new Request(l.apiBaseUrl+t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.token}});return await this.http(n)}catch(e){this.AddLog("Error in get ",e);var s=new Request(l.apiBaseUrl+t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.token}});return await this.http(s)}}}async SendOTPCode(t,e){let i={requestId:t,phone:e};return(await this.post(this.urls.OtpSend,JSON.stringify(i))).sent}async CheckOTPCode(t,e){let i={requestId:t,otp:e};return(await this.post(this.urls.OtpCheck,JSON.stringify(i))).valid}async AddIdentificationRequest(t,e){l.debug&&console.log("Calling identity request with store:"+JSON.stringify(l));let i={requestId:l.requestId,clientDeviceInfo:JSON.stringify(t),redirectId:l.redirectId,phoneNumber:l.phoneNumber,version:e},n=await this.post(this.urls.IdentityInsert,JSON.stringify(i));return""==l.requestId&&(l.requestId=n.requestId),l.hasIdBack=n.hasIdBack,l.hasIdTilt=n.hasIdTilt,l.hasSelfieGesture=n.hasSelfieGesture,l.agreementsValidation=n.agreementsValidation,l.phoneValidation=n.phoneValidation,l.phoneNumber=n.phoneNumber,!0}async UploadFileForRequestB64(t,e,i){let n={requestId:t,type:e,data:await this.toBase64(i)},s=await this.post(this.urls.UploadCapture,JSON.stringify(n));return l.hasIdBack||"IdFront"!=e?l.hasIdBack&&"IdBack"==e?s.isValid:"Selfie"!=e||s.isValid:s.isValid}async GetAgreement(t){return(await this.get(this.urls.GetAgreement+"?type="+t+"&requestId="+l.requestId)).htmlText}async GenerateAgreement(t){let e={requestId:l.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:l.requestId,link:t,phoneNumber:e};return(await this.post(this.urls.SendLink,JSON.stringify(i))).sent}async AddLog(t,e){try{let i={requestId:l.requestId,action:o[l.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){let i={requestId:l.requestId,redirectId:l.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:l.requestId}))).saved}async GetTranslations(t){return await this.get(this.urls.Translations+"?langIso="+t)}}const m=new class{constructor(){this.apiCall=new b}async getValues(){return this.values||(this.values=await this.fetchTranslations()),this.values}getLocale(t=document.body){if(l.langIso&&""!=l.langIso)return l.langIso;{const e=t.closest("[lang]");return e?e.lang:"ro"}}async fetchTranslations(){const t=this.getLocale();try{const e=this.apiCall.GetTranslations(t);if(e)return e}catch(e){return console.error(`Error loading locale: ${t}`,e),null}}};export{b as A,w as F,r as I,i as O,d as S,m as T,p as a,o as b,c,l as s}
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 n=t=>!("isConnected"in t)||t.isConnected,s=(()=>{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(n))})(...e)}),2e3)}})(),a=t=>"function"==typeof t?t():t;var o;!function(t){t[t.LANDING=0]="LANDING",t[t.AGREEMENT=1]="AGREEMENT",t[t.PHONE=2]="PHONE",t[t.CODE=3]="CODE",t[t.CODEERROR=4]="CODEERROR",t[t.ID=5]="ID",t[t.LIVENESS=6]="LIVENESS",t[t.COMPLETE=7]="COMPLETE",t[t.ERROREND=8]="ERROREND",t[t.CAMERAERROR=9]="CAMERAERROR",t[t.NONE=10]="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 d{}d.FlowStatusKey="qbs-ect-flowstatus",d.RequestIdKey="qbs-ect-requestid",d.TokenKey="qbs-ect-token",d.InitialisedKey="qbs-ect-initialised",d.HasIdBackKey="qbs-ect-has-id-back",d.AgreementValidationKey="qbs-ect-agreement-validation",d.PhoneValidationKey="qbs-ect-phone-validation",d.RefreshDoneKey="qbs-ect-refresh-done";class h{constructor(){this.uriEnv="/",this.uriEnv="QA"==l.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"}}const{state:l,onChange:u}=(()=>{const i=((t,e=((t,e)=>t!==e))=>{const i=a(t);let n=new Map(Object.entries(null!=i?i:{}));const s={dispose:[],get:[],set:[],reset:[]},o=()=>{var e;n=new Map(Object.entries(null!==(e=a(t))&&void 0!==e?e:{})),s.reset.forEach((t=>t()))},r=t=>(s.get.forEach((e=>e(t))),n.get(t)),c=(t,i)=>{const a=n.get(t);e(i,a,t)&&(n.set(t,i),s.set.forEach((e=>e(t,i,a))))},d="undefined"==typeof Proxy?{}:new Proxy(i,{get:(t,e)=>r(e),ownKeys:()=>Array.from(n.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(t,e)=>n.has(e),set:(t,e,i)=>(c(e,i),!0)}),h=(t,e)=>(s[t].push(e),()=>{((t,e)=>{const i=t.indexOf(e);i>=0&&(t[i]=t[t.length-1],t.length--)})(s[t],e)});return{state:d,get:r,set:c,on:h,onChange:(e,i)=>{const n=h("set",((t,n)=>{t===e&&i(n)})),s=h("reset",(()=>i(a(t)[e])));return()=>{n(),s()}},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:()=>{s.dispose.forEach((t=>t())),o()},reset:o,forceUpdate:t=>{const e=n.get(t);s.set.forEach((i=>i(t,e,e)))}}})({flowStatus:o.NONE,environment:"PROD",debug:!1,requestId:"",redirectId:"",initialised:!1,token:"",cameraIds:[],cameraId:"",hasIdBack:!1,hasSelfieGesture:!1,hasIdTilt:!1,agreementsValidation:!0,phoneValidation:!0,phoneNumber:"",apiBaseUrl:"https://apiro.id-kyc.com",device:null,langIso:"ro"},void 0);return i.use((()=>{if("function"!=typeof t)return{};const i=new Map;return{dispose:()=>i.clear(),get:e=>{const n=t();n&&((t,e,i)=>{const n=t.get(e);n?n.includes(i)||n.push(i):t.set(e,[i])})(i,e,n)},set:t=>{const n=i.get(t);n&&i.set(t,n.filter(e)),s(i)},reset:()=>{i.forEach((t=>t.forEach(e))),s(i)}}})()),i})();var p,w;u("environment",(t=>{l.debug="QA"==t})),u("flowStatus",(t=>{sessionStorage.setItem(d.FlowStatusKey,o[t])})),u("token",(t=>{sessionStorage.setItem(d.TokenKey,t)})),u("requestId",(t=>{sessionStorage.setItem(d.RequestIdKey,t)})),u("initialised",(t=>{sessionStorage.setItem(d.InitialisedKey,String(t))})),u("hasIdBack",(t=>{sessionStorage.setItem(d.HasIdBackKey,String(t))})),u("agreementsValidation",(t=>{sessionStorage.setItem(d.AgreementValidationKey,String(t))})),u("phoneValidation",(t=>{sessionStorage.setItem(d.PhoneValidationKey,String(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"}(p||(p={})),function(t){t[t.Initialized="initialized"]="Initialized",t[t.Finalized="finalized"]="Finalized",t[t.None="none"]="None"}(w||(w={}));class b{constructor(){this.serviceErrors=["Service Unavailable","Unauthorized"],this.toBase64=t=>new Promise(((e,i)=>{const n=new FileReader;n.readAsDataURL(t),n.onload=()=>e(n.result),n.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 n=new Request(l.apiBaseUrl+t,{method:"POST",body:e,headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.token}});try{return await this.http(n)}catch(n){if(!i||this.serviceErrors.includes(n.message))throw n;this.AddLog("Error in post ",n);try{var s=new Request(l.apiBaseUrl+t,{method:"POST",body:e,headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.token}});return await this.http(s)}catch(i){this.AddLog("Error in post ",i);var a=new Request(l.apiBaseUrl+t,{method:"POST",body:e,headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.token}});return await this.http(a)}}}async get(t,e=!0){var i=new Request(l.apiBaseUrl+t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.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 n=new Request(l.apiBaseUrl+t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.token}});return await this.http(n)}catch(e){this.AddLog("Error in get ",e);var s=new Request(l.apiBaseUrl+t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.token}});return await this.http(s)}}}async SendOTPCode(t,e){let i={requestId:t,phone:e};return(await this.post(this.urls.OtpSend,JSON.stringify(i))).sent}async CheckOTPCode(t,e){let i={requestId:t,otp:e};return(await this.post(this.urls.OtpCheck,JSON.stringify(i))).valid}async AddIdentificationRequest(t,e){l.debug&&console.log("Calling identity request with store:"+JSON.stringify(l));let i={requestId:l.requestId,clientDeviceInfo:JSON.stringify(t),redirectId:l.redirectId,phoneNumber:l.phoneNumber,version:e},n=await this.post(this.urls.IdentityInsert,JSON.stringify(i));return""==l.requestId&&(l.requestId=n.requestId),l.hasIdBack=n.hasIdBack,l.hasIdTilt=n.hasIdTilt,l.hasSelfieGesture=n.hasSelfieGesture,l.agreementsValidation=n.agreementsValidation,l.phoneValidation=n.phoneValidation,l.phoneNumber=n.phoneNumber,!0}async UploadFileForRequestB64(t,e,i){let n={requestId:t,type:e,data:await this.toBase64(i)},s=await this.post(this.urls.UploadCapture,JSON.stringify(n));return l.hasIdBack||"IdFront"!=e?l.hasIdBack&&"IdBack"==e?s.isValid:"Selfie"!=e||s.isValid:s.isValid}async GetAgreement(t){return(await this.get(this.urls.GetAgreement+"?type="+t+"&requestId="+l.requestId)).htmlText}async GenerateAgreement(t){let e={requestId:l.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:l.requestId,link:t,phoneNumber:e};return(await this.post(this.urls.SendLink,JSON.stringify(i))).sent}async AddLog(t,e){try{let i={requestId:l.requestId,action:o[l.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){let i={requestId:l.requestId,redirectId:l.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:l.requestId}))).saved}async GetTranslations(t){return await this.get(this.urls.Translations+"?langIso="+t)}}const m=new class{async getValues(){return this.values||(this.values=await this.fetchTranslations()),this.values}getLocale(t=document.body){if(l.langIso&&""!=l.langIso)return l.langIso;{const e=t.closest("[lang]");return e?e.lang:"ro"}}async fetchTranslations(){const t=this.getLocale();try{const e=(new b).GetTranslations(t);if(e)return e}catch(e){return console.error(`Error loading locale: ${t}`,e),null}}};export{b as A,w as F,r as I,i as O,d as S,m as T,p as a,o as b,c,l as s}