@bigbinary/neeto-payments-frontend 6.0.15 → 6.1.1

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 (217) hide show
  1. package/package.json +5 -11
  2. package/dist/AccountsDashboard.js +0 -528
  3. package/dist/AccountsDashboard.js.map +0 -1
  4. package/dist/AdminCancelRecurringPaymentButton.js +0 -80
  5. package/dist/AdminCancelRecurringPaymentButton.js.map +0 -1
  6. package/dist/CashPaymentButton.js +0 -61
  7. package/dist/CashPaymentButton.js.map +0 -1
  8. package/dist/ConfirmCashPaymentButton.js +0 -109
  9. package/dist/ConfirmCashPaymentButton.js.map +0 -1
  10. package/dist/CopyButtonWrapper-SoJkwX-d.js +0 -27
  11. package/dist/CopyButtonWrapper-SoJkwX-d.js.map +0 -1
  12. package/dist/CustomerCancelRecurringPaymentForm.js +0 -112
  13. package/dist/CustomerCancelRecurringPaymentForm.js.map +0 -1
  14. package/dist/ExportModal-BnP3xriD.js +0 -134
  15. package/dist/ExportModal-BnP3xriD.js.map +0 -1
  16. package/dist/ManualUpiConnect.js +0 -260
  17. package/dist/ManualUpiConnect.js.map +0 -1
  18. package/dist/ManualUpiPayment.js +0 -138
  19. package/dist/ManualUpiPayment.js.map +0 -1
  20. package/dist/ManualUpiPaymentConfirmButton.js +0 -171
  21. package/dist/ManualUpiPaymentConfirmButton.js.map +0 -1
  22. package/dist/ManualUpiPaymentRejectButton.js +0 -139
  23. package/dist/ManualUpiPaymentRejectButton.js.map +0 -1
  24. package/dist/PaymentKindRestrictionAlert.js +0 -39
  25. package/dist/PaymentKindRestrictionAlert.js.map +0 -1
  26. package/dist/PaymentsDashboard.js +0 -615
  27. package/dist/PaymentsDashboard.js.map +0 -1
  28. package/dist/PayoutsDashboard.js +0 -563
  29. package/dist/PayoutsDashboard.js.map +0 -1
  30. package/dist/PayoutsPage.js +0 -163
  31. package/dist/PayoutsPage.js.map +0 -1
  32. package/dist/RazorpayConnect.js +0 -119
  33. package/dist/RazorpayConnect.js.map +0 -1
  34. package/dist/RazorpayLinkedAccountForm.js +0 -225
  35. package/dist/RazorpayLinkedAccountForm.js.map +0 -1
  36. package/dist/RazorpayPaymentButton.js +0 -148
  37. package/dist/RazorpayPaymentButton.js.map +0 -1
  38. package/dist/RecurringPaymentSettings.js +0 -133
  39. package/dist/RecurringPaymentSettings.js.map +0 -1
  40. package/dist/RefundsDashboard.js +0 -534
  41. package/dist/RefundsDashboard.js.map +0 -1
  42. package/dist/SplitTransfersDashboard.js +0 -1118
  43. package/dist/SplitTransfersDashboard.js.map +0 -1
  44. package/dist/StripeCheckoutSetting.js +0 -99
  45. package/dist/StripeCheckoutSetting.js.map +0 -1
  46. package/dist/StripeConnect.js +0 -401
  47. package/dist/StripeConnect.js.map +0 -1
  48. package/dist/StripeManage.js +0 -51
  49. package/dist/StripeManage.js.map +0 -1
  50. package/dist/TaxesDashboard.js +0 -401
  51. package/dist/TaxesDashboard.js.map +0 -1
  52. package/dist/buildStripeTransactionLink.js +0 -12
  53. package/dist/buildStripeTransactionLink.js.map +0 -1
  54. package/dist/cjs/AccountsDashboard.js +0 -530
  55. package/dist/cjs/AccountsDashboard.js.map +0 -1
  56. package/dist/cjs/AdminCancelRecurringPaymentButton.js +0 -82
  57. package/dist/cjs/AdminCancelRecurringPaymentButton.js.map +0 -1
  58. package/dist/cjs/CashPaymentButton.js +0 -63
  59. package/dist/cjs/CashPaymentButton.js.map +0 -1
  60. package/dist/cjs/ConfirmCashPaymentButton.js +0 -111
  61. package/dist/cjs/ConfirmCashPaymentButton.js.map +0 -1
  62. package/dist/cjs/CopyButtonWrapper-Ds1k64E0.js +0 -30
  63. package/dist/cjs/CopyButtonWrapper-Ds1k64E0.js.map +0 -1
  64. package/dist/cjs/CustomerCancelRecurringPaymentForm.js +0 -114
  65. package/dist/cjs/CustomerCancelRecurringPaymentForm.js.map +0 -1
  66. package/dist/cjs/ExportModal-BmHgt24q.js +0 -136
  67. package/dist/cjs/ExportModal-BmHgt24q.js.map +0 -1
  68. package/dist/cjs/ManualUpiConnect.js +0 -281
  69. package/dist/cjs/ManualUpiConnect.js.map +0 -1
  70. package/dist/cjs/ManualUpiPayment.js +0 -159
  71. package/dist/cjs/ManualUpiPayment.js.map +0 -1
  72. package/dist/cjs/ManualUpiPaymentConfirmButton.js +0 -192
  73. package/dist/cjs/ManualUpiPaymentConfirmButton.js.map +0 -1
  74. package/dist/cjs/ManualUpiPaymentRejectButton.js +0 -141
  75. package/dist/cjs/ManualUpiPaymentRejectButton.js.map +0 -1
  76. package/dist/cjs/PaymentKindRestrictionAlert.js +0 -41
  77. package/dist/cjs/PaymentKindRestrictionAlert.js.map +0 -1
  78. package/dist/cjs/PaymentsDashboard.js +0 -617
  79. package/dist/cjs/PaymentsDashboard.js.map +0 -1
  80. package/dist/cjs/PayoutsDashboard.js +0 -565
  81. package/dist/cjs/PayoutsDashboard.js.map +0 -1
  82. package/dist/cjs/PayoutsPage.js +0 -165
  83. package/dist/cjs/PayoutsPage.js.map +0 -1
  84. package/dist/cjs/RazorpayConnect.js +0 -121
  85. package/dist/cjs/RazorpayConnect.js.map +0 -1
  86. package/dist/cjs/RazorpayLinkedAccountForm.js +0 -227
  87. package/dist/cjs/RazorpayLinkedAccountForm.js.map +0 -1
  88. package/dist/cjs/RazorpayPaymentButton.js +0 -150
  89. package/dist/cjs/RazorpayPaymentButton.js.map +0 -1
  90. package/dist/cjs/RecurringPaymentSettings.js +0 -154
  91. package/dist/cjs/RecurringPaymentSettings.js.map +0 -1
  92. package/dist/cjs/RefundsDashboard.js +0 -536
  93. package/dist/cjs/RefundsDashboard.js.map +0 -1
  94. package/dist/cjs/SplitTransfersDashboard.js +0 -1139
  95. package/dist/cjs/SplitTransfersDashboard.js.map +0 -1
  96. package/dist/cjs/StripeCheckoutSetting.js +0 -101
  97. package/dist/cjs/StripeCheckoutSetting.js.map +0 -1
  98. package/dist/cjs/StripeConnect.js +0 -422
  99. package/dist/cjs/StripeConnect.js.map +0 -1
  100. package/dist/cjs/StripeManage.js +0 -53
  101. package/dist/cjs/StripeManage.js.map +0 -1
  102. package/dist/cjs/TaxesDashboard.js +0 -422
  103. package/dist/cjs/TaxesDashboard.js.map +0 -1
  104. package/dist/cjs/buildStripeTransactionLink.js +0 -14
  105. package/dist/cjs/buildStripeTransactionLink.js.map +0 -1
  106. package/dist/cjs/constants.js +0 -38
  107. package/dist/cjs/constants.js.map +0 -1
  108. package/dist/cjs/dashboard-DLj_eVV0.js +0 -112
  109. package/dist/cjs/dashboard-DLj_eVV0.js.map +0 -1
  110. package/dist/cjs/exportChannel-BB1psKzT.js +0 -40
  111. package/dist/cjs/exportChannel-BB1psKzT.js.map +0 -1
  112. package/dist/cjs/getAddressElementOptions.js +0 -14
  113. package/dist/cjs/getAddressElementOptions.js.map +0 -1
  114. package/dist/cjs/getAmountInSmallestCurrencyUnit.js +0 -14
  115. package/dist/cjs/getAmountInSmallestCurrencyUnit.js.map +0 -1
  116. package/dist/cjs/getAmountWithAppliedTax.js +0 -14
  117. package/dist/cjs/getAmountWithAppliedTax.js.map +0 -1
  118. package/dist/cjs/getFormattedAmount.js +0 -14
  119. package/dist/cjs/getFormattedAmount.js.map +0 -1
  120. package/dist/cjs/getFormattedDiscountedAmount.js +0 -14
  121. package/dist/cjs/getFormattedDiscountedAmount.js.map +0 -1
  122. package/dist/cjs/getFormattedDiscountedPercentage.js +0 -14
  123. package/dist/cjs/getFormattedDiscountedPercentage.js.map +0 -1
  124. package/dist/cjs/getFormattedTaxAmount.js +0 -14
  125. package/dist/cjs/getFormattedTaxAmount.js.map +0 -1
  126. package/dist/cjs/getFormattedTipAmount.js +0 -14
  127. package/dist/cjs/getFormattedTipAmount.js.map +0 -1
  128. package/dist/cjs/getQrCodeValue.js +0 -14
  129. package/dist/cjs/getQrCodeValue.js.map +0 -1
  130. package/dist/cjs/getTaxAmount.js +0 -14
  131. package/dist/cjs/getTaxAmount.js.map +0 -1
  132. package/dist/cjs/getTipAmount.js +0 -14
  133. package/dist/cjs/getTipAmount.js.map +0 -1
  134. package/dist/cjs/hasAmountToPay.js +0 -14
  135. package/dist/cjs/hasAmountToPay.js.map +0 -1
  136. package/dist/cjs/index-KqkPP267.js +0 -892
  137. package/dist/cjs/index-KqkPP267.js.map +0 -1
  138. package/dist/cjs/index.js +0 -150
  139. package/dist/cjs/index.js.map +0 -1
  140. package/dist/cjs/queryConstants-Cka1X6GX.js +0 -35
  141. package/dist/cjs/queryConstants-Cka1X6GX.js.map +0 -1
  142. package/dist/cjs/renderFunctions-ydTbw8WO.js +0 -56
  143. package/dist/cjs/renderFunctions-ydTbw8WO.js.map +0 -1
  144. package/dist/cjs/stripe.esm-CrNYjPcC.js +0 -132
  145. package/dist/cjs/stripe.esm-CrNYjPcC.js.map +0 -1
  146. package/dist/cjs/useAccountsApi-CJf2ILqh.js +0 -62
  147. package/dist/cjs/useAccountsApi-CJf2ILqh.js.map +0 -1
  148. package/dist/cjs/useIntegrationsApi-BLP7KuIR.js +0 -26
  149. package/dist/cjs/useIntegrationsApi-BLP7KuIR.js.map +0 -1
  150. package/dist/cjs/usePaymentApi-B_4I2IeI.js +0 -41
  151. package/dist/cjs/usePaymentApi-B_4I2IeI.js.map +0 -1
  152. package/dist/cjs/usePaymentApi-Bf9f9dFY.js +0 -56
  153. package/dist/cjs/usePaymentApi-Bf9f9dFY.js.map +0 -1
  154. package/dist/cjs/usePaymentApi-C90HGytr.js +0 -39
  155. package/dist/cjs/usePaymentApi-C90HGytr.js.map +0 -1
  156. package/dist/cjs/usePlatformApi-CPdK_K-y.js +0 -84
  157. package/dist/cjs/usePlatformApi-CPdK_K-y.js.map +0 -1
  158. package/dist/cjs/useRazorpayPayment.js +0 -113
  159. package/dist/cjs/useRazorpayPayment.js.map +0 -1
  160. package/dist/cjs/useStripePromise.js +0 -57
  161. package/dist/cjs/useStripePromise.js.map +0 -1
  162. package/dist/constants.js +0 -8
  163. package/dist/constants.js.map +0 -1
  164. package/dist/dashboard-Dn2TZTXF.js +0 -106
  165. package/dist/dashboard-Dn2TZTXF.js.map +0 -1
  166. package/dist/exportChannel-h2JJKPT1.js +0 -37
  167. package/dist/exportChannel-h2JJKPT1.js.map +0 -1
  168. package/dist/getAddressElementOptions.js +0 -12
  169. package/dist/getAddressElementOptions.js.map +0 -1
  170. package/dist/getAmountInSmallestCurrencyUnit.js +0 -12
  171. package/dist/getAmountInSmallestCurrencyUnit.js.map +0 -1
  172. package/dist/getAmountWithAppliedTax.js +0 -12
  173. package/dist/getAmountWithAppliedTax.js.map +0 -1
  174. package/dist/getFormattedAmount.js +0 -12
  175. package/dist/getFormattedAmount.js.map +0 -1
  176. package/dist/getFormattedDiscountedAmount.js +0 -12
  177. package/dist/getFormattedDiscountedAmount.js.map +0 -1
  178. package/dist/getFormattedDiscountedPercentage.js +0 -12
  179. package/dist/getFormattedDiscountedPercentage.js.map +0 -1
  180. package/dist/getFormattedTaxAmount.js +0 -12
  181. package/dist/getFormattedTaxAmount.js.map +0 -1
  182. package/dist/getFormattedTipAmount.js +0 -12
  183. package/dist/getFormattedTipAmount.js.map +0 -1
  184. package/dist/getQrCodeValue.js +0 -12
  185. package/dist/getQrCodeValue.js.map +0 -1
  186. package/dist/getTaxAmount.js +0 -12
  187. package/dist/getTaxAmount.js.map +0 -1
  188. package/dist/getTipAmount.js +0 -12
  189. package/dist/getTipAmount.js.map +0 -1
  190. package/dist/hasAmountToPay.js +0 -12
  191. package/dist/hasAmountToPay.js.map +0 -1
  192. package/dist/index-Xdf4XpRc.js +0 -842
  193. package/dist/index-Xdf4XpRc.js.map +0 -1
  194. package/dist/index.js +0 -108
  195. package/dist/index.js.map +0 -1
  196. package/dist/queryConstants-DFKKEEo0.js +0 -33
  197. package/dist/queryConstants-DFKKEEo0.js.map +0 -1
  198. package/dist/renderFunctions-BCW1POD1.js +0 -52
  199. package/dist/renderFunctions-BCW1POD1.js.map +0 -1
  200. package/dist/stripe.esm-DuZ_gsAa.js +0 -130
  201. package/dist/stripe.esm-DuZ_gsAa.js.map +0 -1
  202. package/dist/useAccountsApi-qzNkKYfX.js +0 -58
  203. package/dist/useAccountsApi-qzNkKYfX.js.map +0 -1
  204. package/dist/useIntegrationsApi-DkA7eXBT.js +0 -24
  205. package/dist/useIntegrationsApi-DkA7eXBT.js.map +0 -1
  206. package/dist/usePaymentApi-B1qMca2A.js +0 -53
  207. package/dist/usePaymentApi-B1qMca2A.js.map +0 -1
  208. package/dist/usePaymentApi-D8FEXicG.js +0 -37
  209. package/dist/usePaymentApi-D8FEXicG.js.map +0 -1
  210. package/dist/usePaymentApi-jZmkutky.js +0 -38
  211. package/dist/usePaymentApi-jZmkutky.js.map +0 -1
  212. package/dist/usePlatformApi-0sGcYfsx.js +0 -79
  213. package/dist/usePlatformApi-0sGcYfsx.js.map +0 -1
  214. package/dist/useRazorpayPayment.js +0 -111
  215. package/dist/useRazorpayPayment.js.map +0 -1
  216. package/dist/useStripePromise.js +0 -55
  217. package/dist/useStripePromise.js.map +0 -1
