@pelcro/react-pelcro-js 3.36.0 → 3.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -3333,12 +3333,19 @@ var paymentMethod_en = {
3333
3333
  select: select$6,
3334
3334
  "delete": {
3335
3335
  title: "Delete payment method",
3336
- subtitle: "This payment method could be associated with active subscriptions or serve as the default payment method. Please choose from the available options below for replacement.",
3336
+ subtitle: "Are you sure you want to delete the selected payment method?",
3337
+ details: "Payment method details",
3338
+ message: "This action is irreversible and will permanently remove the payment method from the system. Please ensure that there are no pending transactions or subscriptions associated with this payment method.",
3339
+ buttons: {
3340
+ "delete": "Delete payment method",
3341
+ back: "Go back"
3342
+ },
3337
3343
  options: {
3338
- select: "Select an existing payment method",
3344
+ select: "Select a payment method to be the default",
3339
3345
  add: "Add a new payment method"
3340
3346
  },
3341
- paymentMethodReplaced: "Payment Method Successfully Deleted and Replaced"
3347
+ paymentMethodReplaced: "Payment Method Successfully Deleted and Replaced",
3348
+ deletedSuccessfully: "Payment Method Successfully Deleted"
3342
3349
  },
3343
3350
  create: create$5
3344
3351
  };
@@ -9559,6 +9566,17 @@ const getPaymentCardIcon$1 = name => {
9559
9566
  }), /*#__PURE__*/React__default.createElement("path", {
9560
9567
  fill: "#FFF",
9561
9568
  d: "M22.255 20l-2.113 4.683L18.039 20h-2.695v6.726L12.341 20h-2.274L7 26.981h1.815l.671-1.558h3.432l.682 1.558h3.465v-5.185l2.299 5.185h1.563l2.351-5.095v5.095H25V20H22.255zM10.135 23.915l1.026-2.44 1.066 2.44H10.135zM37.883 23.413L41 20.018h-2.217l-1.994 2.164L34.86 20H28v6.982h6.635l2.092-2.311L38.767 27h2.21L37.883 23.413zM33.728 25.516h-4.011v-1.381h3.838v-1.323h-3.838v-1.308l4.234.012 1.693 1.897L33.728 25.516z"
9569
+ })),
9570
+ amex: /*#__PURE__*/React__default.createElement("svg", {
9571
+ className: "plc-w-16",
9572
+ xmlns: "http://www.w3.org/2000/svg",
9573
+ viewBox: "0 0 48 48"
9574
+ }, /*#__PURE__*/React__default.createElement("path", {
9575
+ fill: "#1976D2",
9576
+ d: "M45,35c0,2.209-1.791,4-4,4H7c-2.209,0-4-1.791-4-4V13c0-2.209,1.791-4,4-4h34c2.209,0,4,1.791,4,4V35z"
9577
+ }), /*#__PURE__*/React__default.createElement("path", {
9578
+ fill: "#FFF",
9579
+ d: "M22.255 20l-2.113 4.683L18.039 20h-2.695v6.726L12.341 20h-2.274L7 26.981h1.815l.671-1.558h3.432l.682 1.558h3.465v-5.185l2.299 5.185h1.563l2.351-5.095v5.095H25V20H22.255zM10.135 23.915l1.026-2.44 1.066 2.44H10.135zM37.883 23.413L41 20.018h-2.217l-1.994 2.164L34.86 20H28v6.982h6.635l2.092-2.311L38.767 27h2.21L37.883 23.413zM33.728 25.516h-4.011v-1.381h3.838v-1.323h-3.838v-1.308l4.234.012 1.693 1.897L33.728 25.516z"
9562
9580
  }))
9563
9581
  };
9564
9582
  return name ? icons[name.toLowerCase()] : /*#__PURE__*/React__default.createElement("svg", {
@@ -9610,6 +9628,19 @@ function notifyBugsnag(callback, startOptions) {
9610
9628
  }
9611
9629
  callback();
9612
9630
  }
9631
+ const refreshUser = () => {
9632
+ var _window$Pelcro6, _window$Pelcro6$user, _window$Pelcro6$user$;
9633
+ window.Pelcro.user.refresh({
9634
+ auth_token: (_window$Pelcro6 = window.Pelcro) === null || _window$Pelcro6 === void 0 ? void 0 : (_window$Pelcro6$user = _window$Pelcro6.user) === null || _window$Pelcro6$user === void 0 ? void 0 : (_window$Pelcro6$user$ = _window$Pelcro6$user.read()) === null || _window$Pelcro6$user$ === void 0 ? void 0 : _window$Pelcro6$user$.auth_token
9635
+ }, (err, res) => {
9636
+ if (err) {
9637
+ console.error(err);
9638
+ }
9639
+ if (res) {
9640
+ return res.data;
9641
+ }
9642
+ });
9643
+ };
9613
9644
 
9614
9645
  const resources = {
9615
9646
  en: {
@@ -12580,8 +12611,8 @@ const SET_CANCEL_SUBSCRIPTION_REASON = "SET_CANCEL_SUBSCRIPTION_REASON";
12580
12611
  const SET_CANCEL_SUBSCRIPTION_OPTION = "SET_CANCEL_SUBSCRIPTION_OPTION";
12581
12612
  const HANDLE_CHECKBOX_CHANGE = "HANDLE_CHECKBOX_CHANGE";
12582
12613
  const SET_IS_DEFAULT_PAYMENT_METHOD = "SET_IS_DEFAULT_PAYMENT_METHOD";
12583
- const SET_DELETE_PAYMENT_METHOD_OPTION = "SET_DELETE_PAYMENT_METHOD_OPTION";
12584
12614
  const SET_PAYMENT_METHODS = "SET_PAYMENT_METHODS";
12615
+ const SHOW_PAYMENT_METHOD_SELECT = "SHOW_PAYMENT_METHOD_SELECT";
12585
12616
  const SET_SUBSCRIPTION_SUSPEND_DATE = "SET_SUBSCRIPTION_SUSPEND_DATE";
12586
12617
  const SET_EMAILS = "SET_EMAILS";
12587
12618
  const SET_EMAILS_ERROR = "SET_EMAILS_ERROR";
@@ -18095,6 +18126,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
18095
18126
  content: t("messages.sourceCreated")
18096
18127
  }
18097
18128
  });
18129
+ refreshUser();
18098
18130
  onSuccess(res);
18099
18131
  });
18100
18132
  }
@@ -18149,6 +18181,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
18149
18181
  }
18150
18182
  });
18151
18183
  }
18184
+ refreshUser();
18152
18185
  onSuccess(res);
18153
18186
  });
18154
18187
  }, 2000);
@@ -18210,6 +18243,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
18210
18243
  content: t("messages.sourceUpdated")
18211
18244
  }
18212
18245
  });
18246
+ refreshUser();
18213
18247
  onSuccess(res);
18214
18248
  });
18215
18249
  }
@@ -18768,6 +18802,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
18768
18802
  type: LOADING,
18769
18803
  payload: false
18770
18804
  });
18805
+ refreshUser();
18771
18806
  onSuccess(res);
18772
18807
  return;
18773
18808
  }
@@ -18783,6 +18818,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
18783
18818
  content: t("messages.sourceCreated")
18784
18819
  }
18785
18820
  });
18821
+ refreshUser();
18786
18822
  onSuccess(res);
18787
18823
  return;
18788
18824
  }
@@ -18802,6 +18838,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
18802
18838
  content: t("messages.sourceUpdated")
18803
18839
  }
18804
18840
  });
18841
+ refreshUser();
18805
18842
  onSuccess(res);
18806
18843
  return;
18807
18844
  }
@@ -18829,6 +18866,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
18829
18866
  }
18830
18867
  });
18831
18868
  }
18869
+ refreshUser();
18832
18870
  onSuccess(res);
18833
18871
  });
18834
18872
  }, 2000);
