@mindbill/react 0.29.0 → 0.31.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/README.md +16 -0
- package/dist/index.d.ts +21 -2
- package/dist/index.js +647 -365
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
// src/index.tsx
|
|
4
4
|
import "@mindbill/embed";
|
|
5
|
-
import { createElement, useEffect as
|
|
5
|
+
import { createElement, useEffect as useEffect7, useRef as useRef6 } from "react";
|
|
6
6
|
|
|
7
7
|
// src/appearance.ts
|
|
8
8
|
var mindBillThemePresets = {
|
|
@@ -2876,19 +2876,290 @@ function BillStatusAgingMatrix({
|
|
|
2876
2876
|
] });
|
|
2877
2877
|
}
|
|
2878
2878
|
|
|
2879
|
+
// src/organization-onboarding.tsx
|
|
2880
|
+
import { useCallback as useCallback2, useEffect as useEffect4, useMemo as useMemo5, useRef as useRef3, useState as useState5 } from "react";
|
|
2881
|
+
import {
|
|
2882
|
+
createOrganizationClient
|
|
2883
|
+
} from "@mindbill/browser";
|
|
2884
|
+
import { Fragment as Fragment4, jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2885
|
+
var STEPS = [
|
|
2886
|
+
{ id: "practice", label: "Practice & billing" },
|
|
2887
|
+
{ id: "locations", label: "Locations" },
|
|
2888
|
+
{ id: "w9", label: "W-9" },
|
|
2889
|
+
{ id: "review", label: "Review" }
|
|
2890
|
+
];
|
|
2891
|
+
var css4 = `
|
|
2892
|
+
.mbob{color:var(--mb-text);font-family:var(--mb-font);font-size:15px}.mbob *{box-sizing:border-box}.mbob h2,.mbob h3,.mbob p{margin:0}
|
|
2893
|
+
.mbob-card{border:1px solid var(--mb-border);border-radius:var(--mb-radius);background:var(--mb-surface);box-shadow:var(--mb-shadow);padding:24px}
|
|
2894
|
+
.mbob-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;margin-bottom:18px}.mbob-head h2{font-size:22px}.mbob-copy{color:var(--mb-muted);margin-top:5px!important}
|
|
2895
|
+
.mbob-steps{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:20px}
|
|
2896
|
+
.mbob-step{display:inline-flex;align-items:center;gap:7px;border:1px solid var(--mb-border);border-radius:999px;background:var(--mb-surface);padding:7px 13px;color:var(--mb-muted);font:inherit;font-size:13px;font-weight:700;cursor:pointer}
|
|
2897
|
+
.mbob-step[data-active=true]{border-color:var(--mb-accent);color:var(--mb-accent);background:color-mix(in srgb,var(--mb-accent) 8%,var(--mb-surface))}
|
|
2898
|
+
.mbob-step[data-done=true] i{color:#159447;font-style:normal}
|
|
2899
|
+
.mbob-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px 22px}.mbob-span{grid-column:1/-1}
|
|
2900
|
+
.mbob-field{display:grid;gap:7px;font-size:13px;font-weight:720}
|
|
2901
|
+
.mbob-field input{width:100%;min-height:44px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);background:var(--mb-input);padding:10px 12px;color:var(--mb-text);font:inherit;font-weight:450}
|
|
2902
|
+
.mbob-field input:focus{outline:3px solid color-mix(in srgb,var(--mb-accent) 22%,transparent);border-color:var(--mb-accent)}
|
|
2903
|
+
.mbob-subhead{margin:20px 0 12px!important;padding-top:16px;border-top:1px solid var(--mb-border);font-size:15px}
|
|
2904
|
+
.mbob-loc{display:grid;grid-template-columns:1.2fr 1.4fr .9fr .4fr .6fr auto auto;gap:10px;align-items:end;border-top:1px solid color-mix(in srgb,var(--mb-border) 60%,transparent);padding:12px 0}
|
|
2905
|
+
.mbob-loc:first-of-type{border-top:0}
|
|
2906
|
+
.mbob-primary{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--mb-muted);white-space:nowrap;padding-bottom:12px}
|
|
2907
|
+
.mbob-remove{border:0;background:transparent;color:var(--mb-muted);font-size:20px;cursor:pointer;padding-bottom:8px}
|
|
2908
|
+
.mbob-add,.mbob-secondary{border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);background:var(--mb-surface);padding:10px 14px;color:var(--mb-text);font:inherit;font-weight:700;cursor:pointer}
|
|
2909
|
+
.mbob-drop{display:grid;place-content:center;gap:6px;min-height:150px;border:2px dashed color-mix(in srgb,var(--mb-muted) 55%,transparent);border-radius:var(--mb-control-radius);text-align:center;cursor:pointer;position:relative}
|
|
2910
|
+
.mbob-drop input{position:absolute;inset:0;opacity:0;cursor:pointer}
|
|
2911
|
+
.mbob-drop span{color:var(--mb-muted);font-size:13px}
|
|
2912
|
+
.mbob-w9-current{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid #9fd6b4;border-radius:var(--mb-control-radius);background:#f3fcf6;padding:12px 14px;margin-bottom:14px}
|
|
2913
|
+
.mbob-w9-current span{color:var(--mb-muted);font-size:13px}
|
|
2914
|
+
.mbob-check{display:grid;gap:9px}
|
|
2915
|
+
.mbob-check-item{display:flex;align-items:center;gap:10px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);padding:11px 14px}
|
|
2916
|
+
.mbob-check-item[data-complete=true]{border-color:#9fd6b4;background:#f3fcf6}
|
|
2917
|
+
.mbob-check-item i{font-style:normal}
|
|
2918
|
+
.mbob-actions{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-top:20px}
|
|
2919
|
+
.mbob-save{min-width:170px;border:0;border-radius:var(--mb-control-radius);background:var(--mb-accent);color:var(--mb-accent-contrast);padding:12px 22px;font:inherit;font-weight:780;cursor:pointer}
|
|
2920
|
+
.mbob-save:disabled{opacity:.6;cursor:wait}
|
|
2921
|
+
.mbob-error{margin-top:14px;border-left:4px solid var(--mb-danger);border-radius:var(--mb-control-radius);background:color-mix(in srgb,var(--mb-danger) 8%,var(--mb-surface));padding:12px 14px;color:var(--mb-danger)}
|
|
2922
|
+
.mbob-status{color:var(--mb-muted)}
|
|
2923
|
+
.mbob-done{color:#159447;font-weight:750}
|
|
2924
|
+
@media(max-width:820px){.mbob-grid{grid-template-columns:1fr}.mbob-span{grid-column:auto}.mbob-loc{grid-template-columns:1fr 1fr;align-items:center}.mbob-loc>*{grid-column:auto}}
|
|
2925
|
+
`;
|
|
2926
|
+
var blankLocation = () => ({ name: "", street: "", city: "", state: "", zip: "", isPrimary: false });
|
|
2927
|
+
async function fileToBase64(file) {
|
|
2928
|
+
const buffer = new Uint8Array(await file.arrayBuffer());
|
|
2929
|
+
let binary = "";
|
|
2930
|
+
for (const byte of buffer) binary += String.fromCharCode(byte);
|
|
2931
|
+
return btoa(binary);
|
|
2932
|
+
}
|
|
2933
|
+
function OrganizationOnboarding({
|
|
2934
|
+
appearance,
|
|
2935
|
+
className = "",
|
|
2936
|
+
style,
|
|
2937
|
+
sessionEndpoint = "/api/mindbill/session",
|
|
2938
|
+
getSession,
|
|
2939
|
+
apiBaseUrl,
|
|
2940
|
+
heading = "Billing setup",
|
|
2941
|
+
description = "Practice identity, locations, and the W-9 \u2014 saved once, used on every bill.",
|
|
2942
|
+
variant = "onboarding",
|
|
2943
|
+
onSaved,
|
|
2944
|
+
onCompleted,
|
|
2945
|
+
onError
|
|
2946
|
+
}) {
|
|
2947
|
+
const client = useMemo5(
|
|
2948
|
+
() => createOrganizationClient({
|
|
2949
|
+
sessionEndpoint,
|
|
2950
|
+
...getSession ? { getSession } : {},
|
|
2951
|
+
...apiBaseUrl ? { apiBaseUrl } : {}
|
|
2952
|
+
}),
|
|
2953
|
+
[sessionEndpoint, getSession, apiBaseUrl]
|
|
2954
|
+
);
|
|
2955
|
+
const [profile, setProfile] = useState5(null);
|
|
2956
|
+
const [loadError, setLoadError] = useState5(null);
|
|
2957
|
+
const [step, setStep] = useState5("practice");
|
|
2958
|
+
const [identity, setIdentity] = useState5({ name: "", legalName: "", taxId: "", npi: "", phone: "", email: "" });
|
|
2959
|
+
const [provider, setProvider] = useState5({ name: "", taxId: "", npi: "", billType: "Professional", phone: "", billingStreet: "", billingCity: "", billingState: "", billingZip: "" });
|
|
2960
|
+
const [locations, setLocations] = useState5([blankLocation()]);
|
|
2961
|
+
const [w9File, setW9File] = useState5(null);
|
|
2962
|
+
const [saving, setSaving] = useState5(false);
|
|
2963
|
+
const [error, setError] = useState5(null);
|
|
2964
|
+
const [savedStep, setSavedStep] = useState5({});
|
|
2965
|
+
const completedFired = useRef3(false);
|
|
2966
|
+
const adoptProfile = useCallback2((next) => {
|
|
2967
|
+
setProfile(next);
|
|
2968
|
+
setIdentity((current) => ({
|
|
2969
|
+
name: next.practiceIdentity.name ?? current.name,
|
|
2970
|
+
legalName: next.practiceIdentity.legalName ?? current.legalName,
|
|
2971
|
+
taxId: next.practiceIdentity.taxId ?? current.taxId,
|
|
2972
|
+
npi: next.practiceIdentity.npi ?? current.npi,
|
|
2973
|
+
phone: next.practiceIdentity.phone ?? current.phone,
|
|
2974
|
+
email: next.practiceIdentity.email ?? current.email
|
|
2975
|
+
}));
|
|
2976
|
+
if (next.billingProviders[0]) setProvider({ billType: "Professional", ...next.billingProviders[0] });
|
|
2977
|
+
if (next.locations.length) setLocations(next.locations.map((item) => ({ ...item })));
|
|
2978
|
+
if (next.onboarding.complete && !completedFired.current) {
|
|
2979
|
+
completedFired.current = true;
|
|
2980
|
+
onCompleted?.(next);
|
|
2981
|
+
}
|
|
2982
|
+
}, [onCompleted]);
|
|
2983
|
+
useEffect4(() => {
|
|
2984
|
+
let alive = true;
|
|
2985
|
+
client.getOrganization().then((next) => {
|
|
2986
|
+
if (alive) {
|
|
2987
|
+
setLoadError(null);
|
|
2988
|
+
adoptProfile(next);
|
|
2989
|
+
}
|
|
2990
|
+
}).catch((caught) => {
|
|
2991
|
+
if (!alive) return;
|
|
2992
|
+
const failure = caught instanceof Error ? caught : new Error("The organization could not be loaded.");
|
|
2993
|
+
setLoadError(failure.message);
|
|
2994
|
+
onError?.(failure);
|
|
2995
|
+
});
|
|
2996
|
+
return () => {
|
|
2997
|
+
alive = false;
|
|
2998
|
+
};
|
|
2999
|
+
}, [client, adoptProfile, onError]);
|
|
3000
|
+
const run = async (work, stepId) => {
|
|
3001
|
+
setSaving(true);
|
|
3002
|
+
setError(null);
|
|
3003
|
+
try {
|
|
3004
|
+
const next = await work();
|
|
3005
|
+
adoptProfile(next);
|
|
3006
|
+
setSavedStep((current) => ({ ...current, [stepId]: true }));
|
|
3007
|
+
onSaved?.(next);
|
|
3008
|
+
if (variant === "onboarding") {
|
|
3009
|
+
const order = ["practice", "locations", "w9", "review"];
|
|
3010
|
+
const nextStep = order[order.indexOf(stepId) + 1];
|
|
3011
|
+
if (nextStep) setStep(nextStep);
|
|
3012
|
+
}
|
|
3013
|
+
} catch (caught) {
|
|
3014
|
+
const failure = caught instanceof Error ? caught : new Error("Saving failed.");
|
|
3015
|
+
setError(failure.message);
|
|
3016
|
+
onError?.(failure);
|
|
3017
|
+
} finally {
|
|
3018
|
+
setSaving(false);
|
|
3019
|
+
}
|
|
3020
|
+
};
|
|
3021
|
+
const savePractice = () => run(() => client.saveBillingProfile({
|
|
3022
|
+
practiceIdentity: identity,
|
|
3023
|
+
...provider.name.trim() || provider.taxId.trim() || provider.npi.trim() ? { billingProviders: [provider] } : {}
|
|
3024
|
+
}), "practice");
|
|
3025
|
+
const saveLocations = () => run(() => client.saveLocations(locations.filter((item) => item.name.trim() || item.street.trim())), "locations");
|
|
3026
|
+
const saveW9 = () => run(async () => {
|
|
3027
|
+
if (!w9File) throw new Error("Choose the practice W-9 PDF first.");
|
|
3028
|
+
return client.saveW9({ filename: w9File.name, contentBase64: await fileToBase64(w9File) });
|
|
3029
|
+
}, "w9");
|
|
3030
|
+
const field = (label, value, onChange, span = false, placeholder = "") => /* @__PURE__ */ jsxs6("label", { className: `mbob-field${span ? " mbob-span" : ""}`, children: [
|
|
3031
|
+
label,
|
|
3032
|
+
/* @__PURE__ */ jsx6("input", { value, placeholder, onChange: (event) => onChange(event.target.value), disabled: saving })
|
|
3033
|
+
] });
|
|
3034
|
+
const setLocation = (index, patch) => setLocations((current) => current.map((item, itemIndex) => {
|
|
3035
|
+
if (itemIndex !== index) return patch.isPrimary ? { ...item, isPrimary: false } : item;
|
|
3036
|
+
return { ...item, ...patch };
|
|
3037
|
+
}));
|
|
3038
|
+
const practiceSection = /* @__PURE__ */ jsxs6("div", { children: [
|
|
3039
|
+
/* @__PURE__ */ jsxs6("div", { className: "mbob-grid", children: [
|
|
3040
|
+
field("Practice name", identity.name, (name) => setIdentity((c) => ({ ...c, name }))),
|
|
3041
|
+
field("Legal name", identity.legalName, (legalName) => setIdentity((c) => ({ ...c, legalName }))),
|
|
3042
|
+
field("Tax ID (EIN)", identity.taxId, (taxId) => setIdentity((c) => ({ ...c, taxId })), false, "94-1234567"),
|
|
3043
|
+
field("Group NPI", identity.npi, (npi) => setIdentity((c) => ({ ...c, npi }))),
|
|
3044
|
+
field("Phone", identity.phone, (phone) => setIdentity((c) => ({ ...c, phone }))),
|
|
3045
|
+
field("Email", identity.email, (email) => setIdentity((c) => ({ ...c, email })))
|
|
3046
|
+
] }),
|
|
3047
|
+
/* @__PURE__ */ jsx6("h3", { className: "mbob-subhead", children: "Billing provider (pay-to)" }),
|
|
3048
|
+
/* @__PURE__ */ jsxs6("div", { className: "mbob-grid", children: [
|
|
3049
|
+
field("Billing provider name", provider.name, (name) => setProvider((c) => ({ ...c, name }))),
|
|
3050
|
+
field("Billing tax ID", provider.taxId, (taxId) => setProvider((c) => ({ ...c, taxId }))),
|
|
3051
|
+
field("Billing NPI", provider.npi, (npi) => setProvider((c) => ({ ...c, npi }))),
|
|
3052
|
+
field("Billing phone", provider.phone ?? "", (phone) => setProvider((c) => ({ ...c, phone }))),
|
|
3053
|
+
field("Street", provider.billingStreet ?? "", (billingStreet) => setProvider((c) => ({ ...c, billingStreet })), true),
|
|
3054
|
+
field("City", provider.billingCity ?? "", (billingCity) => setProvider((c) => ({ ...c, billingCity }))),
|
|
3055
|
+
field("State", provider.billingState ?? "", (billingState) => setProvider((c) => ({ ...c, billingState: billingState.toUpperCase().slice(0, 2) }))),
|
|
3056
|
+
field("ZIP", provider.billingZip ?? "", (billingZip) => setProvider((c) => ({ ...c, billingZip })))
|
|
3057
|
+
] }),
|
|
3058
|
+
/* @__PURE__ */ jsxs6("div", { className: "mbob-actions", children: [
|
|
3059
|
+
/* @__PURE__ */ jsx6("span", { className: "mbob-status", children: savedStep["practice"] ? "Saved to MindBill." : "Saved once, used on every bill." }),
|
|
3060
|
+
/* @__PURE__ */ jsx6("button", { className: "mbob-save", type: "button", disabled: saving, onClick: savePractice, children: saving ? "Saving\u2026" : "Save practice" })
|
|
3061
|
+
] })
|
|
3062
|
+
] });
|
|
3063
|
+
const locationsSection = /* @__PURE__ */ jsxs6("div", { children: [
|
|
3064
|
+
locations.map((location, index) => /* @__PURE__ */ jsxs6("div", { className: "mbob-loc", children: [
|
|
3065
|
+
field("Name", location.name, (name) => setLocation(index, { name })),
|
|
3066
|
+
field("Street", location.street, (street) => setLocation(index, { street })),
|
|
3067
|
+
field("City", location.city, (city) => setLocation(index, { city })),
|
|
3068
|
+
field("State", location.state, (state) => setLocation(index, { state: state.toUpperCase().slice(0, 2) })),
|
|
3069
|
+
field("ZIP", location.zip, (zip) => setLocation(index, { zip })),
|
|
3070
|
+
/* @__PURE__ */ jsxs6("label", { className: "mbob-primary", children: [
|
|
3071
|
+
/* @__PURE__ */ jsx6("input", { type: "radio", name: "mbob-primary", checked: location.isPrimary === true, onChange: () => setLocation(index, { isPrimary: true }) }),
|
|
3072
|
+
" Primary"
|
|
3073
|
+
] }),
|
|
3074
|
+
/* @__PURE__ */ jsx6("button", { className: "mbob-remove", type: "button", "aria-label": "Remove location", onClick: () => setLocations((current) => current.filter((_, itemIndex) => itemIndex !== index)), children: "\xD7" })
|
|
3075
|
+
] }, location.id ?? index)),
|
|
3076
|
+
/* @__PURE__ */ jsx6("button", { className: "mbob-add", type: "button", onClick: () => setLocations((current) => [...current, blankLocation()]), children: "+ Add location" }),
|
|
3077
|
+
/* @__PURE__ */ jsxs6("div", { className: "mbob-actions", children: [
|
|
3078
|
+
/* @__PURE__ */ jsx6("span", { className: "mbob-status", children: savedStep["locations"] ? "Saved to MindBill." : "Where evaluations happen." }),
|
|
3079
|
+
/* @__PURE__ */ jsx6("button", { className: "mbob-save", type: "button", disabled: saving, onClick: saveLocations, children: saving ? "Saving\u2026" : "Save locations" })
|
|
3080
|
+
] })
|
|
3081
|
+
] });
|
|
3082
|
+
const w9Section = /* @__PURE__ */ jsxs6("div", { children: [
|
|
3083
|
+
profile?.w9 ? /* @__PURE__ */ jsxs6("div", { className: "mbob-w9-current", children: [
|
|
3084
|
+
/* @__PURE__ */ jsxs6("div", { children: [
|
|
3085
|
+
/* @__PURE__ */ jsx6("strong", { children: profile.w9.filename }),
|
|
3086
|
+
/* @__PURE__ */ jsxs6("span", { children: [
|
|
3087
|
+
" \xB7 added ",
|
|
3088
|
+
profile.w9.addDate
|
|
3089
|
+
] })
|
|
3090
|
+
] }),
|
|
3091
|
+
/* @__PURE__ */ jsx6("span", { children: "Rides on every bill automatically" })
|
|
3092
|
+
] }) : null,
|
|
3093
|
+
/* @__PURE__ */ jsxs6("label", { className: "mbob-drop", children: [
|
|
3094
|
+
/* @__PURE__ */ jsx6("input", { type: "file", accept: "application/pdf,.pdf", onChange: (event) => setW9File(event.target.files?.[0] ?? null) }),
|
|
3095
|
+
/* @__PURE__ */ jsx6("strong", { children: w9File ? w9File.name : profile?.w9 ? "Replace the W-9 PDF" : "Drop the practice W-9 PDF here, or click to choose" }),
|
|
3096
|
+
/* @__PURE__ */ jsx6("span", { children: "The W-9 is auto-attached to every submission." })
|
|
3097
|
+
] }),
|
|
3098
|
+
/* @__PURE__ */ jsxs6("div", { className: "mbob-actions", children: [
|
|
3099
|
+
/* @__PURE__ */ jsx6("span", { className: "mbob-status", children: savedStep["w9"] ? "Saved to MindBill." : "" }),
|
|
3100
|
+
/* @__PURE__ */ jsx6("button", { className: "mbob-save", type: "button", disabled: saving || !w9File, onClick: saveW9, children: saving ? "Uploading\u2026" : "Save W-9" })
|
|
3101
|
+
] })
|
|
3102
|
+
] });
|
|
3103
|
+
const reviewSection = /* @__PURE__ */ jsxs6("div", { className: "mbob-check", children: [
|
|
3104
|
+
(profile?.onboarding.checklist ?? []).map((item) => /* @__PURE__ */ jsxs6("div", { className: "mbob-check-item", "data-complete": item.complete, children: [
|
|
3105
|
+
/* @__PURE__ */ jsx6("i", { children: item.complete ? "\u2713" : "\u2022" }),
|
|
3106
|
+
/* @__PURE__ */ jsx6("span", { children: item.label })
|
|
3107
|
+
] }, item.id)),
|
|
3108
|
+
profile?.onboarding.complete ? /* @__PURE__ */ jsx6("p", { className: "mbob-done", children: "Billing setup is complete \u2014 bills submitted from your product carry this profile automatically." }) : /* @__PURE__ */ jsx6("p", { className: "mbob-status", children: "Items above complete themselves as each section is saved." })
|
|
3109
|
+
] });
|
|
3110
|
+
const sections = { practice: practiceSection, locations: locationsSection, w9: w9Section, review: reviewSection };
|
|
3111
|
+
return /* @__PURE__ */ jsxs6("div", { className: `mbob ${className}`.trim(), style: { ...mindBillAppearanceStyle(appearance), ...style }, children: [
|
|
3112
|
+
/* @__PURE__ */ jsx6("style", { children: css4 }),
|
|
3113
|
+
/* @__PURE__ */ jsxs6("div", { className: "mbob-card", children: [
|
|
3114
|
+
/* @__PURE__ */ jsx6("div", { className: "mbob-head", children: /* @__PURE__ */ jsxs6("div", { children: [
|
|
3115
|
+
/* @__PURE__ */ jsx6("h2", { children: heading }),
|
|
3116
|
+
/* @__PURE__ */ jsx6("p", { className: "mbob-copy", children: description })
|
|
3117
|
+
] }) }),
|
|
3118
|
+
loadError ? /* @__PURE__ */ jsx6("div", { className: "mbob-error", role: "alert", children: loadError }) : null,
|
|
3119
|
+
variant === "onboarding" ? /* @__PURE__ */ jsxs6(Fragment4, { children: [
|
|
3120
|
+
/* @__PURE__ */ jsx6("div", { className: "mbob-steps", children: STEPS.map((item) => /* @__PURE__ */ jsxs6("button", { className: "mbob-step", type: "button", "data-active": step === item.id, "data-done": Boolean(savedStep[item.id]), onClick: () => setStep(item.id), children: [
|
|
3121
|
+
/* @__PURE__ */ jsx6("i", { children: savedStep[item.id] ? "\u2713" : "" }),
|
|
3122
|
+
item.label
|
|
3123
|
+
] }, item.id)) }),
|
|
3124
|
+
sections[step]
|
|
3125
|
+
] }) : /* @__PURE__ */ jsxs6(Fragment4, { children: [
|
|
3126
|
+
practiceSection,
|
|
3127
|
+
/* @__PURE__ */ jsx6("h3", { className: "mbob-subhead", children: "Locations" }),
|
|
3128
|
+
locationsSection,
|
|
3129
|
+
/* @__PURE__ */ jsx6("h3", { className: "mbob-subhead", children: "Practice W-9" }),
|
|
3130
|
+
w9Section,
|
|
3131
|
+
/* @__PURE__ */ jsx6("h3", { className: "mbob-subhead", children: "Checklist" }),
|
|
3132
|
+
reviewSection
|
|
3133
|
+
] }),
|
|
3134
|
+
error ? /* @__PURE__ */ jsx6("div", { className: "mbob-error", role: "alert", children: error }) : null
|
|
3135
|
+
] })
|
|
3136
|
+
] });
|
|
3137
|
+
}
|
|
3138
|
+
function BillingSettings(props) {
|
|
3139
|
+
return /* @__PURE__ */ jsx6(
|
|
3140
|
+
OrganizationOnboarding,
|
|
3141
|
+
{
|
|
3142
|
+
heading: "Billing settings",
|
|
3143
|
+
description: "Practice identity, locations, and the W-9 used on every bill.",
|
|
3144
|
+
...props,
|
|
3145
|
+
variant: "settings"
|
|
3146
|
+
}
|
|
3147
|
+
);
|
|
3148
|
+
}
|
|
3149
|
+
|
|
2879
3150
|
// src/connected-bill-status.tsx
|
|
2880
3151
|
import {
|
|
2881
|
-
useCallback as
|
|
2882
|
-
useEffect as
|
|
2883
|
-
useMemo as
|
|
2884
|
-
useRef as
|
|
2885
|
-
useState as
|
|
3152
|
+
useCallback as useCallback3,
|
|
3153
|
+
useEffect as useEffect5,
|
|
3154
|
+
useMemo as useMemo6,
|
|
3155
|
+
useRef as useRef4,
|
|
3156
|
+
useState as useState6
|
|
2886
3157
|
} from "react";
|
|
2887
3158
|
import {
|
|
2888
3159
|
DEFAULT_API_BASE_URL,
|
|
2889
3160
|
DEFAULT_SESSION_ENDPOINT
|
|
2890
3161
|
} from "@mindbill/browser";
|
|
2891
|
-
import { Fragment as
|
|
3162
|
+
import { Fragment as Fragment5, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2892
3163
|
var DEFAULT_REFRESH_INTERVAL = 6e4;
|
|
2893
3164
|
async function responseError(response, fallback) {
|
|
2894
3165
|
const body = await response.json().catch(() => null);
|
|
@@ -3021,23 +3292,23 @@ function useBillStatus({
|
|
|
3021
3292
|
initialData = null,
|
|
3022
3293
|
fetch: fetchOverride
|
|
3023
3294
|
}) {
|
|
3024
|
-
const client =
|
|
3295
|
+
const client = useMemo6(() => createBillStatusClient({
|
|
3025
3296
|
billId,
|
|
3026
3297
|
sessionEndpoint,
|
|
3027
3298
|
...getSession ? { getSession } : {},
|
|
3028
3299
|
apiBaseUrl,
|
|
3029
3300
|
...fetchOverride ? { fetch: fetchOverride } : {}
|
|
3030
3301
|
}), [apiBaseUrl, billId, fetchOverride, getSession, sessionEndpoint]);
|
|
3031
|
-
const [data, setData] =
|
|
3032
|
-
const [error, setError] =
|
|
3033
|
-
const [isLoading, setIsLoading] =
|
|
3034
|
-
const [isRefreshing, setIsRefreshing] =
|
|
3035
|
-
const dataRef =
|
|
3036
|
-
const initialDataRef =
|
|
3302
|
+
const [data, setData] = useState6(initialData);
|
|
3303
|
+
const [error, setError] = useState6(null);
|
|
3304
|
+
const [isLoading, setIsLoading] = useState6(enabled && !initialData);
|
|
3305
|
+
const [isRefreshing, setIsRefreshing] = useState6(false);
|
|
3306
|
+
const dataRef = useRef4(initialData);
|
|
3307
|
+
const initialDataRef = useRef4(initialData);
|
|
3037
3308
|
initialDataRef.current = initialData;
|
|
3038
|
-
const activeControllerRef =
|
|
3039
|
-
const requestSequence =
|
|
3040
|
-
|
|
3309
|
+
const activeControllerRef = useRef4(null);
|
|
3310
|
+
const requestSequence = useRef4(0);
|
|
3311
|
+
useEffect5(() => {
|
|
3041
3312
|
const seed = initialDataRef.current;
|
|
3042
3313
|
dataRef.current = seed;
|
|
3043
3314
|
setData(seed);
|
|
@@ -3046,7 +3317,7 @@ function useBillStatus({
|
|
|
3046
3317
|
activeControllerRef.current?.abort();
|
|
3047
3318
|
return () => activeControllerRef.current?.abort();
|
|
3048
3319
|
}, [client, enabled]);
|
|
3049
|
-
const load =
|
|
3320
|
+
const load = useCallback3(async () => {
|
|
3050
3321
|
if (!enabled || !billId) return;
|
|
3051
3322
|
const sequence = ++requestSequence.current;
|
|
3052
3323
|
activeControllerRef.current?.abort();
|
|
@@ -3078,10 +3349,10 @@ function useBillStatus({
|
|
|
3078
3349
|
}
|
|
3079
3350
|
}
|
|
3080
3351
|
}, [billId, client, enabled]);
|
|
3081
|
-
|
|
3352
|
+
useEffect5(() => {
|
|
3082
3353
|
if (enabled) void load();
|
|
3083
3354
|
}, [enabled, load]);
|
|
3084
|
-
|
|
3355
|
+
useEffect5(() => {
|
|
3085
3356
|
if (!enabled || refreshInterval <= 0) return;
|
|
3086
3357
|
const timer = window.setInterval(() => void load(), refreshInterval);
|
|
3087
3358
|
const onFocus = () => void load();
|
|
@@ -3109,17 +3380,17 @@ function ConnectedBillStatus({
|
|
|
3109
3380
|
}) {
|
|
3110
3381
|
const status = useBillStatus(options);
|
|
3111
3382
|
if (status.isLoading && !status.data) {
|
|
3112
|
-
return /* @__PURE__ */
|
|
3383
|
+
return /* @__PURE__ */ jsx7(Fragment5, { children: loadingFallback ?? /* @__PURE__ */ jsx7("div", { role: "status", children: "Loading bill status\u2026" }) });
|
|
3113
3384
|
}
|
|
3114
3385
|
if (status.error && !status.data) {
|
|
3115
|
-
return /* @__PURE__ */
|
|
3386
|
+
return /* @__PURE__ */ jsx7(Fragment5, { children: errorFallback?.(status.error, status.refresh) ?? /* @__PURE__ */ jsxs7("div", { role: "alert", children: [
|
|
3116
3387
|
status.error.message,
|
|
3117
3388
|
" ",
|
|
3118
|
-
/* @__PURE__ */
|
|
3389
|
+
/* @__PURE__ */ jsx7("button", { type: "button", onClick: () => void status.refresh(), children: "Retry" })
|
|
3119
3390
|
] }) });
|
|
3120
3391
|
}
|
|
3121
3392
|
if (!status.data) return null;
|
|
3122
|
-
return /* @__PURE__ */
|
|
3393
|
+
return /* @__PURE__ */ jsx7(
|
|
3123
3394
|
BillStatusSummary,
|
|
3124
3395
|
{
|
|
3125
3396
|
status: status.data.state,
|
|
@@ -3138,7 +3409,7 @@ function ConnectedBillStatus({
|
|
|
3138
3409
|
}
|
|
3139
3410
|
|
|
3140
3411
|
// src/bill-lifecycle-surfaces.tsx
|
|
3141
|
-
import { jsx as
|
|
3412
|
+
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
3142
3413
|
function visibleBillLifecycleActions(actions, showUnavailable = false) {
|
|
3143
3414
|
return actions.filter((action) => action.enabled || showUnavailable);
|
|
3144
3415
|
}
|
|
@@ -3153,11 +3424,11 @@ function BillLifecycleActions({
|
|
|
3153
3424
|
}) {
|
|
3154
3425
|
const visible = visibleBillLifecycleActions(actions, showUnavailable);
|
|
3155
3426
|
if (!visible.length) return null;
|
|
3156
|
-
return /* @__PURE__ */
|
|
3157
|
-
/* @__PURE__ */
|
|
3158
|
-
visible.map((action) => /* @__PURE__ */
|
|
3159
|
-
/* @__PURE__ */
|
|
3160
|
-
!action.enabled && action.reason ? /* @__PURE__ */
|
|
3427
|
+
return /* @__PURE__ */ jsxs8("div", { className: classes("mb-lifecycle-actions", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill actions", children: [
|
|
3428
|
+
/* @__PURE__ */ jsx8("style", { children: lifecycleSurfaceStyles }),
|
|
3429
|
+
visible.map((action) => /* @__PURE__ */ jsxs8("div", { className: "mb-lifecycle-action", children: [
|
|
3430
|
+
/* @__PURE__ */ jsx8("button", { type: "button", className: action.primary ? "mb-action-button is-primary" : "mb-action-button", disabled: disabled || !action.enabled, onClick: () => onAction(action), children: action.label }),
|
|
3431
|
+
!action.enabled && action.reason ? /* @__PURE__ */ jsx8("span", { className: "mb-action-reason", children: action.reason }) : null
|
|
3161
3432
|
] }, action.id))
|
|
3162
3433
|
] });
|
|
3163
3434
|
}
|
|
@@ -3187,18 +3458,18 @@ function defaultFormatDate(createdAt) {
|
|
|
3187
3458
|
return new Intl.DateTimeFormat(void 0, { dateStyle: "medium", timeStyle: "short" }).format(parsed);
|
|
3188
3459
|
}
|
|
3189
3460
|
function BillActivityTimeline({ events, emptyLabel = "No bill activity yet.", appearance, className, style, formatDate = defaultFormatDate }) {
|
|
3190
|
-
return /* @__PURE__ */
|
|
3191
|
-
/* @__PURE__ */
|
|
3192
|
-
/* @__PURE__ */
|
|
3193
|
-
/* @__PURE__ */
|
|
3194
|
-
/* @__PURE__ */
|
|
3461
|
+
return /* @__PURE__ */ jsxs8("section", { className: classes("mb-surface mb-activity", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill activity", children: [
|
|
3462
|
+
/* @__PURE__ */ jsx8("style", { children: lifecycleSurfaceStyles }),
|
|
3463
|
+
/* @__PURE__ */ jsx8("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs8("div", { children: [
|
|
3464
|
+
/* @__PURE__ */ jsx8("strong", { children: "Bill history" }),
|
|
3465
|
+
/* @__PURE__ */ jsx8("span", { children: "Submission, payer responses, follow-up, and payments." })
|
|
3195
3466
|
] }) }),
|
|
3196
|
-
!events.length ? /* @__PURE__ */
|
|
3197
|
-
/* @__PURE__ */
|
|
3198
|
-
/* @__PURE__ */
|
|
3199
|
-
/* @__PURE__ */
|
|
3200
|
-
event.description ? /* @__PURE__ */
|
|
3201
|
-
/* @__PURE__ */
|
|
3467
|
+
!events.length ? /* @__PURE__ */ jsx8("p", { className: "mb-activity-empty", children: emptyLabel }) : /* @__PURE__ */ jsx8("ol", { className: "mb-activity-list", children: events.map((event) => /* @__PURE__ */ jsxs8("li", { className: "mb-activity-item", children: [
|
|
3468
|
+
/* @__PURE__ */ jsx8("span", { className: "mb-activity-marker", "aria-hidden": "true" }),
|
|
3469
|
+
/* @__PURE__ */ jsxs8("div", { className: "mb-activity-content", children: [
|
|
3470
|
+
/* @__PURE__ */ jsx8("strong", { children: event.title ?? billActivityEventLabel(event.type) }),
|
|
3471
|
+
event.description ? /* @__PURE__ */ jsx8("p", { children: event.description }) : null,
|
|
3472
|
+
/* @__PURE__ */ jsxs8("span", { children: [
|
|
3202
3473
|
formatDate(event.createdAt),
|
|
3203
3474
|
event.actor ? ` \xB7 ${event.actor}` : ""
|
|
3204
3475
|
] })
|
|
@@ -3220,6 +3491,20 @@ function billLifecycleStage(state) {
|
|
|
3220
3491
|
if (value.includes("accepted")) return "accepted";
|
|
3221
3492
|
return "submitted";
|
|
3222
3493
|
}
|
|
3494
|
+
function billLifecycleProgressSteps(state) {
|
|
3495
|
+
if (state.toLowerCase() === "rejected") {
|
|
3496
|
+
return [
|
|
3497
|
+
{ id: "submitted", label: "Sent", status: "complete" },
|
|
3498
|
+
{ id: "rejected", label: "Rejected", status: "current" }
|
|
3499
|
+
];
|
|
3500
|
+
}
|
|
3501
|
+
const current = billLifecycleStage(state);
|
|
3502
|
+
const currentIndex = lifecycleStages.findIndex((stage) => stage.id === current);
|
|
3503
|
+
return lifecycleStages.map((stage, index) => ({
|
|
3504
|
+
...stage,
|
|
3505
|
+
status: index < currentIndex ? "complete" : index === currentIndex ? "current" : "upcoming"
|
|
3506
|
+
}));
|
|
3507
|
+
}
|
|
3223
3508
|
function billLifecycleDisplayLabel(state, nativeStatus) {
|
|
3224
3509
|
const value = state.toLowerCase();
|
|
3225
3510
|
if (value === "submitted") return "Sent";
|
|
@@ -3231,24 +3516,18 @@ function billLifecycleDisplayLabel(state, nativeStatus) {
|
|
|
3231
3516
|
return humanize(state || nativeStatus || "submitted");
|
|
3232
3517
|
}
|
|
3233
3518
|
function BillLifecycleProgress({ state, nativeStatus, submittedAt, agingDays, appearance, className, style }) {
|
|
3234
|
-
const
|
|
3235
|
-
const
|
|
3236
|
-
return /* @__PURE__ */
|
|
3237
|
-
/* @__PURE__ */
|
|
3238
|
-
/* @__PURE__ */
|
|
3239
|
-
/* @__PURE__ */
|
|
3240
|
-
/* @__PURE__ */
|
|
3241
|
-
submittedAt ? `Submitted ${defaultFormatDate(submittedAt)}` : "Submitted",
|
|
3242
|
-
typeof agingDays === "number" ? ` \xB7 ${agingDays} days old` : ""
|
|
3243
|
-
] })
|
|
3519
|
+
const rejected = state.toLowerCase() === "rejected";
|
|
3520
|
+
const steps = billLifecycleProgressSteps(state);
|
|
3521
|
+
return /* @__PURE__ */ jsxs8("section", { className: classes(`mb-surface mb-progress${rejected ? " is-rejected" : ""}`, className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill lifecycle", children: [
|
|
3522
|
+
/* @__PURE__ */ jsx8("style", { children: lifecycleSurfaceStyles }),
|
|
3523
|
+
/* @__PURE__ */ jsx8("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs8("div", { children: [
|
|
3524
|
+
/* @__PURE__ */ jsx8("strong", { children: billLifecycleDisplayLabel(state, nativeStatus) }),
|
|
3525
|
+
/* @__PURE__ */ jsx8("span", { children: rejected ? "The payer rejected this submission." : `${submittedAt ? `Submitted ${defaultFormatDate(submittedAt)}` : "Submitted"}${typeof agingDays === "number" ? ` \xB7 ${agingDays} days old` : ""}` })
|
|
3244
3526
|
] }) }),
|
|
3245
|
-
/* @__PURE__ */
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
/* @__PURE__ */ jsx7("b", { children: stage.label })
|
|
3250
|
-
] }, stage.id);
|
|
3251
|
-
}) })
|
|
3527
|
+
/* @__PURE__ */ jsx8("ol", { className: "mb-progress-list", style: { gridTemplateColumns: `repeat(${steps.length}, minmax(0, 1fr))` }, children: steps.map((step, index) => /* @__PURE__ */ jsxs8("li", { className: `is-${step.status}`, "aria-current": step.status === "current" ? "step" : void 0, children: [
|
|
3528
|
+
/* @__PURE__ */ jsx8("span", { "aria-hidden": "true", children: step.status === "complete" ? "\u2713" : rejected && step.status === "current" ? "!" : index + 1 }),
|
|
3529
|
+
/* @__PURE__ */ jsx8("b", { children: step.label })
|
|
3530
|
+
] }, step.id)) })
|
|
3252
3531
|
] });
|
|
3253
3532
|
}
|
|
3254
3533
|
function BillSnapshotSummary({ bill, patient, injury, delivery, appearance, className, style }) {
|
|
@@ -3260,18 +3539,18 @@ function BillSnapshotSummary({ bill, patient, injury, delivery, appearance, clas
|
|
|
3260
3539
|
["Charged", currency(bill.totalCharge)],
|
|
3261
3540
|
["Balance", currency(bill.balanceDue)]
|
|
3262
3541
|
];
|
|
3263
|
-
return /* @__PURE__ */
|
|
3264
|
-
/* @__PURE__ */
|
|
3265
|
-
/* @__PURE__ */
|
|
3266
|
-
/* @__PURE__ */
|
|
3267
|
-
/* @__PURE__ */
|
|
3542
|
+
return /* @__PURE__ */ jsxs8("section", { className: classes("mb-surface mb-snapshot", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill snapshot", children: [
|
|
3543
|
+
/* @__PURE__ */ jsx8("style", { children: lifecycleSurfaceStyles }),
|
|
3544
|
+
/* @__PURE__ */ jsx8("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs8("div", { children: [
|
|
3545
|
+
/* @__PURE__ */ jsx8("strong", { children: "Bill snapshot" }),
|
|
3546
|
+
/* @__PURE__ */ jsxs8("span", { children: [
|
|
3268
3547
|
"Bill #",
|
|
3269
3548
|
bill.billNumber
|
|
3270
3549
|
] })
|
|
3271
3550
|
] }) }),
|
|
3272
|
-
/* @__PURE__ */
|
|
3273
|
-
/* @__PURE__ */
|
|
3274
|
-
/* @__PURE__ */
|
|
3551
|
+
/* @__PURE__ */ jsx8("dl", { children: values.map(([label, value]) => /* @__PURE__ */ jsxs8("div", { children: [
|
|
3552
|
+
/* @__PURE__ */ jsx8("dt", { children: label }),
|
|
3553
|
+
/* @__PURE__ */ jsx8("dd", { children: value })
|
|
3275
3554
|
] }, label)) })
|
|
3276
3555
|
] });
|
|
3277
3556
|
}
|
|
@@ -3286,140 +3565,140 @@ function BillExplanationOfReview({
|
|
|
3286
3565
|
style
|
|
3287
3566
|
}) {
|
|
3288
3567
|
const rows = payments.length ? payments : [null];
|
|
3289
|
-
return /* @__PURE__ */
|
|
3290
|
-
/* @__PURE__ */
|
|
3291
|
-
/* @__PURE__ */
|
|
3292
|
-
/* @__PURE__ */
|
|
3293
|
-
/* @__PURE__ */
|
|
3568
|
+
return /* @__PURE__ */ jsxs8("section", { className: classes("mb-surface mb-eor-review", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Explanation of Review and payments", children: [
|
|
3569
|
+
/* @__PURE__ */ jsx8("style", { children: lifecycleSurfaceStyles }),
|
|
3570
|
+
/* @__PURE__ */ jsx8("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs8("div", { children: [
|
|
3571
|
+
/* @__PURE__ */ jsx8("strong", { children: "Explanation of Review" }),
|
|
3572
|
+
/* @__PURE__ */ jsx8("span", { children: "Payer response and payment reconciliation." })
|
|
3294
3573
|
] }) }),
|
|
3295
|
-
/* @__PURE__ */
|
|
3296
|
-
/* @__PURE__ */
|
|
3297
|
-
/* @__PURE__ */
|
|
3298
|
-
/* @__PURE__ */
|
|
3574
|
+
/* @__PURE__ */ jsxs8("dl", { className: "mb-eor-metrics", children: [
|
|
3575
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3576
|
+
/* @__PURE__ */ jsx8("dt", { children: "Amount billed" }),
|
|
3577
|
+
/* @__PURE__ */ jsx8("dd", { children: currency(remittance.billedAmount) })
|
|
3299
3578
|
] }),
|
|
3300
|
-
/* @__PURE__ */
|
|
3301
|
-
/* @__PURE__ */
|
|
3302
|
-
/* @__PURE__ */
|
|
3579
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3580
|
+
/* @__PURE__ */ jsx8("dt", { children: "Payer allowed" }),
|
|
3581
|
+
/* @__PURE__ */ jsx8("dd", { children: remittance.payerAllowedAmount === null ? "\u2014" : currency(remittance.payerAllowedAmount) })
|
|
3303
3582
|
] }),
|
|
3304
|
-
/* @__PURE__ */
|
|
3305
|
-
/* @__PURE__ */
|
|
3306
|
-
/* @__PURE__ */
|
|
3583
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3584
|
+
/* @__PURE__ */ jsx8("dt", { children: "Payer reported paid" }),
|
|
3585
|
+
/* @__PURE__ */ jsx8("dd", { children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) })
|
|
3307
3586
|
] }),
|
|
3308
|
-
/* @__PURE__ */
|
|
3309
|
-
/* @__PURE__ */
|
|
3310
|
-
/* @__PURE__ */
|
|
3587
|
+
/* @__PURE__ */ jsxs8("div", { className: "is-balance", children: [
|
|
3588
|
+
/* @__PURE__ */ jsx8("dt", { children: "Balance due" }),
|
|
3589
|
+
/* @__PURE__ */ jsx8("dd", { children: currency(remittance.balanceDue) })
|
|
3311
3590
|
] }),
|
|
3312
|
-
/* @__PURE__ */
|
|
3313
|
-
/* @__PURE__ */
|
|
3314
|
-
/* @__PURE__ */
|
|
3591
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3592
|
+
/* @__PURE__ */ jsx8("dt", { children: "Payment posted" }),
|
|
3593
|
+
/* @__PURE__ */ jsx8("dd", { children: currency(remittance.postedPrincipal) })
|
|
3315
3594
|
] }),
|
|
3316
|
-
/* @__PURE__ */
|
|
3317
|
-
/* @__PURE__ */
|
|
3318
|
-
/* @__PURE__ */
|
|
3595
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3596
|
+
/* @__PURE__ */ jsx8("dt", { children: "Penalty & interest" }),
|
|
3597
|
+
/* @__PURE__ */ jsx8("dd", { children: currency(remittance.postedAdditional) })
|
|
3319
3598
|
] }),
|
|
3320
|
-
/* @__PURE__ */
|
|
3321
|
-
/* @__PURE__ */
|
|
3322
|
-
/* @__PURE__ */
|
|
3599
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3600
|
+
/* @__PURE__ */ jsx8("dt", { children: "Total received" }),
|
|
3601
|
+
/* @__PURE__ */ jsx8("dd", { children: currency(remittance.totalPostedCash) })
|
|
3323
3602
|
] }),
|
|
3324
|
-
/* @__PURE__ */
|
|
3325
|
-
/* @__PURE__ */
|
|
3326
|
-
/* @__PURE__ */
|
|
3603
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3604
|
+
/* @__PURE__ */ jsx8("dt", { children: "Expected" }),
|
|
3605
|
+
/* @__PURE__ */ jsx8("dd", { children: currency(remittance.expectedAmount) })
|
|
3327
3606
|
] })
|
|
3328
3607
|
] }),
|
|
3329
|
-
remittance.denialReason ? /* @__PURE__ */
|
|
3330
|
-
/* @__PURE__ */
|
|
3331
|
-
/* @__PURE__ */
|
|
3608
|
+
remittance.denialReason ? /* @__PURE__ */ jsxs8("div", { className: "mb-denial", children: [
|
|
3609
|
+
/* @__PURE__ */ jsx8("strong", { children: "Denial reason" }),
|
|
3610
|
+
/* @__PURE__ */ jsx8("p", { children: remittance.denialReason })
|
|
3332
3611
|
] }) : null,
|
|
3333
|
-
/* @__PURE__ */
|
|
3334
|
-
/* @__PURE__ */
|
|
3335
|
-
/* @__PURE__ */
|
|
3336
|
-
/* @__PURE__ */
|
|
3337
|
-
/* @__PURE__ */
|
|
3338
|
-
/* @__PURE__ */
|
|
3339
|
-
/* @__PURE__ */
|
|
3612
|
+
/* @__PURE__ */ jsx8("div", { className: "mb-eor-table-wrap", children: /* @__PURE__ */ jsxs8("table", { className: "mb-eor-table", children: [
|
|
3613
|
+
/* @__PURE__ */ jsxs8("thead", { children: [
|
|
3614
|
+
/* @__PURE__ */ jsxs8("tr", { className: "mb-eor-groups", children: [
|
|
3615
|
+
/* @__PURE__ */ jsx8("th", { colSpan: 2, children: "Submission" }),
|
|
3616
|
+
/* @__PURE__ */ jsx8("th", { colSpan: 5, children: "EOR payment information" }),
|
|
3617
|
+
/* @__PURE__ */ jsx8("th", { colSpan: 2, children: "EOR post" }),
|
|
3618
|
+
/* @__PURE__ */ jsx8("th", { children: "EOR" })
|
|
3340
3619
|
] }),
|
|
3341
|
-
/* @__PURE__ */
|
|
3342
|
-
/* @__PURE__ */
|
|
3343
|
-
/* @__PURE__ */
|
|
3344
|
-
/* @__PURE__ */
|
|
3345
|
-
/* @__PURE__ */
|
|
3346
|
-
/* @__PURE__ */
|
|
3347
|
-
/* @__PURE__ */
|
|
3348
|
-
/* @__PURE__ */
|
|
3349
|
-
/* @__PURE__ */
|
|
3350
|
-
/* @__PURE__ */
|
|
3351
|
-
/* @__PURE__ */
|
|
3620
|
+
/* @__PURE__ */ jsxs8("tr", { children: [
|
|
3621
|
+
/* @__PURE__ */ jsx8("th", { children: "Submission" }),
|
|
3622
|
+
/* @__PURE__ */ jsx8("th", { children: "Submission payment" }),
|
|
3623
|
+
/* @__PURE__ */ jsx8("th", { children: "Payment method" }),
|
|
3624
|
+
/* @__PURE__ */ jsx8("th", { children: "Reference" }),
|
|
3625
|
+
/* @__PURE__ */ jsx8("th", { children: "Effective date" }),
|
|
3626
|
+
/* @__PURE__ */ jsx8("th", { children: "Payment total" }),
|
|
3627
|
+
/* @__PURE__ */ jsx8("th", { children: "Deposit date" }),
|
|
3628
|
+
/* @__PURE__ */ jsx8("th", { children: "Post date" }),
|
|
3629
|
+
/* @__PURE__ */ jsx8("th", { children: "Source" }),
|
|
3630
|
+
/* @__PURE__ */ jsx8("th", { children: "Document" })
|
|
3352
3631
|
] })
|
|
3353
3632
|
] }),
|
|
3354
|
-
/* @__PURE__ */
|
|
3633
|
+
/* @__PURE__ */ jsx8("tbody", { children: rows.map((payment, index) => {
|
|
3355
3634
|
const eor = eors[index] ?? eors[0];
|
|
3356
|
-
return /* @__PURE__ */
|
|
3357
|
-
/* @__PURE__ */
|
|
3358
|
-
/* @__PURE__ */
|
|
3359
|
-
submittedAt ? /* @__PURE__ */
|
|
3635
|
+
return /* @__PURE__ */ jsxs8("tr", { children: [
|
|
3636
|
+
/* @__PURE__ */ jsxs8("td", { "data-label": "Submission", children: [
|
|
3637
|
+
/* @__PURE__ */ jsx8("strong", { children: "Original bill" }),
|
|
3638
|
+
submittedAt ? /* @__PURE__ */ jsxs8("span", { children: [
|
|
3360
3639
|
"Sent ",
|
|
3361
3640
|
defaultFormatDate(submittedAt)
|
|
3362
3641
|
] }) : null
|
|
3363
3642
|
] }),
|
|
3364
|
-
/* @__PURE__ */
|
|
3365
|
-
/* @__PURE__ */
|
|
3366
|
-
/* @__PURE__ */
|
|
3367
|
-
/* @__PURE__ */
|
|
3368
|
-
/* @__PURE__ */
|
|
3369
|
-
/* @__PURE__ */
|
|
3370
|
-
/* @__PURE__ */
|
|
3371
|
-
/* @__PURE__ */
|
|
3372
|
-
/* @__PURE__ */
|
|
3643
|
+
/* @__PURE__ */ jsx8("td", { "data-label": "Submission payment", children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) }),
|
|
3644
|
+
/* @__PURE__ */ jsx8("td", { "data-label": "Payment method", children: payment ? humanize(payment.method) : "\u2014" }),
|
|
3645
|
+
/* @__PURE__ */ jsx8("td", { "data-label": "Reference", children: payment?.checkNumber || "\u2014" }),
|
|
3646
|
+
/* @__PURE__ */ jsx8("td", { "data-label": "Effective date", children: payment ? payment.receivedDate || payment.depositDate || defaultFormatDate(payment.postedAt) : "\u2014" }),
|
|
3647
|
+
/* @__PURE__ */ jsx8("td", { "data-label": "Payment total", children: payment ? currency(payment.amount) : currency(0) }),
|
|
3648
|
+
/* @__PURE__ */ jsx8("td", { "data-label": "Deposit date", children: payment?.depositDate || "Not recorded" }),
|
|
3649
|
+
/* @__PURE__ */ jsx8("td", { "data-label": "Post date", children: payment ? defaultFormatDate(payment.postedAt) : eor ? defaultFormatDate(eor.addedAt) : "\u2014" }),
|
|
3650
|
+
/* @__PURE__ */ jsx8("td", { "data-label": "Source", children: payment ? payment.source.toUpperCase() : eor ? "EOR" : "\u2014" }),
|
|
3651
|
+
/* @__PURE__ */ jsx8("td", { "data-label": "EOR", children: eor && onOpenEor ? /* @__PURE__ */ jsx8("button", { type: "button", className: "mb-eor-link", onClick: () => void onOpenEor(eor), children: eor.filename }) : eor?.filename || "\u2014" })
|
|
3373
3652
|
] }, payment?.id ?? `empty-${index}`);
|
|
3374
3653
|
}) })
|
|
3375
3654
|
] }) }),
|
|
3376
|
-
eors.length > rows.length ? /* @__PURE__ */
|
|
3655
|
+
eors.length > rows.length ? /* @__PURE__ */ jsx8("div", { className: "mb-eor-documents", children: eors.slice(rows.length).map((eor) => /* @__PURE__ */ jsx8("button", { type: "button", onClick: () => void onOpenEor?.(eor), children: eor.filename }, eor.id)) }) : null
|
|
3377
3656
|
] });
|
|
3378
3657
|
}
|
|
3379
3658
|
function BillRemittanceCard({ remittance, appearance, className, style }) {
|
|
3380
|
-
return /* @__PURE__ */
|
|
3381
|
-
/* @__PURE__ */
|
|
3382
|
-
/* @__PURE__ */
|
|
3383
|
-
/* @__PURE__ */
|
|
3384
|
-
/* @__PURE__ */
|
|
3659
|
+
return /* @__PURE__ */ jsxs8("section", { className: classes("mb-surface mb-remittance", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Remittance summary", children: [
|
|
3660
|
+
/* @__PURE__ */ jsx8("style", { children: lifecycleSurfaceStyles }),
|
|
3661
|
+
/* @__PURE__ */ jsx8("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs8("div", { children: [
|
|
3662
|
+
/* @__PURE__ */ jsx8("strong", { children: "Remittance" }),
|
|
3663
|
+
/* @__PURE__ */ jsx8("span", { children: "Amounts reported by the payer and posted to the bill." })
|
|
3385
3664
|
] }) }),
|
|
3386
|
-
/* @__PURE__ */
|
|
3387
|
-
/* @__PURE__ */
|
|
3388
|
-
/* @__PURE__ */
|
|
3389
|
-
/* @__PURE__ */
|
|
3665
|
+
/* @__PURE__ */ jsxs8("dl", { children: [
|
|
3666
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3667
|
+
/* @__PURE__ */ jsx8("dt", { children: "Amount billed" }),
|
|
3668
|
+
/* @__PURE__ */ jsx8("dd", { children: currency(remittance.billedAmount) })
|
|
3390
3669
|
] }),
|
|
3391
|
-
/* @__PURE__ */
|
|
3392
|
-
/* @__PURE__ */
|
|
3393
|
-
/* @__PURE__ */
|
|
3670
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3671
|
+
/* @__PURE__ */ jsx8("dt", { children: "Expected" }),
|
|
3672
|
+
/* @__PURE__ */ jsx8("dd", { children: currency(remittance.expectedAmount) })
|
|
3394
3673
|
] }),
|
|
3395
|
-
/* @__PURE__ */
|
|
3396
|
-
/* @__PURE__ */
|
|
3397
|
-
/* @__PURE__ */
|
|
3674
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3675
|
+
/* @__PURE__ */ jsx8("dt", { children: "Payer allowed" }),
|
|
3676
|
+
/* @__PURE__ */ jsx8("dd", { children: remittance.payerAllowedAmount === null ? "\u2014" : currency(remittance.payerAllowedAmount) })
|
|
3398
3677
|
] }),
|
|
3399
|
-
/* @__PURE__ */
|
|
3400
|
-
/* @__PURE__ */
|
|
3401
|
-
/* @__PURE__ */
|
|
3678
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3679
|
+
/* @__PURE__ */ jsx8("dt", { children: "Payer reported paid" }),
|
|
3680
|
+
/* @__PURE__ */ jsx8("dd", { children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) })
|
|
3402
3681
|
] }),
|
|
3403
|
-
/* @__PURE__ */
|
|
3404
|
-
/* @__PURE__ */
|
|
3405
|
-
/* @__PURE__ */
|
|
3682
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3683
|
+
/* @__PURE__ */ jsx8("dt", { children: "Payment posted" }),
|
|
3684
|
+
/* @__PURE__ */ jsx8("dd", { children: currency(remittance.postedPrincipal) })
|
|
3406
3685
|
] }),
|
|
3407
|
-
/* @__PURE__ */
|
|
3408
|
-
/* @__PURE__ */
|
|
3409
|
-
/* @__PURE__ */
|
|
3686
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3687
|
+
/* @__PURE__ */ jsx8("dt", { children: "Penalty & interest" }),
|
|
3688
|
+
/* @__PURE__ */ jsx8("dd", { children: currency(remittance.postedAdditional) })
|
|
3410
3689
|
] }),
|
|
3411
|
-
/* @__PURE__ */
|
|
3412
|
-
/* @__PURE__ */
|
|
3413
|
-
/* @__PURE__ */
|
|
3690
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3691
|
+
/* @__PURE__ */ jsx8("dt", { children: "Total received" }),
|
|
3692
|
+
/* @__PURE__ */ jsx8("dd", { children: currency(remittance.totalPostedCash) })
|
|
3414
3693
|
] }),
|
|
3415
|
-
/* @__PURE__ */
|
|
3416
|
-
/* @__PURE__ */
|
|
3417
|
-
/* @__PURE__ */
|
|
3694
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3695
|
+
/* @__PURE__ */ jsx8("dt", { children: "Balance due" }),
|
|
3696
|
+
/* @__PURE__ */ jsx8("dd", { children: currency(remittance.balanceDue) })
|
|
3418
3697
|
] })
|
|
3419
3698
|
] }),
|
|
3420
|
-
remittance.denialReason ? /* @__PURE__ */
|
|
3421
|
-
/* @__PURE__ */
|
|
3422
|
-
/* @__PURE__ */
|
|
3699
|
+
remittance.denialReason ? /* @__PURE__ */ jsxs8("div", { className: "mb-denial", children: [
|
|
3700
|
+
/* @__PURE__ */ jsx8("strong", { children: "Denial reason" }),
|
|
3701
|
+
/* @__PURE__ */ jsx8("p", { children: remittance.denialReason })
|
|
3423
3702
|
] }) : null
|
|
3424
3703
|
] });
|
|
3425
3704
|
}
|
|
@@ -3434,72 +3713,72 @@ function BillPayerContactCard({ delivery, appearance, className, style }) {
|
|
|
3434
3713
|
delivery.contacts.portalUrl ? ["Portal", "Open payer portal", delivery.contacts.portalUrl] : null
|
|
3435
3714
|
].filter(Boolean);
|
|
3436
3715
|
if (!delivery.payerName && !contacts.length) return null;
|
|
3437
|
-
return /* @__PURE__ */
|
|
3438
|
-
/* @__PURE__ */
|
|
3439
|
-
/* @__PURE__ */
|
|
3440
|
-
/* @__PURE__ */
|
|
3441
|
-
/* @__PURE__ */
|
|
3716
|
+
return /* @__PURE__ */ jsxs8("section", { className: classes("mb-surface mb-contacts", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Payer contact information", children: [
|
|
3717
|
+
/* @__PURE__ */ jsx8("style", { children: lifecycleSurfaceStyles }),
|
|
3718
|
+
/* @__PURE__ */ jsx8("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs8("div", { children: [
|
|
3719
|
+
/* @__PURE__ */ jsx8("strong", { children: delivery.payerName || "Claims administrator" }),
|
|
3720
|
+
/* @__PURE__ */ jsx8("span", { children: "Billing and follow-up contacts." })
|
|
3442
3721
|
] }) }),
|
|
3443
|
-
!contacts.length ? /* @__PURE__ */
|
|
3444
|
-
/* @__PURE__ */
|
|
3445
|
-
/* @__PURE__ */
|
|
3722
|
+
!contacts.length ? /* @__PURE__ */ jsx8("p", { className: "mb-empty", children: "No payer contact details are available." }) : /* @__PURE__ */ jsx8("dl", { children: contacts.map(([label, value, href]) => /* @__PURE__ */ jsxs8("div", { children: [
|
|
3723
|
+
/* @__PURE__ */ jsx8("dt", { children: label }),
|
|
3724
|
+
/* @__PURE__ */ jsx8("dd", { children: href ? /* @__PURE__ */ jsx8("a", { href, target: label === "Portal" ? "_blank" : void 0, rel: label === "Portal" ? "noreferrer noopener" : void 0, children: value }) : value })
|
|
3446
3725
|
] }, label)) })
|
|
3447
3726
|
] });
|
|
3448
3727
|
}
|
|
3449
3728
|
function BillPaymentLedger({ payments, appearance, className, style }) {
|
|
3450
|
-
return /* @__PURE__ */
|
|
3451
|
-
/* @__PURE__ */
|
|
3452
|
-
/* @__PURE__ */
|
|
3453
|
-
/* @__PURE__ */
|
|
3454
|
-
/* @__PURE__ */
|
|
3729
|
+
return /* @__PURE__ */ jsxs8("section", { className: classes("mb-surface mb-payments", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Payment ledger", children: [
|
|
3730
|
+
/* @__PURE__ */ jsx8("style", { children: lifecycleSurfaceStyles }),
|
|
3731
|
+
/* @__PURE__ */ jsx8("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs8("div", { children: [
|
|
3732
|
+
/* @__PURE__ */ jsx8("strong", { children: "Payments" }),
|
|
3733
|
+
/* @__PURE__ */ jsx8("span", { children: "Funds recorded against this bill." })
|
|
3455
3734
|
] }) }),
|
|
3456
|
-
!payments.length ? /* @__PURE__ */
|
|
3735
|
+
!payments.length ? /* @__PURE__ */ jsx8("p", { className: "mb-empty", children: "No payments posted." }) : /* @__PURE__ */ jsx8("div", { className: "mb-payment-list", children: payments.map((payment) => {
|
|
3457
3736
|
const additional = payment.feeAmount ?? 0;
|
|
3458
|
-
return /* @__PURE__ */
|
|
3459
|
-
/* @__PURE__ */
|
|
3460
|
-
/* @__PURE__ */
|
|
3461
|
-
/* @__PURE__ */
|
|
3737
|
+
return /* @__PURE__ */ jsxs8("article", { children: [
|
|
3738
|
+
/* @__PURE__ */ jsxs8("div", { className: "mb-payment-amount", children: [
|
|
3739
|
+
/* @__PURE__ */ jsx8("strong", { children: currency(payment.amount) }),
|
|
3740
|
+
/* @__PURE__ */ jsx8("span", { children: "Total received" })
|
|
3462
3741
|
] }),
|
|
3463
|
-
/* @__PURE__ */
|
|
3464
|
-
/* @__PURE__ */
|
|
3465
|
-
/* @__PURE__ */
|
|
3466
|
-
/* @__PURE__ */
|
|
3742
|
+
/* @__PURE__ */ jsxs8("dl", { children: [
|
|
3743
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3744
|
+
/* @__PURE__ */ jsx8("dt", { children: "Applied to bill" }),
|
|
3745
|
+
/* @__PURE__ */ jsx8("dd", { children: currency(payment.principalAmount) })
|
|
3467
3746
|
] }),
|
|
3468
|
-
additional > 0 ? /* @__PURE__ */
|
|
3469
|
-
/* @__PURE__ */
|
|
3470
|
-
/* @__PURE__ */
|
|
3747
|
+
additional > 0 ? /* @__PURE__ */ jsxs8("div", { children: [
|
|
3748
|
+
/* @__PURE__ */ jsx8("dt", { children: "Penalty & interest" }),
|
|
3749
|
+
/* @__PURE__ */ jsx8("dd", { children: currency(additional) })
|
|
3471
3750
|
] }) : null,
|
|
3472
|
-
/* @__PURE__ */
|
|
3473
|
-
/* @__PURE__ */
|
|
3474
|
-
/* @__PURE__ */
|
|
3751
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3752
|
+
/* @__PURE__ */ jsx8("dt", { children: "Method" }),
|
|
3753
|
+
/* @__PURE__ */ jsx8("dd", { children: payment.method.toUpperCase() })
|
|
3475
3754
|
] }),
|
|
3476
|
-
/* @__PURE__ */
|
|
3477
|
-
/* @__PURE__ */
|
|
3478
|
-
/* @__PURE__ */
|
|
3755
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3756
|
+
/* @__PURE__ */ jsx8("dt", { children: "Reference" }),
|
|
3757
|
+
/* @__PURE__ */ jsx8("dd", { children: payment.checkNumber || "\u2014" })
|
|
3479
3758
|
] }),
|
|
3480
|
-
/* @__PURE__ */
|
|
3481
|
-
/* @__PURE__ */
|
|
3482
|
-
/* @__PURE__ */
|
|
3759
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3760
|
+
/* @__PURE__ */ jsx8("dt", { children: "Effective date" }),
|
|
3761
|
+
/* @__PURE__ */ jsx8("dd", { children: payment.receivedDate || payment.depositDate || defaultFormatDate(payment.postedAt) })
|
|
3483
3762
|
] }),
|
|
3484
|
-
/* @__PURE__ */
|
|
3485
|
-
/* @__PURE__ */
|
|
3486
|
-
/* @__PURE__ */
|
|
3763
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3764
|
+
/* @__PURE__ */ jsx8("dt", { children: "Deposit date" }),
|
|
3765
|
+
/* @__PURE__ */ jsx8("dd", { children: payment.depositDate || "Not recorded" })
|
|
3487
3766
|
] }),
|
|
3488
|
-
/* @__PURE__ */
|
|
3489
|
-
/* @__PURE__ */
|
|
3490
|
-
/* @__PURE__ */
|
|
3767
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3768
|
+
/* @__PURE__ */ jsx8("dt", { children: "Posted" }),
|
|
3769
|
+
/* @__PURE__ */ jsxs8("dd", { children: [
|
|
3491
3770
|
defaultFormatDate(payment.postedAt),
|
|
3492
3771
|
" \xB7 ",
|
|
3493
3772
|
payment.source.toUpperCase()
|
|
3494
3773
|
] })
|
|
3495
3774
|
] }),
|
|
3496
|
-
/* @__PURE__ */
|
|
3497
|
-
/* @__PURE__ */
|
|
3498
|
-
/* @__PURE__ */
|
|
3775
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
3776
|
+
/* @__PURE__ */ jsx8("dt", { children: "Status" }),
|
|
3777
|
+
/* @__PURE__ */ jsx8("dd", { children: humanize(payment.status || "posted") })
|
|
3499
3778
|
] })
|
|
3500
3779
|
] }),
|
|
3501
|
-
payment.feeReason ? /* @__PURE__ */
|
|
3502
|
-
payment.note ? /* @__PURE__ */
|
|
3780
|
+
payment.feeReason ? /* @__PURE__ */ jsx8("p", { children: payment.feeReason }) : null,
|
|
3781
|
+
payment.note ? /* @__PURE__ */ jsx8("p", { children: payment.note }) : null
|
|
3503
3782
|
] }, payment.id);
|
|
3504
3783
|
}) })
|
|
3505
3784
|
] });
|
|
@@ -3520,6 +3799,7 @@ var lifecycleSurfaceStyles = `
|
|
|
3520
3799
|
.mb-lifecycle-actions{display:flex;flex-wrap:wrap;gap:10px;align-items:flex-start}.mb-lifecycle-action{display:grid;gap:5px;max-width:260px}.mb-action-button{appearance:none;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius,8px);background:var(--mb-surface);color:var(--mb-text);font:inherit;font-weight:700;line-height:1.2;padding:11px 15px;cursor:pointer}.mb-action-button:hover:not(:disabled){border-color:var(--mb-accent);color:var(--mb-accent)}.mb-action-button:focus-visible{outline:3px solid color-mix(in srgb,var(--mb-accent) 28%,transparent);outline-offset:2px}.mb-action-button.is-primary{background:var(--mb-accent);border-color:var(--mb-accent);color:var(--mb-accent-contrast)}.mb-action-button:disabled{cursor:not-allowed;opacity:.55}.mb-action-reason{color:var(--mb-muted);font-size:12px;line-height:1.35}
|
|
3521
3800
|
.mb-activity-list{list-style:none;margin:0;padding:0}.mb-activity-item{display:grid;grid-template-columns:18px minmax(0,1fr);gap:12px;position:relative;padding:0 0 22px}.mb-activity-item:last-child{padding-bottom:0}.mb-activity-item:not(:last-child)::before{background:var(--mb-border);content:"";left:8px;position:absolute;top:10px;bottom:0;width:1px}.mb-activity-marker{background:var(--mb-surface);border:3px solid var(--mb-accent);border-radius:999px;height:11px;margin-top:4px;position:relative;width:11px;z-index:1}.mb-activity-content{display:grid;gap:4px;min-width:0}.mb-activity-content strong{font-size:15px;line-height:1.35}.mb-activity-content p{color:var(--mb-text);font-size:14px;line-height:1.5;margin:0}.mb-activity-content span,.mb-activity-empty{color:var(--mb-muted);font-size:13px;line-height:1.45}.mb-activity-empty,.mb-empty{margin:0}
|
|
3522
3801
|
.mb-progress-list{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));list-style:none;margin:0;padding:0}.mb-progress-list li{display:grid;gap:7px;position:relative;text-align:center;color:var(--mb-muted);font-size:12px}.mb-progress-list li:not(:last-child)::after{content:"";position:absolute;left:calc(50% + 14px);right:calc(-50% + 14px);top:13px;height:2px;background:var(--mb-border)}.mb-progress-list li.is-complete:not(:last-child)::after{background:var(--mb-accent)}.mb-progress-list li>span{display:grid;place-items:center;justify-self:center;position:relative;z-index:1;width:28px;height:28px;border:2px solid var(--mb-border);border-radius:50%;background:var(--mb-surface);font-weight:800}.mb-progress-list li.is-complete>span,.mb-progress-list li.is-current>span{border-color:var(--mb-accent);background:var(--mb-accent);color:var(--mb-accent-contrast)}.mb-progress-list li.is-current{color:var(--mb-text)}
|
|
3802
|
+
.mb-progress.is-rejected{border-color:color-mix(in srgb,var(--mb-danger) 48%,var(--mb-border));background:color-mix(in srgb,var(--mb-danger) 5%,var(--mb-surface));box-shadow:0 8px 24px color-mix(in srgb,var(--mb-danger) 12%,transparent)}.mb-progress.is-rejected .mb-surface-heading strong,.mb-progress.is-rejected .mb-progress-list li.is-current{color:var(--mb-danger)}.mb-progress.is-rejected .mb-progress-list li.is-complete:not(:last-child)::after{background:var(--mb-danger)}.mb-progress.is-rejected .mb-progress-list li.is-complete>span,.mb-progress.is-rejected .mb-progress-list li.is-current>span{border-color:var(--mb-danger);background:var(--mb-danger);color:#fff}
|
|
3523
3803
|
.mb-snapshot dl,.mb-remittance dl,.mb-contacts dl{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;margin:0}.mb-remittance dl{grid-template-columns:repeat(4,minmax(0,1fr));row-gap:1px;background:var(--mb-border)}.mb-snapshot dl>div,.mb-remittance dl>div,.mb-contacts dl>div{display:grid;gap:3px;padding:10px 14px;border-left:1px solid var(--mb-border)}.mb-remittance dl>div{border:0;background:var(--mb-surface)}.mb-snapshot dl>div:nth-child(3n+1),.mb-contacts dl>div:first-child{border-left:0}.mb-snapshot dt,.mb-remittance dt,.mb-contacts dt,.mb-payment-list dt{color:var(--mb-muted);font-size:11px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.mb-snapshot dd,.mb-remittance dd,.mb-contacts dd,.mb-payment-list dd{font-size:14px;font-weight:750;margin:0;overflow-wrap:anywhere}.mb-contacts a{color:var(--mb-accent)}.mb-denial{margin-top:16px;border-left:4px solid var(--mb-danger);border-radius:var(--mb-control-radius);background:color-mix(in srgb,var(--mb-danger) 8%,var(--mb-surface));padding:12px 14px}.mb-denial p{margin:4px 0 0}
|
|
3524
3804
|
.mb-payment-list{display:grid}.mb-payment-list article{display:grid;grid-template-columns:minmax(120px,.35fr) 1fr;gap:14px 24px;padding:16px 0;border-top:1px solid var(--mb-border)}.mb-payment-list article:first-child{border-top:0}.mb-payment-amount{display:grid;align-content:start;gap:2px}.mb-payment-amount strong{font-size:1.2rem}.mb-payment-list article>dl{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:0}.mb-payment-list article>dl>div{display:grid;align-content:start;gap:3px}.mb-payment-list article span{color:var(--mb-muted);font-size:12px}.mb-payment-list article p{grid-column:1/-1;margin:0;color:var(--mb-muted);font-size:13px}
|
|
3525
3805
|
.mb-eor-review{border-top:4px solid var(--mb-accent);padding-top:17px}.mb-eor-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));margin:0 0 18px;border:1px solid var(--mb-border);border-radius:10px;overflow:hidden}.mb-eor-metrics>div{display:grid;gap:4px;padding:13px 15px;border-left:1px solid var(--mb-border);border-top:1px solid var(--mb-border)}.mb-eor-metrics>div:nth-child(-n+4){border-top:0}.mb-eor-metrics>div:nth-child(4n+1){border-left:0}.mb-eor-metrics dt{color:var(--mb-muted);font-size:11px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.mb-eor-metrics dd{margin:0;font-size:15px;font-weight:800}.mb-eor-metrics .is-balance{background:color-mix(in srgb,var(--mb-accent) 7%,var(--mb-surface))}.mb-eor-table-wrap{overflow-x:auto;border:1px solid var(--mb-border);border-radius:10px}.mb-eor-table{width:100%;min-width:1080px;border-collapse:collapse;font-size:12px}.mb-eor-table th,.mb-eor-table td{padding:10px 12px;border-left:1px solid var(--mb-border);border-top:1px solid var(--mb-border);text-align:left;vertical-align:top}.mb-eor-table th:first-child,.mb-eor-table td:first-child{border-left:0}.mb-eor-table thead th{background:var(--mb-soft);color:var(--mb-muted);font-weight:800}.mb-eor-table .mb-eor-groups th{border-top:0;background:color-mix(in srgb,var(--mb-accent) 13%,var(--mb-surface));color:var(--mb-text);text-align:center}.mb-eor-table td>strong,.mb-eor-table td>span{display:block}.mb-eor-table td>span{margin-top:3px;color:var(--mb-muted)}.mb-eor-link,.mb-eor-documents button{border:0;background:transparent;color:var(--mb-accent);font:inherit;font-weight:750;padding:0;text-align:left;text-decoration:underline;cursor:pointer;overflow-wrap:anywhere}.mb-eor-documents{display:flex;flex-wrap:wrap;gap:12px;margin-top:12px}
|
|
@@ -3528,11 +3808,11 @@ var lifecycleSurfaceStyles = `
|
|
|
3528
3808
|
|
|
3529
3809
|
// src/connected-bill-lifecycle.tsx
|
|
3530
3810
|
import {
|
|
3531
|
-
useCallback as
|
|
3532
|
-
useEffect as
|
|
3533
|
-
useMemo as
|
|
3534
|
-
useRef as
|
|
3535
|
-
useState as
|
|
3811
|
+
useCallback as useCallback4,
|
|
3812
|
+
useEffect as useEffect6,
|
|
3813
|
+
useMemo as useMemo7,
|
|
3814
|
+
useRef as useRef5,
|
|
3815
|
+
useState as useState7
|
|
3536
3816
|
} from "react";
|
|
3537
3817
|
import {
|
|
3538
3818
|
DEFAULT_API_BASE_URL as DEFAULT_API_BASE_URL2,
|
|
@@ -3540,7 +3820,7 @@ import {
|
|
|
3540
3820
|
createBillLifecycleClient
|
|
3541
3821
|
} from "@mindbill/browser";
|
|
3542
3822
|
import { createBillLifecycleClient as createBillLifecycleClient2 } from "@mindbill/browser";
|
|
3543
|
-
import { Fragment as
|
|
3823
|
+
import { Fragment as Fragment6, jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
3544
3824
|
var DEFAULT_REFRESH_INTERVAL2 = 6e4;
|
|
3545
3825
|
function reservePreviewWindow() {
|
|
3546
3826
|
const preview = window.open("about:blank", "_blank");
|
|
@@ -3587,32 +3867,32 @@ function useBillLifecycle({
|
|
|
3587
3867
|
enabled = true,
|
|
3588
3868
|
fetch: fetchOverride
|
|
3589
3869
|
}) {
|
|
3590
|
-
const [data, setData] =
|
|
3591
|
-
const [error, setError] =
|
|
3592
|
-
const [isLoading, setIsLoading] =
|
|
3593
|
-
const [isRefreshing, setIsRefreshing] =
|
|
3594
|
-
const [isMutating, setIsMutating] =
|
|
3595
|
-
const mounted =
|
|
3596
|
-
const client =
|
|
3870
|
+
const [data, setData] = useState7(null);
|
|
3871
|
+
const [error, setError] = useState7(null);
|
|
3872
|
+
const [isLoading, setIsLoading] = useState7(enabled);
|
|
3873
|
+
const [isRefreshing, setIsRefreshing] = useState7(false);
|
|
3874
|
+
const [isMutating, setIsMutating] = useState7(false);
|
|
3875
|
+
const mounted = useRef5(true);
|
|
3876
|
+
const client = useMemo7(() => createBillLifecycleClient({
|
|
3597
3877
|
billId: providedBillId,
|
|
3598
3878
|
sessionEndpoint,
|
|
3599
3879
|
getSession,
|
|
3600
3880
|
apiBaseUrl,
|
|
3601
3881
|
fetch: fetchOverride
|
|
3602
3882
|
}), [apiBaseUrl, fetchOverride, getSession, providedBillId, sessionEndpoint]);
|
|
3603
|
-
|
|
3883
|
+
useEffect6(() => {
|
|
3604
3884
|
setData(null);
|
|
3605
3885
|
setError(null);
|
|
3606
3886
|
setIsLoading(enabled);
|
|
3607
3887
|
}, [enabled, providedBillId]);
|
|
3608
|
-
|
|
3888
|
+
useEffect6(() => {
|
|
3609
3889
|
mounted.current = true;
|
|
3610
3890
|
return () => {
|
|
3611
3891
|
mounted.current = false;
|
|
3612
3892
|
client.clearSession();
|
|
3613
3893
|
};
|
|
3614
3894
|
}, [client]);
|
|
3615
|
-
const refresh =
|
|
3895
|
+
const refresh = useCallback4(async () => {
|
|
3616
3896
|
if (!enabled) return;
|
|
3617
3897
|
setIsRefreshing(true);
|
|
3618
3898
|
try {
|
|
@@ -3629,7 +3909,7 @@ function useBillLifecycle({
|
|
|
3629
3909
|
}
|
|
3630
3910
|
}
|
|
3631
3911
|
}, [client, enabled]);
|
|
3632
|
-
|
|
3912
|
+
useEffect6(() => {
|
|
3633
3913
|
if (!enabled) return;
|
|
3634
3914
|
void refresh();
|
|
3635
3915
|
const interval = refreshInterval > 0 ? window.setInterval(() => void refresh(), refreshInterval) : null;
|
|
@@ -3640,7 +3920,7 @@ function useBillLifecycle({
|
|
|
3640
3920
|
window.removeEventListener("focus", onFocus);
|
|
3641
3921
|
};
|
|
3642
3922
|
}, [enabled, refresh, refreshInterval]);
|
|
3643
|
-
const mutate =
|
|
3923
|
+
const mutate = useCallback4(async (task) => {
|
|
3644
3924
|
setIsMutating(true);
|
|
3645
3925
|
setError(null);
|
|
3646
3926
|
try {
|
|
@@ -3655,13 +3935,13 @@ function useBillLifecycle({
|
|
|
3655
3935
|
if (mounted.current) setIsMutating(false);
|
|
3656
3936
|
}
|
|
3657
3937
|
}, []);
|
|
3658
|
-
const openAttachment =
|
|
3938
|
+
const openAttachment = useCallback4(async (attachment) => {
|
|
3659
3939
|
await openPdfFromUserGesture(() => client.getAttachment(attachment.id));
|
|
3660
3940
|
}, [client]);
|
|
3661
|
-
const openEor =
|
|
3941
|
+
const openEor = useCallback4(async (document2) => {
|
|
3662
3942
|
await openPdfFromUserGesture(() => client.getEor(document2.id));
|
|
3663
3943
|
}, [client]);
|
|
3664
|
-
const downloadPacket =
|
|
3944
|
+
const downloadPacket = useCallback4(async () => {
|
|
3665
3945
|
setError(null);
|
|
3666
3946
|
try {
|
|
3667
3947
|
await openPdfFromUserGesture(() => client.getPacket());
|
|
@@ -3693,8 +3973,8 @@ function useBillLifecycle({
|
|
|
3693
3973
|
};
|
|
3694
3974
|
}
|
|
3695
3975
|
function LifecycleDialog({ children, title, onClose }) {
|
|
3696
|
-
const dialog =
|
|
3697
|
-
|
|
3976
|
+
const dialog = useRef5(null);
|
|
3977
|
+
useEffect6(() => {
|
|
3698
3978
|
const previous = document.activeElement;
|
|
3699
3979
|
dialog.current?.focus();
|
|
3700
3980
|
const onKeyDown = (event) => event.key === "Escape" && onClose();
|
|
@@ -3704,8 +3984,8 @@ function LifecycleDialog({ children, title, onClose }) {
|
|
|
3704
3984
|
previous?.focus();
|
|
3705
3985
|
};
|
|
3706
3986
|
}, [onClose]);
|
|
3707
|
-
return /* @__PURE__ */
|
|
3708
|
-
/* @__PURE__ */
|
|
3987
|
+
return /* @__PURE__ */ jsx9("div", { className: "mb-lifecycle-dialog-backdrop", onMouseDown: (event) => event.currentTarget === event.target && onClose(), children: /* @__PURE__ */ jsxs9("div", { ref: dialog, className: "mb-lifecycle-dialog", role: "dialog", "aria-modal": "true", "aria-label": title, tabIndex: -1, children: [
|
|
3988
|
+
/* @__PURE__ */ jsx9("button", { type: "button", className: "mb-lifecycle-dialog-close", "aria-label": "Close", onClick: onClose, children: "\xD7" }),
|
|
3709
3989
|
children
|
|
3710
3990
|
] }) });
|
|
3711
3991
|
}
|
|
@@ -3738,14 +4018,14 @@ function shouldShowSandboxControls(environment, enabled = false) {
|
|
|
3738
4018
|
function ConnectedBillLifecycle({ appearance, sandboxControls = false, className, style, loadingFallback, errorFallback, onChanged, ...options }) {
|
|
3739
4019
|
const lifecycle = useBillLifecycle(options);
|
|
3740
4020
|
const { data } = lifecycle;
|
|
3741
|
-
const [tab, setTab] =
|
|
3742
|
-
const [panel, setPanel] =
|
|
3743
|
-
const [notice, setNotice] =
|
|
3744
|
-
const [reason, setReason] =
|
|
3745
|
-
const [payment, setPayment] =
|
|
3746
|
-
const [review, setReview] =
|
|
3747
|
-
const lastData =
|
|
3748
|
-
|
|
4021
|
+
const [tab, setTab] = useState7("details");
|
|
4022
|
+
const [panel, setPanel] = useState7("");
|
|
4023
|
+
const [notice, setNotice] = useState7("");
|
|
4024
|
+
const [reason, setReason] = useState7("");
|
|
4025
|
+
const [payment, setPayment] = useState7({ amount: 0, penaltyAmount: 0, interestAmount: 0, method: "check", checkNumber: "", depositDate: today(), note: "" });
|
|
4026
|
+
const [review, setReview] = useState7({ reason: "", payerClaimControlNumber: "", disputedAmount: void 0, attachmentIds: [], route: "ebill" });
|
|
4027
|
+
const lastData = useRef5(null);
|
|
4028
|
+
useEffect6(() => {
|
|
3749
4029
|
if (!data || data === lastData.current) return;
|
|
3750
4030
|
lastData.current = data;
|
|
3751
4031
|
onChanged?.(data);
|
|
@@ -3762,13 +4042,13 @@ function ConnectedBillLifecycle({ appearance, sandboxControls = false, className
|
|
|
3762
4042
|
attachmentIds: current.attachmentIds.length ? current.attachmentIds.filter((id) => data.bill.attachments.some((document2) => document2.id === id)) : data.bill.attachments.map((document2) => document2.id)
|
|
3763
4043
|
}));
|
|
3764
4044
|
}, [data, onChanged]);
|
|
3765
|
-
if (lifecycle.isLoading && !data) return /* @__PURE__ */
|
|
4045
|
+
if (lifecycle.isLoading && !data) return /* @__PURE__ */ jsx9(Fragment6, { children: loadingFallback ?? /* @__PURE__ */ jsx9("div", { className: "mb-lifecycle-loading", children: "Loading bill\u2026" }) });
|
|
3766
4046
|
if (!data) {
|
|
3767
4047
|
const error = lifecycle.error ?? new Error("Bill could not be loaded.");
|
|
3768
|
-
return /* @__PURE__ */
|
|
3769
|
-
/* @__PURE__ */
|
|
3770
|
-
/* @__PURE__ */
|
|
3771
|
-
/* @__PURE__ */
|
|
4048
|
+
return /* @__PURE__ */ jsx9(Fragment6, { children: errorFallback?.(error, lifecycle.refresh) ?? /* @__PURE__ */ jsxs9("div", { className: "mb-lifecycle-error", role: "alert", children: [
|
|
4049
|
+
/* @__PURE__ */ jsx9("strong", { children: "Billing is unavailable." }),
|
|
4050
|
+
/* @__PURE__ */ jsx9("span", { children: error.message }),
|
|
4051
|
+
/* @__PURE__ */ jsx9("button", { type: "button", onClick: () => void lifecycle.refresh(), children: "Try again" })
|
|
3772
4052
|
] }) });
|
|
3773
4053
|
}
|
|
3774
4054
|
const complete = async (message, task) => {
|
|
@@ -3786,170 +4066,170 @@ function ConnectedBillLifecycle({ appearance, sandboxControls = false, className
|
|
|
3786
4066
|
const actions = data.lifecycle.actions.filter((action) => action.enabled && supportedActions.has(action.id));
|
|
3787
4067
|
const showSandboxControls = shouldShowSandboxControls(data.environment, sandboxControls);
|
|
3788
4068
|
const simulations = showSandboxControls ? sandboxScenarios(data.lifecycle.state) : [];
|
|
3789
|
-
return /* @__PURE__ */
|
|
3790
|
-
/* @__PURE__ */
|
|
3791
|
-
/* @__PURE__ */
|
|
3792
|
-
/* @__PURE__ */
|
|
3793
|
-
/* @__PURE__ */
|
|
3794
|
-
/* @__PURE__ */
|
|
4069
|
+
return /* @__PURE__ */ jsxs9("section", { className: ["mb-connected-lifecycle", className].filter(Boolean).join(" "), style: mindBillAppearanceStyle(appearance, style), children: [
|
|
4070
|
+
/* @__PURE__ */ jsx9("style", { children: CONNECTED_LIFECYCLE_STYLES }),
|
|
4071
|
+
/* @__PURE__ */ jsx9(BillLifecycleProgress, { state: data.lifecycle.state, nativeStatus: data.lifecycle.nativeStatus, submittedAt: data.lifecycle.submittedAt ?? null, agingDays: data.lifecycle.agingDays ?? null, ...appearance ? { appearance } : {} }),
|
|
4072
|
+
/* @__PURE__ */ jsxs9("header", { className: "mb-lifecycle-head", children: [
|
|
4073
|
+
/* @__PURE__ */ jsxs9("div", { children: [
|
|
4074
|
+
/* @__PURE__ */ jsx9("div", { className: "mb-lifecycle-title", children: /* @__PURE__ */ jsxs9("h2", { children: [
|
|
3795
4075
|
"Bill #",
|
|
3796
4076
|
data.bill.billNumber
|
|
3797
4077
|
] }) }),
|
|
3798
|
-
/* @__PURE__ */
|
|
4078
|
+
/* @__PURE__ */ jsxs9("p", { children: [
|
|
3799
4079
|
"Claim ",
|
|
3800
4080
|
data.injury.claimNumber || "\u2014",
|
|
3801
4081
|
lifecycle.isRefreshing ? " \xB7 Refreshing\u2026" : ""
|
|
3802
4082
|
] })
|
|
3803
4083
|
] }),
|
|
3804
|
-
/* @__PURE__ */
|
|
4084
|
+
/* @__PURE__ */ jsx9("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating, onClick: () => void lifecycle.downloadPacket().catch(() => void 0), children: "Download packet" })
|
|
3805
4085
|
] }),
|
|
3806
|
-
/* @__PURE__ */
|
|
3807
|
-
/* @__PURE__ */
|
|
3808
|
-
/* @__PURE__ */
|
|
4086
|
+
/* @__PURE__ */ jsxs9("div", { className: "mb-lifecycle-tabs", role: "tablist", "aria-label": "Bill view", children: [
|
|
4087
|
+
/* @__PURE__ */ jsx9("button", { type: "button", role: "tab", "aria-selected": tab === "details", onClick: () => setTab("details"), children: "Bill details" }),
|
|
4088
|
+
/* @__PURE__ */ jsx9("button", { type: "button", role: "tab", "aria-selected": tab === "history", onClick: () => setTab("history"), children: "Bill history" })
|
|
3809
4089
|
] }),
|
|
3810
|
-
tab === "details" ? /* @__PURE__ */
|
|
3811
|
-
data.eors.length || data.payments.length || ["processed", "denied", "partially_paid"].includes(data.lifecycle.state) ? /* @__PURE__ */
|
|
3812
|
-
showSandboxControls ? /* @__PURE__ */
|
|
3813
|
-
/* @__PURE__ */
|
|
3814
|
-
/* @__PURE__ */
|
|
3815
|
-
/* @__PURE__ */
|
|
3816
|
-
/* @__PURE__ */
|
|
4090
|
+
tab === "details" ? /* @__PURE__ */ jsxs9("div", { className: "mb-lifecycle-tabpanel", role: "tabpanel", children: [
|
|
4091
|
+
data.eors.length || data.payments.length || ["processed", "denied", "partially_paid"].includes(data.lifecycle.state) ? /* @__PURE__ */ jsx9(BillExplanationOfReview, { remittance: data.remittance, eors: data.eors, payments: data.payments, submittedAt: data.lifecycle.submittedAt ?? null, onOpenEor: lifecycle.openEor, ...appearance ? { appearance } : {} }) : null,
|
|
4092
|
+
showSandboxControls ? /* @__PURE__ */ jsxs9("section", { className: "mb-lifecycle-simulator", "aria-label": "Sandbox lifecycle simulator", children: [
|
|
4093
|
+
/* @__PURE__ */ jsxs9("div", { children: [
|
|
4094
|
+
/* @__PURE__ */ jsx9("span", { children: "Sandbox demo controls" }),
|
|
4095
|
+
/* @__PURE__ */ jsx9("h3", { children: "Simulate the next payer response" }),
|
|
4096
|
+
/* @__PURE__ */ jsx9("p", { children: "This changes sandbox data only. The host receives the result through the same lifecycle API and components partners use." })
|
|
3817
4097
|
] }),
|
|
3818
|
-
simulations.length ? /* @__PURE__ */
|
|
3819
|
-
/* @__PURE__ */
|
|
3820
|
-
/* @__PURE__ */
|
|
3821
|
-
] }, scenario.id)) }) : /* @__PURE__ */
|
|
4098
|
+
simulations.length ? /* @__PURE__ */ jsx9("div", { className: "mb-lifecycle-simulator-actions", children: simulations.map((scenario) => /* @__PURE__ */ jsxs9("button", { type: "button", disabled: lifecycle.isMutating, onClick: () => void complete(`${scenario.label} simulated.`, () => lifecycle.simulateSandbox({ scenario: scenario.id })), children: [
|
|
4099
|
+
/* @__PURE__ */ jsx9("strong", { children: scenario.label }),
|
|
4100
|
+
/* @__PURE__ */ jsx9("span", { children: scenario.detail })
|
|
4101
|
+
] }, scenario.id)) }) : /* @__PURE__ */ jsx9("p", { className: "mb-lifecycle-simulator-idle", children: "No simulated payer transition is needed at this stage. Use the bill action below to continue." })
|
|
3822
4102
|
] }) : null,
|
|
3823
|
-
/* @__PURE__ */
|
|
3824
|
-
] }) : /* @__PURE__ */
|
|
3825
|
-
viewEor || actions.length ? /* @__PURE__ */
|
|
3826
|
-
viewEor && data.eors[0] ? /* @__PURE__ */
|
|
3827
|
-
actions.map((action) => /* @__PURE__ */
|
|
4103
|
+
/* @__PURE__ */ jsx9(BillReadOnlyForm, { data, onOpenAttachment: lifecycle.openAttachment, ...appearance ? { appearance } : {} })
|
|
4104
|
+
] }) : /* @__PURE__ */ jsx9("div", { className: "mb-lifecycle-tabpanel", role: "tabpanel", children: /* @__PURE__ */ jsx9(BillActivityTimeline, { events: data.activity, ...appearance ? { appearance } : {} }) }),
|
|
4105
|
+
viewEor || actions.length ? /* @__PURE__ */ jsxs9("aside", { className: "mb-lifecycle-actions-sheet", "aria-label": "Bill actions", children: [
|
|
4106
|
+
viewEor && data.eors[0] ? /* @__PURE__ */ jsx9("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => void lifecycle.openEor(data.eors[0]).catch(() => void 0), children: viewEor.label }) : null,
|
|
4107
|
+
actions.map((action) => /* @__PURE__ */ jsx9("button", { type: "button", className: action.primary ? "mb-lifecycle-button primary" : "mb-lifecycle-button secondary", onClick: () => {
|
|
3828
4108
|
const next = actionPanel(action);
|
|
3829
4109
|
if (next) setPanel(next);
|
|
3830
4110
|
}, children: action.label }, action.id))
|
|
3831
4111
|
] }) : null,
|
|
3832
|
-
panel === "resubmit" ? /* @__PURE__ */
|
|
3833
|
-
/* @__PURE__ */
|
|
3834
|
-
/* @__PURE__ */
|
|
3835
|
-
/* @__PURE__ */
|
|
4112
|
+
panel === "resubmit" ? /* @__PURE__ */ jsx9(LifecycleDialog, { title: "Correct and resubmit", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs9("section", { className: "mb-lifecycle-panel", children: [
|
|
4113
|
+
/* @__PURE__ */ jsxs9("div", { children: [
|
|
4114
|
+
/* @__PURE__ */ jsx9("h3", { children: "Correct and resubmit" }),
|
|
4115
|
+
/* @__PURE__ */ jsx9("p", { children: "The original submission remains immutable. This records a new submission attempt after the routing issue is corrected." })
|
|
3836
4116
|
] }),
|
|
3837
|
-
/* @__PURE__ */
|
|
3838
|
-
/* @__PURE__ */
|
|
3839
|
-
/* @__PURE__ */
|
|
4117
|
+
/* @__PURE__ */ jsxs9("label", { children: [
|
|
4118
|
+
/* @__PURE__ */ jsx9("span", { children: "Correction note (optional)" }),
|
|
4119
|
+
/* @__PURE__ */ jsx9("textarea", { value: reason, placeholder: "What changed before resubmission?", onChange: (event) => setReason(event.target.value) })
|
|
3840
4120
|
] }),
|
|
3841
|
-
/* @__PURE__ */
|
|
3842
|
-
/* @__PURE__ */
|
|
3843
|
-
/* @__PURE__ */
|
|
4121
|
+
/* @__PURE__ */ jsxs9("div", { className: "mb-lifecycle-panel-actions", children: [
|
|
4122
|
+
/* @__PURE__ */ jsx9("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
|
|
4123
|
+
/* @__PURE__ */ jsx9("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating, onClick: () => void complete("Bill resubmitted.", () => lifecycle.resubmitBill({ reason })), children: lifecycle.isMutating ? "Resubmitting\u2026" : "Resubmit bill" })
|
|
3844
4124
|
] })
|
|
3845
4125
|
] }) }) : null,
|
|
3846
|
-
panel === "second_review" ? /* @__PURE__ */
|
|
3847
|
-
/* @__PURE__ */
|
|
3848
|
-
/* @__PURE__ */
|
|
3849
|
-
/* @__PURE__ */
|
|
4126
|
+
panel === "second_review" ? /* @__PURE__ */ jsx9(LifecycleDialog, { title: "Submit Second Review", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs9("section", { className: "mb-lifecycle-panel", children: [
|
|
4127
|
+
/* @__PURE__ */ jsxs9("div", { children: [
|
|
4128
|
+
/* @__PURE__ */ jsx9("h3", { children: "Submit Second Review" }),
|
|
4129
|
+
/* @__PURE__ */ jsx9("p", { children: "Explain the dispute and include the payer control number and supporting documents." })
|
|
3850
4130
|
] }),
|
|
3851
|
-
/* @__PURE__ */
|
|
3852
|
-
/* @__PURE__ */
|
|
3853
|
-
/* @__PURE__ */
|
|
3854
|
-
/* @__PURE__ */
|
|
4131
|
+
/* @__PURE__ */ jsxs9("div", { className: "mb-lifecycle-fields two", children: [
|
|
4132
|
+
/* @__PURE__ */ jsxs9("label", { className: "full", children: [
|
|
4133
|
+
/* @__PURE__ */ jsx9("span", { children: "Reason" }),
|
|
4134
|
+
/* @__PURE__ */ jsx9("textarea", { required: true, value: review.reason, onChange: (event) => setReview((current) => ({ ...current, reason: event.target.value })) })
|
|
3855
4135
|
] }),
|
|
3856
|
-
/* @__PURE__ */
|
|
3857
|
-
/* @__PURE__ */
|
|
3858
|
-
/* @__PURE__ */
|
|
4136
|
+
/* @__PURE__ */ jsxs9("label", { children: [
|
|
4137
|
+
/* @__PURE__ */ jsx9("span", { children: "Payer claim control number" }),
|
|
4138
|
+
/* @__PURE__ */ jsx9("input", { required: true, value: review.payerClaimControlNumber, onChange: (event) => setReview((current) => ({ ...current, payerClaimControlNumber: event.target.value })) })
|
|
3859
4139
|
] }),
|
|
3860
|
-
/* @__PURE__ */
|
|
3861
|
-
/* @__PURE__ */
|
|
3862
|
-
/* @__PURE__ */
|
|
4140
|
+
/* @__PURE__ */ jsxs9("label", { children: [
|
|
4141
|
+
/* @__PURE__ */ jsx9("span", { children: "Disputed amount" }),
|
|
4142
|
+
/* @__PURE__ */ jsx9("input", { type: "number", min: "0.01", step: "0.01", value: review.disputedAmount ?? "", onChange: (event) => setReview((current) => ({ ...current, disputedAmount: event.target.value ? Number(event.target.value) : void 0 })) })
|
|
3863
4143
|
] }),
|
|
3864
|
-
/* @__PURE__ */
|
|
3865
|
-
/* @__PURE__ */
|
|
3866
|
-
/* @__PURE__ */
|
|
3867
|
-
/* @__PURE__ */
|
|
3868
|
-
/* @__PURE__ */
|
|
3869
|
-
/* @__PURE__ */
|
|
3870
|
-
/* @__PURE__ */
|
|
4144
|
+
/* @__PURE__ */ jsxs9("label", { children: [
|
|
4145
|
+
/* @__PURE__ */ jsx9("span", { children: "Send via" }),
|
|
4146
|
+
/* @__PURE__ */ jsxs9("select", { value: review.route, onChange: (event) => setReview((current) => ({ ...current, route: event.target.value })), children: [
|
|
4147
|
+
/* @__PURE__ */ jsx9("option", { value: "ebill", children: "E-bill" }),
|
|
4148
|
+
/* @__PURE__ */ jsx9("option", { value: "fax", children: "Fax" }),
|
|
4149
|
+
/* @__PURE__ */ jsx9("option", { value: "mail", children: "Mail" }),
|
|
4150
|
+
/* @__PURE__ */ jsx9("option", { value: "email", children: "Email" })
|
|
3871
4151
|
] })
|
|
3872
4152
|
] })
|
|
3873
4153
|
] }),
|
|
3874
|
-
/* @__PURE__ */
|
|
3875
|
-
/* @__PURE__ */
|
|
3876
|
-
data.bill.attachments.map((attachment) => /* @__PURE__ */
|
|
3877
|
-
/* @__PURE__ */
|
|
3878
|
-
/* @__PURE__ */
|
|
3879
|
-
/* @__PURE__ */
|
|
3880
|
-
/* @__PURE__ */
|
|
4154
|
+
/* @__PURE__ */ jsxs9("fieldset", { className: "mb-lifecycle-packet", children: [
|
|
4155
|
+
/* @__PURE__ */ jsx9("legend", { children: "Supporting packet" }),
|
|
4156
|
+
data.bill.attachments.map((attachment) => /* @__PURE__ */ jsxs9("label", { children: [
|
|
4157
|
+
/* @__PURE__ */ jsx9("input", { type: "checkbox", checked: review.attachmentIds.includes(attachment.id), onChange: (event) => setReview((current) => ({ ...current, attachmentIds: event.target.checked ? [...current.attachmentIds, attachment.id] : current.attachmentIds.filter((id) => id !== attachment.id) })) }),
|
|
4158
|
+
/* @__PURE__ */ jsxs9("span", { children: [
|
|
4159
|
+
/* @__PURE__ */ jsx9("strong", { children: attachment.filename }),
|
|
4160
|
+
/* @__PURE__ */ jsx9("small", { children: attachment.description || attachment.documentType })
|
|
3881
4161
|
] }),
|
|
3882
|
-
/* @__PURE__ */
|
|
4162
|
+
/* @__PURE__ */ jsx9("button", { type: "button", onClick: () => void lifecycle.openAttachment(attachment).catch(() => void 0), children: "View" })
|
|
3883
4163
|
] }, attachment.id))
|
|
3884
4164
|
] }),
|
|
3885
|
-
/* @__PURE__ */
|
|
3886
|
-
/* @__PURE__ */
|
|
3887
|
-
/* @__PURE__ */
|
|
4165
|
+
/* @__PURE__ */ jsxs9("div", { className: "mb-lifecycle-panel-actions", children: [
|
|
4166
|
+
/* @__PURE__ */ jsx9("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
|
|
4167
|
+
/* @__PURE__ */ jsx9("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating || !review.reason.trim() || !review.payerClaimControlNumber.trim(), onClick: () => void complete("Second Review submitted.", () => lifecycle.submitSecondReview(review)), children: lifecycle.isMutating ? "Submitting\u2026" : "Submit Second Review" })
|
|
3888
4168
|
] })
|
|
3889
4169
|
] }) }) : null,
|
|
3890
|
-
panel === "payment" ? /* @__PURE__ */
|
|
3891
|
-
/* @__PURE__ */
|
|
3892
|
-
/* @__PURE__ */
|
|
3893
|
-
/* @__PURE__ */
|
|
4170
|
+
panel === "payment" ? /* @__PURE__ */ jsx9(LifecycleDialog, { title: "Post payment", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs9("section", { className: "mb-lifecycle-panel", children: [
|
|
4171
|
+
/* @__PURE__ */ jsxs9("div", { children: [
|
|
4172
|
+
/* @__PURE__ */ jsx9("h3", { children: "Post payment" }),
|
|
4173
|
+
/* @__PURE__ */ jsx9("p", { children: "Record a full or partial payment, plus any penalty and interest received." })
|
|
3894
4174
|
] }),
|
|
3895
|
-
/* @__PURE__ */
|
|
3896
|
-
/* @__PURE__ */
|
|
3897
|
-
/* @__PURE__ */
|
|
3898
|
-
/* @__PURE__ */
|
|
4175
|
+
/* @__PURE__ */ jsxs9("div", { className: "mb-lifecycle-fields two", children: [
|
|
4176
|
+
/* @__PURE__ */ jsxs9("label", { children: [
|
|
4177
|
+
/* @__PURE__ */ jsx9("span", { children: "Amount applied to bill" }),
|
|
4178
|
+
/* @__PURE__ */ jsx9("input", { type: "number", min: "0.01", max: data.bill.balanceDue, step: "0.01", value: payment.amount || "", onChange: (event) => setPayment((current) => ({ ...current, amount: Number(event.target.value) })) })
|
|
3899
4179
|
] }),
|
|
3900
|
-
/* @__PURE__ */
|
|
3901
|
-
/* @__PURE__ */
|
|
3902
|
-
/* @__PURE__ */
|
|
4180
|
+
/* @__PURE__ */ jsxs9("label", { children: [
|
|
4181
|
+
/* @__PURE__ */ jsx9("span", { children: "Penalty" }),
|
|
4182
|
+
/* @__PURE__ */ jsx9("input", { type: "number", min: "0", step: "0.01", value: payment.penaltyAmount || "", placeholder: "0.00", onChange: (event) => setPayment((current) => ({ ...current, penaltyAmount: Number(event.target.value) })) })
|
|
3903
4183
|
] }),
|
|
3904
|
-
/* @__PURE__ */
|
|
3905
|
-
/* @__PURE__ */
|
|
3906
|
-
/* @__PURE__ */
|
|
4184
|
+
/* @__PURE__ */ jsxs9("label", { children: [
|
|
4185
|
+
/* @__PURE__ */ jsx9("span", { children: "Interest" }),
|
|
4186
|
+
/* @__PURE__ */ jsx9("input", { type: "number", min: "0", step: "0.01", value: payment.interestAmount || "", placeholder: "0.00", onChange: (event) => setPayment((current) => ({ ...current, interestAmount: Number(event.target.value) })) })
|
|
3907
4187
|
] }),
|
|
3908
|
-
/* @__PURE__ */
|
|
3909
|
-
/* @__PURE__ */
|
|
3910
|
-
/* @__PURE__ */
|
|
3911
|
-
/* @__PURE__ */
|
|
3912
|
-
/* @__PURE__ */
|
|
4188
|
+
/* @__PURE__ */ jsxs9("label", { children: [
|
|
4189
|
+
/* @__PURE__ */ jsx9("span", { children: "Method" }),
|
|
4190
|
+
/* @__PURE__ */ jsxs9("select", { value: payment.method, onChange: (event) => setPayment((current) => ({ ...current, method: event.target.value })), children: [
|
|
4191
|
+
/* @__PURE__ */ jsx9("option", { value: "check", children: "Check" }),
|
|
4192
|
+
/* @__PURE__ */ jsx9("option", { value: "eft", children: "EFT" })
|
|
3913
4193
|
] })
|
|
3914
4194
|
] }),
|
|
3915
|
-
/* @__PURE__ */
|
|
3916
|
-
/* @__PURE__ */
|
|
3917
|
-
/* @__PURE__ */
|
|
4195
|
+
/* @__PURE__ */ jsxs9("label", { children: [
|
|
4196
|
+
/* @__PURE__ */ jsx9("span", { children: payment.method === "check" ? "Check number" : "EFT reference" }),
|
|
4197
|
+
/* @__PURE__ */ jsx9("input", { value: payment.checkNumber, onChange: (event) => setPayment((current) => ({ ...current, checkNumber: event.target.value })) })
|
|
3918
4198
|
] }),
|
|
3919
|
-
/* @__PURE__ */
|
|
3920
|
-
/* @__PURE__ */
|
|
3921
|
-
/* @__PURE__ */
|
|
4199
|
+
/* @__PURE__ */ jsxs9("label", { children: [
|
|
4200
|
+
/* @__PURE__ */ jsx9("span", { children: "Deposit date" }),
|
|
4201
|
+
/* @__PURE__ */ jsx9("input", { required: true, value: payment.depositDate, placeholder: "MM/DD/YYYY", onChange: (event) => setPayment((current) => ({ ...current, depositDate: event.target.value })) })
|
|
3922
4202
|
] }),
|
|
3923
|
-
/* @__PURE__ */
|
|
3924
|
-
/* @__PURE__ */
|
|
3925
|
-
/* @__PURE__ */
|
|
4203
|
+
/* @__PURE__ */ jsxs9("label", { className: "full", children: [
|
|
4204
|
+
/* @__PURE__ */ jsx9("span", { children: "Note (optional)" }),
|
|
4205
|
+
/* @__PURE__ */ jsx9("input", { value: payment.note, onChange: (event) => setPayment((current) => ({ ...current, note: event.target.value })) })
|
|
3926
4206
|
] })
|
|
3927
4207
|
] }),
|
|
3928
|
-
/* @__PURE__ */
|
|
3929
|
-
/* @__PURE__ */
|
|
3930
|
-
/* @__PURE__ */
|
|
4208
|
+
/* @__PURE__ */ jsxs9("div", { className: "mb-payment-total", children: [
|
|
4209
|
+
/* @__PURE__ */ jsx9("span", { children: "Total received" }),
|
|
4210
|
+
/* @__PURE__ */ jsx9("strong", { children: new Intl.NumberFormat(void 0, { style: "currency", currency: "USD" }).format(payment.amount + (payment.penaltyAmount ?? 0) + (payment.interestAmount ?? 0)) })
|
|
3931
4211
|
] }),
|
|
3932
|
-
/* @__PURE__ */
|
|
3933
|
-
/* @__PURE__ */
|
|
3934
|
-
/* @__PURE__ */
|
|
4212
|
+
/* @__PURE__ */ jsxs9("div", { className: "mb-lifecycle-panel-actions", children: [
|
|
4213
|
+
/* @__PURE__ */ jsx9("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
|
|
4214
|
+
/* @__PURE__ */ jsx9("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating || payment.amount <= 0 || payment.amount > data.bill.balanceDue || (payment.penaltyAmount ?? 0) < 0 || (payment.interestAmount ?? 0) < 0 || !payment.depositDate, onClick: () => void complete("Payment posted.", () => lifecycle.postPayment(payment)), children: lifecycle.isMutating ? "Posting\u2026" : "Post payment" })
|
|
3935
4215
|
] })
|
|
3936
4216
|
] }) }) : null,
|
|
3937
|
-
panel === "close" || panel === "reopen" ? /* @__PURE__ */
|
|
3938
|
-
/* @__PURE__ */
|
|
3939
|
-
/* @__PURE__ */
|
|
3940
|
-
/* @__PURE__ */
|
|
4217
|
+
panel === "close" || panel === "reopen" ? /* @__PURE__ */ jsx9(LifecycleDialog, { title: panel === "close" ? "Close bill" : "Reopen bill", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs9("section", { className: "mb-lifecycle-panel", children: [
|
|
4218
|
+
/* @__PURE__ */ jsxs9("div", { children: [
|
|
4219
|
+
/* @__PURE__ */ jsx9("h3", { children: panel === "close" ? "Close bill" : "Reopen bill" }),
|
|
4220
|
+
/* @__PURE__ */ jsx9("p", { children: panel === "close" ? "The immutable submission and history remain available." : "Return this bill to active follow-up without changing the submitted snapshot." })
|
|
3941
4221
|
] }),
|
|
3942
|
-
/* @__PURE__ */
|
|
3943
|
-
/* @__PURE__ */
|
|
3944
|
-
/* @__PURE__ */
|
|
4222
|
+
/* @__PURE__ */ jsxs9("label", { children: [
|
|
4223
|
+
/* @__PURE__ */ jsx9("span", { children: "Reason" }),
|
|
4224
|
+
/* @__PURE__ */ jsx9("textarea", { required: true, value: reason, onChange: (event) => setReason(event.target.value) })
|
|
3945
4225
|
] }),
|
|
3946
|
-
/* @__PURE__ */
|
|
3947
|
-
/* @__PURE__ */
|
|
3948
|
-
/* @__PURE__ */
|
|
4226
|
+
/* @__PURE__ */ jsxs9("div", { className: "mb-lifecycle-panel-actions", children: [
|
|
4227
|
+
/* @__PURE__ */ jsx9("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
|
|
4228
|
+
/* @__PURE__ */ jsx9("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating || !reason.trim(), onClick: () => void complete(panel === "close" ? "Bill closed." : "Bill reopened.", () => panel === "close" ? lifecycle.closeBill({ reason }) : lifecycle.reopenBill({ reason })), children: lifecycle.isMutating ? "Saving\u2026" : panel === "close" ? "Close bill" : "Reopen bill" })
|
|
3949
4229
|
] })
|
|
3950
4230
|
] }) }) : null,
|
|
3951
|
-
notice ? /* @__PURE__ */
|
|
3952
|
-
lifecycle.error ? /* @__PURE__ */
|
|
4231
|
+
notice ? /* @__PURE__ */ jsx9("div", { className: "mb-lifecycle-message success", role: "status", children: notice }) : null,
|
|
4232
|
+
lifecycle.error ? /* @__PURE__ */ jsx9("div", { className: "mb-lifecycle-message error", role: "alert", children: lifecycle.error.message }) : null
|
|
3953
4233
|
] });
|
|
3954
4234
|
}
|
|
3955
4235
|
var CONNECTED_LIFECYCLE_STYLES = `
|
|
@@ -3961,9 +4241,9 @@ var CONNECTED_LIFECYCLE_STYLES = `
|
|
|
3961
4241
|
|
|
3962
4242
|
// src/index.tsx
|
|
3963
4243
|
function widget(tagName, props) {
|
|
3964
|
-
const ref =
|
|
4244
|
+
const ref = useRef6(null);
|
|
3965
4245
|
const { onMindBill, onMindBillError } = props;
|
|
3966
|
-
|
|
4246
|
+
useEffect7(() => {
|
|
3967
4247
|
const element = ref.current;
|
|
3968
4248
|
if (!element) return;
|
|
3969
4249
|
const handleEvent = (event) => onMindBill?.(event);
|
|
@@ -4029,6 +4309,7 @@ export {
|
|
|
4029
4309
|
BillSubmissionServiceLinesSection,
|
|
4030
4310
|
BillingDashboard,
|
|
4031
4311
|
BillingReport,
|
|
4312
|
+
BillingSettings,
|
|
4032
4313
|
ConnectedBillLifecycle,
|
|
4033
4314
|
ConnectedBillStatus,
|
|
4034
4315
|
DEFAULT_BILL_SUBMISSION_MODIFIERS,
|
|
@@ -4037,6 +4318,7 @@ export {
|
|
|
4037
4318
|
MED_LEGAL_REPORT_TYPE_CODE,
|
|
4038
4319
|
MindBillBillReview,
|
|
4039
4320
|
MindBillBillTimeline,
|
|
4321
|
+
OrganizationOnboarding,
|
|
4040
4322
|
PSYCH_QME_DEFAULT_DIAGNOSIS,
|
|
4041
4323
|
applyBillSubmissionEvaluationDiagnoses,
|
|
4042
4324
|
applyBillSubmissionEvaluationModifiers,
|