@tesouro/embedded-components-react 0.3.45 → 0.3.48

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 (73) hide show
  1. package/README.md +30 -8
  2. package/dist/index.d.ts +80 -35
  3. package/dist/index.js +47 -45
  4. package/dist/lib/BillPayWidget.js +1 -1
  5. package/dist/lib/CreditCardsWidget.d.ts +1347 -0
  6. package/dist/lib/CreditCardsWidget.js +3 -0
  7. package/dist/lib/{CardsWidget.d.ts → DebitCardsWidget.d.ts} +46 -27
  8. package/dist/lib/DebitCardsWidget.js +3 -0
  9. package/dist/lib/WidgetSuite.d.ts +52 -13
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +9 -9
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +42 -39
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +4 -41
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +40 -55
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +56 -5
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +5 -73
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +72 -48
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +47 -91
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +91 -33
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +33 -160
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +163 -75
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +75 -21
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +23 -210
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +198 -202
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +197 -88
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +105 -13
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +12 -46
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +47 -30
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +26 -182
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +187 -31
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +32 -98
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +102 -16
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +16 -301
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +322 -4
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +4 -33
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +31 -83
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +77 -159
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +167 -3
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +3 -4
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +2 -44
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +46 -1
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +1 -8
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +6 -9
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +9 -92
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +94 -3
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +3 -9
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +7 -20
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +14 -51
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +59 -3
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +3 -128
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +125 -8
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +8 -43
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +41 -18
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +20 -28
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +27 -82
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +83 -47
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +47 -250
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +240 -101
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +107 -204
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +211 -3
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +4 -8
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +6 -113
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +115 -1
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +0 -24
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +25 -0
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index44.js +28 -27
  66. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index.js +3 -2
  67. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index10.js +17 -0
  68. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index11.js +17 -0
  69. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  70. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
  71. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index9.js +3 -10
  72. package/package.json +1 -1
  73. package/dist/lib/CardsWidget.js +0 -3
@@ -0,0 +1,3 @@
1
+ import { CreditCardsWidget as e } from "../libs/tesouro-embedded-components-react/cards-widget/feature/dist/index10.js";
2
+ import "../libs/tesouro-embedded-components-react/cards-widget/feature/dist/index.js";
3
+ export { e as CreditCardsWidget };
@@ -1152,25 +1152,45 @@ interface CardsFeatureLabels {
1152
1152
  cardType: Record<CardType, string>;
1153
1153
  }
1154
1154
 
