tg-core-components 5.4.3-bethard-account-changes.0 → 5.5.0-master

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/es/components/AcceptUpdatedTaC/index.js +8 -3
  2. package/es/components/Checkbox/index.js +93 -0
  3. package/es/components/Deposit/CardInput/index.js +1 -3
  4. package/es/components/Input/index.js +222 -22
  5. package/es/components/InputWrapper/index.js +69 -0
  6. package/es/components/List/ListItem.js +1 -7
  7. package/es/components/Notification.js +4 -4
  8. package/es/components/Select/index.js +202 -64
  9. package/es/components/Select/test.js +111 -0
  10. package/es/index.js +2 -2
  11. package/es/lib/utils/translate.js +1 -8
  12. package/es/misc/countryEmojiFlags.js +0 -1
  13. package/es/widgets/AccountDetail/index.js +53 -77
  14. package/es/widgets/ActivateWidget/index.js +59 -293
  15. package/es/widgets/BonusWidget/BonusCode.js +24 -17
  16. package/es/widgets/BonusWidget/index.js +83 -45
  17. package/es/widgets/Cashier/Payment/index.js +2 -0
  18. package/es/widgets/CashierAccordion/Deposit/BonusCodeInput/index.js +9 -6
  19. package/es/widgets/CashierAccordion/Deposit/DepositWidget/index.js +47 -85
  20. package/es/widgets/CashierAccordion/Deposit/PaymentForm/index.js +2 -6
  21. package/es/widgets/CashierAccordion/Payment/PaymentAccountForms/astroPayBankTransaltions.js +12 -0
  22. package/es/widgets/CashierAccordion/Payment/PaymentAccountForms/index.js +163 -347
  23. package/es/widgets/CashierAccordion/Payment/PaymentAccountParser.js +0 -6
  24. package/es/widgets/CashierAccordion/Payment/PaymentMethodSelector/index.js +2 -2
  25. package/es/widgets/CashierAccordion/Payment/index.js +2 -0
  26. package/es/widgets/CashierAccordion/Withdraw/WithdrawWidget/index.js +8 -22
  27. package/es/widgets/ChangePassword/index.js +53 -40
  28. package/es/widgets/HistoryWidget/index.js +69 -51
  29. package/es/widgets/HistoryWidget/message.js +17 -20
  30. package/es/widgets/RequestResetPassword/index.js +15 -14
  31. package/es/widgets/ResetPassword/index.js +22 -18
  32. package/es/widgets/ResponsibleGamingAccordion/LimitStatus/index.js +5 -2
  33. package/es/widgets/ResponsibleGamingAccordion/PeriodItemContent/index.js +1 -2
  34. package/es/widgets/ResponsibleGamingSingleSignUp/AmountItem/index.js +1 -2
  35. package/es/widgets/ResponsibleGamingWidget/Timespan.js +14 -24
  36. package/es/widgets/ResponsibleGamingWidget/helpers.js +2 -2
  37. package/es/widgets/ResponsibleGamingWidget/validate.js +2 -6
  38. package/es/widgets/Settings/index.js +2 -2
  39. package/es/widgets/SignIn/SignInForm.js +4 -6
  40. package/es/widgets/SignIn/index.js +21 -21
  41. package/es/widgets/SignUp/ContactInfoStep.js +5 -6
  42. package/es/widgets/SportsbookSettings/index.js +10 -24
  43. package/es/widgets/Subscriptions/index.js +3 -5
  44. package/lib/components/AcceptUpdatedTaC/index.js +11 -3
  45. package/lib/components/Checkbox/index.js +106 -0
  46. package/lib/components/Deposit/CardInput/index.js +1 -3
  47. package/lib/components/Input/index.js +223 -26
  48. package/lib/components/InputWrapper/index.js +85 -0
  49. package/lib/components/List/ListItem.js +1 -10
  50. package/lib/components/Notification.js +3 -3
  51. package/lib/components/Select/index.js +209 -63
  52. package/lib/components/Select/test.js +121 -0
  53. package/lib/index.js +7 -7
  54. package/lib/lib/utils/translate.js +1 -8
  55. package/lib/misc/countryEmojiFlags.js +0 -1
  56. package/lib/widgets/AccountDetail/index.js +53 -86
  57. package/lib/widgets/ActivateWidget/index.js +58 -305
  58. package/lib/widgets/BonusWidget/BonusCode.js +24 -20
  59. package/lib/widgets/BonusWidget/index.js +85 -44
  60. package/lib/widgets/Cashier/Payment/index.js +2 -0
  61. package/lib/widgets/CashierAccordion/Deposit/BonusCodeInput/index.js +13 -7
  62. package/lib/widgets/CashierAccordion/Deposit/DepositWidget/index.js +50 -88
  63. package/lib/widgets/CashierAccordion/Deposit/PaymentForm/index.js +2 -9
  64. package/lib/widgets/CashierAccordion/Payment/PaymentAccountForms/astroPayBankTransaltions.js +12 -0
  65. package/lib/widgets/CashierAccordion/Payment/PaymentAccountForms/index.js +195 -378
  66. package/lib/widgets/CashierAccordion/Payment/PaymentAccountParser.js +0 -6
  67. package/lib/widgets/CashierAccordion/Payment/PaymentMethodSelector/index.js +2 -2
  68. package/lib/widgets/CashierAccordion/Payment/index.js +2 -0
  69. package/lib/widgets/CashierAccordion/Withdraw/WithdrawWidget/index.js +10 -24
  70. package/lib/widgets/ChangePassword/index.js +53 -43
  71. package/lib/widgets/HistoryWidget/index.js +69 -51
  72. package/lib/widgets/HistoryWidget/message.js +17 -20
  73. package/lib/widgets/RequestResetPassword/index.js +15 -17
  74. package/lib/widgets/ResetPassword/index.js +25 -21
  75. package/lib/widgets/ResponsibleGamingAccordion/LimitStatus/index.js +5 -2
  76. package/lib/widgets/ResponsibleGamingAccordion/PeriodItemContent/index.js +1 -2
  77. package/lib/widgets/ResponsibleGamingSingleSignUp/AmountItem/index.js +1 -2
  78. package/lib/widgets/ResponsibleGamingWidget/Timespan.js +14 -24
  79. package/lib/widgets/ResponsibleGamingWidget/helpers.js +2 -2
  80. package/lib/widgets/ResponsibleGamingWidget/validate.js +2 -6
  81. package/lib/widgets/Settings/index.js +6 -6
  82. package/lib/widgets/SignIn/SignInForm.js +7 -6
  83. package/lib/widgets/SignIn/index.js +25 -25
  84. package/lib/widgets/SignUp/ContactInfoStep.js +8 -6
  85. package/lib/widgets/SportsbookSettings/index.js +10 -24
  86. package/lib/widgets/Subscriptions/index.js +3 -11
  87. package/package.json +8 -3
  88. package/es/components/AutocompleteInput/index.js +0 -104
  89. package/es/components/Input/BirthdateInput.js +0 -174
  90. package/es/components/Input/Checkbox.js +0 -51
  91. package/es/components/Input/Input.js +0 -73
  92. package/es/components/Input/PasswordInput.js +0 -84
  93. package/es/components/Input/PhoneNumberInput.js +0 -111
  94. package/es/components/Input/input.test.js +0 -80
  95. package/es/components/Input/old-input.test.js +0 -100
  96. package/es/components/common.js +0 -339
  97. package/es/widgets/CashierAccordion/Deposit/PaymentForm/NewTab.js +0 -28
  98. package/lib/components/AutocompleteInput/index.js +0 -118
  99. package/lib/components/Input/BirthdateInput.js +0 -195
  100. package/lib/components/Input/Checkbox.js +0 -65
  101. package/lib/components/Input/Input.js +0 -87
  102. package/lib/components/Input/PasswordInput.js +0 -101
  103. package/lib/components/Input/PhoneNumberInput.js +0 -128
  104. package/lib/components/Input/input.test.js +0 -89
  105. package/lib/components/Input/old-input.test.js +0 -107
  106. package/lib/components/common.js +0 -359
  107. package/lib/widgets/CashierAccordion/Deposit/PaymentForm/NewTab.js +0 -44