@@ -18860,7 +18898,8 @@ const PaymentMethodContainerWithoutStripe = _ref => {
18860
18898
  gift_message: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.giftMessage,
18861
18899
  address_id: product.address_required ? selectedAddressId : null
18862
18900
  }, (err, res) => {
18863
- if (res.data.setup_intent) {
18901
+ var _res$data;
18902
+ if (res !== null && res !== void 0 && (_res$data = res.data) !== null && _res$data !== void 0 && _res$data.setup_intent) {
18864
18903
  return confirmStripeIntentSetup(res, "subCreate");
18865
18904
  }
18866
18905
  confirmStripeCardPayment(res, err, true);
@@ -19126,7 +19165,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
19126
19165
  auth_token: window.Pelcro.user.read().auth_token,
19127
19166
  token: source.id
19128
19167
  }, (err, res) => {
19129
- var _res$data, _res$data$setup_inten, _res$data2, _res$data2$setup_inte;
19168
+ var _res$data2, _res$data2$setup_inte, _res$data3, _res$data3$setup_inte;
19130
19169
  if (err) {
19131
19170
  dispatch({
19132
19171
  type: DISABLE_SUBMIT,
@@ -19145,7 +19184,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
19145
19184
  }
19146
19185
  });
19147
19186
  }
19148
- if (((_res$data = res.data) === null || _res$data === void 0 ? void 0 : (_res$data$setup_inten = _res$data.setup_intent) === null || _res$data$setup_inten === void 0 ? void 0 : _res$data$setup_inten.status) === "requires_action" || ((_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : (_res$data2$setup_inte = _res$data2.setup_intent) === null || _res$data2$setup_inte === void 0 ? void 0 : _res$data2$setup_inte.status) === "requires_confirmation") {
19187
+ if (((_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : (_res$data2$setup_inte = _res$data2.setup_intent) === null || _res$data2$setup_inte === void 0 ? void 0 : _res$data2$setup_inte.status) === "requires_action" || ((_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : (_res$data3$setup_inte = _res$data3.setup_intent) === null || _res$data3$setup_inte === void 0 ? void 0 : _res$data3$setup_inte.status) === "requires_confirmation") {
19149
19188
  confirmStripeIntentSetup(res, "create");
19150
19189
  } else {
19151
19190
  dispatch({
@@ -19159,6 +19198,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
19159
19198
  content: t("messages.sourceCreated")
19160
19199
  }
19161
19200
  });
19201
+ refreshUser();
19162
19202
  onSuccess(res);
19163
19203
  }
19164
19204
  });
@@ -19181,7 +19221,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
19181
19221
  exp_year: year,
19182
19222
  is_default: isDefault
19183
19223
  }, (err, res) => {
19184
- var _res$data3, _res$data3$setup_inte, _res$data4, _res$data4$setup_inte;
19224
+ var _res$data4, _res$data4$setup_inte, _res$data5, _res$data5$setup_inte;
19185
19225
  dispatch({
19186
19226
  type: DISABLE_SUBMIT,
19187
19227
  payload: false
@@ -19200,7 +19240,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
19200
19240
  }
19201
19241
  });
19202
19242
  }
19203
- if (((_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : (_res$data3$setup_inte = _res$data3.setup_intent) === null || _res$data3$setup_inte === void 0 ? void 0 : _res$data3$setup_inte.status) === "requires_action" || ((_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : (_res$data4$setup_inte = _res$data4.setup_intent) === null || _res$data4$setup_inte === void 0 ? void 0 : _res$data4$setup_inte.status) === "requires_confirmation") {
19243
+ if (((_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : (_res$data4$setup_inte = _res$data4.setup_intent) === null || _res$data4$setup_inte === void 0 ? void 0 : _res$data4$setup_inte.status) === "requires_action" || ((_res$data5 = res.data) === null || _res$data5 === void 0 ? void 0 : (_res$data5$setup_inte = _res$data5.setup_intent) === null || _res$data5$setup_inte === void 0 ? void 0 : _res$data5$setup_inte.status) === "requires_confirmation") {
19204
19244
  confirmStripeIntentSetup(res, "update");
19205
19245
  } else {
19206
19246
  dispatch({
@@ -19210,6 +19250,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
19210
19250
  content: t("messages.sourceUpdated")
19211
19251
  }
19212
19252
  });
19253
+ refreshUser();
19213
19254
  onSuccess(res);
19214
19255
  }
19215
19256
  });
@@ -19242,7 +19283,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
19242
19283
  auth_token: window.Pelcro.user.read().auth_token,
19243
19284
  token: source.id
19244
19285
  }, (err, res) => {
19245
- var _res$data5, _res$data5$setup_inte, _res$data6, _res$data6$setup_inte;
19286
+ var _res$data6, _res$data6$setup_inte, _res$data7, _res$data7$setup_inte;
19246
19287
  if (err) {
19247
19288
  onFailure(err);
19248
19289
  return dispatch({
@@ -19253,7 +19294,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
19253
19294
  }
19254
19295
  });
19255
19296
  }
19256
- if (((_res$data5 = res.data) === null || _res$data5 === void 0 ? void 0 : (_res$data5$setup_inte = _res$data5.setup_intent) === null || _res$data5$setup_inte === void 0 ? void 0 : _res$data5$setup_inte.status) === "requires_action" || ((_res$data6 = res.data) === null || _res$data6 === void 0 ? void 0 : (_res$data6$setup_inte = _res$data6.setup_intent) === null || _res$data6$setup_inte === void 0 ? void 0 : _res$data6$setup_inte.status) === "requires_confirmation") {
19297
+ if (((_res$data6 = res.data) === null || _res$data6 === void 0 ? void 0 : (_res$data6$setup_inte = _res$data6.setup_intent) === null || _res$data6$setup_inte === void 0 ? void 0 : _res$data6$setup_inte.status) === "requires_action" || ((_res$data7 = res.data) === null || _res$data7 === void 0 ? void 0 : (_res$data7$setup_inte = _res$data7.setup_intent) === null || _res$data7$setup_inte === void 0 ? void 0 : _res$data7$setup_inte.status) === "requires_confirmation") {
19257
19298
  confirmStripeIntentSetup(res, "replace", paymentMethodId);
19258
19299
  } else {
19259
19300
  setTimeout(() => {
@@ -19279,6 +19320,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
19279
19320
  }
19280
19321
  });
19281
19322
  }
19323
+ refreshUser();
19282
19324
  onSuccess(res);
19283
19325
  });
19284
19326
  }, 2000);
