@everymatrix/player-kyc-verification 1.24.7 → 1.26.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.
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-95fc1c57.js');
6
6
 
7
7
  const DEFAULT_LANGUAGE = 'en';
8
- const SUPPORTED_LANGUAGES = ['de', 'en'];
8
+ const SUPPORTED_LANGUAGES = ['de', 'en', 'hr'];
9
9
  let TRANSLATIONS = {
10
10
  en: {
11
11
  loading: 'Loading, please wait ...',
@@ -71,6 +71,19 @@ let TRANSLATIONS = {
71
71
  successUploadMultipleFiles: 'Your documents have been uploaded and it will be reviewed shortly',
72
72
  failedUpload: 'Upload failed please try again',
73
73
  chooseDocument: 'Choose Document',
74
+ },
75
+ hr: {
76
+ loading: 'Učitavanje, molimo pričekajte ...',
77
+ noVerificationRequired: 'Trenutačno nije potrebna provjera vašeg računa.',
78
+ verificationComplete: 'Provjera dovršena',
79
+ verificationFailed: 'Provjera nije uspjela',
80
+ verificationExpired: 'Provjera je istekla',
81
+ fileSizeExceeded: 'Premašena je maksimalna veličina datoteke. Maksimalna veličina datoteke je: 50mb',
82
+ uploading: 'Prijenos…',
83
+ successUpload: 'Vaš dokument je učitan i uskoro će biti pregledan',
84
+ successUploadMultipleFiles: 'Vaši su dokumenti učitani i uskoro će biti pregledani',
85
+ failedUpload: 'Prijenos nije uspio pokušajte ponovo',
86
+ chooseDocument: 'Odaberite Dokument',
74
87
  }
75
88
  };
76
89
  const getTranslations = (url) => {
@@ -1,5 +1,5 @@
1
1
  const DEFAULT_LANGUAGE = 'en';
2
- const SUPPORTED_LANGUAGES = ['de', 'en'];
2
+ const SUPPORTED_LANGUAGES = ['de', 'en', 'hr'];
3
3
  let TRANSLATIONS = {
4
4
  en: {
5
5
  loading: 'Loading, please wait ...',
@@ -65,6 +65,19 @@ let TRANSLATIONS = {
65
65
  successUploadMultipleFiles: 'Your documents have been uploaded and it will be reviewed shortly',
66
66
  failedUpload: 'Upload failed please try again',
67
67
  chooseDocument: 'Choose Document',
68
+ },
69
+ hr: {
70
+ loading: 'Učitavanje, molimo pričekajte ...',
71
+ noVerificationRequired: 'Trenutačno nije potrebna provjera vašeg računa.',
72
+ verificationComplete: 'Provjera dovršena',
73
+ verificationFailed: 'Provjera nije uspjela',
74
+ verificationExpired: 'Provjera je istekla',
75
+ fileSizeExceeded: 'Premašena je maksimalna veličina datoteke. Maksimalna veličina datoteke je: 50mb',
76
+ uploading: 'Prijenos…',
77
+ successUpload: 'Vaš dokument je učitan i uskoro će biti pregledan',
78
+ successUploadMultipleFiles: 'Vaši su dokumenti učitani i uskoro će biti pregledani',
79
+ failedUpload: 'Prijenos nije uspio pokušajte ponovo',
80
+ chooseDocument: 'Odaberite Dokument',
68
81
  }
69
82
  };
70
83
  export const getTranslations = (url) => {
@@ -1,7 +1,7 @@
1
1
  import { proxyCustomElement, HTMLElement, h, Fragment } from '@stencil/core/internal/client';
2
2
 
3
3
  const DEFAULT_LANGUAGE = 'en';
4
- const SUPPORTED_LANGUAGES = ['de', 'en'];
4
+ const SUPPORTED_LANGUAGES = ['de', 'en', 'hr'];
5
5
  let TRANSLATIONS = {
6
6
  en: {
7
7
  loading: 'Loading, please wait ...',
@@ -67,6 +67,19 @@ let TRANSLATIONS = {
67
67
  successUploadMultipleFiles: 'Your documents have been uploaded and it will be reviewed shortly',
68
68
  failedUpload: 'Upload failed please try again',
69
69
  chooseDocument: 'Choose Document',
70
+ },
71
+ hr: {
72
+ loading: 'Učitavanje, molimo pričekajte ...',
73
+ noVerificationRequired: 'Trenutačno nije potrebna provjera vašeg računa.',
74
+ verificationComplete: 'Provjera dovršena',
75
+ verificationFailed: 'Provjera nije uspjela',
76
+ verificationExpired: 'Provjera je istekla',
77
+ fileSizeExceeded: 'Premašena je maksimalna veličina datoteke. Maksimalna veličina datoteke je: 50mb',
78
+ uploading: 'Prijenos…',
79
+ successUpload: 'Vaš dokument je učitan i uskoro će biti pregledan',
80
+ successUploadMultipleFiles: 'Vaši su dokumenti učitani i uskoro će biti pregledani',
81
+ failedUpload: 'Prijenos nije uspio pokušajte ponovo',
82
+ chooseDocument: 'Odaberite Dokument',
70
83
  }
71
84
  };
72
85
  const getTranslations = (url) => {
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, h, F as Fragment } from './index-abf8c718.js';
2
2
 
3
3
  const DEFAULT_LANGUAGE = 'en';
4
- const SUPPORTED_LANGUAGES = ['de', 'en'];
4
+ const SUPPORTED_LANGUAGES = ['de', 'en', 'hr'];
5
5
  let TRANSLATIONS = {
6
6
  en: {
7
7
  loading: 'Loading, please wait ...',
@@ -67,6 +67,19 @@ let TRANSLATIONS = {
67
67
  successUploadMultipleFiles: 'Your documents have been uploaded and it will be reviewed shortly',
68
68
  failedUpload: 'Upload failed please try again',
69
69
  chooseDocument: 'Choose Document',
70
+ },
71
+ hr: {
72
+ loading: 'Učitavanje, molimo pričekajte ...',
73
+ noVerificationRequired: 'Trenutačno nije potrebna provjera vašeg računa.',
74
+ verificationComplete: 'Provjera dovršena',
75
+ verificationFailed: 'Provjera nije uspjela',
76
+ verificationExpired: 'Provjera je istekla',
77
+ fileSizeExceeded: 'Premašena je maksimalna veličina datoteke. Maksimalna veličina datoteke je: 50mb',
78
+ uploading: 'Prijenos…',
79
+ successUpload: 'Vaš dokument je učitan i uskoro će biti pregledan',
80
+ successUploadMultipleFiles: 'Vaši su dokumenti učitani i uskoro će biti pregledani',
81
+ failedUpload: 'Prijenos nije uspio pokušajte ponovo',
82
+ chooseDocument: 'Odaberite Dokument',
70
83
  }
71
84
  };
72
85
  const getTranslations = (url) => {
@@ -0,0 +1 @@
1
+ import{r as i,h as e,F as t}from"./p-1f2596d0.js";const n=["de","en","hr"];let o={en:{loading:"Loading, please wait ...",noVerificationRequired:"There is no verification required for your account at this moment.",verificationComplete:"Verification complete",verificationFailed:"Verification failed",verificationExpired:"Verification expired",fileSizeExceeded:"Maximum file size exceeded. Max file size is: 50mb",uploading:"Uploading ... ",successUpload:"Your document has been uploaded and it will be reviewed shortly",successUploadMultipleFiles:"Your documents have been uploaded and it will be reviewed shortly",failedUpload:"Upload failed please try again",chooseDocument:"Choose Document"},de:{loading:"Loading, please wait ...",noVerificationRequired:"There is no verification required for your account at this moment.",verificationComplete:"Verification complete",verificationFailed:"Verification failed",verificationExpired:"Verification expired",fileSizeExceeded:"Maximum file size exceeded. Max file size is: 50mb",uploading:"Uploading ... ",successUpload:"Your document has been uploaded and it will be reviewed shortly",successUploadMultipleFiles:"Your documents have been uploaded and it will be reviewed shortly",failedUpload:"Upload failed please try again",chooseDocument:"Choose Document"},ro:{loading:"Loading, please wait ...",noVerificationRequired:"There is no verification required for your account at this moment.",verificationComplete:"Verification complete",verificationFailed:"Verification failed",verificationExpired:"Verification expired",fileSizeExceeded:"Maximum file size exceeded. Max file size is: 50mb",uploading:"Uploading ... ",successUpload:"Your document has been uploaded and it will be reviewed shortly",successUploadMultipleFiles:"Your documents have been uploaded and it will be reviewed shortly",failedUpload:"Upload failed please try again",chooseDocument:"Choose Document"},fr:{loading:"Loading, please wait ...",noVerificationRequired:"There is no verification required for your account at this moment.",verificationComplete:"Verification complete",verificationFailed:"Verification failed",verificationExpired:"Verification expired",fileSizeExceeded:"Maximum file size exceeded. Max file size is: 50mb",uploading:"Uploading ... ",successUpload:"Your document has been uploaded and it will be reviewed shortly",successUploadMultipleFiles:"Your documents have been uploaded and it will be reviewed shortly",failedUpload:"Upload failed please try again",chooseDocument:"Choose Document"},ar:{loading:"Loading, please wait ...",noVerificationRequired:"There is no verification required for your account at this moment.",verificationComplete:"Verification complete",verificationFailed:"Verification failed",verificationExpired:"Verification expired",fileSizeExceeded:"Maximum file size exceeded. Max file size is: 50mb",uploading:"Uploading ... ",successUpload:"Your document has been uploaded and it will be reviewed shortly",successUploadMultipleFiles:"Your documents have been uploaded and it will be reviewed shortly",failedUpload:"Upload failed please try again",chooseDocument:"Choose Document"},hr:{loading:"Učitavanje, molimo pričekajte ...",noVerificationRequired:"Trenutačno nije potrebna provjera vašeg računa.",verificationComplete:"Provjera dovršena",verificationFailed:"Provjera nije uspjela",verificationExpired:"Provjera je istekla",fileSizeExceeded:"Premašena je maksimalna veličina datoteke. Maksimalna veličina datoteke je: 50mb",uploading:"Prijenos…",successUpload:"Vaš dokument je učitan i uskoro će biti pregledan",successUploadMultipleFiles:"Vaši su dokumenti učitani i uskoro će biti pregledani",failedUpload:"Prijenos nije uspio pokušajte ponovo",chooseDocument:"Odaberite Dokument"}};const a=i=>new Promise((e=>{fetch(i).then((i=>i.json())).then((i=>{Object.keys(i).forEach((e=>{for(let t in i[e])o[e][t]=i[e][t]})),e(!0)}))})),r=(i,e,t)=>{const a=e;let r=o[void 0!==a&&n.includes(a)?a:"en"][i];if(void 0!==t)for(const[i,e]of Object.entries(t.values)){const t=new RegExp(`{${i}}`,"g");r=r.replace(t,e)}return r},s=class{constructor(e){i(this,e),this.kycTitle="",this.description="",this.userId="",this.session="",this.endpoint="",this.translationUrl="",this.clientStyling="",this.verifiedIcon="",this.failedIcon="",this.defaultIcon="",this.clientStylingUrl="",this.verificationType=[],this.isLoading=!1,this.stylingAppends=!1,this.selectedFiles=null,this.uploadSizeExceeded=!1,this.expandedOnDesktop=!1,this.scriptInjected=!1,this.MAX_UPLOAD_SIZE=5e7,this.setClientStyling=()=>{let i=document.createElement("style");i.innerHTML=this.clientStyling,this.stylingContainer.prepend(i)},this.setClientStylingURL=()=>{let i=new URL(this.clientStylingUrl),e=document.createElement("style");fetch(i.href).then((i=>i.text())).then((i=>{e.innerHTML=i,setTimeout((()=>{this.stylingContainer.prepend(e)}),1)})).catch((i=>{console.log("error ",i)}))}}handleNewTranslations(){this.isLoading=!0,a(this.translationUrl).then((()=>{this.isLoading=!1}))}async componentWillLoad(){this.translationUrl.length>2&&await a(this.translationUrl)}componentDidRender(){!this.stylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.stylingAppends=!0)}async componentDidLoad(){window.innerWidth>700&&(this.expandedOnDesktop=!0);try{let i=new URL(`${this.endpoint}/v2/player/${this.userId}/verification/GetKYCCustomerStatus`);const e={method:"POST",headers:{"X-SessionId":this.session,"Content-Type":"application/json"},body:JSON.stringify({})};fetch(i.href,e).then((i=>{if(200===i.status)return i.json();throw new Error("HTTP status "+i.status)})).then((i=>{this.verificationType=i.verifications})).catch((i=>{console.error(i)}))}catch(i){console.error("Error fetching verification types:",i)}}handleOptionChange(i,e){const t=i.target;this.selectedOption=t.value,this.verificationType=this.verificationType.map((i=>(i.type===e&&(i.optionChosen=t.value),i)))}handleDocumentsStatus(i,e,t){this.verificationType=this.verificationType.map((n=>{if(n.type===i){const i=n.documents.find((i=>i.code===t));i&&(i.statusUploaded=e)}return n}))}toggleVerificationType(i,e){this.expandedOnDesktop=!1,this.verificationType=this.verificationType.map((t=>{var n;return t.type===i&&(null===(n=t.flowInfo)||void 0===n?void 0:n.type)==e&&(t.expanded=!t.expanded),t}))}checkFileSize(i){let e=0;return Object.keys(i).forEach((t=>{e+=i[t].size})),e<=this.MAX_UPLOAD_SIZE}handleFileSelection(i,e,t){if(this.selectedFiles=i,this.selectedFiles)if(this.checkFileSize(this.selectedFiles)){const i={method:"POST",headers:{"Content-Type":"application/json","X-SessionId":this.session},body:JSON.stringify({DocumentCode:e})};fetch(`${this.endpoint}/v1/player/${this.userId}/verification/GetKYCVerificationDocumentUploadUrl`,i).then((i=>{if(i.ok)return this.uploadingStatus=r("uploading",this.language),this.handleDocumentsStatus(t,this.uploadingStatus,e),i.json()})).then((i=>{const n=new FormData,o=this.selectedFiles;for(let i=0;i<o.length;i++)n.append("files",o[i]);fetch(i.Url,{method:"POST",body:n}).then((i=>{i.ok?(this.uploadingStatus=r(this.selectedFiles.length>1?"successUploadMultipleFiles":"successUpload",this.language),this.handleDocumentsStatus(t,this.uploadingStatus,e)):(this.uploadingStatus=r("failedUpload",this.language),this.handleDocumentsStatus(t,this.uploadingStatus,e),console.error("File upload error:",i.status))})).catch((i=>{console.error("File upload error:",i)}))})).catch((i=>{console.error("File upload error:",i)}))}else console.error(r("fileSizeExceeded",this.language)),this.uploadingStatus=r("fileSizeExceeded",this.language),this.handleDocumentsStatus(t,this.uploadingStatus,e),this.uploadSizeExceeded=!0}importScript(i){return new Promise(((e,t)=>{fetch(i).then((i=>i.text())).then((i=>{if(new Function(i)(),this.scriptInjected)e(!0);else{const i=document.createElement("script");i.src="https://test.insic.de/frontend3/static/js/avs-loader.min.js",document.head.appendChild(i),this.scriptInjected=!0,e(!0)}})).catch((i=>{t(i)}))}))}renderVerificationTypeBox(i){var n,o;this.expandedOnDesktop&&(i.expanded=!0);let a=i.expanded,s=i.type.replace(/([A-Z])/g," $1"),l=i.optionChosen,c=i.status,d=i.documents,p=i.flowInfo;"Widget"===(null==p?void 0:p.type)&&this.importScript(p.url).then((()=>{console.log("Script imported correctly")})).catch((i=>{console.error("Error importing script:",i)}));const h="Verified"===c,f="Failed"===c||"Expired"===c;return e("div",{class:`verification-box ${a?"expanded":""} ${f?"failed":""} ${h?"success":""}`},e("div",{class:"box box-header "+(a?"expanded":""),onClick:()=>{var e;return this.toggleVerificationType(i.type,null===(e=i.flowInfo)||void 0===e?void 0:e.type)}},e("div",{class:"box-icon"},e("div",null,h?this.verifiedIcon?e("img",{class:"CustomVerifiedIcon",src:this.verifiedIcon,alt:""}):e("svg",{width:"100",height:"100",viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg"},e("circle",{cx:"50",cy:"50",r:"40",fill:"#388D79"}),e("circle",{cx:"50",cy:"50",r:"34",fill:"none",stroke:"#fff","stroke-width":"12px"}),e("polyline",{points:"30,50 45,63 70,35",fill:"none",stroke:"#fff","stroke-width":"8px"})):f?this.failedIcon?e("img",{class:"CustomFailedIcon",src:this.failedIcon,alt:""}):e("svg",{width:"100",height:"100",viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg"},e("circle",{cx:"50",cy:"50",r:"40",fill:"red"}),e("line",{x1:"30",y1:"30",x2:"70",y2:"70",stroke:"#fff","stroke-width":"10px"}),e("line",{x1:"30",y1:"70",x2:"70",y2:"30",stroke:"#fff","stroke-width":"10px"})):this.defaultIcon?e("img",{class:"CustomDefaultIcon",src:this.defaultIcon,alt:""}):e("svg",{width:"800px",height:"800px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M4 4V20C4 21.1046 4.89543 22 6 22L18 22C19.1046 22 20 21.1046 20 20V8.34162C20 7.8034 19.7831 7.28789 19.3982 6.91161L14.9579 2.56999C14.5842 2.20459 14.0824 2 13.5597 2L6 2C4.89543 2 4 2.89543 4 4Z",stroke:"#000000","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M9 13H15",stroke:"#000000","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M9 17H12",stroke:"#000000","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M14 2V6C14 7.10457 14.8954 8 16 8H20",stroke:"#000000","stroke-width":"2","stroke-linejoin":"round"})))),e("div",{class:"box-title"},s),e("div",{class:"chevron-icon"},e("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},e("path",{d:a?"M6 15l6-6 6 6":"M6 9l6 6 6-6"})))),e("div",{class:"box box-content"},a&&"Widget"!=(null==p?void 0:p.type)?e(t,null,h?e("div",{class:"verification-status"},r("verificationComplete",this.language)):f?e("div",{class:"verification-status"},r("Failed"===c?"verificationFailed":"verificationExpired",this.language)):d.length>0?e("div",{class:"documents-dropdown"},e("select",{class:"nice-select",onChange:e=>this.handleOptionChange(e,i.type)},e("option",{value:"",selected:!0,disabled:!0,hidden:!0},r("chooseDocument",this.language)),d.map((i=>e("option",{selected:l==i.code,value:i.code},i.type.replace(/([A-Z])/g," $1"))))),(null===(n=d.find((i=>i.code==l)))||void 0===n?void 0:n.statusUploaded)?e("div",{class:"upload-status"},null===(o=d.find((i=>i.code==l)))||void 0===o?void 0:o.statusUploaded):e("div",{class:"upload-button"},l?e("label",null,e("input",{type:"file",accept:"*",multiple:!0,onChange:e=>this.handleFileSelection(e.target.files,this.selectedOption,i.type),style:{display:"none"}}),e("svg",{width:"100",height:"100",xmlns:"http://www.w3.org/2000/svg"},e("circle",{cx:"50",cy:"50",r:"40",fill:"#388D79"}),e("line",{x1:"30",y1:"50",x2:"70",y2:"50",stroke:"white","stroke-width":"6"}),e("line",{x1:"50",y1:"30",x2:"50",y2:"70",stroke:"white","stroke-width":"6"}))):null)):null):e("div",{id:"__avs-wrapper"})))}render(){return this.isLoading?e("div",null,e("p",null,r("loading",this.language))):0===this.verificationType.length?e("div",{style:{padding:"24px",fontSize:"18px"}},r("noVerificationRequired",this.language)):e("div",{class:"ModalContainer",ref:i=>this.stylingContainer=i},e("div",{class:"player-kyc-verification-widget"},e("h2",null,this.kycTitle),e("div",{class:"widget-description"},this.description),e("div",{class:"verification-types"},this.verificationType.map((i=>"Manual"===i.vendorName||"Insic"===i.vendorName?this.renderVerificationTypeBox(i):null)))))}static get watchers(){return{translationUrl:["handleNewTranslations"]}}};s.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");\n:host {\n font-family: "Roboto", sans-serif;\n}\n\n.ModalContainer {\n container-type: inline-size;\n}\n\n.player-kyc-verification-widget {\n padding: 20px;\n align-items: center;\n}\n.player-kyc-verification-widget h2 {\n margin: 4px;\n}\n.player-kyc-verification-widget .widget-description {\n margin: 24px 0px;\n}\n.player-kyc-verification-widget .verification-types {\n width: 100%;\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n grid-gap: 34px;\n}\n.player-kyc-verification-widget .verification-types .verification-box {\n transition: height 0.3s, border-color 0.3s;\n border: solid 1.4px #b5b5b5;\n border-radius: 2px;\n display: flex;\n flex-direction: column;\n padding: 0px 14px;\n border-width: 2px 2px 8px 2px;\n align-self: start;\n}\n.player-kyc-verification-widget .verification-types .verification-box .box {\n flex-shrink: 0;\n}\n.player-kyc-verification-widget .verification-types .verification-box .box-header {\n display: flex;\n padding: 14px 0px;\n justify-content: space-between;\n cursor: pointer;\n align-items: center;\n}\n.player-kyc-verification-widget .verification-types .verification-box .box-header .box-icon {\n flex-grow: 1;\n display: flex;\n justify-content: center;\n}\n.player-kyc-verification-widget .verification-types .verification-box .box-header .box-icon svg {\n height: 24px;\n width: 24px;\n}\n.player-kyc-verification-widget .verification-types .verification-box .box-header .box-title {\n flex-grow: 1;\n font-size: 18px;\n}\n.player-kyc-verification-widget .verification-types .verification-box .box-header .chevron-icon {\n flex-grow: 10;\n width: 14px;\n height: 14px;\n display: flex;\n justify-content: flex-end;\n}\n.player-kyc-verification-widget .verification-types .verification-box .box-header .chevron-icon svg {\n width: 20px;\n height: 22px;\n}\n.player-kyc-verification-widget .verification-types .verification-box .box-content {\n display: none;\n flex-grow: 1;\n border-top: 0.4px solid #bcbcbc;\n padding: 10px 0px;\n flex-grow: 1;\n}\n.player-kyc-verification-widget .verification-types .verification-box .box-content .upload-status {\n text-align: center;\n padding: 20px;\n}\n.player-kyc-verification-widget .verification-types .verification-box .box-content .documents-dropdown {\n display: flex;\n flex-direction: column;\n width: 100%;\n align-items: center;\n}\n.player-kyc-verification-widget .verification-types .verification-box .box-content .documents-dropdown svg {\n margin: 16px;\n cursor: pointer;\n}\n.player-kyc-verification-widget .verification-types .verification-box .box-content .documents-dropdown .nice-select {\n cursor: pointer;\n width: 100%;\n height: 30px;\n padding: 4px 14px;\n font-size: 14px;\n border: 1px solid #ccc;\n border-radius: 2px;\n background-color: #fff;\n color: #333;\n appearance: none;\n -webkit-appearance: none;\n -moz-appearance: none;\n padding-right: 30px;\n background-repeat: no-repeat;\n background-position: right 10px center;\n background-image: url(\'data:image/svg+xml;charset=utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><path fill="%23333" d="M10 18.4l-6.5-6.5h13z"/><path fill="%23333" d="M10 1.6l6.5 6.5H3.5z"/></svg>\');\n}\n.player-kyc-verification-widget .verification-types .verification-box.expanded {\n border-color: green;\n min-height: 120px;\n}\n.player-kyc-verification-widget .verification-types .verification-box.failed {\n border-color: #d42323;\n}\n.player-kyc-verification-widget .verification-types .verification-box.success {\n border-color: green;\n}\n.player-kyc-verification-widget .verification-types .verification-box.expanded .box-content {\n display: flex;\n justify-content: center;\n flex-direction: column;\n}\n.player-kyc-verification-widget .verification-types .verification-box.expanded .box-content .verification-status {\n margin: 12px 0px 16px;\n font-size: 18px;\n text-align: center;\n color: #9b9b9b;\n}\n\n@container (min-width: 700px) {\n .player-kyc-verification-widget {\n padding: 100px 60px;\n }\n}\n@container (max-width: 700px) {\n .player-kyc-verification-widget h2 {\n margin: 4px;\n text-align: center;\n }\n .player-kyc-verification-widget .verification-types {\n grid-template-columns: 1fr;\n grid-gap: 16px;\n }\n}\n@container (max-width: 1240px) and (min-width: 701px) {\n .player-kyc-verification-widget .verification-types {\n grid-template-columns: repeat(2, 1fr);\n }\n}';export{s as player_kyc_verification}
@@ -1 +1 @@
1
- import{p as e,b as i}from"./p-1f2596d0.js";(()=>{const i=import.meta.url,n={};return""!==i&&(n.resourcesUrl=new URL(".",i).href),e(n)})().then((e=>i([["p-7ad5e6ec",[[1,"player-kyc-verification",{kycTitle:[1,"kyc-title"],description:[1],userId:[1,"user-id"],session:[1],language:[1],endpoint:[1],translationUrl:[1,"translation-url"],clientStyling:[1,"client-styling"],verifiedIcon:[1,"verified-icon"],failedIcon:[1,"failed-icon"],defaultIcon:[1,"default-icon"],clientStylingUrl:[1,"client-styling-url"],verificationType:[32],isLoading:[32],stylingAppends:[32],selectedFiles:[32],uploadingStatus:[32],uploadSizeExceeded:[32],selectedOption:[32],expandedOnDesktop:[32]}]]]],e)));
1
+ import{p as e,b as i}from"./p-1f2596d0.js";(()=>{const i=import.meta.url,n={};return""!==i&&(n.resourcesUrl=new URL(".",i).href),e(n)})().then((e=>i([["p-f71e51ae",[[1,"player-kyc-verification",{kycTitle:[1,"kyc-title"],description:[1],userId:[1,"user-id"],session:[1],language:[1],endpoint:[1],translationUrl:[1,"translation-url"],clientStyling:[1,"client-styling"],verifiedIcon:[1,"verified-icon"],failedIcon:[1,"failed-icon"],defaultIcon:[1,"default-icon"],clientStylingUrl:[1,"client-styling-url"],verificationType:[32],isLoading:[32],stylingAppends:[32],selectedFiles:[32],uploadingStatus:[32],uploadSizeExceeded:[32],selectedOption:[32],expandedOnDesktop:[32]}]]]],e)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/player-kyc-verification",
3
- "version": "1.24.7",
3
+ "version": "1.26.0",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",
@@ -1 +0,0 @@
1
- import{r as i,h as e,F as t}from"./p-1f2596d0.js";const n=["de","en"];let o={en:{loading:"Loading, please wait ...",noVerificationRequired:"There is no verification required for your account at this moment.",verificationComplete:"Verification complete",verificationFailed:"Verification failed",verificationExpired:"Verification expired",fileSizeExceeded:"Maximum file size exceeded. Max file size is: 50mb",uploading:"Uploading ... ",successUpload:"Your document has been uploaded and it will be reviewed shortly",successUploadMultipleFiles:"Your documents have been uploaded and it will be reviewed shortly",failedUpload:"Upload failed please try again",chooseDocument:"Choose Document"},de:{loading:"Loading, please wait ...",noVerificationRequired:"There is no verification required for your account at this moment.",verificationComplete:"Verification complete",verificationFailed:"Verification failed",verificationExpired:"Verification expired",fileSizeExceeded:"Maximum file size exceeded. Max file size is: 50mb",uploading:"Uploading ... ",successUpload:"Your document has been uploaded and it will be reviewed shortly",successUploadMultipleFiles:"Your documents have been uploaded and it will be reviewed shortly",failedUpload:"Upload failed please try again",chooseDocument:"Choose Document"},ro:{loading:"Loading, please wait ...",noVerificationRequired:"There is no verification required for your account at this moment.",verificationComplete:"Verification complete",verificationFailed:"Verification failed",verificationExpired:"Verification expired",fileSizeExceeded:"Maximum file size exceeded. Max file size is: 50mb",uploading:"Uploading ... ",successUpload:"Your document has been uploaded and it will be reviewed shortly",successUploadMultipleFiles:"Your documents have been uploaded and it will be reviewed shortly",failedUpload:"Upload failed please try again",chooseDocument:"Choose Document"},fr:{loading:"Loading, please wait ...",noVerificationRequired:"There is no verification required for your account at this moment.",verificationComplete:"Verification complete",verificationFailed:"Verification failed",verificationExpired:"Verification expired",fileSizeExceeded:"Maximum file size exceeded. Max file size is: 50mb",uploading:"Uploading ... ",successUpload:"Your document has been uploaded and it will be reviewed shortly",successUploadMultipleFiles:"Your documents have been uploaded and it will be reviewed shortly",failedUpload:"Upload failed please try again",chooseDocument:"Choose Document"},ar:{loading:"Loading, please wait ...",noVerificationRequired:"There is no verification required for your account at this moment.",verificationComplete:"Verification complete",verificationFailed:"Verification failed",verificationExpired:"Verification expired",fileSizeExceeded:"Maximum file size exceeded. Max file size is: 50mb",uploading:"Uploading ... ",successUpload:"Your document has been uploaded and it will be reviewed shortly",successUploadMultipleFiles:"Your documents have been uploaded and it will be reviewed shortly",failedUpload:"Upload failed please try again",chooseDocument:"Choose Document"}};const r=i=>new Promise((e=>{fetch(i).then((i=>i.json())).then((i=>{Object.keys(i).forEach((e=>{for(let t in i[e])o[e][t]=i[e][t]})),e(!0)}))})),a=(i,e,t)=>{const r=e;let a=o[void 0!==r&&n.includes(r)?r:"en"][i];if(void 0!==t)for(const[i,e]of Object.entries(t.values)){const t=new RegExp(`{${i}}`,"g");a=a.replace(t,e)}return a},s=class{constructor(e){i(this,e),this.kycTitle="",this.description="",this.userId="",this.session="",this.endpoint="",this.translationUrl="",this.clientStyling="",this.verifiedIcon="",this.failedIcon="",this.defaultIcon="",this.clientStylingUrl="",this.verificationType=[],this.isLoading=!1,this.stylingAppends=!1,this.selectedFiles=null,this.uploadSizeExceeded=!1,this.expandedOnDesktop=!1,this.scriptInjected=!1,this.MAX_UPLOAD_SIZE=5e7,this.setClientStyling=()=>{let i=document.createElement("style");i.innerHTML=this.clientStyling,this.stylingContainer.prepend(i)},this.setClientStylingURL=()=>{let i=new URL(this.clientStylingUrl),e=document.createElement("style");fetch(i.href).then((i=>i.text())).then((i=>{e.innerHTML=i,setTimeout((()=>{this.stylingContainer.prepend(e)}),1)})).catch((i=>{console.log("error ",i)}))}}handleNewTranslations(){this.isLoading=!0,r(this.translationUrl).then((()=>{this.isLoading=!1}))}async componentWillLoad(){this.translationUrl.length>2&&await r(this.translationUrl)}componentDidRender(){!this.stylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.stylingAppends=!0)}async componentDidLoad(){window.innerWidth>700&&(this.expandedOnDesktop=!0);try{let i=new URL(`${this.endpoint}/v2/player/${this.userId}/verification/GetKYCCustomerStatus`);const e={method:"POST",headers:{"X-SessionId":this.session,"Content-Type":"application/json"},body:JSON.stringify({})};fetch(i.href,e).then((i=>{if(200===i.status)return i.json();throw new Error("HTTP status "+i.status)})).then((i=>{this.verificationType=i.verifications})).catch((i=>{console.error(i)}))}catch(i){console.error("Error fetching verification types:",i)}}handleOptionChange(i,e){const t=i.target;this.selectedOption=t.value,this.verificationType=this.verificationType.map((i=>(i.type===e&&(i.optionChosen=t.value),i)))}handleDocumentsStatus(i,e,t){this.verificationType=this.verificationType.map((n=>{if(n.type===i){const i=n.documents.find((i=>i.code===t));i&&(i.statusUploaded=e)}return n}))}toggleVerificationType(i,e){this.expandedOnDesktop=!1,this.verificationType=this.verificationType.map((t=>{var n;return t.type===i&&(null===(n=t.flowInfo)||void 0===n?void 0:n.type)==e&&(t.expanded=!t.expanded),t}))}checkFileSize(i){let e=0;return Object.keys(i).forEach((t=>{e+=i[t].size})),e<=this.MAX_UPLOAD_SIZE}handleFileSelection(i,e,t){if(this.selectedFiles=i,this.selectedFiles)if(this.checkFileSize(this.selectedFiles)){const i={method:"POST",headers:{"Content-Type":"application/json","X-SessionId":this.session},body:JSON.stringify({DocumentCode:e})};fetch(`${this.endpoint}/v1/player/${this.userId}/verification/GetKYCVerificationDocumentUploadUrl`,i).then((i=>{if(i.ok)return this.uploadingStatus=a("uploading",this.language),this.handleDocumentsStatus(t,this.uploadingStatus,e),i.json()})).then((i=>{const n=new FormData,o=this.selectedFiles;for(let i=0;i<o.length;i++)n.append("files",o[i]);fetch(i.Url,{method:"POST",body:n}).then((i=>{i.ok?(this.uploadingStatus=a(this.selectedFiles.length>1?"successUploadMultipleFiles":"successUpload",this.language),this.handleDocumentsStatus(t,this.uploadingStatus,e)):(this.uploadingStatus=a("failedUpload",this.language),this.handleDocumentsStatus(t,this.uploadingStatus,e),console.error("File upload error:",i.status))})).catch((i=>{console.error("File upload error:",i)}))})).catch((i=>{console.error("File upload error:",i)}))}else console.error(a("fileSizeExceeded",this.language)),this.uploadingStatus=a("fileSizeExceeded",this.language),this.handleDocumentsStatus(t,this.uploadingStatus,e),this.uploadSizeExceeded=!0}importScript(i){return new Promise(((e,t)=>{fetch(i).then((i=>i.text())).then((i=>{if(new Function(i)(),this.scriptInjected)e(!0);else{const i=document.createElement("script");i.src="https://test.insic.de/frontend3/static/js/avs-loader.min.js",document.head.appendChild(i),this.scriptInjected=!0,e(!0)}})).catch((i=>{t(i)}))}))}renderVerificationTypeBox(i){var n,o;this.expandedOnDesktop&&(i.expanded=!0);let r=i.expanded,s=i.type.replace(/([A-Z])/g," $1"),l=i.optionChosen,c=i.status,d=i.documents,p=i.flowInfo;"Widget"===(null==p?void 0:p.type)&&this.importScript(p.url).then((()=>{console.log("Script imported correctly")})).catch((i=>{console.error("Error importing script:",i)}));const h="Verified"===c,f="Failed"===c||"Expired"===c;return e("div",{class:`verification-box ${r?"expanded":""} ${f?"failed":""} ${h?"success":""}`},e("div",{class:"box box-header "+(r?"expanded":""),onClick:()=>{var e;return this.toggleVerificationType(i.type,null===(e=i.flowInfo)||void 0===e?void 0:e.type)}},e("div",{class:"box-icon"},e("div",null,h?this.verifiedIcon?e("img",{class:"CustomVerifiedIcon",src:this.verifiedIcon,alt:""}):e("svg",{width:"100",height:"100",viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg"},e("circle",{cx:"50",cy:"50",r:"40",fill:"#388D79"}),e("circle",{cx:"50",cy:"50",r:"34",fill:"none",stroke:"#fff","stroke-width":"12px"}),e("polyline",{points:"30,50 45,63 70,35",fill:"none",stroke:"#fff","stroke-width":"8px"})):f?this.failedIcon?e("img",{class:"CustomFailedIcon",src:this.failedIcon,alt:""}):e("svg",{width:"100",height:"100",viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg"},e("circle",{cx:"50",cy:"50",r:"40",fill:"red"}),e("line",{x1:"30",y1:"30",x2:"70",y2:"70",stroke:"#fff","stroke-width":"10px"}),e("line",{x1:"30",y1:"70",x2:"70",y2:"30",stroke:"#fff","stroke-width":"10px"})):this.defaultIcon?e("img",{class:"CustomDefaultIcon",src:this.defaultIcon,alt:""}):e("svg",{width:"800px",height:"800px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M4 4V20C4 21.1046 4.89543 22 6 22L18 22C19.1046 22 20 21.1046 20 20V8.34162C20 7.8034 19.7831 7.28789 19.3982 6.91161L14.9579 2.56999C14.5842 2.20459 14.0824 2 13.5597 2L6 2C4.89543 2 4 2.89543 4 4Z",stroke:"#000000","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M9 13H15",stroke:"#000000","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M9 17H12",stroke:"#000000","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M14 2V6C14 7.10457 14.8954 8 16 8H20",stroke:"#000000","stroke-width":"2","stroke-linejoin":"round"})))),e("div",{class:"box-title"},s),e("div",{class:"chevron-icon"},e("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},e("path",{d:r?"M6 15l6-6 6 6":"M6 9l6 6 6-6"})))),e("div",{class:"box box-content"},r&&"Widget"!=(null==p?void 0:p.type)?e(t,null,h?e("div",{class:"verification-status"},a("verificationComplete",this.language)):f?e("div",{class:"verification-status"},a("Failed"===c?"verificationFailed":"verificationExpired",this.language)):d.length>0?e("div",{class:"documents-dropdown"},e("select",{class:"nice-select",onChange:e=>this.handleOptionChange(e,i.type)},e("option",{value:"",selected:!0,disabled:!0,hidden:!0},a("chooseDocument",this.language)),d.map((i=>e("option",{selected:l==i.code,value:i.code},i.type.replace(/([A-Z])/g," $1"))))),(null===(n=d.find((i=>i.code==l)))||void 0===n?void 0:n.statusUploaded)?e("div",{class:"upload-status"},null===(o=d.find((i=>i.code==l)))||void 0===o?void 0:o.statusUploaded):e("div",{class:"upload-button"},l?e("label",null,e("input",{type:"file",accept:"*",multiple:!0,onChange:e=>this.handleFileSelection(e.target.files,this.selectedOption,i.type),style:{display:"none"}}),e("svg",{width:"100",height:"100",xmlns:"http://www.w3.org/2000/svg"},e("circle",{cx:"50",cy:"50",r:"40",fill:"#388D79"}),e("line",{x1:"30",y1:"50",x2:"70",y2:"50",stroke:"white","stroke-width":"6"}),e("line",{x1:"50",y1:"30",x2:"50",y2:"70",stroke:"white","stroke-width":"6"}))):null)):null):e("div",{id:"__avs-wrapper"})))}render(){return this.isLoading?e("div",null,e("p",null,a("loading",this.language))):0===this.verificationType.length?e("div",{style:{padding:"24px",fontSize:"18px"}},a("noVerificationRequired",this.language)):e("div",{class:"ModalContainer",ref:i=>this.stylingContainer=i},e("div",{class:"player-kyc-verification-widget"},e("h2",null,this.kycTitle),e("div",{class:"widget-description"},this.description),e("div",{class:"verification-types"},this.verificationType.map((i=>"Manual"===i.vendorName||"Insic"===i.vendorName?this.renderVerificationTypeBox(i):null)))))}static get watchers(){return{translationUrl:["handleNewTranslations"]}}};s.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");\n:host {\n font-family: "Roboto", sans-serif;\n}\n\n.ModalContainer {\n container-type: inline-size;\n}\n\n.player-kyc-verification-widget {\n padding: 20px;\n align-items: center;\n}\n.player-kyc-verification-widget h2 {\n margin: 4px;\n}\n.player-kyc-verification-widget .widget-description {\n margin: 24px 0px;\n}\n.player-kyc-verification-widget .verification-types {\n width: 100%;\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n grid-gap: 34px;\n}\n.player-kyc-verification-widget .verification-types .verification-box {\n transition: height 0.3s, border-color 0.3s;\n border: solid 1.4px #b5b5b5;\n border-radius: 2px;\n display: flex;\n flex-direction: column;\n padding: 0px 14px;\n border-width: 2px 2px 8px 2px;\n align-self: start;\n}\n.player-kyc-verification-widget .verification-types .verification-box .box {\n flex-shrink: 0;\n}\n.player-kyc-verification-widget .verification-types .verification-box .box-header {\n display: flex;\n padding: 14px 0px;\n justify-content: space-between;\n cursor: pointer;\n align-items: center;\n}\n.player-kyc-verification-widget .verification-types .verification-box .box-header .box-icon {\n flex-grow: 1;\n display: flex;\n justify-content: center;\n}\n.player-kyc-verification-widget .verification-types .verification-box .box-header .box-icon svg {\n height: 24px;\n width: 24px;\n}\n.player-kyc-verification-widget .verification-types .verification-box .box-header .box-title {\n flex-grow: 1;\n font-size: 18px;\n}\n.player-kyc-verification-widget .verification-types .verification-box .box-header .chevron-icon {\n flex-grow: 10;\n width: 14px;\n height: 14px;\n display: flex;\n justify-content: flex-end;\n}\n.player-kyc-verification-widget .verification-types .verification-box .box-header .chevron-icon svg {\n width: 20px;\n height: 22px;\n}\n.player-kyc-verification-widget .verification-types .verification-box .box-content {\n display: none;\n flex-grow: 1;\n border-top: 0.4px solid #bcbcbc;\n padding: 10px 0px;\n flex-grow: 1;\n}\n.player-kyc-verification-widget .verification-types .verification-box .box-content .upload-status {\n text-align: center;\n padding: 20px;\n}\n.player-kyc-verification-widget .verification-types .verification-box .box-content .documents-dropdown {\n display: flex;\n flex-direction: column;\n width: 100%;\n align-items: center;\n}\n.player-kyc-verification-widget .verification-types .verification-box .box-content .documents-dropdown svg {\n margin: 16px;\n cursor: pointer;\n}\n.player-kyc-verification-widget .verification-types .verification-box .box-content .documents-dropdown .nice-select {\n cursor: pointer;\n width: 100%;\n height: 30px;\n padding: 4px 14px;\n font-size: 14px;\n border: 1px solid #ccc;\n border-radius: 2px;\n background-color: #fff;\n color: #333;\n appearance: none;\n -webkit-appearance: none;\n -moz-appearance: none;\n padding-right: 30px;\n background-repeat: no-repeat;\n background-position: right 10px center;\n background-image: url(\'data:image/svg+xml;charset=utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><path fill="%23333" d="M10 18.4l-6.5-6.5h13z"/><path fill="%23333" d="M10 1.6l6.5 6.5H3.5z"/></svg>\');\n}\n.player-kyc-verification-widget .verification-types .verification-box.expanded {\n border-color: green;\n min-height: 120px;\n}\n.player-kyc-verification-widget .verification-types .verification-box.failed {\n border-color: #d42323;\n}\n.player-kyc-verification-widget .verification-types .verification-box.success {\n border-color: green;\n}\n.player-kyc-verification-widget .verification-types .verification-box.expanded .box-content {\n display: flex;\n justify-content: center;\n flex-direction: column;\n}\n.player-kyc-verification-widget .verification-types .verification-box.expanded .box-content .verification-status {\n margin: 12px 0px 16px;\n font-size: 18px;\n text-align: center;\n color: #9b9b9b;\n}\n\n@container (min-width: 700px) {\n .player-kyc-verification-widget {\n padding: 100px 60px;\n }\n}\n@container (max-width: 700px) {\n .player-kyc-verification-widget h2 {\n margin: 4px;\n text-align: center;\n }\n .player-kyc-verification-widget .verification-types {\n grid-template-columns: 1fr;\n grid-gap: 16px;\n }\n}\n@container (max-width: 1240px) and (min-width: 701px) {\n .player-kyc-verification-widget .verification-types {\n grid-template-columns: repeat(2, 1fr);\n }\n}';export{s as player_kyc_verification}