@everymatrix/temporary-consents 1.29.0 → 1.29.3

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.
@@ -20,6 +20,20 @@ let TRANSLATIONS = {
20
20
  declineButton: 'Odbijte i odjavite se',
21
21
  acceptButton: 'Prihvatiti',
22
22
  loading: 'Molimo pričekajte, učitavanje...'
23
+ },
24
+ 'es-mx': {
25
+ 'title': 'Condiciones de participación',
26
+ 'description': 'Importante: Una verificación completa es requerida para poder utilizar nuestra oferta. Si no se verifica, no será posible hacer retiros y la cuenta para realizar apuestas será bloqueada.',
27
+ 'declineButton': 'Declinar y salir',
28
+ 'acceptButton': 'Aceptar',
29
+ 'Loading': 'Espere por favor, Cargando...'
30
+ },
31
+ 'pt-br': {
32
+ 'title': 'Condições de participação',
33
+ 'description': 'Importante: É necessária uma verificação completa para poder utilizar a nossa oferta. Se não for verificado, os saques não serão possíveis e a conta de apostas será bloqueada.',
34
+ 'declineButton': 'Recusar e sair',
35
+ 'acceptButton': 'Aceitar',
36
+ 'Loading': 'Espere, por favor, Carregando...'
23
37
  }
24
38
  };
25
39
  const getTranslations = (url) => {
@@ -14,6 +14,20 @@ let TRANSLATIONS = {
14
14
  declineButton: 'Odbijte i odjavite se',
15
15
  acceptButton: 'Prihvatiti',
16
16
  loading: 'Molimo pričekajte, učitavanje...'
17
+ },
18
+ 'es-mx': {
19
+ 'title': 'Condiciones de participación',
20
+ 'description': 'Importante: Una verificación completa es requerida para poder utilizar nuestra oferta. Si no se verifica, no será posible hacer retiros y la cuenta para realizar apuestas será bloqueada.',
21
+ 'declineButton': 'Declinar y salir',
22
+ 'acceptButton': 'Aceptar',
23
+ 'Loading': 'Espere por favor, Cargando...'
24
+ },
25
+ 'pt-br': {
26
+ 'title': 'Condições de participação',
27
+ 'description': 'Importante: É necessária uma verificação completa para poder utilizar a nossa oferta. Se não for verificado, os saques não serão possíveis e a conta de apostas será bloqueada.',
28
+ 'declineButton': 'Recusar e sair',
29
+ 'acceptButton': 'Aceitar',
30
+ 'Loading': 'Espere, por favor, Carregando...'
17
31
  }
18
32
  };
19
33
  export const getTranslations = (url) => {
@@ -16,6 +16,20 @@ let TRANSLATIONS = {
16
16
  declineButton: 'Odbijte i odjavite se',
17
17
  acceptButton: 'Prihvatiti',
18
18
  loading: 'Molimo pričekajte, učitavanje...'
19
+ },
20
+ 'es-mx': {
21
+ 'title': 'Condiciones de participación',
22
+ 'description': 'Importante: Una verificación completa es requerida para poder utilizar nuestra oferta. Si no se verifica, no será posible hacer retiros y la cuenta para realizar apuestas será bloqueada.',
23
+ 'declineButton': 'Declinar y salir',
24
+ 'acceptButton': 'Aceptar',
25
+ 'Loading': 'Espere por favor, Cargando...'
26
+ },
27
+ 'pt-br': {
28
+ 'title': 'Condições de participação',
29
+ 'description': 'Importante: É necessária uma verificação completa para poder utilizar a nossa oferta. Se não for verificado, os saques não serão possíveis e a conta de apostas será bloqueada.',
30
+ 'declineButton': 'Recusar e sair',
31
+ 'acceptButton': 'Aceitar',
32
+ 'Loading': 'Espere, por favor, Carregando...'
19
33
  }
20
34
  };
