@tesouro/embedded-components-react 0.5.213 → 0.5.215

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 (278) hide show
  1. package/dist/index.d.ts +88 -1
  2. package/dist/index.js +2 -2
  3. package/dist/lib/BillPayWidget.js +1 -1
  4. package/dist/lib/ReceivablesWidget.d.ts +88 -1
  5. package/dist/lib/ReceivablesWidget.js +1 -1
  6. package/dist/libs/shared/util-validation/dist/index5.js +7 -0
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/data-access/dist/index.js +3 -0
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{data-access/dist/index38.js → bill-upload/data-access/dist/index2.js} +7 -6
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/data-access/dist/index3.js +33 -0
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{data-access/dist/index35.js → bill-upload/data-access/dist/index4.js} +6 -7
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/feature/dist/index.js +7 -0
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/feature/dist/index2.js +8 -0
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/feature/dist/index3.js +13 -0
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/feature/dist/index4.js +133 -0
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/feature/dist/index5.js +3 -0
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/feature/dist/index6.js +5 -0
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/feature/dist/index7.js +4 -0
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/feature/dist/index8.js +56 -0
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/feature/dist/index9.js +1 -0
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/ui/dist/index.js +4 -0
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/ui/dist/index2.js +10 -0
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/ui/dist/index3.js +9 -0
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/ui/dist/index4.js +93 -0
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/ui/dist/index6.js +2 -0
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index.js +29 -33
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/invalidation.js +11 -0
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/{index6.js → lib/invalidatePayableQueries/approvalDecisionQueries.js} +8 -8
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/{index7.js → lib/invalidatePayableQueries/approvalRequestWatch.js} +5 -5
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/{index3.js → lib/invalidatePayableQueries/cleanUpDeletedPayableQueries.js} +4 -4
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/{index9.js → lib/invalidatePayableQueries/hasLiveScheduledRecord.js} +5 -5
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/invalidatePayableQueries/index.js +6 -0
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/{index8.js → lib/invalidatePayableQueries/invalidateDeletedPayableQueries.js} +5 -5
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/{index4.js → lib/invalidatePayableQueries/invalidatePayableQueries.js} +5 -5
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/{index5.js → lib/invalidatePayableQueries/payableProjectionPolling.js} +1 -1
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/{index10.js → lib/invalidatePayableQueries/reconcileCancelledPaymentQueries.js} +7 -7
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/{index12.js → lib/invalidatePayableQueries/reconcileSubmittedForApprovalQueries.js} +3 -3
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/{index13.js → lib/payableOcrQueryOptions.js} +4 -4
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/{index40.js → lib/payablePolicyAssignmentQueryOptions.js} +4 -4
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/{index2.js → lib/queryKeys.js} +4 -4
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/{index21.js → lib/useApplyDuplicateVerdictsMutation.js} +23 -25
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/{index16.js → lib/usePayableApprovalRequests.js} +11 -11
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/{index17.js → lib/usePayableHistoryQuery.js} +6 -6
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/{index18.js → lib/usePayableLineItems.js} +10 -10
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/usePayableMutations/index.js +12 -0
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/{index22.js → lib/usePayableMutations/useAttachPayableFileMutation.js} +7 -7
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/{index23.js → lib/usePayableMutations/useCancelPayableMutation.js} +7 -7
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/usePayableMutations/useCancelScheduledPaymentMutation.js +40 -0
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/usePayableMutations/useCreatePayableMutation.js +34 -0
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/usePayableMutations/useDeletePayableFileMutation.js +34 -0
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/usePayableMutations/useDeletePayableMutation.js +34 -0
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/{index28.js → lib/usePayableMutations/useForceApprovePayableMutation.js} +7 -7
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/{index29.js → lib/usePayableMutations/useForceRejectPayableMutation.js} +7 -7
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/{index32.js → lib/usePayableMutations/useReopenPayableMutation.js} +7 -7
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/{index33.js → lib/usePayableMutations/useSubmitPayableForApprovalMutation.js} +9 -9
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/{index34.js → lib/usePayableMutations/useUpdatePayableMutation.js} +7 -7
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/{index36.js → lib/usePayableMutations/useValidatePayableMutation.js} +5 -5
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/{index19.js → lib/usePayablePaymentRecordsQuery.js} +8 -8
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/{index47.js → lib/usePayableSuggestionsQuery.js} +7 -7
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/usePayablesQueries/index.js +6 -0
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/{index39.js → lib/usePayablesQueries/useFirstPayablesPagesQuery.js} +8 -8
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/{index41.js → lib/usePayablesQueries/usePayableQuery.js} +8 -8
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/{index42.js → lib/usePayablesQueries/usePayablesByIdsQueries.js} +6 -6
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/{index43.js → lib/usePayablesQueries/usePayablesCountQueries.js} +7 -7
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/{index44.js → lib/usePayablesQueries/usePayablesQuery.js} +7 -7
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/usePayablesQueries/usePayablesTotalCountQuery.js +29 -0
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +11 -23
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +11 -5
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js +12 -13
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +66 -23
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js +9 -62
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +29 -2
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +160 -82
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +26 -5
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +22 -31
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +38 -35
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +92 -164
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +82 -45
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +6 -1
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +44 -47
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +112 -12
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +184 -8
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +72 -9
  83. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +31 -65
  84. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +89 -10
  85. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +401 -15
  86. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +12 -161
  87. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +83 -24
  88. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +79 -22
  89. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +222 -30
  90. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +38 -93
  91. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +247 -79
  92. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +23 -4
  93. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +612 -45
  94. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +4 -116
  95. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +27 -179
  96. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +232 -70
  97. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index4.js +15 -38
  98. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +3 -35
  99. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +3 -90
  100. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +36 -405
  101. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +1 -16
  102. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +23 -83
  103. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +3 -80
  104. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +124 -228
  105. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +8 -43
  106. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +6 -251
  107. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +81 -22
  108. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index5.js +38 -6
  109. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +20 -625
  110. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +22 -4
  111. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +28 -42
  112. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +82 -256
  113. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +50 -3
  114. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +260 -3
  115. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +27 -38
  116. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +396 -1
  117. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +332 -6
  118. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +4 -13
  119. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +217 -16
  120. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +5 -130
  121. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +107 -2
  122. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +1 -6
  123. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +24 -129
  124. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +84 -14
  125. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +46 -37
  126. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +12 -223
  127. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/data-access/dist/index.js +4 -0
  128. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{data-access/dist/index30.js → pay-bill/data-access/dist/index2.js} +7 -7
  129. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/data-access/dist/index3.js +7 -0
  130. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{data-access/dist/index11.js → pay-bill/data-access/dist/index4.js} +5 -4
  131. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{data-access/dist/index20.js → pay-bill/data-access/dist/index5.js} +8 -8
  132. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/feature/dist/index.js +3 -0
  133. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/feature/dist/index10.js +179 -0
  134. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/feature/dist/index11.js +51 -0
  135. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/feature/dist/index12.js +1 -0
  136. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/feature/dist/index13.js +5 -0
  137. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/feature/dist/index14.js +73 -0
  138. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/feature/dist/index15.js +1 -0
  139. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/feature/dist/index2.js +18 -0
  140. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/feature/dist/index3.js +26 -0
  141. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/feature/dist/index4.js +72 -0
  142. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/feature/dist/index5.js +2 -0
  143. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/feature/dist/index6.js +9 -0
  144. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/feature/dist/index7.js +7 -0
  145. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/feature/dist/index8.js +35 -0
  146. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/feature/dist/index9.js +41 -0
  147. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index.js +10 -0
  148. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index108.js → pay-bill/ui/dist/index10.js} +4 -4
  149. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index11.js +2 -0
  150. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index103.js → pay-bill/ui/dist/index2.js} +2 -2
  151. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index104.js → pay-bill/ui/dist/index3.js} +3 -3
  152. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index4.js +2 -0
  153. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index5.js +13 -0
  154. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index101.js → pay-bill/ui/dist/index6.js} +5 -5
  155. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index7.js +2 -0
  156. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index106.js → pay-bill/ui/dist/index8.js} +2 -2
  157. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index107.js → pay-bill/ui/dist/index9.js} +1 -1
  158. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +10 -22
  159. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index100.js +2 -12
  160. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index89.js +3 -6
  161. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index90.js +28 -7
  162. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index91.js +2 -93
  163. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index92.js +7 -0
  164. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index93.js +34 -2
  165. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index94.js +2 -7
  166. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index95.js +12 -28
  167. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index96.js +108 -2
  168. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index97.js +2 -7
  169. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index98.js +8 -32
  170. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index99.js +52 -2
  171. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/util/dist/lib/duplicateVerdict.js +7 -0
  172. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/util/dist/lib/groupDuplicates.js +40 -0
  173. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/util/dist/lib/payableRemoval.js +8 -0
  174. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +7 -7
  175. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index10.js +63 -67
  176. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index11.js +160 -1
  177. package/dist/libs/tesouro-embedded-components-react/{bill-pay-widget/data-access/dist/index31.js → invoicing-widget/data-access/dist/index12.js} +0 -2
  178. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index2.js +32 -25
  179. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index6.js +25 -200
  180. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index7.js +175 -1
  181. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index8.js +1 -101
  182. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index9.js +92 -71
  183. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +1 -1
  184. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index10.js +44 -100
  185. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index11.js +93 -421
  186. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +442 -112
  187. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +166 -157
  188. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index14.js +150 -204
  189. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index15.js +202 -31
  190. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index16.js +32 -145
  191. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index17.js +145 -37
  192. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index18.js +44 -58
  193. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index19.js +113 -87
  194. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index20.js +58 -116
  195. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index21.js +83 -357
  196. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index22.js +111 -65
  197. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index23.js +449 -99
  198. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index24.js +68 -281
  199. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index25.js +115 -0
  200. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index26.js +314 -0
  201. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index5.js +1 -1
  202. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index6.js +34 -23
  203. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index8.js +444 -92
  204. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +113 -52
  205. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +18 -14
  206. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index10.js +2 -92
  207. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index11.js +95 -3
  208. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index12.js +3 -24
  209. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +24 -1
  210. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +1 -3
  211. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +1 -1
  212. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js +3 -18
  213. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index17.js +18 -1
  214. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index18.js +0 -3
  215. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +0 -8
  216. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index20.js +11 -0
  217. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index21.js +1 -264
  218. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js +258 -42
  219. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +38 -62
  220. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index24.js +61 -463
  221. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +457 -89
  222. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +91 -234
  223. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +89 -82
  224. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index28.js +22 -338
  225. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js +236 -0
  226. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index3.js +26 -204
  227. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +3 -0
  228. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index31.js +249 -0
  229. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +93 -0
  230. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +344 -0
  231. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index4.js +208 -32
  232. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index5.js +29 -202
  233. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index6.js +183 -137
  234. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index7.js +157 -12
  235. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index8.js +10 -19
  236. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index9.js +23 -2
  237. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +40 -40
  238. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +167 -156
  239. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +66 -34
  240. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  241. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
  242. package/dist/packages/shared-ui-shadcn/dist/index.js +13 -13
  243. package/package.json +1 -1
  244. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index14.js +0 -32
  245. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index15.js +0 -8
  246. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index24.js +0 -40
  247. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index25.js +0 -34
  248. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index26.js +0 -34
  249. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index27.js +0 -34
  250. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index37.js +0 -15
  251. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index45.js +0 -29
  252. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index46.js +0 -6
  253. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +0 -11
  254. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +0 -10
  255. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +0 -84
  256. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +0 -24
  257. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +0 -22
  258. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +0 -31
  259. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +0 -86
  260. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +0 -50
  261. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +0 -262
  262. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +0 -35
  263. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +0 -395
  264. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +0 -310
  265. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +0 -4
  266. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +0 -7
  267. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +0 -114
  268. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +0 -1
  269. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +0 -27
  270. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index102.js +0 -2
  271. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index105.js +0 -2
  272. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index109.js +0 -2
  273. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index110.js +0 -14
  274. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index111.js +0 -108
  275. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index112.js +0 -2
  276. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index113.js +0 -10
  277. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index114.js +0 -52
  278. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index115.js +0 -2
