@empoweredvote/ev-ui 0.4.5 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +802 -268
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +809 -265
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -3
package/dist/index.mjs
CHANGED
|
@@ -170,9 +170,9 @@ function RadarChartCore({
|
|
|
170
170
|
const fSize = adaptiveFontSize(longestLine, baseFSize);
|
|
171
171
|
const lineHeight = fSize * 1.1;
|
|
172
172
|
const dynamicLabelOffset = lines.length > 1 ? labelOffset + 8 : labelOffset;
|
|
173
|
-
const
|
|
174
|
-
const labelX = centerX +
|
|
175
|
-
let labelY = centerY -
|
|
173
|
+
const offset2 = radius + dynamicLabelOffset;
|
|
174
|
+
const labelX = centerX + offset2 * Math.sin(angle);
|
|
175
|
+
let labelY = centerY - offset2 * Math.cos(angle);
|
|
176
176
|
if (isTop && lines.length > 1) {
|
|
177
177
|
labelY -= (lines.length - 1) * lineHeight;
|
|
178
178
|
}
|
|
@@ -1757,8 +1757,622 @@ function PoliticianCard({
|
|
|
1757
1757
|
);
|
|
1758
1758
|
}
|
|
1759
1759
|
|
|
1760
|
+
// src/CompassCardHorizontal.jsx
|
|
1761
|
+
import React10, { useState as useState5, useEffect as useEffect5 } from "react";
|
|
1762
|
+
|
|
1763
|
+
// src/PlaceholderRadar.jsx
|
|
1764
|
+
import React6 from "react";
|
|
1765
|
+
function PlaceholderRadar({ size = 250, name = "" }) {
|
|
1766
|
+
const cx = size / 2;
|
|
1767
|
+
const cy = size / 2;
|
|
1768
|
+
const r = size / 2 * 0.65;
|
|
1769
|
+
const n = 8;
|
|
1770
|
+
const vertices = Array.from({ length: n }, (_, i) => {
|
|
1771
|
+
const a = 2 * Math.PI * i / n;
|
|
1772
|
+
return [cx + r * Math.sin(a), cy - r * Math.cos(a)];
|
|
1773
|
+
});
|
|
1774
|
+
const outerPts = vertices.map(([x, y]) => `${x},${y}`).join(" ");
|
|
1775
|
+
const midPts = vertices.map(([x, y]) => `${cx + (x - cx) * 0.6},${cy + (y - cy) * 0.6}`).join(" ");
|
|
1776
|
+
const innerPts = vertices.map(([x, y]) => `${cx + (x - cx) * 0.3},${cy + (y - cy) * 0.3}`).join(" ");
|
|
1777
|
+
return /* @__PURE__ */ React6.createElement(
|
|
1778
|
+
"svg",
|
|
1779
|
+
{
|
|
1780
|
+
width: size,
|
|
1781
|
+
height: size,
|
|
1782
|
+
viewBox: `0 0 ${size} ${size}`,
|
|
1783
|
+
role: "img",
|
|
1784
|
+
"aria-label": name ? `${name} \u2014 compass data unavailable` : "compass data unavailable",
|
|
1785
|
+
style: {
|
|
1786
|
+
backgroundColor: colorScales.teal["050"],
|
|
1787
|
+
borderRadius: borderRadius.sm,
|
|
1788
|
+
flexShrink: 0
|
|
1789
|
+
}
|
|
1790
|
+
},
|
|
1791
|
+
vertices.map(([x, y], i) => /* @__PURE__ */ React6.createElement(
|
|
1792
|
+
"line",
|
|
1793
|
+
{
|
|
1794
|
+
key: i,
|
|
1795
|
+
x1: cx,
|
|
1796
|
+
y1: cy,
|
|
1797
|
+
x2: x,
|
|
1798
|
+
y2: y,
|
|
1799
|
+
stroke: colorScales.gray["200"],
|
|
1800
|
+
strokeWidth: "1",
|
|
1801
|
+
strokeDasharray: "2 3",
|
|
1802
|
+
opacity: "0.6"
|
|
1803
|
+
}
|
|
1804
|
+
)),
|
|
1805
|
+
/* @__PURE__ */ React6.createElement(
|
|
1806
|
+
"polygon",
|
|
1807
|
+
{
|
|
1808
|
+
points: innerPts,
|
|
1809
|
+
fill: "none",
|
|
1810
|
+
stroke: colorScales.gray["200"],
|
|
1811
|
+
strokeWidth: "1",
|
|
1812
|
+
strokeDasharray: "2 3",
|
|
1813
|
+
opacity: "0.5"
|
|
1814
|
+
}
|
|
1815
|
+
),
|
|
1816
|
+
/* @__PURE__ */ React6.createElement(
|
|
1817
|
+
"polygon",
|
|
1818
|
+
{
|
|
1819
|
+
points: midPts,
|
|
1820
|
+
fill: "none",
|
|
1821
|
+
stroke: colorScales.gray["200"],
|
|
1822
|
+
strokeWidth: "1",
|
|
1823
|
+
strokeDasharray: "3 3",
|
|
1824
|
+
opacity: "0.6"
|
|
1825
|
+
}
|
|
1826
|
+
),
|
|
1827
|
+
/* @__PURE__ */ React6.createElement(
|
|
1828
|
+
"polygon",
|
|
1829
|
+
{
|
|
1830
|
+
points: outerPts,
|
|
1831
|
+
fill: "none",
|
|
1832
|
+
stroke: colorScales.gray["200"],
|
|
1833
|
+
strokeWidth: "1.5",
|
|
1834
|
+
strokeDasharray: "4 3"
|
|
1835
|
+
}
|
|
1836
|
+
)
|
|
1837
|
+
);
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1840
|
+
// src/CompassCardHorizontalMeta.jsx
|
|
1841
|
+
import React9 from "react";
|
|
1842
|
+
|
|
1843
|
+
// src/IconOverlay.jsx
|
|
1844
|
+
import React8, { useState as useState4 } from "react";
|
|
1845
|
+
import {
|
|
1846
|
+
useFloating,
|
|
1847
|
+
useHover,
|
|
1848
|
+
useFocus,
|
|
1849
|
+
useDismiss,
|
|
1850
|
+
useRole,
|
|
1851
|
+
useInteractions,
|
|
1852
|
+
FloatingPortal,
|
|
1853
|
+
offset,
|
|
1854
|
+
flip,
|
|
1855
|
+
shift,
|
|
1856
|
+
autoUpdate
|
|
1857
|
+
} from "@floating-ui/react";
|
|
1858
|
+
|
|
1859
|
+
// src/icons.js
|
|
1860
|
+
import React7 from "react";
|
|
1861
|
+
function BallotIcon({ size = 16, color = "currentColor" }) {
|
|
1862
|
+
return /* @__PURE__ */ React7.createElement(
|
|
1863
|
+
"svg",
|
|
1864
|
+
{
|
|
1865
|
+
width: size,
|
|
1866
|
+
height: size,
|
|
1867
|
+
viewBox: "0 0 24 24",
|
|
1868
|
+
fill: "none",
|
|
1869
|
+
stroke: color,
|
|
1870
|
+
strokeWidth: "2",
|
|
1871
|
+
strokeLinecap: "round",
|
|
1872
|
+
strokeLinejoin: "round",
|
|
1873
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1874
|
+
},
|
|
1875
|
+
/* @__PURE__ */ React7.createElement("path", { d: "m9 12 2 2 4-4" }),
|
|
1876
|
+
/* @__PURE__ */ React7.createElement("path", { d: "M5 7c0-1.1.9-2 2-2h10a2 2 0 0 1 2 2v12H5V7Z" }),
|
|
1877
|
+
/* @__PURE__ */ React7.createElement("path", { d: "M22 19H2" })
|
|
1878
|
+
);
|
|
1879
|
+
}
|
|
1880
|
+
function CompassIcon({ size = 16, color = "currentColor" }) {
|
|
1881
|
+
return /* @__PURE__ */ React7.createElement(
|
|
1882
|
+
"svg",
|
|
1883
|
+
{
|
|
1884
|
+
width: size,
|
|
1885
|
+
height: size,
|
|
1886
|
+
viewBox: "0 0 24 24",
|
|
1887
|
+
fill: "none",
|
|
1888
|
+
stroke: color,
|
|
1889
|
+
strokeWidth: "2",
|
|
1890
|
+
strokeLinecap: "round",
|
|
1891
|
+
strokeLinejoin: "round",
|
|
1892
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1893
|
+
},
|
|
1894
|
+
/* @__PURE__ */ React7.createElement("circle", { cx: "12", cy: "12", r: "10" }),
|
|
1895
|
+
/* @__PURE__ */ React7.createElement("path", { d: "m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z" })
|
|
1896
|
+
);
|
|
1897
|
+
}
|
|
1898
|
+
function BranchIcon({ size = 16, color = "currentColor", branch }) {
|
|
1899
|
+
let paths;
|
|
1900
|
+
switch (branch) {
|
|
1901
|
+
case "executive":
|
|
1902
|
+
paths = /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement("path", { d: "M3 21h18" }), /* @__PURE__ */ React7.createElement("path", { d: "M5 21V7l8-4v18" }), /* @__PURE__ */ React7.createElement("path", { d: "M19 21V11l-6-4" }), /* @__PURE__ */ React7.createElement("path", { d: "M9 9v.01" }), /* @__PURE__ */ React7.createElement("path", { d: "M9 12v.01" }), /* @__PURE__ */ React7.createElement("path", { d: "M9 15v.01" }), /* @__PURE__ */ React7.createElement("path", { d: "M9 18v.01" }), /* @__PURE__ */ React7.createElement("path", { d: "M5 21h14" }), /* @__PURE__ */ React7.createElement("line", { x1: "13", y1: "5", x2: "13", y2: "3" }), /* @__PURE__ */ React7.createElement("line", { x1: "13", y1: "3", x2: "15", y2: "4" }));
|
|
1903
|
+
break;
|
|
1904
|
+
case "legislative":
|
|
1905
|
+
paths = /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement("path", { d: "M8 21h12a2 2 0 0 0 2-2v-2H10v2a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v3h4" }), /* @__PURE__ */ React7.createElement("path", { d: "M19 17V5a2 2 0 0 0-2-2H4" }), /* @__PURE__ */ React7.createElement("path", { d: "M15 8h-5" }), /* @__PURE__ */ React7.createElement("path", { d: "M15 12h-5" }));
|
|
1906
|
+
break;
|
|
1907
|
+
case "judicial":
|
|
1908
|
+
paths = /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement("path", { d: "M12 3v19" }), /* @__PURE__ */ React7.createElement("path", { d: "M5 8l7-5 7 5" }), /* @__PURE__ */ React7.createElement("path", { d: "M3 13l2-5 2 5a3 3 0 0 1-4 0z" }), /* @__PURE__ */ React7.createElement("path", { d: "M17 13l2-5 2 5a3 3 0 0 1-4 0z" }), /* @__PURE__ */ React7.createElement("path", { d: "M8 21h8" }));
|
|
1909
|
+
break;
|
|
1910
|
+
default:
|
|
1911
|
+
paths = /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement("path", { d: "M10 18v-7" }), /* @__PURE__ */ React7.createElement("path", { d: "M11.12 2.198a2 2 0 0 1 1.76.006l7.866 3.847c.476.233.31.949-.22.949H3.474c-.53 0-.695-.716-.22-.949z" }), /* @__PURE__ */ React7.createElement("path", { d: "M14 18v-7" }), /* @__PURE__ */ React7.createElement("path", { d: "M18 18v-7" }), /* @__PURE__ */ React7.createElement("path", { d: "M3 22h18" }), /* @__PURE__ */ React7.createElement("path", { d: "M6 18v-7" }));
|
|
1912
|
+
break;
|
|
1913
|
+
}
|
|
1914
|
+
return /* @__PURE__ */ React7.createElement(
|
|
1915
|
+
"svg",
|
|
1916
|
+
{
|
|
1917
|
+
width: size,
|
|
1918
|
+
height: size,
|
|
1919
|
+
viewBox: "0 0 24 24",
|
|
1920
|
+
fill: "none",
|
|
1921
|
+
stroke: color,
|
|
1922
|
+
strokeWidth: "2",
|
|
1923
|
+
strokeLinecap: "round",
|
|
1924
|
+
strokeLinejoin: "round",
|
|
1925
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1926
|
+
},
|
|
1927
|
+
paths
|
|
1928
|
+
);
|
|
1929
|
+
}
|
|
1930
|
+
|
|
1931
|
+
// src/IconOverlay.jsx
|
|
1932
|
+
function IconWithTooltip({ IconComponent, color, tooltip, size = 14, extraProps = {}, onClick }) {
|
|
1933
|
+
const [isOpen, setIsOpen] = useState4(false);
|
|
1934
|
+
const { refs, floatingStyles, context } = useFloating({
|
|
1935
|
+
open: isOpen,
|
|
1936
|
+
onOpenChange: setIsOpen,
|
|
1937
|
+
middleware: [offset(8), flip(), shift({ padding: 4 })],
|
|
1938
|
+
whileElementsMounted: autoUpdate
|
|
1939
|
+
});
|
|
1940
|
+
const hover = useHover(context);
|
|
1941
|
+
const focus2 = useFocus(context);
|
|
1942
|
+
const dismiss = useDismiss(context);
|
|
1943
|
+
const role = useRole(context, { role: "tooltip" });
|
|
1944
|
+
const { getReferenceProps, getFloatingProps } = useInteractions([
|
|
1945
|
+
hover,
|
|
1946
|
+
focus2,
|
|
1947
|
+
dismiss,
|
|
1948
|
+
role
|
|
1949
|
+
]);
|
|
1950
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement(
|
|
1951
|
+
"span",
|
|
1952
|
+
{
|
|
1953
|
+
ref: refs.setReference,
|
|
1954
|
+
"aria-label": tooltip,
|
|
1955
|
+
tabIndex: 0,
|
|
1956
|
+
style: { display: "inline-flex", padding: spacing[1], ...onClick ? { cursor: "pointer" } : {} },
|
|
1957
|
+
...getReferenceProps(),
|
|
1958
|
+
onClick: onClick ? (e) => {
|
|
1959
|
+
e.stopPropagation();
|
|
1960
|
+
onClick(e);
|
|
1961
|
+
} : void 0
|
|
1962
|
+
},
|
|
1963
|
+
/* @__PURE__ */ React8.createElement(IconComponent, { size, color, ...extraProps })
|
|
1964
|
+
), isOpen && /* @__PURE__ */ React8.createElement(FloatingPortal, null, /* @__PURE__ */ React8.createElement(
|
|
1965
|
+
"div",
|
|
1966
|
+
{
|
|
1967
|
+
ref: refs.setFloating,
|
|
1968
|
+
style: {
|
|
1969
|
+
...floatingStyles,
|
|
1970
|
+
zIndex: 70,
|
|
1971
|
+
background: semanticTokens.light.tooltip.background,
|
|
1972
|
+
color: semanticTokens.light.tooltip.text,
|
|
1973
|
+
padding: "4px 8px",
|
|
1974
|
+
borderRadius: "6px",
|
|
1975
|
+
fontSize: "14px",
|
|
1976
|
+
fontFamily: "'Manrope', sans-serif",
|
|
1977
|
+
pointerEvents: "none",
|
|
1978
|
+
whiteSpace: "nowrap"
|
|
1979
|
+
},
|
|
1980
|
+
...getFloatingProps()
|
|
1981
|
+
},
|
|
1982
|
+
tooltip
|
|
1983
|
+
)));
|
|
1984
|
+
}
|
|
1985
|
+
function IconOverlay({ ballot, hasStances, branch, onCompassClick }) {
|
|
1986
|
+
if (!ballot && !hasStances && !branch) return null;
|
|
1987
|
+
const ballotTooltip = ballot ? `This seat is on your ballot \u2014 ${ballot.electionLabel}: ${new Date(ballot.electionDate).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" })}` : null;
|
|
1988
|
+
return /* @__PURE__ */ React8.createElement(
|
|
1989
|
+
"div",
|
|
1990
|
+
{
|
|
1991
|
+
style: {
|
|
1992
|
+
display: "flex",
|
|
1993
|
+
gap: 4,
|
|
1994
|
+
alignItems: "center",
|
|
1995
|
+
justifyContent: "flex-start",
|
|
1996
|
+
padding: 0,
|
|
1997
|
+
marginLeft: "-4px"
|
|
1998
|
+
// offset icon wrapper padding so icons align flush-left with text
|
|
1999
|
+
}
|
|
2000
|
+
},
|
|
2001
|
+
ballot && /* @__PURE__ */ React8.createElement(
|
|
2002
|
+
IconWithTooltip,
|
|
2003
|
+
{
|
|
2004
|
+
IconComponent: BallotIcon,
|
|
2005
|
+
color: colors.evMutedBlue,
|
|
2006
|
+
tooltip: ballotTooltip,
|
|
2007
|
+
size: 14
|
|
2008
|
+
}
|
|
2009
|
+
),
|
|
2010
|
+
hasStances && /* @__PURE__ */ React8.createElement(
|
|
2011
|
+
IconWithTooltip,
|
|
2012
|
+
{
|
|
2013
|
+
IconComponent: CompassIcon,
|
|
2014
|
+
color: colors.evMutedBlue,
|
|
2015
|
+
tooltip: "Compare your views",
|
|
2016
|
+
size: 14,
|
|
2017
|
+
onClick: onCompassClick
|
|
2018
|
+
}
|
|
2019
|
+
),
|
|
2020
|
+
branch && /* @__PURE__ */ React8.createElement(
|
|
2021
|
+
IconWithTooltip,
|
|
2022
|
+
{
|
|
2023
|
+
IconComponent: BranchIcon,
|
|
2024
|
+
color: colors.evMutedBlue,
|
|
2025
|
+
tooltip: `${branch} branch`,
|
|
2026
|
+
size: 14,
|
|
2027
|
+
extraProps: { branch: branch.toLowerCase() }
|
|
2028
|
+
}
|
|
2029
|
+
)
|
|
2030
|
+
);
|
|
2031
|
+
}
|
|
2032
|
+
|
|
2033
|
+
// src/CompassCardHorizontalMeta.jsx
|
|
2034
|
+
function CompassCardHorizontalMeta({
|
|
2035
|
+
politician,
|
|
2036
|
+
surface = "representatives",
|
|
2037
|
+
userAnswers
|
|
2038
|
+
}) {
|
|
2039
|
+
const titleText = surface === "elections" ? politician.office_running_for : politician.office_title;
|
|
2040
|
+
return /* @__PURE__ */ React9.createElement("div", { style: {
|
|
2041
|
+
flex: 1,
|
|
2042
|
+
minWidth: 0,
|
|
2043
|
+
display: "flex",
|
|
2044
|
+
flexDirection: "column",
|
|
2045
|
+
gap: spacing[1]
|
|
2046
|
+
} }, /* @__PURE__ */ React9.createElement("p", { style: {
|
|
2047
|
+
fontFamily: fonts.primary,
|
|
2048
|
+
fontSize: fontSizes.lg,
|
|
2049
|
+
fontWeight: fontWeights.semibold,
|
|
2050
|
+
lineHeight: 1.4,
|
|
2051
|
+
color: colors.evMutedBlue,
|
|
2052
|
+
margin: 0
|
|
2053
|
+
} }, politician.full_name), /* @__PURE__ */ React9.createElement("p", { style: {
|
|
2054
|
+
fontFamily: fonts.primary,
|
|
2055
|
+
fontSize: fontSizes.sm,
|
|
2056
|
+
fontWeight: fontWeights.semibold,
|
|
2057
|
+
lineHeight: 1.4,
|
|
2058
|
+
color: colors.textSecondary,
|
|
2059
|
+
margin: 0,
|
|
2060
|
+
overflow: "hidden",
|
|
2061
|
+
display: "-webkit-box",
|
|
2062
|
+
WebkitLineClamp: 2,
|
|
2063
|
+
WebkitBoxOrient: "vertical"
|
|
2064
|
+
} }, titleText || ""), politician.district_label && /* @__PURE__ */ React9.createElement("p", { style: {
|
|
2065
|
+
fontFamily: fonts.primary,
|
|
2066
|
+
fontSize: fontSizes.sm,
|
|
2067
|
+
fontWeight: fontWeights.regular,
|
|
2068
|
+
lineHeight: 1.5,
|
|
2069
|
+
color: colors.textMuted,
|
|
2070
|
+
margin: 0,
|
|
2071
|
+
overflow: "hidden",
|
|
2072
|
+
textOverflow: "ellipsis",
|
|
2073
|
+
whiteSpace: "nowrap"
|
|
2074
|
+
} }, politician.district_label), /* @__PURE__ */ React9.createElement(
|
|
2075
|
+
IconOverlay,
|
|
2076
|
+
{
|
|
2077
|
+
ballot: politician.ballot || null,
|
|
2078
|
+
hasStances: Boolean(userAnswers && userAnswers.length > 0) || Boolean(politician.hasStances),
|
|
2079
|
+
branch: politician.branch || null
|
|
2080
|
+
}
|
|
2081
|
+
));
|
|
2082
|
+
}
|
|
2083
|
+
|
|
2084
|
+
// src/compassHelpers.js
|
|
2085
|
+
function buildAnswerMapByShortTitle(allTopics, allAnswers, allowedShorts) {
|
|
2086
|
+
var _a;
|
|
2087
|
+
const allowed = new Set(allowedShorts.map((s) => s.toLowerCase()));
|
|
2088
|
+
const topicById = new Map(allTopics.map((t) => [t.id, t]));
|
|
2089
|
+
const shortById = new Map(allTopics.map((t) => [t.id, t.short_title]));
|
|
2090
|
+
const out = {};
|
|
2091
|
+
const topicByShortLower = new Map(allTopics.map((t) => [t.short_title.toLowerCase(), t]));
|
|
2092
|
+
for (const s of allowedShorts) {
|
|
2093
|
+
const t = topicByShortLower.get(s.toLowerCase());
|
|
2094
|
+
if (t) out[t.short_title] = 0;
|
|
2095
|
+
}
|
|
2096
|
+
for (const a of allAnswers) {
|
|
2097
|
+
const st = shortById.get(a.topic_id);
|
|
2098
|
+
if (!st) continue;
|
|
2099
|
+
if (allowed.has(String(st).toLowerCase())) {
|
|
2100
|
+
out[st] = (_a = a.value) != null ? _a : 0;
|
|
2101
|
+
}
|
|
2102
|
+
}
|
|
2103
|
+
const topicByShort = new Map(allTopics.map((t) => [t.short_title.toLowerCase(), t]));
|
|
2104
|
+
const topicsFiltered = allowedShorts.map((s) => topicByShort.get(s.toLowerCase())).filter(Boolean);
|
|
2105
|
+
return { topicsFiltered, answersByShort: out };
|
|
2106
|
+
}
|
|
2107
|
+
|
|
2108
|
+
// src/CompassCardHorizontal.jsx
|
|
2109
|
+
var RADAR_SIZE = 250;
|
|
2110
|
+
var SLOT_WIDTH = 260;
|
|
2111
|
+
function CompassCardHorizontal({
|
|
2112
|
+
politician,
|
|
2113
|
+
userAnswers = null,
|
|
2114
|
+
tierVisuals = null,
|
|
2115
|
+
view = "compass",
|
|
2116
|
+
surface = "representatives",
|
|
2117
|
+
variant = "compass",
|
|
2118
|
+
onBuildCompass = null,
|
|
2119
|
+
onClick
|
|
2120
|
+
}) {
|
|
2121
|
+
var _a;
|
|
2122
|
+
const [hovered, setHovered] = useState5(false);
|
|
2123
|
+
const [focused, setFocused] = useState5(false);
|
|
2124
|
+
const [imgError, setImgError] = useState5(false);
|
|
2125
|
+
const [emptyCtaHovered, setEmptyCtaHovered] = useState5(false);
|
|
2126
|
+
useEffect5(() => {
|
|
2127
|
+
setImgError(false);
|
|
2128
|
+
}, [politician == null ? void 0 : politician.photo_origin_url]);
|
|
2129
|
+
const cardStyle = {
|
|
2130
|
+
position: "relative",
|
|
2131
|
+
display: "flex",
|
|
2132
|
+
flexDirection: "row",
|
|
2133
|
+
alignItems: "center",
|
|
2134
|
+
backgroundColor: (_a = tierVisuals == null ? void 0 : tierVisuals.bg) != null ? _a : colors.bgWhite,
|
|
2135
|
+
border: `1px solid ${colors.borderLight}`,
|
|
2136
|
+
borderRadius: borderRadius.xl,
|
|
2137
|
+
overflow: "hidden",
|
|
2138
|
+
// clips slot corners via card border-radius — no padding needed
|
|
2139
|
+
boxShadow: focused ? focus.ring : hovered ? shadows.cardHover : shadows.md,
|
|
2140
|
+
transform: hovered ? "translateY(-2px)" : "none",
|
|
2141
|
+
transition: `box-shadow ${duration.normal} ease, transform ${duration.normal} ease`,
|
|
2142
|
+
cursor: onClick ? "pointer" : "default",
|
|
2143
|
+
fontFamily: fonts.primary,
|
|
2144
|
+
outline: "none"
|
|
2145
|
+
};
|
|
2146
|
+
const slotStyle = { width: SLOT_WIDTH, height: SLOT_WIDTH, flexShrink: 0, overflow: "hidden", position: "relative" };
|
|
2147
|
+
function renderCompass() {
|
|
2148
|
+
var _a2, _b, _c;
|
|
2149
|
+
if (!userAnswers || userAnswers.length === 0) {
|
|
2150
|
+
return /* @__PURE__ */ React10.createElement(PlaceholderRadar, { size: RADAR_SIZE, name: (politician == null ? void 0 : politician.full_name) || "" });
|
|
2151
|
+
}
|
|
2152
|
+
let topics = [];
|
|
2153
|
+
let data = {};
|
|
2154
|
+
let compareData = {};
|
|
2155
|
+
try {
|
|
2156
|
+
if (Array.isArray(userAnswers) && userAnswers.length > 0) {
|
|
2157
|
+
const hasEmbeddedTopics = (_b = (_a2 = userAnswers[0]) == null ? void 0 : _a2.topic) == null ? void 0 : _b.short_title;
|
|
2158
|
+
if (hasEmbeddedTopics) {
|
|
2159
|
+
const allowedShorts = userAnswers.map((a) => a.topic.short_title);
|
|
2160
|
+
const allTopics = userAnswers.map((a) => a.topic);
|
|
2161
|
+
const { topicsFiltered, answersByShort } = buildAnswerMapByShortTitle(
|
|
2162
|
+
allTopics,
|
|
2163
|
+
userAnswers,
|
|
2164
|
+
allowedShorts
|
|
2165
|
+
);
|
|
2166
|
+
topics = topicsFiltered;
|
|
2167
|
+
data = answersByShort;
|
|
2168
|
+
} else {
|
|
2169
|
+
if (!Array.isArray(userAnswers[0])) {
|
|
2170
|
+
topics = userAnswers.filter((a) => a.short_title).map((a) => ({ id: a.topic_id || a.short_title, short_title: a.short_title, title: a.short_title }));
|
|
2171
|
+
data = {};
|
|
2172
|
+
for (const a of userAnswers) {
|
|
2173
|
+
if (a.short_title) data[a.short_title] = (_c = a.value) != null ? _c : 0;
|
|
2174
|
+
}
|
|
2175
|
+
}
|
|
2176
|
+
}
|
|
2177
|
+
}
|
|
2178
|
+
if ((politician == null ? void 0 : politician.stances) && typeof politician.stances === "object") {
|
|
2179
|
+
compareData = Array.isArray(politician.stances) ? politician.stances.reduce((acc, s) => {
|
|
2180
|
+
var _a3;
|
|
2181
|
+
if (s.short_title) acc[s.short_title] = (_a3 = s.value) != null ? _a3 : 0;
|
|
2182
|
+
return acc;
|
|
2183
|
+
}, {}) : politician.stances;
|
|
2184
|
+
}
|
|
2185
|
+
if (topics.length === 0) {
|
|
2186
|
+
return /* @__PURE__ */ React10.createElement(PlaceholderRadar, { size: RADAR_SIZE, name: (politician == null ? void 0 : politician.full_name) || "" });
|
|
2187
|
+
}
|
|
2188
|
+
} catch (err) {
|
|
2189
|
+
return /* @__PURE__ */ React10.createElement(PlaceholderRadar, { size: RADAR_SIZE, name: (politician == null ? void 0 : politician.full_name) || "" });
|
|
2190
|
+
}
|
|
2191
|
+
return /* @__PURE__ */ React10.createElement(
|
|
2192
|
+
RadarChartCore,
|
|
2193
|
+
{
|
|
2194
|
+
topics,
|
|
2195
|
+
data,
|
|
2196
|
+
compareData,
|
|
2197
|
+
invertedSpokes: {},
|
|
2198
|
+
onToggleInversion: () => {
|
|
2199
|
+
},
|
|
2200
|
+
onReplaceTopic: () => {
|
|
2201
|
+
},
|
|
2202
|
+
size: RADAR_SIZE,
|
|
2203
|
+
padding: 20,
|
|
2204
|
+
labelOffset: 5,
|
|
2205
|
+
labelFontSize: 12
|
|
2206
|
+
}
|
|
2207
|
+
);
|
|
2208
|
+
}
|
|
2209
|
+
function renderPortrait() {
|
|
2210
|
+
var _a2, _b, _c;
|
|
2211
|
+
const imageSrc = (politician == null ? void 0 : politician.photo_origin_url) || (politician == null ? void 0 : politician.images) && ((_a2 = politician.images[0]) == null ? void 0 : _a2.url) || null;
|
|
2212
|
+
if (imageSrc && !imgError) {
|
|
2213
|
+
return /* @__PURE__ */ React10.createElement(
|
|
2214
|
+
"img",
|
|
2215
|
+
{
|
|
2216
|
+
src: imageSrc,
|
|
2217
|
+
alt: `${politician.full_name} portrait`,
|
|
2218
|
+
style: {
|
|
2219
|
+
width: "100%",
|
|
2220
|
+
height: "100%",
|
|
2221
|
+
objectFit: "cover",
|
|
2222
|
+
objectPosition: (_b = politician.imageFocalPoint) != null ? _b : "center 20%",
|
|
2223
|
+
display: "block"
|
|
2224
|
+
},
|
|
2225
|
+
onError: () => setImgError(true)
|
|
2226
|
+
}
|
|
2227
|
+
);
|
|
2228
|
+
}
|
|
2229
|
+
const parts = ((politician == null ? void 0 : politician.full_name) || "").split(" ").filter(Boolean);
|
|
2230
|
+
const initials = (parts.length >= 2 ? parts[0][0] + parts[parts.length - 1][0] : ((_c = parts[0]) == null ? void 0 : _c[0]) || "?").toUpperCase();
|
|
2231
|
+
return /* @__PURE__ */ React10.createElement("div", { style: {
|
|
2232
|
+
width: "100%",
|
|
2233
|
+
height: "100%",
|
|
2234
|
+
backgroundColor: colors.evMutedBlue,
|
|
2235
|
+
color: colors.textWhite,
|
|
2236
|
+
display: "flex",
|
|
2237
|
+
alignItems: "center",
|
|
2238
|
+
justifyContent: "center",
|
|
2239
|
+
fontFamily: fonts.primary,
|
|
2240
|
+
fontWeight: fontWeights.bold,
|
|
2241
|
+
fontSize: fontSizes["4xl"]
|
|
2242
|
+
} }, initials);
|
|
2243
|
+
}
|
|
2244
|
+
function renderEmptyVariant() {
|
|
2245
|
+
return /* @__PURE__ */ React10.createElement("div", { style: {
|
|
2246
|
+
width: "100%",
|
|
2247
|
+
height: "100%",
|
|
2248
|
+
display: "flex",
|
|
2249
|
+
flexDirection: "column",
|
|
2250
|
+
alignItems: "center",
|
|
2251
|
+
justifyContent: "center",
|
|
2252
|
+
gap: "8px",
|
|
2253
|
+
padding: "12px 14px",
|
|
2254
|
+
boxSizing: "border-box",
|
|
2255
|
+
backgroundColor: colorScales.teal["050"]
|
|
2256
|
+
} }, /* @__PURE__ */ React10.createElement(PlaceholderRadar, { size: 140, name: (politician == null ? void 0 : politician.full_name) || "" }), /* @__PURE__ */ React10.createElement("p", { style: {
|
|
2257
|
+
margin: 0,
|
|
2258
|
+
fontSize: fontSizes.xs,
|
|
2259
|
+
color: colors.textMuted,
|
|
2260
|
+
textAlign: "center",
|
|
2261
|
+
lineHeight: 1.4,
|
|
2262
|
+
fontFamily: fonts.primary
|
|
2263
|
+
} }, "Calibrate your compass to see how you align with ", (politician == null ? void 0 : politician.full_name) || "this official"), /* @__PURE__ */ React10.createElement(
|
|
2264
|
+
"button",
|
|
2265
|
+
{
|
|
2266
|
+
type: "button",
|
|
2267
|
+
onClick: onBuildCompass || void 0,
|
|
2268
|
+
onMouseEnter: () => setEmptyCtaHovered(true),
|
|
2269
|
+
onMouseLeave: () => setEmptyCtaHovered(false),
|
|
2270
|
+
style: {
|
|
2271
|
+
minWidth: "160px",
|
|
2272
|
+
height: "40px",
|
|
2273
|
+
padding: "0 16px",
|
|
2274
|
+
backgroundColor: emptyCtaHovered ? semanticTokens.light.buttonPrimary.background.hovered : semanticTokens.light.buttonPrimary.background.default,
|
|
2275
|
+
color: colors.textWhite,
|
|
2276
|
+
fontSize: fontSizes.xs,
|
|
2277
|
+
fontWeight: fontWeights.semibold,
|
|
2278
|
+
fontFamily: fonts.primary,
|
|
2279
|
+
borderRadius: borderRadius.full,
|
|
2280
|
+
border: "none",
|
|
2281
|
+
cursor: onBuildCompass ? "pointer" : "default",
|
|
2282
|
+
whiteSpace: "nowrap",
|
|
2283
|
+
transition: `background ${duration.normal} ease`,
|
|
2284
|
+
flexShrink: 0
|
|
2285
|
+
}
|
|
2286
|
+
},
|
|
2287
|
+
"Calibrate your compass"
|
|
2288
|
+
));
|
|
2289
|
+
}
|
|
2290
|
+
function renderUnavailablePlate(message = "Compass currently unavailable for this role.") {
|
|
2291
|
+
return /* @__PURE__ */ React10.createElement("div", { style: {
|
|
2292
|
+
width: "100%",
|
|
2293
|
+
height: "100%",
|
|
2294
|
+
backgroundColor: colorScales.teal["050"],
|
|
2295
|
+
display: "flex",
|
|
2296
|
+
alignItems: "center",
|
|
2297
|
+
justifyContent: "center",
|
|
2298
|
+
padding: spacing[4],
|
|
2299
|
+
boxSizing: "border-box"
|
|
2300
|
+
} }, /* @__PURE__ */ React10.createElement("p", { style: {
|
|
2301
|
+
fontSize: fontSizes.sm,
|
|
2302
|
+
fontWeight: fontWeights.semibold,
|
|
2303
|
+
lineHeight: 1.4,
|
|
2304
|
+
color: colors.textMuted,
|
|
2305
|
+
textAlign: "center",
|
|
2306
|
+
maxWidth: "180px",
|
|
2307
|
+
margin: 0,
|
|
2308
|
+
fontFamily: fonts.primary
|
|
2309
|
+
} }, message));
|
|
2310
|
+
}
|
|
2311
|
+
function renderSlotContent() {
|
|
2312
|
+
if (view === "portrait") return renderPortrait();
|
|
2313
|
+
if (variant === "empty") return renderEmptyVariant();
|
|
2314
|
+
if (variant === "administrative" || variant === "judicial") return renderUnavailablePlate();
|
|
2315
|
+
if (variant === "no-stances") {
|
|
2316
|
+
const name = (politician == null ? void 0 : politician.full_name) || "this official";
|
|
2317
|
+
return renderUnavailablePlate(`No compass stances on file for ${name} yet.`);
|
|
2318
|
+
}
|
|
2319
|
+
return /* @__PURE__ */ React10.createElement("div", { style: {
|
|
2320
|
+
width: "100%",
|
|
2321
|
+
height: "100%",
|
|
2322
|
+
display: "flex",
|
|
2323
|
+
alignItems: "center",
|
|
2324
|
+
justifyContent: "center",
|
|
2325
|
+
padding: spacing[3],
|
|
2326
|
+
boxSizing: "border-box"
|
|
2327
|
+
} }, renderCompass());
|
|
2328
|
+
}
|
|
2329
|
+
return /* @__PURE__ */ React10.createElement(
|
|
2330
|
+
"div",
|
|
2331
|
+
{
|
|
2332
|
+
role: "article",
|
|
2333
|
+
"aria-label": `${politician.full_name}, ${politician.office_title || ""}`,
|
|
2334
|
+
tabIndex: 0,
|
|
2335
|
+
style: cardStyle,
|
|
2336
|
+
onClick,
|
|
2337
|
+
onKeyDown: (e) => {
|
|
2338
|
+
if (onClick && (e.key === "Enter" || e.key === " ")) {
|
|
2339
|
+
e.preventDefault();
|
|
2340
|
+
onClick();
|
|
2341
|
+
}
|
|
2342
|
+
},
|
|
2343
|
+
onMouseEnter: () => setHovered(true),
|
|
2344
|
+
onMouseLeave: () => setHovered(false),
|
|
2345
|
+
onFocus: () => setFocused(true),
|
|
2346
|
+
onBlur: () => setFocused(false)
|
|
2347
|
+
},
|
|
2348
|
+
/* @__PURE__ */ React10.createElement("div", { style: slotStyle }, renderSlotContent(), surface === "elections" && politician.running_unopposed && /* @__PURE__ */ React10.createElement("div", { style: {
|
|
2349
|
+
position: "absolute",
|
|
2350
|
+
bottom: "15px",
|
|
2351
|
+
left: 0,
|
|
2352
|
+
width: "100%",
|
|
2353
|
+
backgroundColor: "rgba(0,0,0,0.35)",
|
|
2354
|
+
color: "#fff",
|
|
2355
|
+
fontSize: "12px",
|
|
2356
|
+
fontWeight: 700,
|
|
2357
|
+
letterSpacing: "0.4px",
|
|
2358
|
+
textAlign: "center",
|
|
2359
|
+
textTransform: "uppercase",
|
|
2360
|
+
padding: "6px 0",
|
|
2361
|
+
pointerEvents: "none"
|
|
2362
|
+
} }, "Running Unopposed")),
|
|
2363
|
+
/* @__PURE__ */ React10.createElement("div", { style: { flex: 1, minWidth: 0, padding: spacing[4], paddingLeft: spacing[3] } }, /* @__PURE__ */ React10.createElement(
|
|
2364
|
+
CompassCardHorizontalMeta,
|
|
2365
|
+
{
|
|
2366
|
+
politician,
|
|
2367
|
+
surface,
|
|
2368
|
+
userAnswers
|
|
2369
|
+
}
|
|
2370
|
+
))
|
|
2371
|
+
);
|
|
2372
|
+
}
|
|
2373
|
+
|
|
1760
2374
|
// src/CategorySection.jsx
|
|
1761
|
-
import
|
|
2375
|
+
import React11, { useState as useState6 } from "react";
|
|
1762
2376
|
function CategorySection({
|
|
1763
2377
|
title,
|
|
1764
2378
|
infoTooltip,
|
|
@@ -1768,7 +2382,7 @@ function CategorySection({
|
|
|
1768
2382
|
tier
|
|
1769
2383
|
}) {
|
|
1770
2384
|
var _a, _b;
|
|
1771
|
-
const [showTooltip, setShowTooltip] =
|
|
2385
|
+
const [showTooltip, setShowTooltip] = useState6(false);
|
|
1772
2386
|
const tierStyle = tier ? tierColors[tier] : null;
|
|
1773
2387
|
const styles2 = {
|
|
1774
2388
|
section: {
|
|
@@ -1836,7 +2450,7 @@ function CategorySection({
|
|
|
1836
2450
|
gap: spacing[4]
|
|
1837
2451
|
}
|
|
1838
2452
|
};
|
|
1839
|
-
return /* @__PURE__ */
|
|
2453
|
+
return /* @__PURE__ */ React11.createElement("section", { style: styles2.section, className: "ev-category-section" }, /* @__PURE__ */ React11.createElement("div", { style: styles2.header }, /* @__PURE__ */ React11.createElement("span", { style: styles2.titlePill }, title), infoTooltip && /* @__PURE__ */ React11.createElement(
|
|
1840
2454
|
"button",
|
|
1841
2455
|
{
|
|
1842
2456
|
type: "button",
|
|
@@ -1848,8 +2462,8 @@ function CategorySection({
|
|
|
1848
2462
|
"aria-label": `Info about ${title}`
|
|
1849
2463
|
},
|
|
1850
2464
|
"i",
|
|
1851
|
-
showTooltip && /* @__PURE__ */
|
|
1852
|
-
), websiteUrl && /* @__PURE__ */
|
|
2465
|
+
showTooltip && /* @__PURE__ */ React11.createElement("div", { style: styles2.tooltip, role: "tooltip" }, infoTooltip)
|
|
2466
|
+
), websiteUrl && /* @__PURE__ */ React11.createElement(
|
|
1853
2467
|
"a",
|
|
1854
2468
|
{
|
|
1855
2469
|
href: websiteUrl,
|
|
@@ -1858,7 +2472,7 @@ function CategorySection({
|
|
|
1858
2472
|
style: styles2.externalLink,
|
|
1859
2473
|
"aria-label": `Visit official website for ${title}`
|
|
1860
2474
|
},
|
|
1861
|
-
/* @__PURE__ */
|
|
2475
|
+
/* @__PURE__ */ React11.createElement(
|
|
1862
2476
|
"svg",
|
|
1863
2477
|
{
|
|
1864
2478
|
viewBox: "0 0 24 24",
|
|
@@ -1866,7 +2480,7 @@ function CategorySection({
|
|
|
1866
2480
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1867
2481
|
style: { width: "14px", height: "14px" }
|
|
1868
2482
|
},
|
|
1869
|
-
/* @__PURE__ */
|
|
2483
|
+
/* @__PURE__ */ React11.createElement(
|
|
1870
2484
|
"path",
|
|
1871
2485
|
{
|
|
1872
2486
|
d: "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14",
|
|
@@ -1877,11 +2491,11 @@ function CategorySection({
|
|
|
1877
2491
|
}
|
|
1878
2492
|
)
|
|
1879
2493
|
)
|
|
1880
|
-
)), /* @__PURE__ */
|
|
2494
|
+
)), /* @__PURE__ */ React11.createElement("div", { style: styles2.grid, className: "ev-category-grid" }, children));
|
|
1881
2495
|
}
|
|
1882
2496
|
|
|
1883
2497
|
// src/SubGroupSection.jsx
|
|
1884
|
-
import
|
|
2498
|
+
import React12 from "react";
|
|
1885
2499
|
function SubGroupSection({ title, websiteUrl, children }) {
|
|
1886
2500
|
const styles2 = {
|
|
1887
2501
|
section: {
|
|
@@ -1914,7 +2528,7 @@ function SubGroupSection({ title, websiteUrl, children }) {
|
|
|
1914
2528
|
gap: spacing[2]
|
|
1915
2529
|
}
|
|
1916
2530
|
};
|
|
1917
|
-
return /* @__PURE__ */
|
|
2531
|
+
return /* @__PURE__ */ React12.createElement("div", { style: styles2.section }, title && /* @__PURE__ */ React12.createElement("div", { style: styles2.header }, /* @__PURE__ */ React12.createElement("span", { style: styles2.label }, title), websiteUrl && /* @__PURE__ */ React12.createElement(
|
|
1918
2532
|
"a",
|
|
1919
2533
|
{
|
|
1920
2534
|
href: websiteUrl,
|
|
@@ -1922,12 +2536,12 @@ function SubGroupSection({ title, websiteUrl, children }) {
|
|
|
1922
2536
|
rel: "noopener noreferrer",
|
|
1923
2537
|
style: styles2.link
|
|
1924
2538
|
},
|
|
1925
|
-
/* @__PURE__ */
|
|
1926
|
-
)), /* @__PURE__ */
|
|
2539
|
+
/* @__PURE__ */ React12.createElement("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: { width: "12px", height: "12px" } }, /* @__PURE__ */ React12.createElement("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ React12.createElement("path", { d: "M2 12h20M12 2a15.3 15.3 0 014 10 15.3 15.3 0 01-4 10 15.3 15.3 0 01-4-10 15.3 15.3 0 014-10z", stroke: "currentColor", strokeWidth: "2" }))
|
|
2540
|
+
)), /* @__PURE__ */ React12.createElement("div", { style: styles2.grid, className: "ev-subgroup-grid" }, children));
|
|
1927
2541
|
}
|
|
1928
2542
|
|
|
1929
2543
|
// src/GovernmentBodySection.jsx
|
|
1930
|
-
import
|
|
2544
|
+
import React13, { useState as useState7 } from "react";
|
|
1931
2545
|
function GovernmentBodySection({
|
|
1932
2546
|
title,
|
|
1933
2547
|
websiteUrl,
|
|
@@ -1936,7 +2550,7 @@ function GovernmentBodySection({
|
|
|
1936
2550
|
children
|
|
1937
2551
|
}) {
|
|
1938
2552
|
var _a;
|
|
1939
|
-
const [expanded, setExpanded] =
|
|
2553
|
+
const [expanded, setExpanded] = useState7(defaultExpanded);
|
|
1940
2554
|
const tierStyle = tier ? tierColors[tier] : null;
|
|
1941
2555
|
const accentColor = (_a = tierStyle == null ? void 0 : tierStyle.accent) != null ? _a : colors.borderMedium;
|
|
1942
2556
|
const styles2 = {
|
|
@@ -1976,7 +2590,7 @@ function GovernmentBodySection({
|
|
|
1976
2590
|
display: expanded ? "block" : "none"
|
|
1977
2591
|
}
|
|
1978
2592
|
};
|
|
1979
|
-
return /* @__PURE__ */
|
|
2593
|
+
return /* @__PURE__ */ React13.createElement("section", { style: styles2.section, className: "ev-gov-body-section" }, /* @__PURE__ */ React13.createElement(
|
|
1980
2594
|
"div",
|
|
1981
2595
|
{
|
|
1982
2596
|
style: styles2.header,
|
|
@@ -1992,8 +2606,8 @@ function GovernmentBodySection({
|
|
|
1992
2606
|
"aria-expanded": expanded,
|
|
1993
2607
|
"aria-label": `${expanded ? "Collapse" : "Expand"} ${title}`
|
|
1994
2608
|
},
|
|
1995
|
-
/* @__PURE__ */
|
|
1996
|
-
websiteUrl && /* @__PURE__ */
|
|
2609
|
+
/* @__PURE__ */ React13.createElement("span", { style: styles2.title }, title),
|
|
2610
|
+
websiteUrl && /* @__PURE__ */ React13.createElement(
|
|
1997
2611
|
"a",
|
|
1998
2612
|
{
|
|
1999
2613
|
href: websiteUrl,
|
|
@@ -2003,14 +2617,14 @@ function GovernmentBodySection({
|
|
|
2003
2617
|
onClick: (e) => e.stopPropagation(),
|
|
2004
2618
|
"aria-label": `Visit ${title} website`
|
|
2005
2619
|
},
|
|
2006
|
-
/* @__PURE__ */
|
|
2620
|
+
/* @__PURE__ */ React13.createElement("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: { width: "14px", height: "14px" } }, /* @__PURE__ */ React13.createElement("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ React13.createElement("path", { d: "M2 12h20M12 2a15.3 15.3 0 014 10 15.3 15.3 0 01-4 10 15.3 15.3 0 01-4-10 15.3 15.3 0 014-10z", stroke: "currentColor", strokeWidth: "2" }))
|
|
2007
2621
|
),
|
|
2008
|
-
/* @__PURE__ */
|
|
2009
|
-
), /* @__PURE__ */
|
|
2622
|
+
/* @__PURE__ */ React13.createElement("span", { style: styles2.toggle, "aria-hidden": "true" }, "\u25BC")
|
|
2623
|
+
), /* @__PURE__ */ React13.createElement("div", { style: styles2.content }, children));
|
|
2010
2624
|
}
|
|
2011
2625
|
|
|
2012
2626
|
// src/SocialLinks.jsx
|
|
2013
|
-
import
|
|
2627
|
+
import React14 from "react";
|
|
2014
2628
|
var SOCIAL_PLATFORMS = [
|
|
2015
2629
|
{ test: /facebook\.com/i, platform: "facebook" },
|
|
2016
2630
|
{ test: /twitter\.com|x\.com/i, platform: "twitter" },
|
|
@@ -2081,7 +2695,7 @@ function SocialLinks({
|
|
|
2081
2695
|
}
|
|
2082
2696
|
};
|
|
2083
2697
|
const platformIconMap = {
|
|
2084
|
-
twitter: /* @__PURE__ */
|
|
2698
|
+
twitter: /* @__PURE__ */ React14.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React14.createElement(
|
|
2085
2699
|
"path",
|
|
2086
2700
|
{
|
|
2087
2701
|
d: "M4 4L10.5 12.5M20 20L13.5 11.5M10.5 12.5L4 20H8L13.5 11.5M10.5 12.5L16 4H20L13.5 11.5",
|
|
@@ -2091,7 +2705,7 @@ function SocialLinks({
|
|
|
2091
2705
|
strokeLinejoin: "round"
|
|
2092
2706
|
}
|
|
2093
2707
|
)),
|
|
2094
|
-
facebook: /* @__PURE__ */
|
|
2708
|
+
facebook: /* @__PURE__ */ React14.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React14.createElement(
|
|
2095
2709
|
"path",
|
|
2096
2710
|
{
|
|
2097
2711
|
d: "M18 2H15C13.6739 2 12.4021 2.52678 11.4645 3.46447C10.5268 4.40215 10 5.67392 10 7V10H7V14H10V22H14V14H17L18 10H14V7C14 6.73478 14.1054 6.48043 14.2929 6.29289C14.4804 6.10536 14.7348 6 15 6H18V2Z",
|
|
@@ -2101,8 +2715,8 @@ function SocialLinks({
|
|
|
2101
2715
|
strokeLinejoin: "round"
|
|
2102
2716
|
}
|
|
2103
2717
|
)),
|
|
2104
|
-
instagram: /* @__PURE__ */
|
|
2105
|
-
linkedin: /* @__PURE__ */
|
|
2718
|
+
instagram: /* @__PURE__ */ React14.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React14.createElement("rect", { x: "2", y: "2", width: "20", height: "20", rx: "5", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ React14.createElement("circle", { cx: "12", cy: "12", r: "4", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ React14.createElement("circle", { cx: "18", cy: "6", r: "1", fill: "currentColor" })),
|
|
2719
|
+
linkedin: /* @__PURE__ */ React14.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React14.createElement(
|
|
2106
2720
|
"path",
|
|
2107
2721
|
{
|
|
2108
2722
|
d: "M16 8C17.5913 8 19.1174 8.63214 20.2426 9.75736C21.3679 10.8826 22 12.4087 22 14V21H18V14C18 13.4696 17.7893 12.9609 17.4142 12.5858C17.0391 12.2107 16.5304 12 16 12C15.4696 12 14.9609 12.2107 14.5858 12.5858C14.2107 12.9609 14 13.4696 14 14V21H10V14C10 12.4087 10.6321 10.8826 11.7574 9.75736C12.8826 8.63214 14.4087 8 16 8Z",
|
|
@@ -2111,8 +2725,8 @@ function SocialLinks({
|
|
|
2111
2725
|
strokeLinecap: "round",
|
|
2112
2726
|
strokeLinejoin: "round"
|
|
2113
2727
|
}
|
|
2114
|
-
), /* @__PURE__ */
|
|
2115
|
-
youtube: /* @__PURE__ */
|
|
2728
|
+
), /* @__PURE__ */ React14.createElement("rect", { x: "2", y: "9", width: "4", height: "12", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ React14.createElement("circle", { cx: "4", cy: "4", r: "2", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })),
|
|
2729
|
+
youtube: /* @__PURE__ */ React14.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React14.createElement("rect", { x: "2", y: "5", width: "20", height: "14", rx: "3", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ React14.createElement("polygon", { points: "10,9 16,12 10,15", fill: "currentColor" }))
|
|
2116
2730
|
};
|
|
2117
2731
|
const links = [
|
|
2118
2732
|
{
|
|
@@ -2138,7 +2752,7 @@ function SocialLinks({
|
|
|
2138
2752
|
{
|
|
2139
2753
|
href: website,
|
|
2140
2754
|
label: "Website",
|
|
2141
|
-
icon: /* @__PURE__ */
|
|
2755
|
+
icon: /* @__PURE__ */ React14.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React14.createElement("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ React14.createElement(
|
|
2142
2756
|
"path",
|
|
2143
2757
|
{
|
|
2144
2758
|
d: "M2 12H22M12 2C14.5 4.5 16 8 16 12C16 16 14.5 19.5 12 22C9.5 19.5 8 16 8 12C8 8 9.5 4.5 12 2Z",
|
|
@@ -2168,7 +2782,7 @@ function SocialLinks({
|
|
|
2168
2782
|
if (links.length === 0) {
|
|
2169
2783
|
return null;
|
|
2170
2784
|
}
|
|
2171
|
-
return /* @__PURE__ */
|
|
2785
|
+
return /* @__PURE__ */ React14.createElement("div", { style: styles2.container, className: "ev-social-links" }, links.map((link) => /* @__PURE__ */ React14.createElement(
|
|
2172
2786
|
"a",
|
|
2173
2787
|
{
|
|
2174
2788
|
key: link.label,
|
|
@@ -2191,7 +2805,7 @@ function SocialLinks({
|
|
|
2191
2805
|
}
|
|
2192
2806
|
|
|
2193
2807
|
// src/IssueTags.jsx
|
|
2194
|
-
import
|
|
2808
|
+
import React15 from "react";
|
|
2195
2809
|
function IssueTags({
|
|
2196
2810
|
tags = [],
|
|
2197
2811
|
selectedTags = [],
|
|
@@ -2234,9 +2848,9 @@ function IssueTags({
|
|
|
2234
2848
|
onTagClick(tag.value);
|
|
2235
2849
|
}
|
|
2236
2850
|
};
|
|
2237
|
-
return /* @__PURE__ */
|
|
2851
|
+
return /* @__PURE__ */ React15.createElement("div", { style: styles2.container, className: "ev-issue-tags", role: "list" }, tags.map((tag) => {
|
|
2238
2852
|
const isSelected = selectedTags.includes(tag.value);
|
|
2239
|
-
return /* @__PURE__ */
|
|
2853
|
+
return /* @__PURE__ */ React15.createElement(
|
|
2240
2854
|
"span",
|
|
2241
2855
|
{
|
|
2242
2856
|
key: tag.value,
|
|
@@ -2265,7 +2879,7 @@ function IssueTags({
|
|
|
2265
2879
|
}
|
|
2266
2880
|
|
|
2267
2881
|
// src/CommitteeTable.jsx
|
|
2268
|
-
import
|
|
2882
|
+
import React16, { useState as useState8 } from "react";
|
|
2269
2883
|
var ROLE_ORDER = {
|
|
2270
2884
|
"chair": 0,
|
|
2271
2885
|
"co-chair": 1,
|
|
@@ -2292,7 +2906,7 @@ function CommitteeTable({
|
|
|
2292
2906
|
maxVisible = 6,
|
|
2293
2907
|
style = {}
|
|
2294
2908
|
}) {
|
|
2295
|
-
const [showAll, setShowAll] =
|
|
2909
|
+
const [showAll, setShowAll] = useState8(false);
|
|
2296
2910
|
if (committees.length === 0) {
|
|
2297
2911
|
return null;
|
|
2298
2912
|
}
|
|
@@ -2354,7 +2968,7 @@ function CommitteeTable({
|
|
|
2354
2968
|
cursor: "pointer"
|
|
2355
2969
|
}
|
|
2356
2970
|
};
|
|
2357
|
-
return /* @__PURE__ */
|
|
2971
|
+
return /* @__PURE__ */ React16.createElement("div", { style: styles2.container, className: "ev-committee-table" }, /* @__PURE__ */ React16.createElement("h4", { style: styles2.heading }, /* @__PURE__ */ React16.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React16.createElement("path", { d: "M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2" }), /* @__PURE__ */ React16.createElement("circle", { cx: "9", cy: "7", r: "4" }), /* @__PURE__ */ React16.createElement("path", { d: "M23 21v-2a4 4 0 00-3-3.87M16 3.13a4 4 0 010 7.75" })), title), /* @__PURE__ */ React16.createElement("table", { style: styles2.table }, /* @__PURE__ */ React16.createElement("tbody", null, visible.map((committee, index) => /* @__PURE__ */ React16.createElement("tr", { key: index, style: styles2.row }, /* @__PURE__ */ React16.createElement("td", { style: { ...styles2.cell, ...styles2.nameCell } }, committee.url ? /* @__PURE__ */ React16.createElement(
|
|
2358
2972
|
"a",
|
|
2359
2973
|
{
|
|
2360
2974
|
href: committee.url,
|
|
@@ -2369,7 +2983,7 @@ function CommitteeTable({
|
|
|
2369
2983
|
}
|
|
2370
2984
|
},
|
|
2371
2985
|
committee.name
|
|
2372
|
-
) : committee.name), /* @__PURE__ */
|
|
2986
|
+
) : committee.name), /* @__PURE__ */ React16.createElement("td", { style: { ...styles2.cell, ...styles2.positionCell } }, formatPosition(committee.position)))))), hasMore && /* @__PURE__ */ React16.createElement(
|
|
2373
2987
|
"button",
|
|
2374
2988
|
{
|
|
2375
2989
|
type: "button",
|
|
@@ -2377,7 +2991,7 @@ function CommitteeTable({
|
|
|
2377
2991
|
onClick: () => setShowAll(!showAll)
|
|
2378
2992
|
},
|
|
2379
2993
|
showAll ? "Show less" : `Show all ${sorted.length} committees`,
|
|
2380
|
-
/* @__PURE__ */
|
|
2994
|
+
/* @__PURE__ */ React16.createElement(
|
|
2381
2995
|
"svg",
|
|
2382
2996
|
{
|
|
2383
2997
|
width: "14",
|
|
@@ -2390,16 +3004,16 @@ function CommitteeTable({
|
|
|
2390
3004
|
strokeLinejoin: "round",
|
|
2391
3005
|
style: { transform: showAll ? "rotate(180deg)" : "none", transition: "transform 0.2s" }
|
|
2392
3006
|
},
|
|
2393
|
-
/* @__PURE__ */
|
|
3007
|
+
/* @__PURE__ */ React16.createElement("polyline", { points: "6 9 12 15 18 9" })
|
|
2394
3008
|
)
|
|
2395
3009
|
));
|
|
2396
3010
|
}
|
|
2397
3011
|
|
|
2398
3012
|
// src/PoliticianProfile.jsx
|
|
2399
|
-
import
|
|
3013
|
+
import React19, { useState as useState9, useEffect as useEffect6 } from "react";
|
|
2400
3014
|
|
|
2401
3015
|
// src/LegislativeInlineSummary.jsx
|
|
2402
|
-
import
|
|
3016
|
+
import React17 from "react";
|
|
2403
3017
|
function normalizePosition(pos) {
|
|
2404
3018
|
if (!pos) return "";
|
|
2405
3019
|
return pos.replace(/_/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
@@ -2507,7 +3121,7 @@ function LegislativeInlineSummary({ summary, politicianId, onNavigateToRecord })
|
|
|
2507
3121
|
fontSize: fontSizes.sm,
|
|
2508
3122
|
fontWeight: fontWeights.medium
|
|
2509
3123
|
};
|
|
2510
|
-
return /* @__PURE__ */
|
|
3124
|
+
return /* @__PURE__ */ React17.createElement("div", { style: card }, stats.length > 0 && /* @__PURE__ */ React17.createElement("div", { style: statsRow }, stats.map((s, i) => /* @__PURE__ */ React17.createElement("div", { key: i, style: statItem }, /* @__PURE__ */ React17.createElement("span", { style: statValue }, s.value), s.label && /* @__PURE__ */ React17.createElement("span", { style: statLabel }, s.label)))), mostRecentAction && /* @__PURE__ */ React17.createElement("div", { style: actionLine, title: mostRecentAction }, mostRecentAction), /* @__PURE__ */ React17.createElement("div", null), /* @__PURE__ */ React17.createElement("div", { style: footerRow }, /* @__PURE__ */ React17.createElement(
|
|
2511
3125
|
"button",
|
|
2512
3126
|
{
|
|
2513
3127
|
onClick: () => {
|
|
@@ -2532,12 +3146,12 @@ function LegislativeInlineSummary({ summary, politicianId, onNavigateToRecord })
|
|
|
2532
3146
|
}
|
|
2533
3147
|
},
|
|
2534
3148
|
"View Full Legislative Record",
|
|
2535
|
-
/* @__PURE__ */
|
|
3149
|
+
/* @__PURE__ */ React17.createElement("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true" }, /* @__PURE__ */ React17.createElement("path", { d: "M9 18l6-6-6-6" }))
|
|
2536
3150
|
)));
|
|
2537
3151
|
}
|
|
2538
3152
|
|
|
2539
3153
|
// src/JudicialScorecard.jsx
|
|
2540
|
-
import
|
|
3154
|
+
import React18 from "react";
|
|
2541
3155
|
|
|
2542
3156
|
// src/judicialUtils.js
|
|
2543
3157
|
function formatDate(dateStr) {
|
|
@@ -2655,7 +3269,7 @@ function JudicialScorecard({ judicialRecord, politicianId, onNavigateToRecord })
|
|
|
2655
3269
|
onNavigateToRecord(`/politician/${politicianId}/judicial-record`);
|
|
2656
3270
|
}
|
|
2657
3271
|
};
|
|
2658
|
-
return /* @__PURE__ */
|
|
3272
|
+
return /* @__PURE__ */ React18.createElement("section", { style: sectionStyle }, /* @__PURE__ */ React18.createElement("h3", { style: headingStyle }, "Judicial Record"), evaluations.length > 0 && /* @__PURE__ */ React18.createElement("div", { style: { marginBottom: "16px" } }, evaluations.slice(0, 3).map((ev, i) => /* @__PURE__ */ React18.createElement("span", { key: i, style: evalChipStyle }, ev.rating, /* @__PURE__ */ React18.createElement("span", { style: { fontWeight: 400, color: "#4a90a4", fontSize: "11px" } }, "\u2014 ", ev.source)))), metrics.length > 0 && /* @__PURE__ */ React18.createElement("div", { style: cardGridStyle }, metrics.slice(0, 4).map((m, i) => /* @__PURE__ */ React18.createElement("div", { key: i, style: metricCardStyle }, /* @__PURE__ */ React18.createElement("div", { style: metricLabelStyle }, METRIC_LABELS[m.metric_type] || m.metric_type.replace(/_/g, " ")), /* @__PURE__ */ React18.createElement("div", { style: metricValueStyle }, formatMetricValue(m.metric_type, m.value)), m.context_label && /* @__PURE__ */ React18.createElement("div", { style: metricContextStyle }, m.context_label)))), disciplinary.length > 0 && /* @__PURE__ */ React18.createElement("div", { style: { marginBottom: "12px" } }, disciplinary.slice(0, 2).map((d, i) => /* @__PURE__ */ React18.createElement("div", { key: i, style: disciplinaryStyle }, /* @__PURE__ */ React18.createElement("strong", null, d.record_type), " \u2014 ", formatDate(d.record_date), d.description && /* @__PURE__ */ React18.createElement("div", { style: { marginTop: "4px" } }, d.description)))), /* @__PURE__ */ React18.createElement("a", { href: `/politician/${politicianId}/judicial-record`, onClick: handleNavigate, style: linkStyle }, "View Full Judicial Record \u2192"));
|
|
2659
3273
|
}
|
|
2660
3274
|
|
|
2661
3275
|
// src/PoliticianProfile.jsx
|
|
@@ -2806,13 +3420,13 @@ function formatAddress(addr) {
|
|
|
2806
3420
|
if (cityStateZip) lines.push(cityStateZip);
|
|
2807
3421
|
return lines;
|
|
2808
3422
|
}
|
|
2809
|
-
var CalendarIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
2810
|
-
var ClockIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
2811
|
-
var MapPinIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
2812
|
-
var PhoneIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
2813
|
-
var MailIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
2814
|
-
var GlobeIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
2815
|
-
var ExternalLinkIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
3423
|
+
var CalendarIcon = ({ size = 16 }) => /* @__PURE__ */ React19.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React19.createElement("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }), /* @__PURE__ */ React19.createElement("line", { x1: "16", y1: "2", x2: "16", y2: "6" }), /* @__PURE__ */ React19.createElement("line", { x1: "8", y1: "2", x2: "8", y2: "6" }), /* @__PURE__ */ React19.createElement("line", { x1: "3", y1: "10", x2: "21", y2: "10" }));
|
|
3424
|
+
var ClockIcon = ({ size = 16 }) => /* @__PURE__ */ React19.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React19.createElement("circle", { cx: "12", cy: "12", r: "10" }), /* @__PURE__ */ React19.createElement("polyline", { points: "12 6 12 12 16 14" }));
|
|
3425
|
+
var MapPinIcon = ({ size = 16 }) => /* @__PURE__ */ React19.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React19.createElement("path", { d: "M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0118 0z" }), /* @__PURE__ */ React19.createElement("circle", { cx: "12", cy: "10", r: "3" }));
|
|
3426
|
+
var PhoneIcon = ({ size = 16 }) => /* @__PURE__ */ React19.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React19.createElement("path", { d: "M22 16.92v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07A19.5 19.5 0 013.07 10.8 19.79 19.79 0 01.07 2.18 2 2 0 012.02 0h3a2 2 0 012 1.72c.127.96.361 1.903.7 2.81a2 2 0 01-.45 2.11L6.09 7.91a16 16 0 006 6l1.27-1.27a2 2 0 012.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0122 16.92z" }));
|
|
3427
|
+
var MailIcon = ({ size = 16 }) => /* @__PURE__ */ React19.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React19.createElement("path", { d: "M4 4H20C21.1 4 22 4.9 22 6V18C22 19.1 21.1 20 20 20H4C2.9 20 2 19.1 2 18V6C2 4.9 2.9 4 4 4Z" }), /* @__PURE__ */ React19.createElement("path", { d: "M22 6L12 13L2 6" }));
|
|
3428
|
+
var GlobeIcon = ({ size = 16 }) => /* @__PURE__ */ React19.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React19.createElement("circle", { cx: "12", cy: "12", r: "10" }), /* @__PURE__ */ React19.createElement("path", { d: "M2 12H22M12 2C14.5 4.5 16 8 16 12C16 16 14.5 19.5 12 22C9.5 19.5 8 16 8 12C8 8 9.5 4.5 12 2Z" }));
|
|
3429
|
+
var ExternalLinkIcon = ({ size = 16 }) => /* @__PURE__ */ React19.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React19.createElement("path", { d: "M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6" }), /* @__PURE__ */ React19.createElement("polyline", { points: "15 3 21 3 21 9" }), /* @__PURE__ */ React19.createElement("line", { x1: "10", y1: "14", x2: "21", y2: "3" }));
|
|
2816
3430
|
function PoliticianProfile({
|
|
2817
3431
|
politician = {},
|
|
2818
3432
|
onBack,
|
|
@@ -2839,8 +3453,8 @@ function PoliticianProfile({
|
|
|
2839
3453
|
return pol.photo_origin_url;
|
|
2840
3454
|
})();
|
|
2841
3455
|
const initials = [pol.first_name, pol.last_name].filter(Boolean).map((n) => n[0]).join("");
|
|
2842
|
-
const [imgError, setImgError] =
|
|
2843
|
-
|
|
3456
|
+
const [imgError, setImgError] = useState9(false);
|
|
3457
|
+
useEffect6(() => {
|
|
2844
3458
|
setImgError(false);
|
|
2845
3459
|
}, [profileImageUrl]);
|
|
2846
3460
|
const getSocialHandle = (type) => {
|
|
@@ -3140,7 +3754,7 @@ function PoliticianProfile({
|
|
|
3140
3754
|
borderRadius: borderRadius.full
|
|
3141
3755
|
}
|
|
3142
3756
|
};
|
|
3143
|
-
return /* @__PURE__ */
|
|
3757
|
+
return /* @__PURE__ */ React19.createElement("div", { style: styles2.container, className: "ev-politician-profile" }, onBack && /* @__PURE__ */ React19.createElement(
|
|
3144
3758
|
"button",
|
|
3145
3759
|
{
|
|
3146
3760
|
type: "button",
|
|
@@ -3153,9 +3767,9 @@ function PoliticianProfile({
|
|
|
3153
3767
|
e.currentTarget.style.textDecoration = "none";
|
|
3154
3768
|
}
|
|
3155
3769
|
},
|
|
3156
|
-
/* @__PURE__ */
|
|
3770
|
+
/* @__PURE__ */ React19.createElement("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React19.createElement("path", { d: "M15 19l-7-7 7-7" })),
|
|
3157
3771
|
label
|
|
3158
|
-
), /* @__PURE__ */
|
|
3772
|
+
), /* @__PURE__ */ React19.createElement("div", { style: styles2.card }, /* @__PURE__ */ React19.createElement("div", { style: styles2.heroRow }, /* @__PURE__ */ React19.createElement("div", { style: styles2.photoWrap }, profileImageUrl && !imgError ? /* @__PURE__ */ React19.createElement(
|
|
3159
3773
|
"img",
|
|
3160
3774
|
{
|
|
3161
3775
|
src: profileImageUrl,
|
|
@@ -3163,7 +3777,7 @@ function PoliticianProfile({
|
|
|
3163
3777
|
style: styles2.photo,
|
|
3164
3778
|
onError: () => setImgError(true)
|
|
3165
3779
|
}
|
|
3166
|
-
) : /* @__PURE__ */
|
|
3780
|
+
) : /* @__PURE__ */ React19.createElement("div", { style: styles2.placeholder }, initials || "?")), /* @__PURE__ */ React19.createElement("div", { style: styles2.infoCol }, styles2.tierBadge && /* @__PURE__ */ React19.createElement("div", { style: styles2.tierBadge }, tier), /* @__PURE__ */ React19.createElement("h1", { style: styles2.name }, displayName), banner, /* @__PURE__ */ React19.createElement("p", { style: styles2.roleLine }, roleLine), pol.office_description && /* @__PURE__ */ React19.createElement("p", { style: styles2.officeDesc }, pol.office_description), pol.bio_text && /* @__PURE__ */ React19.createElement("p", { style: styles2.bioText }, pol.bio_text), (termLine || pol.total_years_in_office > 0) && /* @__PURE__ */ React19.createElement("div", { style: styles2.metaRow }, termLine && /* @__PURE__ */ React19.createElement("span", { style: styles2.metaItem }, /* @__PURE__ */ React19.createElement(CalendarIcon, { size: 14 }), termLine), pol.total_years_in_office > 0 && /* @__PURE__ */ React19.createElement("span", { style: styles2.metaItem }, /* @__PURE__ */ React19.createElement(ClockIcon, { size: 14 }), pol.total_years_in_office, " ", pol.total_years_in_office === 1 ? "year" : "years", " in office")), pol.web_form_url && /* @__PURE__ */ React19.createElement(
|
|
3167
3781
|
"a",
|
|
3168
3782
|
{
|
|
3169
3783
|
href: pol.web_form_url,
|
|
@@ -3177,9 +3791,9 @@ function PoliticianProfile({
|
|
|
3177
3791
|
e.currentTarget.style.background = colors.evTeal;
|
|
3178
3792
|
}
|
|
3179
3793
|
},
|
|
3180
|
-
/* @__PURE__ */
|
|
3794
|
+
/* @__PURE__ */ React19.createElement(ExternalLinkIcon, { size: 14 }),
|
|
3181
3795
|
"Submit a Message"
|
|
3182
|
-
))), hasContactInfo && /* @__PURE__ */
|
|
3796
|
+
))), hasContactInfo && /* @__PURE__ */ React19.createElement(React19.Fragment, null, /* @__PURE__ */ React19.createElement("div", { style: divider }), /* @__PURE__ */ React19.createElement("div", { style: sectionHeading }, /* @__PURE__ */ React19.createElement(MailIcon, { size: 20 }), "Contact Information"), /* @__PURE__ */ React19.createElement("div", { style: styles2.contactGrid }, hasAddresses && /* @__PURE__ */ React19.createElement("div", { style: styles2.contactGroup }, /* @__PURE__ */ React19.createElement("p", { style: styles2.contactLabel }, /* @__PURE__ */ React19.createElement(MapPinIcon, { size: 12 }), "Addresses"), addresses.map((addr, i) => /* @__PURE__ */ React19.createElement("div", { key: `addr-${i}` }, /* @__PURE__ */ React19.createElement("p", { style: { ...styles2.contactSubLabel, ...i === 0 ? { marginTop: 0 } : { marginTop: spacing[2] } } }, addr.type), /* @__PURE__ */ React19.createElement("p", { style: styles2.contactValue }, addr.lines.map((line, j) => /* @__PURE__ */ React19.createElement(React19.Fragment, { key: j }, line, j < addr.lines.length - 1 && /* @__PURE__ */ React19.createElement("br", null))))))), hasPhones && /* @__PURE__ */ React19.createElement("div", { style: styles2.contactGroup }, /* @__PURE__ */ React19.createElement("p", { style: styles2.contactLabel }, /* @__PURE__ */ React19.createElement(PhoneIcon, { size: 12 }), "Phone"), Object.entries(phonesByType).map(([type, phones], i) => /* @__PURE__ */ React19.createElement("div", { key: `phone-${type}` }, /* @__PURE__ */ React19.createElement("p", { style: { ...styles2.contactSubLabel, ...i === 0 ? { marginTop: 0 } : { marginTop: spacing[2] } } }, type), phones.map((phone, j) => /* @__PURE__ */ React19.createElement("p", { key: j, style: styles2.contactValue }, /* @__PURE__ */ React19.createElement(
|
|
3183
3797
|
"a",
|
|
3184
3798
|
{
|
|
3185
3799
|
href: `tel:${phone}`,
|
|
@@ -3192,7 +3806,7 @@ function PoliticianProfile({
|
|
|
3192
3806
|
}
|
|
3193
3807
|
},
|
|
3194
3808
|
phone
|
|
3195
|
-
)))))), hasEmails && /* @__PURE__ */
|
|
3809
|
+
)))))), hasEmails && /* @__PURE__ */ React19.createElement("div", { style: styles2.contactGroup }, /* @__PURE__ */ React19.createElement("p", { style: styles2.contactLabel }, /* @__PURE__ */ React19.createElement(MailIcon, { size: 12 }), "Email"), Object.entries(emailsByType).filter(([, emails]) => emails.some((e) => e && e.trim())).map(([type, emails], i) => /* @__PURE__ */ React19.createElement("div", { key: `email-${type}` }, /* @__PURE__ */ React19.createElement("p", { style: { ...styles2.contactSubLabel, ...i === 0 ? { marginTop: 0 } : { marginTop: spacing[2] } } }, type), emails.filter((e) => e && e.trim()).map((email, j) => /* @__PURE__ */ React19.createElement("p", { key: j, style: styles2.contactValue }, /* @__PURE__ */ React19.createElement(
|
|
3196
3810
|
"a",
|
|
3197
3811
|
{
|
|
3198
3812
|
href: `mailto:${email}`,
|
|
@@ -3205,7 +3819,7 @@ function PoliticianProfile({
|
|
|
3205
3819
|
}
|
|
3206
3820
|
},
|
|
3207
3821
|
email
|
|
3208
|
-
)))))), hasWebsitesCol && /* @__PURE__ */
|
|
3822
|
+
)))))), hasWebsitesCol && /* @__PURE__ */ React19.createElement("div", { style: styles2.contactGroup }, /* @__PURE__ */ React19.createElement("p", { style: styles2.contactLabel }, /* @__PURE__ */ React19.createElement(GlobeIcon, { size: 12 }), "Websites"), allWebsites.map((url, i) => /* @__PURE__ */ React19.createElement("p", { key: i, style: styles2.contactValue }, /* @__PURE__ */ React19.createElement(
|
|
3209
3823
|
"a",
|
|
3210
3824
|
{
|
|
3211
3825
|
href: url,
|
|
@@ -3220,7 +3834,7 @@ function PoliticianProfile({
|
|
|
3220
3834
|
}
|
|
3221
3835
|
},
|
|
3222
3836
|
extractDomain(url)
|
|
3223
|
-
))), (hasSocial || socialWebsiteUrls.length > 0) && /* @__PURE__ */
|
|
3837
|
+
))), (hasSocial || socialWebsiteUrls.length > 0) && /* @__PURE__ */ React19.createElement(
|
|
3224
3838
|
SocialLinks,
|
|
3225
3839
|
{
|
|
3226
3840
|
twitter,
|
|
@@ -3231,14 +3845,14 @@ function PoliticianProfile({
|
|
|
3231
3845
|
size: "sm",
|
|
3232
3846
|
style: { marginTop: allWebsites.length > 0 ? "8px" : 0 }
|
|
3233
3847
|
}
|
|
3234
|
-
)))), committees.length > 0 && /* @__PURE__ */
|
|
3848
|
+
)))), committees.length > 0 && /* @__PURE__ */ React19.createElement(React19.Fragment, null, /* @__PURE__ */ React19.createElement("div", { style: divider }), /* @__PURE__ */ React19.createElement(CommitteeTable, { committees })), pol.is_judicial ? /* @__PURE__ */ React19.createElement(
|
|
3235
3849
|
JudicialScorecard,
|
|
3236
3850
|
{
|
|
3237
3851
|
judicialRecord,
|
|
3238
3852
|
politicianId,
|
|
3239
3853
|
onNavigateToRecord
|
|
3240
3854
|
}
|
|
3241
|
-
) : /* @__PURE__ */
|
|
3855
|
+
) : /* @__PURE__ */ React19.createElement(
|
|
3242
3856
|
LegislativeInlineSummary,
|
|
3243
3857
|
{
|
|
3244
3858
|
summary: legislativeSummary,
|
|
@@ -3249,7 +3863,7 @@ function PoliticianProfile({
|
|
|
3249
3863
|
}
|
|
3250
3864
|
|
|
3251
3865
|
// src/LegislativeRecord.jsx
|
|
3252
|
-
import
|
|
3866
|
+
import React20, { useState as useState10 } from "react";
|
|
3253
3867
|
var DEFAULT_LIMIT = 25;
|
|
3254
3868
|
function normalizeText(str) {
|
|
3255
3869
|
if (!str) return "";
|
|
@@ -3329,7 +3943,7 @@ function getPositionBadge(position) {
|
|
|
3329
3943
|
return { bg: colors.borderLight, text: colors.textSecondary };
|
|
3330
3944
|
}
|
|
3331
3945
|
function Badge({ label, bg, text }) {
|
|
3332
|
-
return /* @__PURE__ */
|
|
3946
|
+
return /* @__PURE__ */ React20.createElement("span", { style: {
|
|
3333
3947
|
display: "inline-block",
|
|
3334
3948
|
background: bg,
|
|
3335
3949
|
color: text,
|
|
@@ -3342,18 +3956,18 @@ function Badge({ label, bg, text }) {
|
|
|
3342
3956
|
} }, label);
|
|
3343
3957
|
}
|
|
3344
3958
|
function SectionHeader({ title, yearFilter, years, onYearChange }) {
|
|
3345
|
-
return /* @__PURE__ */
|
|
3959
|
+
return /* @__PURE__ */ React20.createElement("div", { style: {
|
|
3346
3960
|
display: "flex",
|
|
3347
3961
|
alignItems: "center",
|
|
3348
3962
|
justifyContent: "space-between",
|
|
3349
3963
|
marginBottom: spacing[4]
|
|
3350
|
-
} }, /* @__PURE__ */
|
|
3964
|
+
} }, /* @__PURE__ */ React20.createElement("h2", { style: {
|
|
3351
3965
|
fontFamily: fonts.primary,
|
|
3352
3966
|
fontSize: fontSizes.xl,
|
|
3353
3967
|
fontWeight: fontWeights.bold,
|
|
3354
3968
|
color: colors.evTeal,
|
|
3355
3969
|
margin: 0
|
|
3356
|
-
} }, title), years && years.length > 0 && /* @__PURE__ */
|
|
3970
|
+
} }, title), years && years.length > 0 && /* @__PURE__ */ React20.createElement(
|
|
3357
3971
|
"select",
|
|
3358
3972
|
{
|
|
3359
3973
|
value: yearFilter,
|
|
@@ -3369,13 +3983,13 @@ function SectionHeader({ title, yearFilter, years, onYearChange }) {
|
|
|
3369
3983
|
cursor: "pointer"
|
|
3370
3984
|
}
|
|
3371
3985
|
},
|
|
3372
|
-
/* @__PURE__ */
|
|
3373
|
-
years.map((y) => /* @__PURE__ */
|
|
3986
|
+
/* @__PURE__ */ React20.createElement("option", { value: "All" }, "All years"),
|
|
3987
|
+
years.map((y) => /* @__PURE__ */ React20.createElement("option", { key: y, value: y }, y))
|
|
3374
3988
|
));
|
|
3375
3989
|
}
|
|
3376
3990
|
function ShowAllLink({ totalCount, visibleCount, onClick }) {
|
|
3377
3991
|
if (totalCount <= visibleCount) return null;
|
|
3378
|
-
return /* @__PURE__ */
|
|
3992
|
+
return /* @__PURE__ */ React20.createElement("div", { style: { textAlign: "center", marginTop: spacing[3] } }, /* @__PURE__ */ React20.createElement(
|
|
3379
3993
|
"button",
|
|
3380
3994
|
{
|
|
3381
3995
|
type: "button",
|
|
@@ -3403,7 +4017,7 @@ function ShowAllLink({ totalCount, visibleCount, onClick }) {
|
|
|
3403
4017
|
));
|
|
3404
4018
|
}
|
|
3405
4019
|
function EmptyState({ message }) {
|
|
3406
|
-
return /* @__PURE__ */
|
|
4020
|
+
return /* @__PURE__ */ React20.createElement("p", { style: {
|
|
3407
4021
|
fontFamily: fonts.primary,
|
|
3408
4022
|
fontSize: fontSizes.sm,
|
|
3409
4023
|
color: colors.textMuted,
|
|
@@ -3413,24 +4027,24 @@ function EmptyState({ message }) {
|
|
|
3413
4027
|
} }, message);
|
|
3414
4028
|
}
|
|
3415
4029
|
function Spinner() {
|
|
3416
|
-
return /* @__PURE__ */
|
|
4030
|
+
return /* @__PURE__ */ React20.createElement("div", { style: {
|
|
3417
4031
|
display: "flex",
|
|
3418
4032
|
justifyContent: "center",
|
|
3419
4033
|
alignItems: "center",
|
|
3420
4034
|
padding: spacing[10]
|
|
3421
|
-
} }, /* @__PURE__ */
|
|
4035
|
+
} }, /* @__PURE__ */ React20.createElement("div", { style: {
|
|
3422
4036
|
width: "40px",
|
|
3423
4037
|
height: "40px",
|
|
3424
4038
|
borderRadius: borderRadius.full,
|
|
3425
4039
|
border: `3px solid ${colors.borderLight}`,
|
|
3426
4040
|
borderTopColor: colors.evTeal,
|
|
3427
4041
|
animation: "ev-spin 0.8s linear infinite"
|
|
3428
|
-
} }), /* @__PURE__ */
|
|
4042
|
+
} }), /* @__PURE__ */ React20.createElement("style", null, `@keyframes ev-spin { to { transform: rotate(360deg); } }`));
|
|
3429
4043
|
}
|
|
3430
4044
|
function CommitteesSection({ committees, leadership }) {
|
|
3431
|
-
const [showAll, setShowAll] =
|
|
4045
|
+
const [showAll, setShowAll] = useState10(false);
|
|
3432
4046
|
const visible = showAll ? committees : committees.slice(0, DEFAULT_LIMIT);
|
|
3433
|
-
return /* @__PURE__ */
|
|
4047
|
+
return /* @__PURE__ */ React20.createElement("div", { style: { marginBottom: spacing[8] } }, /* @__PURE__ */ React20.createElement(SectionHeader, { title: "Committees & Leadership" }), leadership && leadership.length > 0 && /* @__PURE__ */ React20.createElement("div", { style: { display: "flex", flexWrap: "wrap", gap: spacing[2], marginBottom: spacing[4] } }, leadership.map((role, i) => /* @__PURE__ */ React20.createElement("div", { key: i, style: {
|
|
3434
4048
|
display: "inline-flex",
|
|
3435
4049
|
alignItems: "center",
|
|
3436
4050
|
gap: spacing[1],
|
|
@@ -3441,23 +4055,23 @@ function CommitteesSection({ committees, leadership }) {
|
|
|
3441
4055
|
fontFamily: fonts.primary,
|
|
3442
4056
|
fontSize: fontSizes.sm,
|
|
3443
4057
|
fontWeight: fontWeights.semibold
|
|
3444
|
-
} }, role.title, role.chamber && /* @__PURE__ */
|
|
4058
|
+
} }, role.title, role.chamber && /* @__PURE__ */ React20.createElement("span", { style: { fontWeight: fontWeights.regular, opacity: 0.85 } }, "(", role.chamber, ")")))), committees.length === 0 ? /* @__PURE__ */ React20.createElement(EmptyState, { message: "Committee information is not available for this office." }) : /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement("div", null, visible.map((c, i) => {
|
|
3445
4059
|
const badge = getRoleBadge(c.role);
|
|
3446
|
-
return /* @__PURE__ */
|
|
4060
|
+
return /* @__PURE__ */ React20.createElement("div", { key: i, style: {
|
|
3447
4061
|
display: "flex",
|
|
3448
4062
|
alignItems: "center",
|
|
3449
4063
|
justifyContent: "space-between",
|
|
3450
4064
|
padding: `${spacing[3]} 0`,
|
|
3451
4065
|
borderBottom: `1px solid ${colors.borderLight}`,
|
|
3452
4066
|
gap: spacing[3]
|
|
3453
|
-
} }, /* @__PURE__ */
|
|
4067
|
+
} }, /* @__PURE__ */ React20.createElement("span", { style: {
|
|
3454
4068
|
fontFamily: fonts.primary,
|
|
3455
4069
|
fontSize: fontSizes.sm,
|
|
3456
4070
|
color: colors.textSecondary,
|
|
3457
4071
|
flex: 1,
|
|
3458
4072
|
minWidth: 0
|
|
3459
|
-
} }, c.committee_name, c.parent_name && /* @__PURE__ */
|
|
3460
|
-
})), !showAll && /* @__PURE__ */
|
|
4073
|
+
} }, c.committee_name, c.parent_name && /* @__PURE__ */ React20.createElement("span", { style: { color: colors.textMuted, marginLeft: spacing[1] } }, "(", c.parent_name, ")")), /* @__PURE__ */ React20.createElement(Badge, { label: badge.label, bg: badge.bg, text: badge.text }));
|
|
4074
|
+
})), !showAll && /* @__PURE__ */ React20.createElement(
|
|
3461
4075
|
ShowAllLink,
|
|
3462
4076
|
{
|
|
3463
4077
|
totalCount: committees.length,
|
|
@@ -3468,15 +4082,15 @@ function CommitteesSection({ committees, leadership }) {
|
|
|
3468
4082
|
}
|
|
3469
4083
|
function LegislationSection({ bills, isMobile }) {
|
|
3470
4084
|
const years = getYears(bills, "introduced_at");
|
|
3471
|
-
const [yearFilter, setYearFilter] =
|
|
3472
|
-
const [showAll, setShowAll] =
|
|
4085
|
+
const [yearFilter, setYearFilter] = useState10("All");
|
|
4086
|
+
const [showAll, setShowAll] = useState10(false);
|
|
3473
4087
|
const handleYearChange = (y) => {
|
|
3474
4088
|
setYearFilter(y);
|
|
3475
4089
|
setShowAll(false);
|
|
3476
4090
|
};
|
|
3477
4091
|
const filtered = yearFilter === "All" ? bills : bills.filter((b) => extractYear(b.introduced_at) === yearFilter);
|
|
3478
4092
|
const visible = showAll ? filtered : filtered.slice(0, DEFAULT_LIMIT);
|
|
3479
|
-
return /* @__PURE__ */
|
|
4093
|
+
return /* @__PURE__ */ React20.createElement("div", { style: { marginBottom: spacing[8] } }, /* @__PURE__ */ React20.createElement(
|
|
3480
4094
|
SectionHeader,
|
|
3481
4095
|
{
|
|
3482
4096
|
title: "Sponsored Legislation",
|
|
@@ -3484,42 +4098,42 @@ function LegislationSection({ bills, isMobile }) {
|
|
|
3484
4098
|
years,
|
|
3485
4099
|
onYearChange: handleYearChange
|
|
3486
4100
|
}
|
|
3487
|
-
), bills.length === 0 ? /* @__PURE__ */
|
|
4101
|
+
), bills.length === 0 ? /* @__PURE__ */ React20.createElement(EmptyState, { message: "Sponsored legislation data is not available for this office." }) : /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement("div", null, visible.map((bill, i) => {
|
|
3488
4102
|
const statusBadge = getStatusBadge(bill.status_label);
|
|
3489
|
-
return /* @__PURE__ */
|
|
4103
|
+
return /* @__PURE__ */ React20.createElement("div", { key: i, style: {
|
|
3490
4104
|
display: "flex",
|
|
3491
4105
|
flexDirection: isMobile ? "column" : "row",
|
|
3492
4106
|
alignItems: isMobile ? "flex-start" : "center",
|
|
3493
4107
|
gap: isMobile ? spacing[1] : spacing[3],
|
|
3494
4108
|
padding: `${spacing[3]} 0`,
|
|
3495
4109
|
borderBottom: `1px solid ${colors.borderLight}`
|
|
3496
|
-
} }, /* @__PURE__ */
|
|
4110
|
+
} }, /* @__PURE__ */ React20.createElement("div", { style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React20.createElement("span", { style: {
|
|
3497
4111
|
fontFamily: fonts.primary,
|
|
3498
4112
|
fontSize: fontSizes.xs,
|
|
3499
4113
|
fontWeight: fontWeights.bold,
|
|
3500
4114
|
color: colors.textSecondary,
|
|
3501
4115
|
marginRight: spacing[2]
|
|
3502
|
-
} }, bill.number), /* @__PURE__ */
|
|
4116
|
+
} }, bill.number), /* @__PURE__ */ React20.createElement("span", { style: {
|
|
3503
4117
|
fontFamily: fonts.primary,
|
|
3504
4118
|
fontSize: fontSizes.sm,
|
|
3505
4119
|
color: colors.textSecondary
|
|
3506
|
-
} }, bill.title)), /* @__PURE__ */
|
|
4120
|
+
} }, bill.title)), /* @__PURE__ */ React20.createElement("div", { style: {
|
|
3507
4121
|
display: "flex",
|
|
3508
4122
|
alignItems: "center",
|
|
3509
4123
|
gap: spacing[2],
|
|
3510
4124
|
flexShrink: 0,
|
|
3511
4125
|
flexWrap: "wrap"
|
|
3512
|
-
} }, /* @__PURE__ */
|
|
4126
|
+
} }, /* @__PURE__ */ React20.createElement(Badge, { label: bill.status_label || "Unknown", bg: statusBadge.bg, text: statusBadge.text }), bill.introduced_at && /* @__PURE__ */ React20.createElement("span", { style: {
|
|
3513
4127
|
fontFamily: fonts.primary,
|
|
3514
4128
|
fontSize: fontSizes.xs,
|
|
3515
4129
|
color: colors.textMuted
|
|
3516
|
-
} }, formatDate2(bill.introduced_at)), /* @__PURE__ */
|
|
4130
|
+
} }, formatDate2(bill.introduced_at)), /* @__PURE__ */ React20.createElement("span", { style: {
|
|
3517
4131
|
fontFamily: fonts.primary,
|
|
3518
4132
|
fontSize: fontSizes.xs,
|
|
3519
4133
|
color: colors.textMuted,
|
|
3520
4134
|
fontStyle: "italic"
|
|
3521
4135
|
} }, bill.is_sponsor ? "Sponsored" : "Cosponsored")));
|
|
3522
|
-
})), !showAll && /* @__PURE__ */
|
|
4136
|
+
})), !showAll && /* @__PURE__ */ React20.createElement(
|
|
3523
4137
|
ShowAllLink,
|
|
3524
4138
|
{
|
|
3525
4139
|
totalCount: filtered.length,
|
|
@@ -3530,15 +4144,15 @@ function LegislationSection({ bills, isMobile }) {
|
|
|
3530
4144
|
}
|
|
3531
4145
|
function VotingSection({ votes, isMobile }) {
|
|
3532
4146
|
const years = getYears(votes, "vote_date");
|
|
3533
|
-
const [yearFilter, setYearFilter] =
|
|
3534
|
-
const [showAll, setShowAll] =
|
|
4147
|
+
const [yearFilter, setYearFilter] = useState10("All");
|
|
4148
|
+
const [showAll, setShowAll] = useState10(false);
|
|
3535
4149
|
const handleYearChange = (y) => {
|
|
3536
4150
|
setYearFilter(y);
|
|
3537
4151
|
setShowAll(false);
|
|
3538
4152
|
};
|
|
3539
4153
|
const filtered = yearFilter === "All" ? votes : votes.filter((v) => extractYear(v.vote_date) === yearFilter);
|
|
3540
4154
|
const visible = showAll ? filtered : filtered.slice(0, DEFAULT_LIMIT);
|
|
3541
|
-
return /* @__PURE__ */
|
|
4155
|
+
return /* @__PURE__ */ React20.createElement("div", { style: { marginBottom: spacing[8] } }, /* @__PURE__ */ React20.createElement(
|
|
3542
4156
|
SectionHeader,
|
|
3543
4157
|
{
|
|
3544
4158
|
title: "Voting Record",
|
|
@@ -3546,38 +4160,38 @@ function VotingSection({ votes, isMobile }) {
|
|
|
3546
4160
|
years,
|
|
3547
4161
|
onYearChange: handleYearChange
|
|
3548
4162
|
}
|
|
3549
|
-
), votes.length === 0 ? /* @__PURE__ */
|
|
4163
|
+
), votes.length === 0 ? /* @__PURE__ */ React20.createElement(EmptyState, { message: "Voting records are not available for this office." }) : /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement("div", null, visible.map((vote, i) => {
|
|
3550
4164
|
const positionBadge = getPositionBadge(vote.position);
|
|
3551
4165
|
const normPosition = normalizeText(vote.position);
|
|
3552
4166
|
const topic = vote.bill_title || vote.vote_question;
|
|
3553
4167
|
const sourceUrl = vote.bill_url;
|
|
3554
|
-
return /* @__PURE__ */
|
|
4168
|
+
return /* @__PURE__ */ React20.createElement("div", { key: i, style: {
|
|
3555
4169
|
display: "flex",
|
|
3556
4170
|
flexDirection: isMobile ? "column" : "row",
|
|
3557
4171
|
alignItems: isMobile ? "flex-start" : "center",
|
|
3558
4172
|
gap: isMobile ? spacing[1] : spacing[3],
|
|
3559
4173
|
padding: `${spacing[3]} 0`,
|
|
3560
4174
|
borderBottom: `1px solid ${colors.borderLight}`
|
|
3561
|
-
} }, /* @__PURE__ */
|
|
4175
|
+
} }, /* @__PURE__ */ React20.createElement("div", { style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React20.createElement("span", { style: {
|
|
3562
4176
|
fontFamily: fonts.primary,
|
|
3563
4177
|
fontSize: fontSizes.sm,
|
|
3564
4178
|
color: colors.textSecondary
|
|
3565
|
-
} }, topic)), /* @__PURE__ */
|
|
4179
|
+
} }, topic)), /* @__PURE__ */ React20.createElement("div", { style: {
|
|
3566
4180
|
display: "flex",
|
|
3567
4181
|
alignItems: "center",
|
|
3568
4182
|
gap: spacing[2],
|
|
3569
4183
|
flexShrink: 0,
|
|
3570
4184
|
flexWrap: "wrap"
|
|
3571
|
-
} }, vote.vote_date && /* @__PURE__ */
|
|
4185
|
+
} }, vote.vote_date && /* @__PURE__ */ React20.createElement("span", { style: {
|
|
3572
4186
|
fontFamily: fonts.primary,
|
|
3573
4187
|
fontSize: fontSizes.xs,
|
|
3574
4188
|
color: colors.textMuted
|
|
3575
|
-
} }, formatDate2(vote.vote_date)), /* @__PURE__ */
|
|
4189
|
+
} }, formatDate2(vote.vote_date)), /* @__PURE__ */ React20.createElement(Badge, { label: normPosition || "Unknown", bg: positionBadge.bg, text: positionBadge.text }), vote.result && /* @__PURE__ */ React20.createElement("span", { style: {
|
|
3576
4190
|
fontFamily: fonts.primary,
|
|
3577
4191
|
fontSize: fontSizes.xs,
|
|
3578
4192
|
color: vote.result === "Passed" ? colors.success : colors.textMuted,
|
|
3579
4193
|
fontWeight: fontWeights.medium
|
|
3580
|
-
} }, vote.result), sourceUrl && /* @__PURE__ */
|
|
4194
|
+
} }, vote.result), sourceUrl && /* @__PURE__ */ React20.createElement(
|
|
3581
4195
|
"a",
|
|
3582
4196
|
{
|
|
3583
4197
|
href: sourceUrl,
|
|
@@ -3598,7 +4212,7 @@ function VotingSection({ votes, isMobile }) {
|
|
|
3598
4212
|
},
|
|
3599
4213
|
"Source"
|
|
3600
4214
|
)));
|
|
3601
|
-
})), !showAll && /* @__PURE__ */
|
|
4215
|
+
})), !showAll && /* @__PURE__ */ React20.createElement(
|
|
3602
4216
|
ShowAllLink,
|
|
3603
4217
|
{
|
|
3604
4218
|
totalCount: filtered.length,
|
|
@@ -3617,20 +4231,20 @@ function LegislativeRecord({
|
|
|
3617
4231
|
}) {
|
|
3618
4232
|
const isMobile = useMediaQuery("(max-width: 768px)");
|
|
3619
4233
|
if (loading) {
|
|
3620
|
-
return /* @__PURE__ */
|
|
4234
|
+
return /* @__PURE__ */ React20.createElement(Spinner, null);
|
|
3621
4235
|
}
|
|
3622
|
-
return /* @__PURE__ */
|
|
4236
|
+
return /* @__PURE__ */ React20.createElement("div", { style: { fontFamily: fonts.primary } }, politicianName && /* @__PURE__ */ React20.createElement("h1", { style: {
|
|
3623
4237
|
fontFamily: fonts.primary,
|
|
3624
4238
|
fontSize: isMobile ? fontSizes["2xl"] : fontSizes["4xl"],
|
|
3625
4239
|
fontWeight: fontWeights.bold,
|
|
3626
4240
|
color: colors.evTeal,
|
|
3627
4241
|
marginBottom: spacing[8],
|
|
3628
4242
|
marginTop: 0
|
|
3629
|
-
} }, "Legislative Record: ", politicianName), /* @__PURE__ */
|
|
4243
|
+
} }, "Legislative Record: ", politicianName), /* @__PURE__ */ React20.createElement(CommitteesSection, { committees, leadership }), /* @__PURE__ */ React20.createElement(LegislationSection, { bills, isMobile }), /* @__PURE__ */ React20.createElement(VotingSection, { votes, isMobile }));
|
|
3630
4244
|
}
|
|
3631
4245
|
|
|
3632
4246
|
// src/JudicialRecordDetail.jsx
|
|
3633
|
-
import
|
|
4247
|
+
import React21 from "react";
|
|
3634
4248
|
var containerStyle = {
|
|
3635
4249
|
fontFamily: "'Manrope', sans-serif",
|
|
3636
4250
|
maxWidth: "800px"
|
|
@@ -3715,7 +4329,7 @@ var emptyStateStyle = {
|
|
|
3715
4329
|
function JudicialRecordDetail({ politician = {}, judicialRecord, onBack }) {
|
|
3716
4330
|
var _a;
|
|
3717
4331
|
if (!judicialRecord) {
|
|
3718
|
-
return /* @__PURE__ */
|
|
4332
|
+
return /* @__PURE__ */ React21.createElement("div", { style: containerStyle }, /* @__PURE__ */ React21.createElement("button", { style: backBtnStyle, onClick: onBack }, "\u2190 Back to Profile"), /* @__PURE__ */ React21.createElement("div", { style: emptyStateStyle }, "No judicial record data available."));
|
|
3719
4333
|
}
|
|
3720
4334
|
const {
|
|
3721
4335
|
judge_detail: detail,
|
|
@@ -3724,13 +4338,13 @@ function JudicialRecordDetail({ politician = {}, judicialRecord, onBack }) {
|
|
|
3724
4338
|
disciplinary_records: disciplinary = []
|
|
3725
4339
|
} = judicialRecord;
|
|
3726
4340
|
const displayName = politician.full_name || `${politician.first_name || ""} ${politician.last_name || ""}`.trim();
|
|
3727
|
-
return /* @__PURE__ */
|
|
4341
|
+
return /* @__PURE__ */ React21.createElement("div", { style: containerStyle }, /* @__PURE__ */ React21.createElement("button", { style: backBtnStyle, onClick: onBack }, "\u2190 Back to Profile"), /* @__PURE__ */ React21.createElement("h1", { style: nameStyle }, displayName), /* @__PURE__ */ React21.createElement("p", { style: roleStyle }, (detail == null ? void 0 : detail.court_role) || politician.office_title, (detail == null ? void 0 : detail.date_seated) && ` \xB7 Seated ${formatDate(detail.date_seated)}`), detail && /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement("h2", { style: sectionHeadingStyle }, "Background"), detail.appointed_by && /* @__PURE__ */ React21.createElement("div", { style: detailRowStyle }, /* @__PURE__ */ React21.createElement("span", { style: detailLabelStyle }, "Appointed by"), /* @__PURE__ */ React21.createElement("span", { style: detailValueStyle }, detail.appointed_by, " (", detail.appointing_president_party, ")")), detail.confirmation_vote && /* @__PURE__ */ React21.createElement("div", { style: detailRowStyle }, /* @__PURE__ */ React21.createElement("span", { style: detailLabelStyle }, "Confirmation Vote"), /* @__PURE__ */ React21.createElement("span", { style: detailValueStyle }, detail.confirmation_vote)), detail.election_type && /* @__PURE__ */ React21.createElement("div", { style: detailRowStyle }, /* @__PURE__ */ React21.createElement("span", { style: detailLabelStyle }, "Election Type"), /* @__PURE__ */ React21.createElement("span", { style: detailValueStyle }, detail.election_type === "retention" ? "Retention (Yes/No)" : "Contested Election")), ((_a = detail.areas_of_focus) == null ? void 0 : _a.length) > 0 && /* @__PURE__ */ React21.createElement("div", { style: detailRowStyle }, /* @__PURE__ */ React21.createElement("span", { style: detailLabelStyle }, "Areas of Focus"), /* @__PURE__ */ React21.createElement("span", { style: detailValueStyle }, detail.areas_of_focus.join(", ")))), /* @__PURE__ */ React21.createElement("h2", { style: sectionHeadingStyle }, "Performance Evaluations"), evaluations.length === 0 ? /* @__PURE__ */ React21.createElement("div", { style: emptyStateStyle }, "No evaluation data available yet.") : /* @__PURE__ */ React21.createElement("table", { style: tableStyle }, /* @__PURE__ */ React21.createElement("thead", null, /* @__PURE__ */ React21.createElement("tr", null, /* @__PURE__ */ React21.createElement("th", { style: thStyle }, "Source"), /* @__PURE__ */ React21.createElement("th", { style: thStyle }, "Rating"), /* @__PURE__ */ React21.createElement("th", { style: thStyle }, "Date"))), /* @__PURE__ */ React21.createElement("tbody", null, evaluations.map((ev, i) => /* @__PURE__ */ React21.createElement("tr", { key: i }, /* @__PURE__ */ React21.createElement("td", { style: tdStyle }, ev.source_url ? /* @__PURE__ */ React21.createElement("a", { href: ev.source_url, target: "_blank", rel: "noopener noreferrer", style: { color: "#319795" } }, ev.source) : ev.source), /* @__PURE__ */ React21.createElement("td", { style: { ...tdStyle, fontWeight: 600 } }, ev.rating), /* @__PURE__ */ React21.createElement("td", { style: tdStyle }, formatDate(ev.rating_date)))))), /* @__PURE__ */ React21.createElement("h2", { style: sectionHeadingStyle }, "Performance Metrics"), metrics.length === 0 ? /* @__PURE__ */ React21.createElement("div", { style: emptyStateStyle }, "No performance metric data available yet.") : /* @__PURE__ */ React21.createElement("table", { style: tableStyle }, /* @__PURE__ */ React21.createElement("thead", null, /* @__PURE__ */ React21.createElement("tr", null, /* @__PURE__ */ React21.createElement("th", { style: thStyle }, "Metric"), /* @__PURE__ */ React21.createElement("th", { style: thStyle }, "Value"), /* @__PURE__ */ React21.createElement("th", { style: thStyle }, "Context"), /* @__PURE__ */ React21.createElement("th", { style: thStyle }, "Period"))), /* @__PURE__ */ React21.createElement("tbody", null, metrics.map((m, i) => /* @__PURE__ */ React21.createElement("tr", { key: i }, /* @__PURE__ */ React21.createElement("td", { style: { ...tdStyle, fontWeight: 600 } }, METRIC_LABELS[m.metric_type] || m.metric_type.replace(/_/g, " ")), /* @__PURE__ */ React21.createElement("td", { style: tdStyle }, formatMetricValue(m.metric_type, m.value)), /* @__PURE__ */ React21.createElement("td", { style: { ...tdStyle, color: "#718096", fontSize: "13px" } }, m.context_label), /* @__PURE__ */ React21.createElement("td", { style: tdStyle }, m.time_period))))), disciplinary.length > 0 && /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement("h2", { style: sectionHeadingStyle }, "Disciplinary History"), disciplinary.map((d, i) => /* @__PURE__ */ React21.createElement("div", { key: i, style: {
|
|
3728
4342
|
borderLeft: "3px solid #fc8181",
|
|
3729
4343
|
backgroundColor: "#fff5f5",
|
|
3730
4344
|
borderRadius: "0 6px 6px 0",
|
|
3731
4345
|
padding: "12px 16px",
|
|
3732
4346
|
marginBottom: "10px"
|
|
3733
|
-
} }, /* @__PURE__ */
|
|
4347
|
+
} }, /* @__PURE__ */ React21.createElement("div", { style: { fontWeight: 700, color: "#742a2a", fontSize: "14px" } }, d.record_type, " \u2014 ", formatDate(d.record_date)), d.description && /* @__PURE__ */ React21.createElement("div", { style: { color: "#9b2c2c", fontSize: "13px", marginTop: "4px" } }, d.description), d.source_url && /* @__PURE__ */ React21.createElement(
|
|
3734
4348
|
"a",
|
|
3735
4349
|
{
|
|
3736
4350
|
href: d.source_url,
|
|
@@ -3743,7 +4357,7 @@ function JudicialRecordDetail({ politician = {}, judicialRecord, onBack }) {
|
|
|
3743
4357
|
}
|
|
3744
4358
|
|
|
3745
4359
|
// src/AuthForm.jsx
|
|
3746
|
-
import
|
|
4360
|
+
import React22, { useState as useState11 } from "react";
|
|
3747
4361
|
function AuthForm({
|
|
3748
4362
|
logoSrc = "/EVLogo.svg",
|
|
3749
4363
|
appName = "Empowered Vote",
|
|
@@ -3754,11 +4368,11 @@ function AuthForm({
|
|
|
3754
4368
|
error = null,
|
|
3755
4369
|
submitting = false
|
|
3756
4370
|
}) {
|
|
3757
|
-
const [username, setUsername] =
|
|
3758
|
-
const [password, setPassword] =
|
|
3759
|
-
const [confirmPassword, setConfirmPassword] =
|
|
3760
|
-
const [showPasswords, setShowPasswords] =
|
|
3761
|
-
const [passwordMismatch, setPasswordMismatch] =
|
|
4371
|
+
const [username, setUsername] = useState11("");
|
|
4372
|
+
const [password, setPassword] = useState11("");
|
|
4373
|
+
const [confirmPassword, setConfirmPassword] = useState11("");
|
|
4374
|
+
const [showPasswords, setShowPasswords] = useState11(false);
|
|
4375
|
+
const [passwordMismatch, setPasswordMismatch] = useState11(false);
|
|
3762
4376
|
const isLogin = mode === "login";
|
|
3763
4377
|
const handleSubmit = (e) => {
|
|
3764
4378
|
e.preventDefault();
|
|
@@ -3770,7 +4384,7 @@ function AuthForm({
|
|
|
3770
4384
|
setPasswordMismatch(false);
|
|
3771
4385
|
onSubmit == null ? void 0 : onSubmit(username.trim(), password);
|
|
3772
4386
|
};
|
|
3773
|
-
const EyeOpen = () => /* @__PURE__ */
|
|
4387
|
+
const EyeOpen = () => /* @__PURE__ */ React22.createElement(
|
|
3774
4388
|
"svg",
|
|
3775
4389
|
{
|
|
3776
4390
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3780,7 +4394,7 @@ function AuthForm({
|
|
|
3780
4394
|
stroke: "currentColor",
|
|
3781
4395
|
style: { width: "20px", height: "20px" }
|
|
3782
4396
|
},
|
|
3783
|
-
/* @__PURE__ */
|
|
4397
|
+
/* @__PURE__ */ React22.createElement(
|
|
3784
4398
|
"path",
|
|
3785
4399
|
{
|
|
3786
4400
|
strokeLinecap: "round",
|
|
@@ -3788,7 +4402,7 @@ function AuthForm({
|
|
|
3788
4402
|
d: "M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"
|
|
3789
4403
|
}
|
|
3790
4404
|
),
|
|
3791
|
-
/* @__PURE__ */
|
|
4405
|
+
/* @__PURE__ */ React22.createElement(
|
|
3792
4406
|
"path",
|
|
3793
4407
|
{
|
|
3794
4408
|
strokeLinecap: "round",
|
|
@@ -3797,7 +4411,7 @@ function AuthForm({
|
|
|
3797
4411
|
}
|
|
3798
4412
|
)
|
|
3799
4413
|
);
|
|
3800
|
-
const EyeClosed = () => /* @__PURE__ */
|
|
4414
|
+
const EyeClosed = () => /* @__PURE__ */ React22.createElement(
|
|
3801
4415
|
"svg",
|
|
3802
4416
|
{
|
|
3803
4417
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3807,7 +4421,7 @@ function AuthForm({
|
|
|
3807
4421
|
stroke: "currentColor",
|
|
3808
4422
|
style: { width: "20px", height: "20px" }
|
|
3809
4423
|
},
|
|
3810
|
-
/* @__PURE__ */
|
|
4424
|
+
/* @__PURE__ */ React22.createElement(
|
|
3811
4425
|
"path",
|
|
3812
4426
|
{
|
|
3813
4427
|
strokeLinecap: "round",
|
|
@@ -3816,17 +4430,17 @@ function AuthForm({
|
|
|
3816
4430
|
}
|
|
3817
4431
|
)
|
|
3818
4432
|
);
|
|
3819
|
-
const PasswordToggle = () => /* @__PURE__ */
|
|
4433
|
+
const PasswordToggle = () => /* @__PURE__ */ React22.createElement(
|
|
3820
4434
|
"button",
|
|
3821
4435
|
{
|
|
3822
4436
|
type: "button",
|
|
3823
4437
|
onClick: () => setShowPasswords((prev) => !prev),
|
|
3824
4438
|
style: styles.passwordToggle
|
|
3825
4439
|
},
|
|
3826
|
-
showPasswords ? /* @__PURE__ */
|
|
4440
|
+
showPasswords ? /* @__PURE__ */ React22.createElement(EyeOpen, null) : /* @__PURE__ */ React22.createElement(EyeClosed, null)
|
|
3827
4441
|
);
|
|
3828
4442
|
const displayError = passwordMismatch ? "Passwords do not match." : error;
|
|
3829
|
-
return /* @__PURE__ */
|
|
4443
|
+
return /* @__PURE__ */ React22.createElement("div", { style: styles.wrapper }, /* @__PURE__ */ React22.createElement("div", { style: styles.container }, /* @__PURE__ */ React22.createElement("div", { style: styles.header }, logoSrc && /* @__PURE__ */ React22.createElement("img", { src: logoSrc, alt: appName, style: styles.logo }), appName && /* @__PURE__ */ React22.createElement("h1", { style: styles.appName }, appName), appSubtitle && /* @__PURE__ */ React22.createElement("p", { style: styles.appSubtitle }, appSubtitle)), /* @__PURE__ */ React22.createElement("form", { onSubmit: handleSubmit, style: styles.card }, /* @__PURE__ */ React22.createElement("h2", { style: styles.cardTitle }, isLogin ? "Welcome Back" : "Create Account"), /* @__PURE__ */ React22.createElement("div", { style: styles.fieldGroup }, /* @__PURE__ */ React22.createElement("label", { style: styles.label }, "Username"), /* @__PURE__ */ React22.createElement(
|
|
3830
4444
|
"input",
|
|
3831
4445
|
{
|
|
3832
4446
|
type: "text",
|
|
@@ -3843,7 +4457,7 @@ function AuthForm({
|
|
|
3843
4457
|
},
|
|
3844
4458
|
required: true
|
|
3845
4459
|
}
|
|
3846
|
-
)), /* @__PURE__ */
|
|
4460
|
+
)), /* @__PURE__ */ React22.createElement("div", { style: styles.fieldGroup }, /* @__PURE__ */ React22.createElement("label", { style: styles.label }, "Password"), /* @__PURE__ */ React22.createElement("div", { style: styles.passwordWrapper }, /* @__PURE__ */ React22.createElement(
|
|
3847
4461
|
"input",
|
|
3848
4462
|
{
|
|
3849
4463
|
type: showPasswords ? "text" : "password",
|
|
@@ -3859,7 +4473,7 @@ function AuthForm({
|
|
|
3859
4473
|
},
|
|
3860
4474
|
required: true
|
|
3861
4475
|
}
|
|
3862
|
-
), /* @__PURE__ */
|
|
4476
|
+
), /* @__PURE__ */ React22.createElement(PasswordToggle, null))), !isLogin && /* @__PURE__ */ React22.createElement("div", { style: styles.fieldGroup }, /* @__PURE__ */ React22.createElement("label", { style: styles.label }, "Confirm Password"), /* @__PURE__ */ React22.createElement("div", { style: styles.passwordWrapper }, /* @__PURE__ */ React22.createElement(
|
|
3863
4477
|
"input",
|
|
3864
4478
|
{
|
|
3865
4479
|
type: showPasswords ? "text" : "password",
|
|
@@ -3875,7 +4489,7 @@ function AuthForm({
|
|
|
3875
4489
|
},
|
|
3876
4490
|
required: true
|
|
3877
4491
|
}
|
|
3878
|
-
), /* @__PURE__ */
|
|
4492
|
+
), /* @__PURE__ */ React22.createElement(PasswordToggle, null))), displayError && /* @__PURE__ */ React22.createElement("div", { style: styles.errorBox }, /* @__PURE__ */ React22.createElement("p", { style: styles.errorText }, displayError)), /* @__PURE__ */ React22.createElement(
|
|
3879
4493
|
"button",
|
|
3880
4494
|
{
|
|
3881
4495
|
type: "submit",
|
|
@@ -3893,7 +4507,7 @@ function AuthForm({
|
|
|
3893
4507
|
}
|
|
3894
4508
|
},
|
|
3895
4509
|
submitting ? isLogin ? "Signing In..." : "Creating Account..." : isLogin ? "Sign In" : "Create Account"
|
|
3896
|
-
), onModeSwitch && /* @__PURE__ */
|
|
4510
|
+
), onModeSwitch && /* @__PURE__ */ React22.createElement("div", { style: styles.modeSwitch }, /* @__PURE__ */ React22.createElement("p", { style: styles.modeSwitchText }, isLogin ? "Don't have an account?" : "Already have an account?"), /* @__PURE__ */ React22.createElement(
|
|
3897
4511
|
"button",
|
|
3898
4512
|
{
|
|
3899
4513
|
type: "button",
|
|
@@ -4066,9 +4680,9 @@ var styles = {
|
|
|
4066
4680
|
};
|
|
4067
4681
|
|
|
4068
4682
|
// src/TopicTierBadge.jsx
|
|
4069
|
-
import
|
|
4683
|
+
import React23 from "react";
|
|
4070
4684
|
function LandmarkIcon({ size = 14 }) {
|
|
4071
|
-
return /* @__PURE__ */
|
|
4685
|
+
return /* @__PURE__ */ React23.createElement(
|
|
4072
4686
|
"svg",
|
|
4073
4687
|
{
|
|
4074
4688
|
width: size,
|
|
@@ -4082,16 +4696,16 @@ function LandmarkIcon({ size = 14 }) {
|
|
|
4082
4696
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4083
4697
|
"aria-hidden": "true"
|
|
4084
4698
|
},
|
|
4085
|
-
/* @__PURE__ */
|
|
4086
|
-
/* @__PURE__ */
|
|
4087
|
-
/* @__PURE__ */
|
|
4088
|
-
/* @__PURE__ */
|
|
4089
|
-
/* @__PURE__ */
|
|
4090
|
-
/* @__PURE__ */
|
|
4699
|
+
/* @__PURE__ */ React23.createElement("path", { d: "M10 18v-7" }),
|
|
4700
|
+
/* @__PURE__ */ React23.createElement("path", { d: "M11.12 2.198a2 2 0 0 1 1.76.006l7.866 3.847c.476.233.31.949-.22.949H3.474c-.53 0-.695-.716-.22-.949z" }),
|
|
4701
|
+
/* @__PURE__ */ React23.createElement("path", { d: "M14 18v-7" }),
|
|
4702
|
+
/* @__PURE__ */ React23.createElement("path", { d: "M18 18v-7" }),
|
|
4703
|
+
/* @__PURE__ */ React23.createElement("path", { d: "M3 22h18" }),
|
|
4704
|
+
/* @__PURE__ */ React23.createElement("path", { d: "M6 18v-7" })
|
|
4091
4705
|
);
|
|
4092
4706
|
}
|
|
4093
4707
|
function Building2Icon({ size = 14 }) {
|
|
4094
|
-
return /* @__PURE__ */
|
|
4708
|
+
return /* @__PURE__ */ React23.createElement(
|
|
4095
4709
|
"svg",
|
|
4096
4710
|
{
|
|
4097
4711
|
width: size,
|
|
@@ -4105,17 +4719,17 @@ function Building2Icon({ size = 14 }) {
|
|
|
4105
4719
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4106
4720
|
"aria-hidden": "true"
|
|
4107
4721
|
},
|
|
4108
|
-
/* @__PURE__ */
|
|
4109
|
-
/* @__PURE__ */
|
|
4110
|
-
/* @__PURE__ */
|
|
4111
|
-
/* @__PURE__ */
|
|
4112
|
-
/* @__PURE__ */
|
|
4113
|
-
/* @__PURE__ */
|
|
4114
|
-
/* @__PURE__ */
|
|
4722
|
+
/* @__PURE__ */ React23.createElement("path", { d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z" }),
|
|
4723
|
+
/* @__PURE__ */ React23.createElement("path", { d: "M6 12H4a2 2 0 0 0-2 2v8h4" }),
|
|
4724
|
+
/* @__PURE__ */ React23.createElement("path", { d: "M18 9h2a2 2 0 0 1 2 2v11h-4" }),
|
|
4725
|
+
/* @__PURE__ */ React23.createElement("path", { d: "M10 6h4" }),
|
|
4726
|
+
/* @__PURE__ */ React23.createElement("path", { d: "M10 10h4" }),
|
|
4727
|
+
/* @__PURE__ */ React23.createElement("path", { d: "M10 14h4" }),
|
|
4728
|
+
/* @__PURE__ */ React23.createElement("path", { d: "M10 18h4" })
|
|
4115
4729
|
);
|
|
4116
4730
|
}
|
|
4117
4731
|
function HomeIcon({ size = 14 }) {
|
|
4118
|
-
return /* @__PURE__ */
|
|
4732
|
+
return /* @__PURE__ */ React23.createElement(
|
|
4119
4733
|
"svg",
|
|
4120
4734
|
{
|
|
4121
4735
|
width: size,
|
|
@@ -4129,8 +4743,8 @@ function HomeIcon({ size = 14 }) {
|
|
|
4129
4743
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4130
4744
|
"aria-hidden": "true"
|
|
4131
4745
|
},
|
|
4132
|
-
/* @__PURE__ */
|
|
4133
|
-
/* @__PURE__ */
|
|
4746
|
+
/* @__PURE__ */ React23.createElement("path", { d: "m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" }),
|
|
4747
|
+
/* @__PURE__ */ React23.createElement("polyline", { points: "9 22 9 12 15 12 15 22" })
|
|
4134
4748
|
);
|
|
4135
4749
|
}
|
|
4136
4750
|
var TIER_INFO = {
|
|
@@ -4190,7 +4804,7 @@ function TopicTierBadge({
|
|
|
4190
4804
|
userSelect: "none"
|
|
4191
4805
|
};
|
|
4192
4806
|
};
|
|
4193
|
-
return /* @__PURE__ */
|
|
4807
|
+
return /* @__PURE__ */ React23.createElement(
|
|
4194
4808
|
"span",
|
|
4195
4809
|
{
|
|
4196
4810
|
className: "ev-topic-tier-badge",
|
|
@@ -4200,13 +4814,13 @@ function TopicTierBadge({
|
|
|
4200
4814
|
},
|
|
4201
4815
|
effectiveTiers.map((tier) => {
|
|
4202
4816
|
const { label, Icon } = TIER_INFO[tier];
|
|
4203
|
-
return /* @__PURE__ */
|
|
4817
|
+
return /* @__PURE__ */ React23.createElement("span", { key: tier, style: itemStyle(tier) }, /* @__PURE__ */ React23.createElement(Icon, { size: sizeStyle.iconSize }), !iconOnly && /* @__PURE__ */ React23.createElement("span", null, label));
|
|
4204
4818
|
})
|
|
4205
4819
|
);
|
|
4206
4820
|
}
|
|
4207
4821
|
|
|
4208
4822
|
// src/CompassCoverageCallout.jsx
|
|
4209
|
-
import
|
|
4823
|
+
import React24, { useState as useState12 } from "react";
|
|
4210
4824
|
var TIER_LABELS = {
|
|
4211
4825
|
federal: "federal",
|
|
4212
4826
|
state: "state",
|
|
@@ -4219,7 +4833,7 @@ function CompassCoverageCallout({
|
|
|
4219
4833
|
compassUrl,
|
|
4220
4834
|
onDismiss
|
|
4221
4835
|
}) {
|
|
4222
|
-
const [dismissed, setDismissed] =
|
|
4836
|
+
const [dismissed, setDismissed] = useState12(false);
|
|
4223
4837
|
if (dismissed) return null;
|
|
4224
4838
|
const tierLabel = TIER_LABELS[tier] || tier;
|
|
4225
4839
|
const tierStyle = tierColors[tier] || tierColors.federal;
|
|
@@ -4270,15 +4884,15 @@ function CompassCoverageCallout({
|
|
|
4270
4884
|
setDismissed(true);
|
|
4271
4885
|
if (onDismiss) onDismiss();
|
|
4272
4886
|
};
|
|
4273
|
-
return /* @__PURE__ */
|
|
4887
|
+
return /* @__PURE__ */ React24.createElement(
|
|
4274
4888
|
"div",
|
|
4275
4889
|
{
|
|
4276
4890
|
className: "ev-compass-coverage-callout",
|
|
4277
4891
|
role: "status",
|
|
4278
4892
|
style: containerStyle2
|
|
4279
4893
|
},
|
|
4280
|
-
/* @__PURE__ */
|
|
4281
|
-
onDismiss !== void 0 && /* @__PURE__ */
|
|
4894
|
+
/* @__PURE__ */ React24.createElement("div", { style: textStyle }, /* @__PURE__ */ React24.createElement("div", { style: headlineStyle }, "Your compass covers ", tierLabel, " issues lightly"), /* @__PURE__ */ React24.createElement("div", null, count === 0 ? `None of your ${totalSelected != null ? totalSelected : "selected"} compass topics apply at the ${tierLabel} level. ` : `Only ${count} of your ${totalSelected != null ? totalSelected : "selected"} compass topics apply at the ${tierLabel} level. `, "Add more ", tierLabel, "-applicable topics to get better comparisons with ", tierLabel, " officials."), /* @__PURE__ */ React24.createElement("a", { href: compassUrl, style: ctaStyle }, "Add ", tierLabel, " topics \u2192")),
|
|
4895
|
+
onDismiss !== void 0 && /* @__PURE__ */ React24.createElement(
|
|
4282
4896
|
"button",
|
|
4283
4897
|
{
|
|
4284
4898
|
onClick: handleDismiss,
|
|
@@ -4291,7 +4905,7 @@ function CompassCoverageCallout({
|
|
|
4291
4905
|
}
|
|
4292
4906
|
|
|
4293
4907
|
// src/ExpandCompassNudge.jsx
|
|
4294
|
-
import
|
|
4908
|
+
import React25 from "react";
|
|
4295
4909
|
function ExpandCompassNudge({
|
|
4296
4910
|
politicianName,
|
|
4297
4911
|
missingCount,
|
|
@@ -4338,7 +4952,7 @@ function ExpandCompassNudge({
|
|
|
4338
4952
|
};
|
|
4339
4953
|
const topicsLabel = missingCount === 1 ? "topic" : "topics";
|
|
4340
4954
|
const speakerName = politicianName || "This politician";
|
|
4341
|
-
return /* @__PURE__ */
|
|
4955
|
+
return /* @__PURE__ */ React25.createElement("div", { className: "ev-expand-compass-nudge", style: containerStyle2, role: "region" }, /* @__PURE__ */ React25.createElement("p", { style: headlineStyle }, "Want a richer comparison?"), /* @__PURE__ */ React25.createElement("p", { style: bodyStyle }, speakerName, " has stances on ", missingCount, " more ", topicsLabel, " you haven't answered yet. Expand your compass to see where you stand on all of them."), /* @__PURE__ */ React25.createElement("a", { href: compassUrl, style: ctaStyle }, "Expand my compass \u2192"));
|
|
4342
4956
|
}
|
|
4343
4957
|
|
|
4344
4958
|
// src/computeTierCoverage.js
|
|
@@ -4359,14 +4973,14 @@ function computeTierCoverage(topics) {
|
|
|
4359
4973
|
}
|
|
4360
4974
|
|
|
4361
4975
|
// src/StanceAccordion.jsx
|
|
4362
|
-
import
|
|
4976
|
+
import React27, { useState as useState13, useRef as useRef3, useCallback, useEffect as useEffect7 } from "react";
|
|
4363
4977
|
|
|
4364
4978
|
// src/Favicon.jsx
|
|
4365
|
-
import
|
|
4979
|
+
import React26 from "react";
|
|
4366
4980
|
function Favicon({ url, size = 16 }) {
|
|
4367
4981
|
try {
|
|
4368
4982
|
const domain = new URL(url).hostname;
|
|
4369
|
-
return /* @__PURE__ */
|
|
4983
|
+
return /* @__PURE__ */ React26.createElement(
|
|
4370
4984
|
"img",
|
|
4371
4985
|
{
|
|
4372
4986
|
src: `https://www.google.com/s2/favicons?sz=${size}&domain=${domain}`,
|
|
@@ -4377,7 +4991,7 @@ function Favicon({ url, size = 16 }) {
|
|
|
4377
4991
|
}
|
|
4378
4992
|
);
|
|
4379
4993
|
} catch {
|
|
4380
|
-
return /* @__PURE__ */
|
|
4994
|
+
return /* @__PURE__ */ React26.createElement(
|
|
4381
4995
|
"svg",
|
|
4382
4996
|
{
|
|
4383
4997
|
width: size,
|
|
@@ -4388,8 +5002,8 @@ function Favicon({ url, size = 16 }) {
|
|
|
4388
5002
|
strokeWidth: "1.5",
|
|
4389
5003
|
style: { verticalAlign: "middle", flexShrink: 0 }
|
|
4390
5004
|
},
|
|
4391
|
-
/* @__PURE__ */
|
|
4392
|
-
/* @__PURE__ */
|
|
5005
|
+
/* @__PURE__ */ React26.createElement("circle", { cx: "12", cy: "12", r: "10" }),
|
|
5006
|
+
/* @__PURE__ */ React26.createElement("path", { d: "M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" })
|
|
4393
5007
|
);
|
|
4394
5008
|
}
|
|
4395
5009
|
}
|
|
@@ -4420,9 +5034,9 @@ function StanceAccordion({
|
|
|
4420
5034
|
apiUrl = "https://api.empowered.vote"
|
|
4421
5035
|
}) {
|
|
4422
5036
|
var _a;
|
|
4423
|
-
const [expandedTopicId, setExpandedTopicId] =
|
|
4424
|
-
const [loadingId, setLoadingId] =
|
|
4425
|
-
const [showAll, setShowAll] =
|
|
5037
|
+
const [expandedTopicId, setExpandedTopicId] = useState13(null);
|
|
5038
|
+
const [loadingId, setLoadingId] = useState13(null);
|
|
5039
|
+
const [showAll, setShowAll] = useState13(false);
|
|
4426
5040
|
const contextCache = useRef3(/* @__PURE__ */ new Map());
|
|
4427
5041
|
const quotesCache = useRef3(null);
|
|
4428
5042
|
const polAnswerMap = {};
|
|
@@ -4500,7 +5114,7 @@ function StanceAccordion({
|
|
|
4500
5114
|
},
|
|
4501
5115
|
[expandedTopicId, politicianId, apiUrl]
|
|
4502
5116
|
);
|
|
4503
|
-
|
|
5117
|
+
useEffect7(() => {
|
|
4504
5118
|
if (initialExpandedTopicId && topics && topics.length > 0) {
|
|
4505
5119
|
handleToggle(String(initialExpandedTopicId));
|
|
4506
5120
|
}
|
|
@@ -4516,13 +5130,13 @@ function StanceAccordion({
|
|
|
4516
5130
|
visibleTopics = [pinned, ...baseTopics.filter((t) => String(t.id) !== String(initialExpandedTopicId))];
|
|
4517
5131
|
}
|
|
4518
5132
|
}
|
|
4519
|
-
return /* @__PURE__ */
|
|
5133
|
+
return /* @__PURE__ */ React27.createElement(
|
|
4520
5134
|
"div",
|
|
4521
5135
|
{
|
|
4522
5136
|
className: "flex flex-col",
|
|
4523
5137
|
style: { fontFamily: "'Manrope', sans-serif" }
|
|
4524
5138
|
},
|
|
4525
|
-
/* @__PURE__ */
|
|
5139
|
+
/* @__PURE__ */ React27.createElement(
|
|
4526
5140
|
"h3",
|
|
4527
5141
|
{
|
|
4528
5142
|
className: "text-sm font-semibold text-neutral-400 uppercase tracking-wider mb-2",
|
|
@@ -4544,15 +5158,15 @@ function StanceAccordion({
|
|
|
4544
5158
|
if (topic.topic_key) return q.issue === topic.topic_key;
|
|
4545
5159
|
return topic.short_title && q.issue.toLowerCase() === topic.short_title.toLowerCase();
|
|
4546
5160
|
}) : [];
|
|
4547
|
-
return /* @__PURE__ */
|
|
5161
|
+
return /* @__PURE__ */ React27.createElement("div", { key: topicId, className: "border-b border-neutral-100" }, /* @__PURE__ */ React27.createElement(
|
|
4548
5162
|
"button",
|
|
4549
5163
|
{
|
|
4550
5164
|
type: "button",
|
|
4551
5165
|
onClick: () => handleToggle(topicId),
|
|
4552
5166
|
className: "w-full flex items-center justify-between py-3 px-2 text-left cursor-pointer hover:bg-neutral-50 transition-colors"
|
|
4553
5167
|
},
|
|
4554
|
-
/* @__PURE__ */
|
|
4555
|
-
/* @__PURE__ */
|
|
5168
|
+
/* @__PURE__ */ React27.createElement("div", { className: "flex flex-col min-w-0" }, /* @__PURE__ */ React27.createElement("span", { className: "text-sm font-medium text-neutral-800 truncate" }, topic.short_title), questionText && /* @__PURE__ */ React27.createElement("span", { className: "text-xs text-neutral-400 mt-0.5" }, questionText), /* @__PURE__ */ React27.createElement("span", { className: "text-xs text-neutral-500 mt-0.5" }, label)),
|
|
5169
|
+
/* @__PURE__ */ React27.createElement(
|
|
4556
5170
|
"svg",
|
|
4557
5171
|
{
|
|
4558
5172
|
width: "16",
|
|
@@ -4569,9 +5183,9 @@ function StanceAccordion({
|
|
|
4569
5183
|
transition: "transform 0.2s ease"
|
|
4570
5184
|
}
|
|
4571
5185
|
},
|
|
4572
|
-
/* @__PURE__ */
|
|
5186
|
+
/* @__PURE__ */ React27.createElement("polyline", { points: "9 18 15 12 9 6" })
|
|
4573
5187
|
)
|
|
4574
|
-
), /* @__PURE__ */
|
|
5188
|
+
), /* @__PURE__ */ React27.createElement(
|
|
4575
5189
|
"div",
|
|
4576
5190
|
{
|
|
4577
5191
|
style: {
|
|
@@ -4580,7 +5194,7 @@ function StanceAccordion({
|
|
|
4580
5194
|
transition: "grid-template-rows 0.25s ease"
|
|
4581
5195
|
}
|
|
4582
5196
|
},
|
|
4583
|
-
/* @__PURE__ */
|
|
5197
|
+
/* @__PURE__ */ React27.createElement("div", { style: { overflow: "hidden" } }, /* @__PURE__ */ React27.createElement("div", { className: "px-2 pb-4" }, isLoading && /* @__PURE__ */ React27.createElement("div", { className: "flex items-center py-3" }, /* @__PURE__ */ React27.createElement(
|
|
4584
5198
|
"div",
|
|
4585
5199
|
{
|
|
4586
5200
|
style: {
|
|
@@ -4592,14 +5206,14 @@ function StanceAccordion({
|
|
|
4592
5206
|
animation: "ev-spin 0.8s linear infinite"
|
|
4593
5207
|
}
|
|
4594
5208
|
}
|
|
4595
|
-
)), !isLoading && cached && /* @__PURE__ */
|
|
5209
|
+
)), !isLoading && cached && /* @__PURE__ */ React27.createElement(React27.Fragment, null, cached.reasoning ? /* @__PURE__ */ React27.createElement(
|
|
4596
5210
|
"p",
|
|
4597
5211
|
{
|
|
4598
5212
|
className: "text-sm text-neutral-700 mb-3",
|
|
4599
5213
|
style: { whiteSpace: "pre-wrap", lineHeight: 1.6 }
|
|
4600
5214
|
},
|
|
4601
5215
|
cached.reasoning
|
|
4602
|
-
) : null, cached.sources && cached.sources.length > 0 && /* @__PURE__ */
|
|
5216
|
+
) : null, cached.sources && cached.sources.length > 0 && /* @__PURE__ */ React27.createElement("div", { className: "mt-2" }, /* @__PURE__ */ React27.createElement("p", { className: "text-xs font-semibold text-neutral-500 uppercase tracking-wider mb-1.5" }, "References"), /* @__PURE__ */ React27.createElement("ol", { className: "list-decimal list-inside space-y-1" }, cached.sources.map((src, i) => /* @__PURE__ */ React27.createElement("li", { key: i, className: "text-xs text-neutral-600" }, /* @__PURE__ */ React27.createElement(
|
|
4603
5217
|
"a",
|
|
4604
5218
|
{
|
|
4605
5219
|
href: src,
|
|
@@ -4607,9 +5221,9 @@ function StanceAccordion({
|
|
|
4607
5221
|
rel: "noreferrer",
|
|
4608
5222
|
className: "inline-flex items-center gap-1.5 hover:text-[#00657c] transition-colors"
|
|
4609
5223
|
},
|
|
4610
|
-
/* @__PURE__ */
|
|
4611
|
-
/* @__PURE__ */
|
|
4612
|
-
))))), topicQuotes.length > 0 && /* @__PURE__ */
|
|
5224
|
+
/* @__PURE__ */ React27.createElement(Favicon, { url: src }),
|
|
5225
|
+
/* @__PURE__ */ React27.createElement("span", { className: "underline underline-offset-2" }, getDisplayUrl(src))
|
|
5226
|
+
))))), topicQuotes.length > 0 && /* @__PURE__ */ React27.createElement("div", { style: { marginTop: "12px" } }, /* @__PURE__ */ React27.createElement(
|
|
4613
5227
|
"p",
|
|
4614
5228
|
{
|
|
4615
5229
|
style: {
|
|
@@ -4626,7 +5240,7 @@ function StanceAccordion({
|
|
|
4626
5240
|
const verdict = verdictsByQuote ? verdictsByQuote[quote.id] : void 0;
|
|
4627
5241
|
const borderColor = verdict === "agreed" ? "#0e7490" : verdict === "disagreed" ? "#b45309" : "#e2e8f0";
|
|
4628
5242
|
const sourceName = quote.source_name || quote.sourceName;
|
|
4629
|
-
return /* @__PURE__ */
|
|
5243
|
+
return /* @__PURE__ */ React27.createElement(
|
|
4630
5244
|
"div",
|
|
4631
5245
|
{
|
|
4632
5246
|
key: quote.id,
|
|
@@ -4638,7 +5252,7 @@ function StanceAccordion({
|
|
|
4638
5252
|
marginBottom: "8px"
|
|
4639
5253
|
}
|
|
4640
5254
|
},
|
|
4641
|
-
/* @__PURE__ */
|
|
5255
|
+
/* @__PURE__ */ React27.createElement(
|
|
4642
5256
|
"p",
|
|
4643
5257
|
{
|
|
4644
5258
|
style: {
|
|
@@ -4651,7 +5265,7 @@ function StanceAccordion({
|
|
|
4651
5265
|
},
|
|
4652
5266
|
quote.text
|
|
4653
5267
|
),
|
|
4654
|
-
verdict === "agreed" && /* @__PURE__ */
|
|
5268
|
+
verdict === "agreed" && /* @__PURE__ */ React27.createElement(
|
|
4655
5269
|
"span",
|
|
4656
5270
|
{
|
|
4657
5271
|
style: {
|
|
@@ -4668,10 +5282,10 @@ function StanceAccordion({
|
|
|
4668
5282
|
flexShrink: 0
|
|
4669
5283
|
}
|
|
4670
5284
|
},
|
|
4671
|
-
/* @__PURE__ */
|
|
5285
|
+
/* @__PURE__ */ React27.createElement("svg", { width: "11", height: "11", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.5, strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React27.createElement("path", { d: "M5 13l4 4L19 7" })),
|
|
4672
5286
|
"Agreed"
|
|
4673
5287
|
),
|
|
4674
|
-
verdict === "disagreed" && /* @__PURE__ */
|
|
5288
|
+
verdict === "disagreed" && /* @__PURE__ */ React27.createElement(
|
|
4675
5289
|
"span",
|
|
4676
5290
|
{
|
|
4677
5291
|
style: {
|
|
@@ -4688,10 +5302,10 @@ function StanceAccordion({
|
|
|
4688
5302
|
flexShrink: 0
|
|
4689
5303
|
}
|
|
4690
5304
|
},
|
|
4691
|
-
/* @__PURE__ */
|
|
5305
|
+
/* @__PURE__ */ React27.createElement("svg", { width: "11", height: "11", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.5, strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React27.createElement("path", { d: "M6 18L18 6M6 6l12 12" })),
|
|
4692
5306
|
"Disagreed"
|
|
4693
5307
|
),
|
|
4694
|
-
sourceName && /* @__PURE__ */
|
|
5308
|
+
sourceName && /* @__PURE__ */ React27.createElement(
|
|
4695
5309
|
"a",
|
|
4696
5310
|
{
|
|
4697
5311
|
href: quote.source_url || quote.sourceUrl,
|
|
@@ -4708,10 +5322,10 @@ function StanceAccordion({
|
|
|
4708
5322
|
sourceName
|
|
4709
5323
|
)
|
|
4710
5324
|
);
|
|
4711
|
-
})), !cached.reasoning && (!cached.sources || cached.sources.length === 0) && topicQuotes.length === 0 && /* @__PURE__ */
|
|
5325
|
+
})), !cached.reasoning && (!cached.sources || cached.sources.length === 0) && topicQuotes.length === 0 && /* @__PURE__ */ React27.createElement("p", { className: "text-sm text-neutral-400 italic py-2" }, "No detailed reasoning available for this topic."))))
|
|
4712
5326
|
));
|
|
4713
5327
|
}),
|
|
4714
|
-
hasToggle && /* @__PURE__ */
|
|
5328
|
+
hasToggle && /* @__PURE__ */ React27.createElement(
|
|
4715
5329
|
"button",
|
|
4716
5330
|
{
|
|
4717
5331
|
type: "button",
|
|
@@ -4723,90 +5337,20 @@ function StanceAccordion({
|
|
|
4723
5337
|
)
|
|
4724
5338
|
);
|
|
4725
5339
|
}
|
|
4726
|
-
|
|
4727
|
-
// src/icons.js
|
|
4728
|
-
import React23 from "react";
|
|
4729
|
-
function BallotIcon({ size = 16, color = "currentColor" }) {
|
|
4730
|
-
return /* @__PURE__ */ React23.createElement(
|
|
4731
|
-
"svg",
|
|
4732
|
-
{
|
|
4733
|
-
width: size,
|
|
4734
|
-
height: size,
|
|
4735
|
-
viewBox: "0 0 24 24",
|
|
4736
|
-
fill: "none",
|
|
4737
|
-
stroke: color,
|
|
4738
|
-
strokeWidth: "2",
|
|
4739
|
-
strokeLinecap: "round",
|
|
4740
|
-
strokeLinejoin: "round",
|
|
4741
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
4742
|
-
},
|
|
4743
|
-
/* @__PURE__ */ React23.createElement("path", { d: "m9 12 2 2 4-4" }),
|
|
4744
|
-
/* @__PURE__ */ React23.createElement("path", { d: "M5 7c0-1.1.9-2 2-2h10a2 2 0 0 1 2 2v12H5V7Z" }),
|
|
4745
|
-
/* @__PURE__ */ React23.createElement("path", { d: "M22 19H2" })
|
|
4746
|
-
);
|
|
4747
|
-
}
|
|
4748
|
-
function CompassIcon({ size = 16, color = "currentColor" }) {
|
|
4749
|
-
return /* @__PURE__ */ React23.createElement(
|
|
4750
|
-
"svg",
|
|
4751
|
-
{
|
|
4752
|
-
width: size,
|
|
4753
|
-
height: size,
|
|
4754
|
-
viewBox: "0 0 24 24",
|
|
4755
|
-
fill: "none",
|
|
4756
|
-
stroke: color,
|
|
4757
|
-
strokeWidth: "2",
|
|
4758
|
-
strokeLinecap: "round",
|
|
4759
|
-
strokeLinejoin: "round",
|
|
4760
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
4761
|
-
},
|
|
4762
|
-
/* @__PURE__ */ React23.createElement("circle", { cx: "12", cy: "12", r: "10" }),
|
|
4763
|
-
/* @__PURE__ */ React23.createElement("path", { d: "m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z" })
|
|
4764
|
-
);
|
|
4765
|
-
}
|
|
4766
|
-
function BranchIcon({ size = 16, color = "currentColor", branch }) {
|
|
4767
|
-
let paths;
|
|
4768
|
-
switch (branch) {
|
|
4769
|
-
case "executive":
|
|
4770
|
-
paths = /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement("path", { d: "M3 21h18" }), /* @__PURE__ */ React23.createElement("path", { d: "M5 21V7l8-4v18" }), /* @__PURE__ */ React23.createElement("path", { d: "M19 21V11l-6-4" }), /* @__PURE__ */ React23.createElement("path", { d: "M9 9v.01" }), /* @__PURE__ */ React23.createElement("path", { d: "M9 12v.01" }), /* @__PURE__ */ React23.createElement("path", { d: "M9 15v.01" }), /* @__PURE__ */ React23.createElement("path", { d: "M9 18v.01" }), /* @__PURE__ */ React23.createElement("path", { d: "M5 21h14" }), /* @__PURE__ */ React23.createElement("line", { x1: "13", y1: "5", x2: "13", y2: "3" }), /* @__PURE__ */ React23.createElement("line", { x1: "13", y1: "3", x2: "15", y2: "4" }));
|
|
4771
|
-
break;
|
|
4772
|
-
case "legislative":
|
|
4773
|
-
paths = /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement("path", { d: "M8 21h12a2 2 0 0 0 2-2v-2H10v2a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v3h4" }), /* @__PURE__ */ React23.createElement("path", { d: "M19 17V5a2 2 0 0 0-2-2H4" }), /* @__PURE__ */ React23.createElement("path", { d: "M15 8h-5" }), /* @__PURE__ */ React23.createElement("path", { d: "M15 12h-5" }));
|
|
4774
|
-
break;
|
|
4775
|
-
case "judicial":
|
|
4776
|
-
paths = /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement("path", { d: "M12 3v19" }), /* @__PURE__ */ React23.createElement("path", { d: "M5 8l7-5 7 5" }), /* @__PURE__ */ React23.createElement("path", { d: "M3 13l2-5 2 5a3 3 0 0 1-4 0z" }), /* @__PURE__ */ React23.createElement("path", { d: "M17 13l2-5 2 5a3 3 0 0 1-4 0z" }), /* @__PURE__ */ React23.createElement("path", { d: "M8 21h8" }));
|
|
4777
|
-
break;
|
|
4778
|
-
default:
|
|
4779
|
-
paths = /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement("path", { d: "M10 18v-7" }), /* @__PURE__ */ React23.createElement("path", { d: "M11.12 2.198a2 2 0 0 1 1.76.006l7.866 3.847c.476.233.31.949-.22.949H3.474c-.53 0-.695-.716-.22-.949z" }), /* @__PURE__ */ React23.createElement("path", { d: "M14 18v-7" }), /* @__PURE__ */ React23.createElement("path", { d: "M18 18v-7" }), /* @__PURE__ */ React23.createElement("path", { d: "M3 22h18" }), /* @__PURE__ */ React23.createElement("path", { d: "M6 18v-7" }));
|
|
4780
|
-
break;
|
|
4781
|
-
}
|
|
4782
|
-
return /* @__PURE__ */ React23.createElement(
|
|
4783
|
-
"svg",
|
|
4784
|
-
{
|
|
4785
|
-
width: size,
|
|
4786
|
-
height: size,
|
|
4787
|
-
viewBox: "0 0 24 24",
|
|
4788
|
-
fill: "none",
|
|
4789
|
-
stroke: color,
|
|
4790
|
-
strokeWidth: "2",
|
|
4791
|
-
strokeLinecap: "round",
|
|
4792
|
-
strokeLinejoin: "round",
|
|
4793
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
4794
|
-
},
|
|
4795
|
-
paths
|
|
4796
|
-
);
|
|
4797
|
-
}
|
|
4798
5340
|
export {
|
|
4799
5341
|
AuthForm,
|
|
4800
5342
|
BallotIcon,
|
|
4801
5343
|
BranchIcon,
|
|
4802
5344
|
CategorySection,
|
|
4803
5345
|
CommitteeTable,
|
|
5346
|
+
CompassCardHorizontal,
|
|
4804
5347
|
CompassCoverageCallout,
|
|
4805
5348
|
CompassIcon,
|
|
4806
5349
|
ExpandCompassNudge,
|
|
4807
5350
|
FilterSidebar,
|
|
4808
5351
|
GovernmentBodySection,
|
|
4809
5352
|
Header,
|
|
5353
|
+
IconOverlay,
|
|
4810
5354
|
IssueTags,
|
|
4811
5355
|
JudicialRecordDetail,
|
|
4812
5356
|
JudicialScorecard,
|