@ekyc_qoobiss/qbs-ect-cmp 3.6.43 → 3.6.45

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.
Files changed (49) hide show
  1. package/dist/cjs/{TranslationUtils-dd73945b.js → TranslationUtils-006f5c9e.js} +8 -1
  2. package/dist/cjs/agreement-check_17.cjs.entry.js +206 -292
  3. package/dist/cjs/random-actions.cjs.entry.js +1 -1
  4. package/dist/collection/components/base-component.js +11 -44
  5. package/dist/collection/components/common/agreement-check/agreement-check.js +0 -4
  6. package/dist/collection/components/common/camera-error/camera-error.js +3 -10
  7. package/dist/collection/components/common/capture-error/capture-error.js +3 -8
  8. package/dist/collection/components/common/how-to-info/how-to-info.js +2 -4
  9. package/dist/collection/components/common/id-capture/id-capture.js +2 -3
  10. package/dist/collection/components/common/selfie-capture/selfie-capture.js +1 -3
  11. package/dist/collection/components/flow/agreement-info/agreement-info.js +4 -5
  12. package/dist/collection/components/flow/landing-validation/landing-validation.js +5 -11
  13. package/dist/collection/components/flow/mobile-redirect/mobile-redirect.js +6 -7
  14. package/dist/collection/components/flow/process-id/process-id.js +10 -8
  15. package/dist/collection/components/flow/sms-code-validation/sms-code-validation.js +6 -13
  16. package/dist/collection/components/flow/sms-send/sms-send.js +6 -12
  17. package/dist/collection/components/flow/user-liveness/user-liveness.js +7 -10
  18. package/dist/collection/components/identification-component/identification-component.js +10 -7
  19. package/dist/collection/helpers/ApiCall.js +7 -1
  20. package/dist/collection/models/FlowSteps.js +1 -0
  21. package/dist/esm/{TranslationUtils-741a728a.js → TranslationUtils-13cb9b8c.js} +8 -1
  22. package/dist/esm/agreement-check_17.entry.js +206 -292
  23. package/dist/esm/random-actions.entry.js +1 -1
  24. package/dist/qbs-ect-cmp/p-004a2264.js +1 -0
  25. package/dist/qbs-ect-cmp/{p-a4babb67.entry.js → p-44d4faec.entry.js} +2 -2
  26. package/dist/qbs-ect-cmp/{p-a130edd5.entry.js → p-c93d153b.entry.js} +1 -1
  27. package/dist/qbs-ect-cmp/qbs-ect-cmp.esm.js +1 -1
  28. package/dist/types/components/base-component.d.ts +3 -12
  29. package/dist/types/components/common/agreement-check/agreement-check.d.ts +0 -1
  30. package/dist/types/components/common/camera-error/camera-error.d.ts +0 -1
  31. package/dist/types/components/common/capture-error/capture-error.d.ts +0 -1
  32. package/dist/types/components/common/how-to-info/how-to-info.d.ts +0 -1
  33. package/dist/types/components/common/id-capture/id-capture.d.ts +0 -1
  34. package/dist/types/components/common/selfie-capture/selfie-capture.d.ts +0 -1
  35. package/dist/types/components/flow/agreement-info/agreement-info.d.ts +0 -1
  36. package/dist/types/components/flow/landing-validation/landing-validation.d.ts +0 -1
  37. package/dist/types/components/flow/mobile-redirect/mobile-redirect.d.ts +0 -1
  38. package/dist/types/components/flow/process-id/process-id.d.ts +1 -1
  39. package/dist/types/components/flow/sms-code-validation/sms-code-validation.d.ts +0 -1
  40. package/dist/types/components/flow/sms-send/sms-send.d.ts +0 -1
  41. package/dist/types/components/flow/user-liveness/user-liveness.d.ts +0 -1
  42. package/dist/types/components/identification-component/identification-component.d.ts +0 -1
  43. package/dist/types/helpers/ApiCall.d.ts +2 -0
  44. package/dist/types/models/FlowSteps.d.ts +2 -1
  45. package/dist/types/models/IAddRequest.d.ts +1 -1
  46. package/dist/types/models/IOtpCheck.d.ts +1 -1
  47. package/dist/types/models/IOtpSend.d.ts +1 -1
  48. package/package.json +1 -1
  49. package/dist/qbs-ect-cmp/p-87c689d6.js +0 -1