@@ -8,7 +8,6 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
8
8
 
9
9
  import React, { PureComponent } from 'react';
10
10
  import Input from 'tg-core-components/lib/components/Input';
11
- import Button from 'tg-core-components/lib/components/Button';
12
11
  import compose from 'recompose/compose';
13
12
  import { injectIntl } from 'react-intl';
14
13
  import WithValidation from 'tg-core-components/lib/lib/WithValidation';
@@ -54,23 +53,31 @@ var BonusCodeForm = function BonusCodeForm(_ref3) {
54
53
  return React.createElement(
55
54
  'form',
56
55
  { className: 'form', onSubmit: onSubmit },
57
- React.createElement(Input, {
58
- label: translate({
59
- id: 'label.bonus_code',
60
- defaultMessage: 'Bonus code'
61
- }, intl),
62
- type: 'text',
63
- name: 'bonusCode',
64
- status: errors.bonusCode && 'failure' || 'idle',
65
- statusText: errors.bonusCode && translate({ id: errors.bonusCode }, intl)
66
- }),
67
56
  React.createElement(
68
- Button,
69
- { className: 'button primary wide', type: 'submit' },
70
- translate({
71
- id: 'label.activate',
72
- defaultMessage: 'Activate'
73
- }, intl)
57
+ 'div',
58
+ { className: 'bonus-code-form' },
59
+ React.createElement(Input, {
60
+ className: 'layout-item',
61
+ title: translate({
62
+ id: 'label.bonus_code',
63
+ defaultMessage: 'Bonus code'
64
+ }, intl),
65
+ type: 'text',
66
+ name: 'bonusCode',
67
+ error: errors.bonusCode && translate({ id: errors.bonusCode }, intl)
68
+ }),
69
+ React.createElement(
70
+ 'div',
71
+ { className: 'layout-item' },
72
+ React.createElement(
73
+ 'button',
74
+ { className: 'button primary wide', type: 'submit' },
75
+ translate({
76
+ id: 'label.activate',
77
+ defaultMessage: 'Activate'
78
+ }, intl)
79
+ )
80
+ )
74
81
  )
75
82
  );
76
83
  };
