Joe Biden’s Dobbs Response Has Been Breathtakingly Awful
Why can’t the president show some fight?
ByRebecca Traister,
writer-at-large for New York Magazine and the Cut
Photo: MANDEL NGAN/AFP via Getty Images
Photo: MANDEL NGAN/AFP via Getty Images
This weekend, the Washington Post published an article that chronicled the lumbering strategy of Joe Biden’s administration in the aftermath of the Supreme Court’s overturning of Roe v. Wade. The story describes how, rather than ringing every alarm available, rather than taking every opportunity to signal that we are in a moment of national emergency, the president is instead pointing a vilifying finger — not at the Republican Party (no, he referred to them as his “friends” in his news conference on Friday), but at the very people who have been fighting with every fiber of their being to keep abortion access a reality. Joe Biden is talking tough to the activists.
As the White House’s departing communications director, Kate Bedingfield, said in a statement conveying her boss’s attitude toward those pushing him to act more aggressively in response to Dobbs v. Jackson Women’s Health Organization: “Joe Biden’s goal in responding to Dobbs is not to satisfy some activists who have been consistently out of step with the mainstream of the Democratic Party. It’s to deliver help to women who are in danger and assemble a broad-based coalition to defend a woman’s right to choose now, just as he assembled such a coalition to win during the 2020 election.”
The statement was breathtaking in its awfulness, including its emphasis on coalition-building in service of Joe Biden’s election, emphasis that served to dismiss the advocates who have themselves been a key part of electing Democrats over generations. Worse, by casting activists as “out of step with the mainstream of the Democratic Party,” the Biden administration did the right wing’s job for them: presenting those fighting for human rights as fringe radicals, rather than as people working to provide literal health care, legal support, travel funds, and housing to patients requiring abortions. And they made this “out of step” assessment about a party (and a nation!) in which a vast majority believes that abortion should be legal.
It was a case study in how, while Republicans treat their violent, racist, misogynistic, homophobic, and transphobic activist branch as the guiding lights of their party’s future, Democratic leadership reflexively treats its activist flank — very often people advocating for more humane policies for more people — as the enemy.
The statement was so egregious that this weekend, while talking to the press pool, Biden seemed to walk it back, saying, “Keep protesting. Keep making your point. It’s critically important. We can do a lot of things to accommodate the rights of women.”
But that was ass-covering. The statement from Bedingfield was the real deal, vintage, uncut Joseph Robinette Biden, and the way you can tell is by its middle part, nestled between the casting out of advocates and the call to vote harder this fall: the part where she describes Joe Biden’s goal as being “to deliver help to women who are in danger.”
We know that guy, who has always understood the fight for gender equality as one in which he plays gallant knight, stepping in to save some imperiled women. Activists? Out-of-step weirdos. Joe Biden? Why, he’s just here to deliver help to women in danger.
This is the Joe Biden who in 1991 failed to defend Anita Hill from dehumanizing attacks made by his Republican friends on the Senate Judiciary Committee or call any of the three women willing to corroborate her account of having been sexually harassed by Clarence Thomas, but later tried to make feminist amends by writing the Violence Against Women Act, a piece of legislation via which, the way he often framed it, he was protecting endangered women — a more comfortable approach than, say, providing vigorous defense of a woman’s right to come forward with damning testimony that might imperil the prospects of a powerful peer or roil his Republican colleagues.
This is the Joe Biden who, in the year of our Lord 2019, told two young brothers of a 13-year-old girl he met on the presidential campaign trail, “You’ve got one job here, keep the guys away from your sister.” The guy who appeared at a 2016 White House Summit for Women and Girls and gave a hellacious speech full of lurid, horror-movie details of women and girls in distress: “stone drunk” college “coeds” being “dragged” into the rooms and raped; the sliding door of the garden apartment through which an assailant entered; a brother who found his assaulted sister “in the corner, stark naked and shivering.” That day, he described how he is regularly told, “Mr. Vice-President, thank you. I’ve been raped. I didn’t think anybody listened.”
This is the Joe Biden who in the Friday press conference announcing an executive order on abortion protections predictably homed in on the widely reported story of a 10-year-old who had been raped and could not get the abortion she needed in Ohio, traveling instead to Indiana. “Ten years old,” Biden said. “Ten years old! Raped, six weeks pregnant … forced to travel to another state.” (There is no indication that the Biden administration sought out or intervened on this girl’s behalf).
But this is how Biden can engage with a battle over gender equity: when women can be presented as traumatized, infantilized, grateful for his promises of protections. Here’s what he can’t engage: when activists angry about the loss of their rights get mad at him.
The protective pose isn’t just annoying or retro or specific to good old Uncle Joe. It gets to the heart of old battles waged over abortion for years. It’s tied to the paternalistic concept that abortion is a “decision that should be made between a woman and her doctor,” (a phrase Joe Biden actually uttered in his press conference on the day that Roe was overturned), or perhaps between a woman and a member of the clergy, or between a person who needs an abortion and the state. It’s at the heart of the attitude that a person who can be pregnant, and who might therefore need or want to end that pregnancy, cannot simply get access to that procedure by their own damn self, without consultation or permission from anyone else.
This attitude undergirds everything from the comparatively well-intentioned “between a woman and her doctor” arguments, to punitive state regulations about parental notification and enforced transvaginal ultrasounds, to the odious Hyde Amendment, which Biden supported in his youth and which has dictated since the 1970s that people cannot use state insurance money to pay for abortions because the state doesn’t care for that kind of health care.
The protective approach is rooted in the idea that women and other people capable of pregnancy are not equipped to live as full and equal human beings, to make their own decisions or evaluate their own circumstances without the interference or approval of some higher official. It’s rooted in the same instinct that leads someone to assume a 13-year-old girl needs to be protected from her own sexuality by her brothers.
It’s not just Joe Biden. Protectionism is one of the fraught and complicated aspects of the conversation many are now having about abortion. In the wake of Dobbs, we are hearing about the worst and most traumatic cases of abortion denied: children who’ve been raped, life-threatening ectopic pregnancies, pregnant people whose water has broken before viability, but cannot get the treatment they need to end their pregnancies if there is still a fetal heartbeat, and therefore risk infection and sepsis. These stories are very real, the suffering they describe horrific and unjust.
But those stories are the loudest in part because they conform to an old frame in which the battle is not for equality but for protection of the vulnerable. The stories must be told — they illustrate the depths of the inhumanity — but in fact the inhumanity is also there if you’re just talking about a healthy 30-year-old who wants to end a pregnancy for non-tragic reasons yet is denied because the state doesn’t treat her with dignity. A singular focus on the plight of the most besieged cases obscures a fuller and equally compelling moral argument: that those who require abortion services and all other forms of reproductive-health care aren’t just distressed; they are fully human and therefore owed their rights.
But Biden’s worldview has always been one in which the authority figures put their heads together to sort out these kinds of messes for those denied comparable authority. As he famously recalled of his early Senate days and his relationship with segregationist Dixiecrats like James O. Eastland, they used to “argue like the devil” and “then you’d go down and have lunch or dinner together. The political system worked.”
It was particularly rich, in the Post story, to read some of Biden’s defenders complain about how unfair it was to expect Biden to fix in two weeks what has been in the works for half a century. “The decision we have feared for nearly 50 years finally happened,” Scott Mullhauser, a former Biden adviser, told the paper, arguing that “moments like it are too often laid on the White House, as if they had a magic want to fix it all, rather [than] just insufficient votes in Congress and a regressive Supreme Court majority.”
Jennifer Palmieri, a former White House communications director under Barack Obama, said, “Those people had a 40-year-plan to overturn Roe and they did it … if you’re thinking that it can be solved by a president taking any action in the course of the two weeks after the decision, then you’re not appreciating what a big fight it is and what a precarious moment it is.”
Except that it is a very fair appreciation of our precarious moment to note that our current president has been in power in the Democratic Party for all of the years in which members of the opposition party were hatching their 40-year-plan.
Biden came to the Senate in January of 1973, the same month that Roe was decided. He has not spent the years since impotent. Biden served as chair of the Senate Judiciary Committee, where he had a hand in shaping the current Supreme Court; the Thomas hearings of course ended with Thomas’s ascension to the Court, where he authored the terrifying Dobbs concurrence arguing that the Court should “correct the error” made in other cases that have protected the right to contraceptive access, same-sex partnerships, and marriage equality. Biden authored the 1994 crime bill that worked to expand the carceral system into which so many abortion seekers and providers will now be directed. (Months after the Dobbs oral arguments, Biden failed to say the word “abortion” in his State of the Union address, but did say “fund the police” — the police who will now, in many jurisdictions, be in charge of investigating claims related to criminalized abortion.)
Biden began his time in office opposed to abortion and has evolved since then, but into the 1990s and 2000s, he routinely failed to support the Freedom of Choice Act, which would have banned many oppressive state abortion restrictions. He wrote in his 2007 memoir, again underscoring his fetishized view of imperiled young femininity, “I’d like to make it easier for scared young mothers to choose not to have an abortion.” Yet as president, he quickly folded in the fights for paid leave, child care, and the extension of the Child Tax Credit, which he had vowed to make the very pillars of his administration.
Biden has spent all but four of the years that Republicans have been plotting to overturn Roe in powerful elected office; he has been senator, vice-president, and president. He didn’t just have two weeks to figure out his response to Dobbs; he had a decade since the rise of the Tea Party; six years since his Republican buddies stole a Supreme Court seat from his popularly elected boss; two years since the death of Ruth Bader Ginsburg and the swift confirmation of her successor, Amy Coney Barrett; seven months since the oral arguments in Dobbs; and six weeks since he was handed a once-in-a-lifetime cheat sheet via a leaked draft of the Dobbs opinion.
He had about as much of a head start on this as anyone, and still he is the leader who — on the day that the Dobbs decision came down — had been planning to announce his appointment of a conservative anti-abortion judge to a lifetime spot in Kentucky.
Via an executive order, Biden has directed the Department of Health and Human Services to protect access to medication abortion, and guaranteed patients’ rights to emergency medical services. He has also announced (vague) commitments to protecting patient data and new safety measures for clinics, and has vowed to work to preserve access to contraception. Biden also announced a willingness to support filibuster reform in order to codify Roe legislatively.
This is all fine and good. But it was late in coming, and not at all enough. A Politico story published on Monday suggests that the administration’s timidity stems from fears that acting aggressively will draw lawsuits from the right and ultimately end in defeat in the hands of courts. Well … yes. That is, as they say, the point. A fascistic opposition party has seized control of the institutions and gone all in on supporting an armed insurrection in order to ensure minority rule. That’s how they’re fighting, and the right’s willingness to keep at it, even in periods in which they were losing, is how we landed here.
The fact that Biden can’t seem to discern this, in the context of the appallingly flaccid response to Dobbs, has prompted me to think a lot about the writer Jia Tolentino’s dawning suspicion, for the first time in her life, “that, actually, the Democrats are not interested at all in protecting the right to abortion.”
I’m not yet where Tolentino is. I have been watching other politicians, before Dobbs and since, take creative and assertive action: putting ideas out there, telling stories, defending the right to furious protest, expressing urgency, and making morally compelling arguments. These politicians include Barbara Lee, Alexandria Ocasio-Cortez, Gretchen Whitmer, Elizabeth Warren, Cori Bush, and Pramila Jayapal. We can vote for a more energetic group of leaders who can conceive of this period as a battle for the so-far-unmet promises of this country: democracy, dignity, equality, freedom. All in the face of violent, fascistic opposition.
To criticize Biden is not to suggest that his bad leadership is the root cause of Roe’s overthrow, rather that leadership like his, over five decades, has permitted Roe’s opponents to advance. Yes, vote. Absolutely vote. Vote for leaders willing to commit to a more clear-eyed, urgent, and muscular fight against a terrifying enemy; not on behalf of Joe Biden but in spite of him.
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(3),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(136),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,"3":3,"12":12,"124":124,"136":136}];
window.modules["aaa-module-mounting.legacy"] = [function(require,module,exports){"use strict";const _pickBy=require(221),_each=require(408),Fingerprint2=require(407),DS=require(406),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(408),_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,"408":408,"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","aaa-module-mounting.legacy":"aaa-module-mounting.legacy","ads.legacy":"ads.legacy","facebook.legacy":"facebook.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();
// ]]