Five Top Showrunners Recount the Agony of Waiting for a Pilot Pickup
ByJosef Adalian,
who has covered the television industry since 1992and writes Buffering, a newsletter about streaming
Photo: David Clark/iStockphoto
The end of upfront week marks the conclusion of another incredibly torturous development season for the army of small screen writers and producers who had pilots commissioned. Every year, after submitting their finished products, this select group of creatives has to wait and agonize for anywhere from two weeks to a month over whether they will get the phone call that lets them know whether they’re headed to New York to bask in the celebratory glow of TV’s annual coming-out party — or if they’re staying at home to deal with the crushing reality that the last few months have been pretty much pointless. To find out just what development purgatory is like, Vulture rang up five veteran showrunners — The Shield’s Shawn Ryan, Lost’sDamon Lindelof, Gossip Girl’s Josh Schwartz, How I Met Your Mother’s Craig Thomas, and Community’s Neil Goldman — and asked them to take us through the four stages of stress as they recount their personal stories of acceptance and rejection.
Phase One: From Glee to Anxiety Networks collectively hear thousands of pitches and commission hundreds of pitches, but ultimately, each only makes between one and two dozen pilot episodes. Snagging a green light is thus not too far from winning the lottery, and at first, each project seems headed for the promised land of prime time. “When you’re picked up to pilot, everyone’s equally hot,” says Neil Goldman, the departing exec producer of Community whose first pilot project was Nobody’s Watching, a comedy he and partner Garrett Donovan created with Cougar Town’s Bill Lawrence for the now-dead WB network. A Hollywood newbie at the time, he recalls the rush he felt after the pilot was shot in front of a studio audience. “The execs from the WB were hugging me in the tape room and saying how great it went,” he says. “They even asked us to put together a presentation for the upfronts, which was exciting. At least until we found out that they asked everyone to put together a presentation.”
Craig Thomas was just 29 when he and Carter Bays co-created How I Met Your Mother. Not only was it their first pilot, but the former Late Show With David Letterman writers had only written a few one-off episodes of prime time at that point (American Dad and Quintuplets, if you’re curious). Like Goldman, Thomas and Bays’s first time through the development process was initially easier owing to the ignorance of youth. “We had this unfounded confidence-slash-arrogance that we were going to go,” Thomas says. “Because we liked it, of course it would go! I almost miss that now, being so young and dumb. We didn’t even try to make any cynical changes to the pilot to get them to order it.”
But for most people, the thrill of getting a pilot green light is quickly replaced by the work of making the damn thing. And then, once filming and initial editing is done, comes the encroaching realization and anxiety that it’s about to be judged. Long before a network president or focus group even sees the template, “You turn it in first to the drama team,” says Shawn Ryan (whose latest pilot, Last Resort, was just picked up by ABC). “You’re feeling nervous at that point: Are they going to like it? What are their notes going to be?”
Sometimes, a pilot is clearly blessed by the network early in the process, while sometimes things start to look grim even before production has finished. Josh Schwartz recalls that in 2003 Fox management seemed so determined to not only get his show The O.C. on the air, but to launch it during the summer, that even before the formal green light came, “We had hired writers and made a trailer so Fox execs” could make an early decision. By contrast, Damon Lindelof spent a good chunk of the filming of the Lost pilot wondering if ABC still even wanted the potential series. “[ABC chief] Lloyd Braun, who had been the champion of the show, left ABC about halfway through production,” Lindelof says. “And [replacement] Steve McPherson — and I’m not talking out of school; this is by his own admission — never understood Lost as a TV series. He was not the greatest fan of it, conceptually.” While Lindelof and J.J. Abrams were still in Hawaii, McPherson even called to ask if the men would consider shooting some extra footage so that the two-hour pilot could be aired as a stand-alone movie. “Our takeaway from that exchange was: This guy is not going to pick up the show,” Lindelof says.
Phase Two: The Waiting For most writers, the real stress of the season begins once a final cut is delivered and there’s nothing left to do but wait for the decision. “Easily the worst part is when you’ve addressed their notes … and now you realize you’ve got two weeks until you’re going to find out,” Ryan says. Sometimes the best strategy for staying sane is distraction: Thomas killed the wait time by taking his wife camping at the Grand Canyon. But woe unto the writer who consorts with others who are also waiting on a decision: In 1999, when Schwartz was just 22, the ink barely dry on his USC diploma, he managed to sell ABC a project called Brookfield, which featured both Amy Smart and Kal Penn (and did not get picked up). Schwartz, who remembers the waiting period after production wrapped as an “awful” month of angst and anxiety, says, “I went to college with [actress] Shiri Appleby, and she also was making a pilot that year. One day, she showed me her pilot and I showed her mine. Hers was Roswell, and when I saw it, I remember thinking, Oh, this is how you’re supposed to do a pilot. I asked her to leave right after, and then started to cry into a pillow.”
Confusing matters, many studios ask pilot producers to begin putting together a possible writing staff for a project even before it’s officially been ordered to series. “There’s a race [among pilots],” Ryan explains. “There are certain writers that a few different shows might want. You want to have a schedule in place so you can movie quickly. It becomes very competitive.” But it’s also awkward: “You’re in this weird position where you’re interviewing writers … but the person you’re talking to might end up working on a different show, and you’re going to be working on nothing,” Ryan says. “Your job is to prepare for a possible pickup. But it’s hard to have your heart in it because it might all be for naught.”
It should be noted that as bad as the broadcast development cycle can be, Ryan says cable can be even more stressful. While those networks don’t create shows on the same fixed schedule as broadcasters, and don’t make nearly as many pilots overall, the lack of a universal schedule means creators can be in limbo longer. “The Shield was easily the worse one for me,” he says of the iconic FX drama. “That was a two-month wait …. FX had two pilots, and they were going to pick up one. But there had to be approval from others, like [then News Corp. president] Peter Chernin. It took a whole month to get him to watch both pilots.” During these two months, Ryan started hearing buzz that FX brass at the time were pulling for another project, a drug cartel drama called Dope from writers Chris Brancato and Bert Salke. He recalls turning the producers of that pilot into his enemies, at least in his head: “I felt bad for hating them from afar during the pilot process,” Ryan laughs.
Phase Three: The Rumor Mill Networks begin watching all of their wannabes at once about ten days before upfront week, gathering together in small groups for screenings. Because there are so many different departments (sales, marketing, programming, research) all having different reactions and leaking them to the press, the buzz can sway wildly. Before the relatively recent proliferation of online scrutiny on the process by sites like Deadline (and, well, Vulture), producers hungry for hints as to their pilot’s prospects only had to obsess about the two main trade papers, Variety and The Hollywood Reporter. When Goldman’s Nobody’s Watching was in contention in 2005, “I remember we were listed as one of the pilots with buzz in Variety one day. And then they came out with another buzz report a few days later, and we weren’t listed.” In the current era of multiple trade websites racing to beat each other to post the latest probably-not-true tidbit about shows’ fates, it’s possible for producers to overdose on speculation. “You’re always asking, ‘What do you hear, what’s the rumor?’” Schwartz says. “You spend way too much time on the Internet trying to see what you can find out.” Adds Thomas: “It’s like you’re back in high school, and you want to hear any bit of gossip about yourself or other shows.”
Besides the Hollywood trades, producers tend to lean on their agents and their friends inside networks and studios to suss out the latest temperature check on pilots. But agents aren’t always reliable sources of information. Lindelof, in fact, briefly believed Lost had been passed on by ABC thanks to faulty intel supplied to him by his reps. “It was sometime on a Wednesday, and I was told by my agent that the show was dead,” he says. “There was an off chance that they would pick up six [episodes] and it would be a limited-run miniseries. But that was unlikely. That was on a Wednesday, and the ABC upfront was going to be on the following Tuesday. I remember this specifically because my agents were like, ‘Okay, now you’re out of work. Your pilot’s not going to go. We want to set you up on a couple of other meetings.’” Just two days later, Lindelof interviewed with future Showtime president David Nevins for a writing gig on what would become a short-lived Fox drama (The Inside). Just before their powwow, “My cell phone rang,” Lindelof says. “It was Heather Kadin, who was our exec at ABC and the woman who introduced J.J. to me. She said, ‘The testing just came in on Lost. It came in very well. I’m just telling you, not to get your hopes up, but because I think the show might have a second life and that six-episode thing might happen, probably midseason. But you didn’t hear it from me.’”
Phase Four: Getting The Call — Good or Bad Lindelof left Nevins’s office happy, of course, but he had yet to get the Call. This is the ideal final station of the development journey, the moment when somebody from the network tells producers they’ve won a berth on the prime-time lineup. For Lindelof, that conversation came just a few hours after his meeting with Nevins. “I went home, and I got a call from McPherson,” he says. “And J.J. was already on the line. He was like, ‘You’re coming to New York. You’re going to be on the air in September, thirteen episodes.’ It was a shock.”
“As a rule, the better the news the higher up the person who calls you,” says Ryan. Indeed, when Schwartz and his partner Stephanie Savage found out last week that The Carrie Diaries was green-lit by the CW, “We were having lunch with [Warner Bros. TV president] Peter Roth, and he got the call from [CW president] Mark Pedowitz,” he says. “He passed the phone around, and because we were with Peter, we all hugged.” Thomas actually heard about HIMYM getting a pickup from CBS Über-boss Leslie Moonves, though not directly. “I actually got the call from Matt Rice, our agent,” he says. “He had just been at a party in New York and ran into Moonves. And Les just whispered to Matt, ‘It’s a go.’ We were jumping up and down, popping Champagne.” This year, Bays and Thomas played the pilot slot machine again, selling The Goodwin Games to Fox. And this time, the Internet beat the Call. “Before we heard it from Fox, it was already up on Deadline,” Thomas says. “So we were sitting there, looking at the screen, trying to figure out if this was right or not. And they we got the call from [Fox chief] Kevin Reilly. I think he knew we already knew. He just started off with ‘congrats’ and then said, ‘See you in New York.’”
Inspiring stories of victory aside, the mathematical odds are that the news won’t be good: Networks rarely pick up more than 40 percent of their pilots to series, and in the case of successful nets like CBS, the number can be as few as four. Four years ago, Fox declined to order Ryan’s pilot The Oaks, a spooky ghost story starring future Oscar nominee Jeremy Renner. Because the project was produced during the middle of the 2008 Writers Guild of America strike, and he couldn’t be on set or in the editing suite during most of production, Ryan admits he wasn’t as “emotionally invested in it” as other pilots — and yet, he still felt the blow when Fox told him it was dead. “What really gets to you in these circumstances [is that] you put so much time and effort over six or eight months, and it almost feels unfair that nobody gets to see it,” he says. Goldman says when a pilot doesn’t get picked up to series, “You feel like an abject failure. It’s very depressing, because of all of the buildup. You go from being one of the very few scripts that gets green-lit to production into being dead.”
Sometimes someone from the network calls to deliver the thumbs-down (but never the president: they only deliver good news), and often it’s just left to the writers’ reps. Schwartz remembers that on his first project, Brookfield, his agents told him the show was dead. But soon after, the network’s travel department actually called “and asked me when I wanted to fly out,” he says. “I told them I didn’t think the show was on the schedule. They said, ‘No, we think it is,’ and said they’d look into it. But whoever called me from ABC travel never called me back.”
In the case of Nobody’s Watching, things were so down to the wire that production company NBC Studios actually paid for Goldman and his wife to fly to New York, just in case. “My wife and I got on the plane thinking things were looking good,” he remembers. “And when we landed, there was one voice mail on my phone. It was my partner saying, ‘The tide has turned.’” Things were looking dark, but there was still no decision from the WB. Goldman took his wife out to dinner, and, ironically, execs from NBC Studios happened to be at the same restaurant. “They paid for our meal, which was very nice,” he says. “And they kept telling us, ‘You’re not dead, you’re not dead.’” At one point, Goldman and Donovan actually got the call to go ahead and come to the WB’s upfront. But what they didn’t get was a call telling them the show was either picked up or dead. Instead, the WB announced its schedule, but without Goldman’s show. “The night we were supposed to be celebrating at the WB’s party, my wife and I were sitting in a Dairy Queen parking lot in suburban New York, having Blizzards,” Goldman recalls. The WB’s entertainment chief at the time, David Janollari, called the producers the next day to assure them that the project wasn’t dead and that he still wanted to find a way to give it a green light. “Till this day, nobody has ever called us to tell us we’re dead,” Goldman laughs. “So we’ll see. We’ll see!”
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()}});
}, {"3":3,"6":6,"17":17,"35":35,"40":40}];
window.modules["global-nav.client"] = [function(require,module,exports){"use strict";const dom=require(4),auth=require(17),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(3),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 i=t.querySelector(".dropdown");!n||t.contains(e.target)&&27!==e.keyCode||i.classList.remove("open")})}function gtmSendReport(e,n,t){let i={eventCategory:"ecommerce",eventAction:"componentClick",brand:e,dimension23:"global-nav",list:pageUri,pageZone:"header",variant:"nav-link"};"global-nav-link"===t&&(i.eventLabel=n.href),gtm.reportNow(i)}function updateElementTargetUrlsIfQueryStrings(e){if(searchString){const n=new URLSearchParams(searchString);let t=e.href;if(t.includes("?")){const i=t.split("?"),o=new URLSearchParams(i[1]);for(let e of n.entries())o.set(e[0],e[1]);t=`${i[0]}?${o.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()||auth.isMobileAppRequest())&&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;
}, {"3":3,"4":4,"17":17,"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();
// ]]