@mindbill/react 0.24.0 → 0.26.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 useEffect5, useRef as useRef5 } from "react";
5
+ import { createElement, useEffect as useEffect6, useRef as useRef5 } from "react";
6
6
 
7
7
  // src/appearance.ts
8
8
  var mindBillThemePresets = {
@@ -1044,6 +1044,7 @@ var NATIVE_THEME_OVERRIDE_STYLES = `
1044
1044
  `;
1045
1045
 
1046
1046
  // src/bill-read-only-form.tsx
1047
+ import { useEffect as useEffect2, useState as useState2 } from "react";
1047
1048
  import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
1048
1049
  function money2(value) {
1049
1050
  return new Intl.NumberFormat(void 0, { style: "currency", currency: "USD" }).format(value);
@@ -1060,13 +1061,25 @@ function Value({ label, children, wide = false }) {
1060
1061
  ] });
1061
1062
  }
1062
1063
  function BillReadOnlyForm({ data, appearance, className, style, onOpenAttachment }) {
1064
+ const [payerOpen, setPayerOpen] = useState2(false);
1063
1065
  const { bill, patient, injury } = data;
1064
1066
  const provider = bill.billingSnapshot?.billingProvider;
1065
1067
  const clinician = bill.billingSnapshot?.renderingProvider;
1066
1068
  const location = bill.billingSnapshot?.placeOfService;
1067
1069
  const address = patient.address;
1068
1070
  const patientAddress = [address?.line1, address?.city, address?.state, address?.postalCode].filter(Boolean).join(", ");
1071
+ const billingAddress = provider ? [provider.billingStreet, provider.billingCity, provider.billingState, provider.billingZip].filter(Boolean).join(", ") : "";
1069
1072
  const locationAddress = location ? [location.street, location.city, location.state, location.zip].filter(Boolean).join(", ") : "";
1073
+ const payerName = data.delivery?.payerName || injury.claimsAdminName || "\u2014";
1074
+ const contacts = data.delivery?.contacts;
1075
+ useEffect2(() => {
1076
+ if (!payerOpen) return;
1077
+ const close = (event) => {
1078
+ if (event.key === "Escape") setPayerOpen(false);
1079
+ };
1080
+ window.addEventListener("keydown", close);
1081
+ return () => window.removeEventListener("keydown", close);
1082
+ }, [payerOpen]);
1070
1083
  return /* @__PURE__ */ jsxs2("section", { className: ["mb-readonly-bill", className].filter(Boolean).join(" "), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill details", children: [
1071
1084
  /* @__PURE__ */ jsx2("style", { children: READ_ONLY_STYLES }),
1072
1085
  /* @__PURE__ */ jsxs2("header", { className: "mb-readonly-heading", children: [
@@ -1090,7 +1103,7 @@ function BillReadOnlyForm({ data, appearance, className, style, onOpenAttachment
1090
1103
  /* @__PURE__ */ jsxs2("dl", { className: "mb-read-grid", children: [
1091
1104
  /* @__PURE__ */ jsx2(Value, { label: "Claim number", children: injury.claimNumber }),
1092
1105
  /* @__PURE__ */ jsx2(Value, { label: "WCAB / ADJ number", children: injury.adjNumber }),
1093
- /* @__PURE__ */ jsx2(Value, { label: "Claims administrator", children: injury.claimsAdminName }),
1106
+ /* @__PURE__ */ jsx2(Value, { label: "Claims administrator", children: /* @__PURE__ */ jsx2("button", { type: "button", className: "mb-read-payer", onClick: () => setPayerOpen(true), children: payerName }) }),
1094
1107
  /* @__PURE__ */ jsx2(Value, { label: "Employer", children: injury.employer }),
1095
1108
  /* @__PURE__ */ jsx2(Value, { label: "Date of injury", children: date(injury.doi) }),
1096
1109
  /* @__PURE__ */ jsx2(Value, { label: "Date of service", children: bill.dosEnd ? `${date(bill.dos)} \u2013 ${date(bill.dosEnd)}` : date(bill.dos) }),
@@ -1103,10 +1116,13 @@ function BillReadOnlyForm({ data, appearance, className, style, onOpenAttachment
1103
1116
  /* @__PURE__ */ jsxs2("dl", { className: "mb-read-grid", children: [
1104
1117
  /* @__PURE__ */ jsx2(Value, { label: "Billing provider", children: provider?.name }),
1105
1118
  /* @__PURE__ */ jsx2(Value, { label: "Billing NPI", children: provider?.npi }),
1119
+ /* @__PURE__ */ jsx2(Value, { label: "Billing tax ID", children: provider?.taxId }),
1120
+ /* @__PURE__ */ jsx2(Value, { label: "Billing phone", children: provider?.phone }),
1121
+ /* @__PURE__ */ jsx2(Value, { label: "Billing address", wide: true, children: billingAddress }),
1106
1122
  /* @__PURE__ */ jsx2(Value, { label: "Rendering provider", children: clinician?.name }),
1107
1123
  /* @__PURE__ */ jsx2(Value, { label: "Rendering NPI", children: clinician?.npi }),
1108
- /* @__PURE__ */ jsx2(Value, { label: "Specialty", children: clinician?.specialty }),
1109
- /* @__PURE__ */ jsx2(Value, { label: "Place of service", children: location?.name }),
1124
+ /* @__PURE__ */ jsx2(Value, { label: "Rendering taxonomy", children: clinician?.taxonomy }),
1125
+ /* @__PURE__ */ jsx2(Value, { label: "Place of service code", children: location?.posCode }),
1110
1126
  /* @__PURE__ */ jsx2(Value, { label: "Service address", wide: true, children: locationAddress })
1111
1127
  ] })
1112
1128
  ] }),
@@ -1144,18 +1160,39 @@ function BillReadOnlyForm({ data, appearance, className, style, onOpenAttachment
1144
1160
  /* @__PURE__ */ jsx2("strong", { children: attachment.filename }),
1145
1161
  /* @__PURE__ */ jsx2("span", { children: attachment.description || attachment.documentType.replace(/_/g, " ") })
1146
1162
  ] }),
1147
- onOpenAttachment ? /* @__PURE__ */ jsx2("button", { type: "button", onClick: () => void onOpenAttachment(attachment), children: "View" }) : null
1163
+ onOpenAttachment ? /* @__PURE__ */ jsx2("button", { type: "button", onClick: () => void onOpenAttachment(attachment), children: "Preview" }) : null
1148
1164
  ] }, attachment.id)) }) : /* @__PURE__ */ jsx2("p", { className: "mb-read-empty", children: "No attachments." })
1149
- ] })
1165
+ ] }),
1166
+ payerOpen ? /* @__PURE__ */ jsx2("div", { className: "mb-read-dialog-backdrop", role: "presentation", onMouseDown: (event) => {
1167
+ if (event.target === event.currentTarget) setPayerOpen(false);
1168
+ }, children: /* @__PURE__ */ jsxs2("section", { className: "mb-read-dialog", role: "dialog", "aria-modal": "true", "aria-labelledby": "mb-read-payer-title", children: [
1169
+ /* @__PURE__ */ jsxs2("header", { children: [
1170
+ /* @__PURE__ */ jsxs2("div", { children: [
1171
+ /* @__PURE__ */ jsx2("span", { children: "Claims administrator" }),
1172
+ /* @__PURE__ */ jsx2("h3", { id: "mb-read-payer-title", children: payerName })
1173
+ ] }),
1174
+ /* @__PURE__ */ jsx2("button", { type: "button", "aria-label": "Close claims administrator details", onClick: () => setPayerOpen(false), children: "\xD7" })
1175
+ ] }),
1176
+ /* @__PURE__ */ jsxs2("dl", { className: "mb-read-contact-grid", children: [
1177
+ /* @__PURE__ */ jsx2(Value, { label: "Adjuster", children: contacts?.adjusterName }),
1178
+ /* @__PURE__ */ jsx2(Value, { label: "Adjuster phone", children: contacts?.adjusterPhone }),
1179
+ /* @__PURE__ */ jsx2(Value, { label: "Adjuster email", children: contacts?.adjusterEmail }),
1180
+ /* @__PURE__ */ jsx2(Value, { label: "Claims email", children: contacts?.claimsEmail }),
1181
+ /* @__PURE__ */ jsx2(Value, { label: "Fax", children: contacts?.faxNumber }),
1182
+ /* @__PURE__ */ jsx2(Value, { label: "Portal", children: contacts?.portalUrl ? /* @__PURE__ */ jsx2("a", { href: contacts.portalUrl, target: "_blank", rel: "noopener noreferrer", children: "Open payer portal" }) : "\u2014" }),
1183
+ /* @__PURE__ */ jsx2(Value, { label: "Mailing address", wide: true, children: contacts?.mailingAddress })
1184
+ ] }),
1185
+ !contacts || !Object.values(contacts).some(Boolean) ? /* @__PURE__ */ jsx2("p", { className: "mb-read-empty", children: "No contact details are available for this directory entry." }) : null
1186
+ ] }) }) : null
1150
1187
  ] });
1151
1188
  }