@@ -1,82 +0,0 @@
1
- 'use strict';
2
-
3
- var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
4
- var react = require('react');
5
- var Button = require('@bigbinary/neetoui/Button');
6
- var Alert = require('@bigbinary/neetoui/Alert');
7
- var reactI18next = require('react-i18next');
8
- var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
9
- var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
10
- var axios = require('axios');
11
- var constants = require('./index-KqkPP267.js');
12
- var jsxRuntime = require('react/jsx-runtime');
13
- require('i18next');
14
- require('@bigbinary/neeto-commons-frontend/constants');
15
- require('decimal.js');
16
- require('@bigbinary/neeto-cist');
17
- require('@bigbinary/neeto-commons-frontend/utils');
18
- require('ramda');
19
-
20
- var update = function update(_ref) {
21
- var id = _ref.id,
22
- payload = _ref.payload;
23
- return axios.put("".concat(constants.BASE_URL, "/api/v1/recurring_payments/").concat(id), {
24
- recurring_payment: payload
25
- });
26
- };
27
- var recurringPaymentsApi = {
28
- update: update
29
- };
30
-
31
- var useUpdateRecurringPayments = function useUpdateRecurringPayments() {
32
- var keysToInvalidate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
33
- return reactUtils.useMutationWithInvalidation(recurringPaymentsApi.update, {
34
- keysToInvalidate: _toConsumableArray(keysToInvalidate)
35
- });
36
- };
37
-
38
- var AdminCancelRecurringPaymentButton = function AdminCancelRecurringPaymentButton(_ref) {
39
- var id = _ref.id,
40
- _ref$style = _ref.style,
41
- style = _ref$style === void 0 ? "primary" : _ref$style,
42
- _ref$keysToInvalidate = _ref.keysToInvalidate,
43
- keysToInvalidate = _ref$keysToInvalidate === void 0 ? [] : _ref$keysToInvalidate;
44
- var _useState = react.useState(false),
45
- _useState2 = _slicedToArray(_useState, 2),
46
- isAlertOpen = _useState2[0],
47
- setIsAlertOpen = _useState2[1];
48
- var _useUpdateRecurringPa = useUpdateRecurringPayments(keysToInvalidate),
49
- isPending = _useUpdateRecurringPa.isPending,
50
- updateRecurringPayment = _useUpdateRecurringPa.mutate;
51
- var _useTranslation = reactI18next.useTranslation(),
52
- t = _useTranslation.t;
53
- return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
54
- children: [/*#__PURE__*/jsxRuntime.jsx(Button, {
55
- style: style,
56
- label: t("neetoPayments.recurringPaymentCancel.buttonLabel"),
57
- onClick: function onClick() {
58
- return setIsAlertOpen(true);
59
- }
60
- }), /*#__PURE__*/jsxRuntime.jsx(Alert, {
61
- isOpen: isAlertOpen,
62
- isSubmitting: isPending,
63
- message: t("neetoPayments.recurringPaymentCancel.alertMessage"),
64
- submitButtonLabel: t("neetoPayments.common.continue"),
65
- title: t("neetoPayments.recurringPaymentCancel.alertTitle"),
66
- onClose: function onClose() {
67
- return setIsAlertOpen(false);
68
- },
69
- onSubmit: function onSubmit() {
70
- return updateRecurringPayment({
71
- id: id,
72
- payload: {
73
- status: "cancelled"
74
- }
75
- });
76
- }
77
- })]
78
- });
79
- };
80
-
81
- module.exports = AdminCancelRecurringPaymentButton;
82
- //# sourceMappingURL=AdminCancelRecurringPaymentButton.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AdminCancelRecurringPaymentButton.js","sources":["../../app/javascript/src/apis/recurring_payments.js","../../app/javascript/src/hooks/reactQuery/useRecurringPaymentsApi.js","../../app/javascript/src/components/AdminCancelRecurringPaymentButton/index.jsx"],"sourcesContent":["import axios from \"axios\";\n\nimport { BASE_URL } from \"src/constants\";\n\nconst update = ({ id, payload }) =>\n axios.put(`${BASE_URL}/api/v1/recurring_payments/${id}`, {\n recurring_payment: payload,\n });\n\nconst recurringPaymentsApi = { update };\n\nexport default recurringPaymentsApi;\n","import { useMutationWithInvalidation } from \"neetocommons/react-utils\";\n\nimport recurringPaymentsApi from \"apis/recurring_payments\";\n\nexport const useUpdateRecurringPayments = (keysToInvalidate = []) =>\n useMutationWithInvalidation(recurringPaymentsApi.update, {\n keysToInvalidate: [...keysToInvalidate],\n });\n","import { useState } from \"react\";\n\nimport { Button, Alert } from \"neetoui\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useUpdateRecurringPayments } from \"hooks/reactQuery/useRecurringPaymentsApi\";\n\nconst AdminCancelRecurringPaymentButton = ({\n id,\n style = \"primary\",\n keysToInvalidate = [],\n}) => {\n const [isAlertOpen, setIsAlertOpen] = useState(false);\n const { isPending, mutate: updateRecurringPayment } =\n useUpdateRecurringPayments(keysToInvalidate);\n\n const { t } = useTranslation();\n\n return (\n <>\n <Button\n {...{ style }}\n label={t(\"neetoPayments.recurringPaymentCancel.buttonLabel\")}\n onClick={() => setIsAlertOpen(true)}\n />\n <Alert\n isOpen={isAlertOpen}\n isSubmitting={isPending}\n message={t(\"neetoPayments.recurringPaymentCancel.alertMessage\")}\n submitButtonLabel={t(\"neetoPayments.common.continue\")}\n title={t(\"neetoPayments.recurringPaymentCancel.alertTitle\")}\n onClose={() => setIsAlertOpen(false)}\n onSubmit={() =>\n updateRecurringPayment({ id, payload: { status: \"cancelled\" } })\n }\n />\n </>\n );\n};\n\nexport default AdminCancelRecurringPaymentButton;\n"],"names":["update","_ref","id","payload","axios","put","concat","BASE_URL","recurring_payment","recurringPaymentsApi","useUpdateRecurringPayments","keysToInvalidate","arguments","length","undefined","useMutationWithInvalidation","_toConsumableArray","AdminCancelRecurringPaymentButton","_ref$style","style","_ref$keysToInvalidate","_useState","useState","_useState2","_slicedToArray","isAlertOpen","setIsAlertOpen","_useUpdateRecurringPa","isPending","updateRecurringPayment","mutate","_useTranslation","useTranslation","t","_jsxs","_Fragment","children","_jsx","Button","label","onClick","Alert","isOpen","isSubmitting","message","submitButtonLabel","title","onClose","onSubmit","status"],"mappings":";;;;;;;;;;;;;;;;;;;AAIA,IAAMA,MAAM,GAAG,SAATA,MAAMA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,EAAE,GAAAD,IAAA,CAAFC,EAAE;IAAEC,OAAO,GAAAF,IAAA,CAAPE,OAAO;EAAA,OAC3BC,KAAK,CAACC,GAAG,CAAAC,EAAAA,CAAAA,MAAA,CAAIC,kBAAQ,EAAAD,6BAAAA,CAAAA,CAAAA,MAAA,CAA8BJ,EAAE,CAAI,EAAA;AACvDM,IAAAA,iBAAiB,EAAEL;AACrB,GAAC,CAAC;AAAA,CAAA;AAEJ,IAAMM,oBAAoB,GAAG;AAAET,EAAAA,MAAM,EAANA;AAAO,CAAC;;ACLhC,IAAMU,0BAA0B,GAAG,SAA7BA,0BAA0BA,GAAA;AAAA,EAAA,IAAIC,gBAAgB,GAAAC,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,EAAE;AAAA,EAAA,OAC9DG,sCAA2B,CAACN,oBAAoB,CAACT,MAAM,EAAE;IACvDW,gBAAgB,EAAAK,kBAAA,CAAML,gBAAgB;AACxC,GAAC,CAAC;AAAA,CAAA;;ACAJ,IAAMM,iCAAiC,GAAG,SAApCA,iCAAiCA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EZ,CAAC,CAAC,+BAA+B,CAAE;AACtDa,MAAAA,KAAK,EAAEb,CAAC,CAAC,iDAAiD,CAAE;MAC5Dc,OAAO,EAAE,SAATA,OAAOA,GAAA;QAAA,OAAQrB,cAAc,CAAC,KAAK,CAAC;OAAC;MACrCsB,QAAQ,EAAE,SAAVA,QAAQA,GAAA;AAAA,QAAA,OACNnB,sBAAsB,CAAC;AAAE3B,UAAAA,EAAE,EAAFA,EAAE;AAAEC,UAAAA,OAAO,EAAE;AAAE8C,YAAAA,MAAM,EAAE;AAAY;AAAE,SAAC,CAAC;AAAA;AACjE,KACF,CAAC;AAAA,GACF,CAAC;AAEP;;;;"}
@@ -1,63 +0,0 @@
1
- 'use strict';
2
-
3
- var neetoCist = require('@bigbinary/neeto-cist');
4
- var Button = require('@bigbinary/neetoui/Button');
5
- var reactI18next = require('react-i18next');
6
- var usePaymentApi = require('./usePaymentApi-B_4I2IeI.js');
7
- var jsxRuntime = require('react/jsx-runtime');
8
- require('@babel/runtime/helpers/defineProperty');
9
- require('@tanstack/react-query');
10
- require('axios');
11
- require('./index-KqkPP267.js');
12
- require('i18next');
13
- require('@bigbinary/neeto-commons-frontend/constants');
14
- require('decimal.js');
15
- require('@bigbinary/neeto-commons-frontend/utils');
16
- require('ramda');
17
-
18
- var CashPaymentButton = function CashPaymentButton(_ref) {
19
- var label = _ref.label,
20
- payableId = _ref.payableId,
21
- payableType = _ref.payableType,
22
- tip = _ref.tip,
23
- discountCode = _ref.discountCode,
24
- customAmount = _ref.customAmount,
25
- _ref$isDisabled = _ref.isDisabled,
26
- isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
27
- _ref$isLoading = _ref.isLoading,
28
- isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
29
- _ref$onBeforePayment = _ref.onBeforePayment,
30
- onBeforePayment = _ref$onBeforePayment === void 0 ? neetoCist.noop : _ref$onBeforePayment,
31
- _ref$onFailedPayment = _ref.onFailedPayment,
32
- onFailedPayment = _ref$onFailedPayment === void 0 ? neetoCist.noop : _ref$onFailedPayment,
33
- _ref$onSuccessfulPaym = _ref.onSuccessfulPayment,
34
- onSuccessfulPayment = _ref$onSuccessfulPaym === void 0 ? neetoCist.noop : _ref$onSuccessfulPaym;
35
- var _useTranslation = reactI18next.useTranslation(),
36
- t = _useTranslation.t;
37
- var _useCreateCashPayment = usePaymentApi.useCreateCashPayment({
38
- onSuccess: onSuccessfulPayment,
39
- onError: onFailedPayment
40
- }),
41
- isPending = _useCreateCashPayment.isPending,
42
- createCashPayment = _useCreateCashPayment.mutate;
43
- var handleSubmit = function handleSubmit() {
44
- onBeforePayment();
45
- createCashPayment({
46
- payableId: payableId,
47
- payableType: payableType,
48
- discountCode: discountCode,
49
- customAmount: customAmount,
50
- tipAttributes: tip
51
- });
52
- };
53
- return /*#__PURE__*/jsxRuntime.jsx(Button, {
54
- "data-cy": "payment-submit-button",
55
- disabled: isPending || isDisabled,
56
- label: label || t("neetoPayments.common.proceed"),
57
- loading: isPending || isLoading,
58
- onClick: handleSubmit
59
- });
60
- };
61
-
62
- module.exports = CashPaymentButton;
63
- //# sourceMappingURL=CashPaymentButton.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CashPaymentButton.js","sources":["../../app/javascript/src/components/CashPaymentButton.jsx"],"sourcesContent":["import { noop } from \"neetocist\";\nimport { Button } from \"neetoui\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useCreateCashPayment } from \"hooks/reactQuery/cash/usePaymentApi\";\n\nconst CashPaymentButton = ({\n label,\n payableId,\n payableType,\n tip,\n discountCode,\n customAmount,\n isDisabled = false,\n isLoading = false,\n onBeforePayment = noop,\n onFailedPayment = noop,\n onSuccessfulPayment = noop,\n}) => {\n const { t } = useTranslation();\n\n const { isPending, mutate: createCashPayment } = useCreateCashPayment({\n onSuccess: onSuccessfulPayment,\n onError: onFailedPayment,\n });\n\n const handleSubmit = () => {\n onBeforePayment();\n createCashPayment({\n payableId,\n payableType,\n discountCode,\n customAmount,\n tipAttributes: tip,\n });\n };\n\n return (\n <Button\n data-cy=\"payment-submit-button\"\n disabled={isPending || isDisabled}\n label={label || t(\"neetoPayments.common.proceed\")}\n loading={isPending || isLoading}\n onClick={handleSubmit}\n />\n );\n};\n\nexport default CashPaymentButton;\n"],"names":["CashPaymentButton","_ref","label","payableId","payableType","tip","discountCode","customAmount","_ref$isDisabled","isDisabled","_ref$isLoading","isLoading","_ref$onBeforePayment","onBeforePayment","noop","_ref$onFailedPayment","onFailedPayment","_ref$onSuccessfulPaym","onSuccessfulPayment","_useTranslation","useTranslation","t","_useCreateCashPayment","useCreateCashPayment","onSuccess","onError","isPending","createCashPayment","mutate","handleSubmit","tipAttributes","_jsx","Button","disabled","loading","onClick"],"mappings":";;;;;;;;;;;;;;;;;AAMA,IAAMA,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAAC,IAAA,EAYjB;AAAA,EAAA,IAXJC,KAAK,GAAAD,IAAA,CAALC,KAAK;IACLC,SAAS,GAAAF,IAAA,CAATE,SAAS;IACTC,WAAW,GAAAH,IAAA,CAAXG,WAAW;IACXC,GAAG,GAAAJ,IAAA,CAAHI,GAAG;IACHC,YAAY,GAAAL,IAAA,CAAZK,YAAY;IACZC,YAAY,GAAAN,IAAA,CAAZM,YAAY;IAAAC,eAAA,GAAAP,IAAA,CACZQ,UAAU;AAAVA,IAAAA,UAAU,GAAAD,eAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,eAAA;IAAAE,cAAA,GAAAT,IAAA,CAClBU,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,cAAA;IAAAE,oBAAA,GAAAX,IAAA,CACjBY,eAAe;AAAfA,IAAAA,eAAe,GAAAD,oBAAA,KAAGE,KAAAA,CAAAA,GAAAA,cAAI,GAAAF,oBAAA;IAAAG,oBAAA,GAAAd,IAAA,CACtBe,eAAe;AAAfA,IAAAA,eAAe,GAAAD,oBAAA,KAAGD,KAAAA,CAAAA,GAAAA,cAAI,GAAAC,oBAAA;IAAAE,qBAAA,GAAAhB,IAAA,CACtBiB,mBAAmB;AAAnBA,IAAAA,mBAAmB,GAAAD,qBAAA,KAAGH,KAAAA,CAAAA,GAAAA,cAAI,GAAAG,qBAAA;AAE1B,EAAA,IAAAE,eAAA,GAAcC,2BAAc,EAAE;IAAtBC,CAAC,GAAAF,eAAA,CAADE,CAAC;EAET,IAAAC,qBAAA,GAAiDC,kCAAoB,CAAC;AACpEC,MAAAA,SAAS,EAAEN,mBAAmB;AAC9BO,MAAAA,OAAO,EAAET;AACX,KAAC,CAAC;IAHMU,SAAS,GAAAJ,qBAAA,CAATI,SAAS;IAAUC,iBAAiB,GAAAL,qBAAA,CAAzBM,MAAM;AAKzB,EAAA,IAAMC,YAAY,GAAG,SAAfA,YAAYA,GAAS;AACzBhB,IAAAA,eAAe,EAAE;AACjBc,IAAAA,iBAAiB,CAAC;AAChBxB,MAAAA,SAAS,EAATA,SAAS;AACTC,MAAAA,WAAW,EAAXA,WAAW;AACXE,MAAAA,YAAY,EAAZA,YAAY;AACZC,MAAAA,YAAY,EAAZA,YAAY;AACZuB,MAAAA,aAAa,EAAEzB;AACjB,KAAC,CAAC;GACH;EAED,oBACE0B,cAAA,CAACC,MAAM,EAAA;AACL,IAAA,SAAA,EAAQ,uBAAuB;IAC/BC,QAAQ,EAAEP,SAAS,IAAIjB,UAAW;AAClCP,IAAAA,KAAK,EAAEA,KAAK,IAAImB,CAAC,CAAC,8BAA8B,CAAE;IAClDa,OAAO,EAAER,SAAS,IAAIf,SAAU;AAChCwB,IAAAA,OAAO,EAAEN;AAAa,GACvB,CAAC;AAEN;;;;"}
@@ -1,111 +0,0 @@
1
- 'use strict';
2
-
3
- var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
4
- var react = require('react');
5
- var neetoCist = require('@bigbinary/neeto-cist');
6
- var Button = require('@bigbinary/neetoui/Button');
7
- var Modal = require('@bigbinary/neetoui/Modal');
8
- var Typography = require('@bigbinary/neetoui/Typography');
9
- var Form = require('@bigbinary/neetoui/formik/Form');
10
- var Textarea = require('@bigbinary/neetoui/formik/Textarea');
11
- var ActionBlock = require('@bigbinary/neetoui/formik/ActionBlock');
12
- var reactI18next = require('react-i18next');
13
- var usePaymentApi = require('./usePaymentApi-B_4I2IeI.js');
14
- var jsxRuntime = require('react/jsx-runtime');
15
- require('@babel/runtime/helpers/defineProperty');
16
- require('@tanstack/react-query');
17
- require('axios');
18
- require('./index-KqkPP267.js');
19
- require('i18next');
20
- require('@bigbinary/neeto-commons-frontend/constants');
21
- require('decimal.js');
22
- require('@bigbinary/neeto-commons-frontend/utils');
23
- require('ramda');
24
-
25
- var ConfirmCashPaymentButton = function ConfirmCashPaymentButton(_ref) {
26
- var paymentId = _ref.paymentId,
27
- payableId = _ref.payableId,
28
- _ref$onSuccess = _ref.onSuccess,
29
- onSuccess = _ref$onSuccess === void 0 ? neetoCist.noop : _ref$onSuccess;
30
- var _useState = react.useState(false),
31
- _useState2 = _slicedToArray(_useState, 2),
32
- isModalOpen = _useState2[0],
33
- setIsModalOpen = _useState2[1];
34
- var _useTranslation = reactI18next.useTranslation(),
35
- t = _useTranslation.t;
36
- var _useUpdateCashPayment = usePaymentApi.useUpdateCashPayment(paymentId, {
37
- onSuccess: onSuccess
38
- }),
39
- updateUpiPayment = _useUpdateCashPayment.mutate,
40
- isPending = _useUpdateCashPayment.isPending;
41
- var onClose = function onClose() {
42
- return setIsModalOpen(false);
43
- };
44
- var handleSubmit = function handleSubmit(_ref2) {
45
- var notes = _ref2.notes;
46
- var payload = {
47
- notes: notes,
48
- payableId: payableId,
49
- status: "successful"
50
- };
51
- updateUpiPayment(payload);
52
- };
53
- return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
54
- children: [/*#__PURE__*/jsxRuntime.jsx(Button, {
55
- "data-cy": "confirm-cash-payment-button",
56
- label: t("neetoPayments.common.confirmPayment"),
57
- loading: isPending,
58
- size: "small",
59
- onClick: function onClick() {
60
- return setIsModalOpen(true);
61
- }
62
- }), /*#__PURE__*/jsxRuntime.jsxs(Modal, {
63
- onClose: onClose,
64
- isOpen: isModalOpen,
65
- size: "large",
66
- children: [/*#__PURE__*/jsxRuntime.jsx(Modal.Header, {
67
- children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
68
- style: "h2",
69
- children: t("neetoPayments.cash.confirmModal.title")
70
- })
71
- }), /*#__PURE__*/jsxRuntime.jsx(Form, {
72
- formikProps: {
73
- initialValues: {
74
- notes: ""
75
- },
76
- onSubmit: handleSubmit
77
- },
78
- children: function children(_ref3) {
79
- var isSubmitting = _ref3.isSubmitting;
80
- return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
81
- children: [/*#__PURE__*/jsxRuntime.jsx(Modal.Body, {
82
- children: /*#__PURE__*/jsxRuntime.jsx(Textarea, {
83
- "data-cy": "confirm-booking-modal-input-textfield",
84
- label: t("neetoPayments.cash.confirmModal.notes"),
85
- name: "notes",
86
- placeholder: t("neetoPayments.cash.confirmModal.notesPlaceholder")
87
- })
88
- }), /*#__PURE__*/jsxRuntime.jsx(Modal.Footer, {
89
- className: "space-x-2",
90
- children: /*#__PURE__*/jsxRuntime.jsx(ActionBlock, {
91
- isSubmitting: isPending,
92
- position: "right",
93
- cancelButtonProps: {
94
- onClick: onClose,
95
- style: "tertiary"
96
- },
97
- submitButtonProps: {
98
- disabled: isSubmitting || isPending,
99
- label: t("neetoPayments.common.confirm")
100
- }
101
- })
102
- })]
103
- });
104
- }
105
- })]
106
- })]
107
- });
108
- };
109
-
110
- module.exports = ConfirmCashPaymentButton;
111
- //# sourceMappingURL=ConfirmCashPaymentButton.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ConfirmCashPaymentButton.js","sources":["../../app/javascript/src/components/ConfirmCashPaymentButton.jsx"],"sourcesContent":["import { useState } from \"react\";\n\nimport { noop } from \"neetocist\";\nimport { Button, Modal, Typography } from \"neetoui\";\nimport { Form, Textarea, ActionBlock } from \"neetoui/formik\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useUpdateCashPayment } from \"hooks/reactQuery/cash/usePaymentApi\";\n\nconst ConfirmCashPaymentButton = ({\n paymentId,\n payableId,\n onSuccess = noop,\n}) => {\n const [isModalOpen, setIsModalOpen] = useState(false);\n\n const { t } = useTranslation();\n\n const { mutate: updateUpiPayment, isPending } = useUpdateCashPayment(\n paymentId,\n { onSuccess }\n );\n\n const onClose = () => setIsModalOpen(false);\n\n const handleSubmit = ({ notes }) => {\n const payload = { notes, payableId, status: \"successful\" };\n updateUpiPayment(payload);\n };\n\n return (\n <>\n <Button\n data-cy=\"confirm-cash-payment-button\"\n label={t(\"neetoPayments.common.confirmPayment\")}\n loading={isPending}\n size=\"small\"\n onClick={() => setIsModalOpen(true)}\n />\n <Modal {...{ onClose }} isOpen={isModalOpen} size=\"large\">\n <Modal.Header>\n <Typography style=\"h2\">\n {t(\"neetoPayments.cash.confirmModal.title\")}\n </Typography>\n </Modal.Header>\n <Form\n formikProps={{\n initialValues: { notes: \"\" },\n onSubmit: handleSubmit,\n }}\n >\n {({ isSubmitting }) => (\n <>\n <Modal.Body>\n <Textarea\n data-cy=\"confirm-booking-modal-input-textfield\"\n label={t(\"neetoPayments.cash.confirmModal.notes\")}\n name=\"notes\"\n placeholder={t(\n \"neetoPayments.cash.confirmModal.notesPlaceholder\"\n )}\n />\n </Modal.Body>\n <Modal.Footer className=\"space-x-2\">\n <ActionBlock\n isSubmitting={isPending}\n position=\"right\"\n cancelButtonProps={{\n onClick: onClose,\n style: \"tertiary\",\n }}\n submitButtonProps={{\n disabled: isSubmitting || isPending,\n label: t(\"neetoPayments.common.confirm\"),\n }}\n />\n </Modal.Footer>\n </>\n )}\n </Form>\n </Modal>\n </>\n );\n};\n\nexport default ConfirmCashPaymentButton;\n"],"names":["ConfirmCashPaymentButton","_ref","paymentId","payableId","_ref$onSuccess","onSuccess","noop","_useState","useState","_useState2","_slicedToArray","isModalOpen","setIsModalOpen","_useTranslation","useTranslation","t","_useUpdateCashPayment","useUpdateCashPayment","updateUpiPayment","mutate","isPending","onClose","handleSubmit","_ref2","notes","payload","status","_jsxs","_Fragment","children","_jsx","Button","label","loading","size","onClick","Modal","isOpen","Header","Typography","style","Form","formikProps","initialValues","onSubmit","_ref3","isSubmitting","Body","Textarea","name","placeholder","Footer","className","ActionBlock","position","cancelButtonProps","submitButtonProps","disabled"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AASA,IAAMA,wBAAwB,GAAG,SAA3BA,wBAAwBA,CAAAC,IAAA,EAIxB;AAAA,EAAA,IAHJC,SAAS,GAAAD,IAAA,CAATC,SAAS;IACTC,SAAS,GAAAF,IAAA,CAATE,SAAS;IAAAC,cAAA,GAAAH,IAAA,CACTI,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAGE,KAAAA,CAAAA,GAAAA,cAAI,GAAAF,cAAA;AAEhB,EAAA,IAAAG,SAAA,GAAsCC,cAAQ,CAAC,KAAK,CAAC;IAAAC,UAAA,GAAAC,cAAA,CAAAH,SAAA,EAAA,CAAA,CAAA;AAA9CI,IAAAA,WAAW,GAAAF,UAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,cAAc,GAAAH,UAAA,CAAA,CAAA,CAAA;AAElC,EAAA,IAAAI,eAAA,GAAcC,2BAAc,EAAE;IAAtBC,CAAC,GAAAF,eAAA,CAADE,CAAC;AAET,EAAA,IAAAC,qBAAA,GAAgDC,kCAAoB,CAClEf,SAAS,EACT;AAAEG,MAAAA,SAAS,EAATA;AAAU,KACd,CAAC;IAHea,gBAAgB,GAAAF,qBAAA,CAAxBG,MAAM;IAAoBC,SAAS,GAAAJ,qBAAA,CAATI,SAAS;AAK3C,EAAA,IAAMC,OAAO,GAAG,SAAVA,OAAOA,GAAA;IAAA,OAAST,cAAc,CAAC,KAAK,CAAC;AAAA,GAAA;AAE3C,EAAA,IAAMU,YAAY,GAAG,SAAfA,YAAYA,CAAAC,KAAA,EAA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C,cAAAA,cAAA,CAACM,KAAK,CAACW,IAAI,EAAA;cAAAlB,QAAA,eACTC,cAAA,CAACkB,QAAQ,EAAA;AACP,gBAAA,SAAA,EAAQ,uCAAuC;AAC/ChB,gBAAAA,KAAK,EAAEjB,CAAC,CAAC,uCAAuC,CAAE;AAClDkC,gBAAAA,IAAI,EAAC,OAAO;gBACZC,WAAW,EAAEnC,CAAC,CACZ,kDACF;eACD;AAAC,aACQ,CAAC,eACbe,cAAA,CAACM,KAAK,CAACe,MAAM,EAAA;AAACC,cAAAA,SAAS,EAAC,WAAW;cAAAvB,QAAA,eACjCC,cAAA,CAACuB,WAAW,EAAA;AACVP,gBAAAA,YAAY,EAAE1B,SAAU;AACxBkC,gBAAAA,QAAQ,EAAC,OAAO;AAChBC,gBAAAA,iBAAiB,EAAE;AACjBpB,kBAAAA,OAAO,EAAEd,OAAO;AAChBmB,kBAAAA,KAAK,EAAE;iBACP;AACFgB,gBAAAA,iBAAiB,EAAE;kBACjBC,QAAQ,EAAEX,YAAY,IAAI1B,SAAS;kBACnCY,KAAK,EAAEjB,CAAC,CAAC,8BAA8B;AACzC;eACD;AAAC,aACU,CAAC;AAAA,WACf,CAAC;AAAA;AACJ,OACG,CAAC;AAAA,KACF,CAAC;AAAA,GACR,CAAC;AAEP;;;;"}
@@ -1,30 +0,0 @@
1
- 'use strict';
2
-
3
- var neetoCist = require('@bigbinary/neeto-cist');
4
- var CopyToClipboardButton = require('@bigbinary/neeto-molecules/CopyToClipboardButton');
5
- var jsxRuntime = require('react/jsx-runtime');
6
-
7
- var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
8
-
9
- var css = ".ant-table-cell-row-hover .identifier-copy-button{visibility:visible!important}";
10
- n(css,{});
11
-
12
- var CopyButtonWrapper = function CopyButtonWrapper(_ref) {
13
- var content = _ref.content,
14
- children = _ref.children;
15
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
16
- className: "flex items-center space-x-2",
17
- children: [children, neetoCist.isPresent(content) && /*#__PURE__*/jsxRuntime.jsx("div", {
18
- className: "identifier-copy-button invisible",
19
- children: /*#__PURE__*/jsxRuntime.jsx(CopyToClipboardButton, {
20
- size: "small",
21
- style: "text",
22
- value: content
23
- })
24
- })]
25
- });
26
- };
27
-
28
- exports.CopyButtonWrapper = CopyButtonWrapper;
29
- exports.n = n;
30
- //# sourceMappingURL=CopyButtonWrapper-Ds1k64E0.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CopyButtonWrapper-Ds1k64E0.js","sources":["../../node_modules/rollup-plugin-styles/dist/runtime/inject-css.js","../../app/javascript/src/components/Common/CopyButtonWrapper.jsx"],"sourcesContent":["var e=[],t=[];function n(n,r){if(n&&\"undefined\"!=typeof document){var a,s=!0===r.prepend?\"prepend\":\"append\",d=!0===r.singleTag,i=\"string\"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName(\"head\")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c()}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n))}function c(){var e=document.createElement(\"style\");if(e.setAttribute(\"type\",\"text/css\"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a=\"prepend\"===s?\"afterbegin\":\"beforeend\";return i.insertAdjacentElement(a,e),e}}export{n as default};\n","import { isPresent } from \"neetocist\";\nimport CopyToClipboardButton from \"neetomolecules/CopyToClipboardButton\";\n\n// eslint-disable-next-line import/extensions\nimport \"stylesheets/components/copy-button.css\";\n\nconst CopyButtonWrapper = ({ content, children }) => (\n <div className=\"flex items-center space-x-2\">\n {children}\n {isPresent(content) && (\n <div className=\"identifier-copy-button invisible\">\n <CopyToClipboardButton size=\"small\" style=\"text\" value={content} />\n </div>\n )}\n </div>\n);\n\nexport default CopyButtonWrapper;\n"],"names":["CopyButtonWrapper","_ref","content","children","_jsxs","className","isPresent","_jsx","CopyToClipboardButton","size","style","value"],"mappings":";;;;;;AAAA,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,OAAO,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC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;AAAA,EAAA,oBAC5CC,eAAA,CAAA,KAAA,EAAA;AAAKC,IAAAA,SAAS,EAAC,6BAA6B;IAAAF,QAAA,EAAA,CACzCA,QAAQ,EACRG,mBAAS,CAACJ,OAAO,CAAC,iBACjBK,cAAA,CAAA,KAAA,EAAA;AAAKF,MAAAA,SAAS,EAAC,kCAAkC;MAAAF,QAAA,eAC/CI,cAAA,CAACC,qBAAqB,EAAA;AAACC,QAAAA,IAAI,EAAC,OAAO;AAACC,QAAAA,KAAK,EAAC,MAAM;AAACC,QAAAA,KAAK,EAAET;OAAU;AAAC,KAChE,CACN;AAAA,GACE,CAAC;AAAA;;;;;","x_google_ignoreList":[0]}
@@ -1,114 +0,0 @@
1
- 'use strict';
2
-
3
- var Typography = require('@bigbinary/neetoui/Typography');
4
- var Spinner = require('@bigbinary/neetoui/Spinner');
5
- var Form = require('@bigbinary/neetoui/formik/Form');
6
- var Textarea = require('@bigbinary/neetoui/formik/Textarea');
7
- var Button = require('@bigbinary/neetoui/formik/Button');
8
- var reactI18next = require('react-i18next');
9
- var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
10
- var axios = require('axios');
11
- var constants = require('./index-KqkPP267.js');
12
- var reactQuery = require('@tanstack/react-query');
13
- var ramda = require('ramda');
14
- var queryConstants = require('./queryConstants-Cka1X6GX.js');
15
- var jsxRuntime = require('react/jsx-runtime');
16
- require('i18next');
17
- require('@bigbinary/neeto-commons-frontend/constants');
18
- require('decimal.js');
19
- require('@bigbinary/neeto-cist');
20
- require('@bigbinary/neeto-commons-frontend/utils');
21
-
22
- var show = function show(payableId) {
23
- return axios.get("".concat(constants.BASE_URL, "/api/v1/public/recurring_payments/").concat(payableId));
24
- };
25
- var update = function update(_ref) {
26
- var payableId = _ref.payableId,
27
- payload = _ref.payload;
28
- return axios.put("".concat(constants.BASE_URL, "/api/v1/public/recurring_payments/").concat(payableId), {
29
- recurring_payment: payload
30
- });
31
- };
32
- var recurringPaymentsApi = {
33
- show: show,
34
- update: update
35
- };
36
-
37
- var useFetchRecurringPayment = function useFetchRecurringPayment(payableId) {
38
- return reactQuery.useQuery({
39
- queryKey: [queryConstants.QUERY_KEYS.RECURRING_PAYMENT, payableId],
40
- queryFn: function queryFn() {
41
- return recurringPaymentsApi.show(payableId);
42
- },
43
- enabled: ramda.isNotNil(payableId)
44
- });
45
- };
46
- var useUpdateRecurringPayments = function useUpdateRecurringPayments(payableId) {
47
- return reactUtils.useMutationWithInvalidation(recurringPaymentsApi.update, {
48
- keysToInvalidate: [queryConstants.QUERY_KEYS.RECURRING_PAYMENT, payableId]
49
- });
50
- };
51
-
52
- var CustomerCancelRecurringPaymentForm = function CustomerCancelRecurringPaymentForm(_ref) {
53
- var payableId = _ref.payableId;
54
- var _useTranslation = reactI18next.useTranslation(),
55
- t = _useTranslation.t;
56
- var _useFetchRecurringPay = useFetchRecurringPayment(payableId),
57
- isLoading = _useFetchRecurringPay.isLoading,
58
- _useFetchRecurringPay2 = _useFetchRecurringPay.data,
59
- _useFetchRecurringPay3 = _useFetchRecurringPay2 === void 0 ? {} : _useFetchRecurringPay2,
60
- recurringPayment = _useFetchRecurringPay3.recurringPayment;
61
- var _useUpdateRecurringPa = useUpdateRecurringPayments(payableId),
62
- isPending = _useUpdateRecurringPa.isPending,
63
- updateRecurringPayment = _useUpdateRecurringPa.mutate;
64
- if (isLoading) {
65
- return /*#__PURE__*/jsxRuntime.jsx("div", {
66
- className: "flex h-full w-full items-center justify-center",
67
- children: /*#__PURE__*/jsxRuntime.jsx(Spinner, {})
68
- });
69
- }
70
- if ((recurringPayment === null || recurringPayment === void 0 ? void 0 : recurringPayment.status) === "cancelled") {
71
- return /*#__PURE__*/jsxRuntime.jsx("div", {
72
- className: "flex h-full w-full items-center justify-center",
73
- children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
74
- children: t("neetoPayments.recurringPaymentCancel.message")
75
- })
76
- });
77
- }
78
- return /*#__PURE__*/jsxRuntime.jsx("div", {
79
- className: "flex h-full w-full items-center justify-center",
80
- children: /*#__PURE__*/jsxRuntime.jsxs(Form, {
81
- className: "space-y-6",
82
- formikProps: {
83
- onSubmit: function onSubmit(_ref2) {
84
- var cancelReason = _ref2.cancelReason;
85
- return updateRecurringPayment({
86
- payableId: payableId,
87
- payload: {
88
- status: "cancelled",
89
- cancelReason: cancelReason
90
- }
91
- });
92
- },
93
- initialValues: {
94
- cancelReason: ""
95
- }
96
- },
97
- children: [/*#__PURE__*/jsxRuntime.jsx(Textarea, {
98
- "data-cy": "cancel-meeting-input-textfield",
99
- label: t("neetoPayments.recurringPaymentCancel.reasonLabel"),
100
- name: "cancelReason",
101
- placeholder: t("neetoPayments.recurringPaymentCancel.reasonPlaceholder")
102
- }), /*#__PURE__*/jsxRuntime.jsx(Button, {
103
- "data-cy": "cancel-meeting-submit-button",
104
- disabled: isPending,
105
- label: t("neetoPayments.recurringPaymentCancel.buttonLabel"),
106
- loading: isPending,
107
- style: "danger"
108
- })]
109
- })
110
- });
111
- };
112
-
113
- module.exports = CustomerCancelRecurringPaymentForm;
114
- //# sourceMappingURL=CustomerCancelRecurringPaymentForm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CustomerCancelRecurringPaymentForm.js","sources":["../../app/javascript/src/apis/public/recurring_payments.js","../../app/javascript/src/hooks/reactQuery/public/useRecurringPaymentsApi.js","../../app/javascript/src/components/CustomerCancelRecurringPaymentForm/index.jsx"],"sourcesContent":["import axios from \"axios\";\n\nimport { BASE_URL } from \"src/constants\";\n\nconst show = payableId =>\n axios.get(`${BASE_URL}/api/v1/public/recurring_payments/${payableId}`);\n\nconst update = ({ payableId, payload }) =>\n axios.put(`${BASE_URL}/api/v1/public/recurring_payments/${payableId}`, {\n recurring_payment: payload,\n });\n\nconst recurringPaymentsApi = { show, update };\n\nexport default recurringPaymentsApi;\n","import { useMutationWithInvalidation } from \"neetocommons/react-utils\";\n\nimport recurringPaymentsApi from \"apis/public/recurring_payments\";\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport { isNotNil } from \"ramda\";\n\nimport { QUERY_KEYS } from \"src/common/queryConstants\";\n\nexport const useFetchRecurringPayment = payableId =>\n useQuery({\n queryKey: [QUERY_KEYS.RECURRING_PAYMENT, payableId],\n queryFn: () => recurringPaymentsApi.show(payableId),\n enabled: isNotNil(payableId),\n });\n\nexport const useUpdateRecurringPayments = payableId =>\n useMutationWithInvalidation(recurringPaymentsApi.update, {\n keysToInvalidate: [QUERY_KEYS.RECURRING_PAYMENT, payableId],\n });\n","import { Typography, Spinner } from \"neetoui\";\nimport { Form, Textarea, Button } from \"neetoui/formik\";\nimport { useTranslation } from \"react-i18next\";\n\nimport {\n useUpdateRecurringPayments,\n useFetchRecurringPayment,\n} from \"hooks/reactQuery/public/useRecurringPaymentsApi\";\n\nconst CustomerCancelRecurringPaymentForm = ({ payableId }) => {\n const { t } = useTranslation();\n\n const { isLoading, data: { recurringPayment } = {} } =\n useFetchRecurringPayment(payableId);\n\n const { isPending, mutate: updateRecurringPayment } =\n useUpdateRecurringPayments(payableId);\n\n if (isLoading) {\n return (\n <div className=\"flex h-full w-full items-center justify-center\">\n <Spinner />\n </div>\n );\n }\n\n if (recurringPayment?.status === \"cancelled\") {\n return (\n <div className=\"flex h-full w-full items-center justify-center\">\n <Typography>\n {t(\"neetoPayments.recurringPaymentCancel.message\")}\n </Typography>\n </div>\n );\n }\n\n return (\n <div className=\"flex h-full w-full items-center justify-center\">\n <Form\n className=\"space-y-6\"\n formikProps={{\n onSubmit: ({ cancelReason }) =>\n updateRecurringPayment({\n payableId,\n payload: { status: \"cancelled\", cancelReason },\n }),\n initialValues: { cancelReason: \"\" },\n }}\n >\n <Textarea\n data-cy=\"cancel-meeting-input-textfield\"\n label={t(\"neetoPayments.recurringPaymentCancel.reasonLabel\")}\n name=\"cancelReason\"\n placeholder={t(\n \"neetoPayments.recurringPaymentCancel.reasonPlaceholder\"\n )}\n />\n <Button\n data-cy=\"cancel-meeting-submit-button\"\n disabled={isPending}\n label={t(\"neetoPayments.recurringPaymentCancel.buttonLabel\")}\n loading={isPending}\n style=\"danger\"\n />\n </Form>\n </div>\n );\n};\n\nexport default CustomerCancelRecurringPaymentForm;\n"],"names":["show","payableId","axios","get","concat","BASE_URL","update","_ref","payload","put","recurring_payment","recurringPaymentsApi","useFetchRecurringPayment","useQuery","queryKey","QUERY_KEYS","RECURRING_PAYMENT","queryFn","enabled","isNotNil","useUpdateRecurringPayments","useMutationWithInvalidation","keysToInvalidate","CustomerCancelRecurringPaymentForm","_useTranslation","useTranslation","t","_useFetchRecurringPay","isLoading","_useFetchRecurringPay2","data","_useFetchRecurringPay3","recurringPayment","_useUpdateRecurringPa","isPending","updateRecurringPayment","mutate","_jsx","className","children","Spinner","status","Typography","_jsxs","Form","formikProps","onSubmit","_ref2","cancelReason","initialValues","Textarea","label","name","placeholder","Button","disabled","loading","style"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAIA,IAAMA,IAAI,GAAG,SAAPA,IAAIA,CAAGC,SAAS,EAAA;AAAA,EAAA,OACpBC,KAAK,CAACC,GAAG,CAAA,EAAA,CAAAC,MAAA,CAAIC,kBAAQ,EAAA,oCAAA,CAAA,CAAAD,MAAA,CAAqCH,SAAS,CAAE,CAAC;AAAA,CAAA;AAExE,IAAMK,MAAM,GAAG,SAATA,MAAMA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMN,SAAS,GAAAM,IAAA,CAATN,SAAS;IAAEO,OAAO,GAAAD,IAAA,CAAPC,OAAO;EAAA,OAClCN,KAAK,CAACO,GAAG,CAAAL,EAAAA,CAAAA,MAAA,CAAIC,kBAAQ,EAAAD,oCAAAA,CAAAA,CAAAA,MAAA,CAAqCH,SAAS,CAAI,EAAA;AACrES,IAAAA,iBAAiB,EAAEF;AACrB,GAAC,CAAC;AAAA,CAAA;AAEJ,IAAMG,oBAAoB,GAAG;AAAEX,EAAAA,IAAI,EAAJA,IAAI;AAAEM,EAAAA,MAAM,EAANA;AAAO,CAAC;;ACHtC,IAAMM,wBAAwB,GA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,CACZ,wDACF;AAAE,OACH,CAAC,eACFW,cAAA,CAACiB,MAAM,EAAA;AACL,QAAA,SAAA,EAAQ,8BAA8B;AACtCC,QAAAA,QAAQ,EAAErB,SAAU;AACpBiB,QAAAA,KAAK,EAAEzB,CAAC,CAAC,kDAAkD,CAAE;AAC7D8B,QAAAA,OAAO,EAAEtB,SAAU;AACnBuB,QAAAA,KAAK,EAAC;AAAQ,OACf,CAAC;KACE;AAAC,GACJ,CAAC;AAEV;;;;"}
@@ -1,136 +0,0 @@
1
- 'use strict';
2
-
3
- var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
4
- var react = require('react');
5
- var neetoCist = require('@bigbinary/neeto-cist');
6
- var utils = require('@bigbinary/neeto-commons-frontend/utils');
7
- var Download = require('@bigbinary/neeto-icons/Download');
8
- var Button = require('@bigbinary/neetoui/Button');
9
- var Modal = require('@bigbinary/neetoui/Modal');
10
- var Typography = require('@bigbinary/neetoui/Typography');
11
- var ramda = require('ramda');
12
- var reactI18next = require('react-i18next');
13
- var reactQuery = require('@tanstack/react-query');
14
- var axios = require('axios');
15
- var constants = require('./index-KqkPP267.js');
16
- var exportChannel = require('./exportChannel-BB1psKzT.js');
17
- var jsxRuntime = require('react/jsx-runtime');
18
-
19
- var create = function create(payload) {
20
- return axios.post("".concat(constants.BASE_URL, "/api/v1/exports"), {
21
- "export": payload
22
- }, {
23
- showToastr: false
24
- });
25
- };
26
- var exportsApi = {
27
- create: create
28
- };
29
-
30
- var useExportsData = function useExportsData() {
31
- return reactQuery.useMutation({
32
- mutationFn: exportsApi.create
33
- });
34
- };
35
-
36
- var ExportModal = function ExportModal(_ref) {
37
- var filters = _ref.filters,
38
- dashboardKind = _ref.dashboardKind,
39
- holdableIds = _ref.holdableIds,
40
- sortProperties = _ref.sortProperties,
41
- isExportModalOpen = _ref.isExportModalOpen,
42
- setIsExportModalOpen = _ref.setIsExportModalOpen;
43
- var _useTranslation = reactI18next.useTranslation(),
44
- t = _useTranslation.t;
45
- var _useState = react.useState(""),
46
- _useState2 = _slicedToArray(_useState, 2),
47
- downloadUrl = _useState2[0],
48
- setDownloadUrl = _useState2[1];
49
- var _useState3 = react.useState(false),
50
- _useState4 = _slicedToArray(_useState3, 2),
51
- isGenerating = _useState4[0],
52
- setIsGenerating = _useState4[1];
53
- var _getQueryParams = utils.getQueryParams(),
54
- _getQueryParams$tab = _getQueryParams.tab,
55
- tab = _getQueryParams$tab === void 0 ? "all" : _getQueryParams$tab;
56
- var _useExportsData = useExportsData(),
57
- exportsData = _useExportsData.mutate;
58
- var token = react.useMemo(function () {
59
- return "".concat(dashboardKind, "-report-").concat(constants.uuidV4());
60
- }, [dashboardKind]);
61
- var receivedCallback = function receivedCallback(data) {
62
- if (!data.download_url) return;
63
- setDownloadUrl(data.download_url);
64
- setIsGenerating(false);
65
- };
66
- react.useEffect(function () {
67
- if (isExportModalOpen) {
68
- var channel = exportChannel.exportChannel(token, receivedCallback);
69
- setDownloadUrl("");
70
- setIsGenerating(false);
71
- return function () {
72
- channel.disconnected();
73
- };
74
- }
75
- return undefined;
76
- }, [isExportModalOpen, token]);
77
- var onClose = function onClose() {
78
- return setIsExportModalOpen(false);
79
- };
80
- var handleExport = function handleExport() {
81
- setDownloadUrl("");
82
- setIsGenerating(true);
83
- var payload = ramda.mergeLeft(sortProperties, {
84
- token: token,
85
- filters: filters,
86
- tab: tab,
87
- holdableIds: holdableIds,
88
- dashboard: neetoCist.camelToSnakeCase(dashboardKind)
89
- });
90
- exportsData(payload);
91
- };
92
- return /*#__PURE__*/jsxRuntime.jsxs(Modal, {
93
- onClose: onClose,
94
- isOpen: isExportModalOpen,
95
- children: [/*#__PURE__*/jsxRuntime.jsx(Modal.Header, {
96
- children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
97
- style: "h2",
98
- children: t("neetoPayments.export.title.".concat(dashboardKind))
99
- })
100
- }), /*#__PURE__*/jsxRuntime.jsx(Modal.Body, {
101
- children: isGenerating ? /*#__PURE__*/jsxRuntime.jsx(Typography, {
102
- style: "body2",
103
- children: t("neetoPayments.export.pleaseWait")
104
- }) : /*#__PURE__*/jsxRuntime.jsx(Typography, {
105
- style: "body2",
106
- children: neetoCist.isPresent(downloadUrl) ? t("neetoPayments.export.fileReady") : t("neetoPayments.export.download.".concat(dashboardKind))
107
- })
108
- }), /*#__PURE__*/jsxRuntime.jsx(Modal.Footer, {
109
- className: "space-x-2",
110
- children: neetoCist.isPresent(downloadUrl) ? /*#__PURE__*/jsxRuntime.jsx(Button, {
111
- "data-cy": "neeto-payments-download-button",
112
- href: downloadUrl,
113
- icon: Download,
114
- label: t("neetoPayments.common.download"),
115
- onClick: onClose
116
- }) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
117
- children: [/*#__PURE__*/jsxRuntime.jsx(Button, {
118
- "data-cy": "cancel-button",
119
- disabled: isGenerating,
120
- label: t("neetoPayments.common.cancel"),
121
- style: "tertiary",
122
- onClick: onClose
123
- }), /*#__PURE__*/jsxRuntime.jsx(Button, {
124
- "data-cy": "neeto-payments-export-button",
125
- disabled: isGenerating,
126
- label: t("neetoPayments.common.export"),
127
- loading: isGenerating,
128
- onClick: handleExport
129
- })]
130
- })
131
- })]
132
- });
133
- };
134
-
135
- exports.ExportModal = ExportModal;
136
- //# sourceMappingURL=ExportModal-BmHgt24q.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExportModal-BmHgt24q.js","sources":["../../app/javascript/src/apis/exports.js","../../app/javascript/src/hooks/reactQuery/useExportsApi.js","../../app/javascript/src/components/Common/ExportModal.jsx"],"sourcesContent":["import axios from \"axios\";\n\nimport { BASE_URL } from \"src/constants\";\n\nconst create = payload =>\n axios.post(\n `${BASE_URL}/api/v1/exports`,\n { export: payload },\n { showToastr: false }\n );\n\nconst exportsApi = { create };\n\nexport default exportsApi;\n","import { useMutation } from \"@tanstack/react-query\";\n\nimport exportsApi from \"apis/exports\";\n\nexport const useExportsData = () =>\n useMutation({ mutationFn: exportsApi.create });\n","import { useEffect, useMemo, useState } from \"react\";\n\nimport { isPresent, camelToSnakeCase } from \"neetocist\";\nimport { getQueryParams } from \"neetocommons/utils\";\nimport { Download } from \"neetoicons\";\nimport { Button, Modal, Typography } from \"neetoui\";\nimport { mergeLeft } from \"ramda\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useExportsData } from \"hooks/reactQuery/useExportsApi\";\nimport exportChannel from \"src/channels/exportChannel\";\nimport { uuidV4 } from \"utils\";\n\nconst ExportModal = ({\n filters,\n dashboardKind,\n holdableIds,\n sortProperties,\n isExportModalOpen,\n setIsExportModalOpen,\n}) => {\n const { t } = useTranslation();\n const [downloadUrl, setDownloadUrl] = useState(\"\");\n const [isGenerating, setIsGenerating] = useState(false);\n\n const { tab = \"all\" } = getQueryParams();\n\n const { mutate: exportsData } = useExportsData();\n\n const token = useMemo(\n () => `${dashboardKind}-report-${uuidV4()}`,\n [dashboardKind]\n );\n\n const receivedCallback = data => {\n if (!data.download_url) return;\n setDownloadUrl(data.download_url);\n setIsGenerating(false);\n };\n\n useEffect(() => {\n if (isExportModalOpen) {\n const channel = exportChannel(token, receivedCallback);\n setDownloadUrl(\"\");\n setIsGenerating(false);\n\n return () => {\n channel.disconnected();\n };\n }\n\n return undefined;\n }, [isExportModalOpen, token]);\n\n const onClose = () => setIsExportModalOpen(false);\n\n const handleExport = () => {\n setDownloadUrl(\"\");\n setIsGenerating(true);\n const payload = mergeLeft(sortProperties, {\n token,\n filters,\n tab,\n holdableIds,\n dashboard: camelToSnakeCase(dashboardKind),\n });\n\n exportsData(payload);\n };\n\n return (\n <Modal {...{ onClose }} isOpen={isExportModalOpen}>\n <Modal.Header>\n <Typography style=\"h2\">\n {t(`neetoPayments.export.title.${dashboardKind}`)}\n </Typography>\n </Modal.Header>\n <Modal.Body>\n {isGenerating ? (\n <Typography style=\"body2\">\n {t(\"neetoPayments.export.pleaseWait\")}\n </Typography>\n ) : (\n <Typography style=\"body2\">\n {isPresent(downloadUrl)\n ? t(\"neetoPayments.export.fileReady\")\n : t(`neetoPayments.export.download.${dashboardKind}`)}\n </Typography>\n )}\n </Modal.Body>\n <Modal.Footer className=\"space-x-2\">\n {isPresent(downloadUrl) ? (\n <Button\n data-cy=\"neeto-payments-download-button\"\n href={downloadUrl}\n icon={Download}\n label={t(\"neetoPayments.common.download\")}\n onClick={onClose}\n />\n ) : (\n <>\n <Button\n data-cy=\"cancel-button\"\n disabled={isGenerating}\n label={t(\"neetoPayments.common.cancel\")}\n style=\"tertiary\"\n onClick={onClose}\n />\n <Button\n data-cy=\"neeto-payments-export-button\"\n disabled={isGenerating}\n label={t(\"neetoPayments.common.export\")}\n loading={isGenerating}\n onClick={handleExport}\n />\n </>\n )}\n </Modal.Footer>\n </Modal>\n );\n};\n\nexport default ExportModal;\n"],"names":["create","payload","axios","post","concat","BASE_URL","showToastr","exportsApi","useExportsData","useMutation","mutationFn","ExportModal","_ref","filters","dashboardKind","holdableIds","sortProperties","isExportModalOpen","setIsExportModalOpen","_useTranslation","useTranslation","t","_useState","useState","_useState2","_slicedToArray","downloadUrl","setDownloadUrl","_useState3","_useState4","isGenerating","setIsGenerating","_getQueryParams","getQueryParams","_getQueryParams$tab","tab","_useExportsData","exportsData","mutate","token","useMemo","uuidV4","receivedCallback","data","download_url","useEffect","channel","exportChannel","disconnected","undefined","onClose","handleExport","mergeLeft","dashboard","camelToSnakeCase","_jsxs","Modal","isOpen","children","_jsx","Header","Typography","style","Body","isPresent","Footer","className","Button","href","icon","Download","label","onClick","_Fragment","disabled","loading"],"mappings":";;;;;;;;;;;;;;;;;;AAIA,IAAMA,MAAM,GAAG,SAATA,MAAMA,CAAGC,OAAO,EAAA;AAAA,EAAA,OACpBC,KAAK,CAACC,IAAI,IAAAC,MAAA,CACLC,kBAAQ,EACX,iBAAA,CAAA,EAAA;IAAE,QAAQJ,EAAAA;AAAQ,GAAC,EACnB;AAAEK,IAAAA,UAAU,EAAE;AAAM,GACtB,CAAC;AAAA,CAAA;AAEH,IAAMC,UAAU,GAAG;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