Watching a Michael Bay movie is not only about witnessing the many things he likes: fast cars, big explosions, blue and teal color palettes, hot bods, low angles, American flags. They’re about going through the looking glass of American grotesquerie, where the cinematic indulgence is the point. His latest movie, Netflix’s ensemble assassin movie 6 Underground, starring Ryan Reynolds, is a reckless blast specifically because it is filled with that movie magic known as “Bayhem” — action and destruction that only Bay could deliver on the scale that he does, whether it’s an extensive car chase that destroys Italian art in the process, or a big high-rise sequence seemingly built around his love of smashing glass. Love or hate his movies, it’s impossible to deny that Bay doesn’t have his own aesthetic, which is something that plenty of directors — even Bay’s fellow filmmakers in the Criterion Collection — can’t readily claim.
In honor of 6 Underground and its mastermind, we’ve assembled a list of 18 moments from Michael Bay’s directorial career that define his unique place in action cinema. That includes all of his Transformers movies, Bad Boys, The Rock, and plenty of other films that have brought mayhem to screens across the country.
18. Transformers: Revenge of the Fallen
A very, very big explosion in Egypt
This battle royale set among Egyptian ruins has a lot of Bay qualities that can be numbing — massive robots fighting over some literal plot device, American soldiers adding to the fire power, and Shia LaBeouf and Megan Fox screaming as they dash away from one big boom to the next. But the biggest takeaway — other than the robot balls joke that John Turturro makes while clinging to the Great Pyramid of Giza — is one very special, record-breaking explosion. The climactic, dazzling air strike toward the end of this scene is like Bay’s own Apocalypse Now, and even won him a Guinness World Record for the largest explosion with actors present (a record that has since been beat by the 2015 James Bond movie Spectre).
17. 13 Hours: The Secret Soldiers of Benghazi
Mortar attack
Though 13 Hours sits out awkwardly in Bay’s filmography as a bungled attempt to be taken seriously, his take on the incident at Benghazi leads with his signature style. With in-your-face filmmaking and a constant air of combat, it’s prime Bay. The mortar-attack scene best captures it — first, it’s the shot that follows a mortar from its launch to its target, just like the bomb in Pearl Harbor (also on this list). Then, it’s a soldier (played by James Badge Dale), running in extreme slow motion, sparks flying in his face, right before another one drops and creates a visceral explosion that Bay shows from multiple angles. Within the chaos and questionable politics of 13 Hours, Bay’s visual relationship to warfare stands out.
16. The Island
Hover-bike highway chase
In Bay’s 2005 rip-off of Logan’s Run, sexy clones played by Scarlett Johansson and Ewan McGregor spend a lot of time on the lam, causing the director’s thrill-ride inclinations kick in. The film’s center chase is the highlight, taking its protagonists from the back of a Mack truck to a hover bike (dodging air monorails!) to the side of a tall building. Inspired destruction arises when our heroes push giant metal train wheels from the back of the truck onto the freeway, which rip through the cars of the bad guys in pursuit. (Bay later reused some of this destruction for Transformers: Dark of the Moon.)
15. Bad Boys
Hangar explosion
Bay made a full evolution from music-video director to explosive action director with this finale in Bad Boys. It plays like a chamber piece in the context of his oeuvre, with select explosions in this gunfight (featuring Martin Lawrence and Will Smith) brilliantly building tension, getting bigger and bigger with each dramatic development. Of course, the showiest explosion comes last, with the hangar’s destruction — marking the first of his many captivating wide shots where an entire landscape seems colored with Bay’s beloved bright, fiery orange.
14. Transformers
Final battle in Mission City
The final battle scene in the first Transformers movie finds Bay taking after the sci-fi spectacle of his executive producer and longtime validator, Steven Spielberg, mashing it up with his own brand of PG-13 chaos. With grounded emotional work from Shia LaBeouf and Megan Fox as they help secure the AllSpark for the Autobots, the scene finds a strength in limiting its robo-battling to a few streets. It’s even got some now-classic Bay product placement, like when a Mountain Dew vending machine turns into an evil robot. Looking back on this sequence, you can see how Bay’s inclination for practical destruction found a productive match with the CGI action of the Transformers.
13. Transformers
Decepticons attack on Qatar base
One of the first glances we get at the big ol’ baddie Transformers (a.k.a. Decepticons) arrives in this early scene, when a U.S. base is attacked by a Decepticon named Blackout. It’s an impressive mix of sonic booms and big hangar explosions, and presents a nighttime invasion that U.S. forces have no chance of winning. Add in some flying tanks that dozens of scurrying soldiers have to dodge, and it’s a succinct example of Bay’s destruction that subsequently makes for gripping filmmaking.
12. The Rock
San Francisco chase
One of Bay’s greatest car chases involves a Hummer (commandeered by Sean Connery) running away from a Ferrari (driven by Nicolas Cage) down San Francisco’s hilly streets. The carnage is so ruthless (even a water truck gets smashed up) that a trolley gets knocked off the tracks in its last moments, and then launched into the air in a big ball of fire; Cage’s Ferrari is finally crushed by the blown-up trolley as it rolls down the street. In one of Bay’s most iconic moments of comic relief, a random passerby says: “Hey man, you just fucked up your Ferrari.” To which a cool-as-ice Cage replies: “It’s not mine.”
11. Transformers: The Last Knight
Medieval explosions
The closest we’ve gotten to a Michael Bay medieval epic is the fifth (and, reportedly, his last) Transformers movie, Transformers: The Last Knight. In a cold open that’s meant to further explain the Transformers history within our world (as these movies like to do), Bay handles the Dark Ages in a way he’s most comfortable: big balls of orange fire from catapults hurtling through teal sky and explosions that dramatically eject people into the air in slow motion. This massive battle scene nonetheless sets the stage for Stanley Tucci in a big beard and clearly improvising for Bay’s IMAX 3-D cameras, playing a very drunk Merlin. This scene’s conclusion — which involves something of a Transformer dragon — only cements this brief moment as one of Bay’s stranger but more grandiose cinematic passages.
10. Bad Boys 2
Car-dodging highway chase
Bay’s movies have an affection for trucks, in large part because of the havoc they can cause. Case in point: the highway chase scene in Bad Boys 2, which has Mike and Marcus trying to dodge cars that are being off-loaded from a carrier truck on a busy highway. Bay makes it an in-your-face spectacle by sporadically putting the viewer in the front seat of different cars as automobiles barrel toward the camera. For good measure, Bay throws a boat into the mix for an explosive finishing touch, because car + boat = awesome explosion.
9. Pearl Harbor
Bombing of Pearl Harbor
You can imagine just how much a movie about Pearl Harbor would be a dream gig for Bay — free rein for his militaristic impulses and a duty to make sure the explosions are historically accurate. It’s no surprise, then, that Bay orchestrated one of his most iconic explosions ever toward the beginning of the invasion, starting with a shot that follows a bomb as it’s dropped on a U.S. warship. Seconds later, we see a grandiose wide shot of four warships exploding as planes fly by. Bay has said that the moment took three-and-a-half months to engineer, and that it required 12 cameras for what amounted to “about 30 seconds of film.” The result speaks for itself.
8. Transformers: Age of Extinction
Dogfight through Chicago
The fourth Transformers movie has a kind of manic quality that I love — namely the dogfight in the middle of the movie that happens through the Chicago skyline, with nicked buildings and explosions used as mere collateral damage. Mark Wahlberg (along with Jack Reynor) helps shoot at Decepticons using the Autobot artillery, and it inspires one of his strangest line readings: “These alien guns kick ass!” The scene ends on a perfect match of Bay’s beloved blue and orange — an exploding truck of Bud Light down in Chicago’s financial district. The scene gets even more gratuitous: There are close-ups on all the light-beer casualties, followed up by footage of Wahlberg aggressively drinking from one as American flags wave in the background.
7. Armageddon
Meteor attack on NYC
Michael Bay’s first scene of mass destruction in Armageddon starts with a Godzilla joke — a dog knocks over some dolls of the King of Monsters — and then he tries to the top Godzilla’s destruction with balls of fire from space. Yes, this is very well the type of bombastic spectacle that led Roger Ebert to call the film “an assault on the eyes, the ears, the brain, common sense, and the human desire to be entertained.” But in the context of Bay this is a grand achievement, with flaming cars launched into the New York air, and meteors blasting buildings (and even a bus) like a missile strike. Within the indulgence, Bay also has the audacity to present the Chrysler Tower falling needle-first, cementing himself as a bona fide disaster artist.
6. 6 Underground
Hong Kong penthouse destruction
Bay’s cinema would be nothing without intricate architecture to destroy and glass to break. In 6 Underground, his appetite for destruction finds a perfect castle, a glass-adorned penthouse apartment in Hong Kong, with a pool on the rooftop. You can probably guess all the ways that Bay and his characters renovate the space and its pool, but the scene gets an extra nervous charge from Ben Hardy’s parkour moves as he bounces around steel poles in the Hong Kong skyline. And using the THX introduction to break the high rise’s glass? That’s pure cinema.
5. Transformers: Age of Extinction
Dropping a steamboat from the sky
Even when telling grandiose action stories, Bay is a disaster-story filmmaker at heart, and every now and then finds an inspired way to destroy things on a massive scale. In Age of Extinction, a Decepticon named Lockdown uses a giant magnet on its ship to lift up cars, boats, and other massive stuff, just so it can drop it on the Hong Kong streets below. It’s like the ultimate Bay monster, and its way of picking up stuff and eventually dropping of different mobiles creates a great dramatic buildup. Case in point, when a steamboat hovers above a busy Hong Kong street, and then crashes down. In the words of Stanley Tucci’s agape character: “Oh myyy Goddd!”
4. Pain & Gain
Blowing up Kershaw
Pain & Gain, Bay’s 2013 riff on a Coen brothers–like yarn, has the least number of explosions of any of his movies. And yet it shows that Bayhem is not just a feat of spectacle, but a perspective. Take this pivotal scene, where wannabe millionaire and reckless juice-head Daniel Lugo (Mark Wahlberg) and his accomplices decide to kill a man (Tony Shalhoub’s Victor Kershaw) that they’ve just extorted. They try to make it look like Kershaw got into a drunk driving accident, sending his car into a tractor in a parking lot. But when that fails, Lugo takes a very Bay-esque approach to it — blow him up. That, of course, isn’t a sound fix to their problems, but they get an iconic “cool guys don’t look at explosions” shot in the process.
3. 6 Underground
Florence car chase
Bay shows off his new Netflix money in 6 Underground by kicking off the ensemble action-comedy with his best car chase yet. With a group of assassins (including lead Ryan Reynolds) crammed into a Day-Glo Alfa Romeo, it brings Bay back to the Bad Boys energy of fast action balanced with frantic comedy, punctuated with nasty moments when you can see crashed cars send bodies through windshields. It’s the kind of character-based, freewheeling chaos that Bay adores, and during its joy-riding through tight streets of Florence, he even throws in a Eurotrash version of Carl Orff’s “Carmina Burana” (and, because he can’t resist, a comic beat about Michelangelo’s David and his penis).
2. Transformers: Dark of the Moon
Optimus saves the day
Bay’s Transformers filming technique can sometimes amount to glorified exterior shots (blow stuff up, add robots later), but every now and then it creates a fleeting moment of grace. Case in point: Optimus’s big return during the Battle for Chicago in Transformers: Dark of the Moon, which finds Shia LaBeouf’s Sam Witwicky and Rosie Huntington-Whiteley’s Carly seeking cover at a bus station. Optimus glides through the impressive carnage on Chicago’s riverside Wacker Drive, holding both a sword and gun, slicing and shooting his way through Decepticons. All the while, cars bounce around, and a gauntlet of big explosions surrounds him. For all of Bay’s desires for grandiosity, it’s a genuinely harmonious passage for Bay’s often clashing sensibilities of size, motion, and destruction.
1. Bad Boys 2
Destroying a $40 million mansion
Even with all of his CGI robots and images of city-wide destruction, Bay’s pièce de résistance remains the third act of Bad Boys 2, featuring the destruction of a $40 million mansion, which gets torpedoed and then smashed by a yellow Hummer. The “Plan B” for Smith and Lawrence’s Mike and Marcus getting away comes in typical Bay fashion — a community-destroying downhill drive that barrels through a bunch of shacks (in a territory that’s meant to be Cuba). We get a clear idea of the car’s POV (say good-bye to the side-view mirror) and a wide view of its carnage, and it makes for eye-popping spectacle. Of course, this being one of Bay’s most expensive sequences, the Hummer is surrounded by explosions that go off as it blasts down a hill, as if this were a victory lap accompanied by Bay’s version of the all-American firework.
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();
// ]]