santoid-sdk 5.4.0 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +50 -0
- package/api/AbstractService.d.ts +5 -4
- package/api/AbstractService.js +2 -5
- package/api/ApiLivenessSessionService.d.ts +27 -0
- package/api/ApiLivenessSessionService.js +30 -0
- package/browser/index.js +1 -1
- package/client/index.d.ts +2 -0
- package/client/index.js +2 -0
- package/client/liveness/index.d.ts +2 -1
- package/client/liveness/index.js +3 -1
- package/client/liveness/methods/livenessDetection/index.d.ts +8 -0
- package/client/liveness/methods/livenessDetection/index.js +8 -0
- package/client/liveness/methods/livenessSession/Service.d.ts +19 -0
- package/client/liveness/methods/livenessSession/Service.js +63 -0
- package/client/liveness/methods/livenessSession/index.d.ts +20 -0
- package/client/liveness/methods/livenessSession/index.js +44 -0
- package/client/liveness/methods/uploadIdentificationDocument/index.d.ts +2 -2
- package/package.json +1 -1
- package/server/liveness/methods/uploadIdentificationDocument/index.d.ts +2 -2
- package/utils/constants.d.ts +5 -1
- package/utils/constants.js +6 -2
- package/.bitbucket/pipelines/generated/pipeline/pipes/sonarsource/sonarcloud-scan/sonarcloud-scan.log +0 -263
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Versão 5.5.0
|
|
4
|
+
|
|
5
|
+
### Mudanças
|
|
6
|
+
- Adicionada a função **livenessSession**, a prova de vida v2, sobre o **AWS Rekognition Face Liveness**. Ela cobre o ciclo de sessão (`createSession` e `getResults`), incluindo a espera pelo resultado enquanto o Rekognition ainda avalia. A captura em si — câmera, oval e desafio — é feita pelo `<FaceLivenessDetector>` da AWS, um componente React, e por isso não faz parte deste pacote.
|
|
7
|
+
- A função **livenessDetection** foi marcada como **deprecada**. Ela é a prova de vida v1, baseada no detector in-house (WebSocket com o desafio de cinco posições). Continua funcionando e será mantida até a migração dos clientes, mas não recebe mais evolução — código novo deve usar **livenessSession**.
|
|
8
|
+
- A URL padrão do WebSocket da v1 deixou de apontar para o endereço gerado do Cloud Run e passou a usar o domínio próprio `liveness.santoid.com.br`.
|
|
9
|
+
|
|
3
10
|
## Versão 5.4.0
|
|
4
11
|
- Foram adicionadas as funções de callback **onCameraStart** e **onCameraStop** para as funcionalidades de **Tipificação**, **OCR** e **Face Match**.
|
|
5
12
|
- Agora as funções de iniciar câmera para **Tipificação**, **OCR** e **Face Match** possuem a opção **facingMode**, que permitem que o usuário especifique a direção desejada da câmera
|
package/README.md
CHANGED
|
@@ -365,6 +365,56 @@ Os resultados podem ser obtidos por meio da função de callback **onSuccess** p
|
|
|
365
365
|
### Prova de Vida
|
|
366
366
|
O SDK conta com a funcionalidade de **Prova de Vida**, que possibilita a verificação do usuário atual, avaliando se uma pessoa real está realizando as atividades online por meio de uma rápida análise facial.
|
|
367
367
|
|
|
368
|
+
Existem duas versões:
|
|
369
|
+
|
|
370
|
+
| Versão | Função | Situação |
|
|
371
|
+
| --- | --- | --- |
|
|
372
|
+
| v2 | `livenessSession` | **Recomendada.** Usa o AWS Rekognition Face Liveness. |
|
|
373
|
+
| v1 | `livenessDetection` | **Deprecada.** Detector in-house, via WebSocket, com o desafio de cinco posições. Mantida até a migração dos clientes, sem receber evolução. |
|
|
374
|
+
|
|
375
|
+
#### Prova de Vida v2 (recomendada)
|
|
376
|
+
A v2 é feita em duas partes. O SDK cuida do ciclo de sessão contra a API do SantoiD; a captura — câmera, oval e desafio — é feita pelo componente React `<FaceLivenessDetector>` da AWS, que transmite os frames direto para o Rekognition e por isso não faz parte deste pacote.
|
|
377
|
+
|
|
378
|
+
O fluxo é:
|
|
379
|
+
|
|
380
|
+
1. `createSession()` — cria a sessão e devolve o `sessionId`
|
|
381
|
+
2. o `<FaceLivenessDetector>` recebe esse `sessionId` e conduz a captura
|
|
382
|
+
3. `getResults()` — quando o detector avisar que terminou
|
|
383
|
+
|
|
384
|
+
```ts
|
|
385
|
+
import { livenessSession } from 'santoid-sdk/client/liveness'
|
|
386
|
+
|
|
387
|
+
const session = livenessSession({
|
|
388
|
+
token: 'string',
|
|
389
|
+
|
|
390
|
+
// Opcional: sem track, a verificação não fica atrelada a um processo
|
|
391
|
+
track: 'string',
|
|
392
|
+
customerRequestId: 'string',
|
|
393
|
+
|
|
394
|
+
onSessionCreated: (sessionId) => {
|
|
395
|
+
// Entregue este sessionId ao <FaceLivenessDetector>
|
|
396
|
+
},
|
|
397
|
+
|
|
398
|
+
onResults: (results) => {
|
|
399
|
+
// results.Status, results.Confidence, results.ReferenceImage, results.AuditImages
|
|
400
|
+
},
|
|
401
|
+
|
|
402
|
+
onError: (error) => {
|
|
403
|
+
// ...
|
|
404
|
+
},
|
|
405
|
+
})
|
|
406
|
+
|
|
407
|
+
const sessionId = await session.createSession()
|
|
408
|
+
|
|
409
|
+
// Depois que o detector sinalizar o fim da captura:
|
|
410
|
+
const results = await session.getResults()
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
O `getResults` já espera internamente enquanto o Rekognition ainda avalia — o status fica `CREATED` ou `IN_PROGRESS` por alguns instantes após a captura terminar, e a função só devolve quando sair desse estado (ou após esgotar as tentativas).
|
|
414
|
+
|
|
415
|
+
#### Prova de Vida v1 (deprecada)
|
|
416
|
+
> **Deprecada.** Use `livenessSession`. Esta seção descreve a versão anterior, mantida para os clientes que ainda não migraram.
|
|
417
|
+
|
|
368
418
|
#### Utilização em JavaScript
|
|
369
419
|
Para utilizar a funcionalidade de Prova de Vida, é necessário importar a função para iniciar a verificação e passar alguns valores dentro do objeto de opções, como no exemplo abaixo:
|
|
370
420
|
|
package/api/AbstractService.d.ts
CHANGED
|
@@ -12,10 +12,11 @@ export declare class AbstractService {
|
|
|
12
12
|
serviceOptions: IAbstractServiceOptions;
|
|
13
13
|
baseUrl: string;
|
|
14
14
|
constructor(options: Partial<IBaseSDKOptions>, serviceOptions: IAbstractServiceOptions);
|
|
15
|
-
request({ contentType, authToken, baseUrl, }?: {
|
|
16
|
-
contentType?: string
|
|
17
|
-
authToken?: string
|
|
18
|
-
baseUrl?: string
|
|
15
|
+
request({ contentType, authToken, baseUrl, extraHeaders, }?: {
|
|
16
|
+
contentType?: string;
|
|
17
|
+
authToken?: string;
|
|
18
|
+
baseUrl?: string;
|
|
19
|
+
extraHeaders?: Record<string, string>;
|
|
19
20
|
}): import("axios").AxiosInstance;
|
|
20
21
|
}
|
|
21
22
|
export {};
|
package/api/AbstractService.js
CHANGED
|
@@ -13,13 +13,10 @@ class AbstractService {
|
|
|
13
13
|
}
|
|
14
14
|
request(_a) {
|
|
15
15
|
var _b, _c;
|
|
16
|
-
var { contentType = 'application/json', authToken = this.options.token, baseUrl = (_b = this.options.customApiUrl) !== null && _b !== void 0 ? _b : constants_1.API_GATEWAY_URL, } = _a === void 0 ? {} : _a;
|
|
16
|
+
var { contentType = 'application/json', authToken = this.options.token, baseUrl = (_b = this.options.customApiUrl) !== null && _b !== void 0 ? _b : constants_1.API_GATEWAY_URL, extraHeaders, } = _a === void 0 ? {} : _a;
|
|
17
17
|
const axiosConfig = {
|
|
18
18
|
baseURL: baseUrl,
|
|
19
|
-
headers: {
|
|
20
|
-
'Content-Type': contentType,
|
|
21
|
-
Authorization: `Bearer ${authToken}`,
|
|
22
|
-
},
|
|
19
|
+
headers: Object.assign({ 'Content-Type': contentType, Authorization: `Bearer ${authToken}` }, extraHeaders),
|
|
23
20
|
};
|
|
24
21
|
let domain = this.options.domain;
|
|
25
22
|
if (!this.options.domain && this.options.token) {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { AbstractService } from './AbstractService';
|
|
2
|
+
export interface ILivenessSession {
|
|
3
|
+
SessionId: string;
|
|
4
|
+
}
|
|
5
|
+
export interface ILivenessBoundingBox {
|
|
6
|
+
Width?: number;
|
|
7
|
+
Height?: number;
|
|
8
|
+
Left?: number;
|
|
9
|
+
Top?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface ILivenessImage {
|
|
12
|
+
Bytes?: string;
|
|
13
|
+
BoundingBox?: ILivenessBoundingBox;
|
|
14
|
+
}
|
|
15
|
+
export interface ILivenessSessionResult {
|
|
16
|
+
SessionId: string;
|
|
17
|
+
Status: string;
|
|
18
|
+
Confidence?: number;
|
|
19
|
+
ReferenceImage?: ILivenessImage;
|
|
20
|
+
AuditImages?: ILivenessImage[];
|
|
21
|
+
}
|
|
22
|
+
export declare class ApiLivenessSessionService extends AbstractService {
|
|
23
|
+
get baseLivenessUrl(): string;
|
|
24
|
+
private livenessRequest;
|
|
25
|
+
createSession(customerRequestId?: string): Promise<ILivenessSession>;
|
|
26
|
+
getSessionResults(sessionId: string): Promise<ILivenessSessionResult>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApiLivenessSessionService = void 0;
|
|
4
|
+
const AbstractService_1 = require("./AbstractService");
|
|
5
|
+
const constants_1 = require("../utils/constants");
|
|
6
|
+
class ApiLivenessSessionService extends AbstractService_1.AbstractService {
|
|
7
|
+
get baseLivenessUrl() {
|
|
8
|
+
var _a;
|
|
9
|
+
return (_a = this.options.customApiUrl) !== null && _a !== void 0 ? _a : constants_1.LIVENESS_API_URL;
|
|
10
|
+
}
|
|
11
|
+
// O liveness v2 nao fica atras do API Gateway, entao o
|
|
12
|
+
// x-endpoint-api-userinfo precisa ir explicito: e' ele que o backend le
|
|
13
|
+
// para autorizar (ver api/deps.py, viewer_user_validation).
|
|
14
|
+
livenessRequest() {
|
|
15
|
+
var _a;
|
|
16
|
+
return this.request({
|
|
17
|
+
baseUrl: this.baseLivenessUrl,
|
|
18
|
+
extraHeaders: { 'x-endpoint-api-userinfo': (_a = this.options.token) !== null && _a !== void 0 ? _a : '' },
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
async createSession(customerRequestId) {
|
|
22
|
+
const response = await this.livenessRequest().post('/api/v2/liveness/session', { track: this.options.track, customerRequestId });
|
|
23
|
+
return response.data;
|
|
24
|
+
}
|
|
25
|
+
async getSessionResults(sessionId) {
|
|
26
|
+
const response = await this.livenessRequest().get(`/api/v2/liveness/session/${sessionId}`, { params: this.options.track ? { track: this.options.track } : undefined });
|
|
27
|
+
return response.data;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.ApiLivenessSessionService = ApiLivenessSessionService;
|
package/browser/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("SantoiDSDK",[],t):"object"==typeof exports?exports.SantoiDSDK=t():e.SantoiDSDK=t()}(this,(()=>(()=>{var e={373:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractService=void 0;const o=s(r(218)),n=r(661);t.AbstractService=class{constructor(e,t){this.options=e,this.serviceOptions=t}request(e){var t,r,{contentType:s="application/json",authToken:i=this.options.token,baseUrl:a=(null!==(t=this.options.customApiUrl)&&void 0!==t?t:n.API_GATEWAY_URL)}=void 0===e?{}:e;const c={baseURL:a,headers:{"Content-Type":s,Authorization:`Bearer ${i}`}};let l=this.options.domain;if(!this.options.domain&&this.options.token){const e=this.serviceOptions.tryDecodeJwt(this.options.token);l=null===(r=null==e?void 0:e.claims)||void 0===r?void 0:r.domain}return c.headers&&(l&&(c.headers.Domain=l),this.options.useBillingAccounts&&(c.headers.clientCredentials=!0)),o.default.create(c)}}},151:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ApiAsyncService=void 0;const s=r(373);class o extends s.AbstractService{constructor(e,...t){super(...t),this.resultsRoute=e.resultsRoute}async get(e){return(await this.request().get(`/api/v1/tracks/${this.options.track}/${this.resultsRoute}/`+e)).data}}t.ApiAsyncService=o},748:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ApiFaceMatchService=void 0;const s=r(151),o=r(951);class n extends s.ApiAsyncService{constructor(...e){super({resultsRoute:"face-async"},...e)}async faceMatch(e,t,r){return await(0,o.retryAsyncFunctionXTimes)((async()=>{const s=new this.serviceOptions.FormDataClass;return s.append("track",this.options.track),s.append("deliveryFront","true"),s.append("sensitive_data_compliance","true"),s.append("imageFile1",e,"imageFile1.jpg"),t&&s.append("imageFile2",t,"imageFile2.jpg"),r&&s.append("customerRequestId",r),(await this.request({contentType:"multipart/form-data"}).post("/api/v1/face-match-async",s)).data}))}async get(...e){return await super.get(...e)}}t.ApiFaceMatchService=n},926:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ApiOcrService=void 0;const s=r(151),o=r(951);class n extends s.ApiAsyncService{constructor(...e){super({resultsRoute:"ocr-async"},...e)}async extract(e,t){return await(0,o.retryAsyncFunctionXTimes)((async()=>{const r=new this.serviceOptions.FormDataClass;return r.append("imageFile",e,"imageFile.jpg"),r.append("track",this.options.track),r.append("template",this.options.template),r.append("customerRequestId",t),r.append("deliveryFront","true"),(await this.request({contentType:"multipart/form-data"}).post("/api/v1/ocr-async/ocr",r)).data}))}}t.ApiOcrService=n},456:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ApiTypificationService=void 0;const s=r(151),o=r(951);class n extends s.ApiAsyncService{constructor(...e){super({resultsRoute:"typification-async"},...e)}async predict(e,t){return await(0,o.retryAsyncFunctionXTimes)((async()=>{const r=new this.serviceOptions.FormDataClass;return r.append("imageFile",e,"imageFile.jpg"),r.append("track",this.options.track),r.append("customerRequestId",t),r.append("deliveryFront","true"),(await this.request({contentType:"multipart/form-data"}).post("/api/v1/typification-async/predict",r)).data}))}}t.ApiTypificationService=n},135:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseCoreService=void 0;const s=r(551),o=r(620);t.BaseCoreService=class{constructor(e){this.results={status:null,results:null,loading:!1,error:null},this.cameraIsActive=!1,this.cameraIsSetup=!1,this.options=e}async initialize(e){var t;e?this.startProcessing(e):(null!==(t=this.options.startTheCameraImmediately)&&void 0!==t?t:void 0===this.options.startTheCameraImmediately)&&await this.startCamera()}async updateResults(e){var t,r;this.results=Object.assign(Object.assign({},this.results),e),await(null===(r=(t=this.options).onUpdate)||void 0===r?void 0:r.call(t,this.results))}getVideoStream(){var e;return null===(e=this.frameGetControls)||void 0===e?void 0:e.videoStream}async setupCamera(){this.frameGetControls=await(0,o.getDefaultFrameControls)(),this.cameraIsSetup=!0}async startCamera(e){var t,r,o,n,i,a;try{if(this.cameraIsActive)throw new s.SDKError({message:"The camera has already been initialized",code:s.ECameraErrorCodes.ALREADY_STARTED,fatal:!1});if(this.results.loading)throw new s.SDKError({message:"Typification processing has already started",code:s.EProcessingErrorCodes.ALREADY_STARTED,fatal:!1});this.cameraIsSetup||await this.setupCamera(),this.frameGetControls.videoStream=await(null===(r=(t=this.frameGetControls).startGettingFrames)||void 0===r?void 0:r.call(t,e)),await(null===(n=(o=this.options).onCameraStart)||void 0===n?void 0:n.call(o,{videoStream:this.getVideoStream()})),this.cameraIsActive=!0}catch(e){const t=e instanceof s.SDKError?e:new s.SDKError({message:"Camera initialization error",code:s.ECameraErrorCodes.INITIALIZATION_ERROR,fatal:!1,details:e});await(null===(a=(i=this.options).onError)||void 0===a?void 0:a.call(i,t))}}async stopCamera(){var e,t,r,o,n,i;try{if(!this.cameraIsActive)throw new s.SDKError({message:"Camera not initialized",code:s.ECameraErrorCodes.NOT_INITIALIZED,fatal:!1});await(null===(t=(e=this.frameGetControls).stopGettingFrames)||void 0===t?void 0:t.call(e)),await(null===(o=(r=this.options).onCameraStop)||void 0===o?void 0:o.call(r)),this.cameraIsActive=!1}catch(e){const t=e instanceof s.SDKError?e:new s.SDKError({message:"Error during camera shutdown",code:s.ECameraErrorCodes.SHUTDOWN_ERROR,fatal:!1,details:e});await(null===(i=(n=this.options).onError)||void 0===i?void 0:i.call(n,t))}}async captureImage({startProcessing:e=!0}={}){var t,r;const o=await(null===(r=(t=this.frameGetControls).getNextFrame)||void 0===r?void 0:r.call(t));if(o)return e&&(await this.stopCamera(),await this.startProcessing(o)),o;throw new s.SDKError({message:"Cannot capture image",code:s.ECameraErrorCodes.CANNOT_CAPTURE_IMAGE,fatal:!1})}async waitForResults(e){let t=!1;return await new Promise(((r,s)=>{const o=setInterval((async()=>{var n,i,a,c;try{null===(i=(n=this.options).onClearInterval)||void 0===i||i.call(n,o);const s=await this.service.get(e);if("validation"===(null==s?void 0:s.status)&&!t)return await(null===(c=(a=this.options).onValidationRequested)||void 0===c?void 0:c.call(a,{track:this.options.track,requestId:s.id})),void(t=!0);if("error"===(null==s?void 0:s.status))throw new Error("Não foi possível processar os resultados do Upload de Documentos");if("processed"===(null==s?void 0:s.status)&&s.fileURL){const e=await fetch(s.fileURL),t=await e.json();t&&(clearInterval(o),r(t))}}catch(e){clearInterval(o),s(e)}}),5e3)}))}}},474:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FaceMatchService=void 0;const s=r(877),o=r(551),n=r(616),i=r(748),a=r(135);class c extends a.BaseCoreService{constructor(e){super(e),this.selectedFile1=void 0,this.selectedFile2=void 0,this.service=new i.ApiFaceMatchService(e,{FormDataClass:FormData,tryDecodeJwt:n.tryDecodeJwt})}async initialize(e,t){var r;e?this.startProcessing(e,t):(null!==(r=this.options.startTheCameraImmediately)&&void 0!==r?r:void 0===this.options.startTheCameraImmediately)&&await this.startCamera()}async captureFirstImage({startProcessing:e=!0}={}){const t=await super.captureImage({startProcessing:!1});return this.selectedFile1=t,e&&(await this.stopCamera(),await this.startProcessing(this.selectedFile1)),t}async captureSecondImage({startProcessing:e=!0}={}){if(!this.selectedFile1)throw new o.SDKError({message:"Select the first image before selecting the second",code:o.EFaceMatchErrorCodes.FIRST_IMAGE_NOT_SELECTED,fatal:!1});const t=await super.captureImage({startProcessing:!1});return this.selectedFile2=t,e&&(await this.stopCamera(),await this.startProcessing(this.selectedFile1,this.selectedFile2)),t}async startProcessing(e,t){var r,n,i,a,c,l,u;try{if(this.cameraIsActive)throw new o.SDKError({message:"Cannot start because the camera is running",code:o.ECameraErrorCodes.IS_RUNNING,fatal:!1});if(null===(r=this.results)||void 0===r?void 0:r.loading)throw new o.SDKError({message:"Processing has already started",code:o.EProcessingErrorCodes.ALREADY_STARTED,fatal:!1});this.updateResults({status:null,results:null,loading:!0,error:null});const{requestId:l}=await this.service.faceMatch(e,t,`sdk-ocr-${(0,s.v4)()}`),u=await this.waitForResultsFaceMatch(l);this.updateResults({status:"success",results:u,loading:!1,error:null}),null===(i=(n=this.options).onSuccess)||void 0===i||i.call(n,u),null===(c=(a=this.options).onEnd)||void 0===c||c.call(a)}catch(e){const t=e instanceof o.SDKError?e:new o.SDKError({message:"Error during document upload/analysis",code:o.EProcessingErrorCodes.PROCESSING_ERROR,fatal:!1,details:e});await(null===(u=(l=this.options).onError)||void 0===u?void 0:u.call(l,t)),this.updateResults({status:"error",results:null,loading:!1,error:t})}}async waitForResultsFaceMatch(e){return await new Promise(((t,r)=>{const s=setInterval((async()=>{var o,n,i,a;try{null===(n=(o=this.options).onClearInterval)||void 0===n||n.call(o,s);const r=await this.service.get(e);if("error"===(null==r?void 0:r.status)||"error_connector"===(null==r?void 0:r.status))throw new Error("Não foi possível processar os resultados do FaceMatch");if("processed"===(null==r?void 0:r.status)&&r.fileURL){const e=await fetch(r.fileURL);let o=await e.json();o=Object.assign(Object.assign({},o),{fileImage1:null!==(i=r.fileImage1)&&void 0!==i?i:"",fileImage2:null!==(a=r.fileImage2)&&void 0!==a?a:""}),o&&(clearInterval(s),t(o))}}catch(e){clearInterval(s),r(new Error(e))}}),5e3)}))}}t.FaceMatchService=c},927:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.faceMatch=void 0;const s=r(551),o=r(474);t.faceMatch=async function(e,t,r){var n,i;try{const s=new o.FaceMatchService(e);return await s.initialize(t,r),await(null===(i=(n=s.options).onStart)||void 0===i?void 0:i.call(n,{videoStream:s.getVideoStream()})),{startCamera:async(...e)=>{await s.startCamera(...e)},stopCamera:async()=>{await s.stopCamera()},captureFirstImage:async(...e)=>await s.captureFirstImage(...e),captureSecondImage:async(...e)=>await s.captureSecondImage(...e),getVideoStream:()=>s.getVideoStream(),sendFiles:async(...e)=>{await s.startProcessing(...e)}}}catch(e){throw new s.SDKError({message:"Error while starting SDK",code:s.EDefaultErrorCodes.INITIALIZATION_ERROR,fatal:!0,details:e})}}},577:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OcrService=void 0;const s=r(877),o=r(551),n=r(616),i=r(926),a=r(135);class c extends a.BaseCoreService{constructor(e){super(e),this.service=new i.ApiOcrService(e,{FormDataClass:FormData,tryDecodeJwt:n.tryDecodeJwt})}async startProcessing(e){var t,r,n,i,a,c,l;try{if(this.cameraIsActive)throw new o.SDKError({message:"Cannot start because the camera is running",code:o.ECameraErrorCodes.IS_RUNNING,fatal:!1});if(null===(t=this.results)||void 0===t?void 0:t.loading)throw new o.SDKError({message:"Processing has already started",code:o.EProcessingErrorCodes.ALREADY_STARTED,fatal:!1});this.updateResults({status:null,results:null,loading:!0,error:null});const{requestId:c}=await this.service.extract(e,`sdk-ocr-${(0,s.v4)()}`),l=await this.waitForResults(c);this.updateResults({status:"success",results:l,loading:!1,error:null}),null===(n=(r=this.options).onSuccess)||void 0===n||n.call(r,l),null===(a=(i=this.options).onEnd)||void 0===a||a.call(i)}catch(e){const t=e instanceof o.SDKError?e:new o.SDKError({message:"Error during document upload/analysis",code:o.EProcessingErrorCodes.PROCESSING_ERROR,fatal:!1,details:e});await(null===(l=(c=this.options).onError)||void 0===l?void 0:l.call(c,t)),this.updateResults({status:"error",results:null,loading:!1,error:t})}}}t.OcrService=c},168:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ocr=void 0;const s=r(551),o=r(577);t.ocr=async function(e,t){var r,n;try{const s=new o.OcrService(e);return await s.initialize(t),await(null===(n=(r=s.options).onStart)||void 0===n?void 0:n.call(r,{videoStream:s.getVideoStream()})),{startCamera:async(...e)=>{await s.startCamera(...e)},stopCamera:async()=>{await s.stopCamera()},captureImage:async()=>await s.captureImage(),getVideoStream:()=>s.getVideoStream(),sendFile:async e=>{await s.startProcessing(e)}}}catch(e){throw new s.SDKError({message:"Error while starting SDK",code:s.EDefaultErrorCodes.INITIALIZATION_ERROR,fatal:!0,details:e})}}},983:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypificationService=void 0;const s=r(877),o=r(551),n=r(616),i=r(456),a=r(135);class c extends a.BaseCoreService{constructor(e){super(e),this.service=new i.ApiTypificationService(e,{FormDataClass:FormData,tryDecodeJwt:n.tryDecodeJwt})}async startProcessing(e){var t,r,n,i,a,c,l;try{if(this.cameraIsActive)throw new o.SDKError({message:"Cannot start because the camera is running",code:o.ECameraErrorCodes.IS_RUNNING,fatal:!1});if(null===(t=this.results)||void 0===t?void 0:t.loading)throw new o.SDKError({message:"Processing has already started",code:o.EProcessingErrorCodes.ALREADY_STARTED,fatal:!1});this.updateResults({status:null,results:null,loading:!0,error:null});const{requestId:c}=await this.service.predict(e,`sdk-typification-${(0,s.v4)()}`),l=await this.waitForResults(c);this.updateResults({status:"success",results:l,loading:!1,error:null}),null===(n=(r=this.options).onSuccess)||void 0===n||n.call(r,l),null===(a=(i=this.options).onEnd)||void 0===a||a.call(i)}catch(e){const t=e instanceof o.SDKError?e:new o.SDKError({message:"Error during document upload/analysis",code:o.EProcessingErrorCodes.PROCESSING_ERROR,fatal:!1,details:e});await(null===(l=(c=this.options).onError)||void 0===l?void 0:l.call(c,t)),this.updateResults({status:"error",results:null,loading:!1,error:t})}}}t.TypificationService=c},344:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.typification=void 0;const s=r(551),o=r(983);t.typification=async function(e,t){var r,n;try{const s=new o.TypificationService(e);return await s.initialize(t),await(null===(n=(r=s.options).onStart)||void 0===n?void 0:n.call(r,{videoStream:s.getVideoStream()})),{startCamera:async(...e)=>{await s.startCamera(...e)},stopCamera:async()=>{await s.stopCamera()},captureImage:async()=>await s.captureImage(),getVideoStream:()=>s.getVideoStream(),sendFile:async e=>{await s.startProcessing(e)}}}catch(e){throw new s.SDKError({message:"Error while starting SDK",code:s.EDefaultErrorCodes.INITIALIZATION_ERROR,fatal:!0,details:e})}}},122:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.insertUploadIdentificationDocument=void 0;const s=r(661);t.insertUploadIdentificationDocument=function(e,t){var r,o,n;const i=t?document.querySelector(t):document.body;if(!i)throw new Error("Cannot find target element");const a=document.createElement("iframe");a.style.overflow="hidden",a.style.border="0",a.setAttribute("width",null!==(r=e.width)&&void 0!==r?r:"100%"),a.setAttribute("height",null!==(o=e.height)&&void 0!==o?o:"550px"),a.setAttribute("scrolling","no"),a.setAttribute("allow","camera; microphone; clipboard-read; clipboard-write");let c=`${null!==(n=e.customAppUrl)&&void 0!==n?n:s.APPLICATION_URL}/share/domains/${e.domain}/tracks/${e.track}/flow/${e.flow}/embedded`;e.token&&(c+=`?accessToken=${e.token}`),a.setAttribute("src",c),i.appendChild(a)}},42:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LivenessDetectionService=void 0;const s=r(551),o=r(620),n=r(951),i=r(661);t.LivenessDetectionService=class{constructor(e,t){this.frameGetControls={},this.currentStep="front",this.pauseSendingFramesToWebSocket=!1,this.websocketClosedBySDK=!1,this.validationSuccess=!1,this.canSendNextBytes=!0,this.endCalled=!1,this.cancelSendingFramesToWebsocket=void 0,this.successFrames={front:void 0,right:void 0,left:void 0,up:void 0,bottom:void 0},this.options=e,this.abstractWebSocket=t}async onWebSocketMessage(e){var t,r,o,i,a,c,l,u;const d=e.data,p=JSON.parse(d);return(null==p?void 0:p.validation)&&this.currentStep&&(this.successFrames[this.currentStep]=this.lastSentBytes),(null==p?void 0:p.next_step)&&!p.error&&(this.currentStep=p.next_step,await(null===(r=(t=this.options).onNextStep)||void 0===r?void 0:r.call(t,p.next_step)),await(null===(i=(o=this.options)[`on${(0,n.capitalizeFirstLetter)(p.next_step)}Step`])||void 0===i?void 0:i.call(o))),p&&(this.canSendNextBytes=!!(null==p?void 0:p.can_send_next_bytes)),(null==p?void 0:p.success)&&(this.successFrames.bottom=this.lastSentBytes,this.validationSuccess=!0,await(null===(c=(a=this.options).onSuccess)||void 0===c?void 0:c.call(a,{livenessId:p.livenessId,successFrames:this.successFrames})),await this.stopLivenessDetection()),(null==p?void 0:p.error)&&await(null===(u=(l=this.options).onError)||void 0===u?void 0:u.call(l,new s.SDKError({message:"Wrong position",code:s.ELivenessDetectionErrorCodes.WRONG_POSITION,fatal:!1}))),p}async stopLivenessDetection(){var e,t,r,s,o;await(0,n.waitFor)((()=>!!this.cancelSendingFramesToWebsocket)),null===(e=this.cancelSendingFramesToWebsocket)||void 0===e||e.call(this),await(null===(r=(t=this.frameGetControls).stopGettingFrames)||void 0===r?void 0:r.call(t)),this.abstractWebSocket.disconnectFromWebSocket(),this.endCalled||(await(null===(o=(s=this.options).onEnd)||void 0===o?void 0:o.call(s)),this.endCalled=!0),this.websocketClosedBySDK=!0}async sendFramesToWebSocket(){var e,t;try{if(this.canSendNextBytes&&!this.pauseSendingFramesToWebSocket){const r=await(null===(t=(e=this.frameGetControls).getNextFrame)||void 0===t?void 0:t.call(e));r&&(this.abstractWebSocket.send(r),this.lastSentBytes=r,this.canSendNextBytes=!1)}}catch(e){await this.stopLivenessDetection()}}async onConnect(){var e,t,r,s,a,c,l,u,d,p;try{if(this.options.getNextFrame)this.frameGetControls.startGettingFrames=this.options.startGettingFrames,this.frameGetControls.getNextFrame=this.options.getNextFrame,this.frameGetControls.stopGettingFrames=this.options.stopGettingFrames,this.frameGetControls.videoStream=await(null===(t=(e=this.options).startGettingFrames)||void 0===t?void 0:t.call(e));else{const e=await(0,o.getDefaultFrameControls)();this.frameGetControls.startGettingFrames=e.startGettingFrames,this.frameGetControls.getNextFrame=e.getNextFrame,this.frameGetControls.stopGettingFrames=e.stopGettingFrames,this.frameGetControls.videoStream=await(null===(s=(r=this.frameGetControls).startGettingFrames)||void 0===s?void 0:s.call(r))}await(null===(c=(a=this.options).onStart)||void 0===c?void 0:c.call(a,{videoStream:this.getVideoStream()})),await(null===(u=(l=this.options).onNextStep)||void 0===u?void 0:u.call(l,"front")),await(null===(p=(d=this.options).onFrontStep)||void 0===p?void 0:p.call(d)),this.cancelSendingFramesToWebsocket=(0,n.callAsyncFunctionEveryXSeconds)((async()=>{await this.sendFramesToWebSocket()}),i.SEND_FRAMES_INTERVAL_MS)}catch(e){await this.onError()}}async onError(){var e,t;this.validationSuccess||(await(null===(t=(e=this.options).onError)||void 0===t?void 0:t.call(e,new s.SDKError({message:"Internal Error",code:s.EDefaultErrorCodes.INTERNAL_ERROR,fatal:!1}))),await this.stopLivenessDetection())}resumeGettingFrames(){this.pauseSendingFramesToWebSocket=!1}pauseGettingFrames(){this.pauseSendingFramesToWebSocket=!0}getVideoStream(){var e;return null===(e=this.frameGetControls)||void 0===e?void 0:e.videoStream}}},234:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.livenessDetection=void 0;const s=r(42),o=r(551),n=r(706),i=r(616);t.livenessDetection=function(e){var t;try{const r=new n.AbstractWebSocket({WebSocketClass:null!==(t=e.CustomWebSocketClass)&&void 0!==t?t:WebSocket,decodeJwt:i.decodeJwt},e);r.startConnection();const o=new s.LivenessDetectionService(e,r);return r.waitForWebSocketConnection().then((()=>{o.onConnect()})).catch((()=>{o.onError()})),r.addListener("message",(e=>{o.onWebSocketMessage(e)})),r.addListener("error",(()=>{o.onError()})),r.addListener("close",(()=>{o.onError()})),{getVideoStream:()=>o.getVideoStream(),stopLivenessDetection:async()=>{await o.stopLivenessDetection()},resumeGettingFrames:()=>{o.resumeGettingFrames()},pauseGettingFrames:()=>{o.pauseGettingFrames()}}}catch(e){throw new o.SDKError({message:"Error while starting SDK",code:o.EDefaultErrorCodes.INITIALIZATION_ERROR,fatal:!0})}}},171:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UploadIdentificationDocumentService=void 0;const s=r(456),o=r(748),n=r(551),i=r(877),a=r(616);t.UploadIdentificationDocumentService=class{constructor(e,t){this.results={uploadedDocument:null,typification:{status:null,results:null,loading:!1,error:null},liveness:{status:null,results:null,loading:!1,error:null},faceMatch:{status:null,results:null,loading:!1,error:null}},this.options=e,this.internalOptions=t,this.typificationService=new s.ApiTypificationService(e,{FormDataClass:FormData,tryDecodeJwt:a.tryDecodeJwt}),this.faceMatchService=new o.ApiFaceMatchService(e,{FormDataClass:FormData,tryDecodeJwt:a.tryDecodeJwt})}getResults(){return this.results}async updateResults(e){var t,r,s,o,n,i;this.results=Object.assign(Object.assign({},this.results),e),await(null===(r=(t=this.options).onUpdate)||void 0===r?void 0:r.call(t,this.results)),e.faceMatch||this.tryStartFaceMatch(),Object.entries(this.results).every((([e,t])=>"uploadedDocument"===e||!!t.results))&&(await(null===(o=(s=this.options).onSuccess)||void 0===o?void 0:o.call(s,this.results)),await(null===(i=(n=this.options).onEnd)||void 0===i?void 0:i.call(n)))}updateUploadedDocument(e){this.results.uploadedDocument=e}async waitForResults(e){let t=!1;return await new Promise(((r,s)=>{const o=setInterval((async()=>{var n,i,a,c;try{null===(i=(n=this.options).onClearInterval)||void 0===i||i.call(n,o);const l=await this.typificationService.get(e);if("validation"!==(null==l?void 0:l.status)||t){if("error"===(null==l?void 0:l.status))clearInterval(o),s(new Error("Não foi possível processar os resultados do Upload de Documentos"));else if("processed"===(null==l?void 0:l.status)&&l.fileURL){const e=await fetch(l.fileURL),t=await e.json();t&&(clearInterval(o),r(t))}}else await(null===(c=(a=this.options).onValidationRequested)||void 0===c?void 0:c.call(a,{track:this.options.track,requestId:l.id})),t=!0}catch(e){clearInterval(o),s(new Error(e))}}),5e3)}))}async waitForResultsFaceMatch(e){return await new Promise(((t,r)=>{const s=setInterval((async()=>{var o,n,i,a;try{null===(n=(o=this.options).onClearInterval)||void 0===n||n.call(o,s);const c=await this.faceMatchService.get(e);if("error"===(null==c?void 0:c.status)||"error_connector"===(null==c?void 0:c.status))clearInterval(s),r(new Error("Não foi possível processar os resultados do FaceMatch"));else if("processed"===(null==c?void 0:c.status)&&c.fileURL){const e=await fetch(c.fileURL);let r=await e.json();r=Object.assign(Object.assign({},r),{fileImage1:null!==(i=c.fileImage1)&&void 0!==i?i:"",fileImage2:null!==(a=c.fileImage2)&&void 0!==a?a:""}),r&&(clearInterval(s),t(r))}}catch(e){clearInterval(s),r(new Error(e))}}),5e3)}))}async startDocumentUpload(e){var t,r;try{this.updateResults({typification:{status:null,results:null,loading:!0,error:null}}),this.updateUploadedDocument(e);const{requestId:t}=await this.typificationService.predict(e,`sdk-typification-${(0,i.v4)()}`),r=await this.waitForResults(t);this.updateResults({typification:{status:"success",results:r,loading:!1,error:null}})}catch(e){const s=new n.SDKError({message:"Error during document upload/analysis",code:n.EUploadIdentificationDocumentErrorCodes.DOCUMENT_ANALYSIS_ERROR,fatal:!1,details:e});await(null===(r=(t=this.options).onError)||void 0===r?void 0:r.call(t,s)),this.updateResults({typification:{status:"error",results:null,loading:!1,error:s}})}}startLivenessDetection(e){var t,r;const s=Object.assign(Object.assign({},this.options.livenessDetectionOptions),e);this.updateResults({liveness:{results:null,status:null,loading:!0,error:null}});try{return this.internalOptions.livenessDetection(Object.assign(Object.assign({domain:this.options.domain,customId:this.options.customId,customWebSocketUrl:this.options.customWebSocketUrl,token:this.options.token,track:this.options.track},s),{onSuccess:async e=>{var t;await(null===(t=null==s?void 0:s.onSuccess)||void 0===t?void 0:t.call(s,e)),this.updateResults({liveness:{status:"success",results:e,loading:!1,error:null}})},onError:async e=>{var t,r,o;await(null===(t=null==s?void 0:s.onError)||void 0===t?void 0:t.call(s,e)),await(null===(o=(r=this.options).onError)||void 0===o?void 0:o.call(r,e)),this.updateResults({liveness:{status:"error",results:null,loading:"wrong-position"===(null==e?void 0:e.code),error:null!=e?e:null}})}}))}catch(e){const s=new n.SDKError({message:"Error during liveness detection",code:n.EUploadIdentificationDocumentErrorCodes.LIVENESS_DETECTION_ERROR,fatal:!1,details:e});null===(r=(t=this.options).onError)||void 0===r||r.call(t,s),this.updateResults({liveness:{status:"error",results:null,loading:!1,error:s}})}}async startFaceMatch(e,t){var r,s;try{this.updateResults({faceMatch:{status:null,results:null,loading:!0,error:null}});const{requestId:r}=await this.faceMatchService.faceMatch(e,t,`sdk-facematch-${(0,i.v4)()}`),s=await this.waitForResultsFaceMatch(r);this.updateResults({faceMatch:{results:s,status:"success",loading:!1,error:null}})}catch(e){const t=new n.SDKError({message:"Error when comparing the face with the document",code:n.EUploadIdentificationDocumentErrorCodes.FACE_MATCH_ERROR,fatal:!1,details:e});await(null===(s=(r=this.options).onError)||void 0===s?void 0:s.call(r,t)),this.updateResults({faceMatch:{results:null,status:"error",loading:!1,error:t}})}}async tryStartFaceMatch(){var e,t,r;!this.results.uploadedDocument||!(null===(e=this.results.liveness.results)||void 0===e?void 0:e.successFrames.front)||this.results.faceMatch.loading||this.results.liveness.loading||this.results.typification.loading?await(null===(r=(t=this.options).onError)||void 0===r?void 0:r.call(t,new n.SDKError({message:"Unavailable faces",code:n.EUploadIdentificationDocumentErrorCodes.FACE_MATCH_UNAVAILABLE_FACES_ERROR,fatal:!1}))):await this.startFaceMatch(this.results.uploadedDocument,this.results.liveness.results.successFrames.front)}startAll(e,t){this.startDocumentUpload(e),this.startLivenessDetection(t)}}},604:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uploadIdentificationDocument=void 0;const s=r(171),o=r(234);t.uploadIdentificationDocument=function(e){const t=new s.UploadIdentificationDocumentService(e,{livenessDetection:o.livenessDetection});return{startDocumentUpload:async(...e)=>{await t.startDocumentUpload(...e)},startLivenessDetection:(...e)=>t.startLivenessDetection(...e),startFaceComparison:async(...e)=>{await t.tryStartFaceMatch(...e)},startAll:(...e)=>{t.startAll(...e)},getResults:(...e)=>t.getResults(...e)}}},620:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDefaultFrameControls=void 0,t.getDefaultFrameControls=async function(){let e,t,r,s;return{startGettingFrames:async function(o){var n;return e&&t&&r||(e=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:null!==(n=null==o?void 0:o.facingMode)&&void 0!==n?n:"user"}}),t=document.createElement("video"),t.setAttribute("autoplay","true"),t.style.transform="scale(-1, 1)",t.style.position="absolute",t.style.left="-99999px",document.body.appendChild(t),t.srcObject=e,r=document.createElement("canvas"),s=r.getContext("2d")),e},getNextFrame:async function(){if(r&&t)return r.width=t.videoWidth,r.height=t.videoHeight,null==s||s.drawImage(t,0,0,r.width,r.height),await new Promise(((e,t)=>{r?r.toBlob((t=>{e(t)})):e(null)}));throw new Error("Cannot found video element")},stopGettingFrames:function(){t&&(document.body.removeChild(t),t=void 0),r&&(r=void 0),s&&(s=void 0),e&&(null==e||e.getTracks().forEach((e=>{e.stop()})),e=void 0)}}}},616:(e,t)=>{"use strict";function r(e){const t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),r=decodeURIComponent(window.atob(t).split("").map((e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2))).join(""));return JSON.parse(r)}Object.defineProperty(t,"__esModule",{value:!0}),t.tryDecodeJwt=t.decodeJwt=void 0,t.decodeJwt=r,t.tryDecodeJwt=function(e){try{return r(e)}catch(e){return null}}},661:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_RETRY_TIME_STEP=t.DEFAULT_NUMBER_OF_RETRIES=t.SEND_FRAMES_INTERVAL_MS=t.APPLICATION_URL=t.API_GATEWAY_URL=t.WEBSOCKET_BASE_URL=void 0,t.WEBSOCKET_BASE_URL="wss://santoid-liveness-w4ynos5dlq-ue.a.run.app/api/v1/liveness/ws",t.API_GATEWAY_URL="https://api.santoid.com.br",t.APPLICATION_URL="https://app.santoid.com.br",t.SEND_FRAMES_INTERVAL_MS=100,t.DEFAULT_NUMBER_OF_RETRIES=5,t.DEFAULT_RETRY_TIME_STEP=1e3},551:(e,t)=>{"use strict";var r,s,o,n,i,a;Object.defineProperty(t,"__esModule",{value:!0}),t.SDKError=t.EProcessingErrorCodes=t.ECameraErrorCodes=t.EFaceMatchErrorCodes=t.EUploadIdentificationDocumentErrorCodes=t.ELivenessDetectionErrorCodes=t.EDefaultErrorCodes=void 0,function(e){e.INITIALIZATION_ERROR="initialization-error",e.INTERNAL_ERROR="internal-error"}(r||(t.EDefaultErrorCodes=r={})),function(e){e.WRONG_POSITION="liveness-detection/wrong-position"}(s||(t.ELivenessDetectionErrorCodes=s={})),function(e){e.FACE_MATCH_ERROR="upload-identification-document/face-match-error",e.FACE_MATCH_UNAVAILABLE_FACES_ERROR="upload-identification-document/face-match-unavailable-faces-error",e.DOCUMENT_ANALYSIS_ERROR="upload-identification-document/document-analysis-error",e.LIVENESS_DETECTION_ERROR="upload-identification-document/liveness-detection-error"}(o||(t.EUploadIdentificationDocumentErrorCodes=o={})),function(e){e.FIRST_IMAGE_NOT_SELECTED="face-match/first-image-not-selected"}(n||(t.EFaceMatchErrorCodes=n={})),function(e){e.INITIALIZATION_ERROR="camera/initialization-error",e.IS_RUNNING="camera/is-running",e.ALREADY_STARTED="camera/already-started",e.NOT_INITIALIZED="camera/not-initialized",e.CANNOT_CAPTURE_IMAGE="camera/cannot-capture-image",e.SHUTDOWN_ERROR="camera/shutdown-error"}(i||(t.ECameraErrorCodes=i={})),function(e){e.PROCESSING_ERROR="processing/processing-error",e.ALREADY_STARTED="processing/already-started"}(a||(t.EProcessingErrorCodes=a={}));class c extends Error{constructor({message:e,code:t,fatal:r,details:s}){super(e),this.code=t,this.fatal=r,this.details=s}}t.SDKError=c},951:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.retryAsyncFunctionXTimes=t.callAsyncFunctionEveryXSeconds=t.waitFor=t.wait=t.capitalizeFirstLetter=void 0;const s=r(218),o=r(661);async function n(e){await new Promise((t=>{e()?t():setTimeout((()=>{n(e).then(t)}),500)}))}function i(e){var t;return e instanceof s.AxiosError&&(503===(null===(t=e.response)||void 0===t?void 0:t.status)||"Network Error"===e.message)}t.capitalizeFirstLetter=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},t.wait=async e=>{await new Promise((t=>{setTimeout(t,e)}))},t.waitFor=n,t.callAsyncFunctionEveryXSeconds=function e(t,r,s={stop:!1}){const o={timerEnd:!1};return setTimeout((()=>{o.timerEnd=!0}),r),t().then((async()=>{await n((()=>o.timerEnd)),s.stop||e(t,r,s)})),function(){s.stop=!0}},t.retryAsyncFunctionXTimes=async function e(r,s=i,n=o.DEFAULT_NUMBER_OF_RETRIES,a=1e3,c=o.DEFAULT_RETRY_TIME_STEP){try{return await r()}catch(o){if(s(o)&&n>0)return await(0,t.wait)(a),await e(r,s,n-1,a+c,c);throw o}}},706:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractWebSocket=void 0;const s=r(661);t.AbstractWebSocket=class{constructor(e,t){this.classOptions=e,this.sdkOptions=t}startConnection(){var e,t;const r=this.classOptions.decodeJwt(this.sdkOptions.token),o={x_endpoint_api_userinfo:this.sdkOptions.token,domain:null!==(e=this.sdkOptions.domain)&&void 0!==e?e:r.claims.domain,track:this.sdkOptions.track};this.sdkOptions.customId&&(o.customerRequestId=this.sdkOptions.customId),this.sdkOptions.useBillingAccounts&&(o.clientCredentials=!0);const n=Object.entries(o).map((e=>e.join("="))).join("&");this.websocket=new this.classOptions.WebSocketClass(`${null!==(t=this.sdkOptions.customWebSocketUrl)&&void 0!==t?t:s.WEBSOCKET_BASE_URL}?${n}`)}async waitForWebSocketConnection(){if(await new Promise((e=>{const t=setInterval((()=>{[3,1].includes(this.websocket.readyState)&&(clearInterval(t),e())}),5)})),3===this.websocket.readyState)throw new Error("Cannot connect to server")}disconnectFromWebSocket(){var e,t;[2,3].includes(this.websocket.readyState)||null===(t=(e=this.websocket).close)||void 0===t||t.call(e)}get readyState(){return this.websocket.readyState}addListener(e,t){var r,s;this.websocket.on?this.websocket.on(e,t):null===(s=(r=this.websocket).addEventListener)||void 0===s||s.call(r,e,t)}send(e){this.websocket.send(e)}}},877:(e,t,r)=>{var s=r(570),o=r(358),n=o;n.v1=s,n.v4=o,e.exports=n},327:e=>{for(var t=[],r=0;r<256;++r)t[r]=(r+256).toString(16).substr(1);e.exports=function(e,r){var s=r||0,o=t;return[o[e[s++]],o[e[s++]],o[e[s++]],o[e[s++]],"-",o[e[s++]],o[e[s++]],"-",o[e[s++]],o[e[s++]],"-",o[e[s++]],o[e[s++]],"-",o[e[s++]],o[e[s++]],o[e[s++]],o[e[s++]],o[e[s++]],o[e[s++]]].join("")}},217:e=>{var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var r=new Uint8Array(16);e.exports=function(){return t(r),r}}else{var s=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),s[t]=e>>>((3&t)<<3)&255;return s}}},570:(e,t,r)=>{var s,o,n=r(217),i=r(327),a=0,c=0;e.exports=function(e,t,r){var l=t&&r||0,u=t||[],d=(e=e||{}).node||s,p=void 0!==e.clockseq?e.clockseq:o;if(null==d||null==p){var h=n();null==d&&(d=s=[1|h[0],h[1],h[2],h[3],h[4],h[5]]),null==p&&(p=o=16383&(h[6]<<8|h[7]))}var f=void 0!==e.msecs?e.msecs:(new Date).getTime(),m=void 0!==e.nsecs?e.nsecs:c+1,v=f-a+(m-c)/1e4;if(v<0&&void 0===e.clockseq&&(p=p+1&16383),(v<0||f>a)&&void 0===e.nsecs&&(m=0),m>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");a=f,c=m,o=p;var g=(1e4*(268435455&(f+=122192928e5))+m)%4294967296;u[l++]=g>>>24&255,u[l++]=g>>>16&255,u[l++]=g>>>8&255,u[l++]=255&g;var y=f/4294967296*1e4&268435455;u[l++]=y>>>8&255,u[l++]=255&y,u[l++]=y>>>24&15|16,u[l++]=y>>>16&255,u[l++]=p>>>8|128,u[l++]=255&p;for(var E=0;E<6;++E)u[l+E]=d[E];return t||i(u)}},358:(e,t,r)=>{var s=r(217),o=r(327);e.exports=function(e,t,r){var n=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var i=(e=e||{}).random||(e.rng||s)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t)for(var a=0;a<16;++a)t[n+a]=i[a];return t||o(i)}},218:(e,t,r)=>{"use strict";function s(e,t){return function(){return e.apply(t,arguments)}}const{toString:o}=Object.prototype,{getPrototypeOf:n}=Object,i=(a=Object.create(null),e=>{const t=o.call(e);return a[t]||(a[t]=t.slice(8,-1).toLowerCase())});var a;const c=e=>(e=e.toLowerCase(),t=>i(t)===e),l=e=>t=>typeof t===e,{isArray:u}=Array,d=l("undefined"),p=c("ArrayBuffer"),h=l("string"),f=l("function"),m=l("number"),v=e=>null!==e&&"object"==typeof e,g=e=>{if("object"!==i(e))return!1;const t=n(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},y=c("Date"),E=c("File"),w=c("Blob"),S=c("FileList"),b=c("URLSearchParams");function R(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let s,o;if("object"!=typeof e&&(e=[e]),u(e))for(s=0,o=e.length;s<o;s++)t.call(null,e[s],s,e);else{const o=r?Object.getOwnPropertyNames(e):Object.keys(e),n=o.length;let i;for(s=0;s<n;s++)i=o[s],t.call(null,e[i],i,e)}}function O(e,t){t=t.toLowerCase();const r=Object.keys(e);let s,o=r.length;for(;o-- >0;)if(s=r[o],t===s.toLowerCase())return s;return null}const C="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:r.g,A=e=>!d(e)&&e!==C,D=(_="undefined"!=typeof Uint8Array&&n(Uint8Array),e=>_&&e instanceof _);var _;const T=c("HTMLFormElement"),F=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),I=c("RegExp"),N=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),s={};R(r,((r,o)=>{let n;!1!==(n=t(r,o,e))&&(s[o]=n||r)})),Object.defineProperties(e,s)},P="abcdefghijklmnopqrstuvwxyz",L="0123456789",j={DIGIT:L,ALPHA:P,ALPHA_DIGIT:P+P.toUpperCase()+L},U=c("AsyncFunction");var k={isArray:u,isArrayBuffer:p,isBuffer:function(e){return null!==e&&!d(e)&&null!==e.constructor&&!d(e.constructor)&&f(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||f(e.append)&&("formdata"===(t=i(e))||"object"===t&&f(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&p(e.buffer),t},isString:h,isNumber:m,isBoolean:e=>!0===e||!1===e,isObject:v,isPlainObject:g,isUndefined:d,isDate:y,isFile:E,isBlob:w,isRegExp:I,isFunction:f,isStream:e=>v(e)&&f(e.pipe),isURLSearchParams:b,isTypedArray:D,isFileList:S,forEach:R,merge:function e(){const{caseless:t}=A(this)&&this||{},r={},s=(s,o)=>{const n=t&&O(r,o)||o;g(r[n])&&g(s)?r[n]=e(r[n],s):g(s)?r[n]=e({},s):u(s)?r[n]=s.slice():r[n]=s};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&R(arguments[e],s);return r},extend:(e,t,r,{allOwnKeys:o}={})=>(R(t,((t,o)=>{r&&f(t)?e[o]=s(t,r):e[o]=t}),{allOwnKeys:o}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,s)=>{e.prototype=Object.create(t.prototype,s),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,s)=>{let o,i,a;const c={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)a=o[i],s&&!s(a,e,t)||c[a]||(t[a]=e[a],c[a]=!0);e=!1!==r&&n(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:i,kindOfTest:c,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const s=e.indexOf(t,r);return-1!==s&&s===r},toArray:e=>{if(!e)return null;if(u(e))return e;let t=e.length;if(!m(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=r.next())&&!s.done;){const r=s.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const s=[];for(;null!==(r=e.exec(t));)s.push(r);return s},isHTMLForm:T,hasOwnProperty:F,hasOwnProp:F,reduceDescriptors:N,freezeMethods:e=>{N(e,((t,r)=>{if(f(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const s=e[r];f(s)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(e,t)=>{const r={},s=e=>{e.forEach((e=>{r[e]=!0}))};return u(e)?s(e):s(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:O,global:C,isContextDefined:A,ALPHABET:j,generateString:(e=16,t=j.ALPHA_DIGIT)=>{let r="";const{length:s}=t;for(;e--;)r+=t[Math.random()*s|0];return r},isSpecCompliantForm:function(e){return!!(e&&f(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),r=(e,s)=>{if(v(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[s]=e;const o=u(e)?[]:{};return R(e,((e,t)=>{const n=r(e,s+1);!d(n)&&(o[t]=n)})),t[s]=void 0,o}}return e};return r(e,0)},isAsyncFn:U,isThenable:e=>e&&(v(e)||f(e))&&f(e.then)&&f(e.catch)};function x(e,t,r,s,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),s&&(this.request=s),o&&(this.response=o)}k.inherits(x,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:k.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const M=x.prototype,B={};function G(e){return k.isPlainObject(e)||k.isArray(e)}function K(e){return k.endsWith(e,"[]")?e.slice(0,-2):e}function W(e,t,r){return e?e.concat(t).map((function(e,t){return e=K(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{B[e]={value:e}})),Object.defineProperties(x,B),Object.defineProperty(M,"isAxiosError",{value:!0}),x.from=(e,t,r,s,o,n)=>{const i=Object.create(M);return k.toFlatObject(e,i,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),x.call(i,e.message,t,r,s,o),i.cause=e,i.name=e.name,n&&Object.assign(i,n),i};const q=k.toFlatObject(k,{},null,(function(e){return/^is[A-Z]/.test(e)}));function V(e,t,r){if(!k.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const s=(r=k.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!k.isUndefined(t[e])}))).metaTokens,o=r.visitor||l,n=r.dots,i=r.indexes,a=(r.Blob||"undefined"!=typeof Blob&&Blob)&&k.isSpecCompliantForm(t);if(!k.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(k.isDate(e))return e.toISOString();if(!a&&k.isBlob(e))throw new x("Blob is not supported. Use a Buffer instead.");return k.isArrayBuffer(e)||k.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,r,o){let a=e;if(e&&!o&&"object"==typeof e)if(k.endsWith(r,"{}"))r=s?r:r.slice(0,-2),e=JSON.stringify(e);else if(k.isArray(e)&&function(e){return k.isArray(e)&&!e.some(G)}(e)||(k.isFileList(e)||k.endsWith(r,"[]"))&&(a=k.toArray(e)))return r=K(r),a.forEach((function(e,s){!k.isUndefined(e)&&null!==e&&t.append(!0===i?W([r],s,n):null===i?r:r+"[]",c(e))})),!1;return!!G(e)||(t.append(W(o,r,n),c(e)),!1)}const u=[],d=Object.assign(q,{defaultVisitor:l,convertValue:c,isVisitable:G});if(!k.isObject(e))throw new TypeError("data must be an object");return function e(r,s){if(!k.isUndefined(r)){if(-1!==u.indexOf(r))throw Error("Circular reference detected in "+s.join("."));u.push(r),k.forEach(r,(function(r,n){!0===(!(k.isUndefined(r)||null===r)&&o.call(t,r,k.isString(n)?n.trim():n,s,d))&&e(r,s?s.concat(n):[n])})),u.pop()}}(e),t}function z(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function J(e,t){this._pairs=[],e&&V(e,this,t)}const H=J.prototype;function $(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Y(e,t,r){if(!t)return e;const s=r&&r.encode||$,o=r&&r.serialize;let n;if(n=o?o(t,r):k.isURLSearchParams(t)?t.toString():new J(t,r).toString(s),n){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e}H.append=function(e,t){this._pairs.push([e,t])},H.toString=function(e){const t=e?function(t){return e.call(this,t,z)}:z;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var X=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){k.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Z={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Q={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:J,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&"undefined"!=typeof window&&"undefined"!=typeof document})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]};function ee(e){function t(e,r,s,o){let n=e[o++];const i=Number.isFinite(+n),a=o>=e.length;return n=!n&&k.isArray(s)?s.length:n,a?(k.hasOwnProp(s,n)?s[n]=[s[n],r]:s[n]=r,!i):(s[n]&&k.isObject(s[n])||(s[n]=[]),t(e,r,s[n],o)&&k.isArray(s[n])&&(s[n]=function(e){const t={},r=Object.keys(e);let s;const o=r.length;let n;for(s=0;s<o;s++)n=r[s],t[n]=e[n];return t}(s[n])),!i)}if(k.isFormData(e)&&k.isFunction(e.entries)){const r={};return k.forEachEntry(e,((e,s)=>{t(function(e){return k.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),s,r,0)})),r}return null}const te={transitional:Z,adapter:["xhr","http"],transformRequest:[function(e,t){const r=t.getContentType()||"",s=r.indexOf("application/json")>-1,o=k.isObject(e);if(o&&k.isHTMLForm(e)&&(e=new FormData(e)),k.isFormData(e))return s&&s?JSON.stringify(ee(e)):e;if(k.isArrayBuffer(e)||k.isBuffer(e)||k.isStream(e)||k.isFile(e)||k.isBlob(e))return e;if(k.isArrayBufferView(e))return e.buffer;if(k.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let n;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return V(e,new Q.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,s){return Q.isNode&&k.isBuffer(e)?(this.append(t,e.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((n=k.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return V(n?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||s?(t.setContentType("application/json",!1),function(e,t,r){if(k.isString(e))try{return(0,JSON.parse)(e),k.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||te.transitional,r=t&&t.forcedJSONParsing,s="json"===this.responseType;if(e&&k.isString(e)&&(r&&!this.responseType||s)){const r=!(t&&t.silentJSONParsing)&&s;try{return JSON.parse(e)}catch(e){if(r){if("SyntaxError"===e.name)throw x.from(e,x.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Q.classes.FormData,Blob:Q.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};k.forEach(["delete","get","head","post","put","patch"],(e=>{te.headers[e]={}}));var re=te;const se=k.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),oe=Symbol("internals");function ne(e){return e&&String(e).trim().toLowerCase()}function ie(e){return!1===e||null==e?e:k.isArray(e)?e.map(ie):String(e)}function ae(e,t,r,s,o){return k.isFunction(s)?s.call(this,t,r):(o&&(t=r),k.isString(t)?k.isString(s)?-1!==t.indexOf(s):k.isRegExp(s)?s.test(t):void 0:void 0)}class ce{constructor(e){e&&this.set(e)}set(e,t,r){const s=this;function o(e,t,r){const o=ne(t);if(!o)throw new Error("header name must be a non-empty string");const n=k.findKey(s,o);(!n||void 0===s[n]||!0===r||void 0===r&&!1!==s[n])&&(s[n||t]=ie(e))}const n=(e,t)=>k.forEach(e,((e,r)=>o(e,r,t)));return k.isPlainObject(e)||e instanceof this.constructor?n(e,t):k.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?n((e=>{const t={};let r,s,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),r=e.substring(0,o).trim().toLowerCase(),s=e.substring(o+1).trim(),!r||t[r]&&se[r]||("set-cookie"===r?t[r]?t[r].push(s):t[r]=[s]:t[r]=t[r]?t[r]+", "+s:s)})),t})(e),t):null!=e&&o(t,e,r),this}get(e,t){if(e=ne(e)){const r=k.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=r.exec(e);)t[s[1]]=s[2];return t}(e);if(k.isFunction(t))return t.call(this,e,r);if(k.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ne(e)){const r=k.findKey(this,e);return!(!r||void 0===this[r]||t&&!ae(0,this[r],r,t))}return!1}delete(e,t){const r=this;let s=!1;function o(e){if(e=ne(e)){const o=k.findKey(r,e);!o||t&&!ae(0,r[o],o,t)||(delete r[o],s=!0)}}return k.isArray(e)?e.forEach(o):o(e),s}clear(e){const t=Object.keys(this);let r=t.length,s=!1;for(;r--;){const o=t[r];e&&!ae(0,this[o],o,e,!0)||(delete this[o],s=!0)}return s}normalize(e){const t=this,r={};return k.forEach(this,((s,o)=>{const n=k.findKey(r,o);if(n)return t[n]=ie(s),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,r)=>t.toUpperCase()+r))}(o):String(o).trim();i!==o&&delete t[o],t[i]=ie(s),r[i]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return k.forEach(this,((r,s)=>{null!=r&&!1!==r&&(t[s]=e&&k.isArray(r)?r.join(", "):r)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach((e=>r.set(e))),r}static accessor(e){const t=(this[oe]=this[oe]={accessors:{}}).accessors,r=this.prototype;function s(e){const s=ne(e);t[s]||(function(e,t){const r=k.toCamelCase(" "+t);["get","set","has"].forEach((s=>{Object.defineProperty(e,s+r,{value:function(e,r,o){return this[s].call(this,t,e,r,o)},configurable:!0})}))}(r,e),t[s]=!0)}return k.isArray(e)?e.forEach(s):s(e),this}}ce.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),k.reduceDescriptors(ce.prototype,(({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}})),k.freezeMethods(ce);var le=ce;function ue(e,t){const r=this||re,s=t||r,o=le.from(s.headers);let n=s.data;return k.forEach(e,(function(e){n=e.call(r,n,o.normalize(),t?t.status:void 0)})),o.normalize(),n}function de(e){return!(!e||!e.__CANCEL__)}function pe(e,t,r){x.call(this,null==e?"canceled":e,x.ERR_CANCELED,t,r),this.name="CanceledError"}k.inherits(pe,x,{__CANCEL__:!0});var he=Q.isStandardBrowserEnv?{write:function(e,t,r,s,o,n){const i=[];i.push(e+"="+encodeURIComponent(t)),k.isNumber(r)&&i.push("expires="+new Date(r).toGMTString()),k.isString(s)&&i.push("path="+s),k.isString(o)&&i.push("domain="+o),!0===n&&i.push("secure"),document.cookie=i.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function fe(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var me=Q.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function s(r){let s=r;return e&&(t.setAttribute("href",s),s=t.href),t.setAttribute("href",s),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return r=s(window.location.href),function(e){const t=k.isString(e)?s(e):e;return t.protocol===r.protocol&&t.host===r.host}}():function(){return!0};function ve(e,t){let r=0;const s=function(e,t){e=e||10;const r=new Array(e),s=new Array(e);let o,n=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=s[i];o||(o=c),r[n]=a,s[n]=c;let u=i,d=0;for(;u!==n;)d+=r[u++],u%=e;if(n=(n+1)%e,n===i&&(i=(i+1)%e),c-o<t)return;const p=l&&c-l;return p?Math.round(1e3*d/p):void 0}}(50,250);return o=>{const n=o.loaded,i=o.lengthComputable?o.total:void 0,a=n-r,c=s(a);r=n;const l={loaded:n,total:i,progress:i?n/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&n<=i?(i-n)/c:void 0,event:o};l[t?"download":"upload"]=!0,e(l)}}const ge={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,r){let s=e.data;const o=le.from(e.headers).normalize(),n=e.responseType;let i,a;function c(){e.cancelToken&&e.cancelToken.unsubscribe(i),e.signal&&e.signal.removeEventListener("abort",i)}k.isFormData(s)&&(Q.isStandardBrowserEnv||Q.isStandardBrowserWebWorkerEnv?o.setContentType(!1):o.getContentType(/^\s*multipart\/form-data/)?k.isString(a=o.getContentType())&&o.setContentType(a.replace(/^\s*(multipart\/form-data);+/,"$1")):o.setContentType("multipart/form-data"));let l=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",r=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(t+":"+r))}const u=fe(e.baseURL,e.url);function d(){if(!l)return;const s=le.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders());!function(e,t,r){const s=r.config.validateStatus;r.status&&s&&!s(r.status)?t(new x("Request failed with status code "+r.status,[x.ERR_BAD_REQUEST,x.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}((function(e){t(e),c()}),(function(e){r(e),c()}),{data:n&&"text"!==n&&"json"!==n?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:s,config:e,request:l}),l=null}if(l.open(e.method.toUpperCase(),Y(u,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,"onloadend"in l?l.onloadend=d:l.onreadystatechange=function(){l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))&&setTimeout(d)},l.onabort=function(){l&&(r(new x("Request aborted",x.ECONNABORTED,e,l)),l=null)},l.onerror=function(){r(new x("Network Error",x.ERR_NETWORK,e,l)),l=null},l.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const s=e.transitional||Z;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new x(t,s.clarifyTimeoutError?x.ETIMEDOUT:x.ECONNABORTED,e,l)),l=null},Q.isStandardBrowserEnv){const t=(e.withCredentials||me(u))&&e.xsrfCookieName&&he.read(e.xsrfCookieName);t&&o.set(e.xsrfHeaderName,t)}void 0===s&&o.setContentType(null),"setRequestHeader"in l&&k.forEach(o.toJSON(),(function(e,t){l.setRequestHeader(t,e)})),k.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),n&&"json"!==n&&(l.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&l.addEventListener("progress",ve(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",ve(e.onUploadProgress)),(e.cancelToken||e.signal)&&(i=t=>{l&&(r(!t||t.type?new pe(null,e,l):t),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(i),e.signal&&(e.signal.aborted?i():e.signal.addEventListener("abort",i)));const p=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(u);p&&-1===Q.protocols.indexOf(p)?r(new x("Unsupported protocol "+p+":",x.ERR_BAD_REQUEST,e)):l.send(s||null)}))}};k.forEach(ge,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const ye=e=>`- ${e}`,Ee=e=>k.isFunction(e)||null===e||!1===e;var we=e=>{e=k.isArray(e)?e:[e];const{length:t}=e;let r,s;const o={};for(let n=0;n<t;n++){let t;if(r=e[n],s=r,!Ee(r)&&(s=ge[(t=String(r)).toLowerCase()],void 0===s))throw new x(`Unknown adapter '${t}'`);if(s)break;o[t||"#"+n]=s}if(!s){const e=Object.entries(o).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new x("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(ye).join("\n"):" "+ye(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return s};function Se(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new pe(null,e)}function be(e){return Se(e),e.headers=le.from(e.headers),e.data=ue.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),we(e.adapter||re.adapter)(e).then((function(t){return Se(e),t.data=ue.call(e,e.transformResponse,t),t.headers=le.from(t.headers),t}),(function(t){return de(t)||(Se(e),t&&t.response&&(t.response.data=ue.call(e,e.transformResponse,t.response),t.response.headers=le.from(t.response.headers))),Promise.reject(t)}))}const Re=e=>e instanceof le?e.toJSON():e;function Oe(e,t){t=t||{};const r={};function s(e,t,r){return k.isPlainObject(e)&&k.isPlainObject(t)?k.merge.call({caseless:r},e,t):k.isPlainObject(t)?k.merge({},t):k.isArray(t)?t.slice():t}function o(e,t,r){return k.isUndefined(t)?k.isUndefined(e)?void 0:s(void 0,e,r):s(e,t,r)}function n(e,t){if(!k.isUndefined(t))return s(void 0,t)}function i(e,t){return k.isUndefined(t)?k.isUndefined(e)?void 0:s(void 0,e):s(void 0,t)}function a(r,o,n){return n in t?s(r,o):n in e?s(void 0,r):void 0}const c={url:n,method:n,data:n,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(e,t)=>o(Re(e),Re(t),!0)};return k.forEach(Object.keys(Object.assign({},e,t)),(function(s){const n=c[s]||o,i=n(e[s],t[s],s);k.isUndefined(i)&&n!==a||(r[s]=i)})),r}const Ce={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Ce[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const Ae={};Ce.transitional=function(e,t,r){function s(e,t){return"[Axios v1.5.1] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,o,n)=>{if(!1===e)throw new x(s(o," has been removed"+(t?" in "+t:"")),x.ERR_DEPRECATED);return t&&!Ae[o]&&(Ae[o]=!0,console.warn(s(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,o,n)}};var De={assertOptions:function(e,t,r){if("object"!=typeof e)throw new x("options must be an object",x.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let o=s.length;for(;o-- >0;){const n=s[o],i=t[n];if(i){const t=e[n],r=void 0===t||i(t,n,e);if(!0!==r)throw new x("option "+n+" must be "+r,x.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new x("Unknown option "+n,x.ERR_BAD_OPTION)}},validators:Ce};const _e=De.validators;class Te{constructor(e){this.defaults=e,this.interceptors={request:new X,response:new X}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Oe(this.defaults,t);const{transitional:r,paramsSerializer:s,headers:o}=t;void 0!==r&&De.assertOptions(r,{silentJSONParsing:_e.transitional(_e.boolean),forcedJSONParsing:_e.transitional(_e.boolean),clarifyTimeoutError:_e.transitional(_e.boolean)},!1),null!=s&&(k.isFunction(s)?t.paramsSerializer={serialize:s}:De.assertOptions(s,{encode:_e.function,serialize:_e.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let n=o&&k.merge(o.common,o[t.method]);o&&k.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=le.concat(n,o);const i=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.unshift(e.fulfilled,e.rejected))}));const c=[];let l;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let u,d=0;if(!a){const e=[be.bind(this),void 0];for(e.unshift.apply(e,i),e.push.apply(e,c),u=e.length,l=Promise.resolve(t);d<u;)l=l.then(e[d++],e[d++]);return l}u=i.length;let p=t;for(d=0;d<u;){const e=i[d++],t=i[d++];try{p=e(p)}catch(e){t.call(this,e);break}}try{l=be.call(this,p)}catch(e){return Promise.reject(e)}for(d=0,u=c.length;d<u;)l=l.then(c[d++],c[d++]);return l}getUri(e){return Y(fe((e=Oe(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}k.forEach(["delete","get","head","options"],(function(e){Te.prototype[e]=function(t,r){return this.request(Oe(r||{},{method:e,url:t,data:(r||{}).data}))}})),k.forEach(["post","put","patch"],(function(e){function t(t){return function(r,s,o){return this.request(Oe(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:s}))}}Te.prototype[e]=t(),Te.prototype[e+"Form"]=t(!0)}));var Fe=Te;class Ie{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const r=this;this.promise.then((e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null})),this.promise.then=e=>{let t;const s=new Promise((e=>{r.subscribe(e),t=e})).then(e);return s.cancel=function(){r.unsubscribe(t)},s},e((function(e,s,o){r.reason||(r.reason=new pe(e,s,o),t(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new Ie((function(t){e=t})),cancel:e}}}var Ne=Ie;const Pe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Pe).forEach((([e,t])=>{Pe[t]=e}));var Le=Pe;const je=function e(t){const r=new Fe(t),o=s(Fe.prototype.request,r);return k.extend(o,Fe.prototype,r,{allOwnKeys:!0}),k.extend(o,r,null,{allOwnKeys:!0}),o.create=function(r){return e(Oe(t,r))},o}(re);je.Axios=Fe,je.CanceledError=pe,je.CancelToken=Ne,je.isCancel=de,je.VERSION="1.5.1",je.toFormData=V,je.AxiosError=x,je.Cancel=je.CanceledError,je.all=function(e){return Promise.all(e)},je.spread=function(e){return function(t){return e.apply(null,t)}},je.isAxiosError=function(e){return k.isObject(e)&&!0===e.isAxiosError},je.mergeConfig=Oe,je.AxiosHeaders=le,je.formToJSON=e=>ee(k.isHTMLForm(e)?new FormData(e):e),je.getAdapter=we,je.HttpStatusCode=Le,je.default=je,e.exports=je}},t={};function r(s){var o=t[s];if(void 0!==o)return o.exports;var n=t[s]={exports:{}};return e[s].call(n.exports,n,n.exports,r),n.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();var s={};return(()=>{"use strict";var e=s;const t=r(234),o=r(604),n=r(122),i=r(344),a=r(927),c=r(168);class l{}l.livenessDetection=t.livenessDetection,l.uploadIdentificationDocument=o.uploadIdentificationDocument,l.insertUploadIdentificationDocument=n.insertUploadIdentificationDocument,l.typification=i.typification,l.ocr=c.ocr,l.faceMatch=a.faceMatch,e.default=l})(),s.default})()));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("SantoiDSDK",[],t):"object"==typeof exports?exports.SantoiDSDK=t():e.SantoiDSDK=t()}(this,(()=>(()=>{var e={373:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractService=void 0;const o=r(s(218)),n=s(661);t.AbstractService=class{constructor(e,t){this.options=e,this.serviceOptions=t}request(e){var t,s,{contentType:r="application/json",authToken:i=this.options.token,baseUrl:a=(null!==(t=this.options.customApiUrl)&&void 0!==t?t:n.API_GATEWAY_URL),extraHeaders:c}=void 0===e?{}:e;const l={baseURL:a,headers:Object.assign({"Content-Type":r,Authorization:`Bearer ${i}`},c)};let u=this.options.domain;if(!this.options.domain&&this.options.token){const e=this.serviceOptions.tryDecodeJwt(this.options.token);u=null===(s=null==e?void 0:e.claims)||void 0===s?void 0:s.domain}return l.headers&&(u&&(l.headers.Domain=u),this.options.useBillingAccounts&&(l.headers.clientCredentials=!0)),o.default.create(l)}}},151:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ApiAsyncService=void 0;const r=s(373);class o extends r.AbstractService{constructor(e,...t){super(...t),this.resultsRoute=e.resultsRoute}async get(e){return(await this.request().get(`/api/v1/tracks/${this.options.track}/${this.resultsRoute}/`+e)).data}}t.ApiAsyncService=o},748:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ApiFaceMatchService=void 0;const r=s(151),o=s(951);class n extends r.ApiAsyncService{constructor(...e){super({resultsRoute:"face-async"},...e)}async faceMatch(e,t,s){return await(0,o.retryAsyncFunctionXTimes)((async()=>{const r=new this.serviceOptions.FormDataClass;return r.append("track",this.options.track),r.append("deliveryFront","true"),r.append("sensitive_data_compliance","true"),r.append("imageFile1",e,"imageFile1.jpg"),t&&r.append("imageFile2",t,"imageFile2.jpg"),s&&r.append("customerRequestId",s),(await this.request({contentType:"multipart/form-data"}).post("/api/v1/face-match-async",r)).data}))}async get(...e){return await super.get(...e)}}t.ApiFaceMatchService=n},275:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ApiLivenessSessionService=void 0;const r=s(373),o=s(661);class n extends r.AbstractService{get baseLivenessUrl(){var e;return null!==(e=this.options.customApiUrl)&&void 0!==e?e:o.LIVENESS_API_URL}livenessRequest(){var e;return this.request({baseUrl:this.baseLivenessUrl,extraHeaders:{"x-endpoint-api-userinfo":null!==(e=this.options.token)&&void 0!==e?e:""}})}async createSession(e){return(await this.livenessRequest().post("/api/v2/liveness/session",{track:this.options.track,customerRequestId:e})).data}async getSessionResults(e){return(await this.livenessRequest().get(`/api/v2/liveness/session/${e}`,{params:this.options.track?{track:this.options.track}:void 0})).data}}t.ApiLivenessSessionService=n},926:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ApiOcrService=void 0;const r=s(151),o=s(951);class n extends r.ApiAsyncService{constructor(...e){super({resultsRoute:"ocr-async"},...e)}async extract(e,t){return await(0,o.retryAsyncFunctionXTimes)((async()=>{const s=new this.serviceOptions.FormDataClass;return s.append("imageFile",e,"imageFile.jpg"),s.append("track",this.options.track),s.append("template",this.options.template),s.append("customerRequestId",t),s.append("deliveryFront","true"),(await this.request({contentType:"multipart/form-data"}).post("/api/v1/ocr-async/ocr",s)).data}))}}t.ApiOcrService=n},456:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ApiTypificationService=void 0;const r=s(151),o=s(951);class n extends r.ApiAsyncService{constructor(...e){super({resultsRoute:"typification-async"},...e)}async predict(e,t){return await(0,o.retryAsyncFunctionXTimes)((async()=>{const s=new this.serviceOptions.FormDataClass;return s.append("imageFile",e,"imageFile.jpg"),s.append("track",this.options.track),s.append("customerRequestId",t),s.append("deliveryFront","true"),(await this.request({contentType:"multipart/form-data"}).post("/api/v1/typification-async/predict",s)).data}))}}t.ApiTypificationService=n},135:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseCoreService=void 0;const r=s(551),o=s(620);t.BaseCoreService=class{constructor(e){this.results={status:null,results:null,loading:!1,error:null},this.cameraIsActive=!1,this.cameraIsSetup=!1,this.options=e}async initialize(e){var t;e?this.startProcessing(e):(null!==(t=this.options.startTheCameraImmediately)&&void 0!==t?t:void 0===this.options.startTheCameraImmediately)&&await this.startCamera()}async updateResults(e){var t,s;this.results=Object.assign(Object.assign({},this.results),e),await(null===(s=(t=this.options).onUpdate)||void 0===s?void 0:s.call(t,this.results))}getVideoStream(){var e;return null===(e=this.frameGetControls)||void 0===e?void 0:e.videoStream}async setupCamera(){this.frameGetControls=await(0,o.getDefaultFrameControls)(),this.cameraIsSetup=!0}async startCamera(e){var t,s,o,n,i,a;try{if(this.cameraIsActive)throw new r.SDKError({message:"The camera has already been initialized",code:r.ECameraErrorCodes.ALREADY_STARTED,fatal:!1});if(this.results.loading)throw new r.SDKError({message:"Typification processing has already started",code:r.EProcessingErrorCodes.ALREADY_STARTED,fatal:!1});this.cameraIsSetup||await this.setupCamera(),this.frameGetControls.videoStream=await(null===(s=(t=this.frameGetControls).startGettingFrames)||void 0===s?void 0:s.call(t,e)),await(null===(n=(o=this.options).onCameraStart)||void 0===n?void 0:n.call(o,{videoStream:this.getVideoStream()})),this.cameraIsActive=!0}catch(e){const t=e instanceof r.SDKError?e:new r.SDKError({message:"Camera initialization error",code:r.ECameraErrorCodes.INITIALIZATION_ERROR,fatal:!1,details:e});await(null===(a=(i=this.options).onError)||void 0===a?void 0:a.call(i,t))}}async stopCamera(){var e,t,s,o,n,i;try{if(!this.cameraIsActive)throw new r.SDKError({message:"Camera not initialized",code:r.ECameraErrorCodes.NOT_INITIALIZED,fatal:!1});await(null===(t=(e=this.frameGetControls).stopGettingFrames)||void 0===t?void 0:t.call(e)),await(null===(o=(s=this.options).onCameraStop)||void 0===o?void 0:o.call(s)),this.cameraIsActive=!1}catch(e){const t=e instanceof r.SDKError?e:new r.SDKError({message:"Error during camera shutdown",code:r.ECameraErrorCodes.SHUTDOWN_ERROR,fatal:!1,details:e});await(null===(i=(n=this.options).onError)||void 0===i?void 0:i.call(n,t))}}async captureImage({startProcessing:e=!0}={}){var t,s;const o=await(null===(s=(t=this.frameGetControls).getNextFrame)||void 0===s?void 0:s.call(t));if(o)return e&&(await this.stopCamera(),await this.startProcessing(o)),o;throw new r.SDKError({message:"Cannot capture image",code:r.ECameraErrorCodes.CANNOT_CAPTURE_IMAGE,fatal:!1})}async waitForResults(e){let t=!1;return await new Promise(((s,r)=>{const o=setInterval((async()=>{var n,i,a,c;try{null===(i=(n=this.options).onClearInterval)||void 0===i||i.call(n,o);const r=await this.service.get(e);if("validation"===(null==r?void 0:r.status)&&!t)return await(null===(c=(a=this.options).onValidationRequested)||void 0===c?void 0:c.call(a,{track:this.options.track,requestId:r.id})),void(t=!0);if("error"===(null==r?void 0:r.status))throw new Error("Não foi possível processar os resultados do Upload de Documentos");if("processed"===(null==r?void 0:r.status)&&r.fileURL){const e=await fetch(r.fileURL),t=await e.json();t&&(clearInterval(o),s(t))}}catch(e){clearInterval(o),r(e)}}),5e3)}))}}},474:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FaceMatchService=void 0;const r=s(877),o=s(551),n=s(616),i=s(748),a=s(135);class c extends a.BaseCoreService{constructor(e){super(e),this.selectedFile1=void 0,this.selectedFile2=void 0,this.service=new i.ApiFaceMatchService(e,{FormDataClass:FormData,tryDecodeJwt:n.tryDecodeJwt})}async initialize(e,t){var s;e?this.startProcessing(e,t):(null!==(s=this.options.startTheCameraImmediately)&&void 0!==s?s:void 0===this.options.startTheCameraImmediately)&&await this.startCamera()}async captureFirstImage({startProcessing:e=!0}={}){const t=await super.captureImage({startProcessing:!1});return this.selectedFile1=t,e&&(await this.stopCamera(),await this.startProcessing(this.selectedFile1)),t}async captureSecondImage({startProcessing:e=!0}={}){if(!this.selectedFile1)throw new o.SDKError({message:"Select the first image before selecting the second",code:o.EFaceMatchErrorCodes.FIRST_IMAGE_NOT_SELECTED,fatal:!1});const t=await super.captureImage({startProcessing:!1});return this.selectedFile2=t,e&&(await this.stopCamera(),await this.startProcessing(this.selectedFile1,this.selectedFile2)),t}async startProcessing(e,t){var s,n,i,a,c,l,u;try{if(this.cameraIsActive)throw new o.SDKError({message:"Cannot start because the camera is running",code:o.ECameraErrorCodes.IS_RUNNING,fatal:!1});if(null===(s=this.results)||void 0===s?void 0:s.loading)throw new o.SDKError({message:"Processing has already started",code:o.EProcessingErrorCodes.ALREADY_STARTED,fatal:!1});this.updateResults({status:null,results:null,loading:!0,error:null});const{requestId:l}=await this.service.faceMatch(e,t,`sdk-ocr-${(0,r.v4)()}`),u=await this.waitForResultsFaceMatch(l);this.updateResults({status:"success",results:u,loading:!1,error:null}),null===(i=(n=this.options).onSuccess)||void 0===i||i.call(n,u),null===(c=(a=this.options).onEnd)||void 0===c||c.call(a)}catch(e){const t=e instanceof o.SDKError?e:new o.SDKError({message:"Error during document upload/analysis",code:o.EProcessingErrorCodes.PROCESSING_ERROR,fatal:!1,details:e});await(null===(u=(l=this.options).onError)||void 0===u?void 0:u.call(l,t)),this.updateResults({status:"error",results:null,loading:!1,error:t})}}async waitForResultsFaceMatch(e){return await new Promise(((t,s)=>{const r=setInterval((async()=>{var o,n,i,a;try{null===(n=(o=this.options).onClearInterval)||void 0===n||n.call(o,r);const s=await this.service.get(e);if("error"===(null==s?void 0:s.status)||"error_connector"===(null==s?void 0:s.status))throw new Error("Não foi possível processar os resultados do FaceMatch");if("processed"===(null==s?void 0:s.status)&&s.fileURL){const e=await fetch(s.fileURL);let o=await e.json();o=Object.assign(Object.assign({},o),{fileImage1:null!==(i=s.fileImage1)&&void 0!==i?i:"",fileImage2:null!==(a=s.fileImage2)&&void 0!==a?a:""}),o&&(clearInterval(r),t(o))}}catch(e){clearInterval(r),s(new Error(e))}}),5e3)}))}}t.FaceMatchService=c},927:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.faceMatch=void 0;const r=s(551),o=s(474);t.faceMatch=async function(e,t,s){var n,i;try{const r=new o.FaceMatchService(e);return await r.initialize(t,s),await(null===(i=(n=r.options).onStart)||void 0===i?void 0:i.call(n,{videoStream:r.getVideoStream()})),{startCamera:async(...e)=>{await r.startCamera(...e)},stopCamera:async()=>{await r.stopCamera()},captureFirstImage:async(...e)=>await r.captureFirstImage(...e),captureSecondImage:async(...e)=>await r.captureSecondImage(...e),getVideoStream:()=>r.getVideoStream(),sendFiles:async(...e)=>{await r.startProcessing(...e)}}}catch(e){throw new r.SDKError({message:"Error while starting SDK",code:r.EDefaultErrorCodes.INITIALIZATION_ERROR,fatal:!0,details:e})}}},577:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OcrService=void 0;const r=s(877),o=s(551),n=s(616),i=s(926),a=s(135);class c extends a.BaseCoreService{constructor(e){super(e),this.service=new i.ApiOcrService(e,{FormDataClass:FormData,tryDecodeJwt:n.tryDecodeJwt})}async startProcessing(e){var t,s,n,i,a,c,l;try{if(this.cameraIsActive)throw new o.SDKError({message:"Cannot start because the camera is running",code:o.ECameraErrorCodes.IS_RUNNING,fatal:!1});if(null===(t=this.results)||void 0===t?void 0:t.loading)throw new o.SDKError({message:"Processing has already started",code:o.EProcessingErrorCodes.ALREADY_STARTED,fatal:!1});this.updateResults({status:null,results:null,loading:!0,error:null});const{requestId:c}=await this.service.extract(e,`sdk-ocr-${(0,r.v4)()}`),l=await this.waitForResults(c);this.updateResults({status:"success",results:l,loading:!1,error:null}),null===(n=(s=this.options).onSuccess)||void 0===n||n.call(s,l),null===(a=(i=this.options).onEnd)||void 0===a||a.call(i)}catch(e){const t=e instanceof o.SDKError?e:new o.SDKError({message:"Error during document upload/analysis",code:o.EProcessingErrorCodes.PROCESSING_ERROR,fatal:!1,details:e});await(null===(l=(c=this.options).onError)||void 0===l?void 0:l.call(c,t)),this.updateResults({status:"error",results:null,loading:!1,error:t})}}}t.OcrService=c},168:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ocr=void 0;const r=s(551),o=s(577);t.ocr=async function(e,t){var s,n;try{const r=new o.OcrService(e);return await r.initialize(t),await(null===(n=(s=r.options).onStart)||void 0===n?void 0:n.call(s,{videoStream:r.getVideoStream()})),{startCamera:async(...e)=>{await r.startCamera(...e)},stopCamera:async()=>{await r.stopCamera()},captureImage:async()=>await r.captureImage(),getVideoStream:()=>r.getVideoStream(),sendFile:async e=>{await r.startProcessing(e)}}}catch(e){throw new r.SDKError({message:"Error while starting SDK",code:r.EDefaultErrorCodes.INITIALIZATION_ERROR,fatal:!0,details:e})}}},983:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypificationService=void 0;const r=s(877),o=s(551),n=s(616),i=s(456),a=s(135);class c extends a.BaseCoreService{constructor(e){super(e),this.service=new i.ApiTypificationService(e,{FormDataClass:FormData,tryDecodeJwt:n.tryDecodeJwt})}async startProcessing(e){var t,s,n,i,a,c,l;try{if(this.cameraIsActive)throw new o.SDKError({message:"Cannot start because the camera is running",code:o.ECameraErrorCodes.IS_RUNNING,fatal:!1});if(null===(t=this.results)||void 0===t?void 0:t.loading)throw new o.SDKError({message:"Processing has already started",code:o.EProcessingErrorCodes.ALREADY_STARTED,fatal:!1});this.updateResults({status:null,results:null,loading:!0,error:null});const{requestId:c}=await this.service.predict(e,`sdk-typification-${(0,r.v4)()}`),l=await this.waitForResults(c);this.updateResults({status:"success",results:l,loading:!1,error:null}),null===(n=(s=this.options).onSuccess)||void 0===n||n.call(s,l),null===(a=(i=this.options).onEnd)||void 0===a||a.call(i)}catch(e){const t=e instanceof o.SDKError?e:new o.SDKError({message:"Error during document upload/analysis",code:o.EProcessingErrorCodes.PROCESSING_ERROR,fatal:!1,details:e});await(null===(l=(c=this.options).onError)||void 0===l?void 0:l.call(c,t)),this.updateResults({status:"error",results:null,loading:!1,error:t})}}}t.TypificationService=c},344:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.typification=void 0;const r=s(551),o=s(983);t.typification=async function(e,t){var s,n;try{const r=new o.TypificationService(e);return await r.initialize(t),await(null===(n=(s=r.options).onStart)||void 0===n?void 0:n.call(s,{videoStream:r.getVideoStream()})),{startCamera:async(...e)=>{await r.startCamera(...e)},stopCamera:async()=>{await r.stopCamera()},captureImage:async()=>await r.captureImage(),getVideoStream:()=>r.getVideoStream(),sendFile:async e=>{await r.startProcessing(e)}}}catch(e){throw new r.SDKError({message:"Error while starting SDK",code:r.EDefaultErrorCodes.INITIALIZATION_ERROR,fatal:!0,details:e})}}},122:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.insertUploadIdentificationDocument=void 0;const r=s(661);t.insertUploadIdentificationDocument=function(e,t){var s,o,n;const i=t?document.querySelector(t):document.body;if(!i)throw new Error("Cannot find target element");const a=document.createElement("iframe");a.style.overflow="hidden",a.style.border="0",a.setAttribute("width",null!==(s=e.width)&&void 0!==s?s:"100%"),a.setAttribute("height",null!==(o=e.height)&&void 0!==o?o:"550px"),a.setAttribute("scrolling","no"),a.setAttribute("allow","camera; microphone; clipboard-read; clipboard-write");let c=`${null!==(n=e.customAppUrl)&&void 0!==n?n:r.APPLICATION_URL}/share/domains/${e.domain}/tracks/${e.track}/flow/${e.flow}/embedded`;e.token&&(c+=`?accessToken=${e.token}`),a.setAttribute("src",c),i.appendChild(a)}},42:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LivenessDetectionService=void 0;const r=s(551),o=s(620),n=s(951),i=s(661);t.LivenessDetectionService=class{constructor(e,t){this.frameGetControls={},this.currentStep="front",this.pauseSendingFramesToWebSocket=!1,this.websocketClosedBySDK=!1,this.validationSuccess=!1,this.canSendNextBytes=!0,this.endCalled=!1,this.cancelSendingFramesToWebsocket=void 0,this.successFrames={front:void 0,right:void 0,left:void 0,up:void 0,bottom:void 0},this.options=e,this.abstractWebSocket=t}async onWebSocketMessage(e){var t,s,o,i,a,c,l,u;const d=e.data,p=JSON.parse(d);return(null==p?void 0:p.validation)&&this.currentStep&&(this.successFrames[this.currentStep]=this.lastSentBytes),(null==p?void 0:p.next_step)&&!p.error&&(this.currentStep=p.next_step,await(null===(s=(t=this.options).onNextStep)||void 0===s?void 0:s.call(t,p.next_step)),await(null===(i=(o=this.options)[`on${(0,n.capitalizeFirstLetter)(p.next_step)}Step`])||void 0===i?void 0:i.call(o))),p&&(this.canSendNextBytes=!!(null==p?void 0:p.can_send_next_bytes)),(null==p?void 0:p.success)&&(this.successFrames.bottom=this.lastSentBytes,this.validationSuccess=!0,await(null===(c=(a=this.options).onSuccess)||void 0===c?void 0:c.call(a,{livenessId:p.livenessId,successFrames:this.successFrames})),await this.stopLivenessDetection()),(null==p?void 0:p.error)&&await(null===(u=(l=this.options).onError)||void 0===u?void 0:u.call(l,new r.SDKError({message:"Wrong position",code:r.ELivenessDetectionErrorCodes.WRONG_POSITION,fatal:!1}))),p}async stopLivenessDetection(){var e,t,s,r,o;await(0,n.waitFor)((()=>!!this.cancelSendingFramesToWebsocket)),null===(e=this.cancelSendingFramesToWebsocket)||void 0===e||e.call(this),await(null===(s=(t=this.frameGetControls).stopGettingFrames)||void 0===s?void 0:s.call(t)),this.abstractWebSocket.disconnectFromWebSocket(),this.endCalled||(await(null===(o=(r=this.options).onEnd)||void 0===o?void 0:o.call(r)),this.endCalled=!0),this.websocketClosedBySDK=!0}async sendFramesToWebSocket(){var e,t;try{if(this.canSendNextBytes&&!this.pauseSendingFramesToWebSocket){const s=await(null===(t=(e=this.frameGetControls).getNextFrame)||void 0===t?void 0:t.call(e));s&&(this.abstractWebSocket.send(s),this.lastSentBytes=s,this.canSendNextBytes=!1)}}catch(e){await this.stopLivenessDetection()}}async onConnect(){var e,t,s,r,a,c,l,u,d,p;try{if(this.options.getNextFrame)this.frameGetControls.startGettingFrames=this.options.startGettingFrames,this.frameGetControls.getNextFrame=this.options.getNextFrame,this.frameGetControls.stopGettingFrames=this.options.stopGettingFrames,this.frameGetControls.videoStream=await(null===(t=(e=this.options).startGettingFrames)||void 0===t?void 0:t.call(e));else{const e=await(0,o.getDefaultFrameControls)();this.frameGetControls.startGettingFrames=e.startGettingFrames,this.frameGetControls.getNextFrame=e.getNextFrame,this.frameGetControls.stopGettingFrames=e.stopGettingFrames,this.frameGetControls.videoStream=await(null===(r=(s=this.frameGetControls).startGettingFrames)||void 0===r?void 0:r.call(s))}await(null===(c=(a=this.options).onStart)||void 0===c?void 0:c.call(a,{videoStream:this.getVideoStream()})),await(null===(u=(l=this.options).onNextStep)||void 0===u?void 0:u.call(l,"front")),await(null===(p=(d=this.options).onFrontStep)||void 0===p?void 0:p.call(d)),this.cancelSendingFramesToWebsocket=(0,n.callAsyncFunctionEveryXSeconds)((async()=>{await this.sendFramesToWebSocket()}),i.SEND_FRAMES_INTERVAL_MS)}catch(e){await this.onError()}}async onError(){var e,t;this.validationSuccess||(await(null===(t=(e=this.options).onError)||void 0===t?void 0:t.call(e,new r.SDKError({message:"Internal Error",code:r.EDefaultErrorCodes.INTERNAL_ERROR,fatal:!1}))),await this.stopLivenessDetection())}resumeGettingFrames(){this.pauseSendingFramesToWebSocket=!1}pauseGettingFrames(){this.pauseSendingFramesToWebSocket=!0}getVideoStream(){var e;return null===(e=this.frameGetControls)||void 0===e?void 0:e.videoStream}}},234:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.livenessDetection=void 0;const r=s(42),o=s(551),n=s(706),i=s(616);t.livenessDetection=function(e){var t;try{const s=new n.AbstractWebSocket({WebSocketClass:null!==(t=e.CustomWebSocketClass)&&void 0!==t?t:WebSocket,decodeJwt:i.decodeJwt},e);s.startConnection();const o=new r.LivenessDetectionService(e,s);return s.waitForWebSocketConnection().then((()=>{o.onConnect()})).catch((()=>{o.onError()})),s.addListener("message",(e=>{o.onWebSocketMessage(e)})),s.addListener("error",(()=>{o.onError()})),s.addListener("close",(()=>{o.onError()})),{getVideoStream:()=>o.getVideoStream(),stopLivenessDetection:async()=>{await o.stopLivenessDetection()},resumeGettingFrames:()=>{o.resumeGettingFrames()},pauseGettingFrames:()=>{o.pauseGettingFrames()}}}catch(e){throw new o.SDKError({message:"Error while starting SDK",code:o.EDefaultErrorCodes.INITIALIZATION_ERROR,fatal:!0})}}},460:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LivenessSessionService=void 0;const r=s(275),o=s(551),n=s(951),i=s(661),a=s(616);t.LivenessSessionService=class{constructor(e){this.sessionId=null,this.options=e,this.service=new r.ApiLivenessSessionService(e,{FormDataClass:FormData,tryDecodeJwt:a.tryDecodeJwt})}async createSession(){var e,t;try{const s=await this.service.createSession(this.options.customerRequestId);return this.sessionId=s.SessionId,await(null===(t=(e=this.options).onSessionCreated)||void 0===t?void 0:t.call(e,s.SessionId)),s.SessionId}catch(e){throw await this.fail("Error while creating liveness session",e)}}async getResults(e=this.sessionId){var t,s;if(!e)throw await this.fail("There is no liveness session to fetch results from");try{let r=null;for(let t=0;t<i.LIVENESS_RESULT_MAX_ATTEMPTS&&(r=await this.service.getSessionResults(e),i.LIVENESS_PENDING_STATUSES.includes(r.Status));t++)await(0,n.wait)(i.LIVENESS_RESULT_RETRY_DELAY_MS);return await(null===(s=(t=this.options).onResults)||void 0===s?void 0:s.call(t,r)),r}catch(e){throw await this.fail("Error while fetching liveness session results",e)}}async fail(e,t){var s,r;const n=new o.SDKError({message:e,code:o.EDefaultErrorCodes.INITIALIZATION_ERROR,fatal:!0,details:t});return await(null===(r=(s=this.options).onError)||void 0===r?void 0:r.call(s,n)),n}}},923:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.livenessSession=void 0;const r=s(460),o=s(551);t.livenessSession=function(e){try{const t=new r.LivenessSessionService(e);return{createSession:async()=>await t.createSession(),getResults:async(...e)=>await t.getResults(...e),getSessionId:()=>t.sessionId}}catch(e){throw new o.SDKError({message:"Error while starting SDK",code:o.EDefaultErrorCodes.INITIALIZATION_ERROR,fatal:!0,details:e})}}},171:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UploadIdentificationDocumentService=void 0;const r=s(456),o=s(748),n=s(551),i=s(877),a=s(616);t.UploadIdentificationDocumentService=class{constructor(e,t){this.results={uploadedDocument:null,typification:{status:null,results:null,loading:!1,error:null},liveness:{status:null,results:null,loading:!1,error:null},faceMatch:{status:null,results:null,loading:!1,error:null}},this.options=e,this.internalOptions=t,this.typificationService=new r.ApiTypificationService(e,{FormDataClass:FormData,tryDecodeJwt:a.tryDecodeJwt}),this.faceMatchService=new o.ApiFaceMatchService(e,{FormDataClass:FormData,tryDecodeJwt:a.tryDecodeJwt})}getResults(){return this.results}async updateResults(e){var t,s,r,o,n,i;this.results=Object.assign(Object.assign({},this.results),e),await(null===(s=(t=this.options).onUpdate)||void 0===s?void 0:s.call(t,this.results)),e.faceMatch||this.tryStartFaceMatch(),Object.entries(this.results).every((([e,t])=>"uploadedDocument"===e||!!t.results))&&(await(null===(o=(r=this.options).onSuccess)||void 0===o?void 0:o.call(r,this.results)),await(null===(i=(n=this.options).onEnd)||void 0===i?void 0:i.call(n)))}updateUploadedDocument(e){this.results.uploadedDocument=e}async waitForResults(e){let t=!1;return await new Promise(((s,r)=>{const o=setInterval((async()=>{var n,i,a,c;try{null===(i=(n=this.options).onClearInterval)||void 0===i||i.call(n,o);const l=await this.typificationService.get(e);if("validation"!==(null==l?void 0:l.status)||t){if("error"===(null==l?void 0:l.status))clearInterval(o),r(new Error("Não foi possível processar os resultados do Upload de Documentos"));else if("processed"===(null==l?void 0:l.status)&&l.fileURL){const e=await fetch(l.fileURL),t=await e.json();t&&(clearInterval(o),s(t))}}else await(null===(c=(a=this.options).onValidationRequested)||void 0===c?void 0:c.call(a,{track:this.options.track,requestId:l.id})),t=!0}catch(e){clearInterval(o),r(new Error(e))}}),5e3)}))}async waitForResultsFaceMatch(e){return await new Promise(((t,s)=>{const r=setInterval((async()=>{var o,n,i,a;try{null===(n=(o=this.options).onClearInterval)||void 0===n||n.call(o,r);const c=await this.faceMatchService.get(e);if("error"===(null==c?void 0:c.status)||"error_connector"===(null==c?void 0:c.status))clearInterval(r),s(new Error("Não foi possível processar os resultados do FaceMatch"));else if("processed"===(null==c?void 0:c.status)&&c.fileURL){const e=await fetch(c.fileURL);let s=await e.json();s=Object.assign(Object.assign({},s),{fileImage1:null!==(i=c.fileImage1)&&void 0!==i?i:"",fileImage2:null!==(a=c.fileImage2)&&void 0!==a?a:""}),s&&(clearInterval(r),t(s))}}catch(e){clearInterval(r),s(new Error(e))}}),5e3)}))}async startDocumentUpload(e){var t,s;try{this.updateResults({typification:{status:null,results:null,loading:!0,error:null}}),this.updateUploadedDocument(e);const{requestId:t}=await this.typificationService.predict(e,`sdk-typification-${(0,i.v4)()}`),s=await this.waitForResults(t);this.updateResults({typification:{status:"success",results:s,loading:!1,error:null}})}catch(e){const r=new n.SDKError({message:"Error during document upload/analysis",code:n.EUploadIdentificationDocumentErrorCodes.DOCUMENT_ANALYSIS_ERROR,fatal:!1,details:e});await(null===(s=(t=this.options).onError)||void 0===s?void 0:s.call(t,r)),this.updateResults({typification:{status:"error",results:null,loading:!1,error:r}})}}startLivenessDetection(e){var t,s;const r=Object.assign(Object.assign({},this.options.livenessDetectionOptions),e);this.updateResults({liveness:{results:null,status:null,loading:!0,error:null}});try{return this.internalOptions.livenessDetection(Object.assign(Object.assign({domain:this.options.domain,customId:this.options.customId,customWebSocketUrl:this.options.customWebSocketUrl,token:this.options.token,track:this.options.track},r),{onSuccess:async e=>{var t;await(null===(t=null==r?void 0:r.onSuccess)||void 0===t?void 0:t.call(r,e)),this.updateResults({liveness:{status:"success",results:e,loading:!1,error:null}})},onError:async e=>{var t,s,o;await(null===(t=null==r?void 0:r.onError)||void 0===t?void 0:t.call(r,e)),await(null===(o=(s=this.options).onError)||void 0===o?void 0:o.call(s,e)),this.updateResults({liveness:{status:"error",results:null,loading:"wrong-position"===(null==e?void 0:e.code),error:null!=e?e:null}})}}))}catch(e){const r=new n.SDKError({message:"Error during liveness detection",code:n.EUploadIdentificationDocumentErrorCodes.LIVENESS_DETECTION_ERROR,fatal:!1,details:e});null===(s=(t=this.options).onError)||void 0===s||s.call(t,r),this.updateResults({liveness:{status:"error",results:null,loading:!1,error:r}})}}async startFaceMatch(e,t){var s,r;try{this.updateResults({faceMatch:{status:null,results:null,loading:!0,error:null}});const{requestId:s}=await this.faceMatchService.faceMatch(e,t,`sdk-facematch-${(0,i.v4)()}`),r=await this.waitForResultsFaceMatch(s);this.updateResults({faceMatch:{results:r,status:"success",loading:!1,error:null}})}catch(e){const t=new n.SDKError({message:"Error when comparing the face with the document",code:n.EUploadIdentificationDocumentErrorCodes.FACE_MATCH_ERROR,fatal:!1,details:e});await(null===(r=(s=this.options).onError)||void 0===r?void 0:r.call(s,t)),this.updateResults({faceMatch:{results:null,status:"error",loading:!1,error:t}})}}async tryStartFaceMatch(){var e,t,s;!this.results.uploadedDocument||!(null===(e=this.results.liveness.results)||void 0===e?void 0:e.successFrames.front)||this.results.faceMatch.loading||this.results.liveness.loading||this.results.typification.loading?await(null===(s=(t=this.options).onError)||void 0===s?void 0:s.call(t,new n.SDKError({message:"Unavailable faces",code:n.EUploadIdentificationDocumentErrorCodes.FACE_MATCH_UNAVAILABLE_FACES_ERROR,fatal:!1}))):await this.startFaceMatch(this.results.uploadedDocument,this.results.liveness.results.successFrames.front)}startAll(e,t){this.startDocumentUpload(e),this.startLivenessDetection(t)}}},604:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uploadIdentificationDocument=void 0;const r=s(171),o=s(234);t.uploadIdentificationDocument=function(e){const t=new r.UploadIdentificationDocumentService(e,{livenessDetection:o.livenessDetection});return{startDocumentUpload:async(...e)=>{await t.startDocumentUpload(...e)},startLivenessDetection:(...e)=>t.startLivenessDetection(...e),startFaceComparison:async(...e)=>{await t.tryStartFaceMatch(...e)},startAll:(...e)=>{t.startAll(...e)},getResults:(...e)=>t.getResults(...e)}}},620:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDefaultFrameControls=void 0,t.getDefaultFrameControls=async function(){let e,t,s,r;return{startGettingFrames:async function(o){var n;return e&&t&&s||(e=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:null!==(n=null==o?void 0:o.facingMode)&&void 0!==n?n:"user"}}),t=document.createElement("video"),t.setAttribute("autoplay","true"),t.style.transform="scale(-1, 1)",t.style.position="absolute",t.style.left="-99999px",document.body.appendChild(t),t.srcObject=e,s=document.createElement("canvas"),r=s.getContext("2d")),e},getNextFrame:async function(){if(s&&t)return s.width=t.videoWidth,s.height=t.videoHeight,null==r||r.drawImage(t,0,0,s.width,s.height),await new Promise(((e,t)=>{s?s.toBlob((t=>{e(t)})):e(null)}));throw new Error("Cannot found video element")},stopGettingFrames:function(){t&&(document.body.removeChild(t),t=void 0),s&&(s=void 0),r&&(r=void 0),e&&(null==e||e.getTracks().forEach((e=>{e.stop()})),e=void 0)}}}},616:(e,t)=>{"use strict";function s(e){const t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),s=decodeURIComponent(window.atob(t).split("").map((e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2))).join(""));return JSON.parse(s)}Object.defineProperty(t,"__esModule",{value:!0}),t.tryDecodeJwt=t.decodeJwt=void 0,t.decodeJwt=s,t.tryDecodeJwt=function(e){try{return s(e)}catch(e){return null}}},661:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LIVENESS_RESULT_RETRY_DELAY_MS=t.LIVENESS_RESULT_MAX_ATTEMPTS=t.LIVENESS_PENDING_STATUSES=t.DEFAULT_RETRY_TIME_STEP=t.DEFAULT_NUMBER_OF_RETRIES=t.SEND_FRAMES_INTERVAL_MS=t.APPLICATION_URL=t.API_GATEWAY_URL=t.WEBSOCKET_BASE_URL=t.LIVENESS_API_URL=void 0,t.LIVENESS_API_URL="https://liveness.santoid.com.br",t.WEBSOCKET_BASE_URL=`${t.LIVENESS_API_URL.replace("https://","wss://")}/api/v1/liveness/ws`,t.API_GATEWAY_URL="https://api.santoid.com.br",t.APPLICATION_URL="https://app.santoid.com.br",t.SEND_FRAMES_INTERVAL_MS=100,t.DEFAULT_NUMBER_OF_RETRIES=5,t.DEFAULT_RETRY_TIME_STEP=1e3,t.LIVENESS_PENDING_STATUSES=["CREATED","IN_PROGRESS"],t.LIVENESS_RESULT_MAX_ATTEMPTS=8,t.LIVENESS_RESULT_RETRY_DELAY_MS=1500},551:(e,t)=>{"use strict";var s,r,o,n,i,a;Object.defineProperty(t,"__esModule",{value:!0}),t.SDKError=t.EProcessingErrorCodes=t.ECameraErrorCodes=t.EFaceMatchErrorCodes=t.EUploadIdentificationDocumentErrorCodes=t.ELivenessDetectionErrorCodes=t.EDefaultErrorCodes=void 0,function(e){e.INITIALIZATION_ERROR="initialization-error",e.INTERNAL_ERROR="internal-error"}(s||(t.EDefaultErrorCodes=s={})),function(e){e.WRONG_POSITION="liveness-detection/wrong-position"}(r||(t.ELivenessDetectionErrorCodes=r={})),function(e){e.FACE_MATCH_ERROR="upload-identification-document/face-match-error",e.FACE_MATCH_UNAVAILABLE_FACES_ERROR="upload-identification-document/face-match-unavailable-faces-error",e.DOCUMENT_ANALYSIS_ERROR="upload-identification-document/document-analysis-error",e.LIVENESS_DETECTION_ERROR="upload-identification-document/liveness-detection-error"}(o||(t.EUploadIdentificationDocumentErrorCodes=o={})),function(e){e.FIRST_IMAGE_NOT_SELECTED="face-match/first-image-not-selected"}(n||(t.EFaceMatchErrorCodes=n={})),function(e){e.INITIALIZATION_ERROR="camera/initialization-error",e.IS_RUNNING="camera/is-running",e.ALREADY_STARTED="camera/already-started",e.NOT_INITIALIZED="camera/not-initialized",e.CANNOT_CAPTURE_IMAGE="camera/cannot-capture-image",e.SHUTDOWN_ERROR="camera/shutdown-error"}(i||(t.ECameraErrorCodes=i={})),function(e){e.PROCESSING_ERROR="processing/processing-error",e.ALREADY_STARTED="processing/already-started"}(a||(t.EProcessingErrorCodes=a={}));class c extends Error{constructor({message:e,code:t,fatal:s,details:r}){super(e),this.code=t,this.fatal=s,this.details=r}}t.SDKError=c},951:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.retryAsyncFunctionXTimes=t.callAsyncFunctionEveryXSeconds=t.waitFor=t.wait=t.capitalizeFirstLetter=void 0;const r=s(218),o=s(661);async function n(e){await new Promise((t=>{e()?t():setTimeout((()=>{n(e).then(t)}),500)}))}function i(e){var t;return e instanceof r.AxiosError&&(503===(null===(t=e.response)||void 0===t?void 0:t.status)||"Network Error"===e.message)}t.capitalizeFirstLetter=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},t.wait=async e=>{await new Promise((t=>{setTimeout(t,e)}))},t.waitFor=n,t.callAsyncFunctionEveryXSeconds=function e(t,s,r={stop:!1}){const o={timerEnd:!1};return setTimeout((()=>{o.timerEnd=!0}),s),t().then((async()=>{await n((()=>o.timerEnd)),r.stop||e(t,s,r)})),function(){r.stop=!0}},t.retryAsyncFunctionXTimes=async function e(s,r=i,n=o.DEFAULT_NUMBER_OF_RETRIES,a=1e3,c=o.DEFAULT_RETRY_TIME_STEP){try{return await s()}catch(o){if(r(o)&&n>0)return await(0,t.wait)(a),await e(s,r,n-1,a+c,c);throw o}}},706:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractWebSocket=void 0;const r=s(661);t.AbstractWebSocket=class{constructor(e,t){this.classOptions=e,this.sdkOptions=t}startConnection(){var e,t;const s=this.classOptions.decodeJwt(this.sdkOptions.token),o={x_endpoint_api_userinfo:this.sdkOptions.token,domain:null!==(e=this.sdkOptions.domain)&&void 0!==e?e:s.claims.domain,track:this.sdkOptions.track};this.sdkOptions.customId&&(o.customerRequestId=this.sdkOptions.customId),this.sdkOptions.useBillingAccounts&&(o.clientCredentials=!0);const n=Object.entries(o).map((e=>e.join("="))).join("&");this.websocket=new this.classOptions.WebSocketClass(`${null!==(t=this.sdkOptions.customWebSocketUrl)&&void 0!==t?t:r.WEBSOCKET_BASE_URL}?${n}`)}async waitForWebSocketConnection(){if(await new Promise((e=>{const t=setInterval((()=>{[3,1].includes(this.websocket.readyState)&&(clearInterval(t),e())}),5)})),3===this.websocket.readyState)throw new Error("Cannot connect to server")}disconnectFromWebSocket(){var e,t;[2,3].includes(this.websocket.readyState)||null===(t=(e=this.websocket).close)||void 0===t||t.call(e)}get readyState(){return this.websocket.readyState}addListener(e,t){var s,r;this.websocket.on?this.websocket.on(e,t):null===(r=(s=this.websocket).addEventListener)||void 0===r||r.call(s,e,t)}send(e){this.websocket.send(e)}}},877:(e,t,s)=>{var r=s(570),o=s(358),n=o;n.v1=r,n.v4=o,e.exports=n},327:e=>{for(var t=[],s=0;s<256;++s)t[s]=(s+256).toString(16).substr(1);e.exports=function(e,s){var r=s||0,o=t;return[o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]]].join("")}},217:e=>{var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var s=new Uint8Array(16);e.exports=function(){return t(s),s}}else{var r=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),r[t]=e>>>((3&t)<<3)&255;return r}}},570:(e,t,s)=>{var r,o,n=s(217),i=s(327),a=0,c=0;e.exports=function(e,t,s){var l=t&&s||0,u=t||[],d=(e=e||{}).node||r,p=void 0!==e.clockseq?e.clockseq:o;if(null==d||null==p){var h=n();null==d&&(d=r=[1|h[0],h[1],h[2],h[3],h[4],h[5]]),null==p&&(p=o=16383&(h[6]<<8|h[7]))}var f=void 0!==e.msecs?e.msecs:(new Date).getTime(),m=void 0!==e.nsecs?e.nsecs:c+1,v=f-a+(m-c)/1e4;if(v<0&&void 0===e.clockseq&&(p=p+1&16383),(v<0||f>a)&&void 0===e.nsecs&&(m=0),m>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");a=f,c=m,o=p;var E=(1e4*(268435455&(f+=122192928e5))+m)%4294967296;u[l++]=E>>>24&255,u[l++]=E>>>16&255,u[l++]=E>>>8&255,u[l++]=255&E;var S=f/4294967296*1e4&268435455;u[l++]=S>>>8&255,u[l++]=255&S,u[l++]=S>>>24&15|16,u[l++]=S>>>16&255,u[l++]=p>>>8|128,u[l++]=255&p;for(var w=0;w<6;++w)u[l+w]=d[w];return t||i(u)}},358:(e,t,s)=>{var r=s(217),o=s(327);e.exports=function(e,t,s){var n=t&&s||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var i=(e=e||{}).random||(e.rng||r)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t)for(var a=0;a<16;++a)t[n+a]=i[a];return t||o(i)}},218:(e,t,s)=>{"use strict";function r(e,t){return function(){return e.apply(t,arguments)}}const{toString:o}=Object.prototype,{getPrototypeOf:n}=Object,i=(a=Object.create(null),e=>{const t=o.call(e);return a[t]||(a[t]=t.slice(8,-1).toLowerCase())});var a;const c=e=>(e=e.toLowerCase(),t=>i(t)===e),l=e=>t=>typeof t===e,{isArray:u}=Array,d=l("undefined"),p=c("ArrayBuffer"),h=l("string"),f=l("function"),m=l("number"),v=e=>null!==e&&"object"==typeof e,E=e=>{if("object"!==i(e))return!1;const t=n(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},S=c("Date"),w=c("File"),g=c("Blob"),y=c("FileList"),R=c("URLSearchParams");function b(e,t,{allOwnKeys:s=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),u(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const o=s?Object.getOwnPropertyNames(e):Object.keys(e),n=o.length;let i;for(r=0;r<n;r++)i=o[r],t.call(null,e[i],i,e)}}function A(e,t){t=t.toLowerCase();const s=Object.keys(e);let r,o=s.length;for(;o-- >0;)if(r=s[o],t===r.toLowerCase())return r;return null}const O="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:s.g,_=e=>!d(e)&&e!==O,C=(T="undefined"!=typeof Uint8Array&&n(Uint8Array),e=>T&&e instanceof T);var T;const I=c("HTMLFormElement"),D=(({hasOwnProperty:e})=>(t,s)=>e.call(t,s))(Object.prototype),F=c("RegExp"),N=(e,t)=>{const s=Object.getOwnPropertyDescriptors(e),r={};b(s,((s,o)=>{let n;!1!==(n=t(s,o,e))&&(r[o]=n||s)})),Object.defineProperties(e,r)},L="abcdefghijklmnopqrstuvwxyz",P="0123456789",U={DIGIT:P,ALPHA:L,ALPHA_DIGIT:L+L.toUpperCase()+P},j=c("AsyncFunction");var k={isArray:u,isArrayBuffer:p,isBuffer:function(e){return null!==e&&!d(e)&&null!==e.constructor&&!d(e.constructor)&&f(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||f(e.append)&&("formdata"===(t=i(e))||"object"===t&&f(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&p(e.buffer),t},isString:h,isNumber:m,isBoolean:e=>!0===e||!1===e,isObject:v,isPlainObject:E,isUndefined:d,isDate:S,isFile:w,isBlob:g,isRegExp:F,isFunction:f,isStream:e=>v(e)&&f(e.pipe),isURLSearchParams:R,isTypedArray:C,isFileList:y,forEach:b,merge:function e(){const{caseless:t}=_(this)&&this||{},s={},r=(r,o)=>{const n=t&&A(s,o)||o;E(s[n])&&E(r)?s[n]=e(s[n],r):E(r)?s[n]=e({},r):u(r)?s[n]=r.slice():s[n]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&b(arguments[e],r);return s},extend:(e,t,s,{allOwnKeys:o}={})=>(b(t,((t,o)=>{s&&f(t)?e[o]=r(t,s):e[o]=t}),{allOwnKeys:o}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,s,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),s&&Object.assign(e.prototype,s)},toFlatObject:(e,t,s,r)=>{let o,i,a;const c={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)a=o[i],r&&!r(a,e,t)||c[a]||(t[a]=e[a],c[a]=!0);e=!1!==s&&n(e)}while(e&&(!s||s(e,t))&&e!==Object.prototype);return t},kindOf:i,kindOfTest:c,endsWith:(e,t,s)=>{e=String(e),(void 0===s||s>e.length)&&(s=e.length),s-=t.length;const r=e.indexOf(t,s);return-1!==r&&r===s},toArray:e=>{if(!e)return null;if(u(e))return e;let t=e.length;if(!m(t))return null;const s=new Array(t);for(;t-- >0;)s[t]=e[t];return s},forEachEntry:(e,t)=>{const s=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=s.next())&&!r.done;){const s=r.value;t.call(e,s[0],s[1])}},matchAll:(e,t)=>{let s;const r=[];for(;null!==(s=e.exec(t));)r.push(s);return r},isHTMLForm:I,hasOwnProperty:D,hasOwnProp:D,reduceDescriptors:N,freezeMethods:e=>{N(e,((t,s)=>{if(f(e)&&-1!==["arguments","caller","callee"].indexOf(s))return!1;const r=e[s];f(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+s+"'")}))}))},toObjectSet:(e,t)=>{const s={},r=e=>{e.forEach((e=>{s[e]=!0}))};return u(e)?r(e):r(String(e).split(t)),s},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,s){return t.toUpperCase()+s})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:A,global:O,isContextDefined:_,ALPHABET:U,generateString:(e=16,t=U.ALPHA_DIGIT)=>{let s="";const{length:r}=t;for(;e--;)s+=t[Math.random()*r|0];return s},isSpecCompliantForm:function(e){return!!(e&&f(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),s=(e,r)=>{if(v(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const o=u(e)?[]:{};return b(e,((e,t)=>{const n=s(e,r+1);!d(n)&&(o[t]=n)})),t[r]=void 0,o}}return e};return s(e,0)},isAsyncFn:j,isThenable:e=>e&&(v(e)||f(e))&&f(e.then)&&f(e.catch)};function x(e,t,s,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),s&&(this.config=s),r&&(this.request=r),o&&(this.response=o)}k.inherits(x,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:k.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const M=x.prototype,B={};function G(e){return k.isPlainObject(e)||k.isArray(e)}function K(e){return k.endsWith(e,"[]")?e.slice(0,-2):e}function q(e,t,s){return e?e.concat(t).map((function(e,t){return e=K(e),!s&&t?"["+e+"]":e})).join(s?".":""):t}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{B[e]={value:e}})),Object.defineProperties(x,B),Object.defineProperty(M,"isAxiosError",{value:!0}),x.from=(e,t,s,r,o,n)=>{const i=Object.create(M);return k.toFlatObject(e,i,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),x.call(i,e.message,t,s,r,o),i.cause=e,i.name=e.name,n&&Object.assign(i,n),i};const W=k.toFlatObject(k,{},null,(function(e){return/^is[A-Z]/.test(e)}));function V(e,t,s){if(!k.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(s=k.toFlatObject(s,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!k.isUndefined(t[e])}))).metaTokens,o=s.visitor||l,n=s.dots,i=s.indexes,a=(s.Blob||"undefined"!=typeof Blob&&Blob)&&k.isSpecCompliantForm(t);if(!k.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(k.isDate(e))return e.toISOString();if(!a&&k.isBlob(e))throw new x("Blob is not supported. Use a Buffer instead.");return k.isArrayBuffer(e)||k.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,s,o){let a=e;if(e&&!o&&"object"==typeof e)if(k.endsWith(s,"{}"))s=r?s:s.slice(0,-2),e=JSON.stringify(e);else if(k.isArray(e)&&function(e){return k.isArray(e)&&!e.some(G)}(e)||(k.isFileList(e)||k.endsWith(s,"[]"))&&(a=k.toArray(e)))return s=K(s),a.forEach((function(e,r){!k.isUndefined(e)&&null!==e&&t.append(!0===i?q([s],r,n):null===i?s:s+"[]",c(e))})),!1;return!!G(e)||(t.append(q(o,s,n),c(e)),!1)}const u=[],d=Object.assign(W,{defaultVisitor:l,convertValue:c,isVisitable:G});if(!k.isObject(e))throw new TypeError("data must be an object");return function e(s,r){if(!k.isUndefined(s)){if(-1!==u.indexOf(s))throw Error("Circular reference detected in "+r.join("."));u.push(s),k.forEach(s,(function(s,n){!0===(!(k.isUndefined(s)||null===s)&&o.call(t,s,k.isString(n)?n.trim():n,r,d))&&e(s,r?r.concat(n):[n])})),u.pop()}}(e),t}function J(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function z(e,t){this._pairs=[],e&&V(e,this,t)}const H=z.prototype;function $(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Y(e,t,s){if(!t)return e;const r=s&&s.encode||$,o=s&&s.serialize;let n;if(n=o?o(t,s):k.isURLSearchParams(t)?t.toString():new z(t,s).toString(r),n){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e}H.append=function(e,t){this._pairs.push([e,t])},H.toString=function(e){const t=e?function(t){return e.call(this,t,J)}:J;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var X=class{constructor(){this.handlers=[]}use(e,t,s){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!s&&s.synchronous,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){k.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Z={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Q={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:z,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&"undefined"!=typeof window&&"undefined"!=typeof document})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]};function ee(e){function t(e,s,r,o){let n=e[o++];const i=Number.isFinite(+n),a=o>=e.length;return n=!n&&k.isArray(r)?r.length:n,a?(k.hasOwnProp(r,n)?r[n]=[r[n],s]:r[n]=s,!i):(r[n]&&k.isObject(r[n])||(r[n]=[]),t(e,s,r[n],o)&&k.isArray(r[n])&&(r[n]=function(e){const t={},s=Object.keys(e);let r;const o=s.length;let n;for(r=0;r<o;r++)n=s[r],t[n]=e[n];return t}(r[n])),!i)}if(k.isFormData(e)&&k.isFunction(e.entries)){const s={};return k.forEachEntry(e,((e,r)=>{t(function(e){return k.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,s,0)})),s}return null}const te={transitional:Z,adapter:["xhr","http"],transformRequest:[function(e,t){const s=t.getContentType()||"",r=s.indexOf("application/json")>-1,o=k.isObject(e);if(o&&k.isHTMLForm(e)&&(e=new FormData(e)),k.isFormData(e))return r&&r?JSON.stringify(ee(e)):e;if(k.isArrayBuffer(e)||k.isBuffer(e)||k.isStream(e)||k.isFile(e)||k.isBlob(e))return e;if(k.isArrayBufferView(e))return e.buffer;if(k.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let n;if(o){if(s.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return V(e,new Q.classes.URLSearchParams,Object.assign({visitor:function(e,t,s,r){return Q.isNode&&k.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((n=k.isFileList(e))||s.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return V(n?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,s){if(k.isString(e))try{return(0,JSON.parse)(e),k.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||te.transitional,s=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&k.isString(e)&&(s&&!this.responseType||r)){const s=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(s){if("SyntaxError"===e.name)throw x.from(e,x.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Q.classes.FormData,Blob:Q.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};k.forEach(["delete","get","head","post","put","patch"],(e=>{te.headers[e]={}}));var se=te;const re=k.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),oe=Symbol("internals");function ne(e){return e&&String(e).trim().toLowerCase()}function ie(e){return!1===e||null==e?e:k.isArray(e)?e.map(ie):String(e)}function ae(e,t,s,r,o){return k.isFunction(r)?r.call(this,t,s):(o&&(t=s),k.isString(t)?k.isString(r)?-1!==t.indexOf(r):k.isRegExp(r)?r.test(t):void 0:void 0)}class ce{constructor(e){e&&this.set(e)}set(e,t,s){const r=this;function o(e,t,s){const o=ne(t);if(!o)throw new Error("header name must be a non-empty string");const n=k.findKey(r,o);(!n||void 0===r[n]||!0===s||void 0===s&&!1!==r[n])&&(r[n||t]=ie(e))}const n=(e,t)=>k.forEach(e,((e,s)=>o(e,s,t)));return k.isPlainObject(e)||e instanceof this.constructor?n(e,t):k.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?n((e=>{const t={};let s,r,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),s=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!s||t[s]&&re[s]||("set-cookie"===s?t[s]?t[s].push(r):t[s]=[r]:t[s]=t[s]?t[s]+", "+r:r)})),t})(e),t):null!=e&&o(t,e,s),this}get(e,t){if(e=ne(e)){const s=k.findKey(this,e);if(s){const e=this[s];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),s=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=s.exec(e);)t[r[1]]=r[2];return t}(e);if(k.isFunction(t))return t.call(this,e,s);if(k.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ne(e)){const s=k.findKey(this,e);return!(!s||void 0===this[s]||t&&!ae(0,this[s],s,t))}return!1}delete(e,t){const s=this;let r=!1;function o(e){if(e=ne(e)){const o=k.findKey(s,e);!o||t&&!ae(0,s[o],o,t)||(delete s[o],r=!0)}}return k.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let s=t.length,r=!1;for(;s--;){const o=t[s];e&&!ae(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,s={};return k.forEach(this,((r,o)=>{const n=k.findKey(s,o);if(n)return t[n]=ie(r),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,s)=>t.toUpperCase()+s))}(o):String(o).trim();i!==o&&delete t[o],t[i]=ie(r),s[i]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return k.forEach(this,((s,r)=>{null!=s&&!1!==s&&(t[r]=e&&k.isArray(s)?s.join(", "):s)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const s=new this(e);return t.forEach((e=>s.set(e))),s}static accessor(e){const t=(this[oe]=this[oe]={accessors:{}}).accessors,s=this.prototype;function r(e){const r=ne(e);t[r]||(function(e,t){const s=k.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+s,{value:function(e,s,o){return this[r].call(this,t,e,s,o)},configurable:!0})}))}(s,e),t[r]=!0)}return k.isArray(e)?e.forEach(r):r(e),this}}ce.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),k.reduceDescriptors(ce.prototype,(({value:e},t)=>{let s=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[s]=e}}})),k.freezeMethods(ce);var le=ce;function ue(e,t){const s=this||se,r=t||s,o=le.from(r.headers);let n=r.data;return k.forEach(e,(function(e){n=e.call(s,n,o.normalize(),t?t.status:void 0)})),o.normalize(),n}function de(e){return!(!e||!e.__CANCEL__)}function pe(e,t,s){x.call(this,null==e?"canceled":e,x.ERR_CANCELED,t,s),this.name="CanceledError"}k.inherits(pe,x,{__CANCEL__:!0});var he=Q.isStandardBrowserEnv?{write:function(e,t,s,r,o,n){const i=[];i.push(e+"="+encodeURIComponent(t)),k.isNumber(s)&&i.push("expires="+new Date(s).toGMTString()),k.isString(r)&&i.push("path="+r),k.isString(o)&&i.push("domain="+o),!0===n&&i.push("secure"),document.cookie=i.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function fe(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var me=Q.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let s;function r(s){let r=s;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return s=r(window.location.href),function(e){const t=k.isString(e)?r(e):e;return t.protocol===s.protocol&&t.host===s.host}}():function(){return!0};function ve(e,t){let s=0;const r=function(e,t){e=e||10;const s=new Array(e),r=new Array(e);let o,n=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=r[i];o||(o=c),s[n]=a,r[n]=c;let u=i,d=0;for(;u!==n;)d+=s[u++],u%=e;if(n=(n+1)%e,n===i&&(i=(i+1)%e),c-o<t)return;const p=l&&c-l;return p?Math.round(1e3*d/p):void 0}}(50,250);return o=>{const n=o.loaded,i=o.lengthComputable?o.total:void 0,a=n-s,c=r(a);s=n;const l={loaded:n,total:i,progress:i?n/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&n<=i?(i-n)/c:void 0,event:o};l[t?"download":"upload"]=!0,e(l)}}const Ee={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,s){let r=e.data;const o=le.from(e.headers).normalize(),n=e.responseType;let i,a;function c(){e.cancelToken&&e.cancelToken.unsubscribe(i),e.signal&&e.signal.removeEventListener("abort",i)}k.isFormData(r)&&(Q.isStandardBrowserEnv||Q.isStandardBrowserWebWorkerEnv?o.setContentType(!1):o.getContentType(/^\s*multipart\/form-data/)?k.isString(a=o.getContentType())&&o.setContentType(a.replace(/^\s*(multipart\/form-data);+/,"$1")):o.setContentType("multipart/form-data"));let l=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",s=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(t+":"+s))}const u=fe(e.baseURL,e.url);function d(){if(!l)return;const r=le.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders());!function(e,t,s){const r=s.config.validateStatus;s.status&&r&&!r(s.status)?t(new x("Request failed with status code "+s.status,[x.ERR_BAD_REQUEST,x.ERR_BAD_RESPONSE][Math.floor(s.status/100)-4],s.config,s.request,s)):e(s)}((function(e){t(e),c()}),(function(e){s(e),c()}),{data:n&&"text"!==n&&"json"!==n?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:r,config:e,request:l}),l=null}if(l.open(e.method.toUpperCase(),Y(u,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,"onloadend"in l?l.onloadend=d:l.onreadystatechange=function(){l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))&&setTimeout(d)},l.onabort=function(){l&&(s(new x("Request aborted",x.ECONNABORTED,e,l)),l=null)},l.onerror=function(){s(new x("Network Error",x.ERR_NETWORK,e,l)),l=null},l.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||Z;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),s(new x(t,r.clarifyTimeoutError?x.ETIMEDOUT:x.ECONNABORTED,e,l)),l=null},Q.isStandardBrowserEnv){const t=(e.withCredentials||me(u))&&e.xsrfCookieName&&he.read(e.xsrfCookieName);t&&o.set(e.xsrfHeaderName,t)}void 0===r&&o.setContentType(null),"setRequestHeader"in l&&k.forEach(o.toJSON(),(function(e,t){l.setRequestHeader(t,e)})),k.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),n&&"json"!==n&&(l.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&l.addEventListener("progress",ve(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",ve(e.onUploadProgress)),(e.cancelToken||e.signal)&&(i=t=>{l&&(s(!t||t.type?new pe(null,e,l):t),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(i),e.signal&&(e.signal.aborted?i():e.signal.addEventListener("abort",i)));const p=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(u);p&&-1===Q.protocols.indexOf(p)?s(new x("Unsupported protocol "+p+":",x.ERR_BAD_REQUEST,e)):l.send(r||null)}))}};k.forEach(Ee,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Se=e=>`- ${e}`,we=e=>k.isFunction(e)||null===e||!1===e;var ge=e=>{e=k.isArray(e)?e:[e];const{length:t}=e;let s,r;const o={};for(let n=0;n<t;n++){let t;if(s=e[n],r=s,!we(s)&&(r=Ee[(t=String(s)).toLowerCase()],void 0===r))throw new x(`Unknown adapter '${t}'`);if(r)break;o[t||"#"+n]=r}if(!r){const e=Object.entries(o).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new x("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(Se).join("\n"):" "+Se(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function ye(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new pe(null,e)}function Re(e){return ye(e),e.headers=le.from(e.headers),e.data=ue.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),ge(e.adapter||se.adapter)(e).then((function(t){return ye(e),t.data=ue.call(e,e.transformResponse,t),t.headers=le.from(t.headers),t}),(function(t){return de(t)||(ye(e),t&&t.response&&(t.response.data=ue.call(e,e.transformResponse,t.response),t.response.headers=le.from(t.response.headers))),Promise.reject(t)}))}const be=e=>e instanceof le?e.toJSON():e;function Ae(e,t){t=t||{};const s={};function r(e,t,s){return k.isPlainObject(e)&&k.isPlainObject(t)?k.merge.call({caseless:s},e,t):k.isPlainObject(t)?k.merge({},t):k.isArray(t)?t.slice():t}function o(e,t,s){return k.isUndefined(t)?k.isUndefined(e)?void 0:r(void 0,e,s):r(e,t,s)}function n(e,t){if(!k.isUndefined(t))return r(void 0,t)}function i(e,t){return k.isUndefined(t)?k.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(s,o,n){return n in t?r(s,o):n in e?r(void 0,s):void 0}const c={url:n,method:n,data:n,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(e,t)=>o(be(e),be(t),!0)};return k.forEach(Object.keys(Object.assign({},e,t)),(function(r){const n=c[r]||o,i=n(e[r],t[r],r);k.isUndefined(i)&&n!==a||(s[r]=i)})),s}const Oe={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Oe[e]=function(s){return typeof s===e||"a"+(t<1?"n ":" ")+e}}));const _e={};Oe.transitional=function(e,t,s){function r(e,t){return"[Axios v1.5.1] Transitional option '"+e+"'"+t+(s?". "+s:"")}return(s,o,n)=>{if(!1===e)throw new x(r(o," has been removed"+(t?" in "+t:"")),x.ERR_DEPRECATED);return t&&!_e[o]&&(_e[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(s,o,n)}};var Ce={assertOptions:function(e,t,s){if("object"!=typeof e)throw new x("options must be an object",x.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const n=r[o],i=t[n];if(i){const t=e[n],s=void 0===t||i(t,n,e);if(!0!==s)throw new x("option "+n+" must be "+s,x.ERR_BAD_OPTION_VALUE)}else if(!0!==s)throw new x("Unknown option "+n,x.ERR_BAD_OPTION)}},validators:Oe};const Te=Ce.validators;class Ie{constructor(e){this.defaults=e,this.interceptors={request:new X,response:new X}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Ae(this.defaults,t);const{transitional:s,paramsSerializer:r,headers:o}=t;void 0!==s&&Ce.assertOptions(s,{silentJSONParsing:Te.transitional(Te.boolean),forcedJSONParsing:Te.transitional(Te.boolean),clarifyTimeoutError:Te.transitional(Te.boolean)},!1),null!=r&&(k.isFunction(r)?t.paramsSerializer={serialize:r}:Ce.assertOptions(r,{encode:Te.function,serialize:Te.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let n=o&&k.merge(o.common,o[t.method]);o&&k.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=le.concat(n,o);const i=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.unshift(e.fulfilled,e.rejected))}));const c=[];let l;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let u,d=0;if(!a){const e=[Re.bind(this),void 0];for(e.unshift.apply(e,i),e.push.apply(e,c),u=e.length,l=Promise.resolve(t);d<u;)l=l.then(e[d++],e[d++]);return l}u=i.length;let p=t;for(d=0;d<u;){const e=i[d++],t=i[d++];try{p=e(p)}catch(e){t.call(this,e);break}}try{l=Re.call(this,p)}catch(e){return Promise.reject(e)}for(d=0,u=c.length;d<u;)l=l.then(c[d++],c[d++]);return l}getUri(e){return Y(fe((e=Ae(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}k.forEach(["delete","get","head","options"],(function(e){Ie.prototype[e]=function(t,s){return this.request(Ae(s||{},{method:e,url:t,data:(s||{}).data}))}})),k.forEach(["post","put","patch"],(function(e){function t(t){return function(s,r,o){return this.request(Ae(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:s,data:r}))}}Ie.prototype[e]=t(),Ie.prototype[e+"Form"]=t(!0)}));var De=Ie;class Fe{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const s=this;this.promise.then((e=>{if(!s._listeners)return;let t=s._listeners.length;for(;t-- >0;)s._listeners[t](e);s._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{s.subscribe(e),t=e})).then(e);return r.cancel=function(){s.unsubscribe(t)},r},e((function(e,r,o){s.reason||(s.reason=new pe(e,r,o),t(s.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new Fe((function(t){e=t})),cancel:e}}}var Ne=Fe;const Le={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Le).forEach((([e,t])=>{Le[t]=e}));var Pe=Le;const Ue=function e(t){const s=new De(t),o=r(De.prototype.request,s);return k.extend(o,De.prototype,s,{allOwnKeys:!0}),k.extend(o,s,null,{allOwnKeys:!0}),o.create=function(s){return e(Ae(t,s))},o}(se);Ue.Axios=De,Ue.CanceledError=pe,Ue.CancelToken=Ne,Ue.isCancel=de,Ue.VERSION="1.5.1",Ue.toFormData=V,Ue.AxiosError=x,Ue.Cancel=Ue.CanceledError,Ue.all=function(e){return Promise.all(e)},Ue.spread=function(e){return function(t){return e.apply(null,t)}},Ue.isAxiosError=function(e){return k.isObject(e)&&!0===e.isAxiosError},Ue.mergeConfig=Ae,Ue.AxiosHeaders=le,Ue.formToJSON=e=>ee(k.isHTMLForm(e)?new FormData(e):e),Ue.getAdapter=ge,Ue.HttpStatusCode=Pe,Ue.default=Ue,e.exports=Ue}},t={};function s(r){var o=t[r];if(void 0!==o)return o.exports;var n=t[r]={exports:{}};return e[r].call(n.exports,n,n.exports,s),n.exports}s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();var r={};return(()=>{"use strict";var e=r;const t=s(234),o=s(923),n=s(604),i=s(122),a=s(344),c=s(927),l=s(168);class u{}u.livenessDetection=t.livenessDetection,u.livenessSession=o.livenessSession,u.uploadIdentificationDocument=n.uploadIdentificationDocument,u.insertUploadIdentificationDocument=i.insertUploadIdentificationDocument,u.typification=a.typification,u.ocr=l.ocr,u.faceMatch=c.faceMatch,e.default=u})(),r.default})()));
|
package/client/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { livenessDetection } from './liveness/methods/livenessDetection';
|
|
2
|
+
import { livenessSession } from './liveness/methods/livenessSession';
|
|
2
3
|
import { uploadIdentificationDocument } from './liveness/methods/uploadIdentificationDocument';
|
|
3
4
|
import { insertUploadIdentificationDocument } from './embedded/methods/insertUploadIdentificationDocument';
|
|
4
5
|
import { typification } from './core/methods/typification';
|
|
@@ -6,6 +7,7 @@ import { faceMatch } from './core/methods/faceMatch';
|
|
|
6
7
|
import { ocr } from './core/methods/ocr';
|
|
7
8
|
export default class SantoiDSDK {
|
|
8
9
|
static readonly livenessDetection: typeof livenessDetection;
|
|
10
|
+
static readonly livenessSession: typeof livenessSession;
|
|
9
11
|
static readonly uploadIdentificationDocument: typeof uploadIdentificationDocument;
|
|
10
12
|
static readonly insertUploadIdentificationDocument: typeof insertUploadIdentificationDocument;
|
|
11
13
|
static readonly typification: typeof typification;
|
package/client/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const livenessDetection_1 = require("./liveness/methods/livenessDetection");
|
|
4
|
+
const livenessSession_1 = require("./liveness/methods/livenessSession");
|
|
4
5
|
const uploadIdentificationDocument_1 = require("./liveness/methods/uploadIdentificationDocument");
|
|
5
6
|
const insertUploadIdentificationDocument_1 = require("./embedded/methods/insertUploadIdentificationDocument");
|
|
6
7
|
const typification_1 = require("./core/methods/typification");
|
|
@@ -9,6 +10,7 @@ const ocr_1 = require("./core/methods/ocr");
|
|
|
9
10
|
class SantoiDSDK {
|
|
10
11
|
}
|
|
11
12
|
SantoiDSDK.livenessDetection = livenessDetection_1.livenessDetection;
|
|
13
|
+
SantoiDSDK.livenessSession = livenessSession_1.livenessSession;
|
|
12
14
|
SantoiDSDK.uploadIdentificationDocument = uploadIdentificationDocument_1.uploadIdentificationDocument;
|
|
13
15
|
SantoiDSDK.insertUploadIdentificationDocument = insertUploadIdentificationDocument_1.insertUploadIdentificationDocument;
|
|
14
16
|
SantoiDSDK.typification = typification_1.typification;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { livenessDetection } from './methods/livenessDetection';
|
|
2
|
+
import { livenessSession } from './methods/livenessSession';
|
|
2
3
|
import { uploadIdentificationDocument } from './methods/uploadIdentificationDocument';
|
|
3
|
-
export { livenessDetection, uploadIdentificationDocument, };
|
|
4
|
+
export { livenessDetection, livenessSession, uploadIdentificationDocument, };
|
package/client/liveness/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.uploadIdentificationDocument = exports.livenessDetection = void 0;
|
|
3
|
+
exports.uploadIdentificationDocument = exports.livenessSession = exports.livenessDetection = void 0;
|
|
4
4
|
const livenessDetection_1 = require("./methods/livenessDetection");
|
|
5
5
|
Object.defineProperty(exports, "livenessDetection", { enumerable: true, get: function () { return livenessDetection_1.livenessDetection; } });
|
|
6
|
+
const livenessSession_1 = require("./methods/livenessSession");
|
|
7
|
+
Object.defineProperty(exports, "livenessSession", { enumerable: true, get: function () { return livenessSession_1.livenessSession; } });
|
|
6
8
|
const uploadIdentificationDocument_1 = require("./methods/uploadIdentificationDocument");
|
|
7
9
|
Object.defineProperty(exports, "uploadIdentificationDocument", { enumerable: true, get: function () { return uploadIdentificationDocument_1.uploadIdentificationDocument; } });
|
|
@@ -6,6 +6,14 @@ type ILivenessDetectionParams = Omit<ISDKOptions<TFrameType, TMediaType>, 'onSta
|
|
|
6
6
|
videoStream: TMediaType;
|
|
7
7
|
}) => void | Promise<void>;
|
|
8
8
|
};
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Prova de vida v1, sobre o detector in-house (WebSocket com o
|
|
11
|
+
* desafio de cinco posicoes). Substituida por {@link livenessSession}, que usa
|
|
12
|
+
* o AWS Rekognition Face Liveness.
|
|
13
|
+
*
|
|
14
|
+
* Continua funcionando e sera mantida ate a migracao dos clientes, mas nao
|
|
15
|
+
* recebe mais evolucao. Codigo novo deve usar livenessSession.
|
|
16
|
+
*/
|
|
9
17
|
export declare function livenessDetection(options: ILivenessDetectionParams): {
|
|
10
18
|
getVideoStream: () => TMediaType;
|
|
11
19
|
stopLivenessDetection: () => Promise<void>;
|
|
@@ -5,6 +5,14 @@ const Service_1 = require("./Service");
|
|
|
5
5
|
const error_1 = require("../../../../utils/error");
|
|
6
6
|
const websocket_1 = require("../../../../utils/websocket");
|
|
7
7
|
const index_1 = require("../../utils/index");
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Prova de vida v1, sobre o detector in-house (WebSocket com o
|
|
10
|
+
* desafio de cinco posicoes). Substituida por {@link livenessSession}, que usa
|
|
11
|
+
* o AWS Rekognition Face Liveness.
|
|
12
|
+
*
|
|
13
|
+
* Continua funcionando e sera mantida ate a migracao dos clientes, mas nao
|
|
14
|
+
* recebe mais evolucao. Codigo novo deve usar livenessSession.
|
|
15
|
+
*/
|
|
8
16
|
function livenessDetection(options) {
|
|
9
17
|
var _a;
|
|
10
18
|
try {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ApiLivenessSessionService, type ILivenessSessionResult } from '../../../../api/ApiLivenessSessionService';
|
|
2
|
+
import { type IBaseSDKOptions } from '../../../../utils/types';
|
|
3
|
+
import { SDKError } from '../../../../utils/error';
|
|
4
|
+
export type TLivenessSessionOptions = Omit<IBaseSDKOptions, 'track'> & {
|
|
5
|
+
track?: string;
|
|
6
|
+
customerRequestId?: string;
|
|
7
|
+
onSessionCreated?: (sessionId: string) => void | Promise<void>;
|
|
8
|
+
onResults?: (results: ILivenessSessionResult) => void | Promise<void>;
|
|
9
|
+
onError?: (error: SDKError) => void | Promise<void>;
|
|
10
|
+
};
|
|
11
|
+
export declare class LivenessSessionService {
|
|
12
|
+
options: TLivenessSessionOptions;
|
|
13
|
+
service: ApiLivenessSessionService;
|
|
14
|
+
sessionId: string | null;
|
|
15
|
+
constructor(options: TLivenessSessionOptions);
|
|
16
|
+
createSession(): Promise<string>;
|
|
17
|
+
getResults(sessionId?: string | null): Promise<ILivenessSessionResult>;
|
|
18
|
+
private fail;
|
|
19
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LivenessSessionService = void 0;
|
|
4
|
+
const ApiLivenessSessionService_1 = require("../../../../api/ApiLivenessSessionService");
|
|
5
|
+
const error_1 = require("../../../../utils/error");
|
|
6
|
+
const utils_1 = require("../../../../utils");
|
|
7
|
+
const constants_1 = require("../../../../utils/constants");
|
|
8
|
+
const index_1 = require("../../utils/index");
|
|
9
|
+
class LivenessSessionService {
|
|
10
|
+
constructor(options) {
|
|
11
|
+
this.sessionId = null;
|
|
12
|
+
this.options = options;
|
|
13
|
+
this.service = new ApiLivenessSessionService_1.ApiLivenessSessionService(options, { FormDataClass: FormData, tryDecodeJwt: index_1.tryDecodeJwt });
|
|
14
|
+
}
|
|
15
|
+
async createSession() {
|
|
16
|
+
var _a, _b;
|
|
17
|
+
try {
|
|
18
|
+
const session = await this.service.createSession(this.options.customerRequestId);
|
|
19
|
+
this.sessionId = session.SessionId;
|
|
20
|
+
await ((_b = (_a = this.options).onSessionCreated) === null || _b === void 0 ? void 0 : _b.call(_a, session.SessionId));
|
|
21
|
+
return session.SessionId;
|
|
22
|
+
}
|
|
23
|
+
catch (err) {
|
|
24
|
+
throw await this.fail('Error while creating liveness session', err);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
// A AWS avisa que terminou de transmitir os frames antes do Rekognition
|
|
28
|
+
// terminar de avaliar, entao o resultado fica CREATED/IN_PROGRESS por alguns
|
|
29
|
+
// instantes. Sem este polling o chamador recebe um status que ainda nao e'
|
|
30
|
+
// o final.
|
|
31
|
+
async getResults(sessionId = this.sessionId) {
|
|
32
|
+
var _a, _b;
|
|
33
|
+
if (!sessionId) {
|
|
34
|
+
throw await this.fail('There is no liveness session to fetch results from');
|
|
35
|
+
}
|
|
36
|
+
try {
|
|
37
|
+
let lastResult = null;
|
|
38
|
+
for (let attempt = 0; attempt < constants_1.LIVENESS_RESULT_MAX_ATTEMPTS; attempt++) {
|
|
39
|
+
lastResult = await this.service.getSessionResults(sessionId);
|
|
40
|
+
if (!constants_1.LIVENESS_PENDING_STATUSES.includes(lastResult.Status))
|
|
41
|
+
break;
|
|
42
|
+
await (0, utils_1.wait)(constants_1.LIVENESS_RESULT_RETRY_DELAY_MS);
|
|
43
|
+
}
|
|
44
|
+
await ((_b = (_a = this.options).onResults) === null || _b === void 0 ? void 0 : _b.call(_a, lastResult));
|
|
45
|
+
return lastResult;
|
|
46
|
+
}
|
|
47
|
+
catch (err) {
|
|
48
|
+
throw await this.fail('Error while fetching liveness session results', err);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
async fail(message, cause) {
|
|
52
|
+
var _a, _b;
|
|
53
|
+
const error = new error_1.SDKError({
|
|
54
|
+
message,
|
|
55
|
+
code: error_1.EDefaultErrorCodes.INITIALIZATION_ERROR,
|
|
56
|
+
fatal: true,
|
|
57
|
+
details: cause,
|
|
58
|
+
});
|
|
59
|
+
await ((_b = (_a = this.options).onError) === null || _b === void 0 ? void 0 : _b.call(_a, error));
|
|
60
|
+
return error;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.LivenessSessionService = LivenessSessionService;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type TLivenessSessionOptions } from './Service';
|
|
2
|
+
export type { TLivenessSessionOptions };
|
|
3
|
+
/**
|
|
4
|
+
* Prova de vida v2, sobre o AWS Rekognition Face Liveness.
|
|
5
|
+
*
|
|
6
|
+
* Cobre o ciclo de sessao: cria a sessao e busca o resultado, com o polling
|
|
7
|
+
* necessario enquanto o Rekognition ainda avalia. A captura em si - camera,
|
|
8
|
+
* oval e desafio - fica a cargo do <FaceLivenessDetector> da AWS, que e' um
|
|
9
|
+
* componente React e por isso nao mora neste pacote.
|
|
10
|
+
*
|
|
11
|
+
* Fluxo esperado:
|
|
12
|
+
* 1. createSession() -> entrega o sessionId para o detector
|
|
13
|
+
* 2. o detector transmite os frames direto para a AWS
|
|
14
|
+
* 3. getResults() quando o detector sinalizar que terminou
|
|
15
|
+
*/
|
|
16
|
+
export declare function livenessSession(options: TLivenessSessionOptions): {
|
|
17
|
+
createSession: () => Promise<string>;
|
|
18
|
+
getResults: (sessionId?: string | null | undefined) => Promise<import("../../../../api/ApiLivenessSessionService").ILivenessSessionResult>;
|
|
19
|
+
getSessionId: () => string | null;
|
|
20
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.livenessSession = void 0;
|
|
4
|
+
const Service_1 = require("./Service");
|
|
5
|
+
const error_1 = require("../../../../utils/error");
|
|
6
|
+
/**
|
|
7
|
+
* Prova de vida v2, sobre o AWS Rekognition Face Liveness.
|
|
8
|
+
*
|
|
9
|
+
* Cobre o ciclo de sessao: cria a sessao e busca o resultado, com o polling
|
|
10
|
+
* necessario enquanto o Rekognition ainda avalia. A captura em si - camera,
|
|
11
|
+
* oval e desafio - fica a cargo do <FaceLivenessDetector> da AWS, que e' um
|
|
12
|
+
* componente React e por isso nao mora neste pacote.
|
|
13
|
+
*
|
|
14
|
+
* Fluxo esperado:
|
|
15
|
+
* 1. createSession() -> entrega o sessionId para o detector
|
|
16
|
+
* 2. o detector transmite os frames direto para a AWS
|
|
17
|
+
* 3. getResults() quando o detector sinalizar que terminou
|
|
18
|
+
*/
|
|
19
|
+
function livenessSession(options) {
|
|
20
|
+
try {
|
|
21
|
+
const service = new Service_1.LivenessSessionService(options);
|
|
22
|
+
// Arrow functions sao obrigatorias aqui para o "this" nao se perder
|
|
23
|
+
return {
|
|
24
|
+
createSession: async () => {
|
|
25
|
+
return await service.createSession();
|
|
26
|
+
},
|
|
27
|
+
getResults: async (...rest) => {
|
|
28
|
+
return await service.getResults(...rest);
|
|
29
|
+
},
|
|
30
|
+
getSessionId: () => {
|
|
31
|
+
return service.sessionId;
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
catch (err) {
|
|
36
|
+
throw new error_1.SDKError({
|
|
37
|
+
message: 'Error while starting SDK',
|
|
38
|
+
code: error_1.EDefaultErrorCodes.INITIALIZATION_ERROR,
|
|
39
|
+
fatal: true,
|
|
40
|
+
details: err,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.livenessSession = livenessSession;
|
|
@@ -2,7 +2,7 @@ import { type IServiceOptions } from './Service';
|
|
|
2
2
|
import { type TFrameType, type TMediaType } from '../livenessDetection';
|
|
3
3
|
export declare function uploadIdentificationDocument(options: IServiceOptions<TFrameType, TMediaType>): {
|
|
4
4
|
startDocumentUpload: (file: TFrameType) => Promise<void>;
|
|
5
|
-
startLivenessDetection: (startLivenessDetectionOptions?: (Omit<import("../../../../utils/types").ISDKOptions<TFrameType, TMediaType>, "
|
|
5
|
+
startLivenessDetection: (startLivenessDetectionOptions?: (Omit<import("../../../../utils/types").ISDKOptions<TFrameType, TMediaType>, "track" | "token"> & {
|
|
6
6
|
track?: string | undefined;
|
|
7
7
|
token?: string | undefined;
|
|
8
8
|
}) | undefined) => (Omit<{
|
|
@@ -14,7 +14,7 @@ export declare function uploadIdentificationDocument(options: IServiceOptions<TF
|
|
|
14
14
|
getVideoStream?: (() => TMediaType) | undefined;
|
|
15
15
|
}) | undefined;
|
|
16
16
|
startFaceComparison: () => Promise<void>;
|
|
17
|
-
startAll: (file: TFrameType, startLivenessDetectionOptions?: (Omit<import("../../../../utils/types").ISDKOptions<TFrameType, TMediaType>, "
|
|
17
|
+
startAll: (file: TFrameType, startLivenessDetectionOptions?: (Omit<import("../../../../utils/types").ISDKOptions<TFrameType, TMediaType>, "track" | "token"> & {
|
|
18
18
|
track?: string | undefined;
|
|
19
19
|
token?: string | undefined;
|
|
20
20
|
}) | undefined) => void;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@ import { type IServiceOptions } from '../../../../client/liveness/methods/upload
|
|
|
3
3
|
import { type TFrameType, type TMediaType } from '../livenessDetection';
|
|
4
4
|
export declare function uploadIdentificationDocument(options: IServiceOptions<TFrameType, TMediaType>): {
|
|
5
5
|
startDocumentUpload: (file: import("ws").Data) => Promise<void>;
|
|
6
|
-
startLivenessDetection: (startLivenessDetectionOptions?: (Omit<import("../../../../utils/types").ISDKOptions<import("ws").Data, undefined>, "
|
|
6
|
+
startLivenessDetection: (startLivenessDetectionOptions?: (Omit<import("../../../../utils/types").ISDKOptions<import("ws").Data, undefined>, "track" | "token"> & {
|
|
7
7
|
track?: string | undefined;
|
|
8
8
|
token?: string | undefined;
|
|
9
9
|
}) | undefined) => (Omit<{
|
|
@@ -15,7 +15,7 @@ export declare function uploadIdentificationDocument(options: IServiceOptions<TF
|
|
|
15
15
|
getVideoStream?: (() => undefined) | undefined;
|
|
16
16
|
}) | undefined;
|
|
17
17
|
startFaceComparison: () => Promise<void>;
|
|
18
|
-
startAll: (file: import("ws").Data, startLivenessDetectionOptions?: (Omit<import("../../../../utils/types").ISDKOptions<import("ws").Data, undefined>, "
|
|
18
|
+
startAll: (file: import("ws").Data, startLivenessDetectionOptions?: (Omit<import("../../../../utils/types").ISDKOptions<import("ws").Data, undefined>, "track" | "token"> & {
|
|
19
19
|
track?: string | undefined;
|
|
20
20
|
token?: string | undefined;
|
|
21
21
|
}) | undefined) => void;
|
package/utils/constants.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const LIVENESS_API_URL = "https://liveness.santoid.com.br";
|
|
2
|
+
export declare const WEBSOCKET_BASE_URL: string;
|
|
2
3
|
export declare const API_GATEWAY_URL = "https://api.santoid.com.br";
|
|
3
4
|
export declare const APPLICATION_URL = "https://app.santoid.com.br";
|
|
4
5
|
export declare const SEND_FRAMES_INTERVAL_MS = 100;
|
|
5
6
|
export declare const DEFAULT_NUMBER_OF_RETRIES = 5;
|
|
6
7
|
export declare const DEFAULT_RETRY_TIME_STEP = 1000;
|
|
8
|
+
export declare const LIVENESS_PENDING_STATUSES: string[];
|
|
9
|
+
export declare const LIVENESS_RESULT_MAX_ATTEMPTS = 8;
|
|
10
|
+
export declare const LIVENESS_RESULT_RETRY_DELAY_MS = 1500;
|
package/utils/constants.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_RETRY_TIME_STEP = exports.DEFAULT_NUMBER_OF_RETRIES = exports.SEND_FRAMES_INTERVAL_MS = exports.APPLICATION_URL = exports.API_GATEWAY_URL = exports.WEBSOCKET_BASE_URL = void 0;
|
|
4
|
-
exports.
|
|
3
|
+
exports.LIVENESS_RESULT_RETRY_DELAY_MS = exports.LIVENESS_RESULT_MAX_ATTEMPTS = exports.LIVENESS_PENDING_STATUSES = exports.DEFAULT_RETRY_TIME_STEP = exports.DEFAULT_NUMBER_OF_RETRIES = exports.SEND_FRAMES_INTERVAL_MS = exports.APPLICATION_URL = exports.API_GATEWAY_URL = exports.WEBSOCKET_BASE_URL = exports.LIVENESS_API_URL = void 0;
|
|
4
|
+
exports.LIVENESS_API_URL = 'https://liveness.santoid.com.br';
|
|
5
|
+
exports.WEBSOCKET_BASE_URL = `${exports.LIVENESS_API_URL.replace('https://', 'wss://')}/api/v1/liveness/ws`;
|
|
5
6
|
exports.API_GATEWAY_URL = 'https://api.santoid.com.br';
|
|
6
7
|
exports.APPLICATION_URL = 'https://app.santoid.com.br';
|
|
7
8
|
exports.SEND_FRAMES_INTERVAL_MS = 100;
|
|
8
9
|
exports.DEFAULT_NUMBER_OF_RETRIES = 5;
|
|
9
10
|
exports.DEFAULT_RETRY_TIME_STEP = 1000;
|
|
11
|
+
exports.LIVENESS_PENDING_STATUSES = ['CREATED', 'IN_PROGRESS'];
|
|
12
|
+
exports.LIVENESS_RESULT_MAX_ATTEMPTS = 8;
|
|
13
|
+
exports.LIVENESS_RESULT_RETRY_DELAY_MS = 1500;
|
|
@@ -1,263 +0,0 @@
|
|
|
1
|
-
12:18:33.373 INFO Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
|
|
2
|
-
12:18:33.377 INFO Project root configuration file: NONE
|
|
3
|
-
12:18:33.396 INFO SonarScanner CLI 7.1.0.4889
|
|
4
|
-
12:18:33.399 INFO Java 17.0.14 Amazon.com Inc. (64-bit)
|
|
5
|
-
12:18:33.400 INFO Linux 6.1.79 amd64
|
|
6
|
-
12:18:33.401 INFO SONAR_SCANNER_OPTS=-Xmx2048m
|
|
7
|
-
12:18:33.440 INFO User cache: /opt/sonar-scanner/.sonar/cache
|
|
8
|
-
12:18:34.626 INFO Communicating with SonarQube Cloud
|
|
9
|
-
12:18:34.627 INFO JRE provisioning: os[linux], arch[x86_64]
|
|
10
|
-
12:18:39.042 INFO Starting SonarScanner Engine...
|
|
11
|
-
12:18:39.045 INFO Java 17.0.11 Eclipse Adoptium (64-bit)
|
|
12
|
-
12:18:40.547 INFO Load global settings
|
|
13
|
-
12:18:41.123 INFO Load global settings (done) | time=577ms
|
|
14
|
-
12:18:41.129 INFO Server id: 1BD809FA-AWHW8ct9-T_TB3XqouNu
|
|
15
|
-
12:18:41.446 INFO Loading required plugins
|
|
16
|
-
12:18:41.450 INFO Load plugins index
|
|
17
|
-
12:18:41.561 INFO Load plugins index (done) | time=119ms
|
|
18
|
-
12:18:41.562 INFO Load/download plugins
|
|
19
|
-
12:18:42.532 INFO Load/download plugins (done) | time=970ms
|
|
20
|
-
12:18:43.036 INFO Found an active CI vendor: 'Bitbucket Pipelines'
|
|
21
|
-
12:18:43.155 INFO Detected project key 'santodigital_santoid-sdk-javascript' from 'Bitbucket Cloud Pipelines'
|
|
22
|
-
12:18:43.156 INFO Detected organization key 'santodigital' from 'Bitbucket Cloud Pipelines'
|
|
23
|
-
12:18:43.159 INFO Load project settings for component key: 'santodigital_santoid-sdk-javascript'
|
|
24
|
-
12:18:43.518 INFO Load project settings for component key: 'santodigital_santoid-sdk-javascript' (done) | time=358ms
|
|
25
|
-
12:18:43.525 INFO Process project properties
|
|
26
|
-
12:18:43.537 INFO Project key: santodigital_santoid-sdk-javascript
|
|
27
|
-
12:18:43.537 INFO Base dir: /opt/atlassian/pipelines/agent/build
|
|
28
|
-
12:18:43.538 INFO Working dir: /opt/atlassian/pipelines/agent/build/.scannerwork
|
|
29
|
-
12:18:43.544 INFO Load project branches
|
|
30
|
-
12:18:43.745 INFO Load project branches (done) | time=201ms
|
|
31
|
-
12:18:43.749 INFO Check ALM binding of project 'santodigital_santoid-sdk-javascript'
|
|
32
|
-
12:18:43.896 INFO Detected project binding: BOUND
|
|
33
|
-
12:18:43.897 INFO Check ALM binding of project 'santodigital_santoid-sdk-javascript' (done) | time=147ms
|
|
34
|
-
12:18:43.898 INFO Load project pull requests
|
|
35
|
-
12:18:44.103 INFO Load project pull requests (done) | time=204ms
|
|
36
|
-
12:18:44.105 INFO Load branch configuration
|
|
37
|
-
12:18:44.107 INFO Detected analysis for branch 'master'
|
|
38
|
-
12:18:44.107 INFO Auto-configuring branch master
|
|
39
|
-
12:18:44.109 INFO Load branch configuration (done) | time=4ms
|
|
40
|
-
12:18:44.117 INFO Load quality profiles
|
|
41
|
-
12:18:44.520 INFO Load quality profiles (done) | time=404ms
|
|
42
|
-
12:18:44.527 INFO Load active rules
|
|
43
|
-
12:18:51.474 INFO Load active rules (done) | time=6946ms
|
|
44
|
-
12:18:51.624 INFO Organization key: santodigital
|
|
45
|
-
12:18:51.626 INFO Branch name: master, type: long-lived
|
|
46
|
-
12:18:51.642 INFO Preprocessing files...
|
|
47
|
-
12:18:51.839 INFO 1 language detected in 62 preprocessed files (done) | time=197ms
|
|
48
|
-
12:18:51.839 INFO 3 files ignored because of inclusion/exclusion patterns
|
|
49
|
-
12:18:51.840 INFO 0 files ignored because of scm ignore settings
|
|
50
|
-
12:18:51.871 INFO Loading plugins for detected languages
|
|
51
|
-
12:18:51.872 INFO Load/download plugins
|
|
52
|
-
12:18:53.459 INFO Load/download plugins (done) | time=1587ms
|
|
53
|
-
12:18:53.690 INFO SonarJasmin relies on SonarSecurity to define the JS/TS security rule repositories.
|
|
54
|
-
12:18:53.767 INFO Load metrics repository
|
|
55
|
-
12:18:53.875 INFO Load metrics repository (done) | time=109ms
|
|
56
|
-
12:18:53.882 INFO Sensor cache enabled
|
|
57
|
-
12:18:54.209 INFO Load sensor cache
|
|
58
|
-
12:18:55.323 INFO Load sensor cache (180 KB) | time=1114ms
|
|
59
|
-
12:18:55.402 INFO Load project repositories
|
|
60
|
-
12:18:55.685 INFO Load project repositories (done) | time=283ms
|
|
61
|
-
12:18:55.695 INFO Indexing files...
|
|
62
|
-
12:18:55.696 INFO Project configuration:
|
|
63
|
-
12:18:55.697 INFO Excluded sources: **/build-wrapper-dump.json, __tests__/**/*.test.ts
|
|
64
|
-
12:18:55.697 INFO Included tests: __tests__/**/*.test.ts
|
|
65
|
-
12:18:55.794 INFO 62 files indexed (done) | time=97ms
|
|
66
|
-
12:18:55.802 INFO Quality profile for ts: Sonar way
|
|
67
|
-
12:18:55.803 INFO ------------- Run sensors on module santodigital_santoid-sdk-javascript
|
|
68
|
-
12:18:55.849 INFO SonarJasmin relies on SonarSecurity to define the JS/TS security rule repositories.
|
|
69
|
-
12:18:56.591 INFO Sensor JaCoCo XML Report Importer [jacoco]
|
|
70
|
-
12:18:56.592 INFO 'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
|
|
71
|
-
12:18:56.596 INFO No report imported, no coverage information will be imported by JaCoCo XML Report Importer
|
|
72
|
-
12:18:56.597 INFO Sensor JaCoCo XML Report Importer [jacoco] (done) | time=6ms
|
|
73
|
-
12:18:56.598 INFO Sensor Java Config Sensor [iac]
|
|
74
|
-
12:18:56.631 INFO 0 source files to be analyzed
|
|
75
|
-
12:18:56.640 INFO 0/0 source files have been analyzed
|
|
76
|
-
12:18:56.641 INFO Sensor Java Config Sensor [iac] (done) | time=44ms
|
|
77
|
-
12:18:56.641 INFO Sensor JavaScript/TypeScript analysis [javascript]
|
|
78
|
-
12:18:56.859 INFO Detected os: Linux arch: amd64 alpine: false. Platform: LINUX_X64
|
|
79
|
-
12:18:56.860 INFO Deploy location /opt/sonar-scanner/.sonar/js/node-runtime, tagetRuntime: /opt/sonar-scanner/.sonar/js/node-runtime/node, version: /opt/sonar-scanner/.sonar/js/node-runtime/version.txt
|
|
80
|
-
12:19:00.738 INFO Using embedded Node.js runtime.
|
|
81
|
-
12:19:00.738 INFO Using Node.js executable: '/opt/sonar-scanner/.sonar/js/node-runtime/node'.
|
|
82
|
-
12:19:03.644 INFO Memory configuration: OS (10191 MB), Node.js (2096 MB).
|
|
83
|
-
12:19:07.537 INFO Found 1 tsconfig.json file(s): [/opt/atlassian/pipelines/agent/build/tsconfig.json]
|
|
84
|
-
12:19:07.539 INFO Creating TypeScript program
|
|
85
|
-
12:19:07.539 INFO TypeScript configuration file /opt/atlassian/pipelines/agent/build/tsconfig.json
|
|
86
|
-
12:19:07.539 INFO 62 source files to be analyzed
|
|
87
|
-
12:19:09.130 INFO Starting analysis with current program
|
|
88
|
-
12:19:10.151 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_utils_error_ts.udg
|
|
89
|
-
12:19:10.487 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_utils_types_ts.udg
|
|
90
|
-
12:19:10.583 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_utils_constants_ts.udg
|
|
91
|
-
12:19:10.846 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_api_AbstractService_ts.udg
|
|
92
|
-
12:19:10.990 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_api_ApiAsyncService_ts.udg
|
|
93
|
-
12:19:11.208 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_utils_index_ts.udg
|
|
94
|
-
12:19:11.382 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_api_ApiFaceMatchService_ts.udg
|
|
95
|
-
12:19:11.565 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_client_liveness_utils_index_ts.udg
|
|
96
|
-
12:19:11.777 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_api_ApiOcrService_ts.udg
|
|
97
|
-
12:19:11.915 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_api_ApiTypificationService_ts.udg
|
|
98
|
-
12:19:12.296 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_client_liveness_utils_getNextFrame_ts.udg
|
|
99
|
-
12:19:12.384 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_client_core_utils_types_ts.udg
|
|
100
|
-
12:19:12.636 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_client_core_commons_BaseCoreService_ts.udg
|
|
101
|
-
12:19:12.904 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_client_core_methods_faceMatch_Service_ts.udg
|
|
102
|
-
12:19:12.992 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_client_core_methods_faceMatch_index_ts.udg
|
|
103
|
-
12:19:13.101 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_client_core_methods_ocr_Service_ts.udg
|
|
104
|
-
12:19:13.179 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_client_core_methods_ocr_index_ts.udg
|
|
105
|
-
12:19:13.276 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_client_core_methods_typification_Service_ts.udg
|
|
106
|
-
12:19:13.361 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_client_core_methods_typification_index_ts.udg
|
|
107
|
-
12:19:13.471 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_client_embedded_methods_insertUploadIdentificationDocument_index_ts.udg
|
|
108
|
-
12:19:13.506 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_client_embedded_index_ts.udg
|
|
109
|
-
12:19:13.698 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_utils_websocket_ts.udg
|
|
110
|
-
12:19:13.895 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_client_liveness_methods_livenessDetection_Service_ts.udg
|
|
111
|
-
12:19:14.016 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_client_liveness_methods_livenessDetection_index_ts.udg
|
|
112
|
-
12:19:14.466 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_client_liveness_methods_uploadIdentificationDocument_Service_ts.udg
|
|
113
|
-
12:19:14.666 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_client_liveness_methods_uploadIdentificationDocument_index_ts.udg
|
|
114
|
-
12:19:14.879 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_server_auth_index_ts.udg
|
|
115
|
-
12:19:14.963 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_server_liveness_utils_index_ts.udg
|
|
116
|
-
12:19:15.025 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_server_liveness_methods_livenessDetection_Service_ts.udg
|
|
117
|
-
12:19:15.151 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_server_liveness_methods_livenessDetection_index_ts.udg
|
|
118
|
-
12:19:15.284 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_server_liveness_methods_uploadIdentificationDocument_Service_ts.udg
|
|
119
|
-
12:19:15.373 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_server_liveness_methods_uploadIdentificationDocument_index_ts.udg
|
|
120
|
-
12:19:15.500 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_index_ts.udg
|
|
121
|
-
12:19:15.552 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_client_index_ts.udg
|
|
122
|
-
12:19:15.595 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_client_core_index_ts.udg
|
|
123
|
-
12:19:15.624 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_client_liveness_index_ts.udg
|
|
124
|
-
12:19:15.675 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_server_core_methods_typification_Service_ts.udg
|
|
125
|
-
12:19:15.749 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_server_core_methods_typification_index_ts.udg
|
|
126
|
-
12:19:15.813 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_server_core_methods_faceMatch_Service_ts.udg
|
|
127
|
-
12:19:15.874 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_server_core_methods_faceMatch_index_ts.udg
|
|
128
|
-
12:19:15.938 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_server_core_methods_ocr_Service_ts.udg
|
|
129
|
-
12:19:15.997 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_server_core_methods_ocr_index_ts.udg
|
|
130
|
-
12:19:16.043 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_server_index_ts.udg
|
|
131
|
-
12:19:16.089 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_server_core_index_ts.udg
|
|
132
|
-
12:19:16.121 INFO Written udg to file: /opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts/src_server_liveness_index_ts.udg
|
|
133
|
-
12:19:16.127 INFO Analyzed 62 file(s) with current program
|
|
134
|
-
12:19:16.138 INFO 62/62 source files have been analyzed
|
|
135
|
-
12:19:16.139 INFO Done analysis
|
|
136
|
-
12:19:16.140 INFO Hit the cache for 0 out of 62
|
|
137
|
-
12:19:16.142 INFO Miss the cache for 62 out of 62: ANALYSIS_MODE_INELIGIBLE [62/62]
|
|
138
|
-
12:19:16.142 INFO Sensor JavaScript/TypeScript analysis [javascript] (done) | time=19501ms
|
|
139
|
-
12:19:16.143 INFO Sensor CSS Rules [javascript]
|
|
140
|
-
12:19:16.143 INFO No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
|
|
141
|
-
12:19:16.144 INFO Sensor CSS Rules [javascript] (done) | time=1ms
|
|
142
|
-
12:19:16.144 INFO Sensor JavaScript/TypeScript Coverage [javascript]
|
|
143
|
-
12:19:16.144 INFO Analysing [/opt/atlassian/pipelines/agent/build/coverage/lcov.info]
|
|
144
|
-
12:19:16.169 INFO Sensor JavaScript/TypeScript Coverage [javascript] (done) | time=26ms
|
|
145
|
-
12:19:16.170 INFO Sensor IaC Docker Sensor [iac]
|
|
146
|
-
12:19:16.257 INFO 0 source files to be analyzed
|
|
147
|
-
12:19:16.258 INFO 0/0 source files have been analyzed
|
|
148
|
-
12:19:16.258 INFO Sensor IaC Docker Sensor [iac] (done) | time=88ms
|
|
149
|
-
12:19:16.258 INFO Sensor Serverless configuration file sensor [security]
|
|
150
|
-
12:19:16.258 INFO 0 Serverless function entries were found in the project
|
|
151
|
-
12:19:16.261 INFO 0 Serverless function handlers were kept as entrypoints
|
|
152
|
-
12:19:16.261 INFO Sensor Serverless configuration file sensor [security] (done) | time=4ms
|
|
153
|
-
12:19:16.262 INFO Sensor AWS SAM template file sensor [security]
|
|
154
|
-
12:19:16.262 INFO Sensor AWS SAM template file sensor [security] (done) | time=1ms
|
|
155
|
-
12:19:16.262 INFO Sensor AWS SAM Inline template file sensor [security]
|
|
156
|
-
12:19:16.263 INFO Sensor AWS SAM Inline template file sensor [security] (done) | time=1ms
|
|
157
|
-
12:19:16.264 INFO Sensor EnterpriseTextAndSecretsSensor [textenterprise]
|
|
158
|
-
12:19:16.275 INFO Available processors: 4
|
|
159
|
-
12:19:16.275 INFO Using 4 threads for analysis.
|
|
160
|
-
12:19:16.931 INFO Start fetching files for the text and secrets analysis
|
|
161
|
-
12:19:16.939 INFO Using Git CLI to retrieve untracked files
|
|
162
|
-
12:19:16.943 WARN Retrieving only language associated files, make sure to run the analysis inside a git repository to make use of inclusions specified via "sonar.text.inclusions"
|
|
163
|
-
12:19:16.944 INFO Starting the text and secrets analysis
|
|
164
|
-
12:19:16.946 INFO 62 source files to be analyzed for the text and secrets analysis
|
|
165
|
-
12:19:17.882 INFO 62/62 source files have been analyzed for the text and secrets analysis
|
|
166
|
-
12:19:17.884 INFO Start fetching files for the binary file analysis
|
|
167
|
-
12:19:17.885 INFO There are no files to be analyzed for the binary file analysis
|
|
168
|
-
12:19:17.886 INFO Sensor EnterpriseTextAndSecretsSensor [textenterprise] (done) | time=1623ms
|
|
169
|
-
12:19:17.887 INFO Sensor JavaSecuritySensor [security]
|
|
170
|
-
12:19:17.895 INFO 27 taint analysis rules enabled.
|
|
171
|
-
12:19:17.898 INFO No UCFGs have been included for analysis.
|
|
172
|
-
12:19:17.902 INFO java security sensor: Begin: 2025-06-27T12:19:17.889562758Z, End: 2025-06-27T12:19:17.901097357Z, Duration: 00:00:00.011
|
|
173
|
-
Load type hierarchy and UCFGs: Begin: 2025-06-27T12:19:17.895599287Z, End: 2025-06-27T12:19:17.897835909Z, Duration: 00:00:00.002
|
|
174
|
-
Load type hierarchy: Begin: 2025-06-27T12:19:17.895628136Z, End: 2025-06-27T12:19:17.897126344Z, Duration: 00:00:00.001
|
|
175
|
-
Load UCFGs: Begin: 2025-06-27T12:19:17.897654638Z, End: 2025-06-27T12:19:17.897719007Z, Duration: 00:00:00.000
|
|
176
|
-
12:19:17.903 INFO java security sensor peak memory: 281 MB
|
|
177
|
-
12:19:17.903 INFO Sensor JavaSecuritySensor [security] (done) | time=16ms
|
|
178
|
-
12:19:17.904 INFO Sensor CSharpSecuritySensor [security]
|
|
179
|
-
12:19:17.904 INFO 26 taint analysis rules enabled.
|
|
180
|
-
12:19:17.904 INFO No UCFGs have been included for analysis.
|
|
181
|
-
12:19:17.907 INFO csharp security sensor: Begin: 2025-06-27T12:19:17.903415863Z, End: 2025-06-27T12:19:17.904962670Z, Duration: 00:00:00.001
|
|
182
|
-
Load type hierarchy and UCFGs: Begin: 2025-06-27T12:19:17.904008871Z, End: 2025-06-27T12:19:17.904437235Z, Duration: 00:00:00.000
|
|
183
|
-
Load type hierarchy: Begin: 2025-06-27T12:19:17.904012068Z, End: 2025-06-27T12:19:17.904199003Z, Duration: 00:00:00.000
|
|
184
|
-
Load UCFGs: Begin: 2025-06-27T12:19:17.904323843Z, End: 2025-06-27T12:19:17.904351222Z, Duration: 00:00:00.000
|
|
185
|
-
12:19:17.907 INFO csharp security sensor peak memory: 281 MB
|
|
186
|
-
12:19:17.907 INFO Sensor CSharpSecuritySensor [security] (done) | time=2ms
|
|
187
|
-
12:19:17.908 INFO Sensor PhpSecuritySensor [security]
|
|
188
|
-
12:19:17.908 INFO 18 taint analysis rules enabled.
|
|
189
|
-
12:19:17.908 INFO No UCFGs have been included for analysis.
|
|
190
|
-
12:19:17.909 INFO php security sensor: Begin: 2025-06-27T12:19:17.906351649Z, End: 2025-06-27T12:19:17.907547651Z, Duration: 00:00:00.001
|
|
191
|
-
Load type hierarchy and UCFGs: Begin: 2025-06-27T12:19:17.906774257Z, End: 2025-06-27T12:19:17.907078704Z, Duration: 00:00:00.000
|
|
192
|
-
Load type hierarchy: Begin: 2025-06-27T12:19:17.906776950Z, End: 2025-06-27T12:19:17.906878196Z, Duration: 00:00:00.000
|
|
193
|
-
Load UCFGs: Begin: 2025-06-27T12:19:17.906994699Z, End: 2025-06-27T12:19:17.907009832Z, Duration: 00:00:00.000
|
|
194
|
-
12:19:17.909 INFO php security sensor peak memory: 281 MB
|
|
195
|
-
12:19:17.909 INFO Sensor PhpSecuritySensor [security] (done) | time=2ms
|
|
196
|
-
12:19:17.910 INFO Sensor PythonSecuritySensor [security]
|
|
197
|
-
12:19:17.910 INFO 21 taint analysis rules enabled.
|
|
198
|
-
12:19:17.911 INFO No UCFGs have been included for analysis.
|
|
199
|
-
12:19:17.911 INFO python security sensor: Begin: 2025-06-27T12:19:17.908752067Z, End: 2025-06-27T12:19:17.909817717Z, Duration: 00:00:00.001
|
|
200
|
-
Load type hierarchy and UCFGs: Begin: 2025-06-27T12:19:17.909054087Z, End: 2025-06-27T12:19:17.909341430Z, Duration: 00:00:00.000
|
|
201
|
-
Load type hierarchy: Begin: 2025-06-27T12:19:17.909056875Z, End: 2025-06-27T12:19:17.909148997Z, Duration: 00:00:00.000
|
|
202
|
-
Load UCFGs: Begin: 2025-06-27T12:19:17.909255179Z, End: 2025-06-27T12:19:17.909270680Z, Duration: 00:00:00.000
|
|
203
|
-
12:19:17.911 INFO python security sensor peak memory: 281 MB
|
|
204
|
-
12:19:17.911 INFO Sensor PythonSecuritySensor [security] (done) | time=2ms
|
|
205
|
-
12:19:17.912 INFO Sensor JsSecuritySensor [security]
|
|
206
|
-
12:19:17.913 INFO Sensor JsSecuritySensor [security] (done) | time=1ms
|
|
207
|
-
12:19:17.914 INFO Sensor KotlinSecuritySensor [security]
|
|
208
|
-
12:19:17.916 INFO 24 taint analysis rules enabled.
|
|
209
|
-
12:19:17.917 INFO No UCFGs have been included for analysis.
|
|
210
|
-
12:19:17.917 INFO kotlin security sensor: Begin: 2025-06-27T12:19:17.911502017Z, End: 2025-06-27T12:19:17.912565310Z, Duration: 00:00:00.001
|
|
211
|
-
Load type hierarchy and UCFGs: Begin: 2025-06-27T12:19:17.911819853Z, End: 2025-06-27T12:19:17.912131335Z, Duration: 00:00:00.000
|
|
212
|
-
Load type hierarchy: Begin: 2025-06-27T12:19:17.911822492Z, End: 2025-06-27T12:19:17.911910845Z, Duration: 00:00:00.000
|
|
213
|
-
Load UCFGs: Begin: 2025-06-27T12:19:17.912031457Z, End: 2025-06-27T12:19:17.912047293Z, Duration: 00:00:00.000
|
|
214
|
-
12:19:17.920 INFO kotlin security sensor peak memory: 281 MB
|
|
215
|
-
12:19:17.920 INFO Sensor KotlinSecuritySensor [security] (done) | time=2ms
|
|
216
|
-
12:19:17.920 INFO Sensor GoSecuritySensor [security]
|
|
217
|
-
12:19:17.920 INFO No taint analysis rules have been enabled, will not execute taint analysis.
|
|
218
|
-
12:19:17.920 INFO go security sensor: Begin: 2025-06-27T12:19:17.913593100Z, End: 2025-06-27T12:19:17.914053138Z, Duration: 00:00:00.000
|
|
219
|
-
12:19:17.920 INFO go security sensor peak memory: 281 MB
|
|
220
|
-
12:19:17.921 INFO Sensor GoSecuritySensor [security] (done) | time=1ms
|
|
221
|
-
12:19:17.921 INFO ------------- Run sensors on project
|
|
222
|
-
12:19:18.237 INFO Sensor JsSecuritySensorV2 [jasmin]
|
|
223
|
-
12:19:18.242 INFO 45 file(s) will be analysed by SonarJasmin.
|
|
224
|
-
12:19:20.567 INFO Analysis progress: 8% (4/45 files)
|
|
225
|
-
12:19:20.604 INFO Analysis progress: 17% (8/45 files)
|
|
226
|
-
12:19:20.621 INFO Analysis progress: 26% (12/45 files)
|
|
227
|
-
12:19:20.629 INFO Analysis progress: 35% (16/45 files)
|
|
228
|
-
12:19:20.652 INFO Analysis progress: 44% (20/45 files)
|
|
229
|
-
12:19:20.664 INFO Analysis progress: 53% (24/45 files)
|
|
230
|
-
12:19:20.695 INFO Analysis progress: 62% (28/45 files)
|
|
231
|
-
12:19:20.707 INFO Analysis progress: 71% (32/45 files)
|
|
232
|
-
12:19:20.717 INFO Analysis progress: 80% (36/45 files)
|
|
233
|
-
12:19:20.727 INFO Analysis progress: 88% (40/45 files)
|
|
234
|
-
12:19:20.728 INFO Analysis progress: 97% (44/45 files)
|
|
235
|
-
12:19:20.733 INFO Sensor JsSecuritySensorV2 [jasmin] (done) | time=2497ms
|
|
236
|
-
12:19:20.734 INFO Sensor TsArchitectureSensor [architecture]
|
|
237
|
-
12:19:20.756 INFO * Protobuf reading starting | memory total=248 | free=45 | used=202 (MB)
|
|
238
|
-
12:19:20.756 INFO * Reading SonarArchitecture IR data from directory "/opt/atlassian/pipelines/agent/build/.scannerwork/architecture/ts"
|
|
239
|
-
12:19:20.942 INFO * Files successfully loaded: "45" out of "45"
|
|
240
|
-
12:19:20.942 INFO * Protobuf reading complete | memory total=248 | free=168 | used=79 (MB)
|
|
241
|
-
12:19:20.949 INFO * Build file hiGraphs complete | memory total=248 | free=167 | used=80 (MB)
|
|
242
|
-
12:19:20.952 INFO * Slicing complete | memory total=248 | free=165 | used=82 (MB)
|
|
243
|
-
12:19:20.953 INFO * Cycle detection complete | memory total=248 | free=165 | used=82 (MB)
|
|
244
|
-
12:19:20.968 INFO * Build file hiGraphs complete | memory total=248 | free=165 | used=82 (MB)
|
|
245
|
-
12:19:20.970 INFO * Slicing complete | memory total=248 | free=165 | used=82 (MB)
|
|
246
|
-
12:19:20.993 INFO * Export complete | memory total=248 | free=163 | used=84 (MB)
|
|
247
|
-
12:19:20.994 INFO Sensor TsArchitectureSensor [architecture] (done) | time=260ms
|
|
248
|
-
12:19:20.994 INFO Sensor Zero Coverage Sensor
|
|
249
|
-
12:19:20.995 INFO Sensor Zero Coverage Sensor (done) | time=1ms
|
|
250
|
-
12:19:21.017 INFO CPD Executor 9 files had no CPD blocks
|
|
251
|
-
12:19:21.017 INFO CPD Executor Calculating CPD for 36 files
|
|
252
|
-
12:19:21.057 INFO CPD Executor CPD calculation finished (done) | time=38ms
|
|
253
|
-
12:19:21.187 INFO Analysis report generated in 127ms, dir size=510 KB
|
|
254
|
-
12:19:21.283 INFO Analysis report compressed in 95ms, zip size=204 KB
|
|
255
|
-
12:19:22.180 INFO Analysis report uploaded in 897ms
|
|
256
|
-
12:19:22.181 INFO ANALYSIS SUCCESSFUL, you can find the results at: https://sonarcloud.io/dashboard?id=santodigital_santoid-sdk-javascript&branch=master
|
|
257
|
-
12:19:22.182 INFO Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
|
|
258
|
-
12:19:22.182 INFO More about the report processing at https://sonarcloud.io/api/ce/task?id=AZexVAE_dMEm5pLg6rRk
|
|
259
|
-
12:19:23.082 INFO Sensor cache published successfully
|
|
260
|
-
12:19:23.204 INFO Analysis total time: 40.478 s
|
|
261
|
-
12:19:23.204 INFO SonarScanner Engine completed successfully
|
|
262
|
-
12:19:23.553 INFO EXECUTION SUCCESS
|
|
263
|
-
12:19:23.555 INFO Total time: 50.186s
|