Albert Pyun is the recipient of Vulture’s first ever Stunt Award: Lifetime Achievement. Read about the winners of the inaugural celebration of stunt professionals here.
In 1990, J.D. Salinger’s son, Matt Salinger, strapped on a skintight red, white, and blue suit, pulled a matching rubber mask over his eyes and head, and fought a leather-trench-coat-wearing villain styled to look as though a thousand red crayons had melted over his head. In scene after scene, Salinger heaves an oversize Frisbee of a shield (that wasn’t yet the centerpiece of a billion-dollar franchise), flying to retrieve the thing when it mystically boomerangs back and logrolling behind it when enemies start shooting. The camera dynamically tracks his body as it crashes through flimsy sets and practical explosions, Salinger’s wooden smile masking the utter effort required to pull it all off. There’s an alchemy to the way the gunfire lights up a running figure, to how a close-up gives way to a panorama of combat. Made in the wake of Tim Burton’s Batman, this adaptation of Captain America has a beam of pre-VFX action-filmmaking vision sneaking through the bargain-basement entertainment façade.
If anyone could make peanuts seem like a five-course meal, it was Captain America director Albert Pyun, king of the bargain basement, a title that barely covers the Hawaii-born filmmaker’s massive influence on the B-movie genre over a five-decade-long career. Most reviews of his early Marvel movie are less than generous, but it’s hard to find a critic who didn’t acknowledge a certain charm to the way he prioritized the melodrama of a fight. He pored over the low-budget possibilities of three dozen movies, earning a reputation for making cheaply made sci-fi and apocalyptic stories sing with mesmerizing martial arts–kickboxing combos and audacious stunts. The Pyuniverse pulled in big names like Jean-Claude Van Damme and Charlie Sheen and Burt Reynolds, and launched unknowns: Long before John Wick, Chad Stahelski was the lead of a Pyun franchise sequel. His films were the experimental ground upon which a future of stylized action would be built.
Pyun began his career with 1982’s Sword and the Sorcerer, the only project for which he’d be given anything resembling a sizable production budget (reportedly $4 million). His résumé boasted little more than an assistantship with cinematographer Takao Saito and some commercial editing work when he ventured to Hollywood and pitched a fantasy epic around town. Financiers rejected him until the success of Excalibur made studios yearn for fast and efficient sword-and-sandal copycats. Sword and the Sorcerer, which Pyun directed and co-wrote,was right at home alongside pictures like Conan the Barbarian and Krull, its immersive world famously flecked with shocks of red and green, punctuating Pyun’s carefully choreographed swordplay. It isn’t the most stunt-heavy film, but it features just enough action to give a taste of what Pyun could practically do with bubblegum and shoestring. In a chaotic climax, Pyun’s lead (Lee Horsley) wields a three-bladed sword, swashbuckling through bad guys like a seasoned scrapper thanks to literal smoke and figurative mirrors (slow-motion technology) hiding the fact that Horsley couldn’t actually hack it. It’s commonplace for action directors to cut around leads who struggle with stunts, but here was Pyun, striving to make a stiff look like Errol Flynn.
The independently produced Sword and the Sorcerer — which earned over $36 million at the box office — would function as a calling card for Pyun’s talents going forward, but it would also become a source of heartbreak and frustration and a portent of what was to come. He clashed with Sword and the Sorcerer producers over money, scheduling, and creative control, his go-for-broke imagination straining against oversight. Tragedy struck Pyun’s set when stuntman Jack Tyree died after jumping off a cliff and missing his airbags, an accident that Pyun says traumatized him and forever shifted his perspective on stunt safety. “This movie sure looks great, but I’m not sure I could pass a quiz on what it’s about,” Roger Ebert wrote after Sword’s release. “Maybe it doesn’t matter.”
The magic of a Pyun picture, though, is that feeling of ideas bursting from the seams. He was a Zelig of sorts, an enigma of ’80s and ’90s filmmaking trends. Radioactive Dreams (1985) and Vicious Lips (1986) shimmered with excess in the glitz-and-glam era, merging his love of choreographing musical sequences with his penchant for action. (The best of martial arts can feel like a dance, and it’s a delight to see future American Ninja star Michael Dudikoff merge fistfights with a full-on dance finale.) When Hong Kong heroic bloodshed was all the rage, Cyborg (1989) and Nemesis (1992) packed the kind of gun ballet that would make John Woo blush. Pyun was on the fringes of the proto-superhero boom with Captain America and quietly at the forefront of the Blaxploitation resurgence with Ice-T collaborations Mean Guns (1997) and Crazy Six (1998). He even rode Andrew Dice Clay’s brief tidal wave of fame when he cast him in the delightful Big Trouble in Little China riff Brainsmasher … A Love Story (1993).
Like fellow gonzo filmmakers Ed Wood and Roger Corman, Pyun’s ingenuity fought valiantly against the inevitable limitations of direct-to-video projects (and many of his films were, though some managed to eke out a limited theatrical release). If he was only permitted one location to film, you better believe he’d wear out every camera angle in the book to transform a drab warehouse into a kaleidoscope of action backdrops. If money ran out on Nemesis 3, Pyun would puzzle-piece B-roll from the previous installment and, voilà, a completed movie. (In fact, two completed movies: He made Nemesis 3 and Nemesis 4 from the same shoot.) And he didn’t strive to be a one-man show: Pyun was able to turn throwaway future-shock concepts into action pictures that look more energetic than films made today with a careful casting of below-the-line talent.
Take Cyborg, a Van Damme vehicle shot on the abandoned sets of films that never were, like Masters of the Universe 2 and Cannon Films’ Spider-Man. The film is rendered in Mad Max–ian oranges and tans, thanks to frequent Pyun collaborator and DP Philip Alan Waters. Director Sheldon Lettich (Bloodsport, Lionheart) stepped in as editor, giving the work a peppy sense of urgency. JCVD’s fights are framed like works of art, each gorgeous kick landing like a stroke of paint courtesy of stunt lifers like Jophery C. Brown and Tom Elliott. Unlike most of JCVD’s filmography, Pyun’s movie seemed to be rebelling against the idea that the actor had to always be fighting, putting him on the run, in captivity, strung up, Christ-like. Pyun admitted that apocalyptic stories weren’t all that interesting to him, but their sets — abandoned refineries and warehouses — pulled him in as the perfect empty containers for spectacle. After all his restraint, Pyun shoots the hell out of JCVD’s final fight with the big bad Vincent Klyn, both men shirtless and drenched by rain, engaged in a Sergio Leone–esque staredown before going to war. Each thudding blow crashes with the fury of a tidal wave, and when JCVD is thrown through a windshield, Pyun deploys slo-mo for maximum impact. It ends up playing like a big-budget power-ballad music video.
As frustrating as the money guys found him, Pyun’s infectious enthusiasm seemed to rub off on the people he worked with. Picture the psychotic grin of Christopher Lambert’s character in Mean Guns but on the faces of a crew not in it for the payday or the massive audience (they’d get neither), but the ecstatic experience of truly playing make-believe. Stunt professionals, in particular, were drawn to Pyun’s sets, considered spaces where they could practice their art freely: Benny “The Jet” Urquidez, Bob Brown, Chad Stahelski. Stahelski starred as Nebula, the main villain of Nemesis 2, a sequel to the cyborg-cop drama that put French martial artist Olivier Gruner in the middle of a war between humans and machines. Pyun and his team (stunt go-tos like Brown, Sven-Ole Thorsen, Pat Banta, Dwayne McGee) were firing on all cylinders by this franchise. In one moment in the original Nemesis, Gruner is barricaded in a bathroom, using a machine gun to shoot a Looney Tunes–esque circle around himself in order to fall through multiplestories to safety. In another, Gruner and a villain barrel down a mudslide, their bodies crashing so gymnically it would be astonishing to see it in a $100 million picture, let alone a $2 million one. Toward the climax, Pyun has the audacity to flip and then explode a massive tanker, not unlike the famous Dark Knight set piece. (The Dark Knight co-writer David Goyer also wrote two Albert Pyun films: Arcade and Kickboxer 2.) It’s not just that you’re asking how they did these scenes on a tiny budget; you’re asking how they did it at all.
By Nebula 2, Stahelski — who would go on to work on The Matrix series, co-found the stunt and production house 87eleven, and direct the John Wick franchise — had appeared in or worked on multiple Pyun films, including Brainsmasher, Heatseeker, Hong Kong ’97,and Spitfire. His Nebula, a cyborg bounty hunter, chases Gruner’s character — by this point a woman, played by a positively jacked Sue Price. The film itself is a prolonged chase sequence culminating in one of Pyun’s more astonishing creations. Sue Price’s Alex, holding a goon, falls from a massive structure and shoots through the man she’s holding. Stahelski’s Nebula plummets next to her — on fire, because of course he is — and their shared descent is cut to seem longer than is physically possible. Tom Cruise’s characters have made leaping from buildings feel pedestrian, but in 1995, there was a wild dissonance at work. The stunt clearly had so little money behind it, and yet Pyun’s team pulled it off.
The human body simply intoxicated Pyun. When he wasn’t throwing it off buildings, he was lavishly displaying its musculature, the traps and biceps of martial artists and bodybuilders glistening impossibly against a litany of dystopian backdrops. Across the Nemesis series, as well as Knights (1993) and Raven Hawk (1996), Pyun would cast women far more brawny than their male colleagues, letting his camera unabashedly fixate on their presence. He seemed to be in genuine awe of people in peak physical condition, sometimes preferring an astonishing physique to an ability to act. As Price glides across a desert landscape for 83 glorious minutes in Nemesis 2, Pyun underscores a basic cinematic principle: Audiences want to see beautiful people doing the impossible. By Nemesis 4 (1996), our lead is a full-on nude assassin, muscles exploding from every inch of her body as she kills every man who wrongs her.
After the turn of the century, as most corners of Hollywood faced a tightening of purse strings in the face of a looming recession, little was left for the direct-to-video filmmakers like Pyun. He would eventually embrace green screen as a safer, suddenly more cost-effective way to depict his exciting imagination, and as an acknowledgment, of sorts, that his heyday was fading. With those halcyon days of practical explosions and cartoonlike action gags in the industry’s rearview, Pyun did what he always did: moved on with the times. He funded the lion’s share of his later films himself, including the bizarre sequel to Walter Hill’s Streets of Fire called The Road to Hell (2008), which shares more aesthetically with works like Sin City or The Spirit, forgoing wild stunts for an uncanny valley of mostly idling characters. He stayed busy all the way to 2018’s Interstellar Civil War: Shadows of the Empire, and rumblings of new films persisted all the way until his death in 2022.
Pyun was never recognized by major awards-bestowing organizations in his lifetime, though genre fans championed him at festivals and conferences, on YouTube channels that canonized good “bad” movies, and on Action Twitter, where clips of the stunt work in Nemesis often elicited shock and awe. Pyun maintained a Facebook page for his dedicated fans, where he shared videos of himself talking about his films (he rarely gave interviews otherwise). Filmmaker and author Justin Decloux was one of the first to officially lionize Pyun in his 2019 book, Radioactive Dreams: The Cinema of Albert Pyun, writing that he was “blown away by Pyun’s wildly energetic filmmaking style and his take on John Woo action mixed in with a goofy cyberpunk aesthetic.” He points specifically to Pyun’s knack for secretly making a film while shooting pickups for another, his preference for filming on busy streets without permits to get the perfect shot, and his tendency to work with the same actors and technical team. “To me, Pyun didn’t sound like a hack at all,” Decloux writes. “He sounded like a driven filmmaker who fought tooth and nail for every project.” Imagine what he could have done if he didn’t have to fight.
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();
// ]]