@@ -19374,12 +19416,12 @@ const PaymentMethodContainerWithoutStripe = _ref => {
19374
19416
  coupon_code: state === null || state === void 0 ? void 0 : state.couponCode,
19375
19417
  address_id: selectedAddressId
19376
19418
  }, (error, res) => {
19377
- var _res$data7, _res$data8;
19419
+ var _res$data8, _res$data9;
19378
19420
  if (error) {
19379
19421
  return reject(error);
19380
19422
  }
19381
- const taxAmount = (_res$data7 = res.data) === null || _res$data7 === void 0 ? void 0 : _res$data7.taxes;
19382
- const totalAmountWithTax = (_res$data8 = res.data) === null || _res$data8 === void 0 ? void 0 : _res$data8.total;
19423
+ const taxAmount = (_res$data8 = res.data) === null || _res$data8 === void 0 ? void 0 : _res$data8.taxes;
19424
+ const totalAmountWithTax = (_res$data9 = res.data) === null || _res$data9 === void 0 ? void 0 : _res$data9.total;
19383
19425
  resolve({
19384
19426
  totalAmountWithTax,
19385
19427
  taxAmount
@@ -25305,7 +25347,8 @@ const PasswordResetContainer = _ref => {
25305
25347
  email,
25306
25348
  password,
25307
25349
  password_confirmation: confirmPassword,
25308
- token
25350
+ token,
25351
+ referer: window.location.origin
25309
25352
  }, (err, res) => {
25310
25353
  dispatch({
25311
25354
  type: DISABLE_SUBMIT,
@@ -25537,7 +25580,8 @@ const PasswordForgotContainer = _ref => {
25537
25580
  email
25538
25581
  } = _ref2;
25539
25582
  window.Pelcro.password.forgot({
25540
- email
25583
+ email,
25584
+ referer: window.location.origin
25541
25585
  }, (err, res) => {
25542
25586
  dispatch({
25543
25587
  type: DISABLE_SUBMIT,
@@ -27662,17 +27706,21 @@ const AddressSelectModal = _ref => {
27662
27706
  AddressSelectModal.viewId = "address-select";
27663
27707
 
27664
27708
  const moveDefaultPaymentMethodToStart = paymentMethods => {
27665
- var _window$Pelcro$user$r;
27666
- const defaultPaymentMethod = (_window$Pelcro$user$r = window.Pelcro.user.read()) === null || _window$Pelcro$user$r === void 0 ? void 0 : _window$Pelcro$user$r.source;
27709
+ const defaultPaymentMethod = getDefaultPaymentMethod(paymentMethods);
27667
27710
  const paymentMethodsWithoutDefault = paymentMethods.filter(paymentMethod => paymentMethod.id !== defaultPaymentMethod.id);
27668
27711
  if (defaultPaymentMethod.status !== "chargeable") {
27669
27712
  return paymentMethodsWithoutDefault;
27670
27713
  }
27671
27714
  return [defaultPaymentMethod, ...paymentMethodsWithoutDefault];
27672
27715
  };
27716
+ const getDefaultPaymentMethod = paymentMethods => {
27717
+ const defaultPaymentMethod = paymentMethods.find(paymentMethod => paymentMethod.is_default);
27718
+ return defaultPaymentMethod;
27719
+ };
27673
27720
  const initialState$5 = {
27674
27721
  paymentMethods: [],
27675
27722
  selectedPaymentMethodId: null,
27723
+ skeletonLoader: true,
27676
27724
  isSubmitting: false,
27677
27725
  alert: {
27678
27726
  type: "error",
@@ -27703,12 +27751,11 @@ const PaymentMethodSelectContainer = _ref => {
27703
27751
  });
27704
27752
  return onSuccess(selectedPaymentMethodId);
27705
27753
  };
27706
- const getInitialSelectedMethodId = () => {
27707
- var _window$Pelcro$user$r2;
27754
+ const getInitialSelectedMethodId = paymentMethods => {
27708
27755
  if (selectedPaymentMethodIdFromStore) {
27709
27756
  return selectedPaymentMethodIdFromStore;
27710
27757
  }
27711
- const defaultMethod = (_window$Pelcro$user$r2 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2.source;
27758
+ const defaultMethod = getDefaultPaymentMethod(paymentMethods);
27712
27759
  if (defaultMethod && defaultMethod.status === "chargeable") {
27713
27760
  return String(defaultMethod.id);
27714
27761
  }
@@ -27725,7 +27772,12 @@ const PaymentMethodSelectContainer = _ref => {
27725
27772
  return lib_7({
27726
27773
  ...state,
27727
27774
  paymentMethods: moveDefaultPaymentMethodToStart(action.payload),
27728
- selectedPaymentMethodId: getInitialSelectedMethodId()
27775
+ selectedPaymentMethodId: getInitialSelectedMethodId(action.payload)
27776
+ });
27777
+ case SKELETON_LOADER:
27778
+ return lib_7({
27779
+ ...state,
27780
+ skeletonLoader: action.payload
27729
27781
  });
27730
27782
  case HANDLE_SUBMIT:
27731
27783
  return lib_5({
@@ -27737,10 +27789,23 @@ const PaymentMethodSelectContainer = _ref => {
27737
27789
  }
27738
27790
  }, initialState$5);
27739
27791
  useEffect(() => {
27740
- var _window$Pelcro$user$r3;
27741
- dispatch({
27742
- type: LOAD_PAYMENT_METHODS,
27743
- payload: (_window$Pelcro$user$r3 = window.Pelcro.user.read().sources) !== null && _window$Pelcro$user$r3 !== void 0 ? _window$Pelcro$user$r3 : []
27792
+ window.Pelcro.paymentMethods.list({
27793
+ auth_token: window.Pelcro.user.read().auth_token
27794
+ }, (err, res) => {
27795
+ if (err) {
27796
+ return console.error(err);
27797
+ }
27798
+ if (res) {
27799
+ var _res$data;
27800
+ dispatch({
27801
+ type: LOAD_PAYMENT_METHODS,
27802
+ payload: (_res$data = res.data) !== null && _res$data !== void 0 ? _res$data : []
27803
+ });
27804
+ dispatch({
27805
+ type: SKELETON_LOADER,
27806
+ payload: false
27807
+ });
27808
+ }
27744
27809
  });
27745
27810
  }, []);
27746
27811
  return /*#__PURE__*/React__default.createElement("div", {
@@ -27769,7 +27834,8 @@ const PaymentMethodSelectList = () => {
27769
27834
  dispatch,
27770
27835
  state: {
27771
27836
  paymentMethods,
27772
- selectedPaymentMethodId
27837
+ selectedPaymentMethodId,
27838
+ skeletonLoader
27773
27839
  }
27774
27840
  } = useContext(store$5);
27775
27841
  const handlePaymentMethodSelect = event => {
@@ -27778,7 +27844,9 @@ const PaymentMethodSelectList = () => {
27778
27844
  payload: event.target.value
27779
27845
  });
27780
27846
  };
27781
- return /*#__PURE__*/React__default.createElement("div", {
27847
+ return /*#__PURE__*/React__default.createElement("div", null, skeletonLoader ? /*#__PURE__*/React__default.createElement("div", {
27848
+ className: "plc-w-full plc-h-20 plc-bg-gray-300 plc-rounded-md plc-animate-pulse"
27849
+ }) : /*#__PURE__*/React__default.createElement("div", {
27782
27850
  className: "plc-px-3 plc-py-2 plc-space-y-4 plc-overflow-y-scroll plc-max-h-80 pelcro-payment-method-select-wrapper"
27783
27851
  }, paymentMethods.map(paymentMethod => {
27784
27852
  var _paymentMethod$proper, _paymentMethod$proper2, _paymentMethod$proper3, _paymentMethod$proper4;
@@ -27801,7 +27869,7 @@ const PaymentMethodSelectList = () => {
27801
27869
  }, "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 ", (_paymentMethod$proper2 = paymentMethod.properties) === null || _paymentMethod$proper2 === void 0 ? void 0 : _paymentMethod$proper2.last4), /*#__PURE__*/React__default.createElement("p", {
27802
27870
  className: "plc-text-sm plc-text-gray-500"
27803
27871
  }, t("select.expires"), " ", (_paymentMethod$proper3 = paymentMethod.properties) === null || _paymentMethod$proper3 === void 0 ? void 0 : _paymentMethod$proper3.exp_month, "/", (_paymentMethod$proper4 = paymentMethod.properties) === null || _paymentMethod$proper4 === void 0 ? void 0 : _paymentMethod$proper4.exp_year))));
27804
- }));
27872
+ })));
27805
27873
  };
27806
27874
 
27807
27875
  const PaymentMethodSelectSubmit = _ref => {
@@ -27903,10 +27971,10 @@ const initialState$4 = {
27903
27971
  paymentMethods: [],
27904
27972
  selectedPaymentMethodId: null,
27905
27973
  isSubmitting: false,
27906
- deleteOption: "",
27907
- disableSubmit: false,
27974
+ disableSubmit: true,
27908
27975
  isLoading: false,
27909
27976
  skeletonLoader: true,
27977
+ showPaymentMethodSelect: false,
27910
27978
  alert: {
27911
27979
  type: "error",
27912
27980
  content: ""
@@ -27943,20 +28011,19 @@ const PaymentMethodDeleteContainer = _ref => {
27943
28011
  type: SKELETON_LOADER,
27944
28012
  payload: false
27945
28013
  });
27946
- if (res.data.length !== 1) {
27947
- dispatch({
27948
- type: SET_DELETE_PAYMENT_METHOD_OPTION,
27949
- payload: "select"
27950
- });
27951
- } else {
28014
+ if (res.data.length !== 1 && paymentMethodToDelete.is_default && paymentMethodToDelete.deletable) {
27952
28015
  dispatch({
27953
- type: SET_DELETE_PAYMENT_METHOD_OPTION,
27954
- payload: "add"
28016
+ type: SHOW_PAYMENT_METHOD_SELECT,
28017
+ payload: true
27955
28018
  });
27956
28019
  }
28020
+ dispatch({
28021
+ type: DISABLE_SUBMIT,
28022
+ payload: false
28023
+ });
27957
28024
  }
27958
28025
  });
27959
- }, []); // eslint-disable-line react-hooks/exhaustive-deps
28026
+ }, [paymentMethodToDelete]); // eslint-disable-line react-hooks/exhaustive-deps
27960
28027
 
27961
28028
  const setDefaultPaymentMethod = () => {
27962
28029
  const {
@@ -27968,6 +28035,15 @@ const PaymentMethodDeleteContainer = _ref => {
27968
28035
  is_default: true
27969
28036
  }, (err, res) => {
27970
28037
  if (err) {
28038
+ dispatch({
28039
+ type: DISABLE_SUBMIT,
28040
+ payload: false
28041
+ });
28042
+ dispatch({
28043
+ type: LOADING,
28044
+ payload: false
28045
+ });
28046
+ console.log(err);
27971
28047
  onFailure(err);
27972
28048
  return dispatch({
27973
28049
  type: SHOW_ALERT,
@@ -27990,6 +28066,14 @@ const PaymentMethodDeleteContainer = _ref => {
27990
28066
  auth_token: window.Pelcro.user.read().auth_token,
27991
28067
  payment_method_id: paymentMethodId
27992
28068
  }, (err, res) => {
28069
+ dispatch({
28070
+ type: DISABLE_SUBMIT,
28071
+ payload: false
28072
+ });
28073
+ dispatch({
28074
+ type: LOADING,
28075
+ payload: false
28076
+ });
27993
28077
  if (err) {
27994
28078
  onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
27995
28079
  return dispatch({
@@ -28000,14 +28084,6 @@ const PaymentMethodDeleteContainer = _ref => {
28000
28084
  }
28001
28085
  });
28002
28086
  }
28003
- dispatch({
28004
- type: DISABLE_SUBMIT,
28005
- payload: false
28006
- });
28007
- dispatch({
28008
- type: LOADING,
28009
- payload: false
28010
- });
28011
28087
  onSuccess(res);
28012
28088
  });
28013
28089
  };
@@ -28023,11 +28099,12 @@ const PaymentMethodDeleteContainer = _ref => {
28023
28099
  ...state,
28024
28100
  disableSubmit: true,
28025
28101
  isLoading: true
28026
- }, (state, dispatch) => setDefaultPaymentMethod());
28027
- case SET_DELETE_PAYMENT_METHOD_OPTION:
28028
- return lib_7({
28029
- ...state,
28030
- deleteOption: action.payload
28102
+ }, (state, dispatch) => {
28103
+ if (state.showPaymentMethodSelect) {
28104
+ setDefaultPaymentMethod();
28105
+ } else {
28106
+ deletePaymentMethod();
28107
+ }
28031
28108
  });
28032
28109
  case SET_PAYMENT_METHODS:
28033
28110
  return lib_7({
@@ -28054,6 +28131,11 @@ const PaymentMethodDeleteContainer = _ref => {
28054
28131
  ...state,
28055
28132
  skeletonLoader: action.payload
28056
28133
  });
28134
+ case SHOW_PAYMENT_METHOD_SELECT:
28135
+ return lib_7({
28136
+ ...state,
28137
+ showPaymentMethodSelect: action.payload
28138
+ });
28057
28139
  default:
28058
28140
  return state;
28059
28141
  }
@@ -28076,6 +28158,91 @@ const PaymentMethodDeleteContainer = _ref => {
28076
28158
  })));
28077
28159
  };
28078
28160
 
28161
+ const PaymentMethodDeleteList = props => {
28162
+ const {
28163
+ t
28164
+ } = useTranslation("paymentMethod");
28165
+ const {
28166
+ dispatch,
28167
+ state: {
28168
+ selectedPaymentMethodId,
28169
+ paymentMethods,
28170
+ skeletonLoader,
28171
+ showPaymentMethodSelect
28172
+ }
28173
+ } = useContext(store$4);
28174
+ const {
28175
+ paymentMethodToDelete
28176
+ } = usePelcro();
28177
+ const createPaymentMethodItems = () => {
28178
+ if (paymentMethods.length) {
28179
+ return paymentMethods.filter(paymentMethod => (paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.id) !== (paymentMethodToDelete === null || paymentMethodToDelete === void 0 ? void 0 : paymentMethodToDelete.id)).map(paymentMethod => /*#__PURE__*/React__default.createElement("option", {
28180
+ key: paymentMethod.id,
28181
+ value: paymentMethod.id
28182
+ }, paymentMethod.properties.brand, " -", " ", paymentMethod.properties.last4, " -", " ", paymentMethod.properties.exp_month, " /", paymentMethod.properties.exp_year));
28183
+ }
28184
+ };
28185
+ const handlePaymentMethodSelect = event => {
28186
+ dispatch({
28187
+ type: SELECT_PAYMENT_METHOD,
28188
+ payload: event.target.value
28189
+ });
28190
+ };
28191
+ if (showPaymentMethodSelect) {
28192
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, skeletonLoader ? /*#__PURE__*/React__default.createElement("div", {
28193
+ className: "plc-w-full plc-h-8 plc-bg-gray-300 plc-rounded-md plc-animate-pulse"
28194
+ }) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, paymentMethods && /*#__PURE__*/React__default.createElement("div", {
28195
+ className: "plc-mt-4"
28196
+ }, /*#__PURE__*/React__default.createElement(Select, {
28197
+ label: t("delete.options.select"),
28198
+ name: "default-payment-method",
28199
+ onChange: handlePaymentMethodSelect,
28200
+ value: selectedPaymentMethodId
28201
+ }, /*#__PURE__*/React__default.createElement("option", {
28202
+ value: "",
28203
+ disabled: true,
28204
+ selected: true
28205
+ }), createPaymentMethodItems()))));
28206
+ } else {
28207
+ return null;
28208
+ }
28209
+ };
28210
+
28211
+ const PaymentMethodDetails = () => {
28212
+ var _paymentMethodToDelet, _paymentMethodToDelet2, _paymentMethodToDelet3, _paymentMethodToDelet4;
28213
+ const {
28214
+ state: {
28215
+ skeletonLoader
28216
+ }
28217
+ } = useContext(store$4);
28218
+ const {
28219
+ t
28220
+ } = useTranslation("paymentMethod");
28221
+ const {
28222
+ paymentMethodToDelete
28223
+ } = usePelcro();
28224
+ return /*#__PURE__*/React__default.createElement("div", {
28225
+ className: "plc-text-left plc-mr-auto plc-mb-6"
28226
+ }, /*#__PURE__*/React__default.createElement("h4", {
28227
+ className: "plc-mb-2"
28228
+ }, t("delete.details")), skeletonLoader ? /*#__PURE__*/React__default.createElement("div", {
28229
+ className: "plc-w-full plc-h-16 plc-bg-gray-300 plc-rounded-md plc-animate-pulse"
28230
+ }) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, paymentMethodToDelete && /*#__PURE__*/React__default.createElement("div", {
28231
+ key: paymentMethodToDelete === null || paymentMethodToDelete === void 0 ? void 0 : paymentMethodToDelete.id,
28232
+ className: `plc-p-2 plc-pl-4 plc-shadow-md_dark plc-text-gray-900 plc-rounded pelcro-payment-method-wrapper`
28233
+ }, /*#__PURE__*/React__default.createElement("div", {
28234
+ className: "plc-flex plc-items-center plc-space-x-2 plc-w-full pelcro-select-payment-method-radio",
28235
+ id: `pelcro-payment-method-select-${paymentMethodToDelete === null || paymentMethodToDelete === void 0 ? void 0 : paymentMethodToDelete.id}`,
28236
+ name: "paymentMethod"
28237
+ }, getPaymentCardIcon$1((_paymentMethodToDelet = paymentMethodToDelete.properties) === null || _paymentMethodToDelet === void 0 ? void 0 : _paymentMethodToDelet.brand), /*#__PURE__*/React__default.createElement("div", {
28238
+ className: "plc-flex plc-flex-col plc-text-lg pelcro-payment-method-details"
28239
+ }, /*#__PURE__*/React__default.createElement("p", {
28240
+ className: "plc-font-semibold"
28241
+ }, "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022", " ", (_paymentMethodToDelet2 = paymentMethodToDelete.properties) === null || _paymentMethodToDelet2 === void 0 ? void 0 : _paymentMethodToDelet2.last4), /*#__PURE__*/React__default.createElement("p", {
28242
+ className: "plc-text-sm plc-text-gray-500"
28243
+ }, t("select.expires"), " ", (_paymentMethodToDelet3 = paymentMethodToDelete.properties) === null || _paymentMethodToDelet3 === void 0 ? void 0 : _paymentMethodToDelet3.exp_month, "/", (_paymentMethodToDelet4 = paymentMethodToDelete.properties) === null || _paymentMethodToDelet4 === void 0 ? void 0 : _paymentMethodToDelet4.exp_year))))));
28244
+ };
28245
+
28079
28246
  const PaymentMethodDeleteSubmit = _ref => {
28080
28247
  let {
28081
28248
  name,
@@ -28089,7 +28256,9 @@ const PaymentMethodDeleteSubmit = _ref => {
28089
28256
  dispatch,
28090
28257
  state: {
28091
28258
  isLoading,
28092
- isDisabled
28259
+ disableSubmit,
28260
+ showPaymentMethodSelect,
28261
+ selectedPaymentMethodId
28093
28262
  }
28094
28263
  } = useContext(store$4);
28095
28264
  return /*#__PURE__*/React__default.createElement(Button, Object.assign({
@@ -28099,116 +28268,38 @@ const PaymentMethodDeleteSubmit = _ref => {
28099
28268
  });
28100
28269
  onClick === null || onClick === void 0 ? void 0 : onClick();
28101
28270
  },
28102
- disabled: isDisabled,
28271
+ disabled: showPaymentMethodSelect ? !selectedPaymentMethodId : disableSubmit,
28103
28272
  isLoading: isLoading,
28104
28273
  className: "plc-w-full"
28105
- }, otherProps), name !== null && name !== void 0 ? name : t("select.buttons.selectPaymentMethod"));
28274
+ }, otherProps), name !== null && name !== void 0 ? name : t("delete.buttons.delete"));
28106
28275
  };
