What The Women Counting Your Votes Today Are Thinking
“My fear is someone dropping by and shooting the whole place up.”
Bynia t. evans,
a freelance writer covering race, politics, and democracy. She was a contributing editor at Hammer & Hope and a 2021 fellow at Boston Review. Her work has appeared in Mother Jones, Dissent, Prism, Electric Literature, and Slate, among others.
Laura Booth, director of voter registration and elections for South Carolina’s Anderson County, at her office.
Photo: Elizabeth Bick
Laura Booth, director of voter registration and elections for South Carolina’s Anderson County, at her office.
Photo: Elizabeth Bick
Laura Booth, director of voter registration and elections for South Carolina’s Anderson County, at her office.
Photo: Elizabeth Bick
Several polling places, including Georgia’s Gwinnett and Fulton Counties, were hit on Election Day with what officials are calling “non-credible” bomb threats originating outside of the country. Follow along with New York’s election liveblog here for the latest updates.
The Anderson County, South Carolina, elections office is located in an old bank building with nothing but glass in the front. “My fear is someone just dropping by and shooting the whole place up,” Laura Booth, the county’s elections director, tells me. Someone smashed through one of the big glass windows after hours this summer, not too long after two county vehicles were vandalized in the office parking lot. She’s been on high alert since. “Anytime someone walks in that has a book bag, or has a hoodie or a large jacket on, I start watching immediately,” she says.
It’s not like she hasn’t been threatened before. Weeks before the 2016 presidential election, a man stormed into Booth’s office and asked to file paperwork to run for president. She explained that the filing deadline had already passed. Then he pulled a knife from his pocket. “He just kept twirling it,” she remembers. “He didn’t hold it up to me, didn’t say I’m going to kill you. But the whole time he talked to me, he had a knife in his hand.” Her team called the police, who escorted the man out of the office and charged him with brandishing a weapon in a government building.
But Booth and her employees’ safety feels even more precarious in a presidential race marked by two assassination attempts on Donald Trump and escalating rhetoric against election workers. Almost 40 percent of election officials have reported experiencing threats, according to the Brennan Center. That harassment can run the gamut from angry voters hurling insults at county clerks in their neighborhood grocery store to coordinated “swatting” attacks that deploy armed law-enforcement officers to officials’ homes under false pretenses. One 2023 study by Princeton’s Bridging Divides Initiative, a political-violence research hub, recounted officials receiving messages threatening to “shoot them or their homes, run them over, slit their throats” and “hang them from nooses.” Roudabeh Kishi, Bridging Divides’ chief research officer, says death threats are currently the most common event targeting election officials according to the nonprofit’s real-time data tracker.
And it’s women like Booth, who make up over 80 percent of election workers, that are bearing the brunt of this hostility. Ahead of Election Day, Booth has taken all the precautions she can. She registered her home with local authorities — “there’s been a lot of election officials that have their house swatted,” she says — and her husband will take the day off work so that their kids have one parent on hand, just in case.
Booth assists a visitor. Her office banned weapons after a 2016 incident where a man pulled out knife after Booth informed him that he couldn’t file paperwork to run for president.
Photo: Elizabeth Bick
“I took this job 18 years ago when it was still easygoing, but so much has changed,” she tells me. She chose to work in elections for the flexibility and the low-stress environment it provided her as a young parent. Now, not only is that workplace balance gone, but she sees her colleagues fleeing the profession in droves. Turnover in the field has been particularly severe in South Carolina, where about 80 percent of election directors are directing their first presidential elections. “People with 15 to 20 years of experience are being replaced with people with six to eight months of experience,” she tells me. “A lot of knowledge is walking out of the door, because emotionally and mentally, people just can’t take it anymore.”
Since the early 2000s, the average election official has been white, a woman, and over the age of 50. Some of them are elected; others are political appointees or regular employees for hire. Their titles, like the laws that dictate their work, vary depending on where they live. They are county clerks, registrars, auditors, and elections directors, all earning less on average than their male peers in the field. Yet they are the ones in charge of registering voters, printing and mailing ballots, managing polling locations, and, most critically, tabulating election results.
That last responsibility, coupled with election misinformation and a surge in hostility toward local government officials, have put election officials like Booth in the crosshairs on social media this year. “She has to Hang by the neck till she is Dead Dead Dead,” wrote one Colorado man who pleaded guilty to threatening election officials in Colorado and Arizona. A Philadelphia man went with the classic “Your days are numbered, B****!” when a state party official dared to recruit poll workers for Election Day. And if early voting has been any indication, the misogyny and political violence that has come to define the 2024 election has already found its way to polling sites, too. “You fucking bitch, shut the hell up and let me vote,” a South Carolina man, who was told that his “Let’s Go Brandon” hat violated rules around political apparel, spat at one female poll worker before trying to fight a different female poll worker who stepped in to try to calm him down. In Florida, an 18-year-old Trump supporter was arrested after allegedly brandishing a machete at two elderly women during an incident at a voting site.
Shauna Dozier, director of elections for Clayton County, Georgia, at her desk. “I think sometimes people forget that we’re people, too,” she tells the Cut.
Photo: Rita Harper
One Brennan Center study found that more than three in five election officials experiencing harassment have been threatened in person, vastly outpacing threats received via email, social media, and mail. Despite the severity of some of these threats, prosecutions remain relatively rare. “A lot of what we’re seeing is what we call lawful but awful,” Kishi says. “It’s awful, but isn’t necessarily illegal.” Issuing death threats is one thing, but hurling insults at election officials could be interpreted as free speech; the line isn’t always clear. Election deniers took advantage of that ambiguity during the 2022 midterm elections in South Carolina, when volunteers, egged on by the Republican candidate for secretary of state and local conservative organizations, flooded polling locations in Charleston County, determined to find proof of voter fraud. Isaac Cramer, who runs the county’s board of elections, spent the day fielding calls from panicked, mostly female poll workers who told him the aggressive voters shoved cameras in their faces and yelled at them that they were breaking the law. “Election Day for poll workers used to be about seeing your neighbors and friends,” Cramer says. “Now you look at somebody wrong and you’re accused of committing fraud.”
With the presidential election shaping up to deliver a razor-thin margin, this kind of flood-the-zone tactic will likely make an appearance again on or after Election Day — and election deniers will have the enthusiastic support of state officials in some areas. That’s what Charlotte Sosebee, an elections director in Athens-Clarke County, Georgia, is most worried about heading into November 5. Sosebee has worked in elections administration for 35 years and knows how to handle disgruntled voters, but she fears a larger, coordinated effort to undermine her work. The conservative majority that dominates the state’s election board passed new rules this fall requiring precincts to hand count all ballots on Election Night — a process experts say will almost certainly inject human error into the process — and also passed a measure granting local officials the power to delay certification by requesting a “reasonable inquiry” into the accuracy of the results. Those rules have since been struck down, but Sosebee worries the board’s rhetoric will empower bad actors to inject chaos into the certification process. She witnessed this firsthand in 2020, when one of the members of her county’s board of elections did not agree with the results she presented. (They were ultimately certified.) “I’ll do whatever I need to do to prove that the results are real and true,” she says.
Clayton County, Georgia, found itself under national scrutiny for a recount in 2020“We probably had about 100 people coming in and out of the building who wanted to know the results firsthand,” Dozier says.Photos: Rita Harper.
Clayton County, Georgia, found itself under national scrutiny for a recount in 2020“We probably had about 100 people coming in and out of the building... Clayton County, Georgia, found itself under national scrutiny for a recount in 2020“We probably had about 100 people coming in and out of the building who wanted to know the results firsthand,” Dozier says.Photos: Rita Harper.
The difference between Sosebee’s experience and Booth’s is stark. The South Carolina officials I spoke to tended to be white women representing majority-white, conservative counties with thriving pockets of election denialism. Meanwhile, the officials I spoke with in Georgia, all Black women working in diverse counties, shared fewer experiences of harassment. “We didn’t really face much of that in 2020,” Sosebee recalls. “On Election Night, we noticed that there were some people that had been observers at our polling center, and when we got ready to leave, they would follow us in our cars — I don’t know if that was to make sure that we were actually leaving the building.” Instead, they were preoccupied with political attacks from state officials. These women see their leadership as critical in a country that has long targeted Black people for participating in the franchise. “My grandmother wasn’t even able to vote,” Sosebee tells me. “That’s what makes me wake up every morning and go to work.”
In general, the experts I spoke to were concerned about high turnover rates among officials of all genders. But they expressed skepticism that we’re in the midst of a mass exodus of talent: One Bipartisan Policy Center survey of 19,000 election officials found a turnover increase of 38 percent between 2004 and 2022, a significant but relatively slow trend. Bridgett King, a political-science professor at the University of Kentucky who studies elections, shared a similar note of caution. “I don’t want to say the exodus narrative has been overblown,” she tells me. “But I will say that the majority of people leaving are white women and white people in general. For Black election officials, this is just a condition of living in the bodies they live in in America.”
That historical perspective fuels Shauna Dozier’s steely resolve. Dozier runs elections in Clayton County, the majority-Black Atlanta suburbs that in 2020 provided the deciding votes that won Biden the state and, ultimately, the White House. Twenty years before Governor Brian Kemp turned Georgia into a laboratory for voter suppression, she was a scrappy young intern in the state’s election division charged with making voting easy and accessible; in 2020, when she led the recount effort in Clayton County, Dozier found herself in the national spotlight. “We probably had about 100 people coming in and out of the building who wanted to know the results firsthand,” she says. When I asked her how it felt to lead a majority-Black county through a recount process watched closely by crowds of mostly white, out-of-town voters, she was reluctant to complain, describing the experience as just another part of the job, if “an adjustment.”
Charlotte Sosebee, head of elections for Athens-Clarke County, Georgia, in front of her office.
Photo: Rita Harper
“I think sometimes people forget that we’re people, too,” she adds. “We love what we do, we want to do the best job that we can to the best of our ability, and our goal is to ensure that we protect the integrity of the process.”
But while some election officials find comfort in rooting their experiences in a larger historical struggle, others are reaching a breaking point. Kishi of Bridging Divides told me many of these local leaders are not running for re-election or higher office; they’re afraid to participate in public events or post on social media, and that fear will deepen as they deal with Election Day and its aftermath. Not only does polling show that the presidential race is a toss-up, but one in four Trump supporters believe that, if the former president loses, he should declare the results invalid and do whatever it takes to assume office. They have spent the last eight years watching a lawless liar bully his way to the highest office in the land, spinning racism and misogyny into political gold, and they’ve applied versions of his rhetoric–from declaring government bureaucrats their enemies to bragging about dominating women whether they “like it or not” — in their communities to great success. “People can see that threats and harassment have been effective,” Kishi says. “It’s a cheap tool that gets the job done.”
Booth will get through this Election Day no matter what, but she may not stick around for another. She’s tired of looking over her shoulder. Her teenage son’s classmates — and even some of his teachers — who know what she does for work heckle him about election fraud. Her youngest daughter, though, still doesn’t know what her mother does, and Booth would like to keep it that way. “I’m not going to lie to you and say I haven’t looked for a job in the past 18 months. Something where I can get home and actually sleep at night,” she says. “At a certain point, you just can’t do it anymore.”
Election workers in their office in Athens-Clarke County, GeorgiaSosebee says that on Election Night in 2020, “we noticed that there were some people that had been observers at our polling center, and when we got ready to leave, they would follow us in our cars.”Photos: Rita Harper.
Election workers in their office in Athens-Clarke County, GeorgiaSosebee says that on Election Night in 2020, “we noticed that there were some people ... Election workers in their office in Athens-Clarke County, GeorgiaSosebee says that on Election Night in 2020, “we noticed that there were some people that had been observers at our polling center, and when we got ready to leave, they would follow us in our cars.”Photos: Rita Harper.
By submitting your email, you agree to our
Terms and Privacy Notice
and to receive email correspondence from us. This site is protected by reCAPTCHA and the Google
Privacy Policy and
Terms of Service apply.
or
Already a subscriber?
What is your email?
This email will be used to sign into all New York sites. By submitting your email, you agree to our Terms and Privacy Policy and to receive email correspondence from us.
Password must be at least 8 characters and contain:
Lower case letters (a-z)
Upper case letters (A-Z)
Numbers (0-9)
Special Characters (!@#$%^&*)
This password will be used to sign into all New York sites. By submitting your email, you agree to our Terms and Privacy Policy and to receive email correspondence from us.
You’re in!
As part of your account, you’ll receive occasional updates and offers from New York, which you can opt out of anytime.
or
Already a subscriber?
What is your email?
This email will be used to sign into all New York sites. By submitting your email, you agree to our Terms and Privacy Policy and to receive email correspondence from us.
Password must be at least 8 characters and contain:
Lower case letters (a-z)
Upper case letters (A-Z)
Numbers (0-9)
Special Characters (!@#$%^&*)
This password will be used to sign into all New York sites. By submitting your email, you agree to our Terms and Privacy Policy and to receive email correspondence from us.
You’re in!
As part of your account, you’ll receive occasional updates and offers from New York, which you can opt out of anytime.
Already a subscriber?
Already a subscriber?
`;
// integrate Sub(x) scripts and elements
if (hostname !== 'subs.nymag.com') { // do not integrate on this subdomain
document.head.appendChild(trackingScript);
document.body.insertAdjacentHTML('beforeend', subXAnimationElements);
}
There was an error processing the request. Please try again later."}).catch(e=>console.error("Error verifying email: ",e)))(r.querySelector(".content"),o.bannerCTAVerification)})):(l.remove(),s.remove()),o.dismissable||n.remove(),o.useAlertIcon||a.remove(),r.classList.add("show"),n.addEventListener("click",()=>{u(),r.classList.remove("show")})}else r.remove()}});
}, {"1":1,"6":6,"12":12,"35":35,"40":40}];
window.modules["global-nav.client"] = [function(require,module,exports){"use strict";const dom=require(4),auth=require(12),signInButton=dom.find(".user-signin"),signOutButton=dom.find(".user-signout"),globalNav=dom.find('[class^="global-nav"]'),body=dom.find("body"),dropdownItems=dom.findAll(".dropdown-wrap"),gtm=require(1),appendLandingPageParams=require(135),pageUri=require(124).getPageUri(),subscriptionPromoLinks=dom.findAll(".persist-params"),searchString=window.location.search||"";function closeDropdowns(e){let n=globalNav.querySelectorAll(".dropdown.open");dropdownItems.forEach(function(t){let o=t.querySelector(".dropdown");!n||t.contains(e.target)&&27!==e.keyCode||o.classList.remove("open")})}function gtmSendReport(e,n,t){let o={eventCategory:"ecommerce",eventAction:"componentClick",brand:e,dimension23:"global-nav",list:pageUri,pageZone:"header",variant:"nav-link"};"global-nav-link"===t&&(o.eventLabel=n.href),gtm.reportNow(o)}function updateElementTargetUrlsIfQueryStrings(e){if(searchString){const n=new URLSearchParams(searchString);let t=e.href;if(t.includes("?")){const o=t.split("?"),i=new URLSearchParams(o[1]);for(let e of n.entries())i.set(e[0],e[1]);t=`${o[0]}?${i.toString()}`,e.href=t}else e.href=`${t}?${n.toString()}`}}function init(e){const n=e.querySelectorAll(".to-landing-page");window.addEventListener("auth:init",()=>{signInButton.addEventListener("click",function(e){e.preventDefault(),auth.showEmbeddedLoginFlow("top navigation")}),signOutButton.addEventListener("click",function(e){e.preventDefault(),gtmSendReport("Sign Out",e.target,"user-info-link"),auth.logout()}),auth.isAuthenticated()&&e.classList.add("signed-in"),auth.isSubscriber()&&e.classList.add("subscribed"),e.querySelectorAll(".user-link").forEach(e=>{e.classList.add("active")}),subscriptionPromoLinks.forEach(e=>{updateElementTargetUrlsIfQueryStrings(e)}),appendLandingPageParams(n)})}dropdownItems.forEach(function(e){e.addEventListener("click",function(){e.querySelector(".dropdown").classList.toggle("open")})}),body.addEventListener("click",closeDropdowns),document.addEventListener("keydown",closeDropdowns),globalNav.addEventListener("click",function(e){let n=e.target;n.classList.contains("global-nav-track")&>mSendReport(n.text,n,"global-nav-link")}),module.exports=init;
}, {"1":1,"4":4,"12":12,"124":124,"135":135}];
window.modules["aaa-module-mounting.legacy"] = [function(require,module,exports){"use strict";const _pickBy=require(221),_each=require(406),Fingerprint2=require(408),DS=require(407),Eventify=require(246);function registerGlobals(){window.DS=DS,window.Eventify=Eventify,window.Fingerprint2=Fingerprint2,DS.value("Eventify",Eventify),DS.value("Fingerprint2",Fingerprint2),DS.value("$document",window.document),DS.value("$window",window)}function mountDollarSliceComponents(){DS.service("components",["$document","$module",function(e,n){var o=_pickBy(n.definitions,e=>e.providerStrategy===n.providers.controller),r=Object.keys(o);function t(e){return o=>{try{n.get(e,o)}catch(e){logMountError(o,e)}}}_each(r,n=>{var o=e.querySelectorAll('[data-uri*="/_components/'+n+'/"]'),r=e.querySelectorAll('[data-uri$="/_components/'+n+'"]');_each(o,t(n)),_each(r,t(n))}),this.components=r}]),DS.get("components")}function logMountError(e,n){const o=e.outerHTML.slice(0,e.outerHTML.indexOf(e.innerHTML));console.error("Error attaching controller to "+o,n)}registerGlobals(),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{mountDollarSliceComponents()}):mountDollarSliceComponents();
}, {"221":221,"246":246,"406":406,"407":407,"408":408}];
window.modules["ads.legacy"] = [function(require,module,exports){"use strict";const _map=require(118),_forEach=require(107),_isString=require(268),_intersectionWith=require(409),_isEqual=require(274),_each=require(406),_debounce=require(182),_sortBy=require(205),page=require(124),visit=require(114);DS.service("adService",["Eventify","$cid","$document","$window",function(e,t,a,i){var o,n,s,r,d,c,u,l,g={},p=this,h=[],f=visit.getQueryParamsObject(["utm_campaign"]),m=document.querySelector('script[data-type="ad-a9"]'),b=[],w=!1,v=[],y=document.querySelector('script[data-name="ad-doubleverify"]');document.querySelector('script[data-name="concert-ads"]')||(i.NYM={},i.NYM.analytics={},i.NYM.analytics.adStartTime=i.performance.now(),i.googletag=i.googletag||{},i.googletag.cmd=i.googletag.cmd||[],u=i.googletag,(m||y)&&(i.googletag.cmd=i.googletag.cmd||[],i.googletag.cmd.push(function(){i.googletag.pubads().disableInitialLoad()})),m&&(l=i.setInterval(function(){void 0!==window.apstag&&void 0!==window.apstag.timeout&&(i.clearInterval(l),window.apstag.cleared=!0,l=null)},10),setTimeout(function(){l&&(i.clearInterval(l),i.googletag.pubads().refresh(),window.apstag||console.log("MESSAGE: Timeout for A9 load exceeded, aborting"))},500)),y&&(b.push(new Promise(function(e){w?e():v.push(e)})),c=i.setTimeout(T,2500)),o=function(e){var t,a,o=e.data,n=[];return o.loaded?e:(o.loaded=!0,t=null,(t=o.sizes?u.defineSlot(o.name,o.sizes,o.id).addService(u.pubads()):u.defineOutOfPageSlot(o.name,o.id).addService(u.pubads())).setTargeting("adid",o.id),f.hasOwnProperty("utm_campaign")&&t.setTargeting("utmcamp",f.utm_campaign),a=p.getAdCount(o.label),t.setTargeting("label",o.label+"_"+o.site+"-"+a),u.display(o.id),u.pubads().addEventListener("slotOnload",function(){i.NYM.analytics.firstAdLoadTime||(i.NYM.analytics.firstAdLoadTime=i.performance.now(),i.NYM.analytics.firstAdLoadLabel=e.data.label)}),n=_(o),Promise.all(b).then(function(){n?window.apstag&&window.apstag.cleared?window.apstag.fetchBids({slots:[n],timeout:window.apstag.timeout},function(){u.cmd.push(function(){window.apstag.setDisplayBids(),u.pubads().refresh([t],{changeCorrelator:!1})})}):y&&u.pubads().refresh([t],{changeCorrelator:!1}):u.pubads().refresh([t],{changeCorrelator:!1})}),e.slot=t,e)},n=function(e){var a,i,o,n=t(),s=e.getAttribute("data-name"),r=e.getAttribute("data-sizes"),d=e.getAttribute("data-label"),c=e.getAttribute("data-site");n=e.id,r&&r.length?(r=r.split(","),a=[],_map(r,function(e){e=e.split("x"),i=parseInt(e[0]),o=parseInt(e[1]),a.push([i,o])})):(e.classList.add("oop"),a=!1),this.data={id:n,name:s,sizes:a,loaded:!1,label:d,site:c},g[n]=this},r=function(e){u.cmd.push(function(){var t=o(e);g[e.data.id]=t})},s=function(e){var t=[];e.slot?(t=_(e))&&window.apstag&&window.apstag.cleared&&window.apstag.fetchBids({slots:[t],timeout:window.apstag.timeout},function(){u.cmd.push(function(){window.apstag.setDisplayBids(),u.pubads().refresh([e.slot],{changeCorrelator:!1})})}):e&&r(e)},u.cmd.push(function(){var e,t,o,n=page.getMeta("article:tag"),s=page.getMeta("author"),r=i.location.href,d=(e=a.head.querySelector(".head-gtm"),t=a.body.querySelector(".gtm"),e&&"top"===e.getAttribute("data-gtm")?"gtmtop":t&&"bottom"===t.getAttribute("data-gtm")?"gtmbottom":"");o=[],_forEach([n,s,d],function(e){_forEach(e.split(","),function(e){(e=e.trim().toLowerCase().replace(/\s/g,"-").replace(/\'|\’/g,"")).length&&o.push(e)})}),u.pubads().setTargeting("kw",o),u.pubads().setTargeting("entry_group",o),r=r.slice(r.lastIndexOf("/")+1),u.pubads().setTargeting("pn",r),u.companionAds().setRefreshUnfilledSlots(!0),u.pubads().enableAsyncRendering(),u.enableServices()}),this.load=r,this.create=function(e){return new n(e)},this.refresh=function(e){var t;_isString(e)?(t=this.getById(e),s(t)):s(e)},this.remove=function(e){var t=e.data.id;a.getElementById(t).innerHTML=""},this.getAdCount=function(e){var t,a=0,i=Object.keys(g);return _each(i,function(i){(t=g[i]).data.loaded&&t.data.label===e&&a++}),a},this.getById=function(e){return g[e]},d=_debounce(function(){var e={TopLeaderboard:1,RightColTopMPU:2,outOfPage:99,"homepageTakeover/TopLeaderboard":1},t=_sortBy(h,function(t){return e[t.data.label]||10});_forEach(t,function(e){return e.data.sizes?r(e):i.setTimeout(function(){r(e)},2e3)}),y&&window.PQ.cmd.push(()=>{try{window.PQ.loadSignals(["ids","bsc","vlp"],T)}catch(e){T(),console.error(`There has been an error loading Double Verify signals: ${e}`)}}),h=[]},10),this.addToPageLoadQueue=function(e){h.push(e),d()});function _(e){var t,a=e.sizes;return a=_intersectionWith(a,[[970,250],[970,90],[728,90],[300,600],[300,250],[320,100],[320,50]],_isEqual),e.sizes&&e.sizes.length&&(t={slotID:e.id,sizes:a,slotName:e.label}),t}function T(){i.clearTimeout(c),w=!0,_forEach(v,function(e){e()})}}]);
}, {"107":107,"114":114,"118":118,"124":124,"182":182,"205":205,"268":268,"274":274,"406":406,"409":409}];
window.modules["cid.legacy"] = [function(require,module,exports){"use strict";DS.service("$cid",function(){var r=Math.floor(100*Math.random());return function(){return"cid-"+ ++r}});
}, {}];
window.modules["client.legacy"] = [function(require,module,exports){"use strict";require("cid.legacy"),require("ads.legacy"),require("facebook.legacy"),require("aaa-module-mounting.legacy");
}, {"cid.legacy":"cid.legacy","ads.legacy":"ads.legacy","facebook.legacy":"facebook.legacy","aaa-module-mounting.legacy":"aaa-module-mounting.legacy"}];
window.modules["facebook.legacy"] = [function(require,module,exports){"use strict";DS.service("facebook",[function(){this.fb=function(i){window.FB&&window.FB[i].apply(this,Array.prototype.slice.call(arguments,1))}}]);
}, {}];
require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o typeof key === 'string' && key.match(/\.legacy$/)).forEach(key => window.require(key));
}
function tryToMount(fn, el, name) {
try {
fn(el); // init the controller
} catch (e) {
const elementTag = el.outerHTML.slice(0, el.outerHTML.indexOf(el.innerHTML));
console.error(`Error initializing controller for "${name}" on "${elementTag}"`, e);
}
}
/**
* mount client.js component controllers
*/
function mountComponentModules() {
Object.keys(window.modules).filter(key => typeof key === 'string' && key.match(/\.client$/)).forEach(key => {
let controllerFn = window.require(key);
if (typeof controllerFn === 'function') {
const name = key.replace('.client', ''),
instancesSelector = `[data-uri*="_components/${name}/"]`,
defaultSelector = `[data-uri$="_components${name}"]`,
instances = document.querySelectorAll(instancesSelector),
defaults = document.querySelectorAll(defaultSelector);
for (let el of instances) {
tryToMount(controllerFn, el, name);
}
for (let el of defaults) {
tryToMount(controllerFn, el, name);
}
}
});
}
// Make sure that a `window.process.env.NODE_ENV` is available in the client for any dependencies,
// services, or components that could require it
// note: the `` value is swapped for the actual environment variable in /lib/cmd/compile/scripts.js
window.process = window.process || {};
window.process.env = window.process.env || {};
if (!window.process.env.NODE_ENV) {
window.process.env.NODE_ENV = '';
}
// note: legacy controllers that require legacy services (e.g. dollar-slice) must
// wait for DOMContentLoaded to initialize themselves, as the files themselves must be mounted first
mountLegacyServices();
mountComponentModules();
// ]]