@mindbill/react 0.15.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1296,6 +1296,131 @@ function ConnectedBillStatus({
1296
1296
  );
1297
1297
  }
1298
1298
 
1299
+ // src/bill-lifecycle-surfaces.tsx
1300
+ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
1301
+ function visibleBillLifecycleActions(actions, showUnavailable = false) {
1302
+ return actions.filter((action) => action.enabled || showUnavailable);
1303
+ }
1304
+ function BillLifecycleActions({
1305
+ actions,
1306
+ onAction,
1307
+ showUnavailable = false,
1308
+ disabled = false,
1309
+ appearance,
1310
+ className,
1311
+ style
1312
+ }) {
1313
+ const visible = visibleBillLifecycleActions(actions, showUnavailable);
1314
+ if (!visible.length) return null;
1315
+ return /* @__PURE__ */ jsxs3(
1316
+ "div",
1317
+ {
1318
+ className: ["mb-lifecycle-actions", className].filter(Boolean).join(" "),
1319
+ style: mindBillAppearanceStyle(appearance, style),
1320
+ "aria-label": "Bill actions",
1321
+ children: [
1322
+ /* @__PURE__ */ jsx3("style", { children: lifecycleSurfaceStyles }),
1323
+ visible.map((action) => /* @__PURE__ */ jsxs3("div", { className: "mb-lifecycle-action", children: [
1324
+ /* @__PURE__ */ jsx3(
1325
+ "button",
1326
+ {
1327
+ type: "button",
1328
+ className: action.primary ? "mb-action-button is-primary" : "mb-action-button",
1329
+ disabled: disabled || !action.enabled,
1330
+ onClick: () => onAction(action),
1331
+ children: action.label
1332
+ }
1333
+ ),
1334
+ !action.enabled && action.reason ? /* @__PURE__ */ jsx3("span", { className: "mb-action-reason", children: action.reason }) : null
1335
+ ] }, action.id))
1336
+ ]
1337
+ }
1338
+ );
1339
+ }
1340
+ var activityLabels = {
1341
+ "bill.created": "Bill created",
1342
+ "bill.draft": "Bill saved",
1343
+ "bill.scrub_failed": "Submission needs attention",
1344
+ "bill.submitted": "Bill submitted",
1345
+ "bill.accepted": "Bill accepted",
1346
+ "bill.rejected": "Bill rejected",
1347
+ "bill.denied": "Bill denied",
1348
+ "bill.partially_paid": "Partial payment received",
1349
+ "bill.paid": "Bill paid",
1350
+ "bill.second_review": "Second Bill Review submitted",
1351
+ "bill.lien": "Bill moved to lien",
1352
+ "bill.ibr": "Independent Bill Review submitted",
1353
+ "bill.closed": "Bill closed",
1354
+ "bill.written_off": "Balance written off",
1355
+ "payment.posted": "Payment posted",
1356
+ "eor.received": "EOR received",
1357
+ "bill.autofill_completed": "Bill data extracted"
1358
+ };
1359
+ function billActivityEventLabel(type) {
1360
+ return activityLabels[type] ?? type.replace(/[._-]+/g, " ").replace(/\b\w/g, (character) => character.toUpperCase());
1361
+ }
1362
+ function defaultFormatDate(createdAt) {
1363
+ const parsed = new Date(createdAt);
1364
+ if (Number.isNaN(parsed.getTime())) return createdAt;
1365
+ return new Intl.DateTimeFormat(void 0, {
1366
+ dateStyle: "medium",
1367
+ timeStyle: "short"
1368
+ }).format(parsed);
1369
+ }
1370
+ function BillActivityTimeline({
1371
+ events,
1372
+ emptyLabel = "No bill activity yet.",
1373
+ appearance,
1374
+ className,
1375
+ style,
1376
+ formatDate = defaultFormatDate
1377
+ }) {
1378
+ return /* @__PURE__ */ jsxs3(
1379
+ "section",
1380
+ {
1381
+ className: ["mb-activity", className].filter(Boolean).join(" "),
1382
+ style: mindBillAppearanceStyle(appearance, style),
1383
+ "aria-label": "Bill activity",
1384
+ children: [
1385
+ /* @__PURE__ */ jsx3("style", { children: lifecycleSurfaceStyles }),
1386
+ !events.length ? /* @__PURE__ */ jsx3("p", { className: "mb-activity-empty", children: emptyLabel }) : /* @__PURE__ */ jsx3("ol", { className: "mb-activity-list", children: events.map((event) => /* @__PURE__ */ jsxs3("li", { className: "mb-activity-item", children: [
1387
+ /* @__PURE__ */ jsx3("span", { className: "mb-activity-marker", "aria-hidden": "true" }),
1388
+ /* @__PURE__ */ jsxs3("div", { className: "mb-activity-content", children: [
1389
+ /* @__PURE__ */ jsx3("strong", { children: event.title ?? billActivityEventLabel(event.type) }),
1390
+ event.description ? /* @__PURE__ */ jsx3("p", { children: event.description }) : null,
1391
+ /* @__PURE__ */ jsxs3("span", { children: [
1392
+ formatDate(event.createdAt),
1393
+ event.actor ? ` \xB7 ${event.actor}` : ""
1394
+ ] })
1395
+ ] })
1396
+ ] }, event.id)) })
1397
+ ]
1398
+ }
1399
+ );
1400
+ }
1401
+ var lifecycleSurfaceStyles = `
1402
+ .mb-lifecycle-actions,.mb-activity{box-sizing:border-box;color:var(--mb-text);font-family:var(--mb-font,ui-sans-serif,system-ui,sans-serif)}
1403
+ .mb-lifecycle-actions{display:flex;flex-wrap:wrap;gap:10px;align-items:flex-start}
1404
+ .mb-lifecycle-action{display:grid;gap:5px;max-width:260px}
1405
+ .mb-action-button{appearance:none;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius,8px);background:var(--mb-surface);color:var(--mb-text);font:inherit;font-weight:700;line-height:1.2;padding:11px 15px;cursor:pointer}
1406
+ .mb-action-button:hover:not(:disabled){border-color:var(--mb-accent);color:var(--mb-accent)}
1407
+ .mb-action-button:focus-visible{outline:3px solid color-mix(in srgb,var(--mb-accent) 28%,transparent);outline-offset:2px}
1408
+ .mb-action-button.is-primary{background:var(--mb-accent);border-color:var(--mb-accent);color:var(--mb-accent-contrast)}
1409
+ .mb-action-button:disabled{cursor:not-allowed;opacity:.55}
1410
+ .mb-action-reason{color:var(--mb-muted);font-size:12px;line-height:1.35}
1411
+ .mb-activity{background:var(--mb-surface);border:1px solid var(--mb-border);border-radius:var(--mb-radius,12px);box-shadow:var(--mb-shadow);padding:20px}
1412
+ .mb-activity-list{list-style:none;margin:0;padding:0}
1413
+ .mb-activity-item{display:grid;grid-template-columns:18px minmax(0,1fr);gap:12px;position:relative;padding:0 0 22px}
1414
+ .mb-activity-item:last-child{padding-bottom:0}
1415
+ .mb-activity-item:not(:last-child)::before{background:var(--mb-border);content:"";left:8px;position:absolute;top:10px;bottom:0;width:1px}
1416
+ .mb-activity-marker{background:var(--mb-surface);border:3px solid var(--mb-accent);border-radius:999px;height:11px;margin-top:4px;position:relative;width:11px;z-index:1}
1417
+ .mb-activity-content{display:grid;gap:4px;min-width:0}
1418
+ .mb-activity-content strong{font-size:15px;line-height:1.35}
1419
+ .mb-activity-content p{color:var(--mb-text);font-size:14px;line-height:1.5;margin:0}
1420
+ .mb-activity-content span,.mb-activity-empty{color:var(--mb-muted);font-size:13px;line-height:1.45}
1421
+ .mb-activity-empty{margin:0}
1422
+ `;
1423
+
1299
1424
  // src/connected-bill-lifecycle.tsx