28107
28276
 
28108
- const PaymentMethodDeleteList = props => {
28277
+ const PaymentMethodDeleteBack = _ref => {
28278
+ let {
28279
+ name,
28280
+ onClick,
28281
+ ...otherProps
28282
+ } = _ref;
28109
28283
  const {
28110
28284
  t
28111
28285
  } = useTranslation("paymentMethod");
28112
28286
  const {
28113
- dispatch,
28114
- state: {
28115
- deleteOption,
28116
- selectedPaymentMethodId,
28117
- paymentMethods,
28118
- skeletonLoader
28119
- }
28120
- } = useContext(store$4);
28121
- const {
28122
- paymentMethodToDelete
28287
+ switchView
28123
28288
  } = usePelcro();
28124
- const handlePaymentMethodSelect = event => {
28125
- dispatch({
28126
- type: SELECT_PAYMENT_METHOD,
28127
- payload: event.target.value
28128
- });
28129
- };
28130
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, skeletonLoader ? /*#__PURE__*/React__default.createElement("div", {
28131
- className: "plc-w-full plc-h-40 plc-bg-gray-300 plc-rounded-md plc-animate-pulse"
28132
- }) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, paymentMethods && deleteOption === "select" && /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
28133
- className: "plc-px-3 plc-py-2 plc-space-y-4 plc-overflow-y-scroll no-scrollbar plc-max-h-80 pelcro-payment-method-select-wrapper plc-mb-4"
28134
- }, paymentMethods.filter(paymentMethod => (paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.id) !== (paymentMethodToDelete === null || paymentMethodToDelete === void 0 ? void 0 : paymentMethodToDelete.id)).map(paymentMethod => {
28135
- var _paymentMethod$proper, _paymentMethod$proper2, _paymentMethod$proper3, _paymentMethod$proper4;
28136
- const isSelected = selectedPaymentMethodId === String(paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.id);
28137
- return /*#__PURE__*/React__default.createElement("div", {
28138
- key: paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.id,
28139
- className: `plc-p-2 plc-pl-4 plc-shadow-md plc-text-gray-900 plc-rounded pelcro-payment-method-wrapper`
28140
- }, /*#__PURE__*/React__default.createElement(Radio, {
28141
- className: "plc-flex plc-items-center pelcro-select-payment-method-radio",
28142
- labelClassName: "plc-flex plc-items-center plc-space-x-2 plc-cursor-pointer plc-w-full",
28143
- id: `pelcro-payment-method-select-${paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.id}`,
28144
- name: "paymentMethod",
28145
- checked: isSelected,
28146
- value: paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.id,
28147
- onChange: handlePaymentMethodSelect
28148
- }, getPaymentCardIcon$1((_paymentMethod$proper = paymentMethod.properties) === null || _paymentMethod$proper === void 0 ? void 0 : _paymentMethod$proper.brand), /*#__PURE__*/React__default.createElement("div", {
28149
- className: "plc-flex plc-flex-col plc-text-lg pelcro-payment-method-details"
28150
- }, /*#__PURE__*/React__default.createElement("p", {
28151
- className: "plc-font-semibold"
28152
- }, "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022", " ", (_paymentMethod$proper2 = paymentMethod.properties) === null || _paymentMethod$proper2 === void 0 ? void 0 : _paymentMethod$proper2.last4), /*#__PURE__*/React__default.createElement("p", {
28153
- className: "plc-text-sm plc-text-gray-500"
28154
- }, t("select.expires"), " ", (_paymentMethod$proper3 = paymentMethod.properties) === null || _paymentMethod$proper3 === void 0 ? void 0 : _paymentMethod$proper3.exp_month, "/", (_paymentMethod$proper4 = paymentMethod.properties) === null || _paymentMethod$proper4 === void 0 ? void 0 : _paymentMethod$proper4.exp_year))));
28155
- })), /*#__PURE__*/React__default.createElement("div", {
28156
- className: "plc-px-3"
28157
- }, /*#__PURE__*/React__default.createElement(PaymentMethodDeleteSubmit, null))), deleteOption === "add" && /*#__PURE__*/React__default.createElement(PaymentMethodView, {
28158
- type: "deletePaymentSource",
28159
- showCoupon: false,
28160
- showExternalPaymentMethods: false,
28161
- showApplePayButton: false,
28162
- onDisplay: props.onDisplay,
28163
- onFailure: props.onFailure,
28164
- onSuccess: props.onSuccess,
28165
- setAsDefault: true
28166
- })));
28289
+ return /*#__PURE__*/React__default.createElement(Button, Object.assign({
28290
+ variant: "outline",
28291
+ onClick: () => {
28292
+ switchView("dashboard");
28293
+ onClick === null || onClick === void 0 ? void 0 : onClick();
28294
+ },
28295
+ className: "plc-w-full"
28296
+ }, otherProps), name !== null && name !== void 0 ? name : t("delete.buttons.back"));
28167
28297
  };
