@paro.io/expert-shared-components 1.14.59 → 1.14.60

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.
Files changed (60) hide show
  1. package/lib/README.md +2 -0
  2. package/lib/components/DocumentCenter/MultiFileUploadSection.js +121 -220
  3. package/lib/components/TaxAxis/TaxAxisApi.d.ts +1 -0
  4. package/lib/components/TaxAxis/TaxAxisShell.js +52 -3
  5. package/lib/components/shared/UploadClient.d.ts +1 -2
  6. package/lib/components/shared/UploadClient.js +2 -6
  7. package/lib/index.d.ts +13 -2
  8. package/lib/index.js +27 -3
  9. package/lib/package.json +68 -0
  10. package/lib/tax-axis/components/clientReport/ExecutiveSummary.d.ts +1 -4
  11. package/lib/tax-axis/components/clientReport/ExecutiveSummary.js +6 -10
  12. package/lib/tax-axis/components/clientReport/Methodology.js +2 -2
  13. package/lib/tax-axis/components/clientReport/RecommendedStrategies.d.ts +1 -6
  14. package/lib/tax-axis/components/clientReport/RecommendedStrategies.js +24 -26
  15. package/lib/tax-axis/components/clientReport/StrategyCard.d.ts +1 -1
  16. package/lib/tax-axis/components/clientReport/StrategyCard.js +23 -39
  17. package/lib/tax-axis/components/clientReport/TaxAxisClientReport.d.ts +2 -8
  18. package/lib/tax-axis/components/clientReport/TaxAxisClientReport.js +7 -9
  19. package/lib/tax-axis/components/dashboard/DashboardActions.js +5 -6
  20. package/lib/tax-axis/components/dashboard/DashboardSummary.d.ts +1 -6
  21. package/lib/tax-axis/components/dashboard/DashboardSummary.js +10 -19
  22. package/lib/tax-axis/components/dashboard/StrategyDetailPanel.d.ts +1 -1
  23. package/lib/tax-axis/components/dashboard/StrategyDetailPanel.js +95 -122
  24. package/lib/tax-axis/components/dashboard/TaxAxisDashboard.d.ts +2 -59
  25. package/lib/tax-axis/components/dashboard/TaxAxisDashboard.js +49 -433
  26. package/lib/tax-axis/components/documents/DocumentCard.d.ts +3 -8
  27. package/lib/tax-axis/components/documents/DocumentCard.js +14 -83
  28. package/lib/tax-axis/components/documents/DocumentTier.d.ts +2 -5
  29. package/lib/tax-axis/components/documents/DocumentTier.js +2 -2
  30. package/lib/tax-axis/components/documents/TaxAxisDocuments.d.ts +1 -36
  31. package/lib/tax-axis/components/documents/TaxAxisDocuments.js +86 -363
  32. package/lib/tax-axis/components/extractionReview/TaxAxisExtractionReview.js +17 -17
  33. package/lib/tax-axis/components/intake/ClientParametersSection.js +30 -14
  34. package/lib/tax-axis/components/intake/CpaIntakeQuestionsSection.js +3 -3
  35. package/lib/tax-axis/components/intake/IntakeCtaCards.d.ts +2 -1
  36. package/lib/tax-axis/components/intake/IntakeCtaCards.js +13 -6
  37. package/lib/tax-axis/components/intake/RefineAnalysisSection.js +7 -7
  38. package/lib/tax-axis/components/intake/TaxAxisIntake.js +45 -6
  39. package/lib/tax-axis/components/intake/intakeSchema.d.ts +3 -0
  40. package/lib/tax-axis/components/intake/intakeSchema.js +4 -2
  41. package/lib/tax-axis/components/preparerWorkpaper/TaxAxisPreparerWorkpaper.d.ts +2 -26
  42. package/lib/tax-axis/components/preparerWorkpaper/TaxAxisPreparerWorkpaper.js +4 -15
  43. package/lib/tax-axis/components/processing/TaxAxisProcessing.d.ts +1 -3
  44. package/lib/tax-axis/components/processing/TaxAxisProcessing.js +31 -102
  45. package/lib/tax-axis/components/prospectReport/ProspectPrintView.js +2 -0
  46. package/lib/tax-axis/components/prospectReport/ProspectStrategyCard.d.ts +8 -1
  47. package/lib/tax-axis/components/prospectReport/ProspectStrategyCard.js +5 -5
  48. package/lib/tax-axis/components/prospectReport/TaxAxisProspectReport.d.ts +27 -1
  49. package/lib/tax-axis/components/prospectReport/TaxAxisProspectReport.js +43 -25
  50. package/lib/tax-axis/index.d.ts +0 -4
  51. package/lib/tax-axis/index.js +1 -6
  52. package/lib/tax-axis/lib/adapters/useEngineOutput.d.ts +13 -138
  53. package/lib/tax-axis/lib/adapters/useEngineOutput.js +7 -156
  54. package/lib/tax-axis/lib/data/documents.d.ts +2 -3
  55. package/lib/tax-axis/lib/data/documents.js +25 -225
  56. package/lib/tax-axis/lib/data/strategies.js +9 -9
  57. package/lib/tax-axis/lib/documentFieldCatalog.d.ts +12 -7
  58. package/lib/tax-axis/lib/documentFieldCatalog.js +8 -805
  59. package/lib/tax-axis/lib/types/index.d.ts +1 -13
  60. package/package.json +1 -1
