@mindbill/react 0.28.2 → 0.30.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
@@ -2,7 +2,7 @@
2
2
 
3
3
  // src/index.tsx
4
4
  import "@mindbill/embed";
5
- import { createElement, useEffect as useEffect6, useRef as useRef5 } from "react";
5
+ import { createElement, useEffect as useEffect7, useRef as useRef6 } from "react";
6
6
 
7
7
  // src/appearance.ts
8
8
  var mindBillThemePresets = {
@@ -1787,9 +1787,9 @@ var css = `
1787
1787
  .mbsf-payer-status{display:flex;align-items:center;gap:7px;color:#087f5b;font-size:13px;font-weight:650}.mbsf-payer-intro{margin:4px 0 0;color:var(--mb-muted)}.mbsf-payer-list{display:grid;gap:8px}.mbsf-payer-option{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:11px 12px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);background:color-mix(in srgb,var(--mb-accent) 3%,var(--mb-surface))}.mbsf-payer-option-main{display:grid;gap:5px;min-width:0}.mbsf-payer-option-main strong{overflow-wrap:anywhere}.mbsf-payer-signals{display:flex;flex-wrap:wrap;gap:6px}.mbsf-payer-signal{padding:2px 7px;border:1px solid var(--mb-border);border-radius:999px;color:var(--mb-muted);font-size:12px}.mbsf-payer-signal[data-state=match]{border-color:color-mix(in srgb,#159447 45%,var(--mb-border));color:#087f5b}.mbsf-payer-signal[data-state=warning]{border-color:color-mix(in srgb,#c56a00 55%,var(--mb-border));color:#9a5200}
1788
1788
  .mbsf-chips,.mbsf-quick-picks{display:flex;flex-wrap:wrap;gap:7px;margin-bottom:8px}.mbsf-chip,.mbsf-quick-pick{display:inline-flex;align-items:center;gap:7px;padding:5px 9px;border:1px solid var(--mb-border);border-radius:999px;background:var(--mb-input)}.mbsf-chip button{border:0;background:transparent;color:var(--mb-muted);cursor:pointer;font:inherit}.mbsf-quick-pick{color:var(--mb-text);font:inherit;cursor:pointer}.mbsf-quick-pick[data-selected=true]{border-color:var(--mb-accent);color:var(--mb-accent)}
1789
1789
  .mbsf-segments{display:grid;grid-template-columns:repeat(3,1fr);border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);overflow:hidden}.mbsf-segment{min-height:44px;border:0;border-right:1px solid var(--mb-border);background:var(--mb-input);color:var(--mb-text);font:inherit;font-weight:700;cursor:pointer}.mbsf-segment:last-child{border-right:0}.mbsf-segment[aria-pressed=true]{background:var(--mb-accent);color:var(--mb-accent-contrast)}
1790
- .mbsf-lines{margin-top:18px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);overflow:visible}.mbsf-lines[data-invalid=true]{border-color:var(--mb-danger)}.mbsf-line-head,.mbsf-line{display:grid;grid-template-columns:minmax(190px,1.05fr) minmax(220px,1.5fr) 100px 120px 42px;gap:12px;align-items:start;padding:12px}.mbsf-line-head{color:var(--mb-muted);font-size:13px;font-weight:700;border-bottom:1px solid var(--mb-border)}.mbsf-line{border-bottom:1px solid var(--mb-border)}.mbsf-line:last-child{border-bottom:0}.mbsf-line [data-invalid=true] .mbsf-input{border-color:var(--mb-danger);background:color-mix(in srgb,var(--mb-danger) 4%,var(--mb-input))}.mbsf-money{padding-top:12px;text-align:right;font-variant-numeric:tabular-nums}.mbsf-total{display:flex;justify-content:flex-end;gap:45px;padding:16px 56px 16px 16px;font-size:17px;font-weight:760}
1790
+ .mbsf-lines{margin-top:18px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);overflow:visible}.mbsf-lines[data-invalid=true]{border-color:var(--mb-danger)}.mbsf-line-head,.mbsf-line{display:grid;grid-template-columns:minmax(190px,1.05fr) minmax(190px,1.3fr) minmax(112px,.7fr) 100px 120px 42px;gap:12px;align-items:start;padding:12px}.mbsf-line-head{color:var(--mb-muted);font-size:13px;font-weight:700;border-bottom:1px solid var(--mb-border)}.mbsf-line{border-bottom:1px solid var(--mb-border)}.mbsf-line:last-child{border-bottom:0}.mbsf-line [data-invalid=true] .mbsf-input{border-color:var(--mb-danger);background:color-mix(in srgb,var(--mb-danger) 4%,var(--mb-input))}.mbsf-money{padding-top:12px;text-align:right;font-variant-numeric:tabular-nums}.mbsf-dx{display:flex;flex-wrap:wrap;gap:5px;padding-top:6px}.mbsf-dx-chip{width:30px;height:30px;border:1px solid var(--mb-border);border-radius:8px;background:var(--mb-surface);color:var(--mb-muted);font:inherit;font-size:13px;font-weight:750;cursor:pointer}.mbsf-dx-chip[data-active=true]{border-color:var(--mb-accent);background:color-mix(in srgb,var(--mb-accent) 10%,var(--mb-surface));color:var(--mb-accent)}.mbsf-total{display:flex;justify-content:flex-end;gap:45px;padding:16px 56px 16px 16px;font-size:17px;font-weight:760}
1791
1791
  .mbsf-icon-btn{width:40px;height:42px;border:0;background:transparent;color:var(--mb-text);font-size:22px;cursor:pointer}.mbsf-secondary{min-height:40px;padding:8px 14px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);background:var(--mb-surface);color:var(--mb-text);font:inherit;font-weight:680;cursor:pointer}.mbsf-attach-list{display:grid;gap:10px;margin-bottom:18px}.mbsf-attach-row{padding:14px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius)}.mbsf-attach-row[data-auto=true]{border-color:color-mix(in srgb,#159447 45%,var(--mb-border));background:color-mix(in srgb,#159447 5%,var(--mb-surface))}.mbsf-attach-main{display:flex;align-items:center;gap:12px;min-width:0;flex:1}.mbsf-attach-type{width:min(360px,32vw);flex:0 1 360px}.mbsf-attach-type .mbsf-label{display:block;margin-bottom:6px;font-size:12px}.mbsf-attach-actions{display:flex;align-items:center;gap:6px;flex:0 0 auto}.mbsf-file{min-width:0}.mbsf-file strong{overflow-wrap:anywhere}.mbsf-badge{display:inline-block;margin-left:8px;padding:2px 7px;border:1px solid var(--mb-border);border-radius:7px;color:var(--mb-muted);font-size:12px;font-weight:600}.mbsf-drop{display:grid;width:100%;place-items:center;min-height:210px;padding:30px;border:2px dashed color-mix(in srgb,var(--mb-muted) 55%,transparent);border-radius:var(--mb-control-radius);background:color-mix(in srgb,var(--mb-accent) 3%,var(--mb-surface));color:var(--mb-text);font:inherit;text-align:center;cursor:pointer}.mbsf-drop[data-active=true]{border-color:var(--mb-accent);background:color-mix(in srgb,var(--mb-accent) 10%,var(--mb-surface))}.mbsf-alert{padding:12px 14px;border-radius:var(--mb-control-radius);background:color-mix(in srgb,var(--mb-danger) 10%,transparent);color:var(--mb-danger)}.mbsf-actions{justify-content:flex-end}.mbsf-submit{min-width:180px;min-height:48px;padding:11px 24px;border:0;border-radius:var(--mb-control-radius);background:var(--mb-accent);color:var(--mb-accent-contrast);font:inherit;font-weight:780;cursor:pointer}
1792
- @media(max-width:820px){.mbsf{gap:16px}.mbsf-grid{grid-template-columns:1fr}.mbsf-span{grid-column:auto}.mbsf-card{padding:18px 16px}.mbsf-line-head{display:none}.mbsf-line{position:relative;display:grid;grid-template-columns:minmax(0,1fr) 86px;gap:14px;padding:18px 16px}.mbsf-line>div:before{display:block;margin-bottom:6px;color:var(--mb-muted);font-size:12px;font-weight:700;content:attr(data-label)}.mbsf-line>div:nth-child(1),.mbsf-line>div:nth-child(2){grid-column:1/-1}.mbsf-money{align-self:end;padding:0 0 12px;text-align:right}.mbsf-line .mbsf-icon-btn{position:absolute;right:8px;bottom:3px}.mbsf-total{padding:16px 18px;gap:24px}.mbsf-head{align-items:flex-start}.mbsf-segments{grid-template-columns:repeat(3,minmax(0,1fr))}.mbsf-segment{min-width:0;padding:8px 4px;border-right:1px solid var(--mb-border);border-bottom:0;font-size:13px}.mbsf-segment:last-child{border-right:0}.mbsf-payer-option{align-items:flex-start}.mbsf-attach-row{align-items:flex-start;flex-wrap:wrap}.mbsf-attach-main{align-items:flex-start;flex-basis:calc(100% - 150px)}.mbsf-attach-type{width:100%;flex-basis:100%;order:3}.mbsf-attach-actions{margin-left:auto}.mbsf-drop{min-height:190px;padding:24px 18px}.mbsf-actions{position:sticky;bottom:86px;z-index:10}.mbsf-submit{width:100%}}
1792
+ @media(max-width:820px){.mbsf{gap:16px}.mbsf-grid{grid-template-columns:1fr}.mbsf-span{grid-column:auto}.mbsf-card{padding:18px 16px}.mbsf-line-head{display:none}.mbsf-line{position:relative;display:grid;grid-template-columns:minmax(0,1fr) 86px;gap:14px;padding:18px 16px}.mbsf-line>div:before{display:block;margin-bottom:6px;color:var(--mb-muted);font-size:12px;font-weight:700;content:attr(data-label)}.mbsf-line>div:nth-child(1),.mbsf-line>div:nth-child(2),.mbsf-line>div:nth-child(3){grid-column:1/-1}.mbsf-money{align-self:end;padding:0 0 12px;text-align:right}.mbsf-line .mbsf-icon-btn{position:absolute;right:8px;bottom:3px}.mbsf-total{padding:16px 18px;gap:24px}.mbsf-head{align-items:flex-start}.mbsf-segments{grid-template-columns:repeat(3,minmax(0,1fr))}.mbsf-segment{min-width:0;padding:8px 4px;border-right:1px solid var(--mb-border);border-bottom:0;font-size:13px}.mbsf-segment:last-child{border-right:0}.mbsf-payer-option{align-items:flex-start}.mbsf-attach-row{align-items:flex-start;flex-wrap:wrap}.mbsf-attach-main{align-items:flex-start;flex-basis:calc(100% - 150px)}.mbsf-attach-type{width:100%;flex-basis:100%;order:3}.mbsf-attach-actions{margin-left:auto}.mbsf-drop{min-height:190px;padding:24px 18px}.mbsf-actions{position:sticky;bottom:86px;z-index:10}.mbsf-submit{width:100%}}
1793
1793
  `;
1794
1794
  function RequiredMark() {
1795
1795
  return /* @__PURE__ */ jsx3("span", { className: "mbsf-star", children: " *" });
@@ -2236,6 +2236,10 @@ function BillSubmissionForm({
2236
2236
  /* @__PURE__ */ jsx3("legend", { className: "mbsf-legend", children: "Injury & claim" }),
2237
2237
  /* @__PURE__ */ jsxs3("div", { className: "mbsf-grid", children: [
2238
2238
  /* @__PURE__ */ jsx3(Field2, { path: "service.date", label: "Date of service", required: true, error: errors["service.date"], children: /* @__PURE__ */ jsx3(TextDateInput, { ariaLabel: "Date of service", value: bill.service.date, disabled: locked, required: true, onChange: (date2) => setBill((c) => ({ ...c, service: { ...c.service, date: date2 } })) }) }),
2239
+ /* @__PURE__ */ jsxs3(Field2, { label: "Treatment authorization # (optional)", children: [
2240
+ text(bill.service.authorizationNumber, (authorizationNumber) => setBill((c) => ({ ...c, service: { ...c.service, authorizationNumber } })), { placeholder: "Utilization-review authorization number" }),
2241
+ /* @__PURE__ */ jsx3("small", { className: "mbsf-help", children: "Rides on the bill as CMS-1500 Box 23 / 837 REF*G1." })
2242
+ ] }),
2239
2243
  /* @__PURE__ */ jsx3(Field2, { path: "claim.dateOfInjury", label: "Date of injury", required: true, error: errors["claim.dateOfInjury"], children: /* @__PURE__ */ jsx3(TextDateInput, { ariaLabel: "Date of injury", value: bill.claim.dateOfInjury, disabled: locked, required: true, onChange: (dateOfInjury) => setBill((c) => ({ ...c, claim: { ...c.claim, dateOfInjury } })) }) }),
2240
2244
  /* @__PURE__ */ jsx3(Field2, { path: "claim.employer", label: "Employer name", required: true, error: errors["claim.employer"], children: text(bill.claim.employer, (employer) => setBill((c) => ({ ...c, claim: { ...c.claim, employer } }))) }),
2241
2245
  /* @__PURE__ */ jsx3(Field2, { path: "claim.claimNumber", label: "Claim number", required: true, error: errors["claim.claimNumber"], children: text(bill.claim.claimNumber, (claimNumber) => setBill((c) => ({ ...c, claim: { ...c.claim, claimNumber } }))) }),
@@ -2340,6 +2344,7 @@ function BillSubmissionForm({
2340
2344
  /* @__PURE__ */ jsx3(RequiredMark, {})
2341
2345
  ] }),
2342
2346
  /* @__PURE__ */ jsx3("span", { children: "Modifiers" }),
2347
+ /* @__PURE__ */ jsx3("span", { children: "Dx" }),
2343
2348
  /* @__PURE__ */ jsxs3("span", { children: [
2344
2349
  "Units",
2345
2350
  /* @__PURE__ */ jsx3(RequiredMark, {})
@@ -2365,6 +2370,11 @@ function BillSubmissionForm({
2365
2370
  ] }, modifier)) }),
2366
2371
  /* @__PURE__ */ jsx3(ComboBox, { ariaLabel: `Modifiers ${index + 1}`, disabled: locked, value: "", placeholder: line.modifiers?.length ?? 0 ? `${line.modifiers.length} modifier${line.modifiers.length === 1 ? "" : "s"}` : "Add modifiers\u2026", options: modifiers.filter((item) => !(line.modifiers ?? []).includes(item.code)).map((item) => ({ id: item.code, label: `\u2212${item.code}`, detail: item.description })), onSelect: (option) => setLine(index, { modifiers: [.../* @__PURE__ */ new Set([...line.modifiers ?? [], option.id])] }) })
2367
2372
  ] }),
2373
+ /* @__PURE__ */ jsx3("div", { "data-label": "Dx", children: /* @__PURE__ */ jsx3("div", { className: "mbsf-dx", children: (bill.diagnoses ?? []).length ? (bill.diagnoses ?? []).map((code, dxIndex) => {
2374
+ const pointer = dxIndex + 1;
2375
+ const active = (line.diagnosisPointers ?? []).includes(pointer);
2376
+ return /* @__PURE__ */ jsx3("button", { type: "button", className: "mbsf-dx-chip", "data-active": active, title: `${String.fromCharCode(64 + pointer)} \u2014 ${code}`, "aria-pressed": active, "aria-label": `Point line ${index + 1} at diagnosis ${code}`, onClick: () => setLine(index, { diagnosisPointers: active ? (line.diagnosisPointers ?? []).filter((item) => item !== pointer) : [...line.diagnosisPointers ?? [], pointer].sort((left, right) => left - right) }), children: String.fromCharCode(64 + pointer) }, code);
2377
+ }) : /* @__PURE__ */ jsx3("small", { className: "mbsf-help", children: "Add diagnoses above" }) }) }),
2368
2378
  /* @__PURE__ */ jsxs3("div", { "data-label": "Units", "data-field-path": `serviceLines.${index}.units`, "data-invalid": Boolean(errors[`serviceLines.${index}.units`]), children: [
2369
2379
  /* @__PURE__ */ jsx3("input", { className: "mbsf-input", "aria-label": `Units ${index + 1}`, "aria-invalid": Boolean(errors[`serviceLines.${index}.units`]), type: "number", min: 1, value: line.units ?? 1, onChange: (event) => setLine(index, { units: Number(event.target.value) }) }),
2370
2380
  errors[`serviceLines.${index}.units`] ? /* @__PURE__ */ jsx3("small", { className: "mbsf-error", role: "alert", children: errors[`serviceLines.${index}.units`] }) : null
@@ -2727,19 +2737,429 @@ function BillingReport({ bills, groupBy = "status", heading = "Billing report",
2727
2737
  ] }) });
2728
2738
  }
2729
2739
 
2740
+ // src/status-aging-matrix.tsx
2741
+ import { useMemo as useMemo4 } from "react";
2742
+ import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
2743
+ var BILL_STATUS_AGING_BUCKETS = [
2744
+ { id: "current", label: "0\u201330 days" },
2745
+ { id: "31-60", label: "31\u201360 days" },
2746
+ { id: "61-90", label: "61\u201390 days" },
2747
+ { id: "91+", label: "91+ days" }
2748
+ ];
2749
+ var DEFAULT_STATE_ORDER = [
2750
+ "draft",
2751
+ "incomplete",
2752
+ "created",
2753
+ "sent",
2754
+ "submitted",
2755
+ "accepted",
2756
+ "processed",
2757
+ "paid",
2758
+ "underpaid",
2759
+ "denied",
2760
+ "rejected",
2761
+ "appealing",
2762
+ "second_review",
2763
+ "ibr",
2764
+ "lien",
2765
+ "closed"
2766
+ ];
2767
+ var money4 = (value) => Number(value || 0).toLocaleString(void 0, { style: "currency", currency: "USD" });
2768
+ var stateLabel2 = (state) => state.replaceAll("_", " ").replace(/\b\w/g, (letter) => letter.toUpperCase());
2769
+ var emptyCell = (state, bucket) => ({ state, bucket, count: 0, balance: 0, bills: [] });
2770
+ function buildBillStatusAgingMatrix(bills, stateOrder = DEFAULT_STATE_ORDER, now = /* @__PURE__ */ new Date()) {
2771
+ const orderIndex = new Map(stateOrder.map((state, index) => [state.toLowerCase(), index]));
2772
+ const states = [...new Set(bills.map((bill) => bill.state))].sort((a, b) => {
2773
+ const left = orderIndex.get(a.toLowerCase()) ?? stateOrder.length;
2774
+ const right = orderIndex.get(b.toLowerCase()) ?? stateOrder.length;
2775
+ return left - right || a.localeCompare(b);
2776
+ });
2777
+ const columnTotals = BILL_STATUS_AGING_BUCKETS.map((bucket) => emptyCell("all", bucket.id));
2778
+ const grandTotal = emptyCell("all", "total");
2779
+ const rows = states.map((state) => {
2780
+ const cells = BILL_STATUS_AGING_BUCKETS.map((bucket) => emptyCell(state, bucket.id));
2781
+ const total = emptyCell(state, "total");
2782
+ return { state, label: stateLabel2(state), cells, total };
2783
+ });
2784
+ const rowByState = new Map(rows.map((row) => [row.state, row]));
2785
+ for (const bill of bills) {
2786
+ const row = rowByState.get(bill.state);
2787
+ const bucketIndex = BILL_STATUS_AGING_BUCKETS.findIndex((bucket) => bucket.id === billAgingBucket(bill, now));
2788
+ const balance = Number(bill.balanceDue || 0);
2789
+ for (const cell of [row.cells[bucketIndex], row.total, columnTotals[bucketIndex], grandTotal]) {
2790
+ cell.count += 1;
2791
+ cell.balance += balance;
2792
+ cell.bills.push(bill);
2793
+ }
2794
+ }
2795
+ return { rows, columnTotals, grandTotal };
2796
+ }
2797
+ function buildBillStatusAgingCsv(bills, stateOrder) {
2798
+ const matrix = buildBillStatusAgingMatrix(bills, stateOrder);
2799
+ const escape = (value) => `"${String(value).replaceAll('"', '""')}"`;
2800
+ const header = ["Status", ...BILL_STATUS_AGING_BUCKETS.map((bucket) => bucket.label), "Total"];
2801
+ const lines = matrix.rows.map((row) => [row.label, ...row.cells.map((cell) => cell.count), row.total.count]);
2802
+ lines.push(["Total", ...matrix.columnTotals.map((cell) => cell.count), matrix.grandTotal.count]);
2803
+ return [header, ...lines].map((line) => line.map(escape).join(",")).join("\n");
2804
+ }
2805
+ var css3 = `
2806
+ .mbmx{color:var(--mb-text);font-family:var(--mb-font);font-size:15px}.mbmx *{box-sizing:border-box}.mbmx h2,.mbmx p{margin:0}
2807
+ .mbmx-head{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;margin-bottom:16px}.mbmx-head h2{font-size:24px}.mbmx-copy{color:var(--mb-muted);margin-top:5px!important}
2808
+ .mbmx-card{border:1px solid var(--mb-border);border-radius:var(--mb-radius);background:var(--mb-surface);box-shadow:var(--mb-shadow);overflow:auto}
2809
+ .mbmx-table{width:100%;border-collapse:collapse;min-width:640px}
2810
+ .mbmx-table th{padding:13px 16px;border-bottom:1px solid var(--mb-border);color:var(--mb-muted);font-size:12px;letter-spacing:.04em;text-transform:uppercase;white-space:nowrap;text-align:right}
2811
+ .mbmx-table th:first-child{text-align:left}
2812
+ .mbmx-table td{padding:0;border-bottom:1px solid var(--mb-border);border-left:1px solid color-mix(in srgb,var(--mb-border) 55%,transparent);text-align:right;vertical-align:middle}
2813
+ .mbmx-table td:first-child{border-left:0;padding:14px 16px;text-align:left;white-space:nowrap}
2814
+ .mbmx-table tr:last-child td{border-bottom:0}
2815
+ .mbmx-state{display:inline-flex;padding:4px 9px;border-radius:999px;background:color-mix(in srgb,var(--mb-accent) 10%,var(--mb-surface));color:var(--mb-text);font-size:12px;font-weight:720}
2816
+ .mbmx-cell{display:block;width:100%;min-height:56px;padding:9px 16px;border:0;background:none;color:var(--mb-text);font:inherit;text-align:right}
2817
+ .mbmx-cell[data-clickable=true]{cursor:pointer}.mbmx-cell[data-clickable=true]:hover{background:color-mix(in srgb,var(--mb-accent) 8%,var(--mb-surface))}
2818
+ .mbmx-count{display:block;font-size:17px;font-weight:760;font-variant-numeric:tabular-nums}
2819
+ .mbmx-balance{display:block;margin-top:2px;color:var(--mb-muted);font-size:12px;font-variant-numeric:tabular-nums;white-space:nowrap}
2820
+ .mbmx-zero{color:var(--mb-muted)}
2821
+ .mbmx-total td,.mbmx-table td.mbmx-rowtotal{background:var(--mb-soft);font-weight:760}
2822
+ `;
2823
+ function BillStatusAgingMatrix({
2824
+ bills,
2825
+ heading = "Bills by status and age",
2826
+ description = "Every bill grouped by lifecycle status, then by days outstanding.",
2827
+ stateOrder,
2828
+ showBalances = true,
2829
+ onSelectCell,
2830
+ appearance,
2831
+ className = "",
2832
+ style
2833
+ }) {
2834
+ const matrix = useMemo4(() => buildBillStatusAgingMatrix(bills, stateOrder), [bills, stateOrder]);
2835
+ const clickable = Boolean(onSelectCell);
2836
+ const cell = (data, key, isTotal = false) => /* @__PURE__ */ jsx5("td", { className: isTotal ? "mbmx-rowtotal" : void 0, children: /* @__PURE__ */ jsxs5(
2837
+ "button",
2838
+ {
2839
+ type: "button",
2840
+ className: "mbmx-cell",
2841
+ "data-clickable": clickable && data.count > 0,
2842
+ onClick: () => data.count > 0 && onSelectCell?.(data),
2843
+ disabled: !clickable || data.count === 0,
2844
+ "aria-label": `${stateLabel2(data.state)} \xB7 ${data.bucket === "total" ? "all ages" : data.bucket}: ${data.count} bills`,
2845
+ children: [
2846
+ /* @__PURE__ */ jsx5("span", { className: `mbmx-count ${data.count === 0 ? "mbmx-zero" : ""}`.trim(), children: data.count === 0 ? "\u2014" : data.count }),
2847
+ showBalances && data.count > 0 ? /* @__PURE__ */ jsx5("span", { className: "mbmx-balance", children: money4(data.balance) }) : null
2848
+ ]
2849
+ }
2850
+ ) }, key);
2851
+ return /* @__PURE__ */ jsxs5("div", { className: `mbmx ${className}`.trim(), style: { ...mindBillAppearanceStyle(appearance), ...style }, children: [
2852
+ /* @__PURE__ */ jsx5("style", { children: css3 }),
2853
+ /* @__PURE__ */ jsx5("div", { className: "mbmx-head", children: /* @__PURE__ */ jsxs5("div", { children: [
2854
+ /* @__PURE__ */ jsx5("h2", { children: heading }),
2855
+ /* @__PURE__ */ jsx5("p", { className: "mbmx-copy", children: description })
2856
+ ] }) }),
2857
+ /* @__PURE__ */ jsx5("div", { className: "mbmx-card", children: /* @__PURE__ */ jsxs5("table", { className: "mbmx-table", children: [
2858
+ /* @__PURE__ */ jsx5("thead", { children: /* @__PURE__ */ jsxs5("tr", { children: [
2859
+ /* @__PURE__ */ jsx5("th", { children: "Status" }),
2860
+ BILL_STATUS_AGING_BUCKETS.map((bucket) => /* @__PURE__ */ jsx5("th", { children: bucket.label }, bucket.id)),
2861
+ /* @__PURE__ */ jsx5("th", { children: "Total" })
2862
+ ] }) }),
2863
+ /* @__PURE__ */ jsxs5("tbody", { children: [
2864
+ matrix.rows.map((row) => /* @__PURE__ */ jsxs5("tr", { children: [
2865
+ /* @__PURE__ */ jsx5("td", { children: /* @__PURE__ */ jsx5("span", { className: "mbmx-state", children: row.label }) }),
2866
+ row.cells.map((data) => cell(data, `${row.state}-${data.bucket}`)),
2867
+ cell(row.total, `${row.state}-total`, true)
2868
+ ] }, row.state)),
2869
+ /* @__PURE__ */ jsxs5("tr", { className: "mbmx-total", children: [
2870
+ /* @__PURE__ */ jsx5("td", { children: "Total" }),
2871
+ matrix.columnTotals.map((data) => cell(data, `all-${data.bucket}`)),
2872
+ cell(matrix.grandTotal, "all-total", true)
2873
+ ] })
2874
+ ] })
2875
+ ] }) })
2876
+ ] });
2877
+ }
2878
+
2879
+ // src/organization-onboarding.tsx
2880
+ import { useCallback as useCallback2, useEffect as useEffect4, useMemo as useMemo5, useRef as useRef3, useState as useState5 } from "react";
2881
+ import {
2882
+ createOrganizationClient
2883
+ } from "@mindbill/browser";
2884
+ import { Fragment as Fragment4, jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
2885
+ var STEPS = [
2886
+ { id: "practice", label: "Practice & billing" },
2887
+ { id: "locations", label: "Locations" },
2888
+ { id: "w9", label: "W-9" },
2889
+ { id: "review", label: "Review" }
2890
+ ];
2891
+ var css4 = `
2892
+ .mbob{color:var(--mb-text);font-family:var(--mb-font);font-size:15px}.mbob *{box-sizing:border-box}.mbob h2,.mbob h3,.mbob p{margin:0}
2893
+ .mbob-card{border:1px solid var(--mb-border);border-radius:var(--mb-radius);background:var(--mb-surface);box-shadow:var(--mb-shadow);padding:24px}
2894
+ .mbob-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;margin-bottom:18px}.mbob-head h2{font-size:22px}.mbob-copy{color:var(--mb-muted);margin-top:5px!important}
2895
+ .mbob-steps{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:20px}
2896
+ .mbob-step{display:inline-flex;align-items:center;gap:7px;border:1px solid var(--mb-border);border-radius:999px;background:var(--mb-surface);padding:7px 13px;color:var(--mb-muted);font:inherit;font-size:13px;font-weight:700;cursor:pointer}
2897
+ .mbob-step[data-active=true]{border-color:var(--mb-accent);color:var(--mb-accent);background:color-mix(in srgb,var(--mb-accent) 8%,var(--mb-surface))}
2898
+ .mbob-step[data-done=true] i{color:#159447;font-style:normal}
2899
+ .mbob-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px 22px}.mbob-span{grid-column:1/-1}
2900
+ .mbob-field{display:grid;gap:7px;font-size:13px;font-weight:720}
2901
+ .mbob-field input{width:100%;min-height:44px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);background:var(--mb-input);padding:10px 12px;color:var(--mb-text);font:inherit;font-weight:450}
2902
+ .mbob-field input:focus{outline:3px solid color-mix(in srgb,var(--mb-accent) 22%,transparent);border-color:var(--mb-accent)}
2903
+ .mbob-subhead{margin:20px 0 12px!important;padding-top:16px;border-top:1px solid var(--mb-border);font-size:15px}
2904
+ .mbob-loc{display:grid;grid-template-columns:1.2fr 1.4fr .9fr .4fr .6fr auto auto;gap:10px;align-items:end;border-top:1px solid color-mix(in srgb,var(--mb-border) 60%,transparent);padding:12px 0}
2905
+ .mbob-loc:first-of-type{border-top:0}
2906
+ .mbob-primary{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--mb-muted);white-space:nowrap;padding-bottom:12px}
2907
+ .mbob-remove{border:0;background:transparent;color:var(--mb-muted);font-size:20px;cursor:pointer;padding-bottom:8px}
2908
+ .mbob-add,.mbob-secondary{border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);background:var(--mb-surface);padding:10px 14px;color:var(--mb-text);font:inherit;font-weight:700;cursor:pointer}
2909
+ .mbob-drop{display:grid;place-content:center;gap:6px;min-height:150px;border:2px dashed color-mix(in srgb,var(--mb-muted) 55%,transparent);border-radius:var(--mb-control-radius);text-align:center;cursor:pointer;position:relative}
2910
+ .mbob-drop input{position:absolute;inset:0;opacity:0;cursor:pointer}
2911
+ .mbob-drop span{color:var(--mb-muted);font-size:13px}
2912
+ .mbob-w9-current{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid #9fd6b4;border-radius:var(--mb-control-radius);background:#f3fcf6;padding:12px 14px;margin-bottom:14px}
2913
+ .mbob-w9-current span{color:var(--mb-muted);font-size:13px}
2914
+ .mbob-check{display:grid;gap:9px}
2915
+ .mbob-check-item{display:flex;align-items:center;gap:10px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);padding:11px 14px}
2916
+ .mbob-check-item[data-complete=true]{border-color:#9fd6b4;background:#f3fcf6}
2917
+ .mbob-check-item i{font-style:normal}
2918
+ .mbob-actions{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-top:20px}
2919
+ .mbob-save{min-width:170px;border:0;border-radius:var(--mb-control-radius);background:var(--mb-accent);color:var(--mb-accent-contrast);padding:12px 22px;font:inherit;font-weight:780;cursor:pointer}
2920
+ .mbob-save:disabled{opacity:.6;cursor:wait}
2921
+ .mbob-error{margin-top:14px;border-left:4px solid var(--mb-danger);border-radius:var(--mb-control-radius);background:color-mix(in srgb,var(--mb-danger) 8%,var(--mb-surface));padding:12px 14px;color:var(--mb-danger)}
2922
+ .mbob-status{color:var(--mb-muted)}
2923
+ .mbob-done{color:#159447;font-weight:750}
2924
+ @media(max-width:820px){.mbob-grid{grid-template-columns:1fr}.mbob-span{grid-column:auto}.mbob-loc{grid-template-columns:1fr 1fr;align-items:center}.mbob-loc>*{grid-column:auto}}
2925
+ `;
2926
+ var blankLocation = () => ({ name: "", street: "", city: "", state: "", zip: "", isPrimary: false });
2927
+ async function fileToBase64(file) {
2928
+ const buffer = new Uint8Array(await file.arrayBuffer());
2929
+ let binary = "";
2930
+ for (const byte of buffer) binary += String.fromCharCode(byte);
2931
+ return btoa(binary);
2932
+ }
2933
+ function OrganizationOnboarding({
2934
+ appearance,
2935
+ className = "",
2936
+ style,
2937
+ sessionEndpoint = "/api/mindbill/session",
2938
+ getSession,
2939
+ apiBaseUrl,
2940
+ heading = "Billing setup",
2941
+ description = "Practice identity, locations, and the W-9 \u2014 saved once, used on every bill.",
2942
+ variant = "onboarding",
2943
+ onSaved,
2944
+ onCompleted,
2945
+ onError
2946
+ }) {
2947
+ const client = useMemo5(
2948
+ () => createOrganizationClient({
2949
+ sessionEndpoint,
2950
+ ...getSession ? { getSession } : {},
2951
+ ...apiBaseUrl ? { apiBaseUrl } : {}
2952
+ }),
2953
+ [sessionEndpoint, getSession, apiBaseUrl]
2954
+ );
2955
+ const [profile, setProfile] = useState5(null);
2956
+ const [loadError, setLoadError] = useState5(null);
2957
+ const [step, setStep] = useState5("practice");
2958
+ const [identity, setIdentity] = useState5({ name: "", legalName: "", taxId: "", npi: "", phone: "", email: "" });
2959
+ const [provider, setProvider] = useState5({ name: "", taxId: "", npi: "", billType: "Professional", phone: "", billingStreet: "", billingCity: "", billingState: "", billingZip: "" });
2960
+ const [locations, setLocations] = useState5([blankLocation()]);
2961
+ const [w9File, setW9File] = useState5(null);
2962
+ const [saving, setSaving] = useState5(false);
2963
+ const [error, setError] = useState5(null);
2964
+ const [savedStep, setSavedStep] = useState5({});
2965
+ const completedFired = useRef3(false);
2966
+ const adoptProfile = useCallback2((next) => {
2967
+ setProfile(next);
2968
+ setIdentity((current) => ({
2969
+ name: next.practiceIdentity.name ?? current.name,
2970
+ legalName: next.practiceIdentity.legalName ?? current.legalName,
2971
+ taxId: next.practiceIdentity.taxId ?? current.taxId,
2972
+ npi: next.practiceIdentity.npi ?? current.npi,
2973
+ phone: next.practiceIdentity.phone ?? current.phone,
2974
+ email: next.practiceIdentity.email ?? current.email
2975
+ }));
2976
+ if (next.billingProviders[0]) setProvider({ billType: "Professional", ...next.billingProviders[0] });
2977
+ if (next.locations.length) setLocations(next.locations.map((item) => ({ ...item })));
2978
+ if (next.onboarding.complete && !completedFired.current) {
2979
+ completedFired.current = true;
2980
+ onCompleted?.(next);
2981
+ }
2982
+ }, [onCompleted]);
2983
+ useEffect4(() => {
2984
+ let alive = true;
2985
+ client.getOrganization().then((next) => {
2986
+ if (alive) {
2987
+ setLoadError(null);
2988
+ adoptProfile(next);
2989
+ }
2990
+ }).catch((caught) => {
2991
+ if (!alive) return;
2992
+ const failure = caught instanceof Error ? caught : new Error("The organization could not be loaded.");
2993
+ setLoadError(failure.message);
2994
+ onError?.(failure);
2995
+ });
2996
+ return () => {
2997
+ alive = false;
2998
+ };
2999
+ }, [client, adoptProfile, onError]);
3000
+ const run = async (work, stepId) => {
3001
+ setSaving(true);
3002
+ setError(null);
3003
+ try {
3004
+ const next = await work();
3005
+ adoptProfile(next);
3006
+ setSavedStep((current) => ({ ...current, [stepId]: true }));
3007
+ onSaved?.(next);
3008
+ if (variant === "onboarding") {
3009
+ const order = ["practice", "locations", "w9", "review"];
3010
+ const nextStep = order[order.indexOf(stepId) + 1];
3011
+ if (nextStep) setStep(nextStep);
3012
+ }
3013
+ } catch (caught) {
3014
+ const failure = caught instanceof Error ? caught : new Error("Saving failed.");
3015
+ setError(failure.message);
3016
+ onError?.(failure);
3017
+ } finally {
3018
+ setSaving(false);
3019
+ }
3020
+ };
3021
+ const savePractice = () => run(() => client.saveBillingProfile({
3022
+ practiceIdentity: identity,
3023
+ ...provider.name.trim() || provider.taxId.trim() || provider.npi.trim() ? { billingProviders: [provider] } : {}
3024
+ }), "practice");
3025
+ const saveLocations = () => run(() => client.saveLocations(locations.filter((item) => item.name.trim() || item.street.trim())), "locations");
3026
+ const saveW9 = () => run(async () => {
3027
+ if (!w9File) throw new Error("Choose the practice W-9 PDF first.");
3028
+ return client.saveW9({ filename: w9File.name, contentBase64: await fileToBase64(w9File) });
3029
+ }, "w9");
3030
+ const field = (label, value, onChange, span = false, placeholder = "") => /* @__PURE__ */ jsxs6("label", { className: `mbob-field${span ? " mbob-span" : ""}`, children: [
3031
+ label,
3032
+ /* @__PURE__ */ jsx6("input", { value, placeholder, onChange: (event) => onChange(event.target.value), disabled: saving })
3033
+ ] });
3034
+ const setLocation = (index, patch) => setLocations((current) => current.map((item, itemIndex) => {
3035
+ if (itemIndex !== index) return patch.isPrimary ? { ...item, isPrimary: false } : item;
3036
+ return { ...item, ...patch };
3037
+ }));
3038
+ const practiceSection = /* @__PURE__ */ jsxs6("div", { children: [
3039
+ /* @__PURE__ */ jsxs6("div", { className: "mbob-grid", children: [
3040
+ field("Practice name", identity.name, (name) => setIdentity((c) => ({ ...c, name }))),
3041
+ field("Legal name", identity.legalName, (legalName) => setIdentity((c) => ({ ...c, legalName }))),
3042
+ field("Tax ID (EIN)", identity.taxId, (taxId) => setIdentity((c) => ({ ...c, taxId })), false, "94-1234567"),
3043
+ field("Group NPI", identity.npi, (npi) => setIdentity((c) => ({ ...c, npi }))),
3044
+ field("Phone", identity.phone, (phone) => setIdentity((c) => ({ ...c, phone }))),
3045
+ field("Email", identity.email, (email) => setIdentity((c) => ({ ...c, email })))
3046
+ ] }),
3047
+ /* @__PURE__ */ jsx6("h3", { className: "mbob-subhead", children: "Billing provider (pay-to)" }),
3048
+ /* @__PURE__ */ jsxs6("div", { className: "mbob-grid", children: [
3049
+ field("Billing provider name", provider.name, (name) => setProvider((c) => ({ ...c, name }))),
3050
+ field("Billing tax ID", provider.taxId, (taxId) => setProvider((c) => ({ ...c, taxId }))),
3051
+ field("Billing NPI", provider.npi, (npi) => setProvider((c) => ({ ...c, npi }))),
3052
+ field("Billing phone", provider.phone ?? "", (phone) => setProvider((c) => ({ ...c, phone }))),
3053
+ field("Street", provider.billingStreet ?? "", (billingStreet) => setProvider((c) => ({ ...c, billingStreet })), true),
3054
+ field("City", provider.billingCity ?? "", (billingCity) => setProvider((c) => ({ ...c, billingCity }))),
3055
+ field("State", provider.billingState ?? "", (billingState) => setProvider((c) => ({ ...c, billingState: billingState.toUpperCase().slice(0, 2) }))),
3056
+ field("ZIP", provider.billingZip ?? "", (billingZip) => setProvider((c) => ({ ...c, billingZip })))
3057
+ ] }),
3058
+ /* @__PURE__ */ jsxs6("div", { className: "mbob-actions", children: [
3059
+ /* @__PURE__ */ jsx6("span", { className: "mbob-status", children: savedStep["practice"] ? "Saved to MindBill." : "Saved once, used on every bill." }),
3060
+ /* @__PURE__ */ jsx6("button", { className: "mbob-save", type: "button", disabled: saving, onClick: savePractice, children: saving ? "Saving\u2026" : "Save practice" })
3061
+ ] })
3062
+ ] });
3063
+ const locationsSection = /* @__PURE__ */ jsxs6("div", { children: [
3064
+ locations.map((location, index) => /* @__PURE__ */ jsxs6("div", { className: "mbob-loc", children: [
3065
+ field("Name", location.name, (name) => setLocation(index, { name })),
3066
+ field("Street", location.street, (street) => setLocation(index, { street })),
3067
+ field("City", location.city, (city) => setLocation(index, { city })),
3068
+ field("State", location.state, (state) => setLocation(index, { state: state.toUpperCase().slice(0, 2) })),
3069
+ field("ZIP", location.zip, (zip) => setLocation(index, { zip })),
3070
+ /* @__PURE__ */ jsxs6("label", { className: "mbob-primary", children: [
3071
+ /* @__PURE__ */ jsx6("input", { type: "radio", name: "mbob-primary", checked: location.isPrimary === true, onChange: () => setLocation(index, { isPrimary: true }) }),
3072
+ " Primary"
3073
+ ] }),
3074
+ /* @__PURE__ */ jsx6("button", { className: "mbob-remove", type: "button", "aria-label": "Remove location", onClick: () => setLocations((current) => current.filter((_, itemIndex) => itemIndex !== index)), children: "\xD7" })
3075
+ ] }, location.id ?? index)),
3076
+ /* @__PURE__ */ jsx6("button", { className: "mbob-add", type: "button", onClick: () => setLocations((current) => [...current, blankLocation()]), children: "+ Add location" }),
3077
+ /* @__PURE__ */ jsxs6("div", { className: "mbob-actions", children: [
3078
+ /* @__PURE__ */ jsx6("span", { className: "mbob-status", children: savedStep["locations"] ? "Saved to MindBill." : "Where evaluations happen." }),
3079
+ /* @__PURE__ */ jsx6("button", { className: "mbob-save", type: "button", disabled: saving, onClick: saveLocations, children: saving ? "Saving\u2026" : "Save locations" })
3080
+ ] })
3081
+ ] });
3082
+ const w9Section = /* @__PURE__ */ jsxs6("div", { children: [
3083
+ profile?.w9 ? /* @__PURE__ */ jsxs6("div", { className: "mbob-w9-current", children: [
3084
+ /* @__PURE__ */ jsxs6("div", { children: [
3085
+ /* @__PURE__ */ jsx6("strong", { children: profile.w9.filename }),
3086
+ /* @__PURE__ */ jsxs6("span", { children: [
3087
+ " \xB7 added ",
3088
+ profile.w9.addDate
3089
+ ] })
3090
+ ] }),
3091
+ /* @__PURE__ */ jsx6("span", { children: "Rides on every bill automatically" })
3092
+ ] }) : null,
3093
+ /* @__PURE__ */ jsxs6("label", { className: "mbob-drop", children: [
3094
+ /* @__PURE__ */ jsx6("input", { type: "file", accept: "application/pdf,.pdf", onChange: (event) => setW9File(event.target.files?.[0] ?? null) }),
3095
+ /* @__PURE__ */ jsx6("strong", { children: w9File ? w9File.name : profile?.w9 ? "Replace the W-9 PDF" : "Drop the practice W-9 PDF here, or click to choose" }),
3096
+ /* @__PURE__ */ jsx6("span", { children: "The W-9 is auto-attached to every submission." })
3097
+ ] }),
3098
+ /* @__PURE__ */ jsxs6("div", { className: "mbob-actions", children: [
3099
+ /* @__PURE__ */ jsx6("span", { className: "mbob-status", children: savedStep["w9"] ? "Saved to MindBill." : "" }),
3100
+ /* @__PURE__ */ jsx6("button", { className: "mbob-save", type: "button", disabled: saving || !w9File, onClick: saveW9, children: saving ? "Uploading\u2026" : "Save W-9" })
3101
+ ] })
3102
+ ] });
3103
+ const reviewSection = /* @__PURE__ */ jsxs6("div", { className: "mbob-check", children: [
3104
+ (profile?.onboarding.checklist ?? []).map((item) => /* @__PURE__ */ jsxs6("div", { className: "mbob-check-item", "data-complete": item.complete, children: [
3105
+ /* @__PURE__ */ jsx6("i", { children: item.complete ? "\u2713" : "\u2022" }),
3106
+ /* @__PURE__ */ jsx6("span", { children: item.label })
3107
+ ] }, item.id)),
3108
+ profile?.onboarding.complete ? /* @__PURE__ */ jsx6("p", { className: "mbob-done", children: "Billing setup is complete \u2014 bills submitted from your product carry this profile automatically." }) : /* @__PURE__ */ jsx6("p", { className: "mbob-status", children: "Items above complete themselves as each section is saved." })
3109
+ ] });
3110
+ const sections = { practice: practiceSection, locations: locationsSection, w9: w9Section, review: reviewSection };
3111
+ return /* @__PURE__ */ jsxs6("div", { className: `mbob ${className}`.trim(), style: { ...mindBillAppearanceStyle(appearance), ...style }, children: [
3112
+ /* @__PURE__ */ jsx6("style", { children: css4 }),
3113
+ /* @__PURE__ */ jsxs6("div", { className: "mbob-card", children: [
3114
+ /* @__PURE__ */ jsx6("div", { className: "mbob-head", children: /* @__PURE__ */ jsxs6("div", { children: [
3115
+ /* @__PURE__ */ jsx6("h2", { children: heading }),
3116
+ /* @__PURE__ */ jsx6("p", { className: "mbob-copy", children: description })
3117
+ ] }) }),
3118
+ loadError ? /* @__PURE__ */ jsx6("div", { className: "mbob-error", role: "alert", children: loadError }) : null,
3119
+ variant === "onboarding" ? /* @__PURE__ */ jsxs6(Fragment4, { children: [
3120
+ /* @__PURE__ */ jsx6("div", { className: "mbob-steps", children: STEPS.map((item) => /* @__PURE__ */ jsxs6("button", { className: "mbob-step", type: "button", "data-active": step === item.id, "data-done": Boolean(savedStep[item.id]), onClick: () => setStep(item.id), children: [
3121
+ /* @__PURE__ */ jsx6("i", { children: savedStep[item.id] ? "\u2713" : "" }),
3122
+ item.label
3123
+ ] }, item.id)) }),
3124
+ sections[step]
3125
+ ] }) : /* @__PURE__ */ jsxs6(Fragment4, { children: [
3126
+ practiceSection,
3127
+ /* @__PURE__ */ jsx6("h3", { className: "mbob-subhead", children: "Locations" }),
3128
+ locationsSection,
3129
+ /* @__PURE__ */ jsx6("h3", { className: "mbob-subhead", children: "Practice W-9" }),
3130
+ w9Section,
3131
+ /* @__PURE__ */ jsx6("h3", { className: "mbob-subhead", children: "Checklist" }),
3132
+ reviewSection
3133
+ ] }),
3134
+ error ? /* @__PURE__ */ jsx6("div", { className: "mbob-error", role: "alert", children: error }) : null
3135
+ ] })
3136
+ ] });
3137
+ }
3138
+ function BillingSettings(props) {
3139
+ return /* @__PURE__ */ jsx6(
3140
+ OrganizationOnboarding,
3141
+ {
3142
+ heading: "Billing settings",
3143
+ description: "Practice identity, locations, and the W-9 used on every bill.",
3144
+ ...props,
3145
+ variant: "settings"
3146
+ }
3147
+ );
3148
+ }
3149
+
2730
3150
  // src/connected-bill-status.tsx
2731
3151
  import {
2732
- useCallback as useCallback2,
2733
- useEffect as useEffect4,
2734
- useMemo as useMemo4,
2735
- useRef as useRef3,
2736
- useState as useState5
3152
+ useCallback as useCallback3,
3153
+ useEffect as useEffect5,
3154
+ useMemo as useMemo6,
3155
+ useRef as useRef4,
3156
+ useState as useState6
2737
3157
  } from "react";
2738
3158
  import {
2739
3159
  DEFAULT_API_BASE_URL,
2740
3160
  DEFAULT_SESSION_ENDPOINT
2741
3161
  } from "@mindbill/browser";
2742
- import { Fragment as Fragment4, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
3162
+ import { Fragment as Fragment5, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
2743
3163
  var DEFAULT_REFRESH_INTERVAL = 6e4;
2744
3164
  async function responseError(response, fallback) {
2745
3165
  const body = await response.json().catch(() => null);
@@ -2872,23 +3292,23 @@ function useBillStatus({
2872
3292
  initialData = null,
2873
3293
  fetch: fetchOverride
2874
3294
  }) {
2875
- const client = useMemo4(() => createBillStatusClient({
3295
+ const client = useMemo6(() => createBillStatusClient({
2876
3296
  billId,
2877
3297
  sessionEndpoint,
2878
3298
  ...getSession ? { getSession } : {},
2879
3299
  apiBaseUrl,
2880
3300
  ...fetchOverride ? { fetch: fetchOverride } : {}
2881
3301
  }), [apiBaseUrl, billId, fetchOverride, getSession, sessionEndpoint]);
2882
- const [data, setData] = useState5(initialData);
2883
- const [error, setError] = useState5(null);
2884
- const [isLoading, setIsLoading] = useState5(enabled && !initialData);
2885
- const [isRefreshing, setIsRefreshing] = useState5(false);
2886
- const dataRef = useRef3(initialData);
2887
- const initialDataRef = useRef3(initialData);
3302
+ const [data, setData] = useState6(initialData);
3303
+ const [error, setError] = useState6(null);
3304
+ const [isLoading, setIsLoading] = useState6(enabled && !initialData);
3305
+ const [isRefreshing, setIsRefreshing] = useState6(false);
3306
+ const dataRef = useRef4(initialData);
3307
+ const initialDataRef = useRef4(initialData);
2888
3308
  initialDataRef.current = initialData;
2889
- const activeControllerRef = useRef3(null);
2890
- const requestSequence = useRef3(0);
2891
- useEffect4(() => {
3309
+ const activeControllerRef = useRef4(null);
3310
+ const requestSequence = useRef4(0);
3311
+ useEffect5(() => {
2892
3312
  const seed = initialDataRef.current;
2893
3313
  dataRef.current = seed;
2894
3314
  setData(seed);
@@ -2897,7 +3317,7 @@ function useBillStatus({
2897
3317
  activeControllerRef.current?.abort();
2898
3318
  return () => activeControllerRef.current?.abort();
2899
3319
  }, [client, enabled]);
2900
- const load = useCallback2(async () => {
3320
+ const load = useCallback3(async () => {
2901
3321
  if (!enabled || !billId) return;
2902
3322
  const sequence = ++requestSequence.current;
2903
3323
  activeControllerRef.current?.abort();
@@ -2929,10 +3349,10 @@ function useBillStatus({
2929
3349
  }
2930
3350
  }
2931
3351
  }, [billId, client, enabled]);
2932
- useEffect4(() => {
3352
+ useEffect5(() => {
2933
3353
  if (enabled) void load();
2934
3354
  }, [enabled, load]);
2935
- useEffect4(() => {
3355
+ useEffect5(() => {
2936
3356
  if (!enabled || refreshInterval <= 0) return;
2937
3357
  const timer = window.setInterval(() => void load(), refreshInterval);
2938
3358
  const onFocus = () => void load();
@@ -2960,17 +3380,17 @@ function ConnectedBillStatus({
2960
3380
  }) {
2961
3381
  const status = useBillStatus(options);
2962
3382
  if (status.isLoading && !status.data) {
2963
- return /* @__PURE__ */ jsx5(Fragment4, { children: loadingFallback ?? /* @__PURE__ */ jsx5("div", { role: "status", children: "Loading bill status\u2026" }) });
3383
+ return /* @__PURE__ */ jsx7(Fragment5, { children: loadingFallback ?? /* @__PURE__ */ jsx7("div", { role: "status", children: "Loading bill status\u2026" }) });
2964
3384
  }
2965
3385
  if (status.error && !status.data) {
2966
- return /* @__PURE__ */ jsx5(Fragment4, { children: errorFallback?.(status.error, status.refresh) ?? /* @__PURE__ */ jsxs5("div", { role: "alert", children: [
3386
+ return /* @__PURE__ */ jsx7(Fragment5, { children: errorFallback?.(status.error, status.refresh) ?? /* @__PURE__ */ jsxs7("div", { role: "alert", children: [
2967
3387
  status.error.message,
2968
3388
  " ",
2969
- /* @__PURE__ */ jsx5("button", { type: "button", onClick: () => void status.refresh(), children: "Retry" })
3389
+ /* @__PURE__ */ jsx7("button", { type: "button", onClick: () => void status.refresh(), children: "Retry" })
2970
3390
  ] }) });
2971
3391
  }
2972
3392
  if (!status.data) return null;
2973
- return /* @__PURE__ */ jsx5(
3393
+ return /* @__PURE__ */ jsx7(
2974
3394
  BillStatusSummary,
2975
3395
  {
2976
3396
  status: status.data.state,
@@ -2989,7 +3409,7 @@ function ConnectedBillStatus({
2989
3409
  }
2990
3410
 
2991
3411
  // src/bill-lifecycle-surfaces.tsx
2992
- import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
3412
+ import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
2993
3413
  function visibleBillLifecycleActions(actions, showUnavailable = false) {
2994
3414
  return actions.filter((action) => action.enabled || showUnavailable);
2995
3415
  }
@@ -3004,11 +3424,11 @@ function BillLifecycleActions({
3004
3424
  }) {
3005
3425
  const visible = visibleBillLifecycleActions(actions, showUnavailable);
3006
3426
  if (!visible.length) return null;
3007
- return /* @__PURE__ */ jsxs6("div", { className: classes("mb-lifecycle-actions", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill actions", children: [
3008
- /* @__PURE__ */ jsx6("style", { children: lifecycleSurfaceStyles }),
3009
- visible.map((action) => /* @__PURE__ */ jsxs6("div", { className: "mb-lifecycle-action", children: [
3010
- /* @__PURE__ */ jsx6("button", { type: "button", className: action.primary ? "mb-action-button is-primary" : "mb-action-button", disabled: disabled || !action.enabled, onClick: () => onAction(action), children: action.label }),
3011
- !action.enabled && action.reason ? /* @__PURE__ */ jsx6("span", { className: "mb-action-reason", children: action.reason }) : null
3427
+ return /* @__PURE__ */ jsxs8("div", { className: classes("mb-lifecycle-actions", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill actions", children: [
3428
+ /* @__PURE__ */ jsx8("style", { children: lifecycleSurfaceStyles }),
3429
+ visible.map((action) => /* @__PURE__ */ jsxs8("div", { className: "mb-lifecycle-action", children: [
3430
+ /* @__PURE__ */ jsx8("button", { type: "button", className: action.primary ? "mb-action-button is-primary" : "mb-action-button", disabled: disabled || !action.enabled, onClick: () => onAction(action), children: action.label }),
3431
+ !action.enabled && action.reason ? /* @__PURE__ */ jsx8("span", { className: "mb-action-reason", children: action.reason }) : null
3012
3432
  ] }, action.id))
3013
3433
  ] });
3014
3434
  }
@@ -3038,18 +3458,18 @@ function defaultFormatDate(createdAt) {
3038
3458
  return new Intl.DateTimeFormat(void 0, { dateStyle: "medium", timeStyle: "short" }).format(parsed);
3039
3459
  }
3040
3460
  function BillActivityTimeline({ events, emptyLabel = "No bill activity yet.", appearance, className, style, formatDate = defaultFormatDate }) {
3041
- return /* @__PURE__ */ jsxs6("section", { className: classes("mb-surface mb-activity", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill activity", children: [
3042
- /* @__PURE__ */ jsx6("style", { children: lifecycleSurfaceStyles }),
3043
- /* @__PURE__ */ jsx6("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs6("div", { children: [
3044
- /* @__PURE__ */ jsx6("strong", { children: "Bill history" }),
3045
- /* @__PURE__ */ jsx6("span", { children: "Submission, payer responses, follow-up, and payments." })
3461
+ return /* @__PURE__ */ jsxs8("section", { className: classes("mb-surface mb-activity", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill activity", children: [
3462
+ /* @__PURE__ */ jsx8("style", { children: lifecycleSurfaceStyles }),
3463
+ /* @__PURE__ */ jsx8("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs8("div", { children: [
3464
+ /* @__PURE__ */ jsx8("strong", { children: "Bill history" }),
3465
+ /* @__PURE__ */ jsx8("span", { children: "Submission, payer responses, follow-up, and payments." })
3046
3466
  ] }) }),
3047
- !events.length ? /* @__PURE__ */ jsx6("p", { className: "mb-activity-empty", children: emptyLabel }) : /* @__PURE__ */ jsx6("ol", { className: "mb-activity-list", children: events.map((event) => /* @__PURE__ */ jsxs6("li", { className: "mb-activity-item", children: [
3048
- /* @__PURE__ */ jsx6("span", { className: "mb-activity-marker", "aria-hidden": "true" }),
3049
- /* @__PURE__ */ jsxs6("div", { className: "mb-activity-content", children: [
3050
- /* @__PURE__ */ jsx6("strong", { children: event.title ?? billActivityEventLabel(event.type) }),
3051
- event.description ? /* @__PURE__ */ jsx6("p", { children: event.description }) : null,
3052
- /* @__PURE__ */ jsxs6("span", { children: [
3467
+ !events.length ? /* @__PURE__ */ jsx8("p", { className: "mb-activity-empty", children: emptyLabel }) : /* @__PURE__ */ jsx8("ol", { className: "mb-activity-list", children: events.map((event) => /* @__PURE__ */ jsxs8("li", { className: "mb-activity-item", children: [
3468
+ /* @__PURE__ */ jsx8("span", { className: "mb-activity-marker", "aria-hidden": "true" }),
3469
+ /* @__PURE__ */ jsxs8("div", { className: "mb-activity-content", children: [
3470
+ /* @__PURE__ */ jsx8("strong", { children: event.title ?? billActivityEventLabel(event.type) }),
3471
+ event.description ? /* @__PURE__ */ jsx8("p", { children: event.description }) : null,
3472
+ /* @__PURE__ */ jsxs8("span", { children: [
3053
3473
  formatDate(event.createdAt),
3054
3474
  event.actor ? ` \xB7 ${event.actor}` : ""
3055
3475
  ] })
@@ -3084,20 +3504,20 @@ function billLifecycleDisplayLabel(state, nativeStatus) {
3084
3504
  function BillLifecycleProgress({ state, nativeStatus, submittedAt, agingDays, appearance, className, style }) {
3085
3505
  const current = billLifecycleStage(state);
3086
3506
  const currentIndex = lifecycleStages.findIndex((stage) => stage.id === current);
3087
- return /* @__PURE__ */ jsxs6("section", { className: classes("mb-surface mb-progress", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill lifecycle", children: [
3088
- /* @__PURE__ */ jsx6("style", { children: lifecycleSurfaceStyles }),
3089
- /* @__PURE__ */ jsx6("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs6("div", { children: [
3090
- /* @__PURE__ */ jsx6("strong", { children: billLifecycleDisplayLabel(state, nativeStatus) }),
3091
- /* @__PURE__ */ jsxs6("span", { children: [
3507
+ return /* @__PURE__ */ jsxs8("section", { className: classes("mb-surface mb-progress", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill lifecycle", children: [
3508
+ /* @__PURE__ */ jsx8("style", { children: lifecycleSurfaceStyles }),
3509
+ /* @__PURE__ */ jsx8("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs8("div", { children: [
3510
+ /* @__PURE__ */ jsx8("strong", { children: billLifecycleDisplayLabel(state, nativeStatus) }),
3511
+ /* @__PURE__ */ jsxs8("span", { children: [
3092
3512
  submittedAt ? `Submitted ${defaultFormatDate(submittedAt)}` : "Submitted",
3093
3513
  typeof agingDays === "number" ? ` \xB7 ${agingDays} days old` : ""
3094
3514
  ] })
3095
3515
  ] }) }),
3096
- /* @__PURE__ */ jsx6("ol", { className: "mb-progress-list", children: lifecycleStages.map((stage, index) => {
3516
+ /* @__PURE__ */ jsx8("ol", { className: "mb-progress-list", children: lifecycleStages.map((stage, index) => {
3097
3517
  const status = index < currentIndex ? "complete" : index === currentIndex ? "current" : "upcoming";
3098
- return /* @__PURE__ */ jsxs6("li", { className: `is-${status}`, "aria-current": status === "current" ? "step" : void 0, children: [
3099
- /* @__PURE__ */ jsx6("span", { "aria-hidden": "true", children: status === "complete" ? "\u2713" : index + 1 }),
3100
- /* @__PURE__ */ jsx6("b", { children: stage.label })
3518
+ return /* @__PURE__ */ jsxs8("li", { className: `is-${status}`, "aria-current": status === "current" ? "step" : void 0, children: [
3519
+ /* @__PURE__ */ jsx8("span", { "aria-hidden": "true", children: status === "complete" ? "\u2713" : index + 1 }),
3520
+ /* @__PURE__ */ jsx8("b", { children: stage.label })
3101
3521
  ] }, stage.id);
3102
3522
  }) })
3103
3523
  ] });
@@ -3111,18 +3531,18 @@ function BillSnapshotSummary({ bill, patient, injury, delivery, appearance, clas
3111
3531
  ["Charged", currency(bill.totalCharge)],
3112
3532
  ["Balance", currency(bill.balanceDue)]
3113
3533
  ];
3114
- return /* @__PURE__ */ jsxs6("section", { className: classes("mb-surface mb-snapshot", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill snapshot", children: [
3115
- /* @__PURE__ */ jsx6("style", { children: lifecycleSurfaceStyles }),
3116
- /* @__PURE__ */ jsx6("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs6("div", { children: [
3117
- /* @__PURE__ */ jsx6("strong", { children: "Bill snapshot" }),
3118
- /* @__PURE__ */ jsxs6("span", { children: [
3534
+ return /* @__PURE__ */ jsxs8("section", { className: classes("mb-surface mb-snapshot", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill snapshot", children: [
3535
+ /* @__PURE__ */ jsx8("style", { children: lifecycleSurfaceStyles }),
3536
+ /* @__PURE__ */ jsx8("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs8("div", { children: [
3537
+ /* @__PURE__ */ jsx8("strong", { children: "Bill snapshot" }),
3538
+ /* @__PURE__ */ jsxs8("span", { children: [
3119
3539
  "Bill #",
3120
3540
  bill.billNumber
3121
3541
  ] })
3122
3542
  ] }) }),
3123
- /* @__PURE__ */ jsx6("dl", { children: values.map(([label, value]) => /* @__PURE__ */ jsxs6("div", { children: [
3124
- /* @__PURE__ */ jsx6("dt", { children: label }),
3125
- /* @__PURE__ */ jsx6("dd", { children: value })
3543
+ /* @__PURE__ */ jsx8("dl", { children: values.map(([label, value]) => /* @__PURE__ */ jsxs8("div", { children: [
3544
+ /* @__PURE__ */ jsx8("dt", { children: label }),
3545
+ /* @__PURE__ */ jsx8("dd", { children: value })
3126
3546
  ] }, label)) })
3127
3547
  ] });
3128
3548
  }
@@ -3137,140 +3557,140 @@ function BillExplanationOfReview({
3137
3557
  style
3138
3558
  }) {
3139
3559
  const rows = payments.length ? payments : [null];
3140
- return /* @__PURE__ */ jsxs6("section", { className: classes("mb-surface mb-eor-review", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Explanation of Review and payments", children: [
3141
- /* @__PURE__ */ jsx6("style", { children: lifecycleSurfaceStyles }),
3142
- /* @__PURE__ */ jsx6("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs6("div", { children: [
3143
- /* @__PURE__ */ jsx6("strong", { children: "Explanation of Review" }),
3144
- /* @__PURE__ */ jsx6("span", { children: "Payer response and payment reconciliation." })
3560
+ return /* @__PURE__ */ jsxs8("section", { className: classes("mb-surface mb-eor-review", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Explanation of Review and payments", children: [
3561
+ /* @__PURE__ */ jsx8("style", { children: lifecycleSurfaceStyles }),
3562
+ /* @__PURE__ */ jsx8("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs8("div", { children: [
3563
+ /* @__PURE__ */ jsx8("strong", { children: "Explanation of Review" }),
3564
+ /* @__PURE__ */ jsx8("span", { children: "Payer response and payment reconciliation." })
3145
3565
  ] }) }),
3146
- /* @__PURE__ */ jsxs6("dl", { className: "mb-eor-metrics", children: [
3147
- /* @__PURE__ */ jsxs6("div", { children: [
3148
- /* @__PURE__ */ jsx6("dt", { children: "Amount billed" }),
3149
- /* @__PURE__ */ jsx6("dd", { children: currency(remittance.billedAmount) })
3566
+ /* @__PURE__ */ jsxs8("dl", { className: "mb-eor-metrics", children: [
3567
+ /* @__PURE__ */ jsxs8("div", { children: [
3568
+ /* @__PURE__ */ jsx8("dt", { children: "Amount billed" }),
3569
+ /* @__PURE__ */ jsx8("dd", { children: currency(remittance.billedAmount) })
3150
3570
  ] }),
3151
- /* @__PURE__ */ jsxs6("div", { children: [
3152
- /* @__PURE__ */ jsx6("dt", { children: "Payer allowed" }),
3153
- /* @__PURE__ */ jsx6("dd", { children: remittance.payerAllowedAmount === null ? "\u2014" : currency(remittance.payerAllowedAmount) })
3571
+ /* @__PURE__ */ jsxs8("div", { children: [
3572
+ /* @__PURE__ */ jsx8("dt", { children: "Payer allowed" }),
3573
+ /* @__PURE__ */ jsx8("dd", { children: remittance.payerAllowedAmount === null ? "\u2014" : currency(remittance.payerAllowedAmount) })
3154
3574
  ] }),
3155
- /* @__PURE__ */ jsxs6("div", { children: [
3156
- /* @__PURE__ */ jsx6("dt", { children: "Payer reported paid" }),
3157
- /* @__PURE__ */ jsx6("dd", { children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) })
3575
+ /* @__PURE__ */ jsxs8("div", { children: [
3576
+ /* @__PURE__ */ jsx8("dt", { children: "Payer reported paid" }),
3577
+ /* @__PURE__ */ jsx8("dd", { children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) })
3158
3578
  ] }),
3159
- /* @__PURE__ */ jsxs6("div", { className: "is-balance", children: [
3160
- /* @__PURE__ */ jsx6("dt", { children: "Balance due" }),
3161
- /* @__PURE__ */ jsx6("dd", { children: currency(remittance.balanceDue) })
3579
+ /* @__PURE__ */ jsxs8("div", { className: "is-balance", children: [
3580
+ /* @__PURE__ */ jsx8("dt", { children: "Balance due" }),
3581
+ /* @__PURE__ */ jsx8("dd", { children: currency(remittance.balanceDue) })
3162
3582
  ] }),
3163
- /* @__PURE__ */ jsxs6("div", { children: [
3164
- /* @__PURE__ */ jsx6("dt", { children: "Payment posted" }),
3165
- /* @__PURE__ */ jsx6("dd", { children: currency(remittance.postedPrincipal) })
3583
+ /* @__PURE__ */ jsxs8("div", { children: [
3584
+ /* @__PURE__ */ jsx8("dt", { children: "Payment posted" }),
3585
+ /* @__PURE__ */ jsx8("dd", { children: currency(remittance.postedPrincipal) })
3166
3586
  ] }),
3167
- /* @__PURE__ */ jsxs6("div", { children: [
3168
- /* @__PURE__ */ jsx6("dt", { children: "Penalty & interest" }),
3169
- /* @__PURE__ */ jsx6("dd", { children: currency(remittance.postedAdditional) })
3587
+ /* @__PURE__ */ jsxs8("div", { children: [
3588
+ /* @__PURE__ */ jsx8("dt", { children: "Penalty & interest" }),
3589
+ /* @__PURE__ */ jsx8("dd", { children: currency(remittance.postedAdditional) })
3170
3590
  ] }),
3171
- /* @__PURE__ */ jsxs6("div", { children: [
3172
- /* @__PURE__ */ jsx6("dt", { children: "Total received" }),
3173
- /* @__PURE__ */ jsx6("dd", { children: currency(remittance.totalPostedCash) })
3591
+ /* @__PURE__ */ jsxs8("div", { children: [
3592
+ /* @__PURE__ */ jsx8("dt", { children: "Total received" }),
3593
+ /* @__PURE__ */ jsx8("dd", { children: currency(remittance.totalPostedCash) })
3174
3594
  ] }),
3175
- /* @__PURE__ */ jsxs6("div", { children: [
3176
- /* @__PURE__ */ jsx6("dt", { children: "Expected" }),
3177
- /* @__PURE__ */ jsx6("dd", { children: currency(remittance.expectedAmount) })
3595
+ /* @__PURE__ */ jsxs8("div", { children: [
3596
+ /* @__PURE__ */ jsx8("dt", { children: "Expected" }),
3597
+ /* @__PURE__ */ jsx8("dd", { children: currency(remittance.expectedAmount) })
3178
3598
  ] })
3179
3599
  ] }),
3180
- remittance.denialReason ? /* @__PURE__ */ jsxs6("div", { className: "mb-denial", children: [
3181
- /* @__PURE__ */ jsx6("strong", { children: "Denial reason" }),
3182
- /* @__PURE__ */ jsx6("p", { children: remittance.denialReason })
3600
+ remittance.denialReason ? /* @__PURE__ */ jsxs8("div", { className: "mb-denial", children: [
3601
+ /* @__PURE__ */ jsx8("strong", { children: "Denial reason" }),
3602
+ /* @__PURE__ */ jsx8("p", { children: remittance.denialReason })
3183
3603
  ] }) : null,
3184
- /* @__PURE__ */ jsx6("div", { className: "mb-eor-table-wrap", children: /* @__PURE__ */ jsxs6("table", { className: "mb-eor-table", children: [
3185
- /* @__PURE__ */ jsxs6("thead", { children: [
3186
- /* @__PURE__ */ jsxs6("tr", { className: "mb-eor-groups", children: [
3187
- /* @__PURE__ */ jsx6("th", { colSpan: 2, children: "Submission" }),
3188
- /* @__PURE__ */ jsx6("th", { colSpan: 5, children: "EOR payment information" }),
3189
- /* @__PURE__ */ jsx6("th", { colSpan: 2, children: "EOR post" }),
3190
- /* @__PURE__ */ jsx6("th", { children: "EOR" })
3604
+ /* @__PURE__ */ jsx8("div", { className: "mb-eor-table-wrap", children: /* @__PURE__ */ jsxs8("table", { className: "mb-eor-table", children: [
3605
+ /* @__PURE__ */ jsxs8("thead", { children: [
3606
+ /* @__PURE__ */ jsxs8("tr", { className: "mb-eor-groups", children: [
3607
+ /* @__PURE__ */ jsx8("th", { colSpan: 2, children: "Submission" }),
3608
+ /* @__PURE__ */ jsx8("th", { colSpan: 5, children: "EOR payment information" }),
3609
+ /* @__PURE__ */ jsx8("th", { colSpan: 2, children: "EOR post" }),
3610
+ /* @__PURE__ */ jsx8("th", { children: "EOR" })
3191
3611
  ] }),
3192
- /* @__PURE__ */ jsxs6("tr", { children: [
3193
- /* @__PURE__ */ jsx6("th", { children: "Submission" }),
3194
- /* @__PURE__ */ jsx6("th", { children: "Submission payment" }),
3195
- /* @__PURE__ */ jsx6("th", { children: "Payment method" }),
3196
- /* @__PURE__ */ jsx6("th", { children: "Reference" }),
3197
- /* @__PURE__ */ jsx6("th", { children: "Effective date" }),
3198
- /* @__PURE__ */ jsx6("th", { children: "Payment total" }),
3199
- /* @__PURE__ */ jsx6("th", { children: "Deposit date" }),
3200
- /* @__PURE__ */ jsx6("th", { children: "Post date" }),
3201
- /* @__PURE__ */ jsx6("th", { children: "Source" }),
3202
- /* @__PURE__ */ jsx6("th", { children: "Document" })
3612
+ /* @__PURE__ */ jsxs8("tr", { children: [
3613
+ /* @__PURE__ */ jsx8("th", { children: "Submission" }),
3614
+ /* @__PURE__ */ jsx8("th", { children: "Submission payment" }),
3615
+ /* @__PURE__ */ jsx8("th", { children: "Payment method" }),
3616
+ /* @__PURE__ */ jsx8("th", { children: "Reference" }),
3617
+ /* @__PURE__ */ jsx8("th", { children: "Effective date" }),
3618
+ /* @__PURE__ */ jsx8("th", { children: "Payment total" }),
3619
+ /* @__PURE__ */ jsx8("th", { children: "Deposit date" }),
3620
+ /* @__PURE__ */ jsx8("th", { children: "Post date" }),
3621
+ /* @__PURE__ */ jsx8("th", { children: "Source" }),
3622
+ /* @__PURE__ */ jsx8("th", { children: "Document" })
3203
3623
  ] })
3204
3624
  ] }),
3205
- /* @__PURE__ */ jsx6("tbody", { children: rows.map((payment, index) => {
3625
+ /* @__PURE__ */ jsx8("tbody", { children: rows.map((payment, index) => {
3206
3626
  const eor = eors[index] ?? eors[0];
3207
- return /* @__PURE__ */ jsxs6("tr", { children: [
3208
- /* @__PURE__ */ jsxs6("td", { "data-label": "Submission", children: [
3209
- /* @__PURE__ */ jsx6("strong", { children: "Original bill" }),
3210
- submittedAt ? /* @__PURE__ */ jsxs6("span", { children: [
3627
+ return /* @__PURE__ */ jsxs8("tr", { children: [
3628
+ /* @__PURE__ */ jsxs8("td", { "data-label": "Submission", children: [
3629
+ /* @__PURE__ */ jsx8("strong", { children: "Original bill" }),
3630
+ submittedAt ? /* @__PURE__ */ jsxs8("span", { children: [
3211
3631
  "Sent ",
3212
3632
  defaultFormatDate(submittedAt)
3213
3633
  ] }) : null
3214
3634
  ] }),
3215
- /* @__PURE__ */ jsx6("td", { "data-label": "Submission payment", children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) }),
3216
- /* @__PURE__ */ jsx6("td", { "data-label": "Payment method", children: payment ? humanize(payment.method) : "\u2014" }),
3217
- /* @__PURE__ */ jsx6("td", { "data-label": "Reference", children: payment?.checkNumber || "\u2014" }),
3218
- /* @__PURE__ */ jsx6("td", { "data-label": "Effective date", children: payment ? payment.receivedDate || payment.depositDate || defaultFormatDate(payment.postedAt) : "\u2014" }),
3219
- /* @__PURE__ */ jsx6("td", { "data-label": "Payment total", children: payment ? currency(payment.amount) : currency(0) }),
3220
- /* @__PURE__ */ jsx6("td", { "data-label": "Deposit date", children: payment?.depositDate || "Not recorded" }),
3221
- /* @__PURE__ */ jsx6("td", { "data-label": "Post date", children: payment ? defaultFormatDate(payment.postedAt) : eor ? defaultFormatDate(eor.addedAt) : "\u2014" }),
3222
- /* @__PURE__ */ jsx6("td", { "data-label": "Source", children: payment ? payment.source.toUpperCase() : eor ? "EOR" : "\u2014" }),
3223
- /* @__PURE__ */ jsx6("td", { "data-label": "EOR", children: eor && onOpenEor ? /* @__PURE__ */ jsx6("button", { type: "button", className: "mb-eor-link", onClick: () => void onOpenEor(eor), children: eor.filename }) : eor?.filename || "\u2014" })
3635
+ /* @__PURE__ */ jsx8("td", { "data-label": "Submission payment", children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) }),
3636
+ /* @__PURE__ */ jsx8("td", { "data-label": "Payment method", children: payment ? humanize(payment.method) : "\u2014" }),
3637
+ /* @__PURE__ */ jsx8("td", { "data-label": "Reference", children: payment?.checkNumber || "\u2014" }),
3638
+ /* @__PURE__ */ jsx8("td", { "data-label": "Effective date", children: payment ? payment.receivedDate || payment.depositDate || defaultFormatDate(payment.postedAt) : "\u2014" }),
3639
+ /* @__PURE__ */ jsx8("td", { "data-label": "Payment total", children: payment ? currency(payment.amount) : currency(0) }),
3640
+ /* @__PURE__ */ jsx8("td", { "data-label": "Deposit date", children: payment?.depositDate || "Not recorded" }),
3641
+ /* @__PURE__ */ jsx8("td", { "data-label": "Post date", children: payment ? defaultFormatDate(payment.postedAt) : eor ? defaultFormatDate(eor.addedAt) : "\u2014" }),
3642
+ /* @__PURE__ */ jsx8("td", { "data-label": "Source", children: payment ? payment.source.toUpperCase() : eor ? "EOR" : "\u2014" }),
3643
+ /* @__PURE__ */ jsx8("td", { "data-label": "EOR", children: eor && onOpenEor ? /* @__PURE__ */ jsx8("button", { type: "button", className: "mb-eor-link", onClick: () => void onOpenEor(eor), children: eor.filename }) : eor?.filename || "\u2014" })
3224
3644
  ] }, payment?.id ?? `empty-${index}`);
3225
3645
  }) })
3226
3646
  ] }) }),
3227
- eors.length > rows.length ? /* @__PURE__ */ jsx6("div", { className: "mb-eor-documents", children: eors.slice(rows.length).map((eor) => /* @__PURE__ */ jsx6("button", { type: "button", onClick: () => void onOpenEor?.(eor), children: eor.filename }, eor.id)) }) : null
3647
+ eors.length > rows.length ? /* @__PURE__ */ jsx8("div", { className: "mb-eor-documents", children: eors.slice(rows.length).map((eor) => /* @__PURE__ */ jsx8("button", { type: "button", onClick: () => void onOpenEor?.(eor), children: eor.filename }, eor.id)) }) : null
3228
3648
  ] });
3229
3649
  }
3230
3650
  function BillRemittanceCard({ remittance, appearance, className, style }) {
3231
- return /* @__PURE__ */ jsxs6("section", { className: classes("mb-surface mb-remittance", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Remittance summary", children: [
3232
- /* @__PURE__ */ jsx6("style", { children: lifecycleSurfaceStyles }),
3233
- /* @__PURE__ */ jsx6("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs6("div", { children: [
3234
- /* @__PURE__ */ jsx6("strong", { children: "Remittance" }),
3235
- /* @__PURE__ */ jsx6("span", { children: "Amounts reported by the payer and posted to the bill." })
3651
+ return /* @__PURE__ */ jsxs8("section", { className: classes("mb-surface mb-remittance", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Remittance summary", children: [
3652
+ /* @__PURE__ */ jsx8("style", { children: lifecycleSurfaceStyles }),
3653
+ /* @__PURE__ */ jsx8("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs8("div", { children: [
3654
+ /* @__PURE__ */ jsx8("strong", { children: "Remittance" }),
3655
+ /* @__PURE__ */ jsx8("span", { children: "Amounts reported by the payer and posted to the bill." })
3236
3656
  ] }) }),
3237
- /* @__PURE__ */ jsxs6("dl", { children: [
3238
- /* @__PURE__ */ jsxs6("div", { children: [
3239
- /* @__PURE__ */ jsx6("dt", { children: "Amount billed" }),
3240
- /* @__PURE__ */ jsx6("dd", { children: currency(remittance.billedAmount) })
3657
+ /* @__PURE__ */ jsxs8("dl", { children: [
3658
+ /* @__PURE__ */ jsxs8("div", { children: [
3659
+ /* @__PURE__ */ jsx8("dt", { children: "Amount billed" }),
3660
+ /* @__PURE__ */ jsx8("dd", { children: currency(remittance.billedAmount) })
3241
3661
  ] }),
3242
- /* @__PURE__ */ jsxs6("div", { children: [
3243
- /* @__PURE__ */ jsx6("dt", { children: "Expected" }),
3244
- /* @__PURE__ */ jsx6("dd", { children: currency(remittance.expectedAmount) })
3662
+ /* @__PURE__ */ jsxs8("div", { children: [
3663
+ /* @__PURE__ */ jsx8("dt", { children: "Expected" }),
3664
+ /* @__PURE__ */ jsx8("dd", { children: currency(remittance.expectedAmount) })
3245
3665
  ] }),
3246
- /* @__PURE__ */ jsxs6("div", { children: [
3247
- /* @__PURE__ */ jsx6("dt", { children: "Payer allowed" }),
3248
- /* @__PURE__ */ jsx6("dd", { children: remittance.payerAllowedAmount === null ? "\u2014" : currency(remittance.payerAllowedAmount) })
3666
+ /* @__PURE__ */ jsxs8("div", { children: [
3667
+ /* @__PURE__ */ jsx8("dt", { children: "Payer allowed" }),
3668
+ /* @__PURE__ */ jsx8("dd", { children: remittance.payerAllowedAmount === null ? "\u2014" : currency(remittance.payerAllowedAmount) })
3249
3669
  ] }),
3250
- /* @__PURE__ */ jsxs6("div", { children: [
3251
- /* @__PURE__ */ jsx6("dt", { children: "Payer reported paid" }),
3252
- /* @__PURE__ */ jsx6("dd", { children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) })
3670
+ /* @__PURE__ */ jsxs8("div", { children: [
3671
+ /* @__PURE__ */ jsx8("dt", { children: "Payer reported paid" }),
3672
+ /* @__PURE__ */ jsx8("dd", { children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) })
3253
3673
  ] }),
3254
- /* @__PURE__ */ jsxs6("div", { children: [
3255
- /* @__PURE__ */ jsx6("dt", { children: "Payment posted" }),
3256
- /* @__PURE__ */ jsx6("dd", { children: currency(remittance.postedPrincipal) })
3674
+ /* @__PURE__ */ jsxs8("div", { children: [
3675
+ /* @__PURE__ */ jsx8("dt", { children: "Payment posted" }),
3676
+ /* @__PURE__ */ jsx8("dd", { children: currency(remittance.postedPrincipal) })
3257
3677
  ] }),
3258
- /* @__PURE__ */ jsxs6("div", { children: [
3259
- /* @__PURE__ */ jsx6("dt", { children: "Penalty & interest" }),
3260
- /* @__PURE__ */ jsx6("dd", { children: currency(remittance.postedAdditional) })
3678
+ /* @__PURE__ */ jsxs8("div", { children: [
3679
+ /* @__PURE__ */ jsx8("dt", { children: "Penalty & interest" }),
3680
+ /* @__PURE__ */ jsx8("dd", { children: currency(remittance.postedAdditional) })
3261
3681
  ] }),
3262
- /* @__PURE__ */ jsxs6("div", { children: [
3263
- /* @__PURE__ */ jsx6("dt", { children: "Total received" }),
3264
- /* @__PURE__ */ jsx6("dd", { children: currency(remittance.totalPostedCash) })
3682
+ /* @__PURE__ */ jsxs8("div", { children: [
3683
+ /* @__PURE__ */ jsx8("dt", { children: "Total received" }),
3684
+ /* @__PURE__ */ jsx8("dd", { children: currency(remittance.totalPostedCash) })
3265
3685
  ] }),
3266
- /* @__PURE__ */ jsxs6("div", { children: [
3267
- /* @__PURE__ */ jsx6("dt", { children: "Balance due" }),
3268
- /* @__PURE__ */ jsx6("dd", { children: currency(remittance.balanceDue) })
3686
+ /* @__PURE__ */ jsxs8("div", { children: [
3687
+ /* @__PURE__ */ jsx8("dt", { children: "Balance due" }),
3688
+ /* @__PURE__ */ jsx8("dd", { children: currency(remittance.balanceDue) })
3269
3689
  ] })
3270
3690
  ] }),
3271
- remittance.denialReason ? /* @__PURE__ */ jsxs6("div", { className: "mb-denial", children: [
3272
- /* @__PURE__ */ jsx6("strong", { children: "Denial reason" }),
3273
- /* @__PURE__ */ jsx6("p", { children: remittance.denialReason })
3691
+ remittance.denialReason ? /* @__PURE__ */ jsxs8("div", { className: "mb-denial", children: [
3692
+ /* @__PURE__ */ jsx8("strong", { children: "Denial reason" }),
3693
+ /* @__PURE__ */ jsx8("p", { children: remittance.denialReason })
3274
3694
  ] }) : null
3275
3695
  ] });
3276
3696
  }
@@ -3285,72 +3705,72 @@ function BillPayerContactCard({ delivery, appearance, className, style }) {
3285
3705
  delivery.contacts.portalUrl ? ["Portal", "Open payer portal", delivery.contacts.portalUrl] : null
3286
3706
  ].filter(Boolean);
3287
3707
  if (!delivery.payerName && !contacts.length) return null;
3288
- return /* @__PURE__ */ jsxs6("section", { className: classes("mb-surface mb-contacts", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Payer contact information", children: [
3289
- /* @__PURE__ */ jsx6("style", { children: lifecycleSurfaceStyles }),
3290
- /* @__PURE__ */ jsx6("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs6("div", { children: [
3291
- /* @__PURE__ */ jsx6("strong", { children: delivery.payerName || "Claims administrator" }),
3292
- /* @__PURE__ */ jsx6("span", { children: "Billing and follow-up contacts." })
3708
+ return /* @__PURE__ */ jsxs8("section", { className: classes("mb-surface mb-contacts", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Payer contact information", children: [
3709
+ /* @__PURE__ */ jsx8("style", { children: lifecycleSurfaceStyles }),
3710
+ /* @__PURE__ */ jsx8("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs8("div", { children: [
3711
+ /* @__PURE__ */ jsx8("strong", { children: delivery.payerName || "Claims administrator" }),
3712
+ /* @__PURE__ */ jsx8("span", { children: "Billing and follow-up contacts." })
3293
3713
  ] }) }),
3294
- !contacts.length ? /* @__PURE__ */ jsx6("p", { className: "mb-empty", children: "No payer contact details are available." }) : /* @__PURE__ */ jsx6("dl", { children: contacts.map(([label, value, href]) => /* @__PURE__ */ jsxs6("div", { children: [
3295
- /* @__PURE__ */ jsx6("dt", { children: label }),
3296
- /* @__PURE__ */ jsx6("dd", { children: href ? /* @__PURE__ */ jsx6("a", { href, target: label === "Portal" ? "_blank" : void 0, rel: label === "Portal" ? "noreferrer noopener" : void 0, children: value }) : value })
3714
+ !contacts.length ? /* @__PURE__ */ jsx8("p", { className: "mb-empty", children: "No payer contact details are available." }) : /* @__PURE__ */ jsx8("dl", { children: contacts.map(([label, value, href]) => /* @__PURE__ */ jsxs8("div", { children: [
3715
+ /* @__PURE__ */ jsx8("dt", { children: label }),
3716
+ /* @__PURE__ */ jsx8("dd", { children: href ? /* @__PURE__ */ jsx8("a", { href, target: label === "Portal" ? "_blank" : void 0, rel: label === "Portal" ? "noreferrer noopener" : void 0, children: value }) : value })
3297
3717
  ] }, label)) })
3298
3718
  ] });
3299
3719
  }
3300
3720
  function BillPaymentLedger({ payments, appearance, className, style }) {
3301
- return /* @__PURE__ */ jsxs6("section", { className: classes("mb-surface mb-payments", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Payment ledger", children: [
3302
- /* @__PURE__ */ jsx6("style", { children: lifecycleSurfaceStyles }),
3303
- /* @__PURE__ */ jsx6("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs6("div", { children: [
3304
- /* @__PURE__ */ jsx6("strong", { children: "Payments" }),
3305
- /* @__PURE__ */ jsx6("span", { children: "Funds recorded against this bill." })
3721
+ return /* @__PURE__ */ jsxs8("section", { className: classes("mb-surface mb-payments", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Payment ledger", children: [
3722
+ /* @__PURE__ */ jsx8("style", { children: lifecycleSurfaceStyles }),
3723
+ /* @__PURE__ */ jsx8("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs8("div", { children: [
3724
+ /* @__PURE__ */ jsx8("strong", { children: "Payments" }),
3725
+ /* @__PURE__ */ jsx8("span", { children: "Funds recorded against this bill." })
3306
3726
  ] }) }),
3307
- !payments.length ? /* @__PURE__ */ jsx6("p", { className: "mb-empty", children: "No payments posted." }) : /* @__PURE__ */ jsx6("div", { className: "mb-payment-list", children: payments.map((payment) => {
3727
+ !payments.length ? /* @__PURE__ */ jsx8("p", { className: "mb-empty", children: "No payments posted." }) : /* @__PURE__ */ jsx8("div", { className: "mb-payment-list", children: payments.map((payment) => {
3308
3728
  const additional = payment.feeAmount ?? 0;
3309
- return /* @__PURE__ */ jsxs6("article", { children: [
3310
- /* @__PURE__ */ jsxs6("div", { className: "mb-payment-amount", children: [
3311
- /* @__PURE__ */ jsx6("strong", { children: currency(payment.amount) }),
3312
- /* @__PURE__ */ jsx6("span", { children: "Total received" })
3729
+ return /* @__PURE__ */ jsxs8("article", { children: [
3730
+ /* @__PURE__ */ jsxs8("div", { className: "mb-payment-amount", children: [
3731
+ /* @__PURE__ */ jsx8("strong", { children: currency(payment.amount) }),
3732
+ /* @__PURE__ */ jsx8("span", { children: "Total received" })
3313
3733
  ] }),
3314
- /* @__PURE__ */ jsxs6("dl", { children: [
3315
- /* @__PURE__ */ jsxs6("div", { children: [
3316
- /* @__PURE__ */ jsx6("dt", { children: "Applied to bill" }),
3317
- /* @__PURE__ */ jsx6("dd", { children: currency(payment.principalAmount) })
3734
+ /* @__PURE__ */ jsxs8("dl", { children: [
3735
+ /* @__PURE__ */ jsxs8("div", { children: [
3736
+ /* @__PURE__ */ jsx8("dt", { children: "Applied to bill" }),
3737
+ /* @__PURE__ */ jsx8("dd", { children: currency(payment.principalAmount) })
3318
3738
  ] }),
3319
- additional > 0 ? /* @__PURE__ */ jsxs6("div", { children: [
3320
- /* @__PURE__ */ jsx6("dt", { children: "Penalty & interest" }),
3321
- /* @__PURE__ */ jsx6("dd", { children: currency(additional) })
3739
+ additional > 0 ? /* @__PURE__ */ jsxs8("div", { children: [
3740
+ /* @__PURE__ */ jsx8("dt", { children: "Penalty & interest" }),
3741
+ /* @__PURE__ */ jsx8("dd", { children: currency(additional) })
3322
3742
  ] }) : null,
3323
- /* @__PURE__ */ jsxs6("div", { children: [
3324
- /* @__PURE__ */ jsx6("dt", { children: "Method" }),
3325
- /* @__PURE__ */ jsx6("dd", { children: payment.method.toUpperCase() })
3743
+ /* @__PURE__ */ jsxs8("div", { children: [
3744
+ /* @__PURE__ */ jsx8("dt", { children: "Method" }),
3745
+ /* @__PURE__ */ jsx8("dd", { children: payment.method.toUpperCase() })
3326
3746
  ] }),
3327
- /* @__PURE__ */ jsxs6("div", { children: [
3328
- /* @__PURE__ */ jsx6("dt", { children: "Reference" }),
3329
- /* @__PURE__ */ jsx6("dd", { children: payment.checkNumber || "\u2014" })
3747
+ /* @__PURE__ */ jsxs8("div", { children: [
3748
+ /* @__PURE__ */ jsx8("dt", { children: "Reference" }),
3749
+ /* @__PURE__ */ jsx8("dd", { children: payment.checkNumber || "\u2014" })
3330
3750
  ] }),
3331
- /* @__PURE__ */ jsxs6("div", { children: [
3332
- /* @__PURE__ */ jsx6("dt", { children: "Effective date" }),
3333
- /* @__PURE__ */ jsx6("dd", { children: payment.receivedDate || payment.depositDate || defaultFormatDate(payment.postedAt) })
3751
+ /* @__PURE__ */ jsxs8("div", { children: [
3752
+ /* @__PURE__ */ jsx8("dt", { children: "Effective date" }),
3753
+ /* @__PURE__ */ jsx8("dd", { children: payment.receivedDate || payment.depositDate || defaultFormatDate(payment.postedAt) })
3334
3754
  ] }),
3335
- /* @__PURE__ */ jsxs6("div", { children: [
3336
- /* @__PURE__ */ jsx6("dt", { children: "Deposit date" }),
3337
- /* @__PURE__ */ jsx6("dd", { children: payment.depositDate || "Not recorded" })
3755
+ /* @__PURE__ */ jsxs8("div", { children: [
3756
+ /* @__PURE__ */ jsx8("dt", { children: "Deposit date" }),
3757
+ /* @__PURE__ */ jsx8("dd", { children: payment.depositDate || "Not recorded" })
3338
3758
  ] }),
3339
- /* @__PURE__ */ jsxs6("div", { children: [
3340
- /* @__PURE__ */ jsx6("dt", { children: "Posted" }),
3341
- /* @__PURE__ */ jsxs6("dd", { children: [
3759
+ /* @__PURE__ */ jsxs8("div", { children: [
3760
+ /* @__PURE__ */ jsx8("dt", { children: "Posted" }),
3761
+ /* @__PURE__ */ jsxs8("dd", { children: [
3342
3762
  defaultFormatDate(payment.postedAt),
3343
3763
  " \xB7 ",
3344
3764
  payment.source.toUpperCase()
3345
3765
  ] })
3346
3766
  ] }),
3347
- /* @__PURE__ */ jsxs6("div", { children: [
3348
- /* @__PURE__ */ jsx6("dt", { children: "Status" }),
3349
- /* @__PURE__ */ jsx6("dd", { children: humanize(payment.status || "posted") })
3767
+ /* @__PURE__ */ jsxs8("div", { children: [
3768
+ /* @__PURE__ */ jsx8("dt", { children: "Status" }),
3769
+ /* @__PURE__ */ jsx8("dd", { children: humanize(payment.status || "posted") })
3350
3770
  ] })
3351
3771
  ] }),
3352
- payment.feeReason ? /* @__PURE__ */ jsx6("p", { children: payment.feeReason }) : null,
3353
- payment.note ? /* @__PURE__ */ jsx6("p", { children: payment.note }) : null
3772
+ payment.feeReason ? /* @__PURE__ */ jsx8("p", { children: payment.feeReason }) : null,
3773
+ payment.note ? /* @__PURE__ */ jsx8("p", { children: payment.note }) : null
3354
3774
  ] }, payment.id);
3355
3775
  }) })
3356
3776
  ] });
@@ -3379,11 +3799,11 @@ var lifecycleSurfaceStyles = `
3379
3799
 
3380
3800
  // src/connected-bill-lifecycle.tsx
3381
3801
  import {
3382
- useCallback as useCallback3,
3383
- useEffect as useEffect5,
3384
- useMemo as useMemo5,
3385
- useRef as useRef4,
3386
- useState as useState6
3802
+ useCallback as useCallback4,
3803
+ useEffect as useEffect6,
3804
+ useMemo as useMemo7,
3805
+ useRef as useRef5,
3806
+ useState as useState7
3387
3807
  } from "react";
3388
3808
  import {
3389
3809
  DEFAULT_API_BASE_URL as DEFAULT_API_BASE_URL2,
@@ -3391,7 +3811,7 @@ import {
3391
3811
  createBillLifecycleClient
3392
3812
  } from "@mindbill/browser";
3393
3813
  import { createBillLifecycleClient as createBillLifecycleClient2 } from "@mindbill/browser";
3394
- import { Fragment as Fragment5, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
3814
+ import { Fragment as Fragment6, jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
3395
3815
  var DEFAULT_REFRESH_INTERVAL2 = 6e4;
3396
3816
  function reservePreviewWindow() {
3397
3817
  const preview = window.open("about:blank", "_blank");
@@ -3438,32 +3858,32 @@ function useBillLifecycle({
3438
3858
  enabled = true,
3439
3859
  fetch: fetchOverride
3440
3860
  }) {
3441
- const [data, setData] = useState6(null);
3442
- const [error, setError] = useState6(null);
3443
- const [isLoading, setIsLoading] = useState6(enabled);
3444
- const [isRefreshing, setIsRefreshing] = useState6(false);
3445
- const [isMutating, setIsMutating] = useState6(false);
3446
- const mounted = useRef4(true);
3447
- const client = useMemo5(() => createBillLifecycleClient({
3861
+ const [data, setData] = useState7(null);
3862
+ const [error, setError] = useState7(null);
3863
+ const [isLoading, setIsLoading] = useState7(enabled);
3864
+ const [isRefreshing, setIsRefreshing] = useState7(false);
3865
+ const [isMutating, setIsMutating] = useState7(false);
3866
+ const mounted = useRef5(true);
3867
+ const client = useMemo7(() => createBillLifecycleClient({
3448
3868
  billId: providedBillId,
3449
3869
  sessionEndpoint,
3450
3870
  getSession,
3451
3871
  apiBaseUrl,
3452
3872
  fetch: fetchOverride
3453
3873
  }), [apiBaseUrl, fetchOverride, getSession, providedBillId, sessionEndpoint]);
3454
- useEffect5(() => {
3874
+ useEffect6(() => {
3455
3875
  setData(null);
3456
3876
  setError(null);
3457
3877
  setIsLoading(enabled);
3458
3878
  }, [enabled, providedBillId]);
3459
- useEffect5(() => {
3879
+ useEffect6(() => {
3460
3880
  mounted.current = true;
3461
3881
  return () => {
3462
3882
  mounted.current = false;
3463
3883
  client.clearSession();
3464
3884
  };
3465
3885
  }, [client]);
3466
- const refresh = useCallback3(async () => {
3886
+ const refresh = useCallback4(async () => {
3467
3887
  if (!enabled) return;
3468
3888
  setIsRefreshing(true);
3469
3889
  try {
@@ -3480,7 +3900,7 @@ function useBillLifecycle({
3480
3900
  }
3481
3901
  }
3482
3902
  }, [client, enabled]);
3483
- useEffect5(() => {
3903
+ useEffect6(() => {
3484
3904
  if (!enabled) return;
3485
3905
  void refresh();
3486
3906
  const interval = refreshInterval > 0 ? window.setInterval(() => void refresh(), refreshInterval) : null;
@@ -3491,7 +3911,7 @@ function useBillLifecycle({
3491
3911
  window.removeEventListener("focus", onFocus);
3492
3912
  };
3493
3913
  }, [enabled, refresh, refreshInterval]);
3494
- const mutate = useCallback3(async (task) => {
3914
+ const mutate = useCallback4(async (task) => {
3495
3915
  setIsMutating(true);
3496
3916
  setError(null);
3497
3917
  try {
@@ -3506,13 +3926,13 @@ function useBillLifecycle({
3506
3926
  if (mounted.current) setIsMutating(false);
3507
3927
  }
3508
3928
  }, []);
3509
- const openAttachment = useCallback3(async (attachment) => {
3929
+ const openAttachment = useCallback4(async (attachment) => {
3510
3930
  await openPdfFromUserGesture(() => client.getAttachment(attachment.id));
3511
3931
  }, [client]);
3512
- const openEor = useCallback3(async (document2) => {
3932
+ const openEor = useCallback4(async (document2) => {
3513
3933
  await openPdfFromUserGesture(() => client.getEor(document2.id));
3514
3934
  }, [client]);
3515
- const downloadPacket = useCallback3(async () => {
3935
+ const downloadPacket = useCallback4(async () => {
3516
3936
  setError(null);
3517
3937
  try {
3518
3938
  await openPdfFromUserGesture(() => client.getPacket());
@@ -3544,8 +3964,8 @@ function useBillLifecycle({
3544
3964
  };
3545
3965
  }
3546
3966
  function LifecycleDialog({ children, title, onClose }) {
3547
- const dialog = useRef4(null);
3548
- useEffect5(() => {
3967
+ const dialog = useRef5(null);
3968
+ useEffect6(() => {
3549
3969
  const previous = document.activeElement;
3550
3970
  dialog.current?.focus();
3551
3971
  const onKeyDown = (event) => event.key === "Escape" && onClose();
@@ -3555,8 +3975,8 @@ function LifecycleDialog({ children, title, onClose }) {
3555
3975
  previous?.focus();
3556
3976
  };
3557
3977
  }, [onClose]);
3558
- return /* @__PURE__ */ jsx7("div", { className: "mb-lifecycle-dialog-backdrop", onMouseDown: (event) => event.currentTarget === event.target && onClose(), children: /* @__PURE__ */ jsxs7("div", { ref: dialog, className: "mb-lifecycle-dialog", role: "dialog", "aria-modal": "true", "aria-label": title, tabIndex: -1, children: [
3559
- /* @__PURE__ */ jsx7("button", { type: "button", className: "mb-lifecycle-dialog-close", "aria-label": "Close", onClick: onClose, children: "\xD7" }),
3978
+ return /* @__PURE__ */ jsx9("div", { className: "mb-lifecycle-dialog-backdrop", onMouseDown: (event) => event.currentTarget === event.target && onClose(), children: /* @__PURE__ */ jsxs9("div", { ref: dialog, className: "mb-lifecycle-dialog", role: "dialog", "aria-modal": "true", "aria-label": title, tabIndex: -1, children: [
3979
+ /* @__PURE__ */ jsx9("button", { type: "button", className: "mb-lifecycle-dialog-close", "aria-label": "Close", onClick: onClose, children: "\xD7" }),
3560
3980
  children
3561
3981
  ] }) });
3562
3982
  }
@@ -3589,14 +4009,14 @@ function shouldShowSandboxControls(environment, enabled = false) {
3589
4009
  function ConnectedBillLifecycle({ appearance, sandboxControls = false, className, style, loadingFallback, errorFallback, onChanged, ...options }) {
3590
4010
  const lifecycle = useBillLifecycle(options);
3591
4011
  const { data } = lifecycle;
3592
- const [tab, setTab] = useState6("details");
3593
- const [panel, setPanel] = useState6("");
3594
- const [notice, setNotice] = useState6("");
3595
- const [reason, setReason] = useState6("");
3596
- const [payment, setPayment] = useState6({ amount: 0, penaltyAmount: 0, interestAmount: 0, method: "check", checkNumber: "", depositDate: today(), note: "" });
3597
- const [review, setReview] = useState6({ reason: "", payerClaimControlNumber: "", disputedAmount: void 0, attachmentIds: [], route: "ebill" });
3598
- const lastData = useRef4(null);
3599
- useEffect5(() => {
4012
+ const [tab, setTab] = useState7("details");
4013
+ const [panel, setPanel] = useState7("");
4014
+ const [notice, setNotice] = useState7("");
4015
+ const [reason, setReason] = useState7("");
4016
+ const [payment, setPayment] = useState7({ amount: 0, penaltyAmount: 0, interestAmount: 0, method: "check", checkNumber: "", depositDate: today(), note: "" });
4017
+ const [review, setReview] = useState7({ reason: "", payerClaimControlNumber: "", disputedAmount: void 0, attachmentIds: [], route: "ebill" });
4018
+ const lastData = useRef5(null);
4019
+ useEffect6(() => {
3600
4020
  if (!data || data === lastData.current) return;
3601
4021
  lastData.current = data;
3602
4022
  onChanged?.(data);
@@ -3613,13 +4033,13 @@ function ConnectedBillLifecycle({ appearance, sandboxControls = false, className
3613
4033
  attachmentIds: current.attachmentIds.length ? current.attachmentIds.filter((id) => data.bill.attachments.some((document2) => document2.id === id)) : data.bill.attachments.map((document2) => document2.id)
3614
4034
  }));
3615
4035
  }, [data, onChanged]);
3616
- if (lifecycle.isLoading && !data) return /* @__PURE__ */ jsx7(Fragment5, { children: loadingFallback ?? /* @__PURE__ */ jsx7("div", { className: "mb-lifecycle-loading", children: "Loading bill\u2026" }) });
4036
+ if (lifecycle.isLoading && !data) return /* @__PURE__ */ jsx9(Fragment6, { children: loadingFallback ?? /* @__PURE__ */ jsx9("div", { className: "mb-lifecycle-loading", children: "Loading bill\u2026" }) });
3617
4037
  if (!data) {
3618
4038
  const error = lifecycle.error ?? new Error("Bill could not be loaded.");
3619
- return /* @__PURE__ */ jsx7(Fragment5, { children: errorFallback?.(error, lifecycle.refresh) ?? /* @__PURE__ */ jsxs7("div", { className: "mb-lifecycle-error", role: "alert", children: [
3620
- /* @__PURE__ */ jsx7("strong", { children: "Billing is unavailable." }),
3621
- /* @__PURE__ */ jsx7("span", { children: error.message }),
3622
- /* @__PURE__ */ jsx7("button", { type: "button", onClick: () => void lifecycle.refresh(), children: "Try again" })
4039
+ return /* @__PURE__ */ jsx9(Fragment6, { children: errorFallback?.(error, lifecycle.refresh) ?? /* @__PURE__ */ jsxs9("div", { className: "mb-lifecycle-error", role: "alert", children: [
4040
+ /* @__PURE__ */ jsx9("strong", { children: "Billing is unavailable." }),
4041
+ /* @__PURE__ */ jsx9("span", { children: error.message }),
4042
+ /* @__PURE__ */ jsx9("button", { type: "button", onClick: () => void lifecycle.refresh(), children: "Try again" })
3623
4043
  ] }) });
3624
4044
  }
3625
4045
  const complete = async (message, task) => {
@@ -3637,170 +4057,170 @@ function ConnectedBillLifecycle({ appearance, sandboxControls = false, className
3637
4057
  const actions = data.lifecycle.actions.filter((action) => action.enabled && supportedActions.has(action.id));
3638
4058
  const showSandboxControls = shouldShowSandboxControls(data.environment, sandboxControls);
3639
4059
  const simulations = showSandboxControls ? sandboxScenarios(data.lifecycle.state) : [];
3640
- return /* @__PURE__ */ jsxs7("section", { className: ["mb-connected-lifecycle", className].filter(Boolean).join(" "), style: mindBillAppearanceStyle(appearance, style), children: [
3641
- /* @__PURE__ */ jsx7("style", { children: CONNECTED_LIFECYCLE_STYLES }),
3642
- /* @__PURE__ */ jsx7(BillLifecycleProgress, { state: data.lifecycle.state, nativeStatus: data.lifecycle.nativeStatus, submittedAt: data.lifecycle.submittedAt ?? null, agingDays: data.lifecycle.agingDays ?? null, ...appearance ? { appearance } : {} }),
3643
- /* @__PURE__ */ jsxs7("header", { className: "mb-lifecycle-head", children: [
3644
- /* @__PURE__ */ jsxs7("div", { children: [
3645
- /* @__PURE__ */ jsx7("div", { className: "mb-lifecycle-title", children: /* @__PURE__ */ jsxs7("h2", { children: [
4060
+ return /* @__PURE__ */ jsxs9("section", { className: ["mb-connected-lifecycle", className].filter(Boolean).join(" "), style: mindBillAppearanceStyle(appearance, style), children: [
4061
+ /* @__PURE__ */ jsx9("style", { children: CONNECTED_LIFECYCLE_STYLES }),
4062
+ /* @__PURE__ */ jsx9(BillLifecycleProgress, { state: data.lifecycle.state, nativeStatus: data.lifecycle.nativeStatus, submittedAt: data.lifecycle.submittedAt ?? null, agingDays: data.lifecycle.agingDays ?? null, ...appearance ? { appearance } : {} }),
4063
+ /* @__PURE__ */ jsxs9("header", { className: "mb-lifecycle-head", children: [
4064
+ /* @__PURE__ */ jsxs9("div", { children: [
4065
+ /* @__PURE__ */ jsx9("div", { className: "mb-lifecycle-title", children: /* @__PURE__ */ jsxs9("h2", { children: [
3646
4066
  "Bill #",
3647
4067
  data.bill.billNumber
3648
4068
  ] }) }),
3649
- /* @__PURE__ */ jsxs7("p", { children: [
4069
+ /* @__PURE__ */ jsxs9("p", { children: [
3650
4070
  "Claim ",
3651
4071
  data.injury.claimNumber || "\u2014",
3652
4072
  lifecycle.isRefreshing ? " \xB7 Refreshing\u2026" : ""
3653
4073
  ] })
3654
4074
  ] }),
3655
- /* @__PURE__ */ jsx7("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating, onClick: () => void lifecycle.downloadPacket().catch(() => void 0), children: "Download packet" })
4075
+ /* @__PURE__ */ jsx9("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating, onClick: () => void lifecycle.downloadPacket().catch(() => void 0), children: "Download packet" })
3656
4076
  ] }),
3657
- /* @__PURE__ */ jsxs7("div", { className: "mb-lifecycle-tabs", role: "tablist", "aria-label": "Bill view", children: [
3658
- /* @__PURE__ */ jsx7("button", { type: "button", role: "tab", "aria-selected": tab === "details", onClick: () => setTab("details"), children: "Bill details" }),
3659
- /* @__PURE__ */ jsx7("button", { type: "button", role: "tab", "aria-selected": tab === "history", onClick: () => setTab("history"), children: "Bill history" })
4077
+ /* @__PURE__ */ jsxs9("div", { className: "mb-lifecycle-tabs", role: "tablist", "aria-label": "Bill view", children: [
4078
+ /* @__PURE__ */ jsx9("button", { type: "button", role: "tab", "aria-selected": tab === "details", onClick: () => setTab("details"), children: "Bill details" }),
4079
+ /* @__PURE__ */ jsx9("button", { type: "button", role: "tab", "aria-selected": tab === "history", onClick: () => setTab("history"), children: "Bill history" })
3660
4080
  ] }),
3661
- tab === "details" ? /* @__PURE__ */ jsxs7("div", { className: "mb-lifecycle-tabpanel", role: "tabpanel", children: [
3662
- data.eors.length || data.payments.length || ["processed", "denied", "partially_paid"].includes(data.lifecycle.state) ? /* @__PURE__ */ jsx7(BillExplanationOfReview, { remittance: data.remittance, eors: data.eors, payments: data.payments, submittedAt: data.lifecycle.submittedAt ?? null, onOpenEor: lifecycle.openEor, ...appearance ? { appearance } : {} }) : null,
3663
- showSandboxControls ? /* @__PURE__ */ jsxs7("section", { className: "mb-lifecycle-simulator", "aria-label": "Sandbox lifecycle simulator", children: [
3664
- /* @__PURE__ */ jsxs7("div", { children: [
3665
- /* @__PURE__ */ jsx7("span", { children: "Sandbox demo controls" }),
3666
- /* @__PURE__ */ jsx7("h3", { children: "Simulate the next payer response" }),
3667
- /* @__PURE__ */ jsx7("p", { children: "This changes sandbox data only. The host receives the result through the same lifecycle API and components partners use." })
4081
+ tab === "details" ? /* @__PURE__ */ jsxs9("div", { className: "mb-lifecycle-tabpanel", role: "tabpanel", children: [
4082
+ data.eors.length || data.payments.length || ["processed", "denied", "partially_paid"].includes(data.lifecycle.state) ? /* @__PURE__ */ jsx9(BillExplanationOfReview, { remittance: data.remittance, eors: data.eors, payments: data.payments, submittedAt: data.lifecycle.submittedAt ?? null, onOpenEor: lifecycle.openEor, ...appearance ? { appearance } : {} }) : null,
4083
+ showSandboxControls ? /* @__PURE__ */ jsxs9("section", { className: "mb-lifecycle-simulator", "aria-label": "Sandbox lifecycle simulator", children: [
4084
+ /* @__PURE__ */ jsxs9("div", { children: [
4085
+ /* @__PURE__ */ jsx9("span", { children: "Sandbox demo controls" }),
4086
+ /* @__PURE__ */ jsx9("h3", { children: "Simulate the next payer response" }),
4087
+ /* @__PURE__ */ jsx9("p", { children: "This changes sandbox data only. The host receives the result through the same lifecycle API and components partners use." })
3668
4088
  ] }),
3669
- simulations.length ? /* @__PURE__ */ jsx7("div", { className: "mb-lifecycle-simulator-actions", children: simulations.map((scenario) => /* @__PURE__ */ jsxs7("button", { type: "button", disabled: lifecycle.isMutating, onClick: () => void complete(`${scenario.label} simulated.`, () => lifecycle.simulateSandbox({ scenario: scenario.id })), children: [
3670
- /* @__PURE__ */ jsx7("strong", { children: scenario.label }),
3671
- /* @__PURE__ */ jsx7("span", { children: scenario.detail })
3672
- ] }, scenario.id)) }) : /* @__PURE__ */ jsx7("p", { className: "mb-lifecycle-simulator-idle", children: "No simulated payer transition is needed at this stage. Use the bill action below to continue." })
4089
+ simulations.length ? /* @__PURE__ */ jsx9("div", { className: "mb-lifecycle-simulator-actions", children: simulations.map((scenario) => /* @__PURE__ */ jsxs9("button", { type: "button", disabled: lifecycle.isMutating, onClick: () => void complete(`${scenario.label} simulated.`, () => lifecycle.simulateSandbox({ scenario: scenario.id })), children: [
4090
+ /* @__PURE__ */ jsx9("strong", { children: scenario.label }),
4091
+ /* @__PURE__ */ jsx9("span", { children: scenario.detail })
4092
+ ] }, scenario.id)) }) : /* @__PURE__ */ jsx9("p", { className: "mb-lifecycle-simulator-idle", children: "No simulated payer transition is needed at this stage. Use the bill action below to continue." })
3673
4093
  ] }) : null,
3674
- /* @__PURE__ */ jsx7(BillReadOnlyForm, { data, onOpenAttachment: lifecycle.openAttachment, ...appearance ? { appearance } : {} })
3675
- ] }) : /* @__PURE__ */ jsx7("div", { className: "mb-lifecycle-tabpanel", role: "tabpanel", children: /* @__PURE__ */ jsx7(BillActivityTimeline, { events: data.activity, ...appearance ? { appearance } : {} }) }),
3676
- viewEor || actions.length ? /* @__PURE__ */ jsxs7("aside", { className: "mb-lifecycle-actions-sheet", "aria-label": "Bill actions", children: [
3677
- viewEor && data.eors[0] ? /* @__PURE__ */ jsx7("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => void lifecycle.openEor(data.eors[0]).catch(() => void 0), children: viewEor.label }) : null,
3678
- actions.map((action) => /* @__PURE__ */ jsx7("button", { type: "button", className: action.primary ? "mb-lifecycle-button primary" : "mb-lifecycle-button secondary", onClick: () => {
4094
+ /* @__PURE__ */ jsx9(BillReadOnlyForm, { data, onOpenAttachment: lifecycle.openAttachment, ...appearance ? { appearance } : {} })
4095
+ ] }) : /* @__PURE__ */ jsx9("div", { className: "mb-lifecycle-tabpanel", role: "tabpanel", children: /* @__PURE__ */ jsx9(BillActivityTimeline, { events: data.activity, ...appearance ? { appearance } : {} }) }),
4096
+ viewEor || actions.length ? /* @__PURE__ */ jsxs9("aside", { className: "mb-lifecycle-actions-sheet", "aria-label": "Bill actions", children: [
4097
+ viewEor && data.eors[0] ? /* @__PURE__ */ jsx9("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => void lifecycle.openEor(data.eors[0]).catch(() => void 0), children: viewEor.label }) : null,
4098
+ actions.map((action) => /* @__PURE__ */ jsx9("button", { type: "button", className: action.primary ? "mb-lifecycle-button primary" : "mb-lifecycle-button secondary", onClick: () => {
3679
4099
  const next = actionPanel(action);
3680
4100
  if (next) setPanel(next);
3681
4101
  }, children: action.label }, action.id))
3682
4102
  ] }) : null,
3683
- panel === "resubmit" ? /* @__PURE__ */ jsx7(LifecycleDialog, { title: "Correct and resubmit", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs7("section", { className: "mb-lifecycle-panel", children: [
3684
- /* @__PURE__ */ jsxs7("div", { children: [
3685
- /* @__PURE__ */ jsx7("h3", { children: "Correct and resubmit" }),
3686
- /* @__PURE__ */ jsx7("p", { children: "The original submission remains immutable. This records a new submission attempt after the routing issue is corrected." })
4103
+ panel === "resubmit" ? /* @__PURE__ */ jsx9(LifecycleDialog, { title: "Correct and resubmit", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs9("section", { className: "mb-lifecycle-panel", children: [
4104
+ /* @__PURE__ */ jsxs9("div", { children: [
4105
+ /* @__PURE__ */ jsx9("h3", { children: "Correct and resubmit" }),
4106
+ /* @__PURE__ */ jsx9("p", { children: "The original submission remains immutable. This records a new submission attempt after the routing issue is corrected." })
3687
4107
  ] }),
3688
- /* @__PURE__ */ jsxs7("label", { children: [
3689
- /* @__PURE__ */ jsx7("span", { children: "Correction note (optional)" }),
3690
- /* @__PURE__ */ jsx7("textarea", { value: reason, placeholder: "What changed before resubmission?", onChange: (event) => setReason(event.target.value) })
4108
+ /* @__PURE__ */ jsxs9("label", { children: [
4109
+ /* @__PURE__ */ jsx9("span", { children: "Correction note (optional)" }),
4110
+ /* @__PURE__ */ jsx9("textarea", { value: reason, placeholder: "What changed before resubmission?", onChange: (event) => setReason(event.target.value) })
3691
4111
  ] }),
3692
- /* @__PURE__ */ jsxs7("div", { className: "mb-lifecycle-panel-actions", children: [
3693
- /* @__PURE__ */ jsx7("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
3694
- /* @__PURE__ */ jsx7("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating, onClick: () => void complete("Bill resubmitted.", () => lifecycle.resubmitBill({ reason })), children: lifecycle.isMutating ? "Resubmitting\u2026" : "Resubmit bill" })
4112
+ /* @__PURE__ */ jsxs9("div", { className: "mb-lifecycle-panel-actions", children: [
4113
+ /* @__PURE__ */ jsx9("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
4114
+ /* @__PURE__ */ jsx9("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating, onClick: () => void complete("Bill resubmitted.", () => lifecycle.resubmitBill({ reason })), children: lifecycle.isMutating ? "Resubmitting\u2026" : "Resubmit bill" })
3695
4115
  ] })
3696
4116
  ] }) }) : null,
3697
- panel === "second_review" ? /* @__PURE__ */ jsx7(LifecycleDialog, { title: "Submit Second Review", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs7("section", { className: "mb-lifecycle-panel", children: [
3698
- /* @__PURE__ */ jsxs7("div", { children: [
3699
- /* @__PURE__ */ jsx7("h3", { children: "Submit Second Review" }),
3700
- /* @__PURE__ */ jsx7("p", { children: "Explain the dispute and include the payer control number and supporting documents." })
4117
+ panel === "second_review" ? /* @__PURE__ */ jsx9(LifecycleDialog, { title: "Submit Second Review", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs9("section", { className: "mb-lifecycle-panel", children: [
4118
+ /* @__PURE__ */ jsxs9("div", { children: [
4119
+ /* @__PURE__ */ jsx9("h3", { children: "Submit Second Review" }),
4120
+ /* @__PURE__ */ jsx9("p", { children: "Explain the dispute and include the payer control number and supporting documents." })
3701
4121
  ] }),
3702
- /* @__PURE__ */ jsxs7("div", { className: "mb-lifecycle-fields two", children: [
3703
- /* @__PURE__ */ jsxs7("label", { className: "full", children: [
3704
- /* @__PURE__ */ jsx7("span", { children: "Reason" }),
3705
- /* @__PURE__ */ jsx7("textarea", { required: true, value: review.reason, onChange: (event) => setReview((current) => ({ ...current, reason: event.target.value })) })
4122
+ /* @__PURE__ */ jsxs9("div", { className: "mb-lifecycle-fields two", children: [
4123
+ /* @__PURE__ */ jsxs9("label", { className: "full", children: [
4124
+ /* @__PURE__ */ jsx9("span", { children: "Reason" }),
4125
+ /* @__PURE__ */ jsx9("textarea", { required: true, value: review.reason, onChange: (event) => setReview((current) => ({ ...current, reason: event.target.value })) })
3706
4126
  ] }),
3707
- /* @__PURE__ */ jsxs7("label", { children: [
3708
- /* @__PURE__ */ jsx7("span", { children: "Payer claim control number" }),
3709
- /* @__PURE__ */ jsx7("input", { required: true, value: review.payerClaimControlNumber, onChange: (event) => setReview((current) => ({ ...current, payerClaimControlNumber: event.target.value })) })
4127
+ /* @__PURE__ */ jsxs9("label", { children: [
4128
+ /* @__PURE__ */ jsx9("span", { children: "Payer claim control number" }),
4129
+ /* @__PURE__ */ jsx9("input", { required: true, value: review.payerClaimControlNumber, onChange: (event) => setReview((current) => ({ ...current, payerClaimControlNumber: event.target.value })) })
3710
4130
  ] }),
3711
- /* @__PURE__ */ jsxs7("label", { children: [
3712
- /* @__PURE__ */ jsx7("span", { children: "Disputed amount" }),
3713
- /* @__PURE__ */ jsx7("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 })) })
4131
+ /* @__PURE__ */ jsxs9("label", { children: [
4132
+ /* @__PURE__ */ jsx9("span", { children: "Disputed amount" }),
4133
+ /* @__PURE__ */ jsx9("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 })) })
3714
4134
  ] }),
3715
- /* @__PURE__ */ jsxs7("label", { children: [
3716
- /* @__PURE__ */ jsx7("span", { children: "Send via" }),
3717
- /* @__PURE__ */ jsxs7("select", { value: review.route, onChange: (event) => setReview((current) => ({ ...current, route: event.target.value })), children: [
3718
- /* @__PURE__ */ jsx7("option", { value: "ebill", children: "E-bill" }),
3719
- /* @__PURE__ */ jsx7("option", { value: "fax", children: "Fax" }),
3720
- /* @__PURE__ */ jsx7("option", { value: "mail", children: "Mail" }),
3721
- /* @__PURE__ */ jsx7("option", { value: "email", children: "Email" })
4135
+ /* @__PURE__ */ jsxs9("label", { children: [
4136
+ /* @__PURE__ */ jsx9("span", { children: "Send via" }),
4137
+ /* @__PURE__ */ jsxs9("select", { value: review.route, onChange: (event) => setReview((current) => ({ ...current, route: event.target.value })), children: [
4138
+ /* @__PURE__ */ jsx9("option", { value: "ebill", children: "E-bill" }),
4139
+ /* @__PURE__ */ jsx9("option", { value: "fax", children: "Fax" }),
4140
+ /* @__PURE__ */ jsx9("option", { value: "mail", children: "Mail" }),
4141
+ /* @__PURE__ */ jsx9("option", { value: "email", children: "Email" })
3722
4142
  ] })
3723
4143
  ] })
3724
4144
  ] }),
3725
- /* @__PURE__ */ jsxs7("fieldset", { className: "mb-lifecycle-packet", children: [
3726
- /* @__PURE__ */ jsx7("legend", { children: "Supporting packet" }),
3727
- data.bill.attachments.map((attachment) => /* @__PURE__ */ jsxs7("label", { children: [
3728
- /* @__PURE__ */ jsx7("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) })) }),
3729
- /* @__PURE__ */ jsxs7("span", { children: [
3730
- /* @__PURE__ */ jsx7("strong", { children: attachment.filename }),
3731
- /* @__PURE__ */ jsx7("small", { children: attachment.description || attachment.documentType })
4145
+ /* @__PURE__ */ jsxs9("fieldset", { className: "mb-lifecycle-packet", children: [
4146
+ /* @__PURE__ */ jsx9("legend", { children: "Supporting packet" }),
4147
+ data.bill.attachments.map((attachment) => /* @__PURE__ */ jsxs9("label", { children: [
4148
+ /* @__PURE__ */ jsx9("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) })) }),
4149
+ /* @__PURE__ */ jsxs9("span", { children: [
4150
+ /* @__PURE__ */ jsx9("strong", { children: attachment.filename }),
4151
+ /* @__PURE__ */ jsx9("small", { children: attachment.description || attachment.documentType })
3732
4152
  ] }),
3733
- /* @__PURE__ */ jsx7("button", { type: "button", onClick: () => void lifecycle.openAttachment(attachment).catch(() => void 0), children: "View" })
4153
+ /* @__PURE__ */ jsx9("button", { type: "button", onClick: () => void lifecycle.openAttachment(attachment).catch(() => void 0), children: "View" })
3734
4154
  ] }, attachment.id))
3735
4155
  ] }),
3736
- /* @__PURE__ */ jsxs7("div", { className: "mb-lifecycle-panel-actions", children: [
3737
- /* @__PURE__ */ jsx7("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
3738
- /* @__PURE__ */ jsx7("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" })
4156
+ /* @__PURE__ */ jsxs9("div", { className: "mb-lifecycle-panel-actions", children: [
4157
+ /* @__PURE__ */ jsx9("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
4158
+ /* @__PURE__ */ jsx9("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" })
3739
4159
  ] })
3740
4160
  ] }) }) : null,
3741
- panel === "payment" ? /* @__PURE__ */ jsx7(LifecycleDialog, { title: "Post payment", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs7("section", { className: "mb-lifecycle-panel", children: [
3742
- /* @__PURE__ */ jsxs7("div", { children: [
3743
- /* @__PURE__ */ jsx7("h3", { children: "Post payment" }),
3744
- /* @__PURE__ */ jsx7("p", { children: "Record a full or partial payment, plus any penalty and interest received." })
4161
+ panel === "payment" ? /* @__PURE__ */ jsx9(LifecycleDialog, { title: "Post payment", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs9("section", { className: "mb-lifecycle-panel", children: [
4162
+ /* @__PURE__ */ jsxs9("div", { children: [
4163
+ /* @__PURE__ */ jsx9("h3", { children: "Post payment" }),
4164
+ /* @__PURE__ */ jsx9("p", { children: "Record a full or partial payment, plus any penalty and interest received." })
3745
4165
  ] }),
3746
- /* @__PURE__ */ jsxs7("div", { className: "mb-lifecycle-fields two", children: [
3747
- /* @__PURE__ */ jsxs7("label", { children: [
3748
- /* @__PURE__ */ jsx7("span", { children: "Amount applied to bill" }),
3749
- /* @__PURE__ */ jsx7("input", { type: "number", min: "0.01", max: data.bill.balanceDue, step: "0.01", value: payment.amount || "", onChange: (event) => setPayment((current) => ({ ...current, amount: Number(event.target.value) })) })
4166
+ /* @__PURE__ */ jsxs9("div", { className: "mb-lifecycle-fields two", children: [
4167
+ /* @__PURE__ */ jsxs9("label", { children: [
4168
+ /* @__PURE__ */ jsx9("span", { children: "Amount applied to bill" }),
4169
+ /* @__PURE__ */ jsx9("input", { type: "number", min: "0.01", max: data.bill.balanceDue, step: "0.01", value: payment.amount || "", onChange: (event) => setPayment((current) => ({ ...current, amount: Number(event.target.value) })) })
3750
4170
  ] }),
3751
- /* @__PURE__ */ jsxs7("label", { children: [
3752
- /* @__PURE__ */ jsx7("span", { children: "Penalty" }),
3753
- /* @__PURE__ */ jsx7("input", { type: "number", min: "0", step: "0.01", value: payment.penaltyAmount || "", placeholder: "0.00", onChange: (event) => setPayment((current) => ({ ...current, penaltyAmount: Number(event.target.value) })) })
4171
+ /* @__PURE__ */ jsxs9("label", { children: [
4172
+ /* @__PURE__ */ jsx9("span", { children: "Penalty" }),
4173
+ /* @__PURE__ */ jsx9("input", { type: "number", min: "0", step: "0.01", value: payment.penaltyAmount || "", placeholder: "0.00", onChange: (event) => setPayment((current) => ({ ...current, penaltyAmount: Number(event.target.value) })) })
3754
4174
  ] }),
3755
- /* @__PURE__ */ jsxs7("label", { children: [
3756
- /* @__PURE__ */ jsx7("span", { children: "Interest" }),
3757
- /* @__PURE__ */ jsx7("input", { type: "number", min: "0", step: "0.01", value: payment.interestAmount || "", placeholder: "0.00", onChange: (event) => setPayment((current) => ({ ...current, interestAmount: Number(event.target.value) })) })
4175
+ /* @__PURE__ */ jsxs9("label", { children: [
4176
+ /* @__PURE__ */ jsx9("span", { children: "Interest" }),
4177
+ /* @__PURE__ */ jsx9("input", { type: "number", min: "0", step: "0.01", value: payment.interestAmount || "", placeholder: "0.00", onChange: (event) => setPayment((current) => ({ ...current, interestAmount: Number(event.target.value) })) })
3758
4178
  ] }),
3759
- /* @__PURE__ */ jsxs7("label", { children: [
3760
- /* @__PURE__ */ jsx7("span", { children: "Method" }),
3761
- /* @__PURE__ */ jsxs7("select", { value: payment.method, onChange: (event) => setPayment((current) => ({ ...current, method: event.target.value })), children: [
3762
- /* @__PURE__ */ jsx7("option", { value: "check", children: "Check" }),
3763
- /* @__PURE__ */ jsx7("option", { value: "eft", children: "EFT" })
4179
+ /* @__PURE__ */ jsxs9("label", { children: [
4180
+ /* @__PURE__ */ jsx9("span", { children: "Method" }),
4181
+ /* @__PURE__ */ jsxs9("select", { value: payment.method, onChange: (event) => setPayment((current) => ({ ...current, method: event.target.value })), children: [
4182
+ /* @__PURE__ */ jsx9("option", { value: "check", children: "Check" }),
4183
+ /* @__PURE__ */ jsx9("option", { value: "eft", children: "EFT" })
3764
4184
  ] })
3765
4185
  ] }),
3766
- /* @__PURE__ */ jsxs7("label", { children: [
3767
- /* @__PURE__ */ jsx7("span", { children: payment.method === "check" ? "Check number" : "EFT reference" }),
3768
- /* @__PURE__ */ jsx7("input", { value: payment.checkNumber, onChange: (event) => setPayment((current) => ({ ...current, checkNumber: event.target.value })) })
4186
+ /* @__PURE__ */ jsxs9("label", { children: [
4187
+ /* @__PURE__ */ jsx9("span", { children: payment.method === "check" ? "Check number" : "EFT reference" }),
4188
+ /* @__PURE__ */ jsx9("input", { value: payment.checkNumber, onChange: (event) => setPayment((current) => ({ ...current, checkNumber: event.target.value })) })
3769
4189
  ] }),
3770
- /* @__PURE__ */ jsxs7("label", { children: [
3771
- /* @__PURE__ */ jsx7("span", { children: "Deposit date" }),
3772
- /* @__PURE__ */ jsx7("input", { required: true, value: payment.depositDate, placeholder: "MM/DD/YYYY", onChange: (event) => setPayment((current) => ({ ...current, depositDate: event.target.value })) })
4190
+ /* @__PURE__ */ jsxs9("label", { children: [
4191
+ /* @__PURE__ */ jsx9("span", { children: "Deposit date" }),
4192
+ /* @__PURE__ */ jsx9("input", { required: true, value: payment.depositDate, placeholder: "MM/DD/YYYY", onChange: (event) => setPayment((current) => ({ ...current, depositDate: event.target.value })) })
3773
4193
  ] }),
3774
- /* @__PURE__ */ jsxs7("label", { className: "full", children: [
3775
- /* @__PURE__ */ jsx7("span", { children: "Note (optional)" }),
3776
- /* @__PURE__ */ jsx7("input", { value: payment.note, onChange: (event) => setPayment((current) => ({ ...current, note: event.target.value })) })
4194
+ /* @__PURE__ */ jsxs9("label", { className: "full", children: [
4195
+ /* @__PURE__ */ jsx9("span", { children: "Note (optional)" }),
4196
+ /* @__PURE__ */ jsx9("input", { value: payment.note, onChange: (event) => setPayment((current) => ({ ...current, note: event.target.value })) })
3777
4197
  ] })
3778
4198
  ] }),
3779
- /* @__PURE__ */ jsxs7("div", { className: "mb-payment-total", children: [
3780
- /* @__PURE__ */ jsx7("span", { children: "Total received" }),
3781
- /* @__PURE__ */ jsx7("strong", { children: new Intl.NumberFormat(void 0, { style: "currency", currency: "USD" }).format(payment.amount + (payment.penaltyAmount ?? 0) + (payment.interestAmount ?? 0)) })
4199
+ /* @__PURE__ */ jsxs9("div", { className: "mb-payment-total", children: [
4200
+ /* @__PURE__ */ jsx9("span", { children: "Total received" }),
4201
+ /* @__PURE__ */ jsx9("strong", { children: new Intl.NumberFormat(void 0, { style: "currency", currency: "USD" }).format(payment.amount + (payment.penaltyAmount ?? 0) + (payment.interestAmount ?? 0)) })
3782
4202
  ] }),
3783
- /* @__PURE__ */ jsxs7("div", { className: "mb-lifecycle-panel-actions", children: [
3784
- /* @__PURE__ */ jsx7("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
3785
- /* @__PURE__ */ jsx7("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating || payment.amount <= 0 || payment.amount > data.bill.balanceDue || (payment.penaltyAmount ?? 0) < 0 || (payment.interestAmount ?? 0) < 0 || !payment.depositDate, onClick: () => void complete("Payment posted.", () => lifecycle.postPayment(payment)), children: lifecycle.isMutating ? "Posting\u2026" : "Post payment" })
4203
+ /* @__PURE__ */ jsxs9("div", { className: "mb-lifecycle-panel-actions", children: [
4204
+ /* @__PURE__ */ jsx9("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
4205
+ /* @__PURE__ */ jsx9("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating || payment.amount <= 0 || payment.amount > data.bill.balanceDue || (payment.penaltyAmount ?? 0) < 0 || (payment.interestAmount ?? 0) < 0 || !payment.depositDate, onClick: () => void complete("Payment posted.", () => lifecycle.postPayment(payment)), children: lifecycle.isMutating ? "Posting\u2026" : "Post payment" })
3786
4206
  ] })
3787
4207
  ] }) }) : null,
3788
- panel === "close" || panel === "reopen" ? /* @__PURE__ */ jsx7(LifecycleDialog, { title: panel === "close" ? "Close bill" : "Reopen bill", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs7("section", { className: "mb-lifecycle-panel", children: [
3789
- /* @__PURE__ */ jsxs7("div", { children: [
3790
- /* @__PURE__ */ jsx7("h3", { children: panel === "close" ? "Close bill" : "Reopen bill" }),
3791
- /* @__PURE__ */ jsx7("p", { children: panel === "close" ? "The immutable submission and history remain available." : "Return this bill to active follow-up without changing the submitted snapshot." })
4208
+ panel === "close" || panel === "reopen" ? /* @__PURE__ */ jsx9(LifecycleDialog, { title: panel === "close" ? "Close bill" : "Reopen bill", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs9("section", { className: "mb-lifecycle-panel", children: [
4209
+ /* @__PURE__ */ jsxs9("div", { children: [
4210
+ /* @__PURE__ */ jsx9("h3", { children: panel === "close" ? "Close bill" : "Reopen bill" }),
4211
+ /* @__PURE__ */ jsx9("p", { children: panel === "close" ? "The immutable submission and history remain available." : "Return this bill to active follow-up without changing the submitted snapshot." })
3792
4212
  ] }),
3793
- /* @__PURE__ */ jsxs7("label", { children: [
3794
- /* @__PURE__ */ jsx7("span", { children: "Reason" }),
3795
- /* @__PURE__ */ jsx7("textarea", { required: true, value: reason, onChange: (event) => setReason(event.target.value) })
4213
+ /* @__PURE__ */ jsxs9("label", { children: [
4214
+ /* @__PURE__ */ jsx9("span", { children: "Reason" }),
4215
+ /* @__PURE__ */ jsx9("textarea", { required: true, value: reason, onChange: (event) => setReason(event.target.value) })
3796
4216
  ] }),
3797
- /* @__PURE__ */ jsxs7("div", { className: "mb-lifecycle-panel-actions", children: [
3798
- /* @__PURE__ */ jsx7("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
3799
- /* @__PURE__ */ jsx7("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating || !reason.trim(), onClick: () => void complete(panel === "close" ? "Bill closed." : "Bill reopened.", () => panel === "close" ? lifecycle.closeBill({ reason }) : lifecycle.reopenBill({ reason })), children: lifecycle.isMutating ? "Saving\u2026" : panel === "close" ? "Close bill" : "Reopen bill" })
4217
+ /* @__PURE__ */ jsxs9("div", { className: "mb-lifecycle-panel-actions", children: [
4218
+ /* @__PURE__ */ jsx9("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
4219
+ /* @__PURE__ */ jsx9("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating || !reason.trim(), onClick: () => void complete(panel === "close" ? "Bill closed." : "Bill reopened.", () => panel === "close" ? lifecycle.closeBill({ reason }) : lifecycle.reopenBill({ reason })), children: lifecycle.isMutating ? "Saving\u2026" : panel === "close" ? "Close bill" : "Reopen bill" })
3800
4220
  ] })
3801
4221
  ] }) }) : null,
3802
- notice ? /* @__PURE__ */ jsx7("div", { className: "mb-lifecycle-message success", role: "status", children: notice }) : null,
3803
- lifecycle.error ? /* @__PURE__ */ jsx7("div", { className: "mb-lifecycle-message error", role: "alert", children: lifecycle.error.message }) : null
4222
+ notice ? /* @__PURE__ */ jsx9("div", { className: "mb-lifecycle-message success", role: "status", children: notice }) : null,
4223
+ lifecycle.error ? /* @__PURE__ */ jsx9("div", { className: "mb-lifecycle-message error", role: "alert", children: lifecycle.error.message }) : null
3804
4224
  ] });
3805
4225
  }
3806
4226
  var CONNECTED_LIFECYCLE_STYLES = `
@@ -3812,9 +4232,9 @@ var CONNECTED_LIFECYCLE_STYLES = `
3812
4232
 
3813
4233
  // src/index.tsx
3814
4234
  function widget(tagName, props) {
3815
- const ref = useRef5(null);
4235
+ const ref = useRef6(null);
3816
4236
  const { onMindBill, onMindBillError } = props;
3817
- useEffect6(() => {
4237
+ useEffect7(() => {
3818
4238
  const element = ref.current;
3819
4239
  if (!element) return;
3820
4240
  const handleEvent = (event) => onMindBill?.(event);
@@ -3851,6 +4271,7 @@ function MindBillBillReview(props) {
3851
4271
  return widget("mindbill-bill-review", props);
3852
4272
  }
3853
4273
  export {
4274
+ BILL_STATUS_AGING_BUCKETS,
3854
4275
  BILL_SUBMISSION_DIAGNOSIS_QUICK_PICKS,
3855
4276
  BILL_SUBMISSION_DOCUMENT_TYPES,
3856
4277
  BILL_SUBMISSION_REPORT_TYPES,
@@ -3867,6 +4288,7 @@ export {
3867
4288
  BillRemittanceCard,
3868
4289
  BillReviewForm,
3869
4290
  BillSnapshotSummary,
4291
+ BillStatusAgingMatrix,
3870
4292
  BillStatusSummary,
3871
4293
  BillSubmissionActions,
3872
4294
  BillSubmissionAttachmentsSection,
@@ -3878,6 +4300,7 @@ export {
3878
4300
  BillSubmissionServiceLinesSection,
3879
4301
  BillingDashboard,
3880
4302
  BillingReport,
4303
+ BillingSettings,
3881
4304
  ConnectedBillLifecycle,
3882
4305
  ConnectedBillStatus,
3883
4306
  DEFAULT_BILL_SUBMISSION_MODIFIERS,
@@ -3886,6 +4309,7 @@ export {
3886
4309
  MED_LEGAL_REPORT_TYPE_CODE,
3887
4310
  MindBillBillReview,
3888
4311
  MindBillBillTimeline,
4312
+ OrganizationOnboarding,
3889
4313
  PSYCH_QME_DEFAULT_DIAGNOSIS,
3890
4314
  applyBillSubmissionEvaluationDiagnoses,
3891
4315
  applyBillSubmissionEvaluationModifiers,
@@ -3895,6 +4319,8 @@ export {
3895
4319
  billLifecycleDisplayLabel,
3896
4320
  billLifecycleStage,
3897
4321
  buildBillReviewSaveInput,
4322
+ buildBillStatusAgingCsv,
4323
+ buildBillStatusAgingMatrix,
3898
4324
  buildBillingReportCsv,
3899
4325
  buildBillingReportRows,
3900
4326
  calculateBillSubmissionAllowedAmount,