28168
28298
 
28169
- const PaymentMethodDeleteOptions = _ref => {
28170
- const {
28171
- state: {
28172
- deleteOption,
28173
- paymentMethods,
28174
- skeletonLoader
28175
- },
28176
- dispatch
28177
- } = useContext(store$4);
28299
+ function PaymentMethodDeleteView(props) {
28178
28300
  const {
28179
28301
  t
28180
28302
  } = useTranslation("paymentMethod");
28181
- const handleOptionSelect = event => {
28182
- dispatch({
28183
- type: SET_DELETE_PAYMENT_METHOD_OPTION,
28184
- payload: event.target.value
28185
- });
28186
- };
28187
- return /*#__PURE__*/React__default.createElement("div", {
28188
- className: "plc-text-left plc-mr-auto plc-mb-6"
28189
- }, skeletonLoader ? /*#__PURE__*/React__default.createElement("div", {
28190
- className: "plc-flex plc-flex-col plc-space-y-3"
28191
- }, /*#__PURE__*/React__default.createElement(Radio, {
28192
- className: "plc-animate-puls"
28193
- }, /*#__PURE__*/React__default.createElement("div", {
28194
- className: "plc-w-36 plc-bg-gray-300 plc-h-4 plc-rounded-md plc-animate-pulse"
28195
- })), /*#__PURE__*/React__default.createElement(Radio, {
28196
- className: "plc-animate-pulse"
28197
- }, /*#__PURE__*/React__default.createElement("div", {
28198
- className: "plc-w-36 plc-bg-gray-300 plc-h-4 plc-rounded-md plc-animate-pulse"
28199
- }))) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, paymentMethods && paymentMethods.length !== 1 && /*#__PURE__*/React__default.createElement(Radio, {
28200
- onChange: handleOptionSelect,
28201
- checked: deleteOption === "select",
28202
- value: "select"
28203
- }, t("delete.options.select")), /*#__PURE__*/React__default.createElement(Radio, {
28204
- onChange: handleOptionSelect,
28205
- checked: deleteOption === "add",
28206
- value: "add"
28207
- }, t("delete.options.add"))));
28208
- };
28209
-
28210
- function PaymentMethodDeleteView(props) {
28211
- const [t] = useTranslation("paymentMethod");
28212
28303
  return /*#__PURE__*/React__default.createElement("div", {
28213
28304
  id: "pelcro-payment-method-delete-view"
28214
28305
  }, /*#__PURE__*/React__default.createElement("div", {
@@ -28216,12 +28307,12 @@ function PaymentMethodDeleteView(props) {
28216
28307
  }, /*#__PURE__*/React__default.createElement("h4", {
28217
28308
  className: "plc-text-2xl plc-font-semibold plc-mb-2"
28218
28309
  }, t("delete.title")), /*#__PURE__*/React__default.createElement("p", {
28219
- className: ""
28220
- }, t("delete.subtitle"))), /*#__PURE__*/React__default.createElement(PaymentMethodDeleteContainer, props, /*#__PURE__*/React__default.createElement(AlertWithContext, {
28221
- className: "plc-mb-2"
28222
- }), /*#__PURE__*/React__default.createElement(PaymentMethodDeleteOptions, null), /*#__PURE__*/React__default.createElement(PaymentMethodDeleteList, {
28223
- onSuccess: props.onSuccess
28224
- })));
28310
+ className: "plc-text-sm"
28311
+ }, t("delete.subtitle"))), /*#__PURE__*/React__default.createElement(PaymentMethodDeleteContainer, props, /*#__PURE__*/React__default.createElement(AlertWithContext, null), /*#__PURE__*/React__default.createElement(PaymentMethodDetails, null), /*#__PURE__*/React__default.createElement(PaymentMethodDeleteList, null), /*#__PURE__*/React__default.createElement("p", {
28312
+ className: "plc-text-sm plc-text-justify"
28313
+ }, t("delete.message")), /*#__PURE__*/React__default.createElement("div", {
28314
+ className: "plc-space-x-0 plc-space-y-3 plc-w-full plc-flex plc-flex-col plc-items-center plc-justify-center plc-mt-4"
28315
+ }, /*#__PURE__*/React__default.createElement(PaymentMethodDeleteSubmit, null), /*#__PURE__*/React__default.createElement(PaymentMethodDeleteBack, null))));
28225
28316
  }
