@empoweredvote/ev-ui 0.4.4 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +798 -268
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +805 -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
|
}
|
|
@@ -1756,8 +1756,618 @@ function PoliticianCard({
|
|
|
1756
1756
|
);
|
|
1757
1757
|
}
|
|
1758
1758
|
|
|
1759
|
+
// src/CompassCardHorizontal.jsx
|
|
1760
|
+
import React10, { useState as useState5, useEffect as useEffect5 } from "react";
|
|
1761
|
+
|
|
1762
|
+
// src/PlaceholderRadar.jsx
|
|
1763
|
+
import React6 from "react";
|
|
1764
|
+
function PlaceholderRadar({ size = 250, name = "" }) {
|
|
1765
|
+
const cx = size / 2;
|
|
1766
|
+
const cy = size / 2;
|
|
1767
|
+
const r = size / 2 * 0.65;
|
|
1768
|
+
const n = 8;
|
|
1769
|
+
const vertices = Array.from({ length: n }, (_, i) => {
|
|
1770
|
+
const a = 2 * Math.PI * i / n;
|
|
1771
|
+
return [cx + r * Math.sin(a), cy - r * Math.cos(a)];
|
|
1772
|
+
});
|
|
1773
|
+
const outerPts = vertices.map(([x, y]) => `${x},${y}`).join(" ");
|
|
1774
|
+
const midPts = vertices.map(([x, y]) => `${cx + (x - cx) * 0.6},${cy + (y - cy) * 0.6}`).join(" ");
|
|
1775
|
+
const innerPts = vertices.map(([x, y]) => `${cx + (x - cx) * 0.3},${cy + (y - cy) * 0.3}`).join(" ");
|
|
1776
|
+
return /* @__PURE__ */ React6.createElement(
|
|
1777
|
+
"svg",
|
|
1778
|
+
{
|
|
1779
|
+
width: size,
|
|
1780
|
+
height: size,
|
|
1781
|
+
viewBox: `0 0 ${size} ${size}`,
|
|
1782
|
+
role: "img",
|
|
1783
|
+
"aria-label": name ? `${name} \u2014 compass data unavailable` : "compass data unavailable",
|
|
1784
|
+
style: {
|
|
1785
|
+
backgroundColor: colorScales.teal["050"],
|
|
1786
|
+
borderRadius: borderRadius.sm,
|
|
1787
|
+
flexShrink: 0
|
|
1788
|
+
}
|
|
1789
|
+
},
|
|
1790
|
+
vertices.map(([x, y], i) => /* @__PURE__ */ React6.createElement(
|
|
1791
|
+
"line",
|
|
1792
|
+
{
|
|
1793
|
+
key: i,
|
|
1794
|
+
x1: cx,
|
|
1795
|
+
y1: cy,
|
|
1796
|
+
x2: x,
|
|
1797
|
+
y2: y,
|
|
1798
|
+
stroke: colorScales.gray["200"],
|
|
1799
|
+
strokeWidth: "1",
|
|
1800
|
+
strokeDasharray: "2 3",
|
|
1801
|
+
opacity: "0.6"
|
|
1802
|
+
}
|
|
1803
|
+
)),
|
|
1804
|
+
/* @__PURE__ */ React6.createElement(
|
|
1805
|
+
"polygon",
|
|
1806
|
+
{
|
|
1807
|
+
points: innerPts,
|
|
1808
|
+
fill: "none",
|
|
1809
|
+
stroke: colorScales.gray["200"],
|
|
1810
|
+
strokeWidth: "1",
|
|
1811
|
+
strokeDasharray: "2 3",
|
|
1812
|
+
opacity: "0.5"
|
|
1813
|
+
}
|
|
1814
|
+
),
|
|
1815
|
+
/* @__PURE__ */ React6.createElement(
|
|
1816
|
+
"polygon",
|
|
1817
|
+
{
|
|
1818
|
+
points: midPts,
|
|
1819
|
+
fill: "none",
|
|
1820
|
+
stroke: colorScales.gray["200"],
|
|
1821
|
+
strokeWidth: "1",
|
|
1822
|
+
strokeDasharray: "3 3",
|
|
1823
|
+
opacity: "0.6"
|
|
1824
|
+
}
|
|
1825
|
+
),
|
|
1826
|
+
/* @__PURE__ */ React6.createElement(
|
|
1827
|
+
"polygon",
|
|
1828
|
+
{
|
|
1829
|
+
points: outerPts,
|
|
1830
|
+
fill: "none",
|
|
1831
|
+
stroke: colorScales.gray["200"],
|
|
1832
|
+
strokeWidth: "1.5",
|
|
1833
|
+
strokeDasharray: "4 3"
|
|
1834
|
+
}
|
|
1835
|
+
)
|
|
1836
|
+
);
|
|
1837
|
+
}
|
|
1838
|
+
|
|
1839
|
+
// src/CompassCardHorizontalMeta.jsx
|
|
1840
|
+
import React9 from "react";
|
|
1841
|
+
|
|
1842
|
+
// src/IconOverlay.jsx
|
|
1843
|
+
import React8, { useState as useState4 } from "react";
|
|
1844
|
+
import {
|
|
1845
|
+
useFloating,
|
|
1846
|
+
useHover,
|
|
1847
|
+
useFocus,
|
|
1848
|
+
useDismiss,
|
|
1849
|
+
useRole,
|
|
1850
|
+
useInteractions,
|
|
1851
|
+
FloatingPortal,
|
|
1852
|
+
offset,
|
|
1853
|
+
flip,
|
|
1854
|
+
shift,
|
|
1855
|
+
autoUpdate
|
|
1856
|
+
} from "@floating-ui/react";
|
|
1857
|
+
|
|
1858
|
+
// src/icons.js
|
|
1859
|
+
import React7 from "react";
|
|
1860
|
+
function BallotIcon({ size = 16, color = "currentColor" }) {
|
|
1861
|
+
return /* @__PURE__ */ React7.createElement(
|
|
1862
|
+
"svg",
|
|
1863
|
+
{
|
|
1864
|
+
width: size,
|
|
1865
|
+
height: size,
|
|
1866
|
+
viewBox: "0 0 24 24",
|
|
1867
|
+
fill: "none",
|
|
1868
|
+
stroke: color,
|
|
1869
|
+
strokeWidth: "2",
|
|
1870
|
+
strokeLinecap: "round",
|
|
1871
|
+
strokeLinejoin: "round",
|
|
1872
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1873
|
+
},
|
|
1874
|
+
/* @__PURE__ */ React7.createElement("path", { d: "m9 12 2 2 4-4" }),
|
|
1875
|
+
/* @__PURE__ */ React7.createElement("path", { d: "M5 7c0-1.1.9-2 2-2h10a2 2 0 0 1 2 2v12H5V7Z" }),
|
|
1876
|
+
/* @__PURE__ */ React7.createElement("path", { d: "M22 19H2" })
|
|
1877
|
+
);
|
|
1878
|
+
}
|
|
1879
|
+
function CompassIcon({ size = 16, color = "currentColor" }) {
|
|
1880
|
+
return /* @__PURE__ */ React7.createElement(
|
|
1881
|
+
"svg",
|
|
1882
|
+
{
|
|
1883
|
+
width: size,
|
|
1884
|
+
height: size,
|
|
1885
|
+
viewBox: "0 0 24 24",
|
|
1886
|
+
fill: "none",
|
|
1887
|
+
stroke: color,
|
|
1888
|
+
strokeWidth: "2",
|
|
1889
|
+
strokeLinecap: "round",
|
|
1890
|
+
strokeLinejoin: "round",
|
|
1891
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1892
|
+
},
|
|
1893
|
+
/* @__PURE__ */ React7.createElement("circle", { cx: "12", cy: "12", r: "10" }),
|
|
1894
|
+
/* @__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" })
|
|
1895
|
+
);
|
|
1896
|
+
}
|
|
1897
|
+
function BranchIcon({ size = 16, color = "currentColor", branch }) {
|
|
1898
|
+
let paths;
|
|
1899
|
+
switch (branch) {
|
|
1900
|
+
case "executive":
|
|
1901
|
+
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" }));
|
|
1902
|
+
break;
|
|
1903
|
+
case "legislative":
|
|
1904
|
+
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" }));
|
|
1905
|
+
break;
|
|
1906
|
+
case "judicial":
|
|
1907
|
+
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" }));
|
|
1908
|
+
break;
|
|
1909
|
+
default:
|
|
1910
|
+
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" }));
|
|
1911
|
+
break;
|
|
1912
|
+
}
|
|
1913
|
+
return /* @__PURE__ */ React7.createElement(
|
|
1914
|
+
"svg",
|
|
1915
|
+
{
|
|
1916
|
+
width: size,
|
|
1917
|
+
height: size,
|
|
1918
|
+
viewBox: "0 0 24 24",
|
|
1919
|
+
fill: "none",
|
|
1920
|
+
stroke: color,
|
|
1921
|
+
strokeWidth: "2",
|
|
1922
|
+
strokeLinecap: "round",
|
|
1923
|
+
strokeLinejoin: "round",
|
|
1924
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1925
|
+
},
|
|
1926
|
+
paths
|
|
1927
|
+
);
|
|
1928
|
+
}
|
|
1929
|
+
|
|
1930
|
+
// src/IconOverlay.jsx
|
|
1931
|
+
function IconWithTooltip({ IconComponent, color, tooltip, size = 14, extraProps = {}, onClick }) {
|
|
1932
|
+
const [isOpen, setIsOpen] = useState4(false);
|
|
1933
|
+
const { refs, floatingStyles, context } = useFloating({
|
|
1934
|
+
open: isOpen,
|
|
1935
|
+
onOpenChange: setIsOpen,
|
|
1936
|
+
middleware: [offset(8), flip(), shift({ padding: 4 })],
|
|
1937
|
+
whileElementsMounted: autoUpdate
|
|
1938
|
+
});
|
|
1939
|
+
const hover = useHover(context);
|
|
1940
|
+
const focus2 = useFocus(context);
|
|
1941
|
+
const dismiss = useDismiss(context);
|
|
1942
|
+
const role = useRole(context, { role: "tooltip" });
|
|
1943
|
+
const { getReferenceProps, getFloatingProps } = useInteractions([
|
|
1944
|
+
hover,
|
|
1945
|
+
focus2,
|
|
1946
|
+
dismiss,
|
|
1947
|
+
role
|
|
1948
|
+
]);
|
|
1949
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement(
|
|
1950
|
+
"span",
|
|
1951
|
+
{
|
|
1952
|
+
ref: refs.setReference,
|
|
1953
|
+
"aria-label": tooltip,
|
|
1954
|
+
tabIndex: 0,
|
|
1955
|
+
style: { display: "inline-flex", padding: spacing[1], ...onClick ? { cursor: "pointer" } : {} },
|
|
1956
|
+
...getReferenceProps(),
|
|
1957
|
+
onClick: onClick ? (e) => {
|
|
1958
|
+
e.stopPropagation();
|
|
1959
|
+
onClick(e);
|
|
1960
|
+
} : void 0
|
|
1961
|
+
},
|
|
1962
|
+
/* @__PURE__ */ React8.createElement(IconComponent, { size, color, ...extraProps })
|
|
1963
|
+
), isOpen && /* @__PURE__ */ React8.createElement(FloatingPortal, null, /* @__PURE__ */ React8.createElement(
|
|
1964
|
+
"div",
|
|
1965
|
+
{
|
|
1966
|
+
ref: refs.setFloating,
|
|
1967
|
+
style: {
|
|
1968
|
+
...floatingStyles,
|
|
1969
|
+
zIndex: 70,
|
|
1970
|
+
background: semanticTokens.light.tooltip.background,
|
|
1971
|
+
color: semanticTokens.light.tooltip.text,
|
|
1972
|
+
padding: "4px 8px",
|
|
1973
|
+
borderRadius: "6px",
|
|
1974
|
+
fontSize: "14px",
|
|
1975
|
+
fontFamily: "'Manrope', sans-serif",
|
|
1976
|
+
pointerEvents: "none",
|
|
1977
|
+
whiteSpace: "nowrap"
|
|
1978
|
+
},
|
|
1979
|
+
...getFloatingProps()
|
|
1980
|
+
},
|
|
1981
|
+
tooltip
|
|
1982
|
+
)));
|
|
1983
|
+
}
|
|
1984
|
+
function IconOverlay({ ballot, hasStances, branch, onCompassClick }) {
|
|
1985
|
+
if (!ballot && !hasStances && !branch) return null;
|
|
1986
|
+
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;
|
|
1987
|
+
return /* @__PURE__ */ React8.createElement(
|
|
1988
|
+
"div",
|
|
1989
|
+
{
|
|
1990
|
+
style: {
|
|
1991
|
+
display: "flex",
|
|
1992
|
+
gap: 4,
|
|
1993
|
+
alignItems: "center",
|
|
1994
|
+
justifyContent: "flex-start",
|
|
1995
|
+
padding: 0,
|
|
1996
|
+
marginLeft: "-4px"
|
|
1997
|
+
// offset icon wrapper padding so icons align flush-left with text
|
|
1998
|
+
}
|
|
1999
|
+
},
|
|
2000
|
+
ballot && /* @__PURE__ */ React8.createElement(
|
|
2001
|
+
IconWithTooltip,
|
|
2002
|
+
{
|
|
2003
|
+
IconComponent: BallotIcon,
|
|
2004
|
+
color: colors.evMutedBlue,
|
|
2005
|
+
tooltip: ballotTooltip,
|
|
2006
|
+
size: 14
|
|
2007
|
+
}
|
|
2008
|
+
),
|
|
2009
|
+
hasStances && /* @__PURE__ */ React8.createElement(
|
|
2010
|
+
IconWithTooltip,
|
|
2011
|
+
{
|
|
2012
|
+
IconComponent: CompassIcon,
|
|
2013
|
+
color: colors.evMutedBlue,
|
|
2014
|
+
tooltip: "Compare your views",
|
|
2015
|
+
size: 14,
|
|
2016
|
+
onClick: onCompassClick
|
|
2017
|
+
}
|
|
2018
|
+
),
|
|
2019
|
+
branch && /* @__PURE__ */ React8.createElement(
|
|
2020
|
+
IconWithTooltip,
|
|
2021
|
+
{
|
|
2022
|
+
IconComponent: BranchIcon,
|
|
2023
|
+
color: colors.evMutedBlue,
|
|
2024
|
+
tooltip: `${branch} branch`,
|
|
2025
|
+
size: 14,
|
|
2026
|
+
extraProps: { branch: branch.toLowerCase() }
|
|
2027
|
+
}
|
|
2028
|
+
)
|
|
2029
|
+
);
|
|
2030
|
+
}
|
|
2031
|
+
|
|
2032
|
+
// src/CompassCardHorizontalMeta.jsx
|
|
2033
|
+
function CompassCardHorizontalMeta({
|
|
2034
|
+
politician,
|
|
2035
|
+
surface = "representatives",
|
|
2036
|
+
userAnswers
|
|
2037
|
+
}) {
|
|
2038
|
+
const titleText = surface === "elections" ? politician.office_running_for : politician.office_title;
|
|
2039
|
+
return /* @__PURE__ */ React9.createElement("div", { style: {
|
|
2040
|
+
flex: 1,
|
|
2041
|
+
minWidth: 0,
|
|
2042
|
+
display: "flex",
|
|
2043
|
+
flexDirection: "column",
|
|
2044
|
+
gap: spacing[1]
|
|
2045
|
+
} }, /* @__PURE__ */ React9.createElement("p", { style: {
|
|
2046
|
+
fontFamily: fonts.primary,
|
|
2047
|
+
fontSize: fontSizes.lg,
|
|
2048
|
+
fontWeight: fontWeights.semibold,
|
|
2049
|
+
lineHeight: 1.4,
|
|
2050
|
+
color: colors.evMutedBlue,
|
|
2051
|
+
margin: 0
|
|
2052
|
+
} }, politician.full_name), /* @__PURE__ */ React9.createElement("p", { style: {
|
|
2053
|
+
fontFamily: fonts.primary,
|
|
2054
|
+
fontSize: fontSizes.sm,
|
|
2055
|
+
fontWeight: fontWeights.semibold,
|
|
2056
|
+
lineHeight: 1.4,
|
|
2057
|
+
color: colors.textSecondary,
|
|
2058
|
+
margin: 0,
|
|
2059
|
+
overflow: "hidden",
|
|
2060
|
+
display: "-webkit-box",
|
|
2061
|
+
WebkitLineClamp: 2,
|
|
2062
|
+
WebkitBoxOrient: "vertical"
|
|
2063
|
+
} }, titleText || ""), politician.district_label && /* @__PURE__ */ React9.createElement("p", { style: {
|
|
2064
|
+
fontFamily: fonts.primary,
|
|
2065
|
+
fontSize: fontSizes.sm,
|
|
2066
|
+
fontWeight: fontWeights.regular,
|
|
2067
|
+
lineHeight: 1.5,
|
|
2068
|
+
color: colors.textMuted,
|
|
2069
|
+
margin: 0,
|
|
2070
|
+
overflow: "hidden",
|
|
2071
|
+
textOverflow: "ellipsis",
|
|
2072
|
+
whiteSpace: "nowrap"
|
|
2073
|
+
} }, politician.district_label), /* @__PURE__ */ React9.createElement(
|
|
2074
|
+
IconOverlay,
|
|
2075
|
+
{
|
|
2076
|
+
ballot: politician.ballot || null,
|
|
2077
|
+
hasStances: Boolean(userAnswers && userAnswers.length > 0) || Boolean(politician.hasStances),
|
|
2078
|
+
branch: politician.branch || null
|
|
2079
|
+
}
|
|
2080
|
+
));
|
|
2081
|
+
}
|
|
2082
|
+
|
|
2083
|
+
// src/compassHelpers.js
|
|
2084
|
+
function buildAnswerMapByShortTitle(allTopics, allAnswers, allowedShorts) {
|
|
2085
|
+
var _a;
|
|
2086
|
+
const allowed = new Set(allowedShorts.map((s) => s.toLowerCase()));
|
|
2087
|
+
const topicById = new Map(allTopics.map((t) => [t.id, t]));
|
|
2088
|
+
const shortById = new Map(allTopics.map((t) => [t.id, t.short_title]));
|
|
2089
|
+
const out = {};
|
|
2090
|
+
const topicByShortLower = new Map(allTopics.map((t) => [t.short_title.toLowerCase(), t]));
|
|
2091
|
+
for (const s of allowedShorts) {
|
|
2092
|
+
const t = topicByShortLower.get(s.toLowerCase());
|
|
2093
|
+
if (t) out[t.short_title] = 0;
|
|
2094
|
+
}
|
|
2095
|
+
for (const a of allAnswers) {
|
|
2096
|
+
const st = shortById.get(a.topic_id);
|
|
2097
|
+
if (!st) continue;
|
|
2098
|
+
if (allowed.has(String(st).toLowerCase())) {
|
|
2099
|
+
out[st] = (_a = a.value) != null ? _a : 0;
|
|
2100
|
+
}
|
|
2101
|
+
}
|
|
2102
|
+
const topicByShort = new Map(allTopics.map((t) => [t.short_title.toLowerCase(), t]));
|
|
2103
|
+
const topicsFiltered = allowedShorts.map((s) => topicByShort.get(s.toLowerCase())).filter(Boolean);
|
|
2104
|
+
return { topicsFiltered, answersByShort: out };
|
|
2105
|
+
}
|
|
2106
|
+
|
|
2107
|
+
// src/CompassCardHorizontal.jsx
|
|
2108
|
+
var RADAR_SIZE = 250;
|
|
2109
|
+
var SLOT_WIDTH = 260;
|
|
2110
|
+
function CompassCardHorizontal({
|
|
2111
|
+
politician,
|
|
2112
|
+
userAnswers = null,
|
|
2113
|
+
tierVisuals = null,
|
|
2114
|
+
view = "compass",
|
|
2115
|
+
surface = "representatives",
|
|
2116
|
+
variant = "compass",
|
|
2117
|
+
onBuildCompass = null,
|
|
2118
|
+
onClick
|
|
2119
|
+
}) {
|
|
2120
|
+
var _a;
|
|
2121
|
+
const [hovered, setHovered] = useState5(false);
|
|
2122
|
+
const [focused, setFocused] = useState5(false);
|
|
2123
|
+
const [imgError, setImgError] = useState5(false);
|
|
2124
|
+
const [emptyCtaHovered, setEmptyCtaHovered] = useState5(false);
|
|
2125
|
+
useEffect5(() => {
|
|
2126
|
+
setImgError(false);
|
|
2127
|
+
}, [politician == null ? void 0 : politician.photo_origin_url]);
|
|
2128
|
+
const cardStyle = {
|
|
2129
|
+
position: "relative",
|
|
2130
|
+
display: "flex",
|
|
2131
|
+
flexDirection: "row",
|
|
2132
|
+
alignItems: "center",
|
|
2133
|
+
backgroundColor: (_a = tierVisuals == null ? void 0 : tierVisuals.bg) != null ? _a : colors.bgWhite,
|
|
2134
|
+
border: `1px solid ${colors.borderLight}`,
|
|
2135
|
+
borderRadius: borderRadius.xl,
|
|
2136
|
+
overflow: "hidden",
|
|
2137
|
+
// clips slot corners via card border-radius — no padding needed
|
|
2138
|
+
boxShadow: focused ? focus.ring : hovered ? shadows.cardHover : shadows.md,
|
|
2139
|
+
transform: hovered ? "translateY(-2px)" : "none",
|
|
2140
|
+
transition: `box-shadow ${duration.normal} ease, transform ${duration.normal} ease`,
|
|
2141
|
+
cursor: onClick ? "pointer" : "default",
|
|
2142
|
+
fontFamily: fonts.primary,
|
|
2143
|
+
outline: "none"
|
|
2144
|
+
};
|
|
2145
|
+
const slotStyle = { width: SLOT_WIDTH, height: SLOT_WIDTH, flexShrink: 0, overflow: "hidden", position: "relative" };
|
|
2146
|
+
function renderCompass() {
|
|
2147
|
+
var _a2, _b, _c;
|
|
2148
|
+
if (!userAnswers || userAnswers.length === 0) {
|
|
2149
|
+
return /* @__PURE__ */ React10.createElement(PlaceholderRadar, { size: RADAR_SIZE, name: (politician == null ? void 0 : politician.full_name) || "" });
|
|
2150
|
+
}
|
|
2151
|
+
let topics = [];
|
|
2152
|
+
let data = {};
|
|
2153
|
+
let compareData = {};
|
|
2154
|
+
try {
|
|
2155
|
+
if (Array.isArray(userAnswers) && userAnswers.length > 0) {
|
|
2156
|
+
const hasEmbeddedTopics = (_b = (_a2 = userAnswers[0]) == null ? void 0 : _a2.topic) == null ? void 0 : _b.short_title;
|
|
2157
|
+
if (hasEmbeddedTopics) {
|
|
2158
|
+
const allowedShorts = userAnswers.map((a) => a.topic.short_title);
|
|
2159
|
+
const allTopics = userAnswers.map((a) => a.topic);
|
|
2160
|
+
const { topicsFiltered, answersByShort } = buildAnswerMapByShortTitle(
|
|
2161
|
+
allTopics,
|
|
2162
|
+
userAnswers,
|
|
2163
|
+
allowedShorts
|
|
2164
|
+
);
|
|
2165
|
+
topics = topicsFiltered;
|
|
2166
|
+
data = answersByShort;
|
|
2167
|
+
} else {
|
|
2168
|
+
if (!Array.isArray(userAnswers[0])) {
|
|
2169
|
+
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 }));
|
|
2170
|
+
data = {};
|
|
2171
|
+
for (const a of userAnswers) {
|
|
2172
|
+
if (a.short_title) data[a.short_title] = (_c = a.value) != null ? _c : 0;
|
|
2173
|
+
}
|
|
2174
|
+
}
|
|
2175
|
+
}
|
|
2176
|
+
}
|
|
2177
|
+
if ((politician == null ? void 0 : politician.stances) && typeof politician.stances === "object") {
|
|
2178
|
+
compareData = Array.isArray(politician.stances) ? politician.stances.reduce((acc, s) => {
|
|
2179
|
+
var _a3;
|
|
2180
|
+
if (s.short_title) acc[s.short_title] = (_a3 = s.value) != null ? _a3 : 0;
|
|
2181
|
+
return acc;
|
|
2182
|
+
}, {}) : politician.stances;
|
|
2183
|
+
}
|
|
2184
|
+
if (topics.length === 0) {
|
|
2185
|
+
return /* @__PURE__ */ React10.createElement(PlaceholderRadar, { size: RADAR_SIZE, name: (politician == null ? void 0 : politician.full_name) || "" });
|
|
2186
|
+
}
|
|
2187
|
+
} catch (err) {
|
|
2188
|
+
return /* @__PURE__ */ React10.createElement(PlaceholderRadar, { size: RADAR_SIZE, name: (politician == null ? void 0 : politician.full_name) || "" });
|
|
2189
|
+
}
|
|
2190
|
+
return /* @__PURE__ */ React10.createElement(
|
|
2191
|
+
RadarChartCore,
|
|
2192
|
+
{
|
|
2193
|
+
topics,
|
|
2194
|
+
data,
|
|
2195
|
+
compareData,
|
|
2196
|
+
invertedSpokes: {},
|
|
2197
|
+
onToggleInversion: () => {
|
|
2198
|
+
},
|
|
2199
|
+
onReplaceTopic: () => {
|
|
2200
|
+
},
|
|
2201
|
+
size: RADAR_SIZE,
|
|
2202
|
+
padding: 20,
|
|
2203
|
+
labelOffset: 5,
|
|
2204
|
+
labelFontSize: 12
|
|
2205
|
+
}
|
|
2206
|
+
);
|
|
2207
|
+
}
|
|
2208
|
+
function renderPortrait() {
|
|
2209
|
+
var _a2, _b, _c;
|
|
2210
|
+
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;
|
|
2211
|
+
if (imageSrc && !imgError) {
|
|
2212
|
+
return /* @__PURE__ */ React10.createElement(
|
|
2213
|
+
"img",
|
|
2214
|
+
{
|
|
2215
|
+
src: imageSrc,
|
|
2216
|
+
alt: `${politician.full_name} portrait`,
|
|
2217
|
+
style: {
|
|
2218
|
+
width: "100%",
|
|
2219
|
+
height: "100%",
|
|
2220
|
+
objectFit: "cover",
|
|
2221
|
+
objectPosition: (_b = politician.imageFocalPoint) != null ? _b : "center 20%",
|
|
2222
|
+
display: "block"
|
|
2223
|
+
},
|
|
2224
|
+
onError: () => setImgError(true)
|
|
2225
|
+
}
|
|
2226
|
+
);
|
|
2227
|
+
}
|
|
2228
|
+
const parts = ((politician == null ? void 0 : politician.full_name) || "").split(" ").filter(Boolean);
|
|
2229
|
+
const initials = (parts.length >= 2 ? parts[0][0] + parts[parts.length - 1][0] : ((_c = parts[0]) == null ? void 0 : _c[0]) || "?").toUpperCase();
|
|
2230
|
+
return /* @__PURE__ */ React10.createElement("div", { style: {
|
|
2231
|
+
width: "100%",
|
|
2232
|
+
height: "100%",
|
|
2233
|
+
backgroundColor: colors.evMutedBlue,
|
|
2234
|
+
color: colors.textWhite,
|
|
2235
|
+
display: "flex",
|
|
2236
|
+
alignItems: "center",
|
|
2237
|
+
justifyContent: "center",
|
|
2238
|
+
fontFamily: fonts.primary,
|
|
2239
|
+
fontWeight: fontWeights.bold,
|
|
2240
|
+
fontSize: fontSizes["4xl"]
|
|
2241
|
+
} }, initials);
|
|
2242
|
+
}
|
|
2243
|
+
function renderEmptyVariant() {
|
|
2244
|
+
return /* @__PURE__ */ React10.createElement("div", { style: {
|
|
2245
|
+
width: "100%",
|
|
2246
|
+
height: "100%",
|
|
2247
|
+
display: "flex",
|
|
2248
|
+
flexDirection: "column",
|
|
2249
|
+
alignItems: "center",
|
|
2250
|
+
justifyContent: "center",
|
|
2251
|
+
gap: "8px",
|
|
2252
|
+
padding: "12px 14px",
|
|
2253
|
+
boxSizing: "border-box",
|
|
2254
|
+
backgroundColor: colorScales.teal["050"]
|
|
2255
|
+
} }, /* @__PURE__ */ React10.createElement(PlaceholderRadar, { size: 140, name: (politician == null ? void 0 : politician.full_name) || "" }), /* @__PURE__ */ React10.createElement("p", { style: {
|
|
2256
|
+
margin: 0,
|
|
2257
|
+
fontSize: fontSizes.xs,
|
|
2258
|
+
color: colors.textMuted,
|
|
2259
|
+
textAlign: "center",
|
|
2260
|
+
lineHeight: 1.4,
|
|
2261
|
+
fontFamily: fonts.primary
|
|
2262
|
+
} }, "Calibrate your compass to see how you align with ", (politician == null ? void 0 : politician.full_name) || "this official"), /* @__PURE__ */ React10.createElement(
|
|
2263
|
+
"button",
|
|
2264
|
+
{
|
|
2265
|
+
type: "button",
|
|
2266
|
+
onClick: onBuildCompass || void 0,
|
|
2267
|
+
onMouseEnter: () => setEmptyCtaHovered(true),
|
|
2268
|
+
onMouseLeave: () => setEmptyCtaHovered(false),
|
|
2269
|
+
style: {
|
|
2270
|
+
minWidth: "160px",
|
|
2271
|
+
height: "40px",
|
|
2272
|
+
padding: "0 16px",
|
|
2273
|
+
backgroundColor: emptyCtaHovered ? semanticTokens.light.buttonPrimary.background.hovered : semanticTokens.light.buttonPrimary.background.default,
|
|
2274
|
+
color: colors.textWhite,
|
|
2275
|
+
fontSize: fontSizes.xs,
|
|
2276
|
+
fontWeight: fontWeights.semibold,
|
|
2277
|
+
fontFamily: fonts.primary,
|
|
2278
|
+
borderRadius: borderRadius.full,
|
|
2279
|
+
border: "none",
|
|
2280
|
+
cursor: onBuildCompass ? "pointer" : "default",
|
|
2281
|
+
whiteSpace: "nowrap",
|
|
2282
|
+
transition: `background ${duration.normal} ease`,
|
|
2283
|
+
flexShrink: 0
|
|
2284
|
+
}
|
|
2285
|
+
},
|
|
2286
|
+
"Calibrate your compass"
|
|
2287
|
+
));
|
|
2288
|
+
}
|
|
2289
|
+
function renderUnavailablePlate() {
|
|
2290
|
+
return /* @__PURE__ */ React10.createElement("div", { style: {
|
|
2291
|
+
width: "100%",
|
|
2292
|
+
height: "100%",
|
|
2293
|
+
backgroundColor: colorScales.teal["050"],
|
|
2294
|
+
display: "flex",
|
|
2295
|
+
alignItems: "center",
|
|
2296
|
+
justifyContent: "center",
|
|
2297
|
+
padding: spacing[4],
|
|
2298
|
+
boxSizing: "border-box"
|
|
2299
|
+
} }, /* @__PURE__ */ React10.createElement("p", { style: {
|
|
2300
|
+
fontSize: fontSizes.sm,
|
|
2301
|
+
fontWeight: fontWeights.semibold,
|
|
2302
|
+
lineHeight: 1.4,
|
|
2303
|
+
color: colors.textMuted,
|
|
2304
|
+
textAlign: "center",
|
|
2305
|
+
maxWidth: "180px",
|
|
2306
|
+
margin: 0,
|
|
2307
|
+
fontFamily: fonts.primary
|
|
2308
|
+
} }, "Compass currently unavailable for this role."));
|
|
2309
|
+
}
|
|
2310
|
+
function renderSlotContent() {
|
|
2311
|
+
if (view === "portrait") return renderPortrait();
|
|
2312
|
+
if (variant === "empty") return renderEmptyVariant();
|
|
2313
|
+
if (variant === "administrative" || variant === "judicial") return renderUnavailablePlate();
|
|
2314
|
+
return /* @__PURE__ */ React10.createElement("div", { style: {
|
|
2315
|
+
width: "100%",
|
|
2316
|
+
height: "100%",
|
|
2317
|
+
display: "flex",
|
|
2318
|
+
alignItems: "center",
|
|
2319
|
+
justifyContent: "center",
|
|
2320
|
+
padding: spacing[3],
|
|
2321
|
+
boxSizing: "border-box"
|
|
2322
|
+
} }, renderCompass());
|
|
2323
|
+
}
|
|
2324
|
+
return /* @__PURE__ */ React10.createElement(
|
|
2325
|
+
"div",
|
|
2326
|
+
{
|
|
2327
|
+
role: "article",
|
|
2328
|
+
"aria-label": `${politician.full_name}, ${politician.office_title || ""}`,
|
|
2329
|
+
tabIndex: 0,
|
|
2330
|
+
style: cardStyle,
|
|
2331
|
+
onClick,
|
|
2332
|
+
onKeyDown: (e) => {
|
|
2333
|
+
if (onClick && (e.key === "Enter" || e.key === " ")) {
|
|
2334
|
+
e.preventDefault();
|
|
2335
|
+
onClick();
|
|
2336
|
+
}
|
|
2337
|
+
},
|
|
2338
|
+
onMouseEnter: () => setHovered(true),
|
|
2339
|
+
onMouseLeave: () => setHovered(false),
|
|
2340
|
+
onFocus: () => setFocused(true),
|
|
2341
|
+
onBlur: () => setFocused(false)
|
|
2342
|
+
},
|
|
2343
|
+
/* @__PURE__ */ React10.createElement("div", { style: slotStyle }, renderSlotContent(), surface === "elections" && politician.running_unopposed && /* @__PURE__ */ React10.createElement("div", { style: {
|
|
2344
|
+
position: "absolute",
|
|
2345
|
+
bottom: "15px",
|
|
2346
|
+
left: 0,
|
|
2347
|
+
width: "100%",
|
|
2348
|
+
backgroundColor: "rgba(0,0,0,0.35)",
|
|
2349
|
+
color: "#fff",
|
|
2350
|
+
fontSize: "12px",
|
|
2351
|
+
fontWeight: 700,
|
|
2352
|
+
letterSpacing: "0.4px",
|
|
2353
|
+
textAlign: "center",
|
|
2354
|
+
textTransform: "uppercase",
|
|
2355
|
+
padding: "6px 0",
|
|
2356
|
+
pointerEvents: "none"
|
|
2357
|
+
} }, "Running Unopposed")),
|
|
2358
|
+
/* @__PURE__ */ React10.createElement("div", { style: { flex: 1, minWidth: 0, padding: spacing[4], paddingLeft: spacing[3] } }, /* @__PURE__ */ React10.createElement(
|
|
2359
|
+
CompassCardHorizontalMeta,
|
|
2360
|
+
{
|
|
2361
|
+
politician,
|
|
2362
|
+
surface,
|
|
2363
|
+
userAnswers
|
|
2364
|
+
}
|
|
2365
|
+
))
|
|
2366
|
+
);
|
|
2367
|
+
}
|
|
2368
|
+
|
|
1759
2369
|
// src/CategorySection.jsx
|
|
1760
|
-
import
|
|
2370
|
+
import React11, { useState as useState6 } from "react";
|
|
1761
2371
|
function CategorySection({
|
|
1762
2372
|
title,
|
|
1763
2373
|
infoTooltip,
|
|
@@ -1767,7 +2377,7 @@ function CategorySection({
|
|
|
1767
2377
|
tier
|
|
1768
2378
|
}) {
|
|
1769
2379
|
var _a, _b;
|
|
1770
|
-
const [showTooltip, setShowTooltip] =
|
|
2380
|
+
const [showTooltip, setShowTooltip] = useState6(false);
|
|
1771
2381
|
const tierStyle = tier ? tierColors[tier] : null;
|
|
1772
2382
|
const styles2 = {
|
|
1773
2383
|
section: {
|
|
@@ -1835,7 +2445,7 @@ function CategorySection({
|
|
|
1835
2445
|
gap: spacing[4]
|
|
1836
2446
|
}
|
|
1837
2447
|
};
|
|
1838
|
-
return /* @__PURE__ */
|
|
2448
|
+
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(
|
|
1839
2449
|
"button",
|
|
1840
2450
|
{
|
|
1841
2451
|
type: "button",
|
|
@@ -1847,8 +2457,8 @@ function CategorySection({
|
|
|
1847
2457
|
"aria-label": `Info about ${title}`
|
|
1848
2458
|
},
|
|
1849
2459
|
"i",
|
|
1850
|
-
showTooltip && /* @__PURE__ */
|
|
1851
|
-
), websiteUrl && /* @__PURE__ */
|
|
2460
|
+
showTooltip && /* @__PURE__ */ React11.createElement("div", { style: styles2.tooltip, role: "tooltip" }, infoTooltip)
|
|
2461
|
+
), websiteUrl && /* @__PURE__ */ React11.createElement(
|
|
1852
2462
|
"a",
|
|
1853
2463
|
{
|
|
1854
2464
|
href: websiteUrl,
|
|
@@ -1857,7 +2467,7 @@ function CategorySection({
|
|
|
1857
2467
|
style: styles2.externalLink,
|
|
1858
2468
|
"aria-label": `Visit official website for ${title}`
|
|
1859
2469
|
},
|
|
1860
|
-
/* @__PURE__ */
|
|
2470
|
+
/* @__PURE__ */ React11.createElement(
|
|
1861
2471
|
"svg",
|
|
1862
2472
|
{
|
|
1863
2473
|
viewBox: "0 0 24 24",
|
|
@@ -1865,7 +2475,7 @@ function CategorySection({
|
|
|
1865
2475
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1866
2476
|
style: { width: "14px", height: "14px" }
|
|
1867
2477
|
},
|
|
1868
|
-
/* @__PURE__ */
|
|
2478
|
+
/* @__PURE__ */ React11.createElement(
|
|
1869
2479
|
"path",
|
|
1870
2480
|
{
|
|
1871
2481
|
d: "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14",
|
|
@@ -1876,11 +2486,11 @@ function CategorySection({
|
|
|
1876
2486
|
}
|
|
1877
2487
|
)
|
|
1878
2488
|
)
|
|
1879
|
-
)), /* @__PURE__ */
|
|
2489
|
+
)), /* @__PURE__ */ React11.createElement("div", { style: styles2.grid, className: "ev-category-grid" }, children));
|
|
1880
2490
|
}
|
|
1881
2491
|
|
|
1882
2492
|
// src/SubGroupSection.jsx
|
|
1883
|
-
import
|
|
2493
|
+
import React12 from "react";
|
|
1884
2494
|
function SubGroupSection({ title, websiteUrl, children }) {
|
|
1885
2495
|
const styles2 = {
|
|
1886
2496
|
section: {
|
|
@@ -1913,7 +2523,7 @@ function SubGroupSection({ title, websiteUrl, children }) {
|
|
|
1913
2523
|
gap: spacing[2]
|
|
1914
2524
|
}
|
|
1915
2525
|
};
|
|
1916
|
-
return /* @__PURE__ */
|
|
2526
|
+
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(
|
|
1917
2527
|
"a",
|
|
1918
2528
|
{
|
|
1919
2529
|
href: websiteUrl,
|
|
@@ -1921,12 +2531,12 @@ function SubGroupSection({ title, websiteUrl, children }) {
|
|
|
1921
2531
|
rel: "noopener noreferrer",
|
|
1922
2532
|
style: styles2.link
|
|
1923
2533
|
},
|
|
1924
|
-
/* @__PURE__ */
|
|
1925
|
-
)), /* @__PURE__ */
|
|
2534
|
+
/* @__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" }))
|
|
2535
|
+
)), /* @__PURE__ */ React12.createElement("div", { style: styles2.grid, className: "ev-subgroup-grid" }, children));
|
|
1926
2536
|
}
|
|
1927
2537
|
|
|
1928
2538
|
// src/GovernmentBodySection.jsx
|
|
1929
|
-
import
|
|
2539
|
+
import React13, { useState as useState7 } from "react";
|
|
1930
2540
|
function GovernmentBodySection({
|
|
1931
2541
|
title,
|
|
1932
2542
|
websiteUrl,
|
|
@@ -1935,7 +2545,7 @@ function GovernmentBodySection({
|
|
|
1935
2545
|
children
|
|
1936
2546
|
}) {
|
|
1937
2547
|
var _a;
|
|
1938
|
-
const [expanded, setExpanded] =
|
|
2548
|
+
const [expanded, setExpanded] = useState7(defaultExpanded);
|
|
1939
2549
|
const tierStyle = tier ? tierColors[tier] : null;
|
|
1940
2550
|
const accentColor = (_a = tierStyle == null ? void 0 : tierStyle.accent) != null ? _a : colors.borderMedium;
|
|
1941
2551
|
const styles2 = {
|
|
@@ -1975,7 +2585,7 @@ function GovernmentBodySection({
|
|
|
1975
2585
|
display: expanded ? "block" : "none"
|
|
1976
2586
|
}
|
|
1977
2587
|
};
|
|
1978
|
-
return /* @__PURE__ */
|
|
2588
|
+
return /* @__PURE__ */ React13.createElement("section", { style: styles2.section, className: "ev-gov-body-section" }, /* @__PURE__ */ React13.createElement(
|
|
1979
2589
|
"div",
|
|
1980
2590
|
{
|
|
1981
2591
|
style: styles2.header,
|
|
@@ -1991,8 +2601,8 @@ function GovernmentBodySection({
|
|
|
1991
2601
|
"aria-expanded": expanded,
|
|
1992
2602
|
"aria-label": `${expanded ? "Collapse" : "Expand"} ${title}`
|
|
1993
2603
|
},
|
|
1994
|
-
/* @__PURE__ */
|
|
1995
|
-
websiteUrl && /* @__PURE__ */
|
|
2604
|
+
/* @__PURE__ */ React13.createElement("span", { style: styles2.title }, title),
|
|
2605
|
+
websiteUrl && /* @__PURE__ */ React13.createElement(
|
|
1996
2606
|
"a",
|
|
1997
2607
|
{
|
|
1998
2608
|
href: websiteUrl,
|
|
@@ -2002,14 +2612,14 @@ function GovernmentBodySection({
|
|
|
2002
2612
|
onClick: (e) => e.stopPropagation(),
|
|
2003
2613
|
"aria-label": `Visit ${title} website`
|
|
2004
2614
|
},
|
|
2005
|
-
/* @__PURE__ */
|
|
2615
|
+
/* @__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" }))
|
|
2006
2616
|
),
|
|
2007
|
-
/* @__PURE__ */
|
|
2008
|
-
), /* @__PURE__ */
|
|
2617
|
+
/* @__PURE__ */ React13.createElement("span", { style: styles2.toggle, "aria-hidden": "true" }, "\u25BC")
|
|
2618
|
+
), /* @__PURE__ */ React13.createElement("div", { style: styles2.content }, children));
|
|
2009
2619
|
}
|
|
2010
2620
|
|
|
2011
2621
|
// src/SocialLinks.jsx
|
|
2012
|
-
import
|
|
2622
|
+
import React14 from "react";
|
|
2013
2623
|
var SOCIAL_PLATFORMS = [
|
|
2014
2624
|
{ test: /facebook\.com/i, platform: "facebook" },
|
|
2015
2625
|
{ test: /twitter\.com|x\.com/i, platform: "twitter" },
|
|
@@ -2080,7 +2690,7 @@ function SocialLinks({
|
|
|
2080
2690
|
}
|
|
2081
2691
|
};
|
|
2082
2692
|
const platformIconMap = {
|
|
2083
|
-
twitter: /* @__PURE__ */
|
|
2693
|
+
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(
|
|
2084
2694
|
"path",
|
|
2085
2695
|
{
|
|
2086
2696
|
d: "M4 4L10.5 12.5M20 20L13.5 11.5M10.5 12.5L4 20H8L13.5 11.5M10.5 12.5L16 4H20L13.5 11.5",
|
|
@@ -2090,7 +2700,7 @@ function SocialLinks({
|
|
|
2090
2700
|
strokeLinejoin: "round"
|
|
2091
2701
|
}
|
|
2092
2702
|
)),
|
|
2093
|
-
facebook: /* @__PURE__ */
|
|
2703
|
+
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(
|
|
2094
2704
|
"path",
|
|
2095
2705
|
{
|
|
2096
2706
|
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",
|
|
@@ -2100,8 +2710,8 @@ function SocialLinks({
|
|
|
2100
2710
|
strokeLinejoin: "round"
|
|
2101
2711
|
}
|
|
2102
2712
|
)),
|
|
2103
|
-
instagram: /* @__PURE__ */
|
|
2104
|
-
linkedin: /* @__PURE__ */
|
|
2713
|
+
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" })),
|
|
2714
|
+
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(
|
|
2105
2715
|
"path",
|
|
2106
2716
|
{
|
|
2107
2717
|
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",
|
|
@@ -2110,8 +2720,8 @@ function SocialLinks({
|
|
|
2110
2720
|
strokeLinecap: "round",
|
|
2111
2721
|
strokeLinejoin: "round"
|
|
2112
2722
|
}
|
|
2113
|
-
), /* @__PURE__ */
|
|
2114
|
-
youtube: /* @__PURE__ */
|
|
2723
|
+
), /* @__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" })),
|
|
2724
|
+
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" }))
|
|
2115
2725
|
};
|
|
2116
2726
|
const links = [
|
|
2117
2727
|
{
|
|
@@ -2137,7 +2747,7 @@ function SocialLinks({
|
|
|
2137
2747
|
{
|
|
2138
2748
|
href: website,
|
|
2139
2749
|
label: "Website",
|
|
2140
|
-
icon: /* @__PURE__ */
|
|
2750
|
+
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(
|
|
2141
2751
|
"path",
|
|
2142
2752
|
{
|
|
2143
2753
|
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",
|
|
@@ -2167,7 +2777,7 @@ function SocialLinks({
|
|
|
2167
2777
|
if (links.length === 0) {
|
|
2168
2778
|
return null;
|
|
2169
2779
|
}
|
|
2170
|
-
return /* @__PURE__ */
|
|
2780
|
+
return /* @__PURE__ */ React14.createElement("div", { style: styles2.container, className: "ev-social-links" }, links.map((link) => /* @__PURE__ */ React14.createElement(
|
|
2171
2781
|
"a",
|
|
2172
2782
|
{
|
|
2173
2783
|
key: link.label,
|
|
@@ -2190,7 +2800,7 @@ function SocialLinks({
|
|
|
2190
2800
|
}
|
|
2191
2801
|
|
|
2192
2802
|
// src/IssueTags.jsx
|
|
2193
|
-
import
|
|
2803
|
+
import React15 from "react";
|
|
2194
2804
|
function IssueTags({
|
|
2195
2805
|
tags = [],
|
|
2196
2806
|
selectedTags = [],
|
|
@@ -2233,9 +2843,9 @@ function IssueTags({
|
|
|
2233
2843
|
onTagClick(tag.value);
|
|
2234
2844
|
}
|
|
2235
2845
|
};
|
|
2236
|
-
return /* @__PURE__ */
|
|
2846
|
+
return /* @__PURE__ */ React15.createElement("div", { style: styles2.container, className: "ev-issue-tags", role: "list" }, tags.map((tag) => {
|
|
2237
2847
|
const isSelected = selectedTags.includes(tag.value);
|
|
2238
|
-
return /* @__PURE__ */
|
|
2848
|
+
return /* @__PURE__ */ React15.createElement(
|
|
2239
2849
|
"span",
|
|
2240
2850
|
{
|
|
2241
2851
|
key: tag.value,
|
|
@@ -2264,7 +2874,7 @@ function IssueTags({
|
|
|
2264
2874
|
}
|
|
2265
2875
|
|
|
2266
2876
|
// src/CommitteeTable.jsx
|
|
2267
|
-
import
|
|
2877
|
+
import React16, { useState as useState8 } from "react";
|
|
2268
2878
|
var ROLE_ORDER = {
|
|
2269
2879
|
"chair": 0,
|
|
2270
2880
|
"co-chair": 1,
|
|
@@ -2291,7 +2901,7 @@ function CommitteeTable({
|
|
|
2291
2901
|
maxVisible = 6,
|
|
2292
2902
|
style = {}
|
|
2293
2903
|
}) {
|
|
2294
|
-
const [showAll, setShowAll] =
|
|
2904
|
+
const [showAll, setShowAll] = useState8(false);
|
|
2295
2905
|
if (committees.length === 0) {
|
|
2296
2906
|
return null;
|
|
2297
2907
|
}
|
|
@@ -2353,7 +2963,7 @@ function CommitteeTable({
|
|
|
2353
2963
|
cursor: "pointer"
|
|
2354
2964
|
}
|
|
2355
2965
|
};
|
|
2356
|
-
return /* @__PURE__ */
|
|
2966
|
+
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(
|
|
2357
2967
|
"a",
|
|
2358
2968
|
{
|
|
2359
2969
|
href: committee.url,
|
|
@@ -2368,7 +2978,7 @@ function CommitteeTable({
|
|
|
2368
2978
|
}
|
|
2369
2979
|
},
|
|
2370
2980
|
committee.name
|
|
2371
|
-
) : committee.name), /* @__PURE__ */
|
|
2981
|
+
) : committee.name), /* @__PURE__ */ React16.createElement("td", { style: { ...styles2.cell, ...styles2.positionCell } }, formatPosition(committee.position)))))), hasMore && /* @__PURE__ */ React16.createElement(
|
|
2372
2982
|
"button",
|
|
2373
2983
|
{
|
|
2374
2984
|
type: "button",
|
|
@@ -2376,7 +2986,7 @@ function CommitteeTable({
|
|
|
2376
2986
|
onClick: () => setShowAll(!showAll)
|
|
2377
2987
|
},
|
|
2378
2988
|
showAll ? "Show less" : `Show all ${sorted.length} committees`,
|
|
2379
|
-
/* @__PURE__ */
|
|
2989
|
+
/* @__PURE__ */ React16.createElement(
|
|
2380
2990
|
"svg",
|
|
2381
2991
|
{
|
|
2382
2992
|
width: "14",
|
|
@@ -2389,16 +2999,16 @@ function CommitteeTable({
|
|
|
2389
2999
|
strokeLinejoin: "round",
|
|
2390
3000
|
style: { transform: showAll ? "rotate(180deg)" : "none", transition: "transform 0.2s" }
|
|
2391
3001
|
},
|
|
2392
|
-
/* @__PURE__ */
|
|
3002
|
+
/* @__PURE__ */ React16.createElement("polyline", { points: "6 9 12 15 18 9" })
|
|
2393
3003
|
)
|
|
2394
3004
|
));
|
|
2395
3005
|
}
|
|
2396
3006
|
|
|
2397
3007
|
// src/PoliticianProfile.jsx
|
|
2398
|
-
import
|
|
3008
|
+
import React19, { useState as useState9, useEffect as useEffect6 } from "react";
|
|
2399
3009
|
|
|
2400
3010
|
// src/LegislativeInlineSummary.jsx
|
|
2401
|
-
import
|
|
3011
|
+
import React17 from "react";
|
|
2402
3012
|
function normalizePosition(pos) {
|
|
2403
3013
|
if (!pos) return "";
|
|
2404
3014
|
return pos.replace(/_/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
@@ -2506,7 +3116,7 @@ function LegislativeInlineSummary({ summary, politicianId, onNavigateToRecord })
|
|
|
2506
3116
|
fontSize: fontSizes.sm,
|
|
2507
3117
|
fontWeight: fontWeights.medium
|
|
2508
3118
|
};
|
|
2509
|
-
return /* @__PURE__ */
|
|
3119
|
+
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(
|
|
2510
3120
|
"button",
|
|
2511
3121
|
{
|
|
2512
3122
|
onClick: () => {
|
|
@@ -2531,12 +3141,12 @@ function LegislativeInlineSummary({ summary, politicianId, onNavigateToRecord })
|
|
|
2531
3141
|
}
|
|
2532
3142
|
},
|
|
2533
3143
|
"View Full Legislative Record",
|
|
2534
|
-
/* @__PURE__ */
|
|
3144
|
+
/* @__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" }))
|
|
2535
3145
|
)));
|
|
2536
3146
|
}
|
|
2537
3147
|
|
|
2538
3148
|
// src/JudicialScorecard.jsx
|
|
2539
|
-
import
|
|
3149
|
+
import React18 from "react";
|
|
2540
3150
|
|
|
2541
3151
|
// src/judicialUtils.js
|
|
2542
3152
|
function formatDate(dateStr) {
|
|
@@ -2654,7 +3264,7 @@ function JudicialScorecard({ judicialRecord, politicianId, onNavigateToRecord })
|
|
|
2654
3264
|
onNavigateToRecord(`/politician/${politicianId}/judicial-record`);
|
|
2655
3265
|
}
|
|
2656
3266
|
};
|
|
2657
|
-
return /* @__PURE__ */
|
|
3267
|
+
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"));
|
|
2658
3268
|
}
|
|
2659
3269
|
|
|
2660
3270
|
// src/PoliticianProfile.jsx
|
|
@@ -2805,13 +3415,13 @@ function formatAddress(addr) {
|
|
|
2805
3415
|
if (cityStateZip) lines.push(cityStateZip);
|
|
2806
3416
|
return lines;
|
|
2807
3417
|
}
|
|
2808
|
-
var CalendarIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
2809
|
-
var ClockIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
2810
|
-
var MapPinIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
2811
|
-
var PhoneIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
2812
|
-
var MailIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
2813
|
-
var GlobeIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
2814
|
-
var ExternalLinkIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
3418
|
+
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" }));
|
|
3419
|
+
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" }));
|
|
3420
|
+
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" }));
|
|
3421
|
+
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" }));
|
|
3422
|
+
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" }));
|
|
3423
|
+
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" }));
|
|
3424
|
+
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" }));
|
|
2815
3425
|
function PoliticianProfile({
|
|
2816
3426
|
politician = {},
|
|
2817
3427
|
onBack,
|
|
@@ -2838,8 +3448,8 @@ function PoliticianProfile({
|
|
|
2838
3448
|
return pol.photo_origin_url;
|
|
2839
3449
|
})();
|
|
2840
3450
|
const initials = [pol.first_name, pol.last_name].filter(Boolean).map((n) => n[0]).join("");
|
|
2841
|
-
const [imgError, setImgError] =
|
|
2842
|
-
|
|
3451
|
+
const [imgError, setImgError] = useState9(false);
|
|
3452
|
+
useEffect6(() => {
|
|
2843
3453
|
setImgError(false);
|
|
2844
3454
|
}, [profileImageUrl]);
|
|
2845
3455
|
const getSocialHandle = (type) => {
|
|
@@ -3139,7 +3749,7 @@ function PoliticianProfile({
|
|
|
3139
3749
|
borderRadius: borderRadius.full
|
|
3140
3750
|
}
|
|
3141
3751
|
};
|
|
3142
|
-
return /* @__PURE__ */
|
|
3752
|
+
return /* @__PURE__ */ React19.createElement("div", { style: styles2.container, className: "ev-politician-profile" }, onBack && /* @__PURE__ */ React19.createElement(
|
|
3143
3753
|
"button",
|
|
3144
3754
|
{
|
|
3145
3755
|
type: "button",
|
|
@@ -3152,9 +3762,9 @@ function PoliticianProfile({
|
|
|
3152
3762
|
e.currentTarget.style.textDecoration = "none";
|
|
3153
3763
|
}
|
|
3154
3764
|
},
|
|
3155
|
-
/* @__PURE__ */
|
|
3765
|
+
/* @__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" })),
|
|
3156
3766
|
label
|
|
3157
|
-
), /* @__PURE__ */
|
|
3767
|
+
), /* @__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(
|
|
3158
3768
|
"img",
|
|
3159
3769
|
{
|
|
3160
3770
|
src: profileImageUrl,
|
|
@@ -3162,7 +3772,7 @@ function PoliticianProfile({
|
|
|
3162
3772
|
style: styles2.photo,
|
|
3163
3773
|
onError: () => setImgError(true)
|
|
3164
3774
|
}
|
|
3165
|
-
) : /* @__PURE__ */
|
|
3775
|
+
) : /* @__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(
|
|
3166
3776
|
"a",
|
|
3167
3777
|
{
|
|
3168
3778
|
href: pol.web_form_url,
|
|
@@ -3176,9 +3786,9 @@ function PoliticianProfile({
|
|
|
3176
3786
|
e.currentTarget.style.background = colors.evTeal;
|
|
3177
3787
|
}
|
|
3178
3788
|
},
|
|
3179
|
-
/* @__PURE__ */
|
|
3789
|
+
/* @__PURE__ */ React19.createElement(ExternalLinkIcon, { size: 14 }),
|
|
3180
3790
|
"Submit a Message"
|
|
3181
|
-
))), hasContactInfo && /* @__PURE__ */
|
|
3791
|
+
))), 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(
|
|
3182
3792
|
"a",
|
|
3183
3793
|
{
|
|
3184
3794
|
href: `tel:${phone}`,
|
|
@@ -3191,7 +3801,7 @@ function PoliticianProfile({
|
|
|
3191
3801
|
}
|
|
3192
3802
|
},
|
|
3193
3803
|
phone
|
|
3194
|
-
)))))), hasEmails && /* @__PURE__ */
|
|
3804
|
+
)))))), 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(
|
|
3195
3805
|
"a",
|
|
3196
3806
|
{
|
|
3197
3807
|
href: `mailto:${email}`,
|
|
@@ -3204,7 +3814,7 @@ function PoliticianProfile({
|
|
|
3204
3814
|
}
|
|
3205
3815
|
},
|
|
3206
3816
|
email
|
|
3207
|
-
)))))), hasWebsitesCol && /* @__PURE__ */
|
|
3817
|
+
)))))), 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(
|
|
3208
3818
|
"a",
|
|
3209
3819
|
{
|
|
3210
3820
|
href: url,
|
|
@@ -3219,7 +3829,7 @@ function PoliticianProfile({
|
|
|
3219
3829
|
}
|
|
3220
3830
|
},
|
|
3221
3831
|
extractDomain(url)
|
|
3222
|
-
))), (hasSocial || socialWebsiteUrls.length > 0) && /* @__PURE__ */
|
|
3832
|
+
))), (hasSocial || socialWebsiteUrls.length > 0) && /* @__PURE__ */ React19.createElement(
|
|
3223
3833
|
SocialLinks,
|
|
3224
3834
|
{
|
|
3225
3835
|
twitter,
|
|
@@ -3230,14 +3840,14 @@ function PoliticianProfile({
|
|
|
3230
3840
|
size: "sm",
|
|
3231
3841
|
style: { marginTop: allWebsites.length > 0 ? "8px" : 0 }
|
|
3232
3842
|
}
|
|
3233
|
-
)))), committees.length > 0 && /* @__PURE__ */
|
|
3843
|
+
)))), 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(
|
|
3234
3844
|
JudicialScorecard,
|
|
3235
3845
|
{
|
|
3236
3846
|
judicialRecord,
|
|
3237
3847
|
politicianId,
|
|
3238
3848
|
onNavigateToRecord
|
|
3239
3849
|
}
|
|
3240
|
-
) : /* @__PURE__ */
|
|
3850
|
+
) : /* @__PURE__ */ React19.createElement(
|
|
3241
3851
|
LegislativeInlineSummary,
|
|
3242
3852
|
{
|
|
3243
3853
|
summary: legislativeSummary,
|
|
@@ -3248,7 +3858,7 @@ function PoliticianProfile({
|
|
|
3248
3858
|
}
|
|
3249
3859
|
|
|
3250
3860
|
// src/LegislativeRecord.jsx
|
|
3251
|
-
import
|
|
3861
|
+
import React20, { useState as useState10 } from "react";
|
|
3252
3862
|
var DEFAULT_LIMIT = 25;
|
|
3253
3863
|
function normalizeText(str) {
|
|
3254
3864
|
if (!str) return "";
|
|
@@ -3328,7 +3938,7 @@ function getPositionBadge(position) {
|
|
|
3328
3938
|
return { bg: colors.borderLight, text: colors.textSecondary };
|
|
3329
3939
|
}
|
|
3330
3940
|
function Badge({ label, bg, text }) {
|
|
3331
|
-
return /* @__PURE__ */
|
|
3941
|
+
return /* @__PURE__ */ React20.createElement("span", { style: {
|
|
3332
3942
|
display: "inline-block",
|
|
3333
3943
|
background: bg,
|
|
3334
3944
|
color: text,
|
|
@@ -3341,18 +3951,18 @@ function Badge({ label, bg, text }) {
|
|
|
3341
3951
|
} }, label);
|
|
3342
3952
|
}
|
|
3343
3953
|
function SectionHeader({ title, yearFilter, years, onYearChange }) {
|
|
3344
|
-
return /* @__PURE__ */
|
|
3954
|
+
return /* @__PURE__ */ React20.createElement("div", { style: {
|
|
3345
3955
|
display: "flex",
|
|
3346
3956
|
alignItems: "center",
|
|
3347
3957
|
justifyContent: "space-between",
|
|
3348
3958
|
marginBottom: spacing[4]
|
|
3349
|
-
} }, /* @__PURE__ */
|
|
3959
|
+
} }, /* @__PURE__ */ React20.createElement("h2", { style: {
|
|
3350
3960
|
fontFamily: fonts.primary,
|
|
3351
3961
|
fontSize: fontSizes.xl,
|
|
3352
3962
|
fontWeight: fontWeights.bold,
|
|
3353
3963
|
color: colors.evTeal,
|
|
3354
3964
|
margin: 0
|
|
3355
|
-
} }, title), years && years.length > 0 && /* @__PURE__ */
|
|
3965
|
+
} }, title), years && years.length > 0 && /* @__PURE__ */ React20.createElement(
|
|
3356
3966
|
"select",
|
|
3357
3967
|
{
|
|
3358
3968
|
value: yearFilter,
|
|
@@ -3368,13 +3978,13 @@ function SectionHeader({ title, yearFilter, years, onYearChange }) {
|
|
|
3368
3978
|
cursor: "pointer"
|
|
3369
3979
|
}
|
|
3370
3980
|
},
|
|
3371
|
-
/* @__PURE__ */
|
|
3372
|
-
years.map((y) => /* @__PURE__ */
|
|
3981
|
+
/* @__PURE__ */ React20.createElement("option", { value: "All" }, "All years"),
|
|
3982
|
+
years.map((y) => /* @__PURE__ */ React20.createElement("option", { key: y, value: y }, y))
|
|
3373
3983
|
));
|
|
3374
3984
|
}
|
|
3375
3985
|
function ShowAllLink({ totalCount, visibleCount, onClick }) {
|
|
3376
3986
|
if (totalCount <= visibleCount) return null;
|
|
3377
|
-
return /* @__PURE__ */
|
|
3987
|
+
return /* @__PURE__ */ React20.createElement("div", { style: { textAlign: "center", marginTop: spacing[3] } }, /* @__PURE__ */ React20.createElement(
|
|
3378
3988
|
"button",
|
|
3379
3989
|
{
|
|
3380
3990
|
type: "button",
|
|
@@ -3402,7 +4012,7 @@ function ShowAllLink({ totalCount, visibleCount, onClick }) {
|
|
|
3402
4012
|
));
|
|
3403
4013
|
}
|
|
3404
4014
|
function EmptyState({ message }) {
|
|
3405
|
-
return /* @__PURE__ */
|
|
4015
|
+
return /* @__PURE__ */ React20.createElement("p", { style: {
|
|
3406
4016
|
fontFamily: fonts.primary,
|
|
3407
4017
|
fontSize: fontSizes.sm,
|
|
3408
4018
|
color: colors.textMuted,
|
|
@@ -3412,24 +4022,24 @@ function EmptyState({ message }) {
|
|
|
3412
4022
|
} }, message);
|
|
3413
4023
|
}
|
|
3414
4024
|
function Spinner() {
|
|
3415
|
-
return /* @__PURE__ */
|
|
4025
|
+
return /* @__PURE__ */ React20.createElement("div", { style: {
|
|
3416
4026
|
display: "flex",
|
|
3417
4027
|
justifyContent: "center",
|
|
3418
4028
|
alignItems: "center",
|
|
3419
4029
|
padding: spacing[10]
|
|
3420
|
-
} }, /* @__PURE__ */
|
|
4030
|
+
} }, /* @__PURE__ */ React20.createElement("div", { style: {
|
|
3421
4031
|
width: "40px",
|
|
3422
4032
|
height: "40px",
|
|
3423
4033
|
borderRadius: borderRadius.full,
|
|
3424
4034
|
border: `3px solid ${colors.borderLight}`,
|
|
3425
4035
|
borderTopColor: colors.evTeal,
|
|
3426
4036
|
animation: "ev-spin 0.8s linear infinite"
|
|
3427
|
-
} }), /* @__PURE__ */
|
|
4037
|
+
} }), /* @__PURE__ */ React20.createElement("style", null, `@keyframes ev-spin { to { transform: rotate(360deg); } }`));
|
|
3428
4038
|
}
|
|
3429
4039
|
function CommitteesSection({ committees, leadership }) {
|
|
3430
|
-
const [showAll, setShowAll] =
|
|
4040
|
+
const [showAll, setShowAll] = useState10(false);
|
|
3431
4041
|
const visible = showAll ? committees : committees.slice(0, DEFAULT_LIMIT);
|
|
3432
|
-
return /* @__PURE__ */
|
|
4042
|
+
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: {
|
|
3433
4043
|
display: "inline-flex",
|
|
3434
4044
|
alignItems: "center",
|
|
3435
4045
|
gap: spacing[1],
|
|
@@ -3440,23 +4050,23 @@ function CommitteesSection({ committees, leadership }) {
|
|
|
3440
4050
|
fontFamily: fonts.primary,
|
|
3441
4051
|
fontSize: fontSizes.sm,
|
|
3442
4052
|
fontWeight: fontWeights.semibold
|
|
3443
|
-
} }, role.title, role.chamber && /* @__PURE__ */
|
|
4053
|
+
} }, 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) => {
|
|
3444
4054
|
const badge = getRoleBadge(c.role);
|
|
3445
|
-
return /* @__PURE__ */
|
|
4055
|
+
return /* @__PURE__ */ React20.createElement("div", { key: i, style: {
|
|
3446
4056
|
display: "flex",
|
|
3447
4057
|
alignItems: "center",
|
|
3448
4058
|
justifyContent: "space-between",
|
|
3449
4059
|
padding: `${spacing[3]} 0`,
|
|
3450
4060
|
borderBottom: `1px solid ${colors.borderLight}`,
|
|
3451
4061
|
gap: spacing[3]
|
|
3452
|
-
} }, /* @__PURE__ */
|
|
4062
|
+
} }, /* @__PURE__ */ React20.createElement("span", { style: {
|
|
3453
4063
|
fontFamily: fonts.primary,
|
|
3454
4064
|
fontSize: fontSizes.sm,
|
|
3455
4065
|
color: colors.textSecondary,
|
|
3456
4066
|
flex: 1,
|
|
3457
4067
|
minWidth: 0
|
|
3458
|
-
} }, c.committee_name, c.parent_name && /* @__PURE__ */
|
|
3459
|
-
})), !showAll && /* @__PURE__ */
|
|
4068
|
+
} }, 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 }));
|
|
4069
|
+
})), !showAll && /* @__PURE__ */ React20.createElement(
|
|
3460
4070
|
ShowAllLink,
|
|
3461
4071
|
{
|
|
3462
4072
|
totalCount: committees.length,
|
|
@@ -3467,15 +4077,15 @@ function CommitteesSection({ committees, leadership }) {
|
|
|
3467
4077
|
}
|
|
3468
4078
|
function LegislationSection({ bills, isMobile }) {
|
|
3469
4079
|
const years = getYears(bills, "introduced_at");
|
|
3470
|
-
const [yearFilter, setYearFilter] =
|
|
3471
|
-
const [showAll, setShowAll] =
|
|
4080
|
+
const [yearFilter, setYearFilter] = useState10("All");
|
|
4081
|
+
const [showAll, setShowAll] = useState10(false);
|
|
3472
4082
|
const handleYearChange = (y) => {
|
|
3473
4083
|
setYearFilter(y);
|
|
3474
4084
|
setShowAll(false);
|
|
3475
4085
|
};
|
|
3476
4086
|
const filtered = yearFilter === "All" ? bills : bills.filter((b) => extractYear(b.introduced_at) === yearFilter);
|
|
3477
4087
|
const visible = showAll ? filtered : filtered.slice(0, DEFAULT_LIMIT);
|
|
3478
|
-
return /* @__PURE__ */
|
|
4088
|
+
return /* @__PURE__ */ React20.createElement("div", { style: { marginBottom: spacing[8] } }, /* @__PURE__ */ React20.createElement(
|
|
3479
4089
|
SectionHeader,
|
|
3480
4090
|
{
|
|
3481
4091
|
title: "Sponsored Legislation",
|
|
@@ -3483,42 +4093,42 @@ function LegislationSection({ bills, isMobile }) {
|
|
|
3483
4093
|
years,
|
|
3484
4094
|
onYearChange: handleYearChange
|
|
3485
4095
|
}
|
|
3486
|
-
), bills.length === 0 ? /* @__PURE__ */
|
|
4096
|
+
), 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) => {
|
|
3487
4097
|
const statusBadge = getStatusBadge(bill.status_label);
|
|
3488
|
-
return /* @__PURE__ */
|
|
4098
|
+
return /* @__PURE__ */ React20.createElement("div", { key: i, style: {
|
|
3489
4099
|
display: "flex",
|
|
3490
4100
|
flexDirection: isMobile ? "column" : "row",
|
|
3491
4101
|
alignItems: isMobile ? "flex-start" : "center",
|
|
3492
4102
|
gap: isMobile ? spacing[1] : spacing[3],
|
|
3493
4103
|
padding: `${spacing[3]} 0`,
|
|
3494
4104
|
borderBottom: `1px solid ${colors.borderLight}`
|
|
3495
|
-
} }, /* @__PURE__ */
|
|
4105
|
+
} }, /* @__PURE__ */ React20.createElement("div", { style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React20.createElement("span", { style: {
|
|
3496
4106
|
fontFamily: fonts.primary,
|
|
3497
4107
|
fontSize: fontSizes.xs,
|
|
3498
4108
|
fontWeight: fontWeights.bold,
|
|
3499
4109
|
color: colors.textSecondary,
|
|
3500
4110
|
marginRight: spacing[2]
|
|
3501
|
-
} }, bill.number), /* @__PURE__ */
|
|
4111
|
+
} }, bill.number), /* @__PURE__ */ React20.createElement("span", { style: {
|
|
3502
4112
|
fontFamily: fonts.primary,
|
|
3503
4113
|
fontSize: fontSizes.sm,
|
|
3504
4114
|
color: colors.textSecondary
|
|
3505
|
-
} }, bill.title)), /* @__PURE__ */
|
|
4115
|
+
} }, bill.title)), /* @__PURE__ */ React20.createElement("div", { style: {
|
|
3506
4116
|
display: "flex",
|
|
3507
4117
|
alignItems: "center",
|
|
3508
4118
|
gap: spacing[2],
|
|
3509
4119
|
flexShrink: 0,
|
|
3510
4120
|
flexWrap: "wrap"
|
|
3511
|
-
} }, /* @__PURE__ */
|
|
4121
|
+
} }, /* @__PURE__ */ React20.createElement(Badge, { label: bill.status_label || "Unknown", bg: statusBadge.bg, text: statusBadge.text }), bill.introduced_at && /* @__PURE__ */ React20.createElement("span", { style: {
|
|
3512
4122
|
fontFamily: fonts.primary,
|
|
3513
4123
|
fontSize: fontSizes.xs,
|
|
3514
4124
|
color: colors.textMuted
|
|
3515
|
-
} }, formatDate2(bill.introduced_at)), /* @__PURE__ */
|
|
4125
|
+
} }, formatDate2(bill.introduced_at)), /* @__PURE__ */ React20.createElement("span", { style: {
|
|
3516
4126
|
fontFamily: fonts.primary,
|
|
3517
4127
|
fontSize: fontSizes.xs,
|
|
3518
4128
|
color: colors.textMuted,
|
|
3519
4129
|
fontStyle: "italic"
|
|
3520
4130
|
} }, bill.is_sponsor ? "Sponsored" : "Cosponsored")));
|
|
3521
|
-
})), !showAll && /* @__PURE__ */
|
|
4131
|
+
})), !showAll && /* @__PURE__ */ React20.createElement(
|
|
3522
4132
|
ShowAllLink,
|
|
3523
4133
|
{
|
|
3524
4134
|
totalCount: filtered.length,
|
|
@@ -3529,15 +4139,15 @@ function LegislationSection({ bills, isMobile }) {
|
|
|
3529
4139
|
}
|
|
3530
4140
|
function VotingSection({ votes, isMobile }) {
|
|
3531
4141
|
const years = getYears(votes, "vote_date");
|
|
3532
|
-
const [yearFilter, setYearFilter] =
|
|
3533
|
-
const [showAll, setShowAll] =
|
|
4142
|
+
const [yearFilter, setYearFilter] = useState10("All");
|
|
4143
|
+
const [showAll, setShowAll] = useState10(false);
|
|
3534
4144
|
const handleYearChange = (y) => {
|
|
3535
4145
|
setYearFilter(y);
|
|
3536
4146
|
setShowAll(false);
|
|
3537
4147
|
};
|
|
3538
4148
|
const filtered = yearFilter === "All" ? votes : votes.filter((v) => extractYear(v.vote_date) === yearFilter);
|
|
3539
4149
|
const visible = showAll ? filtered : filtered.slice(0, DEFAULT_LIMIT);
|
|
3540
|
-
return /* @__PURE__ */
|
|
4150
|
+
return /* @__PURE__ */ React20.createElement("div", { style: { marginBottom: spacing[8] } }, /* @__PURE__ */ React20.createElement(
|
|
3541
4151
|
SectionHeader,
|
|
3542
4152
|
{
|
|
3543
4153
|
title: "Voting Record",
|
|
@@ -3545,38 +4155,38 @@ function VotingSection({ votes, isMobile }) {
|
|
|
3545
4155
|
years,
|
|
3546
4156
|
onYearChange: handleYearChange
|
|
3547
4157
|
}
|
|
3548
|
-
), votes.length === 0 ? /* @__PURE__ */
|
|
4158
|
+
), 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) => {
|
|
3549
4159
|
const positionBadge = getPositionBadge(vote.position);
|
|
3550
4160
|
const normPosition = normalizeText(vote.position);
|
|
3551
4161
|
const topic = vote.bill_title || vote.vote_question;
|
|
3552
4162
|
const sourceUrl = vote.bill_url;
|
|
3553
|
-
return /* @__PURE__ */
|
|
4163
|
+
return /* @__PURE__ */ React20.createElement("div", { key: i, style: {
|
|
3554
4164
|
display: "flex",
|
|
3555
4165
|
flexDirection: isMobile ? "column" : "row",
|
|
3556
4166
|
alignItems: isMobile ? "flex-start" : "center",
|
|
3557
4167
|
gap: isMobile ? spacing[1] : spacing[3],
|
|
3558
4168
|
padding: `${spacing[3]} 0`,
|
|
3559
4169
|
borderBottom: `1px solid ${colors.borderLight}`
|
|
3560
|
-
} }, /* @__PURE__ */
|
|
4170
|
+
} }, /* @__PURE__ */ React20.createElement("div", { style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React20.createElement("span", { style: {
|
|
3561
4171
|
fontFamily: fonts.primary,
|
|
3562
4172
|
fontSize: fontSizes.sm,
|
|
3563
4173
|
color: colors.textSecondary
|
|
3564
|
-
} }, topic)), /* @__PURE__ */
|
|
4174
|
+
} }, topic)), /* @__PURE__ */ React20.createElement("div", { style: {
|
|
3565
4175
|
display: "flex",
|
|
3566
4176
|
alignItems: "center",
|
|
3567
4177
|
gap: spacing[2],
|
|
3568
4178
|
flexShrink: 0,
|
|
3569
4179
|
flexWrap: "wrap"
|
|
3570
|
-
} }, vote.vote_date && /* @__PURE__ */
|
|
4180
|
+
} }, vote.vote_date && /* @__PURE__ */ React20.createElement("span", { style: {
|
|
3571
4181
|
fontFamily: fonts.primary,
|
|
3572
4182
|
fontSize: fontSizes.xs,
|
|
3573
4183
|
color: colors.textMuted
|
|
3574
|
-
} }, formatDate2(vote.vote_date)), /* @__PURE__ */
|
|
4184
|
+
} }, formatDate2(vote.vote_date)), /* @__PURE__ */ React20.createElement(Badge, { label: normPosition || "Unknown", bg: positionBadge.bg, text: positionBadge.text }), vote.result && /* @__PURE__ */ React20.createElement("span", { style: {
|
|
3575
4185
|
fontFamily: fonts.primary,
|
|
3576
4186
|
fontSize: fontSizes.xs,
|
|
3577
4187
|
color: vote.result === "Passed" ? colors.success : colors.textMuted,
|
|
3578
4188
|
fontWeight: fontWeights.medium
|
|
3579
|
-
} }, vote.result), sourceUrl && /* @__PURE__ */
|
|
4189
|
+
} }, vote.result), sourceUrl && /* @__PURE__ */ React20.createElement(
|
|
3580
4190
|
"a",
|
|
3581
4191
|
{
|
|
3582
4192
|
href: sourceUrl,
|
|
@@ -3597,7 +4207,7 @@ function VotingSection({ votes, isMobile }) {
|
|
|
3597
4207
|
},
|
|
3598
4208
|
"Source"
|
|
3599
4209
|
)));
|
|
3600
|
-
})), !showAll && /* @__PURE__ */
|
|
4210
|
+
})), !showAll && /* @__PURE__ */ React20.createElement(
|
|
3601
4211
|
ShowAllLink,
|
|
3602
4212
|
{
|
|
3603
4213
|
totalCount: filtered.length,
|
|
@@ -3616,20 +4226,20 @@ function LegislativeRecord({
|
|
|
3616
4226
|
}) {
|
|
3617
4227
|
const isMobile = useMediaQuery("(max-width: 768px)");
|
|
3618
4228
|
if (loading) {
|
|
3619
|
-
return /* @__PURE__ */
|
|
4229
|
+
return /* @__PURE__ */ React20.createElement(Spinner, null);
|
|
3620
4230
|
}
|
|
3621
|
-
return /* @__PURE__ */
|
|
4231
|
+
return /* @__PURE__ */ React20.createElement("div", { style: { fontFamily: fonts.primary } }, politicianName && /* @__PURE__ */ React20.createElement("h1", { style: {
|
|
3622
4232
|
fontFamily: fonts.primary,
|
|
3623
4233
|
fontSize: isMobile ? fontSizes["2xl"] : fontSizes["4xl"],
|
|
3624
4234
|
fontWeight: fontWeights.bold,
|
|
3625
4235
|
color: colors.evTeal,
|
|
3626
4236
|
marginBottom: spacing[8],
|
|
3627
4237
|
marginTop: 0
|
|
3628
|
-
} }, "Legislative Record: ", politicianName), /* @__PURE__ */
|
|
4238
|
+
} }, "Legislative Record: ", politicianName), /* @__PURE__ */ React20.createElement(CommitteesSection, { committees, leadership }), /* @__PURE__ */ React20.createElement(LegislationSection, { bills, isMobile }), /* @__PURE__ */ React20.createElement(VotingSection, { votes, isMobile }));
|
|
3629
4239
|
}
|
|
3630
4240
|
|
|
3631
4241
|
// src/JudicialRecordDetail.jsx
|
|
3632
|
-
import
|
|
4242
|
+
import React21 from "react";
|
|
3633
4243
|
var containerStyle = {
|
|
3634
4244
|
fontFamily: "'Manrope', sans-serif",
|
|
3635
4245
|
maxWidth: "800px"
|
|
@@ -3714,7 +4324,7 @@ var emptyStateStyle = {
|
|
|
3714
4324
|
function JudicialRecordDetail({ politician = {}, judicialRecord, onBack }) {
|
|
3715
4325
|
var _a;
|
|
3716
4326
|
if (!judicialRecord) {
|
|
3717
|
-
return /* @__PURE__ */
|
|
4327
|
+
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."));
|
|
3718
4328
|
}
|
|
3719
4329
|
const {
|
|
3720
4330
|
judge_detail: detail,
|
|
@@ -3723,13 +4333,13 @@ function JudicialRecordDetail({ politician = {}, judicialRecord, onBack }) {
|
|
|
3723
4333
|
disciplinary_records: disciplinary = []
|
|
3724
4334
|
} = judicialRecord;
|
|
3725
4335
|
const displayName = politician.full_name || `${politician.first_name || ""} ${politician.last_name || ""}`.trim();
|
|
3726
|
-
return /* @__PURE__ */
|
|
4336
|
+
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: {
|
|
3727
4337
|
borderLeft: "3px solid #fc8181",
|
|
3728
4338
|
backgroundColor: "#fff5f5",
|
|
3729
4339
|
borderRadius: "0 6px 6px 0",
|
|
3730
4340
|
padding: "12px 16px",
|
|
3731
4341
|
marginBottom: "10px"
|
|
3732
|
-
} }, /* @__PURE__ */
|
|
4342
|
+
} }, /* @__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(
|
|
3733
4343
|
"a",
|
|
3734
4344
|
{
|
|
3735
4345
|
href: d.source_url,
|
|
@@ -3742,7 +4352,7 @@ function JudicialRecordDetail({ politician = {}, judicialRecord, onBack }) {
|
|
|
3742
4352
|
}
|
|
3743
4353
|
|
|
3744
4354
|
// src/AuthForm.jsx
|
|
3745
|
-
import
|
|
4355
|
+
import React22, { useState as useState11 } from "react";
|
|
3746
4356
|
function AuthForm({
|
|
3747
4357
|
logoSrc = "/EVLogo.svg",
|
|
3748
4358
|
appName = "Empowered Vote",
|
|
@@ -3753,11 +4363,11 @@ function AuthForm({
|
|
|
3753
4363
|
error = null,
|
|
3754
4364
|
submitting = false
|
|
3755
4365
|
}) {
|
|
3756
|
-
const [username, setUsername] =
|
|
3757
|
-
const [password, setPassword] =
|
|
3758
|
-
const [confirmPassword, setConfirmPassword] =
|
|
3759
|
-
const [showPasswords, setShowPasswords] =
|
|
3760
|
-
const [passwordMismatch, setPasswordMismatch] =
|
|
4366
|
+
const [username, setUsername] = useState11("");
|
|
4367
|
+
const [password, setPassword] = useState11("");
|
|
4368
|
+
const [confirmPassword, setConfirmPassword] = useState11("");
|
|
4369
|
+
const [showPasswords, setShowPasswords] = useState11(false);
|
|
4370
|
+
const [passwordMismatch, setPasswordMismatch] = useState11(false);
|
|
3761
4371
|
const isLogin = mode === "login";
|
|
3762
4372
|
const handleSubmit = (e) => {
|
|
3763
4373
|
e.preventDefault();
|
|
@@ -3769,7 +4379,7 @@ function AuthForm({
|
|
|
3769
4379
|
setPasswordMismatch(false);
|
|
3770
4380
|
onSubmit == null ? void 0 : onSubmit(username.trim(), password);
|
|
3771
4381
|
};
|
|
3772
|
-
const EyeOpen = () => /* @__PURE__ */
|
|
4382
|
+
const EyeOpen = () => /* @__PURE__ */ React22.createElement(
|
|
3773
4383
|
"svg",
|
|
3774
4384
|
{
|
|
3775
4385
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3779,7 +4389,7 @@ function AuthForm({
|
|
|
3779
4389
|
stroke: "currentColor",
|
|
3780
4390
|
style: { width: "20px", height: "20px" }
|
|
3781
4391
|
},
|
|
3782
|
-
/* @__PURE__ */
|
|
4392
|
+
/* @__PURE__ */ React22.createElement(
|
|
3783
4393
|
"path",
|
|
3784
4394
|
{
|
|
3785
4395
|
strokeLinecap: "round",
|
|
@@ -3787,7 +4397,7 @@ function AuthForm({
|
|
|
3787
4397
|
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"
|
|
3788
4398
|
}
|
|
3789
4399
|
),
|
|
3790
|
-
/* @__PURE__ */
|
|
4400
|
+
/* @__PURE__ */ React22.createElement(
|
|
3791
4401
|
"path",
|
|
3792
4402
|
{
|
|
3793
4403
|
strokeLinecap: "round",
|
|
@@ -3796,7 +4406,7 @@ function AuthForm({
|
|
|
3796
4406
|
}
|
|
3797
4407
|
)
|
|
3798
4408
|
);
|
|
3799
|
-
const EyeClosed = () => /* @__PURE__ */
|
|
4409
|
+
const EyeClosed = () => /* @__PURE__ */ React22.createElement(
|
|
3800
4410
|
"svg",
|
|
3801
4411
|
{
|
|
3802
4412
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3806,7 +4416,7 @@ function AuthForm({
|
|
|
3806
4416
|
stroke: "currentColor",
|
|
3807
4417
|
style: { width: "20px", height: "20px" }
|
|
3808
4418
|
},
|
|
3809
|
-
/* @__PURE__ */
|
|
4419
|
+
/* @__PURE__ */ React22.createElement(
|
|
3810
4420
|
"path",
|
|
3811
4421
|
{
|
|
3812
4422
|
strokeLinecap: "round",
|
|
@@ -3815,17 +4425,17 @@ function AuthForm({
|
|
|
3815
4425
|
}
|
|
3816
4426
|
)
|
|
3817
4427
|
);
|
|
3818
|
-
const PasswordToggle = () => /* @__PURE__ */
|
|
4428
|
+
const PasswordToggle = () => /* @__PURE__ */ React22.createElement(
|
|
3819
4429
|
"button",
|
|
3820
4430
|
{
|
|
3821
4431
|
type: "button",
|
|
3822
4432
|
onClick: () => setShowPasswords((prev) => !prev),
|
|
3823
4433
|
style: styles.passwordToggle
|
|
3824
4434
|
},
|
|
3825
|
-
showPasswords ? /* @__PURE__ */
|
|
4435
|
+
showPasswords ? /* @__PURE__ */ React22.createElement(EyeOpen, null) : /* @__PURE__ */ React22.createElement(EyeClosed, null)
|
|
3826
4436
|
);
|
|
3827
4437
|
const displayError = passwordMismatch ? "Passwords do not match." : error;
|
|
3828
|
-
return /* @__PURE__ */
|
|
4438
|
+
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(
|
|
3829
4439
|
"input",
|
|
3830
4440
|
{
|
|
3831
4441
|
type: "text",
|
|
@@ -3842,7 +4452,7 @@ function AuthForm({
|
|
|
3842
4452
|
},
|
|
3843
4453
|
required: true
|
|
3844
4454
|
}
|
|
3845
|
-
)), /* @__PURE__ */
|
|
4455
|
+
)), /* @__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(
|
|
3846
4456
|
"input",
|
|
3847
4457
|
{
|
|
3848
4458
|
type: showPasswords ? "text" : "password",
|
|
@@ -3858,7 +4468,7 @@ function AuthForm({
|
|
|
3858
4468
|
},
|
|
3859
4469
|
required: true
|
|
3860
4470
|
}
|
|
3861
|
-
), /* @__PURE__ */
|
|
4471
|
+
), /* @__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(
|
|
3862
4472
|
"input",
|
|
3863
4473
|
{
|
|
3864
4474
|
type: showPasswords ? "text" : "password",
|
|
@@ -3874,7 +4484,7 @@ function AuthForm({
|
|
|
3874
4484
|
},
|
|
3875
4485
|
required: true
|
|
3876
4486
|
}
|
|
3877
|
-
), /* @__PURE__ */
|
|
4487
|
+
), /* @__PURE__ */ React22.createElement(PasswordToggle, null))), displayError && /* @__PURE__ */ React22.createElement("div", { style: styles.errorBox }, /* @__PURE__ */ React22.createElement("p", { style: styles.errorText }, displayError)), /* @__PURE__ */ React22.createElement(
|
|
3878
4488
|
"button",
|
|
3879
4489
|
{
|
|
3880
4490
|
type: "submit",
|
|
@@ -3892,7 +4502,7 @@ function AuthForm({
|
|
|
3892
4502
|
}
|
|
3893
4503
|
},
|
|
3894
4504
|
submitting ? isLogin ? "Signing In..." : "Creating Account..." : isLogin ? "Sign In" : "Create Account"
|
|
3895
|
-
), onModeSwitch && /* @__PURE__ */
|
|
4505
|
+
), 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(
|
|
3896
4506
|
"button",
|
|
3897
4507
|
{
|
|
3898
4508
|
type: "button",
|
|
@@ -4065,9 +4675,9 @@ var styles = {
|
|
|
4065
4675
|
};
|
|
4066
4676
|
|
|
4067
4677
|
// src/TopicTierBadge.jsx
|
|
4068
|
-
import
|
|
4678
|
+
import React23 from "react";
|
|
4069
4679
|
function LandmarkIcon({ size = 14 }) {
|
|
4070
|
-
return /* @__PURE__ */
|
|
4680
|
+
return /* @__PURE__ */ React23.createElement(
|
|
4071
4681
|
"svg",
|
|
4072
4682
|
{
|
|
4073
4683
|
width: size,
|
|
@@ -4081,16 +4691,16 @@ function LandmarkIcon({ size = 14 }) {
|
|
|
4081
4691
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4082
4692
|
"aria-hidden": "true"
|
|
4083
4693
|
},
|
|
4084
|
-
/* @__PURE__ */
|
|
4085
|
-
/* @__PURE__ */
|
|
4086
|
-
/* @__PURE__ */
|
|
4087
|
-
/* @__PURE__ */
|
|
4088
|
-
/* @__PURE__ */
|
|
4089
|
-
/* @__PURE__ */
|
|
4694
|
+
/* @__PURE__ */ React23.createElement("path", { d: "M10 18v-7" }),
|
|
4695
|
+
/* @__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" }),
|
|
4696
|
+
/* @__PURE__ */ React23.createElement("path", { d: "M14 18v-7" }),
|
|
4697
|
+
/* @__PURE__ */ React23.createElement("path", { d: "M18 18v-7" }),
|
|
4698
|
+
/* @__PURE__ */ React23.createElement("path", { d: "M3 22h18" }),
|
|
4699
|
+
/* @__PURE__ */ React23.createElement("path", { d: "M6 18v-7" })
|
|
4090
4700
|
);
|
|
4091
4701
|
}
|
|
4092
4702
|
function Building2Icon({ size = 14 }) {
|
|
4093
|
-
return /* @__PURE__ */
|
|
4703
|
+
return /* @__PURE__ */ React23.createElement(
|
|
4094
4704
|
"svg",
|
|
4095
4705
|
{
|
|
4096
4706
|
width: size,
|
|
@@ -4104,17 +4714,17 @@ function Building2Icon({ size = 14 }) {
|
|
|
4104
4714
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4105
4715
|
"aria-hidden": "true"
|
|
4106
4716
|
},
|
|
4107
|
-
/* @__PURE__ */
|
|
4108
|
-
/* @__PURE__ */
|
|
4109
|
-
/* @__PURE__ */
|
|
4110
|
-
/* @__PURE__ */
|
|
4111
|
-
/* @__PURE__ */
|
|
4112
|
-
/* @__PURE__ */
|
|
4113
|
-
/* @__PURE__ */
|
|
4717
|
+
/* @__PURE__ */ React23.createElement("path", { d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z" }),
|
|
4718
|
+
/* @__PURE__ */ React23.createElement("path", { d: "M6 12H4a2 2 0 0 0-2 2v8h4" }),
|
|
4719
|
+
/* @__PURE__ */ React23.createElement("path", { d: "M18 9h2a2 2 0 0 1 2 2v11h-4" }),
|
|
4720
|
+
/* @__PURE__ */ React23.createElement("path", { d: "M10 6h4" }),
|
|
4721
|
+
/* @__PURE__ */ React23.createElement("path", { d: "M10 10h4" }),
|
|
4722
|
+
/* @__PURE__ */ React23.createElement("path", { d: "M10 14h4" }),
|
|
4723
|
+
/* @__PURE__ */ React23.createElement("path", { d: "M10 18h4" })
|
|
4114
4724
|
);
|
|
4115
4725
|
}
|
|
4116
4726
|
function HomeIcon({ size = 14 }) {
|
|
4117
|
-
return /* @__PURE__ */
|
|
4727
|
+
return /* @__PURE__ */ React23.createElement(
|
|
4118
4728
|
"svg",
|
|
4119
4729
|
{
|
|
4120
4730
|
width: size,
|
|
@@ -4128,8 +4738,8 @@ function HomeIcon({ size = 14 }) {
|
|
|
4128
4738
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4129
4739
|
"aria-hidden": "true"
|
|
4130
4740
|
},
|
|
4131
|
-
/* @__PURE__ */
|
|
4132
|
-
/* @__PURE__ */
|
|
4741
|
+
/* @__PURE__ */ React23.createElement("path", { d: "m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" }),
|
|
4742
|
+
/* @__PURE__ */ React23.createElement("polyline", { points: "9 22 9 12 15 12 15 22" })
|
|
4133
4743
|
);
|
|
4134
4744
|
}
|
|
4135
4745
|
var TIER_INFO = {
|
|
@@ -4189,7 +4799,7 @@ function TopicTierBadge({
|
|
|
4189
4799
|
userSelect: "none"
|
|
4190
4800
|
};
|
|
4191
4801
|
};
|
|
4192
|
-
return /* @__PURE__ */
|
|
4802
|
+
return /* @__PURE__ */ React23.createElement(
|
|
4193
4803
|
"span",
|
|
4194
4804
|
{
|
|
4195
4805
|
className: "ev-topic-tier-badge",
|
|
@@ -4199,13 +4809,13 @@ function TopicTierBadge({
|
|
|
4199
4809
|
},
|
|
4200
4810
|
effectiveTiers.map((tier) => {
|
|
4201
4811
|
const { label, Icon } = TIER_INFO[tier];
|
|
4202
|
-
return /* @__PURE__ */
|
|
4812
|
+
return /* @__PURE__ */ React23.createElement("span", { key: tier, style: itemStyle(tier) }, /* @__PURE__ */ React23.createElement(Icon, { size: sizeStyle.iconSize }), !iconOnly && /* @__PURE__ */ React23.createElement("span", null, label));
|
|
4203
4813
|
})
|
|
4204
4814
|
);
|
|
4205
4815
|
}
|
|
4206
4816
|
|
|
4207
4817
|
// src/CompassCoverageCallout.jsx
|
|
4208
|
-
import
|
|
4818
|
+
import React24, { useState as useState12 } from "react";
|
|
4209
4819
|
var TIER_LABELS = {
|
|
4210
4820
|
federal: "federal",
|
|
4211
4821
|
state: "state",
|
|
@@ -4218,7 +4828,7 @@ function CompassCoverageCallout({
|
|
|
4218
4828
|
compassUrl,
|
|
4219
4829
|
onDismiss
|
|
4220
4830
|
}) {
|
|
4221
|
-
const [dismissed, setDismissed] =
|
|
4831
|
+
const [dismissed, setDismissed] = useState12(false);
|
|
4222
4832
|
if (dismissed) return null;
|
|
4223
4833
|
const tierLabel = TIER_LABELS[tier] || tier;
|
|
4224
4834
|
const tierStyle = tierColors[tier] || tierColors.federal;
|
|
@@ -4269,15 +4879,15 @@ function CompassCoverageCallout({
|
|
|
4269
4879
|
setDismissed(true);
|
|
4270
4880
|
if (onDismiss) onDismiss();
|
|
4271
4881
|
};
|
|
4272
|
-
return /* @__PURE__ */
|
|
4882
|
+
return /* @__PURE__ */ React24.createElement(
|
|
4273
4883
|
"div",
|
|
4274
4884
|
{
|
|
4275
4885
|
className: "ev-compass-coverage-callout",
|
|
4276
4886
|
role: "status",
|
|
4277
4887
|
style: containerStyle2
|
|
4278
4888
|
},
|
|
4279
|
-
/* @__PURE__ */
|
|
4280
|
-
onDismiss !== void 0 && /* @__PURE__ */
|
|
4889
|
+
/* @__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")),
|
|
4890
|
+
onDismiss !== void 0 && /* @__PURE__ */ React24.createElement(
|
|
4281
4891
|
"button",
|
|
4282
4892
|
{
|
|
4283
4893
|
onClick: handleDismiss,
|
|
@@ -4290,7 +4900,7 @@ function CompassCoverageCallout({
|
|
|
4290
4900
|
}
|
|
4291
4901
|
|
|
4292
4902
|
// src/ExpandCompassNudge.jsx
|
|
4293
|
-
import
|
|
4903
|
+
import React25 from "react";
|
|
4294
4904
|
function ExpandCompassNudge({
|
|
4295
4905
|
politicianName,
|
|
4296
4906
|
missingCount,
|
|
@@ -4337,7 +4947,7 @@ function ExpandCompassNudge({
|
|
|
4337
4947
|
};
|
|
4338
4948
|
const topicsLabel = missingCount === 1 ? "topic" : "topics";
|
|
4339
4949
|
const speakerName = politicianName || "This politician";
|
|
4340
|
-
return /* @__PURE__ */
|
|
4950
|
+
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"));
|
|
4341
4951
|
}
|
|
4342
4952
|
|
|
4343
4953
|
// src/computeTierCoverage.js
|
|
@@ -4358,14 +4968,14 @@ function computeTierCoverage(topics) {
|
|
|
4358
4968
|
}
|
|
4359
4969
|
|
|
4360
4970
|
// src/StanceAccordion.jsx
|
|
4361
|
-
import
|
|
4971
|
+
import React27, { useState as useState13, useRef as useRef3, useCallback, useEffect as useEffect7 } from "react";
|
|
4362
4972
|
|
|
4363
4973
|
// src/Favicon.jsx
|
|
4364
|
-
import
|
|
4974
|
+
import React26 from "react";
|
|
4365
4975
|
function Favicon({ url, size = 16 }) {
|
|
4366
4976
|
try {
|
|
4367
4977
|
const domain = new URL(url).hostname;
|
|
4368
|
-
return /* @__PURE__ */
|
|
4978
|
+
return /* @__PURE__ */ React26.createElement(
|
|
4369
4979
|
"img",
|
|
4370
4980
|
{
|
|
4371
4981
|
src: `https://www.google.com/s2/favicons?sz=${size}&domain=${domain}`,
|
|
@@ -4376,7 +4986,7 @@ function Favicon({ url, size = 16 }) {
|
|
|
4376
4986
|
}
|
|
4377
4987
|
);
|
|
4378
4988
|
} catch {
|
|
4379
|
-
return /* @__PURE__ */
|
|
4989
|
+
return /* @__PURE__ */ React26.createElement(
|
|
4380
4990
|
"svg",
|
|
4381
4991
|
{
|
|
4382
4992
|
width: size,
|
|
@@ -4387,8 +4997,8 @@ function Favicon({ url, size = 16 }) {
|
|
|
4387
4997
|
strokeWidth: "1.5",
|
|
4388
4998
|
style: { verticalAlign: "middle", flexShrink: 0 }
|
|
4389
4999
|
},
|
|
4390
|
-
/* @__PURE__ */
|
|
4391
|
-
/* @__PURE__ */
|
|
5000
|
+
/* @__PURE__ */ React26.createElement("circle", { cx: "12", cy: "12", r: "10" }),
|
|
5001
|
+
/* @__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" })
|
|
4392
5002
|
);
|
|
4393
5003
|
}
|
|
4394
5004
|
}
|
|
@@ -4419,9 +5029,9 @@ function StanceAccordion({
|
|
|
4419
5029
|
apiUrl = "https://api.empowered.vote"
|
|
4420
5030
|
}) {
|
|
4421
5031
|
var _a;
|
|
4422
|
-
const [expandedTopicId, setExpandedTopicId] =
|
|
4423
|
-
const [loadingId, setLoadingId] =
|
|
4424
|
-
const [showAll, setShowAll] =
|
|
5032
|
+
const [expandedTopicId, setExpandedTopicId] = useState13(null);
|
|
5033
|
+
const [loadingId, setLoadingId] = useState13(null);
|
|
5034
|
+
const [showAll, setShowAll] = useState13(false);
|
|
4425
5035
|
const contextCache = useRef3(/* @__PURE__ */ new Map());
|
|
4426
5036
|
const quotesCache = useRef3(null);
|
|
4427
5037
|
const polAnswerMap = {};
|
|
@@ -4499,7 +5109,7 @@ function StanceAccordion({
|
|
|
4499
5109
|
},
|
|
4500
5110
|
[expandedTopicId, politicianId, apiUrl]
|
|
4501
5111
|
);
|
|
4502
|
-
|
|
5112
|
+
useEffect7(() => {
|
|
4503
5113
|
if (initialExpandedTopicId && topics && topics.length > 0) {
|
|
4504
5114
|
handleToggle(String(initialExpandedTopicId));
|
|
4505
5115
|
}
|
|
@@ -4515,13 +5125,13 @@ function StanceAccordion({
|
|
|
4515
5125
|
visibleTopics = [pinned, ...baseTopics.filter((t) => String(t.id) !== String(initialExpandedTopicId))];
|
|
4516
5126
|
}
|
|
4517
5127
|
}
|
|
4518
|
-
return /* @__PURE__ */
|
|
5128
|
+
return /* @__PURE__ */ React27.createElement(
|
|
4519
5129
|
"div",
|
|
4520
5130
|
{
|
|
4521
5131
|
className: "flex flex-col",
|
|
4522
5132
|
style: { fontFamily: "'Manrope', sans-serif" }
|
|
4523
5133
|
},
|
|
4524
|
-
/* @__PURE__ */
|
|
5134
|
+
/* @__PURE__ */ React27.createElement(
|
|
4525
5135
|
"h3",
|
|
4526
5136
|
{
|
|
4527
5137
|
className: "text-sm font-semibold text-neutral-400 uppercase tracking-wider mb-2",
|
|
@@ -4543,15 +5153,15 @@ function StanceAccordion({
|
|
|
4543
5153
|
if (topic.topic_key) return q.issue === topic.topic_key;
|
|
4544
5154
|
return topic.short_title && q.issue.toLowerCase() === topic.short_title.toLowerCase();
|
|
4545
5155
|
}) : [];
|
|
4546
|
-
return /* @__PURE__ */
|
|
5156
|
+
return /* @__PURE__ */ React27.createElement("div", { key: topicId, className: "border-b border-neutral-100" }, /* @__PURE__ */ React27.createElement(
|
|
4547
5157
|
"button",
|
|
4548
5158
|
{
|
|
4549
5159
|
type: "button",
|
|
4550
5160
|
onClick: () => handleToggle(topicId),
|
|
4551
5161
|
className: "w-full flex items-center justify-between py-3 px-2 text-left cursor-pointer hover:bg-neutral-50 transition-colors"
|
|
4552
5162
|
},
|
|
4553
|
-
/* @__PURE__ */
|
|
4554
|
-
/* @__PURE__ */
|
|
5163
|
+
/* @__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)),
|
|
5164
|
+
/* @__PURE__ */ React27.createElement(
|
|
4555
5165
|
"svg",
|
|
4556
5166
|
{
|
|
4557
5167
|
width: "16",
|
|
@@ -4568,9 +5178,9 @@ function StanceAccordion({
|
|
|
4568
5178
|
transition: "transform 0.2s ease"
|
|
4569
5179
|
}
|
|
4570
5180
|
},
|
|
4571
|
-
/* @__PURE__ */
|
|
5181
|
+
/* @__PURE__ */ React27.createElement("polyline", { points: "9 18 15 12 9 6" })
|
|
4572
5182
|
)
|
|
4573
|
-
), /* @__PURE__ */
|
|
5183
|
+
), /* @__PURE__ */ React27.createElement(
|
|
4574
5184
|
"div",
|
|
4575
5185
|
{
|
|
4576
5186
|
style: {
|
|
@@ -4579,7 +5189,7 @@ function StanceAccordion({
|
|
|
4579
5189
|
transition: "grid-template-rows 0.25s ease"
|
|
4580
5190
|
}
|
|
4581
5191
|
},
|
|
4582
|
-
/* @__PURE__ */
|
|
5192
|
+
/* @__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(
|
|
4583
5193
|
"div",
|
|
4584
5194
|
{
|
|
4585
5195
|
style: {
|
|
@@ -4591,14 +5201,14 @@ function StanceAccordion({
|
|
|
4591
5201
|
animation: "ev-spin 0.8s linear infinite"
|
|
4592
5202
|
}
|
|
4593
5203
|
}
|
|
4594
|
-
)), !isLoading && cached && /* @__PURE__ */
|
|
5204
|
+
)), !isLoading && cached && /* @__PURE__ */ React27.createElement(React27.Fragment, null, cached.reasoning ? /* @__PURE__ */ React27.createElement(
|
|
4595
5205
|
"p",
|
|
4596
5206
|
{
|
|
4597
5207
|
className: "text-sm text-neutral-700 mb-3",
|
|
4598
5208
|
style: { whiteSpace: "pre-wrap", lineHeight: 1.6 }
|
|
4599
5209
|
},
|
|
4600
5210
|
cached.reasoning
|
|
4601
|
-
) : null, cached.sources && cached.sources.length > 0 && /* @__PURE__ */
|
|
5211
|
+
) : 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(
|
|
4602
5212
|
"a",
|
|
4603
5213
|
{
|
|
4604
5214
|
href: src,
|
|
@@ -4606,9 +5216,9 @@ function StanceAccordion({
|
|
|
4606
5216
|
rel: "noreferrer",
|
|
4607
5217
|
className: "inline-flex items-center gap-1.5 hover:text-[#00657c] transition-colors"
|
|
4608
5218
|
},
|
|
4609
|
-
/* @__PURE__ */
|
|
4610
|
-
/* @__PURE__ */
|
|
4611
|
-
))))), topicQuotes.length > 0 && /* @__PURE__ */
|
|
5219
|
+
/* @__PURE__ */ React27.createElement(Favicon, { url: src }),
|
|
5220
|
+
/* @__PURE__ */ React27.createElement("span", { className: "underline underline-offset-2" }, getDisplayUrl(src))
|
|
5221
|
+
))))), topicQuotes.length > 0 && /* @__PURE__ */ React27.createElement("div", { style: { marginTop: "12px" } }, /* @__PURE__ */ React27.createElement(
|
|
4612
5222
|
"p",
|
|
4613
5223
|
{
|
|
4614
5224
|
style: {
|
|
@@ -4625,7 +5235,7 @@ function StanceAccordion({
|
|
|
4625
5235
|
const verdict = verdictsByQuote ? verdictsByQuote[quote.id] : void 0;
|
|
4626
5236
|
const borderColor = verdict === "agreed" ? "#0e7490" : verdict === "disagreed" ? "#b45309" : "#e2e8f0";
|
|
4627
5237
|
const sourceName = quote.source_name || quote.sourceName;
|
|
4628
|
-
return /* @__PURE__ */
|
|
5238
|
+
return /* @__PURE__ */ React27.createElement(
|
|
4629
5239
|
"div",
|
|
4630
5240
|
{
|
|
4631
5241
|
key: quote.id,
|
|
@@ -4637,7 +5247,7 @@ function StanceAccordion({
|
|
|
4637
5247
|
marginBottom: "8px"
|
|
4638
5248
|
}
|
|
4639
5249
|
},
|
|
4640
|
-
/* @__PURE__ */
|
|
5250
|
+
/* @__PURE__ */ React27.createElement(
|
|
4641
5251
|
"p",
|
|
4642
5252
|
{
|
|
4643
5253
|
style: {
|
|
@@ -4650,7 +5260,7 @@ function StanceAccordion({
|
|
|
4650
5260
|
},
|
|
4651
5261
|
quote.text
|
|
4652
5262
|
),
|
|
4653
|
-
verdict === "agreed" && /* @__PURE__ */
|
|
5263
|
+
verdict === "agreed" && /* @__PURE__ */ React27.createElement(
|
|
4654
5264
|
"span",
|
|
4655
5265
|
{
|
|
4656
5266
|
style: {
|
|
@@ -4667,10 +5277,10 @@ function StanceAccordion({
|
|
|
4667
5277
|
flexShrink: 0
|
|
4668
5278
|
}
|
|
4669
5279
|
},
|
|
4670
|
-
/* @__PURE__ */
|
|
5280
|
+
/* @__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" })),
|
|
4671
5281
|
"Agreed"
|
|
4672
5282
|
),
|
|
4673
|
-
verdict === "disagreed" && /* @__PURE__ */
|
|
5283
|
+
verdict === "disagreed" && /* @__PURE__ */ React27.createElement(
|
|
4674
5284
|
"span",
|
|
4675
5285
|
{
|
|
4676
5286
|
style: {
|
|
@@ -4687,10 +5297,10 @@ function StanceAccordion({
|
|
|
4687
5297
|
flexShrink: 0
|
|
4688
5298
|
}
|
|
4689
5299
|
},
|
|
4690
|
-
/* @__PURE__ */
|
|
5300
|
+
/* @__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" })),
|
|
4691
5301
|
"Disagreed"
|
|
4692
5302
|
),
|
|
4693
|
-
sourceName && /* @__PURE__ */
|
|
5303
|
+
sourceName && /* @__PURE__ */ React27.createElement(
|
|
4694
5304
|
"a",
|
|
4695
5305
|
{
|
|
4696
5306
|
href: quote.source_url || quote.sourceUrl,
|
|
@@ -4707,10 +5317,10 @@ function StanceAccordion({
|
|
|
4707
5317
|
sourceName
|
|
4708
5318
|
)
|
|
4709
5319
|
);
|
|
4710
|
-
})), !cached.reasoning && (!cached.sources || cached.sources.length === 0) && topicQuotes.length === 0 && /* @__PURE__ */
|
|
5320
|
+
})), !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."))))
|
|
4711
5321
|
));
|
|
4712
5322
|
}),
|
|
4713
|
-
hasToggle && /* @__PURE__ */
|
|
5323
|
+
hasToggle && /* @__PURE__ */ React27.createElement(
|
|
4714
5324
|
"button",
|
|
4715
5325
|
{
|
|
4716
5326
|
type: "button",
|
|
@@ -4722,90 +5332,20 @@ function StanceAccordion({
|
|
|
4722
5332
|
)
|
|
4723
5333
|
);
|
|
4724
5334
|
}
|
|
4725
|
-
|
|
4726
|
-
// src/icons.js
|
|
4727
|
-
import React23 from "react";
|
|
4728
|
-
function BallotIcon({ size = 16, color = "currentColor" }) {
|
|
4729
|
-
return /* @__PURE__ */ React23.createElement(
|
|
4730
|
-
"svg",
|
|
4731
|
-
{
|
|
4732
|
-
width: size,
|
|
4733
|
-
height: size,
|
|
4734
|
-
viewBox: "0 0 24 24",
|
|
4735
|
-
fill: "none",
|
|
4736
|
-
stroke: color,
|
|
4737
|
-
strokeWidth: "2",
|
|
4738
|
-
strokeLinecap: "round",
|
|
4739
|
-
strokeLinejoin: "round",
|
|
4740
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
4741
|
-
},
|
|
4742
|
-
/* @__PURE__ */ React23.createElement("path", { d: "m9 12 2 2 4-4" }),
|
|
4743
|
-
/* @__PURE__ */ React23.createElement("path", { d: "M5 7c0-1.1.9-2 2-2h10a2 2 0 0 1 2 2v12H5V7Z" }),
|
|
4744
|
-
/* @__PURE__ */ React23.createElement("path", { d: "M22 19H2" })
|
|
4745
|
-
);
|
|
4746
|
-
}
|
|
4747
|
-
function CompassIcon({ size = 16, color = "currentColor" }) {
|
|
4748
|
-
return /* @__PURE__ */ React23.createElement(
|
|
4749
|
-
"svg",
|
|
4750
|
-
{
|
|
4751
|
-
width: size,
|
|
4752
|
-
height: size,
|
|
4753
|
-
viewBox: "0 0 24 24",
|
|
4754
|
-
fill: "none",
|
|
4755
|
-
stroke: color,
|
|
4756
|
-
strokeWidth: "2",
|
|
4757
|
-
strokeLinecap: "round",
|
|
4758
|
-
strokeLinejoin: "round",
|
|
4759
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
4760
|
-
},
|
|
4761
|
-
/* @__PURE__ */ React23.createElement("circle", { cx: "12", cy: "12", r: "10" }),
|
|
4762
|
-
/* @__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" })
|
|
4763
|
-
);
|
|
4764
|
-
}
|
|
4765
|
-
function BranchIcon({ size = 16, color = "currentColor", branch }) {
|
|
4766
|
-
let paths;
|
|
4767
|
-
switch (branch) {
|
|
4768
|
-
case "executive":
|
|
4769
|
-
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" }));
|
|
4770
|
-
break;
|
|
4771
|
-
case "legislative":
|
|
4772
|
-
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" }));
|
|
4773
|
-
break;
|
|
4774
|
-
case "judicial":
|
|
4775
|
-
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" }));
|
|
4776
|
-
break;
|
|
4777
|
-
default:
|
|
4778
|
-
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" }));
|
|
4779
|
-
break;
|
|
4780
|
-
}
|
|
4781
|
-
return /* @__PURE__ */ React23.createElement(
|
|
4782
|
-
"svg",
|
|
4783
|
-
{
|
|
4784
|
-
width: size,
|
|
4785
|
-
height: size,
|
|
4786
|
-
viewBox: "0 0 24 24",
|
|
4787
|
-
fill: "none",
|
|
4788
|
-
stroke: color,
|
|
4789
|
-
strokeWidth: "2",
|
|
4790
|
-
strokeLinecap: "round",
|
|
4791
|
-
strokeLinejoin: "round",
|
|
4792
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
4793
|
-
},
|
|
4794
|
-
paths
|
|
4795
|
-
);
|
|
4796
|
-
}
|
|
4797
5335
|
export {
|
|
4798
5336
|
AuthForm,
|
|
4799
5337
|
BallotIcon,
|
|
4800
5338
|
BranchIcon,
|
|
4801
5339
|
CategorySection,
|
|
4802
5340
|
CommitteeTable,
|
|
5341
|
+
CompassCardHorizontal,
|
|
4803
5342
|
CompassCoverageCallout,
|
|
4804
5343
|
CompassIcon,
|
|
4805
5344
|
ExpandCompassNudge,
|
|
4806
5345
|
FilterSidebar,
|
|
4807
5346
|
GovernmentBodySection,
|
|
4808
5347
|
Header,
|
|
5348
|
+
IconOverlay,
|
|
4809
5349
|
IssueTags,
|
|
4810
5350
|
JudicialRecordDetail,
|
|
4811
5351
|
JudicialScorecard,
|