Brian Letscher as Secret Service Tom.
Photo: Eric McCandless/ABC
#Gladiators, it is a testament to how much I love Scandal and how much I love you all that I’m in my hotel in Minneapolis watching and recapping Scandie instead out in the streets looking for Prince and his buttless chaps. I chose y’all over him, so don’t ever say I haven’t done anything nice for you.
I’m not entirely sure how I feel about “Wild Card.” There were some good elements for sure — Cy being evil! — but overall, I’m just not sure where this is going. Rowan is maybe up to something shady … again. Liv is jealous of what Fitz and Jake are doing in their private lives … again. David is leading Susan on … again. What will it all add up to by season’s end? Fingers crossed that it’s something unexpected, but I don’t know.
Liv has to lose to Rowan, or there is no show. Olake and Olitz can never be done, or there is no show. Cy’s evil plan has to get foiled in the end, or there is no show. See what I’m getting at? Maybe I’m jumping the gun, but I’m not convinced anything new is going to happen this season. I’m still along for the ride, though. And luckily, this episode had a few surprises to keep me entertained and hoping for the future. Let’s get to it, shall we?
We begin with Lillian and Fitz making out in the presidential towncar and I’m mildly turned on. Fitz is still hot, but Lillian is about as interesting as a plate of broiled cauliflower. Why is she here? Fitz could just fap to old episodes of The Ricki Lake Show and it would be more interesting than this. I get it, I guess. Guy needs to get laid so he can forget about Olivia.
Anyway, they keep making out. Abby rolls up in the car, completely giving negative effs about manners, and tells Fitz she needs to talk about a very urgent matter. Uh oh. Lillian bounces and Abby says they need to talk about “wild card.” Fitz doesn’t know what this means — again, how is he the president?! — and Abby tells him that it’s fine if he wants to smash random broads, a.k.a. wild cards, but he needs to make sure certain protocols are in place. He’ll need Secret Service details, drivers, and ambulances on call in case anything should happen. They’ll need to sweep her apartment for his DNA. Of course, Fitz is annoyed to hear this.
You know what? I. Am. Done. With. This. Every week, he’s always doing some garbage he’s not supposed to be doing and living recklessly. Does he not remember he was almost assassinated? Does he not remember that his son was killed? He acts like he’s working guacamole duty at Chipotle, a.k.a. living that low-stakes life. He is the President of the United States. People just want to keep him alive. If he wants to hookup with someone, all he has to do beforehand is send a text that is just, “Yo, I’mma about to put this eggplant emoji in a donut emoji. Make sure no one kills me while I’m doing that. Totes preesh.” He kicks Abby out of the car and says to never bring this up again. Okay. When Lillian turns out to be shady or someone steals an eyebrow hair he left behind at her place after boning and uses his DNA to bring down the republic, I better not hear shit from Fitz. Moving on.
Sally is on her game, doing what she do on The Liberty Report and throwing shade at the government. Meanwhile, Liv is showing Rowan a copy of Mellie’s manuscript. Wait. Two weeks ago, she was cussing her dad out for being trifling. Now she and him are reveling in the success of the book being leaked? LOL. These two are like Tidal music service: Will never work, not worth a damn, but they keep trying in the face of continual failure. Anyway, Rowan needs a favor and it involves Jake. Papa Pope tells Liv that Jake the Bae is seeing someone else. Liv says she doesn’t care. He backs off and says he just wants what’s best for his kids. Um, if he calls them both “kids” that makes Olake’s relationship hella incestual. I’m super not into that.
VP Susan announces her campaign for president. David and Lizzie watch on TV and Lizzie tells David to answer Susan’s call. He does. She’s so in love with him, you guys. She invites him over for dinner. Susan doesn’t deserve this. You know who else is undeserving of hot garbage? Huck, which is why he rolls up to Liv’s place and is like, “You gotta be collecting intel on Jake and Rowan, right? Because why else would you be starting up with them again, especially because Jake works for Rowan.”
I mean, is Huck the only person with any sort of sense on this show? (Okay, Huck and Abby.) Does Liv think that she can handle her dad alone? Why is she keeping Huck in the dark? He has been the most loyal to her out of everyone on the show. She is defending Jake the Bae and Rowan and saying they are being chill. Poor Huck and poor Liv. She doesn’t know what the hell is going on.
We catch up with Cy and his assistant. They’re talking about Governor Hottie, a.k.a. Governor Francisco Vargas, who can put his platanos emoji in my donut emoji any day of the week. (Too far, I know.) Governor Hottie is pretty dope and has high approval ratings with both Democrats and Republicans. The caveat? Apparently, there isn’t one. Hmm, this is Scandal. Something’s up with this guy. And I think Cy is going to investigate. He asks to be alone. Once he’s alone, Secret Service Tom comes out of the shower. WUT? These two are teaming up to make this guy the president?! I guess so, because Tom leaves to blackmail some nerdy dude named Wayne into doing work for Cy.
Across town, Olake finish boning and she’s like, “So you’re seeing someone.” Oh boy. She says she doesn’t care, but wants to know who the woman is and if it’s serious. Jake says she’s special, so this heaux is going to end up dead. Every time Jake tries to move on with his life, someone dies. At the White House, Fitz is acting like a punk by giving Abby the silent treatment. Eyeroll. He then calls Lillian and asks her out on a date, but doesn’t bother making the protocol plan first. At this point, I’m totally fine if someone kills Fitz. He’s being ignorant and selfish. He is an oxygen thief and the world would be better off if he ended up six feet under.
Charlie and Quinn are babysitting Charlie’s friend’s son. Snooze. Onto something more exciting. David finally puts his foot down and says, “We can’t bang when I know that Susan is in love with me.” YAY! Wait … oh. Oh no. He just wants to not sleep with Lizzie and then go sleep with Susan in the same day. That is only polite. Lizzie doesn’t care and they have sex. Cut to me like:
Rowan and Liv are having dinner and he claims he enjoys being retired. Mmm-hmm. I don’t think she’s buying it. Next, we see Wayne arrive at the Pennsylvania Capitol building. Tom goes in behind him and shoots a bunch of the guards and then hands Wayne the gun. Governor Hottie is like, “Lemme handle this,” and then he sees Wayne point the gun. And then, a flashback tells us that GH is the target? Huh? I’m confused. Maybe Cy wants him to get attacked, so he’ll end up in the papers and people will finally know who this guv’nah is?
I was right! Damn, Cy is shady as hell. He tells Abby to alert Fitz, so he can talk about it to the press. She goes to the residence without knocking, and barges in on a shirtless Fitz macking on Lillian. Lillian bounces, then Fitz and Abby duke it out. Fitz thinks that Abby is just mad he’s not boinking Liv because Liv was Abby’s power grab — get a grip, bro — and Abby is like, “Nah, I’m mad because Liv was family and knew all our secrets because she was trustworthy. No one knows who this Lillian heaux is and when she’s not trying to ride your D, she’s out here like”:
Abby has a point. After two dates, how does Lillian already know her way around the residence? Why is Fitz so chill about gallivanting with this woman? He is being so cavalier and that is dangerous. He tells Abby to stay out of his life or he will fire her. Umm, Fitz? YouAreAFuckboi.edu/SummerElectives.
At this point, Wayne is all over the news and Charlie doesn’t want the kid to see it. Okay, the kid is Wayne’s son! I think Charlie is well aware of what Wayne was up to. Yikes. Across town, Olake are post-coital again. She asks him if he thinks Rowan has changed for the better. Jake says he’s not getting in the middle of it. Jake is like, “Rowan is being chill.” Liv is like, “Papa Pope is up to something.” Jake leaves to go to work on the GH/Wayne shooting. Abby calls Liv and tells her about Fitz. UH. OH. Without saying a word, Liv understands that Fitz has moved on with someone else. She’s sad even though she’s hooking up with Jake on the regs. I’m not even going to entertain this foolishness. Liv can’t have it both ways. She can’t dump someone, get a quasi-boyfriend, and then be mad when her ex finally takes the Charlotte’s Web off his peen and gets laid. Moving on.
Jake reports to Cy and Fitz that Wayne is acting alone. Snipers are in place, ready to kill Wayne. Cy looks concerned. UH! Didn’t he think this plan through? Did he think the police were just going to let Wayne off free so he could go to Dave & Buster’s to play Duck Hunt? Everyone on this show has turds for brains. Cy leaves and calls Tom. He’s pissed that Wayne hasn’t shot GH yet, and he’s worried that a sharpshooter will kill Wayne first. If he dies, that will be the headline. LOL. That’s even worse than Cy having turds for brains. Cy is so maniacal and evil and I love it. Anyway, Tom is like, “Get off my back. Wayne will handle it.” Cy tells Tom to make it happen.
Liv storms into OPA and cusses Huck out. LOL. This. Bish. Huck needs to put in his two weeks’ notice because girlfriend does not appreciate him. He’s looking out for her and she’s getting pissy about it. Why? Because deep down, she knows he’s right and she’s like, “I can never beat my dad. He always win.” Damn. She goes on to state that at the end of the day, her dad will never hurt her. Huck is like, “You think Rowan has your back? He is a monster and he will eat you alive.”
Once again, Huck is bringing that hot fire. Huck is the MVP of this episode. We cut back to GH and Wayne. GH is trying to talk Wayne down, and then Tom holds up a gun. We hear a shot, but we don’t see who fired! Then we see the news footage. It was Tom who fired, but the camera doesn’t capture it. While Wayne is distracted, GH tackles him. So, Cy gets his hero. Cy is one crazy mofo. And for some reason, Governor Hottie is being escorted out of the building without a shirt. Two thumbs and a labia up. (Again, too far, I know.) The next day, GH is all anyone can talk about, but that might change soon …
Because someone has photos of Lillian at the crib with Fitz. Abby shows Fitz the photos. He’s like, “Just say we were discussing a news item.” LOL. Lillian’s hair all disheveled and the media will spin it that Fitz was hooking up while GH was held captive. Abby tells him that she is only trying to protect him and his job. She then says if you want to fire me, then fire me. He doesn’t. And he’s like, “Thank you.” NOOOOPE. He acts like a brat the whole episode, and then is like, “Okay, I get it. We cool.”
We cut across town. David did sleep with Susan. Nope. This is boo-boo. Lizzie calls and she seems butthurt that Susan is still there. Ugh, Lizzie. Meanwhile, Cy is hella happy at work and tells Abby that if she wants to distract from the Lillian/Fitz photos, she should bring Governor Hottie in to meet Fitz. The press will go wild. Wow. Cy’s plan is perfect.
We see Charlie with Max, Wayne’s kid. Max is going into a police station. Hmm. Next, we go to OPA. Liv wants to see Huck and Quinn. Liv asks for a background check on Vanessa Moss. She is the woman Jake is seeing. Okay, so Liv is officially taking Huck’s advice and finding out what Jake is up to. I like it. We end on Cy and Governor Hottie meeting at the White House for the first time.
Alrighty, what did you think of tonight’s episode? Were you as ho-hum about it as me? When do you think Cy’s plan will start to unravel? And just what the heck are Charlie and Max up to?
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();
// ]]