1152
1189
  var READ_ONLY_STYLES = `
1153
- .mb-readonly-bill{--mb-accent:#176c70;--mb-border:#d7e0df;--mb-surface:#fff;--mb-muted:#607176;color:var(--mb-text,#17282d);font:inherit;display:grid;gap:16px}.mb-readonly-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:20px}.mb-readonly-heading h2,.mb-read-card h3{margin:0}.mb-readonly-heading p{margin:4px 0 0;color:var(--mb-muted)}.mb-readonly-heading>strong{font-size:1.35rem}.mb-read-card{background:var(--mb-surface);border:1px solid var(--mb-border);border-radius:var(--mb-radius,14px);padding:20px;box-shadow:0 1px 2px rgba(15,40,45,.04)}.mb-read-card h3{font-size:1.05rem;margin-bottom:16px}.mb-read-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:17px 28px;margin:0}.mb-read-value{min-width:0}.mb-read-value.is-wide{grid-column:1/-1}.mb-read-value dt{color:var(--mb-muted);font-size:.75rem;font-weight:700;letter-spacing:.07em;text-transform:uppercase}.mb-read-value dd{font-weight:600;margin:5px 0 0;overflow-wrap:anywhere}.mb-read-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:16px}.mb-read-chips span{border:1px solid var(--mb-border);border-radius:999px;padding:3px 9px;font-size:.82rem;background:#f7f9f8}.mb-read-lines{border:1px solid var(--mb-border);border-radius:10px;overflow:hidden}.mb-read-line-header,.mb-read-line{display:grid;grid-template-columns:1.2fr 1.5fr .45fr .7fr;gap:16px;align-items:center;padding:12px 14px}.mb-read-line-header{background:#f6f8f7;color:var(--mb-muted);font-size:.75rem;font-weight:700;text-transform:uppercase}.mb-read-line{border-top:1px solid var(--mb-border)}.mb-read-line .mb-read-chips{margin:0}.mb-read-line>span:last-child,.mb-read-line>strong:last-child{text-align:right}.mb-read-total{display:flex;justify-content:flex-end;gap:24px;border-top:1px solid var(--mb-border);padding:13px 14px}.mb-read-documents{list-style:none;padding:0;margin:0;display:grid}.mb-read-documents li{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:13px 0;border-top:1px solid var(--mb-border)}.mb-read-documents li:first-child{border-top:0;padding-top:0}.mb-read-documents li:last-child{padding-bottom:0}.mb-read-documents div{display:grid;gap:3px;min-width:0}.mb-read-documents strong{overflow-wrap:anywhere}.mb-read-documents span,.mb-read-empty{color:var(--mb-muted)}.mb-read-documents button{border:1px solid var(--mb-border);border-radius:8px;background:transparent;color:inherit;padding:8px 13px;font:inherit;font-weight:650;cursor:pointer}.mb-read-documents button:hover{border-color:var(--mb-accent);color:var(--mb-accent)}
1154
- @media(max-width:700px){.mb-readonly-heading{align-items:flex-start}.mb-read-grid{grid-template-columns:1fr}.mb-read-value.is-wide{grid-column:auto}.mb-read-card{padding:16px}.mb-read-line-header{display:none}.mb-read-line{grid-template-columns:1fr auto;gap:8px}.mb-read-line>*:nth-child(2){grid-column:1/-1}.mb-read-total{justify-content:space-between}.mb-readonly-heading>strong{font-size:1.05rem}}
1190
+ .mb-readonly-bill{--mb-accent:#176c70;--mb-border:#d7e0df;--mb-surface:#fff;--mb-muted:#607176;color:var(--mb-text,#17282d);font:inherit;display:grid;gap:16px}.mb-readonly-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:20px}.mb-readonly-heading h2,.mb-read-card h3{margin:0}.mb-readonly-heading p{margin:4px 0 0;color:var(--mb-muted)}.mb-readonly-heading>strong{font-size:1.35rem}.mb-read-card{background:var(--mb-surface);border:1px solid var(--mb-border);border-radius:var(--mb-radius,14px);padding:20px;box-shadow:0 1px 2px rgba(15,40,45,.04)}.mb-read-card h3{font-size:1.05rem;margin-bottom:16px}.mb-read-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:17px 28px;margin:0}.mb-read-value{min-width:0}.mb-read-value.is-wide{grid-column:1/-1}.mb-read-value dt{color:var(--mb-muted);font-size:.75rem;font-weight:700;letter-spacing:.07em;text-transform:uppercase}.mb-read-value dd{font-weight:600;margin:5px 0 0;overflow-wrap:anywhere}.mb-read-payer{border:0;border-bottom:1px dotted currentColor;background:transparent;color:inherit;padding:0;font:inherit;font-weight:inherit;text-align:left;cursor:pointer}.mb-read-payer:hover{color:var(--mb-accent)}.mb-read-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:16px}.mb-read-chips span{border:1px solid var(--mb-border);border-radius:999px;padding:3px 9px;font-size:.82rem;background:#f7f9f8}.mb-read-lines{border:1px solid var(--mb-border);border-radius:10px;overflow:hidden}.mb-read-line-header,.mb-read-line{display:grid;grid-template-columns:1.2fr 1.5fr .45fr .7fr;gap:16px;align-items:center;padding:12px 14px}.mb-read-line-header{background:#f6f8f7;color:var(--mb-muted);font-size:.75rem;font-weight:700;text-transform:uppercase}.mb-read-line{border-top:1px solid var(--mb-border)}.mb-read-line .mb-read-chips{margin:0}.mb-read-line>span:last-child,.mb-read-line>strong:last-child{text-align:right}.mb-read-total{display:flex;justify-content:flex-end;gap:24px;border-top:1px solid var(--mb-border);padding:13px 14px}.mb-read-documents{list-style:none;padding:0;margin:0;display:grid}.mb-read-documents li{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:13px 0;border-top:1px solid var(--mb-border)}.mb-read-documents li:first-child{border-top:0;padding-top:0}.mb-read-documents li:last-child{padding-bottom:0}.mb-read-documents div{display:grid;gap:3px;min-width:0}.mb-read-documents strong{overflow-wrap:anywhere}.mb-read-documents span,.mb-read-empty{color:var(--mb-muted)}.mb-read-documents button{border:1px solid var(--mb-border);border-radius:8px;background:transparent;color:inherit;padding:8px 13px;font:inherit;font-weight:650;cursor:pointer}.mb-read-documents button:hover{border-color:var(--mb-accent);color:var(--mb-accent)}.mb-read-dialog-backdrop{position:fixed;inset:0;z-index:1000;display:grid;place-items:center;background:rgba(11,28,32,.46);padding:20px}.mb-read-dialog{width:min(620px,100%);max-height:min(760px,calc(100vh - 40px));overflow:auto;border:1px solid var(--mb-border);border-radius:var(--mb-radius,14px);background:var(--mb-surface);padding:22px;box-shadow:0 22px 70px rgba(8,25,29,.24)}.mb-read-dialog header{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:20px}.mb-read-dialog header span{color:var(--mb-muted);font-size:.75rem;font-weight:700;letter-spacing:.07em;text-transform:uppercase}.mb-read-dialog h3{margin:4px 0 0}.mb-read-dialog header button{border:0;background:transparent;color:inherit;font:inherit;font-size:1.7rem;line-height:1;cursor:pointer}.mb-read-contact-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:17px 28px;margin:0}.mb-read-contact-grid a{color:var(--mb-accent)}
1191
+ @media(max-width:700px){.mb-readonly-heading{align-items:flex-start}.mb-read-grid,.mb-read-contact-grid{grid-template-columns:1fr}.mb-read-value.is-wide{grid-column:auto}.mb-read-card{padding:16px}.mb-read-line-header{display:none}.mb-read-line{grid-template-columns:1fr auto;gap:8px}.mb-read-line>*:nth-child(2){grid-column:1/-1}.mb-read-total{justify-content:space-between}.mb-readonly-heading>strong{font-size:1.05rem}.mb-read-dialog-backdrop{place-items:end center;padding:0}.mb-read-dialog{width:100%;max-height:82vh;border-radius:18px 18px 0 0;padding:20px 18px calc(20px + env(safe-area-inset-bottom))}}
1155
1192
  `;
1156
1193
 
1157
1194
  // src/bill-submission-form.tsx