@@ -1,213 +1,159 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import { extractApiErrorMessage as t } from "../../../shared/util/dist/lib/apiErrors.js";
7
- import "../../../shared/ui/dist/index.js";
8
- import { useCounterpartQuery as n } from "../../../shared/counterpart-management/data-access/dist/index3.js";
1
+ import { hasAnyScope as e } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
2
+ import { Scope as t } from "../../../shared/data-access/dist/lib/scopes.js";
3
+ import "../../../shared/data-access/dist/index.js";
4
+ import { getCounterpartEmail as n } from "../../../shared/counterpart-management/feature/dist/lib/helpers.js";
9
5
  import "../../../shared/counterpart-management/feature/dist/index.js";
10
- import { defaultPaymentValues as r, defaultSendValues as i, fromMajorUnits as a, hasPaymentErrors as o, hasSendErrors as s, splitEmailList as c, validatePaymentValues as l, validateSendValues as ee } from "./index11.js";
11
- import { getIssueReminderBlocker as te, hasSelectedReminder as u } from "./index13.js";
12
- import { useSendReceivableEmailMutation as d } from "../../data-access/dist/index5.js";
13
- import { useAcceptReceivableMutation as f, useCancelReceivableMutation as p, useCloneReceivableMutation as m, useDeclineReceivableMutation as ne, useDeleteReceivableMutation as re, useIssueReceivableMutation as ie } from "../../data-access/dist/index6.js";
14
- import { useMarkReceivablePaidMutation as h, useMarkReceivablePartiallyPaidMutation as g, useMarkReceivableUncollectibleMutation as _ } from "../../data-access/dist/index8.js";
15
- import "../../data-access/dist/index.js";
16
- import { useCallback as v, useState as y } from "react";
6
+ import { RECEIVABLE_PAYMENT_TERMS_RECEIPT_DUE as r } from "../../ui/dist/index10.js";
7
+ import "../../ui/dist/index.js";
17
8
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index14.js
18
- function b({ selectedReceivable: b, messages: S, onCreated: C, onDeleted: w }) {
19
- let T = ie(), E = p(), D = m(), O = f(), k = ne(), A = re(), j = d(), M = h(), N = g(), P = _(), [F, I] = y(), [ae, L] = y(), [R, z] = y(), [B, V] = y(() => i(void 0, S)), [H, U] = y({}), [W, G] = y(), [K, q] = y(() => r()), [J, Y] = y({}), X = n(F?.reminderCounterpartId), Z = !!F?.reminderCounterpartId && X.isLoading, oe = v((e, t, n) => {
20
- let a = "documentLabel" in t ? t.documentLabel : t.title, o = {
21
- id: t.id,
22
- type: t.type,
23
- title: a,
24
- action: e
25
- }, s = n === void 0 ? b : n ?? void 0;
26
- if (e === "send") {
27
- z(o), V(i(s, S)), U({});
28
- return;
29
- }
30
- if (e === "recordPayment") {
31
- G({
32
- ...o,
33
- currency: s?.currency
34
- }), q(r()), Y({});
35
- return;
36
- }
37
- L(void 0), I({
38
- ...o,
39
- reminderCounterpartId: e === "issue" && s && u(s) ? s.counterpart_id : void 0
40
- });
41
- }, [S, b]), se = v(() => {
42
- I(void 0), L(void 0);
43
- }, []), Q = v(() => {
44
- z(void 0), U({});
45
- }, []), $ = v(() => {
46
- G(void 0), Y({});
47
- }, []), ce = v(async () => {
48
- if (!F) return;
49
- let n = { receivable_id: F.id };
50
- if (F.reminderCounterpartId) {
51
- if (Z) return;
52
- let t = te(X.data, S);
53
- if (t) {
54
- e.error(t), I(void 0);
55
- return;
56
- }
57
- }
58
- try {
59
- if (F.action === "issue") await T.mutateAsync({ path: n });
60
- else if (F.action === "cancel") await E.mutateAsync({ path: n });
61
- else if (F.action === "clone") {
62
- let e = await D.mutateAsync({ path: n });
63
- e?.id && C?.(e.id, e.type);
64
- } else F.action === "accept" ? await O.mutateAsync({ path: n }) : F.action === "decline" ? await k.mutateAsync({ path: n }) : F.action === "delete" ? (await A.mutateAsync({ path: n }), w?.(F.id)) : F.action === "markPaid" ? await M.mutateAsync({
65
- path: n,
66
- body: { paid_at: (/* @__PURE__ */ new Date()).toISOString() }
67
- }) : F.action === "markUncollectible" && await P.mutateAsync({ path: n });
68
- I(void 0), L(void 0);
69
- } catch (e) {
70
- L(t(e) ?? S.genericError);
71
- }
72
- }, [
73
- O,
74
- F,
75
- E,
76
- D,
77
- k,
78
- A,
79
- Z,
80
- T,
81
- M,
82
- S,
83
- C,
84
- w,
85
- X.data,
86
- P
87
- ]), le = v(async () => {
88
- if (!R) return;
89
- let e = ee(B, S);
90
- if (s(e)) {
91
- U(e);
92
- return;
93
- }
94
- try {
95
- await j.mutateAsync({
96
- path: { receivable_id: R.id },
97
- body: {
98
- body_text: B.body,
99
- subject_text: B.subject,
100
- recipients: {
101
- to: c(B.to),
102
- cc: c(B.cc),
103
- bcc: c(B.bcc)
104
- }
105
- }
106
- }), Q();
107
- } catch (e) {
108
- U({ form: t(e) ?? S.genericError });
109
- }
110
- }, [
111
- Q,
112
- S,
113
- j,
114
- R,
115
- B
116
- ]), ue = v(async () => {
117
- if (!W) return;
118
- let e = l(K, S, W.currency);
119
- if (o(e)) {
120
- Y(e);
121
- return;
122
- }
123
- try {
124
- let e = { receivable_id: W.id }, t = K.paidAt ? new Date(K.paidAt).toISOString() : void 0;
125
- K.mode === "full" ? await M.mutateAsync({
126
- path: e,
127
- body: {
128
- comment: K.comment || void 0,
129
- paid_at: t
130
- }
131
- }) : await N.mutateAsync({
132
- path: e,
133
- body: {
134
- amount_paid: a(K.amountPaid, W.currency) ?? 0,
135
- comment: K.comment || void 0
136
- }
137
- }), $();
138
- } catch (e) {
139
- Y({ form: t(e) ?? S.genericError });
9
+ var i = 1e4, a = 864e5;
10
+ function o(n) {
11
+ return e(new Set(n ?? []), [t.InvoiceWriteOrg]);
12
+ }
13
+ function s(e) {
14
+ return e.replace(/\D/g, "");
15
+ }
16
+ var c = (e) => e.length > 0 ? Math.min(...e) : Infinity;
17
+ function l(e) {
18
+ return c([
19
+ e.term_1_reminder,
20
+ e.term_2_reminder,
21
+ e.term_final_reminder
22
+ ].flatMap((e) => e ? [e.days_before] : []));
23
+ }
24
+ function u(e) {
25
+ return c((e.terms ?? []).map((e) => e.days_after));
26
+ }
27
+ function d(e) {
28
+ return [...e ?? []].sort((e, t) => l(e) - l(t)).map(({ id: e, name: t }) => ({
29
+ value: e,
30
+ label: t
31
+ }));
32
+ }
33
+ function f(e) {
34
+ return [...e ?? []].sort((e, t) => u(e) - u(t)).map(({ id: e, name: t }) => ({
35
+ value: e,
36
+ label: t
37
+ }));
38
+ }
39
+ function p(e) {
40
+ let [t, n, r] = e.split("-").map(Number);
41
+ if (t && n && r) return new Date(t, n - 1, r);
42
+ }
43
+ function m(e, t) {
44
+ return Math.round((Date.UTC(t.getFullYear(), t.getMonth(), t.getDate()) - Date.UTC(e.getFullYear(), e.getMonth(), e.getDate())) / a);
45
+ }
46
+ function h({ paymentTermsId: e, paymentTermsCustomDate: t }) {
47
+ return e === "custom" ? p(t) : void 0;
48
+ }
49
+ function g({ paymentTermsId: e, paymentTermsCustomDate: t, paymentTerms: n, today: r }) {
50
+ if (e === "custom") return p(t);
51
+ let i = e === "receipt_due" ? 0 : n?.find((t) => t.id === e)?.term_final.number_of_days;
52
+ if (i !== void 0) return new Date(r.getFullYear(), r.getMonth(), r.getDate() + i);
53
+ }
54
+ function _(e) {
55
+ return new Intl.DateTimeFormat("en-US", {
56
+ month: "short",
57
+ day: "numeric",
58
+ year: "numeric"
59
+ }).format(e);
60
+ }
61
+ function v(e, t) {
62
+ return (e === 1 ? t.reminderNameDay : t.reminderNameDays).replace("{days}", String(e));
63
+ }
64
+ function y(e, t) {
65
+ return Number(e) === 1 ? t.reminderUnitDay : t.reminderUnitDays;
66
+ }
67
+ function b(e) {
68
+ let t = Number(e);
69
+ return e !== "" && t >= 1 && t <= 1e4;
70
+ }
71
+ function x(e) {
72
+ return e.every((e) => Number(e) >= 1);
73
+ }
74
+ function S({ daysBefore: e, dueDate: t, messages: n }) {
75
+ return {
76
+ name: v(e, n),
77
+ term_final_reminder: {
78
+ days_before: e,
79
+ subject: n.reminderBeforeDueSubject,
80
+ body: t ? n.reminderBeforeDueBody.replace("{dueDate}", _(t)) : n.reminderBeforeDueBodyNoDate
140
81
  }
141
- }, [
142
- $,
143
- M,
144
- S,
145
- N,
146
- W,
147
- K
148
- ]);
82
+ };
83
+ }
84
+ function C({ terms: e, dueDate: t, messages: n }) {
85
+ let r = e.map(Number).sort((e, t) => e - t), i = r.map((e) => v(e, n)), a = i.length === 1 ? i[0] : `${i.slice(0, -1).join(", ")} ${n.reminderNameAnd} ${i[i.length - 1]}`, o = t ? n.reminderOverdueBody.replace("{dueDate}", _(t)) : n.reminderOverdueBodyNoDate;
149
86
  return {
150
- actionTarget: F,
151
- actionDialog: F ? x(F.action, S) : void 0,
152
- actionError: ae,
153
- actionInProgress: Z || T.isPending || E.isPending || D.isPending || O.isPending || k.isPending || A.isPending || M.isPending || P.isPending,
154
- openAction: oe,
155
- closeAction: se,
156
- confirmAction: ce,
157
- sendOpen: !!R,
158
- sendValues: B,
159
- sendErrors: H,
160
- sendInProgress: j.isPending,
161
- setSendValues: V,
162
- closeSend: Q,
163
- submitSend: le,
164
- paymentOpen: !!W,
165
- paymentValues: K,
166
- paymentErrors: J,
167
- paymentInProgress: M.isPending || N.isPending,
168
- setPaymentValues: q,
169
- closePayment: $,
170
- submitPayment: ue
87
+ name: a,
88
+ terms: r.map((e) => ({
89
+ days_after: e,
90
+ subject: n.reminderOverdueSubject,
91
+ body: o
92
+ }))
171
93
  };
172
94
  }
173
- function x(e, t) {
174
- return e === "issue" ? {
175
- title: t.issueTitle,
176
- description: t.issueDescription,
177
- confirmLabel: t.issueConfirm
178
- } : e === "accept" ? {
179
- title: t.acceptTitle,
180
- description: t.acceptDescription,
181
- confirmLabel: t.acceptConfirm
182
- } : e === "decline" ? {
183
- title: t.declineTitle,
184
- description: t.declineDescription,
185
- confirmLabel: t.declineConfirm,
186
- destructive: !0
187
- } : e === "cancel" ? {
188
- title: t.cancelTitle,
189
- description: t.cancelDescription,
190
- confirmLabel: t.cancelConfirm,
191
- destructive: !0
192
- } : e === "clone" ? {
193
- title: t.cloneTitle,
194
- description: t.cloneDescription,
195
- confirmLabel: t.cloneConfirm
196
- } : e === "delete" ? {
197
- title: t.deleteTitle,
198
- description: t.deleteDescription,
199
- confirmLabel: t.deleteConfirm,
200
- destructive: !0
201
- } : e === "markPaid" ? {
202
- title: t.markPaidTitle,
203
- description: t.markPaidDescription,
204
- confirmLabel: t.markPaidConfirm
205
- } : {
206
- title: t.markUncollectibleTitle,
207
- description: t.markUncollectibleDescription,
208
- confirmLabel: t.markUncollectibleConfirm,
209
- destructive: !0
95
+ function w(e) {
96
+ return !!(e.paymentTermsId || e.paymentReminderId || e.overdueReminderId);
97
+ }
98
+ function T({ showReminders: e, paymentTermsId: t, paymentTermsCustomDate: n, paymentReminderId: a, overdueReminderId: o, paymentReminders: s, overdueReminders: c, canCreate: l, disabled: u, beforeDueInput: p, overdueTerms: g, isCreatingPaymentReminder: _, isCreatingOverdueReminder: v, today: S, messages: C }) {
99
+ let w = {
100
+ checked: e,
101
+ toggleDisabled: !t
102
+ };
103
+ if (!e) return w;
104
+ let T = p !== "", E = b(p), D = h({
105
+ paymentTermsId: t,
106
+ paymentTermsCustomDate: n
107
+ }), O = D ? m(S, D) : void 0, k = s?.find((e) => e.id === a), A = k ? [
108
+ k.term_1_reminder,
109
+ k.term_2_reminder,
110
+ k.term_final_reminder
111
+ ].flatMap((e) => e ? [e.days_before] : []) : [], j = O !== void 0 && (T && Number(p) > O || A.some((e) => e > O)), M = t === r, N = d(s), P = f(c);
112
+ return {
113
+ ...w,
114
+ cards: {
115
+ beforeDue: M ? void 0 : {
116
+ options: N,
117
+ selectedId: a,
118
+ create: l ? {
119
+ value: p,
120
+ unitLabel: y(p, C),
121
+ caption: N.length > 0 ? C.reminderBeforeDueCaption : void 0,
122
+ error: T && !E ? C.reminderDaysRange.replace("{min}", "1").replace("{max}", String(i)) : void 0,
123
+ inputDisabled: u || _,
124
+ saveDisabled: !E || _,
125
+ isSaving: _
126
+ } : void 0,
127
+ warning: j ? C.reminderPastDueWarning : void 0
128
+ },
129
+ overdue: {
130
+ options: P,
131
+ selectedId: o,
132
+ create: l ? {
133
+ caption: P.length > 0 ? C.reminderOverdueCaption : C.reminderOverdueEmptyCaption,
134
+ terms: g.map((e, t) => ({
135
+ value: e,
136
+ unitLabel: y(e, C),
137
+ ariaLabel: C.reminderOverdueTermLabel.replace("{index}", String(t + 1)),
138
+ showPlaceholder: g.length === 1
139
+ })),
140
+ showAddTerm: g.length < 3,
141
+ addTermDisabled: u || v || !g[g.length - 1],
142
+ inputsDisabled: u || v,
143
+ clearDisabled: u || v,
144
+ saveDisabled: u || v || !x(g),
145
+ isSaving: v
146
+ } : void 0
147
+ }
148
+ }
210
149
  };
211
150
  }
151
+ function E(e) {
152
+ return e.type === "invoice" && !!(e.payment_reminder_id || e.overdue_reminder_id);
153
+ }
154
+ function D(e, t) {
155
+ let r = !!(e && n(e)), i = !!e?.reminders_enabled;
156
+ if (!(i && r)) return r ? t.issueRemindersDisabled : i ? t.issueRemindersNoEmail : t.issueRemindersDisabledNoEmail;
157
+ }
212
158
  //#endregion
213
- export { b as useReceivableActions };
159
+ export { i as MAX_REMINDER_DAYS, x as areOverdueTermsValid, f as buildOverdueReminderOptions, C as buildOverdueReminderPayload, d as buildPaymentReminderOptions, S as buildPaymentReminderPayload, T as buildRemindersView, o as canCreateReminders, h as getCustomDueDate, g as getImpliedDueDate, D as getIssueReminderBlocker, E as hasSelectedReminder, b as isBeforeDueDaysValid, s as sanitizeReminderDays, w as shouldShowRemindersInitially };
@@ -2,41 +2,212 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { buildReceivableDetailsView as e } from "./index11.js";
6
- import { useReceivableHistoryQuery as t, useReceivableMailsQuery as n, useReceivablePdfLinkQuery as r, useReceivableQuery as i } from "../../data-access/dist/index9.js";
5
+ import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import { extractApiErrorMessage as t } from "../../../shared/util/dist/lib/apiErrors.js";
7
+ import "../../../shared/ui/dist/index.js";
8
+ import { useCounterpartQuery as n } from "../../../shared/counterpart-management/data-access/dist/index3.js";
9
+ import "../../../shared/counterpart-management/feature/dist/index.js";
10
+ import { defaultPaymentValues as r, defaultSendValues as i, fromMajorUnits as a, hasPaymentErrors as o, hasSendErrors as s, splitEmailList as c, validatePaymentValues as l, validateSendValues as ee } from "./index12.js";
11
+ import { getIssueReminderBlocker as te, hasSelectedReminder as u } from "./index14.js";
12
+ import { useSendReceivableEmailMutation as d } from "../../data-access/dist/index5.js";
13
+ import { useAcceptReceivableMutation as f, useCancelReceivableMutation as p, useCloneReceivableMutation as m, useDeclineReceivableMutation as ne, useDeleteReceivableMutation as re, useIssueReceivableMutation as ie } from "../../data-access/dist/index7.js";
14
+ import { useMarkReceivablePaidMutation as h, useMarkReceivablePartiallyPaidMutation as g, useMarkReceivableUncollectibleMutation as _ } from "../../data-access/dist/index9.js";
7
15
  import "../../data-access/dist/index.js";
8
- import { useMemo as a } from "react";
16
+ import { useCallback as v, useState as y } from "react";
9
17
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index15.js
10
- function o({ selectedReceivableId: o, enabled: s = !0, messages: c }) {
11
- let l = i(o, { enabled: s }), u = t(o, {
12
- enabled: s,
13
- limit: 25,
14
- sort: "timestamp",
15
- order: "desc"
16
- }), d = n(o, {
17
- enabled: s,
18
- limit: 10,
19
- sort: "created_at",
20
- order: "desc"
21
- }), f = r(o, { enabled: s && !!l.data }), p = a(() => e({
22
- receivable: l.data,
23
- history: u.data?.data ?? [],
24
- mails: d.data?.data ?? [],
25
- pdfUrl: f.data?.file_url || f.data?.original_file_url || void 0,
26
- messages: c
27
- }), [
28
- l.data,
29
- u.data?.data,
30
- d.data?.data,
31
- c,
32
- f.data
18
+ function b({ selectedReceivable: b, messages: S, onCreated: C, onDeleted: w }) {
19
+ let T = ie(), E = p(), D = m(), O = f(), k = ne(), A = re(), j = d(), M = h(), N = g(), P = _(), [F, I] = y(), [ae, L] = y(), [R, z] = y(), [B, V] = y(() => i(void 0, S)), [H, U] = y({}), [W, G] = y(), [K, q] = y(() => r()), [J, Y] = y({}), X = n(F?.reminderCounterpartId), Z = !!F?.reminderCounterpartId && X.isLoading, oe = v((e, t, n) => {
20
+ let a = "documentLabel" in t ? t.documentLabel : t.title, o = {
21
+ id: t.id,
22
+ type: t.type,
23
+ title: a,
24
+ action: e
25
+ }, s = n === void 0 ? b : n ?? void 0;
26
+ if (e === "send") {
27
+ z(o), V(i(s, S)), U({});
28
+ return;
29
+ }
30
+ if (e === "recordPayment") {
31
+ G({
32
+ ...o,
33
+ currency: s?.currency
34
+ }), q(r()), Y({});
35
+ return;
36
+ }
37
+ L(void 0), I({
38
+ ...o,
39
+ reminderCounterpartId: e === "issue" && s && u(s) ? s.counterpart_id : void 0
40
+ });
41
+ }, [S, b]), se = v(() => {
42
+ I(void 0), L(void 0);
43
+ }, []), Q = v(() => {
44
+ z(void 0), U({});
45
+ }, []), $ = v(() => {
46
+ G(void 0), Y({});
47
+ }, []), ce = v(async () => {
48
+ if (!F) return;
49
+ let n = { receivable_id: F.id };
50
+ if (F.reminderCounterpartId) {
51
+ if (Z) return;
52
+ let t = te(X.data, S);
53
+ if (t) {
54
+ e.error(t), I(void 0);
55
+ return;
56
+ }
57
+ }
58
+ try {
59
+ if (F.action === "issue") await T.mutateAsync({ path: n });
60
+ else if (F.action === "cancel") await E.mutateAsync({ path: n });
61
+ else if (F.action === "clone") {
62
+ let e = await D.mutateAsync({ path: n });
63
+ e?.id && C?.(e.id, e.type);
64
+ } else F.action === "accept" ? await O.mutateAsync({ path: n }) : F.action === "decline" ? await k.mutateAsync({ path: n }) : F.action === "delete" ? (await A.mutateAsync({ path: n }), w?.(F.id)) : F.action === "markPaid" ? await M.mutateAsync({
65
+ path: n,
66
+ body: { paid_at: (/* @__PURE__ */ new Date()).toISOString() }
67
+ }) : F.action === "markUncollectible" && await P.mutateAsync({ path: n });
68
+ I(void 0), L(void 0);
69
+ } catch (e) {
70
+ L(t(e) ?? S.genericError);
71
+ }
72
+ }, [
73
+ O,
74
+ F,
75
+ E,
76
+ D,
77
+ k,
78
+ A,
79
+ Z,
80
+ T,
81
+ M,
82
+ S,
83
+ C,
84
+ w,
85
+ X.data,
86
+ P
87
+ ]), le = v(async () => {
88
+ if (!R) return;
89
+ let e = ee(B, S);
90
+ if (s(e)) {
91
+ U(e);
92
+ return;
93
+ }
94
+ try {
95
+ await j.mutateAsync({
96
+ path: { receivable_id: R.id },
97
+ body: {
98
+ body_text: B.body,
99
+ subject_text: B.subject,
100
+ recipients: {
101
+ to: c(B.to),
102
+ cc: c(B.cc),
103
+ bcc: c(B.bcc)
104
+ }
105
+ }
106
+ }), Q();
107
+ } catch (e) {
108
+ U({ form: t(e) ?? S.genericError });
109
+ }
110
+ }, [
111
+ Q,
112
+ S,
113
+ j,
114
+ R,
115
+ B
116
+ ]), ue = v(async () => {
117
+ if (!W) return;
118
+ let e = l(K, S, W.currency);
119
+ if (o(e)) {
120
+ Y(e);
121
+ return;
122
+ }
123
+ try {
124
+ let e = { receivable_id: W.id }, t = K.paidAt ? new Date(K.paidAt).toISOString() : void 0;
125
+ K.mode === "full" ? await M.mutateAsync({
126
+ path: e,
127
+ body: {
128
+ comment: K.comment || void 0,
129
+ paid_at: t
130
+ }
131
+ }) : await N.mutateAsync({
132
+ path: e,
133
+ body: {
134
+ amount_paid: a(K.amountPaid, W.currency) ?? 0,
135
+ comment: K.comment || void 0
136
+ }
137
+ }), $();
138
+ } catch (e) {
139
+ Y({ form: t(e) ?? S.genericError });
140
+ }
141
+ }, [
142
+ $,
143
+ M,
144
+ S,
145
+ N,
146
+ W,
147
+ K
33
148
  ]);
34
149
  return {
35
- receivable: l.data,
36
- detailsView: p,
37
- isLoading: l.isLoading || u.isLoading || d.isLoading || f.isLoading,
38
- isError: l.isError
150
+ actionTarget: F,
151
+ actionDialog: F ? x(F.action, S) : void 0,
152
+ actionError: ae,
153
+ actionInProgress: Z || T.isPending || E.isPending || D.isPending || O.isPending || k.isPending || A.isPending || M.isPending || P.isPending,
154
+ openAction: oe,
155
+ closeAction: se,
156
+ confirmAction: ce,
157
+ sendOpen: !!R,
158
+ sendValues: B,
159
+ sendErrors: H,
160
+ sendInProgress: j.isPending,
161
+ setSendValues: V,
162
+ closeSend: Q,
163
+ submitSend: le,
164
+ paymentOpen: !!W,
165
+ paymentValues: K,
166
+ paymentErrors: J,
167
+ paymentInProgress: M.isPending || N.isPending,
168
+ setPaymentValues: q,
169
+ closePayment: $,
170
+ submitPayment: ue
171
+ };
172
+ }
173
+ function x(e, t) {
174
+ return e === "issue" ? {
175
+ title: t.issueTitle,
176
+ description: t.issueDescription,
177
+ confirmLabel: t.issueConfirm
178
+ } : e === "accept" ? {
179
+ title: t.acceptTitle,
180
+ description: t.acceptDescription,
181
+ confirmLabel: t.acceptConfirm
182
+ } : e === "decline" ? {
183
+ title: t.declineTitle,
184
+ description: t.declineDescription,
185
+ confirmLabel: t.declineConfirm,
186
+ destructive: !0
187
+ } : e === "cancel" ? {
188
+ title: t.cancelTitle,
189
+ description: t.cancelDescription,
190
+ confirmLabel: t.cancelConfirm,
191
+ destructive: !0
192
+ } : e === "clone" ? {
193
+ title: t.cloneTitle,
194
+ description: t.cloneDescription,
195
+ confirmLabel: t.cloneConfirm
196
+ } : e === "delete" ? {
197
+ title: t.deleteTitle,
198
+ description: t.deleteDescription,
199
+ confirmLabel: t.deleteConfirm,
200
+ destructive: !0
201
+ } : e === "markPaid" ? {
202
+ title: t.markPaidTitle,
203
+ description: t.markPaidDescription,
204
+ confirmLabel: t.markPaidConfirm
205
+ } : {
206
+ title: t.markUncollectibleTitle,
207
+ description: t.markUncollectibleDescription,
208
+ confirmLabel: t.markUncollectibleConfirm,
209
+ destructive: !0
39
210
  };
40
211
  }
41
212
  //#endregion
42
- export { o as useReceivableDetails };
213
+ export { b as useReceivableActions };