1300
1425
  import {
1301
1426
  useCallback as useCallback2,
@@ -1310,7 +1435,7 @@ import {
1310
1435
  createBillLifecycleClient
1311
1436
  } from "@mindbill/browser";
1312
1437
  import { createBillLifecycleClient as createBillLifecycleClient2 } from "@mindbill/browser";
1313
- import { Fragment as Fragment3, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
1438
+ import { Fragment as Fragment3, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
1314
1439
  var DEFAULT_REFRESH_INTERVAL2 = 6e4;
1315
1440
  function openPdf(blob, filename) {
1316
1441
  const url = URL.createObjectURL(blob);
@@ -1509,18 +1634,18 @@ function SupportingDocumentControl({
1509
1634
  const [file, setFile] = useState3(null);
1510
1635
  const [type, setType] = useState3("appeal");
1511
1636
  const [busy, setBusy] = useState3(false);
1512
- return /* @__PURE__ */ jsxs3("div", { className: "mb-lifecycle-upload", children: [
1513
- /* @__PURE__ */ jsxs3("select", { "aria-label": "Supporting document type", value: type, disabled: disabled || busy, onChange: (event) => setType(event.target.value), children: [
1514
- /* @__PURE__ */ jsx3("option", { value: "appeal", children: "Second Review support" }),
1515
- /* @__PURE__ */ jsx3("option", { value: "final_report", children: "Final report" }),
1516
- /* @__PURE__ */ jsx3("option", { value: "proof_of_service", children: "Proof of service" }),
1517
- /* @__PURE__ */ jsx3("option", { value: "letter_of_attestation", children: "Letter of attestation" }),
1518
- /* @__PURE__ */ jsx3("option", { value: "form_122", children: "DWC Form 122" }),
1519
- /* @__PURE__ */ jsx3("option", { value: "w9", children: "W-9" }),
1520
- /* @__PURE__ */ jsx3("option", { value: "other", children: "Other supporting document" })
1637
+ return /* @__PURE__ */ jsxs4("div", { className: "mb-lifecycle-upload", children: [
1638
+ /* @__PURE__ */ jsxs4("select", { "aria-label": "Supporting document type", value: type, disabled: disabled || busy, onChange: (event) => setType(event.target.value), children: [
1639
+ /* @__PURE__ */ jsx4("option", { value: "appeal", children: "Second Review support" }),
1640
+ /* @__PURE__ */ jsx4("option", { value: "final_report", children: "Final report" }),
1641
+ /* @__PURE__ */ jsx4("option", { value: "proof_of_service", children: "Proof of service" }),
1642
+ /* @__PURE__ */ jsx4("option", { value: "letter_of_attestation", children: "Letter of attestation" }),
1643
+ /* @__PURE__ */ jsx4("option", { value: "form_122", children: "DWC Form 122" }),
1644
+ /* @__PURE__ */ jsx4("option", { value: "w9", children: "W-9" }),
1645
+ /* @__PURE__ */ jsx4("option", { value: "other", children: "Other supporting document" })
1521
1646
  ] }),
1522
- /* @__PURE__ */ jsx3("input", { "aria-label": "Choose supporting PDF", type: "file", accept: "application/pdf,.pdf", disabled: disabled || busy, onChange: (event) => setFile(event.target.files?.[0] ?? null) }),
1523
- /* @__PURE__ */ jsx3("button", { type: "button", className: "mb-lifecycle-button secondary", disabled: disabled || busy || !file, onClick: () => {
1647
+ /* @__PURE__ */ jsx4("input", { "aria-label": "Choose supporting PDF", type: "file", accept: "application/pdf,.pdf", disabled: disabled || busy, onChange: (event) => setFile(event.target.files?.[0] ?? null) }),
1648
+ /* @__PURE__ */ jsx4("button", { type: "button", className: "mb-lifecycle-button secondary", disabled: disabled || busy || !file, onClick: () => {
1524
1649
  if (!file) return;
1525
1650
  setBusy(true);
1526
1651
  void onAdd(file, type).then(() => setFile(null)).catch(() => void 0).finally(() => setBusy(false));
@@ -1572,14 +1697,14 @@ function ConnectedBillLifecycle({
1572
1697
  }));
1573
1698
  }, [data, onChanged]);
1574
1699
  if (lifecycle.isLoading && !data) {
1575
- return /* @__PURE__ */ jsx3(Fragment3, { children: loadingFallback ?? /* @__PURE__ */ jsx3("div", { className: "mb-lifecycle-loading", children: "Loading billing\u2026" }) });
1700
+ return /* @__PURE__ */ jsx4(Fragment3, { children: loadingFallback ?? /* @__PURE__ */ jsx4("div", { className: "mb-lifecycle-loading", children: "Loading billing\u2026" }) });
1576
1701
  }
1577
1702
  if (!data) {
1578
1703
  const error = lifecycle.error ?? new Error("Bill could not be loaded.");
1579
- return /* @__PURE__ */ jsx3(Fragment3, { children: errorFallback?.(error, lifecycle.refresh) ?? /* @__PURE__ */ jsxs3("div", { className: "mb-lifecycle-error", role: "alert", children: [
1580
- /* @__PURE__ */ jsx3("strong", { children: "Billing is unavailable." }),
1581
- /* @__PURE__ */ jsx3("span", { children: error.message }),
1582
- /* @__PURE__ */ jsx3("button", { type: "button", onClick: () => void lifecycle.refresh(), children: "Try again" })
1704
+ return /* @__PURE__ */ jsx4(Fragment3, { children: errorFallback?.(error, lifecycle.refresh) ?? /* @__PURE__ */ jsxs4("div", { className: "mb-lifecycle-error", role: "alert", children: [
1705
+ /* @__PURE__ */ jsx4("strong", { children: "Billing is unavailable." }),
1706
+ /* @__PURE__ */ jsx4("span", { children: error.message }),
1707
+ /* @__PURE__ */ jsx4("button", { type: "button", onClick: () => void lifecycle.refresh(), children: "Try again" })
1583
1708
  ] }) });
1584
1709
  }
1585
1710
  const actionMap = new Map(data.lifecycle.actions.map((action) => [action.id, action]));
@@ -1609,10 +1734,10 @@ function ConnectedBillLifecycle({
1609
1734
  disabled: !action.enabled || lifecycle.isMutating
1610
1735
  }));
1611
1736
  const canEditAndSubmit = Boolean(has("edit_and_submit"));
1612
- return /* @__PURE__ */ jsxs3("section", { className: ["mb-connected-lifecycle", className].filter(Boolean).join(" "), style: mindBillAppearanceStyle(appearance, style), children: [
1613
- /* @__PURE__ */ jsx3("style", { children: CONNECTED_LIFECYCLE_STYLES }),
1614
- /* @__PURE__ */ jsx3("style", { children: CONNECTED_THEME_OVERRIDE_STYLES }),
1615
- canEditAndSubmit ? /* @__PURE__ */ jsx3(
1737
+ return /* @__PURE__ */ jsxs4("section", { className: ["mb-connected-lifecycle", className].filter(Boolean).join(" "), style: mindBillAppearanceStyle(appearance, style), children: [
1738
+ /* @__PURE__ */ jsx4("style", { children: CONNECTED_LIFECYCLE_STYLES }),
1739
+ /* @__PURE__ */ jsx4("style", { children: CONNECTED_THEME_OVERRIDE_STYLES }),
1740
+ canEditAndSubmit ? /* @__PURE__ */ jsx4(
1616
1741
  BillReviewForm,
1617
1742
  {
1618
1743
  data,
@@ -1633,7 +1758,7 @@ function ConnectedBillLifecycle({
1633
1758
  },
1634
1759
  onOpenAttachment: (attachment) => void lifecycle.openAttachment(attachment).catch(() => void 0)
1635
1760
  }
1636
- ) : /* @__PURE__ */ jsx3(
1761
+ ) : /* @__PURE__ */ jsx4(
1637
1762
  BillStatusSummary,
1638
1763
  {
1639
1764
  status: data.lifecycle.state,
@@ -1647,96 +1772,96 @@ function ConnectedBillLifecycle({
1647
1772
  ...appearance ? { appearance } : {}
1648
1773
  }
1649
1774
  ),
1650
- /* @__PURE__ */ jsxs3("div", { className: "mb-lifecycle-toolbar", children: [
1651
- /* @__PURE__ */ jsxs3("div", { children: [
1652
- /* @__PURE__ */ jsxs3("strong", { children: [
1775
+ /* @__PURE__ */ jsxs4("div", { className: "mb-lifecycle-toolbar", children: [
1776
+ /* @__PURE__ */ jsxs4("div", { children: [
1777
+ /* @__PURE__ */ jsxs4("strong", { children: [
1653
1778
  "Bill #",
1654
1779
  data.bill.billNumber
1655
1780
  ] }),
1656
- /* @__PURE__ */ jsx3("span", { children: lifecycle.isRefreshing ? "Refreshing\u2026" : "Status and actions update automatically." })
1781
+ /* @__PURE__ */ jsx4("span", { children: lifecycle.isRefreshing ? "Refreshing\u2026" : "Status and actions update automatically." })
1657
1782
  ] }),
1658
- /* @__PURE__ */ jsxs3("div", { className: "mb-lifecycle-toolbar-actions", children: [
1659
- has("view_eor") ? /* @__PURE__ */ jsx3("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => document.getElementById(`mb-eors-${data.bill.id}`)?.scrollIntoView({ behavior: "smooth", block: "center" }), children: "View EOR" }) : null,
1660
- canEditAndSubmit && has("close") ? /* @__PURE__ */ jsx3("button", { type: "button", className: "mb-lifecycle-button quiet", onClick: () => selectPanel("close"), children: "Close bill" }) : null
1783
+ /* @__PURE__ */ jsxs4("div", { className: "mb-lifecycle-toolbar-actions", children: [
1784
+ has("view_eor") ? /* @__PURE__ */ jsx4("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => document.getElementById(`mb-eors-${data.bill.id}`)?.scrollIntoView({ behavior: "smooth", block: "center" }), children: "View EOR" }) : null,
1785
+ canEditAndSubmit && has("close") ? /* @__PURE__ */ jsx4("button", { type: "button", className: "mb-lifecycle-button quiet", onClick: () => selectPanel("close"), children: "Close bill" }) : null
1661
1786
  ] })
1662
1787
  ] }),
1663
- data.eors.length ? /* @__PURE__ */ jsxs3("section", { className: "mb-lifecycle-card", id: `mb-eors-${data.bill.id}`, children: [
1664
- /* @__PURE__ */ jsxs3("header", { children: [
1665
- /* @__PURE__ */ jsxs3("div", { children: [
1666
- /* @__PURE__ */ jsx3("h3", { children: "Explanation of Review" }),
1667
- /* @__PURE__ */ jsx3("p", { children: "Review the payer response and original PDF before posting payment." })
1788
+ data.eors.length ? /* @__PURE__ */ jsxs4("section", { className: "mb-lifecycle-card", id: `mb-eors-${data.bill.id}`, children: [
1789
+ /* @__PURE__ */ jsxs4("header", { children: [
1790
+ /* @__PURE__ */ jsxs4("div", { children: [
1791
+ /* @__PURE__ */ jsx4("h3", { children: "Explanation of Review" }),
1792
+ /* @__PURE__ */ jsx4("p", { children: "Review the payer response and original PDF before posting payment." })
1668
1793
  ] }),
1669
- /* @__PURE__ */ jsxs3("span", { children: [
1794
+ /* @__PURE__ */ jsxs4("span", { children: [
1670
1795
  data.eors.length,
1671
1796
  " PDF",
1672
1797
  data.eors.length === 1 ? "" : "s"
1673
1798
  ] })
1674
1799
  ] }),
1675
- /* @__PURE__ */ jsx3("ul", { className: "mb-lifecycle-documents", children: data.eors.map((eor) => /* @__PURE__ */ jsxs3("li", { children: [
1676
- /* @__PURE__ */ jsxs3("div", { children: [
1677
- /* @__PURE__ */ jsx3("strong", { children: eor.filename }),
1678
- /* @__PURE__ */ jsx3("span", { children: eor.description || `Added ${new Date(eor.addedAt).toLocaleDateString()}` })
1800
+ /* @__PURE__ */ jsx4("ul", { className: "mb-lifecycle-documents", children: data.eors.map((eor) => /* @__PURE__ */ jsxs4("li", { children: [
1801
+ /* @__PURE__ */ jsxs4("div", { children: [
1802
+ /* @__PURE__ */ jsx4("strong", { children: eor.filename }),
1803
+ /* @__PURE__ */ jsx4("span", { children: eor.description || `Added ${new Date(eor.addedAt).toLocaleDateString()}` })
1679
1804
  ] }),
1680
- /* @__PURE__ */ jsx3("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => void lifecycle.openEor(eor).catch(() => void 0), children: "View PDF" })
1805
+ /* @__PURE__ */ jsx4("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => void lifecycle.openEor(eor).catch(() => void 0), children: "View PDF" })
1681
1806
  ] }, eor.id)) })
1682
1807
  ] }) : null,
1683
- has("independent_bill_review") ? /* @__PURE__ */ jsxs3("div", { className: "mb-lifecycle-info", children: [
1684
- /* @__PURE__ */ jsx3("strong", { children: has("independent_bill_review")?.label }),
1685
- /* @__PURE__ */ jsx3("span", { children: has("independent_bill_review")?.reason })
1808
+ has("independent_bill_review") ? /* @__PURE__ */ jsxs4("div", { className: "mb-lifecycle-info", children: [
1809
+ /* @__PURE__ */ jsx4("strong", { children: has("independent_bill_review")?.label }),
1810
+ /* @__PURE__ */ jsx4("span", { children: has("independent_bill_review")?.reason })
1686
1811
  ] }) : null,
1687
- panel === "correction" ? /* @__PURE__ */ jsxs3("section", { className: "mb-lifecycle-panel", children: [
1688
- /* @__PURE__ */ jsxs3("div", { children: [
1689
- /* @__PURE__ */ jsx3("h3", { children: "Correct and resubmit" }),
1690
- /* @__PURE__ */ jsx3("p", { children: "A new correction draft will preserve this rejected bill in history. Review the copied values before submitting." })
1812
+ panel === "correction" ? /* @__PURE__ */ jsxs4("section", { className: "mb-lifecycle-panel", children: [
1813
+ /* @__PURE__ */ jsxs4("div", { children: [
1814
+ /* @__PURE__ */ jsx4("h3", { children: "Correct and resubmit" }),
1815
+ /* @__PURE__ */ jsx4("p", { children: "A new correction draft will preserve this rejected bill in history. Review the copied values before submitting." })
1691
1816
  ] }),
1692
- /* @__PURE__ */ jsxs3("div", { className: "mb-lifecycle-panel-actions", children: [
1693
- /* @__PURE__ */ jsx3("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
1694
- /* @__PURE__ */ jsx3("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating, onClick: () => void complete("Correction draft created.", lifecycle.startCorrection), children: lifecycle.isMutating ? "Creating\u2026" : "Create correction draft" })
1817
+ /* @__PURE__ */ jsxs4("div", { className: "mb-lifecycle-panel-actions", children: [
1818
+ /* @__PURE__ */ jsx4("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
1819
+ /* @__PURE__ */ jsx4("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating, onClick: () => void complete("Correction draft created.", lifecycle.startCorrection), children: lifecycle.isMutating ? "Creating\u2026" : "Create correction draft" })
1695
1820
  ] })
1696
1821
  ] }) : null,
1697
- panel === "second_review" ? /* @__PURE__ */ jsxs3("section", { className: "mb-lifecycle-panel wide", children: [
1698
- /* @__PURE__ */ jsxs3("div", { children: [
1699
- /* @__PURE__ */ jsx3("h3", { children: "Submit Second Review" }),
1700
- /* @__PURE__ */ jsx3("p", { children: "State why payment is disputed, confirm the payer control number, and choose the supporting documents to send." })
1822
+ panel === "second_review" ? /* @__PURE__ */ jsxs4("section", { className: "mb-lifecycle-panel wide", children: [
1823
+ /* @__PURE__ */ jsxs4("div", { children: [
1824
+ /* @__PURE__ */ jsx4("h3", { children: "Submit Second Review" }),
1825
+ /* @__PURE__ */ jsx4("p", { children: "State why payment is disputed, confirm the payer control number, and choose the supporting documents to send." })
1701
1826
  ] }),
1702
- /* @__PURE__ */ jsxs3("div", { className: "mb-lifecycle-fields two", children: [
1703
- /* @__PURE__ */ jsxs3("label", { children: [
1704
- /* @__PURE__ */ jsx3("span", { children: "Reason for Second Review" }),
1705
- /* @__PURE__ */ jsx3("textarea", { required: true, value: review.reason, onChange: (event) => setReview((current) => ({ ...current, reason: event.target.value })) })
1827
+ /* @__PURE__ */ jsxs4("div", { className: "mb-lifecycle-fields two", children: [
1828
+ /* @__PURE__ */ jsxs4("label", { children: [
1829
+ /* @__PURE__ */ jsx4("span", { children: "Reason for Second Review" }),
1830
+ /* @__PURE__ */ jsx4("textarea", { required: true, value: review.reason, onChange: (event) => setReview((current) => ({ ...current, reason: event.target.value })) })
1706
1831
  ] }),
1707
- /* @__PURE__ */ jsxs3("div", { className: "mb-lifecycle-fields", children: [
1708
- /* @__PURE__ */ jsxs3("label", { children: [
1709
- /* @__PURE__ */ jsx3("span", { children: "Payer claim control number" }),
1710
- /* @__PURE__ */ jsx3("input", { required: true, value: review.payerClaimControlNumber, onChange: (event) => setReview((current) => ({ ...current, payerClaimControlNumber: event.target.value })) })
1832
+ /* @__PURE__ */ jsxs4("div", { className: "mb-lifecycle-fields", children: [
1833
+ /* @__PURE__ */ jsxs4("label", { children: [
1834
+ /* @__PURE__ */ jsx4("span", { children: "Payer claim control number" }),
1835
+ /* @__PURE__ */ jsx4("input", { required: true, value: review.payerClaimControlNumber, onChange: (event) => setReview((current) => ({ ...current, payerClaimControlNumber: event.target.value })) })
1711
1836
  ] }),
1712
- /* @__PURE__ */ jsxs3("label", { children: [
1713
- /* @__PURE__ */ jsx3("span", { children: "Disputed amount" }),
1714
- /* @__PURE__ */ jsx3("input", { type: "number", min: "0.01", step: "0.01", value: review.disputedAmount ?? "", onChange: (event) => setReview((current) => ({ ...current, disputedAmount: event.target.value ? Number(event.target.value) : void 0 })) })
1837
+ /* @__PURE__ */ jsxs4("label", { children: [
1838
+ /* @__PURE__ */ jsx4("span", { children: "Disputed amount" }),
1839
+ /* @__PURE__ */ jsx4("input", { type: "number", min: "0.01", step: "0.01", value: review.disputedAmount ?? "", onChange: (event) => setReview((current) => ({ ...current, disputedAmount: event.target.value ? Number(event.target.value) : void 0 })) })
1715
1840
  ] }),
1716
- /* @__PURE__ */ jsxs3("label", { children: [
1717
- /* @__PURE__ */ jsx3("span", { children: "Send via" }),
1718
- /* @__PURE__ */ jsxs3("select", { value: review.route, onChange: (event) => setReview((current) => ({ ...current, route: event.target.value })), children: [
1719
- /* @__PURE__ */ jsx3("option", { value: "ebill", children: "E-bill" }),
1720
- /* @__PURE__ */ jsx3("option", { value: "fax", children: "Fax" }),
1721
- /* @__PURE__ */ jsx3("option", { value: "mail", children: "Mail" }),
1722
- /* @__PURE__ */ jsx3("option", { value: "email", children: "Email" })
1841
+ /* @__PURE__ */ jsxs4("label", { children: [
1842
+ /* @__PURE__ */ jsx4("span", { children: "Send via" }),
1843
+ /* @__PURE__ */ jsxs4("select", { value: review.route, onChange: (event) => setReview((current) => ({ ...current, route: event.target.value })), children: [
1844
+ /* @__PURE__ */ jsx4("option", { value: "ebill", children: "E-bill" }),
1845
+ /* @__PURE__ */ jsx4("option", { value: "fax", children: "Fax" }),
1846
+ /* @__PURE__ */ jsx4("option", { value: "mail", children: "Mail" }),
1847
+ /* @__PURE__ */ jsx4("option", { value: "email", children: "Email" })
1723
1848
  ] })
1724
1849
  ] })
1725
1850
  ] })
1726
1851
  ] }),
1727
- /* @__PURE__ */ jsxs3("fieldset", { className: "mb-lifecycle-packet", children: [
1728
- /* @__PURE__ */ jsx3("legend", { children: "Supporting packet" }),
1729
- data.bill.attachments.map((attachment) => /* @__PURE__ */ jsxs3("label", { children: [
1730
- /* @__PURE__ */ jsx3("input", { type: "checkbox", checked: review.attachmentIds.includes(attachment.id), onChange: (event) => setReview((current) => ({ ...current, attachmentIds: event.target.checked ? [...current.attachmentIds, attachment.id] : current.attachmentIds.filter((id) => id !== attachment.id) })) }),
1731
- /* @__PURE__ */ jsxs3("span", { children: [
1732
- /* @__PURE__ */ jsx3("strong", { children: attachment.filename }),
1733
- /* @__PURE__ */ jsx3("small", { children: attachment.description || attachment.documentType })
1852
+ /* @__PURE__ */ jsxs4("fieldset", { className: "mb-lifecycle-packet", children: [
1853
+ /* @__PURE__ */ jsx4("legend", { children: "Supporting packet" }),
1854
+ data.bill.attachments.map((attachment) => /* @__PURE__ */ jsxs4("label", { children: [
1855
+ /* @__PURE__ */ jsx4("input", { type: "checkbox", checked: review.attachmentIds.includes(attachment.id), onChange: (event) => setReview((current) => ({ ...current, attachmentIds: event.target.checked ? [...current.attachmentIds, attachment.id] : current.attachmentIds.filter((id) => id !== attachment.id) })) }),
1856
+ /* @__PURE__ */ jsxs4("span", { children: [
1857
+ /* @__PURE__ */ jsx4("strong", { children: attachment.filename }),
1858
+ /* @__PURE__ */ jsx4("small", { children: attachment.description || attachment.documentType })
1734
1859
  ] }),
1735
- /* @__PURE__ */ jsx3("button", { type: "button", onClick: () => void lifecycle.openAttachment(attachment).catch(() => void 0), children: "View" }),
1736
- /* @__PURE__ */ jsx3("button", { type: "button", "aria-label": `Remove ${attachment.filename}`, onClick: () => void lifecycle.removeAttachment(attachment.id).catch(() => void 0), children: "\xD7" })
1860
+ /* @__PURE__ */ jsx4("button", { type: "button", onClick: () => void lifecycle.openAttachment(attachment).catch(() => void 0), children: "View" }),
1861
+ /* @__PURE__ */ jsx4("button", { type: "button", "aria-label": `Remove ${attachment.filename}`, onClick: () => void lifecycle.removeAttachment(attachment.id).catch(() => void 0), children: "\xD7" })
1737
1862
  ] }, attachment.id))
1738
1863
  ] }),
1739
- /* @__PURE__ */ jsx3(SupportingDocumentControl, { disabled: lifecycle.isMutating, onAdd: async (file, type, description) => {
1864
+ /* @__PURE__ */ jsx4(SupportingDocumentControl, { disabled: lifecycle.isMutating, onAdd: async (file, type, description) => {
1740
1865
  const next = await lifecycle.addAttachment(file, type, description);
1741
1866
  setReview((current) => ({
1742
1867
  ...current,
@@ -1746,65 +1871,65 @@ function ConnectedBillLifecycle({
1746
1871
  ]))
1747
1872
  }));
1748
1873
  } }),
1749
- /* @__PURE__ */ jsxs3("div", { className: "mb-lifecycle-panel-actions", children: [
1750
- /* @__PURE__ */ jsx3("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
1751
- /* @__PURE__ */ jsx3("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating || !review.reason.trim() || !review.payerClaimControlNumber.trim(), onClick: () => void complete("Second Review submitted.", () => lifecycle.submitSecondReview(review)), children: lifecycle.isMutating ? "Submitting\u2026" : "Submit Second Review" })
1874
+ /* @__PURE__ */ jsxs4("div", { className: "mb-lifecycle-panel-actions", children: [
1875
+ /* @__PURE__ */ jsx4("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
1876
+ /* @__PURE__ */ jsx4("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating || !review.reason.trim() || !review.payerClaimControlNumber.trim(), onClick: () => void complete("Second Review submitted.", () => lifecycle.submitSecondReview(review)), children: lifecycle.isMutating ? "Submitting\u2026" : "Submit Second Review" })
1752
1877
  ] })
1753
1878
  ] }) : null,
1754
- panel === "payment" ? /* @__PURE__ */ jsxs3("section", { className: "mb-lifecycle-panel", children: [
1755
- /* @__PURE__ */ jsxs3("div", { children: [
1756
- /* @__PURE__ */ jsx3("h3", { children: "Post payment" }),
1757
- /* @__PURE__ */ jsx3("p", { children: "Record funds shown on the EOR. The balance updates and the bill closes automatically when configured." })
1879
+ panel === "payment" ? /* @__PURE__ */ jsxs4("section", { className: "mb-lifecycle-panel", children: [
1880
+ /* @__PURE__ */ jsxs4("div", { children: [
1881
+ /* @__PURE__ */ jsx4("h3", { children: "Post payment" }),
1882
+ /* @__PURE__ */ jsx4("p", { children: "Record funds shown on the EOR. The balance updates and the bill closes automatically when configured." })
1758
1883
  ] }),
1759
- /* @__PURE__ */ jsxs3("div", { className: "mb-lifecycle-fields two", children: [
1760
- /* @__PURE__ */ jsxs3("label", { children: [
1761
- /* @__PURE__ */ jsx3("span", { children: "Amount" }),
1762
- /* @__PURE__ */ jsx3("input", { type: "number", min: "0.01", max: data.bill.balanceDue, step: "0.01", required: true, value: payment.amount || "", onChange: (event) => setPayment((current) => ({ ...current, amount: Number(event.target.value) })) })
1884
+ /* @__PURE__ */ jsxs4("div", { className: "mb-lifecycle-fields two", children: [
1885
+ /* @__PURE__ */ jsxs4("label", { children: [
1886
+ /* @__PURE__ */ jsx4("span", { children: "Amount" }),
1887
+ /* @__PURE__ */ jsx4("input", { type: "number", min: "0.01", max: data.bill.balanceDue, step: "0.01", required: true, value: payment.amount || "", onChange: (event) => setPayment((current) => ({ ...current, amount: Number(event.target.value) })) })
1763
1888
  ] }),
1764
- /* @__PURE__ */ jsxs3("label", { children: [
1765
- /* @__PURE__ */ jsx3("span", { children: "Method" }),
1766
- /* @__PURE__ */ jsxs3("select", { value: payment.method, onChange: (event) => setPayment((current) => ({ ...current, method: event.target.value })), children: [
1767
- /* @__PURE__ */ jsx3("option", { value: "check", children: "Check" }),
1768
- /* @__PURE__ */ jsx3("option", { value: "eft", children: "EFT" })
1889
+ /* @__PURE__ */ jsxs4("label", { children: [
1890
+ /* @__PURE__ */ jsx4("span", { children: "Method" }),
1891
+ /* @__PURE__ */ jsxs4("select", { value: payment.method, onChange: (event) => setPayment((current) => ({ ...current, method: event.target.value })), children: [
1892
+ /* @__PURE__ */ jsx4("option", { value: "check", children: "Check" }),
1893
+ /* @__PURE__ */ jsx4("option", { value: "eft", children: "EFT" })
1769
1894
  ] })
1770
1895
  ] }),
1771
- /* @__PURE__ */ jsxs3("label", { children: [
1772
- /* @__PURE__ */ jsx3("span", { children: payment.method === "check" ? "Check number" : "EFT reference" }),
1773
- /* @__PURE__ */ jsx3("input", { value: payment.checkNumber, onChange: (event) => setPayment((current) => ({ ...current, checkNumber: event.target.value })) })
1896
+ /* @__PURE__ */ jsxs4("label", { children: [
1897
+ /* @__PURE__ */ jsx4("span", { children: payment.method === "check" ? "Check number" : "EFT reference" }),
1898
+ /* @__PURE__ */ jsx4("input", { value: payment.checkNumber, onChange: (event) => setPayment((current) => ({ ...current, checkNumber: event.target.value })) })
1774
1899
  ] }),
1775
- /* @__PURE__ */ jsxs3("label", { children: [
1776
- /* @__PURE__ */ jsx3("span", { children: "Deposit date" }),
1777
- /* @__PURE__ */ jsx3("input", { type: "date", required: true, value: payment.depositDate, onChange: (event) => setPayment((current) => ({ ...current, depositDate: event.target.value })) })
1900
+ /* @__PURE__ */ jsxs4("label", { children: [
1901
+ /* @__PURE__ */ jsx4("span", { children: "Deposit date" }),
1902
+ /* @__PURE__ */ jsx4("input", { type: "date", required: true, value: payment.depositDate, onChange: (event) => setPayment((current) => ({ ...current, depositDate: event.target.value })) })
1778
1903
  ] }),
1779
- /* @__PURE__ */ jsxs3("label", { className: "full", children: [
1780
- /* @__PURE__ */ jsxs3("span", { children: [
1904
+ /* @__PURE__ */ jsxs4("label", { className: "full", children: [
1905
+ /* @__PURE__ */ jsxs4("span", { children: [
1781
1906
  "Note ",
1782
- /* @__PURE__ */ jsx3("small", { children: "Optional" })
1907
+ /* @__PURE__ */ jsx4("small", { children: "Optional" })
1783
1908
  ] }),
1784
- /* @__PURE__ */ jsx3("input", { value: payment.note, onChange: (event) => setPayment((current) => ({ ...current, note: event.target.value })) })
1909
+ /* @__PURE__ */ jsx4("input", { value: payment.note, onChange: (event) => setPayment((current) => ({ ...current, note: event.target.value })) })
1785
1910
  ] })
1786
1911
  ] }),
1787
- /* @__PURE__ */ jsxs3("div", { className: "mb-lifecycle-panel-actions", children: [
1788
- /* @__PURE__ */ jsx3("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
1789
- /* @__PURE__ */ jsx3("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating || payment.amount <= 0 || payment.amount > data.bill.balanceDue || !payment.depositDate, onClick: () => void complete("Payment posted.", () => lifecycle.postPayment(payment)), children: lifecycle.isMutating ? "Posting\u2026" : "Post payment" })
1912
+ /* @__PURE__ */ jsxs4("div", { className: "mb-lifecycle-panel-actions", children: [
1913
+ /* @__PURE__ */ jsx4("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
1914
+ /* @__PURE__ */ jsx4("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating || payment.amount <= 0 || payment.amount > data.bill.balanceDue || !payment.depositDate, onClick: () => void complete("Payment posted.", () => lifecycle.postPayment(payment)), children: lifecycle.isMutating ? "Posting\u2026" : "Post payment" })
1790
1915
  ] })
1791
1916
  ] }) : null,
1792
- panel === "close" ? /* @__PURE__ */ jsxs3("section", { className: "mb-lifecycle-panel danger", children: [
1793
- /* @__PURE__ */ jsxs3("div", { children: [
1794
- /* @__PURE__ */ jsx3("h3", { children: "Close bill" }),
1795
- /* @__PURE__ */ jsx3("p", { children: "Closing removes this bill from active A/R. Any remaining balance will be written off and the original lifecycle is preserved." })
1917
+ panel === "close" ? /* @__PURE__ */ jsxs4("section", { className: "mb-lifecycle-panel danger", children: [
1918
+ /* @__PURE__ */ jsxs4("div", { children: [
1919
+ /* @__PURE__ */ jsx4("h3", { children: "Close bill" }),
1920
+ /* @__PURE__ */ jsx4("p", { children: "Closing removes this bill from active A/R. Any remaining balance will be written off and the original lifecycle is preserved." })
1796
1921
  ] }),
1797
- /* @__PURE__ */ jsxs3("label", { children: [
1798
- /* @__PURE__ */ jsx3("span", { children: "Reason for closing" }),
1799
- /* @__PURE__ */ jsx3("textarea", { required: true, value: closeReason, onChange: (event) => setCloseReason(event.target.value) })
1922
+ /* @__PURE__ */ jsxs4("label", { children: [
1923
+ /* @__PURE__ */ jsx4("span", { children: "Reason for closing" }),
1924
+ /* @__PURE__ */ jsx4("textarea", { required: true, value: closeReason, onChange: (event) => setCloseReason(event.target.value) })
1800
1925
  ] }),
1801
- /* @__PURE__ */ jsxs3("div", { className: "mb-lifecycle-panel-actions", children: [
1802
- /* @__PURE__ */ jsx3("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
1803
- /* @__PURE__ */ jsx3("button", { type: "button", className: "mb-lifecycle-button danger", disabled: lifecycle.isMutating || !closeReason.trim(), onClick: () => void complete("Bill closed.", () => lifecycle.closeBill({ reason: closeReason })), children: lifecycle.isMutating ? "Closing\u2026" : "Close bill" })
1926
+ /* @__PURE__ */ jsxs4("div", { className: "mb-lifecycle-panel-actions", children: [
1927
+ /* @__PURE__ */ jsx4("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
1928
+ /* @__PURE__ */ jsx4("button", { type: "button", className: "mb-lifecycle-button danger", disabled: lifecycle.isMutating || !closeReason.trim(), onClick: () => void complete("Bill closed.", () => lifecycle.closeBill({ reason: closeReason })), children: lifecycle.isMutating ? "Closing\u2026" : "Close bill" })
1804
1929
  ] })
1805
1930
  ] }) : null,
1806
- notice ? /* @__PURE__ */ jsx3("div", { className: "mb-lifecycle-message success", role: "status", children: notice }) : null,
1807
- lifecycle.error ? /* @__PURE__ */ jsx3("div", { className: "mb-lifecycle-message error", role: "alert", children: lifecycle.error.message }) : null
1931
+ notice ? /* @__PURE__ */ jsx4("div", { className: "mb-lifecycle-message success", role: "status", children: notice }) : null,
1932
+ lifecycle.error ? /* @__PURE__ */ jsx4("div", { className: "mb-lifecycle-message error", role: "alert", children: lifecycle.error.message }) : null
1808
1933
  ] });
1809
1934
  }
1810
1935
  var CONNECTED_LIFECYCLE_STYLES = `
@@ -1868,12 +1993,15 @@ function MindBillBillReview(props) {
1868
1993
  return widget("mindbill-bill-review", props);
1869
1994
  }
1870
1995
  export {
1996
+ BillActivityTimeline,
1997
+ BillLifecycleActions,
1871
1998
  BillReviewForm,
1872
1999
  BillStatusSummary,
1873
2000
  ConnectedBillLifecycle,
1874
2001
  ConnectedBillStatus,
1875
2002
  MindBillBillReview,
1876
2003
  MindBillBillTimeline,
2004
+ billActivityEventLabel,
1877
2005
  buildBillReviewSaveInput,
1878
2006
  createBillLifecycleClient2 as createBillLifecycleClient,
1879
2007
  createBillStatusClient,
@@ -1882,6 +2010,7 @@ export {
1882
2010
  mindBillThemePresets,
1883
2011
  resolveMindBillAppearance,
1884
2012
  useBillLifecycle,
1885
- useBillStatus
2013
+ useBillStatus,
2014
+ visibleBillLifecycleActions
1886
2015
  };
1887
2016
  //# sourceMappingURL=index.js.map