28226
28317
 
28227
28318
  const PaymentMethodDeleteModal = props => {
@@ -28248,7 +28339,7 @@ const PaymentMethodDeleteModal = props => {
28248
28339
  nonInteraction: true
28249
28340
  });
28250
28341
  }
28251
- notify$1.success(t("delete.paymentMethodReplaced"));
28342
+ notify$1.success(t("delete.deletedSuccessfully"));
28252
28343
  resetView();
28253
28344
  };
28254
28345
  return /*#__PURE__*/React__default.createElement(Modal, {
@@ -29434,6 +29525,14 @@ const getPaymentCardIcon = name => {
29434
29525
  viewBox: "0 0 50 50"
29435
29526
  }, /*#__PURE__*/React__default.createElement("path", {
29436
29527
  d: "M 5 7 C 2.25 7 0 9.25 0 12 L 0 38 C 0 40.75 2.25 43 5 43 L 45 43 C 47.75 43 50 40.75 50 38 L 50 12 C 50 9.25 47.75 7 45 7 Z M 5 9 L 45 9 C 46.667969 9 48 10.332031 48 12 L 48 38 C 48 39.667969 46.667969 41 45 41 L 5 41 C 3.332031 41 2 39.667969 2 38 L 2 12 C 2 10.332031 3.332031 9 5 9 Z M 8.5625 19.90625 L 4.84375 28.40625 L 7.0625 28.40625 L 7.875 26.5 L 12.0625 26.5 L 12.875 28.40625 L 17.09375 28.40625 L 17.09375 22.09375 L 19.90625 28.40625 L 21.8125 28.40625 L 24.65625 22.1875 L 24.65625 28.40625 L 26.75 28.40625 L 26.75 19.90625 L 23.40625 19.90625 L 20.84375 25.625 L 18.28125 19.90625 L 15 19.90625 L 15 28.09375 L 11.34375 19.90625 Z M 29.5 19.90625 L 29.5 28.4375 L 37.5 28.4375 L 40 25.59375 L 42.46875 28.4375 L 45.125 28.4375 L 41.375 24.0625 L 45.125 19.90625 L 42.46875 19.90625 L 40.0625 22.5625 L 37.75 19.90625 Z M 9.90625 21.6875 L 11.21875 24.6875 L 8.65625 24.6875 Z M 31.5625 21.71875 L 36.65625 21.75 L 38.6875 24.0625 L 36.40625 26.625 L 31.5625 26.625 L 31.5625 24.9375 L 36.1875 24.9375 L 36.1875 23.3125 L 31.5625 23.3125 Z"
29528
+ })),
29529
+ amex: /*#__PURE__*/React__default.createElement("svg", {
29530
+ className: "plc-w-12",
29531
+ fill: "#ffffff",
29532
+ xmlns: "http://www.w3.org/2000/svg",
29533
+ viewBox: "0 0 50 50"
29534
+ }, /*#__PURE__*/React__default.createElement("path", {
29535
+ d: "M 5 7 C 2.25 7 0 9.25 0 12 L 0 38 C 0 40.75 2.25 43 5 43 L 45 43 C 47.75 43 50 40.75 50 38 L 50 12 C 50 9.25 47.75 7 45 7 Z M 5 9 L 45 9 C 46.667969 9 48 10.332031 48 12 L 48 38 C 48 39.667969 46.667969 41 45 41 L 5 41 C 3.332031 41 2 39.667969 2 38 L 2 12 C 2 10.332031 3.332031 9 5 9 Z M 8.5625 19.90625 L 4.84375 28.40625 L 7.0625 28.40625 L 7.875 26.5 L 12.0625 26.5 L 12.875 28.40625 L 17.09375 28.40625 L 17.09375 22.09375 L 19.90625 28.40625 L 21.8125 28.40625 L 24.65625 22.1875 L 24.65625 28.40625 L 26.75 28.40625 L 26.75 19.90625 L 23.40625 19.90625 L 20.84375 25.625 L 18.28125 19.90625 L 15 19.90625 L 15 28.09375 L 11.34375 19.90625 Z M 29.5 19.90625 L 29.5 28.4375 L 37.5 28.4375 L 40 25.59375 L 42.46875 28.4375 L 45.125 28.4375 L 41.375 24.0625 L 45.125 19.90625 L 42.46875 19.90625 L 40.0625 22.5625 L 37.75 19.90625 Z M 9.90625 21.6875 L 11.21875 24.6875 L 8.65625 24.6875 Z M 31.5625 21.71875 L 36.65625 21.75 L 38.6875 24.0625 L 36.40625 26.625 L 31.5625 26.625 L 31.5625 24.9375 L 36.1875 24.9375 L 36.1875 23.3125 L 31.5625 23.3125 Z"
29437
29536
  }))
29438
29537
  };