21
35
  const getTranslations = (url) => {
@@ -16,6 +16,20 @@ let TRANSLATIONS = {
16
16
  declineButton: 'Odbijte i odjavite se',
17
17
  acceptButton: 'Prihvatiti',
18
18
  loading: 'Molimo pričekajte, učitavanje...'
19
+ },
20
+ 'es-mx': {
21
+ 'title': 'Condiciones de participación',
22
+ 'description': 'Importante: Una verificación completa es requerida para poder utilizar nuestra oferta. Si no se verifica, no será posible hacer retiros y la cuenta para realizar apuestas será bloqueada.',
23
+ 'declineButton': 'Declinar y salir',
24
+ 'acceptButton': 'Aceptar',
25
+ 'Loading': 'Espere por favor, Cargando...'
26
+ },
27
+ 'pt-br': {
28
+ 'title': 'Condições de participação',
29
+ 'description': 'Importante: É necessária uma verificação completa para poder utilizar a nossa oferta. Se não for verificado, os saques não serão possíveis e a conta de apostas será bloqueada.',
30
+ 'declineButton': 'Recusar e sair',
31
+ 'acceptButton': 'Aceitar',
32
+ 'Loading': 'Espere, por favor, Carregando...'
19
33
  }
20
34
  };
21
35
  const getTranslations = (url) => {
@@ -0,0 +1 @@
1
+ import{r as t,h as e}from"./p-c8fa79f6.js";const o=["en","hr"];let n={en:{title:"Participation conditions",description:"Important: Full verification is required in order to be able to use our entire offer. If verification is not completed, it is not possible to withdraw and the betting account will be locked in {daysUntilLockout} days.",declineButton:"Decline and log out",acceptButton:"Accept",loading:"Please wait, loading..."},hr:{title:"Uvjeti sudjelovanja",description:"Važno: Potrebna je potpuna verifikacija kako biste mogli koristiti našu cjelokupnu ponudu. Ako potvrda nije dovršena, nije moguće podići i račun za klađenje bit će zaključan za {daysUntilLockout} dana.",declineButton:"Odbijte i odjavite se",acceptButton:"Prihvatiti",loading:"Molimo pričekajte, učitavanje..."},"es-mx":{title:"Condiciones de participación",description:"Importante: Una verificación completa es requerida para poder utilizar nuestra oferta. Si no se verifica, no será posible hacer retiros y la cuenta para realizar apuestas será bloqueada.",declineButton:"Declinar y salir",acceptButton:"Aceptar",Loading:"Espere por favor, Cargando..."},"pt-br":{title:"Condições de participação",description:"Importante: É necessária uma verificação completa para poder utilizar a nossa oferta. Se não for verificado, os saques não serão possíveis e a conta de apostas será bloqueada.",declineButton:"Recusar e sair",acceptButton:"Aceitar",Loading:"Espere, por favor, Carregando..."}};const i=(t,e,i)=>{const s=e;let a=n[void 0!==s&&o.includes(s)?s:"en"][t];if(void 0!==i)for(const[t,e]of Object.entries(i.values)){const o=new RegExp(`{${t}}`,"g");a=a.replace(o,e)}return a},s=class{constructor(e){t(this,e),this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.stylingAppends=!1,this.isLoading=!1,this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.stylingContainer.prepend(t)},this.setClientStylingURL=()=>{let t=new URL(this.clientStylingUrl),e=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{e.innerHTML=t,setTimeout((()=>{this.stylingContainer.prepend(e)}),1)})).catch((t=>{console.log("error ",t)}))}}componentWillLoad(){const t=[];if(this.endpoint&&this.userId){const e=this.getConsents().then((t=>{this.temporaryAccountConsent=t.consents.some((t=>"temporaryaccountconsent"==t.tagCode))}));t.push(e)}if(this.translationUrl){const o=(e=this.translationUrl,new Promise((t=>{fetch(e).then((t=>t.json())).then((e=>{Object.keys(e).forEach((t=>{for(let o in e[t])n[t][o]=e[t][o]})),t(!0)}))})));t.push(o)}var e;return Promise.all(t)}componentDidRender(){!this.stylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.stylingAppends=!0)}getConsents(){const t=new URL(`${this.endpoint}/v1/player/${this.userId}/legislation/consents`),e=new Headers;e.append("X-SessionId",this.sessionId),e.append("Accept","application/json");const o={method:"GET",headers:e};return new Promise(((e,n)=>{this.isLoading=!0,fetch(t.href,o).then((t=>t.json())).then((t=>{e(t)})).catch((t=>{console.error(t),n(t)})).finally((()=>{this.isLoading=!1}))}))}setConsents(){const t=new URL(`${this.endpoint}/v1/player/${this.userId}/legislation/consents`),e=new Headers;e.append("X-SessionId",this.sessionId),e.append("Accept","application/json"),e.append("Content-Type","application/json");const o={method:"POST",headers:e,body:JSON.stringify({consents:[{tagCode:"temporaryaccountconsent",note:"",status:1}]})};return new Promise(((e,n)=>{this.isLoading=!0,fetch(t.href,o).then((t=>t.json())).then((t=>{e(t)})).catch((t=>{console.error(t),n(t)})).finally((()=>{this.isLoading=!1}))}))}handleDecline(){window.postMessage({type:"TemporaryConsentsDeclined"},window.location.href)}handleAccept(){this.setConsents(),window.postMessage({type:"TemporaryConsentsAccepted"},window.location.href)}render(){if(this.temporaryAccountConsent)return this.isLoading?e("p",null,i("loading",this.lang)):e("div",{class:"TemporaryConsents",ref:t=>this.stylingContainer=t},e("h2",{class:"TemporaryConsentsTitle"}," ",i("title",this.lang)," "),e("p",{class:"TemporaryConsentsText"}," ",i("description",this.lang,{values:{daysUntilLockout:this.daysUntilLockout}})," "),e("div",{class:"TemporaryConsentsButtonsWrapper"},e("button",{class:"TemporaryConsentsButton TemporaryConsentsButtonDecline",onClick:()=>this.handleDecline()},i("declineButton",this.lang)),e("button",{class:"TemporaryConsentsButton TemporaryConsentsButtonAccept",onClick:this.handleAccept},i("acceptButton",this.lang))))}};s.style="*,*::after,*::before{box-sizing:border-box;padding:0;margin:0}:host{display:block}.TemporaryConsents{max-width:500px;display:flex;gap:35px;flex-direction:column;box-shadow:0px 1px 5px 1px rgba(0, 0, 0, 0.1);padding:20px;font-family:sans-serif}.TemporaryConsentsTitle{text-align:left;font-family:inherit;color:#000;font-weight:400;font-size:18px;display:block;border-bottom:1px solid #000;padding-bottom:10px}.TemporaryConsentsText{font-family:inherit;font-weight:300;font-size:16px}.TemporaryConsentsButtonsWrapper{display:flex;justify-content:space-evenly;gap:50px}.TemporaryConsentsButton{font-family:inherit;font-weight:300;font-size:14px;border:none;padding:10px;min-width:150px;border-radius:4px}.TemporaryConsentsButtonDecline{background-color:transparent;border:1px solid #000}.TemporaryConsentsButtonAccept{color:white;background-color:#000}";export{s as temporary_consents}
@@ -1 +1 @@
1
- import{p as n,b as t}from"./p-c8fa79f6.js";(()=>{const t=import.meta.url,s={};return""!==t&&(s.resourcesUrl=new URL(".",t).href),n(s)})().then((n=>t([["p-a55f0a66",[[1,"temporary-consents",{endpoint:[513],userId:[513,"user-id"],sessionId:[513,"session-id"],daysUntilLockout:[513,"days-until-lockout"],lang:[513],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],stylingAppends:[32]}]]]],n)));
1
+ import{p as n,b as t}from"./p-c8fa79f6.js";(()=>{const t=import.meta.url,s={};return""!==t&&(s.resourcesUrl=new URL(".",t).href),n(s)})().then((n=>t([["p-0d997674",[[1,"temporary-consents",{endpoint:[513],userId:[513,"user-id"],sessionId:[513,"session-id"],daysUntilLockout:[513,"days-until-lockout"],lang:[513],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],stylingAppends:[32]}]]]],n)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/temporary-consents",
3
- "version": "1.29.0",
3
+ "version": "1.29.3",
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 t,h as e}from"./p-c8fa79f6.js";const o=["en","hr"];let n={en:{title:"Participation conditions",description:"Important: Full verification is required in order to be able to use our entire offer. If verification is not completed, it is not possible to withdraw and the betting account will be locked in {daysUntilLockout} days.",declineButton:"Decline and log out",acceptButton:"Accept",loading:"Please wait, loading..."},hr:{title:"Uvjeti sudjelovanja",description:"Važno: Potrebna je potpuna verifikacija kako biste mogli koristiti našu cjelokupnu ponudu. Ako potvrda nije dovršena, nije moguće podići i račun za klađenje bit će zaključan za {daysUntilLockout} dana.",declineButton:"Odbijte i odjavite se",acceptButton:"Prihvatiti",loading:"Molimo pričekajte, učitavanje..."}};const i=(t,e,i)=>{const s=e;let r=n[void 0!==s&&o.includes(s)?s:"en"][t];if(void 0!==i)for(const[t,e]of Object.entries(i.values)){const o=new RegExp(`{${t}}`,"g");r=r.replace(o,e)}return r},s=class{constructor(e){t(this,e),this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.stylingAppends=!1,this.isLoading=!1,this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.stylingContainer.prepend(t)},this.setClientStylingURL=()=>{let t=new URL(this.clientStylingUrl),e=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{e.innerHTML=t,setTimeout((()=>{this.stylingContainer.prepend(e)}),1)})).catch((t=>{console.log("error ",t)}))}}componentWillLoad(){const t=[];if(this.endpoint&&this.userId){const e=this.getConsents().then((t=>{this.temporaryAccountConsent=t.consents.some((t=>"temporaryaccountconsent"==t.tagCode))}));t.push(e)}if(this.translationUrl){const o=(e=this.translationUrl,new Promise((t=>{fetch(e).then((t=>t.json())).then((e=>{Object.keys(e).forEach((t=>{for(let o in e[t])n[t][o]=e[t][o]})),t(!0)}))})));t.push(o)}var e;return Promise.all(t)}componentDidRender(){!this.stylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.stylingAppends=!0)}getConsents(){const t=new URL(`${this.endpoint}/v1/player/${this.userId}/legislation/consents`),e=new Headers;e.append("X-SessionId",this.sessionId),e.append("Accept","application/json");const o={method:"GET",headers:e};return new Promise(((e,n)=>{this.isLoading=!0,fetch(t.href,o).then((t=>t.json())).then((t=>{e(t)})).catch((t=>{console.error(t),n(t)})).finally((()=>{this.isLoading=!1}))}))}setConsents(){const t=new URL(`${this.endpoint}/v1/player/${this.userId}/legislation/consents`),e=new Headers;e.append("X-SessionId",this.sessionId),e.append("Accept","application/json"),e.append("Content-Type","application/json");const o={method:"POST",headers:e,body:JSON.stringify({consents:[{tagCode:"temporaryaccountconsent",note:"",status:1}]})};return new Promise(((e,n)=>{this.isLoading=!0,fetch(t.href,o).then((t=>t.json())).then((t=>{e(t)})).catch((t=>{console.error(t),n(t)})).finally((()=>{this.isLoading=!1}))}))}handleDecline(){window.postMessage({type:"TemporaryConsentsDeclined"},window.location.href)}handleAccept(){this.setConsents(),window.postMessage({type:"TemporaryConsentsAccepted"},window.location.href)}render(){if(this.temporaryAccountConsent)return this.isLoading?e("p",null,i("loading",this.lang)):e("div",{class:"TemporaryConsents",ref:t=>this.stylingContainer=t},e("h2",{class:"TemporaryConsentsTitle"}," ",i("title",this.lang)," "),e("p",{class:"TemporaryConsentsText"}," ",i("description",this.lang,{values:{daysUntilLockout:this.daysUntilLockout}})," "),e("div",{class:"TemporaryConsentsButtonsWrapper"},e("button",{class:"TemporaryConsentsButton TemporaryConsentsButtonDecline",onClick:()=>this.handleDecline()},i("declineButton",this.lang)),e("button",{class:"TemporaryConsentsButton TemporaryConsentsButtonAccept",onClick:this.handleAccept},i("acceptButton",this.lang))))}};s.style="*,*::after,*::before{box-sizing:border-box;padding:0;margin:0}:host{display:block}.TemporaryConsents{max-width:500px;display:flex;gap:35px;flex-direction:column;box-shadow:0px 1px 5px 1px rgba(0, 0, 0, 0.1);padding:20px;font-family:sans-serif}.TemporaryConsentsTitle{text-align:left;font-family:inherit;color:#000;font-weight:400;font-size:18px;display:block;border-bottom:1px solid #000;padding-bottom:10px}.TemporaryConsentsText{font-family:inherit;font-weight:300;font-size:16px}.TemporaryConsentsButtonsWrapper{display:flex;justify-content:space-evenly;gap:50px}.TemporaryConsentsButton{font-family:inherit;font-weight:300;font-size:14px;border:none;padding:10px;min-width:150px;border-radius:4px}.TemporaryConsentsButtonDecline{background-color:transparent;border:1px solid #000}.TemporaryConsentsButtonAccept{color:white;background-color:#000}";export{s as temporary_consents}