1155
- interface CardsWidgetPagination {
1155
+ /**
1156
+ * What `onPaginationChange` reports. One shared type across both programs — the
1157
+ * shape does not vary by program, so per-program aliases would be published
1158
+ * surface for nothing. Named without the `Widget` segment because no widget
1159
+ * called `CardsWidget` is published any more; `CreditCardsWidget` and
1160
+ * `DebitCardsWidget` both hand back this.
1161
+ */
1162
+ interface CardsPagination {
1156
1163
  /** Cursor for the page on screen. Omit for the first page. */
1157
1164
  paginationToken?: string;
1158
1165
  /** Number of rows requested per page. */
1159
1166
  pageSize: number;
1160
1167
  }
1168
+ /**
1169
+ * The wider shape `pagination` / `defaultPagination` accept. Internal: a
1170
+ * `CardsPagination` handed back by `onPaginationChange` satisfies it, which is
1171
+ * the round-trip the docs describe, so the package publishes only that one.
1172
+ * Keeps the `CardsWidget` segment because the internal component keeps the name.
1173
+ */
1161
1174
  interface CardsWidgetPaginationInput {
1162
1175
  paginationToken?: string;
1163
1176
  pageSize?: number;
1164
1177
  }
1165
1178
 
1179
+ /**
1180
+ * The internal props. Not published: `CreditCardsWidgetProps` and
1181
+ * `DebitCardsWidgetProps` are derived from this by omission, which is what makes
1182
+ * `cardProgram` an implementation detail and the debit-only create props
1183
+ * unreachable on a credit list.
1184
+ */
1166
1185
  interface CardsWidgetProps extends WidgetProviderProps {
1167
1186
  /**
1168
- * Which issuing program the list shows — `'credit'` or `'debit'`.
1187
+ * Which issuing program the list shows — `'credit'` or `'debit'`. It selects
1188
+ * the endpoint that is read as well as which scopes gate the affordances.
1169
1189
  *
1170
- * **Required, with no default.** A cards list shows exactly one program, and
1171
- * the value selects the endpoint that is read as well as which scopes gate the
1172
- * affordances. Defaulting it would make the choice invisible at the call site
1173
- * and would silently pick a program for a host that meant the other one.
1190
+ * **Required, with no default**, and supplied by the wrapper rather than by a
1191
+ * consumer: `CreditCardsWidget` and `DebitCardsWidget` pin it. It was a public
1192
+ * prop until those two exports replaced it, and a default here would silently
1193
+ * pick a program, where an integrator on one route only ever wants one.
1174
1194
  */
1175
1195
  cardProgram: CardProgram;
1176
1196
  /**
@@ -1188,7 +1208,7 @@ interface CardsWidgetProps extends WidgetProviderProps {
1188
1208
  * controls or a cursor-invalidating reset such as page-size changes. Hosts that
1189
1209
  * persist list position should store this whole object, not the token alone.
1190
1210
  */
1191
- onPaginationChange?: (pagination: CardsWidgetPagination) => void;
1211
+ onPaginationChange?: (pagination: CardsPagination) => void;
1192
1212
  /**
1193
1213
  * Overrides for the list's own copy, merged per nested group. Typed with the
1194
1214
  * `ui` lib's own deep-partial helper (each labels module declares one — the
@@ -1297,28 +1317,27 @@ interface CardsWidgetProps extends WidgetProviderProps {
1297
1317
  */
1298
1318
  onActivateCard?: (cardId: string) => void;
1299
1319
  }
1320
+
1300
1321
  /**
1301
- * The cards list widget: one page of an organization's credit or debit cards,
1302
- * with scope-gated Show my cards, Create card and per-row Activate affordances.
1303
- *
1304
- * Selecting a row opens that card's read-only details in a sheet, composed from
1305
- * `CardDetailsWidget` over the sanctioned feature → feature edge. Which card is
1306
- * open is a controllable value (`selectedCardId` / `defaultSelectedCardId` /
1307
- * `onSelectedCardIdChange`) so a host can deep-link into it, mirror it into a
1308
- * query param, or take navigation over entirely — the widget itself reads no
1309
- * router and no search params.
1322
+ * Derived from the internal props rather than restated, so the two cannot drift.
1323
+ * Only `cardProgram` is omitted — the built-in create sheet is debit's, so this
1324
+ * export keeps `cardArtSrc` and the two create-panel label props.
1325
+ */
1326
+ type DebitCardsWidgetProps = Omit<CardsWidgetProps, 'cardProgram'>;
1327
+ /**
1328
+ * One page of an organization's **debit** cards, with scope-gated Show my cards,
1329
+ * Create card and per-row Activate affordances. Selecting a row opens that
1330
+ * card's read-only details in a sheet.
1310
1331
  *
1311
- * On a debit list with `cardArtSrc`, Create card opens the same sheet with
1312
- * nested `CreateCardWidget`. A host `onCreateCard` still takes over that
1313
- * gesture (credit, or a custom debit flow). The two panels are mutually
1314
- * exclusive: opening one closes the other. Success **View card** selects the
1315
- * new debit card so its details open.
1332
+ * With `cardArtSrc`, Create card opens the same sheet with the built-in
1333
+ * `CreateCardWidget` issuance flow; a host `onCreateCard` still takes the
1334
+ * gesture over. Credit is {@link CreditCardsWidget}, which accepts neither
1335
+ * `cardArtSrc` nor the create-panel labels.
1316
1336
  *
1317
- * A pure provider wrapper — every hook lives in `CardsWidgetInner` so it runs
1318
- * inside `WidgetProvider`'s subtree, which is what the data-access hooks read
1319
- * their client, org and token from.
1337
+ * The program is pinned *after* the spread, so a JavaScript host still passing
1338
+ * the retired `cardProgram` cannot point this export at the credit endpoint.
1320
1339
  */
1321
- declare function CardsWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, disclosuresAcceptance, providerLabels, ...innerProps }: CardsWidgetProps): React.JSX.Element;
1340
+ declare function DebitCardsWidget(props: DebitCardsWidgetProps): React.JSX.Element;
1322
1341
 