29439
29538
  return (_icons$name$toLowerCa = icons[name === null || name === void 0 ? void 0 : name.toLowerCase()]) !== null && _icons$name$toLowerCa !== void 0 ? _icons$name$toLowerCa : /*#__PURE__*/React__default.createElement("svg", {
@@ -30760,23 +30859,8 @@ class Dashboard extends Component {
30760
30859
  });
30761
30860
  });
30762
30861
  _defineProperty$3(this, "onDeletePaymentMethodClick", source => {
30763
- const isDeletable = source === null || source === void 0 ? void 0 : source.deletable;
30764
- if (isDeletable) {
30765
- this.props.onClose();
30766
- notify$1.confirm((onSuccess, onFailure) => {
30767
- this.deletePaymentMethod(source.id, onSuccess, onFailure);
30768
- }, {
30769
- confirmMessage: this.locale("messages.paymentMethodDeletion.isSureToDelete"),
30770
- loadingMessage: this.locale("messages.paymentMethodDeletion.loading"),
30771
- successMessage: this.locale("messages.paymentMethodDeletion.success"),
30772
- errorMessage: this.locale("messages.paymentMethodDeletion.error")
30773
- }, {
30774
- closeButtonLabel: this.locale("labels.subCancellation.goBack")
30775
- });
30776
- } else {
30777
- this.props.setPaymentMethodToDelete(source.id);
30778
- return this.props.setView("payment-method-delete");
30779
- }
30862
+ this.props.setPaymentMethodToDelete(source.id);
30863
+ return this.props.setView("payment-method-delete");
30780
30864
  });
