@mindbill/react 0.49.0 → 0.50.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
@@ -348,7 +348,7 @@ function organizationProfileOptions(profile) {
348
348
 
349
349
  // src/index.tsx
350
350
  import "@mindbill/embed";
351
- import { createElement, useEffect as useEffect14, useRef as useRef10 } from "react";
351
+ import { createElement, useEffect as useEffect15, useRef as useRef10 } from "react";
352
352
 
353
353
  // src/native-bill-review.tsx
354
354
  import { sanitizeBillReviewSaveInput } from "@mindbill/browser";
@@ -4677,7 +4677,7 @@ function ReportBillStatusDialog({
4677
4677
  }
4678
4678
 
4679
4679
  // src/organization-onboarding.tsx
4680
- import { useCallback as useCallback2, useEffect as useEffect8, useId as useId2, useMemo as useMemo6, useRef as useRef4, useState as useState9 } from "react";
4680
+ import { useCallback as useCallback2, useEffect as useEffect8, useId as useId2, useMemo as useMemo6, useRef as useRef4, useState as useState10 } from "react";
4681
4681
  import {
4682
4682
  createOrganizationClient
4683
4683
  } from "@mindbill/browser";
@@ -4711,8 +4711,103 @@ function TaxIdInput({ label, value, onChange, disabled }) {
4711
4711
  ] });
4712
4712
  }
4713
4713
 
