@mindbill/react 0.45.0 → 0.47.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
@@ -1,5 +1,45 @@
1
1
  "use client";
2
2
 
3
+ // src/billing-profile-options.ts
4
+ function organizationProfileOptions(profile) {
5
+ return {
6
+ billingProviders: profile.billingProviders.map((provider) => ({
7
+ id: provider.id,
8
+ label: provider.name,
9
+ value: {
10
+ name: provider.name,
11
+ ...provider.taxIdType === "SSN" ? { savedProviderId: provider.id, taxIdType: "SSN", taxIdLast4: provider.taxIdLast4 ?? "" } : { taxId: provider.taxId ?? "", taxIdType: "EIN" },
12
+ npi: provider.npi,
13
+ ...provider.phone !== void 0 ? { phone: provider.phone } : {},
14
+ address: { line1: provider.billingStreet ?? "", city: provider.billingCity ?? "", state: provider.billingState ?? "", postalCode: provider.billingZip ?? "" }
15
+ }
16
+ })),
17
+ renderingProviders: (profile.renderingProviders ?? []).filter((provider) => provider.active !== false).map((provider) => ({
18
+ id: provider.id,
19
+ label: provider.name,
20
+ value: {
21
+ name: provider.name,
22
+ npi: provider.npi,
23
+ ...provider.specialty !== void 0 ? { specialty: provider.specialty } : {},
24
+ ...provider.taxonomy !== void 0 ? { taxonomy: provider.taxonomy } : {},
25
+ ...provider.licenseNumber !== void 0 ? { licenseNumber: provider.licenseNumber } : {},
26
+ ...provider.licenseState !== void 0 ? { licenseState: provider.licenseState } : {},
27
+ ...provider.isQME !== void 0 ? { isQme: provider.isQME } : {},
28
+ ...provider.isAME !== void 0 ? { isAme: provider.isAME } : {}
29
+ }
30
+ })),
31
+ serviceLocations: profile.locations.filter((location) => location.active !== false).map((location) => ({
32
+ id: location.id,
33
+ label: location.nickname || location.name,
34
+ value: {
35
+ name: location.name,
36
+ placeOfServiceCode: location.posCode ?? "",
37
+ address: { line1: location.street, city: location.city, state: location.state, postalCode: location.zip }
38
+ }
39
+ }))
40
+ };
41
+ }
42
+
3
43
  // src/index.tsx
4
44
  import "@mindbill/embed";
5
45
  import { createElement, useEffect as useEffect12, useRef as useRef8 } from "react";
@@ -99,8 +139,8 @@ var mindBillThemePresets = {
99
139
  textColor: "#05092e",
100
140
  mutedColor: "#596078",
101
141
  borderColor: "#d9dae1",
102
- borderRadius: "0px",
103
- controlRadius: "999px",
142
+ borderRadius: "10px",
143
+ controlRadius: "6px",
104
144
  shadow: "0 1px 2px rgba(5,9,46,.04)",
105
145
  dangerColor: "#b42318",
106
146
  successColor: "#167a58",
@@ -114,6 +154,7 @@ function resolveMindBillAppearance(appearance) {
114
154
  }
115
155
  function mindBillAppearanceStyle(appearance, style) {
116
156
  const resolved = resolveMindBillAppearance(appearance);
157
+ const dashboard = resolved.dashboard;
117
158
  return {
118
159
  "--mb-accent": resolved.accentColor,
119
160
  "--mb-accent-contrast": resolved.accentTextColor,
@@ -130,6 +171,25 @@ function mindBillAppearanceStyle(appearance, style) {
130
171
  "--mb-danger": resolved.dangerColor,
131
172
  "--mb-success": resolved.successColor,
132
173
  "--mb-warning": resolved.warningColor,
174
+ "--mbtk-border": dashboard?.borderColor ?? "var(--mb-border)",
175
+ "--mbtk-border-width": dashboard?.borderWidth ?? "1px",
176
+ "--mbtk-radius": dashboard?.borderRadius ?? "var(--mb-radius)",
177
+ "--mbtk-section-gap": dashboard?.sectionGap ?? "16px",
178
+ "--mbtk-row-height": dashboard?.rowMinHeight ?? "44px",
179
+ // Brand accents can be intentionally pale. Counts remain legible on a surface.
180
+ "--mbtk-link": dashboard?.linkColor ?? "var(--mb-text)",
181
+ "--mbtk-violet": dashboard?.sectionColors?.violet ?? "var(--mb-accent)",
182
+ "--mbtk-red": dashboard?.sectionColors?.red ?? "var(--mb-danger)",
183
+ "--mbtk-blue": dashboard?.sectionColors?.blue ?? "var(--mb-accent)",
184
+ "--mbtk-green": dashboard?.sectionColors?.green ?? "var(--mb-success)",
185
+ "--mbtk-amber": dashboard?.sectionColors?.amber ?? "var(--mb-warning)",
186
+ "--mbtk-neutral": dashboard?.sectionColors?.neutral ?? "var(--mb-muted)",
187
+ "--mbtk-aging-text": dashboard?.agingTextColor ?? "var(--mb-text)",
188
+ "--mbtk-aging-radius": dashboard?.agingRadius ?? "var(--mb-control-radius)",
189
+ ...Object.fromEntries(Array.from({ length: 5 }, (_, index) => [
190
+ `--mbtk-aging-${index + 1}`,
191
+ dashboard?.agingColors?.[index] ?? `color-mix(in srgb,var(--mb-accent) ${6 + index * 4}%,var(--mb-surface))`
192
+ ])),
133
193
  ...style
134
194
  };
135
195
  }
@@ -531,7 +591,7 @@ function BillReviewForm({
531
591
  if (!adjFormatValid) result.push("Valid WCAB / ADJ number");
532
592
  if (data.bill.billingMode === "med_legal" && !draft.dos) result.push("Date of service");
533
593
  if (!draft.billingProvider.name.trim()) result.push("Practice name");
534
- if (!draft.billingProvider.taxId.trim()) result.push("Tax ID");
594
+ if (!draft.billingProvider.taxId.trim() && !(draft.billingProvider.taxIdType === "SSN" && draft.billingProvider.taxIdConfigured)) result.push("Tax ID");
535
595
  if (!draft.billingProvider.npi.trim()) result.push("Billing NPI");
536
596
  if (!draft.clinician.name.trim() || !draft.clinician.npi.trim()) result.push("Clinician and NPI");
537
597
  if (![draft.location.name, draft.location.street, draft.location.city, draft.location.state, draft.location.zip].every((value) => value.trim())) result.push("Service location");
@@ -752,7 +812,14 @@ function BillReviewForm({
752
812
  ] }) }),
753
813
  /* @__PURE__ */ jsxs("div", { className: "mb-native-grid three", children: [
754
814
  /* @__PURE__ */ jsx(Field, { label: "Practice name", required: true, disabled: !editable, value: draft.billingProvider.name, onChange: (value) => updateBillingProvider("name", value) }),
755
- /* @__PURE__ */ jsx(Field, { label: "Tax ID", required: true, disabled: !editable, value: draft.billingProvider.taxId, onChange: (value) => updateBillingProvider("taxId", value) }),
815
+ /* @__PURE__ */ jsxs("label", { className: "mb-native-field", children: [
816
+ /* @__PURE__ */ jsx("span", { children: "Tax ID type" }),
817
+ /* @__PURE__ */ jsxs("select", { disabled: !editable, value: draft.billingProvider.taxIdType ?? "EIN", onChange: (event) => setDraft((current) => ({ ...current, billingProvider: { ...current.billingProvider, taxIdType: event.target.value, taxId: "", taxIdConfigured: false, taxIdLast4: "" } })), children: [
818
+ /* @__PURE__ */ jsx("option", { value: "EIN", children: "EIN (business)" }),
819
+ /* @__PURE__ */ jsx("option", { value: "SSN", children: "SSN (individual)" })
820
+ ] })
821
+ ] }),
822
+ /* @__PURE__ */ jsx(Field, { label: "Tax ID", type: draft.billingProvider.taxIdType === "SSN" ? "password" : "text", required: !(draft.billingProvider.taxIdType === "SSN" && draft.billingProvider.taxIdConfigured), disabled: !editable, value: draft.billingProvider.taxId, ...draft.billingProvider.taxIdType === "SSN" && draft.billingProvider.taxIdConfigured ? { hint: `Saved SSN ending in ${draft.billingProvider.taxIdLast4 ?? "\u2022\u2022\u2022\u2022"}. Leave blank to keep this bill's saved number.` } : {}, onChange: (value) => updateBillingProvider("taxId", value) }),
756
823
  /* @__PURE__ */ jsx(Field, { label: "Billing NPI", required: true, disabled: !editable, value: draft.billingProvider.npi, onChange: (value) => updateBillingProvider("npi", value) }),
757
824
  /* @__PURE__ */ jsx(Field, { label: "Phone", optional: true, disabled: !editable, value: draft.billingProvider.phone || "", onChange: (value) => updateBillingProvider("phone", value) }),
758
825
  /* @__PURE__ */ jsx(Field, { label: "Billing street", required: true, disabled: !editable, value: draft.billingProvider.billingStreet || "", onChange: (value) => updateBillingProvider("billingStreet", value) }),
@@ -2322,14 +2389,16 @@ function validateBillSubmission(bill) {
2322
2389
  required("claim.dateOfInjury", bill.claim.dateOfInjury, "Enter the date of injury.");
2323
2390
  required("claim.claimsAdministrator", bill.claim.claimsAdministrator?.name, "Select a claims administrator so MindBill can route this bill.");
2324
2391
  required("service.date", bill.service.date, "Enter the date of service.");
2325
- required("billingProvider.name", bill.billingProvider?.name, "Enter the billing provider name.");
2326
- required("billingProvider.taxId", bill.billingProvider?.taxId, "Enter the billing provider Tax ID (EIN or SSN).");
2327
- required("billingProvider.npi", bill.billingProvider?.npi, "Enter the billing provider NPI.");
2328
- required("billingProvider.phone", bill.billingProvider?.phone, "Enter the billing provider phone number.");
2329
- required("billingProvider.address.line1", bill.billingProvider?.address?.line1, "Enter the billing provider street address.");
2330
- required("billingProvider.address.city", bill.billingProvider?.address?.city, "Enter the billing provider city.");
2331
- required("billingProvider.address.state", bill.billingProvider?.address?.state, "Enter the billing provider 2-letter state code.");
2332
- required("billingProvider.address.postalCode", bill.billingProvider?.address?.postalCode, "Enter the billing provider ZIP code.");
2392
+ if (!bill.billingProvider?.savedProviderId?.trim() && !bill.billingProvider?.sourceBillId?.trim()) {
2393
+ required("billingProvider.name", bill.billingProvider?.name, "Enter the billing provider name.");
2394
+ required("billingProvider.taxId", bill.billingProvider?.taxId, "Enter the billing provider Tax ID (EIN or SSN).");
2395
+ required("billingProvider.npi", bill.billingProvider?.npi, "Enter the billing provider NPI.");
2396
+ required("billingProvider.phone", bill.billingProvider?.phone, "Enter the billing provider phone number.");
2397
+ required("billingProvider.address.line1", bill.billingProvider?.address?.line1, "Enter the billing provider street address.");
2398
+ required("billingProvider.address.city", bill.billingProvider?.address?.city, "Enter the billing provider city.");
2399
+ required("billingProvider.address.state", bill.billingProvider?.address?.state, "Enter the billing provider 2-letter state code.");
2400
+ required("billingProvider.address.postalCode", bill.billingProvider?.address?.postalCode, "Enter the billing provider ZIP code.");
2401
+ }
2333
2402
  required("renderingProvider.name", bill.renderingProvider?.name, "Enter the rendering provider name.");
2334
2403
  required("renderingProvider.npi", bill.renderingProvider?.npi, "Enter the rendering provider NPI.");
2335
2404
  required("renderingProvider.taxonomy", bill.renderingProvider?.taxonomy, "Enter the rendering provider taxonomy code.");
@@ -2350,11 +2419,11 @@ function validateBillSubmission(bill) {
2350
2419
  if (bill.patient.dateOfBirth && !parseBillSubmissionDate(bill.patient.dateOfBirth)) errors["patient.dateOfBirth"] = "Use MM/DD/YYYY";
2351
2420
  if (bill.claim.dateOfInjury && !parseBillSubmissionDate(bill.claim.dateOfInjury)) errors["claim.dateOfInjury"] = "Use MM/DD/YYYY";
2352
2421
  if (bill.patient.address.state.trim().length !== 2) errors["patient.address.state"] = "Use a 2-letter state code";
2353
- if (bill.billingProvider?.address?.state && bill.billingProvider.address.state.trim().length !== 2) errors["billingProvider.address.state"] = "Use a 2-letter state code.";
2422
+ if (!bill.billingProvider?.savedProviderId && !bill.billingProvider?.sourceBillId && bill.billingProvider?.address?.state && bill.billingProvider.address.state.trim().length !== 2) errors["billingProvider.address.state"] = "Use a 2-letter state code.";
2354
2423
  if (bill.serviceLocation?.address?.state && bill.serviceLocation.address.state.trim().length !== 2) errors["serviceLocation.address.state"] = "Use a 2-letter state code.";
2355
2424
  const digits = (value) => value?.replace(/\D/g, "") ?? "";
2356
- if (bill.billingProvider?.taxId && digits(bill.billingProvider.taxId).length !== 9) errors["billingProvider.taxId"] = "Enter a valid 9-digit EIN or SSN.";
2357
- if (bill.billingProvider?.npi && !/^\d{10}$/.test(digits(bill.billingProvider.npi))) errors["billingProvider.npi"] = "Enter a valid 10-digit NPI.";
2425
+ if (!bill.billingProvider?.savedProviderId && !bill.billingProvider?.sourceBillId && bill.billingProvider?.taxId && digits(bill.billingProvider.taxId).length !== 9) errors["billingProvider.taxId"] = "Enter a valid 9-digit EIN or SSN.";
2426
+ if (!bill.billingProvider?.savedProviderId && !bill.billingProvider?.sourceBillId && bill.billingProvider?.npi && !/^\d{10}$/.test(digits(bill.billingProvider.npi))) errors["billingProvider.npi"] = "Enter a valid 10-digit NPI.";
2358
2427
  if (bill.renderingProvider?.npi && !/^\d{10}$/.test(digits(bill.renderingProvider.npi))) errors["renderingProvider.npi"] = "Enter a valid 10-digit NPI.";
2359
2428
  if (bill.renderingProvider?.taxonomy && !/^[A-Za-z0-9]{10}$/.test(bill.renderingProvider.taxonomy.trim())) errors["renderingProvider.taxonomy"] = "Enter a valid 10-character taxonomy code.";
2360
2429
  if (bill.serviceLocation?.placeOfServiceCode && !/^\d{2}$/.test(bill.serviceLocation.placeOfServiceCode.trim())) errors["serviceLocation.placeOfServiceCode"] = "Enter a valid 2-digit place of service code.";
@@ -2564,6 +2633,8 @@ function BillSubmissionForm({
2564
2633
  getSession,
2565
2634
  sessionEndpoint,
2566
2635
  apiBaseUrl,
2636
+ profileOptions,
2637
+ profileDisplay = "expanded",
2567
2638
  fetch: fetchOverride,
2568
2639
  onListClaimsAdministrators,
2569
2640
  onSearchClaimsAdministrators,
@@ -2593,6 +2664,7 @@ function BillSubmissionForm({
2593
2664
  children
2594
2665
  }) {
2595
2666
  const [bill, setBill] = useState5(() => cloneInitialBill(initialBill));
2667
+ const [providerEditing, setProviderEditing] = useState5(false);
2596
2668
  const [selectedIds, setSelectedIds] = useState5(() => attachments.map((item) => item.id));
2597
2669
  const [removedSourceIds, setRemovedSourceIds] = useState5([]);
2598
2670
  const [uploads, setUploads] = useState5([]);
@@ -2867,6 +2939,8 @@ function BillSubmissionForm({
2867
2939
  const administrator2 = clean.claim.claimsAdministrator;
2868
2940
  const complete = {
2869
2941
  ...clean,
2942
+ ...clean.billingProvider?.savedProviderId ? { billingProvider: { savedProviderId: clean.billingProvider.savedProviderId } } : {},
2943
+ ...clean.billingProvider?.sourceBillId ? { billingProvider: { sourceBillId: clean.billingProvider.sourceBillId } } : {},
2870
2944
  claim: {
2871
2945
  ...clean.claim,
2872
2946
  ...administrator2 ? { claimsAdministrator: submittedClaimsAdministrator(administrator2) } : {}
@@ -3084,36 +3158,79 @@ function BillSubmissionForm({
3084
3158
  ] })
3085
3159
  ] })
3086
3160
  ] });
3161
+ const compactProviders = profileDisplay === "compact";
3162
+ const providerErrors = Object.keys(errors).some((path) => /^(billingProvider|renderingProvider|serviceLocation)\./.test(path));
3087
3163
  const providersSection = /* @__PURE__ */ jsxs5("fieldset", { className: "mbsf-card", disabled: locked, children: [
3088
3164
  /* @__PURE__ */ jsx5("legend", { className: "mbsf-legend", children: "Providers & place of service" }),
3089
- /* @__PURE__ */ jsxs5("div", { className: "mbsf-grid", children: [
3090
- /* @__PURE__ */ jsx5("h4", { className: "mbsf-subhead", children: "Billing provider" }),
3091
- /* @__PURE__ */ jsx5(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 } }))) }),
3092
- /* @__PURE__ */ jsx5(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" }) }),
3093
- /* @__PURE__ */ jsx5(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 }) }),
3094
- /* @__PURE__ */ jsx5(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" }) }),
3095
- /* @__PURE__ */ jsx5(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 ?? "" } } }))) }),
3096
- /* @__PURE__ */ jsx5(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 ?? "" } } }))) }),
3097
- /* @__PURE__ */ jsx5(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 ?? "" } } }))) }),
3098
- /* @__PURE__ */ jsx5(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 }) }),
3099
- /* @__PURE__ */ jsx5(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 } } }))) }),
3100
- /* @__PURE__ */ jsx5("h4", { className: "mbsf-subhead", children: "Rendering provider" }),
3101
- /* @__PURE__ */ jsx5(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 } }))) }),
3102
- /* @__PURE__ */ jsx5(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 }) }),
3103
- /* @__PURE__ */ jsxs5(Field2, { path: "renderingProvider.taxonomy", label: "Rendering taxonomy", required: true, error: errors["renderingProvider.taxonomy"], children: [
3104
- /* @__PURE__ */ jsx5(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) => {
3105
- const code = query.trim().toUpperCase();
3106
- return /^[A-Z0-9]{10}$/.test(code) ? { id: code, label: code, detail: "Use this taxonomy code" } : null;
3107
- }, onSelect: (option) => setBill((c) => ({ ...c, renderingProvider: { ...c.renderingProvider, taxonomy: option.id } })) }),
3108
- /* @__PURE__ */ jsx5("small", { className: "mbsf-help", children: "Search by specialty name or 10-character taxonomy code." })
3109
- ] }),
3110
- /* @__PURE__ */ jsx5("h4", { className: "mbsf-subhead", children: "Service facility" }),
3111
- /* @__PURE__ */ jsx5(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" }) }),
3112
- /* @__PURE__ */ jsx5(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 ?? "" } } }))) }),
3113
- /* @__PURE__ */ jsx5(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 ?? "" } } }))) }),
3114
- /* @__PURE__ */ jsx5(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 ?? "" } } }))) }),
3115
- /* @__PURE__ */ jsx5(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 }) }),
3116
- /* @__PURE__ */ jsx5(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 } } }))) })
3165
+ /* @__PURE__ */ jsx5("div", { className: "mbsf-grid", children: [["billingProviders", "billingProvider", "Billing provider"], ["renderingProviders", "renderingProvider", "Rendering provider"], ["serviceLocations", "serviceLocation", "Service location"]].map(([collection, key, label]) => {
3166
+ const options = profileOptions?.[collection];
3167
+ return options?.length ? /* @__PURE__ */ jsxs5(Field2, { label: `Saved ${label.toLowerCase()}`, children: [
3168
+ /* @__PURE__ */ jsx5(ComboBox, { ariaLabel: `Saved ${label.toLowerCase()}`, disabled: locked, value: "", placeholder: bill[key]?.name || `Choose ${label.toLowerCase()}\u2026`, options: options.map(({ id, label: optionLabel }) => ({ id, label: optionLabel })), onSelect: ({ id }) => {
3169
+ const option = options.find((candidate) => candidate.id === id);
3170
+ if (option) setBill((current) => ({ ...current, [key]: structuredClone(option.value) }));
3171
+ } }),
3172
+ /* @__PURE__ */ jsx5("small", { className: "mbsf-help", children: bill[key]?.name ? `Current: ${bill[key]?.name}` : "Select a profile or enter details below." })
3173
+ ] }, key) : null;
3174
+ }) }),
3175
+ compactProviders ? /* @__PURE__ */ jsx5("p", { className: "mbsf-help", children: [bill.billingProvider?.name, bill.renderingProvider?.name, bill.serviceLocation?.name].filter(Boolean).join(" \xB7 ") || "Enter provider details or choose saved profiles." }) : null,
3176
+ /* @__PURE__ */ jsxs5("details", { open: !compactProviders || providerEditing || providerErrors, children: [
3177
+ /* @__PURE__ */ jsx5("summary", { hidden: !compactProviders, onClick: (event) => {
3178
+ event.preventDefault();
3179
+ setProviderEditing((current) => !current);
3180
+ }, style: { cursor: "pointer", marginBottom: 12 }, children: "Review or edit provider details" }),
3181
+ /* @__PURE__ */ jsxs5("div", { className: "mbsf-grid", children: [
3182
+ /* @__PURE__ */ jsx5("h4", { className: "mbsf-subhead", children: "Billing provider" }),
3183
+ bill.billingProvider?.savedProviderId || bill.billingProvider?.sourceBillId ? /* @__PURE__ */ jsxs5("div", { className: "mbsf-span", children: [
3184
+ /* @__PURE__ */ jsxs5("p", { children: [
3185
+ "Using ",
3186
+ bill.billingProvider.sourceBillId ? "this bill\u2019s original" : "saved",
3187
+ " billing provider: ",
3188
+ bill.billingProvider.name,
3189
+ ". SSN ending in ",
3190
+ bill.billingProvider.taxIdLast4 || "\u2022\u2022\u2022\u2022",
3191
+ " stays on MindBill\u2019s server."
3192
+ ] }),
3193
+ /* @__PURE__ */ jsx5("button", { type: "button", className: "mbsf-secondary", disabled: locked, onClick: () => setBill((c) => {
3194
+ const billingProvider = { ...c.billingProvider, taxIdType: "EIN", taxId: "" };
3195
+ delete billingProvider.savedProviderId;
3196
+ delete billingProvider.sourceBillId;
3197
+ delete billingProvider.taxIdLast4;
3198
+ return { ...c, billingProvider };
3199
+ }), children: "Enter different billing provider details" })
3200
+ ] }) : null,
3201
+ /* @__PURE__ */ jsxs5("fieldset", { disabled: locked || Boolean(bill.billingProvider?.savedProviderId || bill.billingProvider?.sourceBillId), style: { display: "contents" }, children: [
3202
+ /* @__PURE__ */ jsx5(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 } }))) }),
3203
+ /* @__PURE__ */ jsx5(Field2, { label: "Tax ID type", children: /* @__PURE__ */ jsxs5("select", { className: "mbsf-select", value: bill.billingProvider?.taxIdType ?? "EIN", onChange: (event) => setBill((c) => ({ ...c, billingProvider: { ...c.billingProvider, taxIdType: event.target.value, taxId: "" } })), children: [
3204
+ /* @__PURE__ */ jsx5("option", { value: "EIN", children: "EIN (business)" }),
3205
+ /* @__PURE__ */ jsx5("option", { value: "SSN", children: "SSN (individual)" })
3206
+ ] }) }),
3207
+ /* @__PURE__ */ jsx5(Field2, { path: "billingProvider.taxId", label: bill.billingProvider?.taxIdType === "SSN" ? "SSN" : "EIN", required: true, error: errors["billingProvider.taxId"], children: /* @__PURE__ */ jsx5("input", { className: "mbsf-input", autoComplete: "off", type: bill.billingProvider?.taxIdType === "SSN" ? "password" : "text", inputMode: "numeric", value: bill.billingProvider?.taxId ?? "", onChange: (event) => setBill((c) => ({ ...c, billingProvider: { ...c.billingProvider, taxId: event.target.value } })) }) }),
3208
+ /* @__PURE__ */ jsx5(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 }) }),
3209
+ /* @__PURE__ */ jsx5(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" }) }),
3210
+ /* @__PURE__ */ jsx5(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 ?? "" } } }))) }),
3211
+ /* @__PURE__ */ jsx5(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 ?? "" } } }))) }),
3212
+ /* @__PURE__ */ jsx5(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 ?? "" } } }))) }),
3213
+ /* @__PURE__ */ jsx5(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 }) }),
3214
+ /* @__PURE__ */ jsx5(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 } } }))) })
3215
+ ] }),
3216
+ /* @__PURE__ */ jsx5("h4", { className: "mbsf-subhead", children: "Rendering provider" }),
3217
+ /* @__PURE__ */ jsx5(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 } }))) }),
3218
+ /* @__PURE__ */ jsx5(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 }) }),
3219
+ /* @__PURE__ */ jsxs5(Field2, { path: "renderingProvider.taxonomy", label: "Rendering taxonomy", required: true, error: errors["renderingProvider.taxonomy"], children: [
3220
+ /* @__PURE__ */ jsx5(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) => {
3221
+ const code = query.trim().toUpperCase();
3222
+ return /^[A-Z0-9]{10}$/.test(code) ? { id: code, label: code, detail: "Use this taxonomy code" } : null;
3223
+ }, onSelect: (option) => setBill((c) => ({ ...c, renderingProvider: { ...c.renderingProvider, taxonomy: option.id } })) }),
3224
+ /* @__PURE__ */ jsx5("small", { className: "mbsf-help", children: "Search by specialty name or 10-character taxonomy code." })
3225
+ ] }),
3226
+ /* @__PURE__ */ jsx5("h4", { className: "mbsf-subhead", children: "Service facility" }),
3227
+ /* @__PURE__ */ jsx5(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" }) }),
3228
+ /* @__PURE__ */ jsx5(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 ?? "" } } }))) }),
3229
+ /* @__PURE__ */ jsx5(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 ?? "" } } }))) }),
3230
+ /* @__PURE__ */ jsx5(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 ?? "" } } }))) }),
3231
+ /* @__PURE__ */ jsx5(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 }) }),
3232
+ /* @__PURE__ */ jsx5(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 } } }))) })
3233
+ ] })
3117
3234
  ] })
3118
3235
  ] });