30781
30865
  _defineProperty$3(this, "displayRedeem", () => {
30782
30866
  return this.props.setView("gift-redeem");
@@ -35121,4 +35205,4 @@ const QrCodeModal = _ref => {
35121
35205
  };
35122
35206
  QrCodeModal.viewId = "qrcode";
35123
35207
 
35124
- export { AddressCreateCity, AddressCreateContainer, AddressCreateCountrySelect, AddressCreateFirstName, AddressCreateLastName, AddressCreateLine1, AddressCreateLine2, AddressCreateModal, AddressCreatePostalCode, AddressCreateSetDefault, AddressCreateStateSelect, AddressCreateSubmit, AddressCreateTextInput, AddressCreateView, AddressSelectContainer, AddressSelectList, AddressSelectModal, AddressSelectSubmit, AddressSelectView, AddressUpdateCity, AddressUpdateContainer, AddressUpdateCountrySelect, AddressUpdateFirstName, AddressUpdateLastName, AddressUpdateLine1, AddressUpdateLine2, AddressUpdateModal, AddressUpdatePostalCode, AddressUpdateSetDefault, AddressUpdateStateSelect, AddressUpdateSubmit, AddressUpdateTextInput, AddressUpdateView, AlertWithContext as Alert, Alert as AlertElement, ApplePayButton, ApplyCouponButton, Auth0LoginButton, Badge, BankAuthenticationSuccess, BankRedirection, Button, CartContainer, CartModal, CartRemoveItemButton, CartSubmit, CartTotalPrice, CartView, Checkbox, CheckoutForm, ConfirmPassword, CouponCode, CouponCodeField, DashboardWithHook as Dashboard, DashboardOpenButton, DatePicker, DiscountedPrice, Email, EmailVerifyContainer, EmailVerifyModal, EmailVerifyResendButton, EmailVerifyView, FacebookLoginButton, GiftCreateContainer, GiftCreateEmail, GiftCreateFirstName, GiftCreateLastName, GiftCreateMessage, GiftCreateModal, GiftCreateStartDate, GiftCreateSubmitButton, GiftCreateView, GiftRedeemCode, GiftRedeemContainer, GiftRedeemModal, GiftRedeemSubmitButton, GiftRedeemView, GoogleLoginButton, IncludeFirstName, IncludeLastName, IncludePhone, Input, InvoiceDetailsContainer, InvoiceDetailsDownloadButton, InvoiceDetailsModal, InvoiceDetailsPayButton, InvoiceDetailsView, InvoicePaymentContainer, InvoicePaymentModal, InvoicePaymentView, Link, LoginButton, LoginContainer, LoginEmail, LoginModal, LoginPassword, LoginRequestLoginToken, LoginUsername, LoginView, Logout, MeterModal, MeterView, Modal, ModalBody, ModalFooter, NewsletterWithHook as NewsLetter, NewsletterUpdateButton, NewsletterUpdateContainer, NewsletterUpdateList, NewsletterUpdateModal, NewsletterUpdateView, Notification, OrderConfirmModal, OrderCreateContainer, OrderCreateFreeButton, OrderCreateModal, OrderCreateSubmitButton, OrderCreateView, Password, PasswordChangeButton, PasswordChangeConfirmNewPassword, PasswordChangeContainer, PasswordChangeCurrentPassword, PasswordChangeModal, PasswordChangeNewPassword, PasswordChangeView, PasswordForgotButton, PasswordForgotContainer, PasswordForgotEmail, PasswordForgotModal, PasswordForgotView, PasswordResetButton, PasswordResetConfirmPassword, PasswordResetContainer, PasswordResetEmail, PasswordResetModal, PasswordResetPassword, PasswordResetView, PasswordlessRequestContainer, PasswordlessRequestEmail, PasswordlessRequestModal, PasswordlessRequestView, PasswordlessRequestViewButton, PaymentCreateContainer, PaymentCreateView, PaymentMethodContainer, PaymentMethodCreateContainer, PaymentMethodCreateModal, PaymentMethodCreateView, PaymentMethodDeleteContainer, PaymentMethodDeleteList, PaymentMethodDeleteModal, PaymentMethodDeleteOptions, PaymentMethodDeleteSubmit, PaymentMethodDeleteView, PaymentMethodSelectContainer, PaymentMethodSelectList, PaymentMethodSelectModal, PaymentMethodSelectSubmit, PaymentMethodSelectView, PaymentMethodUpdateContainer, PaymentMethodUpdateModal, PaymentMethodUpdateSetDefault, PaymentMethodUpdateView, PaymentMethodView, PaymentSuccessModal, PaymentSuccessView, PaypalSubscribeButton, PelcroCardCVC, PelcroCardExpiry, PelcroCardNumber, PelcroModalController, PelcroPaymentRequestButton, ProfilePicChangeButton, ProfilePicChangeContainer, ProfilePicChangeCropper, ProfilePicChangeModal, ProfilePicChangeRemoveButton, ProfilePicChangeSelectButton, ProfilePicChangeView, ProfilePicChangeZoom, QrCodeModal, QrCodeView, Radio, RegisterButton, RegisterCompany, RegisterContainer, RegisterEmail, RegisterFirstName, RegisterJobTitle, RegisterLastName, RegisterModal, RegisterPassword, RegisterView, Select, SelectModalWithHook as SelectModal, SelectedPaymentMethod, ShopPurchaseButton, ShopSelectProductButton, ShopView, SubmitPaymentMethod, SubscriptionCancelModal, SubscriptionCreateContainer, SubscriptionCreateFreePlanButton, SubscriptionCreateModal, SubscriptionCreateView, SubscriptionManageMembersButton, SubscriptionManageMembersContainer, SubscriptionManageMembersEmails, SubscriptionManageMembersList, SubscriptionManageMembersModal, SubscriptionManageMembersView, SubscriptionRenewContainer, SubscriptionRenewModal, SubscriptionRenewView, SubscriptionSuspendContainer, SubscriptionSuspendModal, SubscriptionSuspendView, TaxAmount, TextArea, Tooltip, UserNameInput, UserUpdateButton, UserUpdateContainer, UserUpdateDisplayName, UserUpdateEmail, UserUpdateFirstName, UserUpdateLastName, UserUpdateModal, UserUpdatePhone, UserUpdateProfilePic, UserUpdateTextInput, UserUpdateTin, UserUpdateUsername, UserUpdateView, VerifyLinkTokenContainer, VerifyLinkTokenLoader, VerifyLinkTokenModal, VerifyLinkTokenView, authenticatedButtons, i18next as i18n, init$1 as initButtons, init as initContentEntitlement, invoicePaymentSubmitButton, notify$1 as notify, unauthenticatedButtons, usePelcro };
35208
+ export { AddressCreateCity, AddressCreateContainer, AddressCreateCountrySelect, AddressCreateFirstName, AddressCreateLastName, AddressCreateLine1, AddressCreateLine2, AddressCreateModal, AddressCreatePostalCode, AddressCreateSetDefault, AddressCreateStateSelect, AddressCreateSubmit, AddressCreateTextInput, AddressCreateView, AddressSelectContainer, AddressSelectList, AddressSelectModal, AddressSelectSubmit, AddressSelectView, AddressUpdateCity, AddressUpdateContainer, AddressUpdateCountrySelect, AddressUpdateFirstName, AddressUpdateLastName, AddressUpdateLine1, AddressUpdateLine2, AddressUpdateModal, AddressUpdatePostalCode, AddressUpdateSetDefault, AddressUpdateStateSelect, AddressUpdateSubmit, AddressUpdateTextInput, AddressUpdateView, AlertWithContext as Alert, Alert as AlertElement, ApplePayButton, ApplyCouponButton, Auth0LoginButton, Badge, BankAuthenticationSuccess, BankRedirection, Button, CartContainer, CartModal, CartRemoveItemButton, CartSubmit, CartTotalPrice, CartView, Checkbox, CheckoutForm, ConfirmPassword, CouponCode, CouponCodeField, DashboardWithHook as Dashboard, DashboardOpenButton, DatePicker, DiscountedPrice, Email, EmailVerifyContainer, EmailVerifyModal, EmailVerifyResendButton, EmailVerifyView, FacebookLoginButton, GiftCreateContainer, GiftCreateEmail, GiftCreateFirstName, GiftCreateLastName, GiftCreateMessage, GiftCreateModal, GiftCreateStartDate, GiftCreateSubmitButton, GiftCreateView, GiftRedeemCode, GiftRedeemContainer, GiftRedeemModal, GiftRedeemSubmitButton, GiftRedeemView, GoogleLoginButton, IncludeFirstName, IncludeLastName, IncludePhone, Input, InvoiceDetailsContainer, InvoiceDetailsDownloadButton, InvoiceDetailsModal, InvoiceDetailsPayButton, InvoiceDetailsView, InvoicePaymentContainer, InvoicePaymentModal, InvoicePaymentView, Link, LoginButton, LoginContainer, LoginEmail, LoginModal, LoginPassword, LoginRequestLoginToken, LoginUsername, LoginView, Logout, MeterModal, MeterView, Modal, ModalBody, ModalFooter, NewsletterWithHook as NewsLetter, NewsletterUpdateButton, NewsletterUpdateContainer, NewsletterUpdateList, NewsletterUpdateModal, NewsletterUpdateView, Notification, OrderConfirmModal, OrderCreateContainer, OrderCreateFreeButton, OrderCreateModal, OrderCreateSubmitButton, OrderCreateView, Password, PasswordChangeButton, PasswordChangeConfirmNewPassword, PasswordChangeContainer, PasswordChangeCurrentPassword, PasswordChangeModal, PasswordChangeNewPassword, PasswordChangeView, PasswordForgotButton, PasswordForgotContainer, PasswordForgotEmail, PasswordForgotModal, PasswordForgotView, PasswordResetButton, PasswordResetConfirmPassword, PasswordResetContainer, PasswordResetEmail, PasswordResetModal, PasswordResetPassword, PasswordResetView, PasswordlessRequestContainer, PasswordlessRequestEmail, PasswordlessRequestModal, PasswordlessRequestView, PasswordlessRequestViewButton, PaymentCreateContainer, PaymentCreateView, PaymentMethodContainer, PaymentMethodCreateContainer, PaymentMethodCreateModal, PaymentMethodCreateView, PaymentMethodDeleteContainer, PaymentMethodDeleteList, PaymentMethodDeleteModal, PaymentMethodDeleteSubmit, PaymentMethodDeleteView, PaymentMethodSelectContainer, PaymentMethodSelectList, PaymentMethodSelectModal, PaymentMethodSelectSubmit, PaymentMethodSelectView, PaymentMethodUpdateContainer, PaymentMethodUpdateModal, PaymentMethodUpdateSetDefault, PaymentMethodUpdateView, PaymentMethodView, PaymentSuccessModal, PaymentSuccessView, PaypalSubscribeButton, PelcroCardCVC, PelcroCardExpiry, PelcroCardNumber, PelcroModalController, PelcroPaymentRequestButton, ProfilePicChangeButton, ProfilePicChangeContainer, ProfilePicChangeCropper, ProfilePicChangeModal, ProfilePicChangeRemoveButton, ProfilePicChangeSelectButton, ProfilePicChangeView, ProfilePicChangeZoom, QrCodeModal, QrCodeView, Radio, RegisterButton, RegisterCompany, RegisterContainer, RegisterEmail, RegisterFirstName, RegisterJobTitle, RegisterLastName, RegisterModal, RegisterPassword, RegisterView, Select, SelectModalWithHook as SelectModal, SelectedPaymentMethod, ShopPurchaseButton, ShopSelectProductButton, ShopView, SubmitPaymentMethod, SubscriptionCancelModal, SubscriptionCreateContainer, SubscriptionCreateFreePlanButton, SubscriptionCreateModal, SubscriptionCreateView, SubscriptionManageMembersButton, SubscriptionManageMembersContainer, SubscriptionManageMembersEmails, SubscriptionManageMembersList, SubscriptionManageMembersModal, SubscriptionManageMembersView, SubscriptionRenewContainer, SubscriptionRenewModal, SubscriptionRenewView, SubscriptionSuspendContainer, SubscriptionSuspendModal, SubscriptionSuspendView, TaxAmount, TextArea, Tooltip, UserNameInput, UserUpdateButton, UserUpdateContainer, UserUpdateDisplayName, UserUpdateEmail, UserUpdateFirstName, UserUpdateLastName, UserUpdateModal, UserUpdatePhone, UserUpdateProfilePic, UserUpdateTextInput, UserUpdateTin, UserUpdateUsername, UserUpdateView, VerifyLinkTokenContainer, VerifyLinkTokenLoader, VerifyLinkTokenModal, VerifyLinkTokenView, authenticatedButtons, i18next as i18n, init$1 as initButtons, init as initContentEntitlement, invoicePaymentSubmitButton, notify$1 as notify, unauthenticatedButtons, usePelcro };