4714
+ // src/w9-upload.tsx
4715
+ import { useState as useState9 } from "react";
4716
+ import { jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
4717
+ function validateW9File(file, maxSizeBytes = 20 * 1024 * 1024) {
4718
+ if (!file.name.toLowerCase().endsWith(".pdf") || file.type && file.type !== "application/pdf") return "Choose a PDF file for the W-9.";
4719
+ if (file.size === 0) return "The selected PDF is empty.";
4720
+ if (file.size > maxSizeBytes) return `Choose a PDF smaller than ${Math.round(maxSizeBytes / 1024 / 1024)} MB.`;
4721
+ return null;
4722
+ }
4723
+ var extractionLabels = {
4724
+ idle: "",
4725
+ queued: "W-9 saved. Tax ID and address extraction is queued.",
4726
+ processing: "Reading the tax ID and remittance address\u2026",
4727
+ complete: "Extraction complete. Review the tax ID and remittance address before saving your billing settings.",
4728
+ not_found: "The tax ID or address could not be read. Enter the missing billing details manually.",
4729
+ failed: "Extraction failed. Your W-9 is still saved; enter the billing details manually or retry."
4730
+ };
4731
+ function W9Upload({ document: document2, extractionStatus = "idle", onUpload, onView, onRetryExtraction, maxSizeBytes = 20 * 1024 * 1024, disabled = false, appearance, className = "", style }) {
4732
+ const [file, setFile] = useState9(null);
4733
+ const [busy, setBusy] = useState9(false);
4734
+ const [error, setError] = useState9(null);
4735
+ const [saved, setSaved] = useState9(false);
4736
+ const choose = (next) => {
4737
+ if (busy || disabled) return;
4738
+ const failure = next ? validateW9File(next, maxSizeBytes) : null;
4739
+ setError(failure);
4740
+ setSaved(false);
4741
+ setFile(failure ? null : next);
4742
+ };
4743
+ const upload = async () => {
4744
+ if (!file || busy || disabled) return;
4745
+ setBusy(true);
4746
+ setError(null);
4747
+ setSaved(false);
4748
+ try {
4749
+ await onUpload(file);
4750
+ setFile(null);
4751
+ setSaved(true);
4752
+ } catch {
4753
+ setError("The W-9 could not be uploaded. Please try again.");
4754
+ } finally {
4755
+ setBusy(false);
4756
+ }
4757
+ };
4758
+ const retry = async () => {
4759
+ setBusy(true);
4760
+ setError(null);
4761
+ try {
4762
+ await onRetryExtraction?.();
4763
+ } catch {
4764
+ setError("Extraction could not be restarted. Please try again.");
4765
+ } finally {
4766
+ setBusy(false);
4767
+ }
4768
+ };
4769
+ return /* @__PURE__ */ jsxs13("section", { className: `mbw9 ${className}`.trim(), style: { ...mindBillAppearanceStyle(appearance), ...style }, "aria-label": "Practice W-9", children: [
4770
+ /* @__PURE__ */ jsx13("style", { children: `.mbw9{font:inherit;color:var(--mb-text)}.mbw9 *{box-sizing:border-box}.mbw9 p{margin:0;color:var(--mb-muted);font-size:13px;line-height:1.6}.mbw9-current,.mbw9-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.mbw9-current{padding:12px 14px;background:var(--mb-soft);border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);margin-bottom:12px}.mbw9-current strong{overflow-wrap:anywhere}.mbw9 button{font:inherit;color:var(--mb-text);background:var(--mb-surface);border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);padding:9px 14px;cursor:pointer}.mbw9 button:disabled{opacity:.55;cursor:default}.mbw9-drop{display:grid;gap:8px;padding:20px;border:1px dashed var(--mb-border);border-radius:var(--mb-control-radius);background:var(--mb-surface)}.mbw9-drop input{font:inherit;max-width:100%;color:var(--mb-muted)}.mbw9-actions{margin-top:12px}.mbw9 button.mbw9-primary{background:var(--mb-accent);color:var(--mb-accent-contrast);border-color:var(--mb-accent)}.mbw9 [role=alert]{color:var(--mb-danger);margin-top:12px}.mbw9 button:focus-visible,.mbw9 input:focus-visible{outline:2px solid var(--mb-accent);outline-offset:3px}.mbw9{min-width:0}.mbw9-drop{grid-template-columns:minmax(0,1fr);min-width:0;white-space:normal}.mbw9-drop>*{min-width:0;overflow-wrap:anywhere}.mbw9-drop input{width:100%}.mbw9-current>div{min-width:0;max-width:100%}` }),
4771
+ document2 ? /* @__PURE__ */ jsxs13("div", { className: "mbw9-current", children: [
4772
+ /* @__PURE__ */ jsxs13("div", { children: [
4773
+ /* @__PURE__ */ jsx13("strong", { children: document2.filename }),
4774
+ document2.addedAt ? /* @__PURE__ */ jsxs13("p", { children: [
4775
+ "Added ",
4776
+ document2.addedAt
4777
+ ] }) : null
4778
+ ] }),
4779
+ onView ? /* @__PURE__ */ jsx13("button", { type: "button", disabled: busy || disabled, onClick: onView, children: "View W-9" }) : null
4780
+ ] }) : null,
4781
+ /* @__PURE__ */ jsxs13("label", { className: "mbw9-drop", onDragOver: (event) => event.preventDefault(), onDrop: (event) => {
4782
+ event.preventDefault();
4783
+ choose(event.dataTransfer.files[0] ?? null);
4784
+ }, children: [
4785
+ /* @__PURE__ */ jsx13("strong", { children: document2 ? "Replace practice W-9" : "Upload practice W-9" }),
4786
+ /* @__PURE__ */ jsxs13("p", { children: [
4787
+ "Choose or drop a PDF, up to ",
4788
+ Math.round(maxSizeBytes / 1024 / 1024),
4789
+ " MB. Your server securely stores the document for billing."
4790
+ ] }),
4791
+ /* @__PURE__ */ jsx13("input", { "aria-label": "W-9 PDF", type: "file", accept: "application/pdf,.pdf", disabled: busy || disabled, onChange: (event) => {
4792
+ choose(event.target.files?.[0] ?? null);
4793
+ event.target.value = "";
4794
+ } }),
4795
+ file ? /* @__PURE__ */ jsx13("p", { children: file.name }) : null
4796
+ ] }),
4797
+ /* @__PURE__ */ jsxs13("div", { className: "mbw9-actions", children: [
4798
+ /* @__PURE__ */ jsx13("p", { role: "status", children: busy ? "Working\u2026" : extractionLabels[extractionStatus] || (saved ? "W-9 saved." : "") }),
4799
+ /* @__PURE__ */ jsxs13("div", { children: [
4800
+ onRetryExtraction && (extractionStatus === "failed" || extractionStatus === "not_found") ? /* @__PURE__ */ jsx13("button", { type: "button", disabled: busy || disabled, onClick: () => void retry(), children: "Retry extraction" }) : null,
4801
+ " ",
4802
+ /* @__PURE__ */ jsx13("button", { className: "mbw9-primary", type: "button", disabled: !file || busy || disabled, onClick: () => void upload(), children: busy ? "Please wait\u2026" : "Upload W-9" })
4803
+ ] })
4804
+ ] }),
4805
+ error ? /* @__PURE__ */ jsx13("p", { role: "alert", children: error }) : null
4806
+ ] });
4807
+ }
4808
+
4714
4809
  // src/organization-onboarding.tsx
4715
- import { Fragment as Fragment10, jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
4810
+ import { Fragment as Fragment10, jsx as jsx14, jsxs as jsxs14 } from "react/jsx-runtime";
4716
4811
  var STEPS = [
4717
4812
  { id: "practice", label: "Practice & billing" },
4718
4813
  { id: "rendering", label: "Rendering providers" },
@@ -4786,18 +4881,17 @@ function OrganizationOnboarding({
4786
4881
  }),
4787
4882
  [sessionEndpoint, getSession, apiBaseUrl]
4788
4883
  );
4789
- const [profile, setProfile] = useState9(null);
4790
- const [loadError, setLoadError] = useState9(null);
4791
- const [step, setStep] = useState9("practice");
4792
- const [identity, setIdentity] = useState9({ name: "", legalName: "", taxId: "", npi: "", phone: "", email: "" });
4793
- const [provider, setProvider] = useState9({ name: "", taxId: "", npi: "", billType: "Professional", phone: "", billingStreet: "", billingCity: "", billingState: "", billingZip: "" });
4794
- const [locations, setLocations] = useState9([blankLocation()]);
4795
- const [rendering, setRendering] = useState9(blankRendering);
4884
+ const [profile, setProfile] = useState10(null);
4885
+ const [loadError, setLoadError] = useState10(null);
4886
+ const [step, setStep] = useState10("practice");
4887
+ const [identity, setIdentity] = useState10({ name: "", legalName: "", taxId: "", npi: "", phone: "", email: "" });
4888
+ const [provider, setProvider] = useState10({ name: "", taxId: "", npi: "", billType: "Professional", phone: "", billingStreet: "", billingCity: "", billingState: "", billingZip: "" });
4889
+ const [locations, setLocations] = useState10([blankLocation()]);
4890
+ const [rendering, setRendering] = useState10(blankRendering);
4796
4891
  const primaryGroup = useId2();
4797
- const [w9File, setW9File] = useState9(null);
4798
- const [saving, setSaving] = useState9(false);
4799
- const [error, setError] = useState9(null);
4800
- const [savedStep, setSavedStep] = useState9({});
4892
+ const [saving, setSaving] = useState10(false);
4893
+ const [error, setError] = useState10(null);
4894
+ const [savedStep, setSavedStep] = useState10({});
4801
4895
  const completedFired = useRef4(false);
4802
4896
  const adoptProfile = useCallback2((next) => {
4803
4897
  setProfile(next);
@@ -4865,39 +4959,50 @@ function OrganizationOnboarding({
4865
4959
  });
4866
4960
  }, "practice");
4867
4961
  const saveLocations = () => run(() => client.saveLocations(locations.filter((item) => item.name.trim() || item.street.trim())), "locations");
4868
- const saveW9 = () => run(async () => {
4869
- if (!w9File) throw new Error("Choose the practice W-9 PDF first.");
4870
- return client.saveW9({ filename: w9File.name, contentBase64: await fileToBase64(w9File) });
4871
- }, "w9");
4872
- const field = (label, value, onChange, span = false, placeholder = "") => /* @__PURE__ */ jsxs13("label", { className: `mbob-field${span ? " mbob-span" : ""}`, children: [
4962
+ const saveW9 = async (file) => {
4963
+ setSaving(true);
4964
+ try {
4965
+ const next = await client.saveW9({ filename: file.name, contentBase64: await fileToBase64(file) });
4966
+ adoptProfile(next);
4967
+ setSavedStep((current) => ({ ...current, w9: true }));
4968
+ onSaved?.(next);
4969
+ if (variant === "onboarding") setStep("review");
4970
+ } catch (error2) {
4971
+ onError?.(error2 instanceof Error ? error2 : new Error("The W-9 could not be saved."));
4972
+ throw error2;
4973
+ } finally {
4974
+ setSaving(false);
4975
+ }
4976
+ };
4977
+ const field = (label, value, onChange, span = false, placeholder = "") => /* @__PURE__ */ jsxs14("label", { className: `mbob-field${span ? " mbob-span" : ""}`, children: [
4873
4978
  label,
4874
- /* @__PURE__ */ jsx13("input", { value, placeholder, onChange: (event) => onChange(event.target.value), disabled: saving })
4979
+ /* @__PURE__ */ jsx14("input", { value, placeholder, onChange: (event) => onChange(event.target.value), disabled: saving })
4875
4980
  ] });
4876
4981
  const setLocation = (index, patch) => setLocations((current) => current.map((item, itemIndex) => {
4877
4982
  if (itemIndex !== index) return patch.isPrimary ? { ...item, isPrimary: false } : item;
4878
4983
  return { ...item, ...patch };
4879
4984
  }));
4880
- const practiceSection = /* @__PURE__ */ jsxs13("div", { children: [
4881
- /* @__PURE__ */ jsx13("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." }),
4882
- /* @__PURE__ */ jsxs13("div", { className: "mbob-grid", children: [
4985
+ const practiceSection = /* @__PURE__ */ jsxs14("div", { children: [
4986
+ /* @__PURE__ */ jsx14("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." }),
4987
+ /* @__PURE__ */ jsxs14("div", { className: "mbob-grid", children: [
4883
4988
  field("Practice name", identity.name, (name) => setIdentity((c) => ({ ...c, name }))),
4884
4989
  field("Legal name", identity.legalName, (legalName) => setIdentity((c) => ({ ...c, legalName }))),
4885
- /* @__PURE__ */ jsx13(TaxIdInput, { label: "Practice tax ID", value: identity, disabled: saving, onChange: (patch) => setIdentity((c) => ({ ...c, ...patch })) }),
4990
+ /* @__PURE__ */ jsx14(TaxIdInput, { label: "Practice tax ID", value: identity, disabled: saving, onChange: (patch) => setIdentity((c) => ({ ...c, ...patch })) }),
4886
4991
  field("Group NPI", identity.npi, (npi) => setIdentity((c) => ({ ...c, npi }))),
4887
4992
  field("Phone", identity.phone, (phone) => setIdentity((c) => ({ ...c, phone }))),
4888
4993
  field("Email", identity.email, (email) => setIdentity((c) => ({ ...c, email })))
4889
4994
  ] }),
4890
- /* @__PURE__ */ jsx13("h3", { className: "mbob-subhead", children: "Billing provider (pay-to)" }),
4891
- /* @__PURE__ */ jsxs13("label", { className: "mbob-field", children: [
4995
+ /* @__PURE__ */ jsx14("h3", { className: "mbob-subhead", children: "Billing provider (pay-to)" }),
4996
+ /* @__PURE__ */ jsxs14("label", { className: "mbob-field", children: [
4892
4997
  "Saved billing provider",
4893
- /* @__PURE__ */ jsxs13("select", { disabled: saving, value: provider.id ?? "", onChange: (event) => setProvider({ ...profile?.billingProviders.find((item) => item.id === event.target.value) ?? { name: "", taxId: "", npi: "" } }), children: [
4894
- /* @__PURE__ */ jsx13("option", { value: "", children: "Add a billing provider" }),
4895
- profile?.billingProviders.map((item) => /* @__PURE__ */ jsx13("option", { value: item.id, children: item.name }, item.id))
4998
+ /* @__PURE__ */ jsxs14("select", { disabled: saving, value: provider.id ?? "", onChange: (event) => setProvider({ ...profile?.billingProviders.find((item) => item.id === event.target.value) ?? { name: "", taxId: "", npi: "" } }), children: [
4999
+ /* @__PURE__ */ jsx14("option", { value: "", children: "Add a billing provider" }),
5000
+ profile?.billingProviders.map((item) => /* @__PURE__ */ jsx14("option", { value: item.id, children: item.name }, item.id))
4896
5001
  ] })
4897
5002
  ] }),
4898
- /* @__PURE__ */ jsxs13("div", { className: "mbob-grid", children: [
5003
+ /* @__PURE__ */ jsxs14("div", { className: "mbob-grid", children: [
4899
5004
  field("Billing provider name", provider.name, (name) => setProvider((c) => ({ ...c, name }))),
4900
- /* @__PURE__ */ jsx13(TaxIdInput, { label: "Billing tax ID", value: provider, disabled: saving, onChange: (patch) => setProvider((c) => ({ ...c, ...patch })) }),
5005
+ /* @__PURE__ */ jsx14(TaxIdInput, { label: "Billing tax ID", value: provider, disabled: saving, onChange: (patch) => setProvider((c) => ({ ...c, ...patch })) }),
4901
5006
  field("Billing NPI", provider.npi, (npi) => setProvider((c) => ({ ...c, npi }))),
4902
5007
  field("Billing phone", provider.phone ?? "", (phone) => setProvider((c) => ({ ...c, phone }))),
4903
5008
  field("Street", provider.billingStreet ?? "", (billingStreet) => setProvider((c) => ({ ...c, billingStreet })), true),
@@ -4905,119 +5010,102 @@ function OrganizationOnboarding({
4905
5010
  field("State", provider.billingState ?? "", (billingState) => setProvider((c) => ({ ...c, billingState: billingState.toUpperCase().slice(0, 2) }))),
4906
5011
  field("ZIP", provider.billingZip ?? "", (billingZip) => setProvider((c) => ({ ...c, billingZip })))
4907
5012
  ] }),
4908
- /* @__PURE__ */ jsxs13("div", { className: "mbob-actions", children: [
4909
- /* @__PURE__ */ jsx13("span", { className: "mbob-status", children: savedStep["practice"] ? "Saved to MindBill." : "Saved once, used on every bill." }),
4910
- /* @__PURE__ */ jsx13("button", { className: "mbob-save", type: "button", disabled: saving, onClick: savePractice, children: saving ? "Saving\u2026" : "Save practice" })
5013
+ /* @__PURE__ */ jsxs14("div", { className: "mbob-actions", children: [
5014
+ /* @__PURE__ */ jsx14("span", { className: "mbob-status", children: savedStep["practice"] ? "Saved to MindBill." : "Saved once, used on every bill." }),
5015
+ /* @__PURE__ */ jsx14("button", { className: "mbob-save", type: "button", disabled: saving, onClick: savePractice, children: saving ? "Saving\u2026" : "Save practice" })
4911
5016
  ] })
4912
5017
  ] });
4913
- const renderingSection = /* @__PURE__ */ jsxs13("div", { children: [
4914
- /* @__PURE__ */ jsxs13("label", { className: "mbob-field", children: [
5018
+ const renderingSection = /* @__PURE__ */ jsxs14("div", { children: [
5019
+ /* @__PURE__ */ jsxs14("label", { className: "mbob-field", children: [
4915
5020
  "Saved rendering provider",
4916
- /* @__PURE__ */ jsxs13("select", { disabled: saving, value: rendering.id ?? "", onChange: (event) => setRendering({ ...profile?.renderingProviders?.find((item) => item.id === event.target.value) ?? blankRendering() }), children: [
4917
- /* @__PURE__ */ jsx13("option", { value: "", children: "Add a rendering provider" }),
4918
- profile?.renderingProviders?.map((item) => /* @__PURE__ */ jsxs13("option", { value: item.id, children: [
5021
+ /* @__PURE__ */ jsxs14("select", { disabled: saving, value: rendering.id ?? "", onChange: (event) => setRendering({ ...profile?.renderingProviders?.find((item) => item.id === event.target.value) ?? blankRendering() }), children: [
5022
+ /* @__PURE__ */ jsx14("option", { value: "", children: "Add a rendering provider" }),
5023
+ profile?.renderingProviders?.map((item) => /* @__PURE__ */ jsxs14("option", { value: item.id, children: [
4919
5024
  item.name,
4920
5025
  item.active === false ? " (inactive)" : ""
4921
5026
  ] }, item.id))
4922
5027
  ] })
4923
5028
  ] }),
4924
- /* @__PURE__ */ jsxs13("div", { className: "mbob-grid", style: { marginTop: 16 }, children: [
5029
+ /* @__PURE__ */ jsxs14("div", { className: "mbob-grid", style: { marginTop: 16 }, children: [
4925
5030
  field("Rendering provider name", rendering.name, (name) => setRendering((c) => ({ ...c, name }))),
4926
5031
  field("Rendering NPI", rendering.npi, (npi) => setRendering((c) => ({ ...c, npi }))),
4927
5032
  field("Taxonomy", rendering.taxonomy ?? "", (taxonomy) => setRendering((c) => ({ ...c, taxonomy }))),
4928
5033
  field("Specialty", rendering.specialty ?? "", (specialty) => setRendering((c) => ({ ...c, specialty }))),
4929
5034
  field("License number", rendering.licenseNumber ?? "", (licenseNumber) => setRendering((c) => ({ ...c, licenseNumber }))),
4930
5035
  field("License state", rendering.licenseState ?? "", (licenseState) => setRendering((c) => ({ ...c, licenseState: licenseState.toUpperCase().slice(0, 2) }))),
4931
- /* @__PURE__ */ jsxs13("label", { children: [
4932
- /* @__PURE__ */ jsx13("input", { disabled: saving, type: "checkbox", checked: rendering.active !== false, onChange: (event) => setRendering((c) => ({ ...c, active: event.target.checked })) }),
5036
+ /* @__PURE__ */ jsxs14("label", { children: [
5037
+ /* @__PURE__ */ jsx14("input", { disabled: saving, type: "checkbox", checked: rendering.active !== false, onChange: (event) => setRendering((c) => ({ ...c, active: event.target.checked })) }),
4933
5038
  " Available for new bills"
4934
5039
  ] })
4935
5040
  ] }),
4936
- /* @__PURE__ */ jsxs13("div", { className: "mbob-actions", children: [
4937
- /* @__PURE__ */ jsx13("span", { className: "mbob-status", children: savedStep["rendering"] ? "Saved to MindBill." : "Saved profiles do not change previously submitted bills." }),
4938
- /* @__PURE__ */ jsx13("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" })
5041
+ /* @__PURE__ */ jsxs14("div", { className: "mbob-actions", children: [
5042
+ /* @__PURE__ */ jsx14("span", { className: "mbob-status", children: savedStep["rendering"] ? "Saved to MindBill." : "Saved profiles do not change previously submitted bills." }),
5043
+ /* @__PURE__ */ jsx14("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" })
4939
5044
  ] })
4940
5045
  ] });
4941
- const locationsSection = /* @__PURE__ */ jsxs13("div", { children: [
4942
- locations.map((location, index) => /* @__PURE__ */ jsxs13("div", { className: "mbob-loc", children: [
5046
+ const locationsSection = /* @__PURE__ */ jsxs14("div", { children: [
5047
+ locations.map((location, index) => /* @__PURE__ */ jsxs14("div", { className: "mbob-loc", children: [
4943
5048
  field("Name", location.name ?? "", (name) => setLocation(index, { name })),
4944
5049
  field("Street", location.street, (street) => setLocation(index, { street })),
4945
5050
  field("City", location.city, (city) => setLocation(index, { city })),
4946
5051
  field("State", location.state, (state) => setLocation(index, { state: state.toUpperCase().slice(0, 2) })),
4947
5052
  field("ZIP", location.zip, (zip) => setLocation(index, { zip })),
4948
5053
  field("Place of service code", location.posCode ?? "", (posCode) => setLocation(index, { posCode }), false, "11"),
4949
- /* @__PURE__ */ jsxs13("label", { className: "mbob-primary", children: [
4950
- /* @__PURE__ */ jsx13("input", { disabled: saving || location.active === false, type: "radio", name: primaryGroup, checked: location.isPrimary === true, onChange: () => setLocation(index, { isPrimary: true }) }),
5054
+ /* @__PURE__ */ jsxs14("label", { className: "mbob-primary", children: [
5055
+ /* @__PURE__ */ jsx14("input", { disabled: saving || location.active === false, type: "radio", name: primaryGroup, checked: location.isPrimary === true, onChange: () => setLocation(index, { isPrimary: true }) }),
4951
5056
  " Primary"
4952
5057
  ] }),
4953
- location.id ? /* @__PURE__ */ jsx13("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__ */ jsx13("button", { className: "mbob-remove", disabled: saving, type: "button", "aria-label": "Remove location", onClick: () => setLocations((current) => current.filter((_, itemIndex) => itemIndex !== index)), children: "\xD7" })
5058
+ location.id ? /* @__PURE__ */ jsx14("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__ */ jsx14("button", { className: "mbob-remove", disabled: saving, type: "button", "aria-label": "Remove location", onClick: () => setLocations((current) => current.filter((_, itemIndex) => itemIndex !== index)), children: "\xD7" })
4954
5059
  ] }, location.id ?? index)),
4955
- /* @__PURE__ */ jsx13("button", { className: "mbob-add", type: "button", onClick: () => setLocations((current) => [...current, blankLocation()]), children: "+ Add location" }),
4956
- /* @__PURE__ */ jsxs13("div", { className: "mbob-actions", children: [
4957
- /* @__PURE__ */ jsx13("span", { className: "mbob-status", children: savedStep["locations"] ? "Saved to MindBill." : "Where evaluations happen." }),
4958
- /* @__PURE__ */ jsx13("button", { className: "mbob-save", type: "button", disabled: saving, onClick: saveLocations, children: saving ? "Saving\u2026" : "Save locations" })
5060
+ /* @__PURE__ */ jsx14("button", { className: "mbob-add", type: "button", onClick: () => setLocations((current) => [...current, blankLocation()]), children: "+ Add location" }),
5061
+ /* @__PURE__ */ jsxs14("div", { className: "mbob-actions", children: [
5062
+ /* @__PURE__ */ jsx14("span", { className: "mbob-status", children: savedStep["locations"] ? "Saved to MindBill." : "Where evaluations happen." }),
5063
+ /* @__PURE__ */ jsx14("button", { className: "mbob-save", type: "button", disabled: saving, onClick: saveLocations, children: saving ? "Saving\u2026" : "Save locations" })
4959
5064
  ] })
4960
5065
  ] });
4961
- const w9Section = /* @__PURE__ */ jsxs13("div", { children: [
4962
- profile?.w9 ? /* @__PURE__ */ jsxs13("div", { className: "mbob-w9-current", children: [
4963
- /* @__PURE__ */ jsxs13("div", { children: [
4964
- /* @__PURE__ */ jsx13("strong", { children: profile.w9.filename }),
4965
- /* @__PURE__ */ jsxs13("span", { children: [
4966
- " \xB7 added ",
4967
- profile.w9.addDate
4968
- ] })
4969
- ] }),
4970
- /* @__PURE__ */ jsx13("span", { children: "Rides on every bill automatically" })
4971
- ] }) : null,
4972
- /* @__PURE__ */ jsxs13("label", { className: "mbob-drop", children: [
4973
- /* @__PURE__ */ jsx13("input", { type: "file", accept: "application/pdf,.pdf", onChange: (event) => setW9File(event.target.files?.[0] ?? null) }),
4974
- /* @__PURE__ */ jsx13("strong", { children: w9File ? w9File.name : profile?.w9 ? "Replace the W-9 PDF" : "Drop the practice W-9 PDF here, or click to choose" }),
4975
- /* @__PURE__ */ jsx13("span", { children: "The W-9 is auto-attached to every submission." })
4976
- ] }),
4977
- /* @__PURE__ */ jsxs13("div", { className: "mbob-actions", children: [
4978
- /* @__PURE__ */ jsx13("span", { className: "mbob-status", children: savedStep["w9"] ? "Saved to MindBill." : "" }),
4979
- /* @__PURE__ */ jsx13("button", { className: "mbob-save", type: "button", disabled: saving || !w9File, onClick: saveW9, children: saving ? "Uploading\u2026" : "Save W-9" })
4980
- ] })
5066
+ const w9Section = /* @__PURE__ */ jsxs14("div", { children: [
5067
+ /* @__PURE__ */ jsx14("p", { className: "mbob-status", children: "The saved W-9 is auto-attached to every submission." }),
5068
+ /* @__PURE__ */ jsx14(W9Upload, { ...appearance ? { appearance } : {}, ...profile?.w9 ? { document: { filename: profile.w9.filename, addedAt: profile.w9.addDate } } : {}, onUpload: saveW9, disabled: saving })
4981
5069
  ] });
4982
- const reviewSection = /* @__PURE__ */ jsxs13("div", { className: "mbob-check", children: [
4983
- (profile?.onboarding.checklist ?? []).map((item) => /* @__PURE__ */ jsxs13("div", { className: "mbob-check-item", "data-complete": item.complete, children: [
4984
- /* @__PURE__ */ jsx13("i", { children: item.complete ? "\u2713" : "\u2022" }),
4985
- /* @__PURE__ */ jsx13("span", { children: item.label })
5070
+ const reviewSection = /* @__PURE__ */ jsxs14("div", { className: "mbob-check", children: [
5071
+ (profile?.onboarding.checklist ?? []).map((item) => /* @__PURE__ */ jsxs14("div", { className: "mbob-check-item", "data-complete": item.complete, children: [
5072
+ /* @__PURE__ */ jsx14("i", { children: item.complete ? "\u2713" : "\u2022" }),
5073
+ /* @__PURE__ */ jsx14("span", { children: item.label })
4986
5074
  ] }, item.id)),
4987
- profile?.onboarding.complete ? /* @__PURE__ */ jsx13("p", { className: "mbob-done", children: "Billing setup is complete \u2014 bills submitted from your product carry this profile automatically." }) : /* @__PURE__ */ jsx13("p", { className: "mbob-status", children: "Items above complete themselves as each section is saved." })
5075
+ profile?.onboarding.complete ? /* @__PURE__ */ jsx14("p", { className: "mbob-done", children: "Billing setup is complete \u2014 bills submitted from your product carry this profile automatically." }) : /* @__PURE__ */ jsx14("p", { className: "mbob-status", children: "Items above complete themselves as each section is saved." })
4988
5076
  ] });
4989
5077
  const sections = { practice: practiceSection, rendering: renderingSection, locations: locationsSection, w9: w9Section, review: reviewSection };
4990
- return /* @__PURE__ */ jsxs13("div", { className: `mbob ${className}`.trim(), style: { ...mindBillAppearanceStyle(appearance), ...style }, children: [
4991
- /* @__PURE__ */ jsx13("style", { children: css9 }),
4992
- /* @__PURE__ */ jsxs13("div", { className: "mbob-card", children: [
4993
- /* @__PURE__ */ jsx13("div", { className: "mbob-head", children: /* @__PURE__ */ jsxs13("div", { children: [
4994
- /* @__PURE__ */ jsx13("h2", { children: heading }),
4995
- /* @__PURE__ */ jsx13("p", { className: "mbob-copy", children: description })
5078
+ return /* @__PURE__ */ jsxs14("div", { className: `mbob ${className}`.trim(), style: { ...mindBillAppearanceStyle(appearance), ...style }, children: [
5079
+ /* @__PURE__ */ jsx14("style", { children: css9 }),
5080
+ /* @__PURE__ */ jsxs14("div", { className: "mbob-card", children: [
5081
+ /* @__PURE__ */ jsx14("div", { className: "mbob-head", children: /* @__PURE__ */ jsxs14("div", { children: [
5082
+ /* @__PURE__ */ jsx14("h2", { children: heading }),
5083
+ /* @__PURE__ */ jsx14("p", { className: "mbob-copy", children: description })
4996
5084
  ] }) }),
4997
- loadError ? /* @__PURE__ */ jsx13("div", { className: "mbob-error", role: "alert", children: loadError }) : null,
4998
- variant === "onboarding" ? /* @__PURE__ */ jsxs13(Fragment10, { children: [
4999
- /* @__PURE__ */ jsx13("div", { className: "mbob-steps", children: STEPS.map((item) => /* @__PURE__ */ jsxs13("button", { className: "mbob-step", type: "button", "data-active": step === item.id, "data-done": Boolean(savedStep[item.id]), onClick: () => setStep(item.id), children: [
5000
- /* @__PURE__ */ jsx13("i", { children: savedStep[item.id] ? "\u2713" : "" }),
5085
+ loadError ? /* @__PURE__ */ jsx14("div", { className: "mbob-error", role: "alert", children: loadError }) : null,
5086
+ variant === "onboarding" ? /* @__PURE__ */ jsxs14(Fragment10, { children: [
5087
+ /* @__PURE__ */ jsx14("div", { className: "mbob-steps", children: STEPS.map((item) => /* @__PURE__ */ jsxs14("button", { className: "mbob-step", type: "button", "data-active": step === item.id, "data-done": Boolean(savedStep[item.id]), onClick: () => setStep(item.id), children: [
5088
+ /* @__PURE__ */ jsx14("i", { children: savedStep[item.id] ? "\u2713" : "" }),
5001
5089
  item.label
5002
5090
  ] }, item.id)) }),
5003
5091
  sections[step]
5004
- ] }) : /* @__PURE__ */ jsxs13(Fragment10, { children: [
5092
+ ] }) : /* @__PURE__ */ jsxs14(Fragment10, { children: [
5005
5093
  practiceSection,
5006
- /* @__PURE__ */ jsx13("h3", { className: "mbob-subhead", children: "Rendering providers" }),
5094
+ /* @__PURE__ */ jsx14("h3", { className: "mbob-subhead", children: "Rendering providers" }),
5007
5095
  renderingSection,
5008
- /* @__PURE__ */ jsx13("h3", { className: "mbob-subhead", children: "Locations" }),
5096
+ /* @__PURE__ */ jsx14("h3", { className: "mbob-subhead", children: "Locations" }),
5009
5097
  locationsSection,
5010
- /* @__PURE__ */ jsx13("h3", { className: "mbob-subhead", children: "Practice W-9" }),
5098
+ /* @__PURE__ */ jsx14("h3", { className: "mbob-subhead", children: "Practice W-9" }),
5011
5099
  w9Section,
5012
- /* @__PURE__ */ jsx13("h3", { className: "mbob-subhead", children: "Checklist" }),
5100
+ /* @__PURE__ */ jsx14("h3", { className: "mbob-subhead", children: "Checklist" }),
5013
5101
  reviewSection
5014
5102
  ] }),
5015
- error ? /* @__PURE__ */ jsx13("div", { className: "mbob-error", role: "alert", children: error }) : null
5103
+ error ? /* @__PURE__ */ jsx14("div", { className: "mbob-error", role: "alert", children: error }) : null
5016
5104
  ] })
5017
5105
  ] });
5018
5106
  }
5019
5107
  function BillingSettings(props) {
5020
- return /* @__PURE__ */ jsx13(
5108
+ return /* @__PURE__ */ jsx14(
5021
5109
  OrganizationOnboarding,
5022
5110
  {
5023
5111
  heading: "Billing settings",
@@ -5028,9 +5116,311 @@ function BillingSettings(props) {
5028
5116
  );
5029
5117
  }
5030
5118
 
5119
+ // src/payment-review.tsx
5120
+ import { useEffect as useEffect9, useMemo as useMemo7, useState as useState11 } from "react";
5121
+
5122
+ // src/billing-operations-client.ts
5123
+ import {
5124
+ DEFAULT_API_BASE_URL,
5125
+ DEFAULT_SESSION_ENDPOINT
5126
+ } from "@mindbill/browser";
5127
+ async function responseError(response, fallback) {
5128
+ const body = await response.json().catch(() => null);
5129
+ const detail = body && typeof body === "object" ? body.detail ?? body.error : null;
5130
+ return new Error(typeof detail === "string" ? detail : fallback);
5131
+ }
5132
+ function normalizeSession(value) {
5133
+ if (!value || typeof value !== "object") throw new Error("The MindBill session endpoint returned an invalid response.");
5134
+ const candidate = value;
5135
+ const nested = candidate.session ?? candidate.data;
5136
+ const session = nested && typeof nested === "object" ? nested : candidate;
5137
+ if (typeof session.token !== "string" || session.token.length < 8) {
5138
+ throw new Error("The MindBill session endpoint did not return a browser session token.");
5139
+ }
5140
+ return {
5141
+ token: session.token,
5142
+ ...typeof session.expiresAt === "string" ? { expiresAt: session.expiresAt } : {},
5143
+ ...typeof session.apiBaseUrl === "string" ? { apiBaseUrl: session.apiBaseUrl } : {}
5144
+ };
5145
+ }
5146
+ function isFresh(session) {
5147
+ if (!session) return false;
5148
+ if (!session.expiresAt) return true;
5149
+ const expiresAt = Date.parse(session.expiresAt);
5150
+ return Number.isFinite(expiresAt) && expiresAt > Date.now() + 3e4;
5151
+ }
5152
+ function queryString(values) {
5153
+ const params = new URLSearchParams();
5154
+ for (const [key, value] of Object.entries(values)) {
5155
+ if (value !== void 0 && value !== "") params.set(key, String(value));
5156
+ }
5157
+ const text = params.toString();
5158
+ return text ? `?${text}` : "";
5159
+ }
5160
+ function createBillingOperationsClient({
5161
+ sessionEndpoint = DEFAULT_SESSION_ENDPOINT,
5162
+ getSession,
5163
+ apiBaseUrl = DEFAULT_API_BASE_URL,
5164
+ fetch: fetchOverride
5165
+ } = {}) {
5166
+ const fetcher = fetchOverride ?? globalThis.fetch;
5167
+ if (typeof fetcher !== "function") throw new Error("A Fetch API implementation is required.");
5168
+ let session = null;
5169
+ let pendingSession = null;
5170
+ let pendingSessionSignal = null;
5171
+ const mintSession = async (signal, force = false) => {
5172
+ if (!force && isFresh(session)) return session;
5173
+ if (!force && pendingSession && !pendingSessionSignal?.aborted) return pendingSession;
5174
+ const pending = getSession ? getSession({ signal }) : fetcher(sessionEndpoint, {
5175
+ method: "POST",
5176
+ credentials: "same-origin",
5177
+ headers: { "content-type": "application/json" },
5178
+ body: JSON.stringify({}),
5179
+ signal
5180
+ }).then(async (response) => {
5181
+ if (!response.ok) throw await responseError(response, "MindBill browser session could not be created.");
5182
+ return response.json();
5183
+ });
5184
+ const request = Promise.resolve(pending).then(normalizeSession).then((next) => {
5185
+ session = next;
5186
+ return next;
5187
+ }).finally(() => {
5188
+ if (pendingSession === request) {
5189
+ pendingSession = null;
5190
+ pendingSessionSignal = null;
5191
+ }
5192
+ });
5193
+ pendingSession = request;
5194
+ pendingSessionSignal = signal;
5195
+ return request;
5196
+ };
5197
+ const get = async (path, signal) => {
5198
+ const controller = signal ? null : new AbortController();
5199
+ const requestSignal = signal ?? controller?.signal;
5200
+ if (!requestSignal) throw new Error("An AbortSignal could not be created.");
5201
+ let browserSession = await mintSession(requestSignal);
5202
+ const request = (active) => {
5203
+ const base = (active.apiBaseUrl ?? apiBaseUrl).replace(/\/$/, "");
5204
+ return fetcher(`${base}${path}`, {
5205
+ headers: { authorization: `Bearer ${active.token}` },
5206
+ signal: requestSignal
5207
+ });
5208
+ };
5209
+ let response = await request(browserSession);
5210
+ if (response.status === 401) {
5211
+ session = null;
5212
+ browserSession = await mintSession(requestSignal, true);
5213
+ response = await request(browserSession);
5214
+ }
5215
+ if (!response.ok) throw await responseError(response, "MindBill data could not be loaded.");
5216
+ const body = await response.json();
5217
+ return body.data ?? body;
5218
+ };
5219
+ return {
5220
+ clearSession() {
5221
+ session = null;
5222
+ pendingSession = null;
5223
+ pendingSessionSignal = null;
5224
+ },
5225
+ getBills(query = {}, signal) {
5226
+ const { claimsAdministrator, taskType, taskSection: _taskSection, sort, status, ...filters } = query;
5227
+ void _taskSection;
5228
+ const sortKey = sort?.startsWith("balance_") ? "balanceDue" : sort?.startsWith("patient_") ? "patient" : sort ? "submitted" : void 0;
5229
+ return get(`/partner/v2/bill-dashboard${queryString({
5230
+ ...filters,
5231
+ status: status === "submitted" ? "sent" : status,
5232
+ claimsAdminId: claimsAdministrator,
5233
+ taskKind: taskType,
5234
+ sort: sortKey,
5235
+ dir: sort ? sort.endsWith("_asc") ? "asc" : "desc" : void 0
5236
+ })}`, signal);
5237
+ },
5238
+ getBillTasks(claimsAdministrator, signal, renderingProviderId) {
5239
+ return get(
5240
+ `/partner/v2/bill-tasks${queryString({ claimsAdminId: claimsAdministrator, renderingProviderId })}`,
5241
+ signal
5242
+ );
5243
+ },
5244
+ getServiceLineItems(range, signal) {
5245
+ return get(
5246
+ `/partner/v2/reports/service-line-items${queryString(range)}`,
5247
+ signal
5248
+ );
5249
+ },
5250
+ getPaymentReview(query = {}, signal) {
5251
+ return get(`/partner/v2/reports/payments${queryString(query)}`, signal);
5252
+ },
5253
+ getProductivity(range, signal) {
5254
+ return get(`/partner/v2/reports/productivity${queryString(range)}`, signal);
5255
+ }
5256
+ };
5257
+ }
5258
+
5259
+ // src/payment-review.tsx
5260
+ import { jsx as jsx15, jsxs as jsxs15 } from "react/jsx-runtime";
5261
+ var localDate = (date2) => `${date2.getFullYear()}-${String(date2.getMonth() + 1).padStart(2, "0")}-${String(date2.getDate()).padStart(2, "0")}`;
5262
+ function paymentReviewDateRange(range, now = /* @__PURE__ */ new Date()) {
5263
+ if (range === "all") return {};
5264
+ const start = new Date(now.getFullYear(), now.getMonth(), now.getDate());
5265
+ if (range === "week") start.setDate(start.getDate() - (start.getDay() + 6) % 7);
5266
+ if (range === "month") start.setDate(1);
5267
+ if (range === "year") {
5268
+ start.setMonth(0);
5269
+ start.setDate(1);
5270
+ }
5271
+ return { receivedFrom: localDate(start), receivedTo: localDate(now) };
5272
+ }
5273
+ var money5 = (value) => new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" }).format(value);
5274
+ var dateLabel = (value) => value ? value.slice(0, 10) : "\u2014";
5275
+ var paymentReviewRowKey = (item) => JSON.stringify([item.billId, item.id]);
5276
+ function paymentReviewCsv(items) {
5277
+ const escape = (value) => {
5278
+ let text = value == null ? "" : String(value);
5279
+ if (/^[\s]*[=+@-]/.test(text) || /^[\t\r\n]/.test(text)) text = `'${text}`;
5280
+ return `"${text.replaceAll('"', '""')}"`;
5281
+ };
5282
+ return [["Patient", "Bill", "Claim", "Date of service", "Received", "Posted", "Status", "Method", "Source", "Check / trace", "Amount"], ...items.map((item) => [item.patientName, item.billNumber, item.claimNumber, item.dateOfService, item.receivedDate, item.postedDate, "Received", item.method, item.source, item.checkNumber, item.amount])].map((row) => row.map(escape).join(",")).join("\r\n");
5283
+ }
5284
+ var css10 = `.mbpr{font:14px/1.5 var(--mb-font);color:var(--mb-text);min-width:0}.mbpr *{box-sizing:border-box}.mbpr h2,.mbpr p{margin:0}.mbpr h2{font-size:21px}.mbpr-head,.mbpr-actions,.mbpr-toolbar,.mbpr-pager{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.mbpr-head,.mbpr-pager{justify-content:space-between}.mbpr small,.mbpr-sub{color:var(--mb-muted)}.mbpr small{display:block;font-size:12px}.mbpr-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:18px 0}.mbpr-metric,.mbpr-card{background:var(--mb-surface);border:1px solid var(--mb-border);border-radius:var(--mb-radius)}.mbpr-metric{padding:16px}.mbpr-metric strong{display:block;font-size:24px;line-height:1.4;font-variant-numeric:tabular-nums}.mbpr-card{overflow:hidden}.mbpr-controls{padding:14px;display:grid;gap:12px}.mbpr label{display:grid;gap:4px;font-size:12px}.mbpr input,.mbpr button{font:inherit;color:var(--mb-text);background:var(--mb-input);border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);padding:8px 10px;min-height:38px}.mbpr button{cursor:pointer;white-space:nowrap}.mbpr button:disabled{opacity:.55;cursor:default}.mbpr button.active,.mbpr button.primary{background:var(--mb-accent);border-color:var(--mb-accent);color:var(--mb-accent-contrast)}.mbpr button:focus-visible,.mbpr input:focus-visible{outline:2px solid var(--mb-accent);outline-offset:2px}.mbpr-search{flex:1;min-width:210px}.mbpr-scroll{overflow:auto}.mbpr table{width:100%;min-width:900px;border-collapse:collapse}.mbpr th,.mbpr td{padding:11px 13px;text-align:left;border-top:1px solid var(--mb-border)}.mbpr th{background:var(--mb-soft);color:var(--mb-muted);font-size:12px;font-weight:600}.mbpr .mbpr-money{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}.mbpr .mbpr-link{color:var(--mb-accent);border:0;background:none;padding:0;min-height:30px}.mbpr-status{display:inline-block;background:color-mix(in srgb,var(--mb-success) 10%,var(--mb-surface));color:var(--mb-success);border-radius:var(--mb-control-radius);padding:2px 7px;font-size:12px}.mbpr-state{padding:30px;text-align:center;color:var(--mb-muted)}.mbpr-error{color:var(--mb-danger)}.mbpr-pager{padding:12px;border-top:1px solid var(--mb-border);color:var(--mb-muted);font-size:12px}@media(max-width:640px){.mbpr-metrics{gap:8px}.mbpr-metric{padding:10px}.mbpr-metric strong{font-size:20px}.mbpr-head{align-items:flex-start}.mbpr-toolbar label{flex:1}.mbpr-search{min-width:100%}.mbpr input{width:100%;min-width:0}}`;
5285
+ function ConnectedPaymentReview({ initialQuery, onSelectBill, onPostPayment, appearance, className = "", style, ...options }) {
5286
+ const client = useMemo7(() => createBillingOperationsClient(options), [options.apiBaseUrl, options.fetch, options.getSession, options.sessionEndpoint]);
5287
+ const [query, setQuery] = useState11(() => ({ ...paymentReviewDateRange("month"), page: 1, pageSize: 25, ...initialQuery }));
5288
+ const [range, setRange] = useState11(initialQuery?.receivedFrom || initialQuery?.receivedTo ? null : "month");
5289
+ const [search, setSearch] = useState11(initialQuery?.q ?? "");
5290
+ const [result, setResult] = useState11(null);
5291
+ const [loading, setLoading] = useState11(true);
5292
+ const [error, setError] = useState11(false);
5293
+ const [retry, setRetry] = useState11(0);
5294
+ const invalidRange = Boolean(query.receivedFrom && query.receivedTo && query.receivedFrom > query.receivedTo);
5295
+ useEffect9(() => {
5296
+ const controller = new AbortController();
5297
+ setResult(null);
5298
+ setError(false);
5299
+ if (invalidRange) {
5300
+ setLoading(false);
5301
+ return () => controller.abort();
5302
+ }
5303
+ setLoading(true);
5304
+ client.getPaymentReview(query, controller.signal).then((next) => {
5305
+ if (!controller.signal.aborted) setResult(next);
5306
+ }).catch(() => {
5307
+ if (!controller.signal.aborted) setError(true);
5308
+ }).finally(() => {
5309
+ if (!controller.signal.aborted) setLoading(false);
5310
+ });
5311
+ return () => controller.abort();
5312
+ }, [client, query, retry, invalidRange]);
5313
+ const update = (patch) => setQuery((current) => ({ ...current, ...patch, page: 1 }));
5314
+ const exportPage = () => {
5315
+ if (!result?.items.length || loading) return;
5316
+ const url = URL.createObjectURL(new Blob([paymentReviewCsv(result.items)], { type: "text/csv;charset=utf-8" }));
5317
+ const anchor = document.createElement("a");
5318
+ anchor.href = url;
5319
+ anchor.download = "payment-review-page.csv";
5320
+ anchor.click();
5321
+ URL.revokeObjectURL(url);
5322
+ };
5323
+ return /* @__PURE__ */ jsxs15("section", { className: `mbpr ${className}`.trim(), style: { ...mindBillAppearanceStyle(appearance), ...style }, "aria-label": "Payment review", children: [
5324
+ /* @__PURE__ */ jsx15("style", { children: css10 + `.mbpr{font-family:var(--mb-font,ui-sans-serif,system-ui,sans-serif)}@media(max-width:640px){.mbpr-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.mbpr-metric:first-child{grid-column:1/-1}.mbpr-metric strong{overflow-wrap:anywhere}}` }),
5325
+ /* @__PURE__ */ jsxs15("div", { className: "mbpr-head", children: [
5326
+ /* @__PURE__ */ jsxs15("div", { children: [
5327
+ /* @__PURE__ */ jsx15("h2", { children: "Payment review" }),
5328
+ /* @__PURE__ */ jsx15("p", { className: "mbpr-sub", children: "Review confirmed payments, check details, and cash totals." })
5329
+ ] }),
5330
+ /* @__PURE__ */ jsxs15("div", { className: "mbpr-actions", children: [
5331
+ /* @__PURE__ */ jsx15("button", { type: "button", disabled: !result?.items.length || loading, onClick: exportPage, children: "Export page" }),
5332
+ onPostPayment ? /* @__PURE__ */ jsx15("button", { className: "primary", type: "button", onClick: onPostPayment, children: "+ Post payment" }) : null
5333
+ ] })
5334
+ ] }),
5335
+ /* @__PURE__ */ jsx15("small", { children: "Pending EOR and 835 amounts are excluded until funds are confirmed. Historical legacy payments are also excluded." }),
5336
+ /* @__PURE__ */ jsx15("div", { className: "mbpr-metrics", children: [["Posted total", result ? money5(result.summary.postedTotal) : "\u2014"], ["Payment entries", result?.summary.entryCount ?? "\u2014"], ["Unique patients", result?.summary.uniquePatients ?? "\u2014"]].map(([label, value]) => /* @__PURE__ */ jsxs15("div", { className: "mbpr-metric", children: [
5337
+ /* @__PURE__ */ jsx15("small", { children: label }),
5338
+ /* @__PURE__ */ jsx15("strong", { children: value })
5339
+ ] }, label)) }),
5340
+ /* @__PURE__ */ jsxs15("div", { className: "mbpr-card", children: [
5341
+ /* @__PURE__ */ jsxs15("div", { className: "mbpr-controls", children: [
5342
+ /* @__PURE__ */ jsx15("div", { className: "mbpr-toolbar", "aria-label": "Quick range", children: [["today", "Today"], ["week", "This week"], ["month", "This month"], ["year", "This year"], ["all", "All dates"]].map(([id, label]) => /* @__PURE__ */ jsx15("button", { type: "button", className: range === id ? "active" : "", "aria-pressed": range === id, onClick: () => {
5343
+ setRange(id);
5344
+ setQuery((current) => {
5345
+ const next = { ...current };
5346
+ delete next.receivedFrom;
5347
+ delete next.receivedTo;
5348
+ return { ...next, ...paymentReviewDateRange(id), page: 1 };
5349
+ });
5350
+ }, children: label }, id)) }),
5351
+ /* @__PURE__ */ jsxs15("form", { className: "mbpr-toolbar", onSubmit: (event) => {
5352
+ event.preventDefault();
5353
+ update({ q: search });
5354
+ }, children: [
5355
+ /* @__PURE__ */ jsxs15("label", { className: "mbpr-search", children: [
5356
+ "Search",
5357
+ /* @__PURE__ */ jsx15("input", { type: "search", placeholder: "Patient, bill, claim, payer, or check\u2026", value: search, onChange: (event) => setSearch(event.target.value) })
5358
+ ] }),
5359
+ /* @__PURE__ */ jsx15("button", { type: "submit", children: "Search" }),
5360
+ /* @__PURE__ */ jsxs15("label", { children: [
5361
+ "Received from",
5362
+ /* @__PURE__ */ jsx15("input", { type: "date", value: query.receivedFrom ?? "", onChange: (event) => {
5363
+ setRange(null);
5364
+ update({ receivedFrom: event.target.value });
5365
+ } })
5366
+ ] }),
5367
+ /* @__PURE__ */ jsxs15("label", { children: [
5368
+ "Received through",
5369
+ /* @__PURE__ */ jsx15("input", { type: "date", value: query.receivedTo ?? "", onChange: (event) => {
5370
+ setRange(null);
5371
+ update({ receivedTo: event.target.value });
5372
+ } })
5373
+ ] })
5374
+ ] })
5375
+ ] }),
5376
+ invalidRange ? /* @__PURE__ */ jsx15("p", { className: "mbpr-state mbpr-error", role: "alert", children: "The received-through date must be on or after the received-from date." }) : loading ? /* @__PURE__ */ jsx15("p", { className: "mbpr-state", role: "status", children: "Loading payments\u2026" }) : error ? /* @__PURE__ */ jsxs15("div", { className: "mbpr-state mbpr-error", role: "alert", children: [
5377
+ "Payments could not be loaded. ",
5378
+ /* @__PURE__ */ jsx15("button", { type: "button", onClick: () => setRetry((value) => value + 1), children: "Retry" })
5379
+ ] }) : !result?.items.length ? /* @__PURE__ */ jsx15("p", { className: "mbpr-state", children: "No confirmed payments match these filters." }) : /* @__PURE__ */ jsx15("div", { className: "mbpr-scroll", tabIndex: 0, role: "region", "aria-label": "Payment entries", children: /* @__PURE__ */ jsxs15("table", { children: [
5380
+ /* @__PURE__ */ jsx15("thead", { children: /* @__PURE__ */ jsx15("tr", { children: ["Patient", "Bill / DOS", "Received", "Posted", "Status", "Method / source", "Check / trace", "Amount"].map((label) => /* @__PURE__ */ jsx15("th", { scope: "col", className: label === "Amount" ? "mbpr-money" : "", children: label }, label)) }) }),
5381
+ /* @__PURE__ */ jsx15("tbody", { children: result.items.map((item) => /* @__PURE__ */ jsxs15("tr", { children: [
5382
+ /* @__PURE__ */ jsxs15("td", { children: [
5383
+ item.patientName,
5384
+ /* @__PURE__ */ jsx15("small", { children: item.claimNumber })
5385
+ ] }),
5386
+ /* @__PURE__ */ jsxs15("td", { children: [
5387
+ onSelectBill ? /* @__PURE__ */ jsx15("button", { type: "button", className: "mbpr-link", onClick: () => onSelectBill(item.billId), children: item.billNumber == null ? "View bill" : `Bill #${item.billNumber}` }) : item.billNumber == null ? "\u2014" : `Bill #${item.billNumber}`,
5388
+ /* @__PURE__ */ jsxs15("small", { children: [
5389
+ "DOS ",
5390
+ dateLabel(item.dateOfService)
5391
+ ] })
5392
+ ] }),
5393
+ /* @__PURE__ */ jsx15("td", { children: dateLabel(item.receivedDate) }),
5394
+ /* @__PURE__ */ jsx15("td", { children: dateLabel(item.postedDate) }),
5395
+ /* @__PURE__ */ jsx15("td", { children: /* @__PURE__ */ jsx15("span", { className: "mbpr-status", children: "Received" }) }),
5396
+ /* @__PURE__ */ jsxs15("td", { children: [
5397
+ item.method || "\u2014",
5398
+ /* @__PURE__ */ jsx15("small", { children: item.source })
5399
+ ] }),
5400
+ /* @__PURE__ */ jsx15("td", { children: item.checkNumber || "\u2014" }),
5401
+ /* @__PURE__ */ jsx15("td", { className: "mbpr-money", children: money5(item.amount) })
5402
+ ] }, paymentReviewRowKey(item))) })
5403
+ ] }) }),
5404
+ result ? /* @__PURE__ */ jsxs15("div", { className: "mbpr-pager", children: [
5405
+ /* @__PURE__ */ jsxs15("span", { children: [
5406
+ result.total,
5407
+ " entries \xB7 Page ",
5408
+ result.page,
5409
+ " of ",
5410
+ Math.max(1, Math.ceil(result.total / result.pageSize))
5411
+ ] }),
5412
+ /* @__PURE__ */ jsxs15("div", { className: "mbpr-actions", children: [
5413
+ /* @__PURE__ */ jsx15("button", { type: "button", disabled: result.page <= 1, onClick: () => setQuery((current) => ({ ...current, page: Math.max(1, result.page - 1) })), children: "Previous" }),
5414
+ /* @__PURE__ */ jsx15("button", { type: "button", disabled: result.page * result.pageSize >= result.total, onClick: () => setQuery((current) => ({ ...current, page: result.page + 1 })), children: "Next" })
5415
+ ] })
5416
+ ] }) : null
5417
+ ] })
5418
+ ] });
5419
+ }
5420
+
5031
5421
  // src/notification-settings.tsx
5032
- import { useEffect as useEffect9, useId as useId3, useRef as useRef5, useState as useState10 } from "react";
5033
- import { Fragment as Fragment11, jsx as jsx14, jsxs as jsxs14 } from "react/jsx-runtime";
5422
+ import { useEffect as useEffect10, useId as useId3, useRef as useRef5, useState as useState12 } from "react";
5423
+ import { Fragment as Fragment11, jsx as jsx16, jsxs as jsxs16 } from "react/jsx-runtime";
5034
5424
  function defaultNotificationPreferences() {
5035
5425
  return { enabled: false, statusUpdates: false, agingDays: [], quietHours: true };
5036
5426
  }
@@ -5048,7 +5438,7 @@ function notificationSettingsNeedsConsent(previous, next) {
5048
5438
  if (!previous?.enabled || previous.statusUpdates !== next.statusUpdates || previous.quietHours !== next.quietHours) return true;
5049
5439
  return JSON.stringify(notificationSettingsUpdate(previous, false).agingDays) !== JSON.stringify(notificationSettingsUpdate(next, false).agingDays);
5050
5440
  }
5051
- var css10 = `
5441
+ var css11 = `
5052
5442
  .mbns{color:var(--mb-text);font-family:var(--mb-font);font-size:14px;line-height:1.5;min-width:0}.mbns *{box-sizing:border-box}.mbns h2,.mbns p{margin:0}.mbns-card{padding:24px;background:var(--mb-surface);border:1px solid var(--mb-border);border-radius:var(--mb-radius);box-shadow:var(--mb-shadow)}
5053
5443
  .mbns-header{display:flex;gap:16px;align-items:flex-start;justify-content:space-between;margin-bottom:24px}.mbns h2{font-size:20px;line-height:1.3;font-weight:700}.mbns-muted{color:var(--mb-muted)}.mbns-header p{margin-top:6px;max-width:56ch}.mbns-badge{flex-shrink:0;background:var(--mb-soft);color:var(--mb-muted);padding:4px 9px;border-radius:var(--mb-control-radius);font-size:12px;font-weight:650}
5054
5444
  .mbns-account{padding:14px 16px;background:var(--mb-soft);border-radius:var(--mb-control-radius);margin-bottom:20px;overflow-wrap:anywhere}.mbns-account strong{display:block;font-weight:650}.mbns-account p{margin-top:3px;font-size:13px}
@@ -5056,20 +5446,20 @@ var css10 = `
5056
5446
  .mbns button{font:inherit;min-height:44px;padding:10px 16px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);background:var(--mb-surface);color:var(--mb-text);font-weight:650;cursor:pointer}.mbns button.mbns-save{background:var(--mb-accent);border-color:var(--mb-accent);color:var(--mb-accent-contrast)}.mbns button:disabled{opacity:.5;cursor:not-allowed}.mbns input:focus-visible,.mbns button:focus-visible{outline:2px solid var(--mb-accent);outline-offset:3px}.mbns-notice{margin-top:16px!important;color:var(--mb-muted)}.mbns-error{color:var(--mb-danger)}.mbns :disabled+span{opacity:.6}@media(max-width:540px){.mbns-card{padding:18px}.mbns-header{gap:8px}.mbns-actions button{flex:1 1 auto}.mbns-days{gap:4px 18px}}
5057
5447
  `;
5058
5448
  function NotificationSettings(props) {
5059
- return /* @__PURE__ */ jsx14(NotificationSettingsSession, { ...props }, props.identityKey);
5449
+ return /* @__PURE__ */ jsx16(NotificationSettingsSession, { ...props }, props.identityKey);
5060
5450
  }
5061
5451
  var ConnectedNotificationSettings = NotificationSettings;
5062
5452
  function NotificationSettingsSession({ adapter, appearance, className, style, onSaved }) {
5063
5453
  const titleId = useId3();
5064
- const [snapshot, setSnapshot] = useState10(null);
5065
- const [draft, setDraft] = useState10(defaultNotificationPreferences);
5066
- const [consent, setConsent] = useState10(false);
5067
- const [phase, setPhase] = useState10("loading");
5068
- const [notice, setNotice] = useState10("");
5069
- const [failed, setFailed] = useState10(false);
5070
- const [reload, setReload] = useState10(0);
5454
+ const [snapshot, setSnapshot] = useState12(null);
5455
+ const [draft, setDraft] = useState12(defaultNotificationPreferences);
5456
+ const [consent, setConsent] = useState12(false);
5457
+ const [phase, setPhase] = useState12("loading");
5458
+ const [notice, setNotice] = useState12("");
5459
+ const [failed, setFailed] = useState12(false);
5460
+ const [reload, setReload] = useState12(0);
5071
5461
  const request = useRef5(0);
5072
- useEffect9(() => {
5462
+ useEffect10(() => {
5073
5463
  const current = ++request.current;
5074
5464
  setPhase("loading");
5075
5465
  setSnapshot(null);
@@ -5127,76 +5517,76 @@ function NotificationSettingsSession({ adapter, appearance, className, style, on
5127
5517
  setNotice("We couldn't confirm your changes. Retry, or reload settings to check their current state.");
5128
5518
  }
5129
5519
  };
5130
- return /* @__PURE__ */ jsxs14("section", { className: `mbns ${className ?? ""}`, style: { ...mindBillAppearanceStyle(appearance), ...style }, "aria-labelledby": titleId, "aria-busy": phase === "loading" || phase === "saving", children: [
5131
- /* @__PURE__ */ jsx14("style", { children: css10 }),
5132
- /* @__PURE__ */ jsxs14("div", { className: "mbns-card", children: [
5133
- /* @__PURE__ */ jsxs14("header", { className: "mbns-header", children: [
5134
- /* @__PURE__ */ jsxs14("div", { children: [
5135
- /* @__PURE__ */ jsx14("h2", { id: titleId, children: "Email notifications" }),
5136
- /* @__PURE__ */ jsx14("p", { className: "mbns-muted", children: "Choose which billing updates reach your inbox. Notifications are off until you opt in." })
5520
+ return /* @__PURE__ */ jsxs16("section", { className: `mbns ${className ?? ""}`, style: { ...mindBillAppearanceStyle(appearance), ...style }, "aria-labelledby": titleId, "aria-busy": phase === "loading" || phase === "saving", children: [
5521
+ /* @__PURE__ */ jsx16("style", { children: css11 }),
5522
+ /* @__PURE__ */ jsxs16("div", { className: "mbns-card", children: [
5523
+ /* @__PURE__ */ jsxs16("header", { className: "mbns-header", children: [
5524
+ /* @__PURE__ */ jsxs16("div", { children: [
5525
+ /* @__PURE__ */ jsx16("h2", { id: titleId, children: "Email notifications" }),
5526
+ /* @__PURE__ */ jsx16("p", { className: "mbns-muted", children: "Choose which billing updates reach your inbox. Notifications are off until you opt in." })
5137
5527
  ] }),
5138
- /* @__PURE__ */ jsx14("span", { className: "mbns-badge", children: !snapshot ? "\u2014" : snapshot.preferences?.enabled ? "On" : "Off" })
5528
+ /* @__PURE__ */ jsx16("span", { className: "mbns-badge", children: !snapshot ? "\u2014" : snapshot.preferences?.enabled ? "On" : "Off" })
5139
5529
  ] }),
5140
- phase === "loading" ? /* @__PURE__ */ jsx14("p", { role: "status", className: "mbns-muted", children: "Loading notification preferences\u2026" }) : phase === "error" ? /* @__PURE__ */ jsxs14("div", { children: [
5141
- /* @__PURE__ */ jsx14("p", { role: "alert", className: "mbns-error", children: "We couldn't load your preferences. No settings have been changed." }),
5142
- /* @__PURE__ */ jsx14("div", { className: "mbns-actions", children: /* @__PURE__ */ jsx14("button", { type: "button", onClick: () => setReload((value) => value + 1), children: "Retry loading" }) })
5143
- ] }) : snapshot ? /* @__PURE__ */ jsxs14(Fragment11, { children: [
5144
- /* @__PURE__ */ jsxs14("div", { className: "mbns-account", children: [
5145
- /* @__PURE__ */ jsx14("strong", { children: snapshot.email || "No verified email address" }),
5146
- /* @__PURE__ */ jsxs14("p", { className: "mbns-muted", children: [
5530
+ phase === "loading" ? /* @__PURE__ */ jsx16("p", { role: "status", className: "mbns-muted", children: "Loading notification preferences\u2026" }) : phase === "error" ? /* @__PURE__ */ jsxs16("div", { children: [
5531
+ /* @__PURE__ */ jsx16("p", { role: "alert", className: "mbns-error", children: "We couldn't load your preferences. No settings have been changed." }),
5532
+ /* @__PURE__ */ jsx16("div", { className: "mbns-actions", children: /* @__PURE__ */ jsx16("button", { type: "button", onClick: () => setReload((value) => value + 1), children: "Retry loading" }) })
5533
+ ] }) : snapshot ? /* @__PURE__ */ jsxs16(Fragment11, { children: [
5534
+ /* @__PURE__ */ jsxs16("div", { className: "mbns-account", children: [
5535
+ /* @__PURE__ */ jsx16("strong", { children: snapshot.email || "No verified email address" }),
5536
+ /* @__PURE__ */ jsxs16("p", { className: "mbns-muted", children: [
5147
5537
  snapshot.audience === "practice" ? "Updates for this practice's bills" : "Updates only for bills assigned to you",
5148
5538
  ". Your application manages this address and access."
5149
5539
  ] })
5150
5540
  ] }),
5151
- snapshot.environment === "sandbox" && /* @__PURE__ */ jsx14("p", { className: "mbns-notice", children: "Sandbox preview only. No notification emails will be sent." }),
5152
- !snapshot.canEnable && /* @__PURE__ */ jsx14("p", { className: "mbns-notice", children: "Notifications aren't available for this account yet. Ask your administrator to confirm email verification, billing access and notification availability. You can still turn existing notifications off." }),
5153
- /* @__PURE__ */ jsxs14("label", { className: "mbns-check", children: [
5154
- /* @__PURE__ */ jsx14("input", { type: "checkbox", checked: draft.enabled, disabled: busy || !snapshot.canEnable && !draft.enabled, onChange: (event) => update({ enabled: event.target.checked }) }),
5155
- /* @__PURE__ */ jsxs14("span", { children: [
5156
- /* @__PURE__ */ jsx14("strong", { children: "Send me billing updates" }),
5157
- /* @__PURE__ */ jsx14("small", { children: "Emails contain a general alert, not patient details or attachments." })
5541
+ snapshot.environment === "sandbox" && /* @__PURE__ */ jsx16("p", { className: "mbns-notice", children: "Sandbox preview only. No notification emails will be sent." }),
5542
+ !snapshot.canEnable && /* @__PURE__ */ jsx16("p", { className: "mbns-notice", children: "Notifications aren't available for this account yet. Ask your administrator to confirm email verification, billing access and notification availability. You can still turn existing notifications off." }),
5543
+ /* @__PURE__ */ jsxs16("label", { className: "mbns-check", children: [
5544
+ /* @__PURE__ */ jsx16("input", { type: "checkbox", checked: draft.enabled, disabled: busy || !snapshot.canEnable && !draft.enabled, onChange: (event) => update({ enabled: event.target.checked }) }),
5545
+ /* @__PURE__ */ jsxs16("span", { children: [
5546
+ /* @__PURE__ */ jsx16("strong", { children: "Send me billing updates" }),
5547
+ /* @__PURE__ */ jsx16("small", { children: "Emails contain a general alert, not patient details or attachments." })
5158
5548
  ] })
5159
5549
  ] }),
5160
- /* @__PURE__ */ jsxs14("fieldset", { disabled: busy || !draft.enabled || !snapshot.canEnable, children: [
5161
- /* @__PURE__ */ jsx14("legend", { children: "Updates to receive" }),
5162
- /* @__PURE__ */ jsxs14("label", { className: "mbns-check", children: [
5163
- /* @__PURE__ */ jsx14("input", { type: "checkbox", checked: draft.statusUpdates, onChange: (event) => update({ statusUpdates: event.target.checked }) }),
5164
- /* @__PURE__ */ jsxs14("span", { children: [
5165
- /* @__PURE__ */ jsx14("strong", { children: "Bill status changes" }),
5166
- /* @__PURE__ */ jsx14("small", { children: "Follow accepted, rejected, processed and payment updates." })
5550
+ /* @__PURE__ */ jsxs16("fieldset", { disabled: busy || !draft.enabled || !snapshot.canEnable, children: [
5551
+ /* @__PURE__ */ jsx16("legend", { children: "Updates to receive" }),
5552
+ /* @__PURE__ */ jsxs16("label", { className: "mbns-check", children: [
5553
+ /* @__PURE__ */ jsx16("input", { type: "checkbox", checked: draft.statusUpdates, onChange: (event) => update({ statusUpdates: event.target.checked }) }),
5554
+ /* @__PURE__ */ jsxs16("span", { children: [
5555
+ /* @__PURE__ */ jsx16("strong", { children: "Bill status changes" }),
5556
+ /* @__PURE__ */ jsx16("small", { children: "Follow accepted, rejected, processed and payment updates." })
5167
5557
  ] })
5168
5558
  ] }),
5169
- /* @__PURE__ */ jsx14("p", { className: "mbns-muted", children: "Remind me when a bill is still waiting for a payer:" }),
5170
- /* @__PURE__ */ jsx14("div", { className: "mbns-days", children: [30, 60, 90].map((day) => /* @__PURE__ */ jsxs14("label", { className: "mbns-check", children: [
5171
- /* @__PURE__ */ jsx14("input", { type: "checkbox", checked: draft.agingDays.includes(day), onChange: (event) => update({ agingDays: event.target.checked ? [...draft.agingDays, day] : draft.agingDays.filter((value) => value !== day) }) }),
5172
- /* @__PURE__ */ jsxs14("span", { children: [
5559
+ /* @__PURE__ */ jsx16("p", { className: "mbns-muted", children: "Remind me when a bill is still waiting for a payer:" }),
5560
+ /* @__PURE__ */ jsx16("div", { className: "mbns-days", children: [30, 60, 90].map((day) => /* @__PURE__ */ jsxs16("label", { className: "mbns-check", children: [
5561
+ /* @__PURE__ */ jsx16("input", { type: "checkbox", checked: draft.agingDays.includes(day), onChange: (event) => update({ agingDays: event.target.checked ? [...draft.agingDays, day] : draft.agingDays.filter((value) => value !== day) }) }),
5562
+ /* @__PURE__ */ jsxs16("span", { children: [
5173
5563
  day,
5174
5564
  " days"
5175
5565
  ] })
5176
5566
  ] }, day)) }),
5177
- /* @__PURE__ */ jsxs14("label", { className: "mbns-check", children: [
5178
- /* @__PURE__ */ jsx14("input", { type: "checkbox", checked: draft.quietHours, onChange: (event) => update({ quietHours: event.target.checked }) }),
5179
- /* @__PURE__ */ jsxs14("span", { children: [
5180
- /* @__PURE__ */ jsx14("strong", { children: "Quiet hours" }),
5181
- /* @__PURE__ */ jsx14("small", { children: "Hold emails from 7 pm to 7 am Pacific time." })
5567
+ /* @__PURE__ */ jsxs16("label", { className: "mbns-check", children: [
5568
+ /* @__PURE__ */ jsx16("input", { type: "checkbox", checked: draft.quietHours, onChange: (event) => update({ quietHours: event.target.checked }) }),
5569
+ /* @__PURE__ */ jsxs16("span", { children: [
5570
+ /* @__PURE__ */ jsx16("strong", { children: "Quiet hours" }),
5571
+ /* @__PURE__ */ jsx16("small", { children: "Hold emails from 7 pm to 7 am Pacific time." })
5182
5572
  ] })
5183
5573
  ] })
5184
5574
  ] }),
5185
- draft.enabled && !hasCategory && /* @__PURE__ */ jsx14("p", { className: "mbns-notice", children: "Select at least one update type to enable notifications." }),
5186
- needsConsent && /* @__PURE__ */ jsxs14("label", { className: "mbns-check mbns-consent", children: [
5187
- /* @__PURE__ */ jsx14("input", { type: "checkbox", checked: consent, disabled: busy || !snapshot.canEnable, onChange: (event) => setConsent(event.target.checked) }),
5188
- /* @__PURE__ */ jsxs14("span", { children: [
5575
+ draft.enabled && !hasCategory && /* @__PURE__ */ jsx16("p", { className: "mbns-notice", children: "Select at least one update type to enable notifications." }),
5576
+ needsConsent && /* @__PURE__ */ jsxs16("label", { className: "mbns-check mbns-consent", children: [
5577
+ /* @__PURE__ */ jsx16("input", { type: "checkbox", checked: consent, disabled: busy || !snapshot.canEnable, onChange: (event) => setConsent(event.target.checked) }),
5578
+ /* @__PURE__ */ jsxs16("span", { children: [
5189
5579
  "I agree to receive the selected billing emails ",
5190
5580
  snapshot.audience === "practice" ? "for this practice" : "for bills assigned to me",
5191
5581
  " at the address above. I can unsubscribe at any time."
5192
5582
  ] })
5193
5583
  ] }),
5194
- /* @__PURE__ */ jsxs14("div", { className: "mbns-actions", children: [
5195
- /* @__PURE__ */ jsx14("button", { type: "button", className: "mbns-save", disabled: !canSave, onClick: () => void save(false), children: phase === "saving" ? "Saving\u2026" : "Save preferences" }),
5196
- snapshot.preferences?.enabled && /* @__PURE__ */ jsx14("button", { type: "button", disabled: busy, onClick: () => void save(true), children: "Unsubscribe from all" }),
5197
- failed && /* @__PURE__ */ jsx14("button", { type: "button", disabled: busy, onClick: () => setReload((value) => value + 1), children: "Reload settings" })
5584
+ /* @__PURE__ */ jsxs16("div", { className: "mbns-actions", children: [
5585
+ /* @__PURE__ */ jsx16("button", { type: "button", className: "mbns-save", disabled: !canSave, onClick: () => void save(false), children: phase === "saving" ? "Saving\u2026" : "Save preferences" }),
5586
+ snapshot.preferences?.enabled && /* @__PURE__ */ jsx16("button", { type: "button", disabled: busy, onClick: () => void save(true), children: "Unsubscribe from all" }),
5587
+ failed && /* @__PURE__ */ jsx16("button", { type: "button", disabled: busy, onClick: () => setReload((value) => value + 1), children: "Reload settings" })
5198
5588
  ] }),
5199
- notice && /* @__PURE__ */ jsx14("p", { className: `mbns-notice ${failed ? "mbns-error" : ""}`, role: failed ? "alert" : "status", children: notice })
5589
+ notice && /* @__PURE__ */ jsx16("p", { className: `mbns-notice ${failed ? "mbns-error" : ""}`, role: failed ? "alert" : "status", children: notice })
5200
5590
  ] }) : null
5201
5591
  ] })
5202
5592
  ] });
@@ -5205,18 +5595,18 @@ function NotificationSettingsSession({ adapter, appearance, className, style, on
5205
5595
  // src/connected-bill-status.tsx
5206
5596
  import {
5207
5597
  useCallback as useCallback3,
5208
- useEffect as useEffect10,
5209
- useMemo as useMemo7,
5598
+ useEffect as useEffect11,
5599
+ useMemo as useMemo8,
5210
5600
  useRef as useRef6,
5211
- useState as useState11
5601
+ useState as useState13
5212
5602
  } from "react";
5213
5603
  import {
5214
- DEFAULT_API_BASE_URL,
5215
- DEFAULT_SESSION_ENDPOINT
5604
+ DEFAULT_API_BASE_URL as DEFAULT_API_BASE_URL2,
5605
+ DEFAULT_SESSION_ENDPOINT as DEFAULT_SESSION_ENDPOINT2
5216
5606
  } from "@mindbill/browser";
5217
- import { Fragment as Fragment12, jsx as jsx15, jsxs as jsxs15 } from "react/jsx-runtime";
5607
+ import { Fragment as Fragment12, jsx as jsx17, jsxs as jsxs17 } from "react/jsx-runtime";
5218
5608
  var DEFAULT_REFRESH_INTERVAL = 6e4;
5219
- async function responseError(response, fallback) {
5609
+ async function responseError2(response, fallback) {
5220
5610
  const body = await response.json().catch(() => null);
5221
5611
  const detail = body && typeof body === "object" ? body.detail ?? body.error : null;
5222
5612
  return new Error(typeof detail === "string" ? detail : fallback);
@@ -5227,7 +5617,7 @@ function isSessionFresh(session) {
5227
5617
  const expiresAt = new Date(session.expiresAt).getTime();
5228
5618
  return Number.isFinite(expiresAt) && expiresAt > Date.now() + 3e4;
5229
5619
  }
5230
- function normalizeSession(value) {
5620
+ function normalizeSession2(value) {
5231
5621
  if (!value || typeof value !== "object") {
5232
5622
  throw new Error("The MindBill session endpoint returned an invalid response.");
5233
5623
  }
@@ -5268,9 +5658,9 @@ function normalizeStatus(value, billId) {
5268
5658
  }
5269
5659
  function createBillStatusClient({
5270
5660
  billId,
5271
- sessionEndpoint = DEFAULT_SESSION_ENDPOINT,
5661
+ sessionEndpoint = DEFAULT_SESSION_ENDPOINT2,
5272
5662
  getSession,
5273
- apiBaseUrl = DEFAULT_API_BASE_URL,
5663
+ apiBaseUrl = DEFAULT_API_BASE_URL2,
5274
5664
  fetch: fetchOverride
5275
5665
  }) {
5276
5666
  const fetcher = fetchOverride ?? globalThis.fetch;
@@ -5290,14 +5680,14 @@ function createBillStatusClient({
5290
5680
  signal
5291
5681
  }).then(async (response) => {
5292
5682
  if (!response.ok) {
5293
- throw await responseError(
5683
+ throw await responseError2(
5294
5684
  response,
5295
5685
  "MindBill browser session could not be created."
5296
5686
  );
5297
5687
  }
5298
5688
  return response.json();
5299
5689
  });
5300
- const request = Promise.resolve(pending).then(normalizeSession).then((nextSession) => {
5690
+ const request = Promise.resolve(pending).then(normalizeSession2).then((nextSession) => {
5301
5691
  session = nextSession;
5302
5692
  return nextSession;
5303
5693
  }).finally(() => {
@@ -5330,7 +5720,7 @@ function createBillStatusClient({
5330
5720
  response = await requestStatus(browserSession, signal);
5331
5721
  }
5332
5722
  if (!response.ok) {
5333
- throw await responseError(response, "Bill status could not be loaded.");
5723
+ throw await responseError2(response, "Bill status could not be loaded.");
5334
5724
  }
5335
5725
  const body = await response.json();
5336
5726
  return normalizeStatus(body.data, billId);
@@ -5339,31 +5729,31 @@ function createBillStatusClient({
5339
5729
  }
5340
5730
  function useBillStatus({
5341
5731
  billId,
5342
- sessionEndpoint = DEFAULT_SESSION_ENDPOINT,
5732
+ sessionEndpoint = DEFAULT_SESSION_ENDPOINT2,
5343
5733
  getSession,
5344
- apiBaseUrl = DEFAULT_API_BASE_URL,
5734
+ apiBaseUrl = DEFAULT_API_BASE_URL2,
5345
5735
  refreshInterval = DEFAULT_REFRESH_INTERVAL,
5346
5736
  enabled = true,
5347
5737
  initialData = null,
5348
5738
  fetch: fetchOverride
5349
5739
  }) {
5350
- const client = useMemo7(() => createBillStatusClient({
5740
+ const client = useMemo8(() => createBillStatusClient({
5351
5741
  billId,
5352
5742
  sessionEndpoint,
5353
5743
  ...getSession ? { getSession } : {},
5354
5744
  apiBaseUrl,
5355
5745
  ...fetchOverride ? { fetch: fetchOverride } : {}
5356
5746
  }), [apiBaseUrl, billId, fetchOverride, getSession, sessionEndpoint]);
5357
- const [data, setData] = useState11(initialData);
5358
- const [error, setError] = useState11(null);
5359
- const [isLoading, setIsLoading] = useState11(enabled && !initialData);
5360
- const [isRefreshing, setIsRefreshing] = useState11(false);
5747
+ const [data, setData] = useState13(initialData);
5748
+ const [error, setError] = useState13(null);
5749
+ const [isLoading, setIsLoading] = useState13(enabled && !initialData);
5750
+ const [isRefreshing, setIsRefreshing] = useState13(false);
5361
5751
  const dataRef = useRef6(initialData);
5362
5752
  const initialDataRef = useRef6(initialData);
5363
5753
  initialDataRef.current = initialData;
5364
5754
  const activeControllerRef = useRef6(null);
5365
5755
  const requestSequence = useRef6(0);
5366
- useEffect10(() => {
5756
+ useEffect11(() => {
5367
5757
  const seed = initialDataRef.current;
5368
5758
  dataRef.current = seed;
5369
5759
  setData(seed);
@@ -5404,10 +5794,10 @@ function useBillStatus({
5404
5794
  }
5405
5795
  }
5406
5796
  }, [billId, client, enabled]);
5407
- useEffect10(() => {
5797
+ useEffect11(() => {
5408
5798
  if (enabled) void load();
5409
5799
  }, [enabled, load]);
5410
- useEffect10(() => {
5800
+ useEffect11(() => {
5411
5801
  if (!enabled || refreshInterval <= 0) return;
5412
5802
  const timer = window.setInterval(() => void load(), refreshInterval);
5413
5803
  const onFocus = () => void load();
@@ -5435,17 +5825,17 @@ function ConnectedBillStatus({
5435
5825
  }) {
5436
5826
  const status = useBillStatus(options);
5437
5827
  if (status.isLoading && !status.data) {
5438
- return /* @__PURE__ */ jsx15(Fragment12, { children: loadingFallback ?? /* @__PURE__ */ jsx15("div", { role: "status", children: "Loading bill status\u2026" }) });
5828
+ return /* @__PURE__ */ jsx17(Fragment12, { children: loadingFallback ?? /* @__PURE__ */ jsx17("div", { role: "status", children: "Loading bill status\u2026" }) });
5439
5829
  }
5440
5830
  if (status.error && !status.data) {
5441
- return /* @__PURE__ */ jsx15(Fragment12, { children: errorFallback?.(status.error, status.refresh) ?? /* @__PURE__ */ jsxs15("div", { role: "alert", children: [
5831
+ return /* @__PURE__ */ jsx17(Fragment12, { children: errorFallback?.(status.error, status.refresh) ?? /* @__PURE__ */ jsxs17("div", { role: "alert", children: [
5442
5832
  status.error.message,
5443
5833
  " ",
5444
- /* @__PURE__ */ jsx15("button", { type: "button", onClick: () => void status.refresh(), children: "Retry" })
5834
+ /* @__PURE__ */ jsx17("button", { type: "button", onClick: () => void status.refresh(), children: "Retry" })
5445
5835
  ] }) });
5446
5836
  }
5447
5837
  if (!status.data) return null;
5448
- return /* @__PURE__ */ jsx15(
5838
+ return /* @__PURE__ */ jsx17(
5449
5839
  BillStatusSummary,
5450
5840
  {
5451
5841
  status: status.data.state,
@@ -5464,8 +5854,8 @@ function ConnectedBillStatus({
5464
5854
  }
5465
5855
 
5466
5856
  // src/bill-lifecycle-surfaces.tsx
5467
- import { useEffect as useEffect11, useRef as useRef7, useState as useState12 } from "react";
5468
- import { Fragment as Fragment13, jsx as jsx16, jsxs as jsxs16 } from "react/jsx-runtime";
5857
+ import { useEffect as useEffect12, useRef as useRef7, useState as useState14 } from "react";
5858
+ import { Fragment as Fragment13, jsx as jsx18, jsxs as jsxs18 } from "react/jsx-runtime";
5469
5859
  function visibleBillLifecycleActions(actions, showUnavailable = false) {
5470
5860
  return actions.filter((action) => action.enabled || showUnavailable);
5471
5861
  }
@@ -5480,11 +5870,11 @@ function BillLifecycleActions({
5480
5870
  }) {
5481
5871
  const visible = visibleBillLifecycleActions(actions, showUnavailable);
5482
5872
  if (!visible.length) return null;
5483
- return /* @__PURE__ */ jsxs16("div", { className: classes("mb-lifecycle-actions", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill actions", children: [
5484
- /* @__PURE__ */ jsx16("style", { children: lifecycleSurfaceStyles }),
5485
- visible.map((action) => /* @__PURE__ */ jsxs16("div", { className: "mb-lifecycle-action", children: [
5486
- /* @__PURE__ */ jsx16("button", { type: "button", className: action.primary ? "mb-action-button is-primary" : "mb-action-button", disabled: disabled || !action.enabled, onClick: () => onAction(action), children: action.label }),
5487
- !action.enabled && action.reason ? /* @__PURE__ */ jsx16("span", { className: "mb-action-reason", children: action.reason }) : null
5873
+ return /* @__PURE__ */ jsxs18("div", { className: classes("mb-lifecycle-actions", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill actions", children: [
5874
+ /* @__PURE__ */ jsx18("style", { children: lifecycleSurfaceStyles }),
5875
+ visible.map((action) => /* @__PURE__ */ jsxs18("div", { className: "mb-lifecycle-action", children: [
5876
+ /* @__PURE__ */ jsx18("button", { type: "button", className: action.primary ? "mb-action-button is-primary" : "mb-action-button", disabled: disabled || !action.enabled, onClick: () => onAction(action), children: action.label }),
5877
+ !action.enabled && action.reason ? /* @__PURE__ */ jsx18("span", { className: "mb-action-reason", children: action.reason }) : null
5488
5878
  ] }, action.id))
5489
5879
  ] });
5490
5880
  }
@@ -5514,18 +5904,18 @@ function defaultFormatDate(createdAt) {
5514
5904
  return new Intl.DateTimeFormat(void 0, { dateStyle: "medium", timeStyle: "short" }).format(parsed);
5515
5905
  }
5516
5906
  function BillActivityTimeline({ events, emptyLabel = "No bill activity yet.", appearance, className, style, formatDate = defaultFormatDate }) {
5517
- return /* @__PURE__ */ jsxs16("section", { className: classes("mb-surface mb-activity", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill activity", children: [
5518
- /* @__PURE__ */ jsx16("style", { children: lifecycleSurfaceStyles }),
5519
- /* @__PURE__ */ jsx16("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs16("div", { children: [
5520
- /* @__PURE__ */ jsx16("strong", { children: "Bill history" }),
5521
- /* @__PURE__ */ jsx16("span", { children: "Submission, payer responses, follow-up, and payments." })
5907
+ return /* @__PURE__ */ jsxs18("section", { className: classes("mb-surface mb-activity", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill activity", children: [
5908
+ /* @__PURE__ */ jsx18("style", { children: lifecycleSurfaceStyles }),
5909
+ /* @__PURE__ */ jsx18("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs18("div", { children: [
5910
+ /* @__PURE__ */ jsx18("strong", { children: "Bill history" }),
5911
+ /* @__PURE__ */ jsx18("span", { children: "Submission, payer responses, follow-up, and payments." })
5522
5912
  ] }) }),
5523
- !events.length ? /* @__PURE__ */ jsx16("p", { className: "mb-activity-empty", children: emptyLabel }) : /* @__PURE__ */ jsx16("ol", { className: "mb-activity-list", children: events.map((event) => /* @__PURE__ */ jsxs16("li", { className: "mb-activity-item", children: [
5524
- /* @__PURE__ */ jsx16("span", { className: "mb-activity-marker", "aria-hidden": "true" }),
5525
- /* @__PURE__ */ jsxs16("div", { className: "mb-activity-content", children: [
5526
- /* @__PURE__ */ jsx16("strong", { children: event.title ?? billActivityEventLabel(event.type) }),
5527
- event.description ? /* @__PURE__ */ jsx16("p", { children: event.description }) : null,
5528
- /* @__PURE__ */ jsxs16("span", { children: [
5913
+ !events.length ? /* @__PURE__ */ jsx18("p", { className: "mb-activity-empty", children: emptyLabel }) : /* @__PURE__ */ jsx18("ol", { className: "mb-activity-list", children: events.map((event) => /* @__PURE__ */ jsxs18("li", { className: "mb-activity-item", children: [
5914
+ /* @__PURE__ */ jsx18("span", { className: "mb-activity-marker", "aria-hidden": "true" }),
5915
+ /* @__PURE__ */ jsxs18("div", { className: "mb-activity-content", children: [
5916
+ /* @__PURE__ */ jsx18("strong", { children: event.title ?? billActivityEventLabel(event.type) }),
5917
+ event.description ? /* @__PURE__ */ jsx18("p", { children: event.description }) : null,
5918
+ /* @__PURE__ */ jsxs18("span", { children: [
5529
5919
  formatDate(event.createdAt),
5530
5920
  event.actor ? ` \xB7 ${event.actor}` : ""
5531
5921
  ] })
@@ -5539,49 +5929,49 @@ function historyDate(iso) {
5539
5929
  return new Intl.DateTimeFormat("en-US", { month: "2-digit", day: "2-digit", year: "numeric" }).format(parsed);
5540
5930
  }
5541
5931
  function BillHistoryTable({ entries, selectedEntryId, emptyLabel = "No bill history yet.", appearance, className, style, formatDate = historyDate, documentHref, onOpenDocument }) {
5542
- const [expanded, setExpanded] = useState12({});
5932
+ const [expanded, setExpanded] = useState14({});
5543
5933
  const selectedRowRef = useRef7(null);
5544
- useEffect11(() => {
5934
+ useEffect12(() => {
5545
5935
  if (!selectedEntryId) return;
5546
5936
  const selected = entries.find((entry) => entry.id === selectedEntryId);
5547
5937
  if (selected?.details) setExpanded((current) => current[selectedEntryId] ? current : { ...current, [selectedEntryId]: true });
5548
5938
  selectedRowRef.current?.scrollIntoView({ behavior: "smooth", block: "center" });
5549
5939
  }, [entries, selectedEntryId]);
5550
- return /* @__PURE__ */ jsxs16("section", { className: classes("mb-surface mb-history", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill history", children: [
5551
- /* @__PURE__ */ jsx16("style", { children: lifecycleSurfaceStyles }),
5552
- /* @__PURE__ */ jsx16("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs16("div", { children: [
5553
- /* @__PURE__ */ jsx16("strong", { children: "Bill history" }),
5554
- /* @__PURE__ */ jsx16("span", { children: "Submissions, payer responses, follow-up, and payments." })
5940
+ return /* @__PURE__ */ jsxs18("section", { className: classes("mb-surface mb-history", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill history", children: [
5941
+ /* @__PURE__ */ jsx18("style", { children: lifecycleSurfaceStyles }),
5942
+ /* @__PURE__ */ jsx18("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs18("div", { children: [
5943
+ /* @__PURE__ */ jsx18("strong", { children: "Bill history" }),
5944
+ /* @__PURE__ */ jsx18("span", { children: "Submissions, payer responses, follow-up, and payments." })
5555
5945
  ] }) }),
5556
- !entries.length ? /* @__PURE__ */ jsx16("p", { className: "mb-activity-empty", children: emptyLabel }) : /* @__PURE__ */ jsxs16("div", { className: "mb-history-table", children: [
5557
- /* @__PURE__ */ jsxs16("div", { className: "mb-history-head", "aria-hidden": "true", children: [
5558
- /* @__PURE__ */ jsx16("span", { children: "Date" }),
5559
- /* @__PURE__ */ jsx16("span", { children: "Action" }),
5560
- /* @__PURE__ */ jsx16("span", { children: "User" }),
5561
- /* @__PURE__ */ jsx16("span", { children: "Details" })
5946
+ !entries.length ? /* @__PURE__ */ jsx18("p", { className: "mb-activity-empty", children: emptyLabel }) : /* @__PURE__ */ jsxs18("div", { className: "mb-history-table", children: [
5947
+ /* @__PURE__ */ jsxs18("div", { className: "mb-history-head", "aria-hidden": "true", children: [
5948
+ /* @__PURE__ */ jsx18("span", { children: "Date" }),
5949
+ /* @__PURE__ */ jsx18("span", { children: "Action" }),
5950
+ /* @__PURE__ */ jsx18("span", { children: "User" }),
5951
+ /* @__PURE__ */ jsx18("span", { children: "Details" })
5562
5952
  ] }),
5563
- /* @__PURE__ */ jsx16("ul", { className: "mb-history-rows", children: entries.map((entry) => {
5953
+ /* @__PURE__ */ jsx18("ul", { className: "mb-history-rows", children: entries.map((entry) => {
5564
5954
  const isSelected = entry.id === selectedEntryId;
5565
5955
  const expandable = Boolean(entry.details);
5566
5956
  const isOpen = expandable && Boolean(expanded[entry.id]);
5567
5957
  const details = entry.details;
5568
- const lineContents = /* @__PURE__ */ jsxs16(Fragment13, { children: [
5569
- /* @__PURE__ */ jsx16("span", { className: "mb-history-date", children: formatDate(entry.date) }),
5570
- /* @__PURE__ */ jsx16("span", { className: "mb-history-action", children: entry.action }),
5571
- /* @__PURE__ */ jsx16("span", { className: "mb-history-actor", children: entry.actor ?? "\u2014" }),
5572
- /* @__PURE__ */ jsxs16("span", { className: "mb-history-summary", children: [
5573
- expandable ? /* @__PURE__ */ jsx16("i", { className: `mb-history-caret${isOpen ? " is-open" : ""}`, "aria-hidden": "true" }) : null,
5958
+ const lineContents = /* @__PURE__ */ jsxs18(Fragment13, { children: [
5959
+ /* @__PURE__ */ jsx18("span", { className: "mb-history-date", children: formatDate(entry.date) }),
5960
+ /* @__PURE__ */ jsx18("span", { className: "mb-history-action", children: entry.action }),
5961
+ /* @__PURE__ */ jsx18("span", { className: "mb-history-actor", children: entry.actor ?? "\u2014" }),
5962
+ /* @__PURE__ */ jsxs18("span", { className: "mb-history-summary", children: [
5963
+ expandable ? /* @__PURE__ */ jsx18("i", { className: `mb-history-caret${isOpen ? " is-open" : ""}`, "aria-hidden": "true" }) : null,
5574
5964
  entry.summary
5575
5965
  ] })
5576
5966
  ] });
5577
- return /* @__PURE__ */ jsxs16(
5967
+ return /* @__PURE__ */ jsxs18(
5578
5968
  "li",
5579
5969
  {
5580
5970
  ref: isSelected ? selectedRowRef : void 0,
5581
5971
  className: `mb-history-row is-${entry.tone}${isSelected ? " is-selected" : ""}`,
5582
5972
  "aria-current": isSelected ? "true" : void 0,
5583
5973
  children: [
5584
- expandable ? /* @__PURE__ */ jsx16(
5974
+ expandable ? /* @__PURE__ */ jsx18(
5585
5975
  "button",
5586
5976
  {
5587
5977
  type: "button",
@@ -5590,31 +5980,31 @@ function BillHistoryTable({ entries, selectedEntryId, emptyLabel = "No bill hist
5590
5980
  onClick: () => setExpanded((current) => ({ ...current, [entry.id]: !current[entry.id] })),
5591
5981
  children: lineContents
5592
5982
  }
5593
- ) : /* @__PURE__ */ jsx16("div", { className: "mb-history-line", children: lineContents }),
5594
- isOpen && details ? /* @__PURE__ */ jsxs16("div", { className: "mb-history-details", children: [
5595
- details.rows?.length ? /* @__PURE__ */ jsx16("dl", { className: "mb-history-kv", children: details.rows.map((row) => /* @__PURE__ */ jsxs16("div", { children: [
5596
- /* @__PURE__ */ jsx16("dt", { children: row.label }),
5597
- /* @__PURE__ */ jsx16("dd", { children: row.value })
5983
+ ) : /* @__PURE__ */ jsx18("div", { className: "mb-history-line", children: lineContents }),
5984
+ isOpen && details ? /* @__PURE__ */ jsxs18("div", { className: "mb-history-details", children: [
5985
+ details.rows?.length ? /* @__PURE__ */ jsx18("dl", { className: "mb-history-kv", children: details.rows.map((row) => /* @__PURE__ */ jsxs18("div", { children: [
5986
+ /* @__PURE__ */ jsx18("dt", { children: row.label }),
5987
+ /* @__PURE__ */ jsx18("dd", { children: row.value })
5598
5988
  ] }, `${row.label}-${row.value}`)) }) : null,
5599
- details.documents?.length ? /* @__PURE__ */ jsx16("div", { className: "mb-history-kv", children: /* @__PURE__ */ jsxs16("div", { children: [
5600
- /* @__PURE__ */ jsx16("dt", { children: "Documents" }),
5601
- /* @__PURE__ */ jsx16("dd", { children: details.documents.map((doc) => {
5989
+ details.documents?.length ? /* @__PURE__ */ jsx18("div", { className: "mb-history-kv", children: /* @__PURE__ */ jsxs18("div", { children: [
5990
+ /* @__PURE__ */ jsx18("dt", { children: "Documents" }),
5991
+ /* @__PURE__ */ jsx18("dd", { children: details.documents.map((doc) => {
5602
5992
  const href = documentHref?.(doc) ?? null;
5603
- return href ? /* @__PURE__ */ jsx16("a", { className: "mb-history-doc", href, target: "_blank", rel: "noreferrer", children: doc.filename }, doc.id) : onOpenDocument ? /* @__PURE__ */ jsx16("button", { type: "button", className: "mb-history-doc", onClick: () => void onOpenDocument(doc), children: doc.filename }, doc.id) : /* @__PURE__ */ jsx16("span", { className: "mb-history-doc", children: doc.filename }, doc.id);
5993
+ return href ? /* @__PURE__ */ jsx18("a", { className: "mb-history-doc", href, target: "_blank", rel: "noreferrer", children: doc.filename }, doc.id) : onOpenDocument ? /* @__PURE__ */ jsx18("button", { type: "button", className: "mb-history-doc", onClick: () => void onOpenDocument(doc), children: doc.filename }, doc.id) : /* @__PURE__ */ jsx18("span", { className: "mb-history-doc", children: doc.filename }, doc.id);
5604
5994
  }) })
5605
5995
  ] }) }) : null,
5606
- details.codes?.length ? /* @__PURE__ */ jsx16("dl", { className: "mb-history-codes", children: details.codes.map((code) => /* @__PURE__ */ jsxs16("div", { children: [
5607
- /* @__PURE__ */ jsx16("dt", { children: code.code }),
5608
- /* @__PURE__ */ jsx16("dd", { children: code.text })
5996
+ details.codes?.length ? /* @__PURE__ */ jsx18("dl", { className: "mb-history-codes", children: details.codes.map((code) => /* @__PURE__ */ jsxs18("div", { children: [
5997
+ /* @__PURE__ */ jsx18("dt", { children: code.code }),
5998
+ /* @__PURE__ */ jsx18("dd", { children: code.text })
5609
5999
  ] }, code.code)) }) : null,
5610
- details.complianceDueDates?.length ? /* @__PURE__ */ jsxs16("div", { className: "mb-history-due", children: [
5611
- /* @__PURE__ */ jsx16("em", { children: "Compliance Due Dates" }),
5612
- /* @__PURE__ */ jsx16("dl", { children: details.complianceDueDates.map((due) => /* @__PURE__ */ jsxs16("div", { children: [
5613
- /* @__PURE__ */ jsx16("dt", { children: formatDate(due.date) }),
5614
- /* @__PURE__ */ jsx16("dd", { children: due.text })
6000
+ details.complianceDueDates?.length ? /* @__PURE__ */ jsxs18("div", { className: "mb-history-due", children: [
6001
+ /* @__PURE__ */ jsx18("em", { children: "Compliance Due Dates" }),
6002
+ /* @__PURE__ */ jsx18("dl", { children: details.complianceDueDates.map((due) => /* @__PURE__ */ jsxs18("div", { children: [
6003
+ /* @__PURE__ */ jsx18("dt", { children: formatDate(due.date) }),
6004
+ /* @__PURE__ */ jsx18("dd", { children: due.text })
5615
6005
  ] }, `${due.date}-${due.text}`)) })
5616
6006
  ] }) : null,
5617
- details.text ? /* @__PURE__ */ jsx16("p", { className: "mb-history-text", children: details.text }) : null
6007
+ details.text ? /* @__PURE__ */ jsx18("p", { className: "mb-history-text", children: details.text }) : null
5618
6008
  ] }) : null
5619
6009
  ]
5620
6010
  },
@@ -5675,15 +6065,15 @@ function BillLifecycleProgress({ state, nativeStatus, submittedAt, agingDays, dr
5675
6065
  const rejected = state.toLowerCase() === "rejected";
5676
6066
  const draft = Boolean(draftStage) && isBillLifecycleDraft(state);
5677
6067
  const steps = billLifecycleProgressSteps(state, { draftStage: Boolean(draftStage) });
5678
- return /* @__PURE__ */ jsxs16("section", { className: classes(`mb-surface mb-progress${rejected ? " is-rejected" : ""}`, className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill lifecycle", children: [
5679
- /* @__PURE__ */ jsx16("style", { children: lifecycleSurfaceStyles }),
5680
- /* @__PURE__ */ jsx16("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs16("div", { children: [
5681
- /* @__PURE__ */ jsx16("strong", { children: billLifecycleDisplayLabel(state, nativeStatus) }),
5682
- /* @__PURE__ */ jsx16("span", { children: rejected ? "The payer rejected this submission." : draft ? "Not yet sent" : `${submittedAt ? `Submitted ${defaultFormatDate(submittedAt)}` : "Submitted"}${typeof agingDays === "number" ? ` \xB7 ${agingDays} days old` : ""}` })
6068
+ return /* @__PURE__ */ jsxs18("section", { className: classes(`mb-surface mb-progress${rejected ? " is-rejected" : ""}`, className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill lifecycle", children: [
6069
+ /* @__PURE__ */ jsx18("style", { children: lifecycleSurfaceStyles }),
6070
+ /* @__PURE__ */ jsx18("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs18("div", { children: [
6071
+ /* @__PURE__ */ jsx18("strong", { children: billLifecycleDisplayLabel(state, nativeStatus) }),
6072
+ /* @__PURE__ */ jsx18("span", { children: rejected ? "The payer rejected this submission." : draft ? "Not yet sent" : `${submittedAt ? `Submitted ${defaultFormatDate(submittedAt)}` : "Submitted"}${typeof agingDays === "number" ? ` \xB7 ${agingDays} days old` : ""}` })
5683
6073
  ] }) }),
5684
- /* @__PURE__ */ jsx16("ol", { className: "mb-progress-list", style: { gridTemplateColumns: `repeat(${steps.length}, minmax(0, 1fr))` }, children: steps.map((step, index) => /* @__PURE__ */ jsxs16("li", { className: `is-${step.status}`, "aria-current": step.status === "current" ? "step" : void 0, children: [
5685
- /* @__PURE__ */ jsx16("span", { "aria-hidden": "true", children: step.status === "complete" ? "\u2713" : rejected && step.status === "current" ? "!" : index + 1 }),
5686
- /* @__PURE__ */ jsx16("b", { children: step.label })
6074
+ /* @__PURE__ */ jsx18("ol", { className: "mb-progress-list", style: { gridTemplateColumns: `repeat(${steps.length}, minmax(0, 1fr))` }, children: steps.map((step, index) => /* @__PURE__ */ jsxs18("li", { className: `is-${step.status}`, "aria-current": step.status === "current" ? "step" : void 0, children: [
6075
+ /* @__PURE__ */ jsx18("span", { "aria-hidden": "true", children: step.status === "complete" ? "\u2713" : rejected && step.status === "current" ? "!" : index + 1 }),
6076
+ /* @__PURE__ */ jsx18("b", { children: step.label })
5687
6077
  ] }, step.id)) })
5688
6078
  ] });
5689
6079
  }
@@ -5697,48 +6087,48 @@ function billRejectionIssueSummary(rejection, count) {
5697
6087
  function BillRejectionNotice({ rejection, title = "Rejected \u2014 action required", submittedAt, appearance, className, style, formatDate = defaultFormatDate }) {
5698
6088
  const issues = rejection.issues?.length ? rejection.issues : [{ code: rejection.code, description: rejection.reason }];
5699
6089
  const hasCodes = issues.some((issue) => Boolean(issue.code));
5700
- return /* @__PURE__ */ jsxs16("section", { className: classes("mb-surface mb-rejection-notice", className), style: mindBillAppearanceStyle(appearance, style), role: "alert", "aria-label": "Bill rejection reasons", children: [
5701
- /* @__PURE__ */ jsx16("style", { children: lifecycleSurfaceStyles }),
5702
- /* @__PURE__ */ jsxs16("div", { className: "mb-rejection-overview", children: [
5703
- /* @__PURE__ */ jsxs16("header", { className: "mb-rejection-heading", children: [
5704
- /* @__PURE__ */ jsx16("span", { className: "mb-rejection-icon", "aria-hidden": "true", children: "!" }),
5705
- /* @__PURE__ */ jsxs16("div", { children: [
5706
- /* @__PURE__ */ jsx16("strong", { children: title }),
5707
- /* @__PURE__ */ jsxs16("span", { children: [
6090
+ return /* @__PURE__ */ jsxs18("section", { className: classes("mb-surface mb-rejection-notice", className), style: mindBillAppearanceStyle(appearance, style), role: "alert", "aria-label": "Bill rejection reasons", children: [
6091
+ /* @__PURE__ */ jsx18("style", { children: lifecycleSurfaceStyles }),
6092
+ /* @__PURE__ */ jsxs18("div", { className: "mb-rejection-overview", children: [
6093
+ /* @__PURE__ */ jsxs18("header", { className: "mb-rejection-heading", children: [
6094
+ /* @__PURE__ */ jsx18("span", { className: "mb-rejection-icon", "aria-hidden": "true", children: "!" }),
6095
+ /* @__PURE__ */ jsxs18("div", { children: [
6096
+ /* @__PURE__ */ jsx18("strong", { children: title }),
6097
+ /* @__PURE__ */ jsxs18("span", { children: [
5708
6098
  "Fix the ",
5709
6099
  issues.length === 1 ? "issue" : "issues",
5710
6100
  " below, then resubmit."
5711
6101
  ] })
5712
6102
  ] })
5713
6103
  ] }),
5714
- /* @__PURE__ */ jsxs16("ol", { className: "mb-rejection-progress", "aria-label": "Submission status", children: [
5715
- /* @__PURE__ */ jsxs16("li", { className: "is-complete", children: [
5716
- /* @__PURE__ */ jsx16("span", { "aria-hidden": "true", children: "\u2713" }),
5717
- /* @__PURE__ */ jsx16("b", { children: "Sent" }),
5718
- submittedAt ? /* @__PURE__ */ jsx16("small", { children: formatDate(submittedAt) }) : null
6104
+ /* @__PURE__ */ jsxs18("ol", { className: "mb-rejection-progress", "aria-label": "Submission status", children: [
6105
+ /* @__PURE__ */ jsxs18("li", { className: "is-complete", children: [
6106
+ /* @__PURE__ */ jsx18("span", { "aria-hidden": "true", children: "\u2713" }),
6107
+ /* @__PURE__ */ jsx18("b", { children: "Sent" }),
6108
+ submittedAt ? /* @__PURE__ */ jsx18("small", { children: formatDate(submittedAt) }) : null
5719
6109
  ] }),
5720
- /* @__PURE__ */ jsxs16("li", { className: "is-rejected", "aria-current": "step", children: [
5721
- /* @__PURE__ */ jsx16("span", { "aria-hidden": "true", children: "!" }),
5722
- /* @__PURE__ */ jsx16("b", { children: "Rejected" }),
5723
- rejection.receivedAt ? /* @__PURE__ */ jsx16("small", { children: formatDate(rejection.receivedAt) }) : null
6110
+ /* @__PURE__ */ jsxs18("li", { className: "is-rejected", "aria-current": "step", children: [
6111
+ /* @__PURE__ */ jsx18("span", { "aria-hidden": "true", children: "!" }),
6112
+ /* @__PURE__ */ jsx18("b", { children: "Rejected" }),
6113
+ rejection.receivedAt ? /* @__PURE__ */ jsx18("small", { children: formatDate(rejection.receivedAt) }) : null
5724
6114
  ] })
5725
6115
  ] })
5726
6116
  ] }),
5727
- /* @__PURE__ */ jsxs16("div", { className: "mb-rejection-issues", "aria-label": "Rejection reasons", children: [
5728
- /* @__PURE__ */ jsxs16("div", { className: "mb-rejection-issues-heading", children: [
5729
- /* @__PURE__ */ jsxs16("strong", { children: [
5730
- /* @__PURE__ */ jsx16("span", { "aria-hidden": "true", children: "\u25B3" }),
6117
+ /* @__PURE__ */ jsxs18("div", { className: "mb-rejection-issues", "aria-label": "Rejection reasons", children: [
6118
+ /* @__PURE__ */ jsxs18("div", { className: "mb-rejection-issues-heading", children: [
6119
+ /* @__PURE__ */ jsxs18("strong", { children: [
6120
+ /* @__PURE__ */ jsx18("span", { "aria-hidden": "true", children: "\u25B3" }),
5731
6121
  " Rejection reasons"
5732
6122
  ] }),
5733
- /* @__PURE__ */ jsx16("span", { children: billRejectionIssueSummary(rejection, issues.length) })
6123
+ /* @__PURE__ */ jsx18("span", { children: billRejectionIssueSummary(rejection, issues.length) })
5734
6124
  ] }),
5735
- /* @__PURE__ */ jsx16("ol", { "aria-label": `${issues.length} rejection ${issues.length === 1 ? "reason" : "reasons"}`, children: issues.map((issue, index) => /* @__PURE__ */ jsxs16("li", { children: [
5736
- /* @__PURE__ */ jsx16("span", { className: "mb-rejection-bullet", "aria-hidden": "true" }),
5737
- /* @__PURE__ */ jsx16("p", { children: issue.description }),
5738
- issue.code ? /* @__PURE__ */ jsx16("span", { className: "mb-rejection-code", children: issue.code }) : null
6125
+ /* @__PURE__ */ jsx18("ol", { "aria-label": `${issues.length} rejection ${issues.length === 1 ? "reason" : "reasons"}`, children: issues.map((issue, index) => /* @__PURE__ */ jsxs18("li", { children: [
6126
+ /* @__PURE__ */ jsx18("span", { className: "mb-rejection-bullet", "aria-hidden": "true" }),
6127
+ /* @__PURE__ */ jsx18("p", { children: issue.description }),
6128
+ issue.code ? /* @__PURE__ */ jsx18("span", { className: "mb-rejection-code", children: issue.code }) : null
5739
6129
  ] }, `${issue.code ?? "issue"}-${index}`)) }),
5740
- hasCodes ? /* @__PURE__ */ jsxs16("p", { className: "mb-rejection-code-note", children: [
5741
- /* @__PURE__ */ jsx16("span", { "aria-hidden": "true", children: "i" }),
6130
+ hasCodes ? /* @__PURE__ */ jsxs18("p", { className: "mb-rejection-code-note", children: [
6131
+ /* @__PURE__ */ jsx18("span", { "aria-hidden": "true", children: "i" }),
5742
6132
  " Technical error codes are included for support and auditability."
5743
6133
  ] }) : null
5744
6134
  ] })
@@ -5753,18 +6143,18 @@ function BillSnapshotSummary({ bill, patient, injury, delivery, appearance, clas
5753
6143
  ["Charged", currency(bill.totalCharge)],
5754
6144
  ["Balance", currency(bill.balanceDue)]
5755
6145
  ];
5756
- return /* @__PURE__ */ jsxs16("section", { className: classes("mb-surface mb-snapshot", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill snapshot", children: [
5757
- /* @__PURE__ */ jsx16("style", { children: lifecycleSurfaceStyles }),
5758
- /* @__PURE__ */ jsx16("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs16("div", { children: [
5759
- /* @__PURE__ */ jsx16("strong", { children: "Bill snapshot" }),
5760
- /* @__PURE__ */ jsxs16("span", { children: [
6146
+ return /* @__PURE__ */ jsxs18("section", { className: classes("mb-surface mb-snapshot", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill snapshot", children: [
6147
+ /* @__PURE__ */ jsx18("style", { children: lifecycleSurfaceStyles }),
6148
+ /* @__PURE__ */ jsx18("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs18("div", { children: [
6149
+ /* @__PURE__ */ jsx18("strong", { children: "Bill snapshot" }),
6150
+ /* @__PURE__ */ jsxs18("span", { children: [
5761
6151
  "Bill #",
5762
6152
  bill.billNumber
5763
6153
  ] })
5764
6154
  ] }) }),
5765
- /* @__PURE__ */ jsx16("dl", { children: values.map(([label, value]) => /* @__PURE__ */ jsxs16("div", { children: [
5766
- /* @__PURE__ */ jsx16("dt", { children: label }),
5767
- /* @__PURE__ */ jsx16("dd", { children: value })
6155
+ /* @__PURE__ */ jsx18("dl", { children: values.map(([label, value]) => /* @__PURE__ */ jsxs18("div", { children: [
6156
+ /* @__PURE__ */ jsx18("dt", { children: label }),
6157
+ /* @__PURE__ */ jsx18("dd", { children: value })
5768
6158
  ] }, label)) })
5769
6159
  ] });
5770
6160
  }
@@ -5779,140 +6169,140 @@ function BillExplanationOfReview({
5779
6169
  style
5780
6170
  }) {
5781
6171
  const rows = payments.length ? payments : [null];
5782
- return /* @__PURE__ */ jsxs16("section", { className: classes("mb-surface mb-eor-review", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Explanation of Review and payments", children: [
5783
- /* @__PURE__ */ jsx16("style", { children: lifecycleSurfaceStyles }),
5784
- /* @__PURE__ */ jsx16("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs16("div", { children: [
5785
- /* @__PURE__ */ jsx16("strong", { children: "Explanation of Review" }),
5786
- /* @__PURE__ */ jsx16("span", { children: "Payer response and payment reconciliation." })
6172
+ return /* @__PURE__ */ jsxs18("section", { className: classes("mb-surface mb-eor-review", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Explanation of Review and payments", children: [
6173
+ /* @__PURE__ */ jsx18("style", { children: lifecycleSurfaceStyles }),
6174
+ /* @__PURE__ */ jsx18("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs18("div", { children: [
6175
+ /* @__PURE__ */ jsx18("strong", { children: "Explanation of Review" }),
6176
+ /* @__PURE__ */ jsx18("span", { children: "Payer response and payment reconciliation." })
5787
6177
  ] }) }),
5788
- /* @__PURE__ */ jsxs16("dl", { className: "mb-eor-metrics", children: [
5789
- /* @__PURE__ */ jsxs16("div", { children: [
5790
- /* @__PURE__ */ jsx16("dt", { children: "Amount billed" }),
5791
- /* @__PURE__ */ jsx16("dd", { children: currency(remittance.billedAmount) })
6178
+ /* @__PURE__ */ jsxs18("dl", { className: "mb-eor-metrics", children: [
6179
+ /* @__PURE__ */ jsxs18("div", { children: [
6180
+ /* @__PURE__ */ jsx18("dt", { children: "Amount billed" }),
6181
+ /* @__PURE__ */ jsx18("dd", { children: currency(remittance.billedAmount) })
5792
6182
  ] }),
5793
- /* @__PURE__ */ jsxs16("div", { children: [
5794
- /* @__PURE__ */ jsx16("dt", { children: "Payer allowed" }),
5795
- /* @__PURE__ */ jsx16("dd", { children: remittance.payerAllowedAmount === null ? "\u2014" : currency(remittance.payerAllowedAmount) })
6183
+ /* @__PURE__ */ jsxs18("div", { children: [
6184
+ /* @__PURE__ */ jsx18("dt", { children: "Payer allowed" }),
6185
+ /* @__PURE__ */ jsx18("dd", { children: remittance.payerAllowedAmount === null ? "\u2014" : currency(remittance.payerAllowedAmount) })
5796
6186
  ] }),
5797
- /* @__PURE__ */ jsxs16("div", { children: [
5798
- /* @__PURE__ */ jsx16("dt", { children: "Payer reported paid" }),
5799
- /* @__PURE__ */ jsx16("dd", { children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) })
6187
+ /* @__PURE__ */ jsxs18("div", { children: [
6188
+ /* @__PURE__ */ jsx18("dt", { children: "Payer reported paid" }),
6189
+ /* @__PURE__ */ jsx18("dd", { children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) })
5800
6190
  ] }),
5801
- /* @__PURE__ */ jsxs16("div", { className: "is-balance", children: [
5802
- /* @__PURE__ */ jsx16("dt", { children: "Balance due" }),
5803
- /* @__PURE__ */ jsx16("dd", { children: currency(remittance.balanceDue) })
6191
+ /* @__PURE__ */ jsxs18("div", { className: "is-balance", children: [
6192
+ /* @__PURE__ */ jsx18("dt", { children: "Balance due" }),
6193
+ /* @__PURE__ */ jsx18("dd", { children: currency(remittance.balanceDue) })
5804
6194
  ] }),
5805
- /* @__PURE__ */ jsxs16("div", { children: [
5806
- /* @__PURE__ */ jsx16("dt", { children: "Payment posted" }),
5807
- /* @__PURE__ */ jsx16("dd", { children: currency(remittance.postedPrincipal) })
6195
+ /* @__PURE__ */ jsxs18("div", { children: [
6196
+ /* @__PURE__ */ jsx18("dt", { children: "Payment posted" }),
6197
+ /* @__PURE__ */ jsx18("dd", { children: currency(remittance.postedPrincipal) })
5808
6198
  ] }),
5809
- /* @__PURE__ */ jsxs16("div", { children: [
5810
- /* @__PURE__ */ jsx16("dt", { children: "Penalty & interest" }),
5811
- /* @__PURE__ */ jsx16("dd", { children: currency(remittance.postedAdditional) })
6199
+ /* @__PURE__ */ jsxs18("div", { children: [
6200
+ /* @__PURE__ */ jsx18("dt", { children: "Penalty & interest" }),
6201
+ /* @__PURE__ */ jsx18("dd", { children: currency(remittance.postedAdditional) })
5812
6202
  ] }),
5813
- /* @__PURE__ */ jsxs16("div", { children: [
5814
- /* @__PURE__ */ jsx16("dt", { children: "Total received" }),
5815
- /* @__PURE__ */ jsx16("dd", { children: currency(remittance.totalPostedCash) })
6203
+ /* @__PURE__ */ jsxs18("div", { children: [
6204
+ /* @__PURE__ */ jsx18("dt", { children: "Total received" }),
6205
+ /* @__PURE__ */ jsx18("dd", { children: currency(remittance.totalPostedCash) })
5816
6206
  ] }),
5817
- /* @__PURE__ */ jsxs16("div", { children: [
5818
- /* @__PURE__ */ jsx16("dt", { children: "Expected" }),
5819
- /* @__PURE__ */ jsx16("dd", { children: currency(remittance.expectedAmount) })
6207
+ /* @__PURE__ */ jsxs18("div", { children: [
6208
+ /* @__PURE__ */ jsx18("dt", { children: "Expected" }),
6209
+ /* @__PURE__ */ jsx18("dd", { children: currency(remittance.expectedAmount) })
5820
6210
  ] })
5821
6211
  ] }),
5822
- remittance.denialReason ? /* @__PURE__ */ jsxs16("div", { className: "mb-denial", children: [
5823
- /* @__PURE__ */ jsx16("strong", { children: "Denial reason" }),
5824
- /* @__PURE__ */ jsx16("p", { children: remittance.denialReason })
6212
+ remittance.denialReason ? /* @__PURE__ */ jsxs18("div", { className: "mb-denial", children: [
6213
+ /* @__PURE__ */ jsx18("strong", { children: "Denial reason" }),
6214
+ /* @__PURE__ */ jsx18("p", { children: remittance.denialReason })
5825
6215
  ] }) : null,
5826
- /* @__PURE__ */ jsx16("div", { className: "mb-eor-table-wrap", children: /* @__PURE__ */ jsxs16("table", { className: "mb-eor-table", children: [
5827
- /* @__PURE__ */ jsxs16("thead", { children: [
5828
- /* @__PURE__ */ jsxs16("tr", { className: "mb-eor-groups", children: [
5829
- /* @__PURE__ */ jsx16("th", { colSpan: 2, children: "Submission" }),
5830
- /* @__PURE__ */ jsx16("th", { colSpan: 5, children: "EOR payment information" }),
5831
- /* @__PURE__ */ jsx16("th", { colSpan: 2, children: "EOR post" }),
5832
- /* @__PURE__ */ jsx16("th", { children: "EOR" })
6216
+ /* @__PURE__ */ jsx18("div", { className: "mb-eor-table-wrap", children: /* @__PURE__ */ jsxs18("table", { className: "mb-eor-table", children: [
6217
+ /* @__PURE__ */ jsxs18("thead", { children: [
6218
+ /* @__PURE__ */ jsxs18("tr", { className: "mb-eor-groups", children: [
6219
+ /* @__PURE__ */ jsx18("th", { colSpan: 2, children: "Submission" }),
6220
+ /* @__PURE__ */ jsx18("th", { colSpan: 5, children: "EOR payment information" }),
6221
+ /* @__PURE__ */ jsx18("th", { colSpan: 2, children: "EOR post" }),
6222
+ /* @__PURE__ */ jsx18("th", { children: "EOR" })
5833
6223
  ] }),
5834
- /* @__PURE__ */ jsxs16("tr", { children: [
5835
- /* @__PURE__ */ jsx16("th", { children: "Submission" }),
5836
- /* @__PURE__ */ jsx16("th", { children: "Submission payment" }),
5837
- /* @__PURE__ */ jsx16("th", { children: "Payment method" }),
5838
- /* @__PURE__ */ jsx16("th", { children: "Reference" }),
5839
- /* @__PURE__ */ jsx16("th", { children: "Effective date" }),
5840
- /* @__PURE__ */ jsx16("th", { children: "Payment total" }),
5841
- /* @__PURE__ */ jsx16("th", { children: "Deposit date" }),
5842
- /* @__PURE__ */ jsx16("th", { children: "Post date" }),
5843
- /* @__PURE__ */ jsx16("th", { children: "Source" }),
5844
- /* @__PURE__ */ jsx16("th", { children: "Document" })
6224
+ /* @__PURE__ */ jsxs18("tr", { children: [
6225
+ /* @__PURE__ */ jsx18("th", { children: "Submission" }),
6226
+ /* @__PURE__ */ jsx18("th", { children: "Submission payment" }),
6227
+ /* @__PURE__ */ jsx18("th", { children: "Payment method" }),
6228
+ /* @__PURE__ */ jsx18("th", { children: "Reference" }),
6229
+ /* @__PURE__ */ jsx18("th", { children: "Effective date" }),
6230
+ /* @__PURE__ */ jsx18("th", { children: "Payment total" }),
6231
+ /* @__PURE__ */ jsx18("th", { children: "Deposit date" }),
6232
+ /* @__PURE__ */ jsx18("th", { children: "Post date" }),
6233
+ /* @__PURE__ */ jsx18("th", { children: "Source" }),
6234
+ /* @__PURE__ */ jsx18("th", { children: "Document" })
5845
6235
  ] })
5846
6236
  ] }),
5847
- /* @__PURE__ */ jsx16("tbody", { children: rows.map((payment, index) => {
6237
+ /* @__PURE__ */ jsx18("tbody", { children: rows.map((payment, index) => {
5848
6238
  const eor = eors[index] ?? eors[0];
5849
- return /* @__PURE__ */ jsxs16("tr", { children: [
5850
- /* @__PURE__ */ jsxs16("td", { "data-label": "Submission", children: [
5851
- /* @__PURE__ */ jsx16("strong", { children: "Original bill" }),
5852
- submittedAt ? /* @__PURE__ */ jsxs16("span", { children: [
6239
+ return /* @__PURE__ */ jsxs18("tr", { children: [
6240
+ /* @__PURE__ */ jsxs18("td", { "data-label": "Submission", children: [
6241
+ /* @__PURE__ */ jsx18("strong", { children: "Original bill" }),
6242
+ submittedAt ? /* @__PURE__ */ jsxs18("span", { children: [
5853
6243
  "Sent ",
5854
6244
  defaultFormatDate(submittedAt)
5855
6245
  ] }) : null
5856
6246
  ] }),
5857
- /* @__PURE__ */ jsx16("td", { "data-label": "Submission payment", children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) }),
5858
- /* @__PURE__ */ jsx16("td", { "data-label": "Payment method", children: payment ? humanize(payment.method) : "\u2014" }),
5859
- /* @__PURE__ */ jsx16("td", { "data-label": "Reference", children: payment?.checkNumber || "\u2014" }),
5860
- /* @__PURE__ */ jsx16("td", { "data-label": "Effective date", children: payment ? payment.receivedDate || payment.depositDate || defaultFormatDate(payment.postedAt) : "\u2014" }),
5861
- /* @__PURE__ */ jsx16("td", { "data-label": "Payment total", children: payment ? currency(payment.amount) : currency(0) }),
5862
- /* @__PURE__ */ jsx16("td", { "data-label": "Deposit date", children: payment?.depositDate || "Not recorded" }),
5863
- /* @__PURE__ */ jsx16("td", { "data-label": "Post date", children: payment ? defaultFormatDate(payment.postedAt) : eor ? defaultFormatDate(eor.addedAt) : "\u2014" }),
5864
- /* @__PURE__ */ jsx16("td", { "data-label": "Source", children: payment ? payment.source.toUpperCase() : eor ? "EOR" : "\u2014" }),
5865
- /* @__PURE__ */ jsx16("td", { "data-label": "EOR", children: eor && onOpenEor ? /* @__PURE__ */ jsx16("button", { type: "button", className: "mb-eor-link", onClick: () => void onOpenEor(eor), children: eor.filename }) : eor?.filename || "\u2014" })
6247
+ /* @__PURE__ */ jsx18("td", { "data-label": "Submission payment", children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) }),
6248
+ /* @__PURE__ */ jsx18("td", { "data-label": "Payment method", children: payment ? humanize(payment.method) : "\u2014" }),
6249
+ /* @__PURE__ */ jsx18("td", { "data-label": "Reference", children: payment?.checkNumber || "\u2014" }),
6250
+ /* @__PURE__ */ jsx18("td", { "data-label": "Effective date", children: payment ? payment.receivedDate || payment.depositDate || defaultFormatDate(payment.postedAt) : "\u2014" }),
6251
+ /* @__PURE__ */ jsx18("td", { "data-label": "Payment total", children: payment ? currency(payment.amount) : currency(0) }),
6252
+ /* @__PURE__ */ jsx18("td", { "data-label": "Deposit date", children: payment?.depositDate || "Not recorded" }),
6253
+ /* @__PURE__ */ jsx18("td", { "data-label": "Post date", children: payment ? defaultFormatDate(payment.postedAt) : eor ? defaultFormatDate(eor.addedAt) : "\u2014" }),
6254
+ /* @__PURE__ */ jsx18("td", { "data-label": "Source", children: payment ? payment.source.toUpperCase() : eor ? "EOR" : "\u2014" }),
6255
+ /* @__PURE__ */ jsx18("td", { "data-label": "EOR", children: eor && onOpenEor ? /* @__PURE__ */ jsx18("button", { type: "button", className: "mb-eor-link", onClick: () => void onOpenEor(eor), children: eor.filename }) : eor?.filename || "\u2014" })
5866
6256
  ] }, payment?.id ?? `empty-${index}`);
5867
6257
  }) })
5868
6258
  ] }) }),
5869
- eors.length > rows.length ? /* @__PURE__ */ jsx16("div", { className: "mb-eor-documents", children: eors.slice(rows.length).map((eor) => /* @__PURE__ */ jsx16("button", { type: "button", onClick: () => void onOpenEor?.(eor), children: eor.filename }, eor.id)) }) : null
6259
+ eors.length > rows.length ? /* @__PURE__ */ jsx18("div", { className: "mb-eor-documents", children: eors.slice(rows.length).map((eor) => /* @__PURE__ */ jsx18("button", { type: "button", onClick: () => void onOpenEor?.(eor), children: eor.filename }, eor.id)) }) : null
5870
6260
  ] });
5871
6261
  }
5872
6262
  function BillRemittanceCard({ remittance, appearance, className, style }) {
5873
- return /* @__PURE__ */ jsxs16("section", { className: classes("mb-surface mb-remittance", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Remittance summary", children: [
5874
- /* @__PURE__ */ jsx16("style", { children: lifecycleSurfaceStyles }),
5875
- /* @__PURE__ */ jsx16("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs16("div", { children: [
5876
- /* @__PURE__ */ jsx16("strong", { children: "Remittance" }),
5877
- /* @__PURE__ */ jsx16("span", { children: "Amounts reported by the payer and posted to the bill." })
6263
+ return /* @__PURE__ */ jsxs18("section", { className: classes("mb-surface mb-remittance", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Remittance summary", children: [
6264
+ /* @__PURE__ */ jsx18("style", { children: lifecycleSurfaceStyles }),
6265
+ /* @__PURE__ */ jsx18("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs18("div", { children: [
6266
+ /* @__PURE__ */ jsx18("strong", { children: "Remittance" }),
6267
+ /* @__PURE__ */ jsx18("span", { children: "Amounts reported by the payer and posted to the bill." })
5878
6268
  ] }) }),
5879
- /* @__PURE__ */ jsxs16("dl", { children: [
5880
- /* @__PURE__ */ jsxs16("div", { children: [
5881
- /* @__PURE__ */ jsx16("dt", { children: "Amount billed" }),
5882
- /* @__PURE__ */ jsx16("dd", { children: currency(remittance.billedAmount) })
6269
+ /* @__PURE__ */ jsxs18("dl", { children: [
6270
+ /* @__PURE__ */ jsxs18("div", { children: [
6271
+ /* @__PURE__ */ jsx18("dt", { children: "Amount billed" }),
6272
+ /* @__PURE__ */ jsx18("dd", { children: currency(remittance.billedAmount) })
5883
6273
  ] }),
5884
- /* @__PURE__ */ jsxs16("div", { children: [
5885
- /* @__PURE__ */ jsx16("dt", { children: "Expected" }),
5886
- /* @__PURE__ */ jsx16("dd", { children: currency(remittance.expectedAmount) })
6274
+ /* @__PURE__ */ jsxs18("div", { children: [
6275
+ /* @__PURE__ */ jsx18("dt", { children: "Expected" }),
6276
+ /* @__PURE__ */ jsx18("dd", { children: currency(remittance.expectedAmount) })
5887
6277
  ] }),
5888
- /* @__PURE__ */ jsxs16("div", { children: [
5889
- /* @__PURE__ */ jsx16("dt", { children: "Payer allowed" }),
5890
- /* @__PURE__ */ jsx16("dd", { children: remittance.payerAllowedAmount === null ? "\u2014" : currency(remittance.payerAllowedAmount) })
6278
+ /* @__PURE__ */ jsxs18("div", { children: [
6279
+ /* @__PURE__ */ jsx18("dt", { children: "Payer allowed" }),
6280
+ /* @__PURE__ */ jsx18("dd", { children: remittance.payerAllowedAmount === null ? "\u2014" : currency(remittance.payerAllowedAmount) })
5891
6281
  ] }),
5892
- /* @__PURE__ */ jsxs16("div", { children: [
5893
- /* @__PURE__ */ jsx16("dt", { children: "Payer reported paid" }),
5894
- /* @__PURE__ */ jsx16("dd", { children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) })
6282
+ /* @__PURE__ */ jsxs18("div", { children: [
6283
+ /* @__PURE__ */ jsx18("dt", { children: "Payer reported paid" }),
6284
+ /* @__PURE__ */ jsx18("dd", { children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) })
5895
6285
  ] }),
5896
- /* @__PURE__ */ jsxs16("div", { children: [
5897
- /* @__PURE__ */ jsx16("dt", { children: "Payment posted" }),
5898
- /* @__PURE__ */ jsx16("dd", { children: currency(remittance.postedPrincipal) })
6286
+ /* @__PURE__ */ jsxs18("div", { children: [
6287
+ /* @__PURE__ */ jsx18("dt", { children: "Payment posted" }),
6288
+ /* @__PURE__ */ jsx18("dd", { children: currency(remittance.postedPrincipal) })
5899
6289
  ] }),
5900
- /* @__PURE__ */ jsxs16("div", { children: [
5901
- /* @__PURE__ */ jsx16("dt", { children: "Penalty & interest" }),
5902
- /* @__PURE__ */ jsx16("dd", { children: currency(remittance.postedAdditional) })
6290
+ /* @__PURE__ */ jsxs18("div", { children: [
6291
+ /* @__PURE__ */ jsx18("dt", { children: "Penalty & interest" }),
6292
+ /* @__PURE__ */ jsx18("dd", { children: currency(remittance.postedAdditional) })
5903
6293
  ] }),
5904
- /* @__PURE__ */ jsxs16("div", { children: [
5905
- /* @__PURE__ */ jsx16("dt", { children: "Total received" }),
5906
- /* @__PURE__ */ jsx16("dd", { children: currency(remittance.totalPostedCash) })
6294
+ /* @__PURE__ */ jsxs18("div", { children: [
6295
+ /* @__PURE__ */ jsx18("dt", { children: "Total received" }),
6296
+ /* @__PURE__ */ jsx18("dd", { children: currency(remittance.totalPostedCash) })
5907
6297
  ] }),
5908
- /* @__PURE__ */ jsxs16("div", { children: [
5909
- /* @__PURE__ */ jsx16("dt", { children: "Balance due" }),
5910
- /* @__PURE__ */ jsx16("dd", { children: currency(remittance.balanceDue) })
6298
+ /* @__PURE__ */ jsxs18("div", { children: [
6299
+ /* @__PURE__ */ jsx18("dt", { children: "Balance due" }),
6300
+ /* @__PURE__ */ jsx18("dd", { children: currency(remittance.balanceDue) })
5911
6301
  ] })
5912
6302
  ] }),
5913
- remittance.denialReason ? /* @__PURE__ */ jsxs16("div", { className: "mb-denial", children: [
5914
- /* @__PURE__ */ jsx16("strong", { children: "Denial reason" }),
5915
- /* @__PURE__ */ jsx16("p", { children: remittance.denialReason })
6303
+ remittance.denialReason ? /* @__PURE__ */ jsxs18("div", { className: "mb-denial", children: [
6304
+ /* @__PURE__ */ jsx18("strong", { children: "Denial reason" }),
6305
+ /* @__PURE__ */ jsx18("p", { children: remittance.denialReason })
5916
6306
  ] }) : null
5917
6307
  ] });
5918
6308
  }
@@ -5927,72 +6317,72 @@ function BillPayerContactCard({ delivery, appearance, className, style }) {
5927
6317
  delivery.contacts.portalUrl ? ["Portal", "Open payer portal", delivery.contacts.portalUrl] : null
5928
6318
  ].filter(Boolean);
5929
6319
  if (!delivery.payerName && !contacts2.length) return null;
5930
- return /* @__PURE__ */ jsxs16("section", { className: classes("mb-surface mb-contacts", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Payer contact information", children: [
5931
- /* @__PURE__ */ jsx16("style", { children: lifecycleSurfaceStyles }),
5932
- /* @__PURE__ */ jsx16("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs16("div", { children: [
5933
- /* @__PURE__ */ jsx16("strong", { children: delivery.payerName || "Claims administrator" }),
5934
- /* @__PURE__ */ jsx16("span", { children: "Billing and follow-up contacts." })
6320
+ return /* @__PURE__ */ jsxs18("section", { className: classes("mb-surface mb-contacts", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Payer contact information", children: [
6321
+ /* @__PURE__ */ jsx18("style", { children: lifecycleSurfaceStyles }),
6322
+ /* @__PURE__ */ jsx18("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs18("div", { children: [
6323
+ /* @__PURE__ */ jsx18("strong", { children: delivery.payerName || "Claims administrator" }),
6324
+ /* @__PURE__ */ jsx18("span", { children: "Billing and follow-up contacts." })
5935
6325
  ] }) }),
5936
- !contacts2.length ? /* @__PURE__ */ jsx16("p", { className: "mb-empty", children: "No payer contact details are available." }) : /* @__PURE__ */ jsx16("dl", { children: contacts2.map(([label, value, href]) => /* @__PURE__ */ jsxs16("div", { children: [
5937
- /* @__PURE__ */ jsx16("dt", { children: label }),
5938
- /* @__PURE__ */ jsx16("dd", { children: href ? /* @__PURE__ */ jsx16("a", { href, target: label === "Portal" ? "_blank" : void 0, rel: label === "Portal" ? "noreferrer noopener" : void 0, children: value }) : value })
6326
+ !contacts2.length ? /* @__PURE__ */ jsx18("p", { className: "mb-empty", children: "No payer contact details are available." }) : /* @__PURE__ */ jsx18("dl", { children: contacts2.map(([label, value, href]) => /* @__PURE__ */ jsxs18("div", { children: [
6327
+ /* @__PURE__ */ jsx18("dt", { children: label }),
6328
+ /* @__PURE__ */ jsx18("dd", { children: href ? /* @__PURE__ */ jsx18("a", { href, target: label === "Portal" ? "_blank" : void 0, rel: label === "Portal" ? "noreferrer noopener" : void 0, children: value }) : value })
5939
6329
  ] }, label)) })
5940
6330
  ] });
5941
6331
  }
5942
6332
  function BillPaymentLedger({ payments, appearance, className, style }) {
5943
- return /* @__PURE__ */ jsxs16("section", { className: classes("mb-surface mb-payments", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Payment ledger", children: [
5944
- /* @__PURE__ */ jsx16("style", { children: lifecycleSurfaceStyles }),
5945
- /* @__PURE__ */ jsx16("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs16("div", { children: [
5946
- /* @__PURE__ */ jsx16("strong", { children: "Payments" }),
5947
- /* @__PURE__ */ jsx16("span", { children: "Funds recorded against this bill." })
6333
+ return /* @__PURE__ */ jsxs18("section", { className: classes("mb-surface mb-payments", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Payment ledger", children: [
6334
+ /* @__PURE__ */ jsx18("style", { children: lifecycleSurfaceStyles }),
6335
+ /* @__PURE__ */ jsx18("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs18("div", { children: [
6336
+ /* @__PURE__ */ jsx18("strong", { children: "Payments" }),
6337
+ /* @__PURE__ */ jsx18("span", { children: "Funds recorded against this bill." })
5948
6338
  ] }) }),
5949
- !payments.length ? /* @__PURE__ */ jsx16("p", { className: "mb-empty", children: "No payments posted." }) : /* @__PURE__ */ jsx16("div", { className: "mb-payment-list", children: payments.map((payment) => {
6339
+ !payments.length ? /* @__PURE__ */ jsx18("p", { className: "mb-empty", children: "No payments posted." }) : /* @__PURE__ */ jsx18("div", { className: "mb-payment-list", children: payments.map((payment) => {
5950
6340
  const additional = payment.feeAmount ?? 0;
5951
- return /* @__PURE__ */ jsxs16("article", { children: [
5952
- /* @__PURE__ */ jsxs16("div", { className: "mb-payment-amount", children: [
5953
- /* @__PURE__ */ jsx16("strong", { children: currency(payment.amount) }),
5954
- /* @__PURE__ */ jsx16("span", { children: "Total received" })
6341
+ return /* @__PURE__ */ jsxs18("article", { children: [
6342
+ /* @__PURE__ */ jsxs18("div", { className: "mb-payment-amount", children: [
6343
+ /* @__PURE__ */ jsx18("strong", { children: currency(payment.amount) }),
6344
+ /* @__PURE__ */ jsx18("span", { children: "Total received" })
5955
6345
  ] }),
5956
- /* @__PURE__ */ jsxs16("dl", { children: [
5957
- /* @__PURE__ */ jsxs16("div", { children: [
5958
- /* @__PURE__ */ jsx16("dt", { children: "Applied to bill" }),
5959
- /* @__PURE__ */ jsx16("dd", { children: currency(payment.principalAmount) })
6346
+ /* @__PURE__ */ jsxs18("dl", { children: [
6347
+ /* @__PURE__ */ jsxs18("div", { children: [
6348
+ /* @__PURE__ */ jsx18("dt", { children: "Applied to bill" }),
6349
+ /* @__PURE__ */ jsx18("dd", { children: currency(payment.principalAmount) })
5960
6350
  ] }),
5961
- additional > 0 ? /* @__PURE__ */ jsxs16("div", { children: [
5962
- /* @__PURE__ */ jsx16("dt", { children: "Penalty & interest" }),
5963
- /* @__PURE__ */ jsx16("dd", { children: currency(additional) })
6351
+ additional > 0 ? /* @__PURE__ */ jsxs18("div", { children: [
6352
+ /* @__PURE__ */ jsx18("dt", { children: "Penalty & interest" }),
6353
+ /* @__PURE__ */ jsx18("dd", { children: currency(additional) })
5964
6354
  ] }) : null,
5965
- /* @__PURE__ */ jsxs16("div", { children: [
5966
- /* @__PURE__ */ jsx16("dt", { children: "Method" }),
5967
- /* @__PURE__ */ jsx16("dd", { children: payment.method.toUpperCase() })
6355
+ /* @__PURE__ */ jsxs18("div", { children: [
6356
+ /* @__PURE__ */ jsx18("dt", { children: "Method" }),
6357
+ /* @__PURE__ */ jsx18("dd", { children: payment.method.toUpperCase() })
5968
6358
  ] }),
5969
- /* @__PURE__ */ jsxs16("div", { children: [
5970
- /* @__PURE__ */ jsx16("dt", { children: "Reference" }),
5971
- /* @__PURE__ */ jsx16("dd", { children: payment.checkNumber || "\u2014" })
6359
+ /* @__PURE__ */ jsxs18("div", { children: [
6360
+ /* @__PURE__ */ jsx18("dt", { children: "Reference" }),
6361
+ /* @__PURE__ */ jsx18("dd", { children: payment.checkNumber || "\u2014" })
5972
6362
  ] }),
5973
- /* @__PURE__ */ jsxs16("div", { children: [
5974
- /* @__PURE__ */ jsx16("dt", { children: "Effective date" }),
5975
- /* @__PURE__ */ jsx16("dd", { children: payment.receivedDate || payment.depositDate || defaultFormatDate(payment.postedAt) })
6363
+ /* @__PURE__ */ jsxs18("div", { children: [
6364
+ /* @__PURE__ */ jsx18("dt", { children: "Effective date" }),
6365
+ /* @__PURE__ */ jsx18("dd", { children: payment.receivedDate || payment.depositDate || defaultFormatDate(payment.postedAt) })
5976
6366
  ] }),
5977
- /* @__PURE__ */ jsxs16("div", { children: [
5978
- /* @__PURE__ */ jsx16("dt", { children: "Deposit date" }),
5979
- /* @__PURE__ */ jsx16("dd", { children: payment.depositDate || "Not recorded" })
6367
+ /* @__PURE__ */ jsxs18("div", { children: [
6368
+ /* @__PURE__ */ jsx18("dt", { children: "Deposit date" }),
6369
+ /* @__PURE__ */ jsx18("dd", { children: payment.depositDate || "Not recorded" })
5980
6370
  ] }),
5981
- /* @__PURE__ */ jsxs16("div", { children: [
5982
- /* @__PURE__ */ jsx16("dt", { children: "Posted" }),
5983
- /* @__PURE__ */ jsxs16("dd", { children: [
6371
+ /* @__PURE__ */ jsxs18("div", { children: [
6372
+ /* @__PURE__ */ jsx18("dt", { children: "Posted" }),
6373
+ /* @__PURE__ */ jsxs18("dd", { children: [
5984
6374
  defaultFormatDate(payment.postedAt),
5985
6375
  " \xB7 ",
5986
6376
  payment.source.toUpperCase()
5987
6377
  ] })
5988
6378
  ] }),
5989
- /* @__PURE__ */ jsxs16("div", { children: [
5990
- /* @__PURE__ */ jsx16("dt", { children: "Status" }),
5991
- /* @__PURE__ */ jsx16("dd", { children: humanize(payment.status || "posted") })
6379
+ /* @__PURE__ */ jsxs18("div", { children: [
6380
+ /* @__PURE__ */ jsx18("dt", { children: "Status" }),
6381
+ /* @__PURE__ */ jsx18("dd", { children: humanize(payment.status || "posted") })
5992
6382
  ] })
5993
6383
  ] }),
5994
- payment.feeReason ? /* @__PURE__ */ jsx16("p", { children: payment.feeReason }) : null,
5995
- payment.note ? /* @__PURE__ */ jsx16("p", { children: payment.note }) : null
6384
+ payment.feeReason ? /* @__PURE__ */ jsx18("p", { children: payment.feeReason }) : null,
6385
+ payment.note ? /* @__PURE__ */ jsx18("p", { children: payment.note }) : null
5996
6386
  ] }, payment.id);
5997
6387
  }) })
5998
6388
  ] });
@@ -6049,27 +6439,27 @@ var lifecycleSurfaceStyles = `
6049
6439
  // src/connected-bill-lifecycle.tsx
6050
6440
  import {
6051
6441
  useCallback as useCallback4,
6052
- useEffect as useEffect12,
6053
- useMemo as useMemo9,
6442
+ useEffect as useEffect13,
6443
+ useMemo as useMemo10,
6054
6444
  useRef as useRef8,
6055
- useState as useState14
6445
+ useState as useState16
6056
6446
  } from "react";
6057
6447
  import {
6058
- DEFAULT_API_BASE_URL as DEFAULT_API_BASE_URL2,
6059
- DEFAULT_SESSION_ENDPOINT as DEFAULT_SESSION_ENDPOINT2,
6448
+ DEFAULT_API_BASE_URL as DEFAULT_API_BASE_URL3,
6449
+ DEFAULT_SESSION_ENDPOINT as DEFAULT_SESSION_ENDPOINT3,
6060
6450
  createBillLifecycleClient,
6061
6451
  reportBillStatusContacts,
6062
6452
  secondReviewDeadline
6063
6453
  } from "@mindbill/browser";
6064
6454
 
6065
6455
  // src/second-review-form.tsx
6066
- import { useMemo as useMemo8, useState as useState13 } from "react";
6456
+ import { useMemo as useMemo9, useState as useState15 } from "react";
6067
6457
 
6068
6458
  // src/second-review-corrections.ts
6069
6459
  import { parseSecondReviewCorrection } from "@mindbill/browser";
6070
6460
 
6071
6461
  // src/second-review-form.tsx
6072
- import { Fragment as Fragment14, jsx as jsx17, jsxs as jsxs17 } from "react/jsx-runtime";
6462
+ import { Fragment as Fragment14, jsx as jsx19, jsxs as jsxs19 } from "react/jsx-runtime";
6073
6463
  var SECOND_REVIEW_REASON_TEMPLATES = [
6074
6464
  {
6075
6465
  label: "Med-legal report denied",
@@ -6104,7 +6494,7 @@ var SECOND_REVIEW_REASON_TEMPLATES = [
6104
6494
  value: "This service was provided before the claims administrator accepted or denied liability and was authorized under California Labor Code section 5402(c). Please reprocess this service and issue payment."
6105
6495
  }
6106
6496
  ];
6107
- var css11 = `
6497
+ var css12 = `
6108
6498
  .mb-second-review{display:grid;gap:18px;padding:22px;color:var(--mb-text);font-family:var(--mb-font);background:var(--mb-surface);border:1px solid var(--mb-border);border-radius:var(--mb-radius);box-shadow:var(--mb-shadow)}
6109
6499
  .mb-second-review *{box-sizing:border-box}.mb-second-review h3{margin:0;font-size:22px}.mb-second-review p{margin:4px 0 0;color:var(--mb-muted)}
6110
6500
  .mb-second-review-deadline{padding:12px 14px;border-radius:var(--mb-control-radius);background:color-mix(in srgb,var(--mb-warning) 10%,var(--mb-surface));color:var(--mb-text)!important}
@@ -6117,7 +6507,7 @@ var css11 = `
6117
6507
  .mb-second-review-corrections{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.mb-second-review-correction-note{font-size:13px}
6118
6508
  @media(max-width:680px){.mb-second-review{padding:16px}.mb-second-review-line-head{align-items:flex-start;flex-direction:column}.mb-second-review-metrics{flex-wrap:wrap}.mb-second-review-corrections{grid-template-columns:1fr}}
6119
6509
  `;
6120
- function money5(value) {
6510
+ function money6(value) {
6121
6511
  return new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" }).format(value);
6122
6512
  }
6123
6513
  function initialLineDrafts(data) {
@@ -6142,13 +6532,13 @@ function SecondReviewForm({
6142
6532
  onCancel,
6143
6533
  onSubmit
6144
6534
  }) {
6145
- const [lines, setLines] = useState13(() => initialLineDrafts(data));
6146
- const [attachmentIds, setAttachmentIds] = useState13(() => data.bill.attachments.map((attachment) => attachment.id));
6147
- const [uploads, setUploads] = useState13([]);
6148
- const [formError, setFormError] = useState13("");
6149
- const [preparing, setPreparing] = useState13(false);
6150
- const [delivery, setDelivery] = useState13(null);
6151
- const selectableLines = useMemo8(() => data.bill.lineItems.filter((line) => Boolean(line.id)), [data.bill.lineItems]);
6535
+ const [lines, setLines] = useState15(() => initialLineDrafts(data));
6536
+ const [attachmentIds, setAttachmentIds] = useState15(() => data.bill.attachments.map((attachment) => attachment.id));
6537
+ const [uploads, setUploads] = useState15([]);
6538
+ const [formError, setFormError] = useState15("");
6539
+ const [preparing, setPreparing] = useState15(false);
6540
+ const [delivery, setDelivery] = useState15(null);
6541
+ const selectableLines = useMemo9(() => data.bill.lineItems.filter((line) => Boolean(line.id)), [data.bill.lineItems]);
6152
6542
  const selected = selectableLines.filter((line) => lines[line.id]?.selected);
6153
6543
  const invalidReason = selected.some((line) => !lines[line.id]?.reason.trim());
6154
6544
  const correctionErrors = Object.fromEntries(selected.map((line) => {
@@ -6247,118 +6637,118 @@ function SecondReviewForm({
6247
6637
  setPreparing(false);
6248
6638
  }
6249
6639
  };
6250
- return /* @__PURE__ */ jsxs17(Fragment14, { children: [
6251
- /* @__PURE__ */ jsx17("style", { children: css11 }),
6252
- /* @__PURE__ */ jsxs17("section", { className: "mb-second-review", children: [
6253
- /* @__PURE__ */ jsxs17("div", { children: [
6254
- /* @__PURE__ */ jsx17("h3", { children: "Submit Second Review" }),
6255
- /* @__PURE__ */ jsx17("p", { children: "Select each disputed service and explain why it should be reconsidered." })
6640
+ return /* @__PURE__ */ jsxs19(Fragment14, { children: [
6641
+ /* @__PURE__ */ jsx19("style", { children: css12 }),
6642
+ /* @__PURE__ */ jsxs19("section", { className: "mb-second-review", children: [
6643
+ /* @__PURE__ */ jsxs19("div", { children: [
6644
+ /* @__PURE__ */ jsx19("h3", { children: "Submit Second Review" }),
6645
+ /* @__PURE__ */ jsx19("p", { children: "Select each disputed service and explain why it should be reconsidered." })
6256
6646
  ] }),
6257
- /* @__PURE__ */ jsxs17("label", { className: "mb-second-review-template", children: [
6258
- /* @__PURE__ */ jsx17("span", { className: "mb-second-review-label", children: "Apply a saved reason to selected lines" }),
6259
- /* @__PURE__ */ jsxs17("select", { className: "mb-second-review-select", defaultValue: "", onChange: (event) => {
6647
+ /* @__PURE__ */ jsxs19("label", { className: "mb-second-review-template", children: [
6648
+ /* @__PURE__ */ jsx19("span", { className: "mb-second-review-label", children: "Apply a saved reason to selected lines" }),
6649
+ /* @__PURE__ */ jsxs19("select", { className: "mb-second-review-select", defaultValue: "", onChange: (event) => {
6260
6650
  applyTemplate(event.target.value);
6261
6651
  event.target.value = "";
6262
6652
  }, children: [
6263
- /* @__PURE__ */ jsx17("option", { value: "", children: "Choose a reason template (optional)" }),
6264
- SECOND_REVIEW_REASON_TEMPLATES.map((template) => /* @__PURE__ */ jsx17("option", { value: template.value, children: template.label }, template.label))
6653
+ /* @__PURE__ */ jsx19("option", { value: "", children: "Choose a reason template (optional)" }),
6654
+ SECOND_REVIEW_REASON_TEMPLATES.map((template) => /* @__PURE__ */ jsx19("option", { value: template.value, children: template.label }, template.label))
6265
6655
  ] })
6266
6656
  ] }),
6267
- /* @__PURE__ */ jsxs17("section", { className: "mb-second-review-lines", "aria-label": "Service lines in dispute", children: [
6657
+ /* @__PURE__ */ jsxs19("section", { className: "mb-second-review-lines", "aria-label": "Service lines in dispute", children: [
6268
6658
  selectableLines.map((line) => {
6269
6659
  const draft = lines[line.id];
6270
- return /* @__PURE__ */ jsxs17("article", { className: "mb-second-review-line", "data-selected": draft?.selected, children: [
6271
- /* @__PURE__ */ jsxs17("div", { className: "mb-second-review-line-head", children: [
6272
- /* @__PURE__ */ jsxs17("label", { className: "mb-second-review-check", children: [
6273
- /* @__PURE__ */ jsx17("input", { type: "checkbox", checked: Boolean(draft?.selected), onChange: (event) => patchLine(line.id, { selected: event.target.checked }) }),
6274
- /* @__PURE__ */ jsxs17("span", { children: [
6660
+ return /* @__PURE__ */ jsxs19("article", { className: "mb-second-review-line", "data-selected": draft?.selected, children: [
6661
+ /* @__PURE__ */ jsxs19("div", { className: "mb-second-review-line-head", children: [
6662
+ /* @__PURE__ */ jsxs19("label", { className: "mb-second-review-check", children: [
6663
+ /* @__PURE__ */ jsx19("input", { type: "checkbox", checked: Boolean(draft?.selected), onChange: (event) => patchLine(line.id, { selected: event.target.checked }) }),
6664
+ /* @__PURE__ */ jsxs19("span", { children: [
6275
6665
  line.code,
6276
6666
  line.modifiers.length ? `-${line.modifiers.join("-")}` : ""
6277
6667
  ] })
6278
6668
  ] }),
6279
- /* @__PURE__ */ jsxs17("span", { className: "mb-second-review-metrics", children: [
6280
- /* @__PURE__ */ jsxs17("span", { children: [
6669
+ /* @__PURE__ */ jsxs19("span", { className: "mb-second-review-metrics", children: [
6670
+ /* @__PURE__ */ jsxs19("span", { children: [
6281
6671
  line.units,
6282
6672
  " unit",
6283
6673
  line.units === 1 ? "" : "s"
6284
6674
  ] }),
6285
- /* @__PURE__ */ jsx17("span", { children: money5(line.charge) })
6675
+ /* @__PURE__ */ jsx19("span", { children: money6(line.charge) })
6286
6676
  ] })
6287
6677
  ] }),
6288
- draft?.selected ? /* @__PURE__ */ jsxs17(Fragment14, { children: [
6289
- /* @__PURE__ */ jsxs17("label", { className: "mb-second-review-field", children: [
6290
- /* @__PURE__ */ jsx17("span", { className: "mb-second-review-label", children: "Reason for requesting Second Review" }),
6291
- /* @__PURE__ */ jsx17("textarea", { className: "mb-second-review-textarea", required: true, value: draft.reason, onChange: (event) => patchLine(line.id, { reason: event.target.value }) })
6678
+ draft?.selected ? /* @__PURE__ */ jsxs19(Fragment14, { children: [
6679
+ /* @__PURE__ */ jsxs19("label", { className: "mb-second-review-field", children: [
6680
+ /* @__PURE__ */ jsx19("span", { className: "mb-second-review-label", children: "Reason for requesting Second Review" }),
6681
+ /* @__PURE__ */ jsx19("textarea", { className: "mb-second-review-textarea", required: true, value: draft.reason, onChange: (event) => patchLine(line.id, { reason: event.target.value }) })
6292
6682
  ] }),
6293
- /* @__PURE__ */ jsxs17("div", { className: "mb-second-review-auth", role: "radiogroup", "aria-label": `Service or good ${line.code} authorized`, children: [
6294
- /* @__PURE__ */ jsx17("strong", { children: "Service/Good Authorized?" }),
6295
- [["yes", "Yes"], ["no", "No"], ["", "Not specified"]].map(([value, label]) => /* @__PURE__ */ jsxs17("label", { children: [
6296
- /* @__PURE__ */ jsx17("input", { type: "radio", name: `authorized-${line.id}`, checked: draft.serviceAuthorized === value, onChange: () => patchLine(line.id, { serviceAuthorized: value }) }),
6683
+ /* @__PURE__ */ jsxs19("div", { className: "mb-second-review-auth", role: "radiogroup", "aria-label": `Service or good ${line.code} authorized`, children: [
6684
+ /* @__PURE__ */ jsx19("strong", { children: "Service/Good Authorized?" }),
6685
+ [["yes", "Yes"], ["no", "No"], ["", "Not specified"]].map(([value, label]) => /* @__PURE__ */ jsxs19("label", { children: [
6686
+ /* @__PURE__ */ jsx19("input", { type: "radio", name: `authorized-${line.id}`, checked: draft.serviceAuthorized === value, onChange: () => patchLine(line.id, { serviceAuthorized: value }) }),
6297
6687
  label
6298
6688
  ] }, label))
6299
6689
  ] })
6300
6690
  ] }) : null,
6301
- draft?.selected ? /* @__PURE__ */ jsxs17(Fragment14, { children: [
6302
- /* @__PURE__ */ jsxs17("label", { className: "mb-second-review-check", children: [
6303
- /* @__PURE__ */ jsx17("input", { type: "checkbox", checked: draft.correctBilling, onChange: (event) => patchLine(line.id, { correctBilling: event.target.checked, chargeReviewed: false }) }),
6691
+ draft?.selected ? /* @__PURE__ */ jsxs19(Fragment14, { children: [
6692
+ /* @__PURE__ */ jsxs19("label", { className: "mb-second-review-check", children: [
6693
+ /* @__PURE__ */ jsx19("input", { type: "checkbox", checked: draft.correctBilling, onChange: (event) => patchLine(line.id, { correctBilling: event.target.checked, chargeReviewed: false }) }),
6304
6694
  "Correct units or modifiers on this submission"
6305
6695
  ] }),
6306
- draft.correctBilling ? /* @__PURE__ */ jsxs17(Fragment14, { children: [
6307
- /* @__PURE__ */ jsx17("p", { className: "mb-second-review-correction-note", children: "Earlier submissions stay unchanged. Review the charge explicitly; changing units or modifiers does not recalculate it." }),
6308
- /* @__PURE__ */ jsxs17("div", { className: "mb-second-review-corrections", children: [
6309
- /* @__PURE__ */ jsxs17("label", { className: "mb-second-review-field", children: [
6310
- /* @__PURE__ */ jsx17("span", { className: "mb-second-review-label", children: "Corrected units" }),
6311
- /* @__PURE__ */ jsx17("input", { className: "mb-second-review-select", type: "number", min: "1", max: "10000", step: "1", value: draft.units, onChange: (event) => patchLine(line.id, { units: event.target.value, chargeReviewed: false }) })
6696
+ draft.correctBilling ? /* @__PURE__ */ jsxs19(Fragment14, { children: [
6697
+ /* @__PURE__ */ jsx19("p", { className: "mb-second-review-correction-note", children: "Earlier submissions stay unchanged. Review the charge explicitly; changing units or modifiers does not recalculate it." }),
6698
+ /* @__PURE__ */ jsxs19("div", { className: "mb-second-review-corrections", children: [
6699
+ /* @__PURE__ */ jsxs19("label", { className: "mb-second-review-field", children: [
6700
+ /* @__PURE__ */ jsx19("span", { className: "mb-second-review-label", children: "Corrected units" }),
6701
+ /* @__PURE__ */ jsx19("input", { className: "mb-second-review-select", type: "number", min: "1", max: "10000", step: "1", value: draft.units, onChange: (event) => patchLine(line.id, { units: event.target.value, chargeReviewed: false }) })
6312
6702
  ] }),
6313
- /* @__PURE__ */ jsxs17("label", { className: "mb-second-review-field", children: [
6314
- /* @__PURE__ */ jsx17("span", { className: "mb-second-review-label", children: "Corrected modifiers" }),
6315
- /* @__PURE__ */ jsx17("input", { className: "mb-second-review-select", placeholder: "95, 93 \u2014 or leave blank", value: draft.modifiers, onChange: (event) => patchLine(line.id, { modifiers: event.target.value, chargeReviewed: false }) })
6703
+ /* @__PURE__ */ jsxs19("label", { className: "mb-second-review-field", children: [
6704
+ /* @__PURE__ */ jsx19("span", { className: "mb-second-review-label", children: "Corrected modifiers" }),
6705
+ /* @__PURE__ */ jsx19("input", { className: "mb-second-review-select", placeholder: "95, 93 \u2014 or leave blank", value: draft.modifiers, onChange: (event) => patchLine(line.id, { modifiers: event.target.value, chargeReviewed: false }) })
6316
6706
  ] }),
6317
- /* @__PURE__ */ jsxs17("label", { className: "mb-second-review-field", children: [
6318
- /* @__PURE__ */ jsx17("span", { className: "mb-second-review-label", children: "Corrected charge ($)" }),
6319
- /* @__PURE__ */ jsx17("input", { className: "mb-second-review-select", type: "number", min: "0", max: "999999.99", step: "0.01", value: draft.charge, onChange: (event) => patchLine(line.id, { charge: event.target.value, chargeReviewed: false }) })
6707
+ /* @__PURE__ */ jsxs19("label", { className: "mb-second-review-field", children: [
6708
+ /* @__PURE__ */ jsx19("span", { className: "mb-second-review-label", children: "Corrected charge ($)" }),
6709
+ /* @__PURE__ */ jsx19("input", { className: "mb-second-review-select", type: "number", min: "0", max: "999999.99", step: "0.01", value: draft.charge, onChange: (event) => patchLine(line.id, { charge: event.target.value, chargeReviewed: false }) })
6320
6710
  ] })
6321
6711
  ] }),
6322
- /* @__PURE__ */ jsxs17("label", { className: "mb-second-review-check", children: [
6323
- /* @__PURE__ */ jsx17("input", { type: "checkbox", checked: draft.chargeReviewed, onChange: (event) => patchLine(line.id, { chargeReviewed: event.target.checked }) }),
6712
+ /* @__PURE__ */ jsxs19("label", { className: "mb-second-review-check", children: [
6713
+ /* @__PURE__ */ jsx19("input", { type: "checkbox", checked: draft.chargeReviewed, onChange: (event) => patchLine(line.id, { chargeReviewed: event.target.checked }) }),
6324
6714
  "I reviewed the corrected charge"
6325
6715
  ] }),
6326
- correctionErrors[line.id] ? /* @__PURE__ */ jsx17("p", { className: "mb-second-review-correction-note", role: "status", children: correctionErrors[line.id] }) : null
6716
+ correctionErrors[line.id] ? /* @__PURE__ */ jsx19("p", { className: "mb-second-review-correction-note", role: "status", children: correctionErrors[line.id] }) : null
6327
6717
  ] }) : null
6328
6718
  ] }) : null
6329
6719
  ] }, line.id);
6330
6720
  }),
6331
- !selectableLines.length ? /* @__PURE__ */ jsx17("div", { className: "mb-second-review-error", children: "This bill has no stable service-line identifiers. Refresh the bill before submitting a Second Review." }) : null
6721
+ !selectableLines.length ? /* @__PURE__ */ jsx19("div", { className: "mb-second-review-error", children: "This bill has no stable service-line identifiers. Refresh the bill before submitting a Second Review." }) : null
6332
6722
  ] }),
6333
- /* @__PURE__ */ jsxs17("fieldset", { className: "mb-second-review-packet", children: [
6334
- /* @__PURE__ */ jsx17("legend", { children: "Supporting packet" }),
6335
- data.bill.attachments.map((attachment) => /* @__PURE__ */ jsxs17("label", { className: "mb-second-review-document", children: [
6336
- /* @__PURE__ */ jsx17("input", { type: "checkbox", checked: attachmentIds.includes(attachment.id), onChange: (event) => setAttachmentIds((current) => event.target.checked ? [...current, attachment.id] : current.filter((id) => id !== attachment.id)) }),
6337
- /* @__PURE__ */ jsxs17("span", { children: [
6338
- /* @__PURE__ */ jsx17("strong", { children: attachment.filename }),
6339
- /* @__PURE__ */ jsx17("small", { children: attachment.description || attachment.documentType })
6723
+ /* @__PURE__ */ jsxs19("fieldset", { className: "mb-second-review-packet", children: [
6724
+ /* @__PURE__ */ jsx19("legend", { children: "Supporting packet" }),
6725
+ data.bill.attachments.map((attachment) => /* @__PURE__ */ jsxs19("label", { className: "mb-second-review-document", children: [
6726
+ /* @__PURE__ */ jsx19("input", { type: "checkbox", checked: attachmentIds.includes(attachment.id), onChange: (event) => setAttachmentIds((current) => event.target.checked ? [...current, attachment.id] : current.filter((id) => id !== attachment.id)) }),
6727
+ /* @__PURE__ */ jsxs19("span", { children: [
6728
+ /* @__PURE__ */ jsx19("strong", { children: attachment.filename }),
6729
+ /* @__PURE__ */ jsx19("small", { children: attachment.description || attachment.documentType })
6340
6730
  ] }),
6341
- /* @__PURE__ */ jsx17("button", { className: "mb-second-review-link", type: "button", onClick: () => void openAttachment(attachment).catch(() => void 0), children: "View" })
6731
+ /* @__PURE__ */ jsx19("button", { className: "mb-second-review-link", type: "button", onClick: () => void openAttachment(attachment).catch(() => void 0), children: "View" })
6342
6732
  ] }, attachment.id)),
6343
- /* @__PURE__ */ jsxs17("label", { className: "mb-second-review-upload", children: [
6344
- /* @__PURE__ */ jsx17("input", { type: "file", accept: "application/pdf,.pdf", multiple: true, onChange: addUploads }),
6345
- /* @__PURE__ */ jsxs17("span", { children: [
6346
- /* @__PURE__ */ jsx17("strong", { children: "Choose one or more PDF files" }),
6733
+ /* @__PURE__ */ jsxs19("label", { className: "mb-second-review-upload", children: [
6734
+ /* @__PURE__ */ jsx19("input", { type: "file", accept: "application/pdf,.pdf", multiple: true, onChange: addUploads }),
6735
+ /* @__PURE__ */ jsxs19("span", { children: [
6736
+ /* @__PURE__ */ jsx19("strong", { children: "Choose one or more PDF files" }),
6347
6737
  " to attach"
6348
6738
  ] })
6349
6739
  ] }),
6350
- uploads.map((upload, index) => /* @__PURE__ */ jsxs17("div", { className: "mb-second-review-uploaded", children: [
6351
- /* @__PURE__ */ jsx17("span", { children: upload.file.name }),
6352
- /* @__PURE__ */ jsx17("button", { className: "mb-second-review-link", type: "button", onClick: () => setUploads((current) => current.filter((_, itemIndex) => itemIndex !== index)), children: "Remove" })
6740
+ uploads.map((upload, index) => /* @__PURE__ */ jsxs19("div", { className: "mb-second-review-uploaded", children: [
6741
+ /* @__PURE__ */ jsx19("span", { children: upload.file.name }),
6742
+ /* @__PURE__ */ jsx19("button", { className: "mb-second-review-link", type: "button", onClick: () => setUploads((current) => current.filter((_, itemIndex) => itemIndex !== index)), children: "Remove" })
6353
6743
  ] }, `${upload.file.name}-${index}`))
6354
6744
  ] }),
6355
- formError || error?.message ? /* @__PURE__ */ jsx17("div", { className: "mb-second-review-error", role: "alert", children: formError || error?.message }) : null,
6356
- /* @__PURE__ */ jsxs17("div", { className: "mb-second-review-actions", children: [
6357
- /* @__PURE__ */ jsx17("button", { className: "mb-second-review-button secondary", type: "button", disabled: submitting || preparing, onClick: onCancel, children: "Cancel" }),
6358
- /* @__PURE__ */ jsx17("button", { className: "mb-second-review-button primary", type: "button", disabled: submitting || preparing || !selected.length || invalidReason || invalidCorrection, onClick: () => void continueToDelivery(), children: preparing ? "Preparing\u2026" : "Continue to delivery" })
6745
+ formError || error?.message ? /* @__PURE__ */ jsx19("div", { className: "mb-second-review-error", role: "alert", children: formError || error?.message }) : null,
6746
+ /* @__PURE__ */ jsxs19("div", { className: "mb-second-review-actions", children: [
6747
+ /* @__PURE__ */ jsx19("button", { className: "mb-second-review-button secondary", type: "button", disabled: submitting || preparing, onClick: onCancel, children: "Cancel" }),
6748
+ /* @__PURE__ */ jsx19("button", { className: "mb-second-review-button primary", type: "button", disabled: submitting || preparing || !selected.length || invalidReason || invalidCorrection, onClick: () => void continueToDelivery(), children: preparing ? "Preparing\u2026" : "Continue to delivery" })
6359
6749
  ] })
6360
6750
  ] }),
6361
- delivery ? /* @__PURE__ */ jsx17(SendRouteDialog, { title: "Confirm Second Review delivery", delivery, submitting: submitting || preparing, error: formError || error?.message || null, onCancel: () => setDelivery(null), onConfirm: (route) => void submit(route) }) : null
6751
+ delivery ? /* @__PURE__ */ jsx19(SendRouteDialog, { title: "Confirm Second Review delivery", delivery, submitting: submitting || preparing, error: formError || error?.message || null, onCancel: () => setDelivery(null), onConfirm: (route) => void submit(route) }) : null
6362
6752
  ] });
6363
6753
  }
6364
6754
 
@@ -6370,7 +6760,7 @@ import {
6370
6760
  reportBillStatusContacts as reportBillStatusContacts2,
6371
6761
  secondReviewDeadline as secondReviewDeadline2
6372
6762
  } from "@mindbill/browser";
6373
- import { Fragment as Fragment15, jsx as jsx18, jsxs as jsxs18 } from "react/jsx-runtime";
6763
+ import { Fragment as Fragment15, jsx as jsx20, jsxs as jsxs20 } from "react/jsx-runtime";
6374
6764
  var DEFAULT_REFRESH_INTERVAL2 = 6e4;
6375
6765
  function billTeamNotes(data) {
6376
6766
  const notes = data.notes ?? [];
@@ -6411,32 +6801,32 @@ async function openPdfFromUserGesture(loadPdf) {
6411
6801
  }
6412
6802
  function useBillLifecycle({
6413
6803
  billId: providedBillId,
6414
- sessionEndpoint = DEFAULT_SESSION_ENDPOINT2,
6804
+ sessionEndpoint = DEFAULT_SESSION_ENDPOINT3,
6415
6805
  getSession,
6416
- apiBaseUrl = DEFAULT_API_BASE_URL2,
6806
+ apiBaseUrl = DEFAULT_API_BASE_URL3,
6417
6807
  refreshInterval = DEFAULT_REFRESH_INTERVAL2,
6418
6808
  enabled = true,
6419
6809
  fetch: fetchOverride
6420
6810
  }) {
6421
- const [data, setData] = useState14(null);
6422
- const [error, setError] = useState14(null);
6423
- const [isLoading, setIsLoading] = useState14(enabled);
6424
- const [isRefreshing, setIsRefreshing] = useState14(false);
6425
- const [isMutating, setIsMutating] = useState14(false);
6811
+ const [data, setData] = useState16(null);
6812
+ const [error, setError] = useState16(null);
6813
+ const [isLoading, setIsLoading] = useState16(enabled);
6814
+ const [isRefreshing, setIsRefreshing] = useState16(false);
6815
+ const [isMutating, setIsMutating] = useState16(false);
6426
6816
  const mounted = useRef8(true);
6427
- const client = useMemo9(() => createBillLifecycleClient({
6817
+ const client = useMemo10(() => createBillLifecycleClient({
6428
6818
  billId: providedBillId,
6429
6819
  sessionEndpoint,
6430
6820
  getSession,
6431
6821
  apiBaseUrl,
6432
6822
  fetch: fetchOverride
6433
6823
  }), [apiBaseUrl, fetchOverride, getSession, providedBillId, sessionEndpoint]);
6434
- useEffect12(() => {
6824
+ useEffect13(() => {
6435
6825
  setData(null);
6436
6826
  setError(null);
6437
6827
  setIsLoading(enabled);
6438
6828
  }, [enabled, providedBillId]);
6439
- useEffect12(() => {
6829
+ useEffect13(() => {
6440
6830
  mounted.current = true;
6441
6831
  return () => {
6442
6832
  mounted.current = false;
@@ -6460,7 +6850,7 @@ function useBillLifecycle({
6460
6850
  }
6461
6851
  }
6462
6852
  }, [client, enabled]);
6463
- useEffect12(() => {
6853
+ useEffect13(() => {
6464
6854
  if (!enabled) return;
6465
6855
  void refresh();
6466
6856
  const interval = refreshInterval > 0 ? window.setInterval(() => void refresh(), refreshInterval) : null;
@@ -6566,7 +6956,7 @@ function LifecycleDialog({ children, title, wide = false, onClose }) {
6566
6956
  const dialog = useRef8(null);
6567
6957
  const onCloseRef = useRef8(onClose);
6568
6958
  onCloseRef.current = onClose;
6569
- useEffect12(() => {
6959
+ useEffect13(() => {
6570
6960
  const previous = document.activeElement;
6571
6961
  dialog.current?.focus();
6572
6962
  const onKeyDown = (event) => event.key === "Escape" && onCloseRef.current();
@@ -6576,8 +6966,8 @@ function LifecycleDialog({ children, title, wide = false, onClose }) {
6576
6966
  previous?.focus();
6577
6967
  };
6578
6968
  }, []);
6579
- return /* @__PURE__ */ jsx18("div", { className: "mb-lifecycle-dialog-backdrop", onMouseDown: (event) => event.currentTarget === event.target && onClose(), children: /* @__PURE__ */ jsxs18("div", { ref: dialog, className: ["mb-lifecycle-dialog", wide ? "wide" : ""].filter(Boolean).join(" "), role: "dialog", "aria-modal": "true", "aria-label": title, tabIndex: -1, children: [
6580
- /* @__PURE__ */ jsx18("button", { type: "button", className: "mb-lifecycle-dialog-close", "aria-label": "Close", onClick: onClose, children: "\xD7" }),
6969
+ return /* @__PURE__ */ jsx20("div", { className: "mb-lifecycle-dialog-backdrop", onMouseDown: (event) => event.currentTarget === event.target && onClose(), children: /* @__PURE__ */ jsxs20("div", { ref: dialog, className: ["mb-lifecycle-dialog", wide ? "wide" : ""].filter(Boolean).join(" "), role: "dialog", "aria-modal": "true", "aria-label": title, tabIndex: -1, children: [
6970
+ /* @__PURE__ */ jsx20("button", { type: "button", className: "mb-lifecycle-dialog-close", "aria-label": "Close", onClick: onClose, children: "\xD7" }),
6581
6971
  children
6582
6972
  ] }) });
6583
6973
  }
@@ -6616,22 +7006,22 @@ function correctionRejectionSummary(rejection) {
6616
7006
  function CorrectionRejectionReason({ rejection }) {
6617
7007
  const summary = correctionRejectionSummary(rejection);
6618
7008
  const details = rejection.issues?.filter((issue) => issue.description.trim() !== summary.description || Boolean(issue.code?.trim() && issue.code.trim() !== summary.code)) ?? [];
6619
- return /* @__PURE__ */ jsxs18("div", { className: "mb-lifecycle-correction-reason", role: "alert", children: [
6620
- summary.code ? /* @__PURE__ */ jsxs18("div", { className: "mb-lifecycle-correction-reason-code", children: [
6621
- /* @__PURE__ */ jsx18("span", { children: "Rejection code" }),
6622
- /* @__PURE__ */ jsx18("code", { children: summary.code }),
6623
- summary.clearinghouseDetail ? /* @__PURE__ */ jsxs18("small", { children: [
6624
- /* @__PURE__ */ jsx18("span", { children: "Clearinghouse detail" }),
7009
+ return /* @__PURE__ */ jsxs20("div", { className: "mb-lifecycle-correction-reason", role: "alert", children: [
7010
+ summary.code ? /* @__PURE__ */ jsxs20("div", { className: "mb-lifecycle-correction-reason-code", children: [
7011
+ /* @__PURE__ */ jsx20("span", { children: "Rejection code" }),
7012
+ /* @__PURE__ */ jsx20("code", { children: summary.code }),
7013
+ summary.clearinghouseDetail ? /* @__PURE__ */ jsxs20("small", { children: [
7014
+ /* @__PURE__ */ jsx20("span", { children: "Clearinghouse detail" }),
6625
7015
  summary.clearinghouseDetail
6626
7016
  ] }) : null
6627
7017
  ] }) : null,
6628
- /* @__PURE__ */ jsxs18("div", { className: "mb-lifecycle-correction-reason-description", children: [
6629
- /* @__PURE__ */ jsx18("span", { children: "Reason" }),
6630
- /* @__PURE__ */ jsx18("strong", { children: summary.description })
7018
+ /* @__PURE__ */ jsxs20("div", { className: "mb-lifecycle-correction-reason-description", children: [
7019
+ /* @__PURE__ */ jsx20("span", { children: "Reason" }),
7020
+ /* @__PURE__ */ jsx20("strong", { children: summary.description })
6631
7021
  ] }),
6632
- details.length ? /* @__PURE__ */ jsx18("ul", { "aria-label": "Additional rejection details", children: details.map((issue, index) => /* @__PURE__ */ jsxs18("li", { children: [
6633
- issue.code ? /* @__PURE__ */ jsx18("code", { children: issue.code }) : null,
6634
- /* @__PURE__ */ jsx18("span", { children: issue.description })
7022
+ details.length ? /* @__PURE__ */ jsx20("ul", { "aria-label": "Additional rejection details", children: details.map((issue, index) => /* @__PURE__ */ jsxs20("li", { children: [
7023
+ issue.code ? /* @__PURE__ */ jsx20("code", { children: issue.code }) : null,
7024
+ /* @__PURE__ */ jsx20("span", { children: issue.description })
6635
7025
  ] }, `${issue.code || "issue"}-${index}`)) }) : null
6636
7026
  ] });
6637
7027
  }
@@ -6672,16 +7062,16 @@ function CorrectionVerificationContact({ delivery }) {
6672
7062
  { label: "Mail", values: mailingAddresses }
6673
7063
  ].filter((method) => method.values.length);
6674
7064
  if (!methods.length) return null;
6675
- return /* @__PURE__ */ jsxs18("aside", { className: "mb-lifecycle-correction-contact", children: [
6676
- /* @__PURE__ */ jsx18("strong", { children: "Need to verify the rejected information?" }),
6677
- /* @__PURE__ */ jsxs18("span", { children: [
7065
+ return /* @__PURE__ */ jsxs20("aside", { className: "mb-lifecycle-correction-contact", children: [
7066
+ /* @__PURE__ */ jsx20("strong", { children: "Need to verify the rejected information?" }),
7067
+ /* @__PURE__ */ jsxs20("span", { children: [
6678
7068
  "Contact ",
6679
7069
  delivery.payerName,
6680
7070
  " using any available method:"
6681
7071
  ] }),
6682
- /* @__PURE__ */ jsx18("dl", { children: methods.map((method) => /* @__PURE__ */ jsxs18("div", { children: [
6683
- /* @__PURE__ */ jsx18("dt", { children: method.label }),
6684
- /* @__PURE__ */ jsx18("dd", { children: /* @__PURE__ */ jsx18("ul", { children: method.values.map((value) => /* @__PURE__ */ jsx18("li", { children: method.href ? /* @__PURE__ */ jsx18("a", { href: method.href(value), ...method.label === "Portal" ? { target: "_blank", rel: "noreferrer" } : {}, children: value }) : value }, value)) }) })
7072
+ /* @__PURE__ */ jsx20("dl", { children: methods.map((method) => /* @__PURE__ */ jsxs20("div", { children: [
7073
+ /* @__PURE__ */ jsx20("dt", { children: method.label }),
7074
+ /* @__PURE__ */ jsx20("dd", { children: /* @__PURE__ */ jsx20("ul", { children: method.values.map((value) => /* @__PURE__ */ jsx20("li", { children: method.href ? /* @__PURE__ */ jsx20("a", { href: method.href(value), ...method.label === "Portal" ? { target: "_blank", rel: "noreferrer" } : {}, children: value }) : value }, value)) }) })
6685
7075
  ] }, method.label)) })
6686
7076
  ] });
6687
7077
  }
@@ -6800,24 +7190,24 @@ function shouldShowSandboxControls(environment, enabled = false) {
6800
7190
  function ConnectedBillLifecycle({ appearance, actorName, claimsAdministratorHint, claimsAdministratorSources, courtesyCopyRecipientOptions: courtesyCopyRecipientOptions2 = [], sandboxControls = false, className, style, loadingFallback, errorFallback, onChanged, ...options }) {
6801
7191
  const lifecycle = useBillLifecycle(options);
6802
7192
  const { data } = lifecycle;
6803
- const [tab, setTab] = useState14("details");
6804
- const [selectedSubmissionId, setSelectedSubmissionId] = useState14();
6805
- const [panel, setPanel] = useState14("");
6806
- const [notice, setNotice] = useState14("");
6807
- const [note, setNote] = useState14("");
6808
- const [reason, setReason] = useState14("");
6809
- const [correctionError, setCorrectionError] = useState14("");
6810
- const [newBillError, setNewBillError] = useState14("");
6811
- const [payment, setPayment] = useState14({ amount: 0, penaltyAmount: 0, interestAmount: 0, method: "check", checkNumber: "", depositDate: today(), note: "" });
6812
- const [duplicateError, setDuplicateError] = useState14("");
7193
+ const [tab, setTab] = useState16("details");
7194
+ const [selectedSubmissionId, setSelectedSubmissionId] = useState16();
7195
+ const [panel, setPanel] = useState16("");
7196
+ const [notice, setNotice] = useState16("");
7197
+ const [note, setNote] = useState16("");
7198
+ const [reason, setReason] = useState16("");
7199
+ const [correctionError, setCorrectionError] = useState16("");
7200
+ const [newBillError, setNewBillError] = useState16("");
7201
+ const [payment, setPayment] = useState16({ amount: 0, penaltyAmount: 0, interestAmount: 0, method: "check", checkNumber: "", depositDate: today(), note: "" });
7202
+ const [duplicateError, setDuplicateError] = useState16("");
6813
7203
  const currentAttemptKey = data?.attempts?.find((attempt) => attempt.isCurrent)?.id ?? data?.history?.filter((entry) => entry.kind === "submission").at(-1)?.id ?? data?.bill.id;
6814
- useEffect12(() => {
7204
+ useEffect13(() => {
6815
7205
  setPanel("");
6816
7206
  }, [currentAttemptKey]);
6817
7207
  const actor = actorName?.trim() ? { actorName: actorName.trim() } : {};
6818
7208
  const lastData = useRef8(null);
6819
- const correctionInitialBill = useMemo9(() => data ? correctionBill(data) : null, [data]);
6820
- const correctionAttachments = useMemo9(() => data ? data.bill.attachments.map((attachment) => {
7209
+ const correctionInitialBill = useMemo10(() => data ? correctionBill(data) : null, [data]);
7210
+ const correctionAttachments = useMemo10(() => data ? data.bill.attachments.map((attachment) => {
6821
7211
  const documentType = correctionDocumentType(attachment.documentType);
6822
7212
  const isW9 = documentType === "w9";
6823
7213
  return {
@@ -6830,8 +7220,8 @@ function ConnectedBillLifecycle({ appearance, actorName, claimsAdministratorHint
6830
7220
  ...isW9 ? { autoAttached: true, removable: false } : { removable: true }
6831
7221
  };
6832
7222
  }) : [], [data, lifecycle]);
6833
- const correctionAttentionFields = useMemo9(() => data?.rejection?.issues?.flatMap((issue) => issue.fieldPaths || []).filter((path, index, fields) => fields.indexOf(path) === index) || [], [data]);
6834
- useEffect12(() => {
7223
+ const correctionAttentionFields = useMemo10(() => data?.rejection?.issues?.flatMap((issue) => issue.fieldPaths || []).filter((path, index, fields) => fields.indexOf(path) === index) || [], [data]);
7224
+ useEffect13(() => {
6835
7225
  if (!data || data === lastData.current) return;
6836
7226
  lastData.current = data;
6837
7227
  onChanged?.(data);
@@ -6843,13 +7233,13 @@ function ConnectedBillLifecycle({ appearance, actorName, claimsAdministratorHint
6843
7233
  interestAmount: 0
6844
7234
  }));
6845
7235
  }, [data, onChanged]);
6846
- if (lifecycle.isLoading && !data) return /* @__PURE__ */ jsx18(Fragment15, { children: loadingFallback ?? /* @__PURE__ */ jsx18("div", { className: "mb-lifecycle-loading", children: "Loading bill\u2026" }) });
7236
+ if (lifecycle.isLoading && !data) return /* @__PURE__ */ jsx20(Fragment15, { children: loadingFallback ?? /* @__PURE__ */ jsx20("div", { className: "mb-lifecycle-loading", children: "Loading bill\u2026" }) });
6847
7237
  if (!data) {
6848
7238
  const error = lifecycle.error ?? new Error("Bill could not be loaded.");
6849
- return /* @__PURE__ */ jsx18(Fragment15, { children: errorFallback?.(error, lifecycle.refresh) ?? /* @__PURE__ */ jsxs18("div", { className: "mb-lifecycle-error", role: "alert", children: [
6850
- /* @__PURE__ */ jsx18("strong", { children: "Billing is unavailable." }),
6851
- /* @__PURE__ */ jsx18("span", { children: error.message }),
6852
- /* @__PURE__ */ jsx18("button", { type: "button", onClick: () => void lifecycle.refresh(), children: "Try again" })
7239
+ return /* @__PURE__ */ jsx20(Fragment15, { children: errorFallback?.(error, lifecycle.refresh) ?? /* @__PURE__ */ jsxs20("div", { className: "mb-lifecycle-error", role: "alert", children: [
7240
+ /* @__PURE__ */ jsx20("strong", { children: "Billing is unavailable." }),
7241
+ /* @__PURE__ */ jsx20("span", { children: error.message }),
7242
+ /* @__PURE__ */ jsx20("button", { type: "button", onClick: () => void lifecycle.refresh(), children: "Try again" })
6853
7243
  ] }) });
6854
7244
  }
6855
7245
  const complete = async (message, task) => {
@@ -6972,121 +7362,121 @@ function ConnectedBillLifecycle({ appearance, actorName, claimsAdministratorHint
6972
7362
  const statusContacts = reportBillStatusContacts(data.delivery);
6973
7363
  const receiptEntries = (data.history ?? []).filter((entry) => entry.kind === "submission" || entry.kind === "ack");
6974
7364
  const reviewDeadline = secondReviewDeadline(data.eors);
6975
- return /* @__PURE__ */ jsxs18("section", { className: ["mb-connected-lifecycle", className].filter(Boolean).join(" "), style: mindBillAppearanceStyle(appearance, style), children: [
6976
- /* @__PURE__ */ jsx18("style", { children: CONNECTED_LIFECYCLE_STYLES }),
6977
- ribbonItems.length >= 2 ? /* @__PURE__ */ jsx18(BillSubmissionsRibbon, { items: ribbonItems, onSelect: (item) => {
7365
+ return /* @__PURE__ */ jsxs20("section", { className: ["mb-connected-lifecycle", className].filter(Boolean).join(" "), style: mindBillAppearanceStyle(appearance, style), children: [
7366
+ /* @__PURE__ */ jsx20("style", { children: CONNECTED_LIFECYCLE_STYLES }),
7367
+ ribbonItems.length >= 2 ? /* @__PURE__ */ jsx20(BillSubmissionsRibbon, { items: ribbonItems, onSelect: (item) => {
6978
7368
  setSelectedSubmissionId(item.id);
6979
7369
  setTab("details");
6980
7370
  setPanel("");
6981
7371
  }, ...appearance ? { appearance } : {} }) : null,
6982
- historical ? null : data.lifecycle.state.toLowerCase() === "rejected" && data.rejection ? /* @__PURE__ */ jsx18(BillRejectionNotice, { rejection: data.rejection, submittedAt: data.lifecycle.submittedAt ?? null, ...appearance ? { appearance } : {} }) : /* @__PURE__ */ jsx18(BillLifecycleProgress, { state: data.lifecycle.state, nativeStatus: data.lifecycle.nativeStatus, submittedAt: data.lifecycle.submittedAt ?? null, agingDays: data.lifecycle.agingDays ?? null, ...appearance ? { appearance } : {} }),
6983
- /* @__PURE__ */ jsxs18("header", { className: "mb-lifecycle-head", children: [
6984
- /* @__PURE__ */ jsxs18("div", { children: [
6985
- /* @__PURE__ */ jsx18("div", { className: "mb-lifecycle-title", children: /* @__PURE__ */ jsx18("h2", { children: historical && !selectedAttempt ? "Previous submission" : `Bill #${historical ? selectedAttempt?.billNumber : data.bill.billNumber}` }) }),
6986
- /* @__PURE__ */ jsxs18("p", { children: [
7372
+ historical ? null : data.lifecycle.state.toLowerCase() === "rejected" && data.rejection ? /* @__PURE__ */ jsx20(BillRejectionNotice, { rejection: data.rejection, submittedAt: data.lifecycle.submittedAt ?? null, ...appearance ? { appearance } : {} }) : /* @__PURE__ */ jsx20(BillLifecycleProgress, { state: data.lifecycle.state, nativeStatus: data.lifecycle.nativeStatus, submittedAt: data.lifecycle.submittedAt ?? null, agingDays: data.lifecycle.agingDays ?? null, ...appearance ? { appearance } : {} }),
7373
+ /* @__PURE__ */ jsxs20("header", { className: "mb-lifecycle-head", children: [
7374
+ /* @__PURE__ */ jsxs20("div", { children: [
7375
+ /* @__PURE__ */ jsx20("div", { className: "mb-lifecycle-title", children: /* @__PURE__ */ jsx20("h2", { children: historical && !selectedAttempt ? "Previous submission" : `Bill #${historical ? selectedAttempt?.billNumber : data.bill.billNumber}` }) }),
7376
+ /* @__PURE__ */ jsxs20("p", { children: [
6987
7377
  displayedData ? `Claim ${displayedData.injury.claimNumber || "\u2014"}` : "Previous submission",
6988
7378
  lifecycle.isRefreshing ? " \xB7 Refreshing\u2026" : ""
6989
7379
  ] })
6990
7380
  ] }),
6991
- !historical ? /* @__PURE__ */ jsxs18(Fragment15, { children: [
6992
- /* @__PURE__ */ jsx18("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating, onClick: () => void lifecycle.downloadPacket().catch(() => void 0), children: "Download packet" }),
6993
- /* @__PURE__ */ jsx18("button", { type: "button", className: "mb-lifecycle-button secondary", disabled: lifecycle.isMutating, onClick: () => setPanel("courtesy_copy"), children: "Forward copy" })
7381
+ !historical ? /* @__PURE__ */ jsxs20(Fragment15, { children: [
7382
+ /* @__PURE__ */ jsx20("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating, onClick: () => void lifecycle.downloadPacket().catch(() => void 0), children: "Download packet" }),
7383
+ /* @__PURE__ */ jsx20("button", { type: "button", className: "mb-lifecycle-button secondary", disabled: lifecycle.isMutating, onClick: () => setPanel("courtesy_copy"), children: "Forward copy" })
6994
7384
  ] }) : null
6995
7385
  ] }),
6996
- /* @__PURE__ */ jsxs18("div", { className: "mb-lifecycle-tabs", role: "tablist", "aria-label": "Bill view", children: [
6997
- /* @__PURE__ */ jsx18("button", { type: "button", role: "tab", "aria-selected": tab === "details", onClick: () => setTab("details"), children: "Bill details" }),
6998
- /* @__PURE__ */ jsx18("button", { type: "button", role: "tab", "aria-selected": tab === "history", onClick: () => setTab("history"), children: "Bill history" })
7386
+ /* @__PURE__ */ jsxs20("div", { className: "mb-lifecycle-tabs", role: "tablist", "aria-label": "Bill view", children: [
7387
+ /* @__PURE__ */ jsx20("button", { type: "button", role: "tab", "aria-selected": tab === "details", onClick: () => setTab("details"), children: "Bill details" }),
7388
+ /* @__PURE__ */ jsx20("button", { type: "button", role: "tab", "aria-selected": tab === "history", onClick: () => setTab("history"), children: "Bill history" })
6999
7389
  ] }),
7000
- tab === "details" ? /* @__PURE__ */ jsxs18("div", { className: "mb-lifecycle-tabpanel", role: "tabpanel", children: [
7001
- selectedAttempt && ribbonItems.length >= 2 ? /* @__PURE__ */ jsxs18("section", { className: "mb-lifecycle-attempt-detail", "aria-label": "Selected submission detail", children: [
7002
- /* @__PURE__ */ jsxs18("header", { children: [
7003
- /* @__PURE__ */ jsxs18("div", { children: [
7004
- /* @__PURE__ */ jsx18("span", { children: "Selected submission" }),
7005
- /* @__PURE__ */ jsx18("h3", { children: selectedAttempt.label })
7390
+ tab === "details" ? /* @__PURE__ */ jsxs20("div", { className: "mb-lifecycle-tabpanel", role: "tabpanel", children: [
7391
+ selectedAttempt && ribbonItems.length >= 2 ? /* @__PURE__ */ jsxs20("section", { className: "mb-lifecycle-attempt-detail", "aria-label": "Selected submission detail", children: [
7392
+ /* @__PURE__ */ jsxs20("header", { children: [
7393
+ /* @__PURE__ */ jsxs20("div", { children: [
7394
+ /* @__PURE__ */ jsx20("span", { children: "Selected submission" }),
7395
+ /* @__PURE__ */ jsx20("h3", { children: selectedAttempt.label })
7006
7396
  ] }),
7007
- /* @__PURE__ */ jsx18("strong", { children: selectedAttempt.isCurrent ? "Current" : "Previous" })
7397
+ /* @__PURE__ */ jsx20("strong", { children: selectedAttempt.isCurrent ? "Current" : "Previous" })
7008
7398
  ] }),
7009
- /* @__PURE__ */ jsxs18("dl", { children: [
7010
- /* @__PURE__ */ jsxs18("div", { children: [
7011
- /* @__PURE__ */ jsx18("dt", { children: "Bill" }),
7012
- /* @__PURE__ */ jsxs18("dd", { children: [
7399
+ /* @__PURE__ */ jsxs20("dl", { children: [
7400
+ /* @__PURE__ */ jsxs20("div", { children: [
7401
+ /* @__PURE__ */ jsx20("dt", { children: "Bill" }),
7402
+ /* @__PURE__ */ jsxs20("dd", { children: [
7013
7403
  "#",
7014
7404
  selectedAttempt.billNumber || data.bill.billNumber
7015
7405
  ] })
7016
7406
  ] }),
7017
- /* @__PURE__ */ jsxs18("div", { children: [
7018
- /* @__PURE__ */ jsx18("dt", { children: "Delivery" }),
7019
- /* @__PURE__ */ jsx18("dd", { children: selectedAttempt.deliveryLabel || "\u2014" })
7407
+ /* @__PURE__ */ jsxs20("div", { children: [
7408
+ /* @__PURE__ */ jsx20("dt", { children: "Delivery" }),
7409
+ /* @__PURE__ */ jsx20("dd", { children: selectedAttempt.deliveryLabel || "\u2014" })
7020
7410
  ] }),
7021
- /* @__PURE__ */ jsxs18("div", { children: [
7022
- /* @__PURE__ */ jsx18("dt", { children: "Sent" }),
7023
- /* @__PURE__ */ jsx18("dd", { children: selectedAttempt.sentAt ? new Date(selectedAttempt.sentAt).toLocaleString() : "\u2014" })
7411
+ /* @__PURE__ */ jsxs20("div", { children: [
7412
+ /* @__PURE__ */ jsx20("dt", { children: "Sent" }),
7413
+ /* @__PURE__ */ jsx20("dd", { children: selectedAttempt.sentAt ? new Date(selectedAttempt.sentAt).toLocaleString() : "\u2014" })
7024
7414
  ] }),
7025
- /* @__PURE__ */ jsxs18("div", { children: [
7026
- /* @__PURE__ */ jsx18("dt", { children: "Status" }),
7027
- /* @__PURE__ */ jsx18("dd", { children: selectedAttempt.status || selectedAttempt.ackLabel || "Submitted" })
7415
+ /* @__PURE__ */ jsxs20("div", { children: [
7416
+ /* @__PURE__ */ jsx20("dt", { children: "Status" }),
7417
+ /* @__PURE__ */ jsx20("dd", { children: selectedAttempt.status || selectedAttempt.ackLabel || "Submitted" })
7028
7418
  ] }),
7029
- selectedAttempt.complianceLabel ? /* @__PURE__ */ jsxs18("div", { children: [
7030
- /* @__PURE__ */ jsx18("dt", { children: selectedAttempt.complianceLabel }),
7031
- /* @__PURE__ */ jsx18("dd", { children: selectedAttempt.complianceAt ? new Date(selectedAttempt.complianceAt).toLocaleDateString() : "\u2014" })
7419
+ selectedAttempt.complianceLabel ? /* @__PURE__ */ jsxs20("div", { children: [
7420
+ /* @__PURE__ */ jsx20("dt", { children: selectedAttempt.complianceLabel }),
7421
+ /* @__PURE__ */ jsx20("dd", { children: selectedAttempt.complianceAt ? new Date(selectedAttempt.complianceAt).toLocaleDateString() : "\u2014" })
7032
7422
  ] }) : null
7033
7423
  ] })
7034
7424
  ] }) : null,
7035
- !historical && (data.eors.length || data.payments.length || ["processed", "denied", "partially_paid"].includes(data.lifecycle.state)) ? /* @__PURE__ */ jsx18(BillExplanationOfReview, { remittance: data.remittance, eors: data.eors, payments: data.payments, submittedAt: data.lifecycle.submittedAt ?? null, onOpenEor: lifecycle.openEor, ...appearance ? { appearance } : {} }) : null,
7036
- showSandboxControls ? /* @__PURE__ */ jsxs18("section", { className: "mb-lifecycle-simulator", "aria-label": "Sandbox lifecycle simulator", children: [
7037
- /* @__PURE__ */ jsxs18("div", { children: [
7038
- /* @__PURE__ */ jsx18("span", { children: "Sandbox demo controls" }),
7039
- /* @__PURE__ */ jsx18("h3", { children: "Simulate the next payer response" }),
7040
- /* @__PURE__ */ jsx18("p", { children: "This changes sandbox data only. The host receives the result through the same lifecycle API and components partners use." })
7425
+ !historical && (data.eors.length || data.payments.length || ["processed", "denied", "partially_paid"].includes(data.lifecycle.state)) ? /* @__PURE__ */ jsx20(BillExplanationOfReview, { remittance: data.remittance, eors: data.eors, payments: data.payments, submittedAt: data.lifecycle.submittedAt ?? null, onOpenEor: lifecycle.openEor, ...appearance ? { appearance } : {} }) : null,
7426
+ showSandboxControls ? /* @__PURE__ */ jsxs20("section", { className: "mb-lifecycle-simulator", "aria-label": "Sandbox lifecycle simulator", children: [
7427
+ /* @__PURE__ */ jsxs20("div", { children: [
7428
+ /* @__PURE__ */ jsx20("span", { children: "Sandbox demo controls" }),
7429
+ /* @__PURE__ */ jsx20("h3", { children: "Simulate the next payer response" }),
7430
+ /* @__PURE__ */ jsx20("p", { children: "This changes sandbox data only. The host receives the result through the same lifecycle API and components partners use." })
7041
7431
  ] }),
7042
- simulations.length ? /* @__PURE__ */ jsx18("div", { className: "mb-lifecycle-simulator-actions", children: simulations.map((scenario) => /* @__PURE__ */ jsxs18("button", { type: "button", disabled: lifecycle.isMutating, onClick: () => void complete(`${scenario.label} simulated.`, () => lifecycle.simulateSandbox({ scenario: scenario.id })), children: [
7043
- /* @__PURE__ */ jsx18("strong", { children: scenario.label }),
7044
- /* @__PURE__ */ jsx18("span", { children: scenario.detail })
7045
- ] }, scenario.id)) }) : /* @__PURE__ */ jsx18("p", { className: "mb-lifecycle-simulator-idle", children: "No simulated payer transition is needed at this stage. Use the bill action below to continue." })
7432
+ simulations.length ? /* @__PURE__ */ jsx20("div", { className: "mb-lifecycle-simulator-actions", children: simulations.map((scenario) => /* @__PURE__ */ jsxs20("button", { type: "button", disabled: lifecycle.isMutating, onClick: () => void complete(`${scenario.label} simulated.`, () => lifecycle.simulateSandbox({ scenario: scenario.id })), children: [
7433
+ /* @__PURE__ */ jsx20("strong", { children: scenario.label }),
7434
+ /* @__PURE__ */ jsx20("span", { children: scenario.detail })
7435
+ ] }, scenario.id)) }) : /* @__PURE__ */ jsx20("p", { className: "mb-lifecycle-simulator-idle", children: "No simulated payer transition is needed at this stage. Use the bill action below to continue." })
7046
7436
  ] }) : null,
7047
- historical ? /* @__PURE__ */ jsx18("p", { className: "mb-lifecycle-card", children: selectedDetail?.source === "submission_snapshot" ? "Saved as submitted. This previous submission is read-only; payment balances and current actions are shown on the current bill." : displayedData ? "Historical bill record. An exact as-submitted snapshot was not recorded for this older attempt; these are the stored bill values, not a guaranteed copy of the original packet." : "Detailed values were not saved for this historical submission. Select the current submission to see the current bill. We will not substitute current data for this older attempt." }) : null,
7048
- displayedData ? /* @__PURE__ */ jsx18(BillReadOnlyForm, { data: displayedData, ...!historical ? { onOpenAttachment: lifecycle.openAttachment } : {}, ...appearance ? { appearance } : {} }, activeSubmissionId) : null,
7049
- historical && selectedAttempt ? /* @__PURE__ */ jsxs18("section", { className: "mb-lifecycle-card", "aria-label": "Retained submission files", children: [
7050
- /* @__PURE__ */ jsx18("h3", { children: "Retained submission files" }),
7051
- /* @__PURE__ */ jsx18("p", { children: "Exact files saved for this submission. These downloads do not include a regenerated current bill or a later EOR." }),
7052
- selectedDetail?.artifacts?.length ? selectedDetail.artifacts.map((artifact) => /* @__PURE__ */ jsxs18("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => void lifecycle.downloadSubmissionArtifact(selectedAttempt.id, artifact.id, artifact.label).catch(() => void 0), children: [
7437
+ historical ? /* @__PURE__ */ jsx20("p", { className: "mb-lifecycle-card", children: selectedDetail?.source === "submission_snapshot" ? "Saved as submitted. This previous submission is read-only; payment balances and current actions are shown on the current bill." : displayedData ? "Historical bill record. An exact as-submitted snapshot was not recorded for this older attempt; these are the stored bill values, not a guaranteed copy of the original packet." : "Detailed values were not saved for this historical submission. Select the current submission to see the current bill. We will not substitute current data for this older attempt." }) : null,
7438
+ displayedData ? /* @__PURE__ */ jsx20(BillReadOnlyForm, { data: displayedData, ...!historical ? { onOpenAttachment: lifecycle.openAttachment } : {}, ...appearance ? { appearance } : {} }, activeSubmissionId) : null,
7439
+ historical && selectedAttempt ? /* @__PURE__ */ jsxs20("section", { className: "mb-lifecycle-card", "aria-label": "Retained submission files", children: [
7440
+ /* @__PURE__ */ jsx20("h3", { children: "Retained submission files" }),
7441
+ /* @__PURE__ */ jsx20("p", { children: "Exact files saved for this submission. These downloads do not include a regenerated current bill or a later EOR." }),
7442
+ selectedDetail?.artifacts?.length ? selectedDetail.artifacts.map((artifact) => /* @__PURE__ */ jsxs20("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => void lifecycle.downloadSubmissionArtifact(selectedAttempt.id, artifact.id, artifact.label).catch(() => void 0), children: [
7053
7443
  "Download ",
7054
7444
  artifact.kind === "submitted_edi" ? "submitted EDI" : "submitted attachment",
7055
7445
  ": ",
7056
7446
  artifact.label
7057
- ] }, artifact.id)) : /* @__PURE__ */ jsx18("p", { children: "No retained files are available for this submission." })
7447
+ ] }, artifact.id)) : /* @__PURE__ */ jsx20("p", { children: "No retained files are available for this submission." })
7058
7448
  ] }) : null,
7059
- !historical ? /* @__PURE__ */ jsxs18("section", { className: "mb-lifecycle-notes", "aria-label": "Bill notes", children: [
7060
- /* @__PURE__ */ jsxs18("header", { children: [
7061
- /* @__PURE__ */ jsxs18("div", { children: [
7062
- /* @__PURE__ */ jsx18("h3", { children: "Team notes" }),
7063
- /* @__PURE__ */ jsx18("p", { children: "Shared with your workspace\u2019s billing team. Never sent to the payer." })
7449
+ !historical ? /* @__PURE__ */ jsxs20("section", { className: "mb-lifecycle-notes", "aria-label": "Bill notes", children: [
7450
+ /* @__PURE__ */ jsxs20("header", { children: [
7451
+ /* @__PURE__ */ jsxs20("div", { children: [
7452
+ /* @__PURE__ */ jsx20("h3", { children: "Team notes" }),
7453
+ /* @__PURE__ */ jsx20("p", { children: "Shared with your workspace\u2019s billing team. Never sent to the payer." })
7064
7454
  ] }),
7065
- /* @__PURE__ */ jsx18("span", { children: billNotes.length })
7455
+ /* @__PURE__ */ jsx20("span", { children: billNotes.length })
7066
7456
  ] }),
7067
- billNotes.length ? /* @__PURE__ */ jsx18("ol", { children: billNotes.map((entry) => /* @__PURE__ */ jsxs18("li", { children: [
7068
- /* @__PURE__ */ jsx18("p", { children: entry.summary }),
7069
- /* @__PURE__ */ jsxs18("small", { children: [
7457
+ billNotes.length ? /* @__PURE__ */ jsx20("ol", { children: billNotes.map((entry) => /* @__PURE__ */ jsxs20("li", { children: [
7458
+ /* @__PURE__ */ jsx20("p", { children: entry.summary }),
7459
+ /* @__PURE__ */ jsxs20("small", { children: [
7070
7460
  entry.actor || "System",
7071
7461
  " \xB7 ",
7072
7462
  usDate(entry.date)
7073
7463
  ] })
7074
- ] }, entry.id)) }) : /* @__PURE__ */ jsx18("p", { className: "mb-lifecycle-notes-empty", children: "No notes yet." }),
7075
- /* @__PURE__ */ jsxs18("form", { onSubmit: (event) => {
7464
+ ] }, entry.id)) }) : /* @__PURE__ */ jsx20("p", { className: "mb-lifecycle-notes-empty", children: "No notes yet." }),
7465
+ /* @__PURE__ */ jsxs20("form", { onSubmit: (event) => {
7076
7466
  event.preventDefault();
7077
7467
  void addNote();
7078
7468
  }, children: [
7079
- /* @__PURE__ */ jsxs18("label", { children: [
7080
- /* @__PURE__ */ jsx18("span", { children: "Add a note" }),
7081
- /* @__PURE__ */ jsx18("textarea", { value: note, maxLength: 2e3, placeholder: "Add context for the billing team\u2026", onChange: (event) => setNote(event.target.value) })
7469
+ /* @__PURE__ */ jsxs20("label", { children: [
7470
+ /* @__PURE__ */ jsx20("span", { children: "Add a note" }),
7471
+ /* @__PURE__ */ jsx20("textarea", { value: note, maxLength: 2e3, placeholder: "Add context for the billing team\u2026", onChange: (event) => setNote(event.target.value) })
7082
7472
  ] }),
7083
- /* @__PURE__ */ jsx18("button", { type: "submit", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating || !note.trim(), children: lifecycle.isMutating ? "Adding\u2026" : "Add note" })
7473
+ /* @__PURE__ */ jsx20("button", { type: "submit", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating || !note.trim(), children: lifecycle.isMutating ? "Adding\u2026" : "Add note" })
7084
7474
  ] })
7085
7475
  ] }) : null
7086
- ] }) : /* @__PURE__ */ jsx18("div", { className: "mb-lifecycle-tabpanel", role: "tabpanel", children: data.history?.length ? /* @__PURE__ */ jsx18(BillHistoryTable, { entries: data.history, ...!historical ? { onOpenDocument: lifecycle.openAttachment } : {}, ...appearance ? { appearance } : {} }) : /* @__PURE__ */ jsx18(BillActivityTimeline, { events: data.activity, ...appearance ? { appearance } : {} }) }),
7087
- !historical && (viewEor || actions.length) ? /* @__PURE__ */ jsxs18("aside", { className: "mb-lifecycle-actions-sheet", "aria-label": "Bill actions", children: [
7088
- viewEor && data.eors[0] ? /* @__PURE__ */ jsx18("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => void lifecycle.openEor(data.eors[0]).catch(() => void 0), children: viewEor.label }) : null,
7089
- actions.map((action) => /* @__PURE__ */ jsx18("button", { type: "button", className: action.primary ? "mb-lifecycle-button primary" : "mb-lifecycle-button secondary", onClick: () => {
7476
+ ] }) : /* @__PURE__ */ jsx20("div", { className: "mb-lifecycle-tabpanel", role: "tabpanel", children: data.history?.length ? /* @__PURE__ */ jsx20(BillHistoryTable, { entries: data.history, ...!historical ? { onOpenDocument: lifecycle.openAttachment } : {}, ...appearance ? { appearance } : {} }) : /* @__PURE__ */ jsx20(BillActivityTimeline, { events: data.activity, ...appearance ? { appearance } : {} }) }),
7477
+ !historical && (viewEor || actions.length) ? /* @__PURE__ */ jsxs20("aside", { className: "mb-lifecycle-actions-sheet", "aria-label": "Bill actions", children: [
7478
+ viewEor && data.eors[0] ? /* @__PURE__ */ jsx20("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => void lifecycle.openEor(data.eors[0]).catch(() => void 0), children: viewEor.label }) : null,
7479
+ actions.map((action) => /* @__PURE__ */ jsx20("button", { type: "button", className: action.primary ? "mb-lifecycle-button primary" : "mb-lifecycle-button secondary", onClick: () => {
7090
7480
  const next = actionPanel(action);
7091
7481
  if (!next) return;
7092
7482
  if (next === "resubmit") setCorrectionError("");
@@ -7095,37 +7485,37 @@ function ConnectedBillLifecycle({ appearance, actorName, claimsAdministratorHint
7095
7485
  setPanel(next);
7096
7486
  }, children: action.label }, action.id))
7097
7487
  ] }) : null,
7098
- activePanel === "courtesy_copy" ? /* @__PURE__ */ jsx18(LifecycleDialog, { title: "Forward courtesy copy", wide: true, onClose: () => setPanel(""), children: /* @__PURE__ */ jsx18(BillCourtesyCopyForm, { documents: data.bill.attachments, recipientOptions: courtesyCopyRecipientOptions2, subject: `Courtesy copy \u2014 bill #${data.bill.billNumber}`, environment: data.environment, onPreview: lifecycle.previewCourtesyCopy, onSend: lifecycle.sendCourtesyCopy, onSent: () => {
7488
+ activePanel === "courtesy_copy" ? /* @__PURE__ */ jsx20(LifecycleDialog, { title: "Forward courtesy copy", wide: true, onClose: () => setPanel(""), children: /* @__PURE__ */ jsx20(BillCourtesyCopyForm, { documents: data.bill.attachments, recipientOptions: courtesyCopyRecipientOptions2, subject: `Courtesy copy \u2014 bill #${data.bill.billNumber}`, environment: data.environment, onPreview: lifecycle.previewCourtesyCopy, onSend: lifecycle.sendCourtesyCopy, onSent: () => {
7099
7489
  void lifecycle.refresh();
7100
7490
  }, ...appearance ? { appearance } : {} }) }) : null,
7101
- activePanel === "ibr" ? /* @__PURE__ */ jsx18(LifecycleDialog, { title: "Prepare Independent Bill Review packet", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs18("section", { className: "mb-lifecycle-panel", children: [
7102
- /* @__PURE__ */ jsx18("header", { style: { paddingRight: 44 }, children: /* @__PURE__ */ jsx18("h3", { children: "Prepare Independent Bill Review packet" }) }),
7103
- /* @__PURE__ */ jsx18("p", { children: "Download a PDF packet for self-filing Independent Bill Review (IBR). Preparing this packet does not file the review, send it to a payer, or change the bill status." }),
7104
- lifecycle.error ? /* @__PURE__ */ jsx18("p", { role: "alert", className: "mb-lifecycle-message error", children: lifecycle.error.message }) : null,
7105
- /* @__PURE__ */ jsxs18("div", { className: "mb-lifecycle-panel-actions", children: [
7106
- /* @__PURE__ */ jsx18("button", { type: "button", className: "mb-lifecycle-button secondary", disabled: lifecycle.isMutating, onClick: () => setPanel(""), children: "Cancel" }),
7107
- /* @__PURE__ */ jsx18("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating, onClick: () => void lifecycle.downloadIbrPacket().then(() => {
7491
+ activePanel === "ibr" ? /* @__PURE__ */ jsx20(LifecycleDialog, { title: "Prepare Independent Bill Review packet", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs20("section", { className: "mb-lifecycle-panel", children: [
7492
+ /* @__PURE__ */ jsx20("header", { style: { paddingRight: 44 }, children: /* @__PURE__ */ jsx20("h3", { children: "Prepare Independent Bill Review packet" }) }),
7493
+ /* @__PURE__ */ jsx20("p", { children: "Download a PDF packet for self-filing Independent Bill Review (IBR). Preparing this packet does not file the review, send it to a payer, or change the bill status." }),
7494
+ lifecycle.error ? /* @__PURE__ */ jsx20("p", { role: "alert", className: "mb-lifecycle-message error", children: lifecycle.error.message }) : null,
7495
+ /* @__PURE__ */ jsxs20("div", { className: "mb-lifecycle-panel-actions", children: [
7496
+ /* @__PURE__ */ jsx20("button", { type: "button", className: "mb-lifecycle-button secondary", disabled: lifecycle.isMutating, onClick: () => setPanel(""), children: "Cancel" }),
7497
+ /* @__PURE__ */ jsx20("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating, onClick: () => void lifecycle.downloadIbrPacket().then(() => {
7108
7498
  setPanel("");
7109
7499
  setNotice("IBR packet prepared for self-filing. The review has not been filed.");
7110
7500
  }).catch(() => void 0), children: lifecycle.isMutating ? "Preparing\u2026" : "Prepare IBR packet" })
7111
7501
  ] })
7112
7502
  ] }) }) : null,
7113
- activePanel === "resubmit" && correctionInitialBill ? /* @__PURE__ */ jsx18(LifecycleDialog, { title: "Correct and resubmit", wide: true, onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs18("section", { className: "mb-lifecycle-correction", children: [
7114
- /* @__PURE__ */ jsx18("header", { children: /* @__PURE__ */ jsxs18("div", { children: [
7115
- /* @__PURE__ */ jsx18("h3", { children: "Correct and resubmit" }),
7116
- /* @__PURE__ */ jsx18("p", { children: "Review the rejected snapshot, correct the highlighted information, and submit a new immutable attempt under this bill." })
7503
+ activePanel === "resubmit" && correctionInitialBill ? /* @__PURE__ */ jsx20(LifecycleDialog, { title: "Correct and resubmit", wide: true, onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs20("section", { className: "mb-lifecycle-correction", children: [
7504
+ /* @__PURE__ */ jsx20("header", { children: /* @__PURE__ */ jsxs20("div", { children: [
7505
+ /* @__PURE__ */ jsx20("h3", { children: "Correct and resubmit" }),
7506
+ /* @__PURE__ */ jsx20("p", { children: "Review the rejected snapshot, correct the highlighted information, and submit a new immutable attempt under this bill." })
7117
7507
  ] }) }),
7118
- data.environment === "live" ? /* @__PURE__ */ jsxs18("div", { className: "mb-lifecycle-live-warning", children: [
7119
- /* @__PURE__ */ jsx18("strong", { children: "Live clearinghouse submission" }),
7120
- /* @__PURE__ */ jsx18("span", { children: "Resubmitting sends a real bill. Confirm the corrected information before continuing." })
7508
+ data.environment === "live" ? /* @__PURE__ */ jsxs20("div", { className: "mb-lifecycle-live-warning", children: [
7509
+ /* @__PURE__ */ jsx20("strong", { children: "Live clearinghouse submission" }),
7510
+ /* @__PURE__ */ jsx20("span", { children: "Resubmitting sends a real bill. Confirm the corrected information before continuing." })
7121
7511
  ] }) : null,
7122
- data.rejection ? /* @__PURE__ */ jsx18(CorrectionRejectionReason, { rejection: data.rejection }) : null,
7123
- /* @__PURE__ */ jsx18(CorrectionVerificationContact, { delivery: data.delivery }),
7124
- /* @__PURE__ */ jsxs18("label", { className: "mb-lifecycle-correction-note", children: [
7125
- /* @__PURE__ */ jsx18("span", { children: "Correction note (optional)" }),
7126
- /* @__PURE__ */ jsx18("textarea", { value: reason, placeholder: "What changed before resubmission?", onChange: (event) => setReason(event.target.value) })
7512
+ data.rejection ? /* @__PURE__ */ jsx20(CorrectionRejectionReason, { rejection: data.rejection }) : null,
7513
+ /* @__PURE__ */ jsx20(CorrectionVerificationContact, { delivery: data.delivery }),
7514
+ /* @__PURE__ */ jsxs20("label", { className: "mb-lifecycle-correction-note", children: [
7515
+ /* @__PURE__ */ jsx20("span", { children: "Correction note (optional)" }),
7516
+ /* @__PURE__ */ jsx20("textarea", { value: reason, placeholder: "What changed before resubmission?", onChange: (event) => setReason(event.target.value) })
7127
7517
  ] }),
7128
- /* @__PURE__ */ jsx18(
7518
+ /* @__PURE__ */ jsx20(
7129
7519
  BillSubmissionForm,
7130
7520
  {
7131
7521
  className: "mbsf-lifecycle-correction",
@@ -7151,18 +7541,18 @@ function ConnectedBillLifecycle({ appearance, actorName, claimsAdministratorHint
7151
7541
  ...appearance ? { appearance } : {}
7152
7542
  }
7153
7543
  ),
7154
- correctionError ? /* @__PURE__ */ jsx18("div", { className: "mb-lifecycle-message error", role: "alert", children: correctionError }) : null
7544
+ correctionError ? /* @__PURE__ */ jsx20("div", { className: "mb-lifecycle-message error", role: "alert", children: correctionError }) : null
7155
7545
  ] }) }) : null,
7156
- activePanel === "submit_new_bill" && correctionInitialBill ? /* @__PURE__ */ jsx18(LifecycleDialog, { title: "Submit New Bill", wide: true, onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs18("section", { className: "mb-lifecycle-correction", children: [
7157
- /* @__PURE__ */ jsx18("header", { children: /* @__PURE__ */ jsxs18("div", { children: [
7158
- /* @__PURE__ */ jsx18("h3", { children: "Submit New Bill" }),
7159
- /* @__PURE__ */ jsx18("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." })
7546
+ activePanel === "submit_new_bill" && correctionInitialBill ? /* @__PURE__ */ jsx20(LifecycleDialog, { title: "Submit New Bill", wide: true, onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs20("section", { className: "mb-lifecycle-correction", children: [
7547
+ /* @__PURE__ */ jsx20("header", { children: /* @__PURE__ */ jsxs20("div", { children: [
7548
+ /* @__PURE__ */ jsx20("h3", { children: "Submit New Bill" }),
7549
+ /* @__PURE__ */ jsx20("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." })
7160
7550
  ] }) }),
7161
- /* @__PURE__ */ jsxs18("label", { className: "mb-lifecycle-correction-note", children: [
7162
- /* @__PURE__ */ jsx18("span", { children: "Submission note (optional)" }),
7163
- /* @__PURE__ */ jsx18("textarea", { value: reason, placeholder: "Why is a new bill being submitted?", onChange: (event) => setReason(event.target.value) })
7551
+ /* @__PURE__ */ jsxs20("label", { className: "mb-lifecycle-correction-note", children: [
7552
+ /* @__PURE__ */ jsx20("span", { children: "Submission note (optional)" }),
7553
+ /* @__PURE__ */ jsx20("textarea", { value: reason, placeholder: "Why is a new bill being submitted?", onChange: (event) => setReason(event.target.value) })
7164
7554
  ] }),
7165
- /* @__PURE__ */ jsx18(
7555
+ /* @__PURE__ */ jsx20(
7166
7556
  BillSubmissionForm,
7167
7557
  {
7168
7558
  className: "mbsf-lifecycle-correction",
@@ -7187,10 +7577,10 @@ function ConnectedBillLifecycle({ appearance, actorName, claimsAdministratorHint
7187
7577
  ...appearance ? { appearance } : {}
7188
7578
  }
7189
7579
  ),
7190
- newBillError ? /* @__PURE__ */ jsx18("div", { className: "mb-lifecycle-message error", role: "alert", children: newBillError }) : null
7580
+ newBillError ? /* @__PURE__ */ jsx20("div", { className: "mb-lifecycle-message error", role: "alert", children: newBillError }) : null
7191
7581
  ] }) }) : null,
7192
- activePanel === "second_review" ? /* @__PURE__ */ jsxs18(LifecycleDialog, { title: "Submit Second Review", wide: true, onClose: () => setPanel(""), children: [
7193
- /* @__PURE__ */ jsx18(
7582
+ activePanel === "second_review" ? /* @__PURE__ */ jsxs20(LifecycleDialog, { title: "Submit Second Review", wide: true, onClose: () => setPanel(""), children: [
7583
+ /* @__PURE__ */ jsx20(
7194
7584
  SecondReviewForm,
7195
7585
  {
7196
7586
  data,
@@ -7203,86 +7593,86 @@ function ConnectedBillLifecycle({ appearance, actorName, claimsAdministratorHint
7203
7593
  onSubmit: (input) => complete("Second Review submitted.", () => lifecycle.submitSecondReview({ ...input, ...actor }))
7204
7594
  }
7205
7595
  ),
7206
- reviewDeadline ? /* @__PURE__ */ jsxs18("p", { className: "mb-lifecycle-deadline-hint", children: [
7596
+ reviewDeadline ? /* @__PURE__ */ jsxs20("p", { className: "mb-lifecycle-deadline-hint", children: [
7207
7597
  "Second Review must be requested within 90 days of the denial EOR (dated ",
7208
7598
  usDate(reviewDeadline.eorDate),
7209
7599
  ") \u2014 file by ",
7210
- /* @__PURE__ */ jsx18("strong", { children: usDate(reviewDeadline.deadline) }),
7600
+ /* @__PURE__ */ jsx20("strong", { children: usDate(reviewDeadline.deadline) }),
7211
7601
  "."
7212
7602
  ] }) : null
7213
7603
  ] }) : null,
7214
- activePanel === "payment" ? /* @__PURE__ */ jsx18(LifecycleDialog, { title: "Post payment", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs18("section", { className: "mb-lifecycle-panel", children: [
7215
- /* @__PURE__ */ jsxs18("div", { children: [
7216
- /* @__PURE__ */ jsx18("h3", { children: "Post payment" }),
7217
- /* @__PURE__ */ jsx18("p", { children: "Record a full or partial payment, plus any penalty and interest received." })
7604
+ activePanel === "payment" ? /* @__PURE__ */ jsx20(LifecycleDialog, { title: "Post payment", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs20("section", { className: "mb-lifecycle-panel", children: [
7605
+ /* @__PURE__ */ jsxs20("div", { children: [
7606
+ /* @__PURE__ */ jsx20("h3", { children: "Post payment" }),
7607
+ /* @__PURE__ */ jsx20("p", { children: "Record a full or partial payment, plus any penalty and interest received." })
7218
7608
  ] }),
7219
- /* @__PURE__ */ jsxs18("div", { className: "mb-lifecycle-fields two", children: [
7220
- /* @__PURE__ */ jsxs18("label", { children: [
7221
- /* @__PURE__ */ jsx18("span", { children: "Amount applied to bill" }),
7222
- /* @__PURE__ */ jsx18("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) })) })
7609
+ /* @__PURE__ */ jsxs20("div", { className: "mb-lifecycle-fields two", children: [
7610
+ /* @__PURE__ */ jsxs20("label", { children: [
7611
+ /* @__PURE__ */ jsx20("span", { children: "Amount applied to bill" }),
7612
+ /* @__PURE__ */ jsx20("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) })) })
7223
7613
  ] }),
7224
- /* @__PURE__ */ jsxs18("label", { children: [
7225
- /* @__PURE__ */ jsx18("span", { children: "Penalty" }),
7226
- /* @__PURE__ */ jsx18("input", { type: "number", min: "0", step: "0.01", value: payment.penaltyAmount || "", placeholder: "0.00", onChange: (event) => setPayment((current) => ({ ...current, penaltyAmount: Number(event.target.value) })) })
7614
+ /* @__PURE__ */ jsxs20("label", { children: [
7615
+ /* @__PURE__ */ jsx20("span", { children: "Penalty" }),
7616
+ /* @__PURE__ */ jsx20("input", { type: "number", min: "0", step: "0.01", value: payment.penaltyAmount || "", placeholder: "0.00", onChange: (event) => setPayment((current) => ({ ...current, penaltyAmount: Number(event.target.value) })) })
7227
7617
  ] }),
7228
- /* @__PURE__ */ jsxs18("label", { children: [
7229
- /* @__PURE__ */ jsx18("span", { children: "Interest" }),
7230
- /* @__PURE__ */ jsx18("input", { type: "number", min: "0", step: "0.01", value: payment.interestAmount || "", placeholder: "0.00", onChange: (event) => setPayment((current) => ({ ...current, interestAmount: Number(event.target.value) })) })
7618
+ /* @__PURE__ */ jsxs20("label", { children: [
7619
+ /* @__PURE__ */ jsx20("span", { children: "Interest" }),
7620
+ /* @__PURE__ */ jsx20("input", { type: "number", min: "0", step: "0.01", value: payment.interestAmount || "", placeholder: "0.00", onChange: (event) => setPayment((current) => ({ ...current, interestAmount: Number(event.target.value) })) })
7231
7621
  ] }),
7232
- /* @__PURE__ */ jsxs18("label", { children: [
7233
- /* @__PURE__ */ jsx18("span", { children: "Method" }),
7234
- /* @__PURE__ */ jsxs18("select", { value: payment.method, onChange: (event) => setPayment((current) => ({ ...current, method: event.target.value })), children: [
7235
- /* @__PURE__ */ jsx18("option", { value: "check", children: "Check" }),
7236
- /* @__PURE__ */ jsx18("option", { value: "eft", children: "EFT" })
7622
+ /* @__PURE__ */ jsxs20("label", { children: [
7623
+ /* @__PURE__ */ jsx20("span", { children: "Method" }),
7624
+ /* @__PURE__ */ jsxs20("select", { value: payment.method, onChange: (event) => setPayment((current) => ({ ...current, method: event.target.value })), children: [
7625
+ /* @__PURE__ */ jsx20("option", { value: "check", children: "Check" }),
7626
+ /* @__PURE__ */ jsx20("option", { value: "eft", children: "EFT" })
7237
7627
  ] })
7238
7628
  ] }),
7239
- /* @__PURE__ */ jsxs18("label", { children: [
7240
- /* @__PURE__ */ jsx18("span", { children: payment.method === "check" ? "Check number" : "EFT reference" }),
7241
- /* @__PURE__ */ jsx18("input", { value: payment.checkNumber, onChange: (event) => setPayment((current) => ({ ...current, checkNumber: event.target.value })) })
7629
+ /* @__PURE__ */ jsxs20("label", { children: [
7630
+ /* @__PURE__ */ jsx20("span", { children: payment.method === "check" ? "Check number" : "EFT reference" }),
7631
+ /* @__PURE__ */ jsx20("input", { value: payment.checkNumber, onChange: (event) => setPayment((current) => ({ ...current, checkNumber: event.target.value })) })
7242
7632
  ] }),
7243
- /* @__PURE__ */ jsxs18("label", { children: [
7244
- /* @__PURE__ */ jsx18("span", { children: "Deposit date" }),
7245
- /* @__PURE__ */ jsx18("input", { required: true, value: payment.depositDate, placeholder: "MM/DD/YYYY", onChange: (event) => setPayment((current) => ({ ...current, depositDate: event.target.value })) })
7633
+ /* @__PURE__ */ jsxs20("label", { children: [
7634
+ /* @__PURE__ */ jsx20("span", { children: "Deposit date" }),
7635
+ /* @__PURE__ */ jsx20("input", { required: true, value: payment.depositDate, placeholder: "MM/DD/YYYY", onChange: (event) => setPayment((current) => ({ ...current, depositDate: event.target.value })) })
7246
7636
  ] }),
7247
- /* @__PURE__ */ jsxs18("label", { className: "full", children: [
7248
- /* @__PURE__ */ jsx18("span", { children: "Note (optional)" }),
7249
- /* @__PURE__ */ jsx18("input", { value: payment.note, onChange: (event) => setPayment((current) => ({ ...current, note: event.target.value })) })
7637
+ /* @__PURE__ */ jsxs20("label", { className: "full", children: [
7638
+ /* @__PURE__ */ jsx20("span", { children: "Note (optional)" }),
7639
+ /* @__PURE__ */ jsx20("input", { value: payment.note, onChange: (event) => setPayment((current) => ({ ...current, note: event.target.value })) })
7250
7640
  ] })
7251
7641
  ] }),
7252
- /* @__PURE__ */ jsxs18("div", { className: "mb-payment-total", children: [
7253
- /* @__PURE__ */ jsx18("span", { children: "Total received" }),
7254
- /* @__PURE__ */ jsx18("strong", { children: new Intl.NumberFormat(void 0, { style: "currency", currency: "USD" }).format(payment.amount + (payment.penaltyAmount ?? 0) + (payment.interestAmount ?? 0)) })
7642
+ /* @__PURE__ */ jsxs20("div", { className: "mb-payment-total", children: [
7643
+ /* @__PURE__ */ jsx20("span", { children: "Total received" }),
7644
+ /* @__PURE__ */ jsx20("strong", { children: new Intl.NumberFormat(void 0, { style: "currency", currency: "USD" }).format(payment.amount + (payment.penaltyAmount ?? 0) + (payment.interestAmount ?? 0)) })
7255
7645
  ] }),
7256
- /* @__PURE__ */ jsxs18("div", { className: "mb-lifecycle-panel-actions", children: [
7257
- /* @__PURE__ */ jsx18("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
7258
- /* @__PURE__ */ jsx18("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" })
7646
+ /* @__PURE__ */ jsxs20("div", { className: "mb-lifecycle-panel-actions", children: [
7647
+ /* @__PURE__ */ jsx20("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
7648
+ /* @__PURE__ */ jsx20("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" })
7259
7649
  ] })
7260
7650
  ] }) }) : null,
7261
- activePanel === "close" || activePanel === "reopen" ? /* @__PURE__ */ jsx18(LifecycleDialog, { title: activePanel === "close" ? "Close bill" : "Reopen bill", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs18("section", { className: "mb-lifecycle-panel", children: [
7262
- /* @__PURE__ */ jsxs18("div", { children: [
7263
- /* @__PURE__ */ jsx18("h3", { children: activePanel === "close" ? "Close bill" : "Reopen bill" }),
7264
- /* @__PURE__ */ jsx18("p", { children: activePanel === "close" ? "The immutable submission and history remain available." : "Return this bill to active follow-up without changing the submitted snapshot." })
7651
+ activePanel === "close" || activePanel === "reopen" ? /* @__PURE__ */ jsx20(LifecycleDialog, { title: activePanel === "close" ? "Close bill" : "Reopen bill", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs20("section", { className: "mb-lifecycle-panel", children: [
7652
+ /* @__PURE__ */ jsxs20("div", { children: [
7653
+ /* @__PURE__ */ jsx20("h3", { children: activePanel === "close" ? "Close bill" : "Reopen bill" }),
7654
+ /* @__PURE__ */ jsx20("p", { children: activePanel === "close" ? "The immutable submission and history remain available." : "Return this bill to active follow-up without changing the submitted snapshot." })
7265
7655
  ] }),
7266
- /* @__PURE__ */ jsxs18("label", { children: [
7267
- /* @__PURE__ */ jsx18("span", { children: "Reason" }),
7268
- /* @__PURE__ */ jsx18("textarea", { required: true, value: reason, onChange: (event) => setReason(event.target.value) })
7656
+ /* @__PURE__ */ jsxs20("label", { children: [
7657
+ /* @__PURE__ */ jsx20("span", { children: "Reason" }),
7658
+ /* @__PURE__ */ jsx20("textarea", { required: true, value: reason, onChange: (event) => setReason(event.target.value) })
7269
7659
  ] }),
7270
- /* @__PURE__ */ jsxs18("div", { className: "mb-lifecycle-panel-actions", children: [
7271
- /* @__PURE__ */ jsx18("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
7272
- /* @__PURE__ */ jsx18("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating || !reason.trim(), onClick: () => void complete(activePanel === "close" ? "Bill closed." : "Bill reopened.", () => activePanel === "close" ? lifecycle.closeBill({ reason, ...actor }) : lifecycle.reopenBill({ reason, ...actor })), children: lifecycle.isMutating ? "Saving\u2026" : activePanel === "close" ? "Close bill" : "Reopen bill" })
7660
+ /* @__PURE__ */ jsxs20("div", { className: "mb-lifecycle-panel-actions", children: [
7661
+ /* @__PURE__ */ jsx20("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
7662
+ /* @__PURE__ */ jsx20("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating || !reason.trim(), onClick: () => void complete(activePanel === "close" ? "Bill closed." : "Bill reopened.", () => activePanel === "close" ? lifecycle.closeBill({ reason, ...actor }) : lifecycle.reopenBill({ reason, ...actor })), children: lifecycle.isMutating ? "Saving\u2026" : activePanel === "close" ? "Close bill" : "Reopen bill" })
7273
7663
  ] })
7274
7664
  ] }) }) : null,
7275
- activePanel === "send_duplicate" && correctionInitialBill ? /* @__PURE__ */ jsx18(LifecycleDialog, { title: "Send duplicate bill", wide: true, onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs18("section", { className: "mb-lifecycle-correction", children: [
7276
- /* @__PURE__ */ jsx18("header", { children: /* @__PURE__ */ jsxs18("div", { children: [
7277
- /* @__PURE__ */ jsx18("h3", { children: "Send duplicate bill" }),
7278
- /* @__PURE__ */ jsx18("p", { children: "Review and edit any bill field before creating a duplicate submission. The original bill and its history stay unchanged." })
7665
+ activePanel === "send_duplicate" && correctionInitialBill ? /* @__PURE__ */ jsx20(LifecycleDialog, { title: "Send duplicate bill", wide: true, onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs20("section", { className: "mb-lifecycle-correction", children: [
7666
+ /* @__PURE__ */ jsx20("header", { children: /* @__PURE__ */ jsxs20("div", { children: [
7667
+ /* @__PURE__ */ jsx20("h3", { children: "Send duplicate bill" }),
7668
+ /* @__PURE__ */ jsx20("p", { children: "Review and edit any bill field before creating a duplicate submission. The original bill and its history stay unchanged." })
7279
7669
  ] }) }),
7280
- data.environment === "live" ? /* @__PURE__ */ jsxs18("div", { className: "mb-lifecycle-live-warning", children: [
7281
- /* @__PURE__ */ jsx18("strong", { children: "Live clearinghouse submission" }),
7282
- /* @__PURE__ */ jsx18("span", { children: "The duplicate will be sent only after you confirm its delivery route in the next dialog." })
7670
+ data.environment === "live" ? /* @__PURE__ */ jsxs20("div", { className: "mb-lifecycle-live-warning", children: [
7671
+ /* @__PURE__ */ jsx20("strong", { children: "Live clearinghouse submission" }),
7672
+ /* @__PURE__ */ jsx20("span", { children: "The duplicate will be sent only after you confirm its delivery route in the next dialog." })
7283
7673
  ] }) : null,
7284
- /* @__PURE__ */ jsx18(CorrectionVerificationContact, { delivery: data.delivery }),
7285
- /* @__PURE__ */ jsx18(
7674
+ /* @__PURE__ */ jsx20(CorrectionVerificationContact, { delivery: data.delivery }),
7675
+ /* @__PURE__ */ jsx20(
7286
7676
  BillSubmissionForm,
7287
7677
  {
7288
7678
  className: "mbsf-lifecycle-correction",
@@ -7307,15 +7697,15 @@ function ConnectedBillLifecycle({ appearance, actorName, claimsAdministratorHint
7307
7697
  ...appearance ? { appearance } : {}
7308
7698
  }
7309
7699
  ),
7310
- duplicateError ? /* @__PURE__ */ jsx18("div", { className: "mb-lifecycle-message error", role: "alert", children: duplicateError }) : null
7700
+ duplicateError ? /* @__PURE__ */ jsx20("div", { className: "mb-lifecycle-message error", role: "alert", children: duplicateError }) : null
7311
7701
  ] }) }) : null,
7312
- activePanel === "report_status" ? /* @__PURE__ */ jsx18(
7702
+ activePanel === "report_status" ? /* @__PURE__ */ jsx20(
7313
7703
  ReportBillStatusDialog,
7314
7704
  {
7315
7705
  ...data.delivery.directory ? { directory: data.delivery.directory } : {},
7316
7706
  ...statusContacts.claimsAdmin ? { claimsAdmin: statusContacts.claimsAdmin } : {},
7317
7707
  ...statusContacts.billReview ? { billReview: statusContacts.billReview } : {},
7318
- ...receiptEntries.length ? { receipt: /* @__PURE__ */ jsx18(BillHistoryTable, { entries: receiptEntries, onOpenDocument: lifecycle.openAttachment, ...appearance ? { appearance } : {} }) } : {},
7708
+ ...receiptEntries.length ? { receipt: /* @__PURE__ */ jsx20(BillHistoryTable, { entries: receiptEntries, onOpenDocument: lifecycle.openAttachment, ...appearance ? { appearance } : {} }) } : {},
7319
7709
  submitting: lifecycle.isMutating,
7320
7710
  error: lifecycle.error?.message ?? null,
7321
7711
  onCancel: () => setPanel(""),
@@ -7323,8 +7713,8 @@ function ConnectedBillLifecycle({ appearance, actorName, claimsAdministratorHint
7323
7713
  ...appearance ? { appearance } : {}
7324
7714
  }
7325
7715
  ) : null,
7326
- notice ? /* @__PURE__ */ jsx18("div", { className: "mb-lifecycle-message success", role: "status", children: notice }) : null,
7327
- lifecycle.error ? /* @__PURE__ */ jsx18("div", { className: "mb-lifecycle-message error", role: "alert", children: lifecycle.error.message }) : null
7716
+ notice ? /* @__PURE__ */ jsx20("div", { className: "mb-lifecycle-message success", role: "status", children: notice }) : null,
7717
+ lifecycle.error ? /* @__PURE__ */ jsx20("div", { className: "mb-lifecycle-message error", role: "alert", children: lifecycle.error.message }) : null
7328
7718
  ] });
7329
7719
  }
7330
7720
  var CONNECTED_LIFECYCLE_STYLES = `
@@ -7342,150 +7732,14 @@ var CONNECTED_LIFECYCLE_STYLES = `
7342
7732
  // src/connected-billing-workspace.tsx
7343
7733
  import {
7344
7734
  useCallback as useCallback5,
7345
- useEffect as useEffect13,
7735
+ useEffect as useEffect14,
7346
7736
  useLayoutEffect,
7347
- useMemo as useMemo10,
7737
+ useMemo as useMemo11,
7348
7738
  useRef as useRef9,
7349
- useState as useState15
7739
+ useState as useState17
7350
7740
  } from "react";
7351
-
7352
- // src/billing-operations-client.ts
7353
- import {
7354
- DEFAULT_API_BASE_URL as DEFAULT_API_BASE_URL3,
7355
- DEFAULT_SESSION_ENDPOINT as DEFAULT_SESSION_ENDPOINT3
7356
- } from "@mindbill/browser";
7357
- async function responseError2(response, fallback) {
7358
- const body = await response.json().catch(() => null);
7359
- const detail = body && typeof body === "object" ? body.detail ?? body.error : null;
7360
- return new Error(typeof detail === "string" ? detail : fallback);
7361
- }
7362
- function normalizeSession2(value) {
7363
- if (!value || typeof value !== "object") throw new Error("The MindBill session endpoint returned an invalid response.");
7364
- const candidate = value;
7365
- const nested = candidate.session ?? candidate.data;
7366
- const session = nested && typeof nested === "object" ? nested : candidate;
7367
- if (typeof session.token !== "string" || session.token.length < 8) {
7368
- throw new Error("The MindBill session endpoint did not return a browser session token.");
7369
- }
7370
- return {
7371
- token: session.token,
7372
- ...typeof session.expiresAt === "string" ? { expiresAt: session.expiresAt } : {},
7373
- ...typeof session.apiBaseUrl === "string" ? { apiBaseUrl: session.apiBaseUrl } : {}
7374
- };
7375
- }
7376
- function isFresh(session) {
7377
- if (!session) return false;
7378
- if (!session.expiresAt) return true;
7379
- const expiresAt = Date.parse(session.expiresAt);
7380
- return Number.isFinite(expiresAt) && expiresAt > Date.now() + 3e4;
7381
- }
7382
- function queryString(values) {
7383
- const params = new URLSearchParams();
7384
- for (const [key, value] of Object.entries(values)) {
7385
- if (value !== void 0 && value !== "") params.set(key, String(value));
7386
- }
7387
- const text = params.toString();
7388
- return text ? `?${text}` : "";
7389
- }
7390
- function createBillingOperationsClient({
7391
- sessionEndpoint = DEFAULT_SESSION_ENDPOINT3,
7392
- getSession,
7393
- apiBaseUrl = DEFAULT_API_BASE_URL3,
7394
- fetch: fetchOverride
7395
- } = {}) {
7396
- const fetcher = fetchOverride ?? globalThis.fetch;
7397
- if (typeof fetcher !== "function") throw new Error("A Fetch API implementation is required.");
7398
- let session = null;
7399
- let pendingSession = null;
7400
- let pendingSessionSignal = null;
7401
- const mintSession = async (signal, force = false) => {
7402
- if (!force && isFresh(session)) return session;
7403
- if (!force && pendingSession && !pendingSessionSignal?.aborted) return pendingSession;
7404
- const pending = getSession ? getSession({ signal }) : fetcher(sessionEndpoint, {
7405
- method: "POST",
7406
- credentials: "same-origin",
7407
- headers: { "content-type": "application/json" },
7408
- body: JSON.stringify({}),
7409
- signal
7410
- }).then(async (response) => {
7411
- if (!response.ok) throw await responseError2(response, "MindBill browser session could not be created.");
7412
- return response.json();
7413
- });
7414
- const request = Promise.resolve(pending).then(normalizeSession2).then((next) => {
7415
- session = next;
7416
- return next;
7417
- }).finally(() => {
7418
- if (pendingSession === request) {
7419
- pendingSession = null;
7420
- pendingSessionSignal = null;
7421
- }
7422
- });
7423
- pendingSession = request;
7424
- pendingSessionSignal = signal;
7425
- return request;
7426
- };
7427
- const get = async (path, signal) => {
7428
- const controller = signal ? null : new AbortController();
7429
- const requestSignal = signal ?? controller?.signal;
7430
- if (!requestSignal) throw new Error("An AbortSignal could not be created.");
7431
- let browserSession = await mintSession(requestSignal);
7432
- const request = (active) => {
7433
- const base = (active.apiBaseUrl ?? apiBaseUrl).replace(/\/$/, "");
7434
- return fetcher(`${base}${path}`, {
7435
- headers: { authorization: `Bearer ${active.token}` },
7436
- signal: requestSignal
7437
- });
7438
- };
7439
- let response = await request(browserSession);
7440
- if (response.status === 401) {
7441
- session = null;
7442
- browserSession = await mintSession(requestSignal, true);
7443
- response = await request(browserSession);
7444
- }
7445
- if (!response.ok) throw await responseError2(response, "MindBill data could not be loaded.");
7446
- const body = await response.json();
7447
- return body.data ?? body;
7448
- };
7449
- return {
7450
- clearSession() {
7451
- session = null;
7452
- pendingSession = null;
7453
- pendingSessionSignal = null;
7454
- },
7455
- getBills(query = {}, signal) {
7456
- const { claimsAdministrator, taskType, taskSection: _taskSection, sort, status, ...filters } = query;
7457
- void _taskSection;
7458
- const sortKey = sort?.startsWith("balance_") ? "balanceDue" : sort?.startsWith("patient_") ? "patient" : sort ? "submitted" : void 0;
7459
- return get(`/partner/v2/bill-dashboard${queryString({
7460
- ...filters,
7461
- status: status === "submitted" ? "sent" : status,
7462
- claimsAdminId: claimsAdministrator,
7463
- taskKind: taskType,
7464
- sort: sortKey,
7465
- dir: sort ? sort.endsWith("_asc") ? "asc" : "desc" : void 0
7466
- })}`, signal);
7467
- },
7468
- getBillTasks(claimsAdministrator, signal, renderingProviderId) {
7469
- return get(
7470
- `/partner/v2/bill-tasks${queryString({ claimsAdminId: claimsAdministrator, renderingProviderId })}`,
7471
- signal
7472
- );
7473
- },
7474
- getServiceLineItems(range, signal) {
7475
- return get(
7476
- `/partner/v2/reports/service-line-items${queryString(range)}`,
7477
- signal
7478
- );
7479
- },
7480
- getProductivity(range, signal) {
7481
- return get(`/partner/v2/reports/productivity${queryString(range)}`, signal);
7482
- }
7483
- };
7484
- }
7485
-
7486
- // src/connected-billing-workspace.tsx
7487
- import { Fragment as Fragment16, jsx as jsx19, jsxs as jsxs19 } from "react/jsx-runtime";
7488
- var css12 = `
7741
+ import { Fragment as Fragment16, jsx as jsx21, jsxs as jsxs21 } from "react/jsx-runtime";
7742
+ var css13 = `
7489
7743
  .mbow-select{max-width:100%}
7490
7744
  .mbow{color:var(--mb-text);font:14px/1.45 var(--mb-font);background:var(--mb-soft);border-radius:var(--mb-radius);padding:20px}.mbow,.mbow *{box-sizing:border-box}.mbow h2,.mbow h3,.mbow p{margin:0}.mbow a{color:var(--mb-accent)}
7491
7745
  .mbow-workspace{width:100%;height:100%;max-height:var(--mbow-available-height,100dvh);min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
@@ -7498,15 +7752,15 @@ var css12 = `
7498
7752
  .mbow-back{margin-bottom:12px}.mbow-task-note{color:var(--mb-muted);font-size:13px;margin-bottom:14px!important}.mbow-bar{height:7px;min-width:70px;background:var(--mb-soft);border-radius:99px;overflow:hidden}.mbow-bar i{display:block;height:100%;background:var(--mb-accent);border-radius:inherit}
7499
7753
  @media(max-width:760px){.mbow{padding:14px}.mbow-head{display:block}.mbow-actions{margin-top:12px}.mbow-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.mbow-input{min-width:100%}}
7500
7754
  `;
7501
- function money6(value) {
7755
+ function money7(value) {
7502
7756
  return new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" }).format(value);
7503
7757
  }
7504
7758
  function RenderingProviderFilter({ value, options, onChange }) {
7505
7759
  if (!options && !value) return null;
7506
- return /* @__PURE__ */ jsxs19("select", { className: "mbow-select", "aria-label": "Rendering provider filter", value, onChange: (event) => onChange(event.target.value), children: [
7507
- /* @__PURE__ */ jsx19("option", { value: "", children: "All rendering providers" }),
7508
- value && !options?.some((option) => option.id === value) ? /* @__PURE__ */ jsx19("option", { value, children: "Selected rendering provider" }) : null,
7509
- options?.map((option) => /* @__PURE__ */ jsx19("option", { value: option.id, children: option.name }, option.id))
7760
+ return /* @__PURE__ */ jsxs21("select", { className: "mbow-select", "aria-label": "Rendering provider filter", value, onChange: (event) => onChange(event.target.value), children: [
7761
+ /* @__PURE__ */ jsx21("option", { value: "", children: "All rendering providers" }),
7762
+ value && !options?.some((option) => option.id === value) ? /* @__PURE__ */ jsx21("option", { value, children: "Selected rendering provider" }) : null,
7763
+ options?.map((option) => /* @__PURE__ */ jsx21("option", { value: option.id, children: option.name }, option.id))
7510
7764
  ] });
7511
7765
  }
7512
7766
  function shortDate(value) {
@@ -7522,14 +7776,14 @@ function defaultRange(days = 29) {
7522
7776
  return { from: iso(from), to: iso(to) };
7523
7777
  }
7524
7778
  function Surface({ appearance, className = "", style, children, surfaceRef }) {
7525
- return /* @__PURE__ */ jsxs19("div", { ref: surfaceRef, className: `mbow ${className}`.trim(), style: mindBillAppearanceStyle(appearance, style), children: [
7526
- /* @__PURE__ */ jsx19("style", { children: css12 }),
7779
+ return /* @__PURE__ */ jsxs21("div", { ref: surfaceRef, className: `mbow ${className}`.trim(), style: mindBillAppearanceStyle(appearance, style), children: [
7780
+ /* @__PURE__ */ jsx21("style", { children: css13 }),
7527
7781
  children
7528
7782
  ] });
7529
7783
  }
7530
7784
  function useAvailableViewportHeight() {
7531
7785
  const workspaceRef = useRef9(null);
7532
- const [availableHeight, setAvailableHeight] = useState15(null);
7786
+ const [availableHeight, setAvailableHeight] = useState17(null);
7533
7787
  useLayoutEffect(() => {
7534
7788
  const element = workspaceRef.current;
7535
7789
  if (!element || typeof window === "undefined") return;
@@ -7556,7 +7810,7 @@ function useAvailableViewportHeight() {
7556
7810
  return { workspaceRef, availableHeight };
7557
7811
  }
7558
7812
  function useClient(options) {
7559
- return useMemo10(() => createBillingOperationsClient(options), [options.apiBaseUrl, options.fetch, options.getSession, options.sessionEndpoint]);
7813
+ return useMemo11(() => createBillingOperationsClient(options), [options.apiBaseUrl, options.fetch, options.getSession, options.sessionEndpoint]);
7560
7814
  }
7561
7815
  function BillSearchContent({
7562
7816
  client,
@@ -7564,11 +7818,11 @@ function BillSearchContent({
7564
7818
  onSelectBill,
7565
7819
  heading
7566
7820
  }) {
7567
- const [query, setQuery] = useState15({ age: "all", page: 1, pageSize: 25, sort: "submitted_desc", ...initialQuery, status: initialQuery?.status === "submitted" ? "sent" : initialQuery?.status ?? "all" });
7568
- const [draft, setDraft] = useState15(initialQuery?.q ?? "");
7569
- const [result, setResult] = useState15(null);
7570
- const [error, setError] = useState15(null);
7571
- const [loading, setLoading] = useState15(true);
7821
+ const [query, setQuery] = useState17({ age: "all", page: 1, pageSize: 25, sort: "submitted_desc", ...initialQuery, status: initialQuery?.status === "submitted" ? "sent" : initialQuery?.status ?? "all" });
7822
+ const [draft, setDraft] = useState17(initialQuery?.q ?? "");
7823
+ const [result, setResult] = useState17(null);
7824
+ const [error, setError] = useState17(null);
7825
+ const [loading, setLoading] = useState17(true);
7572
7826
  const load = useCallback5(async (signal) => {
7573
7827
  setLoading(true);
7574
7828
  setError(null);
@@ -7580,78 +7834,78 @@ function BillSearchContent({
7580
7834
  if (!signal?.aborted) setLoading(false);
7581
7835
  }
7582
7836
  }, [client, query]);
7583
- useEffect13(() => {
7837
+ useEffect14(() => {
7584
7838
  const controller = new AbortController();
7585
7839
  void load(controller.signal);
7586
7840
  return () => controller.abort();
7587
7841
  }, [load]);
7588
7842
  const update = (next) => setQuery((current) => ({ ...current, ...next, page: next.page ?? 1 }));
7589
7843
  const pageCount = Math.max(1, Math.ceil((result?.total ?? 0) / (result?.pageSize ?? 25)));
7590
- return /* @__PURE__ */ jsxs19(Fragment16, { children: [
7591
- heading ? /* @__PURE__ */ jsx19("div", { className: "mbow-head", children: /* @__PURE__ */ jsx19("div", { children: typeof heading === "string" ? /* @__PURE__ */ jsx19("h2", { children: heading }) : heading }) }) : null,
7592
- /* @__PURE__ */ jsxs19("form", { className: "mbow-toolbar", onSubmit: (event) => {
7844
+ return /* @__PURE__ */ jsxs21(Fragment16, { children: [
7845
+ heading ? /* @__PURE__ */ jsx21("div", { className: "mbow-head", children: /* @__PURE__ */ jsx21("div", { children: typeof heading === "string" ? /* @__PURE__ */ jsx21("h2", { children: heading }) : heading }) }) : null,
7846
+ /* @__PURE__ */ jsxs21("form", { className: "mbow-toolbar", onSubmit: (event) => {
7593
7847
  event.preventDefault();
7594
7848
  update({ q: draft.trim() });
7595
7849
  }, children: [
7596
- /* @__PURE__ */ jsx19("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" }),
7597
- /* @__PURE__ */ jsxs19("select", { className: "mbow-select", value: query.status ?? "all", onChange: (event) => update({ status: event.target.value }), "aria-label": "Bill status", children: [
7598
- /* @__PURE__ */ jsx19("option", { value: "all", children: "All statuses" }),
7599
- /* @__PURE__ */ jsx19("option", { value: "incomplete", children: "Incomplete" }),
7600
- /* @__PURE__ */ jsx19("option", { value: "sent", children: "Sent" }),
7601
- /* @__PURE__ */ jsx19("option", { value: "accepted", children: "Accepted" }),
7602
- /* @__PURE__ */ jsx19("option", { value: "accepted_no_response", children: "Accepted \u2014 response overdue" }),
7603
- /* @__PURE__ */ jsx19("option", { value: "rejected", children: "Rejected" }),
7604
- /* @__PURE__ */ jsx19("option", { value: "processed", children: "Processed" }),
7605
- /* @__PURE__ */ jsx19("option", { value: "paid", children: "Paid" }),
7606
- /* @__PURE__ */ jsx19("option", { value: "closed", children: "Closed" })
7850
+ /* @__PURE__ */ jsx21("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" }),
7851
+ /* @__PURE__ */ jsxs21("select", { className: "mbow-select", value: query.status ?? "all", onChange: (event) => update({ status: event.target.value }), "aria-label": "Bill status", children: [
7852
+ /* @__PURE__ */ jsx21("option", { value: "all", children: "All statuses" }),
7853
+ /* @__PURE__ */ jsx21("option", { value: "incomplete", children: "Incomplete" }),
7854
+ /* @__PURE__ */ jsx21("option", { value: "sent", children: "Sent" }),
7855
+ /* @__PURE__ */ jsx21("option", { value: "accepted", children: "Accepted" }),
7856
+ /* @__PURE__ */ jsx21("option", { value: "accepted_no_response", children: "Accepted \u2014 response overdue" }),
7857
+ /* @__PURE__ */ jsx21("option", { value: "rejected", children: "Rejected" }),
7858
+ /* @__PURE__ */ jsx21("option", { value: "processed", children: "Processed" }),
7859
+ /* @__PURE__ */ jsx21("option", { value: "paid", children: "Paid" }),
7860
+ /* @__PURE__ */ jsx21("option", { value: "closed", children: "Closed" })
7607
7861
  ] }),
7608
- /* @__PURE__ */ jsxs19("select", { className: "mbow-select", value: query.age ?? "all", onChange: (event) => update({ age: event.target.value }), "aria-label": "A/R age", children: [
7609
- /* @__PURE__ */ jsx19("option", { value: "all", children: "All A/R ages" }),
7610
- /* @__PURE__ */ jsx19("option", { value: "0-30", children: "0\u201330 days" }),
7611
- /* @__PURE__ */ jsx19("option", { value: "31-60", children: "31\u201360 days" }),
7612
- /* @__PURE__ */ jsx19("option", { value: "61-90", children: "61\u201390 days" }),
7613
- /* @__PURE__ */ jsx19("option", { value: "91+", children: "91+ days" }),
7614
- /* @__PURE__ */ jsx19("option", { value: "91-180", children: "91\u2013180 days" }),
7615
- /* @__PURE__ */ jsx19("option", { value: "181+", children: "181+ days" })
7862
+ /* @__PURE__ */ jsxs21("select", { className: "mbow-select", value: query.age ?? "all", onChange: (event) => update({ age: event.target.value }), "aria-label": "A/R age", children: [
7863
+ /* @__PURE__ */ jsx21("option", { value: "all", children: "All A/R ages" }),
7864
+ /* @__PURE__ */ jsx21("option", { value: "0-30", children: "0\u201330 days" }),
7865
+ /* @__PURE__ */ jsx21("option", { value: "31-60", children: "31\u201360 days" }),
7866
+ /* @__PURE__ */ jsx21("option", { value: "61-90", children: "61\u201390 days" }),
7867
+ /* @__PURE__ */ jsx21("option", { value: "91+", children: "91+ days" }),
7868
+ /* @__PURE__ */ jsx21("option", { value: "91-180", children: "91\u2013180 days" }),
7869
+ /* @__PURE__ */ jsx21("option", { value: "181+", children: "181+ days" })
7616
7870
  ] }),
7617
- /* @__PURE__ */ jsx19("button", { className: "mbow-button", type: "submit", children: "Search" }),
7618
- /* @__PURE__ */ jsx19(RenderingProviderFilter, { value: query.renderingProviderId ?? "", options: result?.filters?.renderingProviders, onChange: (value) => update({ renderingProviderId: value }) })
7871
+ /* @__PURE__ */ jsx21("button", { className: "mbow-button", type: "submit", children: "Search" }),
7872
+ /* @__PURE__ */ jsx21(RenderingProviderFilter, { value: query.renderingProviderId ?? "", options: result?.filters?.renderingProviders, onChange: (value) => update({ renderingProviderId: value }) })
7619
7873
  ] }),
7620
- /* @__PURE__ */ jsxs19("div", { className: "mbow-card mbow-scroll", children: [
7621
- loading ? /* @__PURE__ */ jsx19("div", { className: "mbow-state", role: "status", children: "Loading bills\u2026" }) : error ? /* @__PURE__ */ jsxs19("div", { className: "mbow-state mbow-error", role: "alert", children: [
7874
+ /* @__PURE__ */ jsxs21("div", { className: "mbow-card mbow-scroll", children: [
7875
+ loading ? /* @__PURE__ */ jsx21("div", { className: "mbow-state", role: "status", children: "Loading bills\u2026" }) : error ? /* @__PURE__ */ jsxs21("div", { className: "mbow-state mbow-error", role: "alert", children: [
7622
7876
  error.message,
7623
7877
  " ",
7624
- /* @__PURE__ */ jsx19("button", { className: "mbow-button", type: "button", onClick: () => void load(), children: "Retry" })
7625
- ] }) : result?.items.length === 0 ? /* @__PURE__ */ jsx19("div", { className: "mbow-state", children: "No bills match these filters." }) : /* @__PURE__ */ jsxs19("table", { className: "mbow-table", children: [
7626
- /* @__PURE__ */ jsx19("thead", { children: /* @__PURE__ */ jsxs19("tr", { children: [
7627
- /* @__PURE__ */ jsx19("th", { children: "Bill" }),
7628
- /* @__PURE__ */ jsx19("th", { children: "Patient" }),
7629
- /* @__PURE__ */ jsx19("th", { children: "DOS" }),
7630
- /* @__PURE__ */ jsx19("th", { children: "Codes" }),
7631
- /* @__PURE__ */ jsx19("th", { children: "Claims administrator" }),
7632
- /* @__PURE__ */ jsx19("th", { children: "Status" }),
7633
- /* @__PURE__ */ jsx19("th", { children: "Submitted / A/R age" }),
7634
- /* @__PURE__ */ jsx19("th", { className: "mbow-money", children: "Balance due" })
7878
+ /* @__PURE__ */ jsx21("button", { className: "mbow-button", type: "button", onClick: () => void load(), children: "Retry" })
7879
+ ] }) : result?.items.length === 0 ? /* @__PURE__ */ jsx21("div", { className: "mbow-state", children: "No bills match these filters." }) : /* @__PURE__ */ jsxs21("table", { className: "mbow-table", children: [
7880
+ /* @__PURE__ */ jsx21("thead", { children: /* @__PURE__ */ jsxs21("tr", { children: [
7881
+ /* @__PURE__ */ jsx21("th", { children: "Bill" }),
7882
+ /* @__PURE__ */ jsx21("th", { children: "Patient" }),
7883
+ /* @__PURE__ */ jsx21("th", { children: "DOS" }),
7884
+ /* @__PURE__ */ jsx21("th", { children: "Codes" }),
7885
+ /* @__PURE__ */ jsx21("th", { children: "Claims administrator" }),
7886
+ /* @__PURE__ */ jsx21("th", { children: "Status" }),
7887
+ /* @__PURE__ */ jsx21("th", { children: "Submitted / A/R age" }),
7888
+ /* @__PURE__ */ jsx21("th", { className: "mbow-money", children: "Balance due" })
7635
7889
  ] }) }),
7636
- /* @__PURE__ */ jsx19("tbody", { children: result?.items.map((bill) => /* @__PURE__ */ jsxs19("tr", { className: onSelectBill ? "clickable" : "", onClick: () => onSelectBill?.(bill), children: [
7637
- /* @__PURE__ */ jsxs19("td", { className: "mbow-strong", children: [
7890
+ /* @__PURE__ */ jsx21("tbody", { children: result?.items.map((bill) => /* @__PURE__ */ jsxs21("tr", { className: onSelectBill ? "clickable" : "", onClick: () => onSelectBill?.(bill), children: [
7891
+ /* @__PURE__ */ jsxs21("td", { className: "mbow-strong", children: [
7638
7892
  "#",
7639
7893
  bill.billNumber
7640
7894
  ] }),
7641
- /* @__PURE__ */ jsx19("td", { children: bill.patientName }),
7642
- /* @__PURE__ */ jsx19("td", { children: shortDate(bill.dateOfService) }),
7643
- /* @__PURE__ */ jsx19("td", { children: bill.procedureCodes.join(", ") || "\u2014" }),
7644
- /* @__PURE__ */ jsx19("td", { children: bill.claimsAdministrator || "\u2014" }),
7645
- /* @__PURE__ */ jsx19("td", { children: /* @__PURE__ */ jsx19("span", { className: `mbow-badge ${bill.status.tone ?? ""}`, children: bill.status.label }) }),
7646
- /* @__PURE__ */ jsxs19("td", { children: [
7895
+ /* @__PURE__ */ jsx21("td", { children: bill.patientName }),
7896
+ /* @__PURE__ */ jsx21("td", { children: shortDate(bill.dateOfService) }),
7897
+ /* @__PURE__ */ jsx21("td", { children: bill.procedureCodes.join(", ") || "\u2014" }),
7898
+ /* @__PURE__ */ jsx21("td", { children: bill.claimsAdministrator || "\u2014" }),
7899
+ /* @__PURE__ */ jsx21("td", { children: /* @__PURE__ */ jsx21("span", { className: `mbow-badge ${bill.status.tone ?? ""}`, children: bill.status.label }) }),
7900
+ /* @__PURE__ */ jsxs21("td", { children: [
7647
7901
  shortDate(bill.submittedAt),
7648
- /* @__PURE__ */ jsx19("div", { className: "mbow-muted", children: bill.arAgeDays == null ? "\u2014" : `${bill.arAgeDays} days` })
7902
+ /* @__PURE__ */ jsx21("div", { className: "mbow-muted", children: bill.arAgeDays == null ? "\u2014" : `${bill.arAgeDays} days` })
7649
7903
  ] }),
7650
- /* @__PURE__ */ jsx19("td", { className: "mbow-money mbow-strong", children: money6(bill.balanceDue) })
7904
+ /* @__PURE__ */ jsx21("td", { className: "mbow-money mbow-strong", children: money7(bill.balanceDue) })
7651
7905
  ] }, bill.id)) })
7652
7906
  ] }),
7653
- result && !loading && !error ? /* @__PURE__ */ jsxs19("div", { className: "mbow-pager", children: [
7654
- /* @__PURE__ */ jsxs19("span", { children: [
7907
+ result && !loading && !error ? /* @__PURE__ */ jsxs21("div", { className: "mbow-pager", children: [
7908
+ /* @__PURE__ */ jsxs21("span", { children: [
7655
7909
  "Showing ",
7656
7910
  result.total === 0 ? 0 : (result.page - 1) * result.pageSize + 1,
7657
7911
  "\u2013",
@@ -7659,14 +7913,14 @@ function BillSearchContent({
7659
7913
  " of ",
7660
7914
  result.total
7661
7915
  ] }),
7662
- /* @__PURE__ */ jsxs19("span", { children: [
7663
- /* @__PURE__ */ jsx19("button", { className: "mbow-button", type: "button", disabled: result.page <= 1, onClick: () => update({ page: result.page - 1 }), children: "Previous" }),
7916
+ /* @__PURE__ */ jsxs21("span", { children: [
7917
+ /* @__PURE__ */ jsx21("button", { className: "mbow-button", type: "button", disabled: result.page <= 1, onClick: () => update({ page: result.page - 1 }), children: "Previous" }),
7664
7918
  " ",
7665
7919
  result.page,
7666
7920
  " / ",
7667
7921
  pageCount,
7668
7922
  " ",
7669
- /* @__PURE__ */ jsx19("button", { className: "mbow-button", type: "button", disabled: result.page >= pageCount, onClick: () => update({ page: result.page + 1 }), children: "Next" })
7923
+ /* @__PURE__ */ jsx21("button", { className: "mbow-button", type: "button", disabled: result.page >= pageCount, onClick: () => update({ page: result.page + 1 }), children: "Next" })
7670
7924
  ] })
7671
7925
  ] }) : null
7672
7926
  ] })
@@ -7674,7 +7928,7 @@ function BillSearchContent({
7674
7928
  }
7675
7929
  function ConnectedBillSearch({ appearance, className, style, initialQuery, onSelectBill, heading = "All bills", ...options }) {
7676
7930
  const client = useClient(options);
7677
- return /* @__PURE__ */ jsx19(Surface, { appearance, className, style, children: /* @__PURE__ */ jsx19(BillSearchContent, { client, initialQuery, onSelectBill, heading }) });
7931
+ return /* @__PURE__ */ jsx21(Surface, { appearance, className, style, children: /* @__PURE__ */ jsx21(BillSearchContent, { client, initialQuery, onSelectBill, heading }) });
7678
7932
  }
7679
7933
  function taskQuery(cell) {
7680
7934
  const [taskType, taskLabel] = cell.rowId.split("::", 2);
@@ -7685,11 +7939,11 @@ function taskQuery(cell) {
7685
7939
  return { status: "all", taskSection: cell.sectionId, ...taskType ? { taskType } : {}, ...taskLabel ? { taskLabel } : {}, ...age ? { age } : {} };
7686
7940
  }
7687
7941
  function BillTasksContent({ client, onDrillDown, appearance }) {
7688
- const [claimsAdminId, setClaimsAdminId] = useState15("");
7689
- const [renderingProviderId, setRenderingProviderId] = useState15("");
7690
- const [result, setResult] = useState15(null);
7691
- const [error, setError] = useState15(null);
7692
- const [loading, setLoading] = useState15(true);
7942
+ const [claimsAdminId, setClaimsAdminId] = useState17("");
7943
+ const [renderingProviderId, setRenderingProviderId] = useState17("");
7944
+ const [result, setResult] = useState17(null);
7945
+ const [error, setError] = useState17(null);
7946
+ const [loading, setLoading] = useState17(true);
7693
7947
  const load = useCallback5(async (signal) => {
7694
7948
  setLoading(true);
7695
7949
  setError(null);
@@ -7701,32 +7955,32 @@ function BillTasksContent({ client, onDrillDown, appearance }) {
7701
7955
  if (!signal?.aborted) setLoading(false);
7702
7956
  }
7703
7957
  }, [claimsAdminId, renderingProviderId, client]);
7704
- useEffect13(() => {
7958
+ useEffect14(() => {
7705
7959
  const controller = new AbortController();
7706
7960
  void load(controller.signal);
7707
7961
  return () => controller.abort();
7708
7962
  }, [load]);
7709
- if (loading && !result) return /* @__PURE__ */ jsx19("div", { className: "mbow-state", children: "Loading bill tasks\u2026" });
7710
- if (error && !result) return /* @__PURE__ */ jsx19("div", { className: "mbow-state mbow-error", children: error.message });
7711
- if (!result) return /* @__PURE__ */ jsx19(Fragment16, {});
7963
+ if (loading && !result) return /* @__PURE__ */ jsx21("div", { className: "mbow-state", children: "Loading bill tasks\u2026" });
7964
+ if (error && !result) return /* @__PURE__ */ jsx21("div", { className: "mbow-state mbow-error", children: error.message });
7965
+ if (!result) return /* @__PURE__ */ jsx21(Fragment16, {});
7712
7966
  const selectionProps = loading || error ? {} : {
7713
7967
  onSelectCell: (cell) => onDrillDown?.({ ...taskQuery(cell), ...claimsAdminId ? { claimsAdministrator: claimsAdminId } : {}, ...renderingProviderId ? { renderingProviderId } : {} })
7714
7968
  };
7715
- return /* @__PURE__ */ jsxs19(Fragment16, { children: [
7716
- /* @__PURE__ */ jsxs19("p", { className: "mbow-task-note", children: [
7969
+ return /* @__PURE__ */ jsxs21(Fragment16, { children: [
7970
+ /* @__PURE__ */ jsxs21("p", { className: "mbow-task-note", children: [
7717
7971
  "Open follow-up work grouped by task and age. ",
7718
7972
  result.waiting ? "Sent and accepted bills waiting for a payer are shown below." : "Find sent and accepted bills in All bills."
7719
7973
  ] }),
7720
- loading ? /* @__PURE__ */ jsx19("p", { role: "status", children: "Updating bill tasks\u2026" }) : null,
7721
- error ? /* @__PURE__ */ jsx19("p", { role: "alert", className: "mbow-error", children: error.message }) : null,
7722
- /* @__PURE__ */ jsx19(BillTasksDashboard, { data: result.dashboard, appearance: appearance ?? { preset: "mindbill" }, toolbar: /* @__PURE__ */ jsxs19("div", { className: "mbow-toolbar", children: [
7723
- /* @__PURE__ */ jsxs19("select", { "aria-label": "Claims administrator filter", className: "mbow-select", value: claimsAdminId, onChange: (event) => setClaimsAdminId(event.target.value), children: [
7724
- /* @__PURE__ */ jsx19("option", { value: "", children: "All claims administrators" }),
7725
- result.filters.claimsAdministrators.map((item) => /* @__PURE__ */ jsx19("option", { value: item.id, children: item.name }, item.id))
7974
+ loading ? /* @__PURE__ */ jsx21("p", { role: "status", children: "Updating bill tasks\u2026" }) : null,
7975
+ error ? /* @__PURE__ */ jsx21("p", { role: "alert", className: "mbow-error", children: error.message }) : null,
7976
+ /* @__PURE__ */ jsx21(BillTasksDashboard, { data: result.dashboard, appearance: appearance ?? { preset: "mindbill" }, toolbar: /* @__PURE__ */ jsxs21("div", { className: "mbow-toolbar", children: [
7977
+ /* @__PURE__ */ jsxs21("select", { "aria-label": "Claims administrator filter", className: "mbow-select", value: claimsAdminId, onChange: (event) => setClaimsAdminId(event.target.value), children: [
7978
+ /* @__PURE__ */ jsx21("option", { value: "", children: "All claims administrators" }),
7979
+ result.filters.claimsAdministrators.map((item) => /* @__PURE__ */ jsx21("option", { value: item.id, children: item.name }, item.id))
7726
7980
  ] }),
7727
- /* @__PURE__ */ jsx19(RenderingProviderFilter, { value: renderingProviderId, options: result.filters.renderingProviders, onChange: setRenderingProviderId })
7981
+ /* @__PURE__ */ jsx21(RenderingProviderFilter, { value: renderingProviderId, options: result.filters.renderingProviders, onChange: setRenderingProviderId })
7728
7982
  ] }), ...selectionProps }),
7729
- result.waiting ? /* @__PURE__ */ jsx19(
7983
+ result.waiting ? /* @__PURE__ */ jsx21(
7730
7984
  BillTasksDashboard,
7731
7985
  {
7732
7986
  data: result.waiting,
@@ -7744,28 +7998,28 @@ function BillTasksContent({ client, onDrillDown, appearance }) {
7744
7998
  }
7745
7999
  function ConnectedBillTasksDashboard({ appearance, className, style, onDrillDown, ...options }) {
7746
8000
  const client = useClient(options);
7747
- return /* @__PURE__ */ jsx19(Surface, { appearance, className, style, children: /* @__PURE__ */ jsx19(BillTasksContent, { client, onDrillDown, appearance }) });
8001
+ return /* @__PURE__ */ jsx21(Surface, { appearance, className, style, children: /* @__PURE__ */ jsx21(BillTasksContent, { client, onDrillDown, appearance }) });
7748
8002
  }
7749
8003
  function RangeToolbar({ from, to, setFrom, setTo }) {
7750
- return /* @__PURE__ */ jsxs19("div", { className: "mbow-toolbar", children: [
7751
- /* @__PURE__ */ jsxs19("label", { children: [
8004
+ return /* @__PURE__ */ jsxs21("div", { className: "mbow-toolbar", children: [
8005
+ /* @__PURE__ */ jsxs21("label", { children: [
7752
8006
  "From ",
7753
- /* @__PURE__ */ jsx19("input", { className: "mbow-input", type: "date", value: from, onChange: (event) => setFrom(event.target.value) })
8007
+ /* @__PURE__ */ jsx21("input", { className: "mbow-input", type: "date", value: from, onChange: (event) => setFrom(event.target.value) })
7754
8008
  ] }),
7755
- /* @__PURE__ */ jsxs19("label", { children: [
8009
+ /* @__PURE__ */ jsxs21("label", { children: [
7756
8010
  "To ",
7757
- /* @__PURE__ */ jsx19("input", { className: "mbow-input", type: "date", value: to, onChange: (event) => setTo(event.target.value) })
8011
+ /* @__PURE__ */ jsx21("input", { className: "mbow-input", type: "date", value: to, onChange: (event) => setTo(event.target.value) })
7758
8012
  ] })
7759
8013
  ] });
7760
8014
  }
7761
8015
  function ConnectedServiceLineItemsReport({ appearance, className, style, initialFrom, initialTo, onSelectBill, ...options }) {
7762
- const defaults = useMemo10(() => defaultRange(), []);
8016
+ const defaults = useMemo11(() => defaultRange(), []);
7763
8017
  const client = useClient(options);
7764
- const [from, setFrom] = useState15(initialFrom ?? defaults.from);
7765
- const [to, setTo] = useState15(initialTo ?? defaults.to);
7766
- const [data, setData] = useState15(null);
7767
- const [error, setError] = useState15(null);
7768
- useEffect13(() => {
8018
+ const [from, setFrom] = useState17(initialFrom ?? defaults.from);
8019
+ const [to, setTo] = useState17(initialTo ?? defaults.to);
8020
+ const [data, setData] = useState17(null);
8021
+ const [error, setError] = useState17(null);
8022
+ useEffect14(() => {
7769
8023
  const controller = new AbortController();
7770
8024
  setError(null);
7771
8025
  void client.getServiceLineItems({ from, to }, controller.signal).then(setData).catch((cause) => {
@@ -7773,64 +8027,64 @@ function ConnectedServiceLineItemsReport({ appearance, className, style, initial
7773
8027
  });
7774
8028
  return () => controller.abort();
7775
8029
  }, [client, from, to]);
7776
- return /* @__PURE__ */ jsxs19(Surface, { appearance, className, style, children: [
7777
- /* @__PURE__ */ jsx19("div", { className: "mbow-head", children: /* @__PURE__ */ jsxs19("div", { children: [
7778
- /* @__PURE__ */ jsx19("h2", { children: "Original submissions by procedure" }),
7779
- /* @__PURE__ */ jsx19("p", { className: "mbow-sub", children: "First payer submission for each patient and date of service." })
8030
+ return /* @__PURE__ */ jsxs21(Surface, { appearance, className, style, children: [
8031
+ /* @__PURE__ */ jsx21("div", { className: "mbow-head", children: /* @__PURE__ */ jsxs21("div", { children: [
8032
+ /* @__PURE__ */ jsx21("h2", { children: "Original submissions by procedure" }),
8033
+ /* @__PURE__ */ jsx21("p", { className: "mbow-sub", children: "First payer submission for each patient and date of service." })
7780
8034
  ] }) }),
7781
- /* @__PURE__ */ jsx19(RangeToolbar, { from, to, setFrom, setTo }),
7782
- error ? /* @__PURE__ */ jsx19("div", { className: "mbow-state mbow-error", children: error.message }) : !data ? /* @__PURE__ */ jsx19("div", { className: "mbow-state", children: "Loading report\u2026" }) : /* @__PURE__ */ jsxs19(Fragment16, { children: [
7783
- /* @__PURE__ */ jsxs19("div", { className: "mbow-metrics", children: [
7784
- /* @__PURE__ */ jsx19(Metric, { label: "Original bills", value: String(data.totalBills) }),
7785
- /* @__PURE__ */ jsx19(Metric, { label: "Service lines", value: String(data.totalLines) }),
7786
- /* @__PURE__ */ jsx19(Metric, { label: "Total billed", value: money6(data.totalBilled) }),
7787
- /* @__PURE__ */ jsx19(Metric, { label: "Report window", value: data.windowLabel })
8035
+ /* @__PURE__ */ jsx21(RangeToolbar, { from, to, setFrom, setTo }),
8036
+ error ? /* @__PURE__ */ jsx21("div", { className: "mbow-state mbow-error", children: error.message }) : !data ? /* @__PURE__ */ jsx21("div", { className: "mbow-state", children: "Loading report\u2026" }) : /* @__PURE__ */ jsxs21(Fragment16, { children: [
8037
+ /* @__PURE__ */ jsxs21("div", { className: "mbow-metrics", children: [
8038
+ /* @__PURE__ */ jsx21(Metric, { label: "Original bills", value: String(data.totalBills) }),
8039
+ /* @__PURE__ */ jsx21(Metric, { label: "Service lines", value: String(data.totalLines) }),
8040
+ /* @__PURE__ */ jsx21(Metric, { label: "Total billed", value: money7(data.totalBilled) }),
8041
+ /* @__PURE__ */ jsx21(Metric, { label: "Report window", value: data.windowLabel })
7788
8042
  ] }),
7789
- /* @__PURE__ */ jsxs19("div", { className: "mbow-card mbow-scroll", children: [
7790
- /* @__PURE__ */ jsx19("div", { className: "mbow-section-head", children: /* @__PURE__ */ jsx19("h3", { children: "Procedure summary" }) }),
7791
- /* @__PURE__ */ jsxs19("table", { className: "mbow-table", children: [
7792
- /* @__PURE__ */ jsx19("thead", { children: /* @__PURE__ */ jsxs19("tr", { children: [
7793
- /* @__PURE__ */ jsx19("th", { children: "Procedure code" }),
7794
- /* @__PURE__ */ jsx19("th", { children: "Bills" }),
7795
- /* @__PURE__ */ jsx19("th", { children: "Service lines" }),
7796
- /* @__PURE__ */ jsx19("th", { className: "mbow-money", children: "Total billed" })
8043
+ /* @__PURE__ */ jsxs21("div", { className: "mbow-card mbow-scroll", children: [
8044
+ /* @__PURE__ */ jsx21("div", { className: "mbow-section-head", children: /* @__PURE__ */ jsx21("h3", { children: "Procedure summary" }) }),
8045
+ /* @__PURE__ */ jsxs21("table", { className: "mbow-table", children: [
8046
+ /* @__PURE__ */ jsx21("thead", { children: /* @__PURE__ */ jsxs21("tr", { children: [
8047
+ /* @__PURE__ */ jsx21("th", { children: "Procedure code" }),
8048
+ /* @__PURE__ */ jsx21("th", { children: "Bills" }),
8049
+ /* @__PURE__ */ jsx21("th", { children: "Service lines" }),
8050
+ /* @__PURE__ */ jsx21("th", { className: "mbow-money", children: "Total billed" })
7797
8051
  ] }) }),
7798
- /* @__PURE__ */ jsx19("tbody", { children: data.cptRows.map((row) => /* @__PURE__ */ jsxs19("tr", { children: [
7799
- /* @__PURE__ */ jsx19("td", { className: "mbow-strong", children: row.code }),
7800
- /* @__PURE__ */ jsx19("td", { children: row.bills }),
7801
- /* @__PURE__ */ jsx19("td", { children: row.lines }),
7802
- /* @__PURE__ */ jsx19("td", { className: "mbow-money", children: money6(row.billed) })
8052
+ /* @__PURE__ */ jsx21("tbody", { children: data.cptRows.map((row) => /* @__PURE__ */ jsxs21("tr", { children: [
8053
+ /* @__PURE__ */ jsx21("td", { className: "mbow-strong", children: row.code }),
8054
+ /* @__PURE__ */ jsx21("td", { children: row.bills }),
8055
+ /* @__PURE__ */ jsx21("td", { children: row.lines }),
8056
+ /* @__PURE__ */ jsx21("td", { className: "mbow-money", children: money7(row.billed) })
7803
8057
  ] }, row.code)) })
7804
8058
  ] })
7805
8059
  ] }),
7806
- /* @__PURE__ */ jsxs19("div", { className: "mbow-card mbow-scroll", style: { marginTop: 16 }, children: [
7807
- /* @__PURE__ */ jsx19("div", { className: "mbow-section-head", children: /* @__PURE__ */ jsx19("h3", { children: "All original bills" }) }),
7808
- /* @__PURE__ */ jsxs19("table", { className: "mbow-table", children: [
7809
- /* @__PURE__ */ jsx19("thead", { children: /* @__PURE__ */ jsxs19("tr", { children: [
7810
- /* @__PURE__ */ jsx19("th", { children: "Bill" }),
7811
- /* @__PURE__ */ jsx19("th", { children: "First submitted" }),
7812
- /* @__PURE__ */ jsx19("th", { children: "Patient \xB7 Claim" }),
7813
- /* @__PURE__ */ jsx19("th", { children: "DOS" }),
7814
- /* @__PURE__ */ jsx19("th", { children: "Claims administrator" }),
7815
- /* @__PURE__ */ jsx19("th", { children: "Codes" }),
7816
- /* @__PURE__ */ jsx19("th", { className: "mbow-money", children: "Billed" }),
7817
- /* @__PURE__ */ jsx19("th", { children: "Status" })
8060
+ /* @__PURE__ */ jsxs21("div", { className: "mbow-card mbow-scroll", style: { marginTop: 16 }, children: [
8061
+ /* @__PURE__ */ jsx21("div", { className: "mbow-section-head", children: /* @__PURE__ */ jsx21("h3", { children: "All original bills" }) }),
8062
+ /* @__PURE__ */ jsxs21("table", { className: "mbow-table", children: [
8063
+ /* @__PURE__ */ jsx21("thead", { children: /* @__PURE__ */ jsxs21("tr", { children: [
8064
+ /* @__PURE__ */ jsx21("th", { children: "Bill" }),
8065
+ /* @__PURE__ */ jsx21("th", { children: "First submitted" }),
8066
+ /* @__PURE__ */ jsx21("th", { children: "Patient \xB7 Claim" }),
8067
+ /* @__PURE__ */ jsx21("th", { children: "DOS" }),
8068
+ /* @__PURE__ */ jsx21("th", { children: "Claims administrator" }),
8069
+ /* @__PURE__ */ jsx21("th", { children: "Codes" }),
8070
+ /* @__PURE__ */ jsx21("th", { className: "mbow-money", children: "Billed" }),
8071
+ /* @__PURE__ */ jsx21("th", { children: "Status" })
7818
8072
  ] }) }),
7819
- /* @__PURE__ */ jsx19("tbody", { children: data.billRows.map((row) => /* @__PURE__ */ jsxs19("tr", { className: onSelectBill ? "clickable" : "", onClick: () => onSelectBill?.(row.billId), children: [
7820
- /* @__PURE__ */ jsxs19("td", { className: "mbow-strong", children: [
8073
+ /* @__PURE__ */ jsx21("tbody", { children: data.billRows.map((row) => /* @__PURE__ */ jsxs21("tr", { className: onSelectBill ? "clickable" : "", onClick: () => onSelectBill?.(row.billId), children: [
8074
+ /* @__PURE__ */ jsxs21("td", { className: "mbow-strong", children: [
7821
8075
  "#",
7822
8076
  row.billNumber
7823
8077
  ] }),
7824
- /* @__PURE__ */ jsx19("td", { children: shortDate(row.submittedDate) }),
7825
- /* @__PURE__ */ jsxs19("td", { children: [
8078
+ /* @__PURE__ */ jsx21("td", { children: shortDate(row.submittedDate) }),
8079
+ /* @__PURE__ */ jsxs21("td", { children: [
7826
8080
  row.patient,
7827
- /* @__PURE__ */ jsx19("div", { className: "mbow-muted", children: row.claim })
8081
+ /* @__PURE__ */ jsx21("div", { className: "mbow-muted", children: row.claim })
7828
8082
  ] }),
7829
- /* @__PURE__ */ jsx19("td", { children: shortDate(row.dos) }),
7830
- /* @__PURE__ */ jsx19("td", { children: row.claimsAdmin }),
7831
- /* @__PURE__ */ jsx19("td", { children: row.codes.join(", ") }),
7832
- /* @__PURE__ */ jsx19("td", { className: "mbow-money", children: money6(row.billed) }),
7833
- /* @__PURE__ */ jsx19("td", { children: row.status })
8083
+ /* @__PURE__ */ jsx21("td", { children: shortDate(row.dos) }),
8084
+ /* @__PURE__ */ jsx21("td", { children: row.claimsAdmin }),
8085
+ /* @__PURE__ */ jsx21("td", { children: row.codes.join(", ") }),
8086
+ /* @__PURE__ */ jsx21("td", { className: "mbow-money", children: money7(row.billed) }),
8087
+ /* @__PURE__ */ jsx21("td", { children: row.status })
7834
8088
  ] }, row.billId)) })
7835
8089
  ] })
7836
8090
  ] })
@@ -7838,19 +8092,19 @@ function ConnectedServiceLineItemsReport({ appearance, className, style, initial
7838
8092
  ] });
7839
8093
  }
7840
8094
  function Metric({ label, value }) {
7841
- return /* @__PURE__ */ jsxs19("div", { className: "mbow-metric", children: [
7842
- /* @__PURE__ */ jsx19("span", { children: label }),
7843
- /* @__PURE__ */ jsx19("strong", { children: value })
8095
+ return /* @__PURE__ */ jsxs21("div", { className: "mbow-metric", children: [
8096
+ /* @__PURE__ */ jsx21("span", { children: label }),
8097
+ /* @__PURE__ */ jsx21("strong", { children: value })
7844
8098
  ] });
7845
8099
  }
7846
8100
  function ConnectedProductivityReport({ appearance, className, style, initialFrom, initialTo, ...options }) {
7847
- const defaults = useMemo10(() => defaultRange(13), []);
8101
+ const defaults = useMemo11(() => defaultRange(13), []);
7848
8102
  const client = useClient(options);
7849
- const [from, setFrom] = useState15(initialFrom ?? defaults.from);
7850
- const [to, setTo] = useState15(initialTo ?? defaults.to);
7851
- const [data, setData] = useState15(null);
7852
- const [error, setError] = useState15(null);
7853
- useEffect13(() => {
8103
+ const [from, setFrom] = useState17(initialFrom ?? defaults.from);
8104
+ const [to, setTo] = useState17(initialTo ?? defaults.to);
8105
+ const [data, setData] = useState17(null);
8106
+ const [error, setError] = useState17(null);
8107
+ useEffect14(() => {
7854
8108
  const controller = new AbortController();
7855
8109
  setError(null);
7856
8110
  void client.getProductivity({ from, to }, controller.signal).then(setData).catch((cause) => {
@@ -7859,41 +8113,41 @@ function ConnectedProductivityReport({ appearance, className, style, initialFrom
7859
8113
  return () => controller.abort();
7860
8114
  }, [client, from, to]);
7861
8115
  const maxSent = data ? Math.max(1, ...Object.values(data.sentTotal)) : 1;
7862
- return /* @__PURE__ */ jsxs19(Surface, { appearance, className, style, children: [
7863
- /* @__PURE__ */ jsx19("div", { className: "mbow-head", children: /* @__PURE__ */ jsxs19("div", { children: [
7864
- /* @__PURE__ */ jsx19("h2", { children: "Productivity" }),
7865
- /* @__PURE__ */ jsx19("p", { className: "mbow-sub", children: "Bills created and sent per biller, plus accepted-first-try rate." })
8116
+ return /* @__PURE__ */ jsxs21(Surface, { appearance, className, style, children: [
8117
+ /* @__PURE__ */ jsx21("div", { className: "mbow-head", children: /* @__PURE__ */ jsxs21("div", { children: [
8118
+ /* @__PURE__ */ jsx21("h2", { children: "Productivity" }),
8119
+ /* @__PURE__ */ jsx21("p", { className: "mbow-sub", children: "Bills created and sent per biller, plus accepted-first-try rate." })
7866
8120
  ] }) }),
7867
- /* @__PURE__ */ jsx19(RangeToolbar, { from, to, setFrom, setTo }),
7868
- error ? /* @__PURE__ */ jsx19("div", { className: "mbow-state mbow-error", children: error.message }) : !data ? /* @__PURE__ */ jsx19("div", { className: "mbow-state", children: "Loading report\u2026" }) : /* @__PURE__ */ jsxs19(Fragment16, { children: [
7869
- /* @__PURE__ */ jsxs19("div", { className: "mbow-metrics", children: [
7870
- /* @__PURE__ */ jsx19(Metric, { label: "Bills created", value: String(data.totalCreated) }),
7871
- /* @__PURE__ */ jsx19(Metric, { label: "Transmissions", value: String(data.totalSent) }),
7872
- /* @__PURE__ */ jsx19(Metric, { label: "Bills submitted", value: String(data.totalSubmitted) }),
7873
- /* @__PURE__ */ jsx19(Metric, { label: "Accepted first try", value: data.totalSubmitted ? `${Math.round(data.totalClean / data.totalSubmitted * 100)}%` : "\u2014" })
8121
+ /* @__PURE__ */ jsx21(RangeToolbar, { from, to, setFrom, setTo }),
8122
+ error ? /* @__PURE__ */ jsx21("div", { className: "mbow-state mbow-error", children: error.message }) : !data ? /* @__PURE__ */ jsx21("div", { className: "mbow-state", children: "Loading report\u2026" }) : /* @__PURE__ */ jsxs21(Fragment16, { children: [
8123
+ /* @__PURE__ */ jsxs21("div", { className: "mbow-metrics", children: [
8124
+ /* @__PURE__ */ jsx21(Metric, { label: "Bills created", value: String(data.totalCreated) }),
8125
+ /* @__PURE__ */ jsx21(Metric, { label: "Transmissions", value: String(data.totalSent) }),
8126
+ /* @__PURE__ */ jsx21(Metric, { label: "Bills submitted", value: String(data.totalSubmitted) }),
8127
+ /* @__PURE__ */ jsx21(Metric, { label: "Accepted first try", value: data.totalSubmitted ? `${Math.round(data.totalClean / data.totalSubmitted * 100)}%` : "\u2014" })
7874
8128
  ] }),
7875
- /* @__PURE__ */ jsxs19("div", { className: "mbow-card mbow-scroll", children: [
7876
- /* @__PURE__ */ jsx19("div", { className: "mbow-section-head", children: /* @__PURE__ */ jsx19("h3", { children: "Per-biller summary" }) }),
7877
- /* @__PURE__ */ jsxs19("table", { className: "mbow-table", children: [
7878
- /* @__PURE__ */ jsx19("thead", { children: /* @__PURE__ */ jsxs19("tr", { children: [
7879
- /* @__PURE__ */ jsx19("th", { children: "Biller" }),
7880
- /* @__PURE__ */ jsx19("th", { children: "Created" }),
7881
- /* @__PURE__ */ jsx19("th", { children: "Transmissions" }),
7882
- /* @__PURE__ */ jsx19("th", { children: "Submitted" }),
7883
- /* @__PURE__ */ jsx19("th", { children: "Accepted first try" }),
7884
- /* @__PURE__ */ jsx19("th", { children: "Volume" })
8129
+ /* @__PURE__ */ jsxs21("div", { className: "mbow-card mbow-scroll", children: [
8130
+ /* @__PURE__ */ jsx21("div", { className: "mbow-section-head", children: /* @__PURE__ */ jsx21("h3", { children: "Per-biller summary" }) }),
8131
+ /* @__PURE__ */ jsxs21("table", { className: "mbow-table", children: [
8132
+ /* @__PURE__ */ jsx21("thead", { children: /* @__PURE__ */ jsxs21("tr", { children: [
8133
+ /* @__PURE__ */ jsx21("th", { children: "Biller" }),
8134
+ /* @__PURE__ */ jsx21("th", { children: "Created" }),
8135
+ /* @__PURE__ */ jsx21("th", { children: "Transmissions" }),
8136
+ /* @__PURE__ */ jsx21("th", { children: "Submitted" }),
8137
+ /* @__PURE__ */ jsx21("th", { children: "Accepted first try" }),
8138
+ /* @__PURE__ */ jsx21("th", { children: "Volume" })
7885
8139
  ] }) }),
7886
- /* @__PURE__ */ jsx19("tbody", { children: data.billers.map((biller) => {
8140
+ /* @__PURE__ */ jsx21("tbody", { children: data.billers.map((biller) => {
7887
8141
  const sent = data.sentTotal[biller.name] ?? 0;
7888
8142
  const submitted = data.submittedTotal[biller.name] ?? 0;
7889
8143
  const clean = data.cleanTotal[biller.name] ?? 0;
7890
- return /* @__PURE__ */ jsxs19("tr", { children: [
7891
- /* @__PURE__ */ jsx19("td", { className: "mbow-strong", children: biller.name }),
7892
- /* @__PURE__ */ jsx19("td", { children: data.createdTotal[biller.name] ?? 0 }),
7893
- /* @__PURE__ */ jsx19("td", { children: sent }),
7894
- /* @__PURE__ */ jsx19("td", { children: submitted }),
7895
- /* @__PURE__ */ jsx19("td", { children: submitted ? `${Math.round(clean / submitted * 100)}%` : "\u2014" }),
7896
- /* @__PURE__ */ jsx19("td", { children: /* @__PURE__ */ jsx19("div", { className: "mbow-bar", children: /* @__PURE__ */ jsx19("i", { style: { width: `${sent / maxSent * 100}%` } }) }) })
8144
+ return /* @__PURE__ */ jsxs21("tr", { children: [
8145
+ /* @__PURE__ */ jsx21("td", { className: "mbow-strong", children: biller.name }),
8146
+ /* @__PURE__ */ jsx21("td", { children: data.createdTotal[biller.name] ?? 0 }),
8147
+ /* @__PURE__ */ jsx21("td", { children: sent }),
8148
+ /* @__PURE__ */ jsx21("td", { children: submitted }),
8149
+ /* @__PURE__ */ jsx21("td", { children: submitted ? `${Math.round(clean / submitted * 100)}%` : "\u2014" }),
8150
+ /* @__PURE__ */ jsx21("td", { children: /* @__PURE__ */ jsx21("div", { className: "mbow-bar", children: /* @__PURE__ */ jsx21("i", { style: { width: `${sent / maxSent * 100}%` } }) }) })
7897
8151
  ] }, biller.name);
7898
8152
  }) })
7899
8153
  ] })
@@ -7901,37 +8155,37 @@ function ConnectedProductivityReport({ appearance, className, style, initialFrom
7901
8155
  ] })
7902
8156
  ] });
7903
8157
  }
7904
- function ConnectedBillingWorkspace({ appearance, className, style, initialView = "tasks", onCreateBill, sandboxControls = false, getCourtesyCopyRecipientOptions, ...options }) {
8158
+ function ConnectedBillingWorkspace({ appearance, className, style, initialView = "tasks", onCreateBill, onPostPayment, sandboxControls = false, getCourtesyCopyRecipientOptions, ...options }) {
7905
8159
  const client = useClient(options);
7906
- const [view, setView] = useState15(initialView);
7907
- const [billQuery, setBillQuery] = useState15({ status: "all" });
7908
- const [selectedBillId, setSelectedBillId] = useState15(null);
8160
+ const [view, setView] = useState17(initialView);
8161
+ const [billQuery, setBillQuery] = useState17({ status: "all" });
8162
+ const [selectedBillId, setSelectedBillId] = useState17(null);
7909
8163
  const { workspaceRef, availableHeight } = useAvailableViewportHeight();
7910
8164
  const workspaceClassName = ["mbow-workspace", className].filter(Boolean).join(" ");
7911
8165
  const hasExplicitHeight = style?.height != null || style?.maxHeight != null;
7912
8166
  const workspaceStyle = availableHeight == null || hasExplicitHeight ? style : { ...style, maxHeight: availableHeight };
7913
- if (selectedBillId) return /* @__PURE__ */ jsxs19(Surface, { surfaceRef: workspaceRef, appearance, className: workspaceClassName, style: workspaceStyle, children: [
7914
- /* @__PURE__ */ jsx19("button", { className: "mbow-button mbow-back", type: "button", onClick: () => setSelectedBillId(null), children: "\u2190 Back to bills" }),
7915
- /* @__PURE__ */ jsx19(ConnectedBillLifecycle, { billId: selectedBillId, sandboxControls, courtesyCopyRecipientOptions: getCourtesyCopyRecipientOptions?.(selectedBillId) ?? [], ...options, ...appearance ? { appearance } : {} })
8167
+ if (selectedBillId) return /* @__PURE__ */ jsxs21(Surface, { surfaceRef: workspaceRef, appearance, className: workspaceClassName, style: workspaceStyle, children: [
8168
+ /* @__PURE__ */ jsx21("button", { className: "mbow-button mbow-back", type: "button", onClick: () => setSelectedBillId(null), children: "\u2190 Back to bills" }),
8169
+ /* @__PURE__ */ jsx21(ConnectedBillLifecycle, { billId: selectedBillId, sandboxControls, courtesyCopyRecipientOptions: getCourtesyCopyRecipientOptions?.(selectedBillId) ?? [], ...options, ...appearance ? { appearance } : {} })
7916
8170
  ] });
7917
8171
  const selectView = (next) => {
7918
8172
  setView(next);
7919
8173
  setSelectedBillId(null);
7920
8174
  };
7921
8175
  const appearanceProps = appearance ? { appearance } : {};
7922
- return /* @__PURE__ */ jsxs19(Surface, { surfaceRef: workspaceRef, appearance, className: workspaceClassName, style: workspaceStyle, children: [
7923
- /* @__PURE__ */ jsxs19("div", { className: "mbow-head", children: [
7924
- /* @__PURE__ */ jsxs19("div", { children: [
7925
- /* @__PURE__ */ jsx19("h2", { children: "Billing" }),
7926
- /* @__PURE__ */ jsx19("p", { className: "mbow-sub", children: "Follow up on open work or find any bill and its current status." })
8176
+ return /* @__PURE__ */ jsxs21(Surface, { surfaceRef: workspaceRef, appearance, className: workspaceClassName, style: workspaceStyle, children: [
8177
+ /* @__PURE__ */ jsxs21("div", { className: "mbow-head", children: [
8178
+ /* @__PURE__ */ jsxs21("div", { children: [
8179
+ /* @__PURE__ */ jsx21("h2", { children: "Billing" }),
8180
+ /* @__PURE__ */ jsx21("p", { className: "mbow-sub", children: "Follow up on open work or find any bill and its current status." })
7927
8181
  ] }),
7928
- onCreateBill ? /* @__PURE__ */ jsx19("div", { className: "mbow-actions", children: /* @__PURE__ */ jsx19("button", { className: "mbow-button primary", type: "button", onClick: onCreateBill, children: "+ Add bill" }) }) : null
8182
+ onCreateBill ? /* @__PURE__ */ jsx21("div", { className: "mbow-actions", children: /* @__PURE__ */ jsx21("button", { className: "mbow-button primary", type: "button", onClick: onCreateBill, children: "+ Add bill" }) }) : null
7929
8183
  ] }),
7930
- /* @__PURE__ */ jsx19("div", { className: "mbow-tabs", role: "tablist", children: [["tasks", "Bill tasks"], ["bills", "All bills"], ["procedures", "Procedures"], ["productivity", "Productivity"]].map(([id, label]) => /* @__PURE__ */ jsx19("button", { className: `mbow-tab ${view === id ? "active" : ""}`, type: "button", role: "tab", "aria-selected": view === id, onClick: () => selectView(id), children: label }, id)) }),
7931
- view === "tasks" ? /* @__PURE__ */ jsx19(BillTasksContent, { client, onDrillDown: (query) => {
8184
+ /* @__PURE__ */ jsx21("div", { className: "mbow-tabs", role: "tablist", children: [["tasks", "Bill tasks"], ["bills", "All bills"], ["procedures", "Procedures"], ["productivity", "Productivity"], ["payments", "Payment review"]].map(([id, label]) => /* @__PURE__ */ jsx21("button", { className: `mbow-tab ${view === id ? "active" : ""}`, type: "button", role: "tab", "aria-selected": view === id, onClick: () => selectView(id), children: label }, id)) }),
8185
+ view === "tasks" ? /* @__PURE__ */ jsx21(BillTasksContent, { client, onDrillDown: (query) => {
7932
8186
  setBillQuery(query);
7933
8187
  setView("bills");
7934
- }, appearance }) : view === "bills" ? /* @__PURE__ */ jsx19(BillSearchContent, { client, initialQuery: billQuery, onSelectBill: (bill) => setSelectedBillId(bill.id) }) : view === "procedures" ? /* @__PURE__ */ jsx19(ConnectedServiceLineItemsReport, { ...options, ...appearanceProps, onSelectBill: setSelectedBillId }) : /* @__PURE__ */ jsx19(ConnectedProductivityReport, { ...options, ...appearanceProps })
8188
+ }, appearance }) : view === "bills" ? /* @__PURE__ */ jsx21(BillSearchContent, { client, initialQuery: billQuery, onSelectBill: (bill) => setSelectedBillId(bill.id) }) : view === "procedures" ? /* @__PURE__ */ jsx21(ConnectedServiceLineItemsReport, { ...options, ...appearanceProps, onSelectBill: setSelectedBillId }) : view === "payments" ? /* @__PURE__ */ jsx21(ConnectedPaymentReview, { ...options, ...appearanceProps, ...onPostPayment ? { onPostPayment } : {}, onSelectBill: setSelectedBillId }) : /* @__PURE__ */ jsx21(ConnectedProductivityReport, { ...options, ...appearanceProps })
7935
8189
  ] });
7936
8190
  }
7937
8191
 
@@ -7939,7 +8193,7 @@ function ConnectedBillingWorkspace({ appearance, className, style, initialView =
7939
8193
  function widget(tagName, props) {
7940
8194
  const ref = useRef10(null);
7941
8195
  const { onMindBill, onMindBillError } = props;
7942
- useEffect14(() => {
8196
+ useEffect15(() => {
7943
8197
  const element = ref.current;
7944
8198
  if (!element) return;
7945
8199
  const handleEvent = (event) => onMindBill?.(event);
@@ -8019,6 +8273,7 @@ export {
8019
8273
  ConnectedBillTasksDashboard,
8020
8274
  ConnectedBillingWorkspace,
8021
8275
  ConnectedNotificationSettings,
8276
+ ConnectedPaymentReview,
8022
8277
  ConnectedProductivityReport,
8023
8278
  ConnectedServiceLineItemsReport,
8024
8279
  DEFAULT_BILL_SUBMISSION_MODIFIERS,
@@ -8037,6 +8292,7 @@ export {
8037
8292
  SECOND_REVIEW_WINDOW_DAYS,
8038
8293
  SecondReviewForm,
8039
8294
  SendRouteDialog,
8295
+ W9Upload,
8040
8296
  applyBillSubmissionEvaluationDiagnoses,
8041
8297
  applyBillSubmissionEvaluationModifiers,
8042
8298
  billActivityEventLabel,