@@ -1 +1 @@
1
- import{r as t,h as s}from"./p-8942656c.js";import{T as i}from"./p-87c689d6.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-004a2264.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{p as e,b as t}from"./p-8942656c.js";export{s as setNonce}from"./p-8942656c.js";(()=>{const t=import.meta.url,o={};return""!==t&&(o.resourcesUrl=new URL(".",t).href),e(o)})().then((e=>t([["p-054dc5b3",[[1,"loader-dots"]]],["p-a130edd5",[[0,"random-actions"]]],["p-a4babb67",[[1,"identification-component",{token:[1537],order_id:[1537],api_url:[1537],env:[1537],redirect_id:[1537],phone_number:[1537],lang_iso:[1537],errorMessage:[32],errorTitle:[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"],[0,"apiError","apiErrorEmitter"],[9,"scroll","handleScroll"]]],[0,"process-id",{showTimeout:[32],showInvalid:[32],flow:[32]},[[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoIdCapture","captureIdImage"],[0,"recordingIdCapture","capturedIdRecording"]]],[0,"user-liveness",{showError:[32],flow:[32],howToDone:[32]},[[0,"howToInfoDone","howToDoneEvent"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoSelfieCapture","captureSelfieImage"],[0,"recordingSelfieCapture","capturedSelfieRecording"]]],[0,"agreement-info",{agreementsChecked:[32],termsChecked:[32],openAgreements:[32],openTerms:[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"]]],[0,"camera-error",{title:[32],description:[32],buttonDisabled:[32],demoVideo:[32]}],[0,"end-redirect"],[0,"error-end",{message:[1],errorTitle:[1,"error-title"]}],[0,"landing-validation",{warningText:[32],buttonDisabled:[32]}],[0,"mobile-redirect",{infoTextTop:[32],infoTextBottom:[32],contact:[32],invalidValue:[32],waitingMobile:[32],orderStatus:[32],redirectLink:[32],qrCode:[32],prefilledPhone:[32]}],[0,"sms-code-validation",{title:[32],details:[32],buttonText:[32],code:[32],canSend:[32]}],[0,"sms-send",{buttonText:[32],phoneNumber:[32],prefilledPhone:[32],canSend:[32]}],[0,"id-capture",{videoStarted:[32],cameraSize:[32],captureTaken:[32],verified:[32],titleMesage:[32],showDemo:[32],demoVideo:[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"selfie-capture",{videoStarted:[32],captureTaken:[32],verified:[32],titleMesage:[32],demoEnded:[32],demoVideo:[32],captureHeight:[32],captureWidth:[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-check",{agreementType:[1,"agreement-type"],htmlContent:[32],buttonEnabled:[32],scrollClass:[32]}],[0,"capture-error",{type:[1],buttonEnabled:[32],buttonText:[32]}],[0,"how-to-info",{topTitle:[32],subTitle:[32],imagePath:[32],buttonText:[32],buttonEnabled:[32]}],[0,"camera-comp",{modelPath:[1,"model-path"],probabilityThreshold:[2,"probability-threshold"],captureMode:[1,"capture-mode"]}]]]],e)));
1
+ import{p as e,b as t}from"./p-8942656c.js";export{s as setNonce}from"./p-8942656c.js";(()=>{const t=import.meta.url,o={};return""!==t&&(o.resourcesUrl=new URL(".",t).href),e(o)})().then((e=>t([["p-054dc5b3",[[1,"loader-dots"]]],["p-c93d153b",[[0,"random-actions"]]],["p-44d4faec",[[1,"identification-component",{token:[1537],order_id:[1537],api_url:[1537],env:[1537],redirect_id:[1537],phone_number:[1537],lang_iso:[1537],errorMessage:[32],errorTitle:[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"],[0,"apiError","apiErrorEmitter"],[9,"scroll","handleScroll"]]],[0,"process-id",{showTimeout:[32],showInvalid:[32],flow:[32]},[[0,"howToInfoDone","howToDone"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoIdCapture","captureIdImage"],[0,"recordingIdCapture","capturedIdRecording"]]],[0,"user-liveness",{showError:[32],flow:[32],howToDone:[32]},[[0,"howToInfoDone","howToDoneEvent"],[0,"timeElapsed","timeElapsed"],[0,"captureErrorDone","captureErrorDone"],[0,"photoSelfieCapture","captureSelfieImage"],[0,"recordingSelfieCapture","capturedSelfieRecording"]]],[0,"agreement-info",{agreementsChecked:[32],termsChecked:[32],openAgreements:[32],openTerms:[32]},[[0,"agreementAcceptance","agreementAcceptanceEmitted"]]],[0,"camera-error",{title:[32],description:[32],buttonDisabled:[32],demoVideo:[32]}],[0,"end-redirect"],[0,"error-end",{message:[1],errorTitle:[1,"error-title"]}],[0,"landing-validation",{warningText:[32],buttonDisabled:[32]}],[0,"mobile-redirect",{infoTextTop:[32],infoTextBottom:[32],contact:[32],invalidValue:[32],waitingMobile:[32],orderStatus:[32],redirectLink:[32],qrCode:[32],prefilledPhone:[32]}],[0,"sms-code-validation",{title:[32],details:[32],buttonText:[32],code:[32],canSend:[32]}],[0,"sms-send",{buttonText:[32],phoneNumber:[32],prefilledPhone:[32],canSend:[32]}],[0,"id-capture",{videoStarted:[32],cameraSize:[32],captureTaken:[32],verified:[32],titleMesage:[32],showDemo:[32],demoVideo:[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"selfie-capture",{videoStarted:[32],captureTaken:[32],verified:[32],titleMesage:[32],demoEnded:[32],demoVideo:[32],captureHeight:[32],captureWidth:[32]},[[0,"videoStarted","eventVideoStarted"],[0,"takePhoto","takePhoto"],[0,"verificationFinished","verificationFinished"]]],[0,"agreement-check",{agreementType:[1,"agreement-type"],htmlContent:[32],buttonEnabled:[32],scrollClass:[32]}],[0,"capture-error",{type:[1],buttonEnabled:[32],buttonText:[32]}],[0,"how-to-info",{topTitle:[32],subTitle:[32],imagePath:[32],buttonText:[32],buttonEnabled:[32]}],[0,"camera-comp",{modelPath:[1,"model-path"],probabilityThreshold:[2,"probability-threshold"],captureMode:[1,"capture-mode"]}]]]],e)));
@@ -1,15 +1,6 @@
1
- import { EventEmitter } from '../stencil-public-runtime';
2
- import { ApiCall } from '../helpers/ApiCall';
3
1
  import { FlowMoments, FlowSteps } from '../models/FlowSteps';
4
2
  export declare class BaseComponent {
5
- apiCall: ApiCall;
6
- protected flowStep: FlowSteps;
7
- private apiErrorEvent;
8
- private processError;
9
- constructor(step: FlowSteps | undefined);
10
- setEventEmitter(event: EventEmitter<any>): void;
11
- setErrorCallback(callback: (data: any, zone: any) => void): void;
12
- logStep(step: FlowSteps, moment: FlowMoments): Promise<void>;
13
- initialize(): Promise<void>;
14
- finalize(): Promise<void>;
3
+ static logStep(step: FlowSteps, moment: FlowMoments): Promise<void>;
4
+ static initialize(flowStep: FlowSteps): Promise<void>;
5
+ static finalize(flowStep: FlowSteps): Promise<void>;
15
6
  }
@@ -5,7 +5,6 @@ export declare class AgreementCheck {
5
5
  buttonEnabled: boolean;
6
6
  scrollClass: string;
7
7
  private apiCalls;
8
- private baseComponent;
9
8
  private translations;
10
9
  constructor();
11
10
  apiErrorEvent: EventEmitter<any>;
@@ -5,7 +5,6 @@ export declare class CameraError {
5
5
  private buttonDisabled;
6
6
  private demoVideo;
7
7
  private buttonText;
8
- private baseComponent;
9
8
  private translations;
10
9
  apiErrorEvent: EventEmitter<any>;
11
10
  constructor();
@@ -1,6 +1,5 @@
1
1
  import { EventEmitter } from '../../../stencil-public-runtime';
2
2
  export declare class CaptureError {
3
- private baseComponent;
4
3
  type: string;
5
4
  private buttonEnabled;
6
5
  private buttonText;
@@ -1,6 +1,5 @@
1
1
  import { EventEmitter } from '../../../stencil-public-runtime';
2
2
  export declare class HowToInfo {
3
- private baseComponent;
4
3
  private translations;
5
4
  private currentStep;
6
5
  topTitle: string;
@@ -1,6 +1,5 @@
1
1
  import { EventEmitter } from '../../../stencil-public-runtime';
2
2
  export declare class IdCapture {
3
- private baseComponent;
4
3
  private translations;
5
4
  private flowStep;
6
5
  private pose;
@@ -1,6 +1,5 @@
1
1
  import { EventEmitter } from '../../../stencil-public-runtime';
2
2
  export declare class SelfieCapture {
3
- private baseComponent;
4
3
  private translations;
5
4
  component: HTMLElement;
6
5
  private videoStarted;
@@ -4,7 +4,6 @@ export declare class AgreementInfo {
4
4
  termsChecked: boolean;
5
5
  openAgreements: boolean;
6
6
  openTerms: boolean;
7
- private baseComponent;
8
7
  private translations;
9
8
  apiErrorEvent: EventEmitter<any>;
10
9
  constructor();
@@ -2,7 +2,6 @@ import { EventEmitter } from '../../../stencil-public-runtime';
2
2
  export declare class LandingValidation {
3
3
  warningText: string;
4
4
  buttonDisabled: boolean;
5
- private baseComponent;
6
5
  private translations;
7
6
  apiErrorEvent: EventEmitter<any>;
8
7
  constructor();
@@ -9,7 +9,6 @@ export declare class MobileRedirect {
9
9
  private redirectLink;
10
10
  private qrCode;
11
11
  private prefilledPhone;
12
- private baseComponent;
13
12
  private translations;
14
13
  apiErrorEvent: EventEmitter<any>;
15
14
  constructor();
@@ -1,8 +1,8 @@
1
1
  import { EventEmitter } from '../../../stencil-public-runtime';
2
2
  export declare class ProcessId {
3
3
  private captureRetryCount;
4
- private baseComponent;
5
4
  private recordingResultCount;
5
+ private currentStep;
6
6
  private showTimeout;
7
7
  private showInvalid;
8
8
  private flow;
@@ -5,7 +5,6 @@ export declare class SmsCodeValidation {
5
5
  private buttonText;
6
6
  private code;
7
7
  private canSend;
8
- private baseComponent;
9
8
  private translations;
10
9
  apiErrorEvent: EventEmitter<any>;
11
10
  constructor();
@@ -4,7 +4,6 @@ export declare class SmsSend {
4
4
  private phoneNumber;
5
5
  private prefilledPhone;
6
6
  private canSend;
7
- private baseComponent;
8
7
  private translations;
9
8
  apiErrorEvent: EventEmitter<any>;
10
9
  constructor();
@@ -3,7 +3,6 @@ export declare class UserLiveness {
3
3
  showError: boolean;
4
4
  private flow;
5
5
  private howToDone;
6
- private baseComponent;
7
6
  private recordingResultCount;
8
7
  private recordingRetryCount;
9
8
  private currentStep;
@@ -9,7 +9,6 @@ export declare class IdentificationComponent {
9
9
  private errorMessage;
10
10
  private errorTitle;
11
11
  private logInit;
12
- private baseComponent;
13
12
  private flowStatusToSet;
14
13
  private initialised;
15
14
  onTokenChange(newValue: string, _oldValue: string): Promise<void>;
@@ -7,6 +7,8 @@ import { FlowMoments, FlowSteps } from '../models/FlowSteps';
7
7
  import { DeviceState } from '../models/IDevice';
8
8
  import { TranslationValues } from '../models/ITranslationValues';
9
9
  export declare class ApiCall {
10
+ static instance: ApiCall;
11
+ static getInstance(): ApiCall;
10
12
  private urls;
11
13
  private serviceErrors;
12
14
  constructor();
@@ -19,7 +19,8 @@ export declare enum FlowSteps {
19
19
  Selfie,
20
20
  SelfieError,
21
21
  End,
22
- CameraError
22
+ CameraError,
23
+ Default
23
24
  }
24
25
  export declare enum FlowMoments {
25
26
  Initialized,
@@ -5,5 +5,5 @@ export interface AddRequest {
5
5
  agreementsValidation: boolean;
6
6
  phoneValidation: boolean;
7
7
  phoneNumber: string;
8
- status: string;
8
+ state: string;
9
9
  }
@@ -1,4 +1,4 @@
1
1
  export interface OtpCheck {
2
2
  valid: boolean;
3
- status: string;
3
+ state: string;
4
4
  }
@@ -1,4 +1,4 @@
1
1
  export interface OtpSend {
2
2
  sent: boolean;
3
- status: string;
3
+ state: string;
4
4
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ekyc_qoobiss/qbs-ect-cmp",
3
- "version": "3.6.43",
3
+ "version": "3.6.45",
4
4
  "description": "Person Identification Component",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "module": "./dist/index.js",
@@ -1 +0,0 @@
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.IDFRONT=6]="IDFRONT",t[t.IDBACK=7]="IDBACK",t[t.IDTILT=8]="IDTILT",t[t.LIVENESS=9]="LIVENESS",t[t.LIVENESSGESTURE=10]="LIVENESSGESTURE",t[t.COMPLETE=11]="COMPLETE",t[t.ERROREND=12]="ERROREND",t[t.CAMERAERROR=13]="CAMERAERROR",t[t.ABORTED=14]="ABORTED",t[t.NONE=15]="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 h{}h.FlowStatusKey="qbs-ect-flowstatus",h.RequestIdKey="qbs-ect-requestid",h.TokenKey="qbs-ect-token",h.InitialisedKey="qbs-ect-initialised",h.HasIdBackKey="qbs-ect-has-id-back",h.AgreementValidationKey="qbs-ect-agreement-validation",h.PhoneValidationKey="qbs-ect-phone-validation",h.RefreshDoneKey="qbs-ect-refresh-done";class d{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",this.StartFlow=this.uriEnv+"flowstate/startflow",this.NextFlowState=this.uriEnv+"flowstate/getnextstate"}}const{state:l,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))))},h="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)}),d=(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:h,get:r,set:c,on:d,onChange:(e,i)=>{const s=d("set",((t,s)=>{t===e&&i(s)})),n=d("reset",(()=>i(a(t)[e])));return()=>{s(),n()}},use:(...t)=>{const e=t.reduce(((t,e)=>(e.set&&t.push(d("set",e.set)),e.get&&t.push(d("get",e.get)),e.reset&&t.push(d("reset",e.reset)),e.dispose&&t.push(d("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"},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=>{l.debug="QA"==t})),u("flowStatus",(t=>{sessionStorage.setItem(h.FlowStatusKey,o[t])})),u("token",(t=>{sessionStorage.setItem(h.TokenKey,t)})),u("requestId",(t=>{sessionStorage.setItem(h.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"}(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 s=new FileReader;s.readAsDataURL(t),s.onload=()=>e(s.result),s.onerror=t=>i(t)})),this.urls=new d}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(l.apiBaseUrl+t,{method:"POST",body:e,headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.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(l.apiBaseUrl+t,{method:"POST",body:e,headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.token}});return await this.http(n)}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 s=new Request(l.apiBaseUrl+t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.token}});return await this.http(s)}catch(e){this.AddLog("Error in get ",e);var n=new Request(l.apiBaseUrl+t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+l.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){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},s=await this.post(this.urls.IdentityInsert,JSON.stringify(i));return""==l.requestId&&(l.requestId=s.requestId),l.phoneNumber=s.phoneNumber,l.flowStatus=o[s.status],!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 l.flowStatus=o[n.state],!(e in["IdFront","IdBack","Selfie"])||n.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}))}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({requesId:l.requestId,cameraIsAccessible:t}));return o[e.state]}async GetNextFlowState(){let t=await this.get(this.urls.StartFlow+"?requesId="+l.requestId);return o[t.state]}}const f=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,h as S,f as T,p as a,o as b,c,l as s}