@@ -1,4 +1,6 @@
1
- import React from 'react';
1
+ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
2
+
3
+ import React, { useState } from 'react';
2
4
  import { FormattedNumber, FormattedDate } from 'react-intl';
3
5
  import AccordionWidget from '../AccordionWidget';
4
6
  import Button from '../../components/Button';
@@ -6,12 +8,64 @@ import BonusCode from './BonusCode';
6
8
  import { List } from 'tg-core-components';
7
9
  import Translate from '../../components/Translate';
8
10
  import { getBonusState } from './states';
11
+ import marked from 'marked';
12
+
13
+ var ALEACC_BONUS_CLAIM_STATE = ['Initiated', 'PreClaimed'];
14
+ var ALEACC_BONUS_REJECT_STATE = ['Initiated', 'PreClaimed', 'Pending', 'PreWager'];
15
+ var ALEACC_BONUS_ACTION_STATE = [].concat(ALEACC_BONUS_CLAIM_STATE, ALEACC_BONUS_REJECT_STATE);
9
16
 
10
17
  var BonusAction = function BonusAction(_ref) {
11
18
  var bonus = _ref.bonus,
12
- claimBonus = _ref.claimBonus,
13
- device = _ref.device,
14
- redirect = _ref.redirect;
19
+ onClaimBonus = _ref.onClaimBonus,
20
+ onRejectBonus = _ref.onRejectBonus;
21
+
22
+ var _useState = useState(false),
23
+ _useState2 = _slicedToArray(_useState, 2),
24
+ isLoadingClaim = _useState2[0],
25
+ setIsLoadingClaim = _useState2[1];
26
+
27
+ var _useState3 = useState(false),
28
+ _useState4 = _slicedToArray(_useState3, 2),
29
+ isLoadingReject = _useState4[0],
30
+ setIsLoadingReject = _useState4[1];
31
+
32
+ var claimBonus = function claimBonus(e) {
33
+ onClaimBonus(bonus, function (isLoading) {
34
+ return setIsLoadingClaim(isLoading);
35
+ }, e);
36
+ };
37
+
38
+ var rejectBonus = function rejectBonus(e) {
39
+ onRejectBonus(bonus, function (isLoading) {
40
+ return setIsLoadingReject(isLoading);
41
+ }, e);
42
+ };
43
+
44
+ return React.createElement(
45
+ 'div',
46
+ { className: 'actions' },
47
+ ALEACC_BONUS_CLAIM_STATE.includes(bonus.State) && React.createElement(
48
+ Button,
49
+ {
50
+ className: 'button primary small',
51
+ onClick: claimBonus,
52
+ isLoading: isLoadingClaim },
53
+ React.createElement(Translate, { id: 'action.bonus.claim', defaultMessage: 'Claim' })
54
+ ),
55
+ ALEACC_BONUS_REJECT_STATE.includes(bonus.State) && React.createElement(
56
+ Button,
57
+ {
58
+ className: 'button secondary small',
59
+ onClick: rejectBonus,
60
+ isLoading: isLoadingReject },
61
+ React.createElement(Translate, { id: 'action.bonus.reject', defaultMessage: 'Reject' })
62
+ )
63
+ );
64
+ };
65
+
66
+ var BonusActionFT = function BonusActionFT(_ref2) {
67
+ var bonus = _ref2.bonus,
68
+ onClaimBonus = _ref2.onClaimBonus;
15
69
 
16
70
  // Atm it's only fasttrack that supports actions.
17
71
  if (bonus.Provider !== 'fasttrack') return null;
@@ -19,9 +73,6 @@ var BonusAction = function BonusAction(_ref) {
19
73
  // Expired bonuses has no actions
20
74
  if (bonus.State === 'Expired') return null;
21
75
 
22
- var gameUrl = '/casino';
23
- if (device === 'Desktop' && bonus.DesktopGameUrl && bonus.DesktopGameUrl.trim()) gameUrl = bonus.DesktopGameUrl.trim();else if (device !== 'Desktop' && bonus.MobileGameUrl && bonus.MobileGameUrl.trim()) gameUrl = bonus.MobileGameUrl.trim();
24
-
25
76
  // FTType 1 - Pending Bonus
26
77
  // Claim bonus and redirect to game of present.
27
78
  if (bonus.FTType === 1) {
@@ -29,10 +80,8 @@ var BonusAction = function BonusAction(_ref) {
29
80
  return React.createElement(
30
81
  Button,
31
82
  {
32
- onClick: function onClick() {
33
- claimBonus(bonus.Id).then(function () {
34
- redirect(gameUrl);
35
- });
83
+ onClick: function onClick(e) {
84
+ return onClaimBonus(bonus, null, e);
36
85
  },
37
86
  className: 'button primary action wide ' + (bonus.IsLocked && 'locked') },
38
87
  React.createElement(Translate, { id: 'action.bonus.type1', defaultMessage: 'Action type1' })
@@ -45,14 +94,8 @@ var BonusAction = function BonusAction(_ref) {
45
94
  return React.createElement(
46
95
  Button,
47
96
  {
48
- onClick: function onClick() {
49
- return redirect({
50
- pathname: '/dashboard/deposit',
51
- search: gameUrl ? '?ref_url=' + encodeURIComponent(gameUrl) : '',
52
- state: {
53
- bonusCode: bonus.PromoCode
54
- }
55
- });
97
+ onClick: function onClick(e) {
98
+ return onClaimBonus(bonus, null, e);
56
99
  },
57
100
  className: 'button primary action wide ' + (bonus.IsLocked && 'locked') },
58
101
  React.createElement(Translate, { id: 'action.bonus.type2', defaultMessage: 'Action type2' })
@@ -65,20 +108,8 @@ var BonusAction = function BonusAction(_ref) {
65
108
  return React.createElement(
66
109
  Button,
67
110
  {
68
- onClick: function onClick() {
69
- if (!bonus.IsLocked) {
70
- claimBonus(bonus.Id).then(function () {
71
- redirect(gameUrl);
72
- });
73
- } else {
74
- redirect({
75
- pathname: '/dashboard/deposit',
76
- search: '?ref_url=/dashboard/bonus',
77
- state: {
78
- bonusCode: bonus.PromoCode
79
- }
80
- });
81
- }
111
+ onClick: function onClick(e) {
112
+ return onClaimBonus(bonus, null, e);
82
113
  },
83
114
  className: 'button primary action wide ' + (bonus.IsLocked && 'locked') },
84
115
  !!bonus.IsLocked && React.createElement(Translate, {
@@ -92,12 +123,11 @@ var BonusAction = function BonusAction(_ref) {
92
123
  return null;
93
124
  };
94
125
 
95
- var BonusWidget = function BonusWidget(_ref2) {
96
- var bonuses = _ref2.bonuses,
97
- handleBonusCodeSubmit = _ref2.handleBonusCodeSubmit,
98
- claimBonus = _ref2.claimBonus,
99
- device = _ref2.device,
100
- redirect = _ref2.redirect;
126
+ var BonusWidget = function BonusWidget(_ref3) {
127
+ var bonuses = _ref3.bonuses,
128
+ handleBonusCodeSubmit = _ref3.handleBonusCodeSubmit,
129
+ onClaimBonus = _ref3.onClaimBonus,
130
+ onRejectBonus = _ref3.onRejectBonus;
101
131
 
102
132
  var bonusList = { active: null, available: null, finished: null };
103
133
 
@@ -149,12 +179,13 @@ var BonusWidget = function BonusWidget(_ref2) {
149
179
  })]];
150
180
 
151
181
  // Add bonus actions to not expired Fasttrack bonuses
152
- if (item.Provider === 'fasttrack' && item.State !== 'Expired') info.push(React.createElement(BonusAction, {
153
- bonus: item,
154
- claimBonus: claimBonus,
155
- device: device,
156
- redirect: redirect
157
- }));
182
+ if (item.Provider === 'fasttrack' && item.State !== 'Expired') info.push(React.createElement(BonusActionFT, { bonus: item, onClaimBonus: onClaimBonus }));
183
+ // Add bonus actions to post claim bonuses from Aleacc
184
+ else if (item.Provider !== 'fasttrack' && ALEACC_BONUS_ACTION_STATE.includes(item.State)) info.push(React.createElement(BonusAction, {
185
+ bonus: item,
186
+ onClaimBonus: onClaimBonus,
187
+ onRejectBonus: onRejectBonus
188
+ }));
158
189
 
159
190
  var detail = [[React.createElement(
160
191
  'span',
@@ -214,6 +245,13 @@ var BonusWidget = function BonusWidget(_ref2) {
214
245
  })
215
246
  )]];
216
247
 
248
+ info.push([React.createElement('div', {
249
+ className: 'disclaimer',
250
+ dangerouslySetInnerHTML: {
251
+ __html: item.content && item.content.disclaimer && marked(item.content.disclaimer || '') || item.promotion && item.promotion.shortDisclaimer
252
+ }
253
+ })]);
254
+
217
255
  return {
218
256
  id: item.Id,
219
257
  info: info,
@@ -24,5 +24,7 @@ export var matchProviderType = function matchProviderType(first, second) {
24
24
  if (first.service) fType = fType + first.service;
25
25
  if (second.service) sType = sType + second.service;
26
26
 
27
+ if (!fType || !sType) return;
28
+
27
29
  return sType.toLowerCase() === fType.toLowerCase();
28
30
  };
@@ -7,7 +7,8 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
7
7
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
8
8
 
9
9
  import React, { Component } from 'react';
10
- import Input from '../../../../components/Input';
10
+ import TextInput from '../../../../components/Deposit/TextInput';
11
+ import Icon from '../../../../components/Icon';
11
12
  import { injectIntl } from 'react-intl';
12
13
  import translate from '../../../../lib/utils/translate';
13
14
 
@@ -49,14 +50,16 @@ var BonusCodeInput = function (_Component) {
49
50
  return React.createElement(
50
51
  'div',
51
52
  { className: 'bonus-code-input-wrapper' },
52
- React.createElement(Input, {
53
+ React.createElement(TextInput, {
53
54
  name: 'bonusCode',
54
- value: bonusCode,
55
- onChange: onChange,
56
55
  autoFocus: true,
57
- label: translate({ id: 'cashier.bonus_code' }, intl),
56
+ placeholder: translate({ id: 'cashier.bonus_code' }, intl),
58
57
  disabled: disabled,
59
- status: status === 'active' && 'success' || status === 'pending' && 'loading'
58
+ onChange: onChange
59
+ }),
60
+ status && React.createElement(Icon, {
61
+ icon: status === 'active' ? 'check' : '',
62
+ className: 'bonus-icon bonus-' + status
60
63
  })
61
64
  );
62
65
  }
@@ -2,6 +2,8 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument
2
2
 
3
3
  var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
4
4
 
5
+ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
6
+
5
7
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
6
8
 
7
9
  function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
@@ -20,7 +22,7 @@ import BonusCodeInput from '../BonusCodeInput';
20
22
  import { matchProviderType, getPaymentForm } from '../../Payment';
21
23
  import Icon from '../../../../components/Icon';
22
24
  import marked from 'marked';
23
- import Input from '../../../../components/Input';
25
+ import Input from '../../../../components/Deposit/TextInput';
24
26
  import PaymentAmountSelector from '../../Payment/PaymentAmountSelector';
25
27
  import MethodMinMax from '../../Payment/MethodMinMax';
26
28
  import DelayVisibility from '../../../../components/Deposit/DelayVisibility';
@@ -168,8 +170,7 @@ var DepositWidget = function (_Component) {
168
170
  renderAllowBonusWarning = _props.renderAllowBonusWarning,
169
171
  paymentStats = _props.paymentStats,
170
172
  _props$shouldAutoFocu = _props.shouldAutoFocus,
171
- shouldAutoFocus = _props$shouldAutoFocu === undefined ? false : _props$shouldAutoFocu,
172
- hideSelectedBonus = _props.hideSelectedBonus;
173
+ shouldAutoFocus = _props$shouldAutoFocu === undefined ? false : _props$shouldAutoFocu;
173
174
 
174
175
 
175
176
  var accountExclusions = payments.filter(function (provider) {
@@ -182,7 +183,11 @@ var DepositWidget = function (_Component) {
182
183
  }).map(function (provider) {
183
184
  return provider.providerType.toUpperCase();
184
185
  });
185
- var customAmountExclusions = ['reversewithdrawal'];
186
+ var customAmountExclusions = [].concat(_toConsumableArray(payments.filter(function (provider) {
187
+ return provider.hideCustomAmount;
188
+ }).map(function (provider) {
189
+ return provider.providerType.toLowerCase();
190
+ })), ['reversewithdrawal']);
186
191
  var minMaxExclusions = ['reversewithdrawal'];
187
192
 
188
193
  var minDepositBonusAmount = this.getMinDepositBonusAmount();
@@ -193,8 +198,6 @@ var DepositWidget = function (_Component) {
193
198
  return matchProviderType(payment, selectedMethod);
194
199
  });
195
200
 
196
- var hasCustomAmounts = selectedMethodDetail && selectedMethodDetail.customAmounts;
197
-
198
201
  var selectedBonus = bonuses.find(function (b) {
199
202
  return b.PromoCode === bonusCode;
200
203
  });
@@ -221,13 +224,13 @@ var DepositWidget = function (_Component) {
221
224
  bonuses: bonuses,
222
225
  onSelect: this.onSelectBonus,
223
226
  selectedBonus: selectedBonus
224
- }) : !hideSelectedBonus ? React.createElement(SelectedBonus, {
227
+ }) : React.createElement(SelectedBonus, {
225
228
  selectedBonus: selectedBonus,
226
229
  onClick: function onClick() {
227
230
  _this2.onSelectBonus('');
228
231
  _this2.setState({ showBonusSlider: true });
229
232
  }
230
- }) : null),
233
+ })),
231
234
  React.createElement(Form, {
232
235
  onSubmit: this.handleNextStep,
233
236
  initialValues: {
@@ -291,7 +294,7 @@ var DepositWidget = function (_Component) {
291
294
  onSelectMethod: _this2.onSelectMethod,
292
295
  onDeleteAccount: _this2.onDeleteAccount,
293
296
  methodContent: function methodContent(method) {
294
- if (method.txType !== selectedMethod.txType || method.service !== selectedMethod.service) return null;
297
+ if (method.txType !== selectedMethod.txType) return null;
295
298
 
296
299
  return React.createElement(
297
300
  Fragment,
@@ -309,6 +312,7 @@ var DepositWidget = function (_Component) {
309
312
  id: 'label.mobile_number_placeholder',
310
313
  defaultMessage: 'eg. 0701234567'
311
314
  }, intl),
315
+ isControlled: true,
312
316
  value: _this2.state.swishNumber,
313
317
  title: translate({
314
318
  id: 'label.mobile_number'
@@ -337,30 +341,26 @@ var DepositWidget = function (_Component) {
337
341
  return _this2.setState({ buttonLoading: buttonLoading });
338
342
  }
339
343
  }),
340
- !customAmountExclusions.includes(selectedMethod.providerType.toLowerCase()) && !hasCustomAmounts && React.createElement(
344
+ !customAmountExclusions.includes(selectedMethod.providerType.toLowerCase()) && React.createElement(
341
345
  'div',
342
346
  { className: 'custom-amount-and-submit' },
343
347
  React.createElement(Input, {
344
- required: true,
345
348
  pattern: '[0-9]*',
346
349
  className: 'custom-amount',
347
350
  name: 'amount',
348
351
  type: 'number',
349
352
  step: '0.01',
350
- label: translate({
353
+ placeholder: translate({
351
354
  id: 'label.amount'
352
355
  }, intl),
353
- status: errors && errors.amount && errors.amount.length ? 'failure' : '',
354
- value: currentAmount,
356
+ showErrorText: false,
357
+ showErrorIcon: errors && errors.amount && errors.amount.length > 0,
355
358
  onChange: function onChange(e) {
356
359
  return _this2.setState({
357
360
  currentAmount: e.target.value
358
361
  });
359
362
  },
360
- autoFocus: shouldAutoFocus,
361
- setRef: function setRef(ref) {
362
- return _this2.amountInputRef = ref;
363
- }
363
+ autoFocus: shouldAutoFocus
364
364
  }),
365
365
  React.createElement(
366
366
  Button,
@@ -384,7 +384,7 @@ var DepositWidget = function (_Component) {
384
384
  React.createElement(
385
385
  'div',
386
386
  { className: 'bonus-limit' },
387
- !minMaxExclusions.includes(selectedMethod.providerType.toLowerCase()) && !hasCustomAmounts && selectedMethod && selectedMethod.limit && React.createElement(MethodMinMax, {
387
+ !minMaxExclusions.includes(selectedMethod.providerType.toLowerCase()) && !customAmountExclusions.includes(selectedMethod.providerType.toLowerCase()) && selectedMethod && selectedMethod.limit && React.createElement(MethodMinMax, {
388
388
  method: selectedMethod,
389
389
  currency: currency,
390
390
  minDepositBonusAmount: minDepositBonusAmount,
@@ -456,8 +456,7 @@ var DepositWidget = function (_Component) {
456
456
  render: function render(_ref5) {
457
457
  var handleSubmit = _ref5.handleSubmit,
458
458
  values = _ref5.values,
459
- change = _ref5.change,
460
- form = _ref5.form;
459
+ change = _ref5.change;
461
460
  return React.createElement(
462
461
  Fragment,
463
462
  null,
@@ -482,10 +481,7 @@ var DepositWidget = function (_Component) {
482
481
  React.createElement(
483
482
  'div',
484
483
  { className: 'account-details' },
485
- React.createElement(PaymentAccountForm, _extends({}, paymentAccountFormProps, {
486
- change: form.change,
487
- values: values
488
- }))
484
+ React.createElement(PaymentAccountForm, paymentAccountFormProps)
489
485
  ),
490
486
  React.createElement(
491
487
  Button,
@@ -540,45 +536,18 @@ var DepositWidget = function (_Component) {
540
536
  var _initialiseProps = function _initialiseProps() {
541
537
  var _this3 = this;
542
538
 
543
- this.componentDidUpdate = function (prevProps) {
544
- if (prevProps.shouldRenderSgaWarning !== _this3.props.shouldRenderSgaWarning) {
545
- var _state2 = _this3.state,
546
- currentAmount = _state2.currentAmount,
547
- bonusCode = _state2.bonusCode;
548
-
549
- _this3.handleNextStep({ amount: currentAmount, bonusCode: bonusCode });
550
- }
551
- };
552
-
553
539
  this.handleNextStep = function (_ref6) {
554
540
  var amount = _ref6.amount,
555
541
  bonusCode = _ref6.bonusCode;
556
- var _state3 = _this3.state,
557
- selectedMethod = _state3.selectedMethod,
558
- preDepositBonus = _state3.preDepositBonus,
559
- selectedAccount = _state3.selectedAccount;
560
- var _props2 = _this3.props,
561
- paymentStats = _props2.paymentStats,
562
- renderSgaWarningPopup = _props2.renderSgaWarningPopup,
563
- shouldRenderSgaWarning = _props2.shouldRenderSgaWarning;
542
+ var _state2 = _this3.state,
543
+ selectedMethod = _state2.selectedMethod,
544
+ preDepositBonus = _state2.preDepositBonus,
545
+ selectedAccount = _state2.selectedAccount;
564
546
 
565
547
 
566
548
  var formExists = !!PaymentAccountForms[getPaymentForm(selectedMethod)];
567
549
  var skipFillInStep = ['skrill', 'bestpay', 'jeton', 'bankiban', 'bankintl'];
568
550
 
569
- var remainingAmount = 5000 - Number(paymentStats.TotalDepositLast7Days);
570
- var renderSgaWarning = shouldRenderSgaWarning && Number(paymentStats.TotalDepositLast7Days) + Number(amount) > 5000;
571
-
572
- if (renderSgaWarning) {
573
- _this3.setState({
574
- buttonLoading: null,
575
- currentAmount: amount,
576
- bonusCode: bonusCode
577
- });
578
- renderSgaWarningPopup(remainingAmount);
579
- return;
580
- }
581
-
582
551
  if (!formExists || selectedAccount.accountId && skipFillInStep.includes(selectedMethod.providerType.toLowerCase())) {
583
552
  return _this3.onSubmit({
584
553
  currentAmount: amount,
@@ -596,9 +565,9 @@ var _initialiseProps = function _initialiseProps() {
596
565
  };
597
566
 
598
567
  this.handleBackStep = function () {
599
- var _state4 = _this3.state,
600
- currentStep = _state4.currentStep,
601
- buttonLoading = _state4.buttonLoading;
568
+ var _state3 = _this3.state,
569
+ currentStep = _state3.currentStep,
570
+ buttonLoading = _state3.buttonLoading;
602
571
 
603
572
 
604
573
  if (buttonLoading === 'fill-in-submit') return null;
@@ -615,13 +584,13 @@ var _initialiseProps = function _initialiseProps() {
615
584
  };
616
585
 
617
586
  this.onSubmit = function (data) {
618
- var _props3 = _this3.props,
619
- onSubmit = _props3.onSubmit,
620
- countries = _props3.countries,
621
- user = _props3.user;
622
- var _state5 = _this3.state,
623
- selectedMethod = _state5.selectedMethod,
624
- swishNumber = _state5.swishNumber;
587
+ var _props2 = _this3.props,
588
+ onSubmit = _props2.onSubmit,
589
+ countries = _props2.countries,
590
+ user = _props2.user;
591
+ var _state4 = _this3.state,
592
+ selectedMethod = _state4.selectedMethod,
593
+ swishNumber = _state4.swishNumber;
625
594
 
626
595
 
627
596
  var submitData = _extends({}, _this3.state, data);
@@ -654,19 +623,12 @@ var _initialiseProps = function _initialiseProps() {
654
623
 
655
624
  this.onSelectMethod = function (_ref7) {
656
625
  var method = _ref7.method;
657
- var _props4 = _this3.props,
658
- currency = _props4.currency,
659
- paymentStats = _props4.paymentStats,
660
- remainingDepositLimit = _props4.remainingDepositLimit,
661
- payments = _props4.payments,
662
- shouldAutoFocus = _props4.shouldAutoFocus;
663
-
626
+ var _props3 = _this3.props,
627
+ currency = _props3.currency,
628
+ paymentStats = _props3.paymentStats,
629
+ remainingDepositLimit = _props3.remainingDepositLimit,
630
+ payments = _props3.payments;
664
631
 
665
- if (shouldAutoFocus) {
666
- setTimeout(function () {
667
- _this3.amountInputRef && _this3.amountInputRef.focus();
668
- }, 1);
669
- }
670
632
 
671
633
  var selectedMethodDetail = payments.find(function (payment) {
672
634
  return matchProviderType(payment, method);
@@ -724,9 +686,9 @@ var _initialiseProps = function _initialiseProps() {
724
686
  };
725
687
 
726
688
  this.getMinDepositBonusAmount = function () {
727
- var _props5 = _this3.props,
728
- bonuses = _props5.bonuses,
729
- currency = _props5.currency;
689
+ var _props4 = _this3.props,
690
+ bonuses = _props4.bonuses,
691
+ currency = _props4.currency;
730
692
  var bonusCode = _this3.state.bonusCode;
731
693
 
732
694
 
@@ -749,10 +711,10 @@ var _initialiseProps = function _initialiseProps() {
749
711
  };
750
712
 
751
713
  this.getSpainRemainingDepositAmount = function () {
752
- var _props6 = _this3.props,
753
- jurisdiction = _props6.jurisdiction,
754
- hasIdApproved = _props6.hasIdApproved,
755
- paymentStats = _props6.paymentStats;
714
+ var _props5 = _this3.props,
715
+ jurisdiction = _props5.jurisdiction,
716
+ hasIdApproved = _props5.hasIdApproved,
717
+ paymentStats = _props5.paymentStats;
756
718
 
757
719
  return jurisdiction.toLowerCase() === 'es' && !hasIdApproved && (150 - parseFloat(paymentStats.TotalDeposit) < 0 ? 0 : 150 - parseFloat(paymentStats.TotalDeposit));
758
720
  };
@@ -13,7 +13,6 @@ import FramedComponent from '../../hoc/FramedComponent';
13
13
  import InjectedIframeHTML from './InjectedIframeHTML';
14
14
  import DynamicForm from './DynamicForm';
15
15
  import PaymentResult from './PaymentResult';
16
- import NewTab from './NewTab';
17
16
  import flatten from 'lodash/flatten';
18
17
  import Translate from '../../../../components/Translate';
19
18
 
@@ -82,8 +81,7 @@ var PaymentForm = function (_Component) {
82
81
  value: function render() {
83
82
  var _props = this.props,
84
83
  data = _props.data,
85
- onClose = _props.onClose,
86
- details = _props.details;
84
+ onClose = _props.onClose;
87
85
 
88
86
  if (!data.success) {
89
87
  return React.createElement(PaymentError, { data: data, onClose: onClose });
@@ -102,9 +100,7 @@ var PaymentForm = function (_Component) {
102
100
  frameBorder: 0
103
101
  };
104
102
 
105
- if (details && details.newTab) {
106
- return React.createElement(NewTab, { url: data.redirectOutput.url });
107
- } else if (data.redirectOutput.container == 'iframe' && data.redirectOutput.method == 'POST' && data.redirectOutput.html == null) {
103
+ if (data.redirectOutput.container == 'iframe' && data.redirectOutput.method == 'POST' && data.redirectOutput.html == null) {
108
104
  return React.createElement(FormWithIframe, _extends({
109
105
  frameProps: frameProps,
110
106
  target: frameId
@@ -25,6 +25,18 @@ export default (function (intl, category, type) {
25
25
  id: 'cashier.details.accountTypes.I',
26
26
  defaultMessage: 'International account'
27
27
  }, intl);
28
+ },
29
+ M: function M() {
30
+ return translate({
31
+ id: 'cashier.details.accountTypes.M',
32
+ defaultMessage: 'Master account'
33
+ }, intl);
34
+ },
35
+ V: function V() {
36
+ return translate({
37
+ id: 'cashier.details.accountTypes.V',
38
+ defaultMessage: 'Salary account'
39
+ }, intl);
28
40
  }
29
41
  },
30
42
  services: {