@tesouro/embedded-components-react 0.5.221 → 0.5.223

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 (287) hide show
  1. package/dist/index.css +84 -0
  2. package/dist/index.d.ts +239 -214
  3. package/dist/index.js +2 -2
  4. package/dist/lib/BillPayWidget.d.ts +151 -151
  5. package/dist/lib/BillPayWidget.js +1 -1
  6. package/dist/lib/ReceivablesWidget.d.ts +25 -0
  7. package/dist/lib/ReceivablesWidget.js +1 -1
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index.js +22 -0
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index10.js +34 -0
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{data-access/dist/lib/usePayableMutations/useForceApprovePayableMutation.js → bill-detail/data-access/dist/index11.js} +7 -7
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{data-access/dist/lib/usePayableMutations/useForceRejectPayableMutation.js → bill-detail/data-access/dist/index12.js} +7 -7
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{data-access/dist/lib/usePayableMutations/useReopenPayableMutation.js → bill-detail/data-access/dist/index13.js} +7 -7
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{data-access/dist/lib/usePayableMutations/useSubmitPayableForApprovalMutation.js → bill-detail/data-access/dist/index14.js} +9 -9
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{data-access/dist/lib/usePayableMutations/useUpdatePayableMutation.js → bill-detail/data-access/dist/index15.js} +7 -7
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{data-access/dist/lib/usePayableMutations/useValidatePayableMutation.js → bill-detail/data-access/dist/index16.js} +5 -5
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index17.js +12 -0
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{data-access/dist/lib/usePayablePaymentRecordsQuery.js → bill-detail/data-access/dist/index18.js} +1 -1
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{data-access/dist/lib/usePayableSuggestionsQuery.js → bill-detail/data-access/dist/index19.js} +1 -1
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{data-access/dist/lib/usePayableApprovalRequests.js → bill-detail/data-access/dist/index2.js} +6 -5
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{data-access/dist/lib/payablePolicyAssignmentQueryOptions.js → bill-detail/data-access/dist/index20.js} +1 -1
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{data-access/dist/lib/usePayablesQueries/usePayableQuery.js → bill-detail/data-access/dist/index21.js} +9 -8
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{data-access/dist/lib/usePayablesQueries/usePayablesByIdsQueries.js → bill-detail/data-access/dist/index22.js} +6 -6
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index23.js +2 -0
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{data-access/dist/lib/usePayableHistoryQuery.js → bill-detail/data-access/dist/index3.js} +1 -1
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{data-access/dist/lib/usePayableLineItems.js → bill-detail/data-access/dist/index4.js} +3 -3
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{data-access/dist/lib/usePayableMutations/useAttachPayableFileMutation.js → bill-detail/data-access/dist/index5.js} +7 -7
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{data-access/dist/lib/usePayableMutations/useCancelPayableMutation.js → bill-detail/data-access/dist/index6.js} +7 -7
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index7.js +40 -0
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index8.js +34 -0
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index9.js +34 -0
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index.js +12 -0
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index10.js +11 -0
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{feature → bill-detail/feature}/dist/index11.js +2 -2
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{feature → bill-detail/feature}/dist/index12.js +11 -11
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{feature → bill-detail/feature}/dist/index13.js +2 -2
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{feature → bill-detail/feature}/dist/index14.js +8 -8
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{feature → bill-detail/feature}/dist/index15.js +11 -11
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{feature/dist/index17.js → bill-detail/feature/dist/index16.js} +8 -8
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{feature/dist/index18.js → bill-detail/feature/dist/index17.js} +9 -9
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{feature/dist/index19.js → bill-detail/feature/dist/index18.js} +7 -7
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{feature/dist/index20.js → bill-detail/feature/dist/index19.js} +9 -9
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index2.js +59 -0
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{feature/dist/index21.js → bill-detail/feature/dist/index20.js} +1 -1
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{feature/dist/index22.js → bill-detail/feature/dist/index21.js} +2 -2
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{feature/dist/index23.js → bill-detail/feature/dist/index22.js} +1 -1
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{feature/dist/index24.js → bill-detail/feature/dist/index23.js} +11 -11
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{feature/dist/index25.js → bill-detail/feature/dist/index24.js} +5 -5
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{feature/dist/index26.js → bill-detail/feature/dist/index25.js} +1 -1
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{feature/dist/index27.js → bill-detail/feature/dist/index26.js} +9 -9
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{feature/dist/index28.js → bill-detail/feature/dist/index27.js} +19 -19
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{feature/dist/index29.js → bill-detail/feature/dist/index28.js} +1 -1
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{feature/dist/index30.js → bill-detail/feature/dist/index29.js} +2 -2
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index3.js +7 -0
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{feature/dist/index31.js → bill-detail/feature/dist/index30.js} +3 -3
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{feature/dist/index32.js → bill-detail/feature/dist/index31.js} +14 -14
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{feature/dist/index33.js → bill-detail/feature/dist/index32.js} +3 -3
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{feature/dist/index34.js → bill-detail/feature/dist/index33.js} +5 -5
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{feature/dist/index35.js → bill-detail/feature/dist/index34.js} +1 -1
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{feature/dist/index36.js → bill-detail/feature/dist/index35.js} +71 -70
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index36.js +4 -0
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{feature/dist/index38.js → bill-detail/feature/dist/index37.js} +4 -4
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{feature/dist/index39.js → bill-detail/feature/dist/index38.js} +49 -48
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index39.js +3 -0
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index4.js +17 -0
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index40.js +5 -0
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index41.js +67 -0
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index42.js +1 -0
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index5.js +40 -0
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index6.js +229 -0
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index7.js +87 -0
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index8.js +50 -0
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index9.js +16 -0
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index.js +50 -0
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index29.js → bill-detail/ui/dist/index10.js} +4 -4
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index30.js → bill-detail/ui/dist/index11.js} +3 -3
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index31.js → bill-detail/ui/dist/index12.js} +4 -4
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index13.js +2 -0
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index33.js → bill-detail/ui/dist/index14.js} +12 -13
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index34.js → bill-detail/ui/dist/index15.js} +27 -28
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index16.js +2 -0
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index36.js → bill-detail/ui/dist/index17.js} +2 -2
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index37.js → bill-detail/ui/dist/index18.js} +3 -3
  83. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index19.js +2 -0
  84. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index2.js +15 -0
  85. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index42.js → bill-detail/ui/dist/index20.js} +2 -2
  86. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index43.js → bill-detail/ui/dist/index21.js} +3 -3
  87. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index22.js +2 -0
  88. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index45.js → bill-detail/ui/dist/index23.js} +2 -2
  89. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index46.js → bill-detail/ui/dist/index24.js} +3 -3
  90. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index25.js +2 -0
  91. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index48.js → bill-detail/ui/dist/index26.js} +5 -5
  92. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index49.js → bill-detail/ui/dist/index27.js} +7 -7
  93. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index28.js +2 -0
  94. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index51.js → bill-detail/ui/dist/index29.js} +10 -10
  95. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index3.js +55 -0
  96. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index52.js → bill-detail/ui/dist/index30.js} +1 -1
  97. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index53.js → bill-detail/ui/dist/index31.js} +19 -19
  98. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui → bill-detail/ui}/dist/index32.js +1 -1
  99. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index61.js → bill-detail/ui/dist/index33.js} +8 -9
  100. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index62.js → bill-detail/ui/dist/index34.js} +22 -24
  101. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index69.js → bill-detail/ui/dist/index36.js} +1 -1
  102. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index70.js → bill-detail/ui/dist/index37.js} +8 -9
  103. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index72.js → bill-detail/ui/dist/index39.js} +1 -1
  104. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index4.js +2 -0
  105. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index73.js → bill-detail/ui/dist/index40.js} +2 -2
  106. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index64.js → bill-detail/ui/dist/index42.js} +1 -1
  107. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index65.js → bill-detail/ui/dist/index43.js} +3 -3
  108. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index89.js → bill-detail/ui/dist/index45.js} +1 -1
  109. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index90.js → bill-detail/ui/dist/index46.js} +2 -2
  110. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index95.js → bill-detail/ui/dist/index48.js} +3 -3
  111. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index96.js → bill-detail/ui/dist/index49.js} +5 -5
  112. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index5.js +19 -0
  113. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index98.js → bill-detail/ui/dist/index51.js} +1 -1
  114. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index99.js → bill-detail/ui/dist/index52.js} +3 -3
  115. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index54.js → bill-detail/ui/dist/index53.js} +1 -1
  116. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index6.js +23 -0
  117. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index7.js +1 -0
  118. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index8.js +32 -0
  119. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index9.js +1 -0
  120. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/data-access/dist/index.js +6 -0
  121. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{data-access/dist/lib/usePayablesQueries/useFirstPayablesPagesQuery.js → bills-list/data-access/dist/index2.js} +8 -8
  122. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{data-access/dist/lib/usePayablesQueries/usePayablesCountQueries.js → bills-list/data-access/dist/index3.js} +8 -7
  123. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{data-access/dist/lib/usePayablesQueries/usePayablesQuery.js → bills-list/data-access/dist/index4.js} +8 -7
  124. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/data-access/dist/index5.js +30 -0
  125. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/data-access/dist/index6.js +4 -0
  126. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index.js +8 -0
  127. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index10.js +17 -0
  128. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{feature/dist/index52.js → bills-list/feature/dist/index11.js} +1 -1
  129. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{feature/dist/index53.js → bills-list/feature/dist/index12.js} +1 -1
  130. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{feature/dist/index54.js → bills-list/feature/dist/index13.js} +3 -3
  131. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{feature/dist/index55.js → bills-list/feature/dist/index14.js} +23 -23
  132. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{feature/dist/index56.js → bills-list/feature/dist/index15.js} +5 -5
  133. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index16.js +398 -0
  134. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index17.js +246 -0
  135. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index18.js +4 -0
  136. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index19.js +5 -0
  137. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{feature/dist/index44.js → bills-list/feature/dist/index2.js} +3 -3
  138. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index20.js +40 -0
  139. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index21.js +1 -0
  140. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{feature/dist/index45.js → bills-list/feature/dist/index3.js} +1 -1
  141. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{feature/dist/index46.js → bills-list/feature/dist/index4.js} +2 -2
  142. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{feature/dist/index47.js → bills-list/feature/dist/index5.js} +1 -1
  143. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{feature/dist/index48.js → bills-list/feature/dist/index6.js} +2 -2
  144. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{feature/dist/index49.js → bills-list/feature/dist/index7.js} +2 -2
  145. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{feature/dist/index50.js → bills-list/feature/dist/index8.js} +3 -6
  146. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index9.js +22 -0
  147. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index.js +21 -0
  148. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index77.js → bills-list/ui/dist/index10.js} +4 -4
  149. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index11.js +3 -0
  150. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index79.js → bills-list/ui/dist/index12.js} +1 -1
  151. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index80.js → bills-list/ui/dist/index13.js} +3 -3
  152. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index14.js +2 -0
  153. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index82.js → bills-list/ui/dist/index15.js} +1 -1
  154. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index83.js → bills-list/ui/dist/index16.js} +3 -3
  155. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index17.js +2 -0
  156. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index85.js → bills-list/ui/dist/index18.js} +15 -16
  157. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index86.js → bills-list/ui/dist/index19.js} +1 -1
  158. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index2.js +14 -0
  159. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index87.js → bills-list/ui/dist/index20.js} +24 -27
  160. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index21.js +3 -0
  161. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index3.js +64 -0
  162. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index4.js +2 -0
  163. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index5.js +8 -0
  164. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index6.js +35 -0
  165. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index7.js +2 -0
  166. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index75.js → bills-list/ui/dist/index8.js} +2 -2
  167. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui/dist/index76.js → bills-list/ui/dist/index9.js} +1 -1
  168. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index.js +3 -28
  169. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/invalidation.js +8 -8
  170. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +1 -15
  171. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +23 -7
  172. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index2.js +3 -57
  173. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index3.js +43 -4
  174. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index4.js +1 -17
  175. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index5.js +3 -36
  176. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +109 -219
  177. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +5 -85
  178. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +104 -47
  179. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +1 -16
  180. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index5.js +1 -1
  181. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index6.js +1 -1
  182. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +17 -83
  183. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index10.js +50 -31
  184. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index12.js +2 -13
  185. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js +36 -50
  186. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index15.js +10 -9
  187. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +14 -25
  188. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index17.js +2 -18
  189. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +8 -16
  190. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index19.js +74 -19
  191. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index2.js +16 -8
  192. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +2 -14
  193. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +25 -14
  194. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index23.js +4 -2
  195. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +28 -2
  196. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +2 -30
  197. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +7 -2
  198. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index27.js +30 -28
  199. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +1 -0
  200. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index3.js +16 -75
  201. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/{index59.js → index4.js} +2 -2
  202. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index5.js +1 -1
  203. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index6.js +10 -11
  204. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index7.js +2 -64
  205. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index8.js +0 -1
  206. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index9.js +16 -6
  207. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +1 -1
  208. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +18 -1
  209. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index23.js +219 -453
  210. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index24.js +34 -41
  211. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index25.js +463 -32
  212. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index26.js +39 -77
  213. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index27.js +34 -112
  214. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index28.js +75 -310
  215. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index29.js +121 -0
  216. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index30.js +317 -0
  217. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +30 -27
  218. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +7 -5
  219. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index28.js +2 -28
  220. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js +4 -236
  221. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +0 -2
  222. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index31.js +90 -239
  223. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +24 -89
  224. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +231 -54
  225. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +3 -353
  226. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +249 -0
  227. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +93 -0
  228. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +59 -0
  229. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +353 -0
  230. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js +9 -9
  231. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/useMyEntityQuery.js +8 -8
  232. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/index.js +5 -4
  233. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  234. package/dist/libs/tesouro-embedded-components-react/{bill-pay-widget/feature/dist/index16.js → shared/feature/dist/lib/calendar/useLocalCalendarDay.js} +1 -1
  235. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
  236. package/package.json +1 -1
  237. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/usePayableMutations/index.js +0 -12
  238. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/usePayableMutations/useCancelScheduledPaymentMutation.js +0 -40
  239. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/usePayableMutations/useCreatePayableMutation.js +0 -34
  240. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/usePayableMutations/useDeletePayableFileMutation.js +0 -34
  241. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/usePayableMutations/useDeletePayableMutation.js +0 -34
  242. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/usePayablesQueries/index.js +0 -6
  243. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/usePayablesQueries/usePayablesTotalCountQuery.js +0 -29
  244. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +0 -4
  245. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +0 -3
  246. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +0 -5
  247. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +0 -46
  248. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +0 -1
  249. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +0 -22
  250. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +0 -396
  251. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +0 -334
  252. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +0 -4
  253. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +0 -7
  254. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +0 -108
  255. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +0 -1
  256. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +0 -27
  257. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index100.js +0 -2
  258. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js +0 -1
  259. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index39.js +0 -18
  260. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index40.js +0 -54
  261. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index55.js +0 -4
  262. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index56.js +0 -41
  263. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index57.js +0 -2
  264. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index58.js +0 -19
  265. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index60.js +0 -2
  266. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index63.js +0 -2
  267. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index66.js +0 -2
  268. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index67.js +0 -2
  269. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index68.js +0 -1
  270. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index71.js +0 -2
  271. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index74.js +0 -2
  272. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index78.js +0 -3
  273. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index81.js +0 -2
  274. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index84.js +0 -2
  275. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index88.js +0 -3
  276. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index91.js +0 -2
  277. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index92.js +0 -7
  278. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index93.js +0 -34
  279. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index94.js +0 -2
  280. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index97.js +0 -2
  281. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +0 -100
  282. /package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui → bill-detail/ui}/dist/index35.js +0 -0
  283. /package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui → bill-detail/ui}/dist/index38.js +0 -0
  284. /package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui → bill-detail/ui}/dist/index41.js +0 -0
  285. /package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui → bill-detail/ui}/dist/index44.js +0 -0
  286. /package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui → bill-detail/ui}/dist/index47.js +0 -0
  287. /package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/{ui → bill-detail/ui}/dist/index50.js +0 -0