3119
3236
  const serviceLinesSection = /* @__PURE__ */ jsxs5("fieldset", { className: "mbsf-card", disabled: locked, children: [
@@ -3705,37 +3822,29 @@ import {
3705
3822
  buildBillTasksDashboard
3706
3823
  } from "@mindbill/browser";
3707
3824
  import { Fragment as Fragment6, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
3708
- var TONES = {
3709
- violet: "#7c53c3",
3710
- red: "#cf4437",
3711
- blue: "#2f7fd1",
3712
- green: "#2c9a5b",
3713
- amber: "#d9931f",
3714
- neutral: "#8195a1"
3715
- };
3716
- var BUCKET_PILL_BASES = ["#2c9a5b", "#1f9aa8", "#dcbb28", "#e08a2e", "#d75d8a"];
3717
3825
  var css6 = `
3718
3826
  .mbtk{color:var(--mb-text);font-family:var(--mb-font);font-size:14px}.mbtk *{box-sizing:border-box}.mbtk h2,.mbtk p{margin:0}
3719
3827
  .mbtk-heading{margin-bottom:14px}.mbtk-heading h2{font-size:24px}
3720
3828
  .mbtk-toolbar{margin-bottom:14px}
3721
- .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}
3722
- .mbtk-section.is-grand{border-color:var(--mb-border)}
3829
+ .mbtk-section{margin-bottom:var(--mbtk-section-gap);border:var(--mbtk-border-width) solid var(--mbtk-border);border-radius:var(--mbtk-radius);background:var(--mb-surface);box-shadow:var(--mb-shadow);overflow:hidden}
3723
3830
  .mbtk-grid{display:grid;grid-template-columns:var(--mbtk-cols);gap:0 10px;align-items:center;padding:0 16px}
3724
- .mbtk-head{padding:12px 16px;border-bottom:1px solid color-mix(in srgb,var(--mbtk-tone,var(--mb-border)) 22%,var(--mb-border))}
3831
+ .mbtk-head{padding:12px 16px;border-bottom:1px solid var(--mb-border)}
3725
3832
  .mbtk-title{display:flex;align-items:center;gap:9px;min-width:0}
3726
3833
  .mbtk-dot{flex:0 0 auto;width:11px;height:11px;border-radius:50%;background:var(--mbtk-tone,var(--mb-muted))}
3727
3834
  .mbtk-title-text{min-width:0}
3728
3835
  .mbtk-title-text strong{display:block;font-size:15.5px;line-height:1.3}
3729
3836
  .mbtk-basis{display:block;color:var(--mb-muted);font-size:12px;line-height:1.35}
3730
- .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}
3837
+ .mbtk-pill{justify-self:stretch;padding:5px 6px;border-radius:var(--mbtk-aging-radius);background:var(--mb-soft);background:var(--mbtk-pill);color:var(--mbtk-aging-text);font-size:11px;font-weight:750;line-height:1.25;text-align:center;white-space:nowrap}
3731
3838
  .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}
3732
- .mbtk-row{border-top:1px solid color-mix(in srgb,var(--mb-border) 60%,transparent);min-height:44px}
3839
+ .mbtk-row{border-top:1px solid color-mix(in srgb,var(--mb-border) 60%,transparent);min-height:var(--mbtk-row-height)}
3733
3840
  .mbtk-row:first-of-type{border-top:0}
3734
3841
  .mbtk-rowlabel{color:var(--mb-muted);font-size:13px;line-height:1.35;padding:9px 0;overflow-wrap:anywhere}
3735
3842
  .mbtk-count{text-align:center;font-variant-numeric:tabular-nums}
3736
3843
  .mbtk-zero{color:var(--mb-muted)}
3737
- .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}
3844
+ .mbtk-bal{display:block;color:var(--mb-muted);font-size:11px;font-weight:550;line-height:1.35;white-space:nowrap;font-variant-numeric:tabular-nums}
3845
+ .mbtk-link{border:0;background:none;padding:6px 8px;min-height:44px;min-width:44px;color:var(--mbtk-link);font:inherit;font-weight:750;font-variant-numeric:tabular-nums;cursor:pointer;border-radius:var(--mb-control-radius)}
3738
3846
  .mbtk-link:hover{text-decoration:underline;background:color-mix(in srgb,var(--mb-accent) 8%,transparent)}
3847
+ .mbtk-link:focus-visible{outline:2px solid var(--mbtk-link);outline-offset:2px;text-decoration:underline}
3739
3848
  .mbtk-total{text-align:center}
3740
3849
  .mbtk-totals{background:var(--mb-soft);border-top:1px solid var(--mb-border);font-weight:760}
3741
3850
  .mbtk-totals .mbtk-rowlabel{color:var(--mb-text);font-weight:760}
@@ -3745,17 +3854,26 @@ var css6 = `
3745
3854
  .mbtk-footnote{margin-top:12px;color:var(--mb-muted);font-size:12.5px}
3746
3855
  @media(max-width:760px){.mbtk-pill,.mbtk-colhead,.mbtk-count{display:none}.mbtk-grid{grid-template-columns:minmax(0,1fr) auto}}
3747
3856
  `;
3748
- function cellButton(key, count, className, label, onSelect) {
3857
+ var USD = new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" });
3858
+ function cellBody(count, balance) {
3859
+ return /* @__PURE__ */ jsxs8(Fragment6, { children: [
3860
+ /* @__PURE__ */ jsx8("span", { children: count }),
3861
+ count > 0 && balance !== void 0 && Number.isFinite(balance) ? /* @__PURE__ */ jsx8("span", { className: "mbtk-bal", children: USD.format(balance) }) : null
3862
+ ] });
3863
+ }
3864
+ function cellButton(key, count, className, label, onSelect, balance) {
3865
+ const ariaLabel = count > 0 && balance !== void 0 && Number.isFinite(balance) ? `${label} \xB7 ${USD.format(balance)} due` : label;
3749
3866
  if (count > 0 && onSelect) {
3750
- return /* @__PURE__ */ jsx8("span", { className, children: /* @__PURE__ */ jsx8("button", { type: "button", className: "mbtk-link", "aria-label": label, onClick: onSelect, children: count }) }, key);
3867
+ return /* @__PURE__ */ jsx8("span", { className, children: /* @__PURE__ */ jsx8("button", { type: "button", className: "mbtk-link", "aria-label": ariaLabel, onClick: onSelect, children: cellBody(count, balance) }) }, key);
3751
3868
  }
3752
- return /* @__PURE__ */ jsx8("span", { className: `${className}${count === 0 ? " mbtk-zero" : ""}`, children: count }, key);
3869
+ return /* @__PURE__ */ jsx8("span", { className: `${className}${count === 0 ? " mbtk-zero" : ""}`, children: cellBody(count, balance) }, key);
3753
3870
  }
3754
3871
  function TaskRow({
3755
3872
  sectionId,
3756
3873
  row,
3757
3874
  buckets,
3758
- onSelectCell
3875
+ onSelectCell,
3876
+ itemLabel
3759
3877
  }) {
3760
3878
  const allRefs = row.refs.flat();
3761
3879
  return /* @__PURE__ */ jsxs8("div", { className: "mbtk-grid mbtk-row", children: [
@@ -3766,16 +3884,18 @@ function TaskRow({
3766
3884
  bucket.id,
3767
3885
  count,
3768
3886
  "mbtk-count",
3769
- `${row.label} \xB7 ${bucket.label}: ${count} tasks`,
3770
- onSelectCell ? () => onSelectCell({ sectionId, rowId: row.id, bucketId: bucket.id, refs: row.refs[index] ?? [], count }) : null
3887
+ `${row.label} \xB7 ${bucket.label}: ${count} ${itemLabel}`,
3888
+ onSelectCell ? () => onSelectCell({ sectionId, rowId: row.id, bucketId: bucket.id, refs: row.refs[index] ?? [], count }) : null,
3889
+ row.balances?.[index]
3771
3890
  );
3772
3891
  }),
3773
3892
  cellButton(
3774
3893
  "task-total",
3775
3894
  row.total,
3776
3895
  "mbtk-total",
3777
- `${row.label} \xB7 all ages: ${row.total} tasks`,
3778
- onSelectCell ? () => onSelectCell({ sectionId, rowId: row.id, bucketId: null, refs: allRefs, count: row.total }) : null
3896
+ `${row.label} \xB7 all ages: ${row.total} ${itemLabel}`,
3897
+ onSelectCell ? () => onSelectCell({ sectionId, rowId: row.id, bucketId: null, refs: allRefs, count: row.total }) : null,
3898
+ row.balanceTotal
3779
3899
  )
3780
3900
  ] });
3781
3901
  }
@@ -3783,13 +3903,15 @@ function SectionCard({
3783
3903
  section,
3784
3904
  buckets,
3785
3905
  emptyLabel,
3786
- onSelectCell
3906
+ onSelectCell,
3907
+ totalLabel,
3908
+ itemLabel
3787
3909
  }) {
3788
3910
  return /* @__PURE__ */ jsxs8(
3789
3911
  "section",
3790
3912
  {
3791
3913
  className: "mbtk-section",
3792
- style: { "--mbtk-tone": TONES[section.tone] },
3914
+ style: { "--mbtk-tone": `var(--mbtk-${section.tone})` },
3793
3915
  "aria-label": section.label,
3794
3916
  children: [
3795
3917
  /* @__PURE__ */ jsxs8("div", { className: "mbtk-grid mbtk-head", children: [
@@ -3807,19 +3929,19 @@ function SectionCard({
3807
3929
  "span",
3808
3930
  {
3809
3931
  className: "mbtk-pill",
3810
- style: { "--mbtk-pill": BUCKET_PILL_BASES[index % BUCKET_PILL_BASES.length] },
3932
+ style: { "--mbtk-pill": `var(--mbtk-aging-${Math.min(index + 1, 5)})` },
3811
3933
  children: bucket.label
3812
3934
  },
3813
3935
  bucket.id
3814
3936
  )),
3815
- /* @__PURE__ */ jsx8("span", { className: "mbtk-colhead", children: "Task Total" })
3937
+ /* @__PURE__ */ jsx8("span", { className: "mbtk-colhead", children: totalLabel })
3816
3938
  ] }),
3817
3939
  section.empty ? /* @__PURE__ */ jsx8("p", { className: "mbtk-empty", children: emptyLabel }) : /* @__PURE__ */ jsxs8(Fragment6, { children: [
3818
- section.rows.map((row) => /* @__PURE__ */ jsx8(TaskRow, { sectionId: section.id, row, buckets, onSelectCell }, row.id)),
3940
+ section.rows.map((row) => /* @__PURE__ */ jsx8(TaskRow, { sectionId: section.id, row, buckets, onSelectCell, itemLabel }, row.id)),
3819
3941
  /* @__PURE__ */ jsxs8("div", { className: "mbtk-grid mbtk-row mbtk-totals", children: [
3820
3942
  /* @__PURE__ */ jsx8("span", { className: "mbtk-rowlabel", children: "Total" }),
3821
- buckets.map((bucket, index) => /* @__PURE__ */ jsx8("span", { className: "mbtk-count", children: section.totals[index] ?? 0 }, bucket.id)),
3822
- /* @__PURE__ */ jsx8("span", { className: "mbtk-total", children: section.total })
3943
+ buckets.map((bucket, index) => /* @__PURE__ */ jsx8("span", { className: "mbtk-count", children: cellBody(section.totals[index] ?? 0, section.balanceTotals?.[index]) }, bucket.id)),
3944
+ /* @__PURE__ */ jsx8("span", { className: "mbtk-total", children: cellBody(section.total, section.balanceTotal) })
3823
3945
  ] })
3824
3946
  ] })
3825
3947
  ]
@@ -3831,6 +3953,8 @@ function BillTasksDashboard({
3831
3953
  buckets = BILL_TASKS_AGING_BUCKETS,
3832
3954
  heading,
3833
3955
  grandTotalLabel = "Bill Tasks Total",
3956
+ totalLabel = "Task Total",
3957
+ itemLabel = "tasks",
3834
3958
  emptyLabel = "No Tasks",
3835
3959
  onSelectCell,
3836
3960
  toolbar,
@@ -3855,14 +3979,16 @@ function BillTasksDashboard({
3855
3979
  section,
3856
3980
  buckets,
3857
3981
  emptyLabel,
3858
- onSelectCell
3982
+ onSelectCell,
3983
+ totalLabel,
3984
+ itemLabel
3859
3985
  },
3860
3986
  section.id
3861
3987
  )),
3862
3988
  /* @__PURE__ */ jsx8("section", { className: "mbtk-section is-grand", "aria-label": grandTotalLabel, children: /* @__PURE__ */ jsxs8("div", { className: "mbtk-grid mbtk-row mbtk-grand mbtk-totals", children: [
3863
3989
  /* @__PURE__ */ jsx8("span", { className: "mbtk-rowlabel", children: grandTotalLabel }),
3864
- buckets.map((bucket, index) => /* @__PURE__ */ jsx8("span", { className: "mbtk-count", children: data.grandTotals[index] ?? 0 }, bucket.id)),
3865
- /* @__PURE__ */ jsx8("span", { className: "mbtk-total", children: data.grandTotal })
3990
+ buckets.map((bucket, index) => /* @__PURE__ */ jsx8("span", { className: "mbtk-count", children: cellBody(data.grandTotals[index] ?? 0, data.grandBalanceTotals?.[index]) }, bucket.id)),
3991
+ /* @__PURE__ */ jsx8("span", { className: "mbtk-total", children: cellBody(data.grandTotal, data.grandBalanceTotal) })
3866
3992
  ] }) }),
3867
3993
  footnote ? /* @__PURE__ */ jsx8("p", { className: "mbtk-footnote", children: footnote }) : null
3868
3994
  ]
@@ -4401,13 +4527,45 @@ function ReportBillStatusDialog({
4401
4527
  }
4402
4528
 
4403
4529
  // src/organization-onboarding.tsx
4404
- import { useCallback as useCallback2, useEffect as useEffect7, useMemo as useMemo6, useRef as useRef3, useState as useState8 } from "react";
4530
+ import { useCallback as useCallback2, useEffect as useEffect7, useId as useId2, useMemo as useMemo6, useRef as useRef3, useState as useState8 } from "react";
4405
4531
  import {
4406
4532
  createOrganizationClient
4407
4533
  } from "@mindbill/browser";
4534
+
4535
+ // src/tax-id-input.tsx
4536
+ import { organizationTaxIdWrite } from "@mindbill/browser";
4408
4537
  import { Fragment as Fragment9, jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
4538
+ function TaxIdInput({ label, value, onChange, disabled }) {
4539
+ const saved = value.taxIdType === "SSN" && value.taxIdConfigured;
4540
+ return /* @__PURE__ */ jsxs11("div", { className: "mbob-field mbob-tax-id", children: [
4541
+ /* @__PURE__ */ jsxs11("label", { children: [
4542
+ label,
4543
+ " type",
4544
+ /* @__PURE__ */ jsxs11("select", { disabled, value: value.taxIdType ?? "EIN", onChange: (event) => onChange({ taxIdType: event.target.value, taxId: "", taxIdConfigured: false, taxIdLast4: "" }), children: [
4545
+ /* @__PURE__ */ jsx11("option", { value: "EIN", children: "EIN (business)" }),
4546
+ /* @__PURE__ */ jsx11("option", { value: "SSN", children: "SSN (individual)" })
4547
+ ] })
4548
+ ] }),
4549
+ /* @__PURE__ */ jsxs11("label", { children: [
4550
+ label,
4551
+ /* @__PURE__ */ jsx11("input", { disabled, autoComplete: "off", inputMode: "numeric", type: value.taxIdType === "SSN" ? "password" : "text", value: value.taxId ?? "", placeholder: saved ? "Leave blank to keep saved SSN" : "", onChange: (event) => onChange({ taxId: event.target.value }) })
4552
+ ] }),
4553
+ saved ? /* @__PURE__ */ jsxs11(Fragment9, { children: [
4554
+ /* @__PURE__ */ jsxs11("small", { children: [
4555
+ "Saved SSN ending in ",
4556
+ value.taxIdLast4 ?? "\u2022\u2022\u2022\u2022",
4557
+ ". The full number is not returned to your browser."
4558
+ ] }),
4559
+ /* @__PURE__ */ jsx11("button", { type: "button", disabled, onClick: () => onChange({ taxId: "", taxIdConfigured: false, taxIdLast4: "" }), children: "Clear saved SSN on save" })
4560
+ ] }) : null
4561
+ ] });
4562
+ }
4563
+
4564
+ // src/organization-onboarding.tsx
4565
+ import { Fragment as Fragment10, jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
4409
4566
  var STEPS = [
4410
4567
  { id: "practice", label: "Practice & billing" },
4568
+ { id: "rendering", label: "Rendering providers" },
4411
4569
  { id: "locations", label: "Locations" },
4412
4570
  { id: "w9", label: "W-9" },
4413
4571
  { id: "review", label: "Review" }
@@ -4419,13 +4577,14 @@ var css9 = `
4419
4577
  .mbob-steps{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:20px}
4420
4578
  .mbob-step{display:inline-flex;align-items:center;gap:7px;border:1px solid var(--mb-border);border-radius:999px;background:var(--mb-surface);padding:7px 13px;color:var(--mb-muted);font:inherit;font-size:13px;font-weight:700;cursor:pointer}
4421
4579
  .mbob-step[data-active=true]{border-color:var(--mb-accent);color:var(--mb-accent);background:color-mix(in srgb,var(--mb-accent) 8%,var(--mb-surface))}
4422
- .mbob-step[data-done=true] i{color:#159447;font-style:normal}
4423
- .mbob-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px 22px}.mbob-span{grid-column:1/-1}
4580
+ .mbob-step[data-done=true] i{color:var(--mb-success);font-style:normal}
4581
+ .mbob-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px 22px;align-items:start}.mbob-span{grid-column:1/-1}
4582
+ .mbob-tax-id label{display:grid;gap:7px}.mbob-tax-id small{color:var(--mb-muted);font-weight:450;line-height:1.5}.mbob-tax-id button{justify-self:start;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);background:var(--mb-surface);color:var(--mb-text);padding:8px 10px;font:inherit;cursor:pointer}
4424
4583
  .mbob-field{display:grid;gap:7px;font-size:13px;font-weight:720}
4425
- .mbob-field input{width:100%;min-height:44px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);background:var(--mb-input);padding:10px 12px;color:var(--mb-text);font:inherit;font-weight:450}
4584
+ .mbob-field input,.mbob-field select{width:100%;min-height:44px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);background:var(--mb-input);padding:10px 12px;color:var(--mb-text);font:inherit;font-weight:450}
4426
4585
  .mbob-field input:focus{outline:3px solid color-mix(in srgb,var(--mb-accent) 22%,transparent);border-color:var(--mb-accent)}
4427
4586
  .mbob-subhead{margin:20px 0 12px!important;padding-top:16px;border-top:1px solid var(--mb-border);font-size:15px}
4428
- .mbob-loc{display:grid;grid-template-columns:1.2fr 1.4fr .9fr .4fr .6fr auto auto;gap:10px;align-items:end;border-top:1px solid color-mix(in srgb,var(--mb-border) 60%,transparent);padding:12px 0}
4587
+ .mbob-loc{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;align-items:end;border-top:1px solid color-mix(in srgb,var(--mb-border) 60%,transparent);padding:16px 0}
4429
4588
  .mbob-loc:first-of-type{border-top:0}
4430
4589
  .mbob-primary{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--mb-muted);white-space:nowrap;padding-bottom:12px}
4431
4590
  .mbob-remove{border:0;background:transparent;color:var(--mb-muted);font-size:20px;cursor:pointer;padding-bottom:8px}
@@ -4433,21 +4592,22 @@ var css9 = `
4433
4592
  .mbob-drop{display:grid;place-content:center;gap:6px;min-height:150px;border:2px dashed color-mix(in srgb,var(--mb-muted) 55%,transparent);border-radius:var(--mb-control-radius);text-align:center;cursor:pointer;position:relative}
4434
4593
  .mbob-drop input{position:absolute;inset:0;opacity:0;cursor:pointer}
4435
4594
  .mbob-drop span{color:var(--mb-muted);font-size:13px}
4436
- .mbob-w9-current{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid #9fd6b4;border-radius:var(--mb-control-radius);background:#f3fcf6;padding:12px 14px;margin-bottom:14px}
4595
+ .mbob-w9-current{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid color-mix(in srgb,var(--mb-success) 35%,var(--mb-border));border-radius:var(--mb-control-radius);background:color-mix(in srgb,var(--mb-success) 8%,var(--mb-surface));padding:12px 14px;margin-bottom:14px}
4437
4596
  .mbob-w9-current span{color:var(--mb-muted);font-size:13px}
4438
4597
  .mbob-check{display:grid;gap:9px}
4439
4598
  .mbob-check-item{display:flex;align-items:center;gap:10px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);padding:11px 14px}
4440
- .mbob-check-item[data-complete=true]{border-color:#9fd6b4;background:#f3fcf6}
4599
+ .mbob-check-item[data-complete=true]{border-color:color-mix(in srgb,var(--mb-success) 35%,var(--mb-border));background:color-mix(in srgb,var(--mb-success) 8%,var(--mb-surface))}
4441
4600
  .mbob-check-item i{font-style:normal}
4442
4601
  .mbob-actions{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-top:20px}
4443
4602
  .mbob-save{min-width:170px;border:0;border-radius:var(--mb-control-radius);background:var(--mb-accent);color:var(--mb-accent-contrast);padding:12px 22px;font:inherit;font-weight:780;cursor:pointer}
4444
4603
  .mbob-save:disabled{opacity:.6;cursor:wait}
4445
4604
  .mbob-error{margin-top:14px;border-left:4px solid var(--mb-danger);border-radius:var(--mb-control-radius);background:color-mix(in srgb,var(--mb-danger) 8%,var(--mb-surface));padding:12px 14px;color:var(--mb-danger)}
4446
4605
  .mbob-status{color:var(--mb-muted)}
4447
- .mbob-done{color:#159447;font-weight:750}
4606
+ .mbob-done{color:var(--mb-success);font-weight:750}
4448
4607
  @media(max-width:820px){.mbob-grid{grid-template-columns:1fr}.mbob-span{grid-column:auto}.mbob-loc{grid-template-columns:1fr 1fr;align-items:center}.mbob-loc>*{grid-column:auto}}
4449
4608
  `;
4450
4609
  var blankLocation = () => ({ name: "", street: "", city: "", state: "", zip: "", isPrimary: false });