@@ -26,25 +26,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.TaxAxisProcessing = TaxAxisProcessing;
27
27
  const react_1 = __importStar(require("react"));
28
28
  const ProcessingStages_1 = require("./ProcessingStages");
29
- const CRAWL_CEILING = 99; // pause here until reportReady
30
- const CRAWL_TICK_MS = 300; // interval between crawl ticks
31
- const CRAWL_STEP = 0.27; // % added each tick → 0.27 / 0.3s = 0.9%/s
32
- const FINISH_MS = 400; // ms to animate from 99% → 100% once ready
33
- const STAGE_ADVANCE_MS = 3200; // how often the displayed stage advances
34
29
  function buildStages(profile) {
35
30
  var _a;
36
31
  if (!profile) {
37
32
  return [
38
33
  "Parsing source documents",
39
34
  "Injecting IRS 2026 parameters",
40
- "Screening eligible strategies",
35
+ "Screening 25 eligible strategies",
41
36
  "Computing deterministic tax math",
42
37
  "Generating IRS citations",
43
38
  ];
44
39
  }
45
- const entity = profile.entity || "your business";
40
+ const entity = profile.entity || "your";
46
41
  const stateCount = ((_a = profile.states) === null || _a === void 0 ? void 0 : _a.length) || 1;
47
42
  const bizName = profile.bizName || "your business";
43
+ // Verbatim from mock (App.jsx:1473-1477)
48
44
  const base = [
49
45
  "Parsing source documents",
50
46
  "Injecting IRS 2026 parameters",
@@ -57,120 +53,53 @@ function buildStages(profile) {
57
53
  if (entity === "S-Corporation") {
58
54
  base.push("Benchmarking officer salary against BLS data");
59
55
  }
60
- base.push("Screening 30 eligible strategies", "Computing deterministic tax math", "Cross-validating source documents", "Generating IRS citations", `Assembling TaxAxis report for ${bizName}`);
56
+ base.push("Screening 25 eligible strategies", "Computing deterministic tax math", "Cross-validating source documents", "Generating IRS citations", `Assembling TaxAxis report for ${bizName}`);
61
57
  return base;
62
58
  }
63
- function TaxAxisProcessing({ onComplete, profile, reportReady = false, userContext: _userContext = "expert", }) {
59
+ function TaxAxisProcessing({ onComplete, profile, userContext: _userContext = "expert", }) {
64
60
  const stages = (0, react_1.useMemo)(() => buildStages(profile), [profile]);
65
61
  const [progress, setProgress] = (0, react_1.useState)(0);
66
- const [stageIdx, setStageIdx] = (0, react_1.useState)(0);
67
- const finishingRef = (0, react_1.useRef)(false);
68
- const completedRef = (0, react_1.useRef)(false);
69
- // Track current progress in a ref so the finish animation can read it synchronously
70
- // without relying on the async functional-updater pattern.
71
- const progressRef = (0, react_1.useRef)(0);
72
- // ── Stall detection: show patience message after 35s of no progress change ──
73
- const [showPatience, setShowPatience] = (0, react_1.useState)(false);
74
- const lastProgressRef = (0, react_1.useRef)(0);
75
- const stallTimerRef = (0, react_1.useRef)(null);
62
+ // Staged timer from mock (App.jsx:1481). setInterval advances one stage
63
+ // per tick; after the final stage, a 1000ms delay fires onComplete.
64
+ // Target: ~8s total. Dynamic path: 10 stages × 700ms = 7s + 1s nav = 8s.
65
+ // Fallback path (no profile): 5 stages × 1400ms = 7s + 1s nav = 8s.
66
+ const stageInterval = stages.length <= 5 ? 1400 : 700;
76
67
  (0, react_1.useEffect)(() => {
77
- if (finishingRef.current) {
78
- setShowPatience(false);
79
- return;
80
- }
81
- if (progress !== lastProgressRef.current) {
82
- lastProgressRef.current = progress;
83
- setShowPatience(false);
84
- if (stallTimerRef.current)
85
- clearTimeout(stallTimerRef.current);
86
- stallTimerRef.current = setTimeout(() => {
87
- if (!finishingRef.current)
88
- setShowPatience(true);
89
- }, 8000);
90
- }
91
- return () => {
92
- if (stallTimerRef.current)
93
- clearTimeout(stallTimerRef.current);
94
- };
95
- }, [progress]);
96
- const setProgressSync = (v) => {
97
- progressRef.current = v;
98
- setProgress(v);
99
- };
100
- // ── Crawl: 0 → 80% — skipped entirely if reportReady already true on mount ──
101
- (0, react_1.useEffect)(() => {
102
- if (reportReady || finishingRef.current)
103
- return;
68
+ let i = 0;
69
+ let navTimer = null;
104
70
  const iv = setInterval(() => {
105
- if (finishingRef.current) {
106
- clearInterval(iv);
107
- return;
108
- }
109
- const next = Math.min(progressRef.current + CRAWL_STEP, CRAWL_CEILING);
110
- setProgressSync(next);
111
- if (next >= CRAWL_CEILING)
71
+ i++;
72
+ setProgress(i);
73
+ if (i >= stages.length) {
112
74
  clearInterval(iv);
113
- }, CRAWL_TICK_MS);
114
- return () => clearInterval(iv);
115
- // reportReady intentionally in deps: if it arrives before mount effect runs, skip crawl
116
- }, [reportReady]);
117
- // ── Stage labels: advance every STAGE_ADVANCE_MS ─────────────────
118
- (0, react_1.useEffect)(() => {
119
- const iv = setInterval(() => {
120
- setStageIdx((i) => (i + 1 < stages.length ? i + 1 : i));
121
- }, STAGE_ADVANCE_MS);
122
- return () => clearInterval(iv);
123
- }, [stages.length]);
124
- // ── Finish: reportReady → fast fill to 100%, then onComplete ─────
125
- (0, react_1.useEffect)(() => {
126
- if (!reportReady || finishingRef.current || completedRef.current)
127
- return;
128
- finishingRef.current = true;
129
- setStageIdx(stages.length - 1);
130
- // Read current progress synchronously from ref — not from stale state closure
131
- const startPct = progressRef.current;
132
- const startTime = Date.now();
133
- const frame = () => {
134
- const elapsed = Date.now() - startTime;
135
- const t = Math.min(elapsed / FINISH_MS, 1);
136
- const eased = t < 1 ? t * (2 - t) : 1;
137
- setProgressSync(startPct + (100 - startPct) * eased);
138
- if (t < 1) {
139
- requestAnimationFrame(frame);
140
- }
141
- else {
142
- setProgressSync(100);
143
- if (!completedRef.current) {
144
- completedRef.current = true;
145
- setTimeout(onComplete, 150);
146
- }
75
+ navTimer = setTimeout(onComplete, 1000);
147
76
  }
77
+ }, stageInterval);
78
+ return () => {
79
+ clearInterval(iv);
80
+ if (navTimer !== null)
81
+ clearTimeout(navTimer);
148
82
  };
149
- requestAnimationFrame(frame);
150
- // eslint-disable-next-line react-hooks/exhaustive-deps
151
- }, [reportReady, stages.length]);
152
- const pct = Math.round(progress);
153
- const title = (profile === null || profile === void 0 ? void 0 : profile.bizName) ? `Analyzing ${profile.bizName}` : "Running Analysis";
154
- const isFinishing = finishingRef.current;
83
+ }, [stages.length, stageInterval, onComplete]);
84
+ const pct = Math.round((progress / stages.length) * 100);
85
+ const title = (profile === null || profile === void 0 ? void 0 : profile.bizName)
86
+ ? `Analyzing ${profile.bizName}`
87
+ : "Running Analysis";
155
88
  return (react_1.default.createElement("div", { className: "pt-[60px] text-center" },
156
89
  react_1.default.createElement("div", { className: "relative w-[72px] h-[72px] mx-auto mb-7" },
157
90
  react_1.default.createElement("div", { className: "absolute inset-0 rounded-full animate-ping", style: {
158
91
  background: "radial-gradient(circle, #248384, transparent 70%)",
159
92
  opacity: 0.15,
160
- animationDuration: isFinishing ? "0.4s" : "1.4s",
161
93
  } }),
162
94
  react_1.default.createElement("div", { className: "absolute inset-0 w-[72px] h-[72px] rounded-full bg-tax-axis-surface flex items-center justify-center", style: { border: "2px solid rgba(36,131,132,0.4)" } },
163
- react_1.default.createElement("span", { className: "font-bold text-tax-axis-teal-light font-tax-axis-mono", style: { fontSize: pct === 100 ? 20 : 28 } }, pct === 100 ? "✓" : pct))),
95
+ react_1.default.createElement("span", { className: "text-[28px] font-bold text-tax-axis-teal-light font-tax-axis-mono" }, pct))),
164
96
  react_1.default.createElement("h2", { className: "text-[22px] font-bold text-white font-tax-axis-head mb-1" }, title),
165
- react_1.default.createElement("p", { className: "text-[13px] text-tax-axis-text-3 font-tax-axis-body mb-7" }, isFinishing ? "Report ready — loading your results…" : "Deterministic · Temperature 0 · IRS-cited"),
97
+ react_1.default.createElement("p", { className: "text-[13px] text-tax-axis-text-3 font-tax-axis-body mb-7" }, "Deterministic \u00B7 Temperature 0 \u00B7 IRS-cited"),
166
98
  react_1.default.createElement("div", { className: "max-w-[360px] mx-auto mb-6 h-0.5 bg-tax-axis-surface-2 rounded-sm overflow-hidden" },
167
- react_1.default.createElement("div", { className: "h-full rounded-sm", style: {
168
- width: `${progress}%`,
99
+ react_1.default.createElement("div", { className: "h-full rounded-sm transition-[width] duration-[400ms]", style: {
100
+ width: `${pct}%`,
169
101
  background: "linear-gradient(90deg, #248384, #A1E5E6)",
170
102
  boxShadow: "0 0 8px #248384",
171
- transition: isFinishing ? "none" : "width 0.18s linear",
172
103
  } })),
173
- react_1.default.createElement(ProcessingStages_1.ProcessingStages, { stages: stages, progress: stageIdx + 1 }),
174
- pct >= CRAWL_CEILING && !isFinishing && (react_1.default.createElement("p", { className: "text-[11px] text-tax-axis-text-4 font-tax-axis-mono mt-4 animate-pulse" }, "Finalizing analysis\u2026")),
175
- showPatience && !isFinishing && (react_1.default.createElement("p", { className: "text-[13px] text-tax-axis-text-3 font-tax-axis-body mt-4 text-center" }, "Still running \u2014 document analysis typically takes 2\u20133 minutes. Do not navigate away."))));
104
+ react_1.default.createElement(ProcessingStages_1.ProcessingStages, { stages: stages, progress: progress })));
176
105
  }
