@mindbill/react 0.34.0 → 0.36.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 useEffect8, useRef as useRef6 } from "react";
5
+ import { createElement, useEffect as useEffect9, useRef as useRef6 } from "react";
6
6
 
7
7
  // src/appearance.ts
8
8
  var mindBillThemePresets = {
@@ -2007,13 +2007,18 @@ async function prepareBillSubmissionDocuments({
2007
2007
  fetch: fetchOverride
2008
2008
  }) {
2009
2009
  const fetcher = fetchOverride ?? globalThis.fetch;
2010
- if (typeof fetcher !== "function") throw new Error("A Fetch API implementation is required.");
2011
2010
  const selected = selectedIds.map((id) => attachments.find((item) => item.id === id)).filter((item) => Boolean(item));
2012
2011
  const sourceDocuments = await Promise.all(selected.map(async (attachment) => {
2013
- if (!attachment.previewUrl) throw new Error(`${attachment.fileName} cannot be submitted because its document URL is missing.`);
2014
- const response = await fetcher(attachment.previewUrl, { credentials: "same-origin" });
2015
- if (!response.ok) throw new Error(`${attachment.fileName} could not be loaded for submission.`);
2016
- return pdfDocument(await response.blob(), {
2012
+ let blob;
2013
+ if (attachment.loadBlob) blob = await attachment.loadBlob();
2014
+ else {
2015
+ if (!attachment.previewUrl) throw new Error(`${attachment.fileName} cannot be submitted because its document URL is missing.`);
2016
+ if (typeof fetcher !== "function") throw new Error("A Fetch API implementation is required.");
2017
+ const response = await fetcher(attachment.previewUrl, { credentials: "same-origin" });
2018
+ if (!response.ok) throw new Error(`${attachment.fileName} could not be loaded for submission.`);
2019
+ blob = await response.blob();
2020
+ }
2021
+ return pdfDocument(blob, {
2017
2022
  externalId: attachment.id,
2018
2023
  filename: attachment.fileName,
2019
2024
  documentType: attachment.documentType,
@@ -2170,6 +2175,7 @@ function validateBillSubmission(bill) {
2170
2175
  }
2171
2176
  var css2 = `
2172
2177
  .mbsf{display:grid;gap:20px;color:var(--mb-text);font-family:var(--mb-font);font-size:15px}.mbsf *{box-sizing:border-box}
2178
+ .mbsf-attention{padding:14px 16px;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));color:var(--mb-text)}.mbsf [data-attention=true] .mbsf-input,.mbsf [data-attention=true] .mbsf-select,.mbsf [data-attention=true].mbsf-lines{border-color:var(--mb-danger);background:color-mix(in srgb,var(--mb-danger) 4%,var(--mb-input))}.mbsf [data-attention=true]>.mbsf-label{color:var(--mb-danger)}
2173
2179
  .mbsf-head,.mbsf-section-head,.mbsf-attach-row,.mbsf-actions{display:flex;align-items:center;justify-content:space-between;gap:16px}.mbsf-title{margin:0;font-size:24px}.mbsf-copy,.mbsf-help{color:var(--mb-muted);margin:5px 0 0}.mbsf-required{font-size:13px;color:var(--mb-muted);white-space:nowrap}.mbsf-star,.mbsf-error{color:var(--mb-danger)}
2174
2180
  .mbsf-card{min-width:0;margin:0;padding:24px;border:1px solid var(--mb-border);border-radius:var(--mb-radius);background:var(--mb-surface);box-shadow:var(--mb-shadow)}.mbsf-card[data-invalid=true]{border-color:var(--mb-danger)}.mbsf-legend{padding:0 10px;font-size:18px;font-weight:760}.mbsf-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 24px}.mbsf-subhead{grid-column:1/-1;margin:6px 0 -2px;padding-top:14px;border-top:1px solid var(--mb-border);font-size:15px;font-weight:780;letter-spacing:.01em}.mbsf-subhead:first-child{margin-top:0;padding-top:0;border-top:0}.mbsf-span{grid-column:1/-1}.mbsf-field{display:grid;align-content:start;gap:7px;min-width:0}.mbsf-label{font-weight:680}.mbsf-input,.mbsf-select{width:100%;min-height:46px;padding:10px 12px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);background:var(--mb-input);color:var(--mb-text);font:inherit}.mbsf-input:focus,.mbsf-select:focus{outline:3px solid color-mix(in srgb,var(--mb-accent) 22%,transparent);border-color:var(--mb-accent)}.mbsf-field[data-invalid=true] .mbsf-input,.mbsf-field[data-invalid=true] .mbsf-select,.mbsf-invalid-control .mbsf-input{border-color:var(--mb-danger);background:color-mix(in srgb,var(--mb-danger) 4%,var(--mb-input))}.mbsf-field[data-invalid=true] .mbsf-input:focus,.mbsf-field[data-invalid=true] .mbsf-select:focus{outline-color:color-mix(in srgb,var(--mb-danger) 24%,transparent)}
2175
2181
  .mbsf-combo{position:relative}.mbsf-menu{position:absolute;z-index:20;top:calc(100% + 5px);left:0;right:0;max-height:min(360px,46vh);overflow:auto;overscroll-behavior:contain;padding:7px;border:1px solid var(--mb-border);border-radius:12px;background:var(--mb-surface);box-shadow:0 14px 35px rgba(17,38,49,.16)}.mbsf-option{display:grid;width:100%;gap:2px;padding:10px;border:0;border-radius:8px;background:transparent;color:var(--mb-text);font:inherit;text-align:left;cursor:pointer}.mbsf-option:hover,.mbsf-option:focus{background:color-mix(in srgb,var(--mb-accent) 9%,var(--mb-surface))}.mbsf-option small{color:var(--mb-muted)}.mbsf-menu-status{padding:12px;text-align:center;color:var(--mb-muted);font-size:13px}
@@ -2346,6 +2352,8 @@ function BillSubmissionForm({
2346
2352
  submitLabel = "Submit bill",
2347
2353
  heading = "Bill information",
2348
2354
  description = "Review the bill details, add attachments, and submit.",
2355
+ attentionFields = [],
2356
+ attentionMessage,
2349
2357
  children
2350
2358
  }) {
2351
2359
  const [bill, setBill] = useState4(() => cloneInitialBill(initialBill));
@@ -2406,6 +2414,21 @@ function BillSubmissionForm({
2406
2414
  const next = validateBillSubmission(bill).fieldErrors;
2407
2415
  setErrors(missingAttachmentReportType ? { ...next, attachments: "Select a report type for every attachment." } : next);
2408
2416
  }, [bill, missingAttachmentReportType, validationActive]);
2417
+ useEffect4(() => {
2418
+ const root = formRef.current;
2419
+ if (!root) return;
2420
+ const nodes = Array.from(root.querySelectorAll("[data-field-path]"));
2421
+ nodes.forEach((node) => node.removeAttribute("data-attention"));
2422
+ for (const requested of attentionFields) {
2423
+ const normalized = requested.replace(/\[\]/g, "");
2424
+ for (const node of nodes) {
2425
+ const actual = node.dataset.fieldPath ?? "";
2426
+ if (actual === requested || actual === normalized || actual.startsWith(`${normalized}.`) || normalized.startsWith(`${actual}.`)) {
2427
+ node.dataset.attention = "true";
2428
+ }
2429
+ }
2430
+ }
2431
+ }, [attentionFields]);
2409
2432
  const addFiles = useCallback((fileList) => {
2410
2433
  const files = Array.from(fileList);
2411
2434
  if (!files.length) return;
@@ -2895,6 +2918,7 @@ function BillSubmissionForm({
2895
2918
  void submit();
2896
2919
  }, noValidate: true, children: [
2897
2920
  /* @__PURE__ */ jsx4("style", { children: css2 }),
2921
+ attentionMessage ? /* @__PURE__ */ jsx4("div", { className: "mbsf-attention", role: "status", children: attentionMessage }) : null,
2898
2922
  children ?? defaultLayout,
2899
2923
  routeDialog ? /* @__PURE__ */ jsx4(
2900
2924
  SendRouteDialog,
@@ -3319,19 +3343,509 @@ function BillStatusAgingMatrix({
3319
3343
  ] });
3320
3344
  }
3321
3345
 
3346
+ // src/bill-tasks-dashboard.tsx
3347
+ import {
3348
+ BILL_TASKS_AGING_BUCKETS
3349
+ } from "@mindbill/browser";
3350
+ import {
3351
+ BILL_TASKS_AGING_BUCKETS as BILL_TASKS_AGING_BUCKETS2,
3352
+ billTasksAgingBucketIndex,
3353
+ buildBillTasksDashboard
3354
+ } from "@mindbill/browser";
3355
+ import { Fragment as Fragment5, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
3356
+ var TONES = {
3357
+ violet: "#7c53c3",
3358
+ red: "#cf4437",
3359
+ blue: "#2f7fd1",
3360
+ green: "#2c9a5b",
3361
+ amber: "#d9931f",
3362
+ neutral: "#8195a1"
3363
+ };
3364
+ var BUCKET_PILL_BASES = ["#2c9a5b", "#1f9aa8", "#dcbb28", "#e08a2e", "#d75d8a"];
3365
+ var css5 = `
3366
+ .mbtk{color:var(--mb-text);font-family:var(--mb-font);font-size:14px}.mbtk *{box-sizing:border-box}.mbtk h2,.mbtk p{margin:0}
3367
+ .mbtk-heading{margin-bottom:14px}.mbtk-heading h2{font-size:24px}
3368
+ .mbtk-toolbar{margin-bottom:14px}
3369
+ .mbtk-section{margin-bottom:16px;border:1.5px solid var(--mbtk-tone,var(--mb-border));border-radius:var(--mb-radius);background:var(--mb-surface);box-shadow:var(--mb-shadow);overflow:hidden}
3370
+ .mbtk-section.is-grand{border-color:var(--mb-border)}
3371
+ .mbtk-grid{display:grid;grid-template-columns:var(--mbtk-cols);gap:0 10px;align-items:center;padding:0 16px}
3372
+ .mbtk-head{padding:12px 16px;border-bottom:1px solid color-mix(in srgb,var(--mbtk-tone,var(--mb-border)) 22%,var(--mb-border))}
3373
+ .mbtk-title{display:flex;align-items:center;gap:9px;min-width:0}
3374
+ .mbtk-dot{flex:0 0 auto;width:11px;height:11px;border-radius:50%;background:var(--mbtk-tone,var(--mb-muted))}
3375
+ .mbtk-title-text{min-width:0}
3376
+ .mbtk-title-text strong{display:block;font-size:15.5px;line-height:1.3}
3377
+ .mbtk-basis{display:block;color:var(--mb-muted);font-size:12px;line-height:1.35}
3378
+ .mbtk-pill{justify-self:stretch;padding:5px 6px;border-radius:999px;background:color-mix(in srgb,var(--mbtk-pill) 20%,var(--mb-surface));color:color-mix(in srgb,var(--mbtk-pill) 62%,var(--mb-text));font-size:11px;font-weight:750;line-height:1.25;text-align:center;white-space:nowrap}
3379
+ .mbtk-colhead{justify-self:stretch;color:var(--mb-muted);font-size:11px;font-weight:800;letter-spacing:.05em;text-transform:uppercase;text-align:center;white-space:nowrap}
3380
+ .mbtk-row{border-top:1px solid color-mix(in srgb,var(--mb-border) 60%,transparent);min-height:44px}
3381
+ .mbtk-row:first-of-type{border-top:0}
3382
+ .mbtk-rowlabel{color:var(--mb-muted);font-size:13px;line-height:1.35;padding:9px 0;overflow-wrap:anywhere}
3383
+ .mbtk-count{text-align:center;font-variant-numeric:tabular-nums}
3384
+ .mbtk-zero{color:var(--mb-muted)}
3385
+ .mbtk-link{border:0;background:none;padding:6px 8px;color:var(--mb-accent);font:inherit;font-weight:750;font-variant-numeric:tabular-nums;cursor:pointer;border-radius:6px}
3386
+ .mbtk-link:hover{text-decoration:underline;background:color-mix(in srgb,var(--mb-accent) 8%,transparent)}
3387
+ .mbtk-total{text-align:center}
3388
+ .mbtk-totals{background:var(--mb-soft);border-top:1px solid var(--mb-border);font-weight:760}
3389
+ .mbtk-totals .mbtk-rowlabel{color:var(--mb-text);font-weight:760}
3390
+ .mbtk-empty{padding:22px 16px;color:var(--mb-muted);text-align:center}
3391
+ .mbtk-grand .mbtk-rowlabel{color:var(--mb-text);font-size:14px;font-weight:800}
3392
+ .mbtk-grand{min-height:52px}
3393
+ .mbtk-footnote{margin-top:12px;color:var(--mb-muted);font-size:12.5px}
3394
+ @media(max-width:760px){.mbtk-pill,.mbtk-colhead,.mbtk-count{display:none}.mbtk-grid{grid-template-columns:minmax(0,1fr) auto}}
3395
+ `;
3396
+ function cellButton(key, count, className, label, onSelect) {
3397
+ if (count > 0 && onSelect) {
3398
+ return /* @__PURE__ */ jsx7("span", { className, children: /* @__PURE__ */ jsx7("button", { type: "button", className: "mbtk-link", "aria-label": label, onClick: onSelect, children: count }) }, key);
3399
+ }
3400
+ return /* @__PURE__ */ jsx7("span", { className: `${className}${count === 0 ? " mbtk-zero" : ""}`, children: count }, key);
3401
+ }
3402
+ function TaskRow({
3403
+ sectionId,
3404
+ row,
3405
+ buckets,
3406
+ onSelectCell
3407
+ }) {
3408
+ const allRefs = row.refs.flat();
3409
+ return /* @__PURE__ */ jsxs7("div", { className: "mbtk-grid mbtk-row", children: [
3410
+ /* @__PURE__ */ jsx7("span", { className: "mbtk-rowlabel", children: row.label }),
3411
+ buckets.map((bucket, index) => {
3412
+ const count = row.counts[index] ?? 0;
3413
+ return cellButton(
3414
+ bucket.id,
3415
+ count,
3416
+ "mbtk-count",
3417
+ `${row.label} \xB7 ${bucket.label}: ${count} tasks`,
3418
+ onSelectCell ? () => onSelectCell({ sectionId, rowId: row.id, bucketId: bucket.id, refs: row.refs[index] ?? [], count }) : null
3419
+ );
3420
+ }),
3421
+ cellButton(
3422
+ "task-total",
3423
+ row.total,
3424
+ "mbtk-total",
3425
+ `${row.label} \xB7 all ages: ${row.total} tasks`,
3426
+ onSelectCell ? () => onSelectCell({ sectionId, rowId: row.id, bucketId: null, refs: allRefs, count: row.total }) : null
3427
+ )
3428
+ ] });
3429
+ }
3430
+ function SectionCard({
3431
+ section,
3432
+ buckets,
3433
+ emptyLabel,
3434
+ onSelectCell
3435
+ }) {
3436
+ return /* @__PURE__ */ jsxs7(
3437
+ "section",
3438
+ {
3439
+ className: "mbtk-section",
3440
+ style: { "--mbtk-tone": TONES[section.tone] },
3441
+ "aria-label": section.label,
3442
+ children: [
3443
+ /* @__PURE__ */ jsxs7("div", { className: "mbtk-grid mbtk-head", children: [
3444
+ /* @__PURE__ */ jsxs7("span", { className: "mbtk-title", children: [
3445
+ /* @__PURE__ */ jsx7("i", { className: "mbtk-dot", "aria-hidden": "true" }),
3446
+ /* @__PURE__ */ jsxs7("span", { className: "mbtk-title-text", children: [
3447
+ /* @__PURE__ */ jsx7("strong", { children: section.label }),
3448
+ /* @__PURE__ */ jsxs7("span", { className: "mbtk-basis", children: [
3449
+ "by ",
3450
+ section.agingBasisLabel
3451
+ ] })
3452
+ ] })
3453
+ ] }),
3454
+ buckets.map((bucket, index) => /* @__PURE__ */ jsx7(
3455
+ "span",
3456
+ {
3457
+ className: "mbtk-pill",
3458
+ style: { "--mbtk-pill": BUCKET_PILL_BASES[index % BUCKET_PILL_BASES.length] },
3459
+ children: bucket.label
3460
+ },
3461
+ bucket.id
3462
+ )),
3463
+ /* @__PURE__ */ jsx7("span", { className: "mbtk-colhead", children: "Task Total" })
3464
+ ] }),
3465
+ section.empty ? /* @__PURE__ */ jsx7("p", { className: "mbtk-empty", children: emptyLabel }) : /* @__PURE__ */ jsxs7(Fragment5, { children: [
3466
+ section.rows.map((row) => /* @__PURE__ */ jsx7(TaskRow, { sectionId: section.id, row, buckets, onSelectCell }, row.id)),
3467
+ /* @__PURE__ */ jsxs7("div", { className: "mbtk-grid mbtk-row mbtk-totals", children: [
3468
+ /* @__PURE__ */ jsx7("span", { className: "mbtk-rowlabel", children: "Total" }),
3469
+ buckets.map((bucket, index) => /* @__PURE__ */ jsx7("span", { className: "mbtk-count", children: section.totals[index] ?? 0 }, bucket.id)),
3470
+ /* @__PURE__ */ jsx7("span", { className: "mbtk-total", children: section.total })
3471
+ ] })
3472
+ ] })
3473
+ ]
3474
+ }
3475
+ );
3476
+ }
3477
+ function BillTasksDashboard({
3478
+ data,
3479
+ buckets = BILL_TASKS_AGING_BUCKETS,
3480
+ heading,
3481
+ grandTotalLabel = "Bill Tasks Total",
3482
+ emptyLabel = "No Tasks",
3483
+ onSelectCell,
3484
+ toolbar,
3485
+ footnote,
3486
+ appearance,
3487
+ className = "",
3488
+ style
3489
+ }) {
3490
+ const columns = `minmax(150px,1.6fr) repeat(${buckets.length},minmax(84px,1fr)) minmax(84px,1fr)`;
3491
+ return /* @__PURE__ */ jsxs7(
3492
+ "div",
3493
+ {
3494
+ className: `mbtk ${className}`.trim(),
3495
+ style: { ...mindBillAppearanceStyle(appearance), "--mbtk-cols": columns, ...style },
3496
+ children: [
3497
+ /* @__PURE__ */ jsx7("style", { children: css5 }),
3498
+ heading ? /* @__PURE__ */ jsx7("div", { className: "mbtk-heading", children: typeof heading === "string" ? /* @__PURE__ */ jsx7("h2", { children: heading }) : heading }) : null,
3499
+ toolbar ? /* @__PURE__ */ jsx7("div", { className: "mbtk-toolbar", children: toolbar }) : null,
3500
+ data.sections.map((section) => /* @__PURE__ */ jsx7(
3501
+ SectionCard,
3502
+ {
3503
+ section,
3504
+ buckets,
3505
+ emptyLabel,
3506
+ onSelectCell
3507
+ },
3508
+ section.id
3509
+ )),
3510
+ /* @__PURE__ */ jsx7("section", { className: "mbtk-section is-grand", "aria-label": grandTotalLabel, children: /* @__PURE__ */ jsxs7("div", { className: "mbtk-grid mbtk-row mbtk-grand mbtk-totals", children: [
3511
+ /* @__PURE__ */ jsx7("span", { className: "mbtk-rowlabel", children: grandTotalLabel }),
3512
+ buckets.map((bucket, index) => /* @__PURE__ */ jsx7("span", { className: "mbtk-count", children: data.grandTotals[index] ?? 0 }, bucket.id)),
3513
+ /* @__PURE__ */ jsx7("span", { className: "mbtk-total", children: data.grandTotal })
3514
+ ] }) }),
3515
+ footnote ? /* @__PURE__ */ jsx7("p", { className: "mbtk-footnote", children: footnote }) : null
3516
+ ]
3517
+ }
3518
+ );
3519
+ }
3520
+
3521
+ // src/bill-submissions-ribbon.tsx
3522
+ import { Fragment as Fragment6, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
3523
+ function billSubmissionsRibbonDeliveryLabel(summary) {
3524
+ if (/electronically sent/i.test(summary)) return "e-Bill (837)";
3525
+ if (/faxed/i.test(summary)) return "Fax";
3526
+ if (/emailed/i.test(summary)) return "Email";
3527
+ if (/mailed/i.test(summary)) return "Mail";
3528
+ return "Sent";
3529
+ }
3530
+ function ribbonDate(iso) {
3531
+ const parsed = new Date(iso);
3532
+ if (Number.isNaN(parsed.getTime())) return iso;
3533
+ return new Intl.DateTimeFormat("en-US", { month: "2-digit", day: "2-digit", year: "numeric" }).format(parsed);
3534
+ }
3535
+ function billSubmissionsRibbonFromHistory(history) {
3536
+ return history.filter((entry) => entry.kind === "submission").map((entry) => ({
3537
+ id: entry.id,
3538
+ label: entry.action,
3539
+ meta: [
3540
+ { label: "Delivery", value: billSubmissionsRibbonDeliveryLabel(entry.summary) },
3541
+ { label: "Sent", value: ribbonDate(entry.date) }
3542
+ ]
3543
+ }));
3544
+ }
3545
+ var css6 = `
3546
+ .mbsr{display:flex;gap:10px;overflow-x:auto;padding-bottom:4px;color:var(--mb-text);font-family:var(--mb-font);font-size:13px}
3547
+ .mbsr *{box-sizing:border-box}
3548
+ .mbsr-chip{flex:0 0 auto;display:grid;gap:7px;min-width:180px;max-width:280px;padding:11px 13px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);background:var(--mb-surface);color:inherit;font:inherit;text-align:left;text-decoration:none;cursor:pointer}
3549
+ .mbsr-chip:hover{border-color:var(--mb-accent)}
3550
+ .mbsr-chip[data-active=true]{border-color:var(--mb-accent);background:color-mix(in srgb,var(--mb-accent) 7%,var(--mb-surface));box-shadow:0 0 0 1px var(--mb-accent) inset}
3551
+ .mbsr-top{display:flex;align-items:center;gap:8px;min-width:0}
3552
+ .mbsr-label{font-size:13.5px;font-weight:760;line-height:1.3;overflow-wrap:anywhere}
3553
+ .mbsr-badge{flex:0 0 auto;padding:2px 8px;border:1px solid color-mix(in srgb,var(--mb-warning) 55%,var(--mb-border));border-radius:999px;background:color-mix(in srgb,var(--mb-warning) 12%,var(--mb-surface));font-size:11px;font-weight:700;white-space:nowrap}
3554
+ .mbsr-meta{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,auto);gap:2px 14px;justify-content:start}
3555
+ .mbsr-meta>span{display:grid;gap:1px;min-width:0}
3556
+ .mbsr-meta i{color:var(--mb-muted);font-size:10.5px;font-style:normal;font-weight:800;letter-spacing:.05em;text-transform:uppercase;white-space:nowrap}
3557
+ .mbsr-meta b{font-size:12.5px;font-weight:700;white-space:nowrap}
3558
+ `;
3559
+ function BillSubmissionsRibbon({
3560
+ items,
3561
+ onSelect,
3562
+ appearance,
3563
+ className = "",
3564
+ style
3565
+ }) {
3566
+ return /* @__PURE__ */ jsxs8(
3567
+ "div",
3568
+ {
3569
+ className: `mbsr ${className}`.trim(),
3570
+ style: mindBillAppearanceStyle(appearance, style),
3571
+ role: "list",
3572
+ "aria-label": "Bill submissions",
3573
+ children: [
3574
+ /* @__PURE__ */ jsx8("style", { children: css6 }),
3575
+ items.map((item) => {
3576
+ const content = /* @__PURE__ */ jsxs8(Fragment6, { children: [
3577
+ /* @__PURE__ */ jsxs8("span", { className: "mbsr-top", children: [
3578
+ /* @__PURE__ */ jsx8("span", { className: "mbsr-label", children: item.label }),
3579
+ item.badge ? /* @__PURE__ */ jsx8("span", { className: "mbsr-badge", children: item.badge }) : null
3580
+ ] }),
3581
+ item.meta?.length ? /* @__PURE__ */ jsx8("span", { className: "mbsr-meta", children: item.meta.slice(0, 3).map((pair) => /* @__PURE__ */ jsxs8("span", { children: [
3582
+ /* @__PURE__ */ jsx8("i", { children: pair.label }),
3583
+ /* @__PURE__ */ jsx8("b", { children: pair.value })
3584
+ ] }, pair.label)) }) : null
3585
+ ] });
3586
+ return item.href ? /* @__PURE__ */ jsx8(
3587
+ "a",
3588
+ {
3589
+ className: "mbsr-chip",
3590
+ "data-active": Boolean(item.active),
3591
+ href: item.href,
3592
+ role: "listitem",
3593
+ onClick: () => onSelect?.(item),
3594
+ children: content
3595
+ },
3596
+ item.id
3597
+ ) : /* @__PURE__ */ jsx8(
3598
+ "button",
3599
+ {
3600
+ type: "button",
3601
+ className: "mbsr-chip",
3602
+ "data-active": Boolean(item.active),
3603
+ role: "listitem",
3604
+ onClick: () => onSelect?.(item),
3605
+ children: content
3606
+ },
3607
+ item.id
3608
+ );
3609
+ })
3610
+ ]
3611
+ }
3612
+ );
3613
+ }
3614
+
3615
+ // src/report-bill-status-dialog.tsx
3616
+ import { useEffect as useEffect5, useState as useState6 } from "react";
3617
+ import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
3618
+ var REPORT_BILL_STATUS_OPTIONS = [
3619
+ {
3620
+ id: "message_left",
3621
+ label: "Message Left Requesting Bill Payment Status",
3622
+ description: "Claims Administrator/Bill Review representative unavailable."
3623
+ },
3624
+ {
3625
+ id: "eor_pending",
3626
+ label: "Explanation of Review (EOR) Pending",
3627
+ description: "Claims Administrator/Bill Review reported the bill is still in process and an EOR has not been generated or sent."
3628
+ },
3629
+ {
3630
+ id: "eor_sent",
3631
+ label: "Explanation of Review (EOR) Sent",
3632
+ description: "Claims Administrator/Bill Review reported sending an EOR to the provider."
3633
+ },
3634
+ {
3635
+ id: "bill_not_on_file",
3636
+ label: "Bill Not On File",
3637
+ description: "Claims Administrator/Bill Review reported not receiving the bill."
3638
+ },
3639
+ {
3640
+ id: "forwarded",
3641
+ label: "Bill Forwarded to Different Payer / Network",
3642
+ description: "Claims Administrator/Bill Review reported forwarding the bill to a different payer."
3643
+ }
3644
+ ];
3645
+ var css7 = `
3646
+ .mbbs-overlay{position:fixed;inset:0;z-index:1000;display:grid;place-items:center;padding:20px;background:rgba(15,30,40,.45)}
3647
+ .mbbs{display:grid;gap:18px;width:min(860px,100%);max-height:min(90vh,960px);overflow:auto;overscroll-behavior:contain;padding:24px;border:1px solid var(--mb-border);border-radius:var(--mb-radius);background:var(--mb-surface);color:var(--mb-text);font-family:var(--mb-font);font-size:14px;box-shadow:0 24px 60px rgba(17,38,49,.28)}
3648
+ .mbbs *{box-sizing:border-box}
3649
+ .mbbs-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
3650
+ .mbbs-title{margin:0;font-size:20px;font-weight:760}
3651
+ .mbbs-close{border:0;background:transparent;color:var(--mb-muted);font-size:22px;line-height:1;cursor:pointer}
3652
+ .mbbs-section h4{margin:0 0 4px;font-size:15px}
3653
+ .mbbs-copy{margin:0 0 10px;color:var(--mb-muted);font-size:13px}
3654
+ .mbbs-contacts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
3655
+ .mbbs-contact{border:1px solid var(--mb-border);border-left:4px solid var(--mb-accent);border-radius:var(--mb-control-radius);background:color-mix(in srgb,var(--mb-accent) 3%,var(--mb-surface));padding:12px 14px}
3656
+ .mbbs-contact h5{margin:0 0 6px;color:var(--mb-muted);font-size:11px;font-weight:800;letter-spacing:.07em;text-transform:uppercase}
3657
+ .mbbs-contact dl{display:grid;gap:4px;margin:0}
3658
+ .mbbs-contact dl>div{display:grid;grid-template-columns:130px minmax(0,1fr);gap:10px}
3659
+ .mbbs-contact dt{color:var(--mb-muted);font-size:12.5px}
3660
+ .mbbs-contact dd{margin:0;font-weight:700;overflow-wrap:anywhere}
3661
+ .mbbs-receipt{border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);padding:10px}
3662
+ .mbbs-report{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:18px}
3663
+ .mbbs-options{display:grid;gap:8px;align-content:start}
3664
+ .mbbs-option{display:flex;align-items:flex-start;gap:10px;padding:10px 12px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);background:var(--mb-surface);cursor:pointer}
3665
+ .mbbs-option[data-selected=true]{border-color:var(--mb-accent);background:color-mix(in srgb,var(--mb-accent) 5%,var(--mb-surface))}
3666
+ .mbbs-option input{margin-top:3px;accent-color:var(--mb-accent)}
3667
+ .mbbs-option-label{display:block;font-weight:750;line-height:1.35}
3668
+ .mbbs-option-copy{display:block;margin-top:2px;color:var(--mb-muted);font-size:12.5px;line-height:1.4}
3669
+ .mbbs-fields{display:grid;gap:10px;align-content:start}
3670
+ .mbbs-field{display:grid;gap:5px;font-size:13px}
3671
+ .mbbs-label{font-weight:650}
3672
+ .mbbs-input,.mbbs-textarea{width:100%;padding:9px 11px;border:1px solid var(--mb-border);border-radius:calc(var(--mb-control-radius) - 2px);background:var(--mb-input);color:var(--mb-text);font:inherit;font-size:14px}
3673
+ .mbbs-textarea{resize:vertical;min-height:74px}
3674
+ .mbbs-input:focus,.mbbs-textarea:focus{outline:3px solid color-mix(in srgb,var(--mb-accent) 22%,transparent);border-color:var(--mb-accent)}
3675
+ .mbbs-alert{padding:10px 12px;border-radius:var(--mb-control-radius);background:color-mix(in srgb,var(--mb-danger) 10%,transparent);color:var(--mb-danger);font-size:13px}
3676
+ .mbbs-actions{display:flex;justify-content:flex-end;gap:10px}
3677
+ .mbbs-cancel{min-height:42px;padding:9px 16px;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}
3678
+ .mbbs-save{min-height:42px;min-width:130px;padding:9px 18px;border:0;border-radius:var(--mb-control-radius);background:var(--mb-accent);color:var(--mb-accent-contrast);font:inherit;font-weight:760;cursor:pointer}
3679
+ .mbbs-save:disabled,.mbbs-cancel:disabled{opacity:.6;cursor:not-allowed}
3680
+ @media(max-width:700px){.mbbs-contacts,.mbbs-report{grid-template-columns:1fr}}
3681
+ `;
3682
+ function ReportBillStatusDialog({
3683
+ title = "Report Bill Status",
3684
+ claimsAdmin,
3685
+ billReview,
3686
+ receipt,
3687
+ submitting = false,
3688
+ error = null,
3689
+ onCancel,
3690
+ onSave,
3691
+ appearance,
3692
+ className = "",
3693
+ style
3694
+ }) {
3695
+ const [status, setStatus] = useState6(null);
3696
+ const [company, setCompany] = useState6("");
3697
+ const [representativeName, setRepresentativeName] = useState6("");
3698
+ const [representativeRole, setRepresentativeRole] = useState6("");
3699
+ const [phone, setPhone] = useState6("");
3700
+ const [callReference, setCallReference] = useState6("");
3701
+ const [note, setNote] = useState6("");
3702
+ useEffect5(() => {
3703
+ const onKey = (event) => {
3704
+ if (event.key === "Escape" && !submitting) onCancel();
3705
+ };
3706
+ window.addEventListener("keydown", onKey);
3707
+ return () => window.removeEventListener("keydown", onKey);
3708
+ }, [onCancel, submitting]);
3709
+ const save = () => {
3710
+ if (!status) return;
3711
+ onSave({
3712
+ status,
3713
+ ...company.trim() ? { company: company.trim() } : {},
3714
+ ...representativeName.trim() ? { representativeName: representativeName.trim() } : {},
3715
+ ...representativeRole.trim() ? { representativeRole: representativeRole.trim() } : {},
3716
+ ...phone.trim() ? { phone: phone.trim() } : {},
3717
+ ...callReference.trim() ? { callReference: callReference.trim() } : {},
3718
+ ...note.trim() ? { note: note.trim() } : {}
3719
+ });
3720
+ };
3721
+ const field = (label, value, onChange) => /* @__PURE__ */ jsxs9("label", { className: "mbbs-field", children: [
3722
+ /* @__PURE__ */ jsx9("span", { className: "mbbs-label", children: label }),
3723
+ /* @__PURE__ */ jsx9("input", { className: "mbbs-input", value, disabled: submitting, onChange: (event) => onChange(event.target.value) })
3724
+ ] }, label);
3725
+ return /* @__PURE__ */ jsxs9(
3726
+ "div",
3727
+ {
3728
+ className: "mbbs-overlay",
3729
+ role: "presentation",
3730
+ onMouseDown: (event) => {
3731
+ if (event.target === event.currentTarget && !submitting) onCancel();
3732
+ },
3733
+ children: [
3734
+ /* @__PURE__ */ jsx9("style", { children: css7 }),
3735
+ /* @__PURE__ */ jsxs9(
3736
+ "div",
3737
+ {
3738
+ className: `mbbs ${className}`.trim(),
3739
+ style: mindBillAppearanceStyle(appearance, style),
3740
+ role: "dialog",
3741
+ "aria-modal": "true",
3742
+ "aria-label": typeof title === "string" ? title : "Report Bill Status",
3743
+ children: [
3744
+ /* @__PURE__ */ jsxs9("div", { className: "mbbs-head", children: [
3745
+ /* @__PURE__ */ jsx9("h3", { className: "mbbs-title", children: title }),
3746
+ /* @__PURE__ */ jsx9("button", { className: "mbbs-close", type: "button", "aria-label": "Close", disabled: submitting, onClick: onCancel, children: "\xD7" })
3747
+ ] }),
3748
+ claimsAdmin || billReview ? /* @__PURE__ */ jsxs9("div", { className: "mbbs-section", children: [
3749
+ /* @__PURE__ */ jsx9("h4", { children: "1. Call Claims Administrator or Bill Review" }),
3750
+ /* @__PURE__ */ jsx9("p", { className: "mbbs-copy", children: "Contact the payer to request the payment status of this bill." }),
3751
+ /* @__PURE__ */ jsxs9("div", { className: "mbbs-contacts", children: [
3752
+ claimsAdmin ? /* @__PURE__ */ jsxs9("div", { className: "mbbs-contact", children: [
3753
+ /* @__PURE__ */ jsx9("h5", { children: "Claims Admin" }),
3754
+ /* @__PURE__ */ jsxs9("dl", { children: [
3755
+ /* @__PURE__ */ jsxs9("div", { children: [
3756
+ /* @__PURE__ */ jsx9("dt", { children: "Name" }),
3757
+ /* @__PURE__ */ jsx9("dd", { children: claimsAdmin.name })
3758
+ ] }),
3759
+ claimsAdmin.hoursOfOperation ? /* @__PURE__ */ jsxs9("div", { children: [
3760
+ /* @__PURE__ */ jsx9("dt", { children: "Hours of Operation" }),
3761
+ /* @__PURE__ */ jsx9("dd", { children: claimsAdmin.hoursOfOperation })
3762
+ ] }) : null,
3763
+ (claimsAdmin.phones ?? []).map((entry) => /* @__PURE__ */ jsxs9("div", { children: [
3764
+ /* @__PURE__ */ jsx9("dt", { children: entry.label }),
3765
+ /* @__PURE__ */ jsx9("dd", { children: entry.value })
3766
+ ] }, `${entry.label}-${entry.value}`))
3767
+ ] })
3768
+ ] }) : null,
3769
+ billReview ? /* @__PURE__ */ jsxs9("div", { className: "mbbs-contact", children: [
3770
+ /* @__PURE__ */ jsx9("h5", { children: "Bill Review" }),
3771
+ /* @__PURE__ */ jsxs9("dl", { children: [
3772
+ /* @__PURE__ */ jsxs9("div", { children: [
3773
+ /* @__PURE__ */ jsx9("dt", { children: "Name" }),
3774
+ /* @__PURE__ */ jsx9("dd", { children: billReview.name })
3775
+ ] }),
3776
+ billReview.phone ? /* @__PURE__ */ jsxs9("div", { children: [
3777
+ /* @__PURE__ */ jsx9("dt", { children: "Phone" }),
3778
+ /* @__PURE__ */ jsx9("dd", { children: billReview.phone })
3779
+ ] }) : null
3780
+ ] })
3781
+ ] }) : null
3782
+ ] })
3783
+ ] }) : null,
3784
+ receipt ? /* @__PURE__ */ jsxs9("div", { className: "mbbs-section", children: [
3785
+ /* @__PURE__ */ jsx9("h4", { children: "2. Review Bill Submission Receipt" }),
3786
+ /* @__PURE__ */ jsx9("p", { className: "mbbs-copy", children: "Reference the submission receipt below when the payer asks how and when the bill was sent." }),
3787
+ /* @__PURE__ */ jsx9("div", { className: "mbbs-receipt", children: receipt })
3788
+ ] }) : null,
3789
+ /* @__PURE__ */ jsxs9("div", { className: "mbbs-section", children: [
3790
+ /* @__PURE__ */ jsx9("h4", { children: "3. Report Bill Payment Status" }),
3791
+ /* @__PURE__ */ jsx9("p", { className: "mbbs-copy", children: "Select the status reported by the payer, then record who provided it." }),
3792
+ /* @__PURE__ */ jsxs9("div", { className: "mbbs-report", children: [
3793
+ /* @__PURE__ */ jsx9("div", { className: "mbbs-options", role: "radiogroup", "aria-label": "Reported bill payment status", children: REPORT_BILL_STATUS_OPTIONS.map((option) => /* @__PURE__ */ jsxs9("label", { className: "mbbs-option", "data-selected": status === option.id, children: [
3794
+ /* @__PURE__ */ jsx9(
3795
+ "input",
3796
+ {
3797
+ type: "radio",
3798
+ name: "mbbs-status",
3799
+ value: option.id,
3800
+ checked: status === option.id,
3801
+ disabled: submitting,
3802
+ onChange: () => setStatus(option.id)
3803
+ }
3804
+ ),
3805
+ /* @__PURE__ */ jsxs9("span", { children: [
3806
+ /* @__PURE__ */ jsx9("span", { className: "mbbs-option-label", children: option.label }),
3807
+ /* @__PURE__ */ jsx9("span", { className: "mbbs-option-copy", children: option.description })
3808
+ ] })
3809
+ ] }, option.id)) }),
3810
+ /* @__PURE__ */ jsxs9("div", { className: "mbbs-fields", children: [
3811
+ field("Company", company, setCompany),
3812
+ field("Name", representativeName, setRepresentativeName),
3813
+ field("Role", representativeRole, setRepresentativeRole),
3814
+ field("Phone Number", phone, setPhone),
3815
+ field("Call Reference Number", callReference, setCallReference),
3816
+ /* @__PURE__ */ jsxs9("label", { className: "mbbs-field", children: [
3817
+ /* @__PURE__ */ jsx9("span", { className: "mbbs-label", children: "Message Note" }),
3818
+ /* @__PURE__ */ jsx9("textarea", { className: "mbbs-textarea", value: note, disabled: submitting, onChange: (event) => setNote(event.target.value) })
3819
+ ] })
3820
+ ] })
3821
+ ] })
3822
+ ] }),
3823
+ error ? /* @__PURE__ */ jsx9("div", { className: "mbbs-alert", role: "alert", children: error }) : null,
3824
+ /* @__PURE__ */ jsxs9("div", { className: "mbbs-actions", children: [
3825
+ /* @__PURE__ */ jsx9("button", { className: "mbbs-cancel", type: "button", disabled: submitting, onClick: onCancel, children: "Cancel" }),
3826
+ /* @__PURE__ */ jsx9("button", { className: "mbbs-save", type: "button", disabled: submitting || !status, onClick: save, children: submitting ? "Saving\u2026" : "Save" })
3827
+ ] })
3828
+ ]
3829
+ }
3830
+ )
3831
+ ]
3832
+ }
3833
+ );
3834
+ }
3835
+
3322
3836
  // src/organization-onboarding.tsx
3323
- import { useCallback as useCallback2, useEffect as useEffect5, useMemo as useMemo6, useRef as useRef3, useState as useState6 } from "react";
3837
+ import { useCallback as useCallback2, useEffect as useEffect6, useMemo as useMemo6, useRef as useRef3, useState as useState7 } from "react";
3324
3838
  import {
3325
3839
  createOrganizationClient
3326
3840
  } from "@mindbill/browser";
3327
- import { Fragment as Fragment5, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
3841
+ import { Fragment as Fragment7, jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
3328
3842
  var STEPS = [
3329
3843
  { id: "practice", label: "Practice & billing" },
3330
3844
  { id: "locations", label: "Locations" },
3331
3845
  { id: "w9", label: "W-9" },
3332
3846
  { id: "review", label: "Review" }
3333
3847
  ];
3334
- var css5 = `
3848
+ var css8 = `
3335
3849
  .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}
3336
3850
  .mbob-card{border:1px solid var(--mb-border);border-radius:var(--mb-radius);background:var(--mb-surface);box-shadow:var(--mb-shadow);padding:24px}
3337
3851
  .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}
@@ -3395,16 +3909,16 @@ function OrganizationOnboarding({
3395
3909
  }),
3396
3910
  [sessionEndpoint, getSession, apiBaseUrl]
3397
3911
  );
3398
- const [profile, setProfile] = useState6(null);
3399
- const [loadError, setLoadError] = useState6(null);
3400
- const [step, setStep] = useState6("practice");
3401
- const [identity, setIdentity] = useState6({ name: "", legalName: "", taxId: "", npi: "", phone: "", email: "" });
3402
- const [provider, setProvider] = useState6({ name: "", taxId: "", npi: "", billType: "Professional", phone: "", billingStreet: "", billingCity: "", billingState: "", billingZip: "" });
3403
- const [locations, setLocations] = useState6([blankLocation()]);
3404
- const [w9File, setW9File] = useState6(null);
3405
- const [saving, setSaving] = useState6(false);
3406
- const [error, setError] = useState6(null);
3407
- const [savedStep, setSavedStep] = useState6({});
3912
+ const [profile, setProfile] = useState7(null);
3913
+ const [loadError, setLoadError] = useState7(null);
3914
+ const [step, setStep] = useState7("practice");
3915
+ const [identity, setIdentity] = useState7({ name: "", legalName: "", taxId: "", npi: "", phone: "", email: "" });
3916
+ const [provider, setProvider] = useState7({ name: "", taxId: "", npi: "", billType: "Professional", phone: "", billingStreet: "", billingCity: "", billingState: "", billingZip: "" });
3917
+ const [locations, setLocations] = useState7([blankLocation()]);
3918
+ const [w9File, setW9File] = useState7(null);
3919
+ const [saving, setSaving] = useState7(false);
3920
+ const [error, setError] = useState7(null);
3921
+ const [savedStep, setSavedStep] = useState7({});
3408
3922
  const completedFired = useRef3(false);
3409
3923
  const adoptProfile = useCallback2((next) => {
3410
3924
  setProfile(next);
@@ -3423,7 +3937,7 @@ function OrganizationOnboarding({
3423
3937
  onCompleted?.(next);
3424
3938
  }
3425
3939
  }, [onCompleted]);
3426
- useEffect5(() => {
3940
+ useEffect6(() => {
3427
3941
  let alive = true;
3428
3942
  client.getOrganization().then((next) => {
3429
3943
  if (alive) {
@@ -3470,16 +3984,16 @@ function OrganizationOnboarding({
3470
3984
  if (!w9File) throw new Error("Choose the practice W-9 PDF first.");
3471
3985
  return client.saveW9({ filename: w9File.name, contentBase64: await fileToBase64(w9File) });
3472
3986
  }, "w9");
3473
- const field = (label, value, onChange, span = false, placeholder = "") => /* @__PURE__ */ jsxs7("label", { className: `mbob-field${span ? " mbob-span" : ""}`, children: [
3987
+ const field = (label, value, onChange, span = false, placeholder = "") => /* @__PURE__ */ jsxs10("label", { className: `mbob-field${span ? " mbob-span" : ""}`, children: [
3474
3988
  label,
3475
- /* @__PURE__ */ jsx7("input", { value, placeholder, onChange: (event) => onChange(event.target.value), disabled: saving })
3989
+ /* @__PURE__ */ jsx10("input", { value, placeholder, onChange: (event) => onChange(event.target.value), disabled: saving })
3476
3990
  ] });
3477
3991
  const setLocation = (index, patch) => setLocations((current) => current.map((item, itemIndex) => {
3478
3992
  if (itemIndex !== index) return patch.isPrimary ? { ...item, isPrimary: false } : item;
3479
3993
  return { ...item, ...patch };
3480
3994
  }));
3481
- const practiceSection = /* @__PURE__ */ jsxs7("div", { children: [
3482
- /* @__PURE__ */ jsxs7("div", { className: "mbob-grid", children: [
3995
+ const practiceSection = /* @__PURE__ */ jsxs10("div", { children: [
3996
+ /* @__PURE__ */ jsxs10("div", { className: "mbob-grid", children: [
3483
3997
  field("Practice name", identity.name, (name) => setIdentity((c) => ({ ...c, name }))),
3484
3998
  field("Legal name", identity.legalName, (legalName) => setIdentity((c) => ({ ...c, legalName }))),
3485
3999
  field("Tax ID (EIN)", identity.taxId, (taxId) => setIdentity((c) => ({ ...c, taxId })), false, "94-1234567"),
@@ -3487,8 +4001,8 @@ function OrganizationOnboarding({
3487
4001
  field("Phone", identity.phone, (phone) => setIdentity((c) => ({ ...c, phone }))),
3488
4002
  field("Email", identity.email, (email) => setIdentity((c) => ({ ...c, email })))
3489
4003
  ] }),
3490
- /* @__PURE__ */ jsx7("h3", { className: "mbob-subhead", children: "Billing provider (pay-to)" }),
3491
- /* @__PURE__ */ jsxs7("div", { className: "mbob-grid", children: [
4004
+ /* @__PURE__ */ jsx10("h3", { className: "mbob-subhead", children: "Billing provider (pay-to)" }),
4005
+ /* @__PURE__ */ jsxs10("div", { className: "mbob-grid", children: [
3492
4006
  field("Billing provider name", provider.name, (name) => setProvider((c) => ({ ...c, name }))),
3493
4007
  field("Billing tax ID", provider.taxId, (taxId) => setProvider((c) => ({ ...c, taxId }))),
3494
4008
  field("Billing NPI", provider.npi, (npi) => setProvider((c) => ({ ...c, npi }))),
@@ -3498,88 +4012,88 @@ function OrganizationOnboarding({
3498
4012
  field("State", provider.billingState ?? "", (billingState) => setProvider((c) => ({ ...c, billingState: billingState.toUpperCase().slice(0, 2) }))),
3499
4013
  field("ZIP", provider.billingZip ?? "", (billingZip) => setProvider((c) => ({ ...c, billingZip })))
3500
4014
  ] }),
3501
- /* @__PURE__ */ jsxs7("div", { className: "mbob-actions", children: [
3502
- /* @__PURE__ */ jsx7("span", { className: "mbob-status", children: savedStep["practice"] ? "Saved to MindBill." : "Saved once, used on every bill." }),
3503
- /* @__PURE__ */ jsx7("button", { className: "mbob-save", type: "button", disabled: saving, onClick: savePractice, children: saving ? "Saving\u2026" : "Save practice" })
4015
+ /* @__PURE__ */ jsxs10("div", { className: "mbob-actions", children: [
4016
+ /* @__PURE__ */ jsx10("span", { className: "mbob-status", children: savedStep["practice"] ? "Saved to MindBill." : "Saved once, used on every bill." }),
4017
+ /* @__PURE__ */ jsx10("button", { className: "mbob-save", type: "button", disabled: saving, onClick: savePractice, children: saving ? "Saving\u2026" : "Save practice" })
3504
4018
  ] })
3505
4019
  ] });
3506
- const locationsSection = /* @__PURE__ */ jsxs7("div", { children: [
3507
- locations.map((location, index) => /* @__PURE__ */ jsxs7("div", { className: "mbob-loc", children: [
4020
+ const locationsSection = /* @__PURE__ */ jsxs10("div", { children: [
4021
+ locations.map((location, index) => /* @__PURE__ */ jsxs10("div", { className: "mbob-loc", children: [
3508
4022
  field("Name", location.name, (name) => setLocation(index, { name })),
3509
4023
  field("Street", location.street, (street) => setLocation(index, { street })),
3510
4024
  field("City", location.city, (city) => setLocation(index, { city })),
3511
4025
  field("State", location.state, (state) => setLocation(index, { state: state.toUpperCase().slice(0, 2) })),
3512
4026
  field("ZIP", location.zip, (zip) => setLocation(index, { zip })),
3513
- /* @__PURE__ */ jsxs7("label", { className: "mbob-primary", children: [
3514
- /* @__PURE__ */ jsx7("input", { type: "radio", name: "mbob-primary", checked: location.isPrimary === true, onChange: () => setLocation(index, { isPrimary: true }) }),
4027
+ /* @__PURE__ */ jsxs10("label", { className: "mbob-primary", children: [
4028
+ /* @__PURE__ */ jsx10("input", { type: "radio", name: "mbob-primary", checked: location.isPrimary === true, onChange: () => setLocation(index, { isPrimary: true }) }),
3515
4029
  " Primary"
3516
4030
  ] }),
3517
- /* @__PURE__ */ jsx7("button", { className: "mbob-remove", type: "button", "aria-label": "Remove location", onClick: () => setLocations((current) => current.filter((_, itemIndex) => itemIndex !== index)), children: "\xD7" })
4031
+ /* @__PURE__ */ jsx10("button", { className: "mbob-remove", type: "button", "aria-label": "Remove location", onClick: () => setLocations((current) => current.filter((_, itemIndex) => itemIndex !== index)), children: "\xD7" })
3518
4032
  ] }, location.id ?? index)),
3519
- /* @__PURE__ */ jsx7("button", { className: "mbob-add", type: "button", onClick: () => setLocations((current) => [...current, blankLocation()]), children: "+ Add location" }),
3520
- /* @__PURE__ */ jsxs7("div", { className: "mbob-actions", children: [
3521
- /* @__PURE__ */ jsx7("span", { className: "mbob-status", children: savedStep["locations"] ? "Saved to MindBill." : "Where evaluations happen." }),
3522
- /* @__PURE__ */ jsx7("button", { className: "mbob-save", type: "button", disabled: saving, onClick: saveLocations, children: saving ? "Saving\u2026" : "Save locations" })
4033
+ /* @__PURE__ */ jsx10("button", { className: "mbob-add", type: "button", onClick: () => setLocations((current) => [...current, blankLocation()]), children: "+ Add location" }),
4034
+ /* @__PURE__ */ jsxs10("div", { className: "mbob-actions", children: [
4035
+ /* @__PURE__ */ jsx10("span", { className: "mbob-status", children: savedStep["locations"] ? "Saved to MindBill." : "Where evaluations happen." }),
4036
+ /* @__PURE__ */ jsx10("button", { className: "mbob-save", type: "button", disabled: saving, onClick: saveLocations, children: saving ? "Saving\u2026" : "Save locations" })
3523
4037
  ] })
3524
4038
  ] });
3525
- const w9Section = /* @__PURE__ */ jsxs7("div", { children: [
3526
- profile?.w9 ? /* @__PURE__ */ jsxs7("div", { className: "mbob-w9-current", children: [
3527
- /* @__PURE__ */ jsxs7("div", { children: [
3528
- /* @__PURE__ */ jsx7("strong", { children: profile.w9.filename }),
3529
- /* @__PURE__ */ jsxs7("span", { children: [
4039
+ const w9Section = /* @__PURE__ */ jsxs10("div", { children: [
4040
+ profile?.w9 ? /* @__PURE__ */ jsxs10("div", { className: "mbob-w9-current", children: [
4041
+ /* @__PURE__ */ jsxs10("div", { children: [
4042
+ /* @__PURE__ */ jsx10("strong", { children: profile.w9.filename }),
4043
+ /* @__PURE__ */ jsxs10("span", { children: [
3530
4044
  " \xB7 added ",
3531
4045
  profile.w9.addDate
3532
4046
  ] })
3533
4047
  ] }),
3534
- /* @__PURE__ */ jsx7("span", { children: "Rides on every bill automatically" })
4048
+ /* @__PURE__ */ jsx10("span", { children: "Rides on every bill automatically" })
3535
4049
  ] }) : null,
3536
- /* @__PURE__ */ jsxs7("label", { className: "mbob-drop", children: [
3537
- /* @__PURE__ */ jsx7("input", { type: "file", accept: "application/pdf,.pdf", onChange: (event) => setW9File(event.target.files?.[0] ?? null) }),
3538
- /* @__PURE__ */ jsx7("strong", { children: w9File ? w9File.name : profile?.w9 ? "Replace the W-9 PDF" : "Drop the practice W-9 PDF here, or click to choose" }),
3539
- /* @__PURE__ */ jsx7("span", { children: "The W-9 is auto-attached to every submission." })
4050
+ /* @__PURE__ */ jsxs10("label", { className: "mbob-drop", children: [
4051
+ /* @__PURE__ */ jsx10("input", { type: "file", accept: "application/pdf,.pdf", onChange: (event) => setW9File(event.target.files?.[0] ?? null) }),
4052
+ /* @__PURE__ */ jsx10("strong", { children: w9File ? w9File.name : profile?.w9 ? "Replace the W-9 PDF" : "Drop the practice W-9 PDF here, or click to choose" }),
4053
+ /* @__PURE__ */ jsx10("span", { children: "The W-9 is auto-attached to every submission." })
3540
4054
  ] }),
3541
- /* @__PURE__ */ jsxs7("div", { className: "mbob-actions", children: [
3542
- /* @__PURE__ */ jsx7("span", { className: "mbob-status", children: savedStep["w9"] ? "Saved to MindBill." : "" }),
3543
- /* @__PURE__ */ jsx7("button", { className: "mbob-save", type: "button", disabled: saving || !w9File, onClick: saveW9, children: saving ? "Uploading\u2026" : "Save W-9" })
4055
+ /* @__PURE__ */ jsxs10("div", { className: "mbob-actions", children: [
4056
+ /* @__PURE__ */ jsx10("span", { className: "mbob-status", children: savedStep["w9"] ? "Saved to MindBill." : "" }),
4057
+ /* @__PURE__ */ jsx10("button", { className: "mbob-save", type: "button", disabled: saving || !w9File, onClick: saveW9, children: saving ? "Uploading\u2026" : "Save W-9" })
3544
4058
  ] })
3545
4059
  ] });
3546
- const reviewSection = /* @__PURE__ */ jsxs7("div", { className: "mbob-check", children: [
3547
- (profile?.onboarding.checklist ?? []).map((item) => /* @__PURE__ */ jsxs7("div", { className: "mbob-check-item", "data-complete": item.complete, children: [
3548
- /* @__PURE__ */ jsx7("i", { children: item.complete ? "\u2713" : "\u2022" }),
3549
- /* @__PURE__ */ jsx7("span", { children: item.label })
4060
+ const reviewSection = /* @__PURE__ */ jsxs10("div", { className: "mbob-check", children: [
4061
+ (profile?.onboarding.checklist ?? []).map((item) => /* @__PURE__ */ jsxs10("div", { className: "mbob-check-item", "data-complete": item.complete, children: [
4062
+ /* @__PURE__ */ jsx10("i", { children: item.complete ? "\u2713" : "\u2022" }),
4063
+ /* @__PURE__ */ jsx10("span", { children: item.label })
3550
4064
  ] }, item.id)),
3551
- profile?.onboarding.complete ? /* @__PURE__ */ jsx7("p", { className: "mbob-done", children: "Billing setup is complete \u2014 bills submitted from your product carry this profile automatically." }) : /* @__PURE__ */ jsx7("p", { className: "mbob-status", children: "Items above complete themselves as each section is saved." })
4065
+ profile?.onboarding.complete ? /* @__PURE__ */ jsx10("p", { className: "mbob-done", children: "Billing setup is complete \u2014 bills submitted from your product carry this profile automatically." }) : /* @__PURE__ */ jsx10("p", { className: "mbob-status", children: "Items above complete themselves as each section is saved." })
3552
4066
  ] });
3553
4067
  const sections = { practice: practiceSection, locations: locationsSection, w9: w9Section, review: reviewSection };
3554
- return /* @__PURE__ */ jsxs7("div", { className: `mbob ${className}`.trim(), style: { ...mindBillAppearanceStyle(appearance), ...style }, children: [
3555
- /* @__PURE__ */ jsx7("style", { children: css5 }),
3556
- /* @__PURE__ */ jsxs7("div", { className: "mbob-card", children: [
3557
- /* @__PURE__ */ jsx7("div", { className: "mbob-head", children: /* @__PURE__ */ jsxs7("div", { children: [
3558
- /* @__PURE__ */ jsx7("h2", { children: heading }),
3559
- /* @__PURE__ */ jsx7("p", { className: "mbob-copy", children: description })
4068
+ return /* @__PURE__ */ jsxs10("div", { className: `mbob ${className}`.trim(), style: { ...mindBillAppearanceStyle(appearance), ...style }, children: [
4069
+ /* @__PURE__ */ jsx10("style", { children: css8 }),
4070
+ /* @__PURE__ */ jsxs10("div", { className: "mbob-card", children: [
4071
+ /* @__PURE__ */ jsx10("div", { className: "mbob-head", children: /* @__PURE__ */ jsxs10("div", { children: [
4072
+ /* @__PURE__ */ jsx10("h2", { children: heading }),
4073
+ /* @__PURE__ */ jsx10("p", { className: "mbob-copy", children: description })
3560
4074
  ] }) }),
3561
- loadError ? /* @__PURE__ */ jsx7("div", { className: "mbob-error", role: "alert", children: loadError }) : null,
3562
- variant === "onboarding" ? /* @__PURE__ */ jsxs7(Fragment5, { children: [
3563
- /* @__PURE__ */ jsx7("div", { className: "mbob-steps", children: STEPS.map((item) => /* @__PURE__ */ jsxs7("button", { className: "mbob-step", type: "button", "data-active": step === item.id, "data-done": Boolean(savedStep[item.id]), onClick: () => setStep(item.id), children: [
3564
- /* @__PURE__ */ jsx7("i", { children: savedStep[item.id] ? "\u2713" : "" }),
4075
+ loadError ? /* @__PURE__ */ jsx10("div", { className: "mbob-error", role: "alert", children: loadError }) : null,
4076
+ variant === "onboarding" ? /* @__PURE__ */ jsxs10(Fragment7, { children: [
4077
+ /* @__PURE__ */ jsx10("div", { className: "mbob-steps", children: STEPS.map((item) => /* @__PURE__ */ jsxs10("button", { className: "mbob-step", type: "button", "data-active": step === item.id, "data-done": Boolean(savedStep[item.id]), onClick: () => setStep(item.id), children: [
4078
+ /* @__PURE__ */ jsx10("i", { children: savedStep[item.id] ? "\u2713" : "" }),
3565
4079
  item.label
3566
4080
  ] }, item.id)) }),
3567
4081
  sections[step]
3568
- ] }) : /* @__PURE__ */ jsxs7(Fragment5, { children: [
4082
+ ] }) : /* @__PURE__ */ jsxs10(Fragment7, { children: [
3569
4083
  practiceSection,
3570
- /* @__PURE__ */ jsx7("h3", { className: "mbob-subhead", children: "Locations" }),
4084
+ /* @__PURE__ */ jsx10("h3", { className: "mbob-subhead", children: "Locations" }),
3571
4085
  locationsSection,
3572
- /* @__PURE__ */ jsx7("h3", { className: "mbob-subhead", children: "Practice W-9" }),
4086
+ /* @__PURE__ */ jsx10("h3", { className: "mbob-subhead", children: "Practice W-9" }),
3573
4087
  w9Section,
3574
- /* @__PURE__ */ jsx7("h3", { className: "mbob-subhead", children: "Checklist" }),
4088
+ /* @__PURE__ */ jsx10("h3", { className: "mbob-subhead", children: "Checklist" }),
3575
4089
  reviewSection
3576
4090
  ] }),
3577
- error ? /* @__PURE__ */ jsx7("div", { className: "mbob-error", role: "alert", children: error }) : null
4091
+ error ? /* @__PURE__ */ jsx10("div", { className: "mbob-error", role: "alert", children: error }) : null
3578
4092
  ] })
3579
4093
  ] });
3580
4094
  }
3581
4095
  function BillingSettings(props) {
3582
- return /* @__PURE__ */ jsx7(
4096
+ return /* @__PURE__ */ jsx10(
3583
4097
  OrganizationOnboarding,
3584
4098
  {
3585
4099
  heading: "Billing settings",
@@ -3593,16 +4107,16 @@ function BillingSettings(props) {
3593
4107
  // src/connected-bill-status.tsx
3594
4108
  import {
3595
4109
  useCallback as useCallback3,
3596
- useEffect as useEffect6,
4110
+ useEffect as useEffect7,
3597
4111
  useMemo as useMemo7,
3598
4112
  useRef as useRef4,
3599
- useState as useState7
4113
+ useState as useState8
3600
4114
  } from "react";
3601
4115
  import {
3602
4116
  DEFAULT_API_BASE_URL,
3603
4117
  DEFAULT_SESSION_ENDPOINT
3604
4118
  } from "@mindbill/browser";
3605
- import { Fragment as Fragment6, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
4119
+ import { Fragment as Fragment8, jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
3606
4120
  var DEFAULT_REFRESH_INTERVAL = 6e4;
3607
4121
  async function responseError(response, fallback) {
3608
4122
  const body = await response.json().catch(() => null);
@@ -3742,16 +4256,16 @@ function useBillStatus({
3742
4256
  apiBaseUrl,
3743
4257
  ...fetchOverride ? { fetch: fetchOverride } : {}
3744
4258
  }), [apiBaseUrl, billId, fetchOverride, getSession, sessionEndpoint]);
3745
- const [data, setData] = useState7(initialData);
3746
- const [error, setError] = useState7(null);
3747
- const [isLoading, setIsLoading] = useState7(enabled && !initialData);
3748
- const [isRefreshing, setIsRefreshing] = useState7(false);
4259
+ const [data, setData] = useState8(initialData);
4260
+ const [error, setError] = useState8(null);
4261
+ const [isLoading, setIsLoading] = useState8(enabled && !initialData);
4262
+ const [isRefreshing, setIsRefreshing] = useState8(false);
3749
4263
  const dataRef = useRef4(initialData);
3750
4264
  const initialDataRef = useRef4(initialData);
3751
4265
  initialDataRef.current = initialData;
3752
4266
  const activeControllerRef = useRef4(null);
3753
4267
  const requestSequence = useRef4(0);
3754
- useEffect6(() => {
4268
+ useEffect7(() => {
3755
4269
  const seed = initialDataRef.current;
3756
4270
  dataRef.current = seed;
3757
4271
  setData(seed);
@@ -3792,10 +4306,10 @@ function useBillStatus({
3792
4306
  }
3793
4307
  }
3794
4308
  }, [billId, client, enabled]);
3795
- useEffect6(() => {
4309
+ useEffect7(() => {
3796
4310
  if (enabled) void load();
3797
4311
  }, [enabled, load]);
3798
- useEffect6(() => {
4312
+ useEffect7(() => {
3799
4313
  if (!enabled || refreshInterval <= 0) return;
3800
4314
  const timer = window.setInterval(() => void load(), refreshInterval);
3801
4315
  const onFocus = () => void load();
@@ -3823,17 +4337,17 @@ function ConnectedBillStatus({
3823
4337
  }) {
3824
4338
  const status = useBillStatus(options);
3825
4339
  if (status.isLoading && !status.data) {
3826
- return /* @__PURE__ */ jsx8(Fragment6, { children: loadingFallback ?? /* @__PURE__ */ jsx8("div", { role: "status", children: "Loading bill status\u2026" }) });
4340
+ return /* @__PURE__ */ jsx11(Fragment8, { children: loadingFallback ?? /* @__PURE__ */ jsx11("div", { role: "status", children: "Loading bill status\u2026" }) });
3827
4341
  }
3828
4342
  if (status.error && !status.data) {
3829
- return /* @__PURE__ */ jsx8(Fragment6, { children: errorFallback?.(status.error, status.refresh) ?? /* @__PURE__ */ jsxs8("div", { role: "alert", children: [
4343
+ return /* @__PURE__ */ jsx11(Fragment8, { children: errorFallback?.(status.error, status.refresh) ?? /* @__PURE__ */ jsxs11("div", { role: "alert", children: [
3830
4344
  status.error.message,
3831
4345
  " ",
3832
- /* @__PURE__ */ jsx8("button", { type: "button", onClick: () => void status.refresh(), children: "Retry" })
4346
+ /* @__PURE__ */ jsx11("button", { type: "button", onClick: () => void status.refresh(), children: "Retry" })
3833
4347
  ] }) });
3834
4348
  }
3835
4349
  if (!status.data) return null;
3836
- return /* @__PURE__ */ jsx8(
4350
+ return /* @__PURE__ */ jsx11(
3837
4351
  BillStatusSummary,
3838
4352
  {
3839
4353
  status: status.data.state,
@@ -3852,8 +4366,8 @@ function ConnectedBillStatus({
3852
4366
  }
3853
4367
 
3854
4368
  // src/bill-lifecycle-surfaces.tsx
3855
- import { useState as useState8 } from "react";
3856
- import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
4369
+ import { useState as useState9 } from "react";
4370
+ import { jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
3857
4371
  function visibleBillLifecycleActions(actions, showUnavailable = false) {
3858
4372
  return actions.filter((action) => action.enabled || showUnavailable);
3859
4373
  }
@@ -3868,11 +4382,11 @@ function BillLifecycleActions({
3868
4382
  }) {
3869
4383
  const visible = visibleBillLifecycleActions(actions, showUnavailable);
3870
4384
  if (!visible.length) return null;
3871
- return /* @__PURE__ */ jsxs9("div", { className: classes("mb-lifecycle-actions", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill actions", children: [
3872
- /* @__PURE__ */ jsx9("style", { children: lifecycleSurfaceStyles }),
3873
- visible.map((action) => /* @__PURE__ */ jsxs9("div", { className: "mb-lifecycle-action", children: [
3874
- /* @__PURE__ */ jsx9("button", { type: "button", className: action.primary ? "mb-action-button is-primary" : "mb-action-button", disabled: disabled || !action.enabled, onClick: () => onAction(action), children: action.label }),
3875
- !action.enabled && action.reason ? /* @__PURE__ */ jsx9("span", { className: "mb-action-reason", children: action.reason }) : null
4385
+ return /* @__PURE__ */ jsxs12("div", { className: classes("mb-lifecycle-actions", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill actions", children: [
4386
+ /* @__PURE__ */ jsx12("style", { children: lifecycleSurfaceStyles }),
4387
+ visible.map((action) => /* @__PURE__ */ jsxs12("div", { className: "mb-lifecycle-action", children: [
4388
+ /* @__PURE__ */ jsx12("button", { type: "button", className: action.primary ? "mb-action-button is-primary" : "mb-action-button", disabled: disabled || !action.enabled, onClick: () => onAction(action), children: action.label }),
4389
+ !action.enabled && action.reason ? /* @__PURE__ */ jsx12("span", { className: "mb-action-reason", children: action.reason }) : null
3876
4390
  ] }, action.id))
3877
4391
  ] });
3878
4392
  }
@@ -3902,18 +4416,18 @@ function defaultFormatDate(createdAt) {
3902
4416
  return new Intl.DateTimeFormat(void 0, { dateStyle: "medium", timeStyle: "short" }).format(parsed);
3903
4417
  }
3904
4418
  function BillActivityTimeline({ events, emptyLabel = "No bill activity yet.", appearance, className, style, formatDate = defaultFormatDate }) {
3905
- return /* @__PURE__ */ jsxs9("section", { className: classes("mb-surface mb-activity", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill activity", children: [
3906
- /* @__PURE__ */ jsx9("style", { children: lifecycleSurfaceStyles }),
3907
- /* @__PURE__ */ jsx9("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs9("div", { children: [
3908
- /* @__PURE__ */ jsx9("strong", { children: "Bill history" }),
3909
- /* @__PURE__ */ jsx9("span", { children: "Submission, payer responses, follow-up, and payments." })
4419
+ return /* @__PURE__ */ jsxs12("section", { className: classes("mb-surface mb-activity", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill activity", children: [
4420
+ /* @__PURE__ */ jsx12("style", { children: lifecycleSurfaceStyles }),
4421
+ /* @__PURE__ */ jsx12("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs12("div", { children: [
4422
+ /* @__PURE__ */ jsx12("strong", { children: "Bill history" }),
4423
+ /* @__PURE__ */ jsx12("span", { children: "Submission, payer responses, follow-up, and payments." })
3910
4424
  ] }) }),
3911
- !events.length ? /* @__PURE__ */ jsx9("p", { className: "mb-activity-empty", children: emptyLabel }) : /* @__PURE__ */ jsx9("ol", { className: "mb-activity-list", children: events.map((event) => /* @__PURE__ */ jsxs9("li", { className: "mb-activity-item", children: [
3912
- /* @__PURE__ */ jsx9("span", { className: "mb-activity-marker", "aria-hidden": "true" }),
3913
- /* @__PURE__ */ jsxs9("div", { className: "mb-activity-content", children: [
3914
- /* @__PURE__ */ jsx9("strong", { children: event.title ?? billActivityEventLabel(event.type) }),
3915
- event.description ? /* @__PURE__ */ jsx9("p", { children: event.description }) : null,
3916
- /* @__PURE__ */ jsxs9("span", { children: [
4425
+ !events.length ? /* @__PURE__ */ jsx12("p", { className: "mb-activity-empty", children: emptyLabel }) : /* @__PURE__ */ jsx12("ol", { className: "mb-activity-list", children: events.map((event) => /* @__PURE__ */ jsxs12("li", { className: "mb-activity-item", children: [
4426
+ /* @__PURE__ */ jsx12("span", { className: "mb-activity-marker", "aria-hidden": "true" }),
4427
+ /* @__PURE__ */ jsxs12("div", { className: "mb-activity-content", children: [
4428
+ /* @__PURE__ */ jsx12("strong", { children: event.title ?? billActivityEventLabel(event.type) }),
4429
+ event.description ? /* @__PURE__ */ jsx12("p", { children: event.description }) : null,
4430
+ /* @__PURE__ */ jsxs12("span", { children: [
3917
4431
  formatDate(event.createdAt),
3918
4432
  event.actor ? ` \xB7 ${event.actor}` : ""
3919
4433
  ] })
@@ -3927,26 +4441,26 @@ function historyDate(iso) {
3927
4441
  return new Intl.DateTimeFormat("en-US", { month: "2-digit", day: "2-digit", year: "numeric" }).format(parsed);
3928
4442
  }
3929
4443
  function BillHistoryTable({ entries, emptyLabel = "No bill history yet.", appearance, className, style, formatDate = historyDate, documentHref }) {
3930
- const [expanded, setExpanded] = useState8({});
3931
- return /* @__PURE__ */ jsxs9("section", { className: classes("mb-surface mb-history", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill history", children: [
3932
- /* @__PURE__ */ jsx9("style", { children: lifecycleSurfaceStyles }),
3933
- /* @__PURE__ */ jsx9("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs9("div", { children: [
3934
- /* @__PURE__ */ jsx9("strong", { children: "Bill history" }),
3935
- /* @__PURE__ */ jsx9("span", { children: "Submissions, payer responses, follow-up, and payments." })
4444
+ const [expanded, setExpanded] = useState9({});
4445
+ return /* @__PURE__ */ jsxs12("section", { className: classes("mb-surface mb-history", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill history", children: [
4446
+ /* @__PURE__ */ jsx12("style", { children: lifecycleSurfaceStyles }),
4447
+ /* @__PURE__ */ jsx12("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs12("div", { children: [
4448
+ /* @__PURE__ */ jsx12("strong", { children: "Bill history" }),
4449
+ /* @__PURE__ */ jsx12("span", { children: "Submissions, payer responses, follow-up, and payments." })
3936
4450
  ] }) }),
3937
- !entries.length ? /* @__PURE__ */ jsx9("p", { className: "mb-activity-empty", children: emptyLabel }) : /* @__PURE__ */ jsxs9("div", { className: "mb-history-table", children: [
3938
- /* @__PURE__ */ jsxs9("div", { className: "mb-history-head", "aria-hidden": "true", children: [
3939
- /* @__PURE__ */ jsx9("span", { children: "Date" }),
3940
- /* @__PURE__ */ jsx9("span", { children: "Action" }),
3941
- /* @__PURE__ */ jsx9("span", { children: "User" }),
3942
- /* @__PURE__ */ jsx9("span", { children: "Details" })
4451
+ !entries.length ? /* @__PURE__ */ jsx12("p", { className: "mb-activity-empty", children: emptyLabel }) : /* @__PURE__ */ jsxs12("div", { className: "mb-history-table", children: [
4452
+ /* @__PURE__ */ jsxs12("div", { className: "mb-history-head", "aria-hidden": "true", children: [
4453
+ /* @__PURE__ */ jsx12("span", { children: "Date" }),
4454
+ /* @__PURE__ */ jsx12("span", { children: "Action" }),
4455
+ /* @__PURE__ */ jsx12("span", { children: "User" }),
4456
+ /* @__PURE__ */ jsx12("span", { children: "Details" })
3943
4457
  ] }),
3944
- /* @__PURE__ */ jsx9("ul", { className: "mb-history-rows", children: entries.map((entry) => {
4458
+ /* @__PURE__ */ jsx12("ul", { className: "mb-history-rows", children: entries.map((entry) => {
3945
4459
  const expandable = Boolean(entry.details);
3946
4460
  const isOpen = expandable && Boolean(expanded[entry.id]);
3947
4461
  const details = entry.details;
3948
- return /* @__PURE__ */ jsxs9("li", { className: `mb-history-row is-${entry.tone}`, children: [
3949
- /* @__PURE__ */ jsxs9(
4462
+ return /* @__PURE__ */ jsxs12("li", { className: `mb-history-row is-${entry.tone}`, children: [
4463
+ /* @__PURE__ */ jsxs12(
3950
4464
  "button",
3951
4465
  {
3952
4466
  type: "button",
@@ -3955,40 +4469,40 @@ function BillHistoryTable({ entries, emptyLabel = "No bill history yet.", appear
3955
4469
  "aria-expanded": expandable ? isOpen : void 0,
3956
4470
  onClick: expandable ? () => setExpanded((current) => ({ ...current, [entry.id]: !current[entry.id] })) : void 0,
3957
4471
  children: [
3958
- /* @__PURE__ */ jsx9("span", { className: "mb-history-date", children: formatDate(entry.date) }),
3959
- /* @__PURE__ */ jsx9("span", { className: "mb-history-action", children: entry.action }),
3960
- /* @__PURE__ */ jsx9("span", { className: "mb-history-actor", children: entry.actor ?? "\u2014" }),
3961
- /* @__PURE__ */ jsxs9("span", { className: "mb-history-summary", children: [
3962
- expandable ? /* @__PURE__ */ jsx9("i", { className: `mb-history-caret${isOpen ? " is-open" : ""}`, "aria-hidden": "true" }) : null,
4472
+ /* @__PURE__ */ jsx12("span", { className: "mb-history-date", children: formatDate(entry.date) }),
4473
+ /* @__PURE__ */ jsx12("span", { className: "mb-history-action", children: entry.action }),
4474
+ /* @__PURE__ */ jsx12("span", { className: "mb-history-actor", children: entry.actor ?? "\u2014" }),
4475
+ /* @__PURE__ */ jsxs12("span", { className: "mb-history-summary", children: [
4476
+ expandable ? /* @__PURE__ */ jsx12("i", { className: `mb-history-caret${isOpen ? " is-open" : ""}`, "aria-hidden": "true" }) : null,
3963
4477
  entry.summary
3964
4478
  ] })
3965
4479
  ]
3966
4480
  }
3967
4481
  ),
3968
- isOpen && details ? /* @__PURE__ */ jsxs9("div", { className: "mb-history-details", children: [
3969
- details.rows?.length ? /* @__PURE__ */ jsx9("dl", { className: "mb-history-kv", children: details.rows.map((row) => /* @__PURE__ */ jsxs9("div", { children: [
3970
- /* @__PURE__ */ jsx9("dt", { children: row.label }),
3971
- /* @__PURE__ */ jsx9("dd", { children: row.value })
4482
+ isOpen && details ? /* @__PURE__ */ jsxs12("div", { className: "mb-history-details", children: [
4483
+ details.rows?.length ? /* @__PURE__ */ jsx12("dl", { className: "mb-history-kv", children: details.rows.map((row) => /* @__PURE__ */ jsxs12("div", { children: [
4484
+ /* @__PURE__ */ jsx12("dt", { children: row.label }),
4485
+ /* @__PURE__ */ jsx12("dd", { children: row.value })
3972
4486
  ] }, `${row.label}-${row.value}`)) }) : null,
3973
- details.documents?.length ? /* @__PURE__ */ jsx9("div", { className: "mb-history-kv", children: /* @__PURE__ */ jsxs9("div", { children: [
3974
- /* @__PURE__ */ jsx9("dt", { children: "Documents" }),
3975
- /* @__PURE__ */ jsx9("dd", { children: details.documents.map((doc) => {
4487
+ details.documents?.length ? /* @__PURE__ */ jsx12("div", { className: "mb-history-kv", children: /* @__PURE__ */ jsxs12("div", { children: [
4488
+ /* @__PURE__ */ jsx12("dt", { children: "Documents" }),
4489
+ /* @__PURE__ */ jsx12("dd", { children: details.documents.map((doc) => {
3976
4490
  const href = documentHref?.(doc) ?? null;
3977
- return href ? /* @__PURE__ */ jsx9("a", { className: "mb-history-doc", href, target: "_blank", rel: "noreferrer", children: doc.filename }, doc.id) : /* @__PURE__ */ jsx9("span", { className: "mb-history-doc", children: doc.filename }, doc.id);
4491
+ return href ? /* @__PURE__ */ jsx12("a", { className: "mb-history-doc", href, target: "_blank", rel: "noreferrer", children: doc.filename }, doc.id) : /* @__PURE__ */ jsx12("span", { className: "mb-history-doc", children: doc.filename }, doc.id);
3978
4492
  }) })
3979
4493
  ] }) }) : null,
3980
- details.codes?.length ? /* @__PURE__ */ jsx9("dl", { className: "mb-history-codes", children: details.codes.map((code) => /* @__PURE__ */ jsxs9("div", { children: [
3981
- /* @__PURE__ */ jsx9("dt", { children: code.code }),
3982
- /* @__PURE__ */ jsx9("dd", { children: code.text })
4494
+ details.codes?.length ? /* @__PURE__ */ jsx12("dl", { className: "mb-history-codes", children: details.codes.map((code) => /* @__PURE__ */ jsxs12("div", { children: [
4495
+ /* @__PURE__ */ jsx12("dt", { children: code.code }),
4496
+ /* @__PURE__ */ jsx12("dd", { children: code.text })
3983
4497
  ] }, code.code)) }) : null,
3984
- details.complianceDueDates?.length ? /* @__PURE__ */ jsxs9("div", { className: "mb-history-due", children: [
3985
- /* @__PURE__ */ jsx9("em", { children: "Compliance Due Dates" }),
3986
- /* @__PURE__ */ jsx9("dl", { children: details.complianceDueDates.map((due) => /* @__PURE__ */ jsxs9("div", { children: [
3987
- /* @__PURE__ */ jsx9("dt", { children: formatDate(due.date) }),
3988
- /* @__PURE__ */ jsx9("dd", { children: due.text })
4498
+ details.complianceDueDates?.length ? /* @__PURE__ */ jsxs12("div", { className: "mb-history-due", children: [
4499
+ /* @__PURE__ */ jsx12("em", { children: "Compliance Due Dates" }),
4500
+ /* @__PURE__ */ jsx12("dl", { children: details.complianceDueDates.map((due) => /* @__PURE__ */ jsxs12("div", { children: [
4501
+ /* @__PURE__ */ jsx12("dt", { children: formatDate(due.date) }),
4502
+ /* @__PURE__ */ jsx12("dd", { children: due.text })
3989
4503
  ] }, `${due.date}-${due.text}`)) })
3990
4504
  ] }) : null,
3991
- details.text ? /* @__PURE__ */ jsx9("p", { className: "mb-history-text", children: details.text }) : null
4505
+ details.text ? /* @__PURE__ */ jsx12("p", { className: "mb-history-text", children: details.text }) : null
3992
4506
  ] }) : null
3993
4507
  ] }, entry.id);
3994
4508
  }) })
@@ -4036,15 +4550,15 @@ function billLifecycleDisplayLabel(state, nativeStatus) {
4036
4550
  function BillLifecycleProgress({ state, nativeStatus, submittedAt, agingDays, appearance, className, style }) {
4037
4551
  const rejected = state.toLowerCase() === "rejected";
4038
4552
  const steps = billLifecycleProgressSteps(state);
4039
- return /* @__PURE__ */ jsxs9("section", { className: classes(`mb-surface mb-progress${rejected ? " is-rejected" : ""}`, className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill lifecycle", children: [
4040
- /* @__PURE__ */ jsx9("style", { children: lifecycleSurfaceStyles }),
4041
- /* @__PURE__ */ jsx9("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs9("div", { children: [
4042
- /* @__PURE__ */ jsx9("strong", { children: billLifecycleDisplayLabel(state, nativeStatus) }),
4043
- /* @__PURE__ */ jsx9("span", { children: rejected ? "The payer rejected this submission." : `${submittedAt ? `Submitted ${defaultFormatDate(submittedAt)}` : "Submitted"}${typeof agingDays === "number" ? ` \xB7 ${agingDays} days old` : ""}` })
4553
+ return /* @__PURE__ */ jsxs12("section", { className: classes(`mb-surface mb-progress${rejected ? " is-rejected" : ""}`, className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill lifecycle", children: [
4554
+ /* @__PURE__ */ jsx12("style", { children: lifecycleSurfaceStyles }),
4555
+ /* @__PURE__ */ jsx12("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs12("div", { children: [
4556
+ /* @__PURE__ */ jsx12("strong", { children: billLifecycleDisplayLabel(state, nativeStatus) }),
4557
+ /* @__PURE__ */ jsx12("span", { children: rejected ? "The payer rejected this submission." : `${submittedAt ? `Submitted ${defaultFormatDate(submittedAt)}` : "Submitted"}${typeof agingDays === "number" ? ` \xB7 ${agingDays} days old` : ""}` })
4044
4558
  ] }) }),
4045
- /* @__PURE__ */ jsx9("ol", { className: "mb-progress-list", style: { gridTemplateColumns: `repeat(${steps.length}, minmax(0, 1fr))` }, children: steps.map((step, index) => /* @__PURE__ */ jsxs9("li", { className: `is-${step.status}`, "aria-current": step.status === "current" ? "step" : void 0, children: [
4046
- /* @__PURE__ */ jsx9("span", { "aria-hidden": "true", children: step.status === "complete" ? "\u2713" : rejected && step.status === "current" ? "!" : index + 1 }),
4047
- /* @__PURE__ */ jsx9("b", { children: step.label })
4559
+ /* @__PURE__ */ jsx12("ol", { className: "mb-progress-list", style: { gridTemplateColumns: `repeat(${steps.length}, minmax(0, 1fr))` }, children: steps.map((step, index) => /* @__PURE__ */ jsxs12("li", { className: `is-${step.status}`, "aria-current": step.status === "current" ? "step" : void 0, children: [
4560
+ /* @__PURE__ */ jsx12("span", { "aria-hidden": "true", children: step.status === "complete" ? "\u2713" : rejected && step.status === "current" ? "!" : index + 1 }),
4561
+ /* @__PURE__ */ jsx12("b", { children: step.label })
4048
4562
  ] }, step.id)) })
4049
4563
  ] });
4050
4564
  }
@@ -4058,48 +4572,48 @@ function billRejectionIssueSummary(rejection, count) {
4058
4572
  function BillRejectionNotice({ rejection, title = "Rejected \u2014 action required", submittedAt, appearance, className, style, formatDate = defaultFormatDate }) {
4059
4573
  const issues = rejection.issues?.length ? rejection.issues : [{ code: rejection.code, description: rejection.reason }];
4060
4574
  const hasCodes = issues.some((issue) => Boolean(issue.code));
4061
- return /* @__PURE__ */ jsxs9("section", { className: classes("mb-surface mb-rejection-notice", className), style: mindBillAppearanceStyle(appearance, style), role: "alert", "aria-label": "Bill rejection reasons", children: [
4062
- /* @__PURE__ */ jsx9("style", { children: lifecycleSurfaceStyles }),
4063
- /* @__PURE__ */ jsxs9("div", { className: "mb-rejection-overview", children: [
4064
- /* @__PURE__ */ jsxs9("header", { className: "mb-rejection-heading", children: [
4065
- /* @__PURE__ */ jsx9("span", { className: "mb-rejection-icon", "aria-hidden": "true", children: "!" }),
4066
- /* @__PURE__ */ jsxs9("div", { children: [
4067
- /* @__PURE__ */ jsx9("strong", { children: title }),
4068
- /* @__PURE__ */ jsxs9("span", { children: [
4575
+ return /* @__PURE__ */ jsxs12("section", { className: classes("mb-surface mb-rejection-notice", className), style: mindBillAppearanceStyle(appearance, style), role: "alert", "aria-label": "Bill rejection reasons", children: [
4576
+ /* @__PURE__ */ jsx12("style", { children: lifecycleSurfaceStyles }),
4577
+ /* @__PURE__ */ jsxs12("div", { className: "mb-rejection-overview", children: [
4578
+ /* @__PURE__ */ jsxs12("header", { className: "mb-rejection-heading", children: [
4579
+ /* @__PURE__ */ jsx12("span", { className: "mb-rejection-icon", "aria-hidden": "true", children: "!" }),
4580
+ /* @__PURE__ */ jsxs12("div", { children: [
4581
+ /* @__PURE__ */ jsx12("strong", { children: title }),
4582
+ /* @__PURE__ */ jsxs12("span", { children: [
4069
4583
  "Fix the ",
4070
4584
  issues.length === 1 ? "issue" : "issues",
4071
4585
  " below, then resubmit."
4072
4586
  ] })
4073
4587
  ] })
4074
4588
  ] }),
4075
- /* @__PURE__ */ jsxs9("ol", { className: "mb-rejection-progress", "aria-label": "Submission status", children: [
4076
- /* @__PURE__ */ jsxs9("li", { className: "is-complete", children: [
4077
- /* @__PURE__ */ jsx9("span", { "aria-hidden": "true", children: "\u2713" }),
4078
- /* @__PURE__ */ jsx9("b", { children: "Sent" }),
4079
- submittedAt ? /* @__PURE__ */ jsx9("small", { children: formatDate(submittedAt) }) : null
4589
+ /* @__PURE__ */ jsxs12("ol", { className: "mb-rejection-progress", "aria-label": "Submission status", children: [
4590
+ /* @__PURE__ */ jsxs12("li", { className: "is-complete", children: [
4591
+ /* @__PURE__ */ jsx12("span", { "aria-hidden": "true", children: "\u2713" }),
4592
+ /* @__PURE__ */ jsx12("b", { children: "Sent" }),
4593
+ submittedAt ? /* @__PURE__ */ jsx12("small", { children: formatDate(submittedAt) }) : null
4080
4594
  ] }),
4081
- /* @__PURE__ */ jsxs9("li", { className: "is-rejected", "aria-current": "step", children: [
4082
- /* @__PURE__ */ jsx9("span", { "aria-hidden": "true", children: "!" }),
4083
- /* @__PURE__ */ jsx9("b", { children: "Rejected" }),
4084
- rejection.receivedAt ? /* @__PURE__ */ jsx9("small", { children: formatDate(rejection.receivedAt) }) : null
4595
+ /* @__PURE__ */ jsxs12("li", { className: "is-rejected", "aria-current": "step", children: [
4596
+ /* @__PURE__ */ jsx12("span", { "aria-hidden": "true", children: "!" }),
4597
+ /* @__PURE__ */ jsx12("b", { children: "Rejected" }),
4598
+ rejection.receivedAt ? /* @__PURE__ */ jsx12("small", { children: formatDate(rejection.receivedAt) }) : null
4085
4599
  ] })
4086
4600
  ] })
4087
4601
  ] }),
4088
- /* @__PURE__ */ jsxs9("div", { className: "mb-rejection-issues", "aria-label": "Rejection reasons", children: [
4089
- /* @__PURE__ */ jsxs9("div", { className: "mb-rejection-issues-heading", children: [
4090
- /* @__PURE__ */ jsxs9("strong", { children: [
4091
- /* @__PURE__ */ jsx9("span", { "aria-hidden": "true", children: "\u25B3" }),
4602
+ /* @__PURE__ */ jsxs12("div", { className: "mb-rejection-issues", "aria-label": "Rejection reasons", children: [
4603
+ /* @__PURE__ */ jsxs12("div", { className: "mb-rejection-issues-heading", children: [
4604
+ /* @__PURE__ */ jsxs12("strong", { children: [
4605
+ /* @__PURE__ */ jsx12("span", { "aria-hidden": "true", children: "\u25B3" }),
4092
4606
  " Rejection reasons"
4093
4607
  ] }),
4094
- /* @__PURE__ */ jsx9("span", { children: billRejectionIssueSummary(rejection, issues.length) })
4608
+ /* @__PURE__ */ jsx12("span", { children: billRejectionIssueSummary(rejection, issues.length) })
4095
4609
  ] }),
4096
- /* @__PURE__ */ jsx9("ol", { "aria-label": `${issues.length} rejection ${issues.length === 1 ? "reason" : "reasons"}`, children: issues.map((issue, index) => /* @__PURE__ */ jsxs9("li", { children: [
4097
- /* @__PURE__ */ jsx9("span", { className: "mb-rejection-bullet", "aria-hidden": "true" }),
4098
- /* @__PURE__ */ jsx9("p", { children: issue.description }),
4099
- issue.code ? /* @__PURE__ */ jsx9("span", { className: "mb-rejection-code", children: issue.code }) : null
4610
+ /* @__PURE__ */ jsx12("ol", { "aria-label": `${issues.length} rejection ${issues.length === 1 ? "reason" : "reasons"}`, children: issues.map((issue, index) => /* @__PURE__ */ jsxs12("li", { children: [
4611
+ /* @__PURE__ */ jsx12("span", { className: "mb-rejection-bullet", "aria-hidden": "true" }),
4612
+ /* @__PURE__ */ jsx12("p", { children: issue.description }),
4613
+ issue.code ? /* @__PURE__ */ jsx12("span", { className: "mb-rejection-code", children: issue.code }) : null
4100
4614
  ] }, `${issue.code ?? "issue"}-${index}`)) }),
4101
- hasCodes ? /* @__PURE__ */ jsxs9("p", { className: "mb-rejection-code-note", children: [
4102
- /* @__PURE__ */ jsx9("span", { "aria-hidden": "true", children: "i" }),
4615
+ hasCodes ? /* @__PURE__ */ jsxs12("p", { className: "mb-rejection-code-note", children: [
4616
+ /* @__PURE__ */ jsx12("span", { "aria-hidden": "true", children: "i" }),
4103
4617
  " Technical error codes are included for support and auditability."
4104
4618
  ] }) : null
4105
4619
  ] })
@@ -4114,18 +4628,18 @@ function BillSnapshotSummary({ bill, patient, injury, delivery, appearance, clas
4114
4628
  ["Charged", currency(bill.totalCharge)],
4115
4629
  ["Balance", currency(bill.balanceDue)]
4116
4630
  ];
4117
- return /* @__PURE__ */ jsxs9("section", { className: classes("mb-surface mb-snapshot", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill snapshot", children: [
4118
- /* @__PURE__ */ jsx9("style", { children: lifecycleSurfaceStyles }),
4119
- /* @__PURE__ */ jsx9("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs9("div", { children: [
4120
- /* @__PURE__ */ jsx9("strong", { children: "Bill snapshot" }),
4121
- /* @__PURE__ */ jsxs9("span", { children: [
4631
+ return /* @__PURE__ */ jsxs12("section", { className: classes("mb-surface mb-snapshot", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill snapshot", children: [
4632
+ /* @__PURE__ */ jsx12("style", { children: lifecycleSurfaceStyles }),
4633
+ /* @__PURE__ */ jsx12("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs12("div", { children: [
4634
+ /* @__PURE__ */ jsx12("strong", { children: "Bill snapshot" }),
4635
+ /* @__PURE__ */ jsxs12("span", { children: [
4122
4636
  "Bill #",
4123
4637
  bill.billNumber
4124
4638
  ] })
4125
4639
  ] }) }),
4126
- /* @__PURE__ */ jsx9("dl", { children: values.map(([label, value]) => /* @__PURE__ */ jsxs9("div", { children: [
4127
- /* @__PURE__ */ jsx9("dt", { children: label }),
4128
- /* @__PURE__ */ jsx9("dd", { children: value })
4640
+ /* @__PURE__ */ jsx12("dl", { children: values.map(([label, value]) => /* @__PURE__ */ jsxs12("div", { children: [
4641
+ /* @__PURE__ */ jsx12("dt", { children: label }),
4642
+ /* @__PURE__ */ jsx12("dd", { children: value })
4129
4643
  ] }, label)) })
4130
4644
  ] });
4131
4645
  }
@@ -4140,140 +4654,140 @@ function BillExplanationOfReview({
4140
4654
  style
4141
4655
  }) {
4142
4656
  const rows = payments.length ? payments : [null];
4143
- return /* @__PURE__ */ jsxs9("section", { className: classes("mb-surface mb-eor-review", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Explanation of Review and payments", children: [
4144
- /* @__PURE__ */ jsx9("style", { children: lifecycleSurfaceStyles }),
4145
- /* @__PURE__ */ jsx9("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs9("div", { children: [
4146
- /* @__PURE__ */ jsx9("strong", { children: "Explanation of Review" }),
4147
- /* @__PURE__ */ jsx9("span", { children: "Payer response and payment reconciliation." })
4657
+ return /* @__PURE__ */ jsxs12("section", { className: classes("mb-surface mb-eor-review", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Explanation of Review and payments", children: [
4658
+ /* @__PURE__ */ jsx12("style", { children: lifecycleSurfaceStyles }),
4659
+ /* @__PURE__ */ jsx12("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs12("div", { children: [
4660
+ /* @__PURE__ */ jsx12("strong", { children: "Explanation of Review" }),
4661
+ /* @__PURE__ */ jsx12("span", { children: "Payer response and payment reconciliation." })
4148
4662
  ] }) }),
4149
- /* @__PURE__ */ jsxs9("dl", { className: "mb-eor-metrics", children: [
4150
- /* @__PURE__ */ jsxs9("div", { children: [
4151
- /* @__PURE__ */ jsx9("dt", { children: "Amount billed" }),
4152
- /* @__PURE__ */ jsx9("dd", { children: currency(remittance.billedAmount) })
4663
+ /* @__PURE__ */ jsxs12("dl", { className: "mb-eor-metrics", children: [
4664
+ /* @__PURE__ */ jsxs12("div", { children: [
4665
+ /* @__PURE__ */ jsx12("dt", { children: "Amount billed" }),
4666
+ /* @__PURE__ */ jsx12("dd", { children: currency(remittance.billedAmount) })
4153
4667
  ] }),
4154
- /* @__PURE__ */ jsxs9("div", { children: [
4155
- /* @__PURE__ */ jsx9("dt", { children: "Payer allowed" }),
4156
- /* @__PURE__ */ jsx9("dd", { children: remittance.payerAllowedAmount === null ? "\u2014" : currency(remittance.payerAllowedAmount) })
4668
+ /* @__PURE__ */ jsxs12("div", { children: [
4669
+ /* @__PURE__ */ jsx12("dt", { children: "Payer allowed" }),
4670
+ /* @__PURE__ */ jsx12("dd", { children: remittance.payerAllowedAmount === null ? "\u2014" : currency(remittance.payerAllowedAmount) })
4157
4671
  ] }),
4158
- /* @__PURE__ */ jsxs9("div", { children: [
4159
- /* @__PURE__ */ jsx9("dt", { children: "Payer reported paid" }),
4160
- /* @__PURE__ */ jsx9("dd", { children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) })
4672
+ /* @__PURE__ */ jsxs12("div", { children: [
4673
+ /* @__PURE__ */ jsx12("dt", { children: "Payer reported paid" }),
4674
+ /* @__PURE__ */ jsx12("dd", { children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) })
4161
4675
  ] }),
4162
- /* @__PURE__ */ jsxs9("div", { className: "is-balance", children: [
4163
- /* @__PURE__ */ jsx9("dt", { children: "Balance due" }),
4164
- /* @__PURE__ */ jsx9("dd", { children: currency(remittance.balanceDue) })
4676
+ /* @__PURE__ */ jsxs12("div", { className: "is-balance", children: [
4677
+ /* @__PURE__ */ jsx12("dt", { children: "Balance due" }),
4678
+ /* @__PURE__ */ jsx12("dd", { children: currency(remittance.balanceDue) })
4165
4679
  ] }),
4166
- /* @__PURE__ */ jsxs9("div", { children: [
4167
- /* @__PURE__ */ jsx9("dt", { children: "Payment posted" }),
4168
- /* @__PURE__ */ jsx9("dd", { children: currency(remittance.postedPrincipal) })
4680
+ /* @__PURE__ */ jsxs12("div", { children: [
4681
+ /* @__PURE__ */ jsx12("dt", { children: "Payment posted" }),
4682
+ /* @__PURE__ */ jsx12("dd", { children: currency(remittance.postedPrincipal) })
4169
4683
  ] }),
4170
- /* @__PURE__ */ jsxs9("div", { children: [
4171
- /* @__PURE__ */ jsx9("dt", { children: "Penalty & interest" }),
4172
- /* @__PURE__ */ jsx9("dd", { children: currency(remittance.postedAdditional) })
4684
+ /* @__PURE__ */ jsxs12("div", { children: [
4685
+ /* @__PURE__ */ jsx12("dt", { children: "Penalty & interest" }),
4686
+ /* @__PURE__ */ jsx12("dd", { children: currency(remittance.postedAdditional) })
4173
4687
  ] }),
4174
- /* @__PURE__ */ jsxs9("div", { children: [
4175
- /* @__PURE__ */ jsx9("dt", { children: "Total received" }),
4176
- /* @__PURE__ */ jsx9("dd", { children: currency(remittance.totalPostedCash) })
4688
+ /* @__PURE__ */ jsxs12("div", { children: [
4689
+ /* @__PURE__ */ jsx12("dt", { children: "Total received" }),
4690
+ /* @__PURE__ */ jsx12("dd", { children: currency(remittance.totalPostedCash) })
4177
4691
  ] }),
4178
- /* @__PURE__ */ jsxs9("div", { children: [
4179
- /* @__PURE__ */ jsx9("dt", { children: "Expected" }),
4180
- /* @__PURE__ */ jsx9("dd", { children: currency(remittance.expectedAmount) })
4692
+ /* @__PURE__ */ jsxs12("div", { children: [
4693
+ /* @__PURE__ */ jsx12("dt", { children: "Expected" }),
4694
+ /* @__PURE__ */ jsx12("dd", { children: currency(remittance.expectedAmount) })
4181
4695
  ] })
4182
4696
  ] }),
4183
- remittance.denialReason ? /* @__PURE__ */ jsxs9("div", { className: "mb-denial", children: [
4184
- /* @__PURE__ */ jsx9("strong", { children: "Denial reason" }),
4185
- /* @__PURE__ */ jsx9("p", { children: remittance.denialReason })
4697
+ remittance.denialReason ? /* @__PURE__ */ jsxs12("div", { className: "mb-denial", children: [
4698
+ /* @__PURE__ */ jsx12("strong", { children: "Denial reason" }),
4699
+ /* @__PURE__ */ jsx12("p", { children: remittance.denialReason })
4186
4700
  ] }) : null,
4187
- /* @__PURE__ */ jsx9("div", { className: "mb-eor-table-wrap", children: /* @__PURE__ */ jsxs9("table", { className: "mb-eor-table", children: [
4188
- /* @__PURE__ */ jsxs9("thead", { children: [
4189
- /* @__PURE__ */ jsxs9("tr", { className: "mb-eor-groups", children: [
4190
- /* @__PURE__ */ jsx9("th", { colSpan: 2, children: "Submission" }),
4191
- /* @__PURE__ */ jsx9("th", { colSpan: 5, children: "EOR payment information" }),
4192
- /* @__PURE__ */ jsx9("th", { colSpan: 2, children: "EOR post" }),
4193
- /* @__PURE__ */ jsx9("th", { children: "EOR" })
4701
+ /* @__PURE__ */ jsx12("div", { className: "mb-eor-table-wrap", children: /* @__PURE__ */ jsxs12("table", { className: "mb-eor-table", children: [
4702
+ /* @__PURE__ */ jsxs12("thead", { children: [
4703
+ /* @__PURE__ */ jsxs12("tr", { className: "mb-eor-groups", children: [
4704
+ /* @__PURE__ */ jsx12("th", { colSpan: 2, children: "Submission" }),
4705
+ /* @__PURE__ */ jsx12("th", { colSpan: 5, children: "EOR payment information" }),
4706
+ /* @__PURE__ */ jsx12("th", { colSpan: 2, children: "EOR post" }),
4707
+ /* @__PURE__ */ jsx12("th", { children: "EOR" })
4194
4708
  ] }),
4195
- /* @__PURE__ */ jsxs9("tr", { children: [
4196
- /* @__PURE__ */ jsx9("th", { children: "Submission" }),
4197
- /* @__PURE__ */ jsx9("th", { children: "Submission payment" }),
4198
- /* @__PURE__ */ jsx9("th", { children: "Payment method" }),
4199
- /* @__PURE__ */ jsx9("th", { children: "Reference" }),
4200
- /* @__PURE__ */ jsx9("th", { children: "Effective date" }),
4201
- /* @__PURE__ */ jsx9("th", { children: "Payment total" }),
4202
- /* @__PURE__ */ jsx9("th", { children: "Deposit date" }),
4203
- /* @__PURE__ */ jsx9("th", { children: "Post date" }),
4204
- /* @__PURE__ */ jsx9("th", { children: "Source" }),
4205
- /* @__PURE__ */ jsx9("th", { children: "Document" })
4709
+ /* @__PURE__ */ jsxs12("tr", { children: [
4710
+ /* @__PURE__ */ jsx12("th", { children: "Submission" }),
4711
+ /* @__PURE__ */ jsx12("th", { children: "Submission payment" }),
4712
+ /* @__PURE__ */ jsx12("th", { children: "Payment method" }),
4713
+ /* @__PURE__ */ jsx12("th", { children: "Reference" }),
4714
+ /* @__PURE__ */ jsx12("th", { children: "Effective date" }),
4715
+ /* @__PURE__ */ jsx12("th", { children: "Payment total" }),
4716
+ /* @__PURE__ */ jsx12("th", { children: "Deposit date" }),
4717
+ /* @__PURE__ */ jsx12("th", { children: "Post date" }),
4718
+ /* @__PURE__ */ jsx12("th", { children: "Source" }),
4719
+ /* @__PURE__ */ jsx12("th", { children: "Document" })
4206
4720
  ] })
4207
4721
  ] }),
4208
- /* @__PURE__ */ jsx9("tbody", { children: rows.map((payment, index) => {
4722
+ /* @__PURE__ */ jsx12("tbody", { children: rows.map((payment, index) => {
4209
4723
  const eor = eors[index] ?? eors[0];
4210
- return /* @__PURE__ */ jsxs9("tr", { children: [
4211
- /* @__PURE__ */ jsxs9("td", { "data-label": "Submission", children: [
4212
- /* @__PURE__ */ jsx9("strong", { children: "Original bill" }),
4213
- submittedAt ? /* @__PURE__ */ jsxs9("span", { children: [
4724
+ return /* @__PURE__ */ jsxs12("tr", { children: [
4725
+ /* @__PURE__ */ jsxs12("td", { "data-label": "Submission", children: [
4726
+ /* @__PURE__ */ jsx12("strong", { children: "Original bill" }),
4727
+ submittedAt ? /* @__PURE__ */ jsxs12("span", { children: [
4214
4728
  "Sent ",
4215
4729
  defaultFormatDate(submittedAt)
4216
4730
  ] }) : null
4217
4731
  ] }),
4218
- /* @__PURE__ */ jsx9("td", { "data-label": "Submission payment", children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) }),
4219
- /* @__PURE__ */ jsx9("td", { "data-label": "Payment method", children: payment ? humanize(payment.method) : "\u2014" }),
4220
- /* @__PURE__ */ jsx9("td", { "data-label": "Reference", children: payment?.checkNumber || "\u2014" }),
4221
- /* @__PURE__ */ jsx9("td", { "data-label": "Effective date", children: payment ? payment.receivedDate || payment.depositDate || defaultFormatDate(payment.postedAt) : "\u2014" }),
4222
- /* @__PURE__ */ jsx9("td", { "data-label": "Payment total", children: payment ? currency(payment.amount) : currency(0) }),
4223
- /* @__PURE__ */ jsx9("td", { "data-label": "Deposit date", children: payment?.depositDate || "Not recorded" }),
4224
- /* @__PURE__ */ jsx9("td", { "data-label": "Post date", children: payment ? defaultFormatDate(payment.postedAt) : eor ? defaultFormatDate(eor.addedAt) : "\u2014" }),
4225
- /* @__PURE__ */ jsx9("td", { "data-label": "Source", children: payment ? payment.source.toUpperCase() : eor ? "EOR" : "\u2014" }),
4226
- /* @__PURE__ */ jsx9("td", { "data-label": "EOR", children: eor && onOpenEor ? /* @__PURE__ */ jsx9("button", { type: "button", className: "mb-eor-link", onClick: () => void onOpenEor(eor), children: eor.filename }) : eor?.filename || "\u2014" })
4732
+ /* @__PURE__ */ jsx12("td", { "data-label": "Submission payment", children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) }),
4733
+ /* @__PURE__ */ jsx12("td", { "data-label": "Payment method", children: payment ? humanize(payment.method) : "\u2014" }),
4734
+ /* @__PURE__ */ jsx12("td", { "data-label": "Reference", children: payment?.checkNumber || "\u2014" }),
4735
+ /* @__PURE__ */ jsx12("td", { "data-label": "Effective date", children: payment ? payment.receivedDate || payment.depositDate || defaultFormatDate(payment.postedAt) : "\u2014" }),
4736
+ /* @__PURE__ */ jsx12("td", { "data-label": "Payment total", children: payment ? currency(payment.amount) : currency(0) }),
4737
+ /* @__PURE__ */ jsx12("td", { "data-label": "Deposit date", children: payment?.depositDate || "Not recorded" }),
4738
+ /* @__PURE__ */ jsx12("td", { "data-label": "Post date", children: payment ? defaultFormatDate(payment.postedAt) : eor ? defaultFormatDate(eor.addedAt) : "\u2014" }),
4739
+ /* @__PURE__ */ jsx12("td", { "data-label": "Source", children: payment ? payment.source.toUpperCase() : eor ? "EOR" : "\u2014" }),
4740
+ /* @__PURE__ */ jsx12("td", { "data-label": "EOR", children: eor && onOpenEor ? /* @__PURE__ */ jsx12("button", { type: "button", className: "mb-eor-link", onClick: () => void onOpenEor(eor), children: eor.filename }) : eor?.filename || "\u2014" })
4227
4741
  ] }, payment?.id ?? `empty-${index}`);
4228
4742
  }) })
4229
4743
  ] }) }),
4230
- eors.length > rows.length ? /* @__PURE__ */ jsx9("div", { className: "mb-eor-documents", children: eors.slice(rows.length).map((eor) => /* @__PURE__ */ jsx9("button", { type: "button", onClick: () => void onOpenEor?.(eor), children: eor.filename }, eor.id)) }) : null
4744
+ eors.length > rows.length ? /* @__PURE__ */ jsx12("div", { className: "mb-eor-documents", children: eors.slice(rows.length).map((eor) => /* @__PURE__ */ jsx12("button", { type: "button", onClick: () => void onOpenEor?.(eor), children: eor.filename }, eor.id)) }) : null
4231
4745
  ] });
4232
4746
  }
4233
4747
  function BillRemittanceCard({ remittance, appearance, className, style }) {
4234
- return /* @__PURE__ */ jsxs9("section", { className: classes("mb-surface mb-remittance", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Remittance summary", children: [
4235
- /* @__PURE__ */ jsx9("style", { children: lifecycleSurfaceStyles }),
4236
- /* @__PURE__ */ jsx9("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs9("div", { children: [
4237
- /* @__PURE__ */ jsx9("strong", { children: "Remittance" }),
4238
- /* @__PURE__ */ jsx9("span", { children: "Amounts reported by the payer and posted to the bill." })
4748
+ return /* @__PURE__ */ jsxs12("section", { className: classes("mb-surface mb-remittance", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Remittance summary", children: [
4749
+ /* @__PURE__ */ jsx12("style", { children: lifecycleSurfaceStyles }),
4750
+ /* @__PURE__ */ jsx12("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs12("div", { children: [
4751
+ /* @__PURE__ */ jsx12("strong", { children: "Remittance" }),
4752
+ /* @__PURE__ */ jsx12("span", { children: "Amounts reported by the payer and posted to the bill." })
4239
4753
  ] }) }),
4240
- /* @__PURE__ */ jsxs9("dl", { children: [
4241
- /* @__PURE__ */ jsxs9("div", { children: [
4242
- /* @__PURE__ */ jsx9("dt", { children: "Amount billed" }),
4243
- /* @__PURE__ */ jsx9("dd", { children: currency(remittance.billedAmount) })
4754
+ /* @__PURE__ */ jsxs12("dl", { children: [
4755
+ /* @__PURE__ */ jsxs12("div", { children: [
4756
+ /* @__PURE__ */ jsx12("dt", { children: "Amount billed" }),
4757
+ /* @__PURE__ */ jsx12("dd", { children: currency(remittance.billedAmount) })
4244
4758
  ] }),
4245
- /* @__PURE__ */ jsxs9("div", { children: [
4246
- /* @__PURE__ */ jsx9("dt", { children: "Expected" }),
4247
- /* @__PURE__ */ jsx9("dd", { children: currency(remittance.expectedAmount) })
4759
+ /* @__PURE__ */ jsxs12("div", { children: [
4760
+ /* @__PURE__ */ jsx12("dt", { children: "Expected" }),
4761
+ /* @__PURE__ */ jsx12("dd", { children: currency(remittance.expectedAmount) })
4248
4762
  ] }),
4249
- /* @__PURE__ */ jsxs9("div", { children: [
4250
- /* @__PURE__ */ jsx9("dt", { children: "Payer allowed" }),
4251
- /* @__PURE__ */ jsx9("dd", { children: remittance.payerAllowedAmount === null ? "\u2014" : currency(remittance.payerAllowedAmount) })
4763
+ /* @__PURE__ */ jsxs12("div", { children: [
4764
+ /* @__PURE__ */ jsx12("dt", { children: "Payer allowed" }),
4765
+ /* @__PURE__ */ jsx12("dd", { children: remittance.payerAllowedAmount === null ? "\u2014" : currency(remittance.payerAllowedAmount) })
4252
4766
  ] }),
4253
- /* @__PURE__ */ jsxs9("div", { children: [
4254
- /* @__PURE__ */ jsx9("dt", { children: "Payer reported paid" }),
4255
- /* @__PURE__ */ jsx9("dd", { children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) })
4767
+ /* @__PURE__ */ jsxs12("div", { children: [
4768
+ /* @__PURE__ */ jsx12("dt", { children: "Payer reported paid" }),
4769
+ /* @__PURE__ */ jsx12("dd", { children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) })
4256
4770
  ] }),
4257
- /* @__PURE__ */ jsxs9("div", { children: [
4258
- /* @__PURE__ */ jsx9("dt", { children: "Payment posted" }),
4259
- /* @__PURE__ */ jsx9("dd", { children: currency(remittance.postedPrincipal) })
4771
+ /* @__PURE__ */ jsxs12("div", { children: [
4772
+ /* @__PURE__ */ jsx12("dt", { children: "Payment posted" }),
4773
+ /* @__PURE__ */ jsx12("dd", { children: currency(remittance.postedPrincipal) })
4260
4774
  ] }),
4261
- /* @__PURE__ */ jsxs9("div", { children: [
4262
- /* @__PURE__ */ jsx9("dt", { children: "Penalty & interest" }),
4263
- /* @__PURE__ */ jsx9("dd", { children: currency(remittance.postedAdditional) })
4775
+ /* @__PURE__ */ jsxs12("div", { children: [
4776
+ /* @__PURE__ */ jsx12("dt", { children: "Penalty & interest" }),
4777
+ /* @__PURE__ */ jsx12("dd", { children: currency(remittance.postedAdditional) })
4264
4778
  ] }),
4265
- /* @__PURE__ */ jsxs9("div", { children: [
4266
- /* @__PURE__ */ jsx9("dt", { children: "Total received" }),
4267
- /* @__PURE__ */ jsx9("dd", { children: currency(remittance.totalPostedCash) })
4779
+ /* @__PURE__ */ jsxs12("div", { children: [
4780
+ /* @__PURE__ */ jsx12("dt", { children: "Total received" }),
4781
+ /* @__PURE__ */ jsx12("dd", { children: currency(remittance.totalPostedCash) })
4268
4782
  ] }),
4269
- /* @__PURE__ */ jsxs9("div", { children: [
4270
- /* @__PURE__ */ jsx9("dt", { children: "Balance due" }),
4271
- /* @__PURE__ */ jsx9("dd", { children: currency(remittance.balanceDue) })
4783
+ /* @__PURE__ */ jsxs12("div", { children: [
4784
+ /* @__PURE__ */ jsx12("dt", { children: "Balance due" }),
4785
+ /* @__PURE__ */ jsx12("dd", { children: currency(remittance.balanceDue) })
4272
4786
  ] })
4273
4787
  ] }),
4274
- remittance.denialReason ? /* @__PURE__ */ jsxs9("div", { className: "mb-denial", children: [
4275
- /* @__PURE__ */ jsx9("strong", { children: "Denial reason" }),
4276
- /* @__PURE__ */ jsx9("p", { children: remittance.denialReason })
4788
+ remittance.denialReason ? /* @__PURE__ */ jsxs12("div", { className: "mb-denial", children: [
4789
+ /* @__PURE__ */ jsx12("strong", { children: "Denial reason" }),
4790
+ /* @__PURE__ */ jsx12("p", { children: remittance.denialReason })
4277
4791
  ] }) : null
4278
4792
  ] });
4279
4793
  }
@@ -4288,72 +4802,72 @@ function BillPayerContactCard({ delivery, appearance, className, style }) {
4288
4802
  delivery.contacts.portalUrl ? ["Portal", "Open payer portal", delivery.contacts.portalUrl] : null
4289
4803
  ].filter(Boolean);
4290
4804
  if (!delivery.payerName && !contacts.length) return null;
4291
- return /* @__PURE__ */ jsxs9("section", { className: classes("mb-surface mb-contacts", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Payer contact information", children: [
4292
- /* @__PURE__ */ jsx9("style", { children: lifecycleSurfaceStyles }),
4293
- /* @__PURE__ */ jsx9("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs9("div", { children: [
4294
- /* @__PURE__ */ jsx9("strong", { children: delivery.payerName || "Claims administrator" }),
4295
- /* @__PURE__ */ jsx9("span", { children: "Billing and follow-up contacts." })
4805
+ return /* @__PURE__ */ jsxs12("section", { className: classes("mb-surface mb-contacts", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Payer contact information", children: [
4806
+ /* @__PURE__ */ jsx12("style", { children: lifecycleSurfaceStyles }),
4807
+ /* @__PURE__ */ jsx12("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs12("div", { children: [
4808
+ /* @__PURE__ */ jsx12("strong", { children: delivery.payerName || "Claims administrator" }),
4809
+ /* @__PURE__ */ jsx12("span", { children: "Billing and follow-up contacts." })
4296
4810
  ] }) }),
4297
- !contacts.length ? /* @__PURE__ */ jsx9("p", { className: "mb-empty", children: "No payer contact details are available." }) : /* @__PURE__ */ jsx9("dl", { children: contacts.map(([label, value, href]) => /* @__PURE__ */ jsxs9("div", { children: [
4298
- /* @__PURE__ */ jsx9("dt", { children: label }),
4299
- /* @__PURE__ */ jsx9("dd", { children: href ? /* @__PURE__ */ jsx9("a", { href, target: label === "Portal" ? "_blank" : void 0, rel: label === "Portal" ? "noreferrer noopener" : void 0, children: value }) : value })
4811
+ !contacts.length ? /* @__PURE__ */ jsx12("p", { className: "mb-empty", children: "No payer contact details are available." }) : /* @__PURE__ */ jsx12("dl", { children: contacts.map(([label, value, href]) => /* @__PURE__ */ jsxs12("div", { children: [
4812
+ /* @__PURE__ */ jsx12("dt", { children: label }),
4813
+ /* @__PURE__ */ jsx12("dd", { children: href ? /* @__PURE__ */ jsx12("a", { href, target: label === "Portal" ? "_blank" : void 0, rel: label === "Portal" ? "noreferrer noopener" : void 0, children: value }) : value })
4300
4814
  ] }, label)) })
4301
4815
  ] });
4302
4816
  }
4303
4817
  function BillPaymentLedger({ payments, appearance, className, style }) {
4304
- return /* @__PURE__ */ jsxs9("section", { className: classes("mb-surface mb-payments", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Payment ledger", children: [
4305
- /* @__PURE__ */ jsx9("style", { children: lifecycleSurfaceStyles }),
4306
- /* @__PURE__ */ jsx9("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs9("div", { children: [
4307
- /* @__PURE__ */ jsx9("strong", { children: "Payments" }),
4308
- /* @__PURE__ */ jsx9("span", { children: "Funds recorded against this bill." })
4818
+ return /* @__PURE__ */ jsxs12("section", { className: classes("mb-surface mb-payments", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Payment ledger", children: [
4819
+ /* @__PURE__ */ jsx12("style", { children: lifecycleSurfaceStyles }),
4820
+ /* @__PURE__ */ jsx12("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs12("div", { children: [
4821
+ /* @__PURE__ */ jsx12("strong", { children: "Payments" }),
4822
+ /* @__PURE__ */ jsx12("span", { children: "Funds recorded against this bill." })
4309
4823
  ] }) }),
4310
- !payments.length ? /* @__PURE__ */ jsx9("p", { className: "mb-empty", children: "No payments posted." }) : /* @__PURE__ */ jsx9("div", { className: "mb-payment-list", children: payments.map((payment) => {
4824
+ !payments.length ? /* @__PURE__ */ jsx12("p", { className: "mb-empty", children: "No payments posted." }) : /* @__PURE__ */ jsx12("div", { className: "mb-payment-list", children: payments.map((payment) => {
4311
4825
  const additional = payment.feeAmount ?? 0;
4312
- return /* @__PURE__ */ jsxs9("article", { children: [
4313
- /* @__PURE__ */ jsxs9("div", { className: "mb-payment-amount", children: [
4314
- /* @__PURE__ */ jsx9("strong", { children: currency(payment.amount) }),
4315
- /* @__PURE__ */ jsx9("span", { children: "Total received" })
4826
+ return /* @__PURE__ */ jsxs12("article", { children: [
4827
+ /* @__PURE__ */ jsxs12("div", { className: "mb-payment-amount", children: [
4828
+ /* @__PURE__ */ jsx12("strong", { children: currency(payment.amount) }),
4829
+ /* @__PURE__ */ jsx12("span", { children: "Total received" })
4316
4830
  ] }),
4317
- /* @__PURE__ */ jsxs9("dl", { children: [
4318
- /* @__PURE__ */ jsxs9("div", { children: [
4319
- /* @__PURE__ */ jsx9("dt", { children: "Applied to bill" }),
4320
- /* @__PURE__ */ jsx9("dd", { children: currency(payment.principalAmount) })
4831
+ /* @__PURE__ */ jsxs12("dl", { children: [
4832
+ /* @__PURE__ */ jsxs12("div", { children: [
4833
+ /* @__PURE__ */ jsx12("dt", { children: "Applied to bill" }),
4834
+ /* @__PURE__ */ jsx12("dd", { children: currency(payment.principalAmount) })
4321
4835
  ] }),
4322
- additional > 0 ? /* @__PURE__ */ jsxs9("div", { children: [
4323
- /* @__PURE__ */ jsx9("dt", { children: "Penalty & interest" }),
4324
- /* @__PURE__ */ jsx9("dd", { children: currency(additional) })
4836
+ additional > 0 ? /* @__PURE__ */ jsxs12("div", { children: [
4837
+ /* @__PURE__ */ jsx12("dt", { children: "Penalty & interest" }),
4838
+ /* @__PURE__ */ jsx12("dd", { children: currency(additional) })
4325
4839
  ] }) : null,
4326
- /* @__PURE__ */ jsxs9("div", { children: [
4327
- /* @__PURE__ */ jsx9("dt", { children: "Method" }),
4328
- /* @__PURE__ */ jsx9("dd", { children: payment.method.toUpperCase() })
4840
+ /* @__PURE__ */ jsxs12("div", { children: [
4841
+ /* @__PURE__ */ jsx12("dt", { children: "Method" }),
4842
+ /* @__PURE__ */ jsx12("dd", { children: payment.method.toUpperCase() })
4329
4843
  ] }),
4330
- /* @__PURE__ */ jsxs9("div", { children: [
4331
- /* @__PURE__ */ jsx9("dt", { children: "Reference" }),
4332
- /* @__PURE__ */ jsx9("dd", { children: payment.checkNumber || "\u2014" })
4844
+ /* @__PURE__ */ jsxs12("div", { children: [
4845
+ /* @__PURE__ */ jsx12("dt", { children: "Reference" }),
4846
+ /* @__PURE__ */ jsx12("dd", { children: payment.checkNumber || "\u2014" })
4333
4847
  ] }),
4334
- /* @__PURE__ */ jsxs9("div", { children: [
4335
- /* @__PURE__ */ jsx9("dt", { children: "Effective date" }),
4336
- /* @__PURE__ */ jsx9("dd", { children: payment.receivedDate || payment.depositDate || defaultFormatDate(payment.postedAt) })
4848
+ /* @__PURE__ */ jsxs12("div", { children: [
4849
+ /* @__PURE__ */ jsx12("dt", { children: "Effective date" }),
4850
+ /* @__PURE__ */ jsx12("dd", { children: payment.receivedDate || payment.depositDate || defaultFormatDate(payment.postedAt) })
4337
4851
  ] }),
4338
- /* @__PURE__ */ jsxs9("div", { children: [
4339
- /* @__PURE__ */ jsx9("dt", { children: "Deposit date" }),
4340
- /* @__PURE__ */ jsx9("dd", { children: payment.depositDate || "Not recorded" })
4852
+ /* @__PURE__ */ jsxs12("div", { children: [
4853
+ /* @__PURE__ */ jsx12("dt", { children: "Deposit date" }),
4854
+ /* @__PURE__ */ jsx12("dd", { children: payment.depositDate || "Not recorded" })
4341
4855
  ] }),
4342
- /* @__PURE__ */ jsxs9("div", { children: [
4343
- /* @__PURE__ */ jsx9("dt", { children: "Posted" }),
4344
- /* @__PURE__ */ jsxs9("dd", { children: [
4856
+ /* @__PURE__ */ jsxs12("div", { children: [
4857
+ /* @__PURE__ */ jsx12("dt", { children: "Posted" }),
4858
+ /* @__PURE__ */ jsxs12("dd", { children: [
4345
4859
  defaultFormatDate(payment.postedAt),
4346
4860
  " \xB7 ",
4347
4861
  payment.source.toUpperCase()
4348
4862
  ] })
4349
4863
  ] }),
4350
- /* @__PURE__ */ jsxs9("div", { children: [
4351
- /* @__PURE__ */ jsx9("dt", { children: "Status" }),
4352
- /* @__PURE__ */ jsx9("dd", { children: humanize(payment.status || "posted") })
4864
+ /* @__PURE__ */ jsxs12("div", { children: [
4865
+ /* @__PURE__ */ jsx12("dt", { children: "Status" }),
4866
+ /* @__PURE__ */ jsx12("dd", { children: humanize(payment.status || "posted") })
4353
4867
  ] })
4354
4868
  ] }),
4355
- payment.feeReason ? /* @__PURE__ */ jsx9("p", { children: payment.feeReason }) : null,
4356
- payment.note ? /* @__PURE__ */ jsx9("p", { children: payment.note }) : null
4869
+ payment.feeReason ? /* @__PURE__ */ jsx12("p", { children: payment.feeReason }) : null,
4870
+ payment.note ? /* @__PURE__ */ jsx12("p", { children: payment.note }) : null
4357
4871
  ] }, payment.id);
4358
4872
  }) })
4359
4873
  ] });
@@ -4408,10 +4922,10 @@ var lifecycleSurfaceStyles = `
4408
4922
  // src/connected-bill-lifecycle.tsx
4409
4923
  import {
4410
4924
  useCallback as useCallback4,
4411
- useEffect as useEffect7,
4925
+ useEffect as useEffect8,
4412
4926
  useMemo as useMemo8,
4413
4927
  useRef as useRef5,
4414
- useState as useState9
4928
+ useState as useState10
4415
4929
  } from "react";
4416
4930
  import {
4417
4931
  DEFAULT_API_BASE_URL as DEFAULT_API_BASE_URL2,
@@ -4419,7 +4933,7 @@ import {
4419
4933
  createBillLifecycleClient
4420
4934
  } from "@mindbill/browser";
4421
4935
  import { createBillLifecycleClient as createBillLifecycleClient2 } from "@mindbill/browser";
4422
- import { Fragment as Fragment7, jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
4936
+ import { Fragment as Fragment9, jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
4423
4937
  var DEFAULT_REFRESH_INTERVAL2 = 6e4;
4424
4938
  function reservePreviewWindow() {
4425
4939
  const preview = window.open("about:blank", "_blank");
@@ -4461,11 +4975,11 @@ function useBillLifecycle({
4461
4975
  enabled = true,
4462
4976
  fetch: fetchOverride
4463
4977
  }) {
4464
- const [data, setData] = useState9(null);
4465
- const [error, setError] = useState9(null);
4466
- const [isLoading, setIsLoading] = useState9(enabled);
4467
- const [isRefreshing, setIsRefreshing] = useState9(false);
4468
- const [isMutating, setIsMutating] = useState9(false);
4978
+ const [data, setData] = useState10(null);
4979
+ const [error, setError] = useState10(null);
4980
+ const [isLoading, setIsLoading] = useState10(enabled);
4981
+ const [isRefreshing, setIsRefreshing] = useState10(false);
4982
+ const [isMutating, setIsMutating] = useState10(false);
4469
4983
  const mounted = useRef5(true);
4470
4984
  const client = useMemo8(() => createBillLifecycleClient({
4471
4985
  billId: providedBillId,
@@ -4474,12 +4988,12 @@ function useBillLifecycle({
4474
4988
  apiBaseUrl,
4475
4989
  fetch: fetchOverride
4476
4990
  }), [apiBaseUrl, fetchOverride, getSession, providedBillId, sessionEndpoint]);
4477
- useEffect7(() => {
4991
+ useEffect8(() => {
4478
4992
  setData(null);
4479
4993
  setError(null);
4480
4994
  setIsLoading(enabled);
4481
4995
  }, [enabled, providedBillId]);
4482
- useEffect7(() => {
4996
+ useEffect8(() => {
4483
4997
  mounted.current = true;
4484
4998
  return () => {
4485
4999
  mounted.current = false;
@@ -4503,7 +5017,7 @@ function useBillLifecycle({
4503
5017
  }
4504
5018
  }
4505
5019
  }, [client, enabled]);
4506
- useEffect7(() => {
5020
+ useEffect8(() => {
4507
5021
  if (!enabled) return;
4508
5022
  void refresh();
4509
5023
  const interval = refreshInterval > 0 ? window.setInterval(() => void refresh(), refreshInterval) : null;
@@ -4555,6 +5069,7 @@ function useBillLifecycle({
4555
5069
  refresh,
4556
5070
  searchClaimsAdministrators: (query, claimNumber) => client.searchClaimsAdministrators(query, claimNumber),
4557
5071
  getDeliveryOptions: () => client.getDeliveryOptions(),
5072
+ getAttachment: (attachmentId) => client.getAttachment(attachmentId),
4558
5073
  openAttachment,
4559
5074
  openEor,
4560
5075
  downloadPacket,
@@ -4566,9 +5081,9 @@ function useBillLifecycle({
4566
5081
  simulateSandbox: (input) => mutate(() => client.simulateSandbox(input))
4567
5082
  };
4568
5083
  }
4569
- function LifecycleDialog({ children, title, onClose }) {
5084
+ function LifecycleDialog({ children, title, wide = false, onClose }) {
4570
5085
  const dialog = useRef5(null);
4571
- useEffect7(() => {
5086
+ useEffect8(() => {
4572
5087
  const previous = document.activeElement;
4573
5088
  dialog.current?.focus();
4574
5089
  const onKeyDown = (event) => event.key === "Escape" && onClose();
@@ -4578,11 +5093,90 @@ function LifecycleDialog({ children, title, onClose }) {
4578
5093
  previous?.focus();
4579
5094
  };
4580
5095
  }, [onClose]);
4581
- return /* @__PURE__ */ jsx10("div", { className: "mb-lifecycle-dialog-backdrop", onMouseDown: (event) => event.currentTarget === event.target && onClose(), children: /* @__PURE__ */ jsxs10("div", { ref: dialog, className: "mb-lifecycle-dialog", role: "dialog", "aria-modal": "true", "aria-label": title, tabIndex: -1, children: [
4582
- /* @__PURE__ */ jsx10("button", { type: "button", className: "mb-lifecycle-dialog-close", "aria-label": "Close", onClick: onClose, children: "\xD7" }),
5096
+ return /* @__PURE__ */ jsx13("div", { className: "mb-lifecycle-dialog-backdrop", onMouseDown: (event) => event.currentTarget === event.target && onClose(), children: /* @__PURE__ */ jsxs13("div", { ref: dialog, className: ["mb-lifecycle-dialog", wide ? "wide" : ""].filter(Boolean).join(" "), role: "dialog", "aria-modal": "true", "aria-label": title, tabIndex: -1, children: [
5097
+ /* @__PURE__ */ jsx13("button", { type: "button", className: "mb-lifecycle-dialog-close", "aria-label": "Close", onClick: onClose, children: "\xD7" }),
4583
5098
  children
4584
5099
  ] }) });
4585
5100
  }
5101
+ function correctionDocumentType(value) {
5102
+ return BILL_SUBMISSION_DOCUMENT_TYPES.includes(value) ? value : "other";
5103
+ }
5104
+ function correctionBill(data) {
5105
+ const billing = data.bill.billingSnapshot?.billingProvider;
5106
+ const rendering = data.bill.billingSnapshot?.renderingProvider;
5107
+ const location = data.bill.billingSnapshot?.placeOfService;
5108
+ const nameParts = data.patient.name.trim().split(/\s+/);
5109
+ const firstName = data.patient.firstName || nameParts[0] || "";
5110
+ const lastName = data.patient.lastName || nameParts.slice(1).join(" ") || "";
5111
+ return {
5112
+ billingMode: data.bill.billingMode,
5113
+ patient: {
5114
+ firstName,
5115
+ ...data.patient.middleName ? { middleName: data.patient.middleName } : {},
5116
+ lastName,
5117
+ dateOfBirth: data.patient.dob || "",
5118
+ ...data.patient.phone ? { phone: data.patient.phone } : {},
5119
+ address: {
5120
+ line1: data.patient.address?.line1 || "",
5121
+ city: data.patient.address?.city || "",
5122
+ state: data.patient.address?.state || "",
5123
+ postalCode: data.patient.address?.postalCode || ""
5124
+ }
5125
+ },
5126
+ claim: {
5127
+ claimNumber: data.injury.claimNumber || "",
5128
+ ...data.injury.adjNumber ? { adjNumber: data.injury.adjNumber } : {},
5129
+ employer: data.injury.employer || "",
5130
+ dateOfInjury: data.injury.doi || "",
5131
+ ...data.injury.injuryDescription ? { description: data.injury.injuryDescription } : {},
5132
+ ...data.injury.claimsAdminId && data.injury.claimsAdminName ? {
5133
+ claimsAdministrator: { id: data.injury.claimsAdminId, name: data.injury.claimsAdminName }
5134
+ } : {}
5135
+ },
5136
+ service: {
5137
+ date: data.bill.dos,
5138
+ ...data.bill.dosEnd !== void 0 ? { endDate: data.bill.dosEnd } : {},
5139
+ ...data.bill.authorizationNumber !== void 0 ? { authorizationNumber: data.bill.authorizationNumber } : {}
5140
+ },
5141
+ ...billing ? { billingProvider: {
5142
+ name: billing.name,
5143
+ taxId: billing.taxId,
5144
+ npi: billing.npi,
5145
+ ...billing.phone ? { phone: billing.phone } : {},
5146
+ address: {
5147
+ line1: billing.billingStreet || "",
5148
+ city: billing.billingCity || "",
5149
+ state: billing.billingState || "",
5150
+ postalCode: billing.billingZip || ""
5151
+ }
5152
+ } } : {},
5153
+ ...rendering ? { renderingProvider: {
5154
+ name: rendering.name,
5155
+ npi: rendering.npi,
5156
+ ...rendering.taxonomy ? { taxonomy: rendering.taxonomy } : {},
5157
+ ...rendering.specialty ? { specialty: rendering.specialty } : {},
5158
+ ...rendering.licenseNumber ? { licenseNumber: rendering.licenseNumber } : {},
5159
+ ...rendering.licenseState ? { licenseState: rendering.licenseState } : {},
5160
+ ...rendering.isQME !== void 0 ? { isQme: rendering.isQME } : {},
5161
+ ...rendering.isAME !== void 0 ? { isAme: rendering.isAME } : {}
5162
+ } } : {},
5163
+ ...location ? { serviceLocation: {
5164
+ ...location.name ? { name: location.name } : {},
5165
+ address: { line1: location.street, city: location.city, state: location.state, postalCode: location.zip },
5166
+ ...location.posCode ? { placeOfServiceCode: location.posCode } : {}
5167
+ } } : {},
5168
+ diagnoses: [...data.injury.diagnosisCodes || []],
5169
+ serviceLines: data.bill.lineItems.map((line) => ({
5170
+ code: line.code,
5171
+ modifiers: [...line.modifiers],
5172
+ units: line.units,
5173
+ charge: line.charge,
5174
+ ...line.serviceDate ? { serviceDate: line.serviceDate } : {},
5175
+ ...line.serviceDateEnd !== void 0 ? { serviceDateEnd: line.serviceDateEnd } : {},
5176
+ ...line.diagnosisPointers ? { diagnosisPointers: [...line.diagnosisPointers] } : {}
5177
+ }))
5178
+ };
5179
+ }
4586
5180
  function today() {
4587
5181
  const now = /* @__PURE__ */ new Date();
4588
5182
  return new Date(now.getTime() - now.getTimezoneOffset() * 6e4).toISOString().slice(0, 10);
@@ -4612,14 +5206,29 @@ function shouldShowSandboxControls(environment, enabled = false) {
4612
5206
  function ConnectedBillLifecycle({ appearance, sandboxControls = false, className, style, loadingFallback, errorFallback, onChanged, ...options }) {
4613
5207
  const lifecycle = useBillLifecycle(options);
4614
5208
  const { data } = lifecycle;
4615
- const [tab, setTab] = useState9("details");
4616
- const [panel, setPanel] = useState9("");
4617
- const [notice, setNotice] = useState9("");
4618
- const [reason, setReason] = useState9("");
4619
- const [payment, setPayment] = useState9({ amount: 0, penaltyAmount: 0, interestAmount: 0, method: "check", checkNumber: "", depositDate: today(), note: "" });
4620
- const [review, setReview] = useState9({ reason: "", payerClaimControlNumber: "", disputedAmount: void 0, attachmentIds: [], route: "ebill" });
5209
+ const [tab, setTab] = useState10("details");
5210
+ const [panel, setPanel] = useState10("");
5211
+ const [notice, setNotice] = useState10("");
5212
+ const [reason, setReason] = useState10("");
5213
+ const [payment, setPayment] = useState10({ amount: 0, penaltyAmount: 0, interestAmount: 0, method: "check", checkNumber: "", depositDate: today(), note: "" });
5214
+ const [review, setReview] = useState10({ reason: "", payerClaimControlNumber: "", disputedAmount: void 0, attachmentIds: [], route: "ebill" });
4621
5215
  const lastData = useRef5(null);
4622
- useEffect7(() => {
5216
+ const correctionInitialBill = useMemo8(() => data ? correctionBill(data) : null, [data]);
5217
+ const correctionAttachments = useMemo8(() => data ? data.bill.attachments.map((attachment) => {
5218
+ const documentType = correctionDocumentType(attachment.documentType);
5219
+ const isW9 = documentType === "w9";
5220
+ return {
5221
+ id: attachment.id,
5222
+ fileName: attachment.filename,
5223
+ documentType,
5224
+ ...attachment.description ? { description: attachment.description } : {},
5225
+ ...attachment.reportType ? { reportTypeCode: attachment.reportType } : {},
5226
+ loadBlob: () => lifecycle.getAttachment(attachment.id),
5227
+ ...isW9 ? { autoAttached: true, removable: false } : { removable: true }
5228
+ };
5229
+ }) : [], [data, lifecycle]);
5230
+ const correctionAttentionFields = useMemo8(() => data?.rejection?.issues?.flatMap((issue) => issue.fieldPaths || []).filter((path, index, fields) => fields.indexOf(path) === index) || [], [data]);
5231
+ useEffect8(() => {
4623
5232
  if (!data || data === lastData.current) return;
4624
5233
  lastData.current = data;
4625
5234
  onChanged?.(data);
@@ -4636,13 +5245,13 @@ function ConnectedBillLifecycle({ appearance, sandboxControls = false, className
4636
5245
  attachmentIds: current.attachmentIds.length ? current.attachmentIds.filter((id) => data.bill.attachments.some((document2) => document2.id === id)) : data.bill.attachments.map((document2) => document2.id)
4637
5246
  }));
4638
5247
  }, [data, onChanged]);
4639
- if (lifecycle.isLoading && !data) return /* @__PURE__ */ jsx10(Fragment7, { children: loadingFallback ?? /* @__PURE__ */ jsx10("div", { className: "mb-lifecycle-loading", children: "Loading bill\u2026" }) });
5248
+ if (lifecycle.isLoading && !data) return /* @__PURE__ */ jsx13(Fragment9, { children: loadingFallback ?? /* @__PURE__ */ jsx13("div", { className: "mb-lifecycle-loading", children: "Loading bill\u2026" }) });
4640
5249
  if (!data) {
4641
5250
  const error = lifecycle.error ?? new Error("Bill could not be loaded.");
4642
- return /* @__PURE__ */ jsx10(Fragment7, { children: errorFallback?.(error, lifecycle.refresh) ?? /* @__PURE__ */ jsxs10("div", { className: "mb-lifecycle-error", role: "alert", children: [
4643
- /* @__PURE__ */ jsx10("strong", { children: "Billing is unavailable." }),
4644
- /* @__PURE__ */ jsx10("span", { children: error.message }),
4645
- /* @__PURE__ */ jsx10("button", { type: "button", onClick: () => void lifecycle.refresh(), children: "Try again" })
5251
+ return /* @__PURE__ */ jsx13(Fragment9, { children: errorFallback?.(error, lifecycle.refresh) ?? /* @__PURE__ */ jsxs13("div", { className: "mb-lifecycle-error", role: "alert", children: [
5252
+ /* @__PURE__ */ jsx13("strong", { children: "Billing is unavailable." }),
5253
+ /* @__PURE__ */ jsx13("span", { children: error.message }),
5254
+ /* @__PURE__ */ jsx13("button", { type: "button", onClick: () => void lifecycle.refresh(), children: "Try again" })
4646
5255
  ] }) });
4647
5256
  }
4648
5257
  const complete = async (message, task) => {
@@ -4655,189 +5264,244 @@ function ConnectedBillLifecycle({ appearance, sandboxControls = false, className
4655
5264
  } catch {
4656
5265
  }
4657
5266
  };
5267
+ const submitCorrection = async (value) => {
5268
+ setNotice("");
5269
+ const documents = await prepareBillSubmissionDocuments({
5270
+ attachments: correctionAttachments,
5271
+ selectedIds: value.sourceAttachmentIds,
5272
+ reportTypeCodeByAttachmentId: value.sourceAttachmentReportTypes,
5273
+ uploads: value.uploads,
5274
+ ...options.fetch ? { fetch: options.fetch } : {}
5275
+ });
5276
+ await lifecycle.resubmitBill({
5277
+ bill: value.bill,
5278
+ ...documents.length ? { documents } : {},
5279
+ ...reason.trim() ? { reason: reason.trim() } : {}
5280
+ });
5281
+ setPanel("");
5282
+ setReason("");
5283
+ setNotice("Corrected submission sent.");
5284
+ };
4658
5285
  const viewEor = data.lifecycle.actions.find((action) => action.id === "view_eor" && action.enabled);
4659
5286
  const supportedActions = /* @__PURE__ */ new Set(["resubmit", "second_review", "post_payment", "close", "reopen"]);
4660
5287
  const actions = data.lifecycle.actions.filter((action) => action.enabled && supportedActions.has(action.id));
4661
5288
  const showSandboxControls = shouldShowSandboxControls(data.environment, sandboxControls);
4662
5289
  const simulations = showSandboxControls ? sandboxScenarios(data.lifecycle.state) : [];
4663
- return /* @__PURE__ */ jsxs10("section", { className: ["mb-connected-lifecycle", className].filter(Boolean).join(" "), style: mindBillAppearanceStyle(appearance, style), children: [
4664
- /* @__PURE__ */ jsx10("style", { children: CONNECTED_LIFECYCLE_STYLES }),
4665
- data.lifecycle.state.toLowerCase() === "rejected" && data.rejection ? /* @__PURE__ */ jsx10(BillRejectionNotice, { rejection: data.rejection, submittedAt: data.lifecycle.submittedAt ?? null, ...appearance ? { appearance } : {} }) : /* @__PURE__ */ jsx10(BillLifecycleProgress, { state: data.lifecycle.state, nativeStatus: data.lifecycle.nativeStatus, submittedAt: data.lifecycle.submittedAt ?? null, agingDays: data.lifecycle.agingDays ?? null, ...appearance ? { appearance } : {} }),
4666
- /* @__PURE__ */ jsxs10("header", { className: "mb-lifecycle-head", children: [
4667
- /* @__PURE__ */ jsxs10("div", { children: [
4668
- /* @__PURE__ */ jsx10("div", { className: "mb-lifecycle-title", children: /* @__PURE__ */ jsxs10("h2", { children: [
5290
+ return /* @__PURE__ */ jsxs13("section", { className: ["mb-connected-lifecycle", className].filter(Boolean).join(" "), style: mindBillAppearanceStyle(appearance, style), children: [
5291
+ /* @__PURE__ */ jsx13("style", { children: CONNECTED_LIFECYCLE_STYLES }),
5292
+ data.lifecycle.state.toLowerCase() === "rejected" && data.rejection ? /* @__PURE__ */ jsx13(BillRejectionNotice, { rejection: data.rejection, submittedAt: data.lifecycle.submittedAt ?? null, ...appearance ? { appearance } : {} }) : /* @__PURE__ */ jsx13(BillLifecycleProgress, { state: data.lifecycle.state, nativeStatus: data.lifecycle.nativeStatus, submittedAt: data.lifecycle.submittedAt ?? null, agingDays: data.lifecycle.agingDays ?? null, ...appearance ? { appearance } : {} }),
5293
+ /* @__PURE__ */ jsxs13("header", { className: "mb-lifecycle-head", children: [
5294
+ /* @__PURE__ */ jsxs13("div", { children: [
5295
+ /* @__PURE__ */ jsx13("div", { className: "mb-lifecycle-title", children: /* @__PURE__ */ jsxs13("h2", { children: [
4669
5296
  "Bill #",
4670
5297
  data.bill.billNumber
4671
5298
  ] }) }),
4672
- /* @__PURE__ */ jsxs10("p", { children: [
5299
+ /* @__PURE__ */ jsxs13("p", { children: [
4673
5300
  "Claim ",
4674
5301
  data.injury.claimNumber || "\u2014",
4675
5302
  lifecycle.isRefreshing ? " \xB7 Refreshing\u2026" : ""
4676
5303
  ] })
4677
5304
  ] }),
4678
- /* @__PURE__ */ jsx10("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating, onClick: () => void lifecycle.downloadPacket().catch(() => void 0), children: "Download packet" })
5305
+ /* @__PURE__ */ jsx13("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating, onClick: () => void lifecycle.downloadPacket().catch(() => void 0), children: "Download packet" })
4679
5306
  ] }),
4680
- /* @__PURE__ */ jsxs10("div", { className: "mb-lifecycle-tabs", role: "tablist", "aria-label": "Bill view", children: [
4681
- /* @__PURE__ */ jsx10("button", { type: "button", role: "tab", "aria-selected": tab === "details", onClick: () => setTab("details"), children: "Bill details" }),
4682
- /* @__PURE__ */ jsx10("button", { type: "button", role: "tab", "aria-selected": tab === "history", onClick: () => setTab("history"), children: "Bill history" })
5307
+ /* @__PURE__ */ jsxs13("div", { className: "mb-lifecycle-tabs", role: "tablist", "aria-label": "Bill view", children: [
5308
+ /* @__PURE__ */ jsx13("button", { type: "button", role: "tab", "aria-selected": tab === "details", onClick: () => setTab("details"), children: "Bill details" }),
5309
+ /* @__PURE__ */ jsx13("button", { type: "button", role: "tab", "aria-selected": tab === "history", onClick: () => setTab("history"), children: "Bill history" })
4683
5310
  ] }),
4684
- tab === "details" ? /* @__PURE__ */ jsxs10("div", { className: "mb-lifecycle-tabpanel", role: "tabpanel", children: [
4685
- data.eors.length || data.payments.length || ["processed", "denied", "partially_paid"].includes(data.lifecycle.state) ? /* @__PURE__ */ jsx10(BillExplanationOfReview, { remittance: data.remittance, eors: data.eors, payments: data.payments, submittedAt: data.lifecycle.submittedAt ?? null, onOpenEor: lifecycle.openEor, ...appearance ? { appearance } : {} }) : null,
4686
- showSandboxControls ? /* @__PURE__ */ jsxs10("section", { className: "mb-lifecycle-simulator", "aria-label": "Sandbox lifecycle simulator", children: [
4687
- /* @__PURE__ */ jsxs10("div", { children: [
4688
- /* @__PURE__ */ jsx10("span", { children: "Sandbox demo controls" }),
4689
- /* @__PURE__ */ jsx10("h3", { children: "Simulate the next payer response" }),
4690
- /* @__PURE__ */ jsx10("p", { children: "This changes sandbox data only. The host receives the result through the same lifecycle API and components partners use." })
5311
+ tab === "details" ? /* @__PURE__ */ jsxs13("div", { className: "mb-lifecycle-tabpanel", role: "tabpanel", children: [
5312
+ data.eors.length || data.payments.length || ["processed", "denied", "partially_paid"].includes(data.lifecycle.state) ? /* @__PURE__ */ jsx13(BillExplanationOfReview, { remittance: data.remittance, eors: data.eors, payments: data.payments, submittedAt: data.lifecycle.submittedAt ?? null, onOpenEor: lifecycle.openEor, ...appearance ? { appearance } : {} }) : null,
5313
+ showSandboxControls ? /* @__PURE__ */ jsxs13("section", { className: "mb-lifecycle-simulator", "aria-label": "Sandbox lifecycle simulator", children: [
5314
+ /* @__PURE__ */ jsxs13("div", { children: [
5315
+ /* @__PURE__ */ jsx13("span", { children: "Sandbox demo controls" }),
5316
+ /* @__PURE__ */ jsx13("h3", { children: "Simulate the next payer response" }),
5317
+ /* @__PURE__ */ jsx13("p", { children: "This changes sandbox data only. The host receives the result through the same lifecycle API and components partners use." })
4691
5318
  ] }),
4692
- simulations.length ? /* @__PURE__ */ jsx10("div", { className: "mb-lifecycle-simulator-actions", children: simulations.map((scenario) => /* @__PURE__ */ jsxs10("button", { type: "button", disabled: lifecycle.isMutating, onClick: () => void complete(`${scenario.label} simulated.`, () => lifecycle.simulateSandbox({ scenario: scenario.id })), children: [
4693
- /* @__PURE__ */ jsx10("strong", { children: scenario.label }),
4694
- /* @__PURE__ */ jsx10("span", { children: scenario.detail })
4695
- ] }, scenario.id)) }) : /* @__PURE__ */ jsx10("p", { className: "mb-lifecycle-simulator-idle", children: "No simulated payer transition is needed at this stage. Use the bill action below to continue." })
5319
+ simulations.length ? /* @__PURE__ */ jsx13("div", { className: "mb-lifecycle-simulator-actions", children: simulations.map((scenario) => /* @__PURE__ */ jsxs13("button", { type: "button", disabled: lifecycle.isMutating, onClick: () => void complete(`${scenario.label} simulated.`, () => lifecycle.simulateSandbox({ scenario: scenario.id })), children: [
5320
+ /* @__PURE__ */ jsx13("strong", { children: scenario.label }),
5321
+ /* @__PURE__ */ jsx13("span", { children: scenario.detail })
5322
+ ] }, scenario.id)) }) : /* @__PURE__ */ jsx13("p", { className: "mb-lifecycle-simulator-idle", children: "No simulated payer transition is needed at this stage. Use the bill action below to continue." })
4696
5323
  ] }) : null,
4697
- /* @__PURE__ */ jsx10(BillReadOnlyForm, { data, onOpenAttachment: lifecycle.openAttachment, ...appearance ? { appearance } : {} })
4698
- ] }) : /* @__PURE__ */ jsx10("div", { className: "mb-lifecycle-tabpanel", role: "tabpanel", children: data.history?.length ? /* @__PURE__ */ jsx10(BillHistoryTable, { entries: data.history, ...appearance ? { appearance } : {} }) : /* @__PURE__ */ jsx10(BillActivityTimeline, { events: data.activity, ...appearance ? { appearance } : {} }) }),
4699
- viewEor || actions.length ? /* @__PURE__ */ jsxs10("aside", { className: "mb-lifecycle-actions-sheet", "aria-label": "Bill actions", children: [
4700
- viewEor && data.eors[0] ? /* @__PURE__ */ jsx10("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => void lifecycle.openEor(data.eors[0]).catch(() => void 0), children: viewEor.label }) : null,
4701
- actions.map((action) => /* @__PURE__ */ jsx10("button", { type: "button", className: action.primary ? "mb-lifecycle-button primary" : "mb-lifecycle-button secondary", onClick: () => {
5324
+ /* @__PURE__ */ jsx13(BillReadOnlyForm, { data, onOpenAttachment: lifecycle.openAttachment, ...appearance ? { appearance } : {} })
5325
+ ] }) : /* @__PURE__ */ jsx13("div", { className: "mb-lifecycle-tabpanel", role: "tabpanel", children: data.history?.length ? /* @__PURE__ */ jsx13(BillHistoryTable, { entries: data.history, ...appearance ? { appearance } : {} }) : /* @__PURE__ */ jsx13(BillActivityTimeline, { events: data.activity, ...appearance ? { appearance } : {} }) }),
5326
+ viewEor || actions.length ? /* @__PURE__ */ jsxs13("aside", { className: "mb-lifecycle-actions-sheet", "aria-label": "Bill actions", children: [
5327
+ viewEor && data.eors[0] ? /* @__PURE__ */ jsx13("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => void lifecycle.openEor(data.eors[0]).catch(() => void 0), children: viewEor.label }) : null,
5328
+ actions.map((action) => /* @__PURE__ */ jsx13("button", { type: "button", className: action.primary ? "mb-lifecycle-button primary" : "mb-lifecycle-button secondary", onClick: () => {
4702
5329
  const next = actionPanel(action);
4703
5330
  if (next) setPanel(next);
4704
5331
  }, children: action.label }, action.id))
4705
5332
  ] }) : null,
4706
- panel === "resubmit" ? /* @__PURE__ */ jsx10(LifecycleDialog, { title: "Correct and resubmit", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs10("section", { className: "mb-lifecycle-panel", children: [
4707
- /* @__PURE__ */ jsxs10("div", { children: [
4708
- /* @__PURE__ */ jsx10("h3", { children: "Correct and resubmit" }),
4709
- /* @__PURE__ */ jsx10("p", { children: "The original submission remains immutable. This records a new submission attempt after the routing issue is corrected." })
5333
+ panel === "resubmit" && correctionInitialBill ? /* @__PURE__ */ jsx13(LifecycleDialog, { title: "Correct and resubmit", wide: true, onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs13("section", { className: "mb-lifecycle-correction", children: [
5334
+ /* @__PURE__ */ jsxs13("header", { children: [
5335
+ /* @__PURE__ */ jsxs13("div", { children: [
5336
+ /* @__PURE__ */ jsx13("h3", { children: "Correct and resubmit" }),
5337
+ /* @__PURE__ */ jsx13("p", { children: "Review the rejected snapshot, correct the highlighted information, and submit a new immutable attempt under this bill." })
5338
+ ] }),
5339
+ /* @__PURE__ */ jsx13("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" })
4710
5340
  ] }),
4711
- /* @__PURE__ */ jsxs10("label", { children: [
4712
- /* @__PURE__ */ jsx10("span", { children: "Correction note (optional)" }),
4713
- /* @__PURE__ */ jsx10("textarea", { value: reason, placeholder: "What changed before resubmission?", onChange: (event) => setReason(event.target.value) })
5341
+ data.rejection ? /* @__PURE__ */ jsxs13("div", { className: "mb-lifecycle-correction-reason", children: [
5342
+ /* @__PURE__ */ jsx13("strong", { children: data.rejection.reason }),
5343
+ data.rejection.issues?.map((issue, index) => /* @__PURE__ */ jsxs13("span", { children: [
5344
+ issue.code ? `${issue.code}: ` : "",
5345
+ issue.description
5346
+ ] }, `${issue.code || "issue"}-${index}`))
5347
+ ] }) : null,
5348
+ data.delivery.contacts.adjusterPhone || data.delivery.contacts.claimsEmail ? /* @__PURE__ */ jsxs13("aside", { className: "mb-lifecycle-correction-contact", children: [
5349
+ /* @__PURE__ */ jsx13("strong", { children: "Need to verify the rejected information?" }),
5350
+ /* @__PURE__ */ jsxs13("span", { children: [
5351
+ "Contact ",
5352
+ data.delivery.payerName,
5353
+ data.delivery.contacts.adjusterPhone ? ` at ${data.delivery.contacts.adjusterPhone}` : "",
5354
+ data.delivery.contacts.claimsEmail ? ` \xB7 ${data.delivery.contacts.claimsEmail}` : "",
5355
+ "."
5356
+ ] })
5357
+ ] }) : null,
5358
+ /* @__PURE__ */ jsxs13("label", { className: "mb-lifecycle-correction-note", children: [
5359
+ /* @__PURE__ */ jsx13("span", { children: "Correction note (optional)" }),
5360
+ /* @__PURE__ */ jsx13("textarea", { value: reason, placeholder: "What changed before resubmission?", onChange: (event) => setReason(event.target.value) })
4714
5361
  ] }),
4715
- /* @__PURE__ */ jsxs10("div", { className: "mb-lifecycle-panel-actions", children: [
4716
- /* @__PURE__ */ jsx10("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
4717
- /* @__PURE__ */ jsx10("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" })
4718
- ] })
5362
+ /* @__PURE__ */ jsx13(
5363
+ BillSubmissionForm,
5364
+ {
5365
+ initialBill: correctionInitialBill,
5366
+ attachments: correctionAttachments,
5367
+ onSubmit: submitCorrection,
5368
+ onSearchClaimsAdministrators: lifecycle.searchClaimsAdministrators,
5369
+ attentionFields: correctionAttentionFields,
5370
+ attentionMessage: correctionAttentionFields.length ? "The rejected response points to the highlighted fields. Confirm every required value before resubmitting." : "Confirm the bill information below before resubmitting.",
5371
+ submitLabel: lifecycle.isMutating ? "Resubmitting\u2026" : "Resubmit bill",
5372
+ heading: "Corrected bill information",
5373
+ description: "The original submission stays unchanged. This form creates the next submission attempt.",
5374
+ disabled: lifecycle.isMutating,
5375
+ ...options.getSession ? { getSession: options.getSession } : {},
5376
+ ...options.sessionEndpoint ? { sessionEndpoint: options.sessionEndpoint } : {},
5377
+ ...options.apiBaseUrl ? { apiBaseUrl: options.apiBaseUrl } : {},
5378
+ ...options.fetch ? { fetch: options.fetch } : {},
5379
+ ...appearance ? { appearance } : {}
5380
+ }
5381
+ )
4719
5382
  ] }) }) : null,
4720
- panel === "second_review" ? /* @__PURE__ */ jsx10(LifecycleDialog, { title: "Submit Second Review", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs10("section", { className: "mb-lifecycle-panel", children: [
4721
- /* @__PURE__ */ jsxs10("div", { children: [
4722
- /* @__PURE__ */ jsx10("h3", { children: "Submit Second Review" }),
4723
- /* @__PURE__ */ jsx10("p", { children: "Explain the dispute and include the payer control number and supporting documents." })
5383
+ panel === "second_review" ? /* @__PURE__ */ jsx13(LifecycleDialog, { title: "Submit Second Review", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs13("section", { className: "mb-lifecycle-panel", children: [
5384
+ /* @__PURE__ */ jsxs13("div", { children: [
5385
+ /* @__PURE__ */ jsx13("h3", { children: "Submit Second Review" }),
5386
+ /* @__PURE__ */ jsx13("p", { children: "Explain the dispute and include the payer control number and supporting documents." })
4724
5387
  ] }),
4725
- /* @__PURE__ */ jsxs10("div", { className: "mb-lifecycle-fields two", children: [
4726
- /* @__PURE__ */ jsxs10("label", { className: "full", children: [
4727
- /* @__PURE__ */ jsx10("span", { children: "Reason" }),
4728
- /* @__PURE__ */ jsx10("textarea", { required: true, value: review.reason, onChange: (event) => setReview((current) => ({ ...current, reason: event.target.value })) })
5388
+ /* @__PURE__ */ jsxs13("div", { className: "mb-lifecycle-fields two", children: [
5389
+ /* @__PURE__ */ jsxs13("label", { className: "full", children: [
5390
+ /* @__PURE__ */ jsx13("span", { children: "Reason" }),
5391
+ /* @__PURE__ */ jsx13("textarea", { required: true, value: review.reason, onChange: (event) => setReview((current) => ({ ...current, reason: event.target.value })) })
4729
5392
  ] }),
4730
- /* @__PURE__ */ jsxs10("label", { children: [
4731
- /* @__PURE__ */ jsx10("span", { children: "Payer claim control number" }),
4732
- /* @__PURE__ */ jsx10("input", { required: true, value: review.payerClaimControlNumber, onChange: (event) => setReview((current) => ({ ...current, payerClaimControlNumber: event.target.value })) })
5393
+ /* @__PURE__ */ jsxs13("label", { children: [
5394
+ /* @__PURE__ */ jsx13("span", { children: "Payer claim control number" }),
5395
+ /* @__PURE__ */ jsx13("input", { required: true, value: review.payerClaimControlNumber, onChange: (event) => setReview((current) => ({ ...current, payerClaimControlNumber: event.target.value })) })
4733
5396
  ] }),
4734
- /* @__PURE__ */ jsxs10("label", { children: [
4735
- /* @__PURE__ */ jsx10("span", { children: "Disputed amount" }),
4736
- /* @__PURE__ */ jsx10("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 })) })
5397
+ /* @__PURE__ */ jsxs13("label", { children: [
5398
+ /* @__PURE__ */ jsx13("span", { children: "Disputed amount" }),
5399
+ /* @__PURE__ */ jsx13("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 })) })
4737
5400
  ] }),
4738
- /* @__PURE__ */ jsxs10("label", { children: [
4739
- /* @__PURE__ */ jsx10("span", { children: "Send via" }),
4740
- /* @__PURE__ */ jsxs10("select", { value: review.route, onChange: (event) => setReview((current) => ({ ...current, route: event.target.value })), children: [
4741
- /* @__PURE__ */ jsx10("option", { value: "ebill", children: "E-bill" }),
4742
- /* @__PURE__ */ jsx10("option", { value: "fax", children: "Fax" }),
4743
- /* @__PURE__ */ jsx10("option", { value: "mail", children: "Mail" }),
4744
- /* @__PURE__ */ jsx10("option", { value: "email", children: "Email" })
5401
+ /* @__PURE__ */ jsxs13("label", { children: [
5402
+ /* @__PURE__ */ jsx13("span", { children: "Send via" }),
5403
+ /* @__PURE__ */ jsxs13("select", { value: review.route, onChange: (event) => setReview((current) => ({ ...current, route: event.target.value })), children: [
5404
+ /* @__PURE__ */ jsx13("option", { value: "ebill", children: "E-bill" }),
5405
+ /* @__PURE__ */ jsx13("option", { value: "fax", children: "Fax" }),
5406
+ /* @__PURE__ */ jsx13("option", { value: "mail", children: "Mail" }),
5407
+ /* @__PURE__ */ jsx13("option", { value: "email", children: "Email" })
4745
5408
  ] })
4746
5409
  ] })
4747
5410
  ] }),
4748
- /* @__PURE__ */ jsxs10("fieldset", { className: "mb-lifecycle-packet", children: [
4749
- /* @__PURE__ */ jsx10("legend", { children: "Supporting packet" }),
4750
- data.bill.attachments.map((attachment) => /* @__PURE__ */ jsxs10("label", { children: [
4751
- /* @__PURE__ */ jsx10("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) })) }),
4752
- /* @__PURE__ */ jsxs10("span", { children: [
4753
- /* @__PURE__ */ jsx10("strong", { children: attachment.filename }),
4754
- /* @__PURE__ */ jsx10("small", { children: attachment.description || attachment.documentType })
5411
+ /* @__PURE__ */ jsxs13("fieldset", { className: "mb-lifecycle-packet", children: [
5412
+ /* @__PURE__ */ jsx13("legend", { children: "Supporting packet" }),
5413
+ data.bill.attachments.map((attachment) => /* @__PURE__ */ jsxs13("label", { children: [
5414
+ /* @__PURE__ */ jsx13("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) })) }),
5415
+ /* @__PURE__ */ jsxs13("span", { children: [
5416
+ /* @__PURE__ */ jsx13("strong", { children: attachment.filename }),
5417
+ /* @__PURE__ */ jsx13("small", { children: attachment.description || attachment.documentType })
4755
5418
  ] }),
4756
- /* @__PURE__ */ jsx10("button", { type: "button", onClick: () => void lifecycle.openAttachment(attachment).catch(() => void 0), children: "View" })
5419
+ /* @__PURE__ */ jsx13("button", { type: "button", onClick: () => void lifecycle.openAttachment(attachment).catch(() => void 0), children: "View" })
4757
5420
  ] }, attachment.id))
4758
5421
  ] }),
4759
- /* @__PURE__ */ jsxs10("div", { className: "mb-lifecycle-panel-actions", children: [
4760
- /* @__PURE__ */ jsx10("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
4761
- /* @__PURE__ */ jsx10("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" })
5422
+ /* @__PURE__ */ jsxs13("div", { className: "mb-lifecycle-panel-actions", children: [
5423
+ /* @__PURE__ */ jsx13("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
5424
+ /* @__PURE__ */ jsx13("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" })
4762
5425
  ] })
4763
5426
  ] }) }) : null,
4764
- panel === "payment" ? /* @__PURE__ */ jsx10(LifecycleDialog, { title: "Post payment", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs10("section", { className: "mb-lifecycle-panel", children: [
4765
- /* @__PURE__ */ jsxs10("div", { children: [
4766
- /* @__PURE__ */ jsx10("h3", { children: "Post payment" }),
4767
- /* @__PURE__ */ jsx10("p", { children: "Record a full or partial payment, plus any penalty and interest received." })
5427
+ panel === "payment" ? /* @__PURE__ */ jsx13(LifecycleDialog, { title: "Post payment", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs13("section", { className: "mb-lifecycle-panel", children: [
5428
+ /* @__PURE__ */ jsxs13("div", { children: [
5429
+ /* @__PURE__ */ jsx13("h3", { children: "Post payment" }),
5430
+ /* @__PURE__ */ jsx13("p", { children: "Record a full or partial payment, plus any penalty and interest received." })
4768
5431
  ] }),
4769
- /* @__PURE__ */ jsxs10("div", { className: "mb-lifecycle-fields two", children: [
4770
- /* @__PURE__ */ jsxs10("label", { children: [
4771
- /* @__PURE__ */ jsx10("span", { children: "Amount applied to bill" }),
4772
- /* @__PURE__ */ jsx10("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) })) })
5432
+ /* @__PURE__ */ jsxs13("div", { className: "mb-lifecycle-fields two", children: [
5433
+ /* @__PURE__ */ jsxs13("label", { children: [
5434
+ /* @__PURE__ */ jsx13("span", { children: "Amount applied to bill" }),
5435
+ /* @__PURE__ */ jsx13("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) })) })
4773
5436
  ] }),
4774
- /* @__PURE__ */ jsxs10("label", { children: [
4775
- /* @__PURE__ */ jsx10("span", { children: "Penalty" }),
4776
- /* @__PURE__ */ jsx10("input", { type: "number", min: "0", step: "0.01", value: payment.penaltyAmount || "", placeholder: "0.00", onChange: (event) => setPayment((current) => ({ ...current, penaltyAmount: Number(event.target.value) })) })
5437
+ /* @__PURE__ */ jsxs13("label", { children: [
5438
+ /* @__PURE__ */ jsx13("span", { children: "Penalty" }),
5439
+ /* @__PURE__ */ jsx13("input", { type: "number", min: "0", step: "0.01", value: payment.penaltyAmount || "", placeholder: "0.00", onChange: (event) => setPayment((current) => ({ ...current, penaltyAmount: Number(event.target.value) })) })
4777
5440
  ] }),
4778
- /* @__PURE__ */ jsxs10("label", { children: [
4779
- /* @__PURE__ */ jsx10("span", { children: "Interest" }),
4780
- /* @__PURE__ */ jsx10("input", { type: "number", min: "0", step: "0.01", value: payment.interestAmount || "", placeholder: "0.00", onChange: (event) => setPayment((current) => ({ ...current, interestAmount: Number(event.target.value) })) })
5441
+ /* @__PURE__ */ jsxs13("label", { children: [
5442
+ /* @__PURE__ */ jsx13("span", { children: "Interest" }),
5443
+ /* @__PURE__ */ jsx13("input", { type: "number", min: "0", step: "0.01", value: payment.interestAmount || "", placeholder: "0.00", onChange: (event) => setPayment((current) => ({ ...current, interestAmount: Number(event.target.value) })) })
4781
5444
  ] }),
4782
- /* @__PURE__ */ jsxs10("label", { children: [
4783
- /* @__PURE__ */ jsx10("span", { children: "Method" }),
4784
- /* @__PURE__ */ jsxs10("select", { value: payment.method, onChange: (event) => setPayment((current) => ({ ...current, method: event.target.value })), children: [
4785
- /* @__PURE__ */ jsx10("option", { value: "check", children: "Check" }),
4786
- /* @__PURE__ */ jsx10("option", { value: "eft", children: "EFT" })
5445
+ /* @__PURE__ */ jsxs13("label", { children: [
5446
+ /* @__PURE__ */ jsx13("span", { children: "Method" }),
5447
+ /* @__PURE__ */ jsxs13("select", { value: payment.method, onChange: (event) => setPayment((current) => ({ ...current, method: event.target.value })), children: [
5448
+ /* @__PURE__ */ jsx13("option", { value: "check", children: "Check" }),
5449
+ /* @__PURE__ */ jsx13("option", { value: "eft", children: "EFT" })
4787
5450
  ] })
4788
5451
  ] }),
4789
- /* @__PURE__ */ jsxs10("label", { children: [
4790
- /* @__PURE__ */ jsx10("span", { children: payment.method === "check" ? "Check number" : "EFT reference" }),
4791
- /* @__PURE__ */ jsx10("input", { value: payment.checkNumber, onChange: (event) => setPayment((current) => ({ ...current, checkNumber: event.target.value })) })
5452
+ /* @__PURE__ */ jsxs13("label", { children: [
5453
+ /* @__PURE__ */ jsx13("span", { children: payment.method === "check" ? "Check number" : "EFT reference" }),
5454
+ /* @__PURE__ */ jsx13("input", { value: payment.checkNumber, onChange: (event) => setPayment((current) => ({ ...current, checkNumber: event.target.value })) })
4792
5455
  ] }),
4793
- /* @__PURE__ */ jsxs10("label", { children: [
4794
- /* @__PURE__ */ jsx10("span", { children: "Deposit date" }),
4795
- /* @__PURE__ */ jsx10("input", { required: true, value: payment.depositDate, placeholder: "MM/DD/YYYY", onChange: (event) => setPayment((current) => ({ ...current, depositDate: event.target.value })) })
5456
+ /* @__PURE__ */ jsxs13("label", { children: [
5457
+ /* @__PURE__ */ jsx13("span", { children: "Deposit date" }),
5458
+ /* @__PURE__ */ jsx13("input", { required: true, value: payment.depositDate, placeholder: "MM/DD/YYYY", onChange: (event) => setPayment((current) => ({ ...current, depositDate: event.target.value })) })
4796
5459
  ] }),
4797
- /* @__PURE__ */ jsxs10("label", { className: "full", children: [
4798
- /* @__PURE__ */ jsx10("span", { children: "Note (optional)" }),
4799
- /* @__PURE__ */ jsx10("input", { value: payment.note, onChange: (event) => setPayment((current) => ({ ...current, note: event.target.value })) })
5460
+ /* @__PURE__ */ jsxs13("label", { className: "full", children: [
5461
+ /* @__PURE__ */ jsx13("span", { children: "Note (optional)" }),
5462
+ /* @__PURE__ */ jsx13("input", { value: payment.note, onChange: (event) => setPayment((current) => ({ ...current, note: event.target.value })) })
4800
5463
  ] })
4801
5464
  ] }),
4802
- /* @__PURE__ */ jsxs10("div", { className: "mb-payment-total", children: [
4803
- /* @__PURE__ */ jsx10("span", { children: "Total received" }),
4804
- /* @__PURE__ */ jsx10("strong", { children: new Intl.NumberFormat(void 0, { style: "currency", currency: "USD" }).format(payment.amount + (payment.penaltyAmount ?? 0) + (payment.interestAmount ?? 0)) })
5465
+ /* @__PURE__ */ jsxs13("div", { className: "mb-payment-total", children: [
5466
+ /* @__PURE__ */ jsx13("span", { children: "Total received" }),
5467
+ /* @__PURE__ */ jsx13("strong", { children: new Intl.NumberFormat(void 0, { style: "currency", currency: "USD" }).format(payment.amount + (payment.penaltyAmount ?? 0) + (payment.interestAmount ?? 0)) })
4805
5468
  ] }),
4806
- /* @__PURE__ */ jsxs10("div", { className: "mb-lifecycle-panel-actions", children: [
4807
- /* @__PURE__ */ jsx10("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
4808
- /* @__PURE__ */ jsx10("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" })
5469
+ /* @__PURE__ */ jsxs13("div", { className: "mb-lifecycle-panel-actions", children: [
5470
+ /* @__PURE__ */ jsx13("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
5471
+ /* @__PURE__ */ jsx13("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" })
4809
5472
  ] })
4810
5473
  ] }) }) : null,
4811
- panel === "close" || panel === "reopen" ? /* @__PURE__ */ jsx10(LifecycleDialog, { title: panel === "close" ? "Close bill" : "Reopen bill", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs10("section", { className: "mb-lifecycle-panel", children: [
4812
- /* @__PURE__ */ jsxs10("div", { children: [
4813
- /* @__PURE__ */ jsx10("h3", { children: panel === "close" ? "Close bill" : "Reopen bill" }),
4814
- /* @__PURE__ */ jsx10("p", { children: panel === "close" ? "The immutable submission and history remain available." : "Return this bill to active follow-up without changing the submitted snapshot." })
5474
+ panel === "close" || panel === "reopen" ? /* @__PURE__ */ jsx13(LifecycleDialog, { title: panel === "close" ? "Close bill" : "Reopen bill", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs13("section", { className: "mb-lifecycle-panel", children: [
5475
+ /* @__PURE__ */ jsxs13("div", { children: [
5476
+ /* @__PURE__ */ jsx13("h3", { children: panel === "close" ? "Close bill" : "Reopen bill" }),
5477
+ /* @__PURE__ */ jsx13("p", { children: panel === "close" ? "The immutable submission and history remain available." : "Return this bill to active follow-up without changing the submitted snapshot." })
4815
5478
  ] }),
4816
- /* @__PURE__ */ jsxs10("label", { children: [
4817
- /* @__PURE__ */ jsx10("span", { children: "Reason" }),
4818
- /* @__PURE__ */ jsx10("textarea", { required: true, value: reason, onChange: (event) => setReason(event.target.value) })
5479
+ /* @__PURE__ */ jsxs13("label", { children: [
5480
+ /* @__PURE__ */ jsx13("span", { children: "Reason" }),
5481
+ /* @__PURE__ */ jsx13("textarea", { required: true, value: reason, onChange: (event) => setReason(event.target.value) })
4819
5482
  ] }),
4820
- /* @__PURE__ */ jsxs10("div", { className: "mb-lifecycle-panel-actions", children: [
4821
- /* @__PURE__ */ jsx10("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
4822
- /* @__PURE__ */ jsx10("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" })
5483
+ /* @__PURE__ */ jsxs13("div", { className: "mb-lifecycle-panel-actions", children: [
5484
+ /* @__PURE__ */ jsx13("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
5485
+ /* @__PURE__ */ jsx13("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" })
4823
5486
  ] })
4824
5487
  ] }) }) : null,
4825
- notice ? /* @__PURE__ */ jsx10("div", { className: "mb-lifecycle-message success", role: "status", children: notice }) : null,
4826
- lifecycle.error ? /* @__PURE__ */ jsx10("div", { className: "mb-lifecycle-message error", role: "alert", children: lifecycle.error.message }) : null
5488
+ notice ? /* @__PURE__ */ jsx13("div", { className: "mb-lifecycle-message success", role: "status", children: notice }) : null,
5489
+ lifecycle.error ? /* @__PURE__ */ jsx13("div", { className: "mb-lifecycle-message error", role: "alert", children: lifecycle.error.message }) : null
4827
5490
  ] });
4828
5491
  }
4829
5492
  var CONNECTED_LIFECYCLE_STYLES = `
4830
5493
  .mb-lifecycle-simulator{display:grid;gap:14px;padding:18px;border:1px solid #b8dadd;border-radius:var(--mb-radius,14px);background:#f2fbfb}.mb-lifecycle-simulator>div:first-child>span{color:var(--mb-accent);font-size:.72rem;font-weight:850;letter-spacing:.09em;text-transform:uppercase}.mb-lifecycle-simulator h3{margin:3px 0 0;font-size:1.05rem}.mb-lifecycle-simulator p{margin:4px 0 0;color:var(--mb-muted)}.mb-lifecycle-simulator-actions{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px}.mb-lifecycle-simulator-actions button{min-height:76px;border:1px solid #a9cccf;border-radius:10px;background:var(--mb-surface);color:var(--mb-text);cursor:pointer;padding:12px 14px;text-align:left;font:inherit}.mb-lifecycle-simulator-actions button:hover{border-color:var(--mb-accent);box-shadow:0 3px 14px rgba(23,108,112,.1)}.mb-lifecycle-simulator-actions button:disabled{cursor:not-allowed;opacity:.55}.mb-lifecycle-simulator-actions button strong,.mb-lifecycle-simulator-actions button span{display:block}.mb-lifecycle-simulator-actions button span{margin-top:3px;color:var(--mb-muted);font-size:.83rem}.mb-lifecycle-simulator-idle{padding:10px 12px;border-radius:8px;background:rgba(255,255,255,.72)}
4831
5494
  .mb-connected-lifecycle{--mb-accent:#176c70;--mb-text:#17282d;--mb-muted:#607176;--mb-border:#d7e0df;--mb-soft:#f4f7f6;--mb-surface:#fff;display:grid;gap:18px;color:var(--mb-text);font:14px/1.45 var(--mb-font,Inter,ui-sans-serif,system-ui,sans-serif)}.mb-connected-lifecycle *{box-sizing:border-box}.mb-lifecycle-head{display:flex;align-items:center;justify-content:space-between;gap:20px}.mb-lifecycle-title{display:flex;align-items:center;flex-wrap:wrap;gap:10px}.mb-lifecycle-title h2{margin:0;font-size:1.7rem}.mb-lifecycle-head p{margin:3px 0 0;color:var(--mb-muted)}.mb-lifecycle-tabs{display:grid;grid-template-columns:1fr 1fr;border:1px solid var(--mb-border);border-radius:12px;background:var(--mb-surface);padding:6px}.mb-lifecycle-tabs button{min-height:46px;border:0;border-radius:8px;background:transparent;color:var(--mb-muted);font:inherit;font-size:1rem;font-weight:750;cursor:pointer}.mb-lifecycle-tabs button[aria-selected=true]{background:var(--mb-accent);color:white}.mb-lifecycle-tabpanel{display:grid;gap:18px}.mb-lifecycle-button{min-height:40px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius,8px);background:var(--mb-input,#fff);color:var(--mb-text);cursor:pointer;font:inherit;font-weight:750;padding:9px 14px}.mb-lifecycle-button.primary{border-color:var(--mb-accent);background:var(--mb-accent);color:var(--mb-accent-contrast,#fff)}.mb-lifecycle-button:disabled{cursor:not-allowed;opacity:.5}.mb-lifecycle-actions-sheet{position:sticky;bottom:12px;z-index:24;display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:9px;padding:10px;border:1px solid var(--mb-border);border-radius:12px;background:color-mix(in srgb,var(--mb-surface) 94%,transparent);box-shadow:0 10px 34px rgba(18,35,43,.16);backdrop-filter:blur(12px)}.mb-lifecycle-card,.mb-lifecycle-panel{padding:20px;border:1px solid var(--mb-border);border-radius:var(--mb-radius,14px);background:var(--mb-surface)}.mb-lifecycle-card header{display:flex;align-items:center;justify-content:space-between;gap:20px}.mb-lifecycle-card h3,.mb-lifecycle-panel h3{margin:0;font-size:1.08rem}.mb-lifecycle-card p,.mb-lifecycle-panel p{margin:3px 0 0;color:var(--mb-muted)}.mb-lifecycle-card header>span{display:grid;place-items:center;min-width:28px;height:28px;border-radius:999px;background:var(--mb-soft);font-weight:750}.mb-lifecycle-documents{list-style:none;margin:14px 0 0;padding:0}.mb-lifecycle-documents li{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px 0;border-top:1px solid var(--mb-border)}.mb-lifecycle-documents li>div{display:grid;gap:3px;min-width:0}.mb-lifecycle-documents li span{color:var(--mb-muted);font-size:.85rem}.mb-lifecycle-dialog-backdrop{position:fixed;z-index:2147483000;inset:0;display:grid;place-items:center;padding:20px;background:rgba(18,35,43,.56);backdrop-filter:blur(3px)}.mb-lifecycle-dialog{position:relative;width:min(760px,100%);max-height:calc(100vh - 40px);overflow:auto;outline:0}.mb-lifecycle-dialog-close{position:absolute;z-index:1;top:12px;right:12px;width:34px;height:34px;border:1px solid var(--mb-border);border-radius:8px;background:var(--mb-surface);color:var(--mb-text);cursor:pointer;font:22px/1 inherit}.mb-lifecycle-panel{display:grid;gap:17px;padding-top:24px;box-shadow:0 24px 70px rgba(18,35,43,.22)}.mb-lifecycle-panel label{display:grid;gap:6px;font-size:.85rem;font-weight:750}.mb-lifecycle-panel label small{color:var(--mb-muted);font-weight:500}.mb-lifecycle-panel input,.mb-lifecycle-panel select,.mb-lifecycle-panel textarea{width:100%;min-height:44px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius,8px);background:var(--mb-input,#fff);color:var(--mb-text);font:inherit;padding:10px 12px}.mb-lifecycle-panel textarea{min-height:100px;resize:vertical}.mb-lifecycle-fields{display:grid;gap:13px}.mb-lifecycle-fields.two{grid-template-columns:repeat(2,minmax(0,1fr))}.mb-lifecycle-fields .full{grid-column:1/-1}.mb-lifecycle-panel-actions{display:flex;justify-content:flex-end;gap:8px}.mb-lifecycle-packet{display:grid;gap:0;margin:0;padding:0;border:0}.mb-lifecycle-packet legend{margin-bottom:7px;font-size:.85rem;font-weight:800}.mb-lifecycle-packet>label{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:10px;padding:10px 2px;border-top:1px solid var(--mb-border)}.mb-lifecycle-packet>label>input{width:16px;min-height:16px}.mb-lifecycle-packet>label>span{display:grid}.mb-lifecycle-packet button{border:0;background:transparent;color:var(--mb-accent);cursor:pointer;font:inherit}.mb-lifecycle-message,.mb-lifecycle-error,.mb-lifecycle-loading{padding:12px 14px;border-radius:9px}.mb-lifecycle-message.success{background:#edf9f2;color:#217449}.mb-lifecycle-message.error,.mb-lifecycle-error{background:#fff0ef;color:#9d3029}.mb-lifecycle-error{display:flex;align-items:center;gap:12px}.mb-lifecycle-error span{flex:1}.mb-lifecycle-error button{border:1px solid currentColor;border-radius:7px;background:transparent;color:inherit;padding:7px 10px}
5495
+ .mb-lifecycle-dialog.wide{width:min(1280px,100%)}.mb-lifecycle-correction{display:grid;gap:16px;padding:22px;border-radius:var(--mb-radius,14px);background:var(--mb-surface);box-shadow:0 24px 70px rgba(18,35,43,.22)}.mb-lifecycle-correction>header{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding-right:42px}.mb-lifecycle-correction h3{margin:0;font-size:1.2rem}.mb-lifecycle-correction header p{margin:4px 0 0;color:var(--mb-muted)}.mb-lifecycle-correction-reason,.mb-lifecycle-correction-contact{display:grid;gap:4px;padding:13px 15px;border-radius:10px}.mb-lifecycle-correction-reason{border-left:4px solid #c5443f;background:#fff2f1;color:#812d29}.mb-lifecycle-correction-contact{border:1px solid color-mix(in srgb,var(--mb-accent) 35%,var(--mb-border));background:color-mix(in srgb,var(--mb-accent) 7%,var(--mb-surface))}.mb-lifecycle-correction-note{display:grid;gap:6px;font-size:.85rem;font-weight:750}.mb-lifecycle-correction-note textarea{min-height:76px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius,8px);background:var(--mb-input,#fff);color:var(--mb-text);font:inherit;padding:10px 12px;resize:vertical}
4832
5496
  .mb-payment-total{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;border-radius:9px;background:var(--mb-soft)}.mb-payment-total strong{font-size:1.12rem}
4833
- @media(max-width:700px){.mb-lifecycle-head,.mb-lifecycle-card header{align-items:stretch;flex-direction:column}.mb-lifecycle-head>.mb-lifecycle-button{width:100%}.mb-lifecycle-actions-sheet{bottom:calc(var(--mb-host-bottom-offset,72px) + env(safe-area-inset-bottom) + 8px);grid-template-columns:repeat(2,minmax(0,1fr))}.mb-lifecycle-actions-sheet .mb-lifecycle-button:last-child:nth-child(odd){grid-column:1/-1}.mb-lifecycle-fields.two{grid-template-columns:1fr}.mb-lifecycle-fields .full{grid-column:auto}.mb-lifecycle-dialog-backdrop{align-items:end;padding:0}.mb-lifecycle-dialog{max-height:92vh}.mb-lifecycle-dialog .mb-lifecycle-panel{border-radius:18px 18px 0 0}.mb-lifecycle-tabs button{font-size:.9rem}.mb-lifecycle-title h2{font-size:1.4rem}}
5497
+ @media(max-width:700px){.mb-lifecycle-head,.mb-lifecycle-card header{align-items:stretch;flex-direction:column}.mb-lifecycle-head>.mb-lifecycle-button{width:100%}.mb-lifecycle-actions-sheet{bottom:calc(var(--mb-host-bottom-offset,72px) + env(safe-area-inset-bottom) + 8px);grid-template-columns:repeat(2,minmax(0,1fr))}.mb-lifecycle-actions-sheet .mb-lifecycle-button:last-child:nth-child(odd){grid-column:1/-1}.mb-lifecycle-fields.two{grid-template-columns:1fr}.mb-lifecycle-fields .full{grid-column:auto}.mb-lifecycle-dialog-backdrop{align-items:end;padding:0}.mb-lifecycle-dialog{max-height:96vh}.mb-lifecycle-dialog .mb-lifecycle-panel,.mb-lifecycle-correction{border-radius:18px 18px 0 0}.mb-lifecycle-correction{padding:18px 12px}.mb-lifecycle-correction>header{align-items:stretch;flex-direction:column;padding-right:42px}.mb-lifecycle-tabs button{font-size:.9rem}.mb-lifecycle-title h2{font-size:1.4rem}}
4834
5498
  `;
4835
5499
 
4836
5500
  // src/index.tsx
4837
5501
  function widget(tagName, props) {
4838
5502
  const ref = useRef6(null);
4839
5503
  const { onMindBill, onMindBillError } = props;
4840
- useEffect8(() => {
5504
+ useEffect9(() => {
4841
5505
  const element = ref.current;
4842
5506
  if (!element) return;
4843
5507
  const handleEvent = (event) => onMindBill?.(event);
@@ -4879,6 +5543,7 @@ export {
4879
5543
  BILL_SUBMISSION_DOCUMENT_TYPES,
4880
5544
  BILL_SUBMISSION_REPORT_TYPES,
4881
5545
  BILL_SUBMISSION_REQUIRED_FIELDS,
5546
+ BILL_TASKS_AGING_BUCKETS2 as BILL_TASKS_AGING_BUCKETS,
4882
5547
  BillActivityTimeline,
4883
5548
  BillAgingSummary,
4884
5549
  BillExplanationOfReview,
@@ -4903,6 +5568,8 @@ export {
4903
5568
  BillSubmissionPatientSection,
4904
5569
  BillSubmissionProvidersSection,
4905
5570
  BillSubmissionServiceLinesSection,
5571
+ BillSubmissionsRibbon,
5572
+ BillTasksDashboard,
4906
5573
  BillingDashboard,
4907
5574
  BillingReport,
4908
5575
  BillingSettings,
@@ -4916,6 +5583,8 @@ export {
4916
5583
  MindBillBillTimeline,
4917
5584
  OrganizationOnboarding,
4918
5585
  PSYCH_QME_DEFAULT_DIAGNOSIS,
5586
+ REPORT_BILL_STATUS_OPTIONS,
5587
+ ReportBillStatusDialog,
4919
5588
  SendRouteDialog,
4920
5589
  applyBillSubmissionEvaluationDiagnoses,
4921
5590
  applyBillSubmissionEvaluationModifiers,
@@ -4924,9 +5593,13 @@ export {
4924
5593
  billAgingDays,
4925
5594
  billLifecycleDisplayLabel,
4926
5595
  billLifecycleStage,
5596
+ billSubmissionsRibbonDeliveryLabel,
5597
+ billSubmissionsRibbonFromHistory,
5598
+ billTasksAgingBucketIndex,
4927
5599
  buildBillReviewSaveInput,
4928
5600
  buildBillStatusAgingCsv,
4929
5601
  buildBillStatusAgingMatrix,
5602
+ buildBillTasksDashboard,
4930
5603
  buildBillingReportCsv,
4931
5604
  buildBillingReportRows,
4932
5605
  calculateBillSubmissionAllowedAmount,