@everymatrix/player-lugas-limit 1.65.0 → 1.65.2
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/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/player-lugas-limit.cjs.entry.js +51 -33
- package/dist/cjs/player-lugas-limit.cjs.js +1 -1
- package/dist/collection/components/player-lugas-limit/player-lugas-limit.css +1 -0
- package/dist/collection/components/player-lugas-limit/player-lugas-limit.js +49 -32
- package/dist/collection/components/player-lugas-limit/player-lugas-limit.stories.js +21 -21
- package/dist/collection/utils/locale.utils.js +2 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/player-lugas-limit.entry.js +51 -33
- package/dist/esm/player-lugas-limit.js +1 -1
- package/dist/player-lugas-limit/p-ea6f7849.entry.js +1 -0
- package/dist/player-lugas-limit/player-lugas-limit.esm.js +1 -1
- package/dist/types/components/player-lugas-limit/player-lugas-limit.d.ts +12 -4
- package/package.json +1 -1
- package/dist/player-lugas-limit/p-79b74c76.entry.js +0 -1
- /package/dist/types/Users/{maria.bumbar/Desktop/Widgets & Template → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/player-lugas-limit/.stencil/libs/common/src/storybook/storybook-utils.d.ts +0 -0
- /package/dist/types/Users/{maria.bumbar/Desktop/Widgets & Template → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/player-lugas-limit/.stencil/packages/stencil/player-lugas-limit/stencil.config.d.ts +0 -0
- /package/dist/types/Users/{maria.bumbar/Desktop/Widgets & Template → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/player-lugas-limit/.stencil/packages/stencil/player-lugas-limit/stencil.config.dev.d.ts +0 -0
- /package/dist/types/Users/{maria.bumbar/Desktop/Widgets & Template → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/player-lugas-limit/.stencil/packages/stencil/player-lugas-limit/storybook/main.d.ts +0 -0
- /package/dist/types/Users/{maria.bumbar/Desktop/Widgets & Template → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/player-lugas-limit/.stencil/packages/stencil/player-lugas-limit/storybook/preview.d.ts +0 -0
- /package/dist/types/Users/{maria.bumbar/Desktop/Widgets & Template → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/player-lugas-limit/.stencil/tools/plugins/index.d.ts +0 -0
- /package/dist/types/Users/{maria.bumbar/Desktop/Widgets & Template → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/player-lugas-limit/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +0 -0
- /package/dist/types/Users/{maria.bumbar/Desktop/Widgets & Template → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/player-lugas-limit/.stencil/tools/plugins/vite-chunk-plugin.d.ts +0 -0
- /package/dist/types/Users/{maria.bumbar/Desktop/Widgets & Template → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/player-lugas-limit/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +0 -0
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -8,7 +8,7 @@ const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
|
8
8
|
const defineCustomElements = async (win, options) => {
|
|
9
9
|
if (typeof window === 'undefined') return undefined;
|
|
10
10
|
await appGlobals.globalScripts();
|
|
11
|
-
return index.bootstrapLazy([["player-lugas-limit.cjs",[[1,"player-lugas-limit",{"userId":[1,"user-id"],"session":[1],"endpoint":[1],"currency":[1],"amount":[1],"lang":[1],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"mbSource":[1,"mb-source"],"translationUrl":[1,"translation-url"],"isLoading":[32],"showCustomAmount":[32],"isSubmitted":[32],"isUseExistingLimitOptionActive":[32],"selectedPredefinedAmount":[32],"errorMessageOnInitialization":[32],"errorMessageOnSubmit":[32],"errorMessageOnInput":[32],"newAmount":[32]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]]], options);
|
|
11
|
+
return index.bootstrapLazy([["player-lugas-limit.cjs",[[1,"player-lugas-limit",{"userId":[1,"user-id"],"session":[1],"endpoint":[1],"currency":[1],"amount":[1],"lang":[1],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"mbSource":[1,"mb-source"],"translationUrl":[1,"translation-url"],"isLoading":[32],"showCustomAmount":[32],"isSubmitted":[32],"isUseExistingLimitOptionActive":[32],"selectedPredefinedAmount":[32],"errorMessageOnInitialization":[32],"errorMessageOnSubmit":[32],"errorMessageOnInput":[32],"hasLugasError":[32],"newAmount":[32]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]]], options);
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
exports.setNonce = index.setNonce;
|
|
@@ -25,6 +25,7 @@ let TRANSLATIONS = {
|
|
|
25
25
|
LugasNotSet: 'No deposit limit set. Please enter a new limit.',
|
|
26
26
|
loading: 'Loading, please wait ...',
|
|
27
27
|
error: 'It was an error while trying to fetch the data',
|
|
28
|
+
LugasF1002Error: 'We were unable to set your cross-provider deposit limit at LUGAS due to a technical error. Please contact our support team and provide error code F1002. We\'ll be happy to assist you in resolving this issue.'
|
|
28
29
|
},
|
|
29
30
|
de: {
|
|
30
31
|
LugasSetLimitDialogTitle: 'Monatliches zentrales Einzahlungslimit',
|
|
@@ -45,6 +46,7 @@ let TRANSLATIONS = {
|
|
|
45
46
|
LugasNotSet: 'Kein Einzahlungslimit festgelegt. Bitte geben Sie ein neues Limit ein.',
|
|
46
47
|
loading: 'Laden, bitte warten ...',
|
|
47
48
|
error: 'Beim Versuch, die Daten abzurufen, ist ein Fehler aufgetreten',
|
|
49
|
+
LugasF1002Error: 'Ihr anbieterübergreifendes Einzahlungslimit konnte aufgrund eines technischen Fehlers nicht in der LUGAS-Datenbank festgelegt werden. Bitte wenden Sie sich an unseren Kundenservice unter Angabe des Fehlercodes F1002. Wir helfen Ihnen dann gerne weiter.'
|
|
48
50
|
},
|
|
49
51
|
};
|
|
50
52
|
const getTranslations = (url) => {
|
|
@@ -139,7 +141,7 @@ function setStreamStyling(stylingContainer, domain, subscription) {
|
|
|
139
141
|
}
|
|
140
142
|
}
|
|
141
143
|
|
|
142
|
-
const playerLugasLimitCss = "@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 position: absolute;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background-color: rgba(0, 0, 0, 0.5);\n display: flex;\n justify-content: center;\n align-items: center;\n font-size: var(--emw--font-size-small, 12px);\n container-type: inline-size;\n}\n.ModalContainer hr {\n border: 1px solid rgba(0, 0, 0, 0.1);\n margin: 10px 0px;\n}\n.ModalContainer p {\n margin: 0;\n}\n.ModalContainer button {\n width: 100%;\n border: 1px solid var(--emw--color-gray-100, #E8E9EB);\n padding: 10px 0;\n cursor: pointer;\n width: 100%;\n border-radius: var(--emw--border-radius-small, 4px);\n}\n.ModalContainer button.PrimaryButton {\n background: var(--emw--color-primary, #6BB816);\n border: none;\n font-weight: 500;\n}\n.ModalContainer button.PrimaryButton:not(:disabled) {\n color: var(--emw--color-white, #FFF);\n}\n.ModalContainer button.PrimaryButton:disabled {\n cursor: default;\n}\n.ModalContainer .Container {\n position: fixed;\n top: 30vh;\n width: 320px;\n background: var(--emw--color-white, #fff);\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n transform: scale(1.1);\n border-radius: 4px;\n overflow: hidden;\n}\n.ModalContainer .ValidatorContainer {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n}\n.ModalContainer .Paragraphs:not(:last-child) {\n margin-bottom: 20px;\n}\n.ModalContainer .ModalHeader {\n display: flex;\n justify-content: space-between;\n align-items: center;\n background-color: var(--emw--color-gray-50, #F7F8FA);\n padding: 12px;\n}\n.ModalContainer .ModalHeader h2 {\n font-weight: bold;\n font-size: var(--emw--font-size-small, 12px);\n margin: 0;\n}\n.ModalContainer .ModalBody {\n background: var(--emw--color-white, #FFF);\n padding: 12px;\n container-type: inline-size;\n border-radius: 4px;\n}\n.ModalContainer .ModalBody .ErrorContainer {\n display: flex;\n align-items: center;\n color: var(--emw--color-red-100, #E10014);\n border-bottom: 1px solid var(--emw--color-gray-100, #E8E9EB);\n margin: -12px;\n padding: 12px;\n margin-bottom: 12px;\n font-weight: bold;\n position: relative;\n background: linear-gradient(180deg, var(--emw--color-gray-100, #E8E9EB) 0%, rgba(255, 255, 255, 0.47) 30%);\n}\n.ModalContainer .ModalBody .DismissError {\n position: absolute;\n right: 12px;\n cursor: pointer;\n}\n.ModalContainer .ModalBody .ErrorParagraph {\n display: flex;\n align-items: center;\n}\n.ModalContainer .ModalBody .ErrorIcon {\n background: linear-gradient(180deg, var(--emw--color-red-100, #E10014) 0%, var(--emw--color-red-150, #D60080) 100%);\n text-align: center;\n width: 16px;\n height: 16px;\n border-radius: 50%;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n margin-right: 6px;\n}\n.ModalContainer .ModalBody .ErrorIcon svg {\n width: 6px;\n height: 6px;\n}\n.ModalContainer .ModalBody .ErrorIcon svg path {\n fill: var(--emw--color-white, #FFF);\n}\n.ModalContainer .ModalBody .ChooseLimitLabel {\n text-transform: uppercase;\n}\n.ModalContainer .ModalBody .LimitAmountWrapper {\n display: flex;\n flex-direction: column;\n gap: 10px;\n position: relative;\n}\n.ModalContainer .ModalBody .PredefinedAmounts {\n display: flex;\n justify-content: space-between;\n}\n.ModalContainer .ModalBody .PredefinedAmounts button {\n background: none;\n margin: -1px 0 0 -1px;\n color: var(--emw--color-gray-150, #808080);\n}\n.ModalContainer .ModalBody .PredefinedAmounts button.Active {\n font-weight: bold;\n background: var(--emw--color-gray-50, #F7F8FA);\n color: var(--emw--color-gray-200, #323233);\n}\n.ModalContainer .ModalBody .PredefinedAmounts button:first-child {\n border-radius: 4px 0 0 4px;\n}\n.ModalContainer .ModalBody .PredefinedAmounts button:last-child {\n border-radius: 0 4px 4px 0;\n}\n.ModalContainer .ModalBody .CustomAmountInput {\n width: 100%;\n padding: 10px;\n border: 1px solid var(--emw--color-gray-100, #E8E9EB);\n border-radius: 4px;\n box-sizing: border-box;\n margin-bottom: 6px;\n color: var(--emw--color-gray-200, #323233);\n font-weight: bold;\n}\n.ModalContainer .ModalBody .CustomAmountInput.InvalidInput {\n border: 1px solid var(--emw--color-red, #FF0000);\n}\n.ModalContainer .ModalBody .InvalidParagraph {\n font-size: var(--emw--font-size-small, 12px);\n color: var(--emw--color-red, #FF0000);\n}\n.ModalContainer .ModalBody .SetLimitBtn {\n margin-top: 10px;\n}\n.ModalContainer .ModalFooter {\n padding-top: 12px;\n margin: 5px 0px;\n}\n.ModalContainer .Link {\n color: inherit;\n text-decoration: underline;\n cursor: pointer;\n}\n.ModalContainer .Link.Inactive {\n cursor: default;\n color: var(--emw--color-gray-150, #808080);\n}\n.ModalContainer .PrivacyNote {\n font-size: var(--emw--font-size-x-small, 10px);\n font-style: italic;\n}\n.ModalContainer .ExistingLimit {\n margin-bottom: 15px;\n}\n\ninput {\n /* Firefox */\n -moz-appearance: textfield;\n /* Chrome, Safari, Edge, Opera */\n}\ninput::-webkit-outer-spin-button, input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\n@container (max-width: 1300px) {\n .ModalContainer .Container {\n width: 50%;\n }\n}\n@container (max-width: 800px) {\n .ModalContainer .Container {\n width: 70%;\n }\n}\n.LoadingWrapper {\n width: 100%;\n height: 100%;\n background: rgba(255, 255, 255, 0.8);\n position: absolute;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.spinner {\n animation: rotate 2s linear infinite;\n z-index: 2;\n width: 30px;\n height: 30px;\n}\n.spinner .path {\n stroke: var(--emw--color-primary, #6BB816);\n stroke-linecap: round;\n animation: dash 1.5s ease-in-out infinite;\n}\n\n@keyframes rotate {\n 100% {\n transform: rotate(360deg);\n }\n}\n@keyframes dash {\n 0% {\n stroke-dasharray: 1, 150;\n stroke-dashoffset: 0;\n }\n 50% {\n stroke-dasharray: 90, 150;\n stroke-dashoffset: -35;\n }\n 100% {\n stroke-dasharray: 90, 150;\n stroke-dashoffset: -124;\n }\n}";
|
|
144
|
+
const playerLugasLimitCss = "@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 position: absolute;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background-color: rgba(0, 0, 0, 0.5);\n display: flex;\n justify-content: center;\n align-items: center;\n font-size: var(--emw--font-size-small, 12px);\n container-type: inline-size;\n}\n.ModalContainer hr {\n border: 1px solid rgba(0, 0, 0, 0.1);\n margin: 10px 0px;\n}\n.ModalContainer p {\n margin: 0;\n}\n.ModalContainer button {\n width: 100%;\n border: 1px solid var(--emw--color-gray-100, #E8E9EB);\n padding: 10px 0;\n cursor: pointer;\n width: 100%;\n border-radius: var(--emw--border-radius-small, 4px);\n}\n.ModalContainer button.PrimaryButton {\n background: var(--emw--color-primary, #6BB816);\n border: none;\n font-weight: 500;\n}\n.ModalContainer button.PrimaryButton:not(:disabled) {\n color: var(--emw--color-white, #FFF);\n}\n.ModalContainer button.PrimaryButton:disabled {\n cursor: default;\n}\n.ModalContainer .Container {\n position: fixed;\n top: 30vh;\n width: 320px;\n background: var(--emw--color-white, #fff);\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n transform: scale(1.1);\n border-radius: 4px;\n overflow: hidden;\n}\n.ModalContainer .ValidatorContainer {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n}\n.ModalContainer .Paragraphs:not(:last-child) {\n margin-bottom: 20px;\n}\n.ModalContainer .ModalHeader {\n display: flex;\n justify-content: space-between;\n align-items: center;\n background-color: var(--emw--color-gray-50, #F7F8FA);\n padding: 12px;\n}\n.ModalContainer .ModalHeader h2 {\n font-weight: bold;\n font-size: var(--emw--font-size-small, 12px);\n margin: 0;\n}\n.ModalContainer .ModalBody {\n background: var(--emw--color-white, #FFF);\n padding: 12px;\n container-type: inline-size;\n border-radius: 4px;\n}\n.ModalContainer .ModalBody .ErrorContainer {\n display: flex;\n align-items: center;\n color: var(--emw--color-red-100, #E10014);\n border-bottom: 1px solid var(--emw--color-gray-100, #E8E9EB);\n margin: -12px;\n padding: 12px;\n margin-bottom: 12px;\n font-weight: bold;\n position: relative;\n background: linear-gradient(180deg, var(--emw--color-gray-100, #E8E9EB) 0%, rgba(255, 255, 255, 0.47) 30%);\n}\n.ModalContainer .ModalBody .DismissError {\n position: absolute;\n right: 12px;\n cursor: pointer;\n}\n.ModalContainer .ModalBody .ErrorParagraph {\n display: flex;\n align-items: center;\n}\n.ModalContainer .ModalBody .ErrorIcon {\n background: linear-gradient(180deg, var(--emw--color-red-100, #E10014) 0%, var(--emw--color-red-150, #D60080) 100%);\n text-align: center;\n width: 16px;\n height: 16px;\n border-radius: 50%;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n margin-right: 6px;\n flex-shrink: 0;\n}\n.ModalContainer .ModalBody .ErrorIcon svg {\n width: 6px;\n height: 6px;\n}\n.ModalContainer .ModalBody .ErrorIcon svg path {\n fill: var(--emw--color-white, #FFF);\n}\n.ModalContainer .ModalBody .ChooseLimitLabel {\n text-transform: uppercase;\n}\n.ModalContainer .ModalBody .LimitAmountWrapper {\n display: flex;\n flex-direction: column;\n gap: 10px;\n position: relative;\n}\n.ModalContainer .ModalBody .PredefinedAmounts {\n display: flex;\n justify-content: space-between;\n}\n.ModalContainer .ModalBody .PredefinedAmounts button {\n background: none;\n margin: -1px 0 0 -1px;\n color: var(--emw--color-gray-150, #808080);\n}\n.ModalContainer .ModalBody .PredefinedAmounts button.Active {\n font-weight: bold;\n background: var(--emw--color-gray-50, #F7F8FA);\n color: var(--emw--color-gray-200, #323233);\n}\n.ModalContainer .ModalBody .PredefinedAmounts button:first-child {\n border-radius: 4px 0 0 4px;\n}\n.ModalContainer .ModalBody .PredefinedAmounts button:last-child {\n border-radius: 0 4px 4px 0;\n}\n.ModalContainer .ModalBody .CustomAmountInput {\n width: 100%;\n padding: 10px;\n border: 1px solid var(--emw--color-gray-100, #E8E9EB);\n border-radius: 4px;\n box-sizing: border-box;\n margin-bottom: 6px;\n color: var(--emw--color-gray-200, #323233);\n font-weight: bold;\n}\n.ModalContainer .ModalBody .CustomAmountInput.InvalidInput {\n border: 1px solid var(--emw--color-red, #FF0000);\n}\n.ModalContainer .ModalBody .InvalidParagraph {\n font-size: var(--emw--font-size-small, 12px);\n color: var(--emw--color-red, #FF0000);\n}\n.ModalContainer .ModalBody .SetLimitBtn {\n margin-top: 10px;\n}\n.ModalContainer .ModalFooter {\n padding-top: 12px;\n margin: 5px 0px;\n}\n.ModalContainer .Link {\n color: inherit;\n text-decoration: underline;\n cursor: pointer;\n}\n.ModalContainer .Link.Inactive {\n cursor: default;\n color: var(--emw--color-gray-150, #808080);\n}\n.ModalContainer .PrivacyNote {\n font-size: var(--emw--font-size-x-small, 10px);\n font-style: italic;\n}\n.ModalContainer .ExistingLimit {\n margin-bottom: 15px;\n}\n\ninput {\n /* Firefox */\n -moz-appearance: textfield;\n /* Chrome, Safari, Edge, Opera */\n}\ninput::-webkit-outer-spin-button, input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\n@container (max-width: 1300px) {\n .ModalContainer .Container {\n width: 50%;\n }\n}\n@container (max-width: 800px) {\n .ModalContainer .Container {\n width: 70%;\n }\n}\n.LoadingWrapper {\n width: 100%;\n height: 100%;\n background: rgba(255, 255, 255, 0.8);\n position: absolute;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.spinner {\n animation: rotate 2s linear infinite;\n z-index: 2;\n width: 30px;\n height: 30px;\n}\n.spinner .path {\n stroke: var(--emw--color-primary, #6BB816);\n stroke-linecap: round;\n animation: dash 1.5s ease-in-out infinite;\n}\n\n@keyframes rotate {\n 100% {\n transform: rotate(360deg);\n }\n}\n@keyframes dash {\n 0% {\n stroke-dasharray: 1, 150;\n stroke-dashoffset: 0;\n }\n 50% {\n stroke-dasharray: 90, 150;\n stroke-dashoffset: -35;\n }\n 100% {\n stroke-dasharray: 90, 150;\n stroke-dashoffset: -124;\n }\n}";
|
|
143
145
|
const PlayerLugasLimitStyle0 = playerLugasLimitCss;
|
|
144
146
|
|
|
145
147
|
const PlayerLugasLimit = class {
|
|
@@ -151,25 +153,25 @@ const PlayerLugasLimit = class {
|
|
|
151
153
|
/** Displayed currency */
|
|
152
154
|
this.displayedCurrency = '';
|
|
153
155
|
/**
|
|
154
|
-
* Submits the new monthly deposit limit set by the player
|
|
155
|
-
* @param
|
|
156
|
+
* Submits the new monthly deposit limit set by the player.
|
|
157
|
+
* @param amount - User-defined amount
|
|
156
158
|
* @param keepLimit - Whether to keep the current limit
|
|
157
|
-
* @param
|
|
159
|
+
* @param isInitialLimit - Whether the limit is being set initially
|
|
158
160
|
*/
|
|
159
|
-
this.submitMonthlyDepositLimit = (amount, keepLimit = false,
|
|
161
|
+
this.submitMonthlyDepositLimit = async (amount, keepLimit = false, isInitialLimit = false) => {
|
|
160
162
|
if (keepLimit && !this.isUseExistingLimitOptionActive) {
|
|
161
163
|
return;
|
|
162
164
|
}
|
|
163
165
|
this.isSubmitted = true;
|
|
164
166
|
this.errorMessageOnSubmit = '';
|
|
165
167
|
const url = new URL(`${this.endpoint}v2/player/${this.userId}/limit/lugas`);
|
|
166
|
-
const roleLimitAmount =
|
|
167
|
-
const
|
|
168
|
+
const roleLimitAmount = isInitialLimit ? this.newAmount : 0;
|
|
169
|
+
const requestBody = {
|
|
168
170
|
amount,
|
|
169
171
|
keepLimit,
|
|
170
172
|
roleLimitAmount
|
|
171
173
|
};
|
|
172
|
-
const
|
|
174
|
+
const requestOptions = {
|
|
173
175
|
method: 'POST',
|
|
174
176
|
headers: {
|
|
175
177
|
'X-SessionId': this.session,
|
|
@@ -177,31 +179,22 @@ const PlayerLugasLimit = class {
|
|
|
177
179
|
'Content-Type': 'application/json',
|
|
178
180
|
'Authorization': `Bearer ${this.session}`
|
|
179
181
|
},
|
|
180
|
-
body: JSON.stringify(
|
|
182
|
+
body: JSON.stringify(requestBody)
|
|
181
183
|
};
|
|
182
|
-
|
|
183
|
-
.
|
|
184
|
-
if (!
|
|
185
|
-
const
|
|
186
|
-
throw
|
|
184
|
+
try {
|
|
185
|
+
const response = await fetch(url.href, requestOptions);
|
|
186
|
+
if (!response.ok) {
|
|
187
|
+
const error = await response.json();
|
|
188
|
+
throw error;
|
|
187
189
|
}
|
|
188
190
|
this.closeLugasModal.emit();
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
// Check for specific error structure
|
|
197
|
-
if (err.errorCode === 3 && err.errorSourceName === "GmLegislation") {
|
|
198
|
-
console.error(err.error, (_a = err.thirdPartyResponse) === null || _a === void 0 ? void 0 : _a.message);
|
|
199
|
-
}
|
|
200
|
-
else {
|
|
201
|
-
console.error("Unexpected Error:", err);
|
|
202
|
-
}
|
|
203
|
-
})
|
|
204
|
-
.finally(() => this.isSubmitted = false);
|
|
191
|
+
}
|
|
192
|
+
catch (error) {
|
|
193
|
+
this.handleSubmissionError(error, keepLimit);
|
|
194
|
+
}
|
|
195
|
+
finally {
|
|
196
|
+
this.isSubmitted = false;
|
|
197
|
+
}
|
|
205
198
|
};
|
|
206
199
|
this.userId = '';
|
|
207
200
|
this.session = '';
|
|
@@ -221,6 +214,7 @@ const PlayerLugasLimit = class {
|
|
|
221
214
|
this.errorMessageOnInitialization = '';
|
|
222
215
|
this.errorMessageOnSubmit = '';
|
|
223
216
|
this.errorMessageOnInput = '';
|
|
217
|
+
this.hasLugasError = false;
|
|
224
218
|
this.newAmount = '';
|
|
225
219
|
}
|
|
226
220
|
/**
|
|
@@ -294,6 +288,30 @@ const PlayerLugasLimit = class {
|
|
|
294
288
|
.finally(() => this.isLoading = false);
|
|
295
289
|
});
|
|
296
290
|
}
|
|
291
|
+
/**
|
|
292
|
+
* Handles errors during the submission of the monthly deposit limit.
|
|
293
|
+
* @param error - Error response from the server
|
|
294
|
+
* @param keepLimit - Whether the user opted to keep the current limit
|
|
295
|
+
*/
|
|
296
|
+
handleSubmissionError(error, keepLimit) {
|
|
297
|
+
var _a, _b;
|
|
298
|
+
this.errorMessageOnSubmit = translate('LugasNotSet', this.lang);
|
|
299
|
+
if (keepLimit) {
|
|
300
|
+
this.isUseExistingLimitOptionActive = false;
|
|
301
|
+
}
|
|
302
|
+
if (error.errorCode === 3 && error.errorSourceName === 'GmLegislation') {
|
|
303
|
+
const errorMsg = (_b = (_a = error.thirdPartyResponse) === null || _a === void 0 ? void 0 : _a.message) !== null && _b !== void 0 ? _b : '';
|
|
304
|
+
if (errorMsg.includes('F1002')) {
|
|
305
|
+
this.errorMessageOnSubmit = translate('LugasF1002Error', this.lang);
|
|
306
|
+
this.hasLugasError = true;
|
|
307
|
+
this.isUseExistingLimitOptionActive = false;
|
|
308
|
+
}
|
|
309
|
+
console.error(error.error, errorMsg);
|
|
310
|
+
}
|
|
311
|
+
else {
|
|
312
|
+
console.error('Unexpected Error:', error);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
297
315
|
/**
|
|
298
316
|
* Handles form submission.
|
|
299
317
|
* @param event - The form submission event
|
|
@@ -360,13 +378,13 @@ const PlayerLugasLimit = class {
|
|
|
360
378
|
*/
|
|
361
379
|
renderValidator() {
|
|
362
380
|
const renderPredefinedButtons = () => {
|
|
363
|
-
return this.predefinedAmounts.map((currentAmount) => (index.h("button", { class: this.selectedPredefinedAmount === currentAmount ? 'Active' : '', onClick: () => this.handleAmountClick(currentAmount) }, currentAmount)));
|
|
381
|
+
return this.predefinedAmounts.map((currentAmount) => (index.h("button", { class: this.selectedPredefinedAmount === currentAmount ? 'Active' : '', onClick: () => this.handleAmountClick(currentAmount), disabled: this.hasLugasError }, currentAmount)));
|
|
364
382
|
};
|
|
365
383
|
return (index.h("div", { class: "ValidatorContainer" }, this.errorMessageOnSubmit && (index.h("div", { class: "ErrorContainer" }, index.h("span", { class: "DismissError", onClick: () => this.errorMessageOnSubmit = '' }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "9", height: "9", viewBox: "0 0 9 9", fill: "none" }, index.h("path", { d: "M8.18659 0.14708C8.37063 0.33182 8.38174 0.62421 8.21888 0.821452L8.18659 0.857219L4.87619 4.16727L8.18659 7.47732C8.27743 7.56861 8.32973 7.69132 8.33266 7.82007C8.3356 7.94883 8.28895 8.0738 8.20235 8.16913C8.11576 8.26446 7.99584 8.32288 7.86739 8.3323C7.73895 8.34172 7.61179 8.30143 7.51221 8.21975L7.47645 8.18746L4.1664 4.87706L0.856348 8.18746C0.765058 8.27831 0.64235 8.3306 0.513592 8.33354C0.384834 8.33647 0.25987 8.28982 0.164536 8.20322C0.0692018 8.11663 0.0107856 7.99671 0.00136402 7.86827C-0.00805761 7.73982 0.0322357 7.61266 0.113914 7.51308L0.146209 7.47732L3.4566 4.16727L0.146209 0.857219C0.0553613 0.765928 0.00306475 0.64322 0.000130477 0.514462C-0.0028038 0.385704 0.0438486 0.260741 0.130443 0.165407C0.217038 0.0700723 0.336953 0.0116562 0.4654 0.00223455C0.593846 -0.00718708 0.721002 0.0331062 0.820581 0.114785L0.856348 0.14708L4.1664 3.45748L7.47645 0.14708C7.52307 0.10045 7.57843 0.0634608 7.63935 0.0382248C7.70027 0.0129888 7.76557 0 7.83152 0C7.89746 0 7.96276 0.0129888 8.02368 0.0382248C8.0846 0.0634608 8.13996 0.10045 8.18659 0.14708Z", fill: "#111111" }))), index.h("p", { class: "ErrorParagraph" }, index.h("span", { class: "ErrorIcon" }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "9", height: "9", viewBox: "0 0 9 9" }, index.h("path", { d: "M8.18659 0.14708C8.37063 0.33182 8.38174 0.62421 8.21888 0.821452L8.18659 0.857219L4.87619 4.16727L8.18659 7.47732C8.27743 7.56861 8.32973 7.69132 8.33266 7.82007C8.3356 7.94883 8.28895 8.0738 8.20235 8.16913C8.11576 8.26446 7.99584 8.32288 7.86739 8.3323C7.73895 8.34172 7.61179 8.30143 7.51221 8.21975L7.47645 8.18746L4.1664 4.87706L0.856348 8.18746C0.765058 8.27831 0.64235 8.3306 0.513592 8.33354C0.384834 8.33647 0.25987 8.28982 0.164536 8.20322C0.0692018 8.11663 0.0107856 7.99671 0.00136402 7.86827C-0.00805761 7.73982 0.0322357 7.61266 0.113914 7.51308L0.146209 7.47732L3.4566 4.16727L0.146209 0.857219C0.0553613 0.765928 0.00306475 0.64322 0.000130477 0.514462C-0.0028038 0.385704 0.0438486 0.260741 0.130443 0.165407C0.217038 0.0700723 0.336953 0.0116562 0.4654 0.00223455C0.593846 -0.00718708 0.721002 0.0331062 0.820581 0.114785L0.856348 0.14708L4.1664 3.45748L7.47645 0.14708C7.52307 0.10045 7.57843 0.0634608 7.63935 0.0382248C7.70027 0.0129888 7.76557 0 7.83152 0C7.89746 0 7.96276 0.0129888 8.02368 0.0382248C8.0846 0.0634608 8.13996 0.10045 8.18659 0.14708Z" }))), this.errorMessageOnSubmit))), index.h("div", { class: "Paragraphs" }, index.h("p", null, translate('LugasInfoBox', this.lang))), index.h("div", { class: "LimitAmountWrapper" }, this.isSubmitted
|
|
366
384
|
&& index.h("slot", { name: 'spinner' })
|
|
367
385
|
&& index.h("div", { class: "LoadingWrapper" }, index.h("svg", { class: "spinner", viewBox: "0 0 50 50" }, index.h("circle", { class: "path", cx: "25", cy: "25", r: "20", fill: "none", "stroke-width": "5" }))), index.h("p", { class: "ChooseLimitLabel" }, translate('ChooseLimit', this.lang)), index.h("div", { class: "PredefinedAmounts" }, index.h("button", { class: this.selectedPredefinedAmount === 'Other' ? 'Active' : '', onClick: () => this.handleAmountClick('Other') }, translate('ButtonCustomValue', this.lang)), renderPredefinedButtons(), index.h("button", { class: this.selectedPredefinedAmount === 'Max' ? 'Active' : '', onClick: () => this.handleAmountClick('Max') }, translate('ButtonMax', this.lang))), this.showCustomAmount && (index.h("form", { onSubmit: (event) => this.handleSubmit(event) }, this.showCustomAmount &&
|
|
368
|
-
index.h("div", null, index.h("input", { class: `CustomAmountInput ${this.errorMessageOnInput ? 'InvalidInput' : ''}`, type: "number", value: this.selectedPredefinedAmount === 'Max' ? this.maxAmount : null, step: 0.01, placeholder: "0.00", disabled: this.selectedPredefinedAmount === 'Max', onInput: (event) => this.handleInputChange(event) }), this.errorMessageOnInput && index.h("p", { class: "InvalidParagraph" }, this.errorMessageOnInput)), this.selectedPredefinedAmount &&
|
|
369
|
-
index.h("button", { class: "PrimaryButton SetLimitBtn", type: "submit", disabled: this.isSubmitted || !Boolean(this.newAmount) || Boolean(this.errorMessageOnInput) }, translate('LugasSetLimitDialogButtonSetLimit', this.lang, {
|
|
386
|
+
index.h("div", null, index.h("input", { class: `CustomAmountInput ${this.errorMessageOnInput ? 'InvalidInput' : ''}`, type: "number", value: this.selectedPredefinedAmount === 'Max' ? this.maxAmount : null, step: 0.01, placeholder: "0.00", disabled: this.hasLugasError || this.selectedPredefinedAmount === 'Max', onInput: (event) => this.handleInputChange(event) }), this.errorMessageOnInput && index.h("p", { class: "InvalidParagraph" }, this.errorMessageOnInput)), this.selectedPredefinedAmount &&
|
|
387
|
+
index.h("button", { class: "PrimaryButton SetLimitBtn", type: "submit", disabled: this.hasLugasError || this.isSubmitted || !Boolean(this.newAmount) || Boolean(this.errorMessageOnInput) }, translate('LugasSetLimitDialogButtonSetLimit', this.lang, {
|
|
370
388
|
values: {
|
|
371
389
|
currency: this.displayedCurrency,
|
|
372
390
|
amount: Number.parseFloat(this.newAmount || '0').toFixed(2)
|
|
@@ -19,7 +19,7 @@ var patchBrowser = () => {
|
|
|
19
19
|
|
|
20
20
|
patchBrowser().then(async (options) => {
|
|
21
21
|
await appGlobals.globalScripts();
|
|
22
|
-
return index.bootstrapLazy([["player-lugas-limit.cjs",[[1,"player-lugas-limit",{"userId":[1,"user-id"],"session":[1],"endpoint":[1],"currency":[1],"amount":[1],"lang":[1],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"mbSource":[1,"mb-source"],"translationUrl":[1,"translation-url"],"isLoading":[32],"showCustomAmount":[32],"isSubmitted":[32],"isUseExistingLimitOptionActive":[32],"selectedPredefinedAmount":[32],"errorMessageOnInitialization":[32],"errorMessageOnSubmit":[32],"errorMessageOnInput":[32],"newAmount":[32]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]]], options);
|
|
22
|
+
return index.bootstrapLazy([["player-lugas-limit.cjs",[[1,"player-lugas-limit",{"userId":[1,"user-id"],"session":[1],"endpoint":[1],"currency":[1],"amount":[1],"lang":[1],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"mbSource":[1,"mb-source"],"translationUrl":[1,"translation-url"],"isLoading":[32],"showCustomAmount":[32],"isSubmitted":[32],"isUseExistingLimitOptionActive":[32],"selectedPredefinedAmount":[32],"errorMessageOnInitialization":[32],"errorMessageOnSubmit":[32],"errorMessageOnInput":[32],"hasLugasError":[32],"newAmount":[32]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]]], options);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
exports.setNonce = index.setNonce;
|
|
@@ -12,25 +12,25 @@ export class PlayerLugasLimit {
|
|
|
12
12
|
/** Displayed currency */
|
|
13
13
|
this.displayedCurrency = '';
|
|
14
14
|
/**
|
|
15
|
-
* Submits the new monthly deposit limit set by the player
|
|
16
|
-
* @param
|
|
15
|
+
* Submits the new monthly deposit limit set by the player.
|
|
16
|
+
* @param amount - User-defined amount
|
|
17
17
|
* @param keepLimit - Whether to keep the current limit
|
|
18
|
-
* @param
|
|
18
|
+
* @param isInitialLimit - Whether the limit is being set initially
|
|
19
19
|
*/
|
|
20
|
-
this.submitMonthlyDepositLimit = (amount, keepLimit = false,
|
|
20
|
+
this.submitMonthlyDepositLimit = async (amount, keepLimit = false, isInitialLimit = false) => {
|
|
21
21
|
if (keepLimit && !this.isUseExistingLimitOptionActive) {
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
24
|
this.isSubmitted = true;
|
|
25
25
|
this.errorMessageOnSubmit = '';
|
|
26
26
|
const url = new URL(`${this.endpoint}v2/player/${this.userId}/limit/lugas`);
|
|
27
|
-
const roleLimitAmount =
|
|
28
|
-
const
|
|
27
|
+
const roleLimitAmount = isInitialLimit ? this.newAmount : 0;
|
|
28
|
+
const requestBody = {
|
|
29
29
|
amount,
|
|
30
30
|
keepLimit,
|
|
31
31
|
roleLimitAmount
|
|
32
32
|
};
|
|
33
|
-
const
|
|
33
|
+
const requestOptions = {
|
|
34
34
|
method: 'POST',
|
|
35
35
|
headers: {
|
|
36
36
|
'X-SessionId': this.session,
|
|
@@ -38,31 +38,22 @@ export class PlayerLugasLimit {
|
|
|
38
38
|
'Content-Type': 'application/json',
|
|
39
39
|
'Authorization': `Bearer ${this.session}`
|
|
40
40
|
},
|
|
41
|
-
body: JSON.stringify(
|
|
41
|
+
body: JSON.stringify(requestBody)
|
|
42
42
|
};
|
|
43
|
-
|
|
44
|
-
.
|
|
45
|
-
if (!
|
|
46
|
-
const
|
|
47
|
-
throw
|
|
43
|
+
try {
|
|
44
|
+
const response = await fetch(url.href, requestOptions);
|
|
45
|
+
if (!response.ok) {
|
|
46
|
+
const error = await response.json();
|
|
47
|
+
throw error;
|
|
48
48
|
}
|
|
49
49
|
this.closeLugasModal.emit();
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
// Check for specific error structure
|
|
58
|
-
if (err.errorCode === 3 && err.errorSourceName === "GmLegislation") {
|
|
59
|
-
console.error(err.error, (_a = err.thirdPartyResponse) === null || _a === void 0 ? void 0 : _a.message);
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
console.error("Unexpected Error:", err);
|
|
63
|
-
}
|
|
64
|
-
})
|
|
65
|
-
.finally(() => this.isSubmitted = false);
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
this.handleSubmissionError(error, keepLimit);
|
|
53
|
+
}
|
|
54
|
+
finally {
|
|
55
|
+
this.isSubmitted = false;
|
|
56
|
+
}
|
|
66
57
|
};
|
|
67
58
|
this.userId = '';
|
|
68
59
|
this.session = '';
|
|
@@ -82,6 +73,7 @@ export class PlayerLugasLimit {
|
|
|
82
73
|
this.errorMessageOnInitialization = '';
|
|
83
74
|
this.errorMessageOnSubmit = '';
|
|
84
75
|
this.errorMessageOnInput = '';
|
|
76
|
+
this.hasLugasError = false;
|
|
85
77
|
this.newAmount = '';
|
|
86
78
|
}
|
|
87
79
|
/**
|
|
@@ -155,6 +147,30 @@ export class PlayerLugasLimit {
|
|
|
155
147
|
.finally(() => this.isLoading = false);
|
|
156
148
|
});
|
|
157
149
|
}
|
|
150
|
+
/**
|
|
151
|
+
* Handles errors during the submission of the monthly deposit limit.
|
|
152
|
+
* @param error - Error response from the server
|
|
153
|
+
* @param keepLimit - Whether the user opted to keep the current limit
|
|
154
|
+
*/
|
|
155
|
+
handleSubmissionError(error, keepLimit) {
|
|
156
|
+
var _a, _b;
|
|
157
|
+
this.errorMessageOnSubmit = translate('LugasNotSet', this.lang);
|
|
158
|
+
if (keepLimit) {
|
|
159
|
+
this.isUseExistingLimitOptionActive = false;
|
|
160
|
+
}
|
|
161
|
+
if (error.errorCode === 3 && error.errorSourceName === 'GmLegislation') {
|
|
162
|
+
const errorMsg = (_b = (_a = error.thirdPartyResponse) === null || _a === void 0 ? void 0 : _a.message) !== null && _b !== void 0 ? _b : '';
|
|
163
|
+
if (errorMsg.includes('F1002')) {
|
|
164
|
+
this.errorMessageOnSubmit = translate('LugasF1002Error', this.lang);
|
|
165
|
+
this.hasLugasError = true;
|
|
166
|
+
this.isUseExistingLimitOptionActive = false;
|
|
167
|
+
}
|
|
168
|
+
console.error(error.error, errorMsg);
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
console.error('Unexpected Error:', error);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
158
174
|
/**
|
|
159
175
|
* Handles form submission.
|
|
160
176
|
* @param event - The form submission event
|
|
@@ -221,13 +237,13 @@ export class PlayerLugasLimit {
|
|
|
221
237
|
*/
|
|
222
238
|
renderValidator() {
|
|
223
239
|
const renderPredefinedButtons = () => {
|
|
224
|
-
return this.predefinedAmounts.map((currentAmount) => (h("button", { class: this.selectedPredefinedAmount === currentAmount ? 'Active' : '', onClick: () => this.handleAmountClick(currentAmount) }, currentAmount)));
|
|
240
|
+
return this.predefinedAmounts.map((currentAmount) => (h("button", { class: this.selectedPredefinedAmount === currentAmount ? 'Active' : '', onClick: () => this.handleAmountClick(currentAmount), disabled: this.hasLugasError }, currentAmount)));
|
|
225
241
|
};
|
|
226
242
|
return (h("div", { class: "ValidatorContainer" }, this.errorMessageOnSubmit && (h("div", { class: "ErrorContainer" }, h("span", { class: "DismissError", onClick: () => this.errorMessageOnSubmit = '' }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "9", height: "9", viewBox: "0 0 9 9", fill: "none" }, h("path", { d: "M8.18659 0.14708C8.37063 0.33182 8.38174 0.62421 8.21888 0.821452L8.18659 0.857219L4.87619 4.16727L8.18659 7.47732C8.27743 7.56861 8.32973 7.69132 8.33266 7.82007C8.3356 7.94883 8.28895 8.0738 8.20235 8.16913C8.11576 8.26446 7.99584 8.32288 7.86739 8.3323C7.73895 8.34172 7.61179 8.30143 7.51221 8.21975L7.47645 8.18746L4.1664 4.87706L0.856348 8.18746C0.765058 8.27831 0.64235 8.3306 0.513592 8.33354C0.384834 8.33647 0.25987 8.28982 0.164536 8.20322C0.0692018 8.11663 0.0107856 7.99671 0.00136402 7.86827C-0.00805761 7.73982 0.0322357 7.61266 0.113914 7.51308L0.146209 7.47732L3.4566 4.16727L0.146209 0.857219C0.0553613 0.765928 0.00306475 0.64322 0.000130477 0.514462C-0.0028038 0.385704 0.0438486 0.260741 0.130443 0.165407C0.217038 0.0700723 0.336953 0.0116562 0.4654 0.00223455C0.593846 -0.00718708 0.721002 0.0331062 0.820581 0.114785L0.856348 0.14708L4.1664 3.45748L7.47645 0.14708C7.52307 0.10045 7.57843 0.0634608 7.63935 0.0382248C7.70027 0.0129888 7.76557 0 7.83152 0C7.89746 0 7.96276 0.0129888 8.02368 0.0382248C8.0846 0.0634608 8.13996 0.10045 8.18659 0.14708Z", fill: "#111111" }))), h("p", { class: "ErrorParagraph" }, h("span", { class: "ErrorIcon" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "9", height: "9", viewBox: "0 0 9 9" }, h("path", { d: "M8.18659 0.14708C8.37063 0.33182 8.38174 0.62421 8.21888 0.821452L8.18659 0.857219L4.87619 4.16727L8.18659 7.47732C8.27743 7.56861 8.32973 7.69132 8.33266 7.82007C8.3356 7.94883 8.28895 8.0738 8.20235 8.16913C8.11576 8.26446 7.99584 8.32288 7.86739 8.3323C7.73895 8.34172 7.61179 8.30143 7.51221 8.21975L7.47645 8.18746L4.1664 4.87706L0.856348 8.18746C0.765058 8.27831 0.64235 8.3306 0.513592 8.33354C0.384834 8.33647 0.25987 8.28982 0.164536 8.20322C0.0692018 8.11663 0.0107856 7.99671 0.00136402 7.86827C-0.00805761 7.73982 0.0322357 7.61266 0.113914 7.51308L0.146209 7.47732L3.4566 4.16727L0.146209 0.857219C0.0553613 0.765928 0.00306475 0.64322 0.000130477 0.514462C-0.0028038 0.385704 0.0438486 0.260741 0.130443 0.165407C0.217038 0.0700723 0.336953 0.0116562 0.4654 0.00223455C0.593846 -0.00718708 0.721002 0.0331062 0.820581 0.114785L0.856348 0.14708L4.1664 3.45748L7.47645 0.14708C7.52307 0.10045 7.57843 0.0634608 7.63935 0.0382248C7.70027 0.0129888 7.76557 0 7.83152 0C7.89746 0 7.96276 0.0129888 8.02368 0.0382248C8.0846 0.0634608 8.13996 0.10045 8.18659 0.14708Z" }))), this.errorMessageOnSubmit))), h("div", { class: "Paragraphs" }, h("p", null, translate('LugasInfoBox', this.lang))), h("div", { class: "LimitAmountWrapper" }, this.isSubmitted
|
|
227
243
|
&& h("slot", { name: 'spinner' })
|
|
228
244
|
&& h("div", { class: "LoadingWrapper" }, h("svg", { class: "spinner", viewBox: "0 0 50 50" }, h("circle", { class: "path", cx: "25", cy: "25", r: "20", fill: "none", "stroke-width": "5" }))), h("p", { class: "ChooseLimitLabel" }, translate('ChooseLimit', this.lang)), h("div", { class: "PredefinedAmounts" }, h("button", { class: this.selectedPredefinedAmount === 'Other' ? 'Active' : '', onClick: () => this.handleAmountClick('Other') }, translate('ButtonCustomValue', this.lang)), renderPredefinedButtons(), h("button", { class: this.selectedPredefinedAmount === 'Max' ? 'Active' : '', onClick: () => this.handleAmountClick('Max') }, translate('ButtonMax', this.lang))), this.showCustomAmount && (h("form", { onSubmit: (event) => this.handleSubmit(event) }, this.showCustomAmount &&
|
|
229
|
-
h("div", null, h("input", { class: `CustomAmountInput ${this.errorMessageOnInput ? 'InvalidInput' : ''}`, type: "number", value: this.selectedPredefinedAmount === 'Max' ? this.maxAmount : null, step: 0.01, placeholder: "0.00", disabled: this.selectedPredefinedAmount === 'Max', onInput: (event) => this.handleInputChange(event) }), this.errorMessageOnInput && h("p", { class: "InvalidParagraph" }, this.errorMessageOnInput)), this.selectedPredefinedAmount &&
|
|
230
|
-
h("button", { class: "PrimaryButton SetLimitBtn", type: "submit", disabled: this.isSubmitted || !Boolean(this.newAmount) || Boolean(this.errorMessageOnInput) }, translate('LugasSetLimitDialogButtonSetLimit', this.lang, {
|
|
245
|
+
h("div", null, h("input", { class: `CustomAmountInput ${this.errorMessageOnInput ? 'InvalidInput' : ''}`, type: "number", value: this.selectedPredefinedAmount === 'Max' ? this.maxAmount : null, step: 0.01, placeholder: "0.00", disabled: this.hasLugasError || this.selectedPredefinedAmount === 'Max', onInput: (event) => this.handleInputChange(event) }), this.errorMessageOnInput && h("p", { class: "InvalidParagraph" }, this.errorMessageOnInput)), this.selectedPredefinedAmount &&
|
|
246
|
+
h("button", { class: "PrimaryButton SetLimitBtn", type: "submit", disabled: this.hasLugasError || this.isSubmitted || !Boolean(this.newAmount) || Boolean(this.errorMessageOnInput) }, translate('LugasSetLimitDialogButtonSetLimit', this.lang, {
|
|
231
247
|
values: {
|
|
232
248
|
currency: this.displayedCurrency,
|
|
233
249
|
amount: Number.parseFloat(this.newAmount || '0').toFixed(2)
|
|
@@ -453,6 +469,7 @@ export class PlayerLugasLimit {
|
|
|
453
469
|
"errorMessageOnInitialization": {},
|
|
454
470
|
"errorMessageOnSubmit": {},
|
|
455
471
|
"errorMessageOnInput": {},
|
|
472
|
+
"hasLugasError": {},
|
|
456
473
|
"newAmount": {}
|
|
457
474
|
};
|
|
458
475
|
}
|
|
@@ -4,16 +4,16 @@ const meta = {
|
|
|
4
4
|
title: 'Player/Components/player-lugas-limit',
|
|
5
5
|
component: 'player-lugas-limit',
|
|
6
6
|
args: {
|
|
7
|
-
userId:
|
|
8
|
-
session:
|
|
9
|
-
endpoint:
|
|
10
|
-
currency:
|
|
11
|
-
amount:
|
|
12
|
-
lang:
|
|
13
|
-
clientStyling:
|
|
14
|
-
clientStylingUrl:
|
|
15
|
-
mbSource:
|
|
16
|
-
translationUrl:
|
|
7
|
+
userId: '',
|
|
8
|
+
session: '',
|
|
9
|
+
endpoint: '',
|
|
10
|
+
currency: 'EUR',
|
|
11
|
+
amount: '',
|
|
12
|
+
lang: '',
|
|
13
|
+
clientStyling: '',
|
|
14
|
+
clientStylingUrl: '',
|
|
15
|
+
mbSource: '',
|
|
16
|
+
translationUrl: '',
|
|
17
17
|
},
|
|
18
18
|
argTypes: {
|
|
19
19
|
userId: { control: 'text', description: '' },
|
|
@@ -31,7 +31,7 @@ const meta = {
|
|
|
31
31
|
export default meta;
|
|
32
32
|
const Template = (args) => {
|
|
33
33
|
return html `<player-lugas-limit
|
|
34
|
-
|
|
34
|
+
user-id="${args.userId}"
|
|
35
35
|
session="${args.session}"
|
|
36
36
|
endpoint="${args.endpoint}"
|
|
37
37
|
currency="${args.currency}"
|
|
@@ -45,14 +45,14 @@ const Template = (args) => {
|
|
|
45
45
|
};
|
|
46
46
|
export const Default = Template.bind({});
|
|
47
47
|
Default.args = {
|
|
48
|
-
userId:
|
|
49
|
-
session:
|
|
50
|
-
endpoint:
|
|
51
|
-
currency:
|
|
52
|
-
amount:
|
|
53
|
-
lang:
|
|
54
|
-
clientStyling:
|
|
55
|
-
clientStylingUrl:
|
|
56
|
-
mbSource:
|
|
57
|
-
translationUrl:
|
|
48
|
+
userId: '',
|
|
49
|
+
session: '',
|
|
50
|
+
endpoint: 'https://betathome-de-stage-api.stage.norway.everymatrix.com/',
|
|
51
|
+
currency: 'EUR',
|
|
52
|
+
amount: '',
|
|
53
|
+
lang: 'en',
|
|
54
|
+
clientStyling: '',
|
|
55
|
+
clientStylingUrl: '',
|
|
56
|
+
mbSource: '',
|
|
57
|
+
translationUrl: '',
|
|
58
58
|
};
|
|
@@ -19,6 +19,7 @@ let TRANSLATIONS = {
|
|
|
19
19
|
LugasNotSet: 'No deposit limit set. Please enter a new limit.',
|
|
20
20
|
loading: 'Loading, please wait ...',
|
|
21
21
|
error: 'It was an error while trying to fetch the data',
|
|
22
|
+
LugasF1002Error: 'We were unable to set your cross-provider deposit limit at LUGAS due to a technical error. Please contact our support team and provide error code F1002. We\'ll be happy to assist you in resolving this issue.'
|
|
22
23
|
},
|
|
23
24
|
de: {
|
|
24
25
|
LugasSetLimitDialogTitle: 'Monatliches zentrales Einzahlungslimit',
|
|
@@ -39,6 +40,7 @@ let TRANSLATIONS = {
|
|
|
39
40
|
LugasNotSet: 'Kein Einzahlungslimit festgelegt. Bitte geben Sie ein neues Limit ein.',
|
|
40
41
|
loading: 'Laden, bitte warten ...',
|
|
41
42
|
error: 'Beim Versuch, die Daten abzurufen, ist ein Fehler aufgetreten',
|
|
43
|
+
LugasF1002Error: 'Ihr anbieterübergreifendes Einzahlungslimit konnte aufgrund eines technischen Fehlers nicht in der LUGAS-Datenbank festgelegt werden. Bitte wenden Sie sich an unseren Kundenservice unter Angabe des Fehlercodes F1002. Wir helfen Ihnen dann gerne weiter.'
|
|
42
44
|
},
|
|
43
45
|
};
|
|
44
46
|
export const getTranslations = (url) => {
|
package/dist/esm/loader.js
CHANGED
|
@@ -5,7 +5,7 @@ import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|
|
7
7
|
await globalScripts();
|
|
8
|
-
return bootstrapLazy([["player-lugas-limit",[[1,"player-lugas-limit",{"userId":[1,"user-id"],"session":[1],"endpoint":[1],"currency":[1],"amount":[1],"lang":[1],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"mbSource":[1,"mb-source"],"translationUrl":[1,"translation-url"],"isLoading":[32],"showCustomAmount":[32],"isSubmitted":[32],"isUseExistingLimitOptionActive":[32],"selectedPredefinedAmount":[32],"errorMessageOnInitialization":[32],"errorMessageOnSubmit":[32],"errorMessageOnInput":[32],"newAmount":[32]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]]], options);
|
|
8
|
+
return bootstrapLazy([["player-lugas-limit",[[1,"player-lugas-limit",{"userId":[1,"user-id"],"session":[1],"endpoint":[1],"currency":[1],"amount":[1],"lang":[1],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"mbSource":[1,"mb-source"],"translationUrl":[1,"translation-url"],"isLoading":[32],"showCustomAmount":[32],"isSubmitted":[32],"isUseExistingLimitOptionActive":[32],"selectedPredefinedAmount":[32],"errorMessageOnInitialization":[32],"errorMessageOnSubmit":[32],"errorMessageOnInput":[32],"hasLugasError":[32],"newAmount":[32]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]]], options);
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export { defineCustomElements };
|
|
@@ -21,6 +21,7 @@ let TRANSLATIONS = {
|
|
|
21
21
|
LugasNotSet: 'No deposit limit set. Please enter a new limit.',
|
|
22
22
|
loading: 'Loading, please wait ...',
|
|
23
23
|
error: 'It was an error while trying to fetch the data',
|
|
24
|
+
LugasF1002Error: 'We were unable to set your cross-provider deposit limit at LUGAS due to a technical error. Please contact our support team and provide error code F1002. We\'ll be happy to assist you in resolving this issue.'
|
|
24
25
|
},
|
|
25
26
|
de: {
|
|
26
27
|
LugasSetLimitDialogTitle: 'Monatliches zentrales Einzahlungslimit',
|
|
@@ -41,6 +42,7 @@ let TRANSLATIONS = {
|
|
|
41
42
|
LugasNotSet: 'Kein Einzahlungslimit festgelegt. Bitte geben Sie ein neues Limit ein.',
|
|
42
43
|
loading: 'Laden, bitte warten ...',
|
|
43
44
|
error: 'Beim Versuch, die Daten abzurufen, ist ein Fehler aufgetreten',
|
|
45
|
+
LugasF1002Error: 'Ihr anbieterübergreifendes Einzahlungslimit konnte aufgrund eines technischen Fehlers nicht in der LUGAS-Datenbank festgelegt werden. Bitte wenden Sie sich an unseren Kundenservice unter Angabe des Fehlercodes F1002. Wir helfen Ihnen dann gerne weiter.'
|
|
44
46
|
},
|
|
45
47
|
};
|
|
46
48
|
const getTranslations = (url) => {
|
|
@@ -135,7 +137,7 @@ function setStreamStyling(stylingContainer, domain, subscription) {
|
|
|
135
137
|
}
|
|
136
138
|
}
|
|
137
139
|
|
|
138
|
-
const playerLugasLimitCss = "@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 position: absolute;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background-color: rgba(0, 0, 0, 0.5);\n display: flex;\n justify-content: center;\n align-items: center;\n font-size: var(--emw--font-size-small, 12px);\n container-type: inline-size;\n}\n.ModalContainer hr {\n border: 1px solid rgba(0, 0, 0, 0.1);\n margin: 10px 0px;\n}\n.ModalContainer p {\n margin: 0;\n}\n.ModalContainer button {\n width: 100%;\n border: 1px solid var(--emw--color-gray-100, #E8E9EB);\n padding: 10px 0;\n cursor: pointer;\n width: 100%;\n border-radius: var(--emw--border-radius-small, 4px);\n}\n.ModalContainer button.PrimaryButton {\n background: var(--emw--color-primary, #6BB816);\n border: none;\n font-weight: 500;\n}\n.ModalContainer button.PrimaryButton:not(:disabled) {\n color: var(--emw--color-white, #FFF);\n}\n.ModalContainer button.PrimaryButton:disabled {\n cursor: default;\n}\n.ModalContainer .Container {\n position: fixed;\n top: 30vh;\n width: 320px;\n background: var(--emw--color-white, #fff);\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n transform: scale(1.1);\n border-radius: 4px;\n overflow: hidden;\n}\n.ModalContainer .ValidatorContainer {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n}\n.ModalContainer .Paragraphs:not(:last-child) {\n margin-bottom: 20px;\n}\n.ModalContainer .ModalHeader {\n display: flex;\n justify-content: space-between;\n align-items: center;\n background-color: var(--emw--color-gray-50, #F7F8FA);\n padding: 12px;\n}\n.ModalContainer .ModalHeader h2 {\n font-weight: bold;\n font-size: var(--emw--font-size-small, 12px);\n margin: 0;\n}\n.ModalContainer .ModalBody {\n background: var(--emw--color-white, #FFF);\n padding: 12px;\n container-type: inline-size;\n border-radius: 4px;\n}\n.ModalContainer .ModalBody .ErrorContainer {\n display: flex;\n align-items: center;\n color: var(--emw--color-red-100, #E10014);\n border-bottom: 1px solid var(--emw--color-gray-100, #E8E9EB);\n margin: -12px;\n padding: 12px;\n margin-bottom: 12px;\n font-weight: bold;\n position: relative;\n background: linear-gradient(180deg, var(--emw--color-gray-100, #E8E9EB) 0%, rgba(255, 255, 255, 0.47) 30%);\n}\n.ModalContainer .ModalBody .DismissError {\n position: absolute;\n right: 12px;\n cursor: pointer;\n}\n.ModalContainer .ModalBody .ErrorParagraph {\n display: flex;\n align-items: center;\n}\n.ModalContainer .ModalBody .ErrorIcon {\n background: linear-gradient(180deg, var(--emw--color-red-100, #E10014) 0%, var(--emw--color-red-150, #D60080) 100%);\n text-align: center;\n width: 16px;\n height: 16px;\n border-radius: 50%;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n margin-right: 6px;\n}\n.ModalContainer .ModalBody .ErrorIcon svg {\n width: 6px;\n height: 6px;\n}\n.ModalContainer .ModalBody .ErrorIcon svg path {\n fill: var(--emw--color-white, #FFF);\n}\n.ModalContainer .ModalBody .ChooseLimitLabel {\n text-transform: uppercase;\n}\n.ModalContainer .ModalBody .LimitAmountWrapper {\n display: flex;\n flex-direction: column;\n gap: 10px;\n position: relative;\n}\n.ModalContainer .ModalBody .PredefinedAmounts {\n display: flex;\n justify-content: space-between;\n}\n.ModalContainer .ModalBody .PredefinedAmounts button {\n background: none;\n margin: -1px 0 0 -1px;\n color: var(--emw--color-gray-150, #808080);\n}\n.ModalContainer .ModalBody .PredefinedAmounts button.Active {\n font-weight: bold;\n background: var(--emw--color-gray-50, #F7F8FA);\n color: var(--emw--color-gray-200, #323233);\n}\n.ModalContainer .ModalBody .PredefinedAmounts button:first-child {\n border-radius: 4px 0 0 4px;\n}\n.ModalContainer .ModalBody .PredefinedAmounts button:last-child {\n border-radius: 0 4px 4px 0;\n}\n.ModalContainer .ModalBody .CustomAmountInput {\n width: 100%;\n padding: 10px;\n border: 1px solid var(--emw--color-gray-100, #E8E9EB);\n border-radius: 4px;\n box-sizing: border-box;\n margin-bottom: 6px;\n color: var(--emw--color-gray-200, #323233);\n font-weight: bold;\n}\n.ModalContainer .ModalBody .CustomAmountInput.InvalidInput {\n border: 1px solid var(--emw--color-red, #FF0000);\n}\n.ModalContainer .ModalBody .InvalidParagraph {\n font-size: var(--emw--font-size-small, 12px);\n color: var(--emw--color-red, #FF0000);\n}\n.ModalContainer .ModalBody .SetLimitBtn {\n margin-top: 10px;\n}\n.ModalContainer .ModalFooter {\n padding-top: 12px;\n margin: 5px 0px;\n}\n.ModalContainer .Link {\n color: inherit;\n text-decoration: underline;\n cursor: pointer;\n}\n.ModalContainer .Link.Inactive {\n cursor: default;\n color: var(--emw--color-gray-150, #808080);\n}\n.ModalContainer .PrivacyNote {\n font-size: var(--emw--font-size-x-small, 10px);\n font-style: italic;\n}\n.ModalContainer .ExistingLimit {\n margin-bottom: 15px;\n}\n\ninput {\n /* Firefox */\n -moz-appearance: textfield;\n /* Chrome, Safari, Edge, Opera */\n}\ninput::-webkit-outer-spin-button, input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\n@container (max-width: 1300px) {\n .ModalContainer .Container {\n width: 50%;\n }\n}\n@container (max-width: 800px) {\n .ModalContainer .Container {\n width: 70%;\n }\n}\n.LoadingWrapper {\n width: 100%;\n height: 100%;\n background: rgba(255, 255, 255, 0.8);\n position: absolute;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.spinner {\n animation: rotate 2s linear infinite;\n z-index: 2;\n width: 30px;\n height: 30px;\n}\n.spinner .path {\n stroke: var(--emw--color-primary, #6BB816);\n stroke-linecap: round;\n animation: dash 1.5s ease-in-out infinite;\n}\n\n@keyframes rotate {\n 100% {\n transform: rotate(360deg);\n }\n}\n@keyframes dash {\n 0% {\n stroke-dasharray: 1, 150;\n stroke-dashoffset: 0;\n }\n 50% {\n stroke-dasharray: 90, 150;\n stroke-dashoffset: -35;\n }\n 100% {\n stroke-dasharray: 90, 150;\n stroke-dashoffset: -124;\n }\n}";
|
|
140
|
+
const playerLugasLimitCss = "@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 position: absolute;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background-color: rgba(0, 0, 0, 0.5);\n display: flex;\n justify-content: center;\n align-items: center;\n font-size: var(--emw--font-size-small, 12px);\n container-type: inline-size;\n}\n.ModalContainer hr {\n border: 1px solid rgba(0, 0, 0, 0.1);\n margin: 10px 0px;\n}\n.ModalContainer p {\n margin: 0;\n}\n.ModalContainer button {\n width: 100%;\n border: 1px solid var(--emw--color-gray-100, #E8E9EB);\n padding: 10px 0;\n cursor: pointer;\n width: 100%;\n border-radius: var(--emw--border-radius-small, 4px);\n}\n.ModalContainer button.PrimaryButton {\n background: var(--emw--color-primary, #6BB816);\n border: none;\n font-weight: 500;\n}\n.ModalContainer button.PrimaryButton:not(:disabled) {\n color: var(--emw--color-white, #FFF);\n}\n.ModalContainer button.PrimaryButton:disabled {\n cursor: default;\n}\n.ModalContainer .Container {\n position: fixed;\n top: 30vh;\n width: 320px;\n background: var(--emw--color-white, #fff);\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n transform: scale(1.1);\n border-radius: 4px;\n overflow: hidden;\n}\n.ModalContainer .ValidatorContainer {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n}\n.ModalContainer .Paragraphs:not(:last-child) {\n margin-bottom: 20px;\n}\n.ModalContainer .ModalHeader {\n display: flex;\n justify-content: space-between;\n align-items: center;\n background-color: var(--emw--color-gray-50, #F7F8FA);\n padding: 12px;\n}\n.ModalContainer .ModalHeader h2 {\n font-weight: bold;\n font-size: var(--emw--font-size-small, 12px);\n margin: 0;\n}\n.ModalContainer .ModalBody {\n background: var(--emw--color-white, #FFF);\n padding: 12px;\n container-type: inline-size;\n border-radius: 4px;\n}\n.ModalContainer .ModalBody .ErrorContainer {\n display: flex;\n align-items: center;\n color: var(--emw--color-red-100, #E10014);\n border-bottom: 1px solid var(--emw--color-gray-100, #E8E9EB);\n margin: -12px;\n padding: 12px;\n margin-bottom: 12px;\n font-weight: bold;\n position: relative;\n background: linear-gradient(180deg, var(--emw--color-gray-100, #E8E9EB) 0%, rgba(255, 255, 255, 0.47) 30%);\n}\n.ModalContainer .ModalBody .DismissError {\n position: absolute;\n right: 12px;\n cursor: pointer;\n}\n.ModalContainer .ModalBody .ErrorParagraph {\n display: flex;\n align-items: center;\n}\n.ModalContainer .ModalBody .ErrorIcon {\n background: linear-gradient(180deg, var(--emw--color-red-100, #E10014) 0%, var(--emw--color-red-150, #D60080) 100%);\n text-align: center;\n width: 16px;\n height: 16px;\n border-radius: 50%;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n margin-right: 6px;\n flex-shrink: 0;\n}\n.ModalContainer .ModalBody .ErrorIcon svg {\n width: 6px;\n height: 6px;\n}\n.ModalContainer .ModalBody .ErrorIcon svg path {\n fill: var(--emw--color-white, #FFF);\n}\n.ModalContainer .ModalBody .ChooseLimitLabel {\n text-transform: uppercase;\n}\n.ModalContainer .ModalBody .LimitAmountWrapper {\n display: flex;\n flex-direction: column;\n gap: 10px;\n position: relative;\n}\n.ModalContainer .ModalBody .PredefinedAmounts {\n display: flex;\n justify-content: space-between;\n}\n.ModalContainer .ModalBody .PredefinedAmounts button {\n background: none;\n margin: -1px 0 0 -1px;\n color: var(--emw--color-gray-150, #808080);\n}\n.ModalContainer .ModalBody .PredefinedAmounts button.Active {\n font-weight: bold;\n background: var(--emw--color-gray-50, #F7F8FA);\n color: var(--emw--color-gray-200, #323233);\n}\n.ModalContainer .ModalBody .PredefinedAmounts button:first-child {\n border-radius: 4px 0 0 4px;\n}\n.ModalContainer .ModalBody .PredefinedAmounts button:last-child {\n border-radius: 0 4px 4px 0;\n}\n.ModalContainer .ModalBody .CustomAmountInput {\n width: 100%;\n padding: 10px;\n border: 1px solid var(--emw--color-gray-100, #E8E9EB);\n border-radius: 4px;\n box-sizing: border-box;\n margin-bottom: 6px;\n color: var(--emw--color-gray-200, #323233);\n font-weight: bold;\n}\n.ModalContainer .ModalBody .CustomAmountInput.InvalidInput {\n border: 1px solid var(--emw--color-red, #FF0000);\n}\n.ModalContainer .ModalBody .InvalidParagraph {\n font-size: var(--emw--font-size-small, 12px);\n color: var(--emw--color-red, #FF0000);\n}\n.ModalContainer .ModalBody .SetLimitBtn {\n margin-top: 10px;\n}\n.ModalContainer .ModalFooter {\n padding-top: 12px;\n margin: 5px 0px;\n}\n.ModalContainer .Link {\n color: inherit;\n text-decoration: underline;\n cursor: pointer;\n}\n.ModalContainer .Link.Inactive {\n cursor: default;\n color: var(--emw--color-gray-150, #808080);\n}\n.ModalContainer .PrivacyNote {\n font-size: var(--emw--font-size-x-small, 10px);\n font-style: italic;\n}\n.ModalContainer .ExistingLimit {\n margin-bottom: 15px;\n}\n\ninput {\n /* Firefox */\n -moz-appearance: textfield;\n /* Chrome, Safari, Edge, Opera */\n}\ninput::-webkit-outer-spin-button, input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\n@container (max-width: 1300px) {\n .ModalContainer .Container {\n width: 50%;\n }\n}\n@container (max-width: 800px) {\n .ModalContainer .Container {\n width: 70%;\n }\n}\n.LoadingWrapper {\n width: 100%;\n height: 100%;\n background: rgba(255, 255, 255, 0.8);\n position: absolute;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.spinner {\n animation: rotate 2s linear infinite;\n z-index: 2;\n width: 30px;\n height: 30px;\n}\n.spinner .path {\n stroke: var(--emw--color-primary, #6BB816);\n stroke-linecap: round;\n animation: dash 1.5s ease-in-out infinite;\n}\n\n@keyframes rotate {\n 100% {\n transform: rotate(360deg);\n }\n}\n@keyframes dash {\n 0% {\n stroke-dasharray: 1, 150;\n stroke-dashoffset: 0;\n }\n 50% {\n stroke-dasharray: 90, 150;\n stroke-dashoffset: -35;\n }\n 100% {\n stroke-dasharray: 90, 150;\n stroke-dashoffset: -124;\n }\n}";
|
|
139
141
|
const PlayerLugasLimitStyle0 = playerLugasLimitCss;
|
|
140
142
|
|
|
141
143
|
const PlayerLugasLimit = class {
|
|
@@ -147,25 +149,25 @@ const PlayerLugasLimit = class {
|
|
|
147
149
|
/** Displayed currency */
|
|
148
150
|
this.displayedCurrency = '';
|
|
149
151
|
/**
|
|
150
|
-
* Submits the new monthly deposit limit set by the player
|
|
151
|
-
* @param
|
|
152
|
+
* Submits the new monthly deposit limit set by the player.
|
|
153
|
+
* @param amount - User-defined amount
|
|
152
154
|
* @param keepLimit - Whether to keep the current limit
|
|
153
|
-
* @param
|
|
155
|
+
* @param isInitialLimit - Whether the limit is being set initially
|
|
154
156
|
*/
|
|
155
|
-
this.submitMonthlyDepositLimit = (amount, keepLimit = false,
|
|
157
|
+
this.submitMonthlyDepositLimit = async (amount, keepLimit = false, isInitialLimit = false) => {
|
|
156
158
|
if (keepLimit && !this.isUseExistingLimitOptionActive) {
|
|
157
159
|
return;
|
|
158
160
|
}
|
|
159
161
|
this.isSubmitted = true;
|
|
160
162
|
this.errorMessageOnSubmit = '';
|
|
161
163
|
const url = new URL(`${this.endpoint}v2/player/${this.userId}/limit/lugas`);
|
|
162
|
-
const roleLimitAmount =
|
|
163
|
-
const
|
|
164
|
+
const roleLimitAmount = isInitialLimit ? this.newAmount : 0;
|
|
165
|
+
const requestBody = {
|
|
164
166
|
amount,
|
|
165
167
|
keepLimit,
|
|
166
168
|
roleLimitAmount
|
|
167
169
|
};
|
|
168
|
-
const
|
|
170
|
+
const requestOptions = {
|
|
169
171
|
method: 'POST',
|
|
170
172
|
headers: {
|
|
171
173
|
'X-SessionId': this.session,
|
|
@@ -173,31 +175,22 @@ const PlayerLugasLimit = class {
|
|
|
173
175
|
'Content-Type': 'application/json',
|
|
174
176
|
'Authorization': `Bearer ${this.session}`
|
|
175
177
|
},
|
|
176
|
-
body: JSON.stringify(
|
|
178
|
+
body: JSON.stringify(requestBody)
|
|
177
179
|
};
|
|
178
|
-
|
|
179
|
-
.
|
|
180
|
-
if (!
|
|
181
|
-
const
|
|
182
|
-
throw
|
|
180
|
+
try {
|
|
181
|
+
const response = await fetch(url.href, requestOptions);
|
|
182
|
+
if (!response.ok) {
|
|
183
|
+
const error = await response.json();
|
|
184
|
+
throw error;
|
|
183
185
|
}
|
|
184
186
|
this.closeLugasModal.emit();
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
// Check for specific error structure
|
|
193
|
-
if (err.errorCode === 3 && err.errorSourceName === "GmLegislation") {
|
|
194
|
-
console.error(err.error, (_a = err.thirdPartyResponse) === null || _a === void 0 ? void 0 : _a.message);
|
|
195
|
-
}
|
|
196
|
-
else {
|
|
197
|
-
console.error("Unexpected Error:", err);
|
|
198
|
-
}
|
|
199
|
-
})
|
|
200
|
-
.finally(() => this.isSubmitted = false);
|
|
187
|
+
}
|
|
188
|
+
catch (error) {
|
|
189
|
+
this.handleSubmissionError(error, keepLimit);
|
|
190
|
+
}
|
|
191
|
+
finally {
|
|
192
|
+
this.isSubmitted = false;
|
|
193
|
+
}
|
|
201
194
|
};
|
|
202
195
|
this.userId = '';
|
|
203
196
|
this.session = '';
|
|
@@ -217,6 +210,7 @@ const PlayerLugasLimit = class {
|
|
|
217
210
|
this.errorMessageOnInitialization = '';
|
|
218
211
|
this.errorMessageOnSubmit = '';
|
|
219
212
|
this.errorMessageOnInput = '';
|
|
213
|
+
this.hasLugasError = false;
|
|
220
214
|
this.newAmount = '';
|
|
221
215
|
}
|
|
222
216
|
/**
|
|
@@ -290,6 +284,30 @@ const PlayerLugasLimit = class {
|
|
|
290
284
|
.finally(() => this.isLoading = false);
|
|
291
285
|
});
|
|
292
286
|
}
|
|
287
|
+
/**
|
|
288
|
+
* Handles errors during the submission of the monthly deposit limit.
|
|
289
|
+
* @param error - Error response from the server
|
|
290
|
+
* @param keepLimit - Whether the user opted to keep the current limit
|
|
291
|
+
*/
|
|
292
|
+
handleSubmissionError(error, keepLimit) {
|
|
293
|
+
var _a, _b;
|
|
294
|
+
this.errorMessageOnSubmit = translate('LugasNotSet', this.lang);
|
|
295
|
+
if (keepLimit) {
|
|
296
|
+
this.isUseExistingLimitOptionActive = false;
|
|
297
|
+
}
|
|
298
|
+
if (error.errorCode === 3 && error.errorSourceName === 'GmLegislation') {
|
|
299
|
+
const errorMsg = (_b = (_a = error.thirdPartyResponse) === null || _a === void 0 ? void 0 : _a.message) !== null && _b !== void 0 ? _b : '';
|
|
300
|
+
if (errorMsg.includes('F1002')) {
|
|
301
|
+
this.errorMessageOnSubmit = translate('LugasF1002Error', this.lang);
|
|
302
|
+
this.hasLugasError = true;
|
|
303
|
+
this.isUseExistingLimitOptionActive = false;
|
|
304
|
+
}
|
|
305
|
+
console.error(error.error, errorMsg);
|
|
306
|
+
}
|
|
307
|
+
else {
|
|
308
|
+
console.error('Unexpected Error:', error);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
293
311
|
/**
|
|
294
312
|
* Handles form submission.
|
|
295
313
|
* @param event - The form submission event
|
|
@@ -356,13 +374,13 @@ const PlayerLugasLimit = class {
|
|
|
356
374
|
*/
|
|
357
375
|
renderValidator() {
|
|
358
376
|
const renderPredefinedButtons = () => {
|
|
359
|
-
return this.predefinedAmounts.map((currentAmount) => (h("button", { class: this.selectedPredefinedAmount === currentAmount ? 'Active' : '', onClick: () => this.handleAmountClick(currentAmount) }, currentAmount)));
|
|
377
|
+
return this.predefinedAmounts.map((currentAmount) => (h("button", { class: this.selectedPredefinedAmount === currentAmount ? 'Active' : '', onClick: () => this.handleAmountClick(currentAmount), disabled: this.hasLugasError }, currentAmount)));
|
|
360
378
|
};
|
|
361
379
|
return (h("div", { class: "ValidatorContainer" }, this.errorMessageOnSubmit && (h("div", { class: "ErrorContainer" }, h("span", { class: "DismissError", onClick: () => this.errorMessageOnSubmit = '' }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "9", height: "9", viewBox: "0 0 9 9", fill: "none" }, h("path", { d: "M8.18659 0.14708C8.37063 0.33182 8.38174 0.62421 8.21888 0.821452L8.18659 0.857219L4.87619 4.16727L8.18659 7.47732C8.27743 7.56861 8.32973 7.69132 8.33266 7.82007C8.3356 7.94883 8.28895 8.0738 8.20235 8.16913C8.11576 8.26446 7.99584 8.32288 7.86739 8.3323C7.73895 8.34172 7.61179 8.30143 7.51221 8.21975L7.47645 8.18746L4.1664 4.87706L0.856348 8.18746C0.765058 8.27831 0.64235 8.3306 0.513592 8.33354C0.384834 8.33647 0.25987 8.28982 0.164536 8.20322C0.0692018 8.11663 0.0107856 7.99671 0.00136402 7.86827C-0.00805761 7.73982 0.0322357 7.61266 0.113914 7.51308L0.146209 7.47732L3.4566 4.16727L0.146209 0.857219C0.0553613 0.765928 0.00306475 0.64322 0.000130477 0.514462C-0.0028038 0.385704 0.0438486 0.260741 0.130443 0.165407C0.217038 0.0700723 0.336953 0.0116562 0.4654 0.00223455C0.593846 -0.00718708 0.721002 0.0331062 0.820581 0.114785L0.856348 0.14708L4.1664 3.45748L7.47645 0.14708C7.52307 0.10045 7.57843 0.0634608 7.63935 0.0382248C7.70027 0.0129888 7.76557 0 7.83152 0C7.89746 0 7.96276 0.0129888 8.02368 0.0382248C8.0846 0.0634608 8.13996 0.10045 8.18659 0.14708Z", fill: "#111111" }))), h("p", { class: "ErrorParagraph" }, h("span", { class: "ErrorIcon" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "9", height: "9", viewBox: "0 0 9 9" }, h("path", { d: "M8.18659 0.14708C8.37063 0.33182 8.38174 0.62421 8.21888 0.821452L8.18659 0.857219L4.87619 4.16727L8.18659 7.47732C8.27743 7.56861 8.32973 7.69132 8.33266 7.82007C8.3356 7.94883 8.28895 8.0738 8.20235 8.16913C8.11576 8.26446 7.99584 8.32288 7.86739 8.3323C7.73895 8.34172 7.61179 8.30143 7.51221 8.21975L7.47645 8.18746L4.1664 4.87706L0.856348 8.18746C0.765058 8.27831 0.64235 8.3306 0.513592 8.33354C0.384834 8.33647 0.25987 8.28982 0.164536 8.20322C0.0692018 8.11663 0.0107856 7.99671 0.00136402 7.86827C-0.00805761 7.73982 0.0322357 7.61266 0.113914 7.51308L0.146209 7.47732L3.4566 4.16727L0.146209 0.857219C0.0553613 0.765928 0.00306475 0.64322 0.000130477 0.514462C-0.0028038 0.385704 0.0438486 0.260741 0.130443 0.165407C0.217038 0.0700723 0.336953 0.0116562 0.4654 0.00223455C0.593846 -0.00718708 0.721002 0.0331062 0.820581 0.114785L0.856348 0.14708L4.1664 3.45748L7.47645 0.14708C7.52307 0.10045 7.57843 0.0634608 7.63935 0.0382248C7.70027 0.0129888 7.76557 0 7.83152 0C7.89746 0 7.96276 0.0129888 8.02368 0.0382248C8.0846 0.0634608 8.13996 0.10045 8.18659 0.14708Z" }))), this.errorMessageOnSubmit))), h("div", { class: "Paragraphs" }, h("p", null, translate('LugasInfoBox', this.lang))), h("div", { class: "LimitAmountWrapper" }, this.isSubmitted
|
|
362
380
|
&& h("slot", { name: 'spinner' })
|
|
363
381
|
&& h("div", { class: "LoadingWrapper" }, h("svg", { class: "spinner", viewBox: "0 0 50 50" }, h("circle", { class: "path", cx: "25", cy: "25", r: "20", fill: "none", "stroke-width": "5" }))), h("p", { class: "ChooseLimitLabel" }, translate('ChooseLimit', this.lang)), h("div", { class: "PredefinedAmounts" }, h("button", { class: this.selectedPredefinedAmount === 'Other' ? 'Active' : '', onClick: () => this.handleAmountClick('Other') }, translate('ButtonCustomValue', this.lang)), renderPredefinedButtons(), h("button", { class: this.selectedPredefinedAmount === 'Max' ? 'Active' : '', onClick: () => this.handleAmountClick('Max') }, translate('ButtonMax', this.lang))), this.showCustomAmount && (h("form", { onSubmit: (event) => this.handleSubmit(event) }, this.showCustomAmount &&
|
|
364
|
-
h("div", null, h("input", { class: `CustomAmountInput ${this.errorMessageOnInput ? 'InvalidInput' : ''}`, type: "number", value: this.selectedPredefinedAmount === 'Max' ? this.maxAmount : null, step: 0.01, placeholder: "0.00", disabled: this.selectedPredefinedAmount === 'Max', onInput: (event) => this.handleInputChange(event) }), this.errorMessageOnInput && h("p", { class: "InvalidParagraph" }, this.errorMessageOnInput)), this.selectedPredefinedAmount &&
|
|
365
|
-
h("button", { class: "PrimaryButton SetLimitBtn", type: "submit", disabled: this.isSubmitted || !Boolean(this.newAmount) || Boolean(this.errorMessageOnInput) }, translate('LugasSetLimitDialogButtonSetLimit', this.lang, {
|
|
382
|
+
h("div", null, h("input", { class: `CustomAmountInput ${this.errorMessageOnInput ? 'InvalidInput' : ''}`, type: "number", value: this.selectedPredefinedAmount === 'Max' ? this.maxAmount : null, step: 0.01, placeholder: "0.00", disabled: this.hasLugasError || this.selectedPredefinedAmount === 'Max', onInput: (event) => this.handleInputChange(event) }), this.errorMessageOnInput && h("p", { class: "InvalidParagraph" }, this.errorMessageOnInput)), this.selectedPredefinedAmount &&
|
|
383
|
+
h("button", { class: "PrimaryButton SetLimitBtn", type: "submit", disabled: this.hasLugasError || this.isSubmitted || !Boolean(this.newAmount) || Boolean(this.errorMessageOnInput) }, translate('LugasSetLimitDialogButtonSetLimit', this.lang, {
|
|
366
384
|
values: {
|
|
367
385
|
currency: this.displayedCurrency,
|
|
368
386
|
amount: Number.parseFloat(this.newAmount || '0').toFixed(2)
|
|
@@ -16,5 +16,5 @@ var patchBrowser = () => {
|
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(async (options) => {
|
|
18
18
|
await globalScripts();
|
|
19
|
-
return bootstrapLazy([["player-lugas-limit",[[1,"player-lugas-limit",{"userId":[1,"user-id"],"session":[1],"endpoint":[1],"currency":[1],"amount":[1],"lang":[1],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"mbSource":[1,"mb-source"],"translationUrl":[1,"translation-url"],"isLoading":[32],"showCustomAmount":[32],"isSubmitted":[32],"isUseExistingLimitOptionActive":[32],"selectedPredefinedAmount":[32],"errorMessageOnInitialization":[32],"errorMessageOnSubmit":[32],"errorMessageOnInput":[32],"newAmount":[32]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]]], options);
|
|
19
|
+
return bootstrapLazy([["player-lugas-limit",[[1,"player-lugas-limit",{"userId":[1,"user-id"],"session":[1],"endpoint":[1],"currency":[1],"amount":[1],"lang":[1],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"mbSource":[1,"mb-source"],"translationUrl":[1,"translation-url"],"isLoading":[32],"showCustomAmount":[32],"isSubmitted":[32],"isUseExistingLimitOptionActive":[32],"selectedPredefinedAmount":[32],"errorMessageOnInitialization":[32],"errorMessageOnSubmit":[32],"errorMessageOnInput":[32],"hasLugasError":[32],"newAmount":[32]},null,{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}]]]], options);
|
|
20
20
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as n,c as t,h as i}from"./p-cb6ab8af.js";let e={en:{LugasSetLimitDialogTitle:"Monthly Central Deposit Limit",LugasInfoBox:"The central limit is your monthly deposit limit for all licensed websites in Germany. Note that your limit and deposit details may vary if changed on other sites.",ChooseLimit:"Choose Limit",ButtonCustomValue:"Other",ButtonMax:"Max",LugasSetLimitDialogButtonSetLimit:"SET LIMIT {amount} {currency}",invalidInputMessageLimit:"The value entered must be between {minValue} {currency} and {maxValue} {currency}.",LugasSetLimitDialogPrivacyNote:{text:"The selected limit is connected to processing player's personal data due to our legal obligations. In some cases setting a limit is a consent to processing player's personal data. For details see our ",link:"Privacy Policy"},LugasSetLimitDialogExistingLimit:{text:"If you would like to use your existing limit ",link:"click here"},LugasNotSet:"No deposit limit set. Please enter a new limit.",loading:"Loading, please wait ...",error:"It was an error while trying to fetch the data",LugasF1002Error:"We were unable to set your cross-provider deposit limit at LUGAS due to a technical error. Please contact our support team and provide error code F1002. We'll be happy to assist you in resolving this issue."},de:{LugasSetLimitDialogTitle:"Monatliches zentrales Einzahlungslimit",LugasInfoBox:"Das zentrale Limit ist Ihr monatliches Einzahlungslimit für alle lizenzierten Websites in Deutschland. Beachten Sie, dass sich Ihr Limit und der verbleibende Betrag ändern können, wenn Sie auf anderen Websites Einzahlungen vornehmen oder Ihr Limit anpassen.",ChooseLimit:"Limit wählen",ButtonCustomValue:"Eigener",ButtonMax:"Max",LugasSetLimitDialogButtonSetLimit:"LIMIT SETZEN {amount} {currency}",invalidInputMessageLimit:"Der eingegebene Wert muss zwischen {minValue} und {maxValue} {currency} liegen.",LugasSetLimitDialogPrivacyNote:{text:"Das gewählte Limit steht wegen unserer rechtlichen Verpflichtungen in Verbindung mit der Verarbeitung persönlicher Daten der Spieler. In manchen Fällen gilt das Setzen eines Limits als Einwilligung zur Verarbeitung persönlicher Daten des Spielers. Mehr Infos unter ",link:"Erklärung zum Datenschutz"},LugasSetLimitDialogExistingLimit:{text:"Wenn Sie Ihr bestehendes Limit nutzen möchten, ",link:"klicken Sie hier"},LugasNotSet:"Kein Einzahlungslimit festgelegt. Bitte geben Sie ein neues Limit ein.",loading:"Laden, bitte warten ...",error:"Beim Versuch, die Daten abzurufen, ist ein Fehler aufgetreten",LugasF1002Error:"Ihr anbieterübergreifendes Einzahlungslimit konnte aufgrund eines technischen Fehlers nicht in der LUGAS-Datenbank festgelegt werden. Bitte wenden Sie sich an unseren Kundenservice unter Angabe des Fehlercodes F1002. Wir helfen Ihnen dann gerne weiter."}};const o=n=>new Promise((t=>{fetch(n).then((n=>n.json())).then((n=>{Object.keys(n).forEach((t=>{e[t]||(e[t]={});for(let i in n[t])e[t][i]=n[t][i]})),t(!0)}))})),a=(n,t,i)=>{let o=(a=e[t||"de"],n.split(".").reduce(((n,t)=>n&&void 0!==n[t]?n[t]:null),a));var a;if(null===o)return n;if(void 0!==i)for(const[n,t]of Object.entries(i.values)){const i=new RegExp(`{${n}}`,"g");o=o.replace(i,t)}return o};function s(n,t){if(n){const i=document.createElement("style");i.innerHTML=t,n.appendChild(i)}}function r(n,t){const i=new URL(t);fetch(i.href).then((n=>n.text())).then((t=>{const i=document.createElement("style");i.innerHTML=t,n&&n.appendChild(i)})).catch((n=>{console.error("There was an error while trying to load client styling from URL",n)}))}const l=class{constructor(i){n(this,i),this.closeLugasModal=t(this,"closeLugasModal",7),this.predefinedAmounts=[],this.displayedCurrency="",this.submitMonthlyDepositLimit=async(n,t=!1,i=!1)=>{if(t&&!this.isUseExistingLimitOptionActive)return;this.isSubmitted=!0,this.errorMessageOnSubmit="";const e=new URL(`${this.endpoint}v2/player/${this.userId}/limit/lugas`),o={method:"POST",headers:{"X-SessionId":this.session,"X-Session-Type":"others","Content-Type":"application/json",Authorization:`Bearer ${this.session}`},body:JSON.stringify({amount:n,keepLimit:t,roleLimitAmount:i?this.newAmount:0})};try{const n=await fetch(e.href,o);if(!n.ok)throw await n.json();this.closeLugasModal.emit()}catch(n){this.handleSubmissionError(n,t)}finally{this.isSubmitted=!1}},this.userId="",this.session="",this.endpoint="",this.currency="EUR",this.amount="",this.lang=void 0,this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.translationUrl="",this.isLoading=!1,this.showCustomAmount=!1,this.isSubmitted=!1,this.isUseExistingLimitOptionActive=!0,this.selectedPredefinedAmount=void 0,this.errorMessageOnInitialization="",this.errorMessageOnSubmit="",this.errorMessageOnInput="",this.hasLugasError=!1,this.newAmount=""}handleNewTranslations(){o(this.translationUrl)}handleClientStylingChange(n,t){n!=t&&s(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(n,t){n!=t&&this.clientStylingUrl&&r(this.stylingContainer,this.clientStylingUrl)}async componentWillLoad(){this.translationUrl.length>2&&await o(this.translationUrl),await this.getMonthlyDepositLimitConfig(),this.displayedCurrency="EUR"===this.currency?"€":this.currency}componentDidLoad(){this.stylingContainer&&(null!=window.emMessageBus?function(n,t){if(window.emMessageBus){const i=document.createElement("style");window.emMessageBus.subscribe(t,(t=>{i.innerHTML=t,n&&n.appendChild(i)}))}}(this.stylingContainer,`${this.mbSource}.Style`):(this.clientStyling&&s(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&r(this.stylingContainer,this.clientStylingUrl)))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}async getMonthlyDepositLimitConfig(){const n=new URL(`${this.endpoint}api/v1/gm/legislation/config/month-deposit-limit`);return this.isLoading=!0,new Promise((t=>{fetch(n.href).then((n=>{if(n.status>=300)throw new Error("There was an error while fetching the configuration");return n.json()})).then((n=>{this.predefinedAmounts=n.preDefinedOptions,this.minAmount=n.minAmount,this.maxAmount=n.maxAmount,t(!0)})).catch((n=>{this.errorMessageOnInitialization=a("error",this.lang),console.log(n)})).finally((()=>this.isLoading=!1))}))}handleSubmissionError(n,t){var i,e;if(this.errorMessageOnSubmit=a("LugasNotSet",this.lang),t&&(this.isUseExistingLimitOptionActive=!1),3===n.errorCode&&"GmLegislation"===n.errorSourceName){const t=null!==(e=null===(i=n.thirdPartyResponse)||void 0===i?void 0:i.message)&&void 0!==e?e:"";t.includes("F1002")&&(this.errorMessageOnSubmit=a("LugasF1002Error",this.lang),this.hasLugasError=!0,this.isUseExistingLimitOptionActive=!1),console.error(n.error,t)}else console.error("Unexpected Error:",n)}handleSubmit(n){n.preventDefault(),this.errorMessageOnInput||this.submitMonthlyDepositLimit(this.newAmount,!1,!0)}handleInputChange(n){this.newAmount=n.target.value,this.isValidNumber=!isNaN(Number(this.newAmount)),this.isWithinRange=Number(this.newAmount)>=this.minAmount&&Number(this.newAmount)<=this.maxAmount,this.errorMessageOnInput=this.isWithinRange&&this.isValidNumber?"":a("invalidInputMessageLimit",this.lang,{values:{currency:this.displayedCurrency,minValue:this.minAmount,maxValue:this.maxAmount}});const t=this.newAmount.split(".");t.length>1&&(this.newAmount=`${t[0]}.${t[1].slice(0,2)}`,n.target.value=this.newAmount)}handleAmountClick(n){switch(this.showCustomAmount=!1,this.errorMessageOnInput="",this.selectedPredefinedAmount=n,n){case"Other":this.newAmount="",this.showCustomAmount=!0;break;case"Max":this.newAmount=this.maxAmount.toString(),this.showCustomAmount=!0;break;default:this.newAmount=n,this.submitMonthlyDepositLimit(this.newAmount,!1,!0)}}goToPrivacyPolicy(){window.postMessage({type:"GoToPrivacyPolicy"})}renderValidator(){return i("div",{class:"ValidatorContainer"},this.errorMessageOnSubmit&&i("div",{class:"ErrorContainer"},i("span",{class:"DismissError",onClick:()=>this.errorMessageOnSubmit=""},i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"9",height:"9",viewBox:"0 0 9 9",fill:"none"},i("path",{d:"M8.18659 0.14708C8.37063 0.33182 8.38174 0.62421 8.21888 0.821452L8.18659 0.857219L4.87619 4.16727L8.18659 7.47732C8.27743 7.56861 8.32973 7.69132 8.33266 7.82007C8.3356 7.94883 8.28895 8.0738 8.20235 8.16913C8.11576 8.26446 7.99584 8.32288 7.86739 8.3323C7.73895 8.34172 7.61179 8.30143 7.51221 8.21975L7.47645 8.18746L4.1664 4.87706L0.856348 8.18746C0.765058 8.27831 0.64235 8.3306 0.513592 8.33354C0.384834 8.33647 0.25987 8.28982 0.164536 8.20322C0.0692018 8.11663 0.0107856 7.99671 0.00136402 7.86827C-0.00805761 7.73982 0.0322357 7.61266 0.113914 7.51308L0.146209 7.47732L3.4566 4.16727L0.146209 0.857219C0.0553613 0.765928 0.00306475 0.64322 0.000130477 0.514462C-0.0028038 0.385704 0.0438486 0.260741 0.130443 0.165407C0.217038 0.0700723 0.336953 0.0116562 0.4654 0.00223455C0.593846 -0.00718708 0.721002 0.0331062 0.820581 0.114785L0.856348 0.14708L4.1664 3.45748L7.47645 0.14708C7.52307 0.10045 7.57843 0.0634608 7.63935 0.0382248C7.70027 0.0129888 7.76557 0 7.83152 0C7.89746 0 7.96276 0.0129888 8.02368 0.0382248C8.0846 0.0634608 8.13996 0.10045 8.18659 0.14708Z",fill:"#111111"}))),i("p",{class:"ErrorParagraph"},i("span",{class:"ErrorIcon"},i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"9",height:"9",viewBox:"0 0 9 9"},i("path",{d:"M8.18659 0.14708C8.37063 0.33182 8.38174 0.62421 8.21888 0.821452L8.18659 0.857219L4.87619 4.16727L8.18659 7.47732C8.27743 7.56861 8.32973 7.69132 8.33266 7.82007C8.3356 7.94883 8.28895 8.0738 8.20235 8.16913C8.11576 8.26446 7.99584 8.32288 7.86739 8.3323C7.73895 8.34172 7.61179 8.30143 7.51221 8.21975L7.47645 8.18746L4.1664 4.87706L0.856348 8.18746C0.765058 8.27831 0.64235 8.3306 0.513592 8.33354C0.384834 8.33647 0.25987 8.28982 0.164536 8.20322C0.0692018 8.11663 0.0107856 7.99671 0.00136402 7.86827C-0.00805761 7.73982 0.0322357 7.61266 0.113914 7.51308L0.146209 7.47732L3.4566 4.16727L0.146209 0.857219C0.0553613 0.765928 0.00306475 0.64322 0.000130477 0.514462C-0.0028038 0.385704 0.0438486 0.260741 0.130443 0.165407C0.217038 0.0700723 0.336953 0.0116562 0.4654 0.00223455C0.593846 -0.00718708 0.721002 0.0331062 0.820581 0.114785L0.856348 0.14708L4.1664 3.45748L7.47645 0.14708C7.52307 0.10045 7.57843 0.0634608 7.63935 0.0382248C7.70027 0.0129888 7.76557 0 7.83152 0C7.89746 0 7.96276 0.0129888 8.02368 0.0382248C8.0846 0.0634608 8.13996 0.10045 8.18659 0.14708Z"}))),this.errorMessageOnSubmit)),i("div",{class:"Paragraphs"},i("p",null,a("LugasInfoBox",this.lang))),i("div",{class:"LimitAmountWrapper"},this.isSubmitted&&i("slot",{name:"spinner"})&&i("div",{class:"LoadingWrapper"},i("svg",{class:"spinner",viewBox:"0 0 50 50"},i("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none","stroke-width":"5"}))),i("p",{class:"ChooseLimitLabel"},a("ChooseLimit",this.lang)),i("div",{class:"PredefinedAmounts"},i("button",{class:"Other"===this.selectedPredefinedAmount?"Active":"",onClick:()=>this.handleAmountClick("Other")},a("ButtonCustomValue",this.lang)),(()=>this.predefinedAmounts.map((n=>i("button",{class:this.selectedPredefinedAmount===n?"Active":"",onClick:()=>this.handleAmountClick(n),disabled:this.hasLugasError},n))))(),i("button",{class:"Max"===this.selectedPredefinedAmount?"Active":"",onClick:()=>this.handleAmountClick("Max")},a("ButtonMax",this.lang))),this.showCustomAmount&&i("form",{onSubmit:n=>this.handleSubmit(n)},this.showCustomAmount&&i("div",null,i("input",{class:"CustomAmountInput "+(this.errorMessageOnInput?"InvalidInput":""),type:"number",value:"Max"===this.selectedPredefinedAmount?this.maxAmount:null,step:.01,placeholder:"0.00",disabled:this.hasLugasError||"Max"===this.selectedPredefinedAmount,onInput:n=>this.handleInputChange(n)}),this.errorMessageOnInput&&i("p",{class:"InvalidParagraph"},this.errorMessageOnInput)),this.selectedPredefinedAmount&&i("button",{class:"PrimaryButton SetLimitBtn",type:"submit",disabled:this.hasLugasError||this.isSubmitted||!Boolean(this.newAmount)||Boolean(this.errorMessageOnInput)},a("LugasSetLimitDialogButtonSetLimit",this.lang,{values:{currency:this.displayedCurrency,amount:Number.parseFloat(this.newAmount||"0").toFixed(2)}})))),i("div",{class:"ModalFooter"},i("hr",null),i("div",{class:"Paragraphs"},i("p",{class:"ExistingLimit"},a("LugasSetLimitDialogExistingLimit.text",this.lang),i("span",{class:this.isUseExistingLimitOptionActive?"Link":"Link Inactive",onClick:()=>this.submitMonthlyDepositLimit(this.amount,!0)},a("LugasSetLimitDialogExistingLimit.link",this.lang))),i("p",{class:"PrivacyNote"},a("LugasSetLimitDialogPrivacyNote.text",this.lang),i("span",{class:"Link",onClick:this.goToPrivacyPolicy},a("LugasSetLimitDialogPrivacyNote.link",this.lang))))))}render(){if(this.isLoading)return i("div",null,i("p",null,a("loading",this.lang,{values:{currency:this.currency}})));if(this.errorMessageOnInitialization)return i("div",null,i("p",null,this.errorMessageOnInitialization));{const n=this.renderValidator();return i("div",{class:"ModalContainer",ref:n=>this.stylingContainer=n},i("div",{class:"Container"},i("div",{class:"ModalHeader"},i("h2",null,a("LugasSetLimitDialogTitle",this.lang))),i("div",{class:"ModalBody"},n)))}}static get watchers(){return{translationUrl:["handleNewTranslations"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}}};l.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 position: absolute;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background-color: rgba(0, 0, 0, 0.5);\n display: flex;\n justify-content: center;\n align-items: center;\n font-size: var(--emw--font-size-small, 12px);\n container-type: inline-size;\n}\n.ModalContainer hr {\n border: 1px solid rgba(0, 0, 0, 0.1);\n margin: 10px 0px;\n}\n.ModalContainer p {\n margin: 0;\n}\n.ModalContainer button {\n width: 100%;\n border: 1px solid var(--emw--color-gray-100, #E8E9EB);\n padding: 10px 0;\n cursor: pointer;\n width: 100%;\n border-radius: var(--emw--border-radius-small, 4px);\n}\n.ModalContainer button.PrimaryButton {\n background: var(--emw--color-primary, #6BB816);\n border: none;\n font-weight: 500;\n}\n.ModalContainer button.PrimaryButton:not(:disabled) {\n color: var(--emw--color-white, #FFF);\n}\n.ModalContainer button.PrimaryButton:disabled {\n cursor: default;\n}\n.ModalContainer .Container {\n position: fixed;\n top: 30vh;\n width: 320px;\n background: var(--emw--color-white, #fff);\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n transform: scale(1.1);\n border-radius: 4px;\n overflow: hidden;\n}\n.ModalContainer .ValidatorContainer {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n}\n.ModalContainer .Paragraphs:not(:last-child) {\n margin-bottom: 20px;\n}\n.ModalContainer .ModalHeader {\n display: flex;\n justify-content: space-between;\n align-items: center;\n background-color: var(--emw--color-gray-50, #F7F8FA);\n padding: 12px;\n}\n.ModalContainer .ModalHeader h2 {\n font-weight: bold;\n font-size: var(--emw--font-size-small, 12px);\n margin: 0;\n}\n.ModalContainer .ModalBody {\n background: var(--emw--color-white, #FFF);\n padding: 12px;\n container-type: inline-size;\n border-radius: 4px;\n}\n.ModalContainer .ModalBody .ErrorContainer {\n display: flex;\n align-items: center;\n color: var(--emw--color-red-100, #E10014);\n border-bottom: 1px solid var(--emw--color-gray-100, #E8E9EB);\n margin: -12px;\n padding: 12px;\n margin-bottom: 12px;\n font-weight: bold;\n position: relative;\n background: linear-gradient(180deg, var(--emw--color-gray-100, #E8E9EB) 0%, rgba(255, 255, 255, 0.47) 30%);\n}\n.ModalContainer .ModalBody .DismissError {\n position: absolute;\n right: 12px;\n cursor: pointer;\n}\n.ModalContainer .ModalBody .ErrorParagraph {\n display: flex;\n align-items: center;\n}\n.ModalContainer .ModalBody .ErrorIcon {\n background: linear-gradient(180deg, var(--emw--color-red-100, #E10014) 0%, var(--emw--color-red-150, #D60080) 100%);\n text-align: center;\n width: 16px;\n height: 16px;\n border-radius: 50%;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n margin-right: 6px;\n flex-shrink: 0;\n}\n.ModalContainer .ModalBody .ErrorIcon svg {\n width: 6px;\n height: 6px;\n}\n.ModalContainer .ModalBody .ErrorIcon svg path {\n fill: var(--emw--color-white, #FFF);\n}\n.ModalContainer .ModalBody .ChooseLimitLabel {\n text-transform: uppercase;\n}\n.ModalContainer .ModalBody .LimitAmountWrapper {\n display: flex;\n flex-direction: column;\n gap: 10px;\n position: relative;\n}\n.ModalContainer .ModalBody .PredefinedAmounts {\n display: flex;\n justify-content: space-between;\n}\n.ModalContainer .ModalBody .PredefinedAmounts button {\n background: none;\n margin: -1px 0 0 -1px;\n color: var(--emw--color-gray-150, #808080);\n}\n.ModalContainer .ModalBody .PredefinedAmounts button.Active {\n font-weight: bold;\n background: var(--emw--color-gray-50, #F7F8FA);\n color: var(--emw--color-gray-200, #323233);\n}\n.ModalContainer .ModalBody .PredefinedAmounts button:first-child {\n border-radius: 4px 0 0 4px;\n}\n.ModalContainer .ModalBody .PredefinedAmounts button:last-child {\n border-radius: 0 4px 4px 0;\n}\n.ModalContainer .ModalBody .CustomAmountInput {\n width: 100%;\n padding: 10px;\n border: 1px solid var(--emw--color-gray-100, #E8E9EB);\n border-radius: 4px;\n box-sizing: border-box;\n margin-bottom: 6px;\n color: var(--emw--color-gray-200, #323233);\n font-weight: bold;\n}\n.ModalContainer .ModalBody .CustomAmountInput.InvalidInput {\n border: 1px solid var(--emw--color-red, #FF0000);\n}\n.ModalContainer .ModalBody .InvalidParagraph {\n font-size: var(--emw--font-size-small, 12px);\n color: var(--emw--color-red, #FF0000);\n}\n.ModalContainer .ModalBody .SetLimitBtn {\n margin-top: 10px;\n}\n.ModalContainer .ModalFooter {\n padding-top: 12px;\n margin: 5px 0px;\n}\n.ModalContainer .Link {\n color: inherit;\n text-decoration: underline;\n cursor: pointer;\n}\n.ModalContainer .Link.Inactive {\n cursor: default;\n color: var(--emw--color-gray-150, #808080);\n}\n.ModalContainer .PrivacyNote {\n font-size: var(--emw--font-size-x-small, 10px);\n font-style: italic;\n}\n.ModalContainer .ExistingLimit {\n margin-bottom: 15px;\n}\n\ninput {\n /* Firefox */\n -moz-appearance: textfield;\n /* Chrome, Safari, Edge, Opera */\n}\ninput::-webkit-outer-spin-button, input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\n@container (max-width: 1300px) {\n .ModalContainer .Container {\n width: 50%;\n }\n}\n@container (max-width: 800px) {\n .ModalContainer .Container {\n width: 70%;\n }\n}\n.LoadingWrapper {\n width: 100%;\n height: 100%;\n background: rgba(255, 255, 255, 0.8);\n position: absolute;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.spinner {\n animation: rotate 2s linear infinite;\n z-index: 2;\n width: 30px;\n height: 30px;\n}\n.spinner .path {\n stroke: var(--emw--color-primary, #6BB816);\n stroke-linecap: round;\n animation: dash 1.5s ease-in-out infinite;\n}\n\n@keyframes rotate {\n 100% {\n transform: rotate(360deg);\n }\n}\n@keyframes dash {\n 0% {\n stroke-dasharray: 1, 150;\n stroke-dashoffset: 0;\n }\n 50% {\n stroke-dasharray: 90, 150;\n stroke-dashoffset: -35;\n }\n 100% {\n stroke-dasharray: 90, 150;\n stroke-dashoffset: -124;\n }\n}';export{l as player_lugas_limit}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as n,b as t}from"./p-cb6ab8af.js";export{s as setNonce}from"./p-cb6ab8af.js";import{g as e}from"./p-e1255160.js";(()=>{const t=import.meta.url,e={};return""!==t&&(e.resourcesUrl=new URL(".",t).href),n(e)})().then((async n=>(await e(),t([["p-
|
|
1
|
+
import{p as n,b as t}from"./p-cb6ab8af.js";export{s as setNonce}from"./p-cb6ab8af.js";import{g as e}from"./p-e1255160.js";(()=>{const t=import.meta.url,e={};return""!==t&&(e.resourcesUrl=new URL(".",t).href),n(e)})().then((async n=>(await e(),t([["p-ea6f7849",[[1,"player-lugas-limit",{userId:[1,"user-id"],session:[1],endpoint:[1],currency:[1],amount:[1],lang:[1],clientStyling:[1,"client-styling"],clientStylingUrl:[1,"client-styling-url"],mbSource:[1,"mb-source"],translationUrl:[1,"translation-url"],isLoading:[32],showCustomAmount:[32],isSubmitted:[32],isUseExistingLimitOptionActive:[32],selectedPredefinedAmount:[32],errorMessageOnInitialization:[32],errorMessageOnSubmit:[32],errorMessageOnInput:[32],hasLugasError:[32],newAmount:[32]},null,{translationUrl:["handleNewTranslations"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}]]]],n))));
|
|
@@ -40,6 +40,8 @@ export declare class PlayerLugasLimit {
|
|
|
40
40
|
errorMessageOnSubmit: string;
|
|
41
41
|
/** Error message on custom amount input */
|
|
42
42
|
errorMessageOnInput: string;
|
|
43
|
+
/** Flag for checking F1002 Lugas error that should be handled differently */
|
|
44
|
+
hasLugasError: boolean;
|
|
43
45
|
/** New limit amount */
|
|
44
46
|
newAmount: string;
|
|
45
47
|
/** Event to emit for closing the popup */
|
|
@@ -78,12 +80,18 @@ export declare class PlayerLugasLimit {
|
|
|
78
80
|
*/
|
|
79
81
|
getMonthlyDepositLimitConfig(): Promise<boolean>;
|
|
80
82
|
/**
|
|
81
|
-
* Submits the new monthly deposit limit set by the player
|
|
82
|
-
* @param
|
|
83
|
+
* Submits the new monthly deposit limit set by the player.
|
|
84
|
+
* @param amount - User-defined amount
|
|
83
85
|
* @param keepLimit - Whether to keep the current limit
|
|
84
|
-
* @param
|
|
86
|
+
* @param isInitialLimit - Whether the limit is being set initially
|
|
85
87
|
*/
|
|
86
|
-
submitMonthlyDepositLimit: (amount: string, keepLimit?: boolean,
|
|
88
|
+
submitMonthlyDepositLimit: (amount: string, keepLimit?: boolean, isInitialLimit?: boolean) => Promise<void>;
|
|
89
|
+
/**
|
|
90
|
+
* Handles errors during the submission of the monthly deposit limit.
|
|
91
|
+
* @param error - Error response from the server
|
|
92
|
+
* @param keepLimit - Whether the user opted to keep the current limit
|
|
93
|
+
*/
|
|
94
|
+
handleSubmissionError(error: any, keepLimit: boolean): void;
|
|
87
95
|
/**
|
|
88
96
|
* Handles form submission.
|
|
89
97
|
* @param event - The form submission event
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as n,c as t,h as i}from"./p-cb6ab8af.js";let e={en:{LugasSetLimitDialogTitle:"Monthly Central Deposit Limit",LugasInfoBox:"The central limit is your monthly deposit limit for all licensed websites in Germany. Note that your limit and deposit details may vary if changed on other sites.",ChooseLimit:"Choose Limit",ButtonCustomValue:"Other",ButtonMax:"Max",LugasSetLimitDialogButtonSetLimit:"SET LIMIT {amount} {currency}",invalidInputMessageLimit:"The value entered must be between {minValue} {currency} and {maxValue} {currency}.",LugasSetLimitDialogPrivacyNote:{text:"The selected limit is connected to processing player's personal data due to our legal obligations. In some cases setting a limit is a consent to processing player's personal data. For details see our ",link:"Privacy Policy"},LugasSetLimitDialogExistingLimit:{text:"If you would like to use your existing limit ",link:"click here"},LugasNotSet:"No deposit limit set. Please enter a new limit.",loading:"Loading, please wait ...",error:"It was an error while trying to fetch the data"},de:{LugasSetLimitDialogTitle:"Monatliches zentrales Einzahlungslimit",LugasInfoBox:"Das zentrale Limit ist Ihr monatliches Einzahlungslimit für alle lizenzierten Websites in Deutschland. Beachten Sie, dass sich Ihr Limit und der verbleibende Betrag ändern können, wenn Sie auf anderen Websites Einzahlungen vornehmen oder Ihr Limit anpassen.",ChooseLimit:"Limit wählen",ButtonCustomValue:"Eigener",ButtonMax:"Max",LugasSetLimitDialogButtonSetLimit:"LIMIT SETZEN {amount} {currency}",invalidInputMessageLimit:"Der eingegebene Wert muss zwischen {minValue} und {maxValue} {currency} liegen.",LugasSetLimitDialogPrivacyNote:{text:"Das gewählte Limit steht wegen unserer rechtlichen Verpflichtungen in Verbindung mit der Verarbeitung persönlicher Daten der Spieler. In manchen Fällen gilt das Setzen eines Limits als Einwilligung zur Verarbeitung persönlicher Daten des Spielers. Mehr Infos unter ",link:"Erklärung zum Datenschutz"},LugasSetLimitDialogExistingLimit:{text:"Wenn Sie Ihr bestehendes Limit nutzen möchten, ",link:"klicken Sie hier"},LugasNotSet:"Kein Einzahlungslimit festgelegt. Bitte geben Sie ein neues Limit ein.",loading:"Laden, bitte warten ...",error:"Beim Versuch, die Daten abzurufen, ist ein Fehler aufgetreten"}};const o=n=>new Promise((t=>{fetch(n).then((n=>n.json())).then((n=>{Object.keys(n).forEach((t=>{e[t]||(e[t]={});for(let i in n[t])e[t][i]=n[t][i]})),t(!0)}))})),a=(n,t,i)=>{let o=(a=e[t||"de"],n.split(".").reduce(((n,t)=>n&&void 0!==n[t]?n[t]:null),a));var a;if(null===o)return n;if(void 0!==i)for(const[n,t]of Object.entries(i.values)){const i=new RegExp(`{${n}}`,"g");o=o.replace(i,t)}return o};function s(n,t){if(n){const i=document.createElement("style");i.innerHTML=t,n.appendChild(i)}}function r(n,t){const i=new URL(t);fetch(i.href).then((n=>n.text())).then((t=>{const i=document.createElement("style");i.innerHTML=t,n&&n.appendChild(i)})).catch((n=>{console.error("There was an error while trying to load client styling from URL",n)}))}const l=class{constructor(i){n(this,i),this.closeLugasModal=t(this,"closeLugasModal",7),this.predefinedAmounts=[],this.displayedCurrency="",this.submitMonthlyDepositLimit=(n,t=!1,i=!1)=>{if(t&&!this.isUseExistingLimitOptionActive)return;this.isSubmitted=!0,this.errorMessageOnSubmit="";const e=new URL(`${this.endpoint}v2/player/${this.userId}/limit/lugas`),o={method:"POST",headers:{"X-SessionId":this.session,"X-Session-Type":"others","Content-Type":"application/json",Authorization:`Bearer ${this.session}`},body:JSON.stringify({amount:n,keepLimit:t,roleLimitAmount:i?this.newAmount:0})};fetch(e.href,o).then((async n=>{if(!n.ok)throw await n.json();this.closeLugasModal.emit()})).catch((n=>{var i;this.errorMessageOnSubmit=a("LugasNotSet",this.lang),t&&(this.isUseExistingLimitOptionActive=!1),3===n.errorCode&&"GmLegislation"===n.errorSourceName?console.error(n.error,null===(i=n.thirdPartyResponse)||void 0===i?void 0:i.message):console.error("Unexpected Error:",n)})).finally((()=>this.isSubmitted=!1))},this.userId="",this.session="",this.endpoint="",this.currency="EUR",this.amount="",this.lang=void 0,this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.translationUrl="",this.isLoading=!1,this.showCustomAmount=!1,this.isSubmitted=!1,this.isUseExistingLimitOptionActive=!0,this.selectedPredefinedAmount=void 0,this.errorMessageOnInitialization="",this.errorMessageOnSubmit="",this.errorMessageOnInput="",this.newAmount=""}handleNewTranslations(){o(this.translationUrl)}handleClientStylingChange(n,t){n!=t&&s(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(n,t){n!=t&&this.clientStylingUrl&&r(this.stylingContainer,this.clientStylingUrl)}async componentWillLoad(){this.translationUrl.length>2&&await o(this.translationUrl),await this.getMonthlyDepositLimitConfig(),this.displayedCurrency="EUR"===this.currency?"€":this.currency}componentDidLoad(){this.stylingContainer&&(null!=window.emMessageBus?function(n,t){if(window.emMessageBus){const i=document.createElement("style");window.emMessageBus.subscribe(t,(t=>{i.innerHTML=t,n&&n.appendChild(i)}))}}(this.stylingContainer,`${this.mbSource}.Style`):(this.clientStyling&&s(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&r(this.stylingContainer,this.clientStylingUrl)))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}async getMonthlyDepositLimitConfig(){const n=new URL(`${this.endpoint}api/v1/gm/legislation/config/month-deposit-limit`);return this.isLoading=!0,new Promise((t=>{fetch(n.href).then((n=>{if(n.status>=300)throw new Error("There was an error while fetching the configuration");return n.json()})).then((n=>{this.predefinedAmounts=n.preDefinedOptions,this.minAmount=n.minAmount,this.maxAmount=n.maxAmount,t(!0)})).catch((n=>{this.errorMessageOnInitialization=a("error",this.lang),console.log(n)})).finally((()=>this.isLoading=!1))}))}handleSubmit(n){n.preventDefault(),this.errorMessageOnInput||this.submitMonthlyDepositLimit(this.newAmount,!1,!0)}handleInputChange(n){this.newAmount=n.target.value,this.isValidNumber=!isNaN(Number(this.newAmount)),this.isWithinRange=Number(this.newAmount)>=this.minAmount&&Number(this.newAmount)<=this.maxAmount,this.errorMessageOnInput=this.isWithinRange&&this.isValidNumber?"":a("invalidInputMessageLimit",this.lang,{values:{currency:this.displayedCurrency,minValue:this.minAmount,maxValue:this.maxAmount}});const t=this.newAmount.split(".");t.length>1&&(this.newAmount=`${t[0]}.${t[1].slice(0,2)}`,n.target.value=this.newAmount)}handleAmountClick(n){switch(this.showCustomAmount=!1,this.errorMessageOnInput="",this.selectedPredefinedAmount=n,n){case"Other":this.newAmount="",this.showCustomAmount=!0;break;case"Max":this.newAmount=this.maxAmount.toString(),this.showCustomAmount=!0;break;default:this.newAmount=n,this.submitMonthlyDepositLimit(this.newAmount,!1,!0)}}goToPrivacyPolicy(){window.postMessage({type:"GoToPrivacyPolicy"})}renderValidator(){return i("div",{class:"ValidatorContainer"},this.errorMessageOnSubmit&&i("div",{class:"ErrorContainer"},i("span",{class:"DismissError",onClick:()=>this.errorMessageOnSubmit=""},i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"9",height:"9",viewBox:"0 0 9 9",fill:"none"},i("path",{d:"M8.18659 0.14708C8.37063 0.33182 8.38174 0.62421 8.21888 0.821452L8.18659 0.857219L4.87619 4.16727L8.18659 7.47732C8.27743 7.56861 8.32973 7.69132 8.33266 7.82007C8.3356 7.94883 8.28895 8.0738 8.20235 8.16913C8.11576 8.26446 7.99584 8.32288 7.86739 8.3323C7.73895 8.34172 7.61179 8.30143 7.51221 8.21975L7.47645 8.18746L4.1664 4.87706L0.856348 8.18746C0.765058 8.27831 0.64235 8.3306 0.513592 8.33354C0.384834 8.33647 0.25987 8.28982 0.164536 8.20322C0.0692018 8.11663 0.0107856 7.99671 0.00136402 7.86827C-0.00805761 7.73982 0.0322357 7.61266 0.113914 7.51308L0.146209 7.47732L3.4566 4.16727L0.146209 0.857219C0.0553613 0.765928 0.00306475 0.64322 0.000130477 0.514462C-0.0028038 0.385704 0.0438486 0.260741 0.130443 0.165407C0.217038 0.0700723 0.336953 0.0116562 0.4654 0.00223455C0.593846 -0.00718708 0.721002 0.0331062 0.820581 0.114785L0.856348 0.14708L4.1664 3.45748L7.47645 0.14708C7.52307 0.10045 7.57843 0.0634608 7.63935 0.0382248C7.70027 0.0129888 7.76557 0 7.83152 0C7.89746 0 7.96276 0.0129888 8.02368 0.0382248C8.0846 0.0634608 8.13996 0.10045 8.18659 0.14708Z",fill:"#111111"}))),i("p",{class:"ErrorParagraph"},i("span",{class:"ErrorIcon"},i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"9",height:"9",viewBox:"0 0 9 9"},i("path",{d:"M8.18659 0.14708C8.37063 0.33182 8.38174 0.62421 8.21888 0.821452L8.18659 0.857219L4.87619 4.16727L8.18659 7.47732C8.27743 7.56861 8.32973 7.69132 8.33266 7.82007C8.3356 7.94883 8.28895 8.0738 8.20235 8.16913C8.11576 8.26446 7.99584 8.32288 7.86739 8.3323C7.73895 8.34172 7.61179 8.30143 7.51221 8.21975L7.47645 8.18746L4.1664 4.87706L0.856348 8.18746C0.765058 8.27831 0.64235 8.3306 0.513592 8.33354C0.384834 8.33647 0.25987 8.28982 0.164536 8.20322C0.0692018 8.11663 0.0107856 7.99671 0.00136402 7.86827C-0.00805761 7.73982 0.0322357 7.61266 0.113914 7.51308L0.146209 7.47732L3.4566 4.16727L0.146209 0.857219C0.0553613 0.765928 0.00306475 0.64322 0.000130477 0.514462C-0.0028038 0.385704 0.0438486 0.260741 0.130443 0.165407C0.217038 0.0700723 0.336953 0.0116562 0.4654 0.00223455C0.593846 -0.00718708 0.721002 0.0331062 0.820581 0.114785L0.856348 0.14708L4.1664 3.45748L7.47645 0.14708C7.52307 0.10045 7.57843 0.0634608 7.63935 0.0382248C7.70027 0.0129888 7.76557 0 7.83152 0C7.89746 0 7.96276 0.0129888 8.02368 0.0382248C8.0846 0.0634608 8.13996 0.10045 8.18659 0.14708Z"}))),this.errorMessageOnSubmit)),i("div",{class:"Paragraphs"},i("p",null,a("LugasInfoBox",this.lang))),i("div",{class:"LimitAmountWrapper"},this.isSubmitted&&i("slot",{name:"spinner"})&&i("div",{class:"LoadingWrapper"},i("svg",{class:"spinner",viewBox:"0 0 50 50"},i("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none","stroke-width":"5"}))),i("p",{class:"ChooseLimitLabel"},a("ChooseLimit",this.lang)),i("div",{class:"PredefinedAmounts"},i("button",{class:"Other"===this.selectedPredefinedAmount?"Active":"",onClick:()=>this.handleAmountClick("Other")},a("ButtonCustomValue",this.lang)),(()=>this.predefinedAmounts.map((n=>i("button",{class:this.selectedPredefinedAmount===n?"Active":"",onClick:()=>this.handleAmountClick(n)},n))))(),i("button",{class:"Max"===this.selectedPredefinedAmount?"Active":"",onClick:()=>this.handleAmountClick("Max")},a("ButtonMax",this.lang))),this.showCustomAmount&&i("form",{onSubmit:n=>this.handleSubmit(n)},this.showCustomAmount&&i("div",null,i("input",{class:"CustomAmountInput "+(this.errorMessageOnInput?"InvalidInput":""),type:"number",value:"Max"===this.selectedPredefinedAmount?this.maxAmount:null,step:.01,placeholder:"0.00",disabled:"Max"===this.selectedPredefinedAmount,onInput:n=>this.handleInputChange(n)}),this.errorMessageOnInput&&i("p",{class:"InvalidParagraph"},this.errorMessageOnInput)),this.selectedPredefinedAmount&&i("button",{class:"PrimaryButton SetLimitBtn",type:"submit",disabled:this.isSubmitted||!Boolean(this.newAmount)||Boolean(this.errorMessageOnInput)},a("LugasSetLimitDialogButtonSetLimit",this.lang,{values:{currency:this.displayedCurrency,amount:Number.parseFloat(this.newAmount||"0").toFixed(2)}})))),i("div",{class:"ModalFooter"},i("hr",null),i("div",{class:"Paragraphs"},i("p",{class:"ExistingLimit"},a("LugasSetLimitDialogExistingLimit.text",this.lang),i("span",{class:this.isUseExistingLimitOptionActive?"Link":"Link Inactive",onClick:()=>this.submitMonthlyDepositLimit(this.amount,!0)},a("LugasSetLimitDialogExistingLimit.link",this.lang))),i("p",{class:"PrivacyNote"},a("LugasSetLimitDialogPrivacyNote.text",this.lang),i("span",{class:"Link",onClick:this.goToPrivacyPolicy},a("LugasSetLimitDialogPrivacyNote.link",this.lang))))))}render(){if(this.isLoading)return i("div",null,i("p",null,a("loading",this.lang,{values:{currency:this.currency}})));if(this.errorMessageOnInitialization)return i("div",null,i("p",null,this.errorMessageOnInitialization));{const n=this.renderValidator();return i("div",{class:"ModalContainer",ref:n=>this.stylingContainer=n},i("div",{class:"Container"},i("div",{class:"ModalHeader"},i("h2",null,a("LugasSetLimitDialogTitle",this.lang))),i("div",{class:"ModalBody"},n)))}}static get watchers(){return{translationUrl:["handleNewTranslations"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"]}}};l.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 position: absolute;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background-color: rgba(0, 0, 0, 0.5);\n display: flex;\n justify-content: center;\n align-items: center;\n font-size: var(--emw--font-size-small, 12px);\n container-type: inline-size;\n}\n.ModalContainer hr {\n border: 1px solid rgba(0, 0, 0, 0.1);\n margin: 10px 0px;\n}\n.ModalContainer p {\n margin: 0;\n}\n.ModalContainer button {\n width: 100%;\n border: 1px solid var(--emw--color-gray-100, #E8E9EB);\n padding: 10px 0;\n cursor: pointer;\n width: 100%;\n border-radius: var(--emw--border-radius-small, 4px);\n}\n.ModalContainer button.PrimaryButton {\n background: var(--emw--color-primary, #6BB816);\n border: none;\n font-weight: 500;\n}\n.ModalContainer button.PrimaryButton:not(:disabled) {\n color: var(--emw--color-white, #FFF);\n}\n.ModalContainer button.PrimaryButton:disabled {\n cursor: default;\n}\n.ModalContainer .Container {\n position: fixed;\n top: 30vh;\n width: 320px;\n background: var(--emw--color-white, #fff);\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n transform: scale(1.1);\n border-radius: 4px;\n overflow: hidden;\n}\n.ModalContainer .ValidatorContainer {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n}\n.ModalContainer .Paragraphs:not(:last-child) {\n margin-bottom: 20px;\n}\n.ModalContainer .ModalHeader {\n display: flex;\n justify-content: space-between;\n align-items: center;\n background-color: var(--emw--color-gray-50, #F7F8FA);\n padding: 12px;\n}\n.ModalContainer .ModalHeader h2 {\n font-weight: bold;\n font-size: var(--emw--font-size-small, 12px);\n margin: 0;\n}\n.ModalContainer .ModalBody {\n background: var(--emw--color-white, #FFF);\n padding: 12px;\n container-type: inline-size;\n border-radius: 4px;\n}\n.ModalContainer .ModalBody .ErrorContainer {\n display: flex;\n align-items: center;\n color: var(--emw--color-red-100, #E10014);\n border-bottom: 1px solid var(--emw--color-gray-100, #E8E9EB);\n margin: -12px;\n padding: 12px;\n margin-bottom: 12px;\n font-weight: bold;\n position: relative;\n background: linear-gradient(180deg, var(--emw--color-gray-100, #E8E9EB) 0%, rgba(255, 255, 255, 0.47) 30%);\n}\n.ModalContainer .ModalBody .DismissError {\n position: absolute;\n right: 12px;\n cursor: pointer;\n}\n.ModalContainer .ModalBody .ErrorParagraph {\n display: flex;\n align-items: center;\n}\n.ModalContainer .ModalBody .ErrorIcon {\n background: linear-gradient(180deg, var(--emw--color-red-100, #E10014) 0%, var(--emw--color-red-150, #D60080) 100%);\n text-align: center;\n width: 16px;\n height: 16px;\n border-radius: 50%;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n margin-right: 6px;\n}\n.ModalContainer .ModalBody .ErrorIcon svg {\n width: 6px;\n height: 6px;\n}\n.ModalContainer .ModalBody .ErrorIcon svg path {\n fill: var(--emw--color-white, #FFF);\n}\n.ModalContainer .ModalBody .ChooseLimitLabel {\n text-transform: uppercase;\n}\n.ModalContainer .ModalBody .LimitAmountWrapper {\n display: flex;\n flex-direction: column;\n gap: 10px;\n position: relative;\n}\n.ModalContainer .ModalBody .PredefinedAmounts {\n display: flex;\n justify-content: space-between;\n}\n.ModalContainer .ModalBody .PredefinedAmounts button {\n background: none;\n margin: -1px 0 0 -1px;\n color: var(--emw--color-gray-150, #808080);\n}\n.ModalContainer .ModalBody .PredefinedAmounts button.Active {\n font-weight: bold;\n background: var(--emw--color-gray-50, #F7F8FA);\n color: var(--emw--color-gray-200, #323233);\n}\n.ModalContainer .ModalBody .PredefinedAmounts button:first-child {\n border-radius: 4px 0 0 4px;\n}\n.ModalContainer .ModalBody .PredefinedAmounts button:last-child {\n border-radius: 0 4px 4px 0;\n}\n.ModalContainer .ModalBody .CustomAmountInput {\n width: 100%;\n padding: 10px;\n border: 1px solid var(--emw--color-gray-100, #E8E9EB);\n border-radius: 4px;\n box-sizing: border-box;\n margin-bottom: 6px;\n color: var(--emw--color-gray-200, #323233);\n font-weight: bold;\n}\n.ModalContainer .ModalBody .CustomAmountInput.InvalidInput {\n border: 1px solid var(--emw--color-red, #FF0000);\n}\n.ModalContainer .ModalBody .InvalidParagraph {\n font-size: var(--emw--font-size-small, 12px);\n color: var(--emw--color-red, #FF0000);\n}\n.ModalContainer .ModalBody .SetLimitBtn {\n margin-top: 10px;\n}\n.ModalContainer .ModalFooter {\n padding-top: 12px;\n margin: 5px 0px;\n}\n.ModalContainer .Link {\n color: inherit;\n text-decoration: underline;\n cursor: pointer;\n}\n.ModalContainer .Link.Inactive {\n cursor: default;\n color: var(--emw--color-gray-150, #808080);\n}\n.ModalContainer .PrivacyNote {\n font-size: var(--emw--font-size-x-small, 10px);\n font-style: italic;\n}\n.ModalContainer .ExistingLimit {\n margin-bottom: 15px;\n}\n\ninput {\n /* Firefox */\n -moz-appearance: textfield;\n /* Chrome, Safari, Edge, Opera */\n}\ninput::-webkit-outer-spin-button, input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\n@container (max-width: 1300px) {\n .ModalContainer .Container {\n width: 50%;\n }\n}\n@container (max-width: 800px) {\n .ModalContainer .Container {\n width: 70%;\n }\n}\n.LoadingWrapper {\n width: 100%;\n height: 100%;\n background: rgba(255, 255, 255, 0.8);\n position: absolute;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.spinner {\n animation: rotate 2s linear infinite;\n z-index: 2;\n width: 30px;\n height: 30px;\n}\n.spinner .path {\n stroke: var(--emw--color-primary, #6BB816);\n stroke-linecap: round;\n animation: dash 1.5s ease-in-out infinite;\n}\n\n@keyframes rotate {\n 100% {\n transform: rotate(360deg);\n }\n}\n@keyframes dash {\n 0% {\n stroke-dasharray: 1, 150;\n stroke-dashoffset: 0;\n }\n 50% {\n stroke-dasharray: 90, 150;\n stroke-dashoffset: -35;\n }\n 100% {\n stroke-dasharray: 90, 150;\n stroke-dashoffset: -124;\n }\n}';export{l as player_lugas_limit}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|