1323
- export { CardsWidget };
1324
- export type { CardsFeatureLabels as CardsWidgetFeatureLabels, CardsListLabels as CardsWidgetLabels, CardsWidgetPagination, CardsWidgetProps };
1342
+ export { DebitCardsWidget };
1343
+ export type { DebitCardsWidgetProps };
@@ -0,0 +1,3 @@
1
+ import { DebitCardsWidget as e } from "../libs/tesouro-embedded-components-react/cards-widget/feature/dist/index11.js";
2
+ import "../libs/tesouro-embedded-components-react/cards-widget/feature/dist/index.js";
3
+ export { e as DebitCardsWidget };
@@ -1321,25 +1321,45 @@ interface CardsFeatureLabels {
1321
1321
  cardType: Record<CardType, string>;
1322
1322
  }
1323
1323
 
1324
- interface CardsWidgetPagination {
1324
+ /**
1325
+ * What `onPaginationChange` reports. One shared type across both programs — the
1326
+ * shape does not vary by program, so per-program aliases would be published
1327
+ * surface for nothing. Named without the `Widget` segment because no widget
1328
+ * called `CardsWidget` is published any more; `CreditCardsWidget` and
1329
+ * `DebitCardsWidget` both hand back this.
1330
+ */
1331
+ interface CardsPagination {
1325
1332
  /** Cursor for the page on screen. Omit for the first page. */
1326
1333
  paginationToken?: string;
1327
1334
  /** Number of rows requested per page. */
1328
1335
  pageSize: number;
1329
1336
  }
1337
+ /**
1338
+ * The wider shape `pagination` / `defaultPagination` accept. Internal: a
1339
+ * `CardsPagination` handed back by `onPaginationChange` satisfies it, which is
1340
+ * the round-trip the docs describe, so the package publishes only that one.
1341
+ * Keeps the `CardsWidget` segment because the internal component keeps the name.
1342
+ */
1330
1343
  interface CardsWidgetPaginationInput {
1331
1344
  paginationToken?: string;
1332
1345
  pageSize?: number;
1333
1346
  }
1334
1347
 
1348
+ /**
1349
+ * The internal props. Not published: `CreditCardsWidgetProps` and
1350
+ * `DebitCardsWidgetProps` are derived from this by omission, which is what makes
1351
+ * `cardProgram` an implementation detail and the debit-only create props
1352
+ * unreachable on a credit list.
1353
+ */
1335
1354
  interface CardsWidgetProps extends WidgetProviderProps {
1336
1355
  /**
1337
- * Which issuing program the list shows — `'credit'` or `'debit'`.
1356
+ * Which issuing program the list shows — `'credit'` or `'debit'`. It selects
1357
+ * the endpoint that is read as well as which scopes gate the affordances.
1338
1358
  *
1339
- * **Required, with no default.** A cards list shows exactly one program, and
1340
- * the value selects the endpoint that is read as well as which scopes gate the
1341
- * affordances. Defaulting it would make the choice invisible at the call site
1342
- * and would silently pick a program for a host that meant the other one.
1359
+ * **Required, with no default**, and supplied by the wrapper rather than by a
1360
+ * consumer: `CreditCardsWidget` and `DebitCardsWidget` pin it. It was a public
1361
+ * prop until those two exports replaced it, and a default here would silently
1362
+ * pick a program, where an integrator on one route only ever wants one.
1343
1363
  */
1344
1364
  cardProgram: CardProgram;
1345
1365
  /**
@@ -1357,7 +1377,7 @@ interface CardsWidgetProps extends WidgetProviderProps {
1357
1377
  * controls or a cursor-invalidating reset such as page-size changes. Hosts that
1358
1378
  * persist list position should store this whole object, not the token alone.
1359
1379
  */
1360
- onPaginationChange?: (pagination: CardsWidgetPagination) => void;
1380
+ onPaginationChange?: (pagination: CardsPagination) => void;
1361
1381
  /**
1362
1382
  * Overrides for the list's own copy, merged per nested group. Typed with the
1363
1383
  * `ui` lib's own deep-partial helper (each labels module declares one — the
@@ -1467,6 +1487,24 @@ interface CardsWidgetProps extends WidgetProviderProps {
1467
1487
  onActivateCard?: (cardId: string) => void;
1468
1488
  }
1469
1489
 
1490
+ /**
1491
+ * Derived from the internal props rather than restated, so the two cannot drift.
1492
+ *
1493
+ * Four omissions, not one. `cardProgram` is pinned below. The three create-sheet
1494
+ * props are debit-only: the built-in sheet issues against `POST /credit-cards`'s
1495
+ * sibling and `CreateCardWidget` covers debit alone, so credit's Create card
1496
+ * needs a host `onCreateCard` or the button hides. That was prose in the doc; the
1497
+ * type says it here.
1498
+ */
1499
+ type CreditCardsWidgetProps = Omit<CardsWidgetProps, 'cardProgram' | 'cardArtSrc' | 'createCardLabels' | 'createCardFeatureLabels'>;
1500
+
1501
+ /**
1502
+ * Derived from the internal props rather than restated, so the two cannot drift.
1503
+ * Only `cardProgram` is omitted — the built-in create sheet is debit's, so this
1504
+ * export keeps `cardArtSrc` and the two create-panel label props.
1505
+ */
1506
+ type DebitCardsWidgetProps = Omit<CardsWidgetProps, 'cardProgram'>;
1507
+
1470
1508
  interface InsightsWidgetLabels {
1471
1509
  widgetTitle: string;
1472
1510
  activeTab: string;
@@ -1891,15 +1929,16 @@ interface WidgetSuiteDisclosureLabels {
1891
1929
  * A widget's whole copy surface: every label prop it accepts, spread onto it so
1892
1930
  * the props keep the names that widget's own doc gives them.
1893
1931
  *
1894
- * Derived rather than hand-listed: `CardsWidget` alone has six, so a written-out
1895
- * list goes stale the next time one grows a panel. `providerLabels` is excluded
1896
- * because the suite addresses the provider once, at the top level.
1932
+ * Derived rather than hand-listed: the debit card list alone has six, so a
1933
+ * written-out list goes stale the next time one grows a panel. `providerLabels`
1934
+ * is excluded because the suite addresses the provider once, at the top level.
1897
1935
  */
1898
1936
  type WidgetLabelProps<T> = Omit<Pick<T, Extract<keyof T, 'labels' | `${string}Labels`>>, 'providerLabels'>;
1899
1937
  type WidgetSuiteBalancesLabels = WidgetLabelProps<BalancesWidgetProps>;
1900
1938
  type WidgetSuiteInsightsLabels = WidgetLabelProps<InsightsWidgetProps>;
1901
1939
  type WidgetSuiteAccountsLabels = WidgetLabelProps<BankAccountsWidgetProps>;
1902
- type WidgetSuiteCardsListLabels = WidgetLabelProps<CardsWidgetProps>;
1940
+ type WidgetSuiteCreditCardsLabels = WidgetLabelProps<CreditCardsWidgetProps>;
1941
+ type WidgetSuiteDebitCardsLabels = WidgetLabelProps<DebitCardsWidgetProps>;
1903
1942
  type WidgetSuiteTransfersLabels = WidgetLabelProps<TransfersWidgetProps>;
1904
1943
  type WidgetSuiteSettingsLabels = WidgetLabelProps<SettingsWidgetProps>;
1905
1944
  /** The two widgets the Dashboard section pairs, each taking its own copy. */
@@ -1915,8 +1954,8 @@ interface WidgetSuiteDashboardLabels {
1915
1954
  * each is retitled by program.
1916
1955
  */
1917
1956
  interface WidgetSuiteCardsLabels {
1918
- creditCards: WidgetSuiteCardsListLabels;
1919
- debitCards: WidgetSuiteCardsListLabels;
1957
+ creditCards: WidgetSuiteCreditCardsLabels;
1958
+ debitCards: WidgetSuiteDebitCardsLabels;
1920
1959
  }
1921
1960
  /** Expenses is only a placeholder until the suite wires a read/self surface. */
1922
1961
  interface WidgetSuiteExpensesLabels {
@@ -1,16 +1,15 @@
1
1
  import "./index13.js";
2
2
  import "./index14.js";
3
- import "./index25.js";
4
- import "./index31.js";
5
- import "./index40.js";
6
- import "./index42.js";
7
- import "./index44.js";
3
+ import "./index26.js";
4
+ import "./index32.js";
5
+ import "./index41.js";
6
+ import "./index43.js";
8
7
  import "./index45.js";
9
8
  import "./index46.js";
10
9
  import "./index47.js";
11
10
  import "./index48.js";
12
11
  import "./index49.js";
13
- import "./index53.js";
12
+ import "./index50.js";
14
13
  import "./index54.js";
15
14
  import "./index55.js";
16
15
  import "./index56.js";
@@ -19,9 +18,10 @@ import "./index58.js";
19
18
  import "./index59.js";
20
19
  import "./index60.js";
21
20
  import "./index61.js";
22
- import "./index63.js";
23
- import "./index69.js";
21
+ import "./index62.js";
22
+ import "./index64.js";
24
23
  import "./index70.js";
25
24
  import "./index71.js";
26
- import { BillPayWidget as e } from "./index75.js";
25
+ import "./index72.js";
26
+ import { BillPayWidget as e } from "./index76.js";
27
27
  export { e as BillPayWidget };
@@ -13,10 +13,10 @@ import { getBillDetailActions as l } from "./index21.js";
13
13
  import { useState as u } from "react";
14
14
  import { HandIcon as d } from "lucide-react";
15
15
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js
16
- function f({ payableId: d, status: f, currentApprovalRequestId: m, isPolicyApprover: _, hasWaitingRequest: v, arePendingApproversUnknown: y, hasScheduledPayment: b, scheduledPaymentIntentId: x, isScheduledPaymentUnknown: S, labels: C, isMarkAsPaidPending: w, pendingApprovers: T, onPayBillSelect: E, onMarkAsPaidSelect: D }) {
17
- let { initResponse: O } = t(), k = r(), A = n(), j = i(), M = a(), N = c(), P = o(), F = s(), I = w || k.isPending || A.isPending || j.isPending || M.isPending || N.isPending || P.isPending || F.isPending, [L, R] = u(), z = L && (L.id !== "cancelScheduledPayment" || L.scheduledPaymentIntentId === x) ? L : void 0, B = d && f ? l({
16
+ function f({ payableId: d, status: f, currentApprovalRequestId: m, isPolicyApprover: _, hasWaitingRequest: v, arePendingApproversUnknown: y, hasScheduledPayment: b, scheduledPaymentIntentId: x, isScheduledPaymentUnknown: S, labels: C, isMarkAsPaidPending: w, pendingApprovers: T, onPayBillSelect: E, onMarkAsPaidSelect: D, onActionSucceeded: O }) {
17
+ let { initResponse: k } = t(), A = r(), j = n(), M = i(), N = a(), P = c(), F = o(), I = s(), L = w || A.isPending || j.isPending || M.isPending || N.isPending || P.isPending || F.isPending || I.isPending, [R, z] = u(), B = R && (R.id !== "cancelScheduledPayment" || R.scheduledPaymentIntentId === x) ? R : void 0, V = d && f ? l({
18
18
  status: f,
19
- scopes: O?.scopes,
19
+ scopes: k?.scopes,
20
20
  canDecideApprovalRequest: !!m,
21
21
  isPolicyApprover: _,
22
22
  hasWaitingRequest: v,
@@ -24,53 +24,55 @@ function f({ payableId: d, status: f, currentApprovalRequestId: m, isPolicyAppro
24
24
  hasScheduledPayment: b || S,
25
25
  scheduledPaymentIntentId: x,
26
26
  labels: C
27
- }) : [], V = (t) => ({
27
+ }) : [], H = (t) => ({
28
28
  onError: () => e.error(C.actionError),
29
- onSuccess: () => e.success(C.actionSuccess[t])
30
- }), H = {
29
+ onSuccess: () => {
30
+ e.success(C.actionSuccess[t]), O?.();
31
+ }
32
+ }), U = {
31
33
  reject: {
32
- isPending: k.isPending,
33
- run: (e) => m && k.mutate({
34
+ isPending: A.isPending,
35
+ run: (e) => m && A.mutate({
34
36
  path: { approval_request_id: m },
35
37
  body: e ? { reject_reason: e } : void 0
36
- }, V("reject"))
38
+ }, H("reject"))
37
39
  },
38
40
  approve: {
39
- isPending: A.isPending,
40
- run: () => m && A.mutate({ path: { approval_request_id: m } }, V("approve"))
41
+ isPending: j.isPending,
42
+ run: () => m && j.mutate({ path: { approval_request_id: m } }, H("approve"))
41
43
  },
42
44
  cancel: {
43
- isPending: j.isPending,
44
- run: () => d && j.mutate({ path: { payable_id: d } }, V("cancel"))
45
+ isPending: M.isPending,
46
+ run: () => d && M.mutate({ path: { payable_id: d } }, H("cancel"))
45
47
  },
46
48
  cancelScheduledPayment: {
47
- isPending: M.isPending,
49
+ isPending: N.isPending,
48
50
  run: () => {
49
- let e = z?.scheduledPaymentIntentId;
50
- !d || !e || M.mutate({
51
+ let e = B?.scheduledPaymentIntentId;
52
+ !d || !e || N.mutate({
51
53
  path: { payment_intent_id: e },
52
54
  payableId: d
53
- }, V("cancelScheduledPayment"));
55
+ }, H("cancelScheduledPayment"));
54
56
  }
55
57
  },
56
58
  reopen: {
57
- isPending: N.isPending,
58
- run: () => d && N.mutate({ path: { payable_id: d } }, V("reopen"))
59
+ isPending: P.isPending,
60
+ run: () => d && P.mutate({ path: { payable_id: d } }, H("reopen"))
59
61
  },
60
62
  forceApprove: {
61
- isPending: P.isPending,
62
- run: () => d && P.mutate({ path: { payable_id: d } }, V("forceApprove"))
63
+ isPending: F.isPending,
64
+ run: () => d && F.mutate({ path: { payable_id: d } }, H("forceApprove"))
63
65
  },
64
66
  forceReject: {
65
- isPending: F.isPending,
66
- run: () => d && F.mutate({ path: { payable_id: d } }, V("forceReject"))
67
+ isPending: I.isPending,
68
+ run: () => d && I.mutate({ path: { payable_id: d } }, H("forceReject"))
67
69
  }
68
- }, U = B.map((e) => ({
70
+ }, W = V.map((e) => ({
69
71
  ...e,
70
- disabled: I,
71
- loading: e.id === "markAsPaid" ? w : H[e.id]?.isPending ?? !1,
72
+ disabled: L,
73
+ loading: e.id === "markAsPaid" ? w : U[e.id]?.isPending ?? !1,
72
74
  onSelect: () => {
73
- if (!(I || !d)) {
75
+ if (!(L || !d)) {
74
76
  if (e.id === "payBill") {
75
77
  E();
76
78
  return;
@@ -80,34 +82,35 @@ function f({ payableId: d, status: f, currentApprovalRequestId: m, isPolicyAppro
80
82
  return;
81
83
  }
82
84
  if (h(e.id)) {
83
- R({
85
+ z({
84
86
  id: e.id,
85
87
  scheduledPaymentIntentId: x
86
88
  });
87
89
  return;
88
90
  }
89
- H[e.id]?.run();
91
+ U[e.id]?.run();
90
92
  }
91
93
  }
92
94
  }));
93
95
  return {
96
+ isActionPending: L,
94
97
  actions: {
95
- row: U.filter((e) => e.surface === "row"),
96
- menu: U.filter((e) => e.surface === "menu")
98
+ row: W.filter((e) => e.surface === "row"),
99
+ menu: W.filter((e) => e.surface === "menu")
97
100
  },
98
101
  decisionDialog: {
99
- open: !!z,
100
- copy: z ? {
101
- ...C.decisionDialog[z.id],
102
- presentation: g(z.id) ? p : void 0,
103
- pendingApprovers: g(z.id) ? T ?? [] : void 0
102
+ open: !!B,
103
+ copy: B ? {
104
+ ...C.decisionDialog[B.id],
105
+ presentation: g(B.id) ? p : void 0,
106
+ pendingApprovers: g(B.id) ? T ?? [] : void 0
104
107
  } : void 0,
105
- isPending: z ? H[z.id]?.isPending ?? !1 : !1,
108
+ isPending: B ? U[B.id]?.isPending ?? !1 : !1,
106
109
  onCancel: () => {
107
- I || R(void 0);
110
+ L || z(void 0);
108
111
  },
109
112
  onConfirm: (e) => {
110
- !z || I || (H[z.id]?.run(e), R(void 0));
113
+ !B || L || (U[B.id]?.run(e), z(void 0));
111
114
  }
112
115
  }
113
116
  };
@@ -1,44 +1,7 @@
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 { hasAnyScope as t } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
7
- import { Scope as n } from "../../../shared/data-access/dist/lib/scopes.js";
8
- import "../../../shared/data-access/dist/index.js";
9
- import "../../../shared/ui/dist/index.js";
10
- import { useWidgetConfig as r } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
11
- import "../../../shared/feature/dist/index.js";
12
- import { useDeletePayableMutation as i } from "../../data-access/dist/index11.js";
13
- import "../../data-access/dist/index.js";
14
- import { useState as a } from "react";
15
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js
16
- function o({ payableId: o, status: s, enabled: c = !0, labels: l, onDeleted: u }) {
17
- let { initResponse: d } = r(), f = i(), [p, m] = a(!1), h = t(d?.scopes, [n.PayableWriteOrg]), g = !!(c && o && s === "draft" && h), _ = g ? [{
18
- id: "deleteDraft",
19
- label: l.menuItem,
20
- destructive: !0,
21
- onSelect: () => m(!0)
22
- }] : [], v = p && g;
23
- return {
24
- menuItems: _,
25
- dialog: {
26
- open: v,
27
- copy: v ? l.dialog : void 0,
28
- isPending: f.isPending,
29
- onCancel: () => {
30
- f.isPending || m(!1);
31
- },
32
- onConfirm: () => {
33
- !g || !o || f.isPending || f.mutate({ path: { payable_id: o } }, {
34
- onError: () => e.error(l.error),
35
- onSuccess: () => {
36
- m(!1), u();
37
- }
38
- });
39
- }
40
- }
41
- };
2
+ var e = /* @__PURE__ */ new Set(["draft", "new"]);
3
+ function t(t) {
4
+ return !!(t && e.has(t));
42
5
  }
43
6
  //#endregion
44
- export { o as useDraftDelete };
7
+ export { t as isEditablePayableStatus };
@@ -1,59 +1,44 @@
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 { hasAnyScope as t } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
7
+ import { Scope as n } from "../../../shared/data-access/dist/lib/scopes.js";
8
+ import "../../../shared/data-access/dist/index.js";
9
+ import "../../../shared/ui/dist/index.js";
10
+ import { useWidgetConfig as r } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
11
+ import "../../../shared/feature/dist/index.js";
12
+ import { useDeletePayableMutation as i } from "../../data-access/dist/index11.js";
13
+ import "../../data-access/dist/index.js";
14
+ import { useState as a } from "react";
1
15
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js
2
- var e = /* @__PURE__ */ new Set([
3
- "new",
4
- "approve_in_progress",
5
- "waiting_to_be_paid",
6
- "partially_paid"
7
- ]);
8
- function t(e, t) {
9
- let n = /* @__PURE__ */ new Date(`${e.slice(0, 10)}T00:00:00Z`), r = Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate());
10
- return n.getTime() < r;
11
- }
12
- function n({ apiStatus: n, dueDate: r, scheduledPaymentDate: i, hasScheduledPayment: a = !!i, now: o = /* @__PURE__ */ new Date() }) {
13
- if (e.has(n) && a) return {
14
- status: "scheduled",
15
- tone: "accent",
16
- isOverdue: !1
16
+ function o({ payableId: o, status: s, enabled: c = !0, labels: l, onDeleted: u }) {
17
+ let { initResponse: d } = r(), f = i(), [p, m] = a(!1), h = t(d?.scopes, [n.PayableWriteOrg]), g = !!(c && o && s === "draft" && h), _ = g ? [{
18
+ id: "deleteDraft",
19
+ label: l.menuItem,
20
+ destructive: !0,
21
+ onSelect: () => m(!0)
22
+ }] : [], v = p && g;
23
+ return {
24
+ menuItems: _,
25
+ dialog: {
26
+ open: v,
27
+ copy: v ? l.dialog : void 0,
28
+ isPending: f.isPending,
29
+ onCancel: () => {
30
+ f.isPending || m(!1);
31
+ },
32
+ onConfirm: () => {
33
+ !g || !o || f.isPending || f.mutate({ path: { payable_id: o } }, {
34
+ onError: () => e.error(l.error),
35
+ onSuccess: () => {
36
+ m(!1), u();
37
+ }
38
+ });
39
+ }
40
+ }
17
41
  };
18
- let s = !!(e.has(n) && r && t(r, o));
19
- switch (n) {
20
- case "draft": return {
21
- status: "draft",
22
- tone: "neutral",
23
- isOverdue: s
24
- };
25
- case "new":
26
- case "approve_in_progress": return {
27
- status: "pending_approval",
28
- tone: "warning",
29
- isOverdue: s
30
- };
31
- case "waiting_to_be_paid": return {
32
- status: "ready_to_pay",
33
- tone: "info",
34
- isOverdue: s
35
- };
36
- case "partially_paid": return {
37
- status: "partially_paid",
38
- tone: "success",
39
- isOverdue: s
40
- };
41
- case "paid": return {
42
- status: "paid",
43
- tone: "success",
44
- isOverdue: s
45
- };
46
- case "canceled": return {
47
- status: "canceled",
48
- tone: "muted",
49
- isOverdue: s
50
- };
51
- case "rejected": return {
52
- status: "rejected",
53
- tone: "danger",
54
- isOverdue: s
55
- };
56
- }
57
42
  }
58
43
  //#endregion
59
- export { n as derivePayableStatus };
44
+ export { o as useDraftDelete };
@@ -1,8 +1,59 @@
1
- import { formatMoneyExact as e } from "../../../shared/util/dist/lib/formatMoneyExact.js";
2
- import "../../data-access/dist/index.js";
3
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js
4
- function t(t, n) {
5
- if (typeof t == "number") return e(t / 100, { currencyCode: n ?? "USD" });
2
+ var e = /* @__PURE__ */ new Set([
3
+ "new",
4
+ "approve_in_progress",
5
+ "waiting_to_be_paid",
6
+ "partially_paid"
7
+ ]);
8
+ function t(e, t) {
9
+ let n = /* @__PURE__ */ new Date(`${e.slice(0, 10)}T00:00:00Z`), r = Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate());
10
+ return n.getTime() < r;
11
+ }
12
+ function n({ apiStatus: n, dueDate: r, scheduledPaymentDate: i, hasScheduledPayment: a = !!i, now: o = /* @__PURE__ */ new Date() }) {
13
+ if (e.has(n) && a) return {
14
+ status: "scheduled",
15
+ tone: "accent",
16
+ isOverdue: !1
17
+ };
18
+ let s = !!(e.has(n) && r && t(r, o));
19
+ switch (n) {
20
+ case "draft": return {
21
+ status: "draft",
22
+ tone: "neutral",
23
+ isOverdue: s
24
+ };
25
+ case "new":
26
+ case "approve_in_progress": return {
27
+ status: "pending_approval",
28
+ tone: "warning",
29
+ isOverdue: s
30
+ };
31
+ case "waiting_to_be_paid": return {
32
+ status: "ready_to_pay",
33
+ tone: "info",
34
+ isOverdue: s
35
+ };
36
+ case "partially_paid": return {
37
+ status: "partially_paid",
38
+ tone: "success",
39
+ isOverdue: s
40
+ };
41
+ case "paid": return {
42
+ status: "paid",
43
+ tone: "success",
44
+ isOverdue: s
45
+ };
46
+ case "canceled": return {
47
+ status: "canceled",
48
+ tone: "muted",
49
+ isOverdue: s
50
+ };
51
+ case "rejected": return {
52
+ status: "rejected",
53
+ tone: "danger",
54
+ isOverdue: s
55
+ };
56
+ }
6
57
  }
7
58
  //#endregion
8
- export { t as formatBillMoney };
59
+ export { n as derivePayableStatus };