1158
- import { createContext, useCallback, useContext, useEffect as useEffect2, useMemo as useMemo2, useRef as useRef2, useState as useState2 } from "react";
1195
+ import { createContext, useCallback, useContext, useEffect as useEffect3, useMemo as useMemo2, useRef as useRef2, useState as useState3 } from "react";
1159
1196
  import {
1160
1197
  createBillReferenceClient,
1161
1198
  createBillSubmissionClient
@@ -1232,6 +1269,46 @@ var DEFAULT_BILL_SUBMISSION_MODIFIERS = [
1232
1269
  { code: "XP", description: "Separate practitioner" },
1233
1270
  { code: "XU", description: "Unusual non-overlapping service" }
1234
1271
  ];
1272
+ var DEFAULT_BILL_SUBMISSION_TAXONOMIES = [
1273
+ { code: "103G00000X", description: "Clinical Neuropsychologist" },
1274
+ { code: "103T00000X", description: "Psychologist" },
1275
+ { code: "111N00000X", description: "Chiropractor" },
1276
+ { code: "122300000X", description: "Dentist" },
1277
+ { code: "133V00000X", description: "Dietitian, Registered" },
1278
+ { code: "163W00000X", description: "Registered Nurse" },
1279
+ { code: "183500000X", description: "Pharmacist" },
1280
+ { code: "207L00000X", description: "Anesthesiology" },
1281
+ { code: "207P00000X", description: "Emergency Medicine" },
1282
+ { code: "207Q00000X", description: "Family Medicine" },
1283
+ { code: "207R00000X", description: "Internal Medicine" },
1284
+ { code: "207RC0000X", description: "Cardiovascular Disease" },
1285
+ { code: "207RN0300X", description: "Nephrology" },
1286
+ { code: "207RP1001X", description: "Pulmonary Disease" },
1287
+ { code: "207RR0500X", description: "Rheumatology" },
1288
+ { code: "207T00000X", description: "Neurological Surgery" },
1289
+ { code: "207X00000X", description: "Orthopaedic Surgery" },
1290
+ { code: "207XS0117X", description: "Orthopaedic Surgery of the Spine" },
1291
+ { code: "207Y00000X", description: "Otolaryngology" },
1292
+ { code: "208000000X", description: "Pediatrics" },
1293
+ { code: "208100000X", description: "Physical Medicine & Rehabilitation" },
1294
+ { code: "2083X0100X", description: "Occupational Medicine" },
1295
+ { code: "2084N0400X", description: "Neurology" },
1296
+ { code: "2084P0800X", description: "Psychiatry" },
1297
+ { code: "2084P0802X", description: "Addiction Psychiatry" },
1298
+ { code: "2084P0804X", description: "Child & Adolescent Psychiatry" },
1299
+ { code: "2084S0012X", description: "Sleep Medicine" },
1300
+ { code: "2085R0202X", description: "Diagnostic Radiology" },
1301
+ { code: "208600000X", description: "Surgery" },
1302
+ { code: "2086S0105X", description: "Surgery of the Hand" },
1303
+ { code: "208D00000X", description: "General Practice" },
1304
+ { code: "208M00000X", description: "Hospitalist" },
1305
+ { code: "208VP0000X", description: "Pain Medicine" },
1306
+ { code: "213E00000X", description: "Podiatrist" },
1307
+ { code: "225100000X", description: "Physical Therapist" },
1308
+ { code: "225X00000X", description: "Occupational Therapist" },
1309
+ { code: "363A00000X", description: "Physician Assistant" },
1310
+ { code: "363L00000X", description: "Nurse Practitioner" }
1311
+ ];
1235
1312
  var BILL_SUBMISSION_DIAGNOSIS_QUICK_PICKS = [
1236
1313
  { label: "Psych", code: "Z04.6", description: "General psychiatric examination requested by authority" },
1237
1314
  { label: "Back", code: "M54.50", description: "Low back pain, unspecified" },
@@ -1376,8 +1453,26 @@ var BILL_SUBMISSION_REQUIRED_FIELDS = [
1376
1453
  "patient.address.state",
1377
1454
  "patient.address.postalCode",
1378
1455
  "claim.claimNumber",
1456
+ "claim.employer",
1457
+ "claim.dateOfInjury",
1379
1458
  "claim.claimsAdministrator",
1380
1459
  "service.date",
1460
+ "billingProvider.name",
1461
+ "billingProvider.taxId",
1462
+ "billingProvider.npi",
1463
+ "billingProvider.phone",
1464
+ "billingProvider.address.line1",
1465
+ "billingProvider.address.city",
1466
+ "billingProvider.address.state",
1467
+ "billingProvider.address.postalCode",
1468
+ "renderingProvider.name",
1469
+ "renderingProvider.npi",
1470
+ "renderingProvider.taxonomy",
1471
+ "serviceLocation.placeOfServiceCode",
1472
+ "serviceLocation.address.line1",
1473
+ "serviceLocation.address.city",
1474
+ "serviceLocation.address.state",
1475
+ "serviceLocation.address.postalCode",
1381
1476
  "diagnoses[]",
1382
1477
  "serviceLines[].code",
1383
1478
  "serviceLines[].units"
@@ -1537,8 +1632,26 @@ function validateBillSubmission(bill) {
1537
1632
  required("patient.address.state", bill.patient.address.state, "Enter the patient's 2-letter state code.");
1538
1633
  required("patient.address.postalCode", bill.patient.address.postalCode, "Enter the patient's ZIP code.");
1539
1634
  required("claim.claimNumber", bill.claim.claimNumber, "Enter the claim number.");
1635
+ required("claim.employer", bill.claim.employer, "Enter the employer name.");
1636
+ required("claim.dateOfInjury", bill.claim.dateOfInjury, "Enter the date of injury.");
1540
1637
  required("claim.claimsAdministrator", bill.claim.claimsAdministrator?.name, "Select a claims administrator so MindBill can route this bill.");
1541
1638
  required("service.date", bill.service.date, "Enter the date of service.");
1639
+ required("billingProvider.name", bill.billingProvider?.name, "Enter the billing provider name.");
1640
+ required("billingProvider.taxId", bill.billingProvider?.taxId, "Enter the billing provider Tax ID (EIN or SSN).");
1641
+ required("billingProvider.npi", bill.billingProvider?.npi, "Enter the billing provider NPI.");
1642
+ required("billingProvider.phone", bill.billingProvider?.phone, "Enter the billing provider phone number.");
1643
+ required("billingProvider.address.line1", bill.billingProvider?.address?.line1, "Enter the billing provider street address.");
1644
+ required("billingProvider.address.city", bill.billingProvider?.address?.city, "Enter the billing provider city.");
1645
+ required("billingProvider.address.state", bill.billingProvider?.address?.state, "Enter the billing provider 2-letter state code.");
1646
+ required("billingProvider.address.postalCode", bill.billingProvider?.address?.postalCode, "Enter the billing provider ZIP code.");
1647
+ required("renderingProvider.name", bill.renderingProvider?.name, "Enter the rendering provider name.");
1648
+ required("renderingProvider.npi", bill.renderingProvider?.npi, "Enter the rendering provider NPI.");
1649
+ required("renderingProvider.taxonomy", bill.renderingProvider?.taxonomy, "Enter the rendering provider taxonomy code.");
1650
+ required("serviceLocation.placeOfServiceCode", bill.serviceLocation?.placeOfServiceCode, "Enter the 2-digit place of service code.");
1651
+ required("serviceLocation.address.line1", bill.serviceLocation?.address?.line1, "Enter the service facility street address.");
1652
+ required("serviceLocation.address.city", bill.serviceLocation?.address?.city, "Enter the service facility city.");
1653
+ required("serviceLocation.address.state", bill.serviceLocation?.address?.state, "Enter the service facility 2-letter state code.");
1654
+ required("serviceLocation.address.postalCode", bill.serviceLocation?.address?.postalCode, "Enter the service facility ZIP code.");
1542
1655
  if (!(bill.diagnoses ?? []).some((code) => code.trim())) {
1543
1656
  errors.diagnoses = "Select at least one ICD-10 diagnosis code.";
1544
1657
  }
@@ -1546,7 +1659,16 @@ function validateBillSubmission(bill) {
1546
1659
  errors["claim.claimsAdministrator"] = "Select a claims administrator from the payer directory.";
1547
1660
  }
1548
1661
  if (bill.patient.dateOfBirth && !parseBillSubmissionDate(bill.patient.dateOfBirth)) errors["patient.dateOfBirth"] = "Use MM/DD/YYYY";
1662
+ if (bill.claim.dateOfInjury && !parseBillSubmissionDate(bill.claim.dateOfInjury)) errors["claim.dateOfInjury"] = "Use MM/DD/YYYY";
1549
1663
  if (bill.patient.address.state.trim().length !== 2) errors["patient.address.state"] = "Use a 2-letter state code";
1664
+ if (bill.billingProvider?.address?.state && bill.billingProvider.address.state.trim().length !== 2) errors["billingProvider.address.state"] = "Use a 2-letter state code.";
1665
+ if (bill.serviceLocation?.address?.state && bill.serviceLocation.address.state.trim().length !== 2) errors["serviceLocation.address.state"] = "Use a 2-letter state code.";
1666
+ const digits = (value) => value?.replace(/\D/g, "") ?? "";
1667
+ if (bill.billingProvider?.taxId && digits(bill.billingProvider.taxId).length !== 9) errors["billingProvider.taxId"] = "Enter a valid 9-digit EIN or SSN.";
1668
+ if (bill.billingProvider?.npi && !/^\d{10}$/.test(digits(bill.billingProvider.npi))) errors["billingProvider.npi"] = "Enter a valid 10-digit NPI.";
1669
+ if (bill.renderingProvider?.npi && !/^\d{10}$/.test(digits(bill.renderingProvider.npi))) errors["renderingProvider.npi"] = "Enter a valid 10-digit NPI.";
1670
+ if (bill.renderingProvider?.taxonomy && !/^[A-Za-z0-9]{10}$/.test(bill.renderingProvider.taxonomy.trim())) errors["renderingProvider.taxonomy"] = "Enter a valid 10-character taxonomy code.";
1671
+ if (bill.serviceLocation?.placeOfServiceCode && !/^\d{2}$/.test(bill.serviceLocation.placeOfServiceCode.trim())) errors["serviceLocation.placeOfServiceCode"] = "Enter a valid 2-digit place of service code.";
1550
1672
  const lines = submittedLines(bill.serviceLines);
1551
1673
  if (!lines.length) errors.serviceLines = "Add at least one service line";
1552
1674
  lines.forEach((line, index) => {
@@ -1559,7 +1681,7 @@ function validateBillSubmission(bill) {
1559
1681
  var css = `
1560
1682
  .mbsf{display:grid;gap:20px;color:var(--mb-text);font-family:var(--mb-font);font-size:15px}.mbsf *{box-sizing:border-box}
1561
1683
  .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)}
1562
- .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-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)}
1684
+ .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)}
1563
1685
  .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}
1564
1686
  .mbsf-payer-status{display:flex;align-items:center;gap:7px;color:#087f5b;font-size:13px;font-weight:650}.mbsf-payer-intro{margin:4px 0 0;color:var(--mb-muted)}.mbsf-payer-list{display:grid;gap:8px}.mbsf-payer-option{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:11px 12px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);background:color-mix(in srgb,var(--mb-accent) 3%,var(--mb-surface))}.mbsf-payer-option-main{display:grid;gap:5px;min-width:0}.mbsf-payer-option-main strong{overflow-wrap:anywhere}.mbsf-payer-signals{display:flex;flex-wrap:wrap;gap:6px}.mbsf-payer-signal{padding:2px 7px;border:1px solid var(--mb-border);border-radius:999px;color:var(--mb-muted);font-size:12px}.mbsf-payer-signal[data-state=match]{border-color:color-mix(in srgb,#159447 45%,var(--mb-border));color:#087f5b}.mbsf-payer-signal[data-state=warning]{border-color:color-mix(in srgb,#c56a00 55%,var(--mb-border));color:#9a5200}
1565
1687
  .mbsf-chips,.mbsf-quick-picks{display:flex;flex-wrap:wrap;gap:7px;margin-bottom:8px}.mbsf-chip,.mbsf-quick-pick{display:inline-flex;align-items:center;gap:7px;padding:5px 9px;border:1px solid var(--mb-border);border-radius:999px;background:var(--mb-input)}.mbsf-chip button{border:0;background:transparent;color:var(--mb-muted);cursor:pointer;font:inherit}.mbsf-quick-pick{color:var(--mb-text);font:inherit;cursor:pointer}.mbsf-quick-pick[data-selected=true]{border-color:var(--mb-accent);color:var(--mb-accent)}
@@ -1582,9 +1704,9 @@ function Field2({ label, required, error, path, span, children }) {
1582
1704
  ] });
1583
1705
  }
1584
1706
  function TextDateInput({ value, onChange, disabled, required, ariaLabel }) {
1585
- const [display, setDisplay] = useState2(() => formatBillSubmissionDate(value));
1586
- const [invalid, setInvalid] = useState2(false);
1587
- useEffect2(() => {
1707
+ const [display, setDisplay] = useState3(() => formatBillSubmissionDate(value));
1708
+ const [invalid, setInvalid] = useState3(false);
1709
+ useEffect3(() => {
1588
1710
  setDisplay(formatBillSubmissionDate(value));
1589
1711
  setInvalid(false);
1590
1712
  }, [value]);
@@ -1601,8 +1723,8 @@ function TextDateInput({ value, onChange, disabled, required, ariaLabel }) {
1601
1723
  ] });
1602
1724
  }
1603
1725
  function ComboBox({ value, placeholder, options, disabled, loading, loadingMore, invalid, preserveValueOnOpen = false, onOpen, onQuery, onEndReached, onSelect, createOption, ariaLabel }) {
1604
- const [open, setOpen] = useState2(false);
1605
- const [query, setQuery] = useState2("");
1726
+ const [open, setOpen] = useState3(false);
1727
+ const [query, setQuery] = useState3("");
1606
1728
  const visible = useMemo2(() => {
1607
1729
  const q = query.trim().toLowerCase();
1608
1730
  const matches = q ? options.filter((option) => `${option.id} ${option.label} ${option.detail ?? ""}`.toLowerCase().includes(q)) : options;
@@ -1722,6 +1844,7 @@ function BillSubmissionForm({
1722
1844
  onLookupPostalCode,
1723
1845
  procedureOptions,
1724
1846
  modifierOptions,
1847
+ taxonomyOptions,
1725
1848
  attachmentReportTypeMode = "auto",
1726
1849
  attachmentReportTypes = BILL_SUBMISSION_REPORT_TYPES,
1727
1850
  defaultAttachmentReportType,
@@ -1734,24 +1857,24 @@ function BillSubmissionForm({
1734
1857
  description = "Review the bill details, add attachments, and submit.",
1735
1858
  children
1736
1859
  }) {
1737
- const [bill, setBill] = useState2(() => cloneInitialBill(initialBill));
1738
- const [selectedIds, setSelectedIds] = useState2(() => attachments.map((item) => item.id));
1739
- const [removedSourceIds, setRemovedSourceIds] = useState2([]);
1740
- const [uploads, setUploads] = useState2([]);
1741
- const [errors, setErrors] = useState2({});
1742
- const [sourceAttachmentReportTypes, setSourceAttachmentReportTypes] = useState2(() => Object.fromEntries(attachments.flatMap((item) => item.reportTypeCode ? [[item.id, item.reportTypeCode]] : [])));
1743
- const [validationActive, setValidationActive] = useState2(false);
1744
- const [formError, setFormError] = useState2(null);
1745
- const [submitting, setSubmitting] = useState2(false);
1746
- const [payerResults, setPayerResults] = useState2([]);
1747
- const [payerLoading, setPayerLoading] = useState2(false);
1748
- const [diagnosisResults, setDiagnosisResults] = useState2([]);
1749
- const [diagnosisLoading, setDiagnosisLoading] = useState2(false);
1750
- const [diagnosisLoadingMore, setDiagnosisLoadingMore] = useState2(false);
1751
- const [diagnosisQuery, setDiagnosisQuery] = useState2(null);
1752
- const [diagnosisHasMore, setDiagnosisHasMore] = useState2(true);
1753
- const [postalStatus, setPostalStatus] = useState2(null);
1754
- const [dragActive, setDragActive] = useState2(false);
1860
+ const [bill, setBill] = useState3(() => cloneInitialBill(initialBill));
1861
+ const [selectedIds, setSelectedIds] = useState3(() => attachments.map((item) => item.id));
1862
+ const [removedSourceIds, setRemovedSourceIds] = useState3([]);
1863
+ const [uploads, setUploads] = useState3([]);
1864
+ const [errors, setErrors] = useState3({});
1865
+ const [sourceAttachmentReportTypes, setSourceAttachmentReportTypes] = useState3(() => Object.fromEntries(attachments.flatMap((item) => item.reportTypeCode ? [[item.id, item.reportTypeCode]] : [])));
1866
+ const [validationActive, setValidationActive] = useState3(false);
1867
+ const [formError, setFormError] = useState3(null);
1868
+ const [submitting, setSubmitting] = useState3(false);
1869
+ const [payerResults, setPayerResults] = useState3([]);
1870
+ const [payerLoading, setPayerLoading] = useState3(false);
1871
+ const [diagnosisResults, setDiagnosisResults] = useState3([]);
1872
+ const [diagnosisLoading, setDiagnosisLoading] = useState3(false);
1873
+ const [diagnosisLoadingMore, setDiagnosisLoadingMore] = useState3(false);
1874
+ const [diagnosisQuery, setDiagnosisQuery] = useState3(null);
1875
+ const [diagnosisHasMore, setDiagnosisHasMore] = useState3(true);
1876
+ const [postalStatus, setPostalStatus] = useState3(null);
1877
+ const [dragActive, setDragActive] = useState3(false);
1755
1878
  const formRef = useRef2(null);
1756
1879
  const fileInput = useRef2(null);
1757
1880
  const diagnosisRequest = useRef2(0);
@@ -1759,7 +1882,8 @@ function BillSubmissionForm({
1759
1882
  const payerRequest = useRef2(0);
1760
1883
  const procedures = useMemo2(() => mergeOptions(DEFAULT_BILL_SUBMISSION_PROCEDURES, procedureOptions), [procedureOptions]);
1761
1884
  const modifiers = useMemo2(() => mergeOptions(DEFAULT_BILL_SUBMISSION_MODIFIERS, modifierOptions), [modifierOptions]);
1762
- const [evaluationType, setEvaluationType] = useState2(() => initialEvaluationType(initialBill));
1885
+ const taxonomies = useMemo2(() => mergeOptions(DEFAULT_BILL_SUBMISSION_TAXONOMIES, taxonomyOptions), [taxonomyOptions]);
1886
+ const [evaluationType, setEvaluationType] = useState3(() => initialEvaluationType(initialBill));
1763
1887
  const connected = !onSubmit;
1764
1888
  const referenceClient = useMemo2(() => getSession || sessionEndpoint || connected ? createBillReferenceClient({ getSession, sessionEndpoint, apiBaseUrl, fetch: fetchOverride }) : null, [getSession, sessionEndpoint, apiBaseUrl, fetchOverride, connected]);
1765
1889
  const submissionClient = useMemo2(() => connected ? createBillSubmissionClient({ getSession, sessionEndpoint, apiBaseUrl, fetch: fetchOverride }) : null, [getSession, sessionEndpoint, apiBaseUrl, fetchOverride, connected]);
@@ -1768,7 +1892,7 @@ function BillSubmissionForm({
1768
1892
  const forcedAttachmentReportType = showAttachmentReportTypes ? void 0 : defaultAttachmentReportType ?? MED_LEGAL_REPORT_TYPE_CODE;
1769
1893
  const reportTypeOptions = useMemo2(() => attachmentReportTypes.map((item) => ({ id: item.code, label: item.code.replace(/^OZ:/, ""), detail: item.label })), [attachmentReportTypes]);
1770
1894
  const missingAttachmentReportType = showAttachmentReportTypes && (selectedIds.some((id) => !(sourceAttachmentReportTypes[id] || attachments.find((item) => item.id === id)?.reportTypeCode || defaultAttachmentReportType)) || uploads.some((upload) => !(upload.reportTypeCode || defaultAttachmentReportType)));
1771
- useEffect2(() => {
1895
+ useEffect3(() => {
1772
1896
  setBill(cloneInitialBill(initialBill));
1773
1897
  setEvaluationType(initialEvaluationType(initialBill));
1774
1898
  setSelectedIds(attachments.map((item) => item.id));
@@ -1784,7 +1908,7 @@ function BillSubmissionForm({
1784
1908
  diagnosisRequest.current += 1;
1785
1909
  diagnosisAppendPending.current = false;
1786
1910
  }, [initialBill, attachments]);
1787
- useEffect2(() => {
1911
+ useEffect3(() => {
1788
1912
  if (!validationActive) return;
1789
1913
  const next = validateBillSubmission(bill).fieldErrors;
1790
1914
  setErrors(missingAttachmentReportType ? { ...next, attachments: "Select a report type for every attachment." } : next);
@@ -1802,7 +1926,7 @@ function BillSubmissionForm({
1802
1926
  if (selectedIds.length + uploads.length + files.length > MAX_DOCUMENTS) return setFormError(`A bill can include at most ${MAX_DOCUMENTS} attachments.`);
1803
1927
  setUploads((current) => [...current, ...files.map((file) => ({ file, documentType: "other", ...defaultAttachmentReportType ? { reportTypeCode: defaultAttachmentReportType } : {} }))]);
1804
1928
  }, [defaultAttachmentReportType, selectedIds.length, uploads]);
1805
- useEffect2(() => {
1929
+ useEffect3(() => {
1806
1930
  const over = (event) => {
1807
1931
  if (event.dataTransfer?.types.includes("Files")) {
1808
1932
  event.preventDefault();
@@ -1872,7 +1996,7 @@ function BillSubmissionForm({
1872
1996
  });
1873
1997
  void runPayerSearch(query, true);
1874
1998
  };
1875
- useEffect2(() => {
1999
+ useEffect3(() => {
1876
2000
  const payer = bill.claim.claimsAdministrator;
1877
2001
  if (!payer?.name || payer.name.trim().length < 2) return;
1878
2002
  void runPayerSearch(payer.name, !payer.id);
@@ -1952,10 +2076,11 @@ function BillSubmissionForm({
1952
2076
  return;
1953
2077
  }
1954
2078
  if (selectedIds.length + uploads.length > MAX_DOCUMENTS) return setFormError(`A bill can include at most ${MAX_DOCUMENTS} attachments.`);
2079
+ const complete = clean;
1955
2080
  setSubmitting(true);
1956
2081
  try {
1957
2082
  if (onSubmit) {
1958
- await onSubmit({ bill: clean, sourceAttachmentIds: selectedIds, sourceAttachmentReportTypes, uploads });
2083
+ await onSubmit({ bill: complete, sourceAttachmentIds: selectedIds, sourceAttachmentReportTypes, uploads });
1959
2084
  } else {
1960
2085
  if (!submissionClient) throw new Error("The connected billing client is unavailable.");
1961
2086
  const documents = await prepareBillSubmissionDocuments({
@@ -1966,7 +2091,7 @@ function BillSubmissionForm({
1966
2091
  ...forcedAttachmentReportType ? { defaultReportTypeCode: forcedAttachmentReportType } : {},
1967
2092
  ...fetchOverride ? { fetch: fetchOverride } : {}
1968
2093
  });
1969
- const result = await submissionClient.submitBill({ bill: clean, documents });
2094
+ const result = await submissionClient.submitBill({ bill: complete, documents });
1970
2095
  await onSubmitted?.(result);
1971
2096
  }
1972
2097
  } catch (caught) {
@@ -2010,8 +2135,8 @@ function BillSubmissionForm({
2010
2135
  /* @__PURE__ */ jsx3("legend", { className: "mbsf-legend", children: "Injury & claim" }),
2011
2136
  /* @__PURE__ */ jsxs3("div", { className: "mbsf-grid", children: [
2012
2137
  /* @__PURE__ */ jsx3(Field2, { path: "service.date", label: "Date of service", required: true, error: errors["service.date"], children: /* @__PURE__ */ jsx3(TextDateInput, { ariaLabel: "Date of service", value: bill.service.date, disabled: locked, required: true, onChange: (date2) => setBill((c) => ({ ...c, service: { ...c.service, date: date2 } })) }) }),
2013
- /* @__PURE__ */ jsx3(Field2, { label: "Date of injury", children: /* @__PURE__ */ jsx3(TextDateInput, { ariaLabel: "Date of injury", value: bill.claim.dateOfInjury, disabled: locked, onChange: (dateOfInjury) => setBill((c) => ({ ...c, claim: { ...c.claim, dateOfInjury } })) }) }),
2014
- /* @__PURE__ */ jsx3(Field2, { label: "Employer (optional)", children: text(bill.claim.employer, (employer) => setBill((c) => ({ ...c, claim: { ...c.claim, employer } }))) }),
2138
+ /* @__PURE__ */ jsx3(Field2, { path: "claim.dateOfInjury", label: "Date of injury", required: true, error: errors["claim.dateOfInjury"], children: /* @__PURE__ */ jsx3(TextDateInput, { ariaLabel: "Date of injury", value: bill.claim.dateOfInjury, disabled: locked, required: true, onChange: (dateOfInjury) => setBill((c) => ({ ...c, claim: { ...c.claim, dateOfInjury } })) }) }),
2139
+ /* @__PURE__ */ jsx3(Field2, { path: "claim.employer", label: "Employer name", required: true, error: errors["claim.employer"], children: text(bill.claim.employer, (employer) => setBill((c) => ({ ...c, claim: { ...c.claim, employer } }))) }),
2015
2140
  /* @__PURE__ */ jsx3(Field2, { path: "claim.claimNumber", label: "Claim number", required: true, error: errors["claim.claimNumber"], children: text(bill.claim.claimNumber, (claimNumber) => setBill((c) => ({ ...c, claim: { ...c.claim, claimNumber } }))) }),
2016
2141
  /* @__PURE__ */ jsx3(Field2, { label: "WCAB / ADJ number (optional)", children: text(bill.claim.adjNumber, (adjNumber) => setBill((c) => ({ ...c, claim: { ...c.claim, adjNumber } }))) }),
2017
2142
  /* @__PURE__ */ jsxs3(Field2, { path: "claim.claimsAdministrator", label: "Claims administrator", required: true, span: true, error: claimsAdministratorError, children: [
@@ -2073,17 +2198,33 @@ function BillSubmissionForm({
2073
2198
  const providersSection = /* @__PURE__ */ jsxs3("fieldset", { className: "mbsf-card", disabled: locked, children: [
2074
2199
  /* @__PURE__ */ jsx3("legend", { className: "mbsf-legend", children: "Providers & place of service" }),
2075
2200
  /* @__PURE__ */ jsxs3("div", { className: "mbsf-grid", children: [
2076
- /* @__PURE__ */ jsx3(Field2, { label: "Billing provider", children: text(bill.billingProvider?.name, (name) => setBill((c) => ({ ...c, billingProvider: { ...c.billingProvider, name } }))) }),
2077
- /* @__PURE__ */ jsx3(Field2, { label: "Billing tax ID", children: text(bill.billingProvider?.taxId, (taxId) => setBill((c) => ({ ...c, billingProvider: { ...c.billingProvider, taxId } }))) }),
2078
- /* @__PURE__ */ jsx3(Field2, { label: "Billing NPI", children: text(bill.billingProvider?.npi, (npi) => setBill((c) => ({ ...c, billingProvider: { ...c.billingProvider, npi } }))) }),
2079
- /* @__PURE__ */ jsx3(Field2, { label: "Billing phone", children: text(bill.billingProvider?.phone, (phone) => setBill((c) => ({ ...c, billingProvider: { ...c.billingProvider, phone } })), { type: "tel" }) }),
2080
- /* @__PURE__ */ jsx3(Field2, { label: "Rendering provider", children: text(bill.renderingProvider?.name, (name) => setBill((c) => ({ ...c, renderingProvider: { ...c.renderingProvider, name } }))) }),
2081
- /* @__PURE__ */ jsx3(Field2, { label: "Specialty", children: text(bill.renderingProvider?.specialty, (specialty) => setBill((c) => ({ ...c, renderingProvider: { ...c.renderingProvider, specialty } }))) }),
2082
- /* @__PURE__ */ jsx3(Field2, { label: "Rendering NPI", children: text(bill.renderingProvider?.npi, (npi) => setBill((c) => ({ ...c, renderingProvider: { ...c.renderingProvider, npi } }))) }),
2083
- /* @__PURE__ */ jsx3(Field2, { label: "License number", children: text(bill.renderingProvider?.licenseNumber, (licenseNumber) => setBill((c) => ({ ...c, renderingProvider: { ...c.renderingProvider, licenseNumber } }))) }),
2084
- /* @__PURE__ */ jsx3(Field2, { label: "License state", children: text(bill.renderingProvider?.licenseState, (licenseState) => setBill((c) => ({ ...c, renderingProvider: { ...c.renderingProvider, licenseState: licenseState.toUpperCase() } })), { maxLength: 2 }) }),
2085
- /* @__PURE__ */ jsx3(Field2, { label: "Service location", children: text(bill.serviceLocation?.name, (name) => setBill((c) => ({ ...c, serviceLocation: { ...c.serviceLocation, name } }))) }),
2086
- /* @__PURE__ */ jsx3(Field2, { label: "Place of service", children: text(bill.serviceLocation?.placeOfServiceCode, (placeOfServiceCode) => setBill((c) => ({ ...c, serviceLocation: { ...c.serviceLocation, placeOfServiceCode } })), { maxLength: 2 }) })
2201
+ /* @__PURE__ */ jsx3("h4", { className: "mbsf-subhead", children: "Billing provider" }),
2202
+ /* @__PURE__ */ jsx3(Field2, { path: "billingProvider.name", label: "Billing provider name", required: true, error: errors["billingProvider.name"], children: text(bill.billingProvider?.name, (name) => setBill((c) => ({ ...c, billingProvider: { ...c.billingProvider, name } }))) }),
2203
+ /* @__PURE__ */ jsx3(Field2, { path: "billingProvider.taxId", label: "Tax ID (EIN / SSN)", required: true, error: errors["billingProvider.taxId"], children: text(bill.billingProvider?.taxId, (taxId) => setBill((c) => ({ ...c, billingProvider: { ...c.billingProvider, taxId } })), { inputMode: "numeric" }) }),
2204
+ /* @__PURE__ */ jsx3(Field2, { path: "billingProvider.npi", label: "Billing provider NPI", required: true, error: errors["billingProvider.npi"], children: text(bill.billingProvider?.npi, (npi) => setBill((c) => ({ ...c, billingProvider: { ...c.billingProvider, npi } })), { inputMode: "numeric", maxLength: 10 }) }),
2205
+ /* @__PURE__ */ jsx3(Field2, { path: "billingProvider.phone", label: "Billing provider phone", required: true, error: errors["billingProvider.phone"], children: text(bill.billingProvider?.phone, (phone) => setBill((c) => ({ ...c, billingProvider: { ...c.billingProvider, phone } })), { type: "tel" }) }),
2206
+ /* @__PURE__ */ jsx3(Field2, { path: "billingProvider.address.line1", label: "Billing address line 1", required: true, span: true, error: errors["billingProvider.address.line1"], children: text(bill.billingProvider?.address?.line1, (line1) => setBill((c) => ({ ...c, billingProvider: { ...c.billingProvider, address: { line1, line2: c.billingProvider?.address?.line2 ?? "", city: c.billingProvider?.address?.city ?? "", state: c.billingProvider?.address?.state ?? "", postalCode: c.billingProvider?.address?.postalCode ?? "" } } }))) }),
2207
+ /* @__PURE__ */ jsx3(Field2, { label: "Billing address line 2 (optional)", span: true, children: text(bill.billingProvider?.address?.line2, (line2) => setBill((c) => ({ ...c, billingProvider: { ...c.billingProvider, address: { line1: c.billingProvider?.address?.line1 ?? "", line2, city: c.billingProvider?.address?.city ?? "", state: c.billingProvider?.address?.state ?? "", postalCode: c.billingProvider?.address?.postalCode ?? "" } } }))) }),
2208
+ /* @__PURE__ */ jsx3(Field2, { path: "billingProvider.address.city", label: "Billing city", required: true, error: errors["billingProvider.address.city"], children: text(bill.billingProvider?.address?.city, (city) => setBill((c) => ({ ...c, billingProvider: { ...c.billingProvider, address: { line1: c.billingProvider?.address?.line1 ?? "", line2: c.billingProvider?.address?.line2 ?? "", city, state: c.billingProvider?.address?.state ?? "", postalCode: c.billingProvider?.address?.postalCode ?? "" } } }))) }),
2209
+ /* @__PURE__ */ jsx3(Field2, { path: "billingProvider.address.state", label: "Billing state", required: true, error: errors["billingProvider.address.state"], children: text(bill.billingProvider?.address?.state, (state) => setBill((c) => ({ ...c, billingProvider: { ...c.billingProvider, address: { line1: c.billingProvider?.address?.line1 ?? "", line2: c.billingProvider?.address?.line2 ?? "", city: c.billingProvider?.address?.city ?? "", state: state.toUpperCase(), postalCode: c.billingProvider?.address?.postalCode ?? "" } } })), { maxLength: 2 }) }),
2210
+ /* @__PURE__ */ jsx3(Field2, { path: "billingProvider.address.postalCode", label: "Billing ZIP", required: true, error: errors["billingProvider.address.postalCode"], children: text(bill.billingProvider?.address?.postalCode, (postalCode) => setBill((c) => ({ ...c, billingProvider: { ...c.billingProvider, address: { line1: c.billingProvider?.address?.line1 ?? "", line2: c.billingProvider?.address?.line2 ?? "", city: c.billingProvider?.address?.city ?? "", state: c.billingProvider?.address?.state ?? "", postalCode } } }))) }),
2211
+ /* @__PURE__ */ jsx3("h4", { className: "mbsf-subhead", children: "Rendering provider" }),
2212
+ /* @__PURE__ */ jsx3(Field2, { path: "renderingProvider.name", label: "Rendering provider name", required: true, error: errors["renderingProvider.name"], children: text(bill.renderingProvider?.name, (name) => setBill((c) => ({ ...c, renderingProvider: { ...c.renderingProvider, name } }))) }),
2213
+ /* @__PURE__ */ jsx3(Field2, { path: "renderingProvider.npi", label: "Rendering provider NPI", required: true, error: errors["renderingProvider.npi"], children: text(bill.renderingProvider?.npi, (npi) => setBill((c) => ({ ...c, renderingProvider: { ...c.renderingProvider, npi } })), { inputMode: "numeric", maxLength: 10 }) }),
2214
+ /* @__PURE__ */ jsxs3(Field2, { path: "renderingProvider.taxonomy", label: "Rendering taxonomy", required: true, error: errors["renderingProvider.taxonomy"], children: [
2215
+ /* @__PURE__ */ jsx3(ComboBox, { ariaLabel: "Rendering taxonomy", invalid: Boolean(errors["renderingProvider.taxonomy"]), disabled: locked, preserveValueOnOpen: true, value: bill.renderingProvider?.taxonomy ?? "", placeholder: "Search specialty name or taxonomy code\u2026", options: taxonomies.map((item) => ({ id: item.code, label: item.description, detail: item.code })), createOption: (query) => {
2216
+ const code = query.trim().toUpperCase();
2217
+ return /^[A-Z0-9]{10}$/.test(code) ? { id: code, label: code, detail: "Use this taxonomy code" } : null;
2218
+ }, onSelect: (option) => setBill((c) => ({ ...c, renderingProvider: { ...c.renderingProvider, taxonomy: option.id } })) }),
2219
+ /* @__PURE__ */ jsx3("small", { className: "mbsf-help", children: "Search by specialty name or 10-character taxonomy code." })
2220
+ ] }),
2221
+ /* @__PURE__ */ jsx3("h4", { className: "mbsf-subhead", children: "Service facility" }),
2222
+ /* @__PURE__ */ jsx3(Field2, { path: "serviceLocation.placeOfServiceCode", label: "Place of service code", required: true, error: errors["serviceLocation.placeOfServiceCode"], children: text(bill.serviceLocation?.placeOfServiceCode, (placeOfServiceCode) => setBill((c) => ({ ...c, serviceLocation: { ...c.serviceLocation, placeOfServiceCode } })), { inputMode: "numeric", maxLength: 2, placeholder: "11" }) }),
2223
+ /* @__PURE__ */ jsx3(Field2, { path: "serviceLocation.address.line1", label: "Service address line 1", required: true, span: true, error: errors["serviceLocation.address.line1"], children: text(bill.serviceLocation?.address?.line1, (line1) => setBill((c) => ({ ...c, serviceLocation: { ...c.serviceLocation, address: { line1, line2: c.serviceLocation?.address?.line2 ?? "", city: c.serviceLocation?.address?.city ?? "", state: c.serviceLocation?.address?.state ?? "", postalCode: c.serviceLocation?.address?.postalCode ?? "" } } }))) }),
2224
+ /* @__PURE__ */ jsx3(Field2, { label: "Service address line 2 (optional)", span: true, children: text(bill.serviceLocation?.address?.line2, (line2) => setBill((c) => ({ ...c, serviceLocation: { ...c.serviceLocation, address: { line1: c.serviceLocation?.address?.line1 ?? "", line2, city: c.serviceLocation?.address?.city ?? "", state: c.serviceLocation?.address?.state ?? "", postalCode: c.serviceLocation?.address?.postalCode ?? "" } } }))) }),
2225
+ /* @__PURE__ */ jsx3(Field2, { path: "serviceLocation.address.city", label: "Service city", required: true, error: errors["serviceLocation.address.city"], children: text(bill.serviceLocation?.address?.city, (city) => setBill((c) => ({ ...c, serviceLocation: { ...c.serviceLocation, address: { line1: c.serviceLocation?.address?.line1 ?? "", line2: c.serviceLocation?.address?.line2 ?? "", city, state: c.serviceLocation?.address?.state ?? "", postalCode: c.serviceLocation?.address?.postalCode ?? "" } } }))) }),
2226
+ /* @__PURE__ */ jsx3(Field2, { path: "serviceLocation.address.state", label: "Service state", required: true, error: errors["serviceLocation.address.state"], children: text(bill.serviceLocation?.address?.state, (state) => setBill((c) => ({ ...c, serviceLocation: { ...c.serviceLocation, address: { line1: c.serviceLocation?.address?.line1 ?? "", line2: c.serviceLocation?.address?.line2 ?? "", city: c.serviceLocation?.address?.city ?? "", state: state.toUpperCase(), postalCode: c.serviceLocation?.address?.postalCode ?? "" } } })), { maxLength: 2 }) }),
2227
+ /* @__PURE__ */ jsx3(Field2, { path: "serviceLocation.address.postalCode", label: "Service ZIP", required: true, error: errors["serviceLocation.address.postalCode"], children: text(bill.serviceLocation?.address?.postalCode, (postalCode) => setBill((c) => ({ ...c, serviceLocation: { ...c.serviceLocation, address: { line1: c.serviceLocation?.address?.line1 ?? "", line2: c.serviceLocation?.address?.line2 ?? "", city: c.serviceLocation?.address?.city ?? "", state: c.serviceLocation?.address?.state ?? "", postalCode } } }))) })
2087
2228
  ] })
2088
2229
  ] });
2089
2230
  const serviceLinesSection = /* @__PURE__ */ jsxs3("fieldset", { className: "mbsf-card", disabled: locked, children: [
@@ -2093,9 +2234,15 @@ function BillSubmissionForm({
2093
2234
  /* @__PURE__ */ jsx3("p", { className: "mbsf-help", children: evaluationType === "ame" ? "Agreed Medical Evaluator \u2014 eligible ML evaluation codes default to modifier -94." : evaluationType === "psych_qme" ? "Psychiatric QME \u2014 eligible ML evaluation codes default to modifier -96 (-95 for ML200)." : "Qualified Medical Evaluator \u2014 eligible ML evaluation codes default to modifier -95." }),
2094
2235
  /* @__PURE__ */ jsxs3("div", { className: "mbsf-lines", "data-field-path": "serviceLines", "data-invalid": Boolean(errors.serviceLines), children: [
2095
2236
  /* @__PURE__ */ jsxs3("div", { className: "mbsf-line-head", children: [
2096
- /* @__PURE__ */ jsx3("span", { children: "Procedure code" }),
2237
+ /* @__PURE__ */ jsxs3("span", { children: [
2238
+ "Procedure code",
2239
+ /* @__PURE__ */ jsx3(RequiredMark, {})
2240
+ ] }),
2097
2241
  /* @__PURE__ */ jsx3("span", { children: "Modifiers" }),
2098
- /* @__PURE__ */ jsx3("span", { children: "Units" }),
2242
+ /* @__PURE__ */ jsxs3("span", { children: [
2243
+ "Units",
2244
+ /* @__PURE__ */ jsx3(RequiredMark, {})
2245
+ ] }),
2099
2246
  /* @__PURE__ */ jsx3("span", { children: "Allowed" }),
2100
2247
  /* @__PURE__ */ jsx3("span", {}),
2101
2248
  " "
@@ -2217,7 +2364,7 @@ function BillSubmissionForm({
2217
2364
  }
2218
2365
 
2219
2366
  // src/billing-dashboard.tsx
2220
- import { useMemo as useMemo3, useState as useState3 } from "react";
2367
+ import { useMemo as useMemo3, useState as useState4 } from "react";
2221
2368
  import { Fragment as Fragment3, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
2222
2369
  var css2 = `
2223
2370
  .mbdash{display:grid;gap:20px;color:var(--mb-text);font-family:var(--mb-font);font-size:15px}.mbdash *{box-sizing:border-box}.mbdash h2,.mbdash h3,.mbdash p{margin:0}.mbdash-copy{color:var(--mb-muted);margin-top:5px!important}.mbdash-card{min-width:0;border:1px solid var(--mb-border);border-radius:var(--mb-radius);background:var(--mb-surface);box-shadow:var(--mb-shadow)}
@@ -2385,8 +2532,8 @@ function BillAgingSummary(props) {
2385
2532
  return /* @__PURE__ */ jsx4(Shell, { ...shellProps, children: /* @__PURE__ */ jsx4(AgingContent, { bills: props.bills, ...props.heading === void 0 ? {} : { heading: props.heading } }) });
2386
2533
  }
2387
2534
  function BillingDashboard({ bills, heading = "Billing", description = "Track submitted bills, payments, and outstanding balances.", onSelectBill, initialSearch = "", initialState = "all", hideFilters = false, appearance, className, style }) {
2388
- const [search, setSearch] = useState3(initialSearch);
2389
- const [state, setState] = useState3(initialState);
2535
+ const [search, setSearch] = useState4(initialSearch);
2536
+ const [state, setState] = useState4(initialState);
2390
2537
  const states = useMemo3(() => [...new Set(bills.map((bill) => bill.state))].sort((a, b) => a.localeCompare(b)), [bills]);
2391
2538
  const filtered = useMemo3(() => {
2392
2539
  const query = search.trim().toLowerCase();
@@ -2482,10 +2629,10 @@ function BillingReport({ bills, groupBy = "status", heading = "Billing report",
2482
2629
  // src/connected-bill-status.tsx
2483
2630
  import {
2484
2631
  useCallback as useCallback2,
2485
- useEffect as useEffect3,
2632
+ useEffect as useEffect4,
2486
2633
  useMemo as useMemo4,
2487
2634
  useRef as useRef3,
2488
- useState as useState4
2635
+ useState as useState5
2489
2636
  } from "react";
2490
2637
  import {
2491
2638
  DEFAULT_API_BASE_URL,
@@ -2631,16 +2778,16 @@ function useBillStatus({
2631
2778
  apiBaseUrl,
2632
2779
  ...fetchOverride ? { fetch: fetchOverride } : {}
2633
2780
  }), [apiBaseUrl, billId, fetchOverride, getSession, sessionEndpoint]);
2634
- const [data, setData] = useState4(initialData);
2635
- const [error, setError] = useState4(null);
2636
- const [isLoading, setIsLoading] = useState4(enabled && !initialData);
2637
- const [isRefreshing, setIsRefreshing] = useState4(false);
2781
+ const [data, setData] = useState5(initialData);
2782
+ const [error, setError] = useState5(null);
2783
+ const [isLoading, setIsLoading] = useState5(enabled && !initialData);
2784
+ const [isRefreshing, setIsRefreshing] = useState5(false);
2638
2785
  const dataRef = useRef3(initialData);
2639
2786
  const initialDataRef = useRef3(initialData);
2640
2787
  initialDataRef.current = initialData;
2641
2788
  const activeControllerRef = useRef3(null);
2642
2789
  const requestSequence = useRef3(0);
2643
- useEffect3(() => {
2790
+ useEffect4(() => {
2644
2791
  const seed = initialDataRef.current;
2645
2792
  dataRef.current = seed;
2646
2793
  setData(seed);
@@ -2681,10 +2828,10 @@ function useBillStatus({
2681
2828
  }
2682
2829
  }
2683
2830
  }, [billId, client, enabled]);
2684
- useEffect3(() => {
2831
+ useEffect4(() => {
2685
2832
  if (enabled) void load();
2686
2833
  }, [enabled, load]);
2687
- useEffect3(() => {
2834
+ useEffect4(() => {
2688
2835
  if (!enabled || refreshInterval <= 0) return;
2689
2836
  const timer = window.setInterval(() => void load(), refreshInterval);
2690
2837
  const onFocus = () => void load();
@@ -2792,13 +2939,10 @@ function defaultFormatDate(createdAt) {
2792
2939
  function BillActivityTimeline({ events, emptyLabel = "No bill activity yet.", appearance, className, style, formatDate = defaultFormatDate }) {
2793
2940
  return /* @__PURE__ */ jsxs6("section", { className: classes("mb-surface mb-activity", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill activity", children: [
2794
2941
  /* @__PURE__ */ jsx6("style", { children: lifecycleSurfaceStyles }),
2795
- /* @__PURE__ */ jsxs6("header", { className: "mb-surface-heading", children: [
2796
- /* @__PURE__ */ jsxs6("div", { children: [
2797
- /* @__PURE__ */ jsx6("strong", { children: "Bill history" }),
2798
- /* @__PURE__ */ jsx6("span", { children: "Submission, payer responses, follow-up, and payments." })
2799
- ] }),
2800
- /* @__PURE__ */ jsx6("span", { children: events.length })
2801
- ] }),
2942
+ /* @__PURE__ */ jsx6("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs6("div", { children: [
2943
+ /* @__PURE__ */ jsx6("strong", { children: "Bill history" }),
2944
+ /* @__PURE__ */ jsx6("span", { children: "Submission, payer responses, follow-up, and payments." })
2945
+ ] }) }),
2802
2946
  !events.length ? /* @__PURE__ */ jsx6("p", { className: "mb-activity-empty", children: emptyLabel }) : /* @__PURE__ */ jsx6("ol", { className: "mb-activity-list", children: events.map((event) => /* @__PURE__ */ jsxs6("li", { className: "mb-activity-item", children: [
2803
2947
  /* @__PURE__ */ jsx6("span", { className: "mb-activity-marker", "aria-hidden": "true" }),
2804
2948
  /* @__PURE__ */ jsxs6("div", { className: "mb-activity-content", children: [
@@ -2976,16 +3120,16 @@ var lifecycleSurfaceStyles = `
2976
3120
  .mb-progress-list{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));list-style:none;margin:0;padding:0}.mb-progress-list li{display:grid;gap:7px;position:relative;text-align:center;color:var(--mb-muted);font-size:12px}.mb-progress-list li:not(:last-child)::after{content:"";position:absolute;left:calc(50% + 14px);right:calc(-50% + 14px);top:13px;height:2px;background:var(--mb-border)}.mb-progress-list li.is-complete:not(:last-child)::after{background:var(--mb-accent)}.mb-progress-list li>span{display:grid;place-items:center;justify-self:center;position:relative;z-index:1;width:28px;height:28px;border:2px solid var(--mb-border);border-radius:50%;background:var(--mb-surface);font-weight:800}.mb-progress-list li.is-complete>span,.mb-progress-list li.is-current>span{border-color:var(--mb-accent);background:var(--mb-accent);color:var(--mb-accent-contrast)}.mb-progress-list li.is-current{color:var(--mb-text)}
2977
3121
  .mb-snapshot dl,.mb-remittance dl,.mb-contacts dl{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;margin:0}.mb-snapshot dl>div,.mb-remittance dl>div,.mb-contacts dl>div{display:grid;gap:3px;padding:10px 14px;border-left:1px solid var(--mb-border)}.mb-snapshot dl>div:nth-child(3n+1),.mb-remittance dl>div:first-child,.mb-contacts dl>div:first-child{border-left:0}.mb-snapshot dt,.mb-remittance dt,.mb-contacts dt{color:var(--mb-muted);font-size:11px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.mb-snapshot dd,.mb-remittance dd,.mb-contacts dd{font-size:14px;font-weight:750;margin:0;overflow-wrap:anywhere}.mb-contacts a{color:var(--mb-accent)}.mb-denial{margin-top: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));padding:12px 14px}.mb-denial p{margin:4px 0 0}
2978
3122
  .mb-payment-list{display:grid}.mb-payment-list article{display:grid;grid-template-columns:1fr auto;gap:5px 18px;padding:12px 0;border-top:1px solid var(--mb-border)}.mb-payment-list article:first-child{border-top:0}.mb-payment-list article>div{display:grid;gap:2px}.mb-payment-list article>div:nth-child(2){text-align:right}.mb-payment-list article span{color:var(--mb-muted);font-size:12px}.mb-payment-list article p{grid-column:1/-1;margin:0;color:var(--mb-muted);font-size:13px}
2979
- @media(max-width:700px){.mb-progress-list{grid-template-columns:1fr;text-align:left}.mb-progress-list li{grid-template-columns:28px 1fr;align-items:center;text-align:left}.mb-progress-list li:not(:last-child)::after{left:13px;right:auto;top:28px;bottom:-7px;width:2px;height:auto}.mb-progress-list li>span{grid-row:1}.mb-snapshot dl,.mb-remittance dl,.mb-contacts dl{grid-template-columns:1fr 1fr}.mb-snapshot dl>div,.mb-remittance dl>div,.mb-contacts dl>div{border:0;border-top:1px solid var(--mb-border);padding:10px 0}.mb-snapshot dl>div:nth-child(-n+2),.mb-remittance dl>div:nth-child(-n+2),.mb-contacts dl>div:nth-child(-n+2){border-top:0}.mb-payment-list article{grid-template-columns:1fr}.mb-payment-list article>div:nth-child(2){text-align:left}}
3123
+ @media(max-width:700px){.mb-surface.mb-progress{padding:16px 10px}.mb-progress-list{grid-template-columns:repeat(4,minmax(0,1fr))}.mb-progress-list li{display:grid;grid-template-columns:1fr;align-items:start;gap:6px;text-align:center;font-size:10px;min-width:0}.mb-progress-list li b{font-size:10px;white-space:nowrap}.mb-progress-list li:not(:last-child)::after{left:calc(50% + 12px);right:calc(-50% + 12px);top:11px;bottom:auto;width:auto;height:2px}.mb-progress-list li>span{grid-row:auto;width:24px;height:24px;font-size:11px}.mb-snapshot dl,.mb-remittance dl,.mb-contacts dl{grid-template-columns:1fr 1fr}.mb-snapshot dl>div,.mb-remittance dl>div,.mb-contacts dl>div{border:0;border-top:1px solid var(--mb-border);padding:10px 0}.mb-snapshot dl>div:nth-child(-n+2),.mb-remittance dl>div:nth-child(-n+2),.mb-contacts dl>div:nth-child(-n+2){border-top:0}.mb-payment-list article{grid-template-columns:1fr}.mb-payment-list article>div:nth-child(2){text-align:left}}
2980
3124
  `;
2981
3125
 
2982
3126
  // src/connected-bill-lifecycle.tsx
2983
3127
  import {
2984
3128
  useCallback as useCallback3,
2985
- useEffect as useEffect4,
3129
+ useEffect as useEffect5,
2986
3130
  useMemo as useMemo5,
2987
3131
  useRef as useRef4,
2988
- useState as useState5
3132
+ useState as useState6
2989
3133
  } from "react";
2990
3134
  import {
2991
3135
  DEFAULT_API_BASE_URL as DEFAULT_API_BASE_URL2,
@@ -2995,16 +3139,32 @@ import {
2995
3139
  import { createBillLifecycleClient as createBillLifecycleClient2 } from "@mindbill/browser";
2996
3140
  import { Fragment as Fragment5, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
2997
3141
  var DEFAULT_REFRESH_INTERVAL2 = 6e4;
2998
- function downloadBlob(blob, filename, open = false) {
3142
+ function downloadBlob(blob, filename) {
2999
3143
  const url = URL.createObjectURL(blob);
3000
3144
  const link = document.createElement("a");
3001
3145
  link.href = url;
3002
3146
  link.rel = "noopener noreferrer";
3003
3147
  link.download = filename;
3004
- if (open) link.target = "_blank";
3005
3148
  link.click();
3006
3149
  window.setTimeout(() => URL.revokeObjectURL(url), 6e4);
3007
3150
  }
3151
+ function reservePreviewWindow() {
3152
+ const preview = window.open("about:blank", "_blank");
3153
+ if (preview) preview.opener = null;
3154
+ return preview;
3155
+ }
3156
+ function previewBlob(blob, preview) {
3157
+ const url = URL.createObjectURL(blob);
3158
+ if (preview) preview.location.replace(url);
3159
+ else {
3160
+ const link = document.createElement("a");
3161
+ link.href = url;
3162
+ link.target = "_blank";
3163
+ link.rel = "noopener noreferrer";
3164
+ link.click();
3165
+ }
3166
+ window.setTimeout(() => URL.revokeObjectURL(url), 3e5);
3167
+ }
3008
3168
  function useBillLifecycle({
3009
3169
  billId: providedBillId,
3010
3170
  sessionEndpoint = DEFAULT_SESSION_ENDPOINT2,
@@ -3015,11 +3175,11 @@ function useBillLifecycle({
3015
3175
  initialData = null,
3016
3176
  fetch: fetchOverride
3017
3177
  }) {
3018
- const [data, setData] = useState5(initialData);
3019
- const [error, setError] = useState5(null);
3020
- const [isLoading, setIsLoading] = useState5(enabled && !initialData);
3021
- const [isRefreshing, setIsRefreshing] = useState5(false);
3022
- const [isMutating, setIsMutating] = useState5(false);
3178
+ const [data, setData] = useState6(initialData);
3179
+ const [error, setError] = useState6(null);
3180
+ const [isLoading, setIsLoading] = useState6(enabled && !initialData);
3181
+ const [isRefreshing, setIsRefreshing] = useState6(false);
3182
+ const [isMutating, setIsMutating] = useState6(false);
3023
3183
  const mounted = useRef4(true);
3024
3184
  const client = useMemo5(() => createBillLifecycleClient({
3025
3185
  billId: providedBillId,
@@ -3028,11 +3188,11 @@ function useBillLifecycle({
3028
3188
  apiBaseUrl,
3029
3189
  fetch: fetchOverride
3030
3190
  }), [apiBaseUrl, fetchOverride, getSession, providedBillId, sessionEndpoint]);
3031
- useEffect4(() => {
3191
+ useEffect5(() => {
3032
3192
  setData(initialData);
3033
3193
  setError(null);
3034
3194
  }, [initialData, providedBillId]);
3035
- useEffect4(() => {
3195
+ useEffect5(() => {
3036
3196
  mounted.current = true;
3037
3197
  return () => {
3038
3198
  mounted.current = false;
@@ -3056,7 +3216,7 @@ function useBillLifecycle({
3056
3216
  }
3057
3217
  }
3058
3218
  }, [client, enabled]);
3059
- useEffect4(() => {
3219
+ useEffect5(() => {
3060
3220
  if (!enabled) return;
3061
3221
  void refresh();
3062
3222
  const interval = refreshInterval > 0 ? window.setInterval(() => void refresh(), refreshInterval) : null;
@@ -3083,10 +3243,22 @@ function useBillLifecycle({
3083
3243
  }
3084
3244
  }, []);
3085
3245
  const openAttachment = useCallback3(async (attachment) => {
3086
- downloadBlob(await client.getAttachment(attachment.id), attachment.filename, true);
3246
+ const preview = reservePreviewWindow();
3247
+ try {
3248
+ previewBlob(await client.getAttachment(attachment.id), preview);
3249
+ } catch (error2) {
3250
+ preview?.close();
3251
+ throw error2;
3252
+ }
3087
3253
  }, [client]);
3088
3254
  const openEor = useCallback3(async (document2) => {
3089
- downloadBlob(await client.getEor(document2.id), document2.filename, true);
3255
+ const preview = reservePreviewWindow();
3256
+ try {
3257
+ previewBlob(await client.getEor(document2.id), preview);
3258
+ } catch (error2) {
3259
+ preview?.close();
3260
+ throw error2;
3261
+ }
3090
3262
  }, [client]);
3091
3263
  const downloadPacket = useCallback3(async () => {
3092
3264
  const packet = await client.getPacket();
@@ -3115,7 +3287,7 @@ function useBillLifecycle({
3115
3287
  }
3116
3288
  function LifecycleDialog({ children, title, onClose }) {
3117
3289
  const dialog = useRef4(null);
3118
- useEffect4(() => {
3290
+ useEffect5(() => {
3119
3291
  const previous = document.activeElement;
3120
3292
  dialog.current?.focus();
3121
3293
  const onKeyDown = (event) => event.key === "Escape" && onClose();
@@ -3156,14 +3328,14 @@ function sandboxScenarios(state) {
3156
3328
  function ConnectedBillLifecycle({ appearance, className, style, loadingFallback, errorFallback, onChanged, ...options }) {
3157
3329
  const lifecycle = useBillLifecycle(options);
3158
3330
  const { data } = lifecycle;
3159
- const [tab, setTab] = useState5("details");
3160
- const [panel, setPanel] = useState5("");
3161
- const [notice, setNotice] = useState5("");
3162
- const [reason, setReason] = useState5("");
3163
- const [payment, setPayment] = useState5({ amount: 0, method: "check", checkNumber: "", depositDate: today(), note: "" });
3164
- const [review, setReview] = useState5({ reason: "", payerClaimControlNumber: "", disputedAmount: void 0, attachmentIds: [], route: "ebill" });
3331
+ const [tab, setTab] = useState6("details");
3332
+ const [panel, setPanel] = useState6("");
3333
+ const [notice, setNotice] = useState6("");
3334
+ const [reason, setReason] = useState6("");
3335
+ const [payment, setPayment] = useState6({ amount: 0, method: "check", checkNumber: "", depositDate: today(), note: "" });
3336
+ const [review, setReview] = useState6({ reason: "", payerClaimControlNumber: "", disputedAmount: void 0, attachmentIds: [], route: "ebill" });
3165
3337
  const lastData = useRef4(null);
3166
- useEffect4(() => {
3338
+ useEffect5(() => {
3167
3339
  if (!data || data === lastData.current) return;
3168
3340
  lastData.current = data;
3169
3341
  onChanged?.(data);
@@ -3219,10 +3391,7 @@ function ConnectedBillLifecycle({ appearance, className, style, loadingFallback,
3219
3391
  ] }),
3220
3392
  /* @__PURE__ */ jsxs7("div", { className: "mb-lifecycle-tabs", role: "tablist", "aria-label": "Bill view", children: [
3221
3393
  /* @__PURE__ */ jsx7("button", { type: "button", role: "tab", "aria-selected": tab === "details", onClick: () => setTab("details"), children: "Bill details" }),
3222
- /* @__PURE__ */ jsxs7("button", { type: "button", role: "tab", "aria-selected": tab === "history", onClick: () => setTab("history"), children: [
3223
- "Bill history ",
3224
- /* @__PURE__ */ jsx7("span", { children: data.activity.length })
3225
- ] })
3394
+ /* @__PURE__ */ jsx7("button", { type: "button", role: "tab", "aria-selected": tab === "history", onClick: () => setTab("history"), children: "Bill history" })
3226
3395
  ] }),
3227
3396
  data.environment === "sandbox" ? /* @__PURE__ */ jsxs7("section", { className: "mb-lifecycle-simulator", "aria-label": "Sandbox lifecycle simulator", children: [
3228
3397
  /* @__PURE__ */ jsxs7("div", { children: [
@@ -3253,20 +3422,24 @@ function ConnectedBillLifecycle({ appearance, className, style, loadingFallback,
3253
3422
  /* @__PURE__ */ jsx7("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => void lifecycle.openEor(eor).catch(() => void 0), children: "View EOR" })
3254
3423
  ] }, eor.id)) })
3255
3424
  ] }) : null,
3256
- viewEor || actions.length ? /* @__PURE__ */ jsxs7("section", { className: "mb-lifecycle-actions-sheet", children: [
3257
- /* @__PURE__ */ jsxs7("div", { children: [
3258
- /* @__PURE__ */ jsx7("h3", { children: data.lifecycle.state.includes("closed") ? "This bill is closed" : data.lifecycle.state.includes("denied") || data.lifecycle.state.includes("rejected") ? "This bill needs attention" : "Available actions" }),
3259
- /* @__PURE__ */ jsx7("p", { children: "Actions are determined by the current bill status." })
3260
- ] }),
3261
- /* @__PURE__ */ jsxs7("div", { children: [
3262
- viewEor ? /* @__PURE__ */ jsx7("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => document.getElementById(`mb-eors-${data.bill.id}`)?.scrollIntoView({ behavior: "smooth" }), children: viewEor.label }) : null,
3263
- actions.map((action) => /* @__PURE__ */ jsx7("button", { type: "button", className: action.primary ? "mb-lifecycle-button primary" : "mb-lifecycle-button secondary", onClick: () => {
3264
- const next = actionPanel(action);
3265
- if (next) setPanel(next);
3266
- }, children: action.label }, action.id))
3267
- ] })
3268
- ] }) : null
3425
+ viewEor || actions.length ? /* @__PURE__ */ jsx7("button", { type: "button", className: "mb-lifecycle-button secondary mb-lifecycle-actions-trigger", onClick: () => setPanel("actions"), children: "Bill actions" }) : null
3269
3426
  ] }) : /* @__PURE__ */ jsx7("div", { className: "mb-lifecycle-tabpanel", role: "tabpanel", children: /* @__PURE__ */ jsx7(BillActivityTimeline, { events: data.activity, ...appearance ? { appearance } : {} }) }),
3427
+ panel === "actions" ? /* @__PURE__ */ jsx7(LifecycleDialog, { title: "Bill actions", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs7("section", { className: "mb-lifecycle-panel mb-lifecycle-action-panel", children: [
3428
+ /* @__PURE__ */ jsxs7("div", { children: [
3429
+ /* @__PURE__ */ jsx7("h3", { children: "Bill actions" }),
3430
+ /* @__PURE__ */ jsx7("p", { children: "Choose what you want to do with this bill." })
3431
+ ] }),
3432
+ /* @__PURE__ */ jsxs7("div", { className: "mb-lifecycle-action-options", children: [
3433
+ viewEor ? /* @__PURE__ */ jsx7("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => {
3434
+ setPanel("");
3435
+ document.getElementById(`mb-eors-${data.bill.id}`)?.scrollIntoView({ behavior: "smooth" });
3436
+ }, children: viewEor.label }) : null,
3437
+ actions.map((action) => /* @__PURE__ */ jsx7("button", { type: "button", className: action.primary ? "mb-lifecycle-button primary" : "mb-lifecycle-button secondary", onClick: () => {
3438
+ const next = actionPanel(action);
3439
+ if (next) setPanel(next);
3440
+ }, children: action.label }, action.id))
3441
+ ] })
3442
+ ] }) }) : null,
3270
3443
  panel === "resubmit" ? /* @__PURE__ */ jsx7(LifecycleDialog, { title: "Correct and resubmit", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs7("section", { className: "mb-lifecycle-panel", children: [
3271
3444
  /* @__PURE__ */ jsxs7("div", { children: [
3272
3445
  /* @__PURE__ */ jsx7("h3", { children: "Correct and resubmit" }),
@@ -3380,7 +3553,7 @@ function ConnectedBillLifecycle({ appearance, className, style, loadingFallback,
3380
3553
  }
3381
3554
  var CONNECTED_LIFECYCLE_STYLES = `
3382
3555
  .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)}
3383
- .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-title span{border-radius:999px;background:var(--mb-soft);padding:5px 10px;font-weight:750}.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-tabs span{display:inline-grid;place-items:center;min-width:24px;height:24px;margin-left:6px;border-radius:999px;background:rgba(127,127,127,.14);font-size:.8rem}.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-card,.mb-lifecycle-actions-sheet,.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,.mb-lifecycle-actions-sheet{display:flex;align-items:center;justify-content:space-between;gap:20px}.mb-lifecycle-card h3,.mb-lifecycle-actions-sheet h3,.mb-lifecycle-panel h3{margin:0;font-size:1.08rem}.mb-lifecycle-card p,.mb-lifecycle-actions-sheet 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-actions-sheet>div:last-child{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px}.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}
3556
+ .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-title span{border-radius:999px;background:var(--mb-soft);padding:5px 10px;font-weight:750}.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-trigger{width:100%}.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-action-options{display:grid;gap:10px}.mb-lifecycle-action-options .mb-lifecycle-button{width:100%}.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}
3384
3557
  @media(max-width:700px){.mb-lifecycle-head,.mb-lifecycle-actions-sheet,.mb-lifecycle-card header{align-items:stretch;flex-direction:column}.mb-lifecycle-head>.mb-lifecycle-button{width:100%}.mb-lifecycle-actions-sheet>div:last-child{justify-content:stretch}.mb-lifecycle-actions-sheet .mb-lifecycle-button{width:100%}.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}}
3385
3558
  `;
3386
3559
 
@@ -3388,7 +3561,7 @@ var CONNECTED_LIFECYCLE_STYLES = `
3388
3561
  function widget(tagName, props) {
3389
3562
  const ref = useRef5(null);
3390
3563
  const { onMindBill, onMindBillError } = props;
3391
- useEffect5(() => {
3564
+ useEffect6(() => {
3392
3565
  const element = ref.current;
3393
3566
  if (!element) return;
3394
3567
  const handleEvent = (event) => onMindBill?.(event);
@@ -3455,6 +3628,7 @@ export {
3455
3628
  ConnectedBillStatus,
3456
3629
  DEFAULT_BILL_SUBMISSION_MODIFIERS,
3457
3630
  DEFAULT_BILL_SUBMISSION_PROCEDURES,
3631
+ DEFAULT_BILL_SUBMISSION_TAXONOMIES,
3458
3632
  MED_LEGAL_REPORT_TYPE_CODE,
3459
3633
  MindBillBillReview,
3460
3634
  MindBillBillTimeline,