@@ -1,465 +1,231 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { getStateOptions as e } from "../../../shared/util/dist/lib/usStates.js";
6
- import { extractApiErrorMessage as t } from "../../../shared/util/dist/lib/apiErrors.js";
7
- import { COUNTERPART_MESSAGE_LABELS_EN as n } from "../../../shared/counterpart-management/feature/dist/lib/labels.js";
8
- import { useCounterpartAddressesQuery as r } from "../../../shared/counterpart-management/data-access/dist/index7.js";
9
- import { useCounterpartForm as i } from "../../../shared/counterpart-management/feature/dist/lib/useCounterpartForm.js";
10
- import "../../../shared/counterpart-management/feature/dist/index.js";
1
+ import { minorExponentForCurrency as e } from "../../../shared/util/dist/lib/amountOutputToMajorUnits.js";
11
2
  import "../../ui/dist/index10.js";
12
3
  import "../../ui/dist/index.js";
13
- import { buildLineItemControls as a, commitLineItemField as ee, commitTaxRateInput as te, convertPriceInput as ne, createLineItem as re, getCurrencySymbol as ie, lineItemFromProduct as ae, reconcileLineItemIds as oe, reconcileMeasureUnits as se, sanitizeLineItemPatch as ce, sanitizeTaxRateInput as le, stepLineItemQuantity as ue, stripBlankLineItems as de, summarizeLineItemErrors as fe, toSheetLineItem as pe, validateLineItems as me } from "./index6.js";
14
- import { buildReceivableAttachmentsView as he } from "./index7.js";
15
- import { buildCreateRecurrencePayload as ge, buildUpdateRecurrencePayload as _e, clearRecurrenceRecipients as ve, countIssuedIterations as ye, isRecurring as o, recurrenceToFormFields as be, validateRecurrence as xe } from "./index8.js";
16
- import { convertDiscountInput as Se, decorateDiscountInput as Ce, discountInputToMinorUnits as we, sanitizeDiscountInput as Te } from "./index10.js";
17
- import { buildFormTotalsView as Ee, calculateFormTotals as De, validateDiscount as Oe, validateInvoiceTotals as ke } from "./index11.js";
18
- import { createEmptyReceivableFormValues as Ae, hasReceivableFormErrors as je, receivableFormValuesToCreatePayload as Me, receivableFormValuesToLineItemChanges as Ne, receivableFormValuesToUpdatePayload as Pe, receivableToFormValues as Fe, validateReceivableForm as Ie } from "./index12.js";
19
- import { shouldShowRemindersInitially as Le } from "./index14.js";
20
- import { useCreateReceivableMutation as Re, useUpdateReceivableMutation as ze } from "../../data-access/dist/index7.js";
21
- import { useCreateRecurrenceMutation as Be, useRecurrenceQuery as Ve, useUpdateRecurrenceMutation as He } from "../../data-access/dist/index11.js";
22
- import "../../data-access/dist/index.js";
23
- import { useReceivableAttachmentUploads as Ue } from "./index17.js";
24
- import { useReceivablePaymentTerms as We } from "./index18.js";
25
- import { useReceivableRecurrence as Ge } from "./index19.js";
26
- import { useReceivableBankAccount as Ke } from "./index21.js";
27
- import { useReceivableReminders as qe } from "./index22.js";
28
- import { getCurrencyOptions as Je } from "../../../shared/product-catalog/feature/dist/lib/helpers.js";
29
- import { useMeasureUnitsQuery as Ye } from "../../../shared/product-catalog/data-access/dist/index9.js";
30
- import { useMeasureUnits as Xe } from "../../../shared/product-catalog/feature/dist/lib/useMeasureUnits.js";
31
- import "../../../shared/product-catalog/feature/dist/index.js";
32
- import { useCallback as s, useEffect as c, useMemo as l, useRef as u, useState as d } from "react";
4
+ import { isBlankLineItem as t, parseQuantity as n, priceInputToMinorUnits as r } from "./index6.js";
5
+ import { formatTermDate as i, termDueDate as a } from "./index9.js";
6
+ import { formatMoney as o } from "./index12.js";
7
+ import { differenceInCalendarDays as s, isValid as c, parseISO as l } from "date-fns";
33
8
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index23.js
34
- function f({ messages: f, counterpartMessageLabels: Ze, embeddedBankName: Qe, onCreated: $e }) {
35
- let p = Re(), m = ze(), et = Be(), tt = He(), h = u(void 0), g = u([]), _ = u(""), [v, y] = d(!1), [b, nt] = d("create"), [rt, it] = d(), [at, x] = d(), [S, C] = d(() => Ae()), [ot, w] = d({}), [st, ct] = d("none"), T = Xe(), E = Ye(), D = E.data?.data, { unitNamesById: O } = T, [lt, k] = d(), [A, j] = d(!1), M = u(!1), N = u(!1), P = u(!1), F = u({
36
- lines: !1,
37
- discount: !1
38
- }), [ut, I] = d(!1), dt = l(() => e(), []), ft = l(() => ({
39
- ...n,
40
- ...Ze
41
- }), [Ze]), pt = r(S.customerId), mt = pt.data?.data?.[0], L = pt.data?.data?.[0]?.id, ht = s((e) => {
42
- C((t) => ({
43
- ...t,
44
- attachments: e(t.attachments)
45
- }));
46
- }, []), R = Ue({
47
- attachments: S.attachments,
48
- setAttachments: ht,
49
- receivableId: rt
50
- }), { reset: z, discardUploads: B, commitRemovals: gt } = R, _t = S.type === "invoice" ? he({
51
- attachments: S.attachments,
52
- pendingUploads: R.pendingUploads,
53
- isCountLimitReached: R.isCountLimitReached,
54
- isRecurring: o(S),
55
- messages: f
56
- }) : void 0, vt = s((e) => {
57
- C((t) => {
58
- let n = e ?? "";
59
- return n === t.customerId ? t : ve({
60
- ...t,
61
- customerId: n
62
- });
63
- });
64
- }, []), yt = i({
65
- view: st,
66
- setView: ct,
67
- selectedId: S.customerId || void 0,
68
- setSelectedId: vt,
69
- messages: ft,
70
- counterpartType: "customer",
71
- counterpart: void 0,
72
- primaryAddress: mt
73
- }), bt = s((e) => C((t) => {
74
- let n = e({
75
- paymentTermsId: t.paymentTermsId,
76
- paymentTermsCustomDate: t.paymentTermsCustomDate
77
- });
9
+ var u = "US", d = 100;
10
+ function f(e) {
11
+ try {
12
+ return new Intl.DisplayNames(void 0, { type: "region" }).of(e) ?? e;
13
+ } catch {
14
+ return e;
15
+ }
16
+ }
17
+ function p({ address: e, issuerCountry: t, formatCountry: n = f }) {
18
+ if (!e) return [];
19
+ let r = [e.city, e.state].filter(Boolean).join(", "), i = e.country === u && t === u;
20
+ return [
21
+ [e.line1, e.line2].filter(Boolean).join(" "),
22
+ [r, e.postal_code].filter(Boolean).join(" "),
23
+ e.country && !i ? n(e.country) : ""
24
+ ].filter(Boolean);
25
+ }
26
+ var m = { kind: "pending" }, h = (e) => ({
27
+ kind: "text",
28
+ lines: e
29
+ });
30
+ function g(e, t) {
31
+ return e.previewNetDays.replace("{days}", String(t));
32
+ }
33
+ function _(e, t) {
34
+ let n = e.previewEarlyPaymentDays.replace("{days}", String(t.number_of_days));
35
+ return t.discount ? `${n}, ${e.previewEarlyPaymentDiscount.replace("{rate}", String(t.discount / d))}` : n;
36
+ }
37
+ function v({ paymentTermsId: e, paymentTermsCustomDate: t, paymentTerms: n, issueDate: r, messages: o }) {
38
+ let c = {
39
+ dueDate: m,
40
+ paymentTerms: m
41
+ };
42
+ if (e === "custom") {
43
+ if (!t) return c;
44
+ let e = l(t), n = Math.max(0, s(e, r));
78
45
  return {
79
- ...t,
80
- ...n,
81
- ...n.paymentTermsId === "receipt_due" ? { paymentReminderId: "" } : {}
82
- };
83
- }), []), xt = We({
84
- paymentTermsId: S.paymentTermsId,
85
- paymentTermsCustomDate: S.paymentTermsCustomDate,
86
- isRecurring: S.type === "invoice" && o(S),
87
- messages: f,
88
- onChange: bt
89
- }), V = xt.reset, St = s((e) => C((t) => ({
90
- ...t,
91
- ...e
92
- })), []), Ct = Ke({
93
- open: v,
94
- bankAccountId: S.bankAccountId,
95
- embeddedBankName: Qe,
96
- messages: f,
97
- onSelect: St
98
- }), H = Ct.reset, wt = Ve(at), U = at ? wt.data : void 0, W = ye(U), G = W > 0, K = !!at && wt.isLoading, q = u(void 0);
99
- c(() => {
100
- U && q.current !== U.id && (q.current = U.id, C((e) => ({
101
- ...e,
102
- ...be(U)
103
- })));
104
- }, [U]);
105
- let Tt = s((e) => C(e), []), Et = s((e) => w((t) => {
106
- if (!e.some((e) => e in t)) return t;
107
- let n = { ...t };
108
- return e.forEach((e) => delete n[e]), n;
109
- }), []), Dt = u([]), Ot = s((e) => {
110
- if (!A) {
111
- Et(e);
112
- return;
113
- }
114
- Dt.current.push(...e);
115
- }, [Et, A]);
116
- c(() => {
117
- let e = Dt.current;
118
- if (!e.length) return;
119
- Dt.current = [];
120
- let t = xe({
121
- fields: S,
122
- issuedCount: W,
123
- messages: f
124
- });
125
- w((n) => {
126
- let r = { ...n };
127
- return e.forEach((e) => {
128
- t[e] ? r[e] = t[e] : delete r[e];
129
- }), r;
130
- });
131
- }, [
132
- W,
133
- f,
134
- S
135
- ]);
136
- let kt = Ge({
137
- values: S,
138
- errors: ot,
139
- lockSchedule: G,
140
- messages: f,
141
- onChange: Tt,
142
- onClearErrors: Et,
143
- onRevalidateErrors: Ot
144
- }), J = kt.reset, At = s((e) => C((t) => ({
145
- ...t,
146
- ...e
147
- })), []), jt = p.isPending || m.isPending || et.isPending || tt.isPending, Mt = qe({
148
- open: v,
149
- isInvoice: S.type === "invoice",
150
- disabled: jt,
151
- paymentTermsId: S.paymentTermsId,
152
- paymentTermsCustomDate: S.paymentTermsCustomDate,
153
- paymentReminderId: S.paymentReminderId,
154
- overdueReminderId: S.overdueReminderId,
155
- messages: f,
156
- onSelect: At
157
- }), Y = Mt.reset, Nt = s(() => {
158
- g.current = [], k(void 0), nt("create"), it(void 0), x(void 0), q.current = void 0, h.current = void 0, C(Ae()), w({}), j(!1), I(!1), F.current = {
159
- lines: !1,
160
- discount: !1
161
- }, z(), J();
162
- }, [z, J]), Pt = s((e = "invoice") => {
163
- V(), H(), J();
164
- let t = {
165
- ...Ae(),
166
- type: e
167
- };
168
- Y(Le(t)), g.current = [], h.current = void 0, q.current = void 0, k(void 0), nt("create"), it(void 0), x(void 0), C(t), w({}), z(), j(!1), I(!1), F.current = {
169
- lines: !1,
170
- discount: !1
171
- }, y(!0);
172
- }, [
173
- z,
174
- V,
175
- H,
176
- J,
177
- Y
178
- ]), Ft = s((e) => {
179
- if (e.type === "credit_note") return;
180
- V(), H(), J();
181
- let t = Fe(e, D);
182
- Y(Le(t)), g.current = e.line_items, _.current = e.currency, h.current = void 0, q.current = void 0, k(void 0), nt("edit"), it(e.id), x(e.type === "invoice" ? e.recurrence_id ?? void 0 : void 0), C(t), w({}), j(!1), I(!1), F.current = {
183
- lines: !1,
184
- discount: !1
185
- }, z(), y(!0);
186
- }, [
187
- z,
188
- V,
189
- H,
190
- J,
191
- Y,
192
- D
193
- ]);
194
- c(() => {
195
- D?.length && C((e) => {
196
- let t = se(e.lineItems, D);
197
- return t === e.lineItems ? e : {
198
- ...e,
199
- lineItems: t
200
- };
201
- });
202
- }, [D]);
203
- let X = R.isUploading, It = s(() => {
204
- X || (B(), y(!1), w({}));
205
- }, [B, X]), Lt = s((e) => {
206
- let t = { ...e };
207
- t.taxRate !== void 0 && (t.taxRate = le(t.taxRate), P.current = !0), t.type !== void 0 && t.type !== "invoice" && B(), t.discount !== void 0 && A && (N.current = !0), t.discountType !== void 0 && (N.current = !0), t.currency !== void 0 && (M.current = !0), C((e) => {
208
- let n = {
209
- ...e,
210
- ...t
211
- };
212
- return t.discount !== void 0 && (n.discount = Te(t.discount, n.discountType, n.currency)), n.currency !== e.currency && (n.lineItems = e.lineItems.map((t) => ({
213
- ...t,
214
- price: ne(t.price, e.currency, n.currency)
215
- }))), (n.currency !== e.currency || n.discountType !== e.discountType) && (n.discount = Se({
216
- value: n.discount,
217
- type: n.discountType,
218
- currency: n.currency
219
- })), n;
220
- });
221
- }, [B, A]), Rt = s(() => I(!0), []), zt = s(() => {
222
- I(!1), N.current = !0, C((e) => ({
223
- ...e,
224
- discount: Se({
225
- value: e.discount,
226
- type: e.discountType,
227
- currency: e.currency
228
- })
229
- }));
230
- }, []), Bt = s(() => {
231
- P.current = !0, C((e) => {
232
- let t = te(e.taxRate);
233
- return t === e.taxRate ? e : {
234
- ...e,
235
- taxRate: t
236
- };
237
- });
238
- }, []), Z = s((e, { validate: t }) => {
239
- t && (M.current = !0), C((t) => ({
240
- ...t,
241
- lineItems: e(t.lineItems)
242
- }));
243
- }, []);
244
- c(() => {
245
- let e = M.current, t = N.current;
246
- if (!e && !t && !P.current) return;
247
- M.current = !1, N.current = !1, P.current = !1, e && (F.current.lines = !0), t && (F.current.discount = !0);
248
- let n = e ? me(S.lineItems, {
249
- currency: S.currency,
250
- messages: f
251
- }) : void 0;
252
- w((t) => {
253
- let r = { ...t };
254
- return F.current.lines && (r.lineItems = e ? n : t.lineItems, r.lineItemsSummary = fe(r.lineItems, ke(S, f))), F.current.discount && (r.discount = Oe(S, f)), r;
255
- });
256
- }, [f, S]);
257
- let Vt = s((e, t) => {
258
- let { unit: n, ...r } = t, i = ce(r);
259
- i.name !== void 0 && (i.productId = ""), n !== void 0 && (i.measureUnitId = n, i.measureUnitName = ""), i.taxable !== void 0 && (P.current = !0), Z((t) => t.map((t) => t.id === e ? {
260
- ...t,
261
- ...i
262
- } : t), { validate: A });
263
- }, [Z, A]), Ht = s((e, t) => {
264
- Z((n) => n.map((n) => n.id === e ? {
265
- ...n,
266
- ...ae({
267
- product: t,
268
- currency: S.currency,
269
- unitNamesById: O
270
- })
271
- } : n), { validate: !0 });
272
- }, [
273
- Z,
274
- O,
275
- S.currency
276
- ]), Q = s((e, t) => {
277
- t && Z((n) => t.kind === "remove" ? n.filter((t) => t.id !== e) : n.map((n) => n.id === e ? {
278
- ...n,
279
- ...t.patch
280
- } : n), { validate: !0 });
281
- }, [Z]), Ut = s((e, t) => {
282
- let n = S.lineItems.find((t) => t.id === e);
283
- n && Q(e, ee({
284
- lineItem: n,
285
- field: t,
286
- rowCount: S.lineItems.length,
287
- currency: S.currency
288
- }));
289
- }, [
290
- Q,
291
- S.currency,
292
- S.lineItems
293
- ]), Wt = s((e, t) => {
294
- let n = S.lineItems.find((t) => t.id === e);
295
- n && Q(e, ue({
296
- lineItem: n,
297
- step: t,
298
- rowCount: S.lineItems.length
299
- }));
300
- }, [Q, S.lineItems]), Gt = s(() => {
301
- let e = re(S.currency);
302
- k(e.id), C((t) => ({
303
- ...t,
304
- lineItems: [...t.lineItems, e]
305
- }));
306
- }, [S.currency]), Kt = s((e) => {
307
- Z((t) => t.length <= 1 ? t : t.filter((t) => t.id !== e), { validate: !0 });
308
- }, [Z]), qt = s(async () => {
309
- if (X || K) return;
310
- if (E.isLoading) {
311
- w({ form: f.lineItemsLoading });
312
- return;
313
- }
314
- let e = de(S.lineItems), n = e.length === S.lineItems.length ? S : {
315
- ...S,
316
- lineItems: e
46
+ dueDate: h([i(e)]),
47
+ paymentTerms: h([g(o, n)])
317
48
  };
318
- n !== S && C(n);
319
- let r = n.type === "invoice" && o(n), i = {
320
- ...Ie({
321
- values: n,
322
- billingAddressId: L,
323
- messages: f
49
+ }
50
+ if (e === "receipt_due") return {
51
+ dueDate: h([i(r)]),
52
+ paymentTerms: h([o.previewDueOnReceipt])
53
+ };
54
+ let u = n?.find((t) => t.id === e);
55
+ if (!u) return c;
56
+ let d = a(u, r), f = [
57
+ u.term_1 && _(o, u.term_1),
58
+ u.term_2 && _(o, u.term_2),
59
+ u.term_final && g(o, u.term_final.number_of_days)
60
+ ].filter((e) => !!e);
61
+ return {
62
+ dueDate: d ? h([i(d)]) : m,
63
+ paymentTerms: f.length > 0 ? h(f) : m
64
+ };
65
+ }
66
+ function y(e, t) {
67
+ return t ? e.previewTaxId.replace("{taxId}", t) : void 0;
68
+ }
69
+ function b(e) {
70
+ return e.length > 0 ? e : void 0;
71
+ }
72
+ function x(e, t) {
73
+ return e ? {
74
+ name: e.type === "organization" ? e.organization.legal_name : void 0,
75
+ addressLines: b(p({
76
+ address: e.address,
77
+ issuerCountry: e.address?.country
78
+ })),
79
+ taxIdLine: y(t, e.tax_id),
80
+ email: e.email ?? void 0,
81
+ phone: e.phone ?? void 0
82
+ } : {};
83
+ }
84
+ function S(e) {
85
+ let t = "organization" in e ? e.organization : e.individual;
86
+ return {
87
+ name: "organization" in e ? e.organization.legal_name : [e.individual.first_name, e.individual.last_name].filter(Boolean).join(" "),
88
+ email: t.email,
89
+ phone: t.phone
90
+ };
91
+ }
92
+ function C({ counterpart: e, billingAddress: t, issuerCountry: n, messages: r }) {
93
+ if (!e) return { kind: "pending" };
94
+ let { name: i, email: a, phone: o } = S(e);
95
+ return i ? {
96
+ kind: "party",
97
+ name: i,
98
+ addressLines: b(p({
99
+ address: t,
100
+ issuerCountry: n
101
+ })),
102
+ taxIdLine: y(r, e.tax_id),
103
+ email: a || void 0,
104
+ phone: o || void 0
105
+ } : { kind: "pending" };
106
+ }
107
+ function w({ lineItems: e, currency: i, unitNamesById: a, messages: s }) {
108
+ return e.filter((e) => !t(e)).map((e) => {
109
+ let t = r(e.price, i), c = n(e.quantity), l = a[e.measureUnitId] || e.measureUnitName;
110
+ return {
111
+ id: e.id,
112
+ name: e.name,
113
+ quantity: String(c),
114
+ price: o({
115
+ amount: t,
116
+ currency: i,
117
+ fallback: ""
324
118
  }),
325
- ...r ? xe({
326
- fields: n,
327
- issuedCount: W,
328
- messages: f
329
- }) : {}
119
+ ...l ? { unit: l } : {},
120
+ taxable: e.taxable ? s.previewTaxableYes : s.previewTaxableNo,
121
+ amount: o({
122
+ amount: Math.round(t * c),
123
+ currency: i,
124
+ fallback: ""
125
+ })
330
126
  };
331
- if (je(i)) {
332
- w(i), j(!0), F.current = {
333
- lines: !0,
334
- discount: !0
335
- };
336
- return;
337
- }
338
- w({});
339
- let a = b === "edit" ? rt : h.current;
340
- try {
341
- let e, t;
342
- if (a) {
343
- let i = await m.mutateAsync({
344
- path: { receivable_id: a },
345
- body: Pe({
346
- values: n,
347
- billingAddressId: L ?? "",
348
- lineItemChanges: Ne({
349
- values: n,
350
- originalLineItems: g.current,
351
- originalCurrency: _.current,
352
- unitNamesById: O,
353
- units: D
354
- })
355
- })
356
- });
357
- gt(), e = a, t = i?.type ?? n.type, r && i && (g.current = i.line_items, _.current = i.currency, n = {
358
- ...n,
359
- lineItems: oe(n.lineItems, i.line_items)
360
- }, C(n));
361
- } else {
362
- let i = await p.mutateAsync({ body: Me({
363
- values: n,
364
- billingAddressId: L ?? "",
365
- unitNamesById: O
366
- }) });
367
- if (!i?.id) {
368
- y(!1), Nt();
369
- return;
370
- }
371
- e = i.id, t = i.type, r && (h.current = i.id, g.current = i.line_items, _.current = i.currency, n = {
372
- ...n,
373
- lineItems: oe(n.lineItems, i.line_items)
374
- }, C(n));
375
- }
376
- r && (U ? await tt.mutateAsync({
377
- path: { recurrence_id: U.id },
378
- body: _e(n, { lockSchedule: G })
379
- }) : await et.mutateAsync({ body: ge(n, e) }));
380
- let i = b === "create";
381
- y(!1), Nt(), i && $e?.(e, t);
382
- } catch (e) {
383
- w({ form: t(e) ?? f.genericError });
127
+ });
128
+ }
129
+ function T(t, n) {
130
+ return new Intl.NumberFormat(void 0, {
131
+ style: "currency",
132
+ currency: n,
133
+ currencySign: "accounting"
134
+ }).format(-t / 10 ** e(n));
135
+ }
136
+ function E({ totals: e, currency: t, taxRate: n, messages: r }) {
137
+ let i = (e) => o({
138
+ amount: e,
139
+ currency: t,
140
+ fallback: ""
141
+ }), a = e.discountAmount > 0, s = e.taxableItemsSubtotal > 0, c = e.nonTaxableItemsSubtotal > 0, l = [{
142
+ id: "subtotal",
143
+ label: r.previewSubtotal,
144
+ value: i(e.subtotal)
145
+ }];
146
+ return a && l.push({
147
+ id: "discount",
148
+ label: r.previewDiscount,
149
+ value: T(e.discountAmount, t)
150
+ }), c && (s || a) && l.push({
151
+ id: "nonTaxableSubtotal",
152
+ label: r.previewNonTaxableSubtotal,
153
+ value: i(e.nonTaxableSubtotal),
154
+ muted: !0
155
+ }), s && (c || a) && l.push({
156
+ id: "taxableSubtotal",
157
+ label: r.previewTaxableSubtotal,
158
+ value: i(e.taxableSubtotal),
159
+ muted: !0
160
+ }), l.push({
161
+ id: "tax",
162
+ label: n ? r.previewTaxWithRate.replace("{rate}", n) : r.previewTax,
163
+ value: i(e.totalTaxes)
164
+ }), {
165
+ rows: l,
166
+ total: {
167
+ label: r.previewTotal,
168
+ value: i(e.total)
384
169
  }
385
- }, [
386
- L,
387
- gt,
388
- p,
389
- et,
390
- rt,
391
- U,
392
- X,
393
- W,
394
- G,
395
- f,
396
- b,
397
- $e,
398
- K,
399
- Nt,
400
- D,
401
- O,
402
- E.isLoading,
403
- m,
404
- tt,
405
- S
406
- ]), Jt = l(() => ({
407
- ...S,
408
- discount: ut ? S.discount : Ce(we(S.discount, S.discountType, S.currency), S.discountType, S.currency),
409
- lineItems: S.lineItems.map(pe)
410
- }), [ut, S]), Yt = l(() => a(S.lineItems), [S.lineItems]), $ = l(() => De(S), [S]), Xt = l(() => Ee($, S.currency), [$, S.currency]);
170
+ };
171
+ }
172
+ function D({ bankDetails: e, canReceivePayments: t, messages: n }) {
173
+ let r = e ? [
174
+ [n.previewAccountHolderName, e.accountHolderName],
175
+ [n.previewRoutingNumber, e.routingNumber],
176
+ [n.previewAccountNumber, e.accountNumber]
177
+ ].filter((e) => !!e[1]).map(([e, t]) => e.replace("{value}", t)) : [];
178
+ if (t || r.length !== 0) return {
179
+ showPayOnline: t,
180
+ bankLines: r
181
+ };
182
+ }
183
+ function O({ values: e, totals: t, entity: n, counterpart: r, billingAddress: a, paymentTerms: o, unitNamesById: s, bankDetails: u, canReceivePayments: d = !1, messages: f, today: p = /* @__PURE__ */ new Date() }) {
184
+ let h = w({
185
+ lineItems: e.lineItems,
186
+ currency: e.currency,
187
+ unitNamesById: s,
188
+ messages: f
189
+ }), g = n?.logo?.url, _ = l(e.issueDate), y = c(_) ? _ : p;
411
190
  return {
412
- open: v,
413
- setOpen: y,
414
- mode: b,
415
- values: S,
416
- sheetValues: Jt,
417
- errors: ot,
418
- setValues: C,
419
- updateValues: Lt,
420
- commitTaxRate: Bt,
421
- focusDiscount: Rt,
422
- commitDiscount: zt,
423
- updateLineItem: Vt,
424
- selectProduct: Ht,
425
- commitLineItem: Ut,
426
- stepLineItem: Wt,
427
- addLineItem: Gt,
428
- removeLineItem: Kt,
429
- attachmentsView: _t,
430
- attachmentsUploading: R.isUploading,
431
- saveDisabled: E.isLoading || R.isUploading || K,
432
- selectAttachmentFiles: R.selectFiles,
433
- setAttachmentIncludeInEmail: R.setIncludeInEmail,
434
- removeAttachment: R.remove,
435
- autoFocusLineItemId: lt,
436
- lineItemUnitOptions: T.unitOptions,
437
- lineItemsLoading: E.isLoading,
438
- lineItemControls: Yt,
439
- totals: $,
440
- totalsView: Xt,
441
- currencySymbol: ie(S.currency),
442
- isSubmitting: jt,
443
- currencyOptions: Je(S.currency),
444
- paymentTerms: xt,
445
- showBillingSection: S.type === "invoice" || b === "edit",
446
- recurrence: kt,
447
- showRecurrenceSection: S.type === "invoice",
448
- recurrenceLoading: K,
449
- submitLabel: S.type === "invoice" && o(S) ? U ? f.recurrenceUpdateButton : f.recurrenceActivateButton : void 0,
450
- showDueDateField: S.type === "quote",
451
- openCreate: Pt,
452
- openEdit: Ft,
453
- close: It,
454
- submit: qt,
455
- units: T,
456
- counterpartView: st,
457
- counterpartForm: yt,
458
- stateOptions: dt,
459
- openCounterpartCreate: yt.openCreate,
460
- bankAccount: Ct,
461
- reminders: Mt
191
+ issuer: x(n, f),
192
+ logo: g ? {
193
+ kind: "image",
194
+ src: g
195
+ } : { kind: "placeholder" },
196
+ billTo: C({
197
+ counterpart: r,
198
+ billingAddress: a,
199
+ issuerCountry: n?.address?.country,
200
+ messages: f
201
+ }),
202
+ invoiceNumber: m,
203
+ issueDate: i(y),
204
+ ...v({
205
+ paymentTermsId: e.paymentTermsId,
206
+ paymentTermsCustomDate: e.paymentTermsCustomDate,
207
+ paymentTerms: o,
208
+ issueDate: y,
209
+ messages: f
210
+ }),
211
+ openingNote: e.openingNote || void 0,
212
+ lineItems: h.length > 0 ? {
213
+ kind: "rows",
214
+ rows: h
215
+ } : { kind: "empty" },
216
+ totals: h.length > 0 ? E({
217
+ totals: t,
218
+ currency: e.currency,
219
+ taxRate: e.taxRate,
220
+ messages: f
221
+ }) : void 0,
222
+ closingNote: e.closingNote || void 0,
223
+ payment: D({
224
+ bankDetails: u,
225
+ canReceivePayments: d,
226
+ messages: f
227
+ })
462
228
  };
463
229
  }
464
230
  //#endregion
465
- export { f as useReceivableForm };
231
+ export { p as buildPreviewAddressLines, v as buildPreviewPaymentTerms, O as buildReceivablePreviewView, f as formatCountryName };