@@ -16,6 +16,8 @@ function ProspectPrintView({ profile, bizName, displayLo, displayHi, currentTax,
16
16
  body * { visibility: hidden !important; }
17
17
  .prospect-print-root, .prospect-print-root * { visibility: visible !important; }
18
18
  .prospect-print-root { position: absolute !important; left: 0 !important; top: 0 !important; width: 100% !important; }
19
+ body, p, span, div, td, th, li { color: #212529 !important; }
20
+ h1, h2, h3, h4, h5, h6, strong, b { color: #060821 !important; }
19
21
  .no-print { display: none !important; }
20
22
  }
21
23
  `),
@@ -1,10 +1,17 @@
1
1
  import React from "react";
2
2
  import type { Strategy, ClientProfile, ComputedMap } from "../../lib/types";
3
+ interface BackendNarrative {
4
+ whyThisMatters: string;
5
+ howSavingsBreakDown: string;
6
+ whyYouNeedSpecialist: string;
7
+ whatWeDoNext: string;
8
+ }
3
9
  interface ProspectStrategyCardProps {
4
10
  strategy: Strategy;
5
11
  index: number;
6
12
  profile: ClientProfile;
7
13
  computed: ComputedMap;
14
+ backendNarrative?: BackendNarrative | null;
8
15
  }
9
- export declare function ProspectStrategyCard({ strategy: s, index: i, profile, computed }: ProspectStrategyCardProps): React.JSX.Element;
16
+ export declare function ProspectStrategyCard({ strategy: s, index: i, profile, computed, backendNarrative }: ProspectStrategyCardProps): React.JSX.Element;
10
17
  export {};
@@ -8,15 +8,15 @@ const react_1 = __importDefault(require("react"));
8
8
  const strategyNarrative_1 = require("../../lib/data/strategyNarrative");
9
9
  const strategyProspect_1 = require("../../lib/data/strategyProspect");
10
10
  const theme_1 = require("./theme");
11
- function ProspectStrategyCard({ strategy: s, index: i, profile, computed }) {
11
+ function ProspectStrategyCard({ strategy: s, index: i, profile, computed, backendNarrative }) {
12
12
  var _a, _b;
13
13
  const p = strategyProspect_1.STRATEGY_PROSPECT[s.rank];
14
14
  const narr = strategyNarrative_1.STRATEGY_NARRATIVE[s.rank];
15
15
  const c = computed.get(s.rank);
16
- const whyText = narr ? narr.whyMatters(profile) : strategyNarrative_1.NARRATIVE_FALLBACK.whyMatters(s);
17
- const breakdownText = narr ? narr.breakdown(profile, c) : strategyNarrative_1.NARRATIVE_FALLBACK.breakdown(s, c);
18
- const specialistText = (narr === null || narr === void 0 ? void 0 : narr.whySpecialist) || strategyNarrative_1.NARRATIVE_FALLBACK.whySpecialist(s);
19
- const nextText = narr ? narr.nextSteps : strategyNarrative_1.NARRATIVE_FALLBACK.nextSteps(s);
16
+ const whyText = (backendNarrative === null || backendNarrative === void 0 ? void 0 : backendNarrative.whyThisMatters) || (narr ? narr.whyMatters(profile) : strategyNarrative_1.NARRATIVE_FALLBACK.whyMatters(s));
17
+ const breakdownText = (backendNarrative === null || backendNarrative === void 0 ? void 0 : backendNarrative.howSavingsBreakDown) || (narr ? narr.breakdown(profile, c) : strategyNarrative_1.NARRATIVE_FALLBACK.breakdown(s, c));
18
+ const specialistText = (backendNarrative === null || backendNarrative === void 0 ? void 0 : backendNarrative.whyYouNeedSpecialist) || (narr === null || narr === void 0 ? void 0 : narr.whySpecialist) || strategyNarrative_1.NARRATIVE_FALLBACK.whySpecialist(s);
19
+ const nextText = (backendNarrative === null || backendNarrative === void 0 ? void 0 : backendNarrative.whatWeDoNext) || (narr ? narr.nextSteps : strategyNarrative_1.NARRATIVE_FALLBACK.nextSteps(s));
20
20
  const scaledLo = Math.round(((_a = c === null || c === void 0 ? void 0 : c.lo) !== null && _a !== void 0 ? _a : s.lo) / 1000);
21
21
  const scaledHi = Math.round(((_b = c === null || c === void 0 ? void 0 : c.hi) !== null && _b !== void 0 ? _b : s.hi) / 1000);
22
22
  return (react_1.default.createElement("div", { style: { background: theme_1.T.surface, border: `1px solid ${theme_1.T.border}`, borderRadius: 14, padding: "24px 28px", boxShadow: theme_1.T.shadow } },
@@ -1,9 +1,35 @@
1
1
  import React from "react";
2
2
  import type { ClientProfile, TaxAxisScreenProps } from "../../lib/types";
3
+ export interface BackendProspectResults {
4
+ sessionId: string;
5
+ strategies: Array<{
6
+ strategyId: string;
7
+ strategyName: string;
8
+ priorityTier: string;
9
+ savingsLo: number;
10
+ savingsHi: number;
11
+ score: number;
12
+ quickWin: boolean;
13
+ timeline: string;
14
+ ircCite: string;
15
+ narrative: {
16
+ whyThisMatters: string;
17
+ howSavingsBreakDown: string;
18
+ whyYouNeedSpecialist: string;
19
+ whatWeDoNext: string;
20
+ };
21
+ }>;
22
+ executiveSummary: string;
23
+ totalSavingsLo: number;
24
+ totalSavingsHi: number;
25
+ eligibleCount: number;
26
+ generatedAt: string;
27
+ }
3
28
  export interface TaxAxisProspectReportProps extends TaxAxisScreenProps {
4
29
  profile: ClientProfile;
30
+ backendResults?: BackendProspectResults | null;
5
31
  onUpgrade?: () => void;
6
32
  onPresent?: () => void;
7
33
  onReset?: () => void;
8
34
  }
9
- export declare function TaxAxisProspectReport({ profile, onUpgrade, onPresent, onReset, }: TaxAxisProspectReportProps): React.JSX.Element;
35
+ export declare function TaxAxisProspectReport({ profile, backendResults, onUpgrade, onPresent, onReset, }: TaxAxisProspectReportProps): React.JSX.Element;
@@ -35,10 +35,24 @@ const SampleAnalysisPreview_1 = require("./SampleAnalysisPreview");
35
35
  const ProspectDocuments_1 = require("./ProspectDocuments");
36
36
  const ProspectNextSteps_1 = require("./ProspectNextSteps");
37
37
  const ProspectPrintView_1 = require("./ProspectPrintView");
38
- function TaxAxisProspectReport({ profile, onUpgrade, onPresent, onReset, }) {
38
+ function TaxAxisProspectReport({ profile, backendResults, onUpgrade, onPresent, onReset, }) {
39
39
  const bizName = profile.bizName || "Client";
40
40
  const [confirmReset, setConfirmReset] = (0, react_1.useState)(false);
41
41
  const [printMode, setPrintMode] = (0, react_1.useState)(false);
42
+ // ═══ BACKEND NARRATIVE LOOKUP ═══
43
+ // Build a map from strategy rank (number) to backend narrative when available.
44
+ // strategyId format: "S1", "S2", etc.
45
+ const narrativeLookup = (0, react_1.useMemo)(() => {
46
+ if (!(backendResults === null || backendResults === void 0 ? void 0 : backendResults.strategies))
47
+ return null;
48
+ const map = new Map();
49
+ for (const s of backendResults.strategies) {
50
+ const rank = parseInt(s.strategyId.replace("S", ""), 10);
51
+ if (!isNaN(rank))
52
+ map.set(rank, s.narrative);
53
+ }
54
+ return map;
55
+ }, [backendResults]);
42
56
  // ═══ ELIGIBLE STRATEGIES ═══
43
57
  const eligible = (0, react_1.useMemo)(() => (0, compute_1.filterEligibleStrategies)(profile), [profile]);
44
58
  const high = eligible.filter(s => s.priority === "HIGH");
@@ -109,29 +123,30 @@ function TaxAxisProspectReport({ profile, onUpgrade, onPresent, onReset, }) {
109
123
  react_1.default.createElement("span", { style: { fontSize: 11, fontWeight: 700, color: theme_1.T.accent, fontFamily: theme_1.T.mono } }, "01"),
110
124
  react_1.default.createElement("span", { style: { fontSize: 11, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.12em", color: theme_1.T.text4, fontFamily: theme_1.T.body } }, "EXECUTIVE SUMMARY")),
111
125
  react_1.default.createElement("div", { style: { height: 2, background: theme_1.T.accent, width: 48, marginBottom: 16 } }),
112
- react_1.default.createElement("div", { style: { fontSize: 14, color: theme_1.T.text2, fontFamily: theme_1.T.body, lineHeight: 1.8, marginBottom: 12 } },
113
- "We evaluated ",
114
- bizName,
115
- "'s tax position against 25 federal strategies and identified ",
116
- react_1.default.createElement("strong", { style: { color: theme_1.T.white } },
117
- eligible.length,
118
- " applicable opportunities"),
119
- " with combined estimated savings of ",
120
- react_1.default.createElement("strong", { style: { color: theme_1.T.accentLt } },
121
- "$",
122
- displayLo,
123
- "K\u2013$",
124
- displayHi,
125
- "K annually"),
126
- ". ",
127
- high.length,
128
- " strategies could have significant impact."),
129
- react_1.default.createElement("div", { style: { fontSize: 14, color: theme_1.T.text2, fontFamily: theme_1.T.body, lineHeight: 1.8 } },
130
- "The top ",
131
- top3.length,
132
- " strategies are detailed below.",
133
- quick.length > 0 ? ` ${quick.length} can be implemented this week with no structural changes.` : "",
134
- " These are profile-based estimates \u2014 uploading financial documents will refine savings calculations and unlock all 25 strategies.")),
126
+ (backendResults === null || backendResults === void 0 ? void 0 : backendResults.executiveSummary) ? (react_1.default.createElement("div", { style: { fontSize: 14, color: theme_1.T.text2, fontFamily: theme_1.T.body, lineHeight: 1.8 } }, backendResults.executiveSummary)) : (react_1.default.createElement(react_1.default.Fragment, null,
127
+ react_1.default.createElement("div", { style: { fontSize: 14, color: theme_1.T.text2, fontFamily: theme_1.T.body, lineHeight: 1.8, marginBottom: 12 } },
128
+ "We evaluated ",
129
+ bizName,
130
+ "'s tax position against 25 federal strategies and identified ",
131
+ react_1.default.createElement("strong", { style: { color: theme_1.T.white } },
132
+ eligible.length,
133
+ " applicable opportunities"),
134
+ " with combined estimated savings of ",
135
+ react_1.default.createElement("strong", { style: { color: theme_1.T.accentLt } },
136
+ "$",
137
+ displayLo,
138
+ "K\u2013$",
139
+ displayHi,
140
+ "K annually"),
141
+ ". ",
142
+ high.length,
143
+ " strategies could have significant impact."),
144
+ react_1.default.createElement("div", { style: { fontSize: 14, color: theme_1.T.text2, fontFamily: theme_1.T.body, lineHeight: 1.8 } },
145
+ "The top ",
146
+ top3.length,
147
+ " strategies are detailed below.",
148
+ quick.length > 0 ? ` ${quick.length} can be implemented this week with no structural changes.` : "",
149
+ " These are profile-based estimates \u2014 uploading financial documents will refine savings calculations and unlock all 25 strategies.")))),
135
150
  react_1.default.createElement("div", { style: { background: theme_1.T.surface, border: `1px solid ${theme_1.T.border}`, borderRadius: 14, padding: "20px 24px", marginBottom: 24, boxShadow: theme_1.T.shadow } },
136
151
  react_1.default.createElement("div", { style: { fontSize: 10, fontWeight: 700, color: theme_1.T.text4, textTransform: "uppercase", letterSpacing: "0.12em", marginBottom: 12, fontFamily: theme_1.T.mono } }, "SAVINGS DISTRIBUTION"),
137
152
  barData.map((b, i) => (react_1.default.createElement("div", { key: i, style: { display: "flex", alignItems: "center", gap: 10, marginBottom: i < barData.length - 1 ? 8 : 0 } },
@@ -151,7 +166,10 @@ function TaxAxisProspectReport({ profile, onUpgrade, onPresent, onReset, }) {
151
166
  react_1.default.createElement("span", { style: { fontSize: 11, fontWeight: 700, color: theme_1.T.accent, fontFamily: theme_1.T.mono } }, "02"),
152
167
  react_1.default.createElement("span", { style: { fontSize: 11, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.12em", color: theme_1.T.text4, fontFamily: theme_1.T.body } }, "RECOMMENDED STRATEGIES")),
153
168
  react_1.default.createElement("div", { style: { height: 2, background: theme_1.T.accent, width: 48, marginBottom: 16 } }),
154
- react_1.default.createElement("div", { style: { display: "flex", flexDirection: "column", gap: 14 } }, top3.map((s, i) => (react_1.default.createElement(ProspectStrategyCard_1.ProspectStrategyCard, { key: s.rank, strategy: s, index: i, profile: profile, computed: computed }))))),
169
+ react_1.default.createElement("div", { style: { display: "flex", flexDirection: "column", gap: 14 } }, top3.map((s, i) => {
170
+ var _a;
171
+ return (react_1.default.createElement(ProspectStrategyCard_1.ProspectStrategyCard, { key: s.rank, strategy: s, index: i, profile: profile, computed: computed, backendNarrative: (_a = narrativeLookup === null || narrativeLookup === void 0 ? void 0 : narrativeLookup.get(s.rank)) !== null && _a !== void 0 ? _a : null }));
172
+ }))),
155
173
  remaining > 0 && (react_1.default.createElement("div", { style: { marginBottom: 24 } },
156
174
  react_1.default.createElement("div", { style: { display: "flex", alignItems: "baseline", gap: 10, marginBottom: 6 } },
157
175
  react_1.default.createElement("span", { style: { fontSize: 11, fontWeight: 700, color: theme_1.T.accent, fontFamily: theme_1.T.mono } }, "03"),
@@ -5,14 +5,10 @@ export { SectionHeader } from "./components/shared/SectionHeader";
5
5
  export * from "./lib/types";
6
6
  export * from "./lib/data";
7
7
  export * from "./lib/compute";
8
- export { useEngineOutput } from "./lib/adapters/useEngineOutput";
9
- export type { EngineOutput, EngineOutputAdapterResult, EngineStrategyAnalysis, EngineCpaWorkflow } from "./lib/adapters/useEngineOutput";
10
8
  export { TaxAxisIntake } from "./components/intake/TaxAxisIntake";
11
9
  export type { TaxAxisIntakeProps } from "./components/intake/TaxAxisIntake";
12
10
  export { TaxAxisDocuments } from "./components/documents/TaxAxisDocuments";
13
11
  export type { TaxAxisDocumentsProps } from "./components/documents/TaxAxisDocuments";
14
- export { DocumentReviewModal } from "./components/documents/DocumentReviewModal";
15
- export type { DocumentReviewModalProps } from "./components/documents/DocumentReviewModal";
16
12
  export { TaxAxisProcessing } from "./components/processing/TaxAxisProcessing";
17
13
  export type { TaxAxisProcessingProps } from "./components/processing/TaxAxisProcessing";
18
14
  export { TaxAxisDashboard } from "./components/dashboard/TaxAxisDashboard";
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.TaxAxisPresentationMode = exports.TaxAxisProspectReport = exports.TaxAxisExtractionReview = exports.TaxAxisPreparerWorkpaper = exports.TaxAxisClientReport = exports.TaxAxisDashboard = exports.TaxAxisProcessing = exports.DocumentReviewModal = exports.TaxAxisDocuments = exports.TaxAxisIntake = exports.useEngineOutput = exports.SectionHeader = exports.TaxAxisButton = exports.TaxAxisBadge = exports.TaxAxisCard = void 0;
17
+ exports.TaxAxisPresentationMode = exports.TaxAxisProspectReport = exports.TaxAxisExtractionReview = exports.TaxAxisPreparerWorkpaper = exports.TaxAxisClientReport = exports.TaxAxisDashboard = exports.TaxAxisProcessing = exports.TaxAxisDocuments = exports.TaxAxisIntake = exports.SectionHeader = exports.TaxAxisButton = exports.TaxAxisBadge = exports.TaxAxisCard = void 0;
18
18
  // Shared primitives
19
19
  var TaxAxisCard_1 = require("./components/shared/TaxAxisCard");
20
20
  Object.defineProperty(exports, "TaxAxisCard", { enumerable: true, get: function () { return TaxAxisCard_1.TaxAxisCard; } });
@@ -30,16 +30,11 @@ __exportStar(require("./lib/types"), exports);
30
30
  __exportStar(require("./lib/data"), exports);
31
31
  // Compute
32
32
  __exportStar(require("./lib/compute"), exports);
33
- // Adapters
34
- var useEngineOutput_1 = require("./lib/adapters/useEngineOutput");
35
- Object.defineProperty(exports, "useEngineOutput", { enumerable: true, get: function () { return useEngineOutput_1.useEngineOutput; } });
36
33
  // Screens
37
34
  var TaxAxisIntake_1 = require("./components/intake/TaxAxisIntake");
38
35
  Object.defineProperty(exports, "TaxAxisIntake", { enumerable: true, get: function () { return TaxAxisIntake_1.TaxAxisIntake; } });
39
36
  var TaxAxisDocuments_1 = require("./components/documents/TaxAxisDocuments");
40
37
  Object.defineProperty(exports, "TaxAxisDocuments", { enumerable: true, get: function () { return TaxAxisDocuments_1.TaxAxisDocuments; } });
41
- var DocumentReviewModal_1 = require("./components/documents/DocumentReviewModal");
42
- Object.defineProperty(exports, "DocumentReviewModal", { enumerable: true, get: function () { return DocumentReviewModal_1.DocumentReviewModal; } });
43
38
  var TaxAxisProcessing_1 = require("./components/processing/TaxAxisProcessing");
44
39
  Object.defineProperty(exports, "TaxAxisProcessing", { enumerable: true, get: function () { return TaxAxisProcessing_1.TaxAxisProcessing; } });
45
40
  var TaxAxisDashboard_1 = require("./components/dashboard/TaxAxisDashboard");
@@ -1,151 +1,26 @@
1
1
  import type { Strategy, ComputedMap } from "../types";
2
- export interface SourceDocumentRef {
3
- field_label: string;
4
- value_display: string;
5
- source_hint: string;
6
- }
7
- export interface EngineCalculationTrace {
8
- strategy_id: string;
9
- branch_executed: string | null;
10
- formula: string;
11
- inputs: Record<string, unknown>;
12
- result_gross: number | null;
13
- confidence_interval: {
14
- low: number;
15
- high: number;
16
- basis: string;
17
- } | null;
18
- position_strength: string;
19
- irs_cite: string;
20
- data_quality_flag: string | null;
21
- forms_required: string[];
22
- deadline_flag: string | null;
23
- amt_flag: boolean;
24
- source_documents?: SourceDocumentRef[];
25
- specialist_note?: string | null;
2
+ /** Raw engine output blob from the LLM run. */
3
+ export type EngineOutput = Record<string, unknown> | null;
4
+ /** Adapter result passed to client-report / preparer-workpaper components. */
5
+ export interface EngineOutputAdapterResult {
6
+ strategies: Strategy[];
7
+ computedMap: ComputedMap;
26
8
  }
9
+ /** Single strategy analysis entry from the engine. */
27
10
  export interface EngineStrategyAnalysis {
28
11
  strategy_id: string;
29
12
  strategy_name: string;
30
- priority_tier: "HIGH" | "MEDIUM" | "LOW" | "NOT_RECOMMENDED";
13
+ priority_tier: string;
31
14
  weighted_score: number;
32
- scores: {
33
- financial_impact: number;
34
- applicability: number;
35
- complexity: number;
36
- risk: number;
37
- cash_flow: number;
38
- };
39
15
  quick_win: boolean;
40
- calculation_trace: EngineCalculationTrace;
41
16
  engagement_recommendation: string;
42
- risk_disclosure: string | null;
43
- }
44
- export interface EngineClientSummaryStrategy {
45
- slot: number;
46
- strategy_name: string;
47
- savings_range: string;
48
- why_it_applies: string;
49
- next_step: string;
50
- quick_win_badge: boolean;
51
- deadline_flag?: string | null;
17
+ calculation_trace?: Record<string, unknown>;
18
+ [key: string]: unknown;
52
19
  }
20
+ /** CPA workflow section from the engine. */
53
21
  export interface EngineCpaWorkflow {
54
22
  workpaper_codes: string[] | null;
55
- section_6694_notices: Array<{
56
- strategy_id: string;
57
- position_strength: string;
58
- notice: string;
59
- }>;
60
- prior_year_flags: string[];
61
- conflict_of_interest_checklist: Array<{
62
- strategy_id: string;
63
- conflict_prompt: string;
64
- confirmed_no_conflict: boolean;
65
- }>;
66
23
  engagement_recommendations: string[];
24
+ [key: string]: unknown;
67
25
  }
68
- export interface EngineOutput {
69
- engagement_id: string;
70
- generated_at: string;
71
- algorithm_version: string;
72
- business_profile: {
73
- entity_type: string;
74
- industry: string;
75
- industry_vertical: string;
76
- states: string[];
77
- data_years: number;
78
- confidence_tier: string;
79
- effective_tax_rate: number | null;
80
- data_quality_flags: string[];
81
- };
82
- eligibility_screening: {
83
- excluded_strategies: Array<{
84
- strategy_id: string;
85
- status: "EXCLUDED";
86
- reason: string;
87
- irs_cite: string;
88
- }>;
89
- };
90
- strategy_analysis: EngineStrategyAnalysis[];
91
- strategy_interaction_warnings: Array<{
92
- strategy_pair: [string, string];
93
- warning_text: string;
94
- }>;
95
- implementation_roadmap: {
96
- quick_wins: Array<{
97
- strategy_id: string;
98
- action: string;
99
- deadline?: string | null;
100
- }>;
101
- immediate: Array<{
102
- strategy_id: string;
103
- action: string;
104
- deadline?: string | null;
105
- }>;
106
- thirty_day: Array<{
107
- strategy_id: string;
108
- action: string;
109
- deadline?: string | null;
110
- }>;
111
- ninety_day: Array<{
112
- strategy_id: string;
113
- action: string;
114
- deadline?: string | null;
115
- }>;
116
- annual: Array<{
117
- strategy_id: string;
118
- action: string;
119
- deadline?: string | null;
120
- }>;
121
- };
122
- cpa_workflow: EngineCpaWorkflow;
123
- client_summary: {
124
- opening: string;
125
- strategies: EngineClientSummaryStrategy[];
126
- data_quality_note: string | null;
127
- interaction_warning: string | null;
128
- closing: string;
129
- };
130
- risk_disclosures: string[];
131
- client_risk_disclosures: {
132
- accuracy_penalty_warning: string | null;
133
- applies_to_strategies: string[];
134
- };
135
- amt_flags: Array<{
136
- trigger: string;
137
- strategy_id: string;
138
- flag_text: string;
139
- }>;
140
- nexus_flags: Array<{
141
- state: string;
142
- nexus_type: string;
143
- flag_text: string;
144
- }>;
145
- }
146
- export interface EngineOutputAdapterResult {
147
- strategies: Strategy[];
148
- computedMap: ComputedMap;
149
- engineOutput: EngineOutput;
150
- }
151
- export declare function useEngineOutput(engineOutput: EngineOutput | null | undefined): EngineOutputAdapterResult | null;
26
+ export declare function useEngineOutput(_engineOutput: EngineOutput): EngineOutputAdapterResult | null;