@empoweredvote/ev-ui 0.9.9 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +673 -351
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +651 -330
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -54,6 +54,7 @@ __export(index_exports, {
|
|
|
54
54
|
PoliticianCard: () => PoliticianCard,
|
|
55
55
|
PoliticianProfile: () => PoliticianProfile,
|
|
56
56
|
RadarChartCore: () => RadarChartCore,
|
|
57
|
+
SiteFooter: () => SiteFooter,
|
|
57
58
|
SiteHeader: () => SiteHeader,
|
|
58
59
|
SocialLinks: () => SocialLinks,
|
|
59
60
|
StanceAccordion: () => StanceAccordion,
|
|
@@ -160,7 +161,7 @@ function RadarChartCore({
|
|
|
160
161
|
const max = ((_a = topic == null ? void 0 : topic.stances) == null ? void 0 : _a.length) || 10;
|
|
161
162
|
const pct = Math.min(value / max * 10, 10);
|
|
162
163
|
const angle = 2 * Math.PI * index / numSpokes;
|
|
163
|
-
const adjusted = value === 0 ? 0 : invertedSpokes[shortTitle] ?
|
|
164
|
+
const adjusted = value === 0 ? 0 : invertedSpokes[shortTitle] ? (max + 1) * 10 / max - pct : pct;
|
|
164
165
|
const r = adjusted / 10 * radius;
|
|
165
166
|
const x = centerX + r * Math.sin(angle);
|
|
166
167
|
const y = centerY - r * Math.cos(angle);
|
|
@@ -185,7 +186,7 @@ function RadarChartCore({
|
|
|
185
186
|
const max = ((_b = topic == null ? void 0 : topic.stances) == null ? void 0 : _b.length) || 10;
|
|
186
187
|
const pct = Math.min(value / max * 10, 10);
|
|
187
188
|
const angle = 2 * Math.PI * index / numSpokes;
|
|
188
|
-
const adjusted = value === 0 ? 0 : invertedSpokes[shortTitle] ?
|
|
189
|
+
const adjusted = value === 0 ? 0 : invertedSpokes[shortTitle] ? (max + 1) * 10 / max - pct : pct;
|
|
189
190
|
const r = adjusted / 10 * radius;
|
|
190
191
|
const x = centerX + r * Math.sin(angle);
|
|
191
192
|
const y = centerY - r * Math.cos(angle);
|
|
@@ -1785,8 +1786,328 @@ function SiteHeader({
|
|
|
1785
1786
|
);
|
|
1786
1787
|
}
|
|
1787
1788
|
|
|
1788
|
-
// src/
|
|
1789
|
+
// src/SiteFooter.jsx
|
|
1789
1790
|
var import_react9 = __toESM(require("react"));
|
|
1791
|
+
var SIGNUP_ENDPOINT_DEFAULT = "https://gq2nohazl3447rhtau34o6yqs40vpude.lambda-url.us-east-1.on.aws/";
|
|
1792
|
+
var DEFAULT_LINKS = [
|
|
1793
|
+
{ label: "Mind Map", href: "https://empowered.vote/maps/purpose-map.html" },
|
|
1794
|
+
{ label: "Briefing", href: "https://empowered.vote/briefing" },
|
|
1795
|
+
{ label: "Financials", href: "https://financials.empowered.vote", external: true }
|
|
1796
|
+
];
|
|
1797
|
+
function SiteFooter({
|
|
1798
|
+
darkMode = false,
|
|
1799
|
+
brandLabel = "Empowered Vote \xB7 Alpha",
|
|
1800
|
+
year,
|
|
1801
|
+
links = DEFAULT_LINKS,
|
|
1802
|
+
newsletter = true,
|
|
1803
|
+
endpoint = SIGNUP_ENDPOINT_DEFAULT,
|
|
1804
|
+
className = "",
|
|
1805
|
+
style = {}
|
|
1806
|
+
}) {
|
|
1807
|
+
const [open, setOpen] = (0, import_react9.useState)(false);
|
|
1808
|
+
const [submitting, setSubmitting] = (0, import_react9.useState)(false);
|
|
1809
|
+
const [note, setNote] = (0, import_react9.useState)(null);
|
|
1810
|
+
const formRef = (0, import_react9.useRef)(null);
|
|
1811
|
+
const emailRef = (0, import_react9.useRef)(null);
|
|
1812
|
+
const uid = (0, import_react9.useId)().replace(/:/g, "");
|
|
1813
|
+
const formId = `ev-sf-form-${uid}`;
|
|
1814
|
+
const emailId = `ev-sf-email-${uid}`;
|
|
1815
|
+
const noteId = `ev-sf-note-${uid}`;
|
|
1816
|
+
const resolvedYear = year != null ? year : (/* @__PURE__ */ new Date()).getFullYear();
|
|
1817
|
+
const t = darkMode ? {
|
|
1818
|
+
bg: "#131416",
|
|
1819
|
+
borderTop: "#2D2D32",
|
|
1820
|
+
brand: "#F2F2F2",
|
|
1821
|
+
muted: "#8B949E",
|
|
1822
|
+
link: "#8B949E",
|
|
1823
|
+
linkHover: "#F2F2F2",
|
|
1824
|
+
dot: "#FFD740",
|
|
1825
|
+
inputBg: "#1C1C1F",
|
|
1826
|
+
inputBorder: "#41454E",
|
|
1827
|
+
inputText: "#F2F2F2",
|
|
1828
|
+
placeholder: "#8B949E",
|
|
1829
|
+
btnBg: "#F2F2F2",
|
|
1830
|
+
btnText: "#111113",
|
|
1831
|
+
btnHover: "#FFFFFF",
|
|
1832
|
+
teal: "#1DA8C6",
|
|
1833
|
+
coral: "#FF6B52",
|
|
1834
|
+
noteText: "#F2F2F2",
|
|
1835
|
+
noteBg: "rgba(29, 168, 198, 0.15)",
|
|
1836
|
+
errorBg: "rgba(255, 107, 82, 0.18)"
|
|
1837
|
+
} : {
|
|
1838
|
+
bg: "#F7F7F8",
|
|
1839
|
+
borderTop: "#E5E7EB",
|
|
1840
|
+
brand: "#1C1C1C",
|
|
1841
|
+
muted: "#6B7280",
|
|
1842
|
+
link: "#6B7280",
|
|
1843
|
+
linkHover: "#1C1C1C",
|
|
1844
|
+
dot: "#FED12E",
|
|
1845
|
+
inputBg: "#FFFFFF",
|
|
1846
|
+
inputBorder: "#D3D7DE",
|
|
1847
|
+
inputText: "#1C1C1C",
|
|
1848
|
+
placeholder: "#6B7280",
|
|
1849
|
+
btnBg: "#1C1C1C",
|
|
1850
|
+
btnText: "#FFFFFF",
|
|
1851
|
+
btnHover: "#000000",
|
|
1852
|
+
teal: "#00657C",
|
|
1853
|
+
coral: "#FF5740",
|
|
1854
|
+
noteText: "#1C1C1C",
|
|
1855
|
+
noteBg: "rgba(0, 101, 124, 0.10)",
|
|
1856
|
+
errorBg: "rgba(255, 87, 64, 0.12)"
|
|
1857
|
+
};
|
|
1858
|
+
function toggle() {
|
|
1859
|
+
setOpen((prev) => {
|
|
1860
|
+
const next = !prev;
|
|
1861
|
+
if (next) {
|
|
1862
|
+
setTimeout(() => emailRef.current && emailRef.current.focus(), 260);
|
|
1863
|
+
}
|
|
1864
|
+
return next;
|
|
1865
|
+
});
|
|
1866
|
+
}
|
|
1867
|
+
function handleSubmit(e) {
|
|
1868
|
+
e.preventDefault();
|
|
1869
|
+
const form = formRef.current;
|
|
1870
|
+
if (!form) return;
|
|
1871
|
+
const emailInput = form.elements.email;
|
|
1872
|
+
if (emailInput && !emailInput.checkValidity()) {
|
|
1873
|
+
emailInput.reportValidity();
|
|
1874
|
+
return;
|
|
1875
|
+
}
|
|
1876
|
+
const payload = {
|
|
1877
|
+
email: emailInput ? emailInput.value.trim() : "",
|
|
1878
|
+
company: form.elements.company && form.elements.company.value || ""
|
|
1879
|
+
// honeypot
|
|
1880
|
+
};
|
|
1881
|
+
setSubmitting(true);
|
|
1882
|
+
setNote({ msg: "Adding you\u2026", kind: null });
|
|
1883
|
+
fetch(endpoint, {
|
|
1884
|
+
method: "POST",
|
|
1885
|
+
headers: { "Content-Type": "application/json" },
|
|
1886
|
+
body: JSON.stringify(payload)
|
|
1887
|
+
}).then((r) => r.json().catch(() => ({ ok: r.ok }))).then((data) => {
|
|
1888
|
+
if (data && data.ok) {
|
|
1889
|
+
form.reset();
|
|
1890
|
+
setNote({ msg: "You\u2019re on the list \u2014 thanks for following the build. \u{1F389}", kind: "ok" });
|
|
1891
|
+
} else {
|
|
1892
|
+
setNote({ msg: data && data.error || "Something went wrong. Please try again.", kind: "error" });
|
|
1893
|
+
}
|
|
1894
|
+
}).catch(() => {
|
|
1895
|
+
setNote({ msg: "Couldn\u2019t reach us just now. Please try again in a moment.", kind: "error" });
|
|
1896
|
+
}).then(() => setSubmitting(false));
|
|
1897
|
+
}
|
|
1898
|
+
const rootStyle = {
|
|
1899
|
+
borderTop: `1px solid ${t.borderTop}`,
|
|
1900
|
+
padding: "32px 0 40px",
|
|
1901
|
+
background: t.bg,
|
|
1902
|
+
color: t.muted,
|
|
1903
|
+
fontFamily: fonts.primary,
|
|
1904
|
+
fontSize: "0.88rem",
|
|
1905
|
+
// CSS custom props consumed by the scoped <style> for pseudo-selectors.
|
|
1906
|
+
"--ev-sf-placeholder": t.placeholder,
|
|
1907
|
+
"--ev-sf-focus": t.teal,
|
|
1908
|
+
"--ev-sf-input-bg": t.inputBg,
|
|
1909
|
+
"--ev-sf-input-border": t.inputBorder,
|
|
1910
|
+
"--ev-sf-input-text": t.inputText,
|
|
1911
|
+
...style
|
|
1912
|
+
};
|
|
1913
|
+
const linkBase = { color: t.link, textDecoration: "none", transition: "color 0.15s ease" };
|
|
1914
|
+
const onLinkEnter = (e) => {
|
|
1915
|
+
e.currentTarget.style.color = t.linkHover;
|
|
1916
|
+
};
|
|
1917
|
+
const onLinkLeave = (e) => {
|
|
1918
|
+
e.currentTarget.style.color = t.link;
|
|
1919
|
+
};
|
|
1920
|
+
return /* @__PURE__ */ import_react9.default.createElement("footer", { className: `ev-site-footer ${className}`.trim(), style: rootStyle }, /* @__PURE__ */ import_react9.default.createElement("style", null, CSS), /* @__PURE__ */ import_react9.default.createElement("div", { className: "ev-sf-wrap" }, /* @__PURE__ */ import_react9.default.createElement("span", { className: "ev-sf-brand", style: { color: t.brand, fontWeight: fontWeights.bold } }, /* @__PURE__ */ import_react9.default.createElement("span", { className: "ev-sf-dot", style: { background: t.dot } }), brandLabel), /* @__PURE__ */ import_react9.default.createElement("span", { className: "ev-sf-links" }, /* @__PURE__ */ import_react9.default.createElement("span", { style: { color: t.muted } }, "\xA9 ", resolvedYear), links.map((link) => /* @__PURE__ */ import_react9.default.createElement(
|
|
1921
|
+
"a",
|
|
1922
|
+
{
|
|
1923
|
+
key: link.href,
|
|
1924
|
+
href: link.href,
|
|
1925
|
+
style: linkBase,
|
|
1926
|
+
onMouseEnter: onLinkEnter,
|
|
1927
|
+
onMouseLeave: onLinkLeave,
|
|
1928
|
+
...link.external ? { target: "_blank", rel: "noopener noreferrer" } : {}
|
|
1929
|
+
},
|
|
1930
|
+
link.label
|
|
1931
|
+
)), newsletter && /* @__PURE__ */ import_react9.default.createElement(import_react9.default.Fragment, null, /* @__PURE__ */ import_react9.default.createElement(
|
|
1932
|
+
"button",
|
|
1933
|
+
{
|
|
1934
|
+
type: "button",
|
|
1935
|
+
className: "ev-sf-toggle",
|
|
1936
|
+
"aria-expanded": open,
|
|
1937
|
+
"aria-controls": formId,
|
|
1938
|
+
onClick: toggle,
|
|
1939
|
+
style: { color: open ? t.linkHover : t.link },
|
|
1940
|
+
onMouseEnter: (e) => {
|
|
1941
|
+
e.currentTarget.style.color = t.linkHover;
|
|
1942
|
+
},
|
|
1943
|
+
onMouseLeave: (e) => {
|
|
1944
|
+
e.currentTarget.style.color = open ? t.linkHover : t.link;
|
|
1945
|
+
}
|
|
1946
|
+
},
|
|
1947
|
+
"Newsletter ",
|
|
1948
|
+
/* @__PURE__ */ import_react9.default.createElement("span", { className: "ev-sf-caret", "aria-hidden": "true" }, "\u25B8")
|
|
1949
|
+
), /* @__PURE__ */ import_react9.default.createElement(
|
|
1950
|
+
"form",
|
|
1951
|
+
{
|
|
1952
|
+
ref: formRef,
|
|
1953
|
+
className: `ev-sf-form${open ? " open" : ""}`,
|
|
1954
|
+
id: formId,
|
|
1955
|
+
method: "post",
|
|
1956
|
+
noValidate: true,
|
|
1957
|
+
"aria-hidden": !open,
|
|
1958
|
+
onSubmit: handleSubmit
|
|
1959
|
+
},
|
|
1960
|
+
/* @__PURE__ */ import_react9.default.createElement("label", { className: "ev-sf-sr-only", htmlFor: emailId }, "Email address"),
|
|
1961
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
1962
|
+
"input",
|
|
1963
|
+
{
|
|
1964
|
+
ref: emailRef,
|
|
1965
|
+
id: emailId,
|
|
1966
|
+
name: "email",
|
|
1967
|
+
type: "email",
|
|
1968
|
+
required: true,
|
|
1969
|
+
autoComplete: "email",
|
|
1970
|
+
placeholder: "you@example.com",
|
|
1971
|
+
tabIndex: open ? 0 : -1,
|
|
1972
|
+
style: {
|
|
1973
|
+
background: t.inputBg,
|
|
1974
|
+
borderColor: t.inputBorder,
|
|
1975
|
+
color: t.inputText
|
|
1976
|
+
}
|
|
1977
|
+
}
|
|
1978
|
+
),
|
|
1979
|
+
/* @__PURE__ */ import_react9.default.createElement("div", { className: "ev-sf-hp", "aria-hidden": "true" }, /* @__PURE__ */ import_react9.default.createElement("label", null, "Company", /* @__PURE__ */ import_react9.default.createElement("input", { type: "text", name: "company", tabIndex: -1, autoComplete: "off" }))),
|
|
1980
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
1981
|
+
"button",
|
|
1982
|
+
{
|
|
1983
|
+
type: "submit",
|
|
1984
|
+
className: "ev-sf-btn",
|
|
1985
|
+
tabIndex: open ? 0 : -1,
|
|
1986
|
+
disabled: submitting,
|
|
1987
|
+
style: { background: t.btnBg, color: t.btnText },
|
|
1988
|
+
onMouseEnter: (e) => {
|
|
1989
|
+
if (!submitting) e.currentTarget.style.background = t.btnHover;
|
|
1990
|
+
},
|
|
1991
|
+
onMouseLeave: (e) => {
|
|
1992
|
+
e.currentTarget.style.background = t.btnBg;
|
|
1993
|
+
}
|
|
1994
|
+
},
|
|
1995
|
+
"Subscribe"
|
|
1996
|
+
)
|
|
1997
|
+
), /* @__PURE__ */ import_react9.default.createElement(
|
|
1998
|
+
"p",
|
|
1999
|
+
{
|
|
2000
|
+
className: "ev-sf-note",
|
|
2001
|
+
id: noteId,
|
|
2002
|
+
role: "status",
|
|
2003
|
+
"aria-live": "polite",
|
|
2004
|
+
hidden: !note,
|
|
2005
|
+
style: note ? {
|
|
2006
|
+
color: t.noteText,
|
|
2007
|
+
background: note.kind === "error" ? t.errorBg : t.noteBg,
|
|
2008
|
+
borderColor: note.kind === "error" ? t.coral : t.teal
|
|
2009
|
+
} : void 0
|
|
2010
|
+
},
|
|
2011
|
+
note ? note.msg : ""
|
|
2012
|
+
)))));
|
|
2013
|
+
}
|
|
2014
|
+
var CSS = `
|
|
2015
|
+
.ev-site-footer .ev-sf-wrap {
|
|
2016
|
+
max-width: 1280px; margin: 0 auto; padding: 0 24px;
|
|
2017
|
+
display: flex; justify-content: space-between; align-items: center;
|
|
2018
|
+
flex-wrap: wrap; gap: 12px;
|
|
2019
|
+
}
|
|
2020
|
+
.ev-site-footer .ev-sf-brand {
|
|
2021
|
+
display: inline-flex; align-items: center; gap: 10px;
|
|
2022
|
+
}
|
|
2023
|
+
.ev-site-footer .ev-sf-dot {
|
|
2024
|
+
width: 10px; height: 10px; border-radius: 2px; flex: 0 0 auto;
|
|
2025
|
+
}
|
|
2026
|
+
.ev-site-footer .ev-sf-links {
|
|
2027
|
+
display: inline-flex; align-items: center; gap: 18px; flex-wrap: wrap;
|
|
2028
|
+
}
|
|
2029
|
+
.ev-site-footer .ev-sf-sr-only {
|
|
2030
|
+
position: absolute; width: 1px; height: 1px;
|
|
2031
|
+
padding: 0; margin: -1px; overflow: hidden;
|
|
2032
|
+
clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
|
|
2033
|
+
}
|
|
2034
|
+
.ev-site-footer .ev-sf-hp {
|
|
2035
|
+
position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden;
|
|
2036
|
+
}
|
|
2037
|
+
.ev-site-footer .ev-sf-toggle {
|
|
2038
|
+
font: inherit; background: none; border: none; padding: 0; cursor: pointer;
|
|
2039
|
+
display: inline-flex; align-items: center; gap: 5px;
|
|
2040
|
+
transition: color 0.15s ease;
|
|
2041
|
+
}
|
|
2042
|
+
.ev-site-footer .ev-sf-toggle:focus-visible {
|
|
2043
|
+
outline: 2px solid var(--ev-sf-focus); outline-offset: 3px; border-radius: 4px;
|
|
2044
|
+
}
|
|
2045
|
+
.ev-site-footer .ev-sf-caret {
|
|
2046
|
+
font-size: 0.7em; display: inline-block; transition: transform 0.25s ease;
|
|
2047
|
+
}
|
|
2048
|
+
.ev-site-footer .ev-sf-toggle[aria-expanded="true"] .ev-sf-caret {
|
|
2049
|
+
transform: rotate(90deg);
|
|
2050
|
+
}
|
|
2051
|
+
/* Collapsed by default; slides open to the right, pushing the links left.
|
|
2052
|
+
margin-left cancels the parent flex gap so there is no phantom slot when closed. */
|
|
2053
|
+
.ev-site-footer .ev-sf-form {
|
|
2054
|
+
display: flex; align-items: center; gap: 8px;
|
|
2055
|
+
max-width: 0; opacity: 0; margin-left: -18px;
|
|
2056
|
+
overflow: hidden; pointer-events: none;
|
|
2057
|
+
transition: max-width 0.4s cubic-bezier(.4, 0, .2, 1), opacity 0.3s ease, margin-left 0.4s ease;
|
|
2058
|
+
}
|
|
2059
|
+
.ev-site-footer .ev-sf-form.open {
|
|
2060
|
+
max-width: 360px; opacity: 1; margin-left: 0; pointer-events: auto;
|
|
2061
|
+
}
|
|
2062
|
+
.ev-site-footer .ev-sf-form input[type="email"] {
|
|
2063
|
+
width: 188px; flex: 0 0 auto; min-width: 0;
|
|
2064
|
+
font-family: inherit; font-size: 0.9rem;
|
|
2065
|
+
color: var(--ev-sf-input-text); background: var(--ev-sf-input-bg);
|
|
2066
|
+
border: 1.5px solid var(--ev-sf-input-border);
|
|
2067
|
+
border-radius: 999px; padding: 9px 15px;
|
|
2068
|
+
transition: border-color 0.15s ease, box-shadow 0.15s ease;
|
|
2069
|
+
}
|
|
2070
|
+
.ev-site-footer .ev-sf-form input[type="email"]::placeholder { color: var(--ev-sf-placeholder); }
|
|
2071
|
+
.ev-site-footer .ev-sf-form input[type="email"]:focus {
|
|
2072
|
+
outline: 2px solid transparent; outline-offset: 1px;
|
|
2073
|
+
border-color: var(--ev-sf-focus);
|
|
2074
|
+
box-shadow: 0 0 0 3px color-mix(in srgb, var(--ev-sf-focus) 20%, transparent);
|
|
2075
|
+
}
|
|
2076
|
+
.ev-site-footer .ev-sf-btn {
|
|
2077
|
+
font-family: inherit; font-weight: 700; font-size: 0.88rem;
|
|
2078
|
+
white-space: nowrap; padding: 9px 18px;
|
|
2079
|
+
border: 1.5px solid transparent; border-radius: 999px; cursor: pointer;
|
|
2080
|
+
transition: background 0.15s ease, transform 0.15s ease;
|
|
2081
|
+
}
|
|
2082
|
+
.ev-site-footer .ev-sf-btn:hover { transform: translateY(-1px); }
|
|
2083
|
+
.ev-site-footer .ev-sf-btn:disabled { opacity: 0.7; cursor: default; transform: none; }
|
|
2084
|
+
.ev-site-footer .ev-sf-btn:focus-visible {
|
|
2085
|
+
outline: 2px solid var(--ev-sf-focus); outline-offset: 2px;
|
|
2086
|
+
}
|
|
2087
|
+
.ev-site-footer .ev-sf-note {
|
|
2088
|
+
flex-basis: 100%; width: 100%;
|
|
2089
|
+
font-size: 0.82rem; line-height: 1.4;
|
|
2090
|
+
margin: 12px 0 0; padding: 11px 14px;
|
|
2091
|
+
border-radius: 10px; text-align: right;
|
|
2092
|
+
border: 1px solid transparent;
|
|
2093
|
+
}
|
|
2094
|
+
@media (prefers-reduced-motion: reduce) {
|
|
2095
|
+
.ev-site-footer .ev-sf-form { transition: opacity 0.2s ease; }
|
|
2096
|
+
.ev-site-footer .ev-sf-caret { transition: none; }
|
|
2097
|
+
.ev-site-footer .ev-sf-btn:hover { transform: none; }
|
|
2098
|
+
}
|
|
2099
|
+
@media (max-width: 640px) {
|
|
2100
|
+
.ev-site-footer .ev-sf-wrap { flex-direction: column; align-items: flex-start; gap: 10px; }
|
|
2101
|
+
}
|
|
2102
|
+
@media (max-width: 480px) {
|
|
2103
|
+
.ev-site-footer .ev-sf-form.open { flex-basis: 100%; max-width: 100%; margin-left: 0; }
|
|
2104
|
+
.ev-site-footer .ev-sf-form.open input[type="email"] { flex: 1; width: auto; }
|
|
2105
|
+
.ev-site-footer .ev-sf-note { text-align: left; }
|
|
2106
|
+
}
|
|
2107
|
+
`;
|
|
2108
|
+
|
|
2109
|
+
// src/FilterSidebar.jsx
|
|
2110
|
+
var import_react10 = __toESM(require("react"));
|
|
1790
2111
|
function FilterSidebar({
|
|
1791
2112
|
title = "Filter by",
|
|
1792
2113
|
zipCode = "",
|
|
@@ -1940,14 +2261,14 @@ function FilterSidebar({
|
|
|
1940
2261
|
fontSize: fontSizes.sm
|
|
1941
2262
|
}
|
|
1942
2263
|
};
|
|
1943
|
-
return /* @__PURE__ */
|
|
2264
|
+
return /* @__PURE__ */ import_react10.default.createElement("aside", { style: styles2.sidebar, className: "ev-filter-sidebar" }, !isMobile && /* @__PURE__ */ import_react10.default.createElement("h2", { style: styles2.title }, title), /* @__PURE__ */ import_react10.default.createElement("div", { style: isMobile ? void 0 : styles2.contentTop }, /* @__PURE__ */ import_react10.default.createElement("div", { style: isMobile ? { marginBottom: spacing[3] } : styles2.section }, !isMobile && /* @__PURE__ */ import_react10.default.createElement("label", { style: styles2.sectionLabel }, "Location"), autocompleteContainerRef ? /* @__PURE__ */ import_react10.default.createElement(
|
|
1944
2265
|
"div",
|
|
1945
2266
|
{
|
|
1946
2267
|
ref: autocompleteContainerRef,
|
|
1947
2268
|
style: styles2.zipInputWrapper,
|
|
1948
2269
|
className: "ev-autocomplete-container"
|
|
1949
2270
|
}
|
|
1950
|
-
) : /* @__PURE__ */
|
|
2271
|
+
) : /* @__PURE__ */ import_react10.default.createElement("div", { style: styles2.zipInputWrapper }, /* @__PURE__ */ import_react10.default.createElement(
|
|
1951
2272
|
"input",
|
|
1952
2273
|
{
|
|
1953
2274
|
ref: zipInputRef,
|
|
@@ -1959,7 +2280,7 @@ function FilterSidebar({
|
|
|
1959
2280
|
style: styles2.zipInput,
|
|
1960
2281
|
"aria-label": "Search location"
|
|
1961
2282
|
}
|
|
1962
|
-
), /* @__PURE__ */
|
|
2283
|
+
), /* @__PURE__ */ import_react10.default.createElement(
|
|
1963
2284
|
"button",
|
|
1964
2285
|
{
|
|
1965
2286
|
type: "button",
|
|
@@ -1968,7 +2289,7 @@ function FilterSidebar({
|
|
|
1968
2289
|
"aria-label": "Clear ZIP code"
|
|
1969
2290
|
},
|
|
1970
2291
|
"\xD7"
|
|
1971
|
-
))), /* @__PURE__ */
|
|
2292
|
+
))), /* @__PURE__ */ import_react10.default.createElement("div", { style: isMobile ? {} : styles2.section }, !isMobile && /* @__PURE__ */ import_react10.default.createElement("label", { style: styles2.sectionLabel }, "Group"), /* @__PURE__ */ import_react10.default.createElement("div", { style: styles2.radioGroup, role: "radiogroup", "aria-label": "Filter by group" }, filterOptions.map((option) => /* @__PURE__ */ import_react10.default.createElement("label", { key: option.value, style: styles2.radioLabel }, /* @__PURE__ */ import_react10.default.createElement(
|
|
1972
2293
|
"input",
|
|
1973
2294
|
{
|
|
1974
2295
|
type: "radio",
|
|
@@ -1978,18 +2299,18 @@ function FilterSidebar({
|
|
|
1978
2299
|
onChange: () => onFilterChange == null ? void 0 : onFilterChange(option.value),
|
|
1979
2300
|
style: styles2.radioInput
|
|
1980
2301
|
}
|
|
1981
|
-
), option.label))))), !isMobile && /* @__PURE__ */
|
|
2302
|
+
), option.label))))), !isMobile && /* @__PURE__ */ import_react10.default.createElement("div", { style: styles2.imageSection }, locationLabel && /* @__PURE__ */ import_react10.default.createElement("div", { style: styles2.locationLabel }, locationLabel), buildingImageSrc ? /* @__PURE__ */ import_react10.default.createElement(
|
|
1982
2303
|
"img",
|
|
1983
2304
|
{
|
|
1984
2305
|
src: buildingImageSrc,
|
|
1985
2306
|
alt: `${selectedFilter} government building`,
|
|
1986
2307
|
style: styles2.buildingImage
|
|
1987
2308
|
}
|
|
1988
|
-
) : /* @__PURE__ */
|
|
2309
|
+
) : /* @__PURE__ */ import_react10.default.createElement("div", { style: styles2.buildingPlaceholder }, "No image")));
|
|
1989
2310
|
}
|
|
1990
2311
|
|
|
1991
2312
|
// src/PoliticianCard.jsx
|
|
1992
|
-
var
|
|
2313
|
+
var import_react11 = __toESM(require("react"));
|
|
1993
2314
|
function PoliticianCard({
|
|
1994
2315
|
id,
|
|
1995
2316
|
imageSrc,
|
|
@@ -2157,7 +2478,7 @@ function PoliticianCard({
|
|
|
2157
2478
|
textTransform: "uppercase"
|
|
2158
2479
|
}
|
|
2159
2480
|
};
|
|
2160
|
-
const CompassIcon2 = () => /* @__PURE__ */
|
|
2481
|
+
const CompassIcon2 = () => /* @__PURE__ */ import_react11.default.createElement(
|
|
2161
2482
|
"svg",
|
|
2162
2483
|
{
|
|
2163
2484
|
style: styles2.compassIcon,
|
|
@@ -2165,7 +2486,7 @@ function PoliticianCard({
|
|
|
2165
2486
|
fill: "none",
|
|
2166
2487
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2167
2488
|
},
|
|
2168
|
-
/* @__PURE__ */
|
|
2489
|
+
/* @__PURE__ */ import_react11.default.createElement(
|
|
2169
2490
|
"polygon",
|
|
2170
2491
|
{
|
|
2171
2492
|
points: "12,1 21.5,6.5 21.5,17.5 12,23 2.5,17.5 2.5,6.5",
|
|
@@ -2175,13 +2496,13 @@ function PoliticianCard({
|
|
|
2175
2496
|
strokeLinejoin: "round"
|
|
2176
2497
|
}
|
|
2177
2498
|
),
|
|
2178
|
-
/* @__PURE__ */
|
|
2179
|
-
/* @__PURE__ */
|
|
2180
|
-
/* @__PURE__ */
|
|
2181
|
-
/* @__PURE__ */
|
|
2182
|
-
/* @__PURE__ */
|
|
2183
|
-
/* @__PURE__ */
|
|
2184
|
-
/* @__PURE__ */
|
|
2499
|
+
/* @__PURE__ */ import_react11.default.createElement("line", { x1: "12", y1: "12", x2: "12", y2: "1", stroke: "currentColor", strokeWidth: "1" }),
|
|
2500
|
+
/* @__PURE__ */ import_react11.default.createElement("line", { x1: "12", y1: "12", x2: "21.5", y2: "6.5", stroke: "currentColor", strokeWidth: "1" }),
|
|
2501
|
+
/* @__PURE__ */ import_react11.default.createElement("line", { x1: "12", y1: "12", x2: "21.5", y2: "17.5", stroke: "currentColor", strokeWidth: "1" }),
|
|
2502
|
+
/* @__PURE__ */ import_react11.default.createElement("line", { x1: "12", y1: "12", x2: "12", y2: "23", stroke: "currentColor", strokeWidth: "1" }),
|
|
2503
|
+
/* @__PURE__ */ import_react11.default.createElement("line", { x1: "12", y1: "12", x2: "2.5", y2: "17.5", stroke: "currentColor", strokeWidth: "1" }),
|
|
2504
|
+
/* @__PURE__ */ import_react11.default.createElement("line", { x1: "12", y1: "12", x2: "2.5", y2: "6.5", stroke: "currentColor", strokeWidth: "1" }),
|
|
2505
|
+
/* @__PURE__ */ import_react11.default.createElement(
|
|
2185
2506
|
"polygon",
|
|
2186
2507
|
{
|
|
2187
2508
|
points: "12,4 18,7.5 18,16 12,19.5 7,15 5,8",
|
|
@@ -2189,7 +2510,7 @@ function PoliticianCard({
|
|
|
2189
2510
|
opacity: "0.35"
|
|
2190
2511
|
}
|
|
2191
2512
|
),
|
|
2192
|
-
/* @__PURE__ */
|
|
2513
|
+
/* @__PURE__ */ import_react11.default.createElement(
|
|
2193
2514
|
"polygon",
|
|
2194
2515
|
{
|
|
2195
2516
|
points: "12,4 18,7.5 18,16 12,19.5 7,15 5,8",
|
|
@@ -2200,8 +2521,8 @@ function PoliticianCard({
|
|
|
2200
2521
|
}
|
|
2201
2522
|
)
|
|
2202
2523
|
);
|
|
2203
|
-
const [imgError, setImgError] = (0,
|
|
2204
|
-
(0,
|
|
2524
|
+
const [imgError, setImgError] = (0, import_react11.useState)(false);
|
|
2525
|
+
(0, import_react11.useEffect)(() => {
|
|
2205
2526
|
setImgError(false);
|
|
2206
2527
|
}, [imageSrc]);
|
|
2207
2528
|
const getInitials = (n) => {
|
|
@@ -2210,7 +2531,7 @@ function PoliticianCard({
|
|
|
2210
2531
|
const initials = parts.length >= 2 ? parts[0][0] + parts[parts.length - 1][0] : ((_a = parts[0]) == null ? void 0 : _a[0]) || "?";
|
|
2211
2532
|
return initials.toUpperCase();
|
|
2212
2533
|
};
|
|
2213
|
-
return /* @__PURE__ */
|
|
2534
|
+
return /* @__PURE__ */ import_react11.default.createElement(
|
|
2214
2535
|
"div",
|
|
2215
2536
|
{
|
|
2216
2537
|
style: styles2.card,
|
|
@@ -2235,8 +2556,8 @@ function PoliticianCard({
|
|
|
2235
2556
|
}
|
|
2236
2557
|
}
|
|
2237
2558
|
},
|
|
2238
|
-
badge && /* @__PURE__ */
|
|
2239
|
-
/* @__PURE__ */
|
|
2559
|
+
badge && /* @__PURE__ */ import_react11.default.createElement("span", { style: styles2.badge }, badge),
|
|
2560
|
+
/* @__PURE__ */ import_react11.default.createElement("div", { style: styles2.imageWrapper }, imageSrc && !imgError ? /* @__PURE__ */ import_react11.default.createElement(
|
|
2240
2561
|
"img",
|
|
2241
2562
|
{
|
|
2242
2563
|
src: imageSrc,
|
|
@@ -2244,9 +2565,9 @@ function PoliticianCard({
|
|
|
2244
2565
|
style: styles2.image,
|
|
2245
2566
|
onError: () => setImgError(true)
|
|
2246
2567
|
}
|
|
2247
|
-
) : /* @__PURE__ */
|
|
2248
|
-
/* @__PURE__ */
|
|
2249
|
-
onCompassClick && /* @__PURE__ */
|
|
2568
|
+
) : /* @__PURE__ */ import_react11.default.createElement("div", { style: styles2.imagePlaceholder }, getInitials(name))),
|
|
2569
|
+
/* @__PURE__ */ import_react11.default.createElement("div", { style: styles2.content }, /* @__PURE__ */ import_react11.default.createElement("h3", { style: styles2.name }, name), /* @__PURE__ */ import_react11.default.createElement("p", { style: styles2.title }, title), subtitle && /* @__PURE__ */ import_react11.default.createElement("p", { style: styles2.subtitle }, subtitle), footer && /* @__PURE__ */ import_react11.default.createElement("div", { style: { marginTop: "auto", marginLeft: "-5px" } }, footer)),
|
|
2570
|
+
onCompassClick && /* @__PURE__ */ import_react11.default.createElement(
|
|
2250
2571
|
"button",
|
|
2251
2572
|
{
|
|
2252
2573
|
type: "button",
|
|
@@ -2261,25 +2582,25 @@ function PoliticianCard({
|
|
|
2261
2582
|
},
|
|
2262
2583
|
"aria-label": `View ${name}'s compass`
|
|
2263
2584
|
},
|
|
2264
|
-
/* @__PURE__ */
|
|
2585
|
+
/* @__PURE__ */ import_react11.default.createElement(CompassIcon2, null)
|
|
2265
2586
|
)
|
|
2266
2587
|
);
|
|
2267
2588
|
}
|
|
2268
2589
|
|
|
2269
2590
|
// src/CompassCardHorizontal.jsx
|
|
2270
|
-
var
|
|
2591
|
+
var import_react16 = __toESM(require("react"));
|
|
2271
2592
|
|
|
2272
2593
|
// src/CompassCardHorizontalMeta.jsx
|
|
2273
|
-
var
|
|
2594
|
+
var import_react15 = __toESM(require("react"));
|
|
2274
2595
|
|
|
2275
2596
|
// src/IconOverlay.jsx
|
|
2276
|
-
var
|
|
2277
|
-
var
|
|
2597
|
+
var import_react13 = __toESM(require("react"));
|
|
2598
|
+
var import_react14 = require("@floating-ui/react");
|
|
2278
2599
|
|
|
2279
2600
|
// src/icons.js
|
|
2280
|
-
var
|
|
2601
|
+
var import_react12 = __toESM(require("react"));
|
|
2281
2602
|
function BallotIcon({ size = 16, color = "currentColor" }) {
|
|
2282
|
-
return /* @__PURE__ */
|
|
2603
|
+
return /* @__PURE__ */ import_react12.default.createElement(
|
|
2283
2604
|
"svg",
|
|
2284
2605
|
{
|
|
2285
2606
|
width: size,
|
|
@@ -2292,13 +2613,13 @@ function BallotIcon({ size = 16, color = "currentColor" }) {
|
|
|
2292
2613
|
strokeLinejoin: "round",
|
|
2293
2614
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2294
2615
|
},
|
|
2295
|
-
/* @__PURE__ */
|
|
2296
|
-
/* @__PURE__ */
|
|
2297
|
-
/* @__PURE__ */
|
|
2616
|
+
/* @__PURE__ */ import_react12.default.createElement("path", { d: "m9 12 2 2 4-4" }),
|
|
2617
|
+
/* @__PURE__ */ import_react12.default.createElement("path", { d: "M5 7c0-1.1.9-2 2-2h10a2 2 0 0 1 2 2v12H5V7Z" }),
|
|
2618
|
+
/* @__PURE__ */ import_react12.default.createElement("path", { d: "M22 19H2" })
|
|
2298
2619
|
);
|
|
2299
2620
|
}
|
|
2300
2621
|
function CompassIcon({ size = 16, color = "currentColor" }) {
|
|
2301
|
-
return /* @__PURE__ */
|
|
2622
|
+
return /* @__PURE__ */ import_react12.default.createElement(
|
|
2302
2623
|
"svg",
|
|
2303
2624
|
{
|
|
2304
2625
|
width: size,
|
|
@@ -2311,27 +2632,27 @@ function CompassIcon({ size = 16, color = "currentColor" }) {
|
|
|
2311
2632
|
strokeLinejoin: "round",
|
|
2312
2633
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2313
2634
|
},
|
|
2314
|
-
/* @__PURE__ */
|
|
2315
|
-
/* @__PURE__ */
|
|
2635
|
+
/* @__PURE__ */ import_react12.default.createElement("circle", { cx: "12", cy: "12", r: "10" }),
|
|
2636
|
+
/* @__PURE__ */ import_react12.default.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" })
|
|
2316
2637
|
);
|
|
2317
2638
|
}
|
|
2318
2639
|
function BranchIcon({ size = 16, color = "currentColor", branch }) {
|
|
2319
2640
|
let paths;
|
|
2320
2641
|
switch (branch) {
|
|
2321
2642
|
case "executive":
|
|
2322
|
-
paths = /* @__PURE__ */
|
|
2643
|
+
paths = /* @__PURE__ */ import_react12.default.createElement(import_react12.default.Fragment, null, /* @__PURE__ */ import_react12.default.createElement("path", { d: "M3 21h18" }), /* @__PURE__ */ import_react12.default.createElement("path", { d: "M5 21V7l8-4v18" }), /* @__PURE__ */ import_react12.default.createElement("path", { d: "M19 21V11l-6-4" }), /* @__PURE__ */ import_react12.default.createElement("path", { d: "M9 9v.01" }), /* @__PURE__ */ import_react12.default.createElement("path", { d: "M9 12v.01" }), /* @__PURE__ */ import_react12.default.createElement("path", { d: "M9 15v.01" }), /* @__PURE__ */ import_react12.default.createElement("path", { d: "M9 18v.01" }), /* @__PURE__ */ import_react12.default.createElement("path", { d: "M5 21h14" }), /* @__PURE__ */ import_react12.default.createElement("line", { x1: "13", y1: "5", x2: "13", y2: "3" }), /* @__PURE__ */ import_react12.default.createElement("line", { x1: "13", y1: "3", x2: "15", y2: "4" }));
|
|
2323
2644
|
break;
|
|
2324
2645
|
case "legislative":
|
|
2325
|
-
paths = /* @__PURE__ */
|
|
2646
|
+
paths = /* @__PURE__ */ import_react12.default.createElement(import_react12.default.Fragment, null, /* @__PURE__ */ import_react12.default.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__ */ import_react12.default.createElement("path", { d: "M19 17V5a2 2 0 0 0-2-2H4" }), /* @__PURE__ */ import_react12.default.createElement("path", { d: "M15 8h-5" }), /* @__PURE__ */ import_react12.default.createElement("path", { d: "M15 12h-5" }));
|
|
2326
2647
|
break;
|
|
2327
2648
|
case "judicial":
|
|
2328
|
-
paths = /* @__PURE__ */
|
|
2649
|
+
paths = /* @__PURE__ */ import_react12.default.createElement(import_react12.default.Fragment, null, /* @__PURE__ */ import_react12.default.createElement("path", { d: "M12 3v19" }), /* @__PURE__ */ import_react12.default.createElement("path", { d: "M5 8l7-5 7 5" }), /* @__PURE__ */ import_react12.default.createElement("path", { d: "M3 13l2-5 2 5a3 3 0 0 1-4 0z" }), /* @__PURE__ */ import_react12.default.createElement("path", { d: "M17 13l2-5 2 5a3 3 0 0 1-4 0z" }), /* @__PURE__ */ import_react12.default.createElement("path", { d: "M8 21h8" }));
|
|
2329
2650
|
break;
|
|
2330
2651
|
default:
|
|
2331
|
-
paths = /* @__PURE__ */
|
|
2652
|
+
paths = /* @__PURE__ */ import_react12.default.createElement(import_react12.default.Fragment, null, /* @__PURE__ */ import_react12.default.createElement("path", { d: "M10 18v-7" }), /* @__PURE__ */ import_react12.default.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__ */ import_react12.default.createElement("path", { d: "M14 18v-7" }), /* @__PURE__ */ import_react12.default.createElement("path", { d: "M18 18v-7" }), /* @__PURE__ */ import_react12.default.createElement("path", { d: "M3 22h18" }), /* @__PURE__ */ import_react12.default.createElement("path", { d: "M6 18v-7" }));
|
|
2332
2653
|
break;
|
|
2333
2654
|
}
|
|
2334
|
-
return /* @__PURE__ */
|
|
2655
|
+
return /* @__PURE__ */ import_react12.default.createElement(
|
|
2335
2656
|
"svg",
|
|
2336
2657
|
{
|
|
2337
2658
|
width: size,
|
|
@@ -2350,24 +2671,24 @@ function BranchIcon({ size = 16, color = "currentColor", branch }) {
|
|
|
2350
2671
|
|
|
2351
2672
|
// src/IconOverlay.jsx
|
|
2352
2673
|
function IconWithTooltip({ IconComponent, color, tooltip, size = 14, extraProps = {}, onClick }) {
|
|
2353
|
-
const [isOpen, setIsOpen] = (0,
|
|
2354
|
-
const { refs, floatingStyles, context } = (0,
|
|
2674
|
+
const [isOpen, setIsOpen] = (0, import_react13.useState)(false);
|
|
2675
|
+
const { refs, floatingStyles, context } = (0, import_react14.useFloating)({
|
|
2355
2676
|
open: isOpen,
|
|
2356
2677
|
onOpenChange: setIsOpen,
|
|
2357
|
-
middleware: [(0,
|
|
2358
|
-
whileElementsMounted:
|
|
2678
|
+
middleware: [(0, import_react14.offset)(8), (0, import_react14.flip)(), (0, import_react14.shift)({ padding: 4 })],
|
|
2679
|
+
whileElementsMounted: import_react14.autoUpdate
|
|
2359
2680
|
});
|
|
2360
|
-
const hover = (0,
|
|
2361
|
-
const focus2 = (0,
|
|
2362
|
-
const dismiss = (0,
|
|
2363
|
-
const role = (0,
|
|
2364
|
-
const { getReferenceProps, getFloatingProps } = (0,
|
|
2681
|
+
const hover = (0, import_react14.useHover)(context);
|
|
2682
|
+
const focus2 = (0, import_react14.useFocus)(context);
|
|
2683
|
+
const dismiss = (0, import_react14.useDismiss)(context);
|
|
2684
|
+
const role = (0, import_react14.useRole)(context, { role: "tooltip" });
|
|
2685
|
+
const { getReferenceProps, getFloatingProps } = (0, import_react14.useInteractions)([
|
|
2365
2686
|
hover,
|
|
2366
2687
|
focus2,
|
|
2367
2688
|
dismiss,
|
|
2368
2689
|
role
|
|
2369
2690
|
]);
|
|
2370
|
-
return /* @__PURE__ */
|
|
2691
|
+
return /* @__PURE__ */ import_react13.default.createElement(import_react13.default.Fragment, null, /* @__PURE__ */ import_react13.default.createElement(
|
|
2371
2692
|
"span",
|
|
2372
2693
|
{
|
|
2373
2694
|
ref: refs.setReference,
|
|
@@ -2380,8 +2701,8 @@ function IconWithTooltip({ IconComponent, color, tooltip, size = 14, extraProps
|
|
|
2380
2701
|
onClick(e);
|
|
2381
2702
|
} : void 0
|
|
2382
2703
|
},
|
|
2383
|
-
/* @__PURE__ */
|
|
2384
|
-
), isOpen && /* @__PURE__ */
|
|
2704
|
+
/* @__PURE__ */ import_react13.default.createElement(IconComponent, { size, color, ...extraProps })
|
|
2705
|
+
), isOpen && /* @__PURE__ */ import_react13.default.createElement(import_react14.FloatingPortal, null, /* @__PURE__ */ import_react13.default.createElement(
|
|
2385
2706
|
"div",
|
|
2386
2707
|
{
|
|
2387
2708
|
ref: refs.setFloating,
|
|
@@ -2405,7 +2726,7 @@ function IconWithTooltip({ IconComponent, color, tooltip, size = 14, extraProps
|
|
|
2405
2726
|
function IconOverlay({ ballot, hasStances, branch, onCompassClick }) {
|
|
2406
2727
|
if (!ballot && !hasStances && !branch) return null;
|
|
2407
2728
|
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;
|
|
2408
|
-
return /* @__PURE__ */
|
|
2729
|
+
return /* @__PURE__ */ import_react13.default.createElement(
|
|
2409
2730
|
"div",
|
|
2410
2731
|
{
|
|
2411
2732
|
style: {
|
|
@@ -2418,7 +2739,7 @@ function IconOverlay({ ballot, hasStances, branch, onCompassClick }) {
|
|
|
2418
2739
|
// offset icon wrapper padding so icons align flush-left with text
|
|
2419
2740
|
}
|
|
2420
2741
|
},
|
|
2421
|
-
ballot && /* @__PURE__ */
|
|
2742
|
+
ballot && /* @__PURE__ */ import_react13.default.createElement(
|
|
2422
2743
|
IconWithTooltip,
|
|
2423
2744
|
{
|
|
2424
2745
|
IconComponent: BallotIcon,
|
|
@@ -2427,7 +2748,7 @@ function IconOverlay({ ballot, hasStances, branch, onCompassClick }) {
|
|
|
2427
2748
|
size: 14
|
|
2428
2749
|
}
|
|
2429
2750
|
),
|
|
2430
|
-
hasStances && /* @__PURE__ */
|
|
2751
|
+
hasStances && /* @__PURE__ */ import_react13.default.createElement(
|
|
2431
2752
|
IconWithTooltip,
|
|
2432
2753
|
{
|
|
2433
2754
|
IconComponent: CompassIcon,
|
|
@@ -2437,7 +2758,7 @@ function IconOverlay({ ballot, hasStances, branch, onCompassClick }) {
|
|
|
2437
2758
|
onClick: onCompassClick
|
|
2438
2759
|
}
|
|
2439
2760
|
),
|
|
2440
|
-
branch && /* @__PURE__ */
|
|
2761
|
+
branch && /* @__PURE__ */ import_react13.default.createElement(
|
|
2441
2762
|
IconWithTooltip,
|
|
2442
2763
|
{
|
|
2443
2764
|
IconComponent: BranchIcon,
|
|
@@ -2457,20 +2778,20 @@ function CompassCardHorizontalMeta({
|
|
|
2457
2778
|
userAnswers
|
|
2458
2779
|
}) {
|
|
2459
2780
|
const titleText = surface === "elections" ? politician.office_running_for : politician.office_title;
|
|
2460
|
-
return /* @__PURE__ */
|
|
2781
|
+
return /* @__PURE__ */ import_react15.default.createElement("div", { style: {
|
|
2461
2782
|
flex: 1,
|
|
2462
2783
|
minWidth: 0,
|
|
2463
2784
|
display: "flex",
|
|
2464
2785
|
flexDirection: "column",
|
|
2465
2786
|
gap: spacing[1]
|
|
2466
|
-
} }, /* @__PURE__ */
|
|
2787
|
+
} }, /* @__PURE__ */ import_react15.default.createElement("p", { style: {
|
|
2467
2788
|
fontFamily: fonts.primary,
|
|
2468
2789
|
fontSize: fontSizes.lg,
|
|
2469
2790
|
fontWeight: fontWeights.semibold,
|
|
2470
2791
|
lineHeight: 1.4,
|
|
2471
2792
|
color: colors.evMutedBlue,
|
|
2472
2793
|
margin: 0
|
|
2473
|
-
} }, politician.full_name), /* @__PURE__ */
|
|
2794
|
+
} }, politician.full_name), /* @__PURE__ */ import_react15.default.createElement("p", { style: {
|
|
2474
2795
|
fontFamily: fonts.primary,
|
|
2475
2796
|
fontSize: fontSizes.sm,
|
|
2476
2797
|
fontWeight: fontWeights.semibold,
|
|
@@ -2481,7 +2802,7 @@ function CompassCardHorizontalMeta({
|
|
|
2481
2802
|
display: "-webkit-box",
|
|
2482
2803
|
WebkitLineClamp: 2,
|
|
2483
2804
|
WebkitBoxOrient: "vertical"
|
|
2484
|
-
} }, titleText || ""), politician.district_label && /* @__PURE__ */
|
|
2805
|
+
} }, titleText || ""), politician.district_label && /* @__PURE__ */ import_react15.default.createElement("p", { style: {
|
|
2485
2806
|
fontFamily: fonts.primary,
|
|
2486
2807
|
fontSize: fontSizes.sm,
|
|
2487
2808
|
fontWeight: fontWeights.regular,
|
|
@@ -2491,7 +2812,7 @@ function CompassCardHorizontalMeta({
|
|
|
2491
2812
|
overflow: "hidden",
|
|
2492
2813
|
textOverflow: "ellipsis",
|
|
2493
2814
|
whiteSpace: "nowrap"
|
|
2494
|
-
} }, politician.district_label), /* @__PURE__ */
|
|
2815
|
+
} }, politician.district_label), /* @__PURE__ */ import_react15.default.createElement(
|
|
2495
2816
|
IconOverlay,
|
|
2496
2817
|
{
|
|
2497
2818
|
ballot: politician.ballot || null,
|
|
@@ -2540,11 +2861,11 @@ function CompassCardHorizontal({
|
|
|
2540
2861
|
onClick
|
|
2541
2862
|
}) {
|
|
2542
2863
|
var _a;
|
|
2543
|
-
const [hovered, setHovered] = (0,
|
|
2544
|
-
const [focused, setFocused] = (0,
|
|
2545
|
-
const [imgError, setImgError] = (0,
|
|
2546
|
-
const [emptyCtaHovered, setEmptyCtaHovered] = (0,
|
|
2547
|
-
(0,
|
|
2864
|
+
const [hovered, setHovered] = (0, import_react16.useState)(false);
|
|
2865
|
+
const [focused, setFocused] = (0, import_react16.useState)(false);
|
|
2866
|
+
const [imgError, setImgError] = (0, import_react16.useState)(false);
|
|
2867
|
+
const [emptyCtaHovered, setEmptyCtaHovered] = (0, import_react16.useState)(false);
|
|
2868
|
+
(0, import_react16.useEffect)(() => {
|
|
2548
2869
|
setImgError(false);
|
|
2549
2870
|
}, [politician == null ? void 0 : politician.photo_origin_url]);
|
|
2550
2871
|
const cardStyle = {
|
|
@@ -2568,7 +2889,7 @@ function CompassCardHorizontal({
|
|
|
2568
2889
|
function renderCompass() {
|
|
2569
2890
|
var _a2, _b, _c;
|
|
2570
2891
|
if (!userAnswers || userAnswers.length === 0) {
|
|
2571
|
-
return /* @__PURE__ */
|
|
2892
|
+
return /* @__PURE__ */ import_react16.default.createElement(PlaceholderRadar, { size: RADAR_SIZE, name: (politician == null ? void 0 : politician.full_name) || "" });
|
|
2572
2893
|
}
|
|
2573
2894
|
let topics = [];
|
|
2574
2895
|
let data = {};
|
|
@@ -2604,12 +2925,12 @@ function CompassCardHorizontal({
|
|
|
2604
2925
|
}, {}) : politician.stances;
|
|
2605
2926
|
}
|
|
2606
2927
|
if (topics.length === 0) {
|
|
2607
|
-
return /* @__PURE__ */
|
|
2928
|
+
return /* @__PURE__ */ import_react16.default.createElement(PlaceholderRadar, { size: RADAR_SIZE, name: (politician == null ? void 0 : politician.full_name) || "" });
|
|
2608
2929
|
}
|
|
2609
2930
|
} catch (err) {
|
|
2610
|
-
return /* @__PURE__ */
|
|
2931
|
+
return /* @__PURE__ */ import_react16.default.createElement(PlaceholderRadar, { size: RADAR_SIZE, name: (politician == null ? void 0 : politician.full_name) || "" });
|
|
2611
2932
|
}
|
|
2612
|
-
return /* @__PURE__ */
|
|
2933
|
+
return /* @__PURE__ */ import_react16.default.createElement(
|
|
2613
2934
|
RadarChartCore,
|
|
2614
2935
|
{
|
|
2615
2936
|
topics,
|
|
@@ -2631,7 +2952,7 @@ function CompassCardHorizontal({
|
|
|
2631
2952
|
var _a2, _b, _c;
|
|
2632
2953
|
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;
|
|
2633
2954
|
if (imageSrc && !imgError) {
|
|
2634
|
-
return /* @__PURE__ */
|
|
2955
|
+
return /* @__PURE__ */ import_react16.default.createElement(
|
|
2635
2956
|
"img",
|
|
2636
2957
|
{
|
|
2637
2958
|
src: imageSrc,
|
|
@@ -2649,7 +2970,7 @@ function CompassCardHorizontal({
|
|
|
2649
2970
|
}
|
|
2650
2971
|
const parts = ((politician == null ? void 0 : politician.full_name) || "").split(" ").filter(Boolean);
|
|
2651
2972
|
const initials = (parts.length >= 2 ? parts[0][0] + parts[parts.length - 1][0] : ((_c = parts[0]) == null ? void 0 : _c[0]) || "?").toUpperCase();
|
|
2652
|
-
return /* @__PURE__ */
|
|
2973
|
+
return /* @__PURE__ */ import_react16.default.createElement("div", { style: {
|
|
2653
2974
|
width: "100%",
|
|
2654
2975
|
height: "100%",
|
|
2655
2976
|
backgroundColor: colors.evMutedBlue,
|
|
@@ -2663,7 +2984,7 @@ function CompassCardHorizontal({
|
|
|
2663
2984
|
} }, initials);
|
|
2664
2985
|
}
|
|
2665
2986
|
function renderEmptyVariant() {
|
|
2666
|
-
return /* @__PURE__ */
|
|
2987
|
+
return /* @__PURE__ */ import_react16.default.createElement("div", { style: {
|
|
2667
2988
|
width: "100%",
|
|
2668
2989
|
height: "100%",
|
|
2669
2990
|
display: "flex",
|
|
@@ -2674,14 +2995,14 @@ function CompassCardHorizontal({
|
|
|
2674
2995
|
padding: "12px 14px",
|
|
2675
2996
|
boxSizing: "border-box",
|
|
2676
2997
|
backgroundColor: colorScales.teal["050"]
|
|
2677
|
-
} }, /* @__PURE__ */
|
|
2998
|
+
} }, /* @__PURE__ */ import_react16.default.createElement(PlaceholderRadar, { size: 140, name: (politician == null ? void 0 : politician.full_name) || "" }), /* @__PURE__ */ import_react16.default.createElement("p", { style: {
|
|
2678
2999
|
margin: 0,
|
|
2679
3000
|
fontSize: fontSizes.xs,
|
|
2680
3001
|
color: colors.textMuted,
|
|
2681
3002
|
textAlign: "center",
|
|
2682
3003
|
lineHeight: 1.4,
|
|
2683
3004
|
fontFamily: fonts.primary
|
|
2684
|
-
} }, "Calibrate your compass to see how you align with ", (politician == null ? void 0 : politician.full_name) || "this official"), /* @__PURE__ */
|
|
3005
|
+
} }, "Calibrate your compass to see how you align with ", (politician == null ? void 0 : politician.full_name) || "this official"), /* @__PURE__ */ import_react16.default.createElement(
|
|
2685
3006
|
"button",
|
|
2686
3007
|
{
|
|
2687
3008
|
type: "button",
|
|
@@ -2709,7 +3030,7 @@ function CompassCardHorizontal({
|
|
|
2709
3030
|
));
|
|
2710
3031
|
}
|
|
2711
3032
|
function renderUnavailablePlate(message = "Compass currently unavailable for this role.") {
|
|
2712
|
-
return /* @__PURE__ */
|
|
3033
|
+
return /* @__PURE__ */ import_react16.default.createElement("div", { style: {
|
|
2713
3034
|
width: "100%",
|
|
2714
3035
|
height: "100%",
|
|
2715
3036
|
backgroundColor: colorScales.teal["050"],
|
|
@@ -2718,7 +3039,7 @@ function CompassCardHorizontal({
|
|
|
2718
3039
|
justifyContent: "center",
|
|
2719
3040
|
padding: spacing[4],
|
|
2720
3041
|
boxSizing: "border-box"
|
|
2721
|
-
} }, /* @__PURE__ */
|
|
3042
|
+
} }, /* @__PURE__ */ import_react16.default.createElement("p", { style: {
|
|
2722
3043
|
fontSize: fontSizes.sm,
|
|
2723
3044
|
fontWeight: fontWeights.semibold,
|
|
2724
3045
|
lineHeight: 1.4,
|
|
@@ -2737,7 +3058,7 @@ function CompassCardHorizontal({
|
|
|
2737
3058
|
const name = (politician == null ? void 0 : politician.full_name) || "this official";
|
|
2738
3059
|
return renderUnavailablePlate(`No compass stances on file for ${name} yet.`);
|
|
2739
3060
|
}
|
|
2740
|
-
return /* @__PURE__ */
|
|
3061
|
+
return /* @__PURE__ */ import_react16.default.createElement("div", { style: {
|
|
2741
3062
|
width: "100%",
|
|
2742
3063
|
height: "100%",
|
|
2743
3064
|
display: "flex",
|
|
@@ -2747,7 +3068,7 @@ function CompassCardHorizontal({
|
|
|
2747
3068
|
boxSizing: "border-box"
|
|
2748
3069
|
} }, renderCompass());
|
|
2749
3070
|
}
|
|
2750
|
-
return /* @__PURE__ */
|
|
3071
|
+
return /* @__PURE__ */ import_react16.default.createElement(
|
|
2751
3072
|
"div",
|
|
2752
3073
|
{
|
|
2753
3074
|
role: "article",
|
|
@@ -2766,7 +3087,7 @@ function CompassCardHorizontal({
|
|
|
2766
3087
|
onFocus: () => setFocused(true),
|
|
2767
3088
|
onBlur: () => setFocused(false)
|
|
2768
3089
|
},
|
|
2769
|
-
/* @__PURE__ */
|
|
3090
|
+
/* @__PURE__ */ import_react16.default.createElement("div", { style: slotStyle }, renderSlotContent(), surface === "elections" && politician.running_unopposed && /* @__PURE__ */ import_react16.default.createElement("div", { style: {
|
|
2770
3091
|
position: "absolute",
|
|
2771
3092
|
bottom: "15px",
|
|
2772
3093
|
left: 0,
|
|
@@ -2781,7 +3102,7 @@ function CompassCardHorizontal({
|
|
|
2781
3102
|
padding: "6px 0",
|
|
2782
3103
|
pointerEvents: "none"
|
|
2783
3104
|
} }, typeof politician.running_unopposed === "string" ? politician.running_unopposed : "Running Unopposed")),
|
|
2784
|
-
/* @__PURE__ */
|
|
3105
|
+
/* @__PURE__ */ import_react16.default.createElement("div", { style: { flex: 1, minWidth: 0, padding: spacing[4], paddingLeft: spacing[3] } }, /* @__PURE__ */ import_react16.default.createElement(
|
|
2785
3106
|
CompassCardHorizontalMeta,
|
|
2786
3107
|
{
|
|
2787
3108
|
politician,
|
|
@@ -2793,7 +3114,7 @@ function CompassCardHorizontal({
|
|
|
2793
3114
|
}
|
|
2794
3115
|
|
|
2795
3116
|
// src/CompassCardVertical.jsx
|
|
2796
|
-
var
|
|
3117
|
+
var import_react17 = __toESM(require("react"));
|
|
2797
3118
|
var RADAR_SIZE2 = 400;
|
|
2798
3119
|
function CompassCardVertical({
|
|
2799
3120
|
politician,
|
|
@@ -2807,11 +3128,11 @@ function CompassCardVertical({
|
|
|
2807
3128
|
onClick
|
|
2808
3129
|
}) {
|
|
2809
3130
|
var _a;
|
|
2810
|
-
const [hovered, setHovered] = (0,
|
|
2811
|
-
const [focused, setFocused] = (0,
|
|
2812
|
-
const [imgError, setImgError] = (0,
|
|
2813
|
-
const [emptyCtaHovered, setEmptyCtaHovered] = (0,
|
|
2814
|
-
(0,
|
|
3131
|
+
const [hovered, setHovered] = (0, import_react17.useState)(false);
|
|
3132
|
+
const [focused, setFocused] = (0, import_react17.useState)(false);
|
|
3133
|
+
const [imgError, setImgError] = (0, import_react17.useState)(false);
|
|
3134
|
+
const [emptyCtaHovered, setEmptyCtaHovered] = (0, import_react17.useState)(false);
|
|
3135
|
+
(0, import_react17.useEffect)(() => {
|
|
2815
3136
|
setImgError(false);
|
|
2816
3137
|
}, [politician == null ? void 0 : politician.photo_origin_url]);
|
|
2817
3138
|
const cardStyle = {
|
|
@@ -2834,7 +3155,7 @@ function CompassCardVertical({
|
|
|
2834
3155
|
function renderCompass() {
|
|
2835
3156
|
var _a2, _b, _c;
|
|
2836
3157
|
if (!userAnswers || userAnswers.length === 0) {
|
|
2837
|
-
return /* @__PURE__ */
|
|
3158
|
+
return /* @__PURE__ */ import_react17.default.createElement(PlaceholderRadar, { size: RADAR_SIZE2, name: (politician == null ? void 0 : politician.full_name) || "" });
|
|
2838
3159
|
}
|
|
2839
3160
|
let topics = [];
|
|
2840
3161
|
let data = {};
|
|
@@ -2870,17 +3191,17 @@ function CompassCardVertical({
|
|
|
2870
3191
|
}, {}) : politician.stances;
|
|
2871
3192
|
}
|
|
2872
3193
|
if (topics.length === 0) {
|
|
2873
|
-
return /* @__PURE__ */
|
|
3194
|
+
return /* @__PURE__ */ import_react17.default.createElement(PlaceholderRadar, { size: RADAR_SIZE2, name: (politician == null ? void 0 : politician.full_name) || "" });
|
|
2874
3195
|
}
|
|
2875
3196
|
} catch {
|
|
2876
|
-
return /* @__PURE__ */
|
|
3197
|
+
return /* @__PURE__ */ import_react17.default.createElement(PlaceholderRadar, { size: RADAR_SIZE2, name: (politician == null ? void 0 : politician.full_name) || "" });
|
|
2877
3198
|
}
|
|
2878
3199
|
const unansweredSpokes = {};
|
|
2879
3200
|
for (const t of topics) {
|
|
2880
3201
|
const v = compareData[t.short_title];
|
|
2881
3202
|
if (!v || Number(v) === 0) unansweredSpokes[t.short_title] = true;
|
|
2882
3203
|
}
|
|
2883
|
-
return /* @__PURE__ */
|
|
3204
|
+
return /* @__PURE__ */ import_react17.default.createElement("div", { style: { width: RADAR_SIZE2 + 240, maxWidth: "100%", flexShrink: 0 } }, /* @__PURE__ */ import_react17.default.createElement(
|
|
2884
3205
|
RadarChartCore,
|
|
2885
3206
|
{
|
|
2886
3207
|
topics,
|
|
@@ -2915,7 +3236,7 @@ function CompassCardVertical({
|
|
|
2915
3236
|
justifyContent: "center"
|
|
2916
3237
|
};
|
|
2917
3238
|
if (imageSrc && !imgError) {
|
|
2918
|
-
return /* @__PURE__ */
|
|
3239
|
+
return /* @__PURE__ */ import_react17.default.createElement("div", { style: baseStyle }, /* @__PURE__ */ import_react17.default.createElement(
|
|
2919
3240
|
"img",
|
|
2920
3241
|
{
|
|
2921
3242
|
src: imageSrc,
|
|
@@ -2933,7 +3254,7 @@ function CompassCardVertical({
|
|
|
2933
3254
|
}
|
|
2934
3255
|
const parts = ((politician == null ? void 0 : politician.full_name) || "").split(" ").filter(Boolean);
|
|
2935
3256
|
const initials = (parts.length >= 2 ? parts[0][0] + parts[parts.length - 1][0] : ((_c = parts[0]) == null ? void 0 : _c[0]) || "?").toUpperCase();
|
|
2936
|
-
return /* @__PURE__ */
|
|
3257
|
+
return /* @__PURE__ */ import_react17.default.createElement("div", { style: baseStyle }, /* @__PURE__ */ import_react17.default.createElement("span", { style: {
|
|
2937
3258
|
color: colors.textWhite,
|
|
2938
3259
|
fontFamily: fonts.primary,
|
|
2939
3260
|
fontWeight: fontWeights.bold,
|
|
@@ -2944,7 +3265,7 @@ function CompassCardVertical({
|
|
|
2944
3265
|
var _a2, _b, _c;
|
|
2945
3266
|
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;
|
|
2946
3267
|
if (imageSrc && !imgError) {
|
|
2947
|
-
return /* @__PURE__ */
|
|
3268
|
+
return /* @__PURE__ */ import_react17.default.createElement(
|
|
2948
3269
|
"img",
|
|
2949
3270
|
{
|
|
2950
3271
|
src: imageSrc,
|
|
@@ -2963,7 +3284,7 @@ function CompassCardVertical({
|
|
|
2963
3284
|
}
|
|
2964
3285
|
const parts = ((politician == null ? void 0 : politician.full_name) || "").split(" ").filter(Boolean);
|
|
2965
3286
|
const initials = (parts.length >= 2 ? parts[0][0] + parts[parts.length - 1][0] : ((_c = parts[0]) == null ? void 0 : _c[0]) || "?").toUpperCase();
|
|
2966
|
-
return /* @__PURE__ */
|
|
3287
|
+
return /* @__PURE__ */ import_react17.default.createElement("div", { style: {
|
|
2967
3288
|
width: RADAR_SIZE2,
|
|
2968
3289
|
height: RADAR_SIZE2,
|
|
2969
3290
|
backgroundColor: colors.evMutedBlue,
|
|
@@ -2978,7 +3299,7 @@ function CompassCardVertical({
|
|
|
2978
3299
|
} }, initials);
|
|
2979
3300
|
}
|
|
2980
3301
|
function renderEmptyVariant() {
|
|
2981
|
-
return /* @__PURE__ */
|
|
3302
|
+
return /* @__PURE__ */ import_react17.default.createElement("div", { style: {
|
|
2982
3303
|
width: "100%",
|
|
2983
3304
|
height: "100%",
|
|
2984
3305
|
flex: 1,
|
|
@@ -2991,14 +3312,14 @@ function CompassCardVertical({
|
|
|
2991
3312
|
boxSizing: "border-box",
|
|
2992
3313
|
backgroundColor: colorScales.teal["050"],
|
|
2993
3314
|
borderRadius: borderRadius.md
|
|
2994
|
-
} }, /* @__PURE__ */
|
|
3315
|
+
} }, /* @__PURE__ */ import_react17.default.createElement(PlaceholderRadar, { size: 220, name: (politician == null ? void 0 : politician.full_name) || "" }), /* @__PURE__ */ import_react17.default.createElement("p", { style: {
|
|
2995
3316
|
margin: 0,
|
|
2996
3317
|
fontSize: fontSizes.sm,
|
|
2997
3318
|
color: colors.textMuted,
|
|
2998
3319
|
textAlign: "center",
|
|
2999
3320
|
lineHeight: 1.4,
|
|
3000
3321
|
fontFamily: fonts.primary
|
|
3001
|
-
} }, "Calibrate your compass to see how you align with ", (politician == null ? void 0 : politician.full_name) || "this official"), /* @__PURE__ */
|
|
3322
|
+
} }, "Calibrate your compass to see how you align with ", (politician == null ? void 0 : politician.full_name) || "this official"), /* @__PURE__ */ import_react17.default.createElement(
|
|
3002
3323
|
"button",
|
|
3003
3324
|
{
|
|
3004
3325
|
type: "button",
|
|
@@ -3024,7 +3345,7 @@ function CompassCardVertical({
|
|
|
3024
3345
|
));
|
|
3025
3346
|
}
|
|
3026
3347
|
function renderUnavailablePlate(message) {
|
|
3027
|
-
return /* @__PURE__ */
|
|
3348
|
+
return /* @__PURE__ */ import_react17.default.createElement("div", { style: {
|
|
3028
3349
|
width: "100%",
|
|
3029
3350
|
height: "100%",
|
|
3030
3351
|
flex: 1,
|
|
@@ -3035,7 +3356,7 @@ function CompassCardVertical({
|
|
|
3035
3356
|
justifyContent: "center",
|
|
3036
3357
|
padding: spacing[6],
|
|
3037
3358
|
boxSizing: "border-box"
|
|
3038
|
-
} }, /* @__PURE__ */
|
|
3359
|
+
} }, /* @__PURE__ */ import_react17.default.createElement("p", { style: {
|
|
3039
3360
|
fontSize: fontSizes.base,
|
|
3040
3361
|
fontWeight: fontWeights.semibold,
|
|
3041
3362
|
lineHeight: 1.4,
|
|
@@ -3056,7 +3377,7 @@ function CompassCardVertical({
|
|
|
3056
3377
|
}
|
|
3057
3378
|
return renderCompass();
|
|
3058
3379
|
}
|
|
3059
|
-
return /* @__PURE__ */
|
|
3380
|
+
return /* @__PURE__ */ import_react17.default.createElement(
|
|
3060
3381
|
"div",
|
|
3061
3382
|
{
|
|
3062
3383
|
role: "article",
|
|
@@ -3075,21 +3396,21 @@ function CompassCardVertical({
|
|
|
3075
3396
|
onFocus: () => setFocused(true),
|
|
3076
3397
|
onBlur: () => setFocused(false)
|
|
3077
3398
|
},
|
|
3078
|
-
/* @__PURE__ */
|
|
3399
|
+
/* @__PURE__ */ import_react17.default.createElement("div", { style: { padding: spacing[4], paddingBottom: spacing[3], display: "flex", alignItems: "stretch", gap: spacing[3], flexShrink: 0 } }, renderAvatar(), /* @__PURE__ */ import_react17.default.createElement("div", { style: { display: "flex", flexDirection: "column", gap: spacing[1], minWidth: 0, flex: 1 } }, /* @__PURE__ */ import_react17.default.createElement("p", { style: {
|
|
3079
3400
|
fontFamily: fonts.primary,
|
|
3080
3401
|
fontSize: fontSizes.xl,
|
|
3081
3402
|
fontWeight: fontWeights.semibold,
|
|
3082
3403
|
lineHeight: 1.3,
|
|
3083
3404
|
color: colors.evMutedBlue,
|
|
3084
3405
|
margin: 0
|
|
3085
|
-
} }, politician.full_name), /* @__PURE__ */
|
|
3406
|
+
} }, politician.full_name), /* @__PURE__ */ import_react17.default.createElement("p", { style: {
|
|
3086
3407
|
fontFamily: fonts.primary,
|
|
3087
3408
|
fontSize: fontSizes.sm,
|
|
3088
3409
|
fontWeight: fontWeights.semibold,
|
|
3089
3410
|
lineHeight: 1.4,
|
|
3090
3411
|
color: colors.textSecondary,
|
|
3091
3412
|
margin: 0
|
|
3092
|
-
} }, titleText || ""), politician.district_label && /* @__PURE__ */
|
|
3413
|
+
} }, titleText || ""), politician.district_label && /* @__PURE__ */ import_react17.default.createElement("p", { style: {
|
|
3093
3414
|
fontFamily: fonts.primary,
|
|
3094
3415
|
fontSize: fontSizes.sm,
|
|
3095
3416
|
fontWeight: fontWeights.regular,
|
|
@@ -3099,7 +3420,7 @@ function CompassCardVertical({
|
|
|
3099
3420
|
overflow: "hidden",
|
|
3100
3421
|
textOverflow: "ellipsis",
|
|
3101
3422
|
whiteSpace: "nowrap"
|
|
3102
|
-
} }, politician.district_label), /* @__PURE__ */
|
|
3423
|
+
} }, politician.district_label), /* @__PURE__ */ import_react17.default.createElement("div", { style: { marginTop: "auto" } }, /* @__PURE__ */ import_react17.default.createElement(
|
|
3103
3424
|
IconOverlay,
|
|
3104
3425
|
{
|
|
3105
3426
|
ballot: politician.ballot || null,
|
|
@@ -3107,7 +3428,7 @@ function CompassCardVertical({
|
|
|
3107
3428
|
branch: politician.branch || null
|
|
3108
3429
|
}
|
|
3109
3430
|
)))),
|
|
3110
|
-
surface === "elections" && politician.withdrawn && /* @__PURE__ */
|
|
3431
|
+
surface === "elections" && politician.withdrawn && /* @__PURE__ */ import_react17.default.createElement("div", { style: {
|
|
3111
3432
|
margin: `0 ${spacing[4]} ${spacing[3]}`,
|
|
3112
3433
|
backgroundColor: "rgba(120,0,0,0.85)",
|
|
3113
3434
|
color: "#fff",
|
|
@@ -3119,7 +3440,7 @@ function CompassCardVertical({
|
|
|
3119
3440
|
padding: "6px 0",
|
|
3120
3441
|
borderRadius: borderRadius.sm
|
|
3121
3442
|
} }, "Withdrawn"),
|
|
3122
|
-
surface === "elections" && !politician.withdrawn && politician.running_unopposed && /* @__PURE__ */
|
|
3443
|
+
surface === "elections" && !politician.withdrawn && politician.running_unopposed && /* @__PURE__ */ import_react17.default.createElement("div", { style: {
|
|
3123
3444
|
margin: `0 ${spacing[4]} ${spacing[3]}`,
|
|
3124
3445
|
backgroundColor: "rgba(0,0,0,0.75)",
|
|
3125
3446
|
color: "#fff",
|
|
@@ -3131,7 +3452,7 @@ function CompassCardVertical({
|
|
|
3131
3452
|
padding: "6px 0",
|
|
3132
3453
|
borderRadius: borderRadius.sm
|
|
3133
3454
|
} }, typeof politician.running_unopposed === "string" ? politician.running_unopposed : "Running Unopposed"),
|
|
3134
|
-
/* @__PURE__ */
|
|
3455
|
+
/* @__PURE__ */ import_react17.default.createElement("div", { style: {
|
|
3135
3456
|
flex: 1,
|
|
3136
3457
|
padding: spacing[4],
|
|
3137
3458
|
paddingTop: 0,
|
|
@@ -3145,7 +3466,7 @@ function CompassCardVertical({
|
|
|
3145
3466
|
}
|
|
3146
3467
|
|
|
3147
3468
|
// src/CompassKey.jsx
|
|
3148
|
-
var
|
|
3469
|
+
var import_react18 = __toESM(require("react"));
|
|
3149
3470
|
|
|
3150
3471
|
// src/evContext.js
|
|
3151
3472
|
var DEFAULT_BROKER_URL = "https://ev-context.empowered.vote/";
|
|
@@ -3390,9 +3711,9 @@ var evContext = {
|
|
|
3390
3711
|
|
|
3391
3712
|
// src/CompassKey.jsx
|
|
3392
3713
|
function CompassKey({ compact = false } = {}) {
|
|
3393
|
-
const [dismissed, setDismissed] = (0,
|
|
3394
|
-
const [loaded, setLoaded] = (0,
|
|
3395
|
-
(0,
|
|
3714
|
+
const [dismissed, setDismissed] = (0, import_react18.useState)(false);
|
|
3715
|
+
const [loaded, setLoaded] = (0, import_react18.useState)(false);
|
|
3716
|
+
(0, import_react18.useEffect)(() => {
|
|
3396
3717
|
let cancelled = false;
|
|
3397
3718
|
evContext.get().then((shared) => {
|
|
3398
3719
|
if (cancelled) return;
|
|
@@ -3422,16 +3743,16 @@ function CompassKey({ compact = false } = {}) {
|
|
|
3422
3743
|
persistDismissed(false);
|
|
3423
3744
|
}
|
|
3424
3745
|
if (!loaded) return null;
|
|
3425
|
-
const Swatch = ({ color, label }) => /* @__PURE__ */
|
|
3746
|
+
const Swatch = ({ color, label }) => /* @__PURE__ */ import_react18.default.createElement("span", { style: { display: "inline-flex", alignItems: "center", gap: spacing[1] } }, /* @__PURE__ */ import_react18.default.createElement("span", { style: {
|
|
3426
3747
|
display: "inline-block",
|
|
3427
3748
|
width: 16,
|
|
3428
3749
|
height: 16,
|
|
3429
3750
|
borderRadius: "50%",
|
|
3430
3751
|
background: color,
|
|
3431
3752
|
boxShadow: "0 0 0 1px rgba(0,0,0,0.08)"
|
|
3432
|
-
} }), /* @__PURE__ */
|
|
3753
|
+
} }), /* @__PURE__ */ import_react18.default.createElement("span", { style: { fontSize: fontSizes.xs, color: colors.textSecondary, fontFamily: fonts.primary } }, label));
|
|
3433
3754
|
if (dismissed) {
|
|
3434
|
-
return /* @__PURE__ */
|
|
3755
|
+
return /* @__PURE__ */ import_react18.default.createElement(
|
|
3435
3756
|
"button",
|
|
3436
3757
|
{
|
|
3437
3758
|
type: "button",
|
|
@@ -3452,11 +3773,11 @@ function CompassKey({ compact = false } = {}) {
|
|
|
3452
3773
|
cursor: "pointer"
|
|
3453
3774
|
}
|
|
3454
3775
|
},
|
|
3455
|
-
/* @__PURE__ */
|
|
3776
|
+
/* @__PURE__ */ import_react18.default.createElement("span", { "aria-hidden": "true" }, "?"),
|
|
3456
3777
|
" Compass key"
|
|
3457
3778
|
);
|
|
3458
3779
|
}
|
|
3459
|
-
return /* @__PURE__ */
|
|
3780
|
+
return /* @__PURE__ */ import_react18.default.createElement(
|
|
3460
3781
|
"div",
|
|
3461
3782
|
{
|
|
3462
3783
|
role: "region",
|
|
@@ -3475,17 +3796,17 @@ function CompassKey({ compact = false } = {}) {
|
|
|
3475
3796
|
boxSizing: "border-box"
|
|
3476
3797
|
}
|
|
3477
3798
|
},
|
|
3478
|
-
!compact && /* @__PURE__ */
|
|
3799
|
+
!compact && /* @__PURE__ */ import_react18.default.createElement("span", { style: {
|
|
3479
3800
|
fontSize: fontSizes.xs,
|
|
3480
3801
|
fontWeight: fontWeights.semibold,
|
|
3481
3802
|
color: colors.textMuted,
|
|
3482
3803
|
textTransform: "uppercase",
|
|
3483
3804
|
letterSpacing: "0.5px"
|
|
3484
3805
|
} }, "Compass key"),
|
|
3485
|
-
/* @__PURE__ */
|
|
3486
|
-
/* @__PURE__ */
|
|
3487
|
-
/* @__PURE__ */
|
|
3488
|
-
/* @__PURE__ */
|
|
3806
|
+
/* @__PURE__ */ import_react18.default.createElement(Swatch, { color: "#7C6B9E", label: "You" }),
|
|
3807
|
+
/* @__PURE__ */ import_react18.default.createElement(Swatch, { color: "#5A9A6E", label: "Politician" }),
|
|
3808
|
+
/* @__PURE__ */ import_react18.default.createElement(Swatch, { color: "#fed12e", label: "Match" }),
|
|
3809
|
+
/* @__PURE__ */ import_react18.default.createElement("span", { style: { display: "inline-flex", alignItems: "center", gap: spacing[1] } }, /* @__PURE__ */ import_react18.default.createElement("span", { style: {
|
|
3489
3810
|
fontSize: fontSizes.xs,
|
|
3490
3811
|
fontWeight: fontWeights.semibold,
|
|
3491
3812
|
color: "#9ca3af",
|
|
@@ -3493,8 +3814,8 @@ function CompassKey({ compact = false } = {}) {
|
|
|
3493
3814
|
textDecoration: "underline",
|
|
3494
3815
|
textDecorationStyle: "dashed",
|
|
3495
3816
|
textUnderlineOffset: "3px"
|
|
3496
|
-
} }, "Topic"), /* @__PURE__ */
|
|
3497
|
-
/* @__PURE__ */
|
|
3817
|
+
} }, "Topic"), /* @__PURE__ */ import_react18.default.createElement("span", { style: { fontSize: fontSizes.xs, color: colors.textSecondary, fontFamily: fonts.primary } }, "= no stance")),
|
|
3818
|
+
/* @__PURE__ */ import_react18.default.createElement(
|
|
3498
3819
|
"button",
|
|
3499
3820
|
{
|
|
3500
3821
|
type: "button",
|
|
@@ -3517,7 +3838,7 @@ function CompassKey({ compact = false } = {}) {
|
|
|
3517
3838
|
}
|
|
3518
3839
|
|
|
3519
3840
|
// src/CategorySection.jsx
|
|
3520
|
-
var
|
|
3841
|
+
var import_react19 = __toESM(require("react"));
|
|
3521
3842
|
function CategorySection({
|
|
3522
3843
|
title,
|
|
3523
3844
|
infoTooltip,
|
|
@@ -3527,7 +3848,7 @@ function CategorySection({
|
|
|
3527
3848
|
tier
|
|
3528
3849
|
}) {
|
|
3529
3850
|
var _a, _b;
|
|
3530
|
-
const [showTooltip, setShowTooltip] = (0,
|
|
3851
|
+
const [showTooltip, setShowTooltip] = (0, import_react19.useState)(false);
|
|
3531
3852
|
const tierStyle = tier ? tierColors[tier] : null;
|
|
3532
3853
|
const styles2 = {
|
|
3533
3854
|
section: {
|
|
@@ -3595,7 +3916,7 @@ function CategorySection({
|
|
|
3595
3916
|
gap: spacing[4]
|
|
3596
3917
|
}
|
|
3597
3918
|
};
|
|
3598
|
-
return /* @__PURE__ */
|
|
3919
|
+
return /* @__PURE__ */ import_react19.default.createElement("section", { style: styles2.section, className: "ev-category-section" }, /* @__PURE__ */ import_react19.default.createElement("div", { style: styles2.header }, /* @__PURE__ */ import_react19.default.createElement("span", { style: styles2.titlePill }, title), infoTooltip && /* @__PURE__ */ import_react19.default.createElement(
|
|
3599
3920
|
"button",
|
|
3600
3921
|
{
|
|
3601
3922
|
type: "button",
|
|
@@ -3607,8 +3928,8 @@ function CategorySection({
|
|
|
3607
3928
|
"aria-label": `Info about ${title}`
|
|
3608
3929
|
},
|
|
3609
3930
|
"i",
|
|
3610
|
-
showTooltip && /* @__PURE__ */
|
|
3611
|
-
), websiteUrl && /* @__PURE__ */
|
|
3931
|
+
showTooltip && /* @__PURE__ */ import_react19.default.createElement("div", { style: styles2.tooltip, role: "tooltip" }, infoTooltip)
|
|
3932
|
+
), websiteUrl && /* @__PURE__ */ import_react19.default.createElement(
|
|
3612
3933
|
"a",
|
|
3613
3934
|
{
|
|
3614
3935
|
href: websiteUrl,
|
|
@@ -3617,7 +3938,7 @@ function CategorySection({
|
|
|
3617
3938
|
style: styles2.externalLink,
|
|
3618
3939
|
"aria-label": `Visit official website for ${title}`
|
|
3619
3940
|
},
|
|
3620
|
-
/* @__PURE__ */
|
|
3941
|
+
/* @__PURE__ */ import_react19.default.createElement(
|
|
3621
3942
|
"svg",
|
|
3622
3943
|
{
|
|
3623
3944
|
viewBox: "0 0 24 24",
|
|
@@ -3625,7 +3946,7 @@ function CategorySection({
|
|
|
3625
3946
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3626
3947
|
style: { width: "14px", height: "14px" }
|
|
3627
3948
|
},
|
|
3628
|
-
/* @__PURE__ */
|
|
3949
|
+
/* @__PURE__ */ import_react19.default.createElement(
|
|
3629
3950
|
"path",
|
|
3630
3951
|
{
|
|
3631
3952
|
d: "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14",
|
|
@@ -3636,11 +3957,11 @@ function CategorySection({
|
|
|
3636
3957
|
}
|
|
3637
3958
|
)
|
|
3638
3959
|
)
|
|
3639
|
-
)), /* @__PURE__ */
|
|
3960
|
+
)), /* @__PURE__ */ import_react19.default.createElement("div", { style: styles2.grid, className: "ev-category-grid" }, children));
|
|
3640
3961
|
}
|
|
3641
3962
|
|
|
3642
3963
|
// src/SubGroupSection.jsx
|
|
3643
|
-
var
|
|
3964
|
+
var import_react20 = __toESM(require("react"));
|
|
3644
3965
|
function SubGroupSection({ title, websiteUrl, children, gridTemplateColumns, gap, justifyContent }) {
|
|
3645
3966
|
const styles2 = {
|
|
3646
3967
|
section: {
|
|
@@ -3675,7 +3996,7 @@ function SubGroupSection({ title, websiteUrl, children, gridTemplateColumns, gap
|
|
|
3675
3996
|
width: "100%"
|
|
3676
3997
|
}
|
|
3677
3998
|
};
|
|
3678
|
-
return /* @__PURE__ */
|
|
3999
|
+
return /* @__PURE__ */ import_react20.default.createElement("div", { style: styles2.section }, title && /* @__PURE__ */ import_react20.default.createElement("div", { style: styles2.header }, /* @__PURE__ */ import_react20.default.createElement("span", { style: styles2.label }, title), websiteUrl && /* @__PURE__ */ import_react20.default.createElement(
|
|
3679
4000
|
"a",
|
|
3680
4001
|
{
|
|
3681
4002
|
href: websiteUrl,
|
|
@@ -3683,12 +4004,12 @@ function SubGroupSection({ title, websiteUrl, children, gridTemplateColumns, gap
|
|
|
3683
4004
|
rel: "noopener noreferrer",
|
|
3684
4005
|
style: styles2.link
|
|
3685
4006
|
},
|
|
3686
|
-
/* @__PURE__ */
|
|
3687
|
-
)), /* @__PURE__ */
|
|
4007
|
+
/* @__PURE__ */ import_react20.default.createElement("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: { width: "12px", height: "12px" } }, /* @__PURE__ */ import_react20.default.createElement("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ import_react20.default.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" }))
|
|
4008
|
+
)), /* @__PURE__ */ import_react20.default.createElement("div", { style: styles2.grid, className: "ev-subgroup-grid" }, children));
|
|
3688
4009
|
}
|
|
3689
4010
|
|
|
3690
4011
|
// src/GovernmentBodySection.jsx
|
|
3691
|
-
var
|
|
4012
|
+
var import_react21 = __toESM(require("react"));
|
|
3692
4013
|
function GovernmentBodySection({
|
|
3693
4014
|
title,
|
|
3694
4015
|
websiteUrl,
|
|
@@ -3697,7 +4018,7 @@ function GovernmentBodySection({
|
|
|
3697
4018
|
children
|
|
3698
4019
|
}) {
|
|
3699
4020
|
var _a;
|
|
3700
|
-
const [expanded, setExpanded] = (0,
|
|
4021
|
+
const [expanded, setExpanded] = (0, import_react21.useState)(defaultExpanded);
|
|
3701
4022
|
const tierStyle = tier ? tierColors[tier] : null;
|
|
3702
4023
|
const accentColor = (_a = tierStyle == null ? void 0 : tierStyle.accent) != null ? _a : colors.borderMedium;
|
|
3703
4024
|
const styles2 = {
|
|
@@ -3737,7 +4058,7 @@ function GovernmentBodySection({
|
|
|
3737
4058
|
display: expanded ? "block" : "none"
|
|
3738
4059
|
}
|
|
3739
4060
|
};
|
|
3740
|
-
return /* @__PURE__ */
|
|
4061
|
+
return /* @__PURE__ */ import_react21.default.createElement("section", { style: styles2.section, className: "ev-gov-body-section" }, /* @__PURE__ */ import_react21.default.createElement(
|
|
3741
4062
|
"div",
|
|
3742
4063
|
{
|
|
3743
4064
|
style: styles2.header,
|
|
@@ -3753,8 +4074,8 @@ function GovernmentBodySection({
|
|
|
3753
4074
|
"aria-expanded": expanded,
|
|
3754
4075
|
"aria-label": `${expanded ? "Collapse" : "Expand"} ${title}`
|
|
3755
4076
|
},
|
|
3756
|
-
/* @__PURE__ */
|
|
3757
|
-
websiteUrl && /* @__PURE__ */
|
|
4077
|
+
/* @__PURE__ */ import_react21.default.createElement("span", { style: styles2.title }, title),
|
|
4078
|
+
websiteUrl && /* @__PURE__ */ import_react21.default.createElement(
|
|
3758
4079
|
"a",
|
|
3759
4080
|
{
|
|
3760
4081
|
href: websiteUrl,
|
|
@@ -3764,14 +4085,14 @@ function GovernmentBodySection({
|
|
|
3764
4085
|
onClick: (e) => e.stopPropagation(),
|
|
3765
4086
|
"aria-label": `Visit ${title} website`
|
|
3766
4087
|
},
|
|
3767
|
-
/* @__PURE__ */
|
|
4088
|
+
/* @__PURE__ */ import_react21.default.createElement("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: { width: "14px", height: "14px" } }, /* @__PURE__ */ import_react21.default.createElement("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ import_react21.default.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" }))
|
|
3768
4089
|
),
|
|
3769
|
-
/* @__PURE__ */
|
|
3770
|
-
), /* @__PURE__ */
|
|
4090
|
+
/* @__PURE__ */ import_react21.default.createElement("span", { style: styles2.toggle, "aria-hidden": "true" }, "\u25BC")
|
|
4091
|
+
), /* @__PURE__ */ import_react21.default.createElement("div", { style: styles2.content }, children));
|
|
3771
4092
|
}
|
|
3772
4093
|
|
|
3773
4094
|
// src/SocialLinks.jsx
|
|
3774
|
-
var
|
|
4095
|
+
var import_react22 = __toESM(require("react"));
|
|
3775
4096
|
var SOCIAL_PLATFORMS = [
|
|
3776
4097
|
{ test: /facebook\.com/i, platform: "facebook" },
|
|
3777
4098
|
{ test: /twitter\.com|x\.com/i, platform: "twitter" },
|
|
@@ -3843,7 +4164,7 @@ function SocialLinks({
|
|
|
3843
4164
|
}
|
|
3844
4165
|
};
|
|
3845
4166
|
const platformIconMap = {
|
|
3846
|
-
twitter: /* @__PURE__ */
|
|
4167
|
+
twitter: /* @__PURE__ */ import_react22.default.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react22.default.createElement(
|
|
3847
4168
|
"path",
|
|
3848
4169
|
{
|
|
3849
4170
|
d: "M4 4L10.5 12.5M20 20L13.5 11.5M10.5 12.5L4 20H8L13.5 11.5M10.5 12.5L16 4H20L13.5 11.5",
|
|
@@ -3853,7 +4174,7 @@ function SocialLinks({
|
|
|
3853
4174
|
strokeLinejoin: "round"
|
|
3854
4175
|
}
|
|
3855
4176
|
)),
|
|
3856
|
-
facebook: /* @__PURE__ */
|
|
4177
|
+
facebook: /* @__PURE__ */ import_react22.default.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react22.default.createElement(
|
|
3857
4178
|
"path",
|
|
3858
4179
|
{
|
|
3859
4180
|
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",
|
|
@@ -3863,8 +4184,8 @@ function SocialLinks({
|
|
|
3863
4184
|
strokeLinejoin: "round"
|
|
3864
4185
|
}
|
|
3865
4186
|
)),
|
|
3866
|
-
instagram: /* @__PURE__ */
|
|
3867
|
-
linkedin: /* @__PURE__ */
|
|
4187
|
+
instagram: /* @__PURE__ */ import_react22.default.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react22.default.createElement("rect", { x: "2", y: "2", width: "20", height: "20", rx: "5", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ import_react22.default.createElement("circle", { cx: "12", cy: "12", r: "4", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ import_react22.default.createElement("circle", { cx: "18", cy: "6", r: "1", fill: "currentColor" })),
|
|
4188
|
+
linkedin: /* @__PURE__ */ import_react22.default.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react22.default.createElement(
|
|
3868
4189
|
"path",
|
|
3869
4190
|
{
|
|
3870
4191
|
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",
|
|
@@ -3873,8 +4194,8 @@ function SocialLinks({
|
|
|
3873
4194
|
strokeLinecap: "round",
|
|
3874
4195
|
strokeLinejoin: "round"
|
|
3875
4196
|
}
|
|
3876
|
-
), /* @__PURE__ */
|
|
3877
|
-
youtube: /* @__PURE__ */
|
|
4197
|
+
), /* @__PURE__ */ import_react22.default.createElement("rect", { x: "2", y: "9", width: "4", height: "12", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ import_react22.default.createElement("circle", { cx: "4", cy: "4", r: "2", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })),
|
|
4198
|
+
youtube: /* @__PURE__ */ import_react22.default.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react22.default.createElement("rect", { x: "2", y: "5", width: "20", height: "14", rx: "3", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ import_react22.default.createElement("polygon", { points: "10,9 16,12 10,15", fill: "currentColor" }))
|
|
3878
4199
|
};
|
|
3879
4200
|
const links = [
|
|
3880
4201
|
{
|
|
@@ -3900,7 +4221,7 @@ function SocialLinks({
|
|
|
3900
4221
|
{
|
|
3901
4222
|
href: website,
|
|
3902
4223
|
label: "Website",
|
|
3903
|
-
icon: /* @__PURE__ */
|
|
4224
|
+
icon: /* @__PURE__ */ import_react22.default.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react22.default.createElement("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ import_react22.default.createElement(
|
|
3904
4225
|
"path",
|
|
3905
4226
|
{
|
|
3906
4227
|
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",
|
|
@@ -3930,7 +4251,7 @@ function SocialLinks({
|
|
|
3930
4251
|
if (links.length === 0) {
|
|
3931
4252
|
return null;
|
|
3932
4253
|
}
|
|
3933
|
-
return /* @__PURE__ */
|
|
4254
|
+
return /* @__PURE__ */ import_react22.default.createElement("div", { style: styles2.container, className: "ev-social-links" }, links.map((link) => /* @__PURE__ */ import_react22.default.createElement(
|
|
3934
4255
|
"a",
|
|
3935
4256
|
{
|
|
3936
4257
|
key: link.label,
|
|
@@ -3953,7 +4274,7 @@ function SocialLinks({
|
|
|
3953
4274
|
}
|
|
3954
4275
|
|
|
3955
4276
|
// src/IssueTags.jsx
|
|
3956
|
-
var
|
|
4277
|
+
var import_react23 = __toESM(require("react"));
|
|
3957
4278
|
function IssueTags({
|
|
3958
4279
|
tags = [],
|
|
3959
4280
|
selectedTags = [],
|
|
@@ -3996,9 +4317,9 @@ function IssueTags({
|
|
|
3996
4317
|
onTagClick(tag.value);
|
|
3997
4318
|
}
|
|
3998
4319
|
};
|
|
3999
|
-
return /* @__PURE__ */
|
|
4320
|
+
return /* @__PURE__ */ import_react23.default.createElement("div", { style: styles2.container, className: "ev-issue-tags", role: "list" }, tags.map((tag) => {
|
|
4000
4321
|
const isSelected = selectedTags.includes(tag.value);
|
|
4001
|
-
return /* @__PURE__ */
|
|
4322
|
+
return /* @__PURE__ */ import_react23.default.createElement(
|
|
4002
4323
|
"span",
|
|
4003
4324
|
{
|
|
4004
4325
|
key: tag.value,
|
|
@@ -4027,7 +4348,7 @@ function IssueTags({
|
|
|
4027
4348
|
}
|
|
4028
4349
|
|
|
4029
4350
|
// src/CommitteeTable.jsx
|
|
4030
|
-
var
|
|
4351
|
+
var import_react24 = __toESM(require("react"));
|
|
4031
4352
|
var ROLE_ORDER = {
|
|
4032
4353
|
"chair": 0,
|
|
4033
4354
|
"co-chair": 1,
|
|
@@ -4054,7 +4375,7 @@ function CommitteeTable({
|
|
|
4054
4375
|
maxVisible = 6,
|
|
4055
4376
|
style = {}
|
|
4056
4377
|
}) {
|
|
4057
|
-
const [showAll, setShowAll] = (0,
|
|
4378
|
+
const [showAll, setShowAll] = (0, import_react24.useState)(false);
|
|
4058
4379
|
if (committees.length === 0) {
|
|
4059
4380
|
return null;
|
|
4060
4381
|
}
|
|
@@ -4116,7 +4437,7 @@ function CommitteeTable({
|
|
|
4116
4437
|
cursor: "pointer"
|
|
4117
4438
|
}
|
|
4118
4439
|
};
|
|
4119
|
-
return /* @__PURE__ */
|
|
4440
|
+
return /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.container, className: "ev-committee-table" }, /* @__PURE__ */ import_react24.default.createElement("h4", { style: styles2.heading }, /* @__PURE__ */ import_react24.default.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react24.default.createElement("path", { d: "M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2" }), /* @__PURE__ */ import_react24.default.createElement("circle", { cx: "9", cy: "7", r: "4" }), /* @__PURE__ */ import_react24.default.createElement("path", { d: "M23 21v-2a4 4 0 00-3-3.87M16 3.13a4 4 0 010 7.75" })), title), /* @__PURE__ */ import_react24.default.createElement("table", { style: styles2.table }, /* @__PURE__ */ import_react24.default.createElement("tbody", null, visible.map((committee, index) => /* @__PURE__ */ import_react24.default.createElement("tr", { key: index, style: styles2.row }, /* @__PURE__ */ import_react24.default.createElement("td", { style: { ...styles2.cell, ...styles2.nameCell } }, committee.url ? /* @__PURE__ */ import_react24.default.createElement(
|
|
4120
4441
|
"a",
|
|
4121
4442
|
{
|
|
4122
4443
|
href: committee.url,
|
|
@@ -4131,7 +4452,7 @@ function CommitteeTable({
|
|
|
4131
4452
|
}
|
|
4132
4453
|
},
|
|
4133
4454
|
committee.name
|
|
4134
|
-
) : committee.name), /* @__PURE__ */
|
|
4455
|
+
) : committee.name), /* @__PURE__ */ import_react24.default.createElement("td", { style: { ...styles2.cell, ...styles2.positionCell } }, formatPosition(committee.position)))))), hasMore && /* @__PURE__ */ import_react24.default.createElement(
|
|
4135
4456
|
"button",
|
|
4136
4457
|
{
|
|
4137
4458
|
type: "button",
|
|
@@ -4139,7 +4460,7 @@ function CommitteeTable({
|
|
|
4139
4460
|
onClick: () => setShowAll(!showAll)
|
|
4140
4461
|
},
|
|
4141
4462
|
showAll ? "Show less" : `Show all ${sorted.length} committees`,
|
|
4142
|
-
/* @__PURE__ */
|
|
4463
|
+
/* @__PURE__ */ import_react24.default.createElement(
|
|
4143
4464
|
"svg",
|
|
4144
4465
|
{
|
|
4145
4466
|
width: "14",
|
|
@@ -4152,16 +4473,16 @@ function CommitteeTable({
|
|
|
4152
4473
|
strokeLinejoin: "round",
|
|
4153
4474
|
style: { transform: showAll ? "rotate(180deg)" : "none", transition: "transform 0.2s" }
|
|
4154
4475
|
},
|
|
4155
|
-
/* @__PURE__ */
|
|
4476
|
+
/* @__PURE__ */ import_react24.default.createElement("polyline", { points: "6 9 12 15 18 9" })
|
|
4156
4477
|
)
|
|
4157
4478
|
));
|
|
4158
4479
|
}
|
|
4159
4480
|
|
|
4160
4481
|
// src/PoliticianProfile.jsx
|
|
4161
|
-
var
|
|
4482
|
+
var import_react27 = __toESM(require("react"));
|
|
4162
4483
|
|
|
4163
4484
|
// src/LegislativeInlineSummary.jsx
|
|
4164
|
-
var
|
|
4485
|
+
var import_react25 = __toESM(require("react"));
|
|
4165
4486
|
function normalizePosition(pos) {
|
|
4166
4487
|
if (!pos) return "";
|
|
4167
4488
|
return pos.replace(/_/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
@@ -4269,7 +4590,7 @@ function LegislativeInlineSummary({ summary, politicianId, onNavigateToRecord })
|
|
|
4269
4590
|
fontSize: fontSizes.sm,
|
|
4270
4591
|
fontWeight: fontWeights.medium
|
|
4271
4592
|
};
|
|
4272
|
-
return /* @__PURE__ */
|
|
4593
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", { style: card }, stats.length > 0 && /* @__PURE__ */ import_react25.default.createElement("div", { style: statsRow }, stats.map((s, i) => /* @__PURE__ */ import_react25.default.createElement("div", { key: i, style: statItem }, /* @__PURE__ */ import_react25.default.createElement("span", { style: statValue }, s.value), s.label && /* @__PURE__ */ import_react25.default.createElement("span", { style: statLabel }, s.label)))), mostRecentAction && /* @__PURE__ */ import_react25.default.createElement("div", { style: actionLine, title: mostRecentAction }, mostRecentAction), /* @__PURE__ */ import_react25.default.createElement("div", null), /* @__PURE__ */ import_react25.default.createElement("div", { style: footerRow }, /* @__PURE__ */ import_react25.default.createElement(
|
|
4273
4594
|
"button",
|
|
4274
4595
|
{
|
|
4275
4596
|
onClick: () => {
|
|
@@ -4294,12 +4615,12 @@ function LegislativeInlineSummary({ summary, politicianId, onNavigateToRecord })
|
|
|
4294
4615
|
}
|
|
4295
4616
|
},
|
|
4296
4617
|
"View Full Legislative Record",
|
|
4297
|
-
/* @__PURE__ */
|
|
4618
|
+
/* @__PURE__ */ import_react25.default.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__ */ import_react25.default.createElement("path", { d: "M9 18l6-6-6-6" }))
|
|
4298
4619
|
)));
|
|
4299
4620
|
}
|
|
4300
4621
|
|
|
4301
4622
|
// src/JudicialScorecard.jsx
|
|
4302
|
-
var
|
|
4623
|
+
var import_react26 = __toESM(require("react"));
|
|
4303
4624
|
|
|
4304
4625
|
// src/judicialUtils.js
|
|
4305
4626
|
function formatDate(dateStr) {
|
|
@@ -4417,7 +4738,7 @@ function JudicialScorecard({ judicialRecord, politicianId, onNavigateToRecord })
|
|
|
4417
4738
|
onNavigateToRecord(`/politician/${politicianId}/judicial-record`);
|
|
4418
4739
|
}
|
|
4419
4740
|
};
|
|
4420
|
-
return /* @__PURE__ */
|
|
4741
|
+
return /* @__PURE__ */ import_react26.default.createElement("section", { style: sectionStyle }, /* @__PURE__ */ import_react26.default.createElement("h3", { style: headingStyle }, "Judicial Record"), evaluations.length > 0 && /* @__PURE__ */ import_react26.default.createElement("div", { style: { marginBottom: "16px" } }, evaluations.slice(0, 3).map((ev, i) => /* @__PURE__ */ import_react26.default.createElement("span", { key: i, style: evalChipStyle }, ev.rating, /* @__PURE__ */ import_react26.default.createElement("span", { style: { fontWeight: 400, color: "#4a90a4", fontSize: "11px" } }, "\u2014 ", ev.source)))), metrics.length > 0 && /* @__PURE__ */ import_react26.default.createElement("div", { style: cardGridStyle }, metrics.slice(0, 4).map((m, i) => /* @__PURE__ */ import_react26.default.createElement("div", { key: i, style: metricCardStyle }, /* @__PURE__ */ import_react26.default.createElement("div", { style: metricLabelStyle }, METRIC_LABELS[m.metric_type] || m.metric_type.replace(/_/g, " ")), /* @__PURE__ */ import_react26.default.createElement("div", { style: metricValueStyle }, formatMetricValue(m.metric_type, m.value)), m.context_label && /* @__PURE__ */ import_react26.default.createElement("div", { style: metricContextStyle }, m.context_label)))), disciplinary.length > 0 && /* @__PURE__ */ import_react26.default.createElement("div", { style: { marginBottom: "12px" } }, disciplinary.slice(0, 2).map((d, i) => /* @__PURE__ */ import_react26.default.createElement("div", { key: i, style: disciplinaryStyle }, /* @__PURE__ */ import_react26.default.createElement("strong", null, d.record_type), " \u2014 ", formatDate(d.record_date), d.description && /* @__PURE__ */ import_react26.default.createElement("div", { style: { marginTop: "4px" } }, d.description)))), /* @__PURE__ */ import_react26.default.createElement("a", { href: `/politician/${politicianId}/judicial-record`, onClick: handleNavigate, style: linkStyle }, "View Full Judicial Record \u2192"));
|
|
4421
4742
|
}
|
|
4422
4743
|
|
|
4423
4744
|
// src/PoliticianProfile.jsx
|
|
@@ -4593,13 +4914,13 @@ function formatAddress(addr) {
|
|
|
4593
4914
|
if (cityStateZip) lines.push(cityStateZip);
|
|
4594
4915
|
return lines;
|
|
4595
4916
|
}
|
|
4596
|
-
var CalendarIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
4597
|
-
var ClockIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
4598
|
-
var MapPinIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
4599
|
-
var PhoneIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
4600
|
-
var MailIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
4601
|
-
var GlobeIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
4602
|
-
var ExternalLinkIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
4917
|
+
var CalendarIcon = ({ size = 16 }) => /* @__PURE__ */ import_react27.default.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react27.default.createElement("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }), /* @__PURE__ */ import_react27.default.createElement("line", { x1: "16", y1: "2", x2: "16", y2: "6" }), /* @__PURE__ */ import_react27.default.createElement("line", { x1: "8", y1: "2", x2: "8", y2: "6" }), /* @__PURE__ */ import_react27.default.createElement("line", { x1: "3", y1: "10", x2: "21", y2: "10" }));
|
|
4918
|
+
var ClockIcon = ({ size = 16 }) => /* @__PURE__ */ import_react27.default.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react27.default.createElement("circle", { cx: "12", cy: "12", r: "10" }), /* @__PURE__ */ import_react27.default.createElement("polyline", { points: "12 6 12 12 16 14" }));
|
|
4919
|
+
var MapPinIcon = ({ size = 16 }) => /* @__PURE__ */ import_react27.default.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react27.default.createElement("path", { d: "M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0118 0z" }), /* @__PURE__ */ import_react27.default.createElement("circle", { cx: "12", cy: "10", r: "3" }));
|
|
4920
|
+
var PhoneIcon = ({ size = 16 }) => /* @__PURE__ */ import_react27.default.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react27.default.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" }));
|
|
4921
|
+
var MailIcon = ({ size = 16 }) => /* @__PURE__ */ import_react27.default.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react27.default.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__ */ import_react27.default.createElement("path", { d: "M22 6L12 13L2 6" }));
|
|
4922
|
+
var GlobeIcon = ({ size = 16 }) => /* @__PURE__ */ import_react27.default.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react27.default.createElement("circle", { cx: "12", cy: "12", r: "10" }), /* @__PURE__ */ import_react27.default.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" }));
|
|
4923
|
+
var ExternalLinkIcon = ({ size = 16 }) => /* @__PURE__ */ import_react27.default.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react27.default.createElement("path", { d: "M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6" }), /* @__PURE__ */ import_react27.default.createElement("polyline", { points: "15 3 21 3 21 9" }), /* @__PURE__ */ import_react27.default.createElement("line", { x1: "10", y1: "14", x2: "21", y2: "3" }));
|
|
4603
4924
|
function PoliticianProfile({
|
|
4604
4925
|
politician = {},
|
|
4605
4926
|
onBack,
|
|
@@ -4627,8 +4948,8 @@ function PoliticianProfile({
|
|
|
4627
4948
|
return pol.photo_origin_url;
|
|
4628
4949
|
})();
|
|
4629
4950
|
const initials = [pol.first_name, pol.last_name].filter(Boolean).map((n) => n[0]).join("");
|
|
4630
|
-
const [imgError, setImgError] = (0,
|
|
4631
|
-
(0,
|
|
4951
|
+
const [imgError, setImgError] = (0, import_react27.useState)(false);
|
|
4952
|
+
(0, import_react27.useEffect)(() => {
|
|
4632
4953
|
setImgError(false);
|
|
4633
4954
|
}, [profileImageUrl]);
|
|
4634
4955
|
const getSocialHandle = (type) => {
|
|
@@ -4928,7 +5249,7 @@ function PoliticianProfile({
|
|
|
4928
5249
|
borderRadius: borderRadius.full
|
|
4929
5250
|
}
|
|
4930
5251
|
};
|
|
4931
|
-
return /* @__PURE__ */
|
|
5252
|
+
return /* @__PURE__ */ import_react27.default.createElement("div", { style: styles2.container, className: "ev-politician-profile" }, onBack && /* @__PURE__ */ import_react27.default.createElement(
|
|
4932
5253
|
"button",
|
|
4933
5254
|
{
|
|
4934
5255
|
type: "button",
|
|
@@ -4941,9 +5262,9 @@ function PoliticianProfile({
|
|
|
4941
5262
|
e.currentTarget.style.textDecoration = "none";
|
|
4942
5263
|
}
|
|
4943
5264
|
},
|
|
4944
|
-
/* @__PURE__ */
|
|
5265
|
+
/* @__PURE__ */ import_react27.default.createElement("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react27.default.createElement("path", { d: "M15 19l-7-7 7-7" })),
|
|
4945
5266
|
label
|
|
4946
|
-
), /* @__PURE__ */
|
|
5267
|
+
), /* @__PURE__ */ import_react27.default.createElement("div", { style: styles2.card }, /* @__PURE__ */ import_react27.default.createElement("div", { style: styles2.heroRow }, /* @__PURE__ */ import_react27.default.createElement("div", { style: styles2.photoWrap }, profileImageUrl && !imgError ? /* @__PURE__ */ import_react27.default.createElement(
|
|
4947
5268
|
"img",
|
|
4948
5269
|
{
|
|
4949
5270
|
src: profileImageUrl,
|
|
@@ -4951,7 +5272,7 @@ function PoliticianProfile({
|
|
|
4951
5272
|
style: styles2.photo,
|
|
4952
5273
|
onError: () => setImgError(true)
|
|
4953
5274
|
}
|
|
4954
|
-
) : /* @__PURE__ */
|
|
5275
|
+
) : /* @__PURE__ */ import_react27.default.createElement("div", { style: styles2.placeholder }, initials || "?")), /* @__PURE__ */ import_react27.default.createElement("div", { style: styles2.infoCol }, styles2.tierBadge && /* @__PURE__ */ import_react27.default.createElement("div", { style: styles2.tierBadge }, tier), /* @__PURE__ */ import_react27.default.createElement("h1", { style: styles2.name }, displayName), banner, /* @__PURE__ */ import_react27.default.createElement("p", { style: styles2.roleLine }, roleLine), pol.office_description && /* @__PURE__ */ import_react27.default.createElement("p", { style: styles2.officeDesc }, pol.office_description), pol.bio_text && /* @__PURE__ */ import_react27.default.createElement("p", { style: styles2.bioText }, pol.bio_text), (termLine || pol.total_years_in_office > 0) && /* @__PURE__ */ import_react27.default.createElement("div", { style: styles2.metaRow }, termLine && /* @__PURE__ */ import_react27.default.createElement("span", { style: styles2.metaItem }, /* @__PURE__ */ import_react27.default.createElement(CalendarIcon, { size: 14 }), termLine), pol.total_years_in_office > 0 && /* @__PURE__ */ import_react27.default.createElement("span", { style: styles2.metaItem }, /* @__PURE__ */ import_react27.default.createElement(ClockIcon, { size: 14 }), pol.total_years_in_office, " ", pol.total_years_in_office === 1 ? "year" : "years", " in office")), pol.web_form_url && /* @__PURE__ */ import_react27.default.createElement(
|
|
4955
5276
|
"a",
|
|
4956
5277
|
{
|
|
4957
5278
|
href: pol.web_form_url,
|
|
@@ -4965,9 +5286,9 @@ function PoliticianProfile({
|
|
|
4965
5286
|
e.currentTarget.style.background = colors.evTeal;
|
|
4966
5287
|
}
|
|
4967
5288
|
},
|
|
4968
|
-
/* @__PURE__ */
|
|
5289
|
+
/* @__PURE__ */ import_react27.default.createElement(ExternalLinkIcon, { size: 14 }),
|
|
4969
5290
|
"Submit a Message"
|
|
4970
|
-
))), hasContactInfo && /* @__PURE__ */
|
|
5291
|
+
))), hasContactInfo && /* @__PURE__ */ import_react27.default.createElement(import_react27.default.Fragment, null, /* @__PURE__ */ import_react27.default.createElement("div", { style: divider }), /* @__PURE__ */ import_react27.default.createElement("div", { style: sectionHeading }, /* @__PURE__ */ import_react27.default.createElement(MailIcon, { size: 20 }), "Contact Information"), /* @__PURE__ */ import_react27.default.createElement("div", { style: styles2.contactGrid }, hasAddresses && /* @__PURE__ */ import_react27.default.createElement("div", { style: styles2.contactGroup }, /* @__PURE__ */ import_react27.default.createElement("p", { style: styles2.contactLabel }, /* @__PURE__ */ import_react27.default.createElement(MapPinIcon, { size: 12 }), "Addresses"), addresses.map((addr, i) => /* @__PURE__ */ import_react27.default.createElement("div", { key: `addr-${i}` }, /* @__PURE__ */ import_react27.default.createElement("p", { style: { ...styles2.contactSubLabel, ...i === 0 ? { marginTop: 0 } : { marginTop: spacing[2] } } }, addr.type), /* @__PURE__ */ import_react27.default.createElement("p", { style: styles2.contactValue }, addr.lines.map((line, j) => /* @__PURE__ */ import_react27.default.createElement(import_react27.default.Fragment, { key: j }, line, j < addr.lines.length - 1 && /* @__PURE__ */ import_react27.default.createElement("br", null))))))), hasPhones && /* @__PURE__ */ import_react27.default.createElement("div", { style: styles2.contactGroup }, /* @__PURE__ */ import_react27.default.createElement("p", { style: styles2.contactLabel }, /* @__PURE__ */ import_react27.default.createElement(PhoneIcon, { size: 12 }), "Phone"), Object.entries(phonesByType).map(([type, phones], i) => /* @__PURE__ */ import_react27.default.createElement("div", { key: `phone-${type}` }, /* @__PURE__ */ import_react27.default.createElement("p", { style: { ...styles2.contactSubLabel, ...i === 0 ? { marginTop: 0 } : { marginTop: spacing[2] } } }, type), phones.map((phone, j) => /* @__PURE__ */ import_react27.default.createElement("p", { key: j, style: styles2.contactValue }, /* @__PURE__ */ import_react27.default.createElement(
|
|
4971
5292
|
"a",
|
|
4972
5293
|
{
|
|
4973
5294
|
href: `tel:${phone}`,
|
|
@@ -4980,7 +5301,7 @@ function PoliticianProfile({
|
|
|
4980
5301
|
}
|
|
4981
5302
|
},
|
|
4982
5303
|
phone
|
|
4983
|
-
)))))), hasEmails && /* @__PURE__ */
|
|
5304
|
+
)))))), hasEmails && /* @__PURE__ */ import_react27.default.createElement("div", { style: styles2.contactGroup }, /* @__PURE__ */ import_react27.default.createElement("p", { style: styles2.contactLabel }, /* @__PURE__ */ import_react27.default.createElement(MailIcon, { size: 12 }), "Email"), Object.entries(emailsByType).filter(([, emails]) => emails.some((e) => e && e.trim())).map(([type, emails], i) => /* @__PURE__ */ import_react27.default.createElement("div", { key: `email-${type}` }, /* @__PURE__ */ import_react27.default.createElement("p", { style: { ...styles2.contactSubLabel, ...i === 0 ? { marginTop: 0 } : { marginTop: spacing[2] } } }, type), emails.filter((e) => e && e.trim()).map((email, j) => /* @__PURE__ */ import_react27.default.createElement("p", { key: j, style: styles2.contactValue }, /* @__PURE__ */ import_react27.default.createElement(
|
|
4984
5305
|
"a",
|
|
4985
5306
|
{
|
|
4986
5307
|
href: `mailto:${email}`,
|
|
@@ -4993,7 +5314,7 @@ function PoliticianProfile({
|
|
|
4993
5314
|
}
|
|
4994
5315
|
},
|
|
4995
5316
|
email
|
|
4996
|
-
)))))), hasWebsitesCol && /* @__PURE__ */
|
|
5317
|
+
)))))), hasWebsitesCol && /* @__PURE__ */ import_react27.default.createElement("div", { style: styles2.contactGroup }, /* @__PURE__ */ import_react27.default.createElement("p", { style: styles2.contactLabel }, /* @__PURE__ */ import_react27.default.createElement(GlobeIcon, { size: 12 }), "Websites"), allWebsites.map((url, i) => /* @__PURE__ */ import_react27.default.createElement("p", { key: i, style: styles2.contactValue }, /* @__PURE__ */ import_react27.default.createElement(
|
|
4997
5318
|
"a",
|
|
4998
5319
|
{
|
|
4999
5320
|
href: url,
|
|
@@ -5008,7 +5329,7 @@ function PoliticianProfile({
|
|
|
5008
5329
|
}
|
|
5009
5330
|
},
|
|
5010
5331
|
extractDomain(url)
|
|
5011
|
-
))), (hasSocial || socialWebsiteUrls.length > 0) && /* @__PURE__ */
|
|
5332
|
+
))), (hasSocial || socialWebsiteUrls.length > 0) && /* @__PURE__ */ import_react27.default.createElement(
|
|
5012
5333
|
SocialLinks,
|
|
5013
5334
|
{
|
|
5014
5335
|
twitter,
|
|
@@ -5020,14 +5341,14 @@ function PoliticianProfile({
|
|
|
5020
5341
|
darkMode,
|
|
5021
5342
|
style: { marginTop: allWebsites.length > 0 ? "8px" : 0 }
|
|
5022
5343
|
}
|
|
5023
|
-
)))), committees.length > 0 && /* @__PURE__ */
|
|
5344
|
+
)))), committees.length > 0 && /* @__PURE__ */ import_react27.default.createElement(import_react27.default.Fragment, null, /* @__PURE__ */ import_react27.default.createElement("div", { style: divider }), /* @__PURE__ */ import_react27.default.createElement(CommitteeTable, { committees })), pol.is_judicial ? /* @__PURE__ */ import_react27.default.createElement(
|
|
5024
5345
|
JudicialScorecard,
|
|
5025
5346
|
{
|
|
5026
5347
|
judicialRecord,
|
|
5027
5348
|
politicianId,
|
|
5028
5349
|
onNavigateToRecord
|
|
5029
5350
|
}
|
|
5030
|
-
) : /* @__PURE__ */
|
|
5351
|
+
) : /* @__PURE__ */ import_react27.default.createElement(
|
|
5031
5352
|
LegislativeInlineSummary,
|
|
5032
5353
|
{
|
|
5033
5354
|
summary: legislativeSummary,
|
|
@@ -5038,7 +5359,7 @@ function PoliticianProfile({
|
|
|
5038
5359
|
}
|
|
5039
5360
|
|
|
5040
5361
|
// src/LegislativeRecord.jsx
|
|
5041
|
-
var
|
|
5362
|
+
var import_react28 = __toESM(require("react"));
|
|
5042
5363
|
var DEFAULT_LIMIT = 25;
|
|
5043
5364
|
function normalizeText(str) {
|
|
5044
5365
|
if (!str) return "";
|
|
@@ -5118,7 +5439,7 @@ function getPositionBadge(position) {
|
|
|
5118
5439
|
return { bg: colors.borderLight, text: colors.textSecondary };
|
|
5119
5440
|
}
|
|
5120
5441
|
function Badge({ label, bg, text }) {
|
|
5121
|
-
return /* @__PURE__ */
|
|
5442
|
+
return /* @__PURE__ */ import_react28.default.createElement("span", { style: {
|
|
5122
5443
|
display: "inline-block",
|
|
5123
5444
|
background: bg,
|
|
5124
5445
|
color: text,
|
|
@@ -5131,18 +5452,18 @@ function Badge({ label, bg, text }) {
|
|
|
5131
5452
|
} }, label);
|
|
5132
5453
|
}
|
|
5133
5454
|
function SectionHeader({ title, yearFilter, years, onYearChange }) {
|
|
5134
|
-
return /* @__PURE__ */
|
|
5455
|
+
return /* @__PURE__ */ import_react28.default.createElement("div", { style: {
|
|
5135
5456
|
display: "flex",
|
|
5136
5457
|
alignItems: "center",
|
|
5137
5458
|
justifyContent: "space-between",
|
|
5138
5459
|
marginBottom: spacing[4]
|
|
5139
|
-
} }, /* @__PURE__ */
|
|
5460
|
+
} }, /* @__PURE__ */ import_react28.default.createElement("h2", { style: {
|
|
5140
5461
|
fontFamily: fonts.primary,
|
|
5141
5462
|
fontSize: fontSizes.xl,
|
|
5142
5463
|
fontWeight: fontWeights.bold,
|
|
5143
5464
|
color: colors.evTeal,
|
|
5144
5465
|
margin: 0
|
|
5145
|
-
} }, title), years && years.length > 0 && /* @__PURE__ */
|
|
5466
|
+
} }, title), years && years.length > 0 && /* @__PURE__ */ import_react28.default.createElement(
|
|
5146
5467
|
"select",
|
|
5147
5468
|
{
|
|
5148
5469
|
value: yearFilter,
|
|
@@ -5158,13 +5479,13 @@ function SectionHeader({ title, yearFilter, years, onYearChange }) {
|
|
|
5158
5479
|
cursor: "pointer"
|
|
5159
5480
|
}
|
|
5160
5481
|
},
|
|
5161
|
-
/* @__PURE__ */
|
|
5162
|
-
years.map((y) => /* @__PURE__ */
|
|
5482
|
+
/* @__PURE__ */ import_react28.default.createElement("option", { value: "All" }, "All years"),
|
|
5483
|
+
years.map((y) => /* @__PURE__ */ import_react28.default.createElement("option", { key: y, value: y }, y))
|
|
5163
5484
|
));
|
|
5164
5485
|
}
|
|
5165
5486
|
function ShowAllLink({ totalCount, visibleCount, onClick }) {
|
|
5166
5487
|
if (totalCount <= visibleCount) return null;
|
|
5167
|
-
return /* @__PURE__ */
|
|
5488
|
+
return /* @__PURE__ */ import_react28.default.createElement("div", { style: { textAlign: "center", marginTop: spacing[3] } }, /* @__PURE__ */ import_react28.default.createElement(
|
|
5168
5489
|
"button",
|
|
5169
5490
|
{
|
|
5170
5491
|
type: "button",
|
|
@@ -5192,7 +5513,7 @@ function ShowAllLink({ totalCount, visibleCount, onClick }) {
|
|
|
5192
5513
|
));
|
|
5193
5514
|
}
|
|
5194
5515
|
function EmptyState({ message }) {
|
|
5195
|
-
return /* @__PURE__ */
|
|
5516
|
+
return /* @__PURE__ */ import_react28.default.createElement("p", { style: {
|
|
5196
5517
|
fontFamily: fonts.primary,
|
|
5197
5518
|
fontSize: fontSizes.sm,
|
|
5198
5519
|
color: colors.textMuted,
|
|
@@ -5202,24 +5523,24 @@ function EmptyState({ message }) {
|
|
|
5202
5523
|
} }, message);
|
|
5203
5524
|
}
|
|
5204
5525
|
function Spinner() {
|
|
5205
|
-
return /* @__PURE__ */
|
|
5526
|
+
return /* @__PURE__ */ import_react28.default.createElement("div", { style: {
|
|
5206
5527
|
display: "flex",
|
|
5207
5528
|
justifyContent: "center",
|
|
5208
5529
|
alignItems: "center",
|
|
5209
5530
|
padding: spacing[10]
|
|
5210
|
-
} }, /* @__PURE__ */
|
|
5531
|
+
} }, /* @__PURE__ */ import_react28.default.createElement("div", { style: {
|
|
5211
5532
|
width: "40px",
|
|
5212
5533
|
height: "40px",
|
|
5213
5534
|
borderRadius: borderRadius.full,
|
|
5214
5535
|
border: `3px solid ${colors.borderLight}`,
|
|
5215
5536
|
borderTopColor: colors.evTeal,
|
|
5216
5537
|
animation: "ev-spin 0.8s linear infinite"
|
|
5217
|
-
} }), /* @__PURE__ */
|
|
5538
|
+
} }), /* @__PURE__ */ import_react28.default.createElement("style", null, `@keyframes ev-spin { to { transform: rotate(360deg); } }`));
|
|
5218
5539
|
}
|
|
5219
5540
|
function CommitteesSection({ committees, leadership }) {
|
|
5220
|
-
const [showAll, setShowAll] = (0,
|
|
5541
|
+
const [showAll, setShowAll] = (0, import_react28.useState)(false);
|
|
5221
5542
|
const visible = showAll ? committees : committees.slice(0, DEFAULT_LIMIT);
|
|
5222
|
-
return /* @__PURE__ */
|
|
5543
|
+
return /* @__PURE__ */ import_react28.default.createElement("div", { style: { marginBottom: spacing[8] } }, /* @__PURE__ */ import_react28.default.createElement(SectionHeader, { title: "Committees & Leadership" }), leadership && leadership.length > 0 && /* @__PURE__ */ import_react28.default.createElement("div", { style: { display: "flex", flexWrap: "wrap", gap: spacing[2], marginBottom: spacing[4] } }, leadership.map((role, i) => /* @__PURE__ */ import_react28.default.createElement("div", { key: i, style: {
|
|
5223
5544
|
display: "inline-flex",
|
|
5224
5545
|
alignItems: "center",
|
|
5225
5546
|
gap: spacing[1],
|
|
@@ -5230,23 +5551,23 @@ function CommitteesSection({ committees, leadership }) {
|
|
|
5230
5551
|
fontFamily: fonts.primary,
|
|
5231
5552
|
fontSize: fontSizes.sm,
|
|
5232
5553
|
fontWeight: fontWeights.semibold
|
|
5233
|
-
} }, role.title, role.chamber && /* @__PURE__ */
|
|
5554
|
+
} }, role.title, role.chamber && /* @__PURE__ */ import_react28.default.createElement("span", { style: { fontWeight: fontWeights.regular, opacity: 0.85 } }, "(", role.chamber, ")")))), committees.length === 0 ? /* @__PURE__ */ import_react28.default.createElement(EmptyState, { message: "Committee information is not available for this office." }) : /* @__PURE__ */ import_react28.default.createElement(import_react28.default.Fragment, null, /* @__PURE__ */ import_react28.default.createElement("div", null, visible.map((c, i) => {
|
|
5234
5555
|
const badge = getRoleBadge(c.role);
|
|
5235
|
-
return /* @__PURE__ */
|
|
5556
|
+
return /* @__PURE__ */ import_react28.default.createElement("div", { key: i, style: {
|
|
5236
5557
|
display: "flex",
|
|
5237
5558
|
alignItems: "center",
|
|
5238
5559
|
justifyContent: "space-between",
|
|
5239
5560
|
padding: `${spacing[3]} 0`,
|
|
5240
5561
|
borderBottom: `1px solid ${colors.borderLight}`,
|
|
5241
5562
|
gap: spacing[3]
|
|
5242
|
-
} }, /* @__PURE__ */
|
|
5563
|
+
} }, /* @__PURE__ */ import_react28.default.createElement("span", { style: {
|
|
5243
5564
|
fontFamily: fonts.primary,
|
|
5244
5565
|
fontSize: fontSizes.sm,
|
|
5245
5566
|
color: colors.textSecondary,
|
|
5246
5567
|
flex: 1,
|
|
5247
5568
|
minWidth: 0
|
|
5248
|
-
} }, c.committee_name, c.parent_name && /* @__PURE__ */
|
|
5249
|
-
})), !showAll && /* @__PURE__ */
|
|
5569
|
+
} }, c.committee_name, c.parent_name && /* @__PURE__ */ import_react28.default.createElement("span", { style: { color: colors.textMuted, marginLeft: spacing[1] } }, "(", c.parent_name, ")")), /* @__PURE__ */ import_react28.default.createElement(Badge, { label: badge.label, bg: badge.bg, text: badge.text }));
|
|
5570
|
+
})), !showAll && /* @__PURE__ */ import_react28.default.createElement(
|
|
5250
5571
|
ShowAllLink,
|
|
5251
5572
|
{
|
|
5252
5573
|
totalCount: committees.length,
|
|
@@ -5257,15 +5578,15 @@ function CommitteesSection({ committees, leadership }) {
|
|
|
5257
5578
|
}
|
|
5258
5579
|
function LegislationSection({ bills, isMobile }) {
|
|
5259
5580
|
const years = getYears(bills, "introduced_at");
|
|
5260
|
-
const [yearFilter, setYearFilter] = (0,
|
|
5261
|
-
const [showAll, setShowAll] = (0,
|
|
5581
|
+
const [yearFilter, setYearFilter] = (0, import_react28.useState)("All");
|
|
5582
|
+
const [showAll, setShowAll] = (0, import_react28.useState)(false);
|
|
5262
5583
|
const handleYearChange = (y) => {
|
|
5263
5584
|
setYearFilter(y);
|
|
5264
5585
|
setShowAll(false);
|
|
5265
5586
|
};
|
|
5266
5587
|
const filtered = yearFilter === "All" ? bills : bills.filter((b) => extractYear(b.introduced_at) === yearFilter);
|
|
5267
5588
|
const visible = showAll ? filtered : filtered.slice(0, DEFAULT_LIMIT);
|
|
5268
|
-
return /* @__PURE__ */
|
|
5589
|
+
return /* @__PURE__ */ import_react28.default.createElement("div", { style: { marginBottom: spacing[8] } }, /* @__PURE__ */ import_react28.default.createElement(
|
|
5269
5590
|
SectionHeader,
|
|
5270
5591
|
{
|
|
5271
5592
|
title: "Sponsored Legislation",
|
|
@@ -5273,42 +5594,42 @@ function LegislationSection({ bills, isMobile }) {
|
|
|
5273
5594
|
years,
|
|
5274
5595
|
onYearChange: handleYearChange
|
|
5275
5596
|
}
|
|
5276
|
-
), bills.length === 0 ? /* @__PURE__ */
|
|
5597
|
+
), bills.length === 0 ? /* @__PURE__ */ import_react28.default.createElement(EmptyState, { message: "Sponsored legislation data is not available for this office." }) : /* @__PURE__ */ import_react28.default.createElement(import_react28.default.Fragment, null, /* @__PURE__ */ import_react28.default.createElement("div", null, visible.map((bill, i) => {
|
|
5277
5598
|
const statusBadge = getStatusBadge(bill.status_label);
|
|
5278
|
-
return /* @__PURE__ */
|
|
5599
|
+
return /* @__PURE__ */ import_react28.default.createElement("div", { key: i, style: {
|
|
5279
5600
|
display: "flex",
|
|
5280
5601
|
flexDirection: isMobile ? "column" : "row",
|
|
5281
5602
|
alignItems: isMobile ? "flex-start" : "center",
|
|
5282
5603
|
gap: isMobile ? spacing[1] : spacing[3],
|
|
5283
5604
|
padding: `${spacing[3]} 0`,
|
|
5284
5605
|
borderBottom: `1px solid ${colors.borderLight}`
|
|
5285
|
-
} }, /* @__PURE__ */
|
|
5606
|
+
} }, /* @__PURE__ */ import_react28.default.createElement("div", { style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ import_react28.default.createElement("span", { style: {
|
|
5286
5607
|
fontFamily: fonts.primary,
|
|
5287
5608
|
fontSize: fontSizes.xs,
|
|
5288
5609
|
fontWeight: fontWeights.bold,
|
|
5289
5610
|
color: colors.textSecondary,
|
|
5290
5611
|
marginRight: spacing[2]
|
|
5291
|
-
} }, bill.number), /* @__PURE__ */
|
|
5612
|
+
} }, bill.number), /* @__PURE__ */ import_react28.default.createElement("span", { style: {
|
|
5292
5613
|
fontFamily: fonts.primary,
|
|
5293
5614
|
fontSize: fontSizes.sm,
|
|
5294
5615
|
color: colors.textSecondary
|
|
5295
|
-
} }, bill.title)), /* @__PURE__ */
|
|
5616
|
+
} }, bill.title)), /* @__PURE__ */ import_react28.default.createElement("div", { style: {
|
|
5296
5617
|
display: "flex",
|
|
5297
5618
|
alignItems: "center",
|
|
5298
5619
|
gap: spacing[2],
|
|
5299
5620
|
flexShrink: 0,
|
|
5300
5621
|
flexWrap: "wrap"
|
|
5301
|
-
} }, /* @__PURE__ */
|
|
5622
|
+
} }, /* @__PURE__ */ import_react28.default.createElement(Badge, { label: bill.status_label || "Unknown", bg: statusBadge.bg, text: statusBadge.text }), bill.introduced_at && /* @__PURE__ */ import_react28.default.createElement("span", { style: {
|
|
5302
5623
|
fontFamily: fonts.primary,
|
|
5303
5624
|
fontSize: fontSizes.xs,
|
|
5304
5625
|
color: colors.textMuted
|
|
5305
|
-
} }, formatDate2(bill.introduced_at)), /* @__PURE__ */
|
|
5626
|
+
} }, formatDate2(bill.introduced_at)), /* @__PURE__ */ import_react28.default.createElement("span", { style: {
|
|
5306
5627
|
fontFamily: fonts.primary,
|
|
5307
5628
|
fontSize: fontSizes.xs,
|
|
5308
5629
|
color: colors.textMuted,
|
|
5309
5630
|
fontStyle: "italic"
|
|
5310
5631
|
} }, bill.is_sponsor ? "Sponsored" : "Cosponsored")));
|
|
5311
|
-
})), !showAll && /* @__PURE__ */
|
|
5632
|
+
})), !showAll && /* @__PURE__ */ import_react28.default.createElement(
|
|
5312
5633
|
ShowAllLink,
|
|
5313
5634
|
{
|
|
5314
5635
|
totalCount: filtered.length,
|
|
@@ -5319,15 +5640,15 @@ function LegislationSection({ bills, isMobile }) {
|
|
|
5319
5640
|
}
|
|
5320
5641
|
function VotingSection({ votes, isMobile }) {
|
|
5321
5642
|
const years = getYears(votes, "vote_date");
|
|
5322
|
-
const [yearFilter, setYearFilter] = (0,
|
|
5323
|
-
const [showAll, setShowAll] = (0,
|
|
5643
|
+
const [yearFilter, setYearFilter] = (0, import_react28.useState)("All");
|
|
5644
|
+
const [showAll, setShowAll] = (0, import_react28.useState)(false);
|
|
5324
5645
|
const handleYearChange = (y) => {
|
|
5325
5646
|
setYearFilter(y);
|
|
5326
5647
|
setShowAll(false);
|
|
5327
5648
|
};
|
|
5328
5649
|
const filtered = yearFilter === "All" ? votes : votes.filter((v) => extractYear(v.vote_date) === yearFilter);
|
|
5329
5650
|
const visible = showAll ? filtered : filtered.slice(0, DEFAULT_LIMIT);
|
|
5330
|
-
return /* @__PURE__ */
|
|
5651
|
+
return /* @__PURE__ */ import_react28.default.createElement("div", { style: { marginBottom: spacing[8] } }, /* @__PURE__ */ import_react28.default.createElement(
|
|
5331
5652
|
SectionHeader,
|
|
5332
5653
|
{
|
|
5333
5654
|
title: "Voting Record",
|
|
@@ -5335,38 +5656,38 @@ function VotingSection({ votes, isMobile }) {
|
|
|
5335
5656
|
years,
|
|
5336
5657
|
onYearChange: handleYearChange
|
|
5337
5658
|
}
|
|
5338
|
-
), votes.length === 0 ? /* @__PURE__ */
|
|
5659
|
+
), votes.length === 0 ? /* @__PURE__ */ import_react28.default.createElement(EmptyState, { message: "Voting records are not available for this office." }) : /* @__PURE__ */ import_react28.default.createElement(import_react28.default.Fragment, null, /* @__PURE__ */ import_react28.default.createElement("div", null, visible.map((vote, i) => {
|
|
5339
5660
|
const positionBadge = getPositionBadge(vote.position);
|
|
5340
5661
|
const normPosition = normalizeText(vote.position);
|
|
5341
5662
|
const topic = vote.bill_title || vote.vote_question;
|
|
5342
5663
|
const sourceUrl = vote.bill_url;
|
|
5343
|
-
return /* @__PURE__ */
|
|
5664
|
+
return /* @__PURE__ */ import_react28.default.createElement("div", { key: i, style: {
|
|
5344
5665
|
display: "flex",
|
|
5345
5666
|
flexDirection: isMobile ? "column" : "row",
|
|
5346
5667
|
alignItems: isMobile ? "flex-start" : "center",
|
|
5347
5668
|
gap: isMobile ? spacing[1] : spacing[3],
|
|
5348
5669
|
padding: `${spacing[3]} 0`,
|
|
5349
5670
|
borderBottom: `1px solid ${colors.borderLight}`
|
|
5350
|
-
} }, /* @__PURE__ */
|
|
5671
|
+
} }, /* @__PURE__ */ import_react28.default.createElement("div", { style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ import_react28.default.createElement("span", { style: {
|
|
5351
5672
|
fontFamily: fonts.primary,
|
|
5352
5673
|
fontSize: fontSizes.sm,
|
|
5353
5674
|
color: colors.textSecondary
|
|
5354
|
-
} }, topic)), /* @__PURE__ */
|
|
5675
|
+
} }, topic)), /* @__PURE__ */ import_react28.default.createElement("div", { style: {
|
|
5355
5676
|
display: "flex",
|
|
5356
5677
|
alignItems: "center",
|
|
5357
5678
|
gap: spacing[2],
|
|
5358
5679
|
flexShrink: 0,
|
|
5359
5680
|
flexWrap: "wrap"
|
|
5360
|
-
} }, vote.vote_date && /* @__PURE__ */
|
|
5681
|
+
} }, vote.vote_date && /* @__PURE__ */ import_react28.default.createElement("span", { style: {
|
|
5361
5682
|
fontFamily: fonts.primary,
|
|
5362
5683
|
fontSize: fontSizes.xs,
|
|
5363
5684
|
color: colors.textMuted
|
|
5364
|
-
} }, formatDate2(vote.vote_date)), /* @__PURE__ */
|
|
5685
|
+
} }, formatDate2(vote.vote_date)), /* @__PURE__ */ import_react28.default.createElement(Badge, { label: normPosition || "Unknown", bg: positionBadge.bg, text: positionBadge.text }), vote.result && /* @__PURE__ */ import_react28.default.createElement("span", { style: {
|
|
5365
5686
|
fontFamily: fonts.primary,
|
|
5366
5687
|
fontSize: fontSizes.xs,
|
|
5367
5688
|
color: vote.result === "Passed" ? colors.success : colors.textMuted,
|
|
5368
5689
|
fontWeight: fontWeights.medium
|
|
5369
|
-
} }, vote.result), sourceUrl && /* @__PURE__ */
|
|
5690
|
+
} }, vote.result), sourceUrl && /* @__PURE__ */ import_react28.default.createElement(
|
|
5370
5691
|
"a",
|
|
5371
5692
|
{
|
|
5372
5693
|
href: sourceUrl,
|
|
@@ -5387,7 +5708,7 @@ function VotingSection({ votes, isMobile }) {
|
|
|
5387
5708
|
},
|
|
5388
5709
|
"Source"
|
|
5389
5710
|
)));
|
|
5390
|
-
})), !showAll && /* @__PURE__ */
|
|
5711
|
+
})), !showAll && /* @__PURE__ */ import_react28.default.createElement(
|
|
5391
5712
|
ShowAllLink,
|
|
5392
5713
|
{
|
|
5393
5714
|
totalCount: filtered.length,
|
|
@@ -5406,20 +5727,20 @@ function LegislativeRecord({
|
|
|
5406
5727
|
}) {
|
|
5407
5728
|
const isMobile = useMediaQuery("(max-width: 768px)");
|
|
5408
5729
|
if (loading) {
|
|
5409
|
-
return /* @__PURE__ */
|
|
5730
|
+
return /* @__PURE__ */ import_react28.default.createElement(Spinner, null);
|
|
5410
5731
|
}
|
|
5411
|
-
return /* @__PURE__ */
|
|
5732
|
+
return /* @__PURE__ */ import_react28.default.createElement("div", { style: { fontFamily: fonts.primary } }, politicianName && /* @__PURE__ */ import_react28.default.createElement("h1", { style: {
|
|
5412
5733
|
fontFamily: fonts.primary,
|
|
5413
5734
|
fontSize: isMobile ? fontSizes["2xl"] : fontSizes["4xl"],
|
|
5414
5735
|
fontWeight: fontWeights.bold,
|
|
5415
5736
|
color: colors.evTeal,
|
|
5416
5737
|
marginBottom: spacing[8],
|
|
5417
5738
|
marginTop: 0
|
|
5418
|
-
} }, "Legislative Record: ", politicianName), /* @__PURE__ */
|
|
5739
|
+
} }, "Legislative Record: ", politicianName), /* @__PURE__ */ import_react28.default.createElement(CommitteesSection, { committees, leadership }), /* @__PURE__ */ import_react28.default.createElement(LegislationSection, { bills, isMobile }), /* @__PURE__ */ import_react28.default.createElement(VotingSection, { votes, isMobile }));
|
|
5419
5740
|
}
|
|
5420
5741
|
|
|
5421
5742
|
// src/JudicialRecordDetail.jsx
|
|
5422
|
-
var
|
|
5743
|
+
var import_react29 = __toESM(require("react"));
|
|
5423
5744
|
var containerStyle = {
|
|
5424
5745
|
fontFamily: "'Manrope', sans-serif",
|
|
5425
5746
|
maxWidth: "800px"
|
|
@@ -5504,7 +5825,7 @@ var emptyStateStyle = {
|
|
|
5504
5825
|
function JudicialRecordDetail({ politician = {}, judicialRecord, onBack }) {
|
|
5505
5826
|
var _a;
|
|
5506
5827
|
if (!judicialRecord) {
|
|
5507
|
-
return /* @__PURE__ */
|
|
5828
|
+
return /* @__PURE__ */ import_react29.default.createElement("div", { style: containerStyle }, /* @__PURE__ */ import_react29.default.createElement("button", { style: backBtnStyle, onClick: onBack }, "\u2190 Back to Profile"), /* @__PURE__ */ import_react29.default.createElement("div", { style: emptyStateStyle }, "No judicial record data available."));
|
|
5508
5829
|
}
|
|
5509
5830
|
const {
|
|
5510
5831
|
judge_detail: detail,
|
|
@@ -5513,13 +5834,13 @@ function JudicialRecordDetail({ politician = {}, judicialRecord, onBack }) {
|
|
|
5513
5834
|
disciplinary_records: disciplinary = []
|
|
5514
5835
|
} = judicialRecord;
|
|
5515
5836
|
const displayName = politician.full_name || `${politician.first_name || ""} ${politician.last_name || ""}`.trim();
|
|
5516
|
-
return /* @__PURE__ */
|
|
5837
|
+
return /* @__PURE__ */ import_react29.default.createElement("div", { style: containerStyle }, /* @__PURE__ */ import_react29.default.createElement("button", { style: backBtnStyle, onClick: onBack }, "\u2190 Back to Profile"), /* @__PURE__ */ import_react29.default.createElement("h1", { style: nameStyle }, displayName), /* @__PURE__ */ import_react29.default.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__ */ import_react29.default.createElement(import_react29.default.Fragment, null, /* @__PURE__ */ import_react29.default.createElement("h2", { style: sectionHeadingStyle }, "Background"), detail.appointed_by && /* @__PURE__ */ import_react29.default.createElement("div", { style: detailRowStyle }, /* @__PURE__ */ import_react29.default.createElement("span", { style: detailLabelStyle }, "Appointed by"), /* @__PURE__ */ import_react29.default.createElement("span", { style: detailValueStyle }, detail.appointed_by, " (", detail.appointing_president_party, ")")), detail.confirmation_vote && /* @__PURE__ */ import_react29.default.createElement("div", { style: detailRowStyle }, /* @__PURE__ */ import_react29.default.createElement("span", { style: detailLabelStyle }, "Confirmation Vote"), /* @__PURE__ */ import_react29.default.createElement("span", { style: detailValueStyle }, detail.confirmation_vote)), detail.election_type && /* @__PURE__ */ import_react29.default.createElement("div", { style: detailRowStyle }, /* @__PURE__ */ import_react29.default.createElement("span", { style: detailLabelStyle }, "Election Type"), /* @__PURE__ */ import_react29.default.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__ */ import_react29.default.createElement("div", { style: detailRowStyle }, /* @__PURE__ */ import_react29.default.createElement("span", { style: detailLabelStyle }, "Areas of Focus"), /* @__PURE__ */ import_react29.default.createElement("span", { style: detailValueStyle }, detail.areas_of_focus.join(", ")))), /* @__PURE__ */ import_react29.default.createElement("h2", { style: sectionHeadingStyle }, "Performance Evaluations"), evaluations.length === 0 ? /* @__PURE__ */ import_react29.default.createElement("div", { style: emptyStateStyle }, "No evaluation data available yet.") : /* @__PURE__ */ import_react29.default.createElement("table", { style: tableStyle }, /* @__PURE__ */ import_react29.default.createElement("thead", null, /* @__PURE__ */ import_react29.default.createElement("tr", null, /* @__PURE__ */ import_react29.default.createElement("th", { style: thStyle }, "Source"), /* @__PURE__ */ import_react29.default.createElement("th", { style: thStyle }, "Rating"), /* @__PURE__ */ import_react29.default.createElement("th", { style: thStyle }, "Date"))), /* @__PURE__ */ import_react29.default.createElement("tbody", null, evaluations.map((ev, i) => /* @__PURE__ */ import_react29.default.createElement("tr", { key: i }, /* @__PURE__ */ import_react29.default.createElement("td", { style: tdStyle }, ev.source_url ? /* @__PURE__ */ import_react29.default.createElement("a", { href: ev.source_url, target: "_blank", rel: "noopener noreferrer", style: { color: "#319795" } }, ev.source) : ev.source), /* @__PURE__ */ import_react29.default.createElement("td", { style: { ...tdStyle, fontWeight: 600 } }, ev.rating), /* @__PURE__ */ import_react29.default.createElement("td", { style: tdStyle }, formatDate(ev.rating_date)))))), /* @__PURE__ */ import_react29.default.createElement("h2", { style: sectionHeadingStyle }, "Performance Metrics"), metrics.length === 0 ? /* @__PURE__ */ import_react29.default.createElement("div", { style: emptyStateStyle }, "No performance metric data available yet.") : /* @__PURE__ */ import_react29.default.createElement("table", { style: tableStyle }, /* @__PURE__ */ import_react29.default.createElement("thead", null, /* @__PURE__ */ import_react29.default.createElement("tr", null, /* @__PURE__ */ import_react29.default.createElement("th", { style: thStyle }, "Metric"), /* @__PURE__ */ import_react29.default.createElement("th", { style: thStyle }, "Value"), /* @__PURE__ */ import_react29.default.createElement("th", { style: thStyle }, "Context"), /* @__PURE__ */ import_react29.default.createElement("th", { style: thStyle }, "Period"))), /* @__PURE__ */ import_react29.default.createElement("tbody", null, metrics.map((m, i) => /* @__PURE__ */ import_react29.default.createElement("tr", { key: i }, /* @__PURE__ */ import_react29.default.createElement("td", { style: { ...tdStyle, fontWeight: 600 } }, METRIC_LABELS[m.metric_type] || m.metric_type.replace(/_/g, " ")), /* @__PURE__ */ import_react29.default.createElement("td", { style: tdStyle }, formatMetricValue(m.metric_type, m.value)), /* @__PURE__ */ import_react29.default.createElement("td", { style: { ...tdStyle, color: "#718096", fontSize: "13px" } }, m.context_label), /* @__PURE__ */ import_react29.default.createElement("td", { style: tdStyle }, m.time_period))))), disciplinary.length > 0 && /* @__PURE__ */ import_react29.default.createElement(import_react29.default.Fragment, null, /* @__PURE__ */ import_react29.default.createElement("h2", { style: sectionHeadingStyle }, "Disciplinary History"), disciplinary.map((d, i) => /* @__PURE__ */ import_react29.default.createElement("div", { key: i, style: {
|
|
5517
5838
|
borderLeft: "3px solid #fc8181",
|
|
5518
5839
|
backgroundColor: "#fff5f5",
|
|
5519
5840
|
borderRadius: "0 6px 6px 0",
|
|
5520
5841
|
padding: "12px 16px",
|
|
5521
5842
|
marginBottom: "10px"
|
|
5522
|
-
} }, /* @__PURE__ */
|
|
5843
|
+
} }, /* @__PURE__ */ import_react29.default.createElement("div", { style: { fontWeight: 700, color: "#742a2a", fontSize: "14px" } }, d.record_type, " \u2014 ", formatDate(d.record_date)), d.description && /* @__PURE__ */ import_react29.default.createElement("div", { style: { color: "#9b2c2c", fontSize: "13px", marginTop: "4px" } }, d.description), d.source_url && /* @__PURE__ */ import_react29.default.createElement(
|
|
5523
5844
|
"a",
|
|
5524
5845
|
{
|
|
5525
5846
|
href: d.source_url,
|
|
@@ -5532,7 +5853,7 @@ function JudicialRecordDetail({ politician = {}, judicialRecord, onBack }) {
|
|
|
5532
5853
|
}
|
|
5533
5854
|
|
|
5534
5855
|
// src/AuthForm.jsx
|
|
5535
|
-
var
|
|
5856
|
+
var import_react30 = __toESM(require("react"));
|
|
5536
5857
|
function AuthForm({
|
|
5537
5858
|
logoSrc = "/EVLogo.svg",
|
|
5538
5859
|
appName = "Empowered Vote",
|
|
@@ -5543,11 +5864,11 @@ function AuthForm({
|
|
|
5543
5864
|
error = null,
|
|
5544
5865
|
submitting = false
|
|
5545
5866
|
}) {
|
|
5546
|
-
const [username, setUsername] = (0,
|
|
5547
|
-
const [password, setPassword] = (0,
|
|
5548
|
-
const [confirmPassword, setConfirmPassword] = (0,
|
|
5549
|
-
const [showPasswords, setShowPasswords] = (0,
|
|
5550
|
-
const [passwordMismatch, setPasswordMismatch] = (0,
|
|
5867
|
+
const [username, setUsername] = (0, import_react30.useState)("");
|
|
5868
|
+
const [password, setPassword] = (0, import_react30.useState)("");
|
|
5869
|
+
const [confirmPassword, setConfirmPassword] = (0, import_react30.useState)("");
|
|
5870
|
+
const [showPasswords, setShowPasswords] = (0, import_react30.useState)(false);
|
|
5871
|
+
const [passwordMismatch, setPasswordMismatch] = (0, import_react30.useState)(false);
|
|
5551
5872
|
const isLogin = mode === "login";
|
|
5552
5873
|
const handleSubmit = (e) => {
|
|
5553
5874
|
e.preventDefault();
|
|
@@ -5559,7 +5880,7 @@ function AuthForm({
|
|
|
5559
5880
|
setPasswordMismatch(false);
|
|
5560
5881
|
onSubmit == null ? void 0 : onSubmit(username.trim(), password);
|
|
5561
5882
|
};
|
|
5562
|
-
const EyeOpen = () => /* @__PURE__ */
|
|
5883
|
+
const EyeOpen = () => /* @__PURE__ */ import_react30.default.createElement(
|
|
5563
5884
|
"svg",
|
|
5564
5885
|
{
|
|
5565
5886
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5569,7 +5890,7 @@ function AuthForm({
|
|
|
5569
5890
|
stroke: "currentColor",
|
|
5570
5891
|
style: { width: "20px", height: "20px" }
|
|
5571
5892
|
},
|
|
5572
|
-
/* @__PURE__ */
|
|
5893
|
+
/* @__PURE__ */ import_react30.default.createElement(
|
|
5573
5894
|
"path",
|
|
5574
5895
|
{
|
|
5575
5896
|
strokeLinecap: "round",
|
|
@@ -5577,7 +5898,7 @@ function AuthForm({
|
|
|
5577
5898
|
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"
|
|
5578
5899
|
}
|
|
5579
5900
|
),
|
|
5580
|
-
/* @__PURE__ */
|
|
5901
|
+
/* @__PURE__ */ import_react30.default.createElement(
|
|
5581
5902
|
"path",
|
|
5582
5903
|
{
|
|
5583
5904
|
strokeLinecap: "round",
|
|
@@ -5586,7 +5907,7 @@ function AuthForm({
|
|
|
5586
5907
|
}
|
|
5587
5908
|
)
|
|
5588
5909
|
);
|
|
5589
|
-
const EyeClosed = () => /* @__PURE__ */
|
|
5910
|
+
const EyeClosed = () => /* @__PURE__ */ import_react30.default.createElement(
|
|
5590
5911
|
"svg",
|
|
5591
5912
|
{
|
|
5592
5913
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5596,7 +5917,7 @@ function AuthForm({
|
|
|
5596
5917
|
stroke: "currentColor",
|
|
5597
5918
|
style: { width: "20px", height: "20px" }
|
|
5598
5919
|
},
|
|
5599
|
-
/* @__PURE__ */
|
|
5920
|
+
/* @__PURE__ */ import_react30.default.createElement(
|
|
5600
5921
|
"path",
|
|
5601
5922
|
{
|
|
5602
5923
|
strokeLinecap: "round",
|
|
@@ -5605,17 +5926,17 @@ function AuthForm({
|
|
|
5605
5926
|
}
|
|
5606
5927
|
)
|
|
5607
5928
|
);
|
|
5608
|
-
const PasswordToggle = () => /* @__PURE__ */
|
|
5929
|
+
const PasswordToggle = () => /* @__PURE__ */ import_react30.default.createElement(
|
|
5609
5930
|
"button",
|
|
5610
5931
|
{
|
|
5611
5932
|
type: "button",
|
|
5612
5933
|
onClick: () => setShowPasswords((prev) => !prev),
|
|
5613
5934
|
style: styles.passwordToggle
|
|
5614
5935
|
},
|
|
5615
|
-
showPasswords ? /* @__PURE__ */
|
|
5936
|
+
showPasswords ? /* @__PURE__ */ import_react30.default.createElement(EyeOpen, null) : /* @__PURE__ */ import_react30.default.createElement(EyeClosed, null)
|
|
5616
5937
|
);
|
|
5617
5938
|
const displayError = passwordMismatch ? "Passwords do not match." : error;
|
|
5618
|
-
return /* @__PURE__ */
|
|
5939
|
+
return /* @__PURE__ */ import_react30.default.createElement("div", { style: styles.wrapper }, /* @__PURE__ */ import_react30.default.createElement("div", { style: styles.container }, /* @__PURE__ */ import_react30.default.createElement("div", { style: styles.header }, logoSrc && /* @__PURE__ */ import_react30.default.createElement("img", { src: logoSrc, alt: appName, style: styles.logo }), appName && /* @__PURE__ */ import_react30.default.createElement("h1", { style: styles.appName }, appName), appSubtitle && /* @__PURE__ */ import_react30.default.createElement("p", { style: styles.appSubtitle }, appSubtitle)), /* @__PURE__ */ import_react30.default.createElement("form", { onSubmit: handleSubmit, style: styles.card }, /* @__PURE__ */ import_react30.default.createElement("h2", { style: styles.cardTitle }, isLogin ? "Welcome Back" : "Create Account"), /* @__PURE__ */ import_react30.default.createElement("div", { style: styles.fieldGroup }, /* @__PURE__ */ import_react30.default.createElement("label", { style: styles.label }, "Username"), /* @__PURE__ */ import_react30.default.createElement(
|
|
5619
5940
|
"input",
|
|
5620
5941
|
{
|
|
5621
5942
|
type: "text",
|
|
@@ -5632,7 +5953,7 @@ function AuthForm({
|
|
|
5632
5953
|
},
|
|
5633
5954
|
required: true
|
|
5634
5955
|
}
|
|
5635
|
-
)), /* @__PURE__ */
|
|
5956
|
+
)), /* @__PURE__ */ import_react30.default.createElement("div", { style: styles.fieldGroup }, /* @__PURE__ */ import_react30.default.createElement("label", { style: styles.label }, "Password"), /* @__PURE__ */ import_react30.default.createElement("div", { style: styles.passwordWrapper }, /* @__PURE__ */ import_react30.default.createElement(
|
|
5636
5957
|
"input",
|
|
5637
5958
|
{
|
|
5638
5959
|
type: showPasswords ? "text" : "password",
|
|
@@ -5648,7 +5969,7 @@ function AuthForm({
|
|
|
5648
5969
|
},
|
|
5649
5970
|
required: true
|
|
5650
5971
|
}
|
|
5651
|
-
), /* @__PURE__ */
|
|
5972
|
+
), /* @__PURE__ */ import_react30.default.createElement(PasswordToggle, null))), !isLogin && /* @__PURE__ */ import_react30.default.createElement("div", { style: styles.fieldGroup }, /* @__PURE__ */ import_react30.default.createElement("label", { style: styles.label }, "Confirm Password"), /* @__PURE__ */ import_react30.default.createElement("div", { style: styles.passwordWrapper }, /* @__PURE__ */ import_react30.default.createElement(
|
|
5652
5973
|
"input",
|
|
5653
5974
|
{
|
|
5654
5975
|
type: showPasswords ? "text" : "password",
|
|
@@ -5664,7 +5985,7 @@ function AuthForm({
|
|
|
5664
5985
|
},
|
|
5665
5986
|
required: true
|
|
5666
5987
|
}
|
|
5667
|
-
), /* @__PURE__ */
|
|
5988
|
+
), /* @__PURE__ */ import_react30.default.createElement(PasswordToggle, null))), displayError && /* @__PURE__ */ import_react30.default.createElement("div", { style: styles.errorBox }, /* @__PURE__ */ import_react30.default.createElement("p", { style: styles.errorText }, displayError)), /* @__PURE__ */ import_react30.default.createElement(
|
|
5668
5989
|
"button",
|
|
5669
5990
|
{
|
|
5670
5991
|
type: "submit",
|
|
@@ -5682,7 +6003,7 @@ function AuthForm({
|
|
|
5682
6003
|
}
|
|
5683
6004
|
},
|
|
5684
6005
|
submitting ? isLogin ? "Signing In..." : "Creating Account..." : isLogin ? "Sign In" : "Create Account"
|
|
5685
|
-
), onModeSwitch && /* @__PURE__ */
|
|
6006
|
+
), onModeSwitch && /* @__PURE__ */ import_react30.default.createElement("div", { style: styles.modeSwitch }, /* @__PURE__ */ import_react30.default.createElement("p", { style: styles.modeSwitchText }, isLogin ? "Don't have an account?" : "Already have an account?"), /* @__PURE__ */ import_react30.default.createElement(
|
|
5686
6007
|
"button",
|
|
5687
6008
|
{
|
|
5688
6009
|
type: "button",
|
|
@@ -5855,9 +6176,9 @@ var styles = {
|
|
|
5855
6176
|
};
|
|
5856
6177
|
|
|
5857
6178
|
// src/TopicTierBadge.jsx
|
|
5858
|
-
var
|
|
6179
|
+
var import_react31 = __toESM(require("react"));
|
|
5859
6180
|
function LandmarkIcon({ size = 14 }) {
|
|
5860
|
-
return /* @__PURE__ */
|
|
6181
|
+
return /* @__PURE__ */ import_react31.default.createElement(
|
|
5861
6182
|
"svg",
|
|
5862
6183
|
{
|
|
5863
6184
|
width: size,
|
|
@@ -5871,16 +6192,16 @@ function LandmarkIcon({ size = 14 }) {
|
|
|
5871
6192
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5872
6193
|
"aria-hidden": "true"
|
|
5873
6194
|
},
|
|
5874
|
-
/* @__PURE__ */
|
|
5875
|
-
/* @__PURE__ */
|
|
5876
|
-
/* @__PURE__ */
|
|
5877
|
-
/* @__PURE__ */
|
|
5878
|
-
/* @__PURE__ */
|
|
5879
|
-
/* @__PURE__ */
|
|
6195
|
+
/* @__PURE__ */ import_react31.default.createElement("path", { d: "M10 18v-7" }),
|
|
6196
|
+
/* @__PURE__ */ import_react31.default.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" }),
|
|
6197
|
+
/* @__PURE__ */ import_react31.default.createElement("path", { d: "M14 18v-7" }),
|
|
6198
|
+
/* @__PURE__ */ import_react31.default.createElement("path", { d: "M18 18v-7" }),
|
|
6199
|
+
/* @__PURE__ */ import_react31.default.createElement("path", { d: "M3 22h18" }),
|
|
6200
|
+
/* @__PURE__ */ import_react31.default.createElement("path", { d: "M6 18v-7" })
|
|
5880
6201
|
);
|
|
5881
6202
|
}
|
|
5882
6203
|
function Building2Icon({ size = 14 }) {
|
|
5883
|
-
return /* @__PURE__ */
|
|
6204
|
+
return /* @__PURE__ */ import_react31.default.createElement(
|
|
5884
6205
|
"svg",
|
|
5885
6206
|
{
|
|
5886
6207
|
width: size,
|
|
@@ -5894,17 +6215,17 @@ function Building2Icon({ size = 14 }) {
|
|
|
5894
6215
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5895
6216
|
"aria-hidden": "true"
|
|
5896
6217
|
},
|
|
5897
|
-
/* @__PURE__ */
|
|
5898
|
-
/* @__PURE__ */
|
|
5899
|
-
/* @__PURE__ */
|
|
5900
|
-
/* @__PURE__ */
|
|
5901
|
-
/* @__PURE__ */
|
|
5902
|
-
/* @__PURE__ */
|
|
5903
|
-
/* @__PURE__ */
|
|
6218
|
+
/* @__PURE__ */ import_react31.default.createElement("path", { d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z" }),
|
|
6219
|
+
/* @__PURE__ */ import_react31.default.createElement("path", { d: "M6 12H4a2 2 0 0 0-2 2v8h4" }),
|
|
6220
|
+
/* @__PURE__ */ import_react31.default.createElement("path", { d: "M18 9h2a2 2 0 0 1 2 2v11h-4" }),
|
|
6221
|
+
/* @__PURE__ */ import_react31.default.createElement("path", { d: "M10 6h4" }),
|
|
6222
|
+
/* @__PURE__ */ import_react31.default.createElement("path", { d: "M10 10h4" }),
|
|
6223
|
+
/* @__PURE__ */ import_react31.default.createElement("path", { d: "M10 14h4" }),
|
|
6224
|
+
/* @__PURE__ */ import_react31.default.createElement("path", { d: "M10 18h4" })
|
|
5904
6225
|
);
|
|
5905
6226
|
}
|
|
5906
6227
|
function HomeIcon({ size = 14 }) {
|
|
5907
|
-
return /* @__PURE__ */
|
|
6228
|
+
return /* @__PURE__ */ import_react31.default.createElement(
|
|
5908
6229
|
"svg",
|
|
5909
6230
|
{
|
|
5910
6231
|
width: size,
|
|
@@ -5918,8 +6239,8 @@ function HomeIcon({ size = 14 }) {
|
|
|
5918
6239
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5919
6240
|
"aria-hidden": "true"
|
|
5920
6241
|
},
|
|
5921
|
-
/* @__PURE__ */
|
|
5922
|
-
/* @__PURE__ */
|
|
6242
|
+
/* @__PURE__ */ import_react31.default.createElement("path", { d: "m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" }),
|
|
6243
|
+
/* @__PURE__ */ import_react31.default.createElement("polyline", { points: "9 22 9 12 15 12 15 22" })
|
|
5923
6244
|
);
|
|
5924
6245
|
}
|
|
5925
6246
|
var TIER_INFO = {
|
|
@@ -5979,7 +6300,7 @@ function TopicTierBadge({
|
|
|
5979
6300
|
userSelect: "none"
|
|
5980
6301
|
};
|
|
5981
6302
|
};
|
|
5982
|
-
return /* @__PURE__ */
|
|
6303
|
+
return /* @__PURE__ */ import_react31.default.createElement(
|
|
5983
6304
|
"span",
|
|
5984
6305
|
{
|
|
5985
6306
|
className: "ev-topic-tier-badge",
|
|
@@ -5989,13 +6310,13 @@ function TopicTierBadge({
|
|
|
5989
6310
|
},
|
|
5990
6311
|
effectiveTiers.map((tier) => {
|
|
5991
6312
|
const { label, Icon } = TIER_INFO[tier];
|
|
5992
|
-
return /* @__PURE__ */
|
|
6313
|
+
return /* @__PURE__ */ import_react31.default.createElement("span", { key: tier, style: itemStyle(tier) }, /* @__PURE__ */ import_react31.default.createElement(Icon, { size: sizeStyle.iconSize }), !iconOnly && /* @__PURE__ */ import_react31.default.createElement("span", null, label));
|
|
5993
6314
|
})
|
|
5994
6315
|
);
|
|
5995
6316
|
}
|
|
5996
6317
|
|
|
5997
6318
|
// src/CompassCoverageCallout.jsx
|
|
5998
|
-
var
|
|
6319
|
+
var import_react32 = __toESM(require("react"));
|
|
5999
6320
|
var TIER_LABELS = {
|
|
6000
6321
|
federal: "federal",
|
|
6001
6322
|
state: "state",
|
|
@@ -6008,7 +6329,7 @@ function CompassCoverageCallout({
|
|
|
6008
6329
|
compassUrl,
|
|
6009
6330
|
onDismiss
|
|
6010
6331
|
}) {
|
|
6011
|
-
const [dismissed, setDismissed] = (0,
|
|
6332
|
+
const [dismissed, setDismissed] = (0, import_react32.useState)(false);
|
|
6012
6333
|
if (dismissed) return null;
|
|
6013
6334
|
const tierLabel = TIER_LABELS[tier] || tier;
|
|
6014
6335
|
const tierStyle = tierColors[tier] || tierColors.federal;
|
|
@@ -6059,15 +6380,15 @@ function CompassCoverageCallout({
|
|
|
6059
6380
|
setDismissed(true);
|
|
6060
6381
|
if (onDismiss) onDismiss();
|
|
6061
6382
|
};
|
|
6062
|
-
return /* @__PURE__ */
|
|
6383
|
+
return /* @__PURE__ */ import_react32.default.createElement(
|
|
6063
6384
|
"div",
|
|
6064
6385
|
{
|
|
6065
6386
|
className: "ev-compass-coverage-callout",
|
|
6066
6387
|
role: "status",
|
|
6067
6388
|
style: containerStyle2
|
|
6068
6389
|
},
|
|
6069
|
-
/* @__PURE__ */
|
|
6070
|
-
onDismiss !== void 0 && /* @__PURE__ */
|
|
6390
|
+
/* @__PURE__ */ import_react32.default.createElement("div", { style: textStyle }, /* @__PURE__ */ import_react32.default.createElement("div", { style: headlineStyle }, "Your compass covers ", tierLabel, " issues lightly"), /* @__PURE__ */ import_react32.default.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__ */ import_react32.default.createElement("a", { href: compassUrl, style: ctaStyle }, "Add ", tierLabel, " topics \u2192")),
|
|
6391
|
+
onDismiss !== void 0 && /* @__PURE__ */ import_react32.default.createElement(
|
|
6071
6392
|
"button",
|
|
6072
6393
|
{
|
|
6073
6394
|
onClick: handleDismiss,
|
|
@@ -6080,7 +6401,7 @@ function CompassCoverageCallout({
|
|
|
6080
6401
|
}
|
|
6081
6402
|
|
|
6082
6403
|
// src/ExpandCompassNudge.jsx
|
|
6083
|
-
var
|
|
6404
|
+
var import_react33 = __toESM(require("react"));
|
|
6084
6405
|
function ExpandCompassNudge({
|
|
6085
6406
|
politicianName,
|
|
6086
6407
|
missingCount,
|
|
@@ -6127,7 +6448,7 @@ function ExpandCompassNudge({
|
|
|
6127
6448
|
};
|
|
6128
6449
|
const topicsLabel = missingCount === 1 ? "topic" : "topics";
|
|
6129
6450
|
const speakerName = politicianName || "This politician";
|
|
6130
|
-
return /* @__PURE__ */
|
|
6451
|
+
return /* @__PURE__ */ import_react33.default.createElement("div", { className: "ev-expand-compass-nudge", style: containerStyle2, role: "region" }, /* @__PURE__ */ import_react33.default.createElement("p", { style: headlineStyle }, "Want a richer comparison?"), /* @__PURE__ */ import_react33.default.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__ */ import_react33.default.createElement("a", { href: compassUrl, style: ctaStyle }, "Expand my compass \u2192"));
|
|
6131
6452
|
}
|
|
6132
6453
|
|
|
6133
6454
|
// src/computeTierCoverage.js
|
|
@@ -6148,7 +6469,7 @@ function computeTierCoverage(topics) {
|
|
|
6148
6469
|
}
|
|
6149
6470
|
|
|
6150
6471
|
// src/useEvContextPromotion.js
|
|
6151
|
-
var
|
|
6472
|
+
var import_react34 = require("react");
|
|
6152
6473
|
function useEvContextPromotion({
|
|
6153
6474
|
domain,
|
|
6154
6475
|
isLoggedIn,
|
|
@@ -6157,23 +6478,23 @@ function useEvContextPromotion({
|
|
|
6157
6478
|
apiWriter,
|
|
6158
6479
|
enabled = true
|
|
6159
6480
|
}) {
|
|
6160
|
-
const [shouldPrompt, setShouldPrompt] = (0,
|
|
6161
|
-
const [payload, setPayload] = (0,
|
|
6162
|
-
const [status, setStatus] = (0,
|
|
6163
|
-
const [error, setError] = (0,
|
|
6164
|
-
const apiDataRef = (0,
|
|
6481
|
+
const [shouldPrompt, setShouldPrompt] = (0, import_react34.useState)(false);
|
|
6482
|
+
const [payload, setPayload] = (0, import_react34.useState)(null);
|
|
6483
|
+
const [status, setStatus] = (0, import_react34.useState)("idle");
|
|
6484
|
+
const [error, setError] = (0, import_react34.useState)(null);
|
|
6485
|
+
const apiDataRef = (0, import_react34.useRef)(apiData);
|
|
6165
6486
|
apiDataRef.current = apiData;
|
|
6166
|
-
const userIdRef = (0,
|
|
6487
|
+
const userIdRef = (0, import_react34.useRef)(userId);
|
|
6167
6488
|
userIdRef.current = userId;
|
|
6168
|
-
const isLoggedInRef = (0,
|
|
6489
|
+
const isLoggedInRef = (0, import_react34.useRef)(isLoggedIn);
|
|
6169
6490
|
isLoggedInRef.current = isLoggedIn;
|
|
6170
|
-
const enabledRef = (0,
|
|
6491
|
+
const enabledRef = (0, import_react34.useRef)(enabled);
|
|
6171
6492
|
enabledRef.current = enabled;
|
|
6172
|
-
const domainRef = (0,
|
|
6493
|
+
const domainRef = (0, import_react34.useRef)(domain);
|
|
6173
6494
|
domainRef.current = domain;
|
|
6174
|
-
const apiWriterRef = (0,
|
|
6495
|
+
const apiWriterRef = (0, import_react34.useRef)(apiWriter);
|
|
6175
6496
|
apiWriterRef.current = apiWriter;
|
|
6176
|
-
const detect = (0,
|
|
6497
|
+
const detect = (0, import_react34.useCallback)(async () => {
|
|
6177
6498
|
const _enabled = enabledRef.current;
|
|
6178
6499
|
const _isLoggedIn = isLoggedInRef.current;
|
|
6179
6500
|
const _userId = userIdRef.current;
|
|
@@ -6212,16 +6533,16 @@ function useEvContextPromotion({
|
|
|
6212
6533
|
setPayload(null);
|
|
6213
6534
|
}
|
|
6214
6535
|
}, []);
|
|
6215
|
-
(0,
|
|
6536
|
+
(0, import_react34.useEffect)(() => {
|
|
6216
6537
|
detect();
|
|
6217
6538
|
}, [detect, isLoggedIn, userId, apiData, enabled, domain]);
|
|
6218
|
-
(0,
|
|
6539
|
+
(0, import_react34.useEffect)(() => {
|
|
6219
6540
|
const unsub = evContext.subscribe(() => {
|
|
6220
6541
|
detect();
|
|
6221
6542
|
});
|
|
6222
6543
|
return unsub;
|
|
6223
6544
|
}, [detect]);
|
|
6224
|
-
const promote = (0,
|
|
6545
|
+
const promote = (0, import_react34.useCallback)(async () => {
|
|
6225
6546
|
const _userId = userIdRef.current;
|
|
6226
6547
|
const _domain = domainRef.current;
|
|
6227
6548
|
const _writer = apiWriterRef.current;
|
|
@@ -6248,7 +6569,7 @@ function useEvContextPromotion({
|
|
|
6248
6569
|
setError(err instanceof Error ? err : new Error(String(err)));
|
|
6249
6570
|
}
|
|
6250
6571
|
}, [payload]);
|
|
6251
|
-
const dismiss = (0,
|
|
6572
|
+
const dismiss = (0, import_react34.useCallback)(async () => {
|
|
6252
6573
|
const _userId = userIdRef.current;
|
|
6253
6574
|
const _domain = domainRef.current;
|
|
6254
6575
|
if (!_userId) return;
|
|
@@ -6307,14 +6628,14 @@ function isGuestPopulated(domain, fullEvContext) {
|
|
|
6307
6628
|
}
|
|
6308
6629
|
|
|
6309
6630
|
// src/StanceAccordion.jsx
|
|
6310
|
-
var
|
|
6631
|
+
var import_react36 = __toESM(require("react"));
|
|
6311
6632
|
|
|
6312
6633
|
// src/Favicon.jsx
|
|
6313
|
-
var
|
|
6634
|
+
var import_react35 = __toESM(require("react"));
|
|
6314
6635
|
function Favicon({ url, size = 16 }) {
|
|
6315
6636
|
try {
|
|
6316
6637
|
const domain = new URL(url).hostname;
|
|
6317
|
-
return /* @__PURE__ */
|
|
6638
|
+
return /* @__PURE__ */ import_react35.default.createElement(
|
|
6318
6639
|
"img",
|
|
6319
6640
|
{
|
|
6320
6641
|
src: `https://www.google.com/s2/favicons?sz=${size}&domain=${domain}`,
|
|
@@ -6325,7 +6646,7 @@ function Favicon({ url, size = 16 }) {
|
|
|
6325
6646
|
}
|
|
6326
6647
|
);
|
|
6327
6648
|
} catch {
|
|
6328
|
-
return /* @__PURE__ */
|
|
6649
|
+
return /* @__PURE__ */ import_react35.default.createElement(
|
|
6329
6650
|
"svg",
|
|
6330
6651
|
{
|
|
6331
6652
|
width: size,
|
|
@@ -6336,8 +6657,8 @@ function Favicon({ url, size = 16 }) {
|
|
|
6336
6657
|
strokeWidth: "1.5",
|
|
6337
6658
|
style: { verticalAlign: "middle", flexShrink: 0 }
|
|
6338
6659
|
},
|
|
6339
|
-
/* @__PURE__ */
|
|
6340
|
-
/* @__PURE__ */
|
|
6660
|
+
/* @__PURE__ */ import_react35.default.createElement("circle", { cx: "12", cy: "12", r: "10" }),
|
|
6661
|
+
/* @__PURE__ */ import_react35.default.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" })
|
|
6341
6662
|
);
|
|
6342
6663
|
}
|
|
6343
6664
|
}
|
|
@@ -6432,11 +6753,11 @@ function StanceAccordion({
|
|
|
6432
6753
|
apiUrl = "https://api.empowered.vote"
|
|
6433
6754
|
}) {
|
|
6434
6755
|
var _a;
|
|
6435
|
-
const [expandedTopicId, setExpandedTopicId] = (0,
|
|
6436
|
-
const [loadingId, setLoadingId] = (0,
|
|
6437
|
-
const [showAll, setShowAll] = (0,
|
|
6438
|
-
const contextCache = (0,
|
|
6439
|
-
const quotesCache = (0,
|
|
6756
|
+
const [expandedTopicId, setExpandedTopicId] = (0, import_react36.useState)(null);
|
|
6757
|
+
const [loadingId, setLoadingId] = (0, import_react36.useState)(null);
|
|
6758
|
+
const [showAll, setShowAll] = (0, import_react36.useState)(false);
|
|
6759
|
+
const contextCache = (0, import_react36.useRef)(/* @__PURE__ */ new Map());
|
|
6760
|
+
const quotesCache = (0, import_react36.useRef)(null);
|
|
6440
6761
|
const c = palette(darkMode);
|
|
6441
6762
|
const polAnswerMap = {};
|
|
6442
6763
|
if (polAnswers) {
|
|
@@ -6496,7 +6817,7 @@ function StanceAccordion({
|
|
|
6496
6817
|
quotesCache.current = [];
|
|
6497
6818
|
}
|
|
6498
6819
|
}
|
|
6499
|
-
const handleToggle = (0,
|
|
6820
|
+
const handleToggle = (0, import_react36.useCallback)(
|
|
6500
6821
|
async (topicId) => {
|
|
6501
6822
|
if (expandedTopicId === topicId) {
|
|
6502
6823
|
setExpandedTopicId(null);
|
|
@@ -6513,7 +6834,7 @@ function StanceAccordion({
|
|
|
6513
6834
|
},
|
|
6514
6835
|
[expandedTopicId, politicianId, apiUrl]
|
|
6515
6836
|
);
|
|
6516
|
-
(0,
|
|
6837
|
+
(0, import_react36.useEffect)(() => {
|
|
6517
6838
|
if (initialExpandedTopicId && topics && topics.length > 0) {
|
|
6518
6839
|
handleToggle(String(initialExpandedTopicId));
|
|
6519
6840
|
}
|
|
@@ -6536,13 +6857,13 @@ function StanceAccordion({
|
|
|
6536
6857
|
textTransform: "uppercase",
|
|
6537
6858
|
letterSpacing: "0.06em"
|
|
6538
6859
|
};
|
|
6539
|
-
return /* @__PURE__ */
|
|
6860
|
+
return /* @__PURE__ */ import_react36.default.createElement(
|
|
6540
6861
|
"div",
|
|
6541
6862
|
{
|
|
6542
6863
|
className: "ev-stance-panel flex flex-col",
|
|
6543
6864
|
style: { fontFamily: "'Manrope', sans-serif" }
|
|
6544
6865
|
},
|
|
6545
|
-
/* @__PURE__ */
|
|
6866
|
+
/* @__PURE__ */ import_react36.default.createElement("h3", { style: { ...sectionLabelStyle, marginBottom: "8px" } }, "Stance Breakdown"),
|
|
6546
6867
|
visibleTopics.map((topic) => {
|
|
6547
6868
|
const topicId = String(topic.id);
|
|
6548
6869
|
const polValue = polAnswerMap[topicId];
|
|
@@ -6561,13 +6882,13 @@ function StanceAccordion({
|
|
|
6561
6882
|
if (topic.topic_key) return q.issue === topic.topic_key;
|
|
6562
6883
|
return topic.short_title && q.issue.toLowerCase() === topic.short_title.toLowerCase();
|
|
6563
6884
|
}) : [];
|
|
6564
|
-
return /* @__PURE__ */
|
|
6885
|
+
return /* @__PURE__ */ import_react36.default.createElement(
|
|
6565
6886
|
"div",
|
|
6566
6887
|
{
|
|
6567
6888
|
key: topicId,
|
|
6568
6889
|
style: { borderBottom: `1px solid ${c.rowBorder}` }
|
|
6569
6890
|
},
|
|
6570
|
-
/* @__PURE__ */
|
|
6891
|
+
/* @__PURE__ */ import_react36.default.createElement(
|
|
6571
6892
|
"button",
|
|
6572
6893
|
{
|
|
6573
6894
|
type: "button",
|
|
@@ -6587,7 +6908,7 @@ function StanceAccordion({
|
|
|
6587
6908
|
e.currentTarget.style.background = "transparent";
|
|
6588
6909
|
}
|
|
6589
6910
|
},
|
|
6590
|
-
/* @__PURE__ */
|
|
6911
|
+
/* @__PURE__ */ import_react36.default.createElement("div", { className: "flex flex-col min-w-0", style: { gap: "5px" } }, /* @__PURE__ */ import_react36.default.createElement(
|
|
6591
6912
|
"span",
|
|
6592
6913
|
{
|
|
6593
6914
|
style: {
|
|
@@ -6598,7 +6919,7 @@ function StanceAccordion({
|
|
|
6598
6919
|
}
|
|
6599
6920
|
},
|
|
6600
6921
|
titleText
|
|
6601
|
-
), /* @__PURE__ */
|
|
6922
|
+
), /* @__PURE__ */ import_react36.default.createElement("span", { style: { display: "flex", alignItems: "flex-start", gap: "8px" } }, /* @__PURE__ */ import_react36.default.createElement(
|
|
6602
6923
|
"span",
|
|
6603
6924
|
{
|
|
6604
6925
|
style: {
|
|
@@ -6610,7 +6931,7 @@ function StanceAccordion({
|
|
|
6610
6931
|
marginTop: "6px"
|
|
6611
6932
|
}
|
|
6612
6933
|
}
|
|
6613
|
-
), /* @__PURE__ */
|
|
6934
|
+
), /* @__PURE__ */ import_react36.default.createElement(
|
|
6614
6935
|
"span",
|
|
6615
6936
|
{
|
|
6616
6937
|
style: {
|
|
@@ -6621,7 +6942,7 @@ function StanceAccordion({
|
|
|
6621
6942
|
},
|
|
6622
6943
|
label
|
|
6623
6944
|
))),
|
|
6624
|
-
/* @__PURE__ */
|
|
6945
|
+
/* @__PURE__ */ import_react36.default.createElement(
|
|
6625
6946
|
"svg",
|
|
6626
6947
|
{
|
|
6627
6948
|
width: "16",
|
|
@@ -6639,10 +6960,10 @@ function StanceAccordion({
|
|
|
6639
6960
|
transition: "transform 0.2s ease"
|
|
6640
6961
|
}
|
|
6641
6962
|
},
|
|
6642
|
-
/* @__PURE__ */
|
|
6963
|
+
/* @__PURE__ */ import_react36.default.createElement("polyline", { points: "9 18 15 12 9 6" })
|
|
6643
6964
|
)
|
|
6644
6965
|
),
|
|
6645
|
-
/* @__PURE__ */
|
|
6966
|
+
/* @__PURE__ */ import_react36.default.createElement(
|
|
6646
6967
|
"div",
|
|
6647
6968
|
{
|
|
6648
6969
|
style: {
|
|
@@ -6651,7 +6972,7 @@ function StanceAccordion({
|
|
|
6651
6972
|
transition: "grid-template-rows 0.25s ease"
|
|
6652
6973
|
}
|
|
6653
6974
|
},
|
|
6654
|
-
/* @__PURE__ */
|
|
6975
|
+
/* @__PURE__ */ import_react36.default.createElement("div", { style: { overflow: "hidden" } }, /* @__PURE__ */ import_react36.default.createElement("div", { style: { padding: "4px 8px 16px" } }, stances.length > 0 && /* @__PURE__ */ import_react36.default.createElement(import_react36.default.Fragment, null, (userValue > 0 || polValue > 0) && /* @__PURE__ */ import_react36.default.createElement(
|
|
6655
6976
|
"div",
|
|
6656
6977
|
{
|
|
6657
6978
|
style: {
|
|
@@ -6663,14 +6984,14 @@ function StanceAccordion({
|
|
|
6663
6984
|
color: c.sourceText
|
|
6664
6985
|
}
|
|
6665
6986
|
},
|
|
6666
|
-
userValue > 0 && /* @__PURE__ */
|
|
6667
|
-
/* @__PURE__ */
|
|
6668
|
-
), /* @__PURE__ */
|
|
6987
|
+
userValue > 0 && /* @__PURE__ */ import_react36.default.createElement("span", { style: { display: "inline-flex", alignItems: "center", gap: "6px" } }, /* @__PURE__ */ import_react36.default.createElement("span", { style: { width: "9px", height: "9px", borderRadius: "50%", backgroundColor: USER_DOT } }), "You"),
|
|
6988
|
+
/* @__PURE__ */ import_react36.default.createElement("span", { style: { display: "inline-flex", alignItems: "center", gap: "6px" } }, /* @__PURE__ */ import_react36.default.createElement("span", { style: { width: "9px", height: "9px", borderRadius: "50%", backgroundColor: c.polDot } }), "Their stance")
|
|
6989
|
+
), /* @__PURE__ */ import_react36.default.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "6px", marginBottom: "14px" } }, stances.map((stance, i) => {
|
|
6669
6990
|
const stanceNum = i + 1;
|
|
6670
6991
|
const isUser = userValue === stanceNum;
|
|
6671
6992
|
const isPol = polValue === stanceNum;
|
|
6672
6993
|
const isActive = isUser || isPol;
|
|
6673
|
-
return /* @__PURE__ */
|
|
6994
|
+
return /* @__PURE__ */ import_react36.default.createElement(
|
|
6674
6995
|
"div",
|
|
6675
6996
|
{
|
|
6676
6997
|
key: i,
|
|
@@ -6686,7 +7007,7 @@ function StanceAccordion({
|
|
|
6686
7007
|
backgroundColor: isActive ? c.pillActiveBg : "transparent"
|
|
6687
7008
|
}
|
|
6688
7009
|
},
|
|
6689
|
-
/* @__PURE__ */
|
|
7010
|
+
/* @__PURE__ */ import_react36.default.createElement(
|
|
6690
7011
|
"span",
|
|
6691
7012
|
{
|
|
6692
7013
|
style: {
|
|
@@ -6698,10 +7019,10 @@ function StanceAccordion({
|
|
|
6698
7019
|
paddingTop: "3px"
|
|
6699
7020
|
}
|
|
6700
7021
|
},
|
|
6701
|
-
isUser && /* @__PURE__ */
|
|
6702
|
-
isPol && /* @__PURE__ */
|
|
7022
|
+
isUser && /* @__PURE__ */ import_react36.default.createElement("span", { style: { width: "9px", height: "9px", borderRadius: "50%", backgroundColor: USER_DOT, boxShadow: `0 0 0 3px ${USER_DOT}33` } }),
|
|
7023
|
+
isPol && /* @__PURE__ */ import_react36.default.createElement("span", { style: { width: "9px", height: "9px", borderRadius: "50%", backgroundColor: c.polDot, boxShadow: `0 0 0 3px ${c.polDot}33` } })
|
|
6703
7024
|
),
|
|
6704
|
-
/* @__PURE__ */
|
|
7025
|
+
/* @__PURE__ */ import_react36.default.createElement(
|
|
6705
7026
|
"span",
|
|
6706
7027
|
{
|
|
6707
7028
|
style: {
|
|
@@ -6713,7 +7034,7 @@ function StanceAccordion({
|
|
|
6713
7034
|
stance.text
|
|
6714
7035
|
)
|
|
6715
7036
|
);
|
|
6716
|
-
}))), isLoading && /* @__PURE__ */
|
|
7037
|
+
}))), isLoading && /* @__PURE__ */ import_react36.default.createElement("div", { className: "flex items-center", style: { padding: "12px 0" } }, /* @__PURE__ */ import_react36.default.createElement(
|
|
6717
7038
|
"div",
|
|
6718
7039
|
{
|
|
6719
7040
|
style: {
|
|
@@ -6725,7 +7046,7 @@ function StanceAccordion({
|
|
|
6725
7046
|
animation: "ev-spin 0.8s linear infinite"
|
|
6726
7047
|
}
|
|
6727
7048
|
}
|
|
6728
|
-
)), !isLoading && cached && /* @__PURE__ */
|
|
7049
|
+
)), !isLoading && cached && /* @__PURE__ */ import_react36.default.createElement(import_react36.default.Fragment, null, cached.reasoning ? /* @__PURE__ */ import_react36.default.createElement(
|
|
6729
7050
|
"p",
|
|
6730
7051
|
{
|
|
6731
7052
|
style: {
|
|
@@ -6737,7 +7058,7 @@ function StanceAccordion({
|
|
|
6737
7058
|
}
|
|
6738
7059
|
},
|
|
6739
7060
|
cached.reasoning
|
|
6740
|
-
) : null, cached.sources && cached.sources.length > 0 && /* @__PURE__ */
|
|
7061
|
+
) : null, cached.sources && cached.sources.length > 0 && /* @__PURE__ */ import_react36.default.createElement("div", { style: { marginTop: "8px" } }, /* @__PURE__ */ import_react36.default.createElement("p", { style: { ...sectionLabelStyle, marginBottom: "6px" } }, "References"), /* @__PURE__ */ import_react36.default.createElement("ol", { style: { listStyle: "decimal", listStylePosition: "inside", display: "flex", flexDirection: "column", gap: "4px" } }, cached.sources.map((src, i) => /* @__PURE__ */ import_react36.default.createElement("li", { key: i, style: { fontSize: "12px", color: c.sourceText } }, /* @__PURE__ */ import_react36.default.createElement(
|
|
6741
7062
|
"a",
|
|
6742
7063
|
{
|
|
6743
7064
|
href: src,
|
|
@@ -6746,13 +7067,13 @@ function StanceAccordion({
|
|
|
6746
7067
|
className: "inline-flex items-center gap-1.5",
|
|
6747
7068
|
style: { color: c.link }
|
|
6748
7069
|
},
|
|
6749
|
-
/* @__PURE__ */
|
|
6750
|
-
/* @__PURE__ */
|
|
6751
|
-
))))), topicQuotes.length > 0 && /* @__PURE__ */
|
|
7070
|
+
/* @__PURE__ */ import_react36.default.createElement(Favicon, { url: src }),
|
|
7071
|
+
/* @__PURE__ */ import_react36.default.createElement("span", { style: { textDecoration: "underline", textUnderlineOffset: "2px" } }, getDisplayUrl(src))
|
|
7072
|
+
))))), topicQuotes.length > 0 && /* @__PURE__ */ import_react36.default.createElement("div", { style: { marginTop: "14px" } }, /* @__PURE__ */ import_react36.default.createElement("p", { style: { ...sectionLabelStyle, marginBottom: "8px" } }, "Quotes"), topicQuotes.map((quote) => {
|
|
6752
7073
|
const verdict = verdictsByQuote ? verdictsByQuote[quote.id] : void 0;
|
|
6753
7074
|
const borderColor = verdict === "agreed" ? c.agreedText : verdict === "disagreed" ? c.disagreedText : c.quoteBorder;
|
|
6754
7075
|
const sourceName = quote.source_name || quote.sourceName;
|
|
6755
|
-
return /* @__PURE__ */
|
|
7076
|
+
return /* @__PURE__ */ import_react36.default.createElement(
|
|
6756
7077
|
"div",
|
|
6757
7078
|
{
|
|
6758
7079
|
key: quote.id,
|
|
@@ -6764,7 +7085,7 @@ function StanceAccordion({
|
|
|
6764
7085
|
marginBottom: "8px"
|
|
6765
7086
|
}
|
|
6766
7087
|
},
|
|
6767
|
-
/* @__PURE__ */
|
|
7088
|
+
/* @__PURE__ */ import_react36.default.createElement(
|
|
6768
7089
|
"p",
|
|
6769
7090
|
{
|
|
6770
7091
|
style: {
|
|
@@ -6777,7 +7098,7 @@ function StanceAccordion({
|
|
|
6777
7098
|
},
|
|
6778
7099
|
quote.text
|
|
6779
7100
|
),
|
|
6780
|
-
verdict === "agreed" && /* @__PURE__ */
|
|
7101
|
+
verdict === "agreed" && /* @__PURE__ */ import_react36.default.createElement(
|
|
6781
7102
|
"span",
|
|
6782
7103
|
{
|
|
6783
7104
|
style: {
|
|
@@ -6794,10 +7115,10 @@ function StanceAccordion({
|
|
|
6794
7115
|
flexShrink: 0
|
|
6795
7116
|
}
|
|
6796
7117
|
},
|
|
6797
|
-
/* @__PURE__ */
|
|
7118
|
+
/* @__PURE__ */ import_react36.default.createElement("svg", { width: "11", height: "11", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.5, strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react36.default.createElement("path", { d: "M5 13l4 4L19 7" })),
|
|
6798
7119
|
"Agreed"
|
|
6799
7120
|
),
|
|
6800
|
-
verdict === "disagreed" && /* @__PURE__ */
|
|
7121
|
+
verdict === "disagreed" && /* @__PURE__ */ import_react36.default.createElement(
|
|
6801
7122
|
"span",
|
|
6802
7123
|
{
|
|
6803
7124
|
style: {
|
|
@@ -6814,10 +7135,10 @@ function StanceAccordion({
|
|
|
6814
7135
|
flexShrink: 0
|
|
6815
7136
|
}
|
|
6816
7137
|
},
|
|
6817
|
-
/* @__PURE__ */
|
|
7138
|
+
/* @__PURE__ */ import_react36.default.createElement("svg", { width: "11", height: "11", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.5, strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react36.default.createElement("path", { d: "M6 18L18 6M6 6l12 12" })),
|
|
6818
7139
|
"Disagreed"
|
|
6819
7140
|
),
|
|
6820
|
-
sourceName && /* @__PURE__ */
|
|
7141
|
+
sourceName && /* @__PURE__ */ import_react36.default.createElement(
|
|
6821
7142
|
"a",
|
|
6822
7143
|
{
|
|
6823
7144
|
href: quote.source_url || quote.sourceUrl,
|
|
@@ -6834,11 +7155,11 @@ function StanceAccordion({
|
|
|
6834
7155
|
sourceName
|
|
6835
7156
|
)
|
|
6836
7157
|
);
|
|
6837
|
-
})), !cached.reasoning && (!cached.sources || cached.sources.length === 0) && topicQuotes.length === 0 && /* @__PURE__ */
|
|
7158
|
+
})), !cached.reasoning && (!cached.sources || cached.sources.length === 0) && topicQuotes.length === 0 && /* @__PURE__ */ import_react36.default.createElement("p", { style: { fontSize: "14px", color: c.emptyText, fontStyle: "italic", padding: "8px 0" } }, "No detailed reasoning available for this topic."))))
|
|
6838
7159
|
)
|
|
6839
7160
|
);
|
|
6840
7161
|
}),
|
|
6841
|
-
hasToggle && /* @__PURE__ */
|
|
7162
|
+
hasToggle && /* @__PURE__ */ import_react36.default.createElement(
|
|
6842
7163
|
"button",
|
|
6843
7164
|
{
|
|
6844
7165
|
type: "button",
|
|
@@ -6877,6 +7198,7 @@ function StanceAccordion({
|
|
|
6877
7198
|
PoliticianCard,
|
|
6878
7199
|
PoliticianProfile,
|
|
6879
7200
|
RadarChartCore,
|
|
7201
|
+
SiteFooter,
|
|
6880
7202
|
SiteHeader,
|
|
6881
7203
|
SocialLinks,
|
|
6882
7204
|
StanceAccordion,
|