4610
+ var blankRendering = () => ({ name: "", npi: "", specialty: "", taxonomy: "", active: true });
4451
4611
  async function fileToBase64(file) {
4452
4612
  const buffer = new Uint8Array(await file.arrayBuffer());
4453
4613
  let binary = "";
@@ -4482,6 +4642,8 @@ function OrganizationOnboarding({
4482
4642
  const [identity, setIdentity] = useState8({ name: "", legalName: "", taxId: "", npi: "", phone: "", email: "" });
4483
4643
  const [provider, setProvider] = useState8({ name: "", taxId: "", npi: "", billType: "Professional", phone: "", billingStreet: "", billingCity: "", billingState: "", billingZip: "" });
4484
4644
  const [locations, setLocations] = useState8([blankLocation()]);
4645
+ const [rendering, setRendering] = useState8(blankRendering);
4646
+ const primaryGroup = useId2();
4485
4647
  const [w9File, setW9File] = useState8(null);
4486
4648
  const [saving, setSaving] = useState8(false);
4487
4649
  const [error, setError] = useState8(null);
@@ -4492,12 +4654,16 @@ function OrganizationOnboarding({
4492
4654
  setIdentity((current) => ({
4493
4655
  name: next.practiceIdentity.name ?? current.name,
4494
4656
  legalName: next.practiceIdentity.legalName ?? current.legalName,
4495
- taxId: next.practiceIdentity.taxId ?? current.taxId,
4657
+ taxId: next.practiceIdentity.taxId ?? "",
4658
+ taxIdType: next.practiceIdentity.taxIdType ?? "EIN",
4659
+ taxIdLast4: next.practiceIdentity.taxIdLast4 ?? "",
4660
+ taxIdConfigured: next.practiceIdentity.taxIdConfigured ?? false,
4496
4661
  npi: next.practiceIdentity.npi ?? current.npi,
4497
4662
  phone: next.practiceIdentity.phone ?? current.phone,
4498
4663
  email: next.practiceIdentity.email ?? current.email
4499
4664
  }));
4500
4665
  if (next.billingProviders[0]) setProvider({ billType: "Professional", ...next.billingProviders[0] });
4666
+ if (next.renderingProviders?.[0]) setRendering({ ...next.renderingProviders[0] });
4501
4667
  if (next.locations.length) setLocations(next.locations.map((item) => ({ ...item })));
4502
4668
  if (next.onboarding.complete && !completedFired.current) {
4503
4669
  completedFired.current = true;
@@ -4530,7 +4696,7 @@ function OrganizationOnboarding({
4530
4696
  setSavedStep((current) => ({ ...current, [stepId]: true }));
4531
4697
  onSaved?.(next);
4532
4698
  if (variant === "onboarding") {
4533
- const order = ["practice", "locations", "w9", "review"];
4699
+ const order = STEPS.map((item) => item.id);
4534
4700
  const nextStep = order[order.indexOf(stepId) + 1];
4535
4701
  if (nextStep) setStep(nextStep);
4536
4702
  }
@@ -4542,36 +4708,46 @@ function OrganizationOnboarding({
4542
4708
  setSaving(false);
4543
4709
  }
4544
4710
  };
4545
- const savePractice = () => run(() => client.saveBillingProfile({
4546
- practiceIdentity: identity,
4547
- ...provider.name.trim() || provider.taxId.trim() || provider.npi.trim() ? { billingProviders: [provider] } : {}
4548
- }), "practice");
4711
+ const savePractice = () => run(() => {
4712
+ return client.saveBillingProfile({
4713
+ practiceIdentity: organizationTaxIdWrite(identity),
4714
+ ...provider.name.trim() || provider.taxId?.trim() || provider.npi.trim() ? { billingProviders: [organizationTaxIdWrite(provider)] } : {}
4715
+ });
4716
+ }, "practice");
4549
4717
  const saveLocations = () => run(() => client.saveLocations(locations.filter((item) => item.name.trim() || item.street.trim())), "locations");
4550
4718
  const saveW9 = () => run(async () => {
4551
4719
  if (!w9File) throw new Error("Choose the practice W-9 PDF first.");
4552
4720
  return client.saveW9({ filename: w9File.name, contentBase64: await fileToBase64(w9File) });
4553
4721
  }, "w9");
4554
- const field = (label, value, onChange, span = false, placeholder = "") => /* @__PURE__ */ jsxs11("label", { className: `mbob-field${span ? " mbob-span" : ""}`, children: [
4722
+ const field = (label, value, onChange, span = false, placeholder = "") => /* @__PURE__ */ jsxs12("label", { className: `mbob-field${span ? " mbob-span" : ""}`, children: [
4555
4723
  label,
4556
- /* @__PURE__ */ jsx11("input", { value, placeholder, onChange: (event) => onChange(event.target.value), disabled: saving })
4724
+ /* @__PURE__ */ jsx12("input", { value, placeholder, onChange: (event) => onChange(event.target.value), disabled: saving })
4557
4725
  ] });
4558
4726
  const setLocation = (index, patch) => setLocations((current) => current.map((item, itemIndex) => {
4559
4727
  if (itemIndex !== index) return patch.isPrimary ? { ...item, isPrimary: false } : item;
4560
4728
  return { ...item, ...patch };
4561
4729
  }));
4562
- const practiceSection = /* @__PURE__ */ jsxs11("div", { children: [
4563
- /* @__PURE__ */ jsxs11("div", { className: "mbob-grid", children: [
4730
+ const practiceSection = /* @__PURE__ */ jsxs12("div", { children: [
4731
+ /* @__PURE__ */ jsx12("p", { className: "mbob-status", children: "Choose EIN for a business or SSN for an individual. Saved SSNs are encrypted and shown only by their last four digits." }),
4732
+ /* @__PURE__ */ jsxs12("div", { className: "mbob-grid", children: [
4564
4733
  field("Practice name", identity.name, (name) => setIdentity((c) => ({ ...c, name }))),
4565
4734
  field("Legal name", identity.legalName, (legalName) => setIdentity((c) => ({ ...c, legalName }))),
4566
- field("Tax ID (EIN)", identity.taxId, (taxId) => setIdentity((c) => ({ ...c, taxId })), false, "94-1234567"),
4735
+ /* @__PURE__ */ jsx12(TaxIdInput, { label: "Practice tax ID", value: identity, disabled: saving, onChange: (patch) => setIdentity((c) => ({ ...c, ...patch })) }),
4567
4736
  field("Group NPI", identity.npi, (npi) => setIdentity((c) => ({ ...c, npi }))),
4568
4737
  field("Phone", identity.phone, (phone) => setIdentity((c) => ({ ...c, phone }))),
4569
4738
  field("Email", identity.email, (email) => setIdentity((c) => ({ ...c, email })))
4570
4739
  ] }),
4571
- /* @__PURE__ */ jsx11("h3", { className: "mbob-subhead", children: "Billing provider (pay-to)" }),
4572
- /* @__PURE__ */ jsxs11("div", { className: "mbob-grid", children: [
4740
+ /* @__PURE__ */ jsx12("h3", { className: "mbob-subhead", children: "Billing provider (pay-to)" }),
4741
+ /* @__PURE__ */ jsxs12("label", { className: "mbob-field", children: [
4742
+ "Saved billing provider",
4743
+ /* @__PURE__ */ jsxs12("select", { disabled: saving, value: provider.id ?? "", onChange: (event) => setProvider({ ...profile?.billingProviders.find((item) => item.id === event.target.value) ?? { name: "", taxId: "", npi: "" } }), children: [
4744
+ /* @__PURE__ */ jsx12("option", { value: "", children: "Add a billing provider" }),
4745
+ profile?.billingProviders.map((item) => /* @__PURE__ */ jsx12("option", { value: item.id, children: item.name }, item.id))
4746
+ ] })
4747
+ ] }),
4748
+ /* @__PURE__ */ jsxs12("div", { className: "mbob-grid", children: [
4573
4749
  field("Billing provider name", provider.name, (name) => setProvider((c) => ({ ...c, name }))),
4574
- field("Billing tax ID", provider.taxId, (taxId) => setProvider((c) => ({ ...c, taxId }))),
4750
+ /* @__PURE__ */ jsx12(TaxIdInput, { label: "Billing tax ID", value: provider, disabled: saving, onChange: (patch) => setProvider((c) => ({ ...c, ...patch })) }),
4575
4751
  field("Billing NPI", provider.npi, (npi) => setProvider((c) => ({ ...c, npi }))),
4576
4752
  field("Billing phone", provider.phone ?? "", (phone) => setProvider((c) => ({ ...c, phone }))),
4577
4753
  field("Street", provider.billingStreet ?? "", (billingStreet) => setProvider((c) => ({ ...c, billingStreet })), true),
@@ -4579,88 +4755,119 @@ function OrganizationOnboarding({
4579
4755
  field("State", provider.billingState ?? "", (billingState) => setProvider((c) => ({ ...c, billingState: billingState.toUpperCase().slice(0, 2) }))),
4580
4756
  field("ZIP", provider.billingZip ?? "", (billingZip) => setProvider((c) => ({ ...c, billingZip })))
4581
4757
  ] }),
4582
- /* @__PURE__ */ jsxs11("div", { className: "mbob-actions", children: [
4583
- /* @__PURE__ */ jsx11("span", { className: "mbob-status", children: savedStep["practice"] ? "Saved to MindBill." : "Saved once, used on every bill." }),
4584
- /* @__PURE__ */ jsx11("button", { className: "mbob-save", type: "button", disabled: saving, onClick: savePractice, children: saving ? "Saving\u2026" : "Save practice" })
4758
+ /* @__PURE__ */ jsxs12("div", { className: "mbob-actions", children: [
4759
+ /* @__PURE__ */ jsx12("span", { className: "mbob-status", children: savedStep["practice"] ? "Saved to MindBill." : "Saved once, used on every bill." }),
4760
+ /* @__PURE__ */ jsx12("button", { className: "mbob-save", type: "button", disabled: saving, onClick: savePractice, children: saving ? "Saving\u2026" : "Save practice" })
4585
4761
  ] })
4586
4762
  ] });
4587
- const locationsSection = /* @__PURE__ */ jsxs11("div", { children: [
4588
- locations.map((location, index) => /* @__PURE__ */ jsxs11("div", { className: "mbob-loc", children: [
4589
- field("Name", location.name, (name) => setLocation(index, { name })),
4763
+ const renderingSection = /* @__PURE__ */ jsxs12("div", { children: [
4764
+ /* @__PURE__ */ jsxs12("label", { className: "mbob-field", children: [
4765
+ "Saved rendering provider",
4766
+ /* @__PURE__ */ jsxs12("select", { disabled: saving, value: rendering.id ?? "", onChange: (event) => setRendering({ ...profile?.renderingProviders?.find((item) => item.id === event.target.value) ?? blankRendering() }), children: [
4767
+ /* @__PURE__ */ jsx12("option", { value: "", children: "Add a rendering provider" }),
4768
+ profile?.renderingProviders?.map((item) => /* @__PURE__ */ jsxs12("option", { value: item.id, children: [
4769
+ item.name,
4770
+ item.active === false ? " (inactive)" : ""
4771
+ ] }, item.id))
4772
+ ] })
4773
+ ] }),
4774
+ /* @__PURE__ */ jsxs12("div", { className: "mbob-grid", style: { marginTop: 16 }, children: [
4775
+ field("Rendering provider name", rendering.name, (name) => setRendering((c) => ({ ...c, name }))),
4776
+ field("Rendering NPI", rendering.npi, (npi) => setRendering((c) => ({ ...c, npi }))),
4777
+ field("Taxonomy", rendering.taxonomy ?? "", (taxonomy) => setRendering((c) => ({ ...c, taxonomy }))),
4778
+ field("Specialty", rendering.specialty ?? "", (specialty) => setRendering((c) => ({ ...c, specialty }))),
4779
+ field("License number", rendering.licenseNumber ?? "", (licenseNumber) => setRendering((c) => ({ ...c, licenseNumber }))),
4780
+ field("License state", rendering.licenseState ?? "", (licenseState) => setRendering((c) => ({ ...c, licenseState: licenseState.toUpperCase().slice(0, 2) }))),
4781
+ /* @__PURE__ */ jsxs12("label", { children: [
4782
+ /* @__PURE__ */ jsx12("input", { disabled: saving, type: "checkbox", checked: rendering.active !== false, onChange: (event) => setRendering((c) => ({ ...c, active: event.target.checked })) }),
4783
+ " Available for new bills"
4784
+ ] })
4785
+ ] }),
4786
+ /* @__PURE__ */ jsxs12("div", { className: "mbob-actions", children: [
4787
+ /* @__PURE__ */ jsx12("span", { className: "mbob-status", children: savedStep["rendering"] ? "Saved to MindBill." : "Saved profiles do not change previously submitted bills." }),
4788
+ /* @__PURE__ */ jsx12("button", { className: "mbob-save", type: "button", disabled: saving || !rendering.name.trim(), onClick: () => run(() => client.saveBillingProfile({ renderingProviders: [rendering] }), "rendering"), children: saving ? "Saving\u2026" : "Save rendering provider" })
4789
+ ] })
4790
+ ] });
4791
+ const locationsSection = /* @__PURE__ */ jsxs12("div", { children: [
4792
+ locations.map((location, index) => /* @__PURE__ */ jsxs12("div", { className: "mbob-loc", children: [
4793
+ field("Name", location.name ?? "", (name) => setLocation(index, { name })),
4590
4794
  field("Street", location.street, (street) => setLocation(index, { street })),
4591
4795
  field("City", location.city, (city) => setLocation(index, { city })),
4592
4796
  field("State", location.state, (state) => setLocation(index, { state: state.toUpperCase().slice(0, 2) })),
4593
4797
  field("ZIP", location.zip, (zip) => setLocation(index, { zip })),
4594
- /* @__PURE__ */ jsxs11("label", { className: "mbob-primary", children: [
4595
- /* @__PURE__ */ jsx11("input", { type: "radio", name: "mbob-primary", checked: location.isPrimary === true, onChange: () => setLocation(index, { isPrimary: true }) }),
4798
+ field("Place of service code", location.posCode ?? "", (posCode) => setLocation(index, { posCode }), false, "11"),
4799
+ /* @__PURE__ */ jsxs12("label", { className: "mbob-primary", children: [
4800
+ /* @__PURE__ */ jsx12("input", { disabled: saving || location.active === false, type: "radio", name: primaryGroup, checked: location.isPrimary === true, onChange: () => setLocation(index, { isPrimary: true }) }),
4596
4801
  " Primary"
4597
4802
  ] }),
4598
- /* @__PURE__ */ jsx11("button", { className: "mbob-remove", type: "button", "aria-label": "Remove location", onClick: () => setLocations((current) => current.filter((_, itemIndex) => itemIndex !== index)), children: "\xD7" })
4803
+ location.id ? /* @__PURE__ */ jsx12("button", { className: "mbob-secondary", disabled: saving, type: "button", onClick: () => setLocation(index, { active: location.active === false, ...location.active !== false ? { isPrimary: false } : {} }), children: location.active === false ? "Restore" : "Archive" }) : /* @__PURE__ */ jsx12("button", { className: "mbob-remove", disabled: saving, type: "button", "aria-label": "Remove location", onClick: () => setLocations((current) => current.filter((_, itemIndex) => itemIndex !== index)), children: "\xD7" })
4599
4804
  ] }, location.id ?? index)),
4600
- /* @__PURE__ */ jsx11("button", { className: "mbob-add", type: "button", onClick: () => setLocations((current) => [...current, blankLocation()]), children: "+ Add location" }),
4601
- /* @__PURE__ */ jsxs11("div", { className: "mbob-actions", children: [
4602
- /* @__PURE__ */ jsx11("span", { className: "mbob-status", children: savedStep["locations"] ? "Saved to MindBill." : "Where evaluations happen." }),
4603
- /* @__PURE__ */ jsx11("button", { className: "mbob-save", type: "button", disabled: saving, onClick: saveLocations, children: saving ? "Saving\u2026" : "Save locations" })
4805
+ /* @__PURE__ */ jsx12("button", { className: "mbob-add", type: "button", onClick: () => setLocations((current) => [...current, blankLocation()]), children: "+ Add location" }),
4806
+ /* @__PURE__ */ jsxs12("div", { className: "mbob-actions", children: [
4807
+ /* @__PURE__ */ jsx12("span", { className: "mbob-status", children: savedStep["locations"] ? "Saved to MindBill." : "Where evaluations happen." }),
4808
+ /* @__PURE__ */ jsx12("button", { className: "mbob-save", type: "button", disabled: saving, onClick: saveLocations, children: saving ? "Saving\u2026" : "Save locations" })
4604
4809
  ] })
4605
4810
  ] });
4606
- const w9Section = /* @__PURE__ */ jsxs11("div", { children: [
4607
- profile?.w9 ? /* @__PURE__ */ jsxs11("div", { className: "mbob-w9-current", children: [
4608
- /* @__PURE__ */ jsxs11("div", { children: [
4609
- /* @__PURE__ */ jsx11("strong", { children: profile.w9.filename }),
4610
- /* @__PURE__ */ jsxs11("span", { children: [
4811
+ const w9Section = /* @__PURE__ */ jsxs12("div", { children: [
4812
+ profile?.w9 ? /* @__PURE__ */ jsxs12("div", { className: "mbob-w9-current", children: [
4813
+ /* @__PURE__ */ jsxs12("div", { children: [
4814
+ /* @__PURE__ */ jsx12("strong", { children: profile.w9.filename }),
4815
+ /* @__PURE__ */ jsxs12("span", { children: [
4611
4816
  " \xB7 added ",
4612
4817
  profile.w9.addDate
4613
4818
  ] })
4614
4819
  ] }),
4615
- /* @__PURE__ */ jsx11("span", { children: "Rides on every bill automatically" })
4820
+ /* @__PURE__ */ jsx12("span", { children: "Rides on every bill automatically" })
4616
4821
  ] }) : null,
4617
- /* @__PURE__ */ jsxs11("label", { className: "mbob-drop", children: [
4618
- /* @__PURE__ */ jsx11("input", { type: "file", accept: "application/pdf,.pdf", onChange: (event) => setW9File(event.target.files?.[0] ?? null) }),
4619
- /* @__PURE__ */ jsx11("strong", { children: w9File ? w9File.name : profile?.w9 ? "Replace the W-9 PDF" : "Drop the practice W-9 PDF here, or click to choose" }),
4620
- /* @__PURE__ */ jsx11("span", { children: "The W-9 is auto-attached to every submission." })
4822
+ /* @__PURE__ */ jsxs12("label", { className: "mbob-drop", children: [
4823
+ /* @__PURE__ */ jsx12("input", { type: "file", accept: "application/pdf,.pdf", onChange: (event) => setW9File(event.target.files?.[0] ?? null) }),
4824
+ /* @__PURE__ */ jsx12("strong", { children: w9File ? w9File.name : profile?.w9 ? "Replace the W-9 PDF" : "Drop the practice W-9 PDF here, or click to choose" }),
4825
+ /* @__PURE__ */ jsx12("span", { children: "The W-9 is auto-attached to every submission." })
4621
4826
  ] }),
4622
- /* @__PURE__ */ jsxs11("div", { className: "mbob-actions", children: [
4623
- /* @__PURE__ */ jsx11("span", { className: "mbob-status", children: savedStep["w9"] ? "Saved to MindBill." : "" }),
4624
- /* @__PURE__ */ jsx11("button", { className: "mbob-save", type: "button", disabled: saving || !w9File, onClick: saveW9, children: saving ? "Uploading\u2026" : "Save W-9" })
4827
+ /* @__PURE__ */ jsxs12("div", { className: "mbob-actions", children: [
4828
+ /* @__PURE__ */ jsx12("span", { className: "mbob-status", children: savedStep["w9"] ? "Saved to MindBill." : "" }),
4829
+ /* @__PURE__ */ jsx12("button", { className: "mbob-save", type: "button", disabled: saving || !w9File, onClick: saveW9, children: saving ? "Uploading\u2026" : "Save W-9" })
4625
4830
  ] })
4626
4831
  ] });
4627
- const reviewSection = /* @__PURE__ */ jsxs11("div", { className: "mbob-check", children: [
4628
- (profile?.onboarding.checklist ?? []).map((item) => /* @__PURE__ */ jsxs11("div", { className: "mbob-check-item", "data-complete": item.complete, children: [
4629
- /* @__PURE__ */ jsx11("i", { children: item.complete ? "\u2713" : "\u2022" }),
4630
- /* @__PURE__ */ jsx11("span", { children: item.label })
4832
+ const reviewSection = /* @__PURE__ */ jsxs12("div", { className: "mbob-check", children: [
4833
+ (profile?.onboarding.checklist ?? []).map((item) => /* @__PURE__ */ jsxs12("div", { className: "mbob-check-item", "data-complete": item.complete, children: [
4834
+ /* @__PURE__ */ jsx12("i", { children: item.complete ? "\u2713" : "\u2022" }),
4835
+ /* @__PURE__ */ jsx12("span", { children: item.label })
4631
4836
  ] }, item.id)),
4632
- profile?.onboarding.complete ? /* @__PURE__ */ jsx11("p", { className: "mbob-done", children: "Billing setup is complete \u2014 bills submitted from your product carry this profile automatically." }) : /* @__PURE__ */ jsx11("p", { className: "mbob-status", children: "Items above complete themselves as each section is saved." })
4837
+ profile?.onboarding.complete ? /* @__PURE__ */ jsx12("p", { className: "mbob-done", children: "Billing setup is complete \u2014 bills submitted from your product carry this profile automatically." }) : /* @__PURE__ */ jsx12("p", { className: "mbob-status", children: "Items above complete themselves as each section is saved." })
4633
4838
  ] });
4634
- const sections = { practice: practiceSection, locations: locationsSection, w9: w9Section, review: reviewSection };
4635
- return /* @__PURE__ */ jsxs11("div", { className: `mbob ${className}`.trim(), style: { ...mindBillAppearanceStyle(appearance), ...style }, children: [
4636
- /* @__PURE__ */ jsx11("style", { children: css9 }),
4637
- /* @__PURE__ */ jsxs11("div", { className: "mbob-card", children: [
4638
- /* @__PURE__ */ jsx11("div", { className: "mbob-head", children: /* @__PURE__ */ jsxs11("div", { children: [
4639
- /* @__PURE__ */ jsx11("h2", { children: heading }),
4640
- /* @__PURE__ */ jsx11("p", { className: "mbob-copy", children: description })
4839
+ const sections = { practice: practiceSection, rendering: renderingSection, locations: locationsSection, w9: w9Section, review: reviewSection };
4840
+ return /* @__PURE__ */ jsxs12("div", { className: `mbob ${className}`.trim(), style: { ...mindBillAppearanceStyle(appearance), ...style }, children: [
4841
+ /* @__PURE__ */ jsx12("style", { children: css9 }),
4842
+ /* @__PURE__ */ jsxs12("div", { className: "mbob-card", children: [
4843
+ /* @__PURE__ */ jsx12("div", { className: "mbob-head", children: /* @__PURE__ */ jsxs12("div", { children: [
4844
+ /* @__PURE__ */ jsx12("h2", { children: heading }),
4845
+ /* @__PURE__ */ jsx12("p", { className: "mbob-copy", children: description })
4641
4846
  ] }) }),
4642
- loadError ? /* @__PURE__ */ jsx11("div", { className: "mbob-error", role: "alert", children: loadError }) : null,
4643
- variant === "onboarding" ? /* @__PURE__ */ jsxs11(Fragment9, { children: [
4644
- /* @__PURE__ */ jsx11("div", { className: "mbob-steps", children: STEPS.map((item) => /* @__PURE__ */ jsxs11("button", { className: "mbob-step", type: "button", "data-active": step === item.id, "data-done": Boolean(savedStep[item.id]), onClick: () => setStep(item.id), children: [
4645
- /* @__PURE__ */ jsx11("i", { children: savedStep[item.id] ? "\u2713" : "" }),
4847
+ loadError ? /* @__PURE__ */ jsx12("div", { className: "mbob-error", role: "alert", children: loadError }) : null,
4848
+ variant === "onboarding" ? /* @__PURE__ */ jsxs12(Fragment10, { children: [
4849
+ /* @__PURE__ */ jsx12("div", { className: "mbob-steps", children: STEPS.map((item) => /* @__PURE__ */ jsxs12("button", { className: "mbob-step", type: "button", "data-active": step === item.id, "data-done": Boolean(savedStep[item.id]), onClick: () => setStep(item.id), children: [
4850
+ /* @__PURE__ */ jsx12("i", { children: savedStep[item.id] ? "\u2713" : "" }),
4646
4851
  item.label
4647
4852
  ] }, item.id)) }),
4648
4853
  sections[step]
4649
- ] }) : /* @__PURE__ */ jsxs11(Fragment9, { children: [
4854
+ ] }) : /* @__PURE__ */ jsxs12(Fragment10, { children: [
4650
4855
  practiceSection,
4651
- /* @__PURE__ */ jsx11("h3", { className: "mbob-subhead", children: "Locations" }),
4856
+ /* @__PURE__ */ jsx12("h3", { className: "mbob-subhead", children: "Rendering providers" }),
4857
+ renderingSection,
4858
+ /* @__PURE__ */ jsx12("h3", { className: "mbob-subhead", children: "Locations" }),
4652
4859
  locationsSection,
4653
- /* @__PURE__ */ jsx11("h3", { className: "mbob-subhead", children: "Practice W-9" }),
4860
+ /* @__PURE__ */ jsx12("h3", { className: "mbob-subhead", children: "Practice W-9" }),
4654
4861
  w9Section,
4655
- /* @__PURE__ */ jsx11("h3", { className: "mbob-subhead", children: "Checklist" }),
4862
+ /* @__PURE__ */ jsx12("h3", { className: "mbob-subhead", children: "Checklist" }),
4656
4863
  reviewSection
4657
4864
  ] }),
4658
- error ? /* @__PURE__ */ jsx11("div", { className: "mbob-error", role: "alert", children: error }) : null
4865
+ error ? /* @__PURE__ */ jsx12("div", { className: "mbob-error", role: "alert", children: error }) : null
4659
4866
  ] })
4660
4867
  ] });
4661
4868
  }
4662
4869
  function BillingSettings(props) {
4663
- return /* @__PURE__ */ jsx11(
4870
+ return /* @__PURE__ */ jsx12(
4664
4871
  OrganizationOnboarding,
4665
4872
  {
4666
4873
  heading: "Billing settings",
@@ -4683,7 +4890,7 @@ import {
4683
4890
  DEFAULT_API_BASE_URL,
4684
4891
  DEFAULT_SESSION_ENDPOINT
4685
4892
  } from "@mindbill/browser";
4686
- import { Fragment as Fragment10, jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
4893
+ import { Fragment as Fragment11, jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
4687
4894
  var DEFAULT_REFRESH_INTERVAL = 6e4;
4688
4895
  async function responseError(response, fallback) {
4689
4896
  const body = await response.json().catch(() => null);
@@ -4904,17 +5111,17 @@ function ConnectedBillStatus({
4904
5111
  }) {
4905
5112
  const status = useBillStatus(options);
4906
5113
  if (status.isLoading && !status.data) {
4907
- return /* @__PURE__ */ jsx12(Fragment10, { children: loadingFallback ?? /* @__PURE__ */ jsx12("div", { role: "status", children: "Loading bill status\u2026" }) });
5114
+ return /* @__PURE__ */ jsx13(Fragment11, { children: loadingFallback ?? /* @__PURE__ */ jsx13("div", { role: "status", children: "Loading bill status\u2026" }) });
4908
5115
  }
4909
5116
  if (status.error && !status.data) {
4910
- return /* @__PURE__ */ jsx12(Fragment10, { children: errorFallback?.(status.error, status.refresh) ?? /* @__PURE__ */ jsxs12("div", { role: "alert", children: [
5117
+ return /* @__PURE__ */ jsx13(Fragment11, { children: errorFallback?.(status.error, status.refresh) ?? /* @__PURE__ */ jsxs13("div", { role: "alert", children: [
4911
5118
  status.error.message,
4912
5119
  " ",
4913
- /* @__PURE__ */ jsx12("button", { type: "button", onClick: () => void status.refresh(), children: "Retry" })
5120
+ /* @__PURE__ */ jsx13("button", { type: "button", onClick: () => void status.refresh(), children: "Retry" })
4914
5121
  ] }) });
4915
5122
  }
4916
5123
  if (!status.data) return null;
4917
- return /* @__PURE__ */ jsx12(
5124
+ return /* @__PURE__ */ jsx13(
4918
5125
  BillStatusSummary,
4919
5126
  {
4920
5127
  status: status.data.state,
@@ -4934,7 +5141,7 @@ function ConnectedBillStatus({
4934
5141
 
4935
5142
  // src/bill-lifecycle-surfaces.tsx
4936
5143
  import { useEffect as useEffect9, useRef as useRef5, useState as useState10 } from "react";
4937
- import { Fragment as Fragment11, jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
5144
+ import { Fragment as Fragment12, jsx as jsx14, jsxs as jsxs14 } from "react/jsx-runtime";
4938
5145
  function visibleBillLifecycleActions(actions, showUnavailable = false) {
4939
5146
  return actions.filter((action) => action.enabled || showUnavailable);
4940
5147
  }
@@ -4949,11 +5156,11 @@ function BillLifecycleActions({
4949
5156
  }) {
4950
5157
  const visible = visibleBillLifecycleActions(actions, showUnavailable);
4951
5158
  if (!visible.length) return null;
4952
- return /* @__PURE__ */ jsxs13("div", { className: classes("mb-lifecycle-actions", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill actions", children: [
4953
- /* @__PURE__ */ jsx13("style", { children: lifecycleSurfaceStyles }),
4954
- visible.map((action) => /* @__PURE__ */ jsxs13("div", { className: "mb-lifecycle-action", children: [
4955
- /* @__PURE__ */ jsx13("button", { type: "button", className: action.primary ? "mb-action-button is-primary" : "mb-action-button", disabled: disabled || !action.enabled, onClick: () => onAction(action), children: action.label }),
4956
- !action.enabled && action.reason ? /* @__PURE__ */ jsx13("span", { className: "mb-action-reason", children: action.reason }) : null
5159
+ return /* @__PURE__ */ jsxs14("div", { className: classes("mb-lifecycle-actions", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill actions", children: [
5160
+ /* @__PURE__ */ jsx14("style", { children: lifecycleSurfaceStyles }),
5161
+ visible.map((action) => /* @__PURE__ */ jsxs14("div", { className: "mb-lifecycle-action", children: [
5162
+ /* @__PURE__ */ jsx14("button", { type: "button", className: action.primary ? "mb-action-button is-primary" : "mb-action-button", disabled: disabled || !action.enabled, onClick: () => onAction(action), children: action.label }),
5163
+ !action.enabled && action.reason ? /* @__PURE__ */ jsx14("span", { className: "mb-action-reason", children: action.reason }) : null
4957
5164
  ] }, action.id))
4958
5165
  ] });
4959
5166
  }
@@ -4983,18 +5190,18 @@ function defaultFormatDate(createdAt) {
4983
5190
  return new Intl.DateTimeFormat(void 0, { dateStyle: "medium", timeStyle: "short" }).format(parsed);
4984
5191
  }
4985
5192
  function BillActivityTimeline({ events, emptyLabel = "No bill activity yet.", appearance, className, style, formatDate = defaultFormatDate }) {
4986
- return /* @__PURE__ */ jsxs13("section", { className: classes("mb-surface mb-activity", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill activity", children: [
4987
- /* @__PURE__ */ jsx13("style", { children: lifecycleSurfaceStyles }),
4988
- /* @__PURE__ */ jsx13("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs13("div", { children: [
4989
- /* @__PURE__ */ jsx13("strong", { children: "Bill history" }),
4990
- /* @__PURE__ */ jsx13("span", { children: "Submission, payer responses, follow-up, and payments." })
5193
+ return /* @__PURE__ */ jsxs14("section", { className: classes("mb-surface mb-activity", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill activity", children: [
5194
+ /* @__PURE__ */ jsx14("style", { children: lifecycleSurfaceStyles }),
5195
+ /* @__PURE__ */ jsx14("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs14("div", { children: [
5196
+ /* @__PURE__ */ jsx14("strong", { children: "Bill history" }),
5197
+ /* @__PURE__ */ jsx14("span", { children: "Submission, payer responses, follow-up, and payments." })
4991
5198
  ] }) }),
4992
- !events.length ? /* @__PURE__ */ jsx13("p", { className: "mb-activity-empty", children: emptyLabel }) : /* @__PURE__ */ jsx13("ol", { className: "mb-activity-list", children: events.map((event) => /* @__PURE__ */ jsxs13("li", { className: "mb-activity-item", children: [
4993
- /* @__PURE__ */ jsx13("span", { className: "mb-activity-marker", "aria-hidden": "true" }),
4994
- /* @__PURE__ */ jsxs13("div", { className: "mb-activity-content", children: [
4995
- /* @__PURE__ */ jsx13("strong", { children: event.title ?? billActivityEventLabel(event.type) }),
4996
- event.description ? /* @__PURE__ */ jsx13("p", { children: event.description }) : null,
4997
- /* @__PURE__ */ jsxs13("span", { children: [
5199
+ !events.length ? /* @__PURE__ */ jsx14("p", { className: "mb-activity-empty", children: emptyLabel }) : /* @__PURE__ */ jsx14("ol", { className: "mb-activity-list", children: events.map((event) => /* @__PURE__ */ jsxs14("li", { className: "mb-activity-item", children: [
5200
+ /* @__PURE__ */ jsx14("span", { className: "mb-activity-marker", "aria-hidden": "true" }),
5201
+ /* @__PURE__ */ jsxs14("div", { className: "mb-activity-content", children: [
5202
+ /* @__PURE__ */ jsx14("strong", { children: event.title ?? billActivityEventLabel(event.type) }),
5203
+ event.description ? /* @__PURE__ */ jsx14("p", { children: event.description }) : null,
5204
+ /* @__PURE__ */ jsxs14("span", { children: [
4998
5205
  formatDate(event.createdAt),
4999
5206
  event.actor ? ` \xB7 ${event.actor}` : ""
5000
5207
  ] })
@@ -5016,41 +5223,41 @@ function BillHistoryTable({ entries, selectedEntryId, emptyLabel = "No bill hist
5016
5223
  if (selected?.details) setExpanded((current) => current[selectedEntryId] ? current : { ...current, [selectedEntryId]: true });
5017
5224
  selectedRowRef.current?.scrollIntoView({ behavior: "smooth", block: "center" });
5018
5225
  }, [entries, selectedEntryId]);
5019
- return /* @__PURE__ */ jsxs13("section", { className: classes("mb-surface mb-history", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill history", children: [
5020
- /* @__PURE__ */ jsx13("style", { children: lifecycleSurfaceStyles }),
5021
- /* @__PURE__ */ jsx13("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs13("div", { children: [
5022
- /* @__PURE__ */ jsx13("strong", { children: "Bill history" }),
5023
- /* @__PURE__ */ jsx13("span", { children: "Submissions, payer responses, follow-up, and payments." })
5226
+ return /* @__PURE__ */ jsxs14("section", { className: classes("mb-surface mb-history", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill history", children: [
5227
+ /* @__PURE__ */ jsx14("style", { children: lifecycleSurfaceStyles }),
5228
+ /* @__PURE__ */ jsx14("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs14("div", { children: [
5229
+ /* @__PURE__ */ jsx14("strong", { children: "Bill history" }),
5230
+ /* @__PURE__ */ jsx14("span", { children: "Submissions, payer responses, follow-up, and payments." })
5024
5231
  ] }) }),
5025
- !entries.length ? /* @__PURE__ */ jsx13("p", { className: "mb-activity-empty", children: emptyLabel }) : /* @__PURE__ */ jsxs13("div", { className: "mb-history-table", children: [
5026
- /* @__PURE__ */ jsxs13("div", { className: "mb-history-head", "aria-hidden": "true", children: [
5027
- /* @__PURE__ */ jsx13("span", { children: "Date" }),
5028
- /* @__PURE__ */ jsx13("span", { children: "Action" }),
5029
- /* @__PURE__ */ jsx13("span", { children: "User" }),
5030
- /* @__PURE__ */ jsx13("span", { children: "Details" })
5232
+ !entries.length ? /* @__PURE__ */ jsx14("p", { className: "mb-activity-empty", children: emptyLabel }) : /* @__PURE__ */ jsxs14("div", { className: "mb-history-table", children: [
5233
+ /* @__PURE__ */ jsxs14("div", { className: "mb-history-head", "aria-hidden": "true", children: [
5234
+ /* @__PURE__ */ jsx14("span", { children: "Date" }),
5235
+ /* @__PURE__ */ jsx14("span", { children: "Action" }),
5236
+ /* @__PURE__ */ jsx14("span", { children: "User" }),
5237
+ /* @__PURE__ */ jsx14("span", { children: "Details" })
5031
5238
  ] }),
5032
- /* @__PURE__ */ jsx13("ul", { className: "mb-history-rows", children: entries.map((entry) => {
5239
+ /* @__PURE__ */ jsx14("ul", { className: "mb-history-rows", children: entries.map((entry) => {
5033
5240
  const isSelected = entry.id === selectedEntryId;
5034
5241
  const expandable = Boolean(entry.details);
5035
5242
  const isOpen = expandable && Boolean(expanded[entry.id]);
5036
5243
  const details = entry.details;
5037
- const lineContents = /* @__PURE__ */ jsxs13(Fragment11, { children: [
5038
- /* @__PURE__ */ jsx13("span", { className: "mb-history-date", children: formatDate(entry.date) }),
5039
- /* @__PURE__ */ jsx13("span", { className: "mb-history-action", children: entry.action }),
5040
- /* @__PURE__ */ jsx13("span", { className: "mb-history-actor", children: entry.actor ?? "\u2014" }),
5041
- /* @__PURE__ */ jsxs13("span", { className: "mb-history-summary", children: [
5042
- expandable ? /* @__PURE__ */ jsx13("i", { className: `mb-history-caret${isOpen ? " is-open" : ""}`, "aria-hidden": "true" }) : null,
5244
+ const lineContents = /* @__PURE__ */ jsxs14(Fragment12, { children: [
5245
+ /* @__PURE__ */ jsx14("span", { className: "mb-history-date", children: formatDate(entry.date) }),
5246
+ /* @__PURE__ */ jsx14("span", { className: "mb-history-action", children: entry.action }),
5247
+ /* @__PURE__ */ jsx14("span", { className: "mb-history-actor", children: entry.actor ?? "\u2014" }),
5248
+ /* @__PURE__ */ jsxs14("span", { className: "mb-history-summary", children: [
5249
+ expandable ? /* @__PURE__ */ jsx14("i", { className: `mb-history-caret${isOpen ? " is-open" : ""}`, "aria-hidden": "true" }) : null,
5043
5250
  entry.summary
5044
5251
  ] })
5045
5252
  ] });
5046
- return /* @__PURE__ */ jsxs13(
5253
+ return /* @__PURE__ */ jsxs14(
5047
5254
  "li",
5048
5255
  {
5049
5256
  ref: isSelected ? selectedRowRef : void 0,
5050
5257
  className: `mb-history-row is-${entry.tone}${isSelected ? " is-selected" : ""}`,
5051
5258
  "aria-current": isSelected ? "true" : void 0,
5052
5259
  children: [
5053
- expandable ? /* @__PURE__ */ jsx13(
5260
+ expandable ? /* @__PURE__ */ jsx14(
5054
5261
  "button",
5055
5262
  {
5056
5263
  type: "button",
@@ -5059,31 +5266,31 @@ function BillHistoryTable({ entries, selectedEntryId, emptyLabel = "No bill hist
5059
5266
  onClick: () => setExpanded((current) => ({ ...current, [entry.id]: !current[entry.id] })),
5060
5267
  children: lineContents
5061
5268
  }
5062
- ) : /* @__PURE__ */ jsx13("div", { className: "mb-history-line", children: lineContents }),
5063
- isOpen && details ? /* @__PURE__ */ jsxs13("div", { className: "mb-history-details", children: [
5064
- details.rows?.length ? /* @__PURE__ */ jsx13("dl", { className: "mb-history-kv", children: details.rows.map((row) => /* @__PURE__ */ jsxs13("div", { children: [
5065
- /* @__PURE__ */ jsx13("dt", { children: row.label }),
5066
- /* @__PURE__ */ jsx13("dd", { children: row.value })
5269
+ ) : /* @__PURE__ */ jsx14("div", { className: "mb-history-line", children: lineContents }),
5270
+ isOpen && details ? /* @__PURE__ */ jsxs14("div", { className: "mb-history-details", children: [
5271
+ details.rows?.length ? /* @__PURE__ */ jsx14("dl", { className: "mb-history-kv", children: details.rows.map((row) => /* @__PURE__ */ jsxs14("div", { children: [
5272
+ /* @__PURE__ */ jsx14("dt", { children: row.label }),
5273
+ /* @__PURE__ */ jsx14("dd", { children: row.value })
5067
5274
  ] }, `${row.label}-${row.value}`)) }) : null,
5068
- details.documents?.length ? /* @__PURE__ */ jsx13("div", { className: "mb-history-kv", children: /* @__PURE__ */ jsxs13("div", { children: [
5069
- /* @__PURE__ */ jsx13("dt", { children: "Documents" }),
5070
- /* @__PURE__ */ jsx13("dd", { children: details.documents.map((doc) => {
5275
+ details.documents?.length ? /* @__PURE__ */ jsx14("div", { className: "mb-history-kv", children: /* @__PURE__ */ jsxs14("div", { children: [
5276
+ /* @__PURE__ */ jsx14("dt", { children: "Documents" }),
5277
+ /* @__PURE__ */ jsx14("dd", { children: details.documents.map((doc) => {
5071
5278
  const href = documentHref?.(doc) ?? null;
5072
- return href ? /* @__PURE__ */ jsx13("a", { className: "mb-history-doc", href, target: "_blank", rel: "noreferrer", children: doc.filename }, doc.id) : onOpenDocument ? /* @__PURE__ */ jsx13("button", { type: "button", className: "mb-history-doc", onClick: () => void onOpenDocument(doc), children: doc.filename }, doc.id) : /* @__PURE__ */ jsx13("span", { className: "mb-history-doc", children: doc.filename }, doc.id);
5279
+ return href ? /* @__PURE__ */ jsx14("a", { className: "mb-history-doc", href, target: "_blank", rel: "noreferrer", children: doc.filename }, doc.id) : onOpenDocument ? /* @__PURE__ */ jsx14("button", { type: "button", className: "mb-history-doc", onClick: () => void onOpenDocument(doc), children: doc.filename }, doc.id) : /* @__PURE__ */ jsx14("span", { className: "mb-history-doc", children: doc.filename }, doc.id);
5073
5280
  }) })
5074
5281
  ] }) }) : null,
5075
- details.codes?.length ? /* @__PURE__ */ jsx13("dl", { className: "mb-history-codes", children: details.codes.map((code) => /* @__PURE__ */ jsxs13("div", { children: [
5076
- /* @__PURE__ */ jsx13("dt", { children: code.code }),
5077
- /* @__PURE__ */ jsx13("dd", { children: code.text })
5282
+ details.codes?.length ? /* @__PURE__ */ jsx14("dl", { className: "mb-history-codes", children: details.codes.map((code) => /* @__PURE__ */ jsxs14("div", { children: [
5283
+ /* @__PURE__ */ jsx14("dt", { children: code.code }),
5284
+ /* @__PURE__ */ jsx14("dd", { children: code.text })
5078
5285
  ] }, code.code)) }) : null,
5079
- details.complianceDueDates?.length ? /* @__PURE__ */ jsxs13("div", { className: "mb-history-due", children: [
5080
- /* @__PURE__ */ jsx13("em", { children: "Compliance Due Dates" }),
5081
- /* @__PURE__ */ jsx13("dl", { children: details.complianceDueDates.map((due) => /* @__PURE__ */ jsxs13("div", { children: [
5082
- /* @__PURE__ */ jsx13("dt", { children: formatDate(due.date) }),
5083
- /* @__PURE__ */ jsx13("dd", { children: due.text })
5286
+ details.complianceDueDates?.length ? /* @__PURE__ */ jsxs14("div", { className: "mb-history-due", children: [
5287
+ /* @__PURE__ */ jsx14("em", { children: "Compliance Due Dates" }),
5288
+ /* @__PURE__ */ jsx14("dl", { children: details.complianceDueDates.map((due) => /* @__PURE__ */ jsxs14("div", { children: [
5289
+ /* @__PURE__ */ jsx14("dt", { children: formatDate(due.date) }),
5290
+ /* @__PURE__ */ jsx14("dd", { children: due.text })
5084
5291
  ] }, `${due.date}-${due.text}`)) })
5085
5292
  ] }) : null,
5086
- details.text ? /* @__PURE__ */ jsx13("p", { className: "mb-history-text", children: details.text }) : null
5293
+ details.text ? /* @__PURE__ */ jsx14("p", { className: "mb-history-text", children: details.text }) : null
5087
5294
  ] }) : null
5088
5295
  ]
5089
5296
  },
@@ -5144,15 +5351,15 @@ function BillLifecycleProgress({ state, nativeStatus, submittedAt, agingDays, dr
5144
5351
  const rejected = state.toLowerCase() === "rejected";
5145
5352
  const draft = Boolean(draftStage) && isBillLifecycleDraft(state);
5146
5353
  const steps = billLifecycleProgressSteps(state, { draftStage: Boolean(draftStage) });
5147
- return /* @__PURE__ */ jsxs13("section", { className: classes(`mb-surface mb-progress${rejected ? " is-rejected" : ""}`, className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill lifecycle", children: [
5148
- /* @__PURE__ */ jsx13("style", { children: lifecycleSurfaceStyles }),
5149
- /* @__PURE__ */ jsx13("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs13("div", { children: [
5150
- /* @__PURE__ */ jsx13("strong", { children: billLifecycleDisplayLabel(state, nativeStatus) }),
5151
- /* @__PURE__ */ jsx13("span", { children: rejected ? "The payer rejected this submission." : draft ? "Not yet sent" : `${submittedAt ? `Submitted ${defaultFormatDate(submittedAt)}` : "Submitted"}${typeof agingDays === "number" ? ` \xB7 ${agingDays} days old` : ""}` })
5354
+ return /* @__PURE__ */ jsxs14("section", { className: classes(`mb-surface mb-progress${rejected ? " is-rejected" : ""}`, className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill lifecycle", children: [
5355
+ /* @__PURE__ */ jsx14("style", { children: lifecycleSurfaceStyles }),
5356
+ /* @__PURE__ */ jsx14("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs14("div", { children: [
5357
+ /* @__PURE__ */ jsx14("strong", { children: billLifecycleDisplayLabel(state, nativeStatus) }),
5358
+ /* @__PURE__ */ jsx14("span", { children: rejected ? "The payer rejected this submission." : draft ? "Not yet sent" : `${submittedAt ? `Submitted ${defaultFormatDate(submittedAt)}` : "Submitted"}${typeof agingDays === "number" ? ` \xB7 ${agingDays} days old` : ""}` })
5152
5359
  ] }) }),
5153
- /* @__PURE__ */ jsx13("ol", { className: "mb-progress-list", style: { gridTemplateColumns: `repeat(${steps.length}, minmax(0, 1fr))` }, children: steps.map((step, index) => /* @__PURE__ */ jsxs13("li", { className: `is-${step.status}`, "aria-current": step.status === "current" ? "step" : void 0, children: [
5154
- /* @__PURE__ */ jsx13("span", { "aria-hidden": "true", children: step.status === "complete" ? "\u2713" : rejected && step.status === "current" ? "!" : index + 1 }),
5155
- /* @__PURE__ */ jsx13("b", { children: step.label })
5360
+ /* @__PURE__ */ jsx14("ol", { className: "mb-progress-list", style: { gridTemplateColumns: `repeat(${steps.length}, minmax(0, 1fr))` }, children: steps.map((step, index) => /* @__PURE__ */ jsxs14("li", { className: `is-${step.status}`, "aria-current": step.status === "current" ? "step" : void 0, children: [
5361
+ /* @__PURE__ */ jsx14("span", { "aria-hidden": "true", children: step.status === "complete" ? "\u2713" : rejected && step.status === "current" ? "!" : index + 1 }),
5362
+ /* @__PURE__ */ jsx14("b", { children: step.label })
5156
5363
  ] }, step.id)) })
5157
5364
  ] });
5158
5365
  }
@@ -5166,48 +5373,48 @@ function billRejectionIssueSummary(rejection, count) {
5166
5373
  function BillRejectionNotice({ rejection, title = "Rejected \u2014 action required", submittedAt, appearance, className, style, formatDate = defaultFormatDate }) {
5167
5374
  const issues = rejection.issues?.length ? rejection.issues : [{ code: rejection.code, description: rejection.reason }];
5168
5375
  const hasCodes = issues.some((issue) => Boolean(issue.code));
5169
- return /* @__PURE__ */ jsxs13("section", { className: classes("mb-surface mb-rejection-notice", className), style: mindBillAppearanceStyle(appearance, style), role: "alert", "aria-label": "Bill rejection reasons", children: [
5170
- /* @__PURE__ */ jsx13("style", { children: lifecycleSurfaceStyles }),
5171
- /* @__PURE__ */ jsxs13("div", { className: "mb-rejection-overview", children: [
5172
- /* @__PURE__ */ jsxs13("header", { className: "mb-rejection-heading", children: [
5173
- /* @__PURE__ */ jsx13("span", { className: "mb-rejection-icon", "aria-hidden": "true", children: "!" }),
5174
- /* @__PURE__ */ jsxs13("div", { children: [
5175
- /* @__PURE__ */ jsx13("strong", { children: title }),
5176
- /* @__PURE__ */ jsxs13("span", { children: [
5376
+ return /* @__PURE__ */ jsxs14("section", { className: classes("mb-surface mb-rejection-notice", className), style: mindBillAppearanceStyle(appearance, style), role: "alert", "aria-label": "Bill rejection reasons", children: [
5377
+ /* @__PURE__ */ jsx14("style", { children: lifecycleSurfaceStyles }),
5378
+ /* @__PURE__ */ jsxs14("div", { className: "mb-rejection-overview", children: [
5379
+ /* @__PURE__ */ jsxs14("header", { className: "mb-rejection-heading", children: [
5380
+ /* @__PURE__ */ jsx14("span", { className: "mb-rejection-icon", "aria-hidden": "true", children: "!" }),
5381
+ /* @__PURE__ */ jsxs14("div", { children: [
5382
+ /* @__PURE__ */ jsx14("strong", { children: title }),
5383
+ /* @__PURE__ */ jsxs14("span", { children: [
5177
5384
  "Fix the ",
5178
5385
  issues.length === 1 ? "issue" : "issues",
5179
5386
  " below, then resubmit."
5180
5387
  ] })
5181
5388
  ] })
5182
5389
  ] }),
5183
- /* @__PURE__ */ jsxs13("ol", { className: "mb-rejection-progress", "aria-label": "Submission status", children: [
5184
- /* @__PURE__ */ jsxs13("li", { className: "is-complete", children: [
5185
- /* @__PURE__ */ jsx13("span", { "aria-hidden": "true", children: "\u2713" }),
5186
- /* @__PURE__ */ jsx13("b", { children: "Sent" }),
5187
- submittedAt ? /* @__PURE__ */ jsx13("small", { children: formatDate(submittedAt) }) : null
5390
+ /* @__PURE__ */ jsxs14("ol", { className: "mb-rejection-progress", "aria-label": "Submission status", children: [
5391
+ /* @__PURE__ */ jsxs14("li", { className: "is-complete", children: [
5392
+ /* @__PURE__ */ jsx14("span", { "aria-hidden": "true", children: "\u2713" }),
5393
+ /* @__PURE__ */ jsx14("b", { children: "Sent" }),
5394
+ submittedAt ? /* @__PURE__ */ jsx14("small", { children: formatDate(submittedAt) }) : null
5188
5395
  ] }),
5189
- /* @__PURE__ */ jsxs13("li", { className: "is-rejected", "aria-current": "step", children: [
5190
- /* @__PURE__ */ jsx13("span", { "aria-hidden": "true", children: "!" }),
5191
- /* @__PURE__ */ jsx13("b", { children: "Rejected" }),
5192
- rejection.receivedAt ? /* @__PURE__ */ jsx13("small", { children: formatDate(rejection.receivedAt) }) : null
5396
+ /* @__PURE__ */ jsxs14("li", { className: "is-rejected", "aria-current": "step", children: [
5397
+ /* @__PURE__ */ jsx14("span", { "aria-hidden": "true", children: "!" }),
5398
+ /* @__PURE__ */ jsx14("b", { children: "Rejected" }),
5399
+ rejection.receivedAt ? /* @__PURE__ */ jsx14("small", { children: formatDate(rejection.receivedAt) }) : null
5193
5400
  ] })
5194
5401
  ] })
5195
5402
  ] }),
5196
- /* @__PURE__ */ jsxs13("div", { className: "mb-rejection-issues", "aria-label": "Rejection reasons", children: [
5197
- /* @__PURE__ */ jsxs13("div", { className: "mb-rejection-issues-heading", children: [
5198
- /* @__PURE__ */ jsxs13("strong", { children: [
5199
- /* @__PURE__ */ jsx13("span", { "aria-hidden": "true", children: "\u25B3" }),
5403
+ /* @__PURE__ */ jsxs14("div", { className: "mb-rejection-issues", "aria-label": "Rejection reasons", children: [
5404
+ /* @__PURE__ */ jsxs14("div", { className: "mb-rejection-issues-heading", children: [
5405
+ /* @__PURE__ */ jsxs14("strong", { children: [
5406
+ /* @__PURE__ */ jsx14("span", { "aria-hidden": "true", children: "\u25B3" }),
5200
5407
  " Rejection reasons"
5201
5408
  ] }),
5202
- /* @__PURE__ */ jsx13("span", { children: billRejectionIssueSummary(rejection, issues.length) })
5409
+ /* @__PURE__ */ jsx14("span", { children: billRejectionIssueSummary(rejection, issues.length) })
5203
5410
  ] }),
5204
- /* @__PURE__ */ jsx13("ol", { "aria-label": `${issues.length} rejection ${issues.length === 1 ? "reason" : "reasons"}`, children: issues.map((issue, index) => /* @__PURE__ */ jsxs13("li", { children: [
5205
- /* @__PURE__ */ jsx13("span", { className: "mb-rejection-bullet", "aria-hidden": "true" }),
5206
- /* @__PURE__ */ jsx13("p", { children: issue.description }),
5207
- issue.code ? /* @__PURE__ */ jsx13("span", { className: "mb-rejection-code", children: issue.code }) : null
5411
+ /* @__PURE__ */ jsx14("ol", { "aria-label": `${issues.length} rejection ${issues.length === 1 ? "reason" : "reasons"}`, children: issues.map((issue, index) => /* @__PURE__ */ jsxs14("li", { children: [
5412
+ /* @__PURE__ */ jsx14("span", { className: "mb-rejection-bullet", "aria-hidden": "true" }),
5413
+ /* @__PURE__ */ jsx14("p", { children: issue.description }),
5414
+ issue.code ? /* @__PURE__ */ jsx14("span", { className: "mb-rejection-code", children: issue.code }) : null
5208
5415
  ] }, `${issue.code ?? "issue"}-${index}`)) }),
5209
- hasCodes ? /* @__PURE__ */ jsxs13("p", { className: "mb-rejection-code-note", children: [
5210
- /* @__PURE__ */ jsx13("span", { "aria-hidden": "true", children: "i" }),
5416
+ hasCodes ? /* @__PURE__ */ jsxs14("p", { className: "mb-rejection-code-note", children: [
5417
+ /* @__PURE__ */ jsx14("span", { "aria-hidden": "true", children: "i" }),
5211
5418
  " Technical error codes are included for support and auditability."
5212
5419
  ] }) : null
5213
5420
  ] })
@@ -5222,18 +5429,18 @@ function BillSnapshotSummary({ bill, patient, injury, delivery, appearance, clas
5222
5429
  ["Charged", currency(bill.totalCharge)],
5223
5430
  ["Balance", currency(bill.balanceDue)]
5224
5431
  ];
5225
- return /* @__PURE__ */ jsxs13("section", { className: classes("mb-surface mb-snapshot", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill snapshot", children: [
5226
- /* @__PURE__ */ jsx13("style", { children: lifecycleSurfaceStyles }),
5227
- /* @__PURE__ */ jsx13("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs13("div", { children: [
5228
- /* @__PURE__ */ jsx13("strong", { children: "Bill snapshot" }),
5229
- /* @__PURE__ */ jsxs13("span", { children: [
5432
+ return /* @__PURE__ */ jsxs14("section", { className: classes("mb-surface mb-snapshot", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill snapshot", children: [
5433
+ /* @__PURE__ */ jsx14("style", { children: lifecycleSurfaceStyles }),
5434
+ /* @__PURE__ */ jsx14("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs14("div", { children: [
5435
+ /* @__PURE__ */ jsx14("strong", { children: "Bill snapshot" }),
5436
+ /* @__PURE__ */ jsxs14("span", { children: [
5230
5437
  "Bill #",
5231
5438
  bill.billNumber
5232
5439
  ] })
5233
5440
  ] }) }),
5234
- /* @__PURE__ */ jsx13("dl", { children: values.map(([label, value]) => /* @__PURE__ */ jsxs13("div", { children: [
5235
- /* @__PURE__ */ jsx13("dt", { children: label }),
5236
- /* @__PURE__ */ jsx13("dd", { children: value })
5441
+ /* @__PURE__ */ jsx14("dl", { children: values.map(([label, value]) => /* @__PURE__ */ jsxs14("div", { children: [
5442
+ /* @__PURE__ */ jsx14("dt", { children: label }),
5443
+ /* @__PURE__ */ jsx14("dd", { children: value })
5237
5444
  ] }, label)) })
5238
5445
  ] });
5239
5446
  }
@@ -5248,140 +5455,140 @@ function BillExplanationOfReview({
5248
5455
  style
5249
5456
  }) {
5250
5457
  const rows = payments.length ? payments : [null];
5251
- return /* @__PURE__ */ jsxs13("section", { className: classes("mb-surface mb-eor-review", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Explanation of Review and payments", children: [
5252
- /* @__PURE__ */ jsx13("style", { children: lifecycleSurfaceStyles }),
5253
- /* @__PURE__ */ jsx13("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs13("div", { children: [
5254
- /* @__PURE__ */ jsx13("strong", { children: "Explanation of Review" }),
5255
- /* @__PURE__ */ jsx13("span", { children: "Payer response and payment reconciliation." })
5458
+ return /* @__PURE__ */ jsxs14("section", { className: classes("mb-surface mb-eor-review", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Explanation of Review and payments", children: [
5459
+ /* @__PURE__ */ jsx14("style", { children: lifecycleSurfaceStyles }),
5460
+ /* @__PURE__ */ jsx14("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs14("div", { children: [
5461
+ /* @__PURE__ */ jsx14("strong", { children: "Explanation of Review" }),
5462
+ /* @__PURE__ */ jsx14("span", { children: "Payer response and payment reconciliation." })
5256
5463
  ] }) }),
5257
- /* @__PURE__ */ jsxs13("dl", { className: "mb-eor-metrics", children: [
5258
- /* @__PURE__ */ jsxs13("div", { children: [
5259
- /* @__PURE__ */ jsx13("dt", { children: "Amount billed" }),
5260
- /* @__PURE__ */ jsx13("dd", { children: currency(remittance.billedAmount) })
5464
+ /* @__PURE__ */ jsxs14("dl", { className: "mb-eor-metrics", children: [
5465
+ /* @__PURE__ */ jsxs14("div", { children: [
5466
+ /* @__PURE__ */ jsx14("dt", { children: "Amount billed" }),
5467
+ /* @__PURE__ */ jsx14("dd", { children: currency(remittance.billedAmount) })
5261
5468
  ] }),
5262
- /* @__PURE__ */ jsxs13("div", { children: [
5263
- /* @__PURE__ */ jsx13("dt", { children: "Payer allowed" }),
5264
- /* @__PURE__ */ jsx13("dd", { children: remittance.payerAllowedAmount === null ? "\u2014" : currency(remittance.payerAllowedAmount) })
5469
+ /* @__PURE__ */ jsxs14("div", { children: [
5470
+ /* @__PURE__ */ jsx14("dt", { children: "Payer allowed" }),
5471
+ /* @__PURE__ */ jsx14("dd", { children: remittance.payerAllowedAmount === null ? "\u2014" : currency(remittance.payerAllowedAmount) })
5265
5472
  ] }),
5266
- /* @__PURE__ */ jsxs13("div", { children: [
5267
- /* @__PURE__ */ jsx13("dt", { children: "Payer reported paid" }),
5268
- /* @__PURE__ */ jsx13("dd", { children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) })
5473
+ /* @__PURE__ */ jsxs14("div", { children: [
5474
+ /* @__PURE__ */ jsx14("dt", { children: "Payer reported paid" }),
5475
+ /* @__PURE__ */ jsx14("dd", { children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) })
5269
5476
  ] }),
5270
- /* @__PURE__ */ jsxs13("div", { className: "is-balance", children: [
5271
- /* @__PURE__ */ jsx13("dt", { children: "Balance due" }),
5272
- /* @__PURE__ */ jsx13("dd", { children: currency(remittance.balanceDue) })
5477
+ /* @__PURE__ */ jsxs14("div", { className: "is-balance", children: [
5478
+ /* @__PURE__ */ jsx14("dt", { children: "Balance due" }),
5479
+ /* @__PURE__ */ jsx14("dd", { children: currency(remittance.balanceDue) })
5273
5480
  ] }),
5274
- /* @__PURE__ */ jsxs13("div", { children: [
5275
- /* @__PURE__ */ jsx13("dt", { children: "Payment posted" }),
5276
- /* @__PURE__ */ jsx13("dd", { children: currency(remittance.postedPrincipal) })
5481
+ /* @__PURE__ */ jsxs14("div", { children: [
5482
+ /* @__PURE__ */ jsx14("dt", { children: "Payment posted" }),
5483
+ /* @__PURE__ */ jsx14("dd", { children: currency(remittance.postedPrincipal) })
5277
5484
  ] }),
5278
- /* @__PURE__ */ jsxs13("div", { children: [
5279
- /* @__PURE__ */ jsx13("dt", { children: "Penalty & interest" }),
5280
- /* @__PURE__ */ jsx13("dd", { children: currency(remittance.postedAdditional) })
5485
+ /* @__PURE__ */ jsxs14("div", { children: [
5486
+ /* @__PURE__ */ jsx14("dt", { children: "Penalty & interest" }),
5487
+ /* @__PURE__ */ jsx14("dd", { children: currency(remittance.postedAdditional) })
5281
5488
  ] }),
5282
- /* @__PURE__ */ jsxs13("div", { children: [
5283
- /* @__PURE__ */ jsx13("dt", { children: "Total received" }),
5284
- /* @__PURE__ */ jsx13("dd", { children: currency(remittance.totalPostedCash) })
5489
+ /* @__PURE__ */ jsxs14("div", { children: [
5490
+ /* @__PURE__ */ jsx14("dt", { children: "Total received" }),
5491
+ /* @__PURE__ */ jsx14("dd", { children: currency(remittance.totalPostedCash) })
5285
5492
  ] }),
5286
- /* @__PURE__ */ jsxs13("div", { children: [
5287
- /* @__PURE__ */ jsx13("dt", { children: "Expected" }),
5288
- /* @__PURE__ */ jsx13("dd", { children: currency(remittance.expectedAmount) })
5493
+ /* @__PURE__ */ jsxs14("div", { children: [
5494
+ /* @__PURE__ */ jsx14("dt", { children: "Expected" }),
5495
+ /* @__PURE__ */ jsx14("dd", { children: currency(remittance.expectedAmount) })
5289
5496
  ] })
5290
5497
  ] }),
5291
- remittance.denialReason ? /* @__PURE__ */ jsxs13("div", { className: "mb-denial", children: [
5292
- /* @__PURE__ */ jsx13("strong", { children: "Denial reason" }),
5293
- /* @__PURE__ */ jsx13("p", { children: remittance.denialReason })
5498
+ remittance.denialReason ? /* @__PURE__ */ jsxs14("div", { className: "mb-denial", children: [
5499
+ /* @__PURE__ */ jsx14("strong", { children: "Denial reason" }),
5500
+ /* @__PURE__ */ jsx14("p", { children: remittance.denialReason })
5294
5501
  ] }) : null,
5295
- /* @__PURE__ */ jsx13("div", { className: "mb-eor-table-wrap", children: /* @__PURE__ */ jsxs13("table", { className: "mb-eor-table", children: [
5296
- /* @__PURE__ */ jsxs13("thead", { children: [
5297
- /* @__PURE__ */ jsxs13("tr", { className: "mb-eor-groups", children: [
5298
- /* @__PURE__ */ jsx13("th", { colSpan: 2, children: "Submission" }),
5299
- /* @__PURE__ */ jsx13("th", { colSpan: 5, children: "EOR payment information" }),
5300
- /* @__PURE__ */ jsx13("th", { colSpan: 2, children: "EOR post" }),
5301
- /* @__PURE__ */ jsx13("th", { children: "EOR" })
5502
+ /* @__PURE__ */ jsx14("div", { className: "mb-eor-table-wrap", children: /* @__PURE__ */ jsxs14("table", { className: "mb-eor-table", children: [
5503
+ /* @__PURE__ */ jsxs14("thead", { children: [
5504
+ /* @__PURE__ */ jsxs14("tr", { className: "mb-eor-groups", children: [
5505
+ /* @__PURE__ */ jsx14("th", { colSpan: 2, children: "Submission" }),
5506
+ /* @__PURE__ */ jsx14("th", { colSpan: 5, children: "EOR payment information" }),
5507
+ /* @__PURE__ */ jsx14("th", { colSpan: 2, children: "EOR post" }),
5508
+ /* @__PURE__ */ jsx14("th", { children: "EOR" })
5302
5509
  ] }),
5303
- /* @__PURE__ */ jsxs13("tr", { children: [
5304
- /* @__PURE__ */ jsx13("th", { children: "Submission" }),
5305
- /* @__PURE__ */ jsx13("th", { children: "Submission payment" }),
5306
- /* @__PURE__ */ jsx13("th", { children: "Payment method" }),
5307
- /* @__PURE__ */ jsx13("th", { children: "Reference" }),
5308
- /* @__PURE__ */ jsx13("th", { children: "Effective date" }),
5309
- /* @__PURE__ */ jsx13("th", { children: "Payment total" }),
5310
- /* @__PURE__ */ jsx13("th", { children: "Deposit date" }),
5311
- /* @__PURE__ */ jsx13("th", { children: "Post date" }),
5312
- /* @__PURE__ */ jsx13("th", { children: "Source" }),
5313
- /* @__PURE__ */ jsx13("th", { children: "Document" })
5510
+ /* @__PURE__ */ jsxs14("tr", { children: [
5511
+ /* @__PURE__ */ jsx14("th", { children: "Submission" }),
5512
+ /* @__PURE__ */ jsx14("th", { children: "Submission payment" }),
5513
+ /* @__PURE__ */ jsx14("th", { children: "Payment method" }),
5514
+ /* @__PURE__ */ jsx14("th", { children: "Reference" }),
5515
+ /* @__PURE__ */ jsx14("th", { children: "Effective date" }),
5516
+ /* @__PURE__ */ jsx14("th", { children: "Payment total" }),
5517
+ /* @__PURE__ */ jsx14("th", { children: "Deposit date" }),
5518
+ /* @__PURE__ */ jsx14("th", { children: "Post date" }),
5519
+ /* @__PURE__ */ jsx14("th", { children: "Source" }),
5520
+ /* @__PURE__ */ jsx14("th", { children: "Document" })
5314
5521
  ] })
5315
5522
  ] }),
5316
- /* @__PURE__ */ jsx13("tbody", { children: rows.map((payment, index) => {
5523
+ /* @__PURE__ */ jsx14("tbody", { children: rows.map((payment, index) => {
5317
5524
  const eor = eors[index] ?? eors[0];
5318
- return /* @__PURE__ */ jsxs13("tr", { children: [
5319
- /* @__PURE__ */ jsxs13("td", { "data-label": "Submission", children: [
5320
- /* @__PURE__ */ jsx13("strong", { children: "Original bill" }),
5321
- submittedAt ? /* @__PURE__ */ jsxs13("span", { children: [
5525
+ return /* @__PURE__ */ jsxs14("tr", { children: [
5526
+ /* @__PURE__ */ jsxs14("td", { "data-label": "Submission", children: [
5527
+ /* @__PURE__ */ jsx14("strong", { children: "Original bill" }),
5528
+ submittedAt ? /* @__PURE__ */ jsxs14("span", { children: [
5322
5529
  "Sent ",
5323
5530
  defaultFormatDate(submittedAt)
5324
5531
  ] }) : null
5325
5532
  ] }),
5326
- /* @__PURE__ */ jsx13("td", { "data-label": "Submission payment", children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) }),
5327
- /* @__PURE__ */ jsx13("td", { "data-label": "Payment method", children: payment ? humanize(payment.method) : "\u2014" }),
5328
- /* @__PURE__ */ jsx13("td", { "data-label": "Reference", children: payment?.checkNumber || "\u2014" }),
5329
- /* @__PURE__ */ jsx13("td", { "data-label": "Effective date", children: payment ? payment.receivedDate || payment.depositDate || defaultFormatDate(payment.postedAt) : "\u2014" }),
5330
- /* @__PURE__ */ jsx13("td", { "data-label": "Payment total", children: payment ? currency(payment.amount) : currency(0) }),
5331
- /* @__PURE__ */ jsx13("td", { "data-label": "Deposit date", children: payment?.depositDate || "Not recorded" }),
5332
- /* @__PURE__ */ jsx13("td", { "data-label": "Post date", children: payment ? defaultFormatDate(payment.postedAt) : eor ? defaultFormatDate(eor.addedAt) : "\u2014" }),
5333
- /* @__PURE__ */ jsx13("td", { "data-label": "Source", children: payment ? payment.source.toUpperCase() : eor ? "EOR" : "\u2014" }),
5334
- /* @__PURE__ */ jsx13("td", { "data-label": "EOR", children: eor && onOpenEor ? /* @__PURE__ */ jsx13("button", { type: "button", className: "mb-eor-link", onClick: () => void onOpenEor(eor), children: eor.filename }) : eor?.filename || "\u2014" })
5533
+ /* @__PURE__ */ jsx14("td", { "data-label": "Submission payment", children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) }),
5534
+ /* @__PURE__ */ jsx14("td", { "data-label": "Payment method", children: payment ? humanize(payment.method) : "\u2014" }),
5535
+ /* @__PURE__ */ jsx14("td", { "data-label": "Reference", children: payment?.checkNumber || "\u2014" }),
5536
+ /* @__PURE__ */ jsx14("td", { "data-label": "Effective date", children: payment ? payment.receivedDate || payment.depositDate || defaultFormatDate(payment.postedAt) : "\u2014" }),
5537
+ /* @__PURE__ */ jsx14("td", { "data-label": "Payment total", children: payment ? currency(payment.amount) : currency(0) }),
5538
+ /* @__PURE__ */ jsx14("td", { "data-label": "Deposit date", children: payment?.depositDate || "Not recorded" }),
5539
+ /* @__PURE__ */ jsx14("td", { "data-label": "Post date", children: payment ? defaultFormatDate(payment.postedAt) : eor ? defaultFormatDate(eor.addedAt) : "\u2014" }),
5540
+ /* @__PURE__ */ jsx14("td", { "data-label": "Source", children: payment ? payment.source.toUpperCase() : eor ? "EOR" : "\u2014" }),
5541
+ /* @__PURE__ */ jsx14("td", { "data-label": "EOR", children: eor && onOpenEor ? /* @__PURE__ */ jsx14("button", { type: "button", className: "mb-eor-link", onClick: () => void onOpenEor(eor), children: eor.filename }) : eor?.filename || "\u2014" })
5335
5542
  ] }, payment?.id ?? `empty-${index}`);
5336
5543
  }) })
5337
5544
  ] }) }),
5338
- eors.length > rows.length ? /* @__PURE__ */ jsx13("div", { className: "mb-eor-documents", children: eors.slice(rows.length).map((eor) => /* @__PURE__ */ jsx13("button", { type: "button", onClick: () => void onOpenEor?.(eor), children: eor.filename }, eor.id)) }) : null
5545
+ eors.length > rows.length ? /* @__PURE__ */ jsx14("div", { className: "mb-eor-documents", children: eors.slice(rows.length).map((eor) => /* @__PURE__ */ jsx14("button", { type: "button", onClick: () => void onOpenEor?.(eor), children: eor.filename }, eor.id)) }) : null
5339
5546
  ] });
5340
5547
  }
5341
5548
  function BillRemittanceCard({ remittance, appearance, className, style }) {
5342
- return /* @__PURE__ */ jsxs13("section", { className: classes("mb-surface mb-remittance", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Remittance summary", children: [
5343
- /* @__PURE__ */ jsx13("style", { children: lifecycleSurfaceStyles }),
5344
- /* @__PURE__ */ jsx13("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs13("div", { children: [
5345
- /* @__PURE__ */ jsx13("strong", { children: "Remittance" }),
5346
- /* @__PURE__ */ jsx13("span", { children: "Amounts reported by the payer and posted to the bill." })
5549
+ return /* @__PURE__ */ jsxs14("section", { className: classes("mb-surface mb-remittance", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Remittance summary", children: [
5550
+ /* @__PURE__ */ jsx14("style", { children: lifecycleSurfaceStyles }),
5551
+ /* @__PURE__ */ jsx14("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs14("div", { children: [
5552
+ /* @__PURE__ */ jsx14("strong", { children: "Remittance" }),
5553
+ /* @__PURE__ */ jsx14("span", { children: "Amounts reported by the payer and posted to the bill." })
5347
5554
  ] }) }),
5348
- /* @__PURE__ */ jsxs13("dl", { children: [
5349
- /* @__PURE__ */ jsxs13("div", { children: [
5350
- /* @__PURE__ */ jsx13("dt", { children: "Amount billed" }),
5351
- /* @__PURE__ */ jsx13("dd", { children: currency(remittance.billedAmount) })
5555
+ /* @__PURE__ */ jsxs14("dl", { children: [
5556
+ /* @__PURE__ */ jsxs14("div", { children: [
5557
+ /* @__PURE__ */ jsx14("dt", { children: "Amount billed" }),
5558
+ /* @__PURE__ */ jsx14("dd", { children: currency(remittance.billedAmount) })
5352
5559
  ] }),
5353
- /* @__PURE__ */ jsxs13("div", { children: [
5354
- /* @__PURE__ */ jsx13("dt", { children: "Expected" }),
5355
- /* @__PURE__ */ jsx13("dd", { children: currency(remittance.expectedAmount) })
5560
+ /* @__PURE__ */ jsxs14("div", { children: [
5561
+ /* @__PURE__ */ jsx14("dt", { children: "Expected" }),
5562
+ /* @__PURE__ */ jsx14("dd", { children: currency(remittance.expectedAmount) })
5356
5563
  ] }),
5357
- /* @__PURE__ */ jsxs13("div", { children: [
5358
- /* @__PURE__ */ jsx13("dt", { children: "Payer allowed" }),
5359
- /* @__PURE__ */ jsx13("dd", { children: remittance.payerAllowedAmount === null ? "\u2014" : currency(remittance.payerAllowedAmount) })
5564
+ /* @__PURE__ */ jsxs14("div", { children: [
5565
+ /* @__PURE__ */ jsx14("dt", { children: "Payer allowed" }),
5566
+ /* @__PURE__ */ jsx14("dd", { children: remittance.payerAllowedAmount === null ? "\u2014" : currency(remittance.payerAllowedAmount) })
5360
5567
  ] }),
5361
- /* @__PURE__ */ jsxs13("div", { children: [
5362
- /* @__PURE__ */ jsx13("dt", { children: "Payer reported paid" }),
5363
- /* @__PURE__ */ jsx13("dd", { children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) })
5568
+ /* @__PURE__ */ jsxs14("div", { children: [
5569
+ /* @__PURE__ */ jsx14("dt", { children: "Payer reported paid" }),
5570
+ /* @__PURE__ */ jsx14("dd", { children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) })
5364
5571
  ] }),
5365
- /* @__PURE__ */ jsxs13("div", { children: [
5366
- /* @__PURE__ */ jsx13("dt", { children: "Payment posted" }),
5367
- /* @__PURE__ */ jsx13("dd", { children: currency(remittance.postedPrincipal) })
5572
+ /* @__PURE__ */ jsxs14("div", { children: [
5573
+ /* @__PURE__ */ jsx14("dt", { children: "Payment posted" }),
5574
+ /* @__PURE__ */ jsx14("dd", { children: currency(remittance.postedPrincipal) })
5368
5575
  ] }),
5369
- /* @__PURE__ */ jsxs13("div", { children: [
5370
- /* @__PURE__ */ jsx13("dt", { children: "Penalty & interest" }),
5371
- /* @__PURE__ */ jsx13("dd", { children: currency(remittance.postedAdditional) })
5576
+ /* @__PURE__ */ jsxs14("div", { children: [
5577
+ /* @__PURE__ */ jsx14("dt", { children: "Penalty & interest" }),
5578
+ /* @__PURE__ */ jsx14("dd", { children: currency(remittance.postedAdditional) })
5372
5579
  ] }),
5373
- /* @__PURE__ */ jsxs13("div", { children: [
5374
- /* @__PURE__ */ jsx13("dt", { children: "Total received" }),
5375
- /* @__PURE__ */ jsx13("dd", { children: currency(remittance.totalPostedCash) })
5580
+ /* @__PURE__ */ jsxs14("div", { children: [
5581
+ /* @__PURE__ */ jsx14("dt", { children: "Total received" }),
5582
+ /* @__PURE__ */ jsx14("dd", { children: currency(remittance.totalPostedCash) })
5376
5583
  ] }),
5377
- /* @__PURE__ */ jsxs13("div", { children: [
5378
- /* @__PURE__ */ jsx13("dt", { children: "Balance due" }),
5379
- /* @__PURE__ */ jsx13("dd", { children: currency(remittance.balanceDue) })
5584
+ /* @__PURE__ */ jsxs14("div", { children: [
5585
+ /* @__PURE__ */ jsx14("dt", { children: "Balance due" }),
5586
+ /* @__PURE__ */ jsx14("dd", { children: currency(remittance.balanceDue) })
5380
5587
  ] })
5381
5588
  ] }),
5382
- remittance.denialReason ? /* @__PURE__ */ jsxs13("div", { className: "mb-denial", children: [
5383
- /* @__PURE__ */ jsx13("strong", { children: "Denial reason" }),
5384
- /* @__PURE__ */ jsx13("p", { children: remittance.denialReason })
5589
+ remittance.denialReason ? /* @__PURE__ */ jsxs14("div", { className: "mb-denial", children: [
5590
+ /* @__PURE__ */ jsx14("strong", { children: "Denial reason" }),
5591
+ /* @__PURE__ */ jsx14("p", { children: remittance.denialReason })
5385
5592
  ] }) : null
5386
5593
  ] });
5387
5594
  }
@@ -5396,72 +5603,72 @@ function BillPayerContactCard({ delivery, appearance, className, style }) {
5396
5603
  delivery.contacts.portalUrl ? ["Portal", "Open payer portal", delivery.contacts.portalUrl] : null
5397
5604
  ].filter(Boolean);
5398
5605
  if (!delivery.payerName && !contacts2.length) return null;
5399
- return /* @__PURE__ */ jsxs13("section", { className: classes("mb-surface mb-contacts", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Payer contact information", children: [
5400
- /* @__PURE__ */ jsx13("style", { children: lifecycleSurfaceStyles }),
5401
- /* @__PURE__ */ jsx13("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs13("div", { children: [
5402
- /* @__PURE__ */ jsx13("strong", { children: delivery.payerName || "Claims administrator" }),
5403
- /* @__PURE__ */ jsx13("span", { children: "Billing and follow-up contacts." })
5606
+ return /* @__PURE__ */ jsxs14("section", { className: classes("mb-surface mb-contacts", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Payer contact information", children: [
5607
+ /* @__PURE__ */ jsx14("style", { children: lifecycleSurfaceStyles }),
5608
+ /* @__PURE__ */ jsx14("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs14("div", { children: [
5609
+ /* @__PURE__ */ jsx14("strong", { children: delivery.payerName || "Claims administrator" }),
5610
+ /* @__PURE__ */ jsx14("span", { children: "Billing and follow-up contacts." })
5404
5611
  ] }) }),
5405
- !contacts2.length ? /* @__PURE__ */ jsx13("p", { className: "mb-empty", children: "No payer contact details are available." }) : /* @__PURE__ */ jsx13("dl", { children: contacts2.map(([label, value, href]) => /* @__PURE__ */ jsxs13("div", { children: [
5406
- /* @__PURE__ */ jsx13("dt", { children: label }),
5407
- /* @__PURE__ */ jsx13("dd", { children: href ? /* @__PURE__ */ jsx13("a", { href, target: label === "Portal" ? "_blank" : void 0, rel: label === "Portal" ? "noreferrer noopener" : void 0, children: value }) : value })
5612
+ !contacts2.length ? /* @__PURE__ */ jsx14("p", { className: "mb-empty", children: "No payer contact details are available." }) : /* @__PURE__ */ jsx14("dl", { children: contacts2.map(([label, value, href]) => /* @__PURE__ */ jsxs14("div", { children: [
5613
+ /* @__PURE__ */ jsx14("dt", { children: label }),
5614
+ /* @__PURE__ */ jsx14("dd", { children: href ? /* @__PURE__ */ jsx14("a", { href, target: label === "Portal" ? "_blank" : void 0, rel: label === "Portal" ? "noreferrer noopener" : void 0, children: value }) : value })
5408
5615
  ] }, label)) })
5409
5616
  ] });
5410
5617
  }
5411
5618
  function BillPaymentLedger({ payments, appearance, className, style }) {
5412
- return /* @__PURE__ */ jsxs13("section", { className: classes("mb-surface mb-payments", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Payment ledger", children: [
5413
- /* @__PURE__ */ jsx13("style", { children: lifecycleSurfaceStyles }),
5414
- /* @__PURE__ */ jsx13("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs13("div", { children: [
5415
- /* @__PURE__ */ jsx13("strong", { children: "Payments" }),
5416
- /* @__PURE__ */ jsx13("span", { children: "Funds recorded against this bill." })
5619
+ return /* @__PURE__ */ jsxs14("section", { className: classes("mb-surface mb-payments", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Payment ledger", children: [
5620
+ /* @__PURE__ */ jsx14("style", { children: lifecycleSurfaceStyles }),
5621
+ /* @__PURE__ */ jsx14("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs14("div", { children: [
5622
+ /* @__PURE__ */ jsx14("strong", { children: "Payments" }),
5623
+ /* @__PURE__ */ jsx14("span", { children: "Funds recorded against this bill." })
5417
5624
  ] }) }),
5418
- !payments.length ? /* @__PURE__ */ jsx13("p", { className: "mb-empty", children: "No payments posted." }) : /* @__PURE__ */ jsx13("div", { className: "mb-payment-list", children: payments.map((payment) => {
5625
+ !payments.length ? /* @__PURE__ */ jsx14("p", { className: "mb-empty", children: "No payments posted." }) : /* @__PURE__ */ jsx14("div", { className: "mb-payment-list", children: payments.map((payment) => {
5419
5626
  const additional = payment.feeAmount ?? 0;
5420
- return /* @__PURE__ */ jsxs13("article", { children: [
5421
- /* @__PURE__ */ jsxs13("div", { className: "mb-payment-amount", children: [
5422
- /* @__PURE__ */ jsx13("strong", { children: currency(payment.amount) }),
5423
- /* @__PURE__ */ jsx13("span", { children: "Total received" })
5627
+ return /* @__PURE__ */ jsxs14("article", { children: [
5628
+ /* @__PURE__ */ jsxs14("div", { className: "mb-payment-amount", children: [
5629
+ /* @__PURE__ */ jsx14("strong", { children: currency(payment.amount) }),
5630
+ /* @__PURE__ */ jsx14("span", { children: "Total received" })
5424
5631
  ] }),
5425
- /* @__PURE__ */ jsxs13("dl", { children: [
5426
- /* @__PURE__ */ jsxs13("div", { children: [
5427
- /* @__PURE__ */ jsx13("dt", { children: "Applied to bill" }),
5428
- /* @__PURE__ */ jsx13("dd", { children: currency(payment.principalAmount) })
5632
+ /* @__PURE__ */ jsxs14("dl", { children: [
5633
+ /* @__PURE__ */ jsxs14("div", { children: [
5634
+ /* @__PURE__ */ jsx14("dt", { children: "Applied to bill" }),
5635
+ /* @__PURE__ */ jsx14("dd", { children: currency(payment.principalAmount) })
5429
5636
  ] }),
5430
- additional > 0 ? /* @__PURE__ */ jsxs13("div", { children: [
5431
- /* @__PURE__ */ jsx13("dt", { children: "Penalty & interest" }),
5432
- /* @__PURE__ */ jsx13("dd", { children: currency(additional) })
5637
+ additional > 0 ? /* @__PURE__ */ jsxs14("div", { children: [
5638
+ /* @__PURE__ */ jsx14("dt", { children: "Penalty & interest" }),
5639
+ /* @__PURE__ */ jsx14("dd", { children: currency(additional) })
5433
5640
  ] }) : null,
5434
- /* @__PURE__ */ jsxs13("div", { children: [
5435
- /* @__PURE__ */ jsx13("dt", { children: "Method" }),
5436
- /* @__PURE__ */ jsx13("dd", { children: payment.method.toUpperCase() })
5641
+ /* @__PURE__ */ jsxs14("div", { children: [
5642
+ /* @__PURE__ */ jsx14("dt", { children: "Method" }),
5643
+ /* @__PURE__ */ jsx14("dd", { children: payment.method.toUpperCase() })
5437
5644
  ] }),
5438
- /* @__PURE__ */ jsxs13("div", { children: [
5439
- /* @__PURE__ */ jsx13("dt", { children: "Reference" }),
5440
- /* @__PURE__ */ jsx13("dd", { children: payment.checkNumber || "\u2014" })
5645
+ /* @__PURE__ */ jsxs14("div", { children: [
5646
+ /* @__PURE__ */ jsx14("dt", { children: "Reference" }),
5647
+ /* @__PURE__ */ jsx14("dd", { children: payment.checkNumber || "\u2014" })
5441
5648
  ] }),
5442
- /* @__PURE__ */ jsxs13("div", { children: [
5443
- /* @__PURE__ */ jsx13("dt", { children: "Effective date" }),
5444
- /* @__PURE__ */ jsx13("dd", { children: payment.receivedDate || payment.depositDate || defaultFormatDate(payment.postedAt) })
5649
+ /* @__PURE__ */ jsxs14("div", { children: [
5650
+ /* @__PURE__ */ jsx14("dt", { children: "Effective date" }),
5651
+ /* @__PURE__ */ jsx14("dd", { children: payment.receivedDate || payment.depositDate || defaultFormatDate(payment.postedAt) })
5445
5652
  ] }),
5446
- /* @__PURE__ */ jsxs13("div", { children: [
5447
- /* @__PURE__ */ jsx13("dt", { children: "Deposit date" }),
5448
- /* @__PURE__ */ jsx13("dd", { children: payment.depositDate || "Not recorded" })
5653
+ /* @__PURE__ */ jsxs14("div", { children: [
5654
+ /* @__PURE__ */ jsx14("dt", { children: "Deposit date" }),
5655
+ /* @__PURE__ */ jsx14("dd", { children: payment.depositDate || "Not recorded" })
5449
5656
  ] }),
5450
- /* @__PURE__ */ jsxs13("div", { children: [
5451
- /* @__PURE__ */ jsx13("dt", { children: "Posted" }),
5452
- /* @__PURE__ */ jsxs13("dd", { children: [
5657
+ /* @__PURE__ */ jsxs14("div", { children: [
5658
+ /* @__PURE__ */ jsx14("dt", { children: "Posted" }),
5659
+ /* @__PURE__ */ jsxs14("dd", { children: [
5453
5660
  defaultFormatDate(payment.postedAt),
5454
5661
  " \xB7 ",
5455
5662
  payment.source.toUpperCase()
5456
5663
  ] })
5457
5664
  ] }),
5458
- /* @__PURE__ */ jsxs13("div", { children: [
5459
- /* @__PURE__ */ jsx13("dt", { children: "Status" }),
5460
- /* @__PURE__ */ jsx13("dd", { children: humanize(payment.status || "posted") })
5665
+ /* @__PURE__ */ jsxs14("div", { children: [
5666
+ /* @__PURE__ */ jsx14("dt", { children: "Status" }),
5667
+ /* @__PURE__ */ jsx14("dd", { children: humanize(payment.status || "posted") })
5461
5668
  ] })
5462
5669
  ] }),
5463
- payment.feeReason ? /* @__PURE__ */ jsx13("p", { children: payment.feeReason }) : null,
5464
- payment.note ? /* @__PURE__ */ jsx13("p", { children: payment.note }) : null
5670
+ payment.feeReason ? /* @__PURE__ */ jsx14("p", { children: payment.feeReason }) : null,
5671
+ payment.note ? /* @__PURE__ */ jsx14("p", { children: payment.note }) : null
5465
5672
  ] }, payment.id);
5466
5673
  }) })
5467
5674
  ] });
@@ -5532,7 +5739,7 @@ import {
5532
5739
 
5533
5740
  // src/second-review-form.tsx
5534
5741
  import { useMemo as useMemo8, useState as useState11 } from "react";
5535
- import { Fragment as Fragment12, jsx as jsx14, jsxs as jsxs14 } from "react/jsx-runtime";
5742
+ import { Fragment as Fragment13, jsx as jsx15, jsxs as jsxs15 } from "react/jsx-runtime";
5536
5743
  var SECOND_REVIEW_REASON_TEMPLATES = [
5537
5744
  {
5538
5745
  label: "Med-legal report denied",
@@ -5689,90 +5896,90 @@ function SecondReviewForm({
5689
5896
  setPreparing(false);
5690
5897
  }
5691
5898
  };
5692
- return /* @__PURE__ */ jsxs14(Fragment12, { children: [
5693
- /* @__PURE__ */ jsx14("style", { children: css10 }),
5694
- /* @__PURE__ */ jsxs14("section", { className: "mb-second-review", children: [
5695
- /* @__PURE__ */ jsxs14("div", { children: [
5696
- /* @__PURE__ */ jsx14("h3", { children: "Submit Second Review" }),
5697
- /* @__PURE__ */ jsx14("p", { children: "Select each disputed service and explain why it should be reconsidered." })
5899
+ return /* @__PURE__ */ jsxs15(Fragment13, { children: [
5900
+ /* @__PURE__ */ jsx15("style", { children: css10 }),
5901
+ /* @__PURE__ */ jsxs15("section", { className: "mb-second-review", children: [
5902
+ /* @__PURE__ */ jsxs15("div", { children: [
5903
+ /* @__PURE__ */ jsx15("h3", { children: "Submit Second Review" }),
5904
+ /* @__PURE__ */ jsx15("p", { children: "Select each disputed service and explain why it should be reconsidered." })
5698
5905
  ] }),
5699
- /* @__PURE__ */ jsxs14("label", { className: "mb-second-review-template", children: [
5700
- /* @__PURE__ */ jsx14("span", { className: "mb-second-review-label", children: "Apply a saved reason to selected lines" }),
5701
- /* @__PURE__ */ jsxs14("select", { className: "mb-second-review-select", defaultValue: "", onChange: (event) => {
5906
+ /* @__PURE__ */ jsxs15("label", { className: "mb-second-review-template", children: [
5907
+ /* @__PURE__ */ jsx15("span", { className: "mb-second-review-label", children: "Apply a saved reason to selected lines" }),
5908
+ /* @__PURE__ */ jsxs15("select", { className: "mb-second-review-select", defaultValue: "", onChange: (event) => {
5702
5909
  applyTemplate(event.target.value);
5703
5910
  event.target.value = "";
5704
5911
  }, children: [
5705
- /* @__PURE__ */ jsx14("option", { value: "", children: "Choose a reason template (optional)" }),
5706
- SECOND_REVIEW_REASON_TEMPLATES.map((template) => /* @__PURE__ */ jsx14("option", { value: template.value, children: template.label }, template.label))
5912
+ /* @__PURE__ */ jsx15("option", { value: "", children: "Choose a reason template (optional)" }),
5913
+ SECOND_REVIEW_REASON_TEMPLATES.map((template) => /* @__PURE__ */ jsx15("option", { value: template.value, children: template.label }, template.label))
5707
5914
  ] })
5708
5915
  ] }),
5709
- /* @__PURE__ */ jsxs14("section", { className: "mb-second-review-lines", "aria-label": "Service lines in dispute", children: [
5916
+ /* @__PURE__ */ jsxs15("section", { className: "mb-second-review-lines", "aria-label": "Service lines in dispute", children: [
5710
5917
  selectableLines.map((line) => {
5711
5918
  const draft = lines[line.id];
5712
- return /* @__PURE__ */ jsxs14("article", { className: "mb-second-review-line", "data-selected": draft?.selected, children: [
5713
- /* @__PURE__ */ jsxs14("div", { className: "mb-second-review-line-head", children: [
5714
- /* @__PURE__ */ jsxs14("label", { className: "mb-second-review-check", children: [
5715
- /* @__PURE__ */ jsx14("input", { type: "checkbox", checked: Boolean(draft?.selected), onChange: (event) => patchLine(line.id, { selected: event.target.checked }) }),
5716
- /* @__PURE__ */ jsxs14("span", { children: [
5919
+ return /* @__PURE__ */ jsxs15("article", { className: "mb-second-review-line", "data-selected": draft?.selected, children: [
5920
+ /* @__PURE__ */ jsxs15("div", { className: "mb-second-review-line-head", children: [
5921
+ /* @__PURE__ */ jsxs15("label", { className: "mb-second-review-check", children: [
5922
+ /* @__PURE__ */ jsx15("input", { type: "checkbox", checked: Boolean(draft?.selected), onChange: (event) => patchLine(line.id, { selected: event.target.checked }) }),
5923
+ /* @__PURE__ */ jsxs15("span", { children: [
5717
5924
  line.code,
5718
5925
  line.modifiers.length ? `-${line.modifiers.join("-")}` : ""
5719
5926
  ] })
5720
5927
  ] }),
5721
- /* @__PURE__ */ jsxs14("span", { className: "mb-second-review-metrics", children: [
5722
- /* @__PURE__ */ jsxs14("span", { children: [
5928
+ /* @__PURE__ */ jsxs15("span", { className: "mb-second-review-metrics", children: [
5929
+ /* @__PURE__ */ jsxs15("span", { children: [
5723
5930
  line.units,
5724
5931
  " unit",
5725
5932
  line.units === 1 ? "" : "s"
5726
5933
  ] }),
5727
- /* @__PURE__ */ jsx14("span", { children: money5(line.charge) })
5934
+ /* @__PURE__ */ jsx15("span", { children: money5(line.charge) })
5728
5935
  ] })
5729
5936
  ] }),
5730
- draft?.selected ? /* @__PURE__ */ jsxs14(Fragment12, { children: [
5731
- /* @__PURE__ */ jsxs14("label", { className: "mb-second-review-field", children: [
5732
- /* @__PURE__ */ jsx14("span", { className: "mb-second-review-label", children: "Reason for requesting Second Review" }),
5733
- /* @__PURE__ */ jsx14("textarea", { className: "mb-second-review-textarea", required: true, value: draft.reason, onChange: (event) => patchLine(line.id, { reason: event.target.value }) })
5937
+ draft?.selected ? /* @__PURE__ */ jsxs15(Fragment13, { children: [
5938
+ /* @__PURE__ */ jsxs15("label", { className: "mb-second-review-field", children: [
5939
+ /* @__PURE__ */ jsx15("span", { className: "mb-second-review-label", children: "Reason for requesting Second Review" }),
5940
+ /* @__PURE__ */ jsx15("textarea", { className: "mb-second-review-textarea", required: true, value: draft.reason, onChange: (event) => patchLine(line.id, { reason: event.target.value }) })
5734
5941
  ] }),
5735
- /* @__PURE__ */ jsxs14("div", { className: "mb-second-review-auth", role: "radiogroup", "aria-label": `Service or good ${line.code} authorized`, children: [
5736
- /* @__PURE__ */ jsx14("strong", { children: "Service/Good Authorized?" }),
5737
- [["yes", "Yes"], ["no", "No"], ["", "Not specified"]].map(([value, label]) => /* @__PURE__ */ jsxs14("label", { children: [
5738
- /* @__PURE__ */ jsx14("input", { type: "radio", name: `authorized-${line.id}`, checked: draft.serviceAuthorized === value, onChange: () => patchLine(line.id, { serviceAuthorized: value }) }),
5942
+ /* @__PURE__ */ jsxs15("div", { className: "mb-second-review-auth", role: "radiogroup", "aria-label": `Service or good ${line.code} authorized`, children: [
5943
+ /* @__PURE__ */ jsx15("strong", { children: "Service/Good Authorized?" }),
5944
+ [["yes", "Yes"], ["no", "No"], ["", "Not specified"]].map(([value, label]) => /* @__PURE__ */ jsxs15("label", { children: [
5945
+ /* @__PURE__ */ jsx15("input", { type: "radio", name: `authorized-${line.id}`, checked: draft.serviceAuthorized === value, onChange: () => patchLine(line.id, { serviceAuthorized: value }) }),
5739
5946
  label
5740
5947
  ] }, label))
5741
5948
  ] })
5742
5949
  ] }) : null
5743
5950
  ] }, line.id);
5744
5951
  }),
5745
- !selectableLines.length ? /* @__PURE__ */ jsx14("div", { className: "mb-second-review-error", children: "This bill has no stable service-line identifiers. Refresh the bill before submitting a Second Review." }) : null
5952
+ !selectableLines.length ? /* @__PURE__ */ jsx15("div", { className: "mb-second-review-error", children: "This bill has no stable service-line identifiers. Refresh the bill before submitting a Second Review." }) : null
5746
5953
  ] }),
5747
- /* @__PURE__ */ jsxs14("fieldset", { className: "mb-second-review-packet", children: [
5748
- /* @__PURE__ */ jsx14("legend", { children: "Supporting packet" }),
5749
- data.bill.attachments.map((attachment) => /* @__PURE__ */ jsxs14("label", { className: "mb-second-review-document", children: [
5750
- /* @__PURE__ */ jsx14("input", { type: "checkbox", checked: attachmentIds.includes(attachment.id), onChange: (event) => setAttachmentIds((current) => event.target.checked ? [...current, attachment.id] : current.filter((id) => id !== attachment.id)) }),
5751
- /* @__PURE__ */ jsxs14("span", { children: [
5752
- /* @__PURE__ */ jsx14("strong", { children: attachment.filename }),
5753
- /* @__PURE__ */ jsx14("small", { children: attachment.description || attachment.documentType })
5954
+ /* @__PURE__ */ jsxs15("fieldset", { className: "mb-second-review-packet", children: [
5955
+ /* @__PURE__ */ jsx15("legend", { children: "Supporting packet" }),
5956
+ data.bill.attachments.map((attachment) => /* @__PURE__ */ jsxs15("label", { className: "mb-second-review-document", children: [
5957
+ /* @__PURE__ */ jsx15("input", { type: "checkbox", checked: attachmentIds.includes(attachment.id), onChange: (event) => setAttachmentIds((current) => event.target.checked ? [...current, attachment.id] : current.filter((id) => id !== attachment.id)) }),
5958
+ /* @__PURE__ */ jsxs15("span", { children: [
5959
+ /* @__PURE__ */ jsx15("strong", { children: attachment.filename }),
5960
+ /* @__PURE__ */ jsx15("small", { children: attachment.description || attachment.documentType })
5754
5961
  ] }),
5755
- /* @__PURE__ */ jsx14("button", { className: "mb-second-review-link", type: "button", onClick: () => void openAttachment(attachment).catch(() => void 0), children: "View" })
5962
+ /* @__PURE__ */ jsx15("button", { className: "mb-second-review-link", type: "button", onClick: () => void openAttachment(attachment).catch(() => void 0), children: "View" })
5756
5963
  ] }, attachment.id)),
5757
- /* @__PURE__ */ jsxs14("label", { className: "mb-second-review-upload", children: [
5758
- /* @__PURE__ */ jsx14("input", { type: "file", accept: "application/pdf,.pdf", multiple: true, onChange: addUploads }),
5759
- /* @__PURE__ */ jsxs14("span", { children: [
5760
- /* @__PURE__ */ jsx14("strong", { children: "Choose one or more PDF files" }),
5964
+ /* @__PURE__ */ jsxs15("label", { className: "mb-second-review-upload", children: [
5965
+ /* @__PURE__ */ jsx15("input", { type: "file", accept: "application/pdf,.pdf", multiple: true, onChange: addUploads }),
5966
+ /* @__PURE__ */ jsxs15("span", { children: [
5967
+ /* @__PURE__ */ jsx15("strong", { children: "Choose one or more PDF files" }),
5761
5968
  " to attach"
5762
5969
  ] })
5763
5970
  ] }),
5764
- uploads.map((upload, index) => /* @__PURE__ */ jsxs14("div", { className: "mb-second-review-uploaded", children: [
5765
- /* @__PURE__ */ jsx14("span", { children: upload.file.name }),
5766
- /* @__PURE__ */ jsx14("button", { className: "mb-second-review-link", type: "button", onClick: () => setUploads((current) => current.filter((_, itemIndex) => itemIndex !== index)), children: "Remove" })
5971
+ uploads.map((upload, index) => /* @__PURE__ */ jsxs15("div", { className: "mb-second-review-uploaded", children: [
5972
+ /* @__PURE__ */ jsx15("span", { children: upload.file.name }),
5973
+ /* @__PURE__ */ jsx15("button", { className: "mb-second-review-link", type: "button", onClick: () => setUploads((current) => current.filter((_, itemIndex) => itemIndex !== index)), children: "Remove" })
5767
5974
  ] }, `${upload.file.name}-${index}`))
5768
5975
  ] }),
5769
- formError || error?.message ? /* @__PURE__ */ jsx14("div", { className: "mb-second-review-error", role: "alert", children: formError || error?.message }) : null,
5770
- /* @__PURE__ */ jsxs14("div", { className: "mb-second-review-actions", children: [
5771
- /* @__PURE__ */ jsx14("button", { className: "mb-second-review-button secondary", type: "button", disabled: submitting || preparing, onClick: onCancel, children: "Cancel" }),
5772
- /* @__PURE__ */ jsx14("button", { className: "mb-second-review-button primary", type: "button", disabled: submitting || preparing || !selected.length || invalidReason, onClick: () => void continueToDelivery(), children: preparing ? "Preparing\u2026" : "Continue to delivery" })
5976
+ formError || error?.message ? /* @__PURE__ */ jsx15("div", { className: "mb-second-review-error", role: "alert", children: formError || error?.message }) : null,
5977
+ /* @__PURE__ */ jsxs15("div", { className: "mb-second-review-actions", children: [
5978
+ /* @__PURE__ */ jsx15("button", { className: "mb-second-review-button secondary", type: "button", disabled: submitting || preparing, onClick: onCancel, children: "Cancel" }),
5979
+ /* @__PURE__ */ jsx15("button", { className: "mb-second-review-button primary", type: "button", disabled: submitting || preparing || !selected.length || invalidReason, onClick: () => void continueToDelivery(), children: preparing ? "Preparing\u2026" : "Continue to delivery" })
5773
5980
  ] })
5774
5981
  ] }),
5775
- delivery ? /* @__PURE__ */ jsx14(SendRouteDialog, { title: "Confirm Second Review delivery", delivery, submitting: submitting || preparing, error: formError || error?.message || null, onCancel: () => setDelivery(null), onConfirm: (route) => void submit(route) }) : null
5982
+ delivery ? /* @__PURE__ */ jsx15(SendRouteDialog, { title: "Confirm Second Review delivery", delivery, submitting: submitting || preparing, error: formError || error?.message || null, onCancel: () => setDelivery(null), onConfirm: (route) => void submit(route) }) : null
5776
5983
  ] });
5777
5984
  }
5778
5985
 
@@ -5784,7 +5991,7 @@ import {
5784
5991
  reportBillStatusContacts as reportBillStatusContacts2,
5785
5992
  secondReviewDeadline as secondReviewDeadline2
5786
5993
  } from "@mindbill/browser";
5787
- import { Fragment as Fragment13, jsx as jsx15, jsxs as jsxs15 } from "react/jsx-runtime";
5994
+ import { Fragment as Fragment14, jsx as jsx16, jsxs as jsxs16 } from "react/jsx-runtime";
5788
5995
  var DEFAULT_REFRESH_INTERVAL2 = 6e4;
5789
5996
  function reservePreviewWindow() {
5790
5997
  const preview = window.open("about:blank", "_blank");
@@ -5951,8 +6158,8 @@ function LifecycleDialog({ children, title, wide = false, onClose }) {
5951
6158
  previous?.focus();
5952
6159
  };
5953
6160
  }, []);
5954
- return /* @__PURE__ */ jsx15("div", { className: "mb-lifecycle-dialog-backdrop", onMouseDown: (event) => event.currentTarget === event.target && onClose(), children: /* @__PURE__ */ jsxs15("div", { ref: dialog, className: ["mb-lifecycle-dialog", wide ? "wide" : ""].filter(Boolean).join(" "), role: "dialog", "aria-modal": "true", "aria-label": title, tabIndex: -1, children: [
5955
- /* @__PURE__ */ jsx15("button", { type: "button", className: "mb-lifecycle-dialog-close", "aria-label": "Close", onClick: onClose, children: "\xD7" }),
6161
+ return /* @__PURE__ */ jsx16("div", { className: "mb-lifecycle-dialog-backdrop", onMouseDown: (event) => event.currentTarget === event.target && onClose(), children: /* @__PURE__ */ jsxs16("div", { ref: dialog, className: ["mb-lifecycle-dialog", wide ? "wide" : ""].filter(Boolean).join(" "), role: "dialog", "aria-modal": "true", "aria-label": title, tabIndex: -1, children: [
6162
+ /* @__PURE__ */ jsx16("button", { type: "button", className: "mb-lifecycle-dialog-close", "aria-label": "Close", onClick: onClose, children: "\xD7" }),
5956
6163
  children
5957
6164
  ] }) });
5958
6165
  }
@@ -5991,22 +6198,22 @@ function correctionRejectionSummary(rejection) {
5991
6198
  function CorrectionRejectionReason({ rejection }) {
5992
6199
  const summary = correctionRejectionSummary(rejection);
5993
6200
  const details = rejection.issues?.filter((issue) => issue.description.trim() !== summary.description || Boolean(issue.code?.trim() && issue.code.trim() !== summary.code)) ?? [];
5994
- return /* @__PURE__ */ jsxs15("div", { className: "mb-lifecycle-correction-reason", role: "alert", children: [
5995
- summary.code ? /* @__PURE__ */ jsxs15("div", { className: "mb-lifecycle-correction-reason-code", children: [
5996
- /* @__PURE__ */ jsx15("span", { children: "Rejection code" }),
5997
- /* @__PURE__ */ jsx15("code", { children: summary.code }),
5998
- summary.clearinghouseDetail ? /* @__PURE__ */ jsxs15("small", { children: [
5999
- /* @__PURE__ */ jsx15("span", { children: "Clearinghouse detail" }),
6201
+ return /* @__PURE__ */ jsxs16("div", { className: "mb-lifecycle-correction-reason", role: "alert", children: [
6202
+ summary.code ? /* @__PURE__ */ jsxs16("div", { className: "mb-lifecycle-correction-reason-code", children: [
6203
+ /* @__PURE__ */ jsx16("span", { children: "Rejection code" }),
6204
+ /* @__PURE__ */ jsx16("code", { children: summary.code }),
6205
+ summary.clearinghouseDetail ? /* @__PURE__ */ jsxs16("small", { children: [
6206
+ /* @__PURE__ */ jsx16("span", { children: "Clearinghouse detail" }),
6000
6207
  summary.clearinghouseDetail
6001
6208
  ] }) : null
6002
6209
  ] }) : null,
6003
- /* @__PURE__ */ jsxs15("div", { className: "mb-lifecycle-correction-reason-description", children: [
6004
- /* @__PURE__ */ jsx15("span", { children: "Reason" }),
6005
- /* @__PURE__ */ jsx15("strong", { children: summary.description })
6210
+ /* @__PURE__ */ jsxs16("div", { className: "mb-lifecycle-correction-reason-description", children: [
6211
+ /* @__PURE__ */ jsx16("span", { children: "Reason" }),
6212
+ /* @__PURE__ */ jsx16("strong", { children: summary.description })
6006
6213
  ] }),
6007
- details.length ? /* @__PURE__ */ jsx15("ul", { "aria-label": "Additional rejection details", children: details.map((issue, index) => /* @__PURE__ */ jsxs15("li", { children: [
6008
- issue.code ? /* @__PURE__ */ jsx15("code", { children: issue.code }) : null,
6009
- /* @__PURE__ */ jsx15("span", { children: issue.description })
6214
+ details.length ? /* @__PURE__ */ jsx16("ul", { "aria-label": "Additional rejection details", children: details.map((issue, index) => /* @__PURE__ */ jsxs16("li", { children: [
6215
+ issue.code ? /* @__PURE__ */ jsx16("code", { children: issue.code }) : null,
6216
+ /* @__PURE__ */ jsx16("span", { children: issue.description })
6010
6217
  ] }, `${issue.code || "issue"}-${index}`)) }) : null
6011
6218
  ] });
6012
6219
  }
@@ -6047,16 +6254,16 @@ function CorrectionVerificationContact({ delivery }) {
6047
6254
  { label: "Mail", values: mailingAddresses }
6048
6255
  ].filter((method) => method.values.length);
6049
6256
  if (!methods.length) return null;
6050
- return /* @__PURE__ */ jsxs15("aside", { className: "mb-lifecycle-correction-contact", children: [
6051
- /* @__PURE__ */ jsx15("strong", { children: "Need to verify the rejected information?" }),
6052
- /* @__PURE__ */ jsxs15("span", { children: [
6257
+ return /* @__PURE__ */ jsxs16("aside", { className: "mb-lifecycle-correction-contact", children: [
6258
+ /* @__PURE__ */ jsx16("strong", { children: "Need to verify the rejected information?" }),
6259
+ /* @__PURE__ */ jsxs16("span", { children: [
6053
6260
  "Contact ",
6054
6261
  delivery.payerName,
6055
6262
  " using any available method:"
6056
6263
  ] }),
6057
- /* @__PURE__ */ jsx15("dl", { children: methods.map((method) => /* @__PURE__ */ jsxs15("div", { children: [
6058
- /* @__PURE__ */ jsx15("dt", { children: method.label }),
6059
- /* @__PURE__ */ jsx15("dd", { children: /* @__PURE__ */ jsx15("ul", { children: method.values.map((value) => /* @__PURE__ */ jsx15("li", { children: method.href ? /* @__PURE__ */ jsx15("a", { href: method.href(value), ...method.label === "Portal" ? { target: "_blank", rel: "noreferrer" } : {}, children: value }) : value }, value)) }) })
6264
+ /* @__PURE__ */ jsx16("dl", { children: methods.map((method) => /* @__PURE__ */ jsxs16("div", { children: [
6265
+ /* @__PURE__ */ jsx16("dt", { children: method.label }),
6266
+ /* @__PURE__ */ jsx16("dd", { children: /* @__PURE__ */ jsx16("ul", { children: method.values.map((value) => /* @__PURE__ */ jsx16("li", { children: method.href ? /* @__PURE__ */ jsx16("a", { href: method.href(value), ...method.label === "Portal" ? { target: "_blank", rel: "noreferrer" } : {}, children: value }) : value }, value)) }) })
6060
6267
  ] }, method.label)) })
6061
6268
  ] });
6062
6269
  }
@@ -6100,6 +6307,8 @@ function correctionBill(data) {
6100
6307
  ...billing ? { billingProvider: {
6101
6308
  name: billing.name,
6102
6309
  taxId: billing.taxId,
6310
+ ...billing.taxIdType ? { taxIdType: billing.taxIdType } : {},
6311
+ ...billing.taxIdType === "SSN" && billing.taxIdConfigured ? { sourceBillId: data.bill.id, ...billing.taxIdLast4 ? { taxIdLast4: billing.taxIdLast4 } : {} } : {},
6103
6312
  npi: billing.npi,
6104
6313
  ...billing.phone ? { phone: billing.phone } : {},
6105
6314
  address: {
@@ -6211,13 +6420,13 @@ function ConnectedBillLifecycle({ appearance, actorName, claimsAdministratorHint
6211
6420
  interestAmount: 0
6212
6421
  }));
6213
6422
  }, [data, onChanged]);
6214
- if (lifecycle.isLoading && !data) return /* @__PURE__ */ jsx15(Fragment13, { children: loadingFallback ?? /* @__PURE__ */ jsx15("div", { className: "mb-lifecycle-loading", children: "Loading bill\u2026" }) });
6423
+ if (lifecycle.isLoading && !data) return /* @__PURE__ */ jsx16(Fragment14, { children: loadingFallback ?? /* @__PURE__ */ jsx16("div", { className: "mb-lifecycle-loading", children: "Loading bill\u2026" }) });
6215
6424
  if (!data) {
6216
6425
  const error = lifecycle.error ?? new Error("Bill could not be loaded.");
6217
- return /* @__PURE__ */ jsx15(Fragment13, { children: errorFallback?.(error, lifecycle.refresh) ?? /* @__PURE__ */ jsxs15("div", { className: "mb-lifecycle-error", role: "alert", children: [
6218
- /* @__PURE__ */ jsx15("strong", { children: "Billing is unavailable." }),
6219
- /* @__PURE__ */ jsx15("span", { children: error.message }),
6220
- /* @__PURE__ */ jsx15("button", { type: "button", onClick: () => void lifecycle.refresh(), children: "Try again" })
6426
+ return /* @__PURE__ */ jsx16(Fragment14, { children: errorFallback?.(error, lifecycle.refresh) ?? /* @__PURE__ */ jsxs16("div", { className: "mb-lifecycle-error", role: "alert", children: [
6427
+ /* @__PURE__ */ jsx16("strong", { children: "Billing is unavailable." }),
6428
+ /* @__PURE__ */ jsx16("span", { children: error.message }),
6429
+ /* @__PURE__ */ jsx16("button", { type: "button", onClick: () => void lifecycle.refresh(), children: "Try again" })
6221
6430
  ] }) });
6222
6431
  }
6223
6432
  const complete = async (message, task) => {
@@ -6336,110 +6545,110 @@ function ConnectedBillLifecycle({ appearance, actorName, claimsAdministratorHint
6336
6545
  const statusContacts = reportBillStatusContacts(data.delivery);
6337
6546
  const receiptEntries = (data.history ?? []).filter((entry) => entry.kind === "submission" || entry.kind === "ack");
6338
6547
  const reviewDeadline = secondReviewDeadline(data.eors);
6339
- return /* @__PURE__ */ jsxs15("section", { className: ["mb-connected-lifecycle", className].filter(Boolean).join(" "), style: mindBillAppearanceStyle(appearance, style), children: [
6340
- /* @__PURE__ */ jsx15("style", { children: CONNECTED_LIFECYCLE_STYLES }),
6341
- ribbonItems.length >= 2 ? /* @__PURE__ */ jsx15(BillSubmissionsRibbon, { items: ribbonItems, onSelect: (item) => {
6548
+ return /* @__PURE__ */ jsxs16("section", { className: ["mb-connected-lifecycle", className].filter(Boolean).join(" "), style: mindBillAppearanceStyle(appearance, style), children: [
6549
+ /* @__PURE__ */ jsx16("style", { children: CONNECTED_LIFECYCLE_STYLES }),
6550
+ ribbonItems.length >= 2 ? /* @__PURE__ */ jsx16(BillSubmissionsRibbon, { items: ribbonItems, onSelect: (item) => {
6342
6551
  setSelectedSubmissionId(item.id);
6343
6552
  setTab("details");
6344
6553
  }, ...appearance ? { appearance } : {} }) : null,
6345
- data.lifecycle.state.toLowerCase() === "rejected" && data.rejection ? /* @__PURE__ */ jsx15(BillRejectionNotice, { rejection: data.rejection, submittedAt: data.lifecycle.submittedAt ?? null, ...appearance ? { appearance } : {} }) : /* @__PURE__ */ jsx15(BillLifecycleProgress, { state: data.lifecycle.state, nativeStatus: data.lifecycle.nativeStatus, submittedAt: data.lifecycle.submittedAt ?? null, agingDays: data.lifecycle.agingDays ?? null, ...appearance ? { appearance } : {} }),
6346
- /* @__PURE__ */ jsxs15("header", { className: "mb-lifecycle-head", children: [
6347
- /* @__PURE__ */ jsxs15("div", { children: [
6348
- /* @__PURE__ */ jsx15("div", { className: "mb-lifecycle-title", children: /* @__PURE__ */ jsxs15("h2", { children: [
6554
+ data.lifecycle.state.toLowerCase() === "rejected" && data.rejection ? /* @__PURE__ */ jsx16(BillRejectionNotice, { rejection: data.rejection, submittedAt: data.lifecycle.submittedAt ?? null, ...appearance ? { appearance } : {} }) : /* @__PURE__ */ jsx16(BillLifecycleProgress, { state: data.lifecycle.state, nativeStatus: data.lifecycle.nativeStatus, submittedAt: data.lifecycle.submittedAt ?? null, agingDays: data.lifecycle.agingDays ?? null, ...appearance ? { appearance } : {} }),
6555
+ /* @__PURE__ */ jsxs16("header", { className: "mb-lifecycle-head", children: [
6556
+ /* @__PURE__ */ jsxs16("div", { children: [
6557
+ /* @__PURE__ */ jsx16("div", { className: "mb-lifecycle-title", children: /* @__PURE__ */ jsxs16("h2", { children: [
6349
6558
  "Bill #",
6350
6559
  data.bill.billNumber
6351
6560
  ] }) }),
6352
- /* @__PURE__ */ jsxs15("p", { children: [
6561
+ /* @__PURE__ */ jsxs16("p", { children: [
6353
6562
  "Claim ",
6354
6563
  data.injury.claimNumber || "\u2014",
6355
6564
  lifecycle.isRefreshing ? " \xB7 Refreshing\u2026" : ""
6356
6565
  ] })
6357
6566
  ] }),
6358
- /* @__PURE__ */ jsx15("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating, onClick: () => void lifecycle.downloadPacket().catch(() => void 0), children: "Download packet" })
6567
+ /* @__PURE__ */ jsx16("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating, onClick: () => void lifecycle.downloadPacket().catch(() => void 0), children: "Download packet" })
6359
6568
  ] }),
6360
- /* @__PURE__ */ jsxs15("div", { className: "mb-lifecycle-tabs", role: "tablist", "aria-label": "Bill view", children: [
6361
- /* @__PURE__ */ jsx15("button", { type: "button", role: "tab", "aria-selected": tab === "details", onClick: () => setTab("details"), children: "Bill details" }),
6362
- /* @__PURE__ */ jsx15("button", { type: "button", role: "tab", "aria-selected": tab === "history", onClick: () => setTab("history"), children: "Bill history" })
6569
+ /* @__PURE__ */ jsxs16("div", { className: "mb-lifecycle-tabs", role: "tablist", "aria-label": "Bill view", children: [
6570
+ /* @__PURE__ */ jsx16("button", { type: "button", role: "tab", "aria-selected": tab === "details", onClick: () => setTab("details"), children: "Bill details" }),
6571
+ /* @__PURE__ */ jsx16("button", { type: "button", role: "tab", "aria-selected": tab === "history", onClick: () => setTab("history"), children: "Bill history" })
6363
6572
  ] }),
6364
- tab === "details" ? /* @__PURE__ */ jsxs15("div", { className: "mb-lifecycle-tabpanel", role: "tabpanel", children: [
6365
- selectedAttempt && ribbonItems.length >= 2 ? /* @__PURE__ */ jsxs15("section", { className: "mb-lifecycle-attempt-detail", "aria-label": "Selected submission detail", children: [
6366
- /* @__PURE__ */ jsxs15("header", { children: [
6367
- /* @__PURE__ */ jsxs15("div", { children: [
6368
- /* @__PURE__ */ jsx15("span", { children: "Selected submission" }),
6369
- /* @__PURE__ */ jsx15("h3", { children: selectedAttempt.label })
6573
+ tab === "details" ? /* @__PURE__ */ jsxs16("div", { className: "mb-lifecycle-tabpanel", role: "tabpanel", children: [
6574
+ selectedAttempt && ribbonItems.length >= 2 ? /* @__PURE__ */ jsxs16("section", { className: "mb-lifecycle-attempt-detail", "aria-label": "Selected submission detail", children: [
6575
+ /* @__PURE__ */ jsxs16("header", { children: [
6576
+ /* @__PURE__ */ jsxs16("div", { children: [
6577
+ /* @__PURE__ */ jsx16("span", { children: "Selected submission" }),
6578
+ /* @__PURE__ */ jsx16("h3", { children: selectedAttempt.label })
6370
6579
  ] }),
6371
- /* @__PURE__ */ jsx15("strong", { children: selectedAttempt.isCurrent ? "Current" : "Previous" })
6580
+ /* @__PURE__ */ jsx16("strong", { children: selectedAttempt.isCurrent ? "Current" : "Previous" })
6372
6581
  ] }),
6373
- /* @__PURE__ */ jsxs15("dl", { children: [
6374
- /* @__PURE__ */ jsxs15("div", { children: [
6375
- /* @__PURE__ */ jsx15("dt", { children: "Bill" }),
6376
- /* @__PURE__ */ jsxs15("dd", { children: [
6582
+ /* @__PURE__ */ jsxs16("dl", { children: [
6583
+ /* @__PURE__ */ jsxs16("div", { children: [
6584
+ /* @__PURE__ */ jsx16("dt", { children: "Bill" }),
6585
+ /* @__PURE__ */ jsxs16("dd", { children: [
6377
6586
  "#",
6378
6587
  selectedAttempt.billNumber || data.bill.billNumber
6379
6588
  ] })
6380
6589
  ] }),
6381
- /* @__PURE__ */ jsxs15("div", { children: [
6382
- /* @__PURE__ */ jsx15("dt", { children: "Delivery" }),
6383
- /* @__PURE__ */ jsx15("dd", { children: selectedAttempt.deliveryLabel || "\u2014" })
6590
+ /* @__PURE__ */ jsxs16("div", { children: [
6591
+ /* @__PURE__ */ jsx16("dt", { children: "Delivery" }),
6592
+ /* @__PURE__ */ jsx16("dd", { children: selectedAttempt.deliveryLabel || "\u2014" })
6384
6593
  ] }),
6385
- /* @__PURE__ */ jsxs15("div", { children: [
6386
- /* @__PURE__ */ jsx15("dt", { children: "Sent" }),
6387
- /* @__PURE__ */ jsx15("dd", { children: selectedAttempt.sentAt ? new Date(selectedAttempt.sentAt).toLocaleString() : "\u2014" })
6594
+ /* @__PURE__ */ jsxs16("div", { children: [
6595
+ /* @__PURE__ */ jsx16("dt", { children: "Sent" }),
6596
+ /* @__PURE__ */ jsx16("dd", { children: selectedAttempt.sentAt ? new Date(selectedAttempt.sentAt).toLocaleString() : "\u2014" })
6388
6597
  ] }),
6389
- /* @__PURE__ */ jsxs15("div", { children: [
6390
- /* @__PURE__ */ jsx15("dt", { children: "Status" }),
6391
- /* @__PURE__ */ jsx15("dd", { children: selectedAttempt.ackLabel || selectedAttempt.status || "Submitted" })
6598
+ /* @__PURE__ */ jsxs16("div", { children: [
6599
+ /* @__PURE__ */ jsx16("dt", { children: "Status" }),
6600
+ /* @__PURE__ */ jsx16("dd", { children: selectedAttempt.ackLabel || selectedAttempt.status || "Submitted" })
6392
6601
  ] }),
6393
- selectedAttempt.complianceLabel ? /* @__PURE__ */ jsxs15("div", { children: [
6394
- /* @__PURE__ */ jsx15("dt", { children: selectedAttempt.complianceLabel }),
6395
- /* @__PURE__ */ jsx15("dd", { children: selectedAttempt.complianceAt ? new Date(selectedAttempt.complianceAt).toLocaleDateString() : "\u2014" })
6602
+ selectedAttempt.complianceLabel ? /* @__PURE__ */ jsxs16("div", { children: [
6603
+ /* @__PURE__ */ jsx16("dt", { children: selectedAttempt.complianceLabel }),
6604
+ /* @__PURE__ */ jsx16("dd", { children: selectedAttempt.complianceAt ? new Date(selectedAttempt.complianceAt).toLocaleDateString() : "\u2014" })
6396
6605
  ] }) : null
6397
6606
  ] })
6398
6607
  ] }) : null,
6399
- data.eors.length || data.payments.length || ["processed", "denied", "partially_paid"].includes(data.lifecycle.state) ? /* @__PURE__ */ jsx15(BillExplanationOfReview, { remittance: data.remittance, eors: data.eors, payments: data.payments, submittedAt: data.lifecycle.submittedAt ?? null, onOpenEor: lifecycle.openEor, ...appearance ? { appearance } : {} }) : null,
6400
- showSandboxControls ? /* @__PURE__ */ jsxs15("section", { className: "mb-lifecycle-simulator", "aria-label": "Sandbox lifecycle simulator", children: [
6401
- /* @__PURE__ */ jsxs15("div", { children: [
6402
- /* @__PURE__ */ jsx15("span", { children: "Sandbox demo controls" }),
6403
- /* @__PURE__ */ jsx15("h3", { children: "Simulate the next payer response" }),
6404
- /* @__PURE__ */ jsx15("p", { children: "This changes sandbox data only. The host receives the result through the same lifecycle API and components partners use." })
6608
+ data.eors.length || data.payments.length || ["processed", "denied", "partially_paid"].includes(data.lifecycle.state) ? /* @__PURE__ */ jsx16(BillExplanationOfReview, { remittance: data.remittance, eors: data.eors, payments: data.payments, submittedAt: data.lifecycle.submittedAt ?? null, onOpenEor: lifecycle.openEor, ...appearance ? { appearance } : {} }) : null,
6609
+ showSandboxControls ? /* @__PURE__ */ jsxs16("section", { className: "mb-lifecycle-simulator", "aria-label": "Sandbox lifecycle simulator", children: [
6610
+ /* @__PURE__ */ jsxs16("div", { children: [
6611
+ /* @__PURE__ */ jsx16("span", { children: "Sandbox demo controls" }),
6612
+ /* @__PURE__ */ jsx16("h3", { children: "Simulate the next payer response" }),
6613
+ /* @__PURE__ */ jsx16("p", { children: "This changes sandbox data only. The host receives the result through the same lifecycle API and components partners use." })
6405
6614
  ] }),
6406
- simulations.length ? /* @__PURE__ */ jsx15("div", { className: "mb-lifecycle-simulator-actions", children: simulations.map((scenario) => /* @__PURE__ */ jsxs15("button", { type: "button", disabled: lifecycle.isMutating, onClick: () => void complete(`${scenario.label} simulated.`, () => lifecycle.simulateSandbox({ scenario: scenario.id })), children: [
6407
- /* @__PURE__ */ jsx15("strong", { children: scenario.label }),
6408
- /* @__PURE__ */ jsx15("span", { children: scenario.detail })
6409
- ] }, scenario.id)) }) : /* @__PURE__ */ jsx15("p", { className: "mb-lifecycle-simulator-idle", children: "No simulated payer transition is needed at this stage. Use the bill action below to continue." })
6615
+ simulations.length ? /* @__PURE__ */ jsx16("div", { className: "mb-lifecycle-simulator-actions", children: simulations.map((scenario) => /* @__PURE__ */ jsxs16("button", { type: "button", disabled: lifecycle.isMutating, onClick: () => void complete(`${scenario.label} simulated.`, () => lifecycle.simulateSandbox({ scenario: scenario.id })), children: [
6616
+ /* @__PURE__ */ jsx16("strong", { children: scenario.label }),
6617
+ /* @__PURE__ */ jsx16("span", { children: scenario.detail })
6618
+ ] }, scenario.id)) }) : /* @__PURE__ */ jsx16("p", { className: "mb-lifecycle-simulator-idle", children: "No simulated payer transition is needed at this stage. Use the bill action below to continue." })
6410
6619
  ] }) : null,
6411
- /* @__PURE__ */ jsx15(BillReadOnlyForm, { data, onOpenAttachment: lifecycle.openAttachment, ...appearance ? { appearance } : {} }),
6412
- /* @__PURE__ */ jsxs15("section", { className: "mb-lifecycle-notes", "aria-label": "Bill notes", children: [
6413
- /* @__PURE__ */ jsxs15("header", { children: [
6414
- /* @__PURE__ */ jsxs15("div", { children: [
6415
- /* @__PURE__ */ jsx15("h3", { children: "Bill notes" }),
6416
- /* @__PURE__ */ jsx15("p", { children: "Shared with everyone working this bill through the Partner API." })
6620
+ /* @__PURE__ */ jsx16(BillReadOnlyForm, { data, onOpenAttachment: lifecycle.openAttachment, ...appearance ? { appearance } : {} }),
6621
+ /* @__PURE__ */ jsxs16("section", { className: "mb-lifecycle-notes", "aria-label": "Bill notes", children: [
6622
+ /* @__PURE__ */ jsxs16("header", { children: [
6623
+ /* @__PURE__ */ jsxs16("div", { children: [
6624
+ /* @__PURE__ */ jsx16("h3", { children: "Bill notes" }),
6625
+ /* @__PURE__ */ jsx16("p", { children: "Shared with everyone working this bill through the Partner API." })
6417
6626
  ] }),
6418
- /* @__PURE__ */ jsx15("span", { children: billNotes.length })
6627
+ /* @__PURE__ */ jsx16("span", { children: billNotes.length })
6419
6628
  ] }),
6420
- billNotes.length ? /* @__PURE__ */ jsx15("ol", { children: billNotes.map((entry) => /* @__PURE__ */ jsxs15("li", { children: [
6421
- /* @__PURE__ */ jsx15("p", { children: entry.summary }),
6422
- /* @__PURE__ */ jsxs15("small", { children: [
6629
+ billNotes.length ? /* @__PURE__ */ jsx16("ol", { children: billNotes.map((entry) => /* @__PURE__ */ jsxs16("li", { children: [
6630
+ /* @__PURE__ */ jsx16("p", { children: entry.summary }),
6631
+ /* @__PURE__ */ jsxs16("small", { children: [
6423
6632
  entry.actor || "System",
6424
6633
  " \xB7 ",
6425
6634
  usDate(entry.date)
6426
6635
  ] })
6427
- ] }, entry.id)) }) : /* @__PURE__ */ jsx15("p", { className: "mb-lifecycle-notes-empty", children: "No notes yet." }),
6428
- /* @__PURE__ */ jsxs15("form", { onSubmit: (event) => {
6636
+ ] }, entry.id)) }) : /* @__PURE__ */ jsx16("p", { className: "mb-lifecycle-notes-empty", children: "No notes yet." }),
6637
+ /* @__PURE__ */ jsxs16("form", { onSubmit: (event) => {
6429
6638
  event.preventDefault();
6430
6639
  void addNote();
6431
6640
  }, children: [
6432
- /* @__PURE__ */ jsxs15("label", { children: [
6433
- /* @__PURE__ */ jsx15("span", { children: "Add a note" }),
6434
- /* @__PURE__ */ jsx15("textarea", { value: note, maxLength: 2e3, placeholder: "Add context for the billing team\u2026", onChange: (event) => setNote(event.target.value) })
6641
+ /* @__PURE__ */ jsxs16("label", { children: [
6642
+ /* @__PURE__ */ jsx16("span", { children: "Add a note" }),
6643
+ /* @__PURE__ */ jsx16("textarea", { value: note, maxLength: 2e3, placeholder: "Add context for the billing team\u2026", onChange: (event) => setNote(event.target.value) })
6435
6644
  ] }),
6436
- /* @__PURE__ */ jsx15("button", { type: "submit", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating || !note.trim(), children: lifecycle.isMutating ? "Adding\u2026" : "Add note" })
6645
+ /* @__PURE__ */ jsx16("button", { type: "submit", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating || !note.trim(), children: lifecycle.isMutating ? "Adding\u2026" : "Add note" })
6437
6646
  ] })
6438
6647
  ] })
6439
- ] }) : /* @__PURE__ */ jsx15("div", { className: "mb-lifecycle-tabpanel", role: "tabpanel", children: data.history?.length ? /* @__PURE__ */ jsx15(BillHistoryTable, { entries: data.history, onOpenDocument: lifecycle.openAttachment, ...appearance ? { appearance } : {} }) : /* @__PURE__ */ jsx15(BillActivityTimeline, { events: data.activity, ...appearance ? { appearance } : {} }) }),
6440
- viewEor || actions.length ? /* @__PURE__ */ jsxs15("aside", { className: "mb-lifecycle-actions-sheet", "aria-label": "Bill actions", children: [
6441
- viewEor && data.eors[0] ? /* @__PURE__ */ jsx15("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => void lifecycle.openEor(data.eors[0]).catch(() => void 0), children: viewEor.label }) : null,
6442
- actions.map((action) => /* @__PURE__ */ jsx15("button", { type: "button", className: action.primary ? "mb-lifecycle-button primary" : "mb-lifecycle-button secondary", onClick: () => {
6648
+ ] }) : /* @__PURE__ */ jsx16("div", { className: "mb-lifecycle-tabpanel", role: "tabpanel", children: data.history?.length ? /* @__PURE__ */ jsx16(BillHistoryTable, { entries: data.history, onOpenDocument: lifecycle.openAttachment, ...appearance ? { appearance } : {} }) : /* @__PURE__ */ jsx16(BillActivityTimeline, { events: data.activity, ...appearance ? { appearance } : {} }) }),
6649
+ viewEor || actions.length ? /* @__PURE__ */ jsxs16("aside", { className: "mb-lifecycle-actions-sheet", "aria-label": "Bill actions", children: [
6650
+ viewEor && data.eors[0] ? /* @__PURE__ */ jsx16("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => void lifecycle.openEor(data.eors[0]).catch(() => void 0), children: viewEor.label }) : null,
6651
+ actions.map((action) => /* @__PURE__ */ jsx16("button", { type: "button", className: action.primary ? "mb-lifecycle-button primary" : "mb-lifecycle-button secondary", onClick: () => {
6443
6652
  const next = actionPanel(action);
6444
6653
  if (!next) return;
6445
6654
  if (next === "resubmit") setCorrectionError("");
@@ -6448,22 +6657,22 @@ function ConnectedBillLifecycle({ appearance, actorName, claimsAdministratorHint
6448
6657
  setPanel(next);
6449
6658
  }, children: action.label }, action.id))
6450
6659
  ] }) : null,
6451
- panel === "resubmit" && correctionInitialBill ? /* @__PURE__ */ jsx15(LifecycleDialog, { title: "Correct and resubmit", wide: true, onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs15("section", { className: "mb-lifecycle-correction", children: [
6452
- /* @__PURE__ */ jsx15("header", { children: /* @__PURE__ */ jsxs15("div", { children: [
6453
- /* @__PURE__ */ jsx15("h3", { children: "Correct and resubmit" }),
6454
- /* @__PURE__ */ jsx15("p", { children: "Review the rejected snapshot, correct the highlighted information, and submit a new immutable attempt under this bill." })
6660
+ panel === "resubmit" && correctionInitialBill ? /* @__PURE__ */ jsx16(LifecycleDialog, { title: "Correct and resubmit", wide: true, onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs16("section", { className: "mb-lifecycle-correction", children: [
6661
+ /* @__PURE__ */ jsx16("header", { children: /* @__PURE__ */ jsxs16("div", { children: [
6662
+ /* @__PURE__ */ jsx16("h3", { children: "Correct and resubmit" }),
6663
+ /* @__PURE__ */ jsx16("p", { children: "Review the rejected snapshot, correct the highlighted information, and submit a new immutable attempt under this bill." })
6455
6664
  ] }) }),
6456
- data.environment === "live" ? /* @__PURE__ */ jsxs15("div", { className: "mb-lifecycle-live-warning", children: [
6457
- /* @__PURE__ */ jsx15("strong", { children: "Live clearinghouse submission" }),
6458
- /* @__PURE__ */ jsx15("span", { children: "Resubmitting sends a real bill. Confirm the corrected information before continuing." })
6665
+ data.environment === "live" ? /* @__PURE__ */ jsxs16("div", { className: "mb-lifecycle-live-warning", children: [
6666
+ /* @__PURE__ */ jsx16("strong", { children: "Live clearinghouse submission" }),
6667
+ /* @__PURE__ */ jsx16("span", { children: "Resubmitting sends a real bill. Confirm the corrected information before continuing." })
6459
6668
  ] }) : null,
6460
- data.rejection ? /* @__PURE__ */ jsx15(CorrectionRejectionReason, { rejection: data.rejection }) : null,
6461
- /* @__PURE__ */ jsx15(CorrectionVerificationContact, { delivery: data.delivery }),
6462
- /* @__PURE__ */ jsxs15("label", { className: "mb-lifecycle-correction-note", children: [
6463
- /* @__PURE__ */ jsx15("span", { children: "Correction note (optional)" }),
6464
- /* @__PURE__ */ jsx15("textarea", { value: reason, placeholder: "What changed before resubmission?", onChange: (event) => setReason(event.target.value) })
6669
+ data.rejection ? /* @__PURE__ */ jsx16(CorrectionRejectionReason, { rejection: data.rejection }) : null,
6670
+ /* @__PURE__ */ jsx16(CorrectionVerificationContact, { delivery: data.delivery }),
6671
+ /* @__PURE__ */ jsxs16("label", { className: "mb-lifecycle-correction-note", children: [
6672
+ /* @__PURE__ */ jsx16("span", { children: "Correction note (optional)" }),
6673
+ /* @__PURE__ */ jsx16("textarea", { value: reason, placeholder: "What changed before resubmission?", onChange: (event) => setReason(event.target.value) })
6465
6674
  ] }),
6466
- /* @__PURE__ */ jsx15(
6675
+ /* @__PURE__ */ jsx16(
6467
6676
  BillSubmissionForm,
6468
6677
  {
6469
6678
  className: "mbsf-lifecycle-correction",
@@ -6489,18 +6698,18 @@ function ConnectedBillLifecycle({ appearance, actorName, claimsAdministratorHint
6489
6698
  ...appearance ? { appearance } : {}
6490
6699
  }
6491
6700
  ),
6492
- correctionError ? /* @__PURE__ */ jsx15("div", { className: "mb-lifecycle-message error", role: "alert", children: correctionError }) : null
6701
+ correctionError ? /* @__PURE__ */ jsx16("div", { className: "mb-lifecycle-message error", role: "alert", children: correctionError }) : null
6493
6702
  ] }) }) : null,
6494
- panel === "submit_new_bill" && correctionInitialBill ? /* @__PURE__ */ jsx15(LifecycleDialog, { title: "Submit New Bill", wide: true, onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs15("section", { className: "mb-lifecycle-correction", children: [
6495
- /* @__PURE__ */ jsx15("header", { children: /* @__PURE__ */ jsxs15("div", { children: [
6496
- /* @__PURE__ */ jsx15("h3", { children: "Submit New Bill" }),
6497
- /* @__PURE__ */ jsx15("p", { children: "This closed bill stays closed and keeps its record. Review the carried-over snapshot below and submit a fresh bill \u2014 both bills stay linked in the submissions timeline." })
6703
+ panel === "submit_new_bill" && correctionInitialBill ? /* @__PURE__ */ jsx16(LifecycleDialog, { title: "Submit New Bill", wide: true, onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs16("section", { className: "mb-lifecycle-correction", children: [
6704
+ /* @__PURE__ */ jsx16("header", { children: /* @__PURE__ */ jsxs16("div", { children: [
6705
+ /* @__PURE__ */ jsx16("h3", { children: "Submit New Bill" }),
6706
+ /* @__PURE__ */ jsx16("p", { children: "This closed bill stays closed and keeps its record. Review the carried-over snapshot below and submit a fresh bill \u2014 both bills stay linked in the submissions timeline." })
6498
6707
  ] }) }),
6499
- /* @__PURE__ */ jsxs15("label", { className: "mb-lifecycle-correction-note", children: [
6500
- /* @__PURE__ */ jsx15("span", { children: "Submission note (optional)" }),
6501
- /* @__PURE__ */ jsx15("textarea", { value: reason, placeholder: "Why is a new bill being submitted?", onChange: (event) => setReason(event.target.value) })
6708
+ /* @__PURE__ */ jsxs16("label", { className: "mb-lifecycle-correction-note", children: [
6709
+ /* @__PURE__ */ jsx16("span", { children: "Submission note (optional)" }),
6710
+ /* @__PURE__ */ jsx16("textarea", { value: reason, placeholder: "Why is a new bill being submitted?", onChange: (event) => setReason(event.target.value) })
6502
6711
  ] }),
6503
- /* @__PURE__ */ jsx15(
6712
+ /* @__PURE__ */ jsx16(
6504
6713
  BillSubmissionForm,
6505
6714
  {
6506
6715
  className: "mbsf-lifecycle-correction",
@@ -6525,10 +6734,10 @@ function ConnectedBillLifecycle({ appearance, actorName, claimsAdministratorHint
6525
6734
  ...appearance ? { appearance } : {}
6526
6735
  }
6527
6736
  ),
6528
- newBillError ? /* @__PURE__ */ jsx15("div", { className: "mb-lifecycle-message error", role: "alert", children: newBillError }) : null
6737
+ newBillError ? /* @__PURE__ */ jsx16("div", { className: "mb-lifecycle-message error", role: "alert", children: newBillError }) : null
6529
6738
  ] }) }) : null,
6530
- panel === "second_review" ? /* @__PURE__ */ jsxs15(LifecycleDialog, { title: "Submit Second Review", wide: true, onClose: () => setPanel(""), children: [
6531
- /* @__PURE__ */ jsx15(
6739
+ panel === "second_review" ? /* @__PURE__ */ jsxs16(LifecycleDialog, { title: "Submit Second Review", wide: true, onClose: () => setPanel(""), children: [
6740
+ /* @__PURE__ */ jsx16(
6532
6741
  SecondReviewForm,
6533
6742
  {
6534
6743
  data,
@@ -6541,86 +6750,86 @@ function ConnectedBillLifecycle({ appearance, actorName, claimsAdministratorHint
6541
6750
  onSubmit: (input) => complete("Second Review submitted.", () => lifecycle.submitSecondReview({ ...input, ...actor }))
6542
6751
  }
6543
6752
  ),
6544
- reviewDeadline ? /* @__PURE__ */ jsxs15("p", { className: "mb-lifecycle-deadline-hint", children: [
6753
+ reviewDeadline ? /* @__PURE__ */ jsxs16("p", { className: "mb-lifecycle-deadline-hint", children: [
6545
6754
  "Second Review must be requested within 90 days of the denial EOR (dated ",
6546
6755
  usDate(reviewDeadline.eorDate),
6547
6756
  ") \u2014 file by ",
6548
- /* @__PURE__ */ jsx15("strong", { children: usDate(reviewDeadline.deadline) }),
6757
+ /* @__PURE__ */ jsx16("strong", { children: usDate(reviewDeadline.deadline) }),
6549
6758
  "."
6550
6759
  ] }) : null
6551
6760
  ] }) : null,
6552
- panel === "payment" ? /* @__PURE__ */ jsx15(LifecycleDialog, { title: "Post payment", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs15("section", { className: "mb-lifecycle-panel", children: [
6553
- /* @__PURE__ */ jsxs15("div", { children: [
6554
- /* @__PURE__ */ jsx15("h3", { children: "Post payment" }),
6555
- /* @__PURE__ */ jsx15("p", { children: "Record a full or partial payment, plus any penalty and interest received." })
6761
+ panel === "payment" ? /* @__PURE__ */ jsx16(LifecycleDialog, { title: "Post payment", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs16("section", { className: "mb-lifecycle-panel", children: [
6762
+ /* @__PURE__ */ jsxs16("div", { children: [
6763
+ /* @__PURE__ */ jsx16("h3", { children: "Post payment" }),
6764
+ /* @__PURE__ */ jsx16("p", { children: "Record a full or partial payment, plus any penalty and interest received." })
6556
6765
  ] }),
6557
- /* @__PURE__ */ jsxs15("div", { className: "mb-lifecycle-fields two", children: [
6558
- /* @__PURE__ */ jsxs15("label", { children: [
6559
- /* @__PURE__ */ jsx15("span", { children: "Amount applied to bill" }),
6560
- /* @__PURE__ */ jsx15("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) })) })
6766
+ /* @__PURE__ */ jsxs16("div", { className: "mb-lifecycle-fields two", children: [
6767
+ /* @__PURE__ */ jsxs16("label", { children: [
6768
+ /* @__PURE__ */ jsx16("span", { children: "Amount applied to bill" }),
6769
+ /* @__PURE__ */ jsx16("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) })) })
6561
6770
  ] }),
6562
- /* @__PURE__ */ jsxs15("label", { children: [
6563
- /* @__PURE__ */ jsx15("span", { children: "Penalty" }),
6564
- /* @__PURE__ */ jsx15("input", { type: "number", min: "0", step: "0.01", value: payment.penaltyAmount || "", placeholder: "0.00", onChange: (event) => setPayment((current) => ({ ...current, penaltyAmount: Number(event.target.value) })) })
6771
+ /* @__PURE__ */ jsxs16("label", { children: [
6772
+ /* @__PURE__ */ jsx16("span", { children: "Penalty" }),
6773
+ /* @__PURE__ */ jsx16("input", { type: "number", min: "0", step: "0.01", value: payment.penaltyAmount || "", placeholder: "0.00", onChange: (event) => setPayment((current) => ({ ...current, penaltyAmount: Number(event.target.value) })) })
6565
6774
  ] }),
6566
- /* @__PURE__ */ jsxs15("label", { children: [
6567
- /* @__PURE__ */ jsx15("span", { children: "Interest" }),
6568
- /* @__PURE__ */ jsx15("input", { type: "number", min: "0", step: "0.01", value: payment.interestAmount || "", placeholder: "0.00", onChange: (event) => setPayment((current) => ({ ...current, interestAmount: Number(event.target.value) })) })
6775
+ /* @__PURE__ */ jsxs16("label", { children: [
6776
+ /* @__PURE__ */ jsx16("span", { children: "Interest" }),
6777
+ /* @__PURE__ */ jsx16("input", { type: "number", min: "0", step: "0.01", value: payment.interestAmount || "", placeholder: "0.00", onChange: (event) => setPayment((current) => ({ ...current, interestAmount: Number(event.target.value) })) })
6569
6778
  ] }),
6570
- /* @__PURE__ */ jsxs15("label", { children: [
6571
- /* @__PURE__ */ jsx15("span", { children: "Method" }),
6572
- /* @__PURE__ */ jsxs15("select", { value: payment.method, onChange: (event) => setPayment((current) => ({ ...current, method: event.target.value })), children: [
6573
- /* @__PURE__ */ jsx15("option", { value: "check", children: "Check" }),
6574
- /* @__PURE__ */ jsx15("option", { value: "eft", children: "EFT" })
6779
+ /* @__PURE__ */ jsxs16("label", { children: [
6780
+ /* @__PURE__ */ jsx16("span", { children: "Method" }),
6781
+ /* @__PURE__ */ jsxs16("select", { value: payment.method, onChange: (event) => setPayment((current) => ({ ...current, method: event.target.value })), children: [
6782
+ /* @__PURE__ */ jsx16("option", { value: "check", children: "Check" }),
6783
+ /* @__PURE__ */ jsx16("option", { value: "eft", children: "EFT" })
6575
6784
  ] })
6576
6785
  ] }),
6577
- /* @__PURE__ */ jsxs15("label", { children: [
6578
- /* @__PURE__ */ jsx15("span", { children: payment.method === "check" ? "Check number" : "EFT reference" }),
6579
- /* @__PURE__ */ jsx15("input", { value: payment.checkNumber, onChange: (event) => setPayment((current) => ({ ...current, checkNumber: event.target.value })) })
6786
+ /* @__PURE__ */ jsxs16("label", { children: [
6787
+ /* @__PURE__ */ jsx16("span", { children: payment.method === "check" ? "Check number" : "EFT reference" }),
6788
+ /* @__PURE__ */ jsx16("input", { value: payment.checkNumber, onChange: (event) => setPayment((current) => ({ ...current, checkNumber: event.target.value })) })
6580
6789
  ] }),
6581
- /* @__PURE__ */ jsxs15("label", { children: [
6582
- /* @__PURE__ */ jsx15("span", { children: "Deposit date" }),
6583
- /* @__PURE__ */ jsx15("input", { required: true, value: payment.depositDate, placeholder: "MM/DD/YYYY", onChange: (event) => setPayment((current) => ({ ...current, depositDate: event.target.value })) })
6790
+ /* @__PURE__ */ jsxs16("label", { children: [
6791
+ /* @__PURE__ */ jsx16("span", { children: "Deposit date" }),
6792
+ /* @__PURE__ */ jsx16("input", { required: true, value: payment.depositDate, placeholder: "MM/DD/YYYY", onChange: (event) => setPayment((current) => ({ ...current, depositDate: event.target.value })) })
6584
6793
  ] }),
6585
- /* @__PURE__ */ jsxs15("label", { className: "full", children: [
6586
- /* @__PURE__ */ jsx15("span", { children: "Note (optional)" }),
6587
- /* @__PURE__ */ jsx15("input", { value: payment.note, onChange: (event) => setPayment((current) => ({ ...current, note: event.target.value })) })
6794
+ /* @__PURE__ */ jsxs16("label", { className: "full", children: [
6795
+ /* @__PURE__ */ jsx16("span", { children: "Note (optional)" }),
6796
+ /* @__PURE__ */ jsx16("input", { value: payment.note, onChange: (event) => setPayment((current) => ({ ...current, note: event.target.value })) })
6588
6797
  ] })
6589
6798
  ] }),
6590
- /* @__PURE__ */ jsxs15("div", { className: "mb-payment-total", children: [
6591
- /* @__PURE__ */ jsx15("span", { children: "Total received" }),
6592
- /* @__PURE__ */ jsx15("strong", { children: new Intl.NumberFormat(void 0, { style: "currency", currency: "USD" }).format(payment.amount + (payment.penaltyAmount ?? 0) + (payment.interestAmount ?? 0)) })
6799
+ /* @__PURE__ */ jsxs16("div", { className: "mb-payment-total", children: [
6800
+ /* @__PURE__ */ jsx16("span", { children: "Total received" }),
6801
+ /* @__PURE__ */ jsx16("strong", { children: new Intl.NumberFormat(void 0, { style: "currency", currency: "USD" }).format(payment.amount + (payment.penaltyAmount ?? 0) + (payment.interestAmount ?? 0)) })
6593
6802
  ] }),
6594
- /* @__PURE__ */ jsxs15("div", { className: "mb-lifecycle-panel-actions", children: [
6595
- /* @__PURE__ */ jsx15("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
6596
- /* @__PURE__ */ jsx15("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, ...actor })), children: lifecycle.isMutating ? "Posting\u2026" : "Post payment" })
6803
+ /* @__PURE__ */ jsxs16("div", { className: "mb-lifecycle-panel-actions", children: [
6804
+ /* @__PURE__ */ jsx16("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
6805
+ /* @__PURE__ */ jsx16("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, ...actor })), children: lifecycle.isMutating ? "Posting\u2026" : "Post payment" })
6597
6806
  ] })
6598
6807
  ] }) }) : null,
6599
- panel === "close" || panel === "reopen" ? /* @__PURE__ */ jsx15(LifecycleDialog, { title: panel === "close" ? "Close bill" : "Reopen bill", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs15("section", { className: "mb-lifecycle-panel", children: [
6600
- /* @__PURE__ */ jsxs15("div", { children: [
6601
- /* @__PURE__ */ jsx15("h3", { children: panel === "close" ? "Close bill" : "Reopen bill" }),
6602
- /* @__PURE__ */ jsx15("p", { children: panel === "close" ? "The immutable submission and history remain available." : "Return this bill to active follow-up without changing the submitted snapshot." })
6808
+ panel === "close" || panel === "reopen" ? /* @__PURE__ */ jsx16(LifecycleDialog, { title: panel === "close" ? "Close bill" : "Reopen bill", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs16("section", { className: "mb-lifecycle-panel", children: [
6809
+ /* @__PURE__ */ jsxs16("div", { children: [
6810
+ /* @__PURE__ */ jsx16("h3", { children: panel === "close" ? "Close bill" : "Reopen bill" }),
6811
+ /* @__PURE__ */ jsx16("p", { children: panel === "close" ? "The immutable submission and history remain available." : "Return this bill to active follow-up without changing the submitted snapshot." })
6603
6812
  ] }),
6604
- /* @__PURE__ */ jsxs15("label", { children: [
6605
- /* @__PURE__ */ jsx15("span", { children: "Reason" }),
6606
- /* @__PURE__ */ jsx15("textarea", { required: true, value: reason, onChange: (event) => setReason(event.target.value) })
6813
+ /* @__PURE__ */ jsxs16("label", { children: [
6814
+ /* @__PURE__ */ jsx16("span", { children: "Reason" }),
6815
+ /* @__PURE__ */ jsx16("textarea", { required: true, value: reason, onChange: (event) => setReason(event.target.value) })
6607
6816
  ] }),
6608
- /* @__PURE__ */ jsxs15("div", { className: "mb-lifecycle-panel-actions", children: [
6609
- /* @__PURE__ */ jsx15("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
6610
- /* @__PURE__ */ jsx15("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, ...actor }) : lifecycle.reopenBill({ reason, ...actor })), children: lifecycle.isMutating ? "Saving\u2026" : panel === "close" ? "Close bill" : "Reopen bill" })
6817
+ /* @__PURE__ */ jsxs16("div", { className: "mb-lifecycle-panel-actions", children: [
6818
+ /* @__PURE__ */ jsx16("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
6819
+ /* @__PURE__ */ jsx16("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, ...actor }) : lifecycle.reopenBill({ reason, ...actor })), children: lifecycle.isMutating ? "Saving\u2026" : panel === "close" ? "Close bill" : "Reopen bill" })
6611
6820
  ] })
6612
6821
  ] }) }) : null,
6613
- panel === "send_duplicate" && correctionInitialBill ? /* @__PURE__ */ jsx15(LifecycleDialog, { title: "Send duplicate bill", wide: true, onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs15("section", { className: "mb-lifecycle-correction", children: [
6614
- /* @__PURE__ */ jsx15("header", { children: /* @__PURE__ */ jsxs15("div", { children: [
6615
- /* @__PURE__ */ jsx15("h3", { children: "Send duplicate bill" }),
6616
- /* @__PURE__ */ jsx15("p", { children: "Review and edit any bill field before creating a duplicate submission. The original bill and its history stay unchanged." })
6822
+ panel === "send_duplicate" && correctionInitialBill ? /* @__PURE__ */ jsx16(LifecycleDialog, { title: "Send duplicate bill", wide: true, onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs16("section", { className: "mb-lifecycle-correction", children: [
6823
+ /* @__PURE__ */ jsx16("header", { children: /* @__PURE__ */ jsxs16("div", { children: [
6824
+ /* @__PURE__ */ jsx16("h3", { children: "Send duplicate bill" }),
6825
+ /* @__PURE__ */ jsx16("p", { children: "Review and edit any bill field before creating a duplicate submission. The original bill and its history stay unchanged." })
6617
6826
  ] }) }),
6618
- data.environment === "live" ? /* @__PURE__ */ jsxs15("div", { className: "mb-lifecycle-live-warning", children: [
6619
- /* @__PURE__ */ jsx15("strong", { children: "Live clearinghouse submission" }),
6620
- /* @__PURE__ */ jsx15("span", { children: "The duplicate will be sent only after you confirm its delivery route in the next dialog." })
6827
+ data.environment === "live" ? /* @__PURE__ */ jsxs16("div", { className: "mb-lifecycle-live-warning", children: [
6828
+ /* @__PURE__ */ jsx16("strong", { children: "Live clearinghouse submission" }),
6829
+ /* @__PURE__ */ jsx16("span", { children: "The duplicate will be sent only after you confirm its delivery route in the next dialog." })
6621
6830
  ] }) : null,
6622
- /* @__PURE__ */ jsx15(CorrectionVerificationContact, { delivery: data.delivery }),
6623
- /* @__PURE__ */ jsx15(
6831
+ /* @__PURE__ */ jsx16(CorrectionVerificationContact, { delivery: data.delivery }),
6832
+ /* @__PURE__ */ jsx16(
6624
6833
  BillSubmissionForm,
6625
6834
  {
6626
6835
  className: "mbsf-lifecycle-correction",
@@ -6645,15 +6854,15 @@ function ConnectedBillLifecycle({ appearance, actorName, claimsAdministratorHint
6645
6854
  ...appearance ? { appearance } : {}
6646
6855
  }
6647
6856
  ),
6648
- duplicateError ? /* @__PURE__ */ jsx15("div", { className: "mb-lifecycle-message error", role: "alert", children: duplicateError }) : null
6857
+ duplicateError ? /* @__PURE__ */ jsx16("div", { className: "mb-lifecycle-message error", role: "alert", children: duplicateError }) : null
6649
6858
  ] }) }) : null,
6650
- panel === "report_status" ? /* @__PURE__ */ jsx15(
6859
+ panel === "report_status" ? /* @__PURE__ */ jsx16(
6651
6860
  ReportBillStatusDialog,
6652
6861
  {
6653
6862
  ...data.delivery.directory ? { directory: data.delivery.directory } : {},
6654
6863
  ...statusContacts.claimsAdmin ? { claimsAdmin: statusContacts.claimsAdmin } : {},
6655
6864
  ...statusContacts.billReview ? { billReview: statusContacts.billReview } : {},
6656
- ...receiptEntries.length ? { receipt: /* @__PURE__ */ jsx15(BillHistoryTable, { entries: receiptEntries, onOpenDocument: lifecycle.openAttachment, ...appearance ? { appearance } : {} }) } : {},
6865
+ ...receiptEntries.length ? { receipt: /* @__PURE__ */ jsx16(BillHistoryTable, { entries: receiptEntries, onOpenDocument: lifecycle.openAttachment, ...appearance ? { appearance } : {} }) } : {},
6657
6866
  submitting: lifecycle.isMutating,
6658
6867
  error: lifecycle.error?.message ?? null,
6659
6868
  onCancel: () => setPanel(""),
@@ -6661,8 +6870,8 @@ function ConnectedBillLifecycle({ appearance, actorName, claimsAdministratorHint
6661
6870
  ...appearance ? { appearance } : {}
6662
6871
  }
6663
6872
  ) : null,
6664
- notice ? /* @__PURE__ */ jsx15("div", { className: "mb-lifecycle-message success", role: "status", children: notice }) : null,
6665
- lifecycle.error ? /* @__PURE__ */ jsx15("div", { className: "mb-lifecycle-message error", role: "alert", children: lifecycle.error.message }) : null
6873
+ notice ? /* @__PURE__ */ jsx16("div", { className: "mb-lifecycle-message success", role: "status", children: notice }) : null,
6874
+ lifecycle.error ? /* @__PURE__ */ jsx16("div", { className: "mb-lifecycle-message error", role: "alert", children: lifecycle.error.message }) : null
6666
6875
  ] });
6667
6876
  }
6668
6877
  var CONNECTED_LIFECYCLE_STYLES = `
@@ -6790,7 +6999,17 @@ function createBillingOperationsClient({
6790
6999
  pendingSessionSignal = null;
6791
7000
  },
6792
7001
  getBills(query = {}, signal) {
6793
- return get(`/partner/v2/browser/bills${queryString(query)}`, signal);
7002
+ const { claimsAdministrator, taskType, taskSection: _taskSection, sort, status, ...filters } = query;
7003
+ void _taskSection;
7004
+ const sortKey = sort?.startsWith("balance_") ? "balanceDue" : sort?.startsWith("patient_") ? "patient" : sort ? "submitted" : void 0;
7005
+ return get(`/partner/v2/browser/bills${queryString({
7006
+ ...filters,
7007
+ status: status === "submitted" ? "sent" : status,
7008
+ claimsAdminId: claimsAdministrator,
7009
+ taskKind: taskType,
7010
+ sort: sortKey,
7011
+ dir: sort ? sort.endsWith("_asc") ? "asc" : "desc" : void 0
7012
+ })}`, signal);
6794
7013
  },
6795
7014
  getBillTasks(claimsAdministrator, signal) {
6796
7015
  return get(
@@ -6811,7 +7030,7 @@ function createBillingOperationsClient({
6811
7030
  }
6812
7031
 
6813
7032
  // src/connected-billing-workspace.tsx
6814
- import { Fragment as Fragment14, jsx as jsx16, jsxs as jsxs16 } from "react/jsx-runtime";
7033
+ import { Fragment as Fragment15, jsx as jsx17, jsxs as jsxs17 } from "react/jsx-runtime";
6815
7034
  var css11 = `
6816
7035
  .mbow{color:var(--mb-text);font:14px/1.45 var(--mb-font);background:var(--mb-soft);border-radius:var(--mb-radius);padding:20px}.mbow *{box-sizing:border-box}.mbow h2,.mbow h3,.mbow p{margin:0}.mbow a{color:var(--mb-accent)}
6817
7036
  .mbow-workspace{width:100%;height:100%;max-height:var(--mbow-available-height,100dvh);min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
@@ -6840,8 +7059,8 @@ function defaultRange(days = 29) {
6840
7059
  return { from: iso(from), to: iso(to) };
6841
7060
  }
6842
7061
  function Surface({ appearance, className = "", style, children, surfaceRef }) {
6843
- return /* @__PURE__ */ jsxs16("div", { ref: surfaceRef, className: `mbow ${className}`.trim(), style: mindBillAppearanceStyle(appearance, style), children: [
6844
- /* @__PURE__ */ jsx16("style", { children: css11 }),
7062
+ return /* @__PURE__ */ jsxs17("div", { ref: surfaceRef, className: `mbow ${className}`.trim(), style: mindBillAppearanceStyle(appearance, style), children: [
7063
+ /* @__PURE__ */ jsx17("style", { children: css11 }),
6845
7064
  children
6846
7065
  ] });
6847
7066
  }
@@ -6882,7 +7101,7 @@ function BillSearchContent({
6882
7101
  onSelectBill,
6883
7102
  heading
6884
7103
  }) {
6885
- const [query, setQuery] = useState13({ status: "all", age: "all", page: 1, pageSize: 25, sort: "submitted_desc", ...initialQuery });
7104
+ const [query, setQuery] = useState13({ age: "all", page: 1, pageSize: 25, sort: "submitted_desc", ...initialQuery, status: initialQuery?.status === "submitted" ? "sent" : initialQuery?.status ?? "all" });
6886
7105
  const [draft, setDraft] = useState13(initialQuery?.q ?? "");
6887
7106
  const [result, setResult] = useState13(null);
6888
7107
  const [error, setError] = useState13(null);
@@ -6905,69 +7124,70 @@ function BillSearchContent({
6905
7124
  }, [load]);
6906
7125
  const update = (next) => setQuery((current) => ({ ...current, ...next, page: next.page ?? 1 }));
6907
7126
  const pageCount = Math.max(1, Math.ceil((result?.total ?? 0) / (result?.pageSize ?? 25)));
6908
- return /* @__PURE__ */ jsxs16(Fragment14, { children: [
6909
- heading ? /* @__PURE__ */ jsx16("div", { className: "mbow-head", children: /* @__PURE__ */ jsx16("div", { children: typeof heading === "string" ? /* @__PURE__ */ jsx16("h2", { children: heading }) : heading }) }) : null,
6910
- /* @__PURE__ */ jsxs16("form", { className: "mbow-toolbar", onSubmit: (event) => {
7127
+ return /* @__PURE__ */ jsxs17(Fragment15, { children: [
7128
+ heading ? /* @__PURE__ */ jsx17("div", { className: "mbow-head", children: /* @__PURE__ */ jsx17("div", { children: typeof heading === "string" ? /* @__PURE__ */ jsx17("h2", { children: heading }) : heading }) }) : null,
7129
+ /* @__PURE__ */ jsxs17("form", { className: "mbow-toolbar", onSubmit: (event) => {
6911
7130
  event.preventDefault();
6912
7131
  update({ q: draft.trim() });
6913
7132
  }, children: [
6914
- /* @__PURE__ */ jsx16("input", { className: "mbow-input", value: draft, onChange: (event) => setDraft(event.target.value), placeholder: "Search patient, bill ID, claim, or external ID\u2026", "aria-label": "Search bills" }),
6915
- /* @__PURE__ */ jsxs16("select", { className: "mbow-select", value: query.status ?? "all", onChange: (event) => update({ status: event.target.value }), "aria-label": "Bill status", children: [
6916
- /* @__PURE__ */ jsx16("option", { value: "all", children: "All statuses" }),
6917
- /* @__PURE__ */ jsx16("option", { value: "incomplete", children: "Incomplete" }),
6918
- /* @__PURE__ */ jsx16("option", { value: "submitted", children: "Submitted" }),
6919
- /* @__PURE__ */ jsx16("option", { value: "accepted", children: "Accepted" }),
6920
- /* @__PURE__ */ jsx16("option", { value: "rejected", children: "Rejected" }),
6921
- /* @__PURE__ */ jsx16("option", { value: "processed", children: "Processed" }),
6922
- /* @__PURE__ */ jsx16("option", { value: "paid", children: "Paid" }),
6923
- /* @__PURE__ */ jsx16("option", { value: "closed", children: "Closed" })
7133
+ /* @__PURE__ */ jsx17("input", { className: "mbow-input", value: draft, onChange: (event) => setDraft(event.target.value), placeholder: "Search patient, bill ID, claim, or external ID\u2026", "aria-label": "Search bills" }),
7134
+ /* @__PURE__ */ jsxs17("select", { className: "mbow-select", value: query.status ?? "all", onChange: (event) => update({ status: event.target.value }), "aria-label": "Bill status", children: [
7135
+ /* @__PURE__ */ jsx17("option", { value: "all", children: "All statuses" }),
7136
+ /* @__PURE__ */ jsx17("option", { value: "incomplete", children: "Incomplete" }),
7137
+ /* @__PURE__ */ jsx17("option", { value: "sent", children: "Sent" }),
7138
+ /* @__PURE__ */ jsx17("option", { value: "accepted", children: "Accepted" }),
7139
+ /* @__PURE__ */ jsx17("option", { value: "accepted_no_response", children: "Accepted \u2014 response overdue" }),
7140
+ /* @__PURE__ */ jsx17("option", { value: "rejected", children: "Rejected" }),
7141
+ /* @__PURE__ */ jsx17("option", { value: "processed", children: "Processed" }),
7142
+ /* @__PURE__ */ jsx17("option", { value: "paid", children: "Paid" }),
7143
+ /* @__PURE__ */ jsx17("option", { value: "closed", children: "Closed" })
6924
7144
  ] }),
6925
- /* @__PURE__ */ jsxs16("select", { className: "mbow-select", value: query.age ?? "all", onChange: (event) => update({ age: event.target.value }), "aria-label": "A/R age", children: [
6926
- /* @__PURE__ */ jsx16("option", { value: "all", children: "All A/R ages" }),
6927
- /* @__PURE__ */ jsx16("option", { value: "0-30", children: "0\u201330 days" }),
6928
- /* @__PURE__ */ jsx16("option", { value: "31-60", children: "31\u201360 days" }),
6929
- /* @__PURE__ */ jsx16("option", { value: "61-90", children: "61\u201390 days" }),
6930
- /* @__PURE__ */ jsx16("option", { value: "91+", children: "91+ days" }),
6931
- /* @__PURE__ */ jsx16("option", { value: "91-180", children: "91\u2013180 days" }),
6932
- /* @__PURE__ */ jsx16("option", { value: "181+", children: "181+ days" })
7145
+ /* @__PURE__ */ jsxs17("select", { className: "mbow-select", value: query.age ?? "all", onChange: (event) => update({ age: event.target.value }), "aria-label": "A/R age", children: [
7146
+ /* @__PURE__ */ jsx17("option", { value: "all", children: "All A/R ages" }),
7147
+ /* @__PURE__ */ jsx17("option", { value: "0-30", children: "0\u201330 days" }),
7148
+ /* @__PURE__ */ jsx17("option", { value: "31-60", children: "31\u201360 days" }),
7149
+ /* @__PURE__ */ jsx17("option", { value: "61-90", children: "61\u201390 days" }),
7150
+ /* @__PURE__ */ jsx17("option", { value: "91+", children: "91+ days" }),
7151
+ /* @__PURE__ */ jsx17("option", { value: "91-180", children: "91\u2013180 days" }),
7152
+ /* @__PURE__ */ jsx17("option", { value: "181+", children: "181+ days" })
6933
7153
  ] }),
6934
- /* @__PURE__ */ jsx16("button", { className: "mbow-button", type: "submit", children: "Search" })
7154
+ /* @__PURE__ */ jsx17("button", { className: "mbow-button", type: "submit", children: "Search" })
6935
7155
  ] }),
6936
- /* @__PURE__ */ jsxs16("div", { className: "mbow-card mbow-scroll", children: [
6937
- loading && !result ? /* @__PURE__ */ jsx16("div", { className: "mbow-state", role: "status", children: "Loading bills\u2026" }) : error && !result ? /* @__PURE__ */ jsxs16("div", { className: "mbow-state mbow-error", role: "alert", children: [
7156
+ /* @__PURE__ */ jsxs17("div", { className: "mbow-card mbow-scroll", children: [
7157
+ loading ? /* @__PURE__ */ jsx17("div", { className: "mbow-state", role: "status", children: "Loading bills\u2026" }) : error ? /* @__PURE__ */ jsxs17("div", { className: "mbow-state mbow-error", role: "alert", children: [
6938
7158
  error.message,
6939
7159
  " ",
6940
- /* @__PURE__ */ jsx16("button", { className: "mbow-button", type: "button", onClick: () => void load(), children: "Retry" })
6941
- ] }) : result?.items.length === 0 ? /* @__PURE__ */ jsx16("div", { className: "mbow-state", children: "No bills match these filters." }) : /* @__PURE__ */ jsxs16("table", { className: "mbow-table", children: [
6942
- /* @__PURE__ */ jsx16("thead", { children: /* @__PURE__ */ jsxs16("tr", { children: [
6943
- /* @__PURE__ */ jsx16("th", { children: "Bill" }),
6944
- /* @__PURE__ */ jsx16("th", { children: "Patient" }),
6945
- /* @__PURE__ */ jsx16("th", { children: "DOS" }),
6946
- /* @__PURE__ */ jsx16("th", { children: "Codes" }),
6947
- /* @__PURE__ */ jsx16("th", { children: "Claims administrator" }),
6948
- /* @__PURE__ */ jsx16("th", { children: "Status" }),
6949
- /* @__PURE__ */ jsx16("th", { children: "Submitted / A/R age" }),
6950
- /* @__PURE__ */ jsx16("th", { className: "mbow-money", children: "Balance due" })
7160
+ /* @__PURE__ */ jsx17("button", { className: "mbow-button", type: "button", onClick: () => void load(), children: "Retry" })
7161
+ ] }) : result?.items.length === 0 ? /* @__PURE__ */ jsx17("div", { className: "mbow-state", children: "No bills match these filters." }) : /* @__PURE__ */ jsxs17("table", { className: "mbow-table", children: [
7162
+ /* @__PURE__ */ jsx17("thead", { children: /* @__PURE__ */ jsxs17("tr", { children: [
7163
+ /* @__PURE__ */ jsx17("th", { children: "Bill" }),
7164
+ /* @__PURE__ */ jsx17("th", { children: "Patient" }),
7165
+ /* @__PURE__ */ jsx17("th", { children: "DOS" }),
7166
+ /* @__PURE__ */ jsx17("th", { children: "Codes" }),
7167
+ /* @__PURE__ */ jsx17("th", { children: "Claims administrator" }),
7168
+ /* @__PURE__ */ jsx17("th", { children: "Status" }),
7169
+ /* @__PURE__ */ jsx17("th", { children: "Submitted / A/R age" }),
7170
+ /* @__PURE__ */ jsx17("th", { className: "mbow-money", children: "Balance due" })
6951
7171
  ] }) }),
6952
- /* @__PURE__ */ jsx16("tbody", { children: result?.items.map((bill) => /* @__PURE__ */ jsxs16("tr", { className: onSelectBill ? "clickable" : "", onClick: () => onSelectBill?.(bill), children: [
6953
- /* @__PURE__ */ jsxs16("td", { className: "mbow-strong", children: [
7172
+ /* @__PURE__ */ jsx17("tbody", { children: result?.items.map((bill) => /* @__PURE__ */ jsxs17("tr", { className: onSelectBill ? "clickable" : "", onClick: () => onSelectBill?.(bill), children: [
7173
+ /* @__PURE__ */ jsxs17("td", { className: "mbow-strong", children: [
6954
7174
  "#",
6955
7175
  bill.billNumber
6956
7176
  ] }),
6957
- /* @__PURE__ */ jsx16("td", { children: bill.patientName }),
6958
- /* @__PURE__ */ jsx16("td", { children: shortDate(bill.dateOfService) }),
6959
- /* @__PURE__ */ jsx16("td", { children: bill.procedureCodes.join(", ") || "\u2014" }),
6960
- /* @__PURE__ */ jsx16("td", { children: bill.claimsAdministrator || "\u2014" }),
6961
- /* @__PURE__ */ jsx16("td", { children: /* @__PURE__ */ jsx16("span", { className: `mbow-badge ${bill.status.tone ?? ""}`, children: bill.status.label }) }),
6962
- /* @__PURE__ */ jsxs16("td", { children: [
7177
+ /* @__PURE__ */ jsx17("td", { children: bill.patientName }),
7178
+ /* @__PURE__ */ jsx17("td", { children: shortDate(bill.dateOfService) }),
7179
+ /* @__PURE__ */ jsx17("td", { children: bill.procedureCodes.join(", ") || "\u2014" }),
7180
+ /* @__PURE__ */ jsx17("td", { children: bill.claimsAdministrator || "\u2014" }),
7181
+ /* @__PURE__ */ jsx17("td", { children: /* @__PURE__ */ jsx17("span", { className: `mbow-badge ${bill.status.tone ?? ""}`, children: bill.status.label }) }),
7182
+ /* @__PURE__ */ jsxs17("td", { children: [
6963
7183
  shortDate(bill.submittedAt),
6964
- /* @__PURE__ */ jsx16("div", { className: "mbow-muted", children: bill.arAgeDays == null ? "\u2014" : `${bill.arAgeDays} days` })
7184
+ /* @__PURE__ */ jsx17("div", { className: "mbow-muted", children: bill.arAgeDays == null ? "\u2014" : `${bill.arAgeDays} days` })
6965
7185
  ] }),
6966
- /* @__PURE__ */ jsx16("td", { className: "mbow-money mbow-strong", children: money6(bill.balanceDue) })
7186
+ /* @__PURE__ */ jsx17("td", { className: "mbow-money mbow-strong", children: money6(bill.balanceDue) })
6967
7187
  ] }, bill.id)) })
6968
7188
  ] }),
6969
- result ? /* @__PURE__ */ jsxs16("div", { className: "mbow-pager", children: [
6970
- /* @__PURE__ */ jsxs16("span", { children: [
7189
+ result && !loading && !error ? /* @__PURE__ */ jsxs17("div", { className: "mbow-pager", children: [
7190
+ /* @__PURE__ */ jsxs17("span", { children: [
6971
7191
  "Showing ",
6972
7192
  result.total === 0 ? 0 : (result.page - 1) * result.pageSize + 1,
6973
7193
  "\u2013",
@@ -6975,14 +7195,14 @@ function BillSearchContent({
6975
7195
  " of ",
6976
7196
  result.total
6977
7197
  ] }),
6978
- /* @__PURE__ */ jsxs16("span", { children: [
6979
- /* @__PURE__ */ jsx16("button", { className: "mbow-button", type: "button", disabled: result.page <= 1, onClick: () => update({ page: result.page - 1 }), children: "Previous" }),
7198
+ /* @__PURE__ */ jsxs17("span", { children: [
7199
+ /* @__PURE__ */ jsx17("button", { className: "mbow-button", type: "button", disabled: result.page <= 1, onClick: () => update({ page: result.page - 1 }), children: "Previous" }),
6980
7200
  " ",
6981
7201
  result.page,
6982
7202
  " / ",
6983
7203
  pageCount,
6984
7204
  " ",
6985
- /* @__PURE__ */ jsx16("button", { className: "mbow-button", type: "button", disabled: result.page >= pageCount, onClick: () => update({ page: result.page + 1 }), children: "Next" })
7205
+ /* @__PURE__ */ jsx17("button", { className: "mbow-button", type: "button", disabled: result.page >= pageCount, onClick: () => update({ page: result.page + 1 }), children: "Next" })
6986
7206
  ] })
6987
7207
  ] }) : null
6988
7208
  ] })
@@ -6990,11 +7210,14 @@ function BillSearchContent({
6990
7210
  }
6991
7211
  function ConnectedBillSearch({ appearance, className, style, initialQuery, onSelectBill, heading = "All bills", ...options }) {
6992
7212
  const client = useClient(options);
6993
- return /* @__PURE__ */ jsx16(Surface, { appearance, className, style, children: /* @__PURE__ */ jsx16(BillSearchContent, { client, initialQuery, onSelectBill, heading }) });
7213
+ return /* @__PURE__ */ jsx17(Surface, { appearance, className, style, children: /* @__PURE__ */ jsx17(BillSearchContent, { client, initialQuery, onSelectBill, heading }) });
6994
7214
  }
6995
7215
  function taskQuery(cell) {
6996
7216
  const [taskType, taskLabel] = cell.rowId.split("::", 2);
6997
7217
  const age = cell.bucketId === "1-30" ? "0-30" : cell.bucketId;
7218
+ if (cell.sectionId === "waiting_sent" || cell.sectionId === "waiting_accepted") {
7219
+ return { status: cell.rowId, ...age ? { age } : {} };
7220
+ }
6998
7221
  return { status: "all", taskSection: cell.sectionId, ...taskType ? { taskType } : {}, ...taskLabel ? { taskLabel } : {}, ...age ? { age } : {} };
6999
7222
  }
7000
7223
  function BillTasksContent({ client, onDrillDown, appearance }) {
@@ -7018,34 +7241,52 @@ function BillTasksContent({ client, onDrillDown, appearance }) {
7018
7241
  void load(controller.signal);
7019
7242
  return () => controller.abort();
7020
7243
  }, [load]);
7021
- if (loading && !result) return /* @__PURE__ */ jsx16("div", { className: "mbow-state", children: "Loading bill tasks\u2026" });
7022
- if (error && !result) return /* @__PURE__ */ jsx16("div", { className: "mbow-state mbow-error", children: error.message });
7023
- if (!result) return /* @__PURE__ */ jsx16(Fragment14, {});
7024
- return /* @__PURE__ */ jsxs16(Fragment14, { children: [
7025
- /* @__PURE__ */ jsxs16("p", { className: "mbow-task-note", children: [
7026
- "Open follow-up work only. Sent bills waiting on a payer stay available in ",
7027
- /* @__PURE__ */ jsx16("strong", { children: "All bills" }),
7028
- "."
7244
+ if (loading && !result) return /* @__PURE__ */ jsx17("div", { className: "mbow-state", children: "Loading bill tasks\u2026" });
7245
+ if (error && !result) return /* @__PURE__ */ jsx17("div", { className: "mbow-state mbow-error", children: error.message });
7246
+ if (!result) return /* @__PURE__ */ jsx17(Fragment15, {});
7247
+ const selectionProps = loading || error ? {} : {
7248
+ onSelectCell: (cell) => onDrillDown?.({ ...taskQuery(cell), ...claimsAdminId ? { claimsAdministrator: claimsAdminId } : {} })
7249
+ };
7250
+ return /* @__PURE__ */ jsxs17(Fragment15, { children: [
7251
+ /* @__PURE__ */ jsxs17("p", { className: "mbow-task-note", children: [
7252
+ "Open follow-up work grouped by task and age. ",
7253
+ result.waiting ? "Sent and accepted bills waiting for a payer are shown below." : "Find sent and accepted bills in All bills."
7029
7254
  ] }),
7030
- /* @__PURE__ */ jsx16(BillTasksDashboard, { data: result.dashboard, appearance: appearance ?? { preset: "mindbill" }, toolbar: /* @__PURE__ */ jsxs16("select", { className: "mbow-select", value: claimsAdminId, onChange: (event) => setClaimsAdminId(event.target.value), children: [
7031
- /* @__PURE__ */ jsx16("option", { value: "", children: "All claims administrators" }),
7032
- result.filters.claimsAdministrators.map((item) => /* @__PURE__ */ jsx16("option", { value: item.id, children: item.name }, item.id))
7033
- ] }), onSelectCell: (cell) => onDrillDown?.(taskQuery(cell)) })
7255
+ loading ? /* @__PURE__ */ jsx17("p", { role: "status", children: "Updating bill tasks\u2026" }) : null,
7256
+ error ? /* @__PURE__ */ jsx17("p", { role: "alert", className: "mbow-error", children: error.message }) : null,
7257
+ /* @__PURE__ */ jsx17(BillTasksDashboard, { data: result.dashboard, appearance: appearance ?? { preset: "mindbill" }, toolbar: /* @__PURE__ */ jsxs17("select", { "aria-label": "Claims administrator filter", className: "mbow-select", value: claimsAdminId, onChange: (event) => setClaimsAdminId(event.target.value), children: [
7258
+ /* @__PURE__ */ jsx17("option", { value: "", children: "All claims administrators" }),
7259
+ result.filters.claimsAdministrators.map((item) => /* @__PURE__ */ jsx17("option", { value: item.id, children: item.name }, item.id))
7260
+ ] }), ...selectionProps }),
7261
+ result.waiting ? /* @__PURE__ */ jsx17(
7262
+ BillTasksDashboard,
7263
+ {
7264
+ data: result.waiting,
7265
+ appearance: appearance ?? { preset: "mindbill" },
7266
+ heading: "Bills waiting for payer",
7267
+ totalLabel: "Bill Total",
7268
+ itemLabel: "bills",
7269
+ grandTotalLabel: "Waiting Bills Total",
7270
+ emptyLabel: "No waiting bills",
7271
+ ...selectionProps,
7272
+ footnote: "Waiting bills can also have overdue follow-up tasks above. These bill totals are separate from task totals."
7273
+ }
7274
+ ) : null
7034
7275
  ] });
7035
7276
  }
7036
7277
  function ConnectedBillTasksDashboard({ appearance, className, style, onDrillDown, ...options }) {
7037
7278
  const client = useClient(options);
7038
- return /* @__PURE__ */ jsx16(Surface, { appearance, className, style, children: /* @__PURE__ */ jsx16(BillTasksContent, { client, onDrillDown, appearance }) });
7279
+ return /* @__PURE__ */ jsx17(Surface, { appearance, className, style, children: /* @__PURE__ */ jsx17(BillTasksContent, { client, onDrillDown, appearance }) });
7039
7280
  }
7040
7281
  function RangeToolbar({ from, to, setFrom, setTo }) {
7041
- return /* @__PURE__ */ jsxs16("div", { className: "mbow-toolbar", children: [
7042
- /* @__PURE__ */ jsxs16("label", { children: [
7282
+ return /* @__PURE__ */ jsxs17("div", { className: "mbow-toolbar", children: [
7283
+ /* @__PURE__ */ jsxs17("label", { children: [
7043
7284
  "From ",
7044
- /* @__PURE__ */ jsx16("input", { className: "mbow-input", type: "date", value: from, onChange: (event) => setFrom(event.target.value) })
7285
+ /* @__PURE__ */ jsx17("input", { className: "mbow-input", type: "date", value: from, onChange: (event) => setFrom(event.target.value) })
7045
7286
  ] }),
7046
- /* @__PURE__ */ jsxs16("label", { children: [
7287
+ /* @__PURE__ */ jsxs17("label", { children: [
7047
7288
  "To ",
7048
- /* @__PURE__ */ jsx16("input", { className: "mbow-input", type: "date", value: to, onChange: (event) => setTo(event.target.value) })
7289
+ /* @__PURE__ */ jsx17("input", { className: "mbow-input", type: "date", value: to, onChange: (event) => setTo(event.target.value) })
7049
7290
  ] })
7050
7291
  ] });
7051
7292
  }
@@ -7064,64 +7305,64 @@ function ConnectedServiceLineItemsReport({ appearance, className, style, initial
7064
7305
  });
7065
7306
  return () => controller.abort();
7066
7307
  }, [client, from, to]);
7067
- return /* @__PURE__ */ jsxs16(Surface, { appearance, className, style, children: [
7068
- /* @__PURE__ */ jsx16("div", { className: "mbow-head", children: /* @__PURE__ */ jsxs16("div", { children: [
7069
- /* @__PURE__ */ jsx16("h2", { children: "Original submissions by procedure" }),
7070
- /* @__PURE__ */ jsx16("p", { className: "mbow-sub", children: "First payer submission for each patient and date of service." })
7308
+ return /* @__PURE__ */ jsxs17(Surface, { appearance, className, style, children: [
7309
+ /* @__PURE__ */ jsx17("div", { className: "mbow-head", children: /* @__PURE__ */ jsxs17("div", { children: [
7310
+ /* @__PURE__ */ jsx17("h2", { children: "Original submissions by procedure" }),
7311
+ /* @__PURE__ */ jsx17("p", { className: "mbow-sub", children: "First payer submission for each patient and date of service." })
7071
7312
  ] }) }),
7072
- /* @__PURE__ */ jsx16(RangeToolbar, { from, to, setFrom, setTo }),
7073
- error ? /* @__PURE__ */ jsx16("div", { className: "mbow-state mbow-error", children: error.message }) : !data ? /* @__PURE__ */ jsx16("div", { className: "mbow-state", children: "Loading report\u2026" }) : /* @__PURE__ */ jsxs16(Fragment14, { children: [
7074
- /* @__PURE__ */ jsxs16("div", { className: "mbow-metrics", children: [
7075
- /* @__PURE__ */ jsx16(Metric, { label: "Original bills", value: String(data.totalBills) }),
7076
- /* @__PURE__ */ jsx16(Metric, { label: "Service lines", value: String(data.totalLines) }),
7077
- /* @__PURE__ */ jsx16(Metric, { label: "Total billed", value: money6(data.totalBilled) }),
7078
- /* @__PURE__ */ jsx16(Metric, { label: "Report window", value: data.windowLabel })
7313
+ /* @__PURE__ */ jsx17(RangeToolbar, { from, to, setFrom, setTo }),
7314
+ error ? /* @__PURE__ */ jsx17("div", { className: "mbow-state mbow-error", children: error.message }) : !data ? /* @__PURE__ */ jsx17("div", { className: "mbow-state", children: "Loading report\u2026" }) : /* @__PURE__ */ jsxs17(Fragment15, { children: [
7315
+ /* @__PURE__ */ jsxs17("div", { className: "mbow-metrics", children: [
7316
+ /* @__PURE__ */ jsx17(Metric, { label: "Original bills", value: String(data.totalBills) }),
7317
+ /* @__PURE__ */ jsx17(Metric, { label: "Service lines", value: String(data.totalLines) }),
7318
+ /* @__PURE__ */ jsx17(Metric, { label: "Total billed", value: money6(data.totalBilled) }),
7319
+ /* @__PURE__ */ jsx17(Metric, { label: "Report window", value: data.windowLabel })
7079
7320
  ] }),
7080
- /* @__PURE__ */ jsxs16("div", { className: "mbow-card mbow-scroll", children: [
7081
- /* @__PURE__ */ jsx16("div", { className: "mbow-section-head", children: /* @__PURE__ */ jsx16("h3", { children: "Procedure summary" }) }),
7082
- /* @__PURE__ */ jsxs16("table", { className: "mbow-table", children: [
7083
- /* @__PURE__ */ jsx16("thead", { children: /* @__PURE__ */ jsxs16("tr", { children: [
7084
- /* @__PURE__ */ jsx16("th", { children: "Procedure code" }),
7085
- /* @__PURE__ */ jsx16("th", { children: "Bills" }),
7086
- /* @__PURE__ */ jsx16("th", { children: "Service lines" }),
7087
- /* @__PURE__ */ jsx16("th", { className: "mbow-money", children: "Total billed" })
7321
+ /* @__PURE__ */ jsxs17("div", { className: "mbow-card mbow-scroll", children: [
7322
+ /* @__PURE__ */ jsx17("div", { className: "mbow-section-head", children: /* @__PURE__ */ jsx17("h3", { children: "Procedure summary" }) }),
7323
+ /* @__PURE__ */ jsxs17("table", { className: "mbow-table", children: [
7324
+ /* @__PURE__ */ jsx17("thead", { children: /* @__PURE__ */ jsxs17("tr", { children: [
7325
+ /* @__PURE__ */ jsx17("th", { children: "Procedure code" }),
7326
+ /* @__PURE__ */ jsx17("th", { children: "Bills" }),
7327
+ /* @__PURE__ */ jsx17("th", { children: "Service lines" }),
7328
+ /* @__PURE__ */ jsx17("th", { className: "mbow-money", children: "Total billed" })
7088
7329
  ] }) }),
7089
- /* @__PURE__ */ jsx16("tbody", { children: data.cptRows.map((row) => /* @__PURE__ */ jsxs16("tr", { children: [
7090
- /* @__PURE__ */ jsx16("td", { className: "mbow-strong", children: row.code }),
7091
- /* @__PURE__ */ jsx16("td", { children: row.bills }),
7092
- /* @__PURE__ */ jsx16("td", { children: row.lines }),
7093
- /* @__PURE__ */ jsx16("td", { className: "mbow-money", children: money6(row.billed) })
7330
+ /* @__PURE__ */ jsx17("tbody", { children: data.cptRows.map((row) => /* @__PURE__ */ jsxs17("tr", { children: [
7331
+ /* @__PURE__ */ jsx17("td", { className: "mbow-strong", children: row.code }),
7332
+ /* @__PURE__ */ jsx17("td", { children: row.bills }),
7333
+ /* @__PURE__ */ jsx17("td", { children: row.lines }),
7334
+ /* @__PURE__ */ jsx17("td", { className: "mbow-money", children: money6(row.billed) })
7094
7335
  ] }, row.code)) })
7095
7336
  ] })
7096
7337
  ] }),
7097
- /* @__PURE__ */ jsxs16("div", { className: "mbow-card mbow-scroll", style: { marginTop: 16 }, children: [
7098
- /* @__PURE__ */ jsx16("div", { className: "mbow-section-head", children: /* @__PURE__ */ jsx16("h3", { children: "All original bills" }) }),
7099
- /* @__PURE__ */ jsxs16("table", { className: "mbow-table", children: [
7100
- /* @__PURE__ */ jsx16("thead", { children: /* @__PURE__ */ jsxs16("tr", { children: [
7101
- /* @__PURE__ */ jsx16("th", { children: "Bill" }),
7102
- /* @__PURE__ */ jsx16("th", { children: "First submitted" }),
7103
- /* @__PURE__ */ jsx16("th", { children: "Patient \xB7 Claim" }),
7104
- /* @__PURE__ */ jsx16("th", { children: "DOS" }),
7105
- /* @__PURE__ */ jsx16("th", { children: "Claims administrator" }),
7106
- /* @__PURE__ */ jsx16("th", { children: "Codes" }),
7107
- /* @__PURE__ */ jsx16("th", { className: "mbow-money", children: "Billed" }),
7108
- /* @__PURE__ */ jsx16("th", { children: "Status" })
7338
+ /* @__PURE__ */ jsxs17("div", { className: "mbow-card mbow-scroll", style: { marginTop: 16 }, children: [
7339
+ /* @__PURE__ */ jsx17("div", { className: "mbow-section-head", children: /* @__PURE__ */ jsx17("h3", { children: "All original bills" }) }),
7340
+ /* @__PURE__ */ jsxs17("table", { className: "mbow-table", children: [
7341
+ /* @__PURE__ */ jsx17("thead", { children: /* @__PURE__ */ jsxs17("tr", { children: [
7342
+ /* @__PURE__ */ jsx17("th", { children: "Bill" }),
7343
+ /* @__PURE__ */ jsx17("th", { children: "First submitted" }),
7344
+ /* @__PURE__ */ jsx17("th", { children: "Patient \xB7 Claim" }),
7345
+ /* @__PURE__ */ jsx17("th", { children: "DOS" }),
7346
+ /* @__PURE__ */ jsx17("th", { children: "Claims administrator" }),
7347
+ /* @__PURE__ */ jsx17("th", { children: "Codes" }),
7348
+ /* @__PURE__ */ jsx17("th", { className: "mbow-money", children: "Billed" }),
7349
+ /* @__PURE__ */ jsx17("th", { children: "Status" })
7109
7350
  ] }) }),
7110
- /* @__PURE__ */ jsx16("tbody", { children: data.billRows.map((row) => /* @__PURE__ */ jsxs16("tr", { className: onSelectBill ? "clickable" : "", onClick: () => onSelectBill?.(row.billId), children: [
7111
- /* @__PURE__ */ jsxs16("td", { className: "mbow-strong", children: [
7351
+ /* @__PURE__ */ jsx17("tbody", { children: data.billRows.map((row) => /* @__PURE__ */ jsxs17("tr", { className: onSelectBill ? "clickable" : "", onClick: () => onSelectBill?.(row.billId), children: [
7352
+ /* @__PURE__ */ jsxs17("td", { className: "mbow-strong", children: [
7112
7353
  "#",
7113
7354
  row.billNumber
7114
7355
  ] }),
7115
- /* @__PURE__ */ jsx16("td", { children: shortDate(row.submittedDate) }),
7116
- /* @__PURE__ */ jsxs16("td", { children: [
7356
+ /* @__PURE__ */ jsx17("td", { children: shortDate(row.submittedDate) }),
7357
+ /* @__PURE__ */ jsxs17("td", { children: [
7117
7358
  row.patient,
7118
- /* @__PURE__ */ jsx16("div", { className: "mbow-muted", children: row.claim })
7359
+ /* @__PURE__ */ jsx17("div", { className: "mbow-muted", children: row.claim })
7119
7360
  ] }),
7120
- /* @__PURE__ */ jsx16("td", { children: shortDate(row.dos) }),
7121
- /* @__PURE__ */ jsx16("td", { children: row.claimsAdmin }),
7122
- /* @__PURE__ */ jsx16("td", { children: row.codes.join(", ") }),
7123
- /* @__PURE__ */ jsx16("td", { className: "mbow-money", children: money6(row.billed) }),
7124
- /* @__PURE__ */ jsx16("td", { children: row.status })
7361
+ /* @__PURE__ */ jsx17("td", { children: shortDate(row.dos) }),
7362
+ /* @__PURE__ */ jsx17("td", { children: row.claimsAdmin }),
7363
+ /* @__PURE__ */ jsx17("td", { children: row.codes.join(", ") }),
7364
+ /* @__PURE__ */ jsx17("td", { className: "mbow-money", children: money6(row.billed) }),
7365
+ /* @__PURE__ */ jsx17("td", { children: row.status })
7125
7366
  ] }, row.billId)) })
7126
7367
  ] })
7127
7368
  ] })
@@ -7129,9 +7370,9 @@ function ConnectedServiceLineItemsReport({ appearance, className, style, initial
7129
7370
  ] });
7130
7371
  }
7131
7372
  function Metric({ label, value }) {
7132
- return /* @__PURE__ */ jsxs16("div", { className: "mbow-metric", children: [
7133
- /* @__PURE__ */ jsx16("span", { children: label }),
7134
- /* @__PURE__ */ jsx16("strong", { children: value })
7373
+ return /* @__PURE__ */ jsxs17("div", { className: "mbow-metric", children: [
7374
+ /* @__PURE__ */ jsx17("span", { children: label }),
7375
+ /* @__PURE__ */ jsx17("strong", { children: value })
7135
7376
  ] });
7136
7377
  }
7137
7378
  function ConnectedProductivityReport({ appearance, className, style, initialFrom, initialTo, ...options }) {
@@ -7150,41 +7391,41 @@ function ConnectedProductivityReport({ appearance, className, style, initialFrom
7150
7391
  return () => controller.abort();
7151
7392
  }, [client, from, to]);
7152
7393
  const maxSent = data ? Math.max(1, ...Object.values(data.sentTotal)) : 1;
7153
- return /* @__PURE__ */ jsxs16(Surface, { appearance, className, style, children: [
7154
- /* @__PURE__ */ jsx16("div", { className: "mbow-head", children: /* @__PURE__ */ jsxs16("div", { children: [
7155
- /* @__PURE__ */ jsx16("h2", { children: "Productivity" }),
7156
- /* @__PURE__ */ jsx16("p", { className: "mbow-sub", children: "Bills created and sent per biller, plus accepted-first-try rate." })
7394
+ return /* @__PURE__ */ jsxs17(Surface, { appearance, className, style, children: [
7395
+ /* @__PURE__ */ jsx17("div", { className: "mbow-head", children: /* @__PURE__ */ jsxs17("div", { children: [
7396
+ /* @__PURE__ */ jsx17("h2", { children: "Productivity" }),
7397
+ /* @__PURE__ */ jsx17("p", { className: "mbow-sub", children: "Bills created and sent per biller, plus accepted-first-try rate." })
7157
7398
  ] }) }),
7158
- /* @__PURE__ */ jsx16(RangeToolbar, { from, to, setFrom, setTo }),
7159
- error ? /* @__PURE__ */ jsx16("div", { className: "mbow-state mbow-error", children: error.message }) : !data ? /* @__PURE__ */ jsx16("div", { className: "mbow-state", children: "Loading report\u2026" }) : /* @__PURE__ */ jsxs16(Fragment14, { children: [
7160
- /* @__PURE__ */ jsxs16("div", { className: "mbow-metrics", children: [
7161
- /* @__PURE__ */ jsx16(Metric, { label: "Bills created", value: String(data.totalCreated) }),
7162
- /* @__PURE__ */ jsx16(Metric, { label: "Transmissions", value: String(data.totalSent) }),
7163
- /* @__PURE__ */ jsx16(Metric, { label: "Bills submitted", value: String(data.totalSubmitted) }),
7164
- /* @__PURE__ */ jsx16(Metric, { label: "Accepted first try", value: data.totalSubmitted ? `${Math.round(data.totalClean / data.totalSubmitted * 100)}%` : "\u2014" })
7399
+ /* @__PURE__ */ jsx17(RangeToolbar, { from, to, setFrom, setTo }),
7400
+ error ? /* @__PURE__ */ jsx17("div", { className: "mbow-state mbow-error", children: error.message }) : !data ? /* @__PURE__ */ jsx17("div", { className: "mbow-state", children: "Loading report\u2026" }) : /* @__PURE__ */ jsxs17(Fragment15, { children: [
7401
+ /* @__PURE__ */ jsxs17("div", { className: "mbow-metrics", children: [
7402
+ /* @__PURE__ */ jsx17(Metric, { label: "Bills created", value: String(data.totalCreated) }),
7403
+ /* @__PURE__ */ jsx17(Metric, { label: "Transmissions", value: String(data.totalSent) }),
7404
+ /* @__PURE__ */ jsx17(Metric, { label: "Bills submitted", value: String(data.totalSubmitted) }),
7405
+ /* @__PURE__ */ jsx17(Metric, { label: "Accepted first try", value: data.totalSubmitted ? `${Math.round(data.totalClean / data.totalSubmitted * 100)}%` : "\u2014" })
7165
7406
  ] }),
7166
- /* @__PURE__ */ jsxs16("div", { className: "mbow-card mbow-scroll", children: [
7167
- /* @__PURE__ */ jsx16("div", { className: "mbow-section-head", children: /* @__PURE__ */ jsx16("h3", { children: "Per-biller summary" }) }),
7168
- /* @__PURE__ */ jsxs16("table", { className: "mbow-table", children: [
7169
- /* @__PURE__ */ jsx16("thead", { children: /* @__PURE__ */ jsxs16("tr", { children: [
7170
- /* @__PURE__ */ jsx16("th", { children: "Biller" }),
7171
- /* @__PURE__ */ jsx16("th", { children: "Created" }),
7172
- /* @__PURE__ */ jsx16("th", { children: "Transmissions" }),
7173
- /* @__PURE__ */ jsx16("th", { children: "Submitted" }),
7174
- /* @__PURE__ */ jsx16("th", { children: "Accepted first try" }),
7175
- /* @__PURE__ */ jsx16("th", { children: "Volume" })
7407
+ /* @__PURE__ */ jsxs17("div", { className: "mbow-card mbow-scroll", children: [
7408
+ /* @__PURE__ */ jsx17("div", { className: "mbow-section-head", children: /* @__PURE__ */ jsx17("h3", { children: "Per-biller summary" }) }),
7409
+ /* @__PURE__ */ jsxs17("table", { className: "mbow-table", children: [
7410
+ /* @__PURE__ */ jsx17("thead", { children: /* @__PURE__ */ jsxs17("tr", { children: [
7411
+ /* @__PURE__ */ jsx17("th", { children: "Biller" }),
7412
+ /* @__PURE__ */ jsx17("th", { children: "Created" }),
7413
+ /* @__PURE__ */ jsx17("th", { children: "Transmissions" }),
7414
+ /* @__PURE__ */ jsx17("th", { children: "Submitted" }),
7415
+ /* @__PURE__ */ jsx17("th", { children: "Accepted first try" }),
7416
+ /* @__PURE__ */ jsx17("th", { children: "Volume" })
7176
7417
  ] }) }),
7177
- /* @__PURE__ */ jsx16("tbody", { children: data.billers.map((biller) => {
7418
+ /* @__PURE__ */ jsx17("tbody", { children: data.billers.map((biller) => {
7178
7419
  const sent = data.sentTotal[biller.name] ?? 0;
7179
7420
  const submitted = data.submittedTotal[biller.name] ?? 0;
7180
7421
  const clean = data.cleanTotal[biller.name] ?? 0;
7181
- return /* @__PURE__ */ jsxs16("tr", { children: [
7182
- /* @__PURE__ */ jsx16("td", { className: "mbow-strong", children: biller.name }),
7183
- /* @__PURE__ */ jsx16("td", { children: data.createdTotal[biller.name] ?? 0 }),
7184
- /* @__PURE__ */ jsx16("td", { children: sent }),
7185
- /* @__PURE__ */ jsx16("td", { children: submitted }),
7186
- /* @__PURE__ */ jsx16("td", { children: submitted ? `${Math.round(clean / submitted * 100)}%` : "\u2014" }),
7187
- /* @__PURE__ */ jsx16("td", { children: /* @__PURE__ */ jsx16("div", { className: "mbow-bar", children: /* @__PURE__ */ jsx16("i", { style: { width: `${sent / maxSent * 100}%` } }) }) })
7422
+ return /* @__PURE__ */ jsxs17("tr", { children: [
7423
+ /* @__PURE__ */ jsx17("td", { className: "mbow-strong", children: biller.name }),
7424
+ /* @__PURE__ */ jsx17("td", { children: data.createdTotal[biller.name] ?? 0 }),
7425
+ /* @__PURE__ */ jsx17("td", { children: sent }),
7426
+ /* @__PURE__ */ jsx17("td", { children: submitted }),
7427
+ /* @__PURE__ */ jsx17("td", { children: submitted ? `${Math.round(clean / submitted * 100)}%` : "\u2014" }),
7428
+ /* @__PURE__ */ jsx17("td", { children: /* @__PURE__ */ jsx17("div", { className: "mbow-bar", children: /* @__PURE__ */ jsx17("i", { style: { width: `${sent / maxSent * 100}%` } }) }) })
7188
7429
  ] }, biller.name);
7189
7430
  }) })
7190
7431
  ] })
@@ -7201,28 +7442,28 @@ function ConnectedBillingWorkspace({ appearance, className, style, initialView =
7201
7442
  const workspaceClassName = ["mbow-workspace", className].filter(Boolean).join(" ");
7202
7443
  const hasExplicitHeight = style?.height != null || style?.maxHeight != null;
7203
7444
  const workspaceStyle = availableHeight == null || hasExplicitHeight ? style : { ...style, maxHeight: availableHeight };
7204
- if (selectedBillId) return /* @__PURE__ */ jsxs16(Surface, { surfaceRef: workspaceRef, appearance, className: workspaceClassName, style: workspaceStyle, children: [
7205
- /* @__PURE__ */ jsx16("button", { className: "mbow-button mbow-back", type: "button", onClick: () => setSelectedBillId(null), children: "\u2190 Back to bills" }),
7206
- /* @__PURE__ */ jsx16(ConnectedBillLifecycle, { billId: selectedBillId, ...options, ...appearance ? { appearance } : {} })
7445
+ if (selectedBillId) return /* @__PURE__ */ jsxs17(Surface, { surfaceRef: workspaceRef, appearance, className: workspaceClassName, style: workspaceStyle, children: [
7446
+ /* @__PURE__ */ jsx17("button", { className: "mbow-button mbow-back", type: "button", onClick: () => setSelectedBillId(null), children: "\u2190 Back to bills" }),
7447
+ /* @__PURE__ */ jsx17(ConnectedBillLifecycle, { billId: selectedBillId, ...options, ...appearance ? { appearance } : {} })
7207
7448
  ] });
7208
7449
  const selectView = (next) => {
7209
7450
  setView(next);
7210
7451
  setSelectedBillId(null);
7211
7452
  };
7212
7453
  const appearanceProps = appearance ? { appearance } : {};
7213
- return /* @__PURE__ */ jsxs16(Surface, { surfaceRef: workspaceRef, appearance, className: workspaceClassName, style: workspaceStyle, children: [
7214
- /* @__PURE__ */ jsxs16("div", { className: "mbow-head", children: [
7215
- /* @__PURE__ */ jsxs16("div", { children: [
7216
- /* @__PURE__ */ jsx16("h2", { children: "Billing" }),
7217
- /* @__PURE__ */ jsx16("p", { className: "mbow-sub", children: "Follow up on open work or find any bill and its current status." })
7454
+ return /* @__PURE__ */ jsxs17(Surface, { surfaceRef: workspaceRef, appearance, className: workspaceClassName, style: workspaceStyle, children: [
7455
+ /* @__PURE__ */ jsxs17("div", { className: "mbow-head", children: [
7456
+ /* @__PURE__ */ jsxs17("div", { children: [
7457
+ /* @__PURE__ */ jsx17("h2", { children: "Billing" }),
7458
+ /* @__PURE__ */ jsx17("p", { className: "mbow-sub", children: "Follow up on open work or find any bill and its current status." })
7218
7459
  ] }),
7219
- onCreateBill ? /* @__PURE__ */ jsx16("div", { className: "mbow-actions", children: /* @__PURE__ */ jsx16("button", { className: "mbow-button primary", type: "button", onClick: onCreateBill, children: "+ Add bill" }) }) : null
7460
+ onCreateBill ? /* @__PURE__ */ jsx17("div", { className: "mbow-actions", children: /* @__PURE__ */ jsx17("button", { className: "mbow-button primary", type: "button", onClick: onCreateBill, children: "+ Add bill" }) }) : null
7220
7461
  ] }),
7221
- /* @__PURE__ */ jsx16("div", { className: "mbow-tabs", role: "tablist", children: [["tasks", "Bill tasks"], ["bills", "All bills"], ["procedures", "Procedures"], ["productivity", "Productivity"]].map(([id, label]) => /* @__PURE__ */ jsx16("button", { className: `mbow-tab ${view === id ? "active" : ""}`, type: "button", role: "tab", "aria-selected": view === id, onClick: () => selectView(id), children: label }, id)) }),
7222
- view === "tasks" ? /* @__PURE__ */ jsx16(BillTasksContent, { client, onDrillDown: (query) => {
7462
+ /* @__PURE__ */ jsx17("div", { className: "mbow-tabs", role: "tablist", children: [["tasks", "Bill tasks"], ["bills", "All bills"], ["procedures", "Procedures"], ["productivity", "Productivity"]].map(([id, label]) => /* @__PURE__ */ jsx17("button", { className: `mbow-tab ${view === id ? "active" : ""}`, type: "button", role: "tab", "aria-selected": view === id, onClick: () => selectView(id), children: label }, id)) }),
7463
+ view === "tasks" ? /* @__PURE__ */ jsx17(BillTasksContent, { client, onDrillDown: (query) => {
7223
7464
  setBillQuery(query);
7224
7465
  setView("bills");
7225
- }, appearance }) : view === "bills" ? /* @__PURE__ */ jsx16(BillSearchContent, { client, initialQuery: billQuery, onSelectBill: (bill) => setSelectedBillId(bill.id) }) : view === "procedures" ? /* @__PURE__ */ jsx16(ConnectedServiceLineItemsReport, { ...options, ...appearanceProps, onSelectBill: setSelectedBillId }) : /* @__PURE__ */ jsx16(ConnectedProductivityReport, { ...options, ...appearanceProps })
7466
+ }, appearance }) : view === "bills" ? /* @__PURE__ */ jsx17(BillSearchContent, { client, initialQuery: billQuery, onSelectBill: (bill) => setSelectedBillId(bill.id) }) : view === "procedures" ? /* @__PURE__ */ jsx17(ConnectedServiceLineItemsReport, { ...options, ...appearanceProps, onSelectBill: setSelectedBillId }) : /* @__PURE__ */ jsx17(ConnectedProductivityReport, { ...options, ...appearanceProps })
7226
7467
  ] });
7227
7468
  }
7228
7469
 
@@ -7357,6 +7598,7 @@ export {
7357
7598
  mindBillAppearanceStyle,
7358
7599
  mindBillThemePresets,
7359
7600
  normalizeClaimsAdministratorName,
7601
+ organizationProfileOptions,
7360
7602
  parseBillSubmissionDate,
7361
7603
  prepareBillSubmissionDocuments,
7362
7604
  reportBillStatusContacts